[TEST]: Ensure Rattled triggers from Intimidate before player switches out

This commit is contained in:
dobin 2025-06-06 23:55:46 +09:00
parent 92e45fba81
commit 6bf78cd732

View File

@ -49,4 +49,19 @@ describe("Abilities - Rattled", () => {
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-1);
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
});
it("should activate Rattled from Intimidate before the Pokémon is switched out.", async () => {
game.override.enemyLevel(100); // Ensures the opponent switches first by overriding their Pokémon's level to 100.
await game.classicMode.startBattle([SpeciesId.GIMMIGHOUL, SpeciesId.BULBASAUR]);
const playerPokemon = game.field.getPlayerPokemon();
game.forceEnemyToSwitch();
game.doSwitchPokemon(1);
await game.phaseInterceptor.to("StatStageChangePhase");
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(-2);
await game.phaseInterceptor.to("StatStageChangePhase");
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(2);
});
});