diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 55e21ae928b..a67a09df74a 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -115,7 +115,10 @@ export class SpeciesFormChange { formIndexes.push(pokemon.fusionFormIndex); } - const formMatch = [true, true]; + const formMatch = [true]; + if (pokemon.isFusion()) + formMatch.push(true); + for (let i = 0; i < speciesArray.length; ++i) { const species = speciesArray[i]; const formIndex = formIndexes[i]; diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 2df8748a9fa..886e2f12f70 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1660,8 +1660,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } changeForm(formChange: SpeciesFormChange): Promise { + const matchesBase = this.species.speciesId == formChange.speciesId; + return new Promise(resolve => { - this.formIndex = Math.max(this.species.forms.findIndex(f => f.formKey === formChange.formKey), 0); + const newFormIndex = Math.max((matchesBase ? this.species : this.fusionSpecies).forms.findIndex(f => f.formKey === formChange.formKey), 0); + if (matchesBase) + this.formIndex = newFormIndex; + else + this.fusionFormIndex = newFormIndex; + this.generateName(); const abilityCount = this.getSpeciesForm().getAbilityCount(); if (this.abilityIndex >= abilityCount) // Shouldn't happen