diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 5ae7d227b3c..27c4edea297 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1107,7 +1107,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { */ getSpeciesForm(ignoreOverride?: boolean, useIllusion: boolean = false): PokemonSpeciesForm { const species: PokemonSpecies = useIllusion && !!this.summonData?.illusion ? getPokemonSpecies(this.summonData?.illusion.species) : this.species; - const formIndex: integer = useIllusion && !!this.summonData?.illusion ? this.summonData?.illusion.formIndex : this.formIndex; if (!ignoreOverride && this.summonData?.speciesForm) { @@ -5282,13 +5281,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { sceneOverride?: BattleScene, ): AnySound { const scene = sceneOverride ?? globalScene; // TODO: is `sceneOverride` needed? - const cry = this.getSpeciesForm().cry(soundConfig); + const cry = this.getSpeciesForm(undefined, true).cry(soundConfig); let duration = cry.totalDuration * 1000; if ( this.fusionSpecies && - this.getSpeciesForm() !== this.getFusionSpeciesForm() + this.getSpeciesForm(undefined, true) !== this.getFusionSpeciesForm(undefined, true) ) { - let fusionCry = this.getFusionSpeciesForm().cry(soundConfig, true); + let fusionCry = this.getFusionSpeciesForm(undefined, true).cry(soundConfig, true); duration = Math.min(duration, fusionCry.totalDuration * 1000); fusionCry.destroy(); scene.time.delayedCall(fixedInt(Math.ceil(duration * 0.4)), () => { @@ -5298,7 +5297,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { cry, fixedInt(Math.ceil(duration * 0.2)), ); - fusionCry = this.getFusionSpeciesForm().cry( + fusionCry = this.getFusionSpeciesForm(undefined, true).cry( Object.assign( { seek: Math.max(fusionCry.totalDuration * 0.4, 0) }, soundConfig, diff --git a/test/abilities/illusion.test.ts b/test/abilities/illusion.test.ts index aa77aa701b2..bdb235f458b 100644 --- a/test/abilities/illusion.test.ts +++ b/test/abilities/illusion.test.ts @@ -7,6 +7,7 @@ import { Moves } from "#enums/moves"; import { Abilities } from "#enums/abilities"; import { PokeballType } from "#app/enums/pokeball"; import { Gender } from "#app/data/gender"; +import { BerryPhase } from "#app/phases/berry-phase"; describe("Abilities - Illusion", () => { let phaserGame: Phaser.Game; @@ -66,7 +67,7 @@ describe("Abilities - Illusion", () => { expect(!!zorua.summonData?.illusion).equals(false); }); - it("break if the ability is suppressed", async () => { + it("break with neutralizing gas", async () => { game.override.enemyAbility(Abilities.NEUTRALIZING_GAS); await game.classicMode.startBattle([Species.KOFFING]);