2024-09-25 14:52:48 -07:00
|
|
|
import { Moves } from "#enums/moves";
|
|
|
|
import { Species } from "#enums/species";
|
|
|
|
import { Abilities } from "#enums/abilities";
|
2025-02-22 22:52:07 -06:00
|
|
|
import GameManager from "#test/testUtils/gameManager";
|
2024-09-25 14:52:48 -07:00
|
|
|
import Phaser from "phaser";
|
|
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
|
|
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
|
|
|
import { BattlerIndex } from "#app/battle";
|
2025-01-12 15:33:05 -08:00
|
|
|
import type { PlayerPokemon } from "#app/field/pokemon";
|
2024-09-25 14:52:48 -07:00
|
|
|
|
|
|
|
describe("Moves - Aroma Veil", () => {
|
|
|
|
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("double")
|
|
|
|
.enemyAbility(Abilities.BALL_FETCH)
|
2024-10-04 13:08:31 +08:00
|
|
|
.enemyMoveset([ Moves.HEAL_BLOCK, Moves.IMPRISON, Moves.SPLASH ])
|
2024-09-25 14:52:48 -07:00
|
|
|
.enemySpecies(Species.SHUCKLE)
|
|
|
|
.ability(Abilities.AROMA_VEIL)
|
2024-10-04 13:08:31 +08:00
|
|
|
.moveset([ Moves.GROWL ]);
|
2024-09-25 14:52:48 -07:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Aroma Veil protects the Pokemon's side against most Move Restriction Battler Tags", async () => {
|
2024-10-04 13:08:31 +08:00
|
|
|
await game.classicMode.startBattle([ Species.REGIELEKI, Species.BULBASAUR ]);
|
2024-09-25 14:52:48 -07:00
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const party = game.scene.getPlayerParty()! as PlayerPokemon[];
|
2024-09-25 14:52:48 -07:00
|
|
|
|
|
|
|
game.move.select(Moves.GROWL);
|
|
|
|
game.move.select(Moves.GROWL);
|
|
|
|
await game.forceEnemyMove(Moves.HEAL_BLOCK);
|
|
|
|
await game.toNextTurn();
|
|
|
|
party.forEach(p => {
|
|
|
|
expect(p.getTag(BattlerTagType.HEAL_BLOCK)).toBeUndefined();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Aroma Veil does not protect against Imprison", async () => {
|
2024-10-04 13:08:31 +08:00
|
|
|
await game.classicMode.startBattle([ Species.REGIELEKI, Species.BULBASAUR ]);
|
2024-09-25 14:52:48 -07:00
|
|
|
|
2024-11-03 18:53:52 -08:00
|
|
|
const party = game.scene.getPlayerParty()! as PlayerPokemon[];
|
2024-09-25 14:52:48 -07:00
|
|
|
|
|
|
|
game.move.select(Moves.GROWL);
|
|
|
|
game.move.select(Moves.GROWL, 1);
|
|
|
|
await game.forceEnemyMove(Moves.IMPRISON, BattlerIndex.PLAYER);
|
|
|
|
await game.forceEnemyMove(Moves.SPLASH);
|
|
|
|
await game.toNextTurn();
|
|
|
|
expect(game.scene.arena.getTag(ArenaTagType.IMPRISON)).toBeDefined();
|
|
|
|
party.forEach(p => {
|
|
|
|
expect(p.getTag(BattlerTagType.IMPRISON)).toBeDefined();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|