From 24426bb24863ac334b8837d2e991e759266cb64c Mon Sep 17 00:00:00 2001 From: Byroks Date: Mon, 5 Feb 2024 13:29:29 +0100 Subject: [PATCH] =?UTF-8?q?HotFix=20nicht=20=C3=B6ffenbare=20Charaktere?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes: + Currency hat bei (fast) allen Items gefehlt weswegen das Charakterblatt nicht mehr öffenbar war, nachdem man Wert und Currency eingetragen hat. + Beachte Menge für Vermögensrechnung + Hort rechnung beachtet jetzt Currency --- source/module/actors/M5Character.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/source/module/actors/M5Character.ts b/source/module/actors/M5Character.ts index 2fb4d88..72335ca 100644 --- a/source/module/actors/M5Character.ts +++ b/source/module/actors/M5Character.ts @@ -178,10 +178,10 @@ export class M5Character extends Actor { label += "*"; } if (item.system.valuable) { - ret.stats.wealth += this.calculateValue(item.system.value, item.system.currency); + ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } if (item.system.hoarded) { - ret.stats.hoard += item.system.value || 0; + ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } let icon = item.img; @@ -303,10 +303,10 @@ export class M5Character extends Actor { ")"; } if (item.system.valuable) { - ret.stats.wealth += this.calculateValue(item.system.value, item.system.currency); + ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } if (item.system.hoarded) { - ret.stats.hoard += item.system.value || 0; + ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } ret.gear.weapons[item.id] = { @@ -316,6 +316,7 @@ export class M5Character extends Actor { valuable: item.system?.valuable, hoarded: item.system?.hoarded, value: item.system.value || 0, + currency: item.system.currency || "", calc: item.system.calc, special: item.system.special, damageBase: item.system.damageBase, @@ -336,10 +337,10 @@ export class M5Character extends Actor { label += "*(" + (item.system.stats.defenseBonus < 0 ? "" : "+") + item.system.stats.defenseBonus + ")"; } if (item.system.valuable) { - ret.stats.wealth += this.calculateValue(item.system.value, item.system.currency); + ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } if (item.system.hoarded) { - ret.stats.hoard += item.system.value || 0; + ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } ret.gear.defensiveWeapons[item.id] = { @@ -349,6 +350,7 @@ export class M5Character extends Actor { valuable: item.system?.valuable, hoarded: item.system?.hoarded, value: item.system.value || 0, + currency: item.system.currency || "", defenseBonus: item.system.stats.defenseBonus, calc: item.system.calc, equipped: item.system?.equipped, @@ -368,10 +370,10 @@ export class M5Character extends Actor { label += "*"; } if (item.system.valuable) { - ret.stats.wealth += this.calculateValue(item.system.value, item.system.currency); + ret.stats.wealth += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } if (item.system.hoarded) { - ret.stats.hoard += item.system.value || 0; + ret.stats.hoard += this.calculateValue(item.system.value * item.system.quantity, item.system.currency); } ret.gear.armor[item.id] = { @@ -380,6 +382,7 @@ export class M5Character extends Actor { valuable: item.system?.valuable, hoarded: item.system?.hoarded, value: item.system.value || 0, + currency: item.system.currency || "", lpProtection: item.system.lpProtection, calc: item.system.calc, equipped: item.system?.equipped,