Test for failure on a already moved target
This commit is contained in:
parent
88724b83eb
commit
bde258bdfb
|
@ -3,6 +3,7 @@ import { Moves } from "#enums/moves";
|
||||||
import { Abilities } from "#app/enums/abilities";
|
import { Abilities } from "#app/enums/abilities";
|
||||||
import { BattlerIndex } from "#app/battle";
|
import { BattlerIndex } from "#app/battle";
|
||||||
import { WeatherType } from "#enums/weather-type";
|
import { WeatherType } from "#enums/weather-type";
|
||||||
|
import { MoveResult } from "#app/field/pokemon";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { describe, beforeAll, afterEach, beforeEach, it, expect } from "vitest";
|
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);
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue