mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
https://github.com/pagefaultgames/pokerogue/pull/5926 * Condensed all overrides into 1 line where possible I hope I got them all... * Fixed tests 0.5 * Cleaned up safeguard test to not use outdated code; fixed rest of errors * Fixed illusion test * Revert safeguart etst * Fixed battle tets * Fixed stuff * Fixed things2.0 * Fixed import issues * Revert changes outside of the tests directory * Revert changes outside of the tests directory --------- Co-authored-by: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { AbilityId } from "#enums/ability-id";
|
|
import { PokemonExpBoosterModifier } from "#app/modifier/modifier";
|
|
import { NumberHolder } from "#app/utils/common";
|
|
import GameManager from "#test/testUtils/gameManager";
|
|
import Phase from "phaser";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
|
|
describe("EXP Modifier Items", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phase.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
|
|
game.override.enemyAbility(AbilityId.BALL_FETCH).ability(AbilityId.BALL_FETCH).battleStyle("single");
|
|
});
|
|
|
|
it("EXP booster items stack multiplicatively", async () => {
|
|
game.override.startingHeldItems([{ name: "LUCKY_EGG", count: 3 }, { name: "GOLDEN_EGG" }]);
|
|
await game.classicMode.startBattle();
|
|
|
|
const partyMember = game.scene.getPlayerPokemon()!;
|
|
partyMember.exp = 100;
|
|
const expHolder = new NumberHolder(partyMember.exp);
|
|
game.scene.applyModifiers(PokemonExpBoosterModifier, true, partyMember, expHolder);
|
|
expect(expHolder.value).toBe(440);
|
|
}, 20000);
|
|
});
|