[Fix] V13 - Companion Fixes (#1840)

* Fixed companion initial max stress. Cleaned up prepareData flow

* Clamped adversary resources
This commit is contained in:
WBHarry 2026-04-26 11:20:20 +02:00 committed by GitHub
parent cfd9950aae
commit 3157fd450f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 24 additions and 21 deletions

View file

@ -660,6 +660,8 @@ export default class DhCharacter extends DhCreature {
prepareDerivedData() {
super.prepareDerivedData();
this.resources.hope.max -= this.scars;
if (this.companion) {
for (let levelKey in this.companion.system.levelData.levelups) {
const level = this.companion.system.levelData.levelups[levelKey];
@ -673,7 +675,6 @@ export default class DhCharacter extends DhCreature {
}
}
this.resources.hope.max -= this.scars;
this.attack.roll.trait = this.rules.attack.roll.trait ?? this.attack.roll.trait;
this.resources.armor = {
@ -684,6 +685,9 @@ export default class DhCharacter extends DhCreature {
};
this.attack.damage.parts[0].value.custom.formula = `@prof${this.basicAttackDamageDice}${this.rules.attack.damage.bonus ? ` + ${this.rules.attack.damage.bonus}` : ''}`;
// Clamp resources (must be done last to ensure all updates occur)
this.resources.clamp();
}
getRollData() {