mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +02:00
Fixed remaining tests
This commit is contained in:
parent
3d0c050a5e
commit
79121a8d01
@ -1,8 +1,6 @@
|
|||||||
import { BattlerIndex } from "#enums/battler-index";
|
|
||||||
import { globalScene } from "#app/global-scene";
|
|
||||||
import { AbilityId } from "#enums/ability-id";
|
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import GameManager from "#test/testUtils/gameManager";
|
import GameManager from "#test/testUtils/gameManager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
@ -24,29 +22,28 @@ describe("Abilities - Mold Breaker", () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override
|
game.override
|
||||||
.moveset([MoveId.SPLASH])
|
|
||||||
.ability(AbilityId.MOLD_BREAKER)
|
.ability(AbilityId.MOLD_BREAKER)
|
||||||
.battleStyle("single")
|
.battleStyle("single")
|
||||||
.criticalHits(false)
|
.criticalHits(false)
|
||||||
.enemySpecies(SpeciesId.MAGIKARP)
|
.enemySpecies(SpeciesId.MAGIKARP)
|
||||||
.enemyAbility(AbilityId.BALL_FETCH)
|
.enemyAbility(AbilityId.STURDY)
|
||||||
.enemyMoveset(MoveId.SPLASH);
|
.enemyMoveset(MoveId.SPLASH);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should turn off the ignore abilities arena variable after the user's move", async () => {
|
it("should turn off the ignore abilities arena variable after the user's move", async () => {
|
||||||
game.override
|
await game.classicMode.startBattle([SpeciesId.PINSIR]);
|
||||||
.enemyMoveset(MoveId.SPLASH)
|
|
||||||
.ability(AbilityId.MOLD_BREAKER)
|
|
||||||
.moveset([MoveId.ERUPTION])
|
|
||||||
.startingLevel(100)
|
|
||||||
.enemyLevel(2);
|
|
||||||
await game.classicMode.startBattle([SpeciesId.MAGIKARP]);
|
|
||||||
const enemy = game.scene.getEnemyPokemon()!;
|
|
||||||
|
|
||||||
expect(enemy.isFainted()).toBe(false);
|
const player = game.field.getPlayerPokemon();
|
||||||
game.move.select(MoveId.SPLASH);
|
const enemy = game.field.getEnemyPokemon();
|
||||||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY]);
|
|
||||||
await game.phaseInterceptor.to("MoveEndPhase", true);
|
game.move.use(MoveId.X_SCISSOR);
|
||||||
expect(globalScene.arena.ignoreAbilities).toBe(false);
|
await game.phaseInterceptor.to("MoveEffectPhase");
|
||||||
|
|
||||||
|
expect(game.scene.arena.ignoreAbilities).toBe(true);
|
||||||
|
expect(game.scene.arena.ignoringEffectSource).toBe(player.getBattlerIndex());
|
||||||
|
|
||||||
|
await game.toEndOfTurn();
|
||||||
|
expect(game.scene.arena.ignoreAbilities).toBe(false);
|
||||||
|
expect(enemy.isFainted()).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -58,8 +58,7 @@ describe("Items - Dire Hit", () => {
|
|||||||
|
|
||||||
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
|
await game.classicMode.startBattle([SpeciesId.PIKACHU]);
|
||||||
|
|
||||||
game.move.select(MoveId.SPLASH);
|
game.move.use(MoveId.SPLASH);
|
||||||
|
|
||||||
await game.doKillOpponents();
|
await game.doKillOpponents();
|
||||||
|
|
||||||
await game.phaseInterceptor.to(BattleEndPhase);
|
await game.phaseInterceptor.to(BattleEndPhase);
|
||||||
|
@ -64,13 +64,13 @@ export class MoveHelper extends GameManagerHelper {
|
|||||||
const movePosition = this.getMovePosition(pkmIndex, move);
|
const movePosition = this.getMovePosition(pkmIndex, move);
|
||||||
if (movePosition === -1) {
|
if (movePosition === -1) {
|
||||||
expect.fail(
|
expect.fail(
|
||||||
`MoveHelper.select called with move ${toReadableString(MoveId[move])} not in moveset!
|
`MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset!
|
||||||
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
|
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
|
||||||
Moveset: ${this.game.scene
|
Moveset: [${this.game.scene
|
||||||
.getField()
|
.getPlayerParty()
|
||||||
[pkmIndex].getMoveset()
|
[pkmIndex].getMoveset()
|
||||||
.map(pm => toReadableString(MoveId[pm.moveId]))
|
.map(pm => toReadableString(MoveId[pm.moveId]))
|
||||||
.join(", ")}`,
|
.join(", ")}]`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,11 +110,11 @@ export class MoveHelper extends GameManagerHelper {
|
|||||||
expect.fail(
|
expect.fail(
|
||||||
`MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset!
|
`MoveHelper.selectWithTera called with move '${toReadableString(MoveId[move])}' not in moveset!
|
||||||
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
|
Battler Index: ${toReadableString(BattlerIndex[pkmIndex])};
|
||||||
Moveset: ${this.game.scene
|
Moveset: [${this.game.scene
|
||||||
.getField()
|
.getPlayerParty()
|
||||||
[pkmIndex].getMoveset()
|
[pkmIndex].getMoveset()
|
||||||
.map(pm => toReadableString(MoveId[pm.moveId]))
|
.map(pm => toReadableString(MoveId[pm.moveId]))
|
||||||
.join(", ")}`,
|
.join(", ")}]`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user