mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-28 11:12:24 +02:00
Implemented tests for Desolate Land
This commit is contained in:
parent
a0e6852bd1
commit
62634e7d6b
@ -1,3 +1,4 @@
|
||||
import { PokeballType } from "#app/enums/pokeball";
|
||||
import { WeatherType } from "#app/enums/weather-type";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
@ -34,7 +35,7 @@ describe("Abilities - Desolate Land", () => {
|
||||
* This checks that the weather has changed after the Enemy Pokemon with {@linkcode Abilities.DESOLATE_LAND}
|
||||
* is forcefully moved out of the field from moves such as Roar {@linkcode Moves.ROAR}
|
||||
*/
|
||||
it("should lift when all pokemon with this ability leave the field", async () => {
|
||||
it("should lift only when all pokemon with this ability leave the field", async () => {
|
||||
game.override
|
||||
.battleType("double")
|
||||
.enemyMoveset([ Moves.SPLASH, Moves.ROAR ]);
|
||||
@ -92,6 +93,29 @@ describe("Abilities - Desolate Land", () => {
|
||||
expect(game.scene.arena.weather?.weatherType).not.toBe(WeatherType.HARSH_SUN);
|
||||
});
|
||||
|
||||
it("should lift when pokemon returns upon switching from double to single battle", async () => {
|
||||
game.override
|
||||
.battleType("even-doubles")
|
||||
.enemyMoveset([ Moves.SPLASH, Moves.MEMENTO ])
|
||||
.startingWave(12);
|
||||
await game.classicMode.startBattle([ Species.MAGIKARP, Species.MAGCARGO ]);
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
||||
|
||||
game.move.select(Moves.SPLASH, 0, 2);
|
||||
game.move.select(Moves.SPLASH, 1, 2);
|
||||
await game.forceEnemyMove(Moves.MEMENTO, 0);
|
||||
await game.forceEnemyMove(Moves.MEMENTO, 1);
|
||||
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
||||
|
||||
await game.toNextWave();
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).not.toBe(WeatherType.HARSH_SUN);
|
||||
});
|
||||
|
||||
it("should lift when enemy is captured", async () => {
|
||||
game.override
|
||||
.battleType("single")
|
||||
@ -102,6 +126,9 @@ describe("Abilities - Desolate Land", () => {
|
||||
|
||||
expect(game.scene.arena.weather?.weatherType).toBe(WeatherType.HARSH_SUN);
|
||||
|
||||
game.scene.pokeballCounts[PokeballType.MASTER_BALL] = 1;
|
||||
|
||||
game.doThrowPokeball(PokeballType.MASTER_BALL);
|
||||
|
||||
await game.phaseInterceptor.to("TurnEndPhase");
|
||||
|
||||
|
@ -24,6 +24,7 @@ import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
||||
import { TurnStartPhase } from "#app/phases/turn-start-phase";
|
||||
import ErrorInterceptor from "#app/test/utils/errorInterceptor";
|
||||
import type InputsHandler from "#app/test/utils/inputsHandler";
|
||||
import type BallUiHandler from "#app/ui/ball-ui-handler";
|
||||
import type BattleMessageUiHandler from "#app/ui/battle-message-ui-handler";
|
||||
import type CommandUiHandler from "#app/ui/command-ui-handler";
|
||||
import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||
@ -458,16 +459,15 @@ export default class GameManager {
|
||||
(this.scene.ui.getHandler() as CommandUiHandler).processInput(Button.ACTION);
|
||||
});
|
||||
|
||||
this.doSelectPokeball(ballIndex, "CommandPhase");
|
||||
this.doSelectPokeball(ballIndex);
|
||||
}
|
||||
// ???
|
||||
doSelectPokeball(slot: number, inPhase = "SwitchPhase") {
|
||||
this.onNextPrompt(inPhase, Mode.PARTY, () => {
|
||||
const partyHandler = this.scene.ui.getHandler() as PartyUiHandler;
|
||||
doSelectPokeball(ballIndex: number) {
|
||||
this.onNextPrompt("CommandPhase", Mode.BALL, () => {
|
||||
const ballHandler = this.scene.ui.getHandler() as BallUiHandler;
|
||||
|
||||
partyHandler.setCursor(slot);
|
||||
partyHandler.processInput(Button.ACTION); // select party slot
|
||||
partyHandler.processInput(Button.ACTION); // send out (or whatever option is at the top)
|
||||
ballHandler.setCursor(ballIndex);
|
||||
ballHandler.processInput(Button.ACTION); // select ball and throw
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user