mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-26 03:28:32 +00:00
[Bug] Fix softlock caused by shields down preventing faint status (#5252)
This commit is contained in:
parent
91a4333e96
commit
0d1dacbc7a
@ -2861,7 +2861,7 @@ export class PreSetStatusEffectImmunityAbAttr extends PreSetStatusAbAttr {
|
||||
* @returns A boolean indicating the result of the status application.
|
||||
*/
|
||||
applyPreSetStatus(pokemon: Pokemon, passive: boolean, simulated: boolean, effect: StatusEffect, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||
if (this.immuneEffects.length < 1 || this.immuneEffects.includes(effect)) {
|
||||
if (effect !== StatusEffect.FAINT && this.immuneEffects.length < 1 || this.immuneEffects.includes(effect)) {
|
||||
cancelled.value = true;
|
||||
return true;
|
||||
}
|
||||
|
@ -189,4 +189,19 @@ describe("Abilities - SHIELDS DOWN", () => {
|
||||
}
|
||||
);
|
||||
|
||||
test("should not prevent minior from receiving the fainted status effect in trainer battles", async () => {
|
||||
game.override.enemyMoveset([ Moves.TACKLE ]);
|
||||
game.override.moveset([ Moves.THUNDERBOLT ]);
|
||||
game.override.startingLevel(100);
|
||||
game.override.startingWave(5);
|
||||
game.override.enemySpecies(Species.MINIOR);
|
||||
await game.classicMode.startBattle([ Species.REGIELEKI ]);
|
||||
const minior = game.scene.getEnemyPokemon()!;
|
||||
|
||||
game.move.select(Moves.THUNDERBOLT);
|
||||
await game.toNextTurn();
|
||||
expect(minior.isFainted()).toBe(true);
|
||||
expect(minior.status?.effect).toBe(StatusEffect.FAINT);
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user