Added new function and updated tests

This commit is contained in:
frutescens 2024-09-01 15:05:29 -07:00
parent e2feddaf62
commit 334f30e49a
2 changed files with 12 additions and 2 deletions

View File

@ -4,7 +4,6 @@ import GameManager from "#test/utils/gameManager";
import { Species } from "#enums/species";
import { Moves } from "#enums/moves";
import { LearnMovePhase } from "#app/phases/learn-move-phase";
import Overrides from "#app/overrides";
describe("Learn Move Phase", () => {
let phaserGame: Phaser.Game;
@ -22,7 +21,7 @@ describe("Learn Move Phase", () => {
beforeEach(() => {
game = new GameManager(phaserGame);
Overrides.XP_MULTIPLIER_OVERRIDE = 50;
game.override.xpMultiplier(50);
});
it("If Pokemon has less than 4 moves, its newest move will be added to the lowest empty index", async () => {

View File

@ -48,6 +48,17 @@ export class OverridesHelper extends GameManagerHelper {
return this;
}
/**
* Override the XP Multiplier
* @param value the XP multiplier to set
* @returns this
*/
xpMultiplier(value: number): this {
vi.spyOn(Overrides, "XP_MULTIPLIER_OVERRIDE", "get").mockReturnValue(value);
this.log(`XP Multiplier set to ${value}!`);
return this;
}
/**
* Override the player (pokemon) starting held items
* @param items the items to hold