mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-21 07:42:25 +02:00
Add tests for oblivious and own tempo
This commit is contained in:
parent
85925ee727
commit
a2504076b3
68
test/abilities/oblivious.test.ts
Normal file
68
test/abilities/oblivious.test.ts
Normal file
@ -0,0 +1,68 @@
|
||||
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/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Abilities - Oblivious", () => {
|
||||
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
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should remove taunt when gained", async () => {
|
||||
game.override.ability(Abilities.OBLIVIOUS)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.addTag(BattlerTagType.TAUNT); // sourceID needs to be defined
|
||||
expect(enemy?.getTag(BattlerTagType.TAUNT)).toBeTruthy();
|
||||
|
||||
game.move.select(Moves.SKILL_SWAP);
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(enemy?.status).toBeFalsy();
|
||||
});
|
||||
|
||||
it("should remove infatuation when gained", async () => {
|
||||
game.override.ability(Abilities.OBLIVIOUS)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.addTag(BattlerTagType.INFATUATED, 5, Moves.JUDGMENT, game.scene.getPlayerPokemon()?.id); // sourceID needs to be defined
|
||||
expect(enemy?.getTag(BattlerTagType.INFATUATED)).toBeTruthy();
|
||||
|
||||
game.move.select(Moves.SKILL_SWAP);
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(enemy?.status).toBeFalsy();
|
||||
});
|
||||
});
|
51
test/abilities/own_tempo.test.ts
Normal file
51
test/abilities/own_tempo.test.ts
Normal file
@ -0,0 +1,51 @@
|
||||
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/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Abilities - Own Tempo", () => {
|
||||
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
|
||||
.moveset([ Moves.SPLASH ])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should remove confusion when gained", async () => {
|
||||
game.override.ability(Abilities.OWN_TEMPO)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.moveset(Moves.SKILL_SWAP)
|
||||
.enemyMoveset(Moves.SPLASH),
|
||||
|
||||
await game.classicMode.startBattle([ Species.FEEBAS ]);
|
||||
const enemy = game.scene.getEnemyPokemon();
|
||||
enemy?.addTag(BattlerTagType.CONFUSED);
|
||||
expect(enemy?.getTag(BattlerTagType.CONFUSED)).toBeTruthy();
|
||||
|
||||
game.move.select(Moves.SKILL_SWAP);
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(enemy?.status).toBeFalsy();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user