diff --git a/src/main.mjs b/src/main.mjs index 3ad47c3..3d87828 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -442,11 +442,7 @@ class DSA41_CharacterData extends TypeDataModel { this.computed.attacke.basiswert = Math.round((this.computed.attributes_without_modifiers.courage + this.computed.attributes_without_modifiers.agility + this.computed.attributes_without_modifiers.strength) / 5); this.computed.parade.basiswert = Math.round((this.computed.attributes_without_modifiers.intuition + this.computed.attributes_without_modifiers.agility + this.computed.attributes_without_modifiers.strength) / 5); this.computed.fernkampf.basiswert = Math.round((this.computed.attributes_without_modifiers.intuition + this.computed.attributes_without_modifiers.dexterity + this.computed.attributes_without_modifiers.strength) / 5); - - this.computed.initiative.wert = this.computed.initiative.basiswert + this.modifikator_initiative; - this.computed.attacke.wert = this.computed.attacke.basiswert + this.modifikator_attacke; - this.computed.parade.wert = this.computed.parade.basiswert + this.modifikator_parade; - this.computed.fernkampf.wert = this.computed.fernkampf.basiswert + this.modifikator_fernkampf; + const equipped_ruestungen = this.parent.items.filter((x) => x.type === "Ruestung" && x.system.angelegt === true); for (const item of equipped_ruestungen) { @@ -464,6 +460,11 @@ class DSA41_CharacterData extends TypeDataModel { this.computed.kampf.ruestungen_gesamt.gesamt_behinderung += item.system.gesamt_behinderung; } + this.computed.initiative.wert = this.computed.initiative.basiswert + this.modifikator_initiative - this.computed.kampf.ruestungen_gesamt.gesamt_behinderung; + this.computed.attacke.wert = this.computed.attacke.basiswert + this.modifikator_attacke; + this.computed.parade.wert = this.computed.parade.basiswert + this.modifikator_parade; + this.computed.fernkampf.wert = this.computed.fernkampf.basiswert + this.modifikator_fernkampf; + for (let [key, value] of Object.entries(this.computed.kampf.ruestungen_gesamt)) { this.computed.kampf.ruestungen_gesamt[key] = Math.round(value); }