Fix initial starters not having first ability unlocked

This commit is contained in:
Flashfyre 2024-04-23 22:16:49 -04:00
parent ba71d2750b
commit 1376ea4e87
1 changed files with 7 additions and 1 deletions

View File

@ -348,6 +348,7 @@ export class GameData {
if ([ '1.0.0', '1.0.1' ].includes(systemData.gameVersion)) if ([ '1.0.0', '1.0.1' ].includes(systemData.gameVersion))
this.migrateStarterAbilities(systemData); this.migrateStarterAbilities(systemData);
this.fixVariantData(systemData); this.fixVariantData(systemData);
this.fixStarterData(systemData);
// Migrate ability starter data if empty for caught species // Migrate ability starter data if empty for caught species
Object.keys(systemData.starterData).forEach(sd => { Object.keys(systemData.starterData).forEach(sd => {
if (systemData.dexData[sd].caughtAttr && !systemData.starterData[sd].abilityAttr) if (systemData.dexData[sd].caughtAttr && !systemData.starterData[sd].abilityAttr)
@ -984,7 +985,7 @@ export class GameData {
moveset: null, moveset: null,
eggMoves: 0, eggMoves: 0,
candyCount: 0, candyCount: 0,
abilityAttr: 0, abilityAttr: defaultStarterSpecies.includes(speciesId) ? AbilityAttr.ABILTIY_1 : 0,
passiveAttr: 0, passiveAttr: 0,
valueReduction: 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;
}
} }