Skip to content

Commit

Permalink
[Test] Update wimp out test and comment (#4900)
Browse files Browse the repository at this point in the history
* Changed conditional to actually consider the wave index.

* Added PigeonBar's test

* Added check for MEs + Documentation

* Apply suggestions from code review

Co-authored-by: PigeonBar <[email protected]>

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: PigeonBar <[email protected]>
  • Loading branch information
3 people authored Nov 17, 2024
1 parent 6b58d51 commit e825e30
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/data/ability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4951,6 +4951,7 @@ class ForceSwitchOutHelper {
}
/**
* For wild Pokémon battles, the Pokémon will flee if the conditions are met (waveIndex and double battles).
* It will not flee if it is a Mystery Encounter with fleeing disabled (checked in `getSwitchOutCondition()`) or if it is a wave 10x wild boss
*/
} else {
if (!pokemon.scene.currentBattle.waveIndex || pokemon.scene.currentBattle.waveIndex % 10 === 0) {
Expand Down
19 changes: 19 additions & 0 deletions src/test/abilities/wimp_out.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,4 +613,23 @@ describe("Abilities - Wimp Out", () => {

confirmNoSwitch();
});

it("should not activate on wave X0 bosses", async () => {
game.override.enemyAbility(Abilities.WIMP_OUT)
.startingLevel(5850)
.startingWave(10);
await game.classicMode.startBattle([ Species.GOLISOPOD ]);

const enemyPokemon = game.scene.getEnemyPokemon()!;

// Use 2 turns of False Swipe due to opponent's health bar shield
game.move.select(Moves.FALSE_SWIPE);
await game.toNextTurn();
game.move.select(Moves.FALSE_SWIPE);
await game.toNextTurn();

const isVisible = enemyPokemon.visible;
const hasFled = enemyPokemon.switchOutStatus;
expect(isVisible && !hasFled).toBe(true);
});
});

0 comments on commit e825e30

Please sign in to comment.