[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

@ -130,9 +130,6 @@ export default class DhCompanion extends DhCreature {
const level = this.levelData.levelups[levelKey];
for (let selection of level.selections) {
switch (selection.type) {
case 'hope':
this.resources.hope += selection.value;
break;
case 'vicious':
if (selection.data[0] === 'damage') {
this.attack.damage.parts[0].value.dice = adjustDice(this.attack.damage.parts[0].value.dice);
@ -167,6 +164,9 @@ export default class DhCompanion extends DhCreature {
return acc;
}, this.partner.system.companionData.levelupChoices);
}
// Clamp resources (must be done last to ensure all updates occur)
this.resources.clamp();
}
async _preUpdate(changes, options, userId) {