mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Fiexd remainig tests
This commit is contained in:
parent
abd6c73e7a
commit
ef2e646936
@ -28,11 +28,11 @@ describe("Abilities - Screen Cleaner", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("removes Aurora Veil", async () => {
|
it("removes Aurora Veil", async () => {
|
||||||
game.override.moveset([MoveId.HAIL]).enemyMoveset(MoveId.AURORA_VEIL);
|
game.override.enemyMoveset(MoveId.AURORA_VEIL);
|
||||||
|
|
||||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
|
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(MoveId.HAIL);
|
game.move.use(MoveId.HAIL);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.AURORA_VEIL)).toBeDefined();
|
expect(game.scene.arena.getTag(ArenaTagType.AURORA_VEIL)).toBeDefined();
|
||||||
@ -49,7 +49,7 @@ describe("Abilities - Screen Cleaner", () => {
|
|||||||
|
|
||||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
|
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(MoveId.SPLASH);
|
game.move.use(MoveId.SPLASH);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.LIGHT_SCREEN)).toBeDefined();
|
expect(game.scene.arena.getTag(ArenaTagType.LIGHT_SCREEN)).toBeDefined();
|
||||||
@ -66,7 +66,7 @@ describe("Abilities - Screen Cleaner", () => {
|
|||||||
|
|
||||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
|
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.MAGIKARP]);
|
||||||
|
|
||||||
game.move.select(MoveId.SPLASH);
|
game.move.use(MoveId.SPLASH);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.REFLECT)).toBeDefined();
|
expect(game.scene.arena.getTag(ArenaTagType.REFLECT)).toBeDefined();
|
||||||
|
@ -103,7 +103,7 @@ describe("Moves - Gastro Acid", () => {
|
|||||||
game.move.use(MoveId.WATER_GUN);
|
game.move.use(MoveId.WATER_GUN);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
// water gun should've dealt damage due to suppressed Water Absorb
|
// water gun should've dealt damage due to suppressed Water Absorb
|
||||||
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp());
|
expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp());
|
||||||
|
|
||||||
game.move.use(MoveId.SPORE);
|
game.move.use(MoveId.SPORE);
|
||||||
await game.toEndOfTurn();
|
await game.toEndOfTurn();
|
||||||
|
@ -6,6 +6,7 @@ import Phaser from "phaser";
|
|||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
import { ArenaTrapTag } from "#app/data/arena-tag";
|
import { ArenaTrapTag } from "#app/data/arena-tag";
|
||||||
import { ArenaTagSide } from "#enums/arena-tag-side";
|
import { ArenaTagSide } from "#enums/arena-tag-side";
|
||||||
|
import { BattlerIndex } from "#enums/battler-index";
|
||||||
|
|
||||||
describe("Moves - Spikes", () => {
|
describe("Moves - Spikes", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -81,12 +82,12 @@ describe("Moves - Spikes", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("should work when all targets fainted", async () => {
|
it("should work when all targets fainted", async () => {
|
||||||
game.override.enemySpecies(SpeciesId.DIGLETT).battleStyle("double").startingLevel(50);
|
game.override.enemySpecies(SpeciesId.DIGLETT).battleStyle("double").startingLevel(1000);
|
||||||
await game.classicMode.startBattle([SpeciesId.RAYQUAZA]);
|
await game.classicMode.startBattle([SpeciesId.RAYQUAZA, SpeciesId.SHUCKLE]);
|
||||||
|
|
||||||
game.move.use(MoveId.SPIKES);
|
game.move.use(MoveId.HYPER_VOICE, BattlerIndex.PLAYER);
|
||||||
await game.doKillOpponents();
|
game.move.use(MoveId.SPIKES, BattlerIndex.PLAYER_2);
|
||||||
await game.phaseInterceptor.to("TurnEndPhase");
|
await game.toNextWave();
|
||||||
|
|
||||||
expect(game.scene.arena.getTagOnSide(ArenaTrapTag, ArenaTagSide.ENEMY)).toBeDefined();
|
expect(game.scene.arena.getTagOnSide(ArenaTrapTag, ArenaTagSide.ENEMY)).toBeDefined();
|
||||||
});
|
});
|
||||||
|
@ -12,7 +12,6 @@ import overrides from "#app/overrides";
|
|||||||
import { CheckSwitchPhase } from "#app/phases/check-switch-phase";
|
import { CheckSwitchPhase } from "#app/phases/check-switch-phase";
|
||||||
import { CommandPhase } from "#app/phases/command-phase";
|
import { CommandPhase } from "#app/phases/command-phase";
|
||||||
import { EncounterPhase } from "#app/phases/encounter-phase";
|
import { EncounterPhase } from "#app/phases/encounter-phase";
|
||||||
import { FaintPhase } from "#app/phases/faint-phase";
|
|
||||||
import { LoginPhase } from "#app/phases/login-phase";
|
import { LoginPhase } from "#app/phases/login-phase";
|
||||||
import { MovePhase } from "#app/phases/move-phase";
|
import { MovePhase } from "#app/phases/move-phase";
|
||||||
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
||||||
@ -452,17 +451,14 @@ export default class GameManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Faints a player or enemy pokemon instantly by setting their HP to 0.
|
* Faint a player or enemy pokemon instantly by setting their HP to 0.
|
||||||
* @param pokemon - The player/enemy pokemon being fainted
|
* @param pokemon - The player/enemy pokemon being fainted
|
||||||
* @returns A promise that resolves once the fainted pokemon's FaintPhase finishes running.
|
* @returns A Promise that resolves once the fainted pokemon's FaintPhase finishes running.
|
||||||
*/
|
*/
|
||||||
async killPokemon(pokemon: PlayerPokemon | EnemyPokemon) {
|
async killPokemon(pokemon: PlayerPokemon | EnemyPokemon) {
|
||||||
return new Promise<void>(async (resolve, reject) => {
|
|
||||||
pokemon.hp = 0;
|
pokemon.hp = 0;
|
||||||
this.scene.phaseManager.pushPhase(new FaintPhase(pokemon.getBattlerIndex(), true));
|
this.scene.phaseManager.pushNew("FaintPhase", pokemon.getBattlerIndex(), true);
|
||||||
await this.phaseInterceptor.to(FaintPhase).catch(e => reject(e));
|
await this.phaseInterceptor.to("FaintPhase");
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user