mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-09 00:49:27 +02:00
Added test override for pokeballs
This commit is contained in:
parent
eaead476e8
commit
e034d7e04e
@ -33,7 +33,7 @@ describe("Move - Payback", () => {
|
|||||||
.enemySpecies(SpeciesId.DRACOVISH)
|
.enemySpecies(SpeciesId.DRACOVISH)
|
||||||
.enemyAbility(AbilityId.BALL_FETCH)
|
.enemyAbility(AbilityId.BALL_FETCH)
|
||||||
.enemyMoveset(MoveId.SPLASH)
|
.enemyMoveset(MoveId.SPLASH)
|
||||||
.startingModifier([{ name: "POKEBALL", count: 5 }]);
|
.startingPokeballs({ [PokeballType.POKEBALL]: 5 });
|
||||||
|
|
||||||
powerSpy = vi.spyOn(allMoves[MoveId.PAYBACK], "calculateBattlePower");
|
powerSpy = vi.spyOn(allMoves[MoveId.PAYBACK], "calculateBattlePower");
|
||||||
});
|
});
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
/** biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */
|
/** biome-ignore-start lint/correctness/noUnusedImports: tsdoc imports */
|
||||||
import type { NewArenaEvent } from "#events/battle-scene";
|
import type { NewArenaEvent } from "#events/battle-scene";
|
||||||
|
|
||||||
/** biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */
|
/** biome-ignore-end lint/correctness/noUnusedImports: tsdoc imports */
|
||||||
|
|
||||||
|
import type { PokeballCounts } from "#app/battle-scene";
|
||||||
import type { BattleStyle, RandomTrainerOverride } from "#app/overrides";
|
import type { BattleStyle, RandomTrainerOverride } from "#app/overrides";
|
||||||
import Overrides, { defaultOverrides } from "#app/overrides";
|
import Overrides, { defaultOverrides } from "#app/overrides";
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
@ -134,6 +136,17 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
return this;
|
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}
|
* Override the player pokemon's {@linkcode SpeciesId | species}
|
||||||
* @param species - The {@linkcode SpeciesId | species} to set
|
* @param species - The {@linkcode SpeciesId | species} to set
|
||||||
|
Loading…
Reference in New Issue
Block a user