[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

@ -212,6 +212,7 @@ export async function runMigrations() {
}
if (foundry.utils.isNewerVersion('1.5.5', lastMigrationVersion)) {
/* Clear out Environments that were added directly from compendium */
for (const scene of game.scenes) {
if (!scene.flags.daggerheart) continue;
const systemData = new game.system.api.data.scenes.DHScene(scene.flags.daggerheart);
@ -226,6 +227,25 @@ export async function runMigrations() {
lastMigrationVersion = '1.5.5';
}
if (foundry.utils.isNewerVersion('1.6.0', lastMigrationVersion)) {
/* Delevel any companions that are higher level than their partner character */
for (const companion of game.actors.filter(x => x.type === 'companion')) {
if (companion.system.levelData.level.current <= 1) continue;
if (!companion.system.partner) {
await companion.updateLevel(1);
} else {
const endLevel = companion.system.partner.system.levelData.level.current;
if (endLevel < companion.system.levelData.level.current) {
companion.system.levelData.level.changed = companion.system.levelData.level.current;
await companion.updateLevel(endLevel);
}
}
}
lastMigrationVersion = '1.6.0';
}
//#endregion
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);