mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-25 19:14:52 +01:00
* Add isPartner method to trainer class * Ensure force switches cannot pull pokemon from the wrong trainer * Add override for battle type * Fixup tests and broken assumptions * Make move fail override semi-invuln check Bandaid fix because move effect phase does not allow for the move to fail if all of its conditions fail * Restore overrides * Apply kev's suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Fix illusion test battle type invocation * Update struggle and healer tests to use battleStyle --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
50 lines
1.5 KiB
TypeScript
50 lines
1.5 KiB
TypeScript
import { BattlerIndex } from "#app/battle";
|
|
import { allMoves } from "#app/data/moves/move";
|
|
import { Abilities } from "#app/enums/abilities";
|
|
import { Moves } from "#enums/moves";
|
|
import { Species } from "#enums/species";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
describe("Moves - Lash Out", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
game.override
|
|
.battleStyle("single")
|
|
.disableCrits()
|
|
.enemySpecies(Species.MAGIKARP)
|
|
.enemyAbility(Abilities.FUR_COAT)
|
|
.enemyMoveset([Moves.GROWL])
|
|
.startingLevel(10)
|
|
.enemyLevel(10)
|
|
.starterSpecies(Species.FEEBAS)
|
|
.ability(Abilities.BALL_FETCH)
|
|
.moveset([Moves.LASH_OUT]);
|
|
});
|
|
|
|
it("should deal double damage if the user's stat stages were lowered this turn", async () => {
|
|
vi.spyOn(allMoves[Moves.LASH_OUT], "calculateBattlePower");
|
|
await game.classicMode.startBattle();
|
|
|
|
game.move.select(Moves.LASH_OUT);
|
|
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
|
|
await game.phaseInterceptor.to("BerryPhase");
|
|
|
|
expect(allMoves[Moves.LASH_OUT].calculateBattlePower).toHaveReturnedWith(150);
|
|
});
|
|
});
|