mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 23:13:42 +02:00
* Added more biome rules * Fixes * Added a few more rules * Added global phaser to biome * Fix tpyo * Updated biome to 2.1.4; improved docs on linting/localization; added vcs support Also added `.build` to gitignore cuz reasons * Fixed tpyo * dd * Applied linter fixes * Partially fixed some private property issues * Upgraded to Biome 2.2.0; added `operatorLinebreak` and a few new rules * Moved operator linebreaks before lines * Applied kev's suggestions * Update biome.jsonc Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * added like all the rules and then some * modify biome.jsonc * apply biome formatting * Reverted changes to balance folder * fixed stuff * Fixed biome stripping trailing globstars from everything * made `noInvertedElse` an error rule * Add & apply fixes for `useExplicitLengthCheck`, `useAtIndex` and `noNonNullAssertedOptionalChain` * Bumped biome to 2.2.3 * Fixed a few syntax errors * Removed trailing globstars since biome actually fixed their shit * Final clean up * foobarbaz * Fixed remaining issues * Fixed a few errors in SSUI * fixed rounding issue * Fixed test to not round funky * Fixed biome false positive for vitest hooks * Apply biome:all --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com>
57 lines
1.9 KiB
TypeScript
57 lines
1.9 KiB
TypeScript
import { Status } from "#data/status-effect";
|
|
import { AbilityId } from "#enums/ability-id";
|
|
import { MoveId } from "#enums/move-id";
|
|
import { SpeciesId } from "#enums/species-id";
|
|
import { StatusEffect } from "#enums/status-effect";
|
|
import { QuietFormChangePhase } from "#phases/quiet-form-change-phase";
|
|
import { TurnEndPhase } from "#phases/turn-end-phase";
|
|
import { GameManager } from "#test/test-utils/game-manager";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
|
|
|
|
describe("Abilities - SCHOOLING", () => {
|
|
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 = MoveId.SPLASH;
|
|
game.override.battleStyle("single").ability(AbilityId.SCHOOLING).moveset([moveToUse]).enemyMoveset(MoveId.TACKLE);
|
|
});
|
|
|
|
test("check if fainted pokemon switches to base form on arena reset", async () => {
|
|
const soloForm = 0;
|
|
const schoolForm = 1;
|
|
game.override.startingWave(4).starterForms({
|
|
[SpeciesId.WISHIWASHI]: schoolForm,
|
|
});
|
|
|
|
await game.classicMode.startBattle([SpeciesId.MAGIKARP, SpeciesId.WISHIWASHI]);
|
|
|
|
const wishiwashi = game.scene.getPlayerParty().find(p => p.species.speciesId === SpeciesId.WISHIWASHI)!;
|
|
expect(wishiwashi).not.toBe(undefined);
|
|
expect(wishiwashi.formIndex).toBe(schoolForm);
|
|
|
|
wishiwashi.hp = 0;
|
|
wishiwashi.status = new Status(StatusEffect.FAINT);
|
|
expect(wishiwashi.isFainted()).toBe(true);
|
|
|
|
game.move.select(MoveId.SPLASH);
|
|
await game.doKillOpponents();
|
|
await game.phaseInterceptor.to(TurnEndPhase);
|
|
game.doSelectModifier();
|
|
await game.phaseInterceptor.to(QuietFormChangePhase);
|
|
|
|
expect(wishiwashi.formIndex).toBe(soloForm);
|
|
});
|
|
});
|