From 2f68791021e37275bd3c9bf887d855e14c5097bf Mon Sep 17 00:00:00 2001 From: frutescens Date: Sun, 20 Oct 2024 16:46:17 -0700 Subject: [PATCH] done? for now? --- src/test/abilities/mimicry.test.ts | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/test/abilities/mimicry.test.ts b/src/test/abilities/mimicry.test.ts index 3b442491d36..a4c6cad496e 100644 --- a/src/test/abilities/mimicry.test.ts +++ b/src/test/abilities/mimicry.test.ts @@ -57,11 +57,11 @@ describe("Abilities - Mimicry", () => { .enemyMoveset([ Moves.SPLASH, Moves.PSYCHIC_TERRAIN ]); await game.classicMode.startBattle([ Species.REGIELEKI ]); - const playerPokemon1 = game.scene.getPlayerPokemon(); + const playerPokemon = game.scene.getPlayerPokemon(); game.move.select(Moves.TRANSFORM); await game.forceEnemyMove(Moves.PSYCHIC_TERRAIN); await game.toNextTurn(); - expect(playerPokemon1?.getTypes().includes(Type.PSYCHIC)).toBe(true); + expect(playerPokemon?.getTypes().includes(Type.PSYCHIC)).toBe(true); if (game.scene.arena.terrain) { game.scene.arena.terrain.turnsLeft = 1; @@ -70,6 +70,26 @@ describe("Abilities - Mimicry", () => { game.move.select(Moves.SPLASH); await game.forceEnemyMove(Moves.SPLASH); await game.toNextTurn(); - expect(playerPokemon1?.getTypes().includes(Type.ELECTRIC)).toBe(true); + expect(playerPokemon?.getTypes().includes(Type.ELECTRIC)).toBe(true); + }); + + it("If the Pokemon is under the effect of a type-adding move and an equivalent terrain activates, the move's effect disappears", async () => { + game.override + .enemyMoveset([ Moves.FORESTS_CURSE, Moves.GRASSY_TERRAIN ]); + await game.classicMode.startBattle([ Species.FEEBAS ]); + + const playerPokemon = game.scene.getPlayerPokemon(); + game.move.select(Moves.SPLASH); + await game.forceEnemyMove(Moves.FORESTS_CURSE); + await game.toNextTurn(); + + expect(playerPokemon?.summonData.addedType).toBe(Type.GRASS); + + game.move.select(Moves.SPLASH); + await game.forceEnemyMove(Moves.GRASSY_TERRAIN); + await game.phaseInterceptor.to("TurnEndPhase"); + + expect(playerPokemon?.summonData.addedType).toBeNull(); + expect(playerPokemon?.getTypes().includes(Type.GRASS)).toBe(true); }); });