mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-09 11:31:49 +00:00
* Make `OPP_MOVESET_OVERRIDE` fully override the enemy's moveset * Update tests with new override behavior * Fix tests * Fix another test * Move overrides no longer required to be arrays * Remove `SPLASH_ONLY` test utility variable * Update moveset override helper functions * Missed some tests
55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
import { BattlerIndex } from "#app/battle";
|
|
import { Abilities } from "#app/enums/abilities";
|
|
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
|
import { BerryPhase } from "#app/phases/berry-phase";
|
|
import { Moves } from "#enums/moves";
|
|
import { Species } from "#enums/species";
|
|
import GameManager from "#test/utils/gameManager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
const TIMEOUT = 20 * 1000;
|
|
|
|
describe("Moves - Alluring Voice", () => {
|
|
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
|
|
.battleType("single")
|
|
.disableCrits()
|
|
.enemySpecies(Species.MAGIKARP)
|
|
.enemyAbility(Abilities.ICE_SCALES)
|
|
.enemyMoveset([Moves.HOWL])
|
|
.startingLevel(10)
|
|
.enemyLevel(10)
|
|
.starterSpecies(Species.FEEBAS)
|
|
.ability(Abilities.BALL_FETCH)
|
|
.moveset([Moves.ALLURING_VOICE]);
|
|
|
|
});
|
|
|
|
it("should confuse the opponent if their stat stages were raised", async () => {
|
|
await game.classicMode.startBattle();
|
|
|
|
const enemy = game.scene.getEnemyPokemon()!;
|
|
|
|
game.move.select(Moves.ALLURING_VOICE);
|
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
|
await game.phaseInterceptor.to(BerryPhase);
|
|
|
|
expect(enemy.getTag(BattlerTagType.CONFUSED)?.tagType).toBe("CONFUSED");
|
|
}, TIMEOUT);
|
|
});
|