2024-07-25 15:51:05 -07:00
|
|
|
import { BattleStat } from "#app/data/battle-stat";
|
|
|
|
import { Stat } from "#app/data/pokemon-stat";
|
2024-08-22 06:49:33 -07:00
|
|
|
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
|
|
|
|
import { TurnInitPhase } from "#app/phases/turn-init-phase";
|
2024-06-13 18:44:23 -04:00
|
|
|
import { Abilities } from "#enums/abilities";
|
|
|
|
import { Moves } from "#enums/moves";
|
|
|
|
import { Species } from "#enums/species";
|
2024-08-22 06:49:33 -07:00
|
|
|
import GameManager from "#test/utils/gameManager";
|
2024-07-25 15:51:05 -07:00
|
|
|
import Phaser from "phaser";
|
|
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
2024-06-08 00:33:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
describe("Moves - Growth", () => {
|
|
|
|
let phaserGame: Phaser.Game;
|
|
|
|
let game: GameManager;
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
phaserGame = new Phaser.Game({
|
|
|
|
type: Phaser.HEADLESS,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
game.phaseInterceptor.restoreOg();
|
|
|
|
});
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
game = new GameManager(phaserGame);
|
|
|
|
const moveToUse = Moves.GROWTH;
|
2024-07-25 14:48:48 -07:00
|
|
|
game.override.battleType("single");
|
2024-07-25 14:57:47 -07:00
|
|
|
game.override.enemySpecies(Species.RATTATA);
|
2024-07-25 15:05:32 -07:00
|
|
|
game.override.enemyAbility(Abilities.MOXIE);
|
2024-07-25 15:35:20 -07:00
|
|
|
game.override.ability(Abilities.INSOMNIA);
|
2024-07-25 15:29:19 -07:00
|
|
|
game.override.startingLevel(2000);
|
2024-07-25 15:51:05 -07:00
|
|
|
game.override.moveset([moveToUse]);
|
2024-08-22 06:49:33 -07:00
|
|
|
game.override.enemyMoveset([Moves.TACKLE, Moves.TACKLE, Moves.TACKLE, Moves.TACKLE]);
|
2024-06-08 00:33:45 +02:00
|
|
|
});
|
|
|
|
|
2024-08-22 06:49:33 -07:00
|
|
|
it("GROWTH", async () => {
|
2024-06-08 00:33:45 +02:00
|
|
|
const moveToUse = Moves.GROWTH;
|
|
|
|
await game.startBattle([
|
|
|
|
Species.MIGHTYENA,
|
|
|
|
Species.MIGHTYENA,
|
|
|
|
]);
|
|
|
|
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
|
|
|
expect(battleStatsPokemon[Stat.SPATK]).toBe(0);
|
|
|
|
|
|
|
|
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
|
|
|
|
expect(battleStatsOpponent[BattleStat.SPATK]).toBe(0);
|
|
|
|
|
2024-08-22 06:49:33 -07:00
|
|
|
game.move.select(moveToUse);
|
2024-06-08 00:33:45 +02:00
|
|
|
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnInitPhase);
|
|
|
|
battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
|
|
|
|
expect(battleStatsPokemon[BattleStat.SPATK]).toBe(1);
|
|
|
|
}, 20000);
|
|
|
|
});
|