mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 09:02:47 +02:00
* Removed unneeded duplicate entries from movesets * Removed `array.fill` in moveset overrides * Reverted accidental changes
77 lines
2.5 KiB
TypeScript
77 lines
2.5 KiB
TypeScript
import { allMoves } from "#app/data/data-lists";
|
|
import { Abilities } from "#enums/abilities";
|
|
import { Moves } from "#enums/moves";
|
|
import { Species } from "#enums/species";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
describe("Abilities - Aura Break", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
const auraBreakMultiplier = ((9 / 16) * 4) / 3;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
game.override
|
|
.battleStyle("single")
|
|
.moveset([Moves.MOONBLAST, Moves.DARK_PULSE])
|
|
.enemyMoveset(Moves.SPLASH)
|
|
.enemyAbility(Abilities.AURA_BREAK)
|
|
.enemySpecies(Species.SHUCKLE);
|
|
});
|
|
|
|
it("reverses the effect of Fairy Aura", async () => {
|
|
const moveToCheck = allMoves[Moves.MOONBLAST];
|
|
const basePower = moveToCheck.power;
|
|
|
|
game.override.ability(Abilities.FAIRY_AURA);
|
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
|
|
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
|
game.move.select(Moves.MOONBLAST);
|
|
await game.phaseInterceptor.to("MoveEffectPhase");
|
|
|
|
expect(moveToCheck.calculateBattlePower).toHaveReturnedWith(expect.closeTo(basePower * auraBreakMultiplier));
|
|
});
|
|
|
|
it("reverses the effect of Dark Aura", async () => {
|
|
const moveToCheck = allMoves[Moves.DARK_PULSE];
|
|
const basePower = moveToCheck.power;
|
|
|
|
game.override.ability(Abilities.DARK_AURA);
|
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
|
|
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
|
game.move.select(Moves.DARK_PULSE);
|
|
await game.phaseInterceptor.to("MoveEffectPhase");
|
|
|
|
expect(moveToCheck.calculateBattlePower).toHaveReturnedWith(expect.closeTo(basePower * auraBreakMultiplier));
|
|
});
|
|
|
|
it("has no effect if neither Fairy Aura nor Dark Aura are present", async () => {
|
|
const moveToCheck = allMoves[Moves.MOONBLAST];
|
|
const basePower = moveToCheck.power;
|
|
|
|
game.override.ability(Abilities.BALL_FETCH);
|
|
vi.spyOn(moveToCheck, "calculateBattlePower");
|
|
|
|
await game.classicMode.startBattle([Species.PIKACHU]);
|
|
game.move.select(Moves.MOONBLAST);
|
|
await game.phaseInterceptor.to("MoveEffectPhase");
|
|
|
|
expect(moveToCheck.calculateBattlePower).toHaveReturnedWith(basePower);
|
|
});
|
|
});
|