pokerogue/test/abilities/wind_rider.test.ts
NightKev 9dcb904649
[Misc] Improve enum naming (#5933)
* Rename `Abilities` to `AbilityId`

* Rename `abilities.ts` to `ability-id.ts`

* Rename `Moves` to `MoveId`

* Rename `moves.ts` to `move-id.ts`

* Rename `Species` to `SpeciesId`

* Rename `species.ts` to `species-id.ts`

* Rename `Biome` to `BiomeId`

* Rename `biome.ts` to `biome-id.ts`

* Replace `Abilities` with `AbilityId` in comments

* Replace `Biome` with `BiomeId` in comments

* Replace `Moves` with `MoveId` in comments

* Replace `Species` with `SpeciesId` in comments
2025-06-04 14:54:27 -07:00

115 lines
3.6 KiB
TypeScript

import { Stat } from "#enums/stat";
import GameManager from "#test/testUtils/gameManager";
import { AbilityId } from "#enums/ability-id";
import { MoveId } from "#enums/move-id";
import { SpeciesId } from "#enums/species-id";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Wind Rider", () => {
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
.battleStyle("single")
.enemySpecies(SpeciesId.SHIFTRY)
.enemyAbility(AbilityId.WIND_RIDER)
.moveset([MoveId.TAILWIND, MoveId.SPLASH, MoveId.PETAL_BLIZZARD, MoveId.SANDSTORM])
.enemyMoveset(MoveId.SPLASH);
});
it("takes no damage from wind moves and its ATK stat stage is raised by 1 when hit by one", async () => {
await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
const shiftry = game.scene.getEnemyPokemon()!;
expect(shiftry.getStatStage(Stat.ATK)).toBe(0);
game.move.select(MoveId.PETAL_BLIZZARD);
await game.phaseInterceptor.to("TurnEndPhase");
expect(shiftry.isFullHp()).toBe(true);
expect(shiftry.getStatStage(Stat.ATK)).toBe(1);
});
it("ATK stat stage is raised by 1 when Tailwind is present on its side", async () => {
game.override.enemySpecies(SpeciesId.MAGIKARP).ability(AbilityId.WIND_RIDER);
await game.classicMode.startBattle([SpeciesId.SHIFTRY]);
const shiftry = game.scene.getPlayerPokemon()!;
expect(shiftry.getStatStage(Stat.ATK)).toBe(0);
game.move.select(MoveId.TAILWIND);
await game.phaseInterceptor.to("TurnEndPhase");
expect(shiftry.getStatStage(Stat.ATK)).toBe(1);
});
it("does not raise ATK stat stage when Tailwind is present on opposing side", async () => {
game.override.enemySpecies(SpeciesId.MAGIKARP).ability(AbilityId.WIND_RIDER);
await game.classicMode.startBattle([SpeciesId.SHIFTRY]);
const magikarp = game.scene.getEnemyPokemon()!;
const shiftry = game.scene.getPlayerPokemon()!;
expect(shiftry.getStatStage(Stat.ATK)).toBe(0);
expect(magikarp.getStatStage(Stat.ATK)).toBe(0);
game.move.select(MoveId.TAILWIND);
await game.phaseInterceptor.to("TurnEndPhase");
expect(shiftry.getStatStage(Stat.ATK)).toBe(1);
expect(magikarp.getStatStage(Stat.ATK)).toBe(0);
});
it("does not raise ATK stat stage when Tailwind is present on opposing side", async () => {
game.override.enemySpecies(SpeciesId.MAGIKARP).ability(AbilityId.WIND_RIDER);
await game.classicMode.startBattle([SpeciesId.SHIFTRY]);
const magikarp = game.scene.getEnemyPokemon()!;
const shiftry = game.scene.getPlayerPokemon()!;
expect(shiftry.getStatStage(Stat.ATK)).toBe(0);
expect(magikarp.getStatStage(Stat.ATK)).toBe(0);
game.move.select(MoveId.TAILWIND);
await game.phaseInterceptor.to("TurnEndPhase");
expect(shiftry.getStatStage(Stat.ATK)).toBe(1);
expect(magikarp.getStatStage(Stat.ATK)).toBe(0);
});
it("does not interact with Sandstorm", async () => {
game.override.enemySpecies(SpeciesId.MAGIKARP);
await game.classicMode.startBattle([SpeciesId.SHIFTRY]);
const shiftry = game.scene.getPlayerPokemon()!;
expect(shiftry.getStatStage(Stat.ATK)).toBe(0);
expect(shiftry.isFullHp()).toBe(true);
game.move.select(MoveId.SANDSTORM);
await game.phaseInterceptor.to("TurnEndPhase");
expect(shiftry.getStatStage(Stat.ATK)).toBe(0);
expect(shiftry.hp).lessThan(shiftry.getMaxHp());
});
});