mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-26 22:15:52 +01:00
* Consolidate `doSelectTarget()` into `doAttack()` * Fix ternary * Add error message to aid in debugging tests * Update docs * [Test] Change `doAttack()` to `selectMove()` * Add `select()` to `src/test/utils/helpers/moveHelper.ts` * Replace instances of `game.selectMove()` with `game.move.select()` * Fix imports * Replace `selectMove()` with `move.select()` helper Fix broken tests for Pastel Veil and Sweet Veil * Update tsdocs
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
import { BattleStat } from "#app/data/battle-stat";
|
|
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
|
import { Abilities } from "#enums/abilities";
|
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
|
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";
|
|
|
|
// See also: TypeImmunityAbAttr
|
|
describe("Abilities - Volt Absorb", () => {
|
|
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");
|
|
game.override.disableCrits();
|
|
});
|
|
|
|
it("does not activate when CHARGE is used", async () => {
|
|
const moveToUse = Moves.CHARGE;
|
|
const ability = Abilities.VOLT_ABSORB;
|
|
|
|
game.override.moveset([moveToUse]);
|
|
game.override.ability(ability);
|
|
game.override.enemyMoveset([Moves.SPLASH, Moves.NONE, Moves.NONE, Moves.NONE]);
|
|
game.override.enemySpecies(Species.DUSKULL);
|
|
game.override.enemyAbility(Abilities.BALL_FETCH);
|
|
|
|
await game.startBattle();
|
|
|
|
game.move.select(moveToUse);
|
|
|
|
await game.phaseInterceptor.to(TurnEndPhase);
|
|
|
|
expect(game.scene.getParty()[0].summonData.battleStats[BattleStat.SPDEF]).toBe(1);
|
|
expect(game.scene.getParty()[0].getTag(BattlerTagType.CHARGED)).toBeDefined();
|
|
expect(game.phaseInterceptor.log).not.toContain("ShowAbilityPhase");
|
|
});
|
|
});
|