pokerogue/src/test/abilities/aroma_veil.test.ts

66 lines
2.1 KiB
TypeScript
Raw Normal View History

[Moves][Ability] Implement Torment / Taunt / Imprison + Aroma Veil (#4378) * Torment * Taunt and Imprison * ability immunities * Aroma Veil * Imprison * Test Files * Added exceptions for Rollout and check for active ability * adding tests so that git doesn't auto-fail * Blah * please * some documentation * Removed random newlines * Added check for ability's presence mid battle * Changed BattlerTagImmunityAbAttr to look at lists instead * Work? * Imprison and Taunt Tests * Tests * Final tests before documentation * documentation blah * Imports * Flx Change * flx - adding overrides * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * flx fixes * quick docs * privated retrieveField * Handling undefined * Update src/data/arena-tag.ts Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * forget to remove partials for heal block * Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Marked Torment as partial * Update src/test/moves/torment.test.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * tsdocs * Prevents test pokemon from being immune to torment * Update src/data/arena-tag.ts Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com> * Torranx Fixes * Check for this.source * why * lighting things with my mind on fire * aRHGHSHDKSHD --------- Co-authored-by: frutescens <info@laptop> Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Adrian T. <68144167+torranx@users.noreply.github.com>
2024-09-25 14:52:48 -07:00
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import { Abilities } from "#enums/abilities";
import GameManager from "#test/utils/gameManager";
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";
import { PlayerPokemon } from "#app/field/pokemon";
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)
.enemyMoveset([Moves.HEAL_BLOCK, Moves.IMPRISON, Moves.SPLASH])
.enemySpecies(Species.SHUCKLE)
.ability(Abilities.AROMA_VEIL)
.moveset([Moves.GROWL]);
});
it("Aroma Veil protects the Pokemon's side against most Move Restriction Battler Tags", async () => {
await game.classicMode.startBattle([Species.REGIELEKI, Species.BULBASAUR]);
const party = game.scene.getParty()! as PlayerPokemon[];
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 () => {
await game.classicMode.startBattle([Species.REGIELEKI, Species.BULBASAUR]);
const party = game.scene.getParty()! as PlayerPokemon[];
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();
});
});
});