mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-06 01:47:30 +00:00
* Create Getters, Setters, and Types * Work on `pokemon.ts` * Adjust Types, Refactor `White Herb` Modifier * Migrate `TempBattleStat` Usage * Refactor `PokemonBaseStatModifier` Slightly * Remove `BattleStat`, Use "Stat Stages" & New Names * Address Phase `integers` * Finalize `BattleStat` Removal * Address Minor Manual NITs * Apply Own Review Suggestions * Fix Syntax Error * Add Docs * Overhaul X Items * Implement Guard and Power Split with Unit Tests * Add Several Unit Tests and Fixes * Implement Speed Swap with Unit Tests * Fix Keys in Summary Menu * Fix Starf Berry Raising EVA and ACC * Fix Contrary & Simple, Verify with Unit Tests * Implement Power & Guard Swap with Unit Tests * Add Move Effect Message to Speed Swap * Add Move Effect Message to Power & Guard Split * Add Localization Entries * Adjust Last X Item Unit Test * Overhaul X Items Unit Tests * Finish Missing Docs * Revamp Crit-Based Unit Tests & Dire Hit * Address Initial NITs * Apply NIT Batch Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> * Fix Moody Test * Address Multiple Messages for `ProtectStatAbAttr` * Change `ignoreOverride` to `bypassSummonData` * Adjust Italian Localization Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com> * Fix Moody --------- Co-authored-by: flx-sta <50131232+flx-sta@users.noreply.github.com> Co-authored-by: Niccolò <123510358+NicusPulcis@users.noreply.github.com>
68 lines
2.1 KiB
TypeScript
68 lines
2.1 KiB
TypeScript
import { Stat } from "#enums/stat";
|
|
import { EnemyCommandPhase } from "#app/phases/enemy-command-phase";
|
|
import { TurnEndPhase } from "#app/phases/turn-end-phase";
|
|
import { Moves } from "#enums/moves";
|
|
import { Species } from "#enums/species";
|
|
import GameManager from "#test/utils/gameManager";
|
|
import Phaser from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
|
|
describe("Moves - Tackle", () => {
|
|
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.TACKLE;
|
|
game.override.battleType("single");
|
|
game.override.enemySpecies(Species.MAGIKARP);
|
|
game.override.startingLevel(1);
|
|
game.override.startingWave(97);
|
|
game.override.moveset([moveToUse]);
|
|
game.override.enemyMoveset([Moves.GROWTH, Moves.GROWTH, Moves.GROWTH, Moves.GROWTH]);
|
|
game.override.disableCrits();
|
|
});
|
|
|
|
it("TACKLE against ghost", async () => {
|
|
const moveToUse = Moves.TACKLE;
|
|
game.override.enemySpecies(Species.GENGAR);
|
|
await game.startBattle([
|
|
Species.MIGHTYENA,
|
|
]);
|
|
const hpOpponent = game.scene.currentBattle.enemyParty[0].hp;
|
|
game.move.select(moveToUse);
|
|
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnEndPhase);
|
|
const hpLost = hpOpponent - game.scene.currentBattle.enemyParty[0].hp;
|
|
expect(hpLost).toBe(0);
|
|
}, 20000);
|
|
|
|
it("TACKLE against not resistant", async () => {
|
|
const moveToUse = Moves.TACKLE;
|
|
await game.startBattle([
|
|
Species.MIGHTYENA,
|
|
]);
|
|
game.scene.currentBattle.enemyParty[0].stats[Stat.DEF] = 50;
|
|
game.scene.getParty()[0].stats[Stat.ATK] = 50;
|
|
|
|
|
|
const hpOpponent = game.scene.currentBattle.enemyParty[0].hp;
|
|
|
|
game.move.select(moveToUse);
|
|
await game.phaseInterceptor.runFrom(EnemyCommandPhase).to(TurnEndPhase);
|
|
const hpLost = hpOpponent - game.scene.currentBattle.enemyParty[0].hp;
|
|
expect(hpLost).toBeGreaterThan(0);
|
|
expect(hpLost).toBeLessThan(4);
|
|
}, 20000);
|
|
});
|