mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 08:22:16 +02:00
update retaliate test
This commit is contained in:
parent
89c19fa3af
commit
6b13f606a1
@ -1,10 +1,11 @@
|
|||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import GameManager from "#app/test/utils/gameManager";
|
import GameManager from "#app/test/utils/gameManager";
|
||||||
import { Species } from "#enums/species";
|
import { Species } from "#enums/species";
|
||||||
import { Moves } from "#enums/moves";
|
import { Moves } from "#enums/moves";
|
||||||
import { getMovePosition } from "#app/test/utils/gameManagerUtils";
|
|
||||||
import { allMoves } from "#app/data/move.js";
|
import { allMoves } from "#app/data/move.js";
|
||||||
|
import { MoveEffectPhase } from "#app/phases/move-effect-phase.js";
|
||||||
|
import { TurnEndPhase } from "#app/phases/turn-end-phase.js";
|
||||||
|
|
||||||
describe("Moves - Retaliate", () => {
|
describe("Moves - Retaliate", () => {
|
||||||
let phaserGame: Phaser.Game;
|
let phaserGame: Phaser.Game;
|
||||||
@ -26,7 +27,8 @@ describe("Moves - Retaliate", () => {
|
|||||||
game = new GameManager(phaserGame);
|
game = new GameManager(phaserGame);
|
||||||
game.override.battleType("single");
|
game.override.battleType("single");
|
||||||
game.override.enemySpecies(Species.SNORLAX);
|
game.override.enemySpecies(Species.SNORLAX);
|
||||||
game.override.enemyMoveset([Moves.RETALIATE, Moves.RETALIATE, Moves.RETALIATE, Moves.RETALIATE]);
|
game.override.enemyMoveset([Moves.GIGA_IMPACT, Moves.GIGA_IMPACT, Moves.GIGA_IMPACT, Moves.GIGA_IMPACT]);
|
||||||
|
game.override.enemyHeldItems([{name: "WIDE_LENS", count: 3}]);
|
||||||
game.override.enemyLevel(100);
|
game.override.enemyLevel(100);
|
||||||
|
|
||||||
game.override.moveset([Moves.RETALIATE, Moves.SPLASH]);
|
game.override.moveset([Moves.RETALIATE, Moves.SPLASH]);
|
||||||
@ -36,17 +38,18 @@ describe("Moves - Retaliate", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("increases power if ally died previous turn", async () => {
|
it("increases power if ally died previous turn", async () => {
|
||||||
|
vi.spyOn(retaliate, "calculateBattlePower");
|
||||||
await game.startBattle([Species.ABRA, Species.COBALION]);
|
await game.startBattle([Species.ABRA, Species.COBALION]);
|
||||||
expect(retaliate.calculateBattlePower(game.scene.getPlayerPokemon()!, game.scene.getEnemyPokemon()!)).equals(70);
|
game.move.select(Moves.RETALIATE);
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
expect(retaliate.calculateBattlePower).toHaveLastReturnedWith(70);
|
||||||
game.doSelectPartyPokemon(1);
|
game.doSelectPartyPokemon(1);
|
||||||
|
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.SPLASH));
|
game.move.select(Moves.RETALIATE);
|
||||||
const snorlax = game.scene.getEnemyPokemon()!;
|
await game.phaseInterceptor.to(MoveEffectPhase);
|
||||||
const cobalion = game.scene.getPlayerPokemon()!;
|
const cobalion = game.scene.getPlayerPokemon()!;
|
||||||
expect(cobalion.name).equals("Cobalion");
|
expect(cobalion.name).equals("Cobalion");
|
||||||
expect(retaliate.calculateBattlePower(cobalion, snorlax)).equals(140);
|
expect(retaliate.calculateBattlePower).toHaveReturnedWith(140);
|
||||||
expect(retaliate.calculateBattlePower(snorlax, cobalion)).equals(70);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user