From bde258bdfb767f18217cd33773697c996949e4f9 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 27 Dec 2024 13:23:25 -0800 Subject: [PATCH] Test for failure on a already moved target --- src/test/moves/quash.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/moves/quash.test.ts b/src/test/moves/quash.test.ts index b804e90c763..7d41832d49f 100644 --- a/src/test/moves/quash.test.ts +++ b/src/test/moves/quash.test.ts @@ -3,6 +3,7 @@ import { Moves } from "#enums/moves"; import { Abilities } from "#app/enums/abilities"; import { BattlerIndex } from "#app/battle"; import { WeatherType } from "#enums/weather-type"; +import { MoveResult } from "#app/field/pokemon"; import GameManager from "#test/utils/gameManager"; import Phaser from "phaser"; import { describe, beforeAll, afterEach, beforeEach, it, expect } from "vitest"; @@ -46,4 +47,15 @@ describe("Moves - Quash", () => { expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.SUNNY); }); + it("fails if the target has already moved", async () => { + await game.classicMode.startBattle([ Species.ACCELGOR, Species.RATTATA ]); + game.move.select(Moves.SPLASH, 0); + game.move.select(Moves.QUASH, 1, BattlerIndex.PLAYER); + + await game.phaseInterceptor.to("MoveEndPhase"); + await game.phaseInterceptor.to("MoveEndPhase"); + + expect(game.scene.getPlayerField()[1].getLastXMoves(1)[0].result).toBe(MoveResult.FAIL); + }); + });