mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-04-22 17:44:19 +01:00
* Extract Mode enum out of UI and into its own file Reduces circular imports from 909 to 773 * Move around utility files Reduces cyclical dependencies from 773 to 765 * Remove starterColors and bypassLogin from battle-scene Reduces cyclical dependencies from 765 to 623 * Fix test runner error * Update import for bypassLogin in test * Update mocks for utils in tests * Fix broken tests * Update selectWithTera override * Update path for utils in ab-attr.ts * Update path for utils in ability-class.ts * Fix utils import path in healer.test.ts
41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { Abilities } from "#app/enums/abilities";
|
|
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(Abilities.BALL_FETCH);
|
|
game.override.ability(Abilities.BALL_FETCH);
|
|
game.override.battleStyle("single");
|
|
});
|
|
|
|
it("EXP booster items stack multiplicatively", async () => {
|
|
game.override.startingHeldItems([{ name: "LUCKY_EGG", count: 3 }, { name: "GOLDEN_EGG" }]);
|
|
await game.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);
|
|
});
|