[Feature] 1383 - Companion Bonus Levelups (#1565)

* Fixed so that companions can get bonus levelupchoices from their partner

* Fixed collection prep order

* Added ActiveEffects to Beastbound features

* Corrected styling

* Added migration for overleveled companions

* Raised version

* Moved migration to 1.6.0. Sillyness
This commit is contained in:
WBHarry 2026-01-25 15:21:06 +01:00 committed by GitHub
parent c42f876d4f
commit ce96ffa0a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 551 additions and 18 deletions

View file

@ -662,6 +662,11 @@ export default class DhCharacter extends BaseDataActor {
const globalHopeMax = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).maxHope;
this.resources.hope.max = globalHopeMax - this.scars;
this.resources.hitPoints.max += this.class.value?.system?.hitPoints ?? 0;
/* Companion Related Data */
this.companionData = {
levelupChoices: this.levelData.level.current - 1
};
}
prepareDerivedData() {
@ -733,6 +738,16 @@ export default class DhCharacter extends BaseDataActor {
};
}
}
/* Force companion data prep */
if (this.companion) {
if (
changes.system?.levelData?.level?.current !== undefined &&
changes.system.levelData.level.current !== this._source.levelData.level.current
) {
this.companion.update(this.companion.toObject(), { diff: false, recursive: false });
}
}
}
async _preDelete() {