Fix encombrement herbes
This commit is contained in:
parent
df45c4bbbb
commit
a13b9f9c56
@ -3,6 +3,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
||||
|
||||
const typesObjetsEquipement = ["objet", "arme", "armure", "conteneur", "herbe", "ingredient", "livre", "potion", "munition", "nourritureboisson", "monnaie"];
|
||||
const typesObjetsOeuvres = ["oeuvre", "recettecuisine", "musique", "chant", "danse", "jeu"];
|
||||
const encBrin = 0.00005;
|
||||
/* -------------------------------------------- */
|
||||
export class RdDItem extends Item {
|
||||
|
||||
@ -24,14 +25,24 @@ export class RdDItem extends Item {
|
||||
_calculsEquipement() {
|
||||
const tplData = Misc.templateData(this);
|
||||
const quantite = Misc.data(this).type == 'conteneur' ? 1 : (tplData.quantite ?? 0);
|
||||
if (tplData.encombrement != undefined) {
|
||||
tplData.encTotal = Math.max(tplData.encombrement, 0) * quantite;
|
||||
const enc = this.getEnc();
|
||||
if (enc != undefined) {
|
||||
tplData.encTotal = Math.max(enc, 0) * quantite;
|
||||
}
|
||||
if (tplData.cout != undefined) {
|
||||
tplData.prixTotal = Math.max(tplData.cout, 0) * quantite;
|
||||
}
|
||||
}
|
||||
|
||||
getEnc() {
|
||||
const itemData = Misc.data(this);
|
||||
switch (itemData.type)
|
||||
{
|
||||
case 'herbe':
|
||||
return encBrin;
|
||||
}
|
||||
return itemData.data.encombrement
|
||||
}
|
||||
|
||||
isConsommable(options = { warnIfNot: true }) {
|
||||
const itemData = Misc.data(this);
|
||||
|
Loading…
Reference in New Issue
Block a user