add OverridesHelper.startingHeldItems

This commit is contained in:
Felix Staud 2024-07-25 16:38:56 -07:00
parent a7b26355b0
commit 05a3142c13
1 changed files with 12 additions and 0 deletions

View File

@ -5,6 +5,7 @@ import { Moves } from "#app/enums/moves.js";
import { Species } from "#app/enums/species.js"; import { Species } from "#app/enums/species.js";
import * as GameMode from "#app/game-mode"; import * as GameMode from "#app/game-mode";
import { GameModes, getGameMode } from "#app/game-mode"; import { GameModes, getGameMode } from "#app/game-mode";
import { ModifierOverride } from "#app/modifier/modifier-type.js";
import Overrides from "#app/overrides"; import Overrides from "#app/overrides";
import GameManager from "#test/utils/gameManager"; import GameManager from "#test/utils/gameManager";
import { vi } from "vitest"; import { vi } from "vitest";
@ -52,6 +53,17 @@ export class OverridesHelper {
return this; return this;
} }
/**
* Override the player (pokemon) starting held items
* @param items the items to hold
* @returns this
*/
startingHeldItems(items: ModifierOverride[]) {
vi.spyOn(Overrides, "STARTING_HELD_ITEMS_OVERRIDE", "get").mockReturnValue(items);
this.log("Player Pokemon starting held items set to:", items);
return this;
}
/** /**
* Override the player (pokemon) {@linkcode Species | species} * Override the player (pokemon) {@linkcode Species | species}
* @param species the (pokemon) {@linkcode Species | species} to set * @param species the (pokemon) {@linkcode Species | species} to set