From 1376ea4e8711300f1aa83a82665d7e073adda97f Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 23 Apr 2024 22:16:49 -0400 Subject: [PATCH] Fix initial starters not having first ability unlocked --- src/system/game-data.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/system/game-data.ts b/src/system/game-data.ts index 0c176e446..c5e6dce29 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -348,6 +348,7 @@ export class GameData { if ([ '1.0.0', '1.0.1' ].includes(systemData.gameVersion)) this.migrateStarterAbilities(systemData); this.fixVariantData(systemData); + this.fixStarterData(systemData); // Migrate ability starter data if empty for caught species Object.keys(systemData.starterData).forEach(sd => { if (systemData.dexData[sd].caughtAttr && !systemData.starterData[sd].abilityAttr) @@ -984,7 +985,7 @@ export class GameData { moveset: null, eggMoves: 0, candyCount: 0, - abilityAttr: 0, + abilityAttr: defaultStarterSpecies.includes(speciesId) ? AbilityAttr.ABILTIY_1 : 0, passiveAttr: 0, valueReduction: 0 }; @@ -1291,4 +1292,9 @@ export class GameData { } } } + + fixStarterData(systemData: SystemSaveData): void { + for (let starterId of defaultStarterSpecies) + systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1; + } } \ No newline at end of file