mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-23 01:54:49 +01:00
* Add isPartner method to trainer class * Ensure force switches cannot pull pokemon from the wrong trainer * Add override for battle type * Fixup tests and broken assumptions * Make move fail override semi-invuln check Bandaid fix because move effect phase does not allow for the move to fail if all of its conditions fail * Restore overrides * Apply kev's suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Fix illusion test battle type invocation * Update struggle and healer tests to use battleStyle --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
55 lines
1.4 KiB
TypeScript
55 lines
1.4 KiB
TypeScript
import { Stat } from "#app/enums/stat";
|
|
import { Abilities } from "#enums/abilities";
|
|
import { Moves } from "#enums/moves";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, it, expect } from "vitest";
|
|
|
|
describe("Abilities - Illuminate", () => {
|
|
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.SPLASH)
|
|
.ability(Abilities.ILLUMINATE)
|
|
.enemyAbility(Abilities.BALL_FETCH)
|
|
.enemyMoveset(Moves.SAND_ATTACK);
|
|
});
|
|
|
|
it("should prevent ACC stat stage from being lowered", async () => {
|
|
game.override.battleStyle("single");
|
|
|
|
await game.classicMode.startBattle();
|
|
|
|
const player = game.scene.getPlayerPokemon()!;
|
|
|
|
expect(player.getStatStage(Stat.ACC)).toBe(0);
|
|
|
|
game.move.select(Moves.SPLASH);
|
|
|
|
await game.toNextTurn();
|
|
|
|
expect(player.getStatStage(Stat.ACC)).toBe(0);
|
|
});
|
|
|
|
it("should guarantee double battle with any one LURE", async () => {
|
|
game.override.startingModifier([{ name: "LURE" }]).startingWave(2);
|
|
|
|
await game.classicMode.startBattle();
|
|
|
|
expect(game.scene.getEnemyField().length).toBe(2);
|
|
});
|
|
});
|