Add Consumable Items (#62)

Changes:
 + add Quantity value for items
 + add plus and minus buttons for list
 + add roll button if item contains formulas
 + decrease quantity by 1 if rolled
This commit is contained in:
2023-12-15 21:34:32 +01:00
committed by GitHub
parent c313d3448c
commit bfa51605bc
4 changed files with 82 additions and 0 deletions
+10
View File
@@ -171,7 +171,15 @@ export class M5Character extends Actor {
if (item.system.magic) {
label += "*";
}
let rollable = false;
// console.log(item.system.rolls.formulas.map((p) => p.enabled));
for (let key in item.system.rolls.formulas) {
rollable = item.system.rolls.formulas[key].enabled;
if (rollable) {
break;
}
}
ret.gear.items[item.id] = {
label: label,
magic: item.system.magic,
@@ -179,6 +187,8 @@ export class M5Character extends Actor {
equipped: item.system?.equipped,
value: item.system.value || 0,
currency: item.system.currency || "",
quantity: item.system.quantity || 0,
rollExist: rollable,
};
});
}