mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-12-16 14:55:22 +01:00
* [Challenge] Add Nuzlocke-related Challenges Co-authored-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt> Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Sirzento <sirzento@gmx.de> * Add Sacred Ash to `revive` Group * Separate Challenge Utility Functions * Misc. Changes * Transition to `BooleanHolder` * Add "Nuzlocke" Achievement * Change Challenge Order * Adjust Nuzlocke Achievement to Include Fresh Start * Fix Infinite Reward Reroll Bug * Fix Party Heal * Minor Change * Adjust TODOs * Add Unit Tests * Tweak Faint Cry in Permanent Faint * Resolve rebase issue * Apply Matthew's Suggestions Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com> * Apply Matthew's Suggestions Pt. 2 Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com> * Fix and Lint Suggestions * Revert Accidental Overrides * Fix and Lint Suggestions Pt. 2 * Rename Challenges * Prevent `RandomMoveAttr` from Using Banned Moves * Update Locales --------- Co-authored-by: Matilde Simões <matilde.simoes@tecnico.ulisboa.pt> Co-authored-by: Fuad Ali <fuad.ali@tecnico.ulisboa.pt> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Sirzento <sirzento@gmx.de> Co-authored-by: Bertie690 <136088738+Bertie690@users.noreply.github.com>
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { AbilityId } from "#enums/ability-id";
|
|
import { Challenges } from "#enums/challenges";
|
|
import { MoveId } from "#enums/move-id";
|
|
import { PokeballType } from "#enums/pokeball";
|
|
import { SpeciesId } from "#enums/species-id";
|
|
import { GameManager } from "#test/test-utils/game-manager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
describe("Challenges - Limited Catch", () => {
|
|
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.challengeMode.addChallenge(Challenges.LIMITED_CATCH, 1, 1);
|
|
game.override
|
|
.battleStyle("single")
|
|
.enemySpecies(SpeciesId.VOLTORB)
|
|
.enemyAbility(AbilityId.BALL_FETCH)
|
|
.enemyMoveset(MoveId.SPLASH)
|
|
.startingModifier([{ name: "MASTER_BALL", count: 1 }]);
|
|
});
|
|
|
|
it("should allow wild Pokémon to be caught on X1 waves", async () => {
|
|
game.override.startingWave(31);
|
|
await game.challengeMode.startBattle([SpeciesId.NUZLEAF]);
|
|
|
|
game.doThrowPokeball(PokeballType.MASTER_BALL);
|
|
await game.toEndOfTurn();
|
|
|
|
expect(game.scene.getPlayerParty()).toHaveLength(2);
|
|
});
|
|
|
|
it("should prevent Pokémon from being caught on non-X1 waves", async () => {
|
|
game.override.startingWave(53);
|
|
await game.challengeMode.startBattle([SpeciesId.NUZLEAF]);
|
|
|
|
game.doThrowPokeball(PokeballType.MASTER_BALL);
|
|
await game.toEndOfTurn();
|
|
|
|
expect(game.scene.getPlayerParty()).toHaveLength(1);
|
|
});
|
|
});
|