mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52: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
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import { MoveId } from "#enums/move-id";
|
|
import { AbilityId } from "#enums/ability-id";
|
|
import { SpeciesId } from "#enums/species-id";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phase from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
describe("Items - Mystical Rock", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phase.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
|
|
game.override
|
|
.enemySpecies(SpeciesId.SHUCKLE)
|
|
.enemyMoveset(MoveId.SPLASH)
|
|
.enemyAbility(AbilityId.BALL_FETCH)
|
|
.moveset([MoveId.SUNNY_DAY, MoveId.GRASSY_TERRAIN])
|
|
.startingHeldItems([{ name: "MYSTICAL_ROCK", count: 2 }])
|
|
.battleStyle("single");
|
|
});
|
|
|
|
it("should increase weather duration by +2 turns per stack", async () => {
|
|
await game.classicMode.startBattle([SpeciesId.GASTLY]);
|
|
|
|
game.move.select(MoveId.SUNNY_DAY);
|
|
|
|
await game.phaseInterceptor.to("MoveEndPhase");
|
|
|
|
const weather = globalScene.arena.weather;
|
|
|
|
expect(weather).toBeDefined();
|
|
expect(weather!.turnsLeft).to.equal(9);
|
|
});
|
|
|
|
it("should increase terrain duration by +2 turns per stack", async () => {
|
|
await game.classicMode.startBattle([SpeciesId.GASTLY]);
|
|
|
|
game.move.select(MoveId.GRASSY_TERRAIN);
|
|
|
|
await game.phaseInterceptor.to("MoveEndPhase");
|
|
|
|
const terrain = globalScene.arena.terrain;
|
|
|
|
expect(terrain).toBeDefined();
|
|
expect(terrain!.turnsLeft).to.equal(9);
|
|
});
|
|
});
|