[Bug] Unlocking correct base form of Zygarde when captured (#5453)

This commit is contained in:
Wlowscha 2025-03-01 20:33:31 +01:00 committed by GitHub
parent 89e8085c39
commit c7df847e66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 5 deletions

View File

@ -1645,11 +1645,19 @@ export class GameData {
} else if (formIndex === 3) { } else if (formIndex === 3) {
dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(1); dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(1);
} }
} } else if (pokemon.species.speciesId === Species.ZYGARDE) {
const allFormChanges = pokemonFormChanges.hasOwnProperty(species.speciesId) ? pokemonFormChanges[species.speciesId] : []; if (formIndex === 4) {
const toCurrentFormChanges = allFormChanges.filter(f => (f.formKey === formKey)); dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(2);
if (toCurrentFormChanges.length > 0) { } else if (formIndex === 5) {
dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(0); dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(3);
}
} else {
const allFormChanges = pokemonFormChanges.hasOwnProperty(species.speciesId) ? pokemonFormChanges[species.speciesId] : [];
const toCurrentFormChanges = allFormChanges.filter(f => (f.formKey === formKey));
if (toCurrentFormChanges.length > 0) {
// Needs to do this or Castform can unlock the wrong form, etc.
dexEntry.caughtAttr |= globalScene.gameData.getFormAttr(0);
}
} }
} }