mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 09:02:47 +02:00
* 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
59 lines
1.8 KiB
TypeScript
59 lines
1.8 KiB
TypeScript
import { Stat } from "#enums/stat";
|
|
import { AbilityId } from "#enums/ability-id";
|
|
import { MoveId } from "#enums/move-id";
|
|
import { SpeciesId } from "#enums/species-id";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
describe("Abilities - Hyper Cutter", () => {
|
|
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")
|
|
.moveset([MoveId.SAND_ATTACK, MoveId.NOBLE_ROAR, MoveId.DEFOG, MoveId.OCTOLOCK])
|
|
.ability(AbilityId.BALL_FETCH)
|
|
.enemySpecies(SpeciesId.SHUCKLE)
|
|
.enemyAbility(AbilityId.HYPER_CUTTER)
|
|
.enemyMoveset(MoveId.SPLASH);
|
|
});
|
|
|
|
// Reference Link: https://bulbapedia.bulbagarden.net/wiki/Hyper_Cutter_(Ability)
|
|
|
|
it("only prevents ATK drops", async () => {
|
|
await game.classicMode.startBattle();
|
|
|
|
const enemy = game.scene.getEnemyPokemon()!;
|
|
|
|
game.move.select(MoveId.OCTOLOCK);
|
|
await game.toNextTurn();
|
|
game.move.select(MoveId.DEFOG);
|
|
await game.toNextTurn();
|
|
game.move.select(MoveId.NOBLE_ROAR);
|
|
await game.toNextTurn();
|
|
game.move.select(MoveId.SAND_ATTACK);
|
|
await game.toNextTurn();
|
|
game.override.moveset([MoveId.STRING_SHOT]);
|
|
game.move.select(MoveId.STRING_SHOT);
|
|
await game.toNextTurn();
|
|
|
|
expect(enemy.getStatStage(Stat.ATK)).toEqual(0);
|
|
[Stat.ACC, Stat.DEF, Stat.EVA, Stat.SPATK, Stat.SPDEF, Stat.SPD].forEach((stat: number) =>
|
|
expect(enemy.getStatStage(stat)).toBeLessThan(0),
|
|
);
|
|
});
|
|
});
|