From b5b75aa2c63e47d4dc9feb23ccaafbf089ee14a1 Mon Sep 17 00:00:00 2001 From: Byroks Date: Mon, 15 Jan 2024 14:15:30 +0100 Subject: [PATCH] #18 Remove ContainerId from containers (#29) Changes + remove containerId variable from containers as it's not needed Reviewed-on: https://git.byroks.de/MidgardVTT-Entwicklung/foundry-vtt-system-midgard5/pulls/29 Reviewed-by: oskaloq --- source/module/actors/M5Character.ts | 43 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index be1be10..3a23ab5 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -145,11 +145,10 @@ export class M5Character extends Actor { ret.stats.perceptionFW = 6; ret.stats.drinking = this.modResult(0); ret.stats.drinkingFW = Math.floor(ret.attributes.ko.value / 10); - ret.stats.hoardMin = M5Character.levelThreshold.at (ret.level - 1)/2; - ret.stats.hoardNext = M5Character.levelThreshold.at (ret.level)/2; - ret.stats.wealth = data.info.gold + data.info.silver/10 + data.info.copper/100; + ret.stats.hoardMin = M5Character.levelThreshold.at(ret.level - 1) / 2; + ret.stats.hoardNext = M5Character.levelThreshold.at(ret.level) / 2; + ret.stats.wealth = data.info.gold + data.info.silver / 10 + data.info.copper / 100; ret.stats.hoard = 0; - if (!skip?.mods) { const aggregate = new M5ModAggregate(data, ret); @@ -177,14 +176,14 @@ export class M5Character extends Actor { let label = item.name; if (item.system.magic) { label += "*"; - }; - if (item.system.valuable) { + } + if (item.system.valuable) { ret.stats.wealth += item.system.value || 0; - }; + } if (item.system.hoarded) { ret.stats.hoard += item.system.value || 0; } - + let icon = item.img; let rollable = false; @@ -195,7 +194,7 @@ export class M5Character extends Actor { break; } } - + ret.gear.items[item.id] = { label: label, icon: icon, @@ -243,13 +242,11 @@ export class M5Character extends Actor { calc: item.system.calc, equipped: item.system?.equipped, weight: item.system.weight || 0, - containerId: item.system.containerId || "", value: item.system.value || 0, currency: item.system.currency || "", quantity: item.system.quantity || 0, rollExist: rollable, }; - }); } @@ -262,8 +259,8 @@ export class M5Character extends Actor { let label = item.name; if (item.system.magic) { label += "*"; - }; - + } + ret.gear.effects[item.id] = { label: label, magic: item.system.magic, @@ -306,21 +303,21 @@ export class M5Character extends Actor { (item.system.stats.damageBonus < 0 ? "" : "+") + item.system.stats.damageBonus + ")"; - }; + } if (item.system.valuable) { ret.stats.wealth += item.system.value || 0; - }; + } if (item.system.hoarded) { ret.stats.hoard += item.system.value || 0; } - + ret.gear.weapons[item.id] = { label: label, skillId: item.system.skillId, magic: item.system.magic, valuable: item.system?.valuable, hoarded: item.system?.hoarded, - value: item.system.value || 0, + value: item.system.value || 0, calc: item.system.calc, }; }); @@ -335,14 +332,14 @@ export class M5Character extends Actor { let label = item.name; if (item.system.magic) { label += "*(" + (item.system.stats.defenseBonus < 0 ? "" : "+") + item.system.stats.defenseBonus + ")"; - }; + } if (item.system.valuable) { ret.stats.wealth += item.system.value || 0; - }; + } if (item.system.hoarded) { ret.stats.hoard += item.system.value || 0; } - + ret.gear.defensiveWeapons[item.id] = { label: label, skillId: item.system.skillId, @@ -364,14 +361,14 @@ export class M5Character extends Actor { let label = item.name; if (item.system.magic) { label += "*"; - }; + } if (item.system.valuable) { ret.stats.wealth += item.system.value || 0; - }; + } if (item.system.hoarded) { ret.stats.hoard += item.system.value || 0; } - + ret.gear.armor[item.id] = { label: label, magic: item.system.magic,