From 2fbcd28ea871e8d6c0eea1e4f9a1c72b8e0f3efd Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 27 Dec 2024 14:47:54 -0800 Subject: [PATCH] Test for respecting TR --- src/test/moves/quash.test.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/test/moves/quash.test.ts b/src/test/moves/quash.test.ts index c5a56ef074f..3cbe79d7bfe 100644 --- a/src/test/moves/quash.test.ts +++ b/src/test/moves/quash.test.ts @@ -59,7 +59,7 @@ describe("Moves - Quash", () => { }); it("makes multiple quashed targets move in speed order at the end of the turn", async () => { - game.override.enemySpecies(Species.REGIELEKI) + game.override.enemySpecies(Species.NINJASK) .enemyLevel(100); await game.classicMode.startBattle([ Species.ACCELGOR, Species.RATTATA ]); @@ -75,4 +75,25 @@ describe("Moves - Quash", () => { expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SUNNY); }); + it("respects trick room", async () => { + game.override.enemyMoveset([ Moves.RAIN_DANCE, Moves.SPLASH, Moves.TRICK_ROOM ]); + + await game.classicMode.startBattle([ Species.ACCELGOR, Species.RATTATA ]); + game.move.select(Moves.SPLASH, 0); + game.move.select(Moves.SPLASH, 1); + + await game.forceEnemyMove(Moves.TRICK_ROOM); + await game.forceEnemyMove(Moves.SPLASH); + await game.phaseInterceptor.to("TurnInitPhase"); + // both users are quashed - accelgor should move last w/ TR so rain should be up at end of turn + game.move.select(Moves.RAIN_DANCE, 0); + game.move.select(Moves.SUNNY_DAY, 1); + + await game.forceEnemyMove(Moves.QUASH, BattlerIndex.PLAYER); + await game.forceEnemyMove(Moves.QUASH, BattlerIndex.PLAYER_2); + + await game.phaseInterceptor.to("TurnEndPhase", false); + expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.RAIN); + }); + });