Added test override for pokeballs

This commit is contained in:
Wlowscha 2025-07-13 13:04:46 +02:00
parent eaead476e8
commit e034d7e04e
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 14 additions and 1 deletions

View File

@ -33,7 +33,7 @@ describe("Move - Payback", () => {
.enemySpecies(SpeciesId.DRACOVISH)
.enemyAbility(AbilityId.BALL_FETCH)
.enemyMoveset(MoveId.SPLASH)
.startingModifier([{ name: "POKEBALL", count: 5 }]);
.startingPokeballs({ [PokeballType.POKEBALL]: 5 });
powerSpy = vi.spyOn(allMoves[MoveId.PAYBACK], "calculateBattlePower");
});

View File

@ -1,7 +1,9 @@
/** biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */
import type { NewArenaEvent } from "#events/battle-scene";
/** biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */
import type { PokeballCounts } from "#app/battle-scene";
import type { BattleStyle, RandomTrainerOverride } from "#app/overrides";
import Overrides, { defaultOverrides } from "#app/overrides";
import { AbilityId } from "#enums/ability-id";
@ -134,6 +136,17 @@ export class OverridesHelper extends GameManagerHelper {
return this;
}
/**
* Override the player's starting pokeballs
* @param items - The items to hold
* @returns `this`
*/
public startingPokeballs(pokeballs: PokeballCounts): this {
vi.spyOn(Overrides, "POKEBALL_OVERRIDE", "get").mockReturnValue({ active: true, pokeballs: pokeballs });
this.log("Player Pokemon starting held items set to:", { active: true, pokeballs: pokeballs });
return this;
}
/**
* Override the player pokemon's {@linkcode SpeciesId | species}
* @param species - The {@linkcode SpeciesId | species} to set