Remove boolean return type apply functions

This commit is contained in:
Dean 2025-02-16 01:27:58 -08:00
parent 2eb67a5d66
commit ddfce53c77
3 changed files with 374 additions and 694 deletions

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ export class ShowAbilityPhase extends PokemonPhase {
} else {
globalScene.currentBattle.lastPlayerInvolved = pokemon.getBattlerIndex() % 2;
}
globalScene.abilityBar.showAbility(this.pokemonName, this.abilityName, this.passive).then(() => {
if (pokemon?.battleData) {
pokemon.battleData.abilityRevealed = true;

View File

@ -71,7 +71,7 @@ describe("Moves - Secret Power", () => {
await game.classicMode.startBattle([ Species.BLASTOISE, Species.CHARIZARD ]);
const sereneGraceAttr = allAbilities[Abilities.SERENE_GRACE].getAttrs(MoveEffectChanceMultiplierAbAttr)[0];
vi.spyOn(sereneGraceAttr, "apply");
vi.spyOn(sereneGraceAttr, "canApply");
game.move.select(Moves.WATER_PLEDGE, 0, BattlerIndex.ENEMY);
game.move.select(Moves.FIRE_PLEDGE, 1, BattlerIndex.ENEMY_2);
@ -89,8 +89,8 @@ describe("Moves - Secret Power", () => {
await game.phaseInterceptor.to("BerryPhase", false);
expect(sereneGraceAttr.apply).toHaveBeenCalledOnce();
expect(sereneGraceAttr.apply).toHaveLastReturnedWith(true);
expect(sereneGraceAttr.canApply).toHaveBeenCalledOnce();
expect(sereneGraceAttr.canApply).toHaveLastReturnedWith(true);
expect(rainbowEffect.apply).toHaveBeenCalledTimes(0);
}