mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
test for moves done
This commit is contained in:
parent
ad44d70494
commit
8ce48815fc
@ -1,11 +1,12 @@
|
|||||||
import { Abilities } from "#enums/abilities";
|
import { Abilities } from "#enums/abilities";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
|
import { Type } from "#app/data/type";
|
||||||
import GameManager from "#test/utils/gameManager";
|
import GameManager from "#test/utils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
describe("Moves - Forests Curse", () => {
|
describe("Moves - Forest's Curse", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
let game: GameManager;
|
let game: GameManager;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ describe("Moves - Forests Curse", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.moveset([ Moves.SPLASH ])
|
.moveset([ Moves.FORESTS_CURSE, Moves.TRICK_OR_TREAT ])
|
||||||
.ability(Abilities.BALL_FETCH)
|
.ability(Abilities.BALL_FETCH)
|
||||||
.battleType("single")
|
.battleType("single")
|
||||||
.disableCrits()
|
.disableCrits()
|
||||||
@ -31,12 +32,16 @@ describe("Moves - Forests Curse", () => {
|
|||||||
.enemyMoveset(Moves.SPLASH);
|
.enemyMoveset(Moves.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should do X", async () => {
|
it("Using Forest's Curse on a Pokemon affected by Trick Or Treat will replace the Ghost-type with Grass", async () => {
|
||||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||||
|
|
||||||
game.move.select(Moves.SPLASH);
|
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||||
await game.phaseInterceptor.to("BerryPhase");
|
game.move.select(Moves.TRICK_OR_TREAT);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(enemyPokemon!.summonData.addedType).toBe(Type.GHOST);
|
||||||
|
|
||||||
expect(true).toBe(true);
|
game.move.select(Moves.FORESTS_CURSE);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(enemyPokemon?.summonData.addedType).toBe(Type.GRASS);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
47
src/test/moves/trick_or_treat.test.ts
Normal file
47
src/test/moves/trick_or_treat.test.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import { Abilities } from "#enums/abilities";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import { Type } from "#app/data/type";
|
||||||
|
import GameManager from "#test/utils/gameManager";
|
||||||
|
import Phaser from "phaser";
|
||||||
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
describe("Moves - Trick Or Treat", () => {
|
||||||
|
let phaserGame: Phaser.Game;
|
||||||
|
let game: GameManager;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
phaserGame = new Phaser.Game({
|
||||||
|
type: Phaser.HEADLESS,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
game.phaseInterceptor.restoreOg();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
game = new GameManager(phaserGame);
|
||||||
|
game.override
|
||||||
|
.moveset([ Moves.FORESTS_CURSE, Moves.TRICK_OR_TREAT ])
|
||||||
|
.ability(Abilities.BALL_FETCH)
|
||||||
|
.battleType("single")
|
||||||
|
.disableCrits()
|
||||||
|
.enemySpecies(Species.MAGIKARP)
|
||||||
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
|
.enemyMoveset(Moves.SPLASH);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("Using Trick Or Treat on a Pokemon affected by Forest's Curse will replace the Grass-type with Ghost", async () => {
|
||||||
|
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||||
|
|
||||||
|
const enemyPokemon = game.scene.getEnemyPokemon();
|
||||||
|
game.move.select(Moves.FORESTS_CURSE);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(enemyPokemon!.summonData.addedType).toBe(Type.GRASS);
|
||||||
|
|
||||||
|
game.move.select(Moves.TRICK_OR_TREAT);
|
||||||
|
await game.phaseInterceptor.to("TurnEndPhase");
|
||||||
|
expect(enemyPokemon?.summonData.addedType).toBe(Type.GHOST);
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user