diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 31ad3337926..8a0da5f35c2 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -7521,7 +7521,7 @@ export class SuppressAbilitiesAttr extends MoveEffectAttr { /** Causes the effect to fail when the target's ability is unsupressable or already suppressed. */ getCondition(): MoveConditionFunc { - return (user, target, move) => target.getAbility().isSuppressable && !target.summonData.abilitySuppressed; + return (_user, target, _move) => !target.summonData.abilitySuppressed && (target.getAbility().isSuppressable || (target.hasPassive() && target.getPassiveAbility().isSuppressable)); } } diff --git a/test/moves/gastro_acid.test.ts b/test/moves/gastro_acid.test.ts index 8247d29c0a0..333619d16db 100644 --- a/test/moves/gastro_acid.test.ts +++ b/test/moves/gastro_acid.test.ts @@ -25,7 +25,7 @@ describe("Moves - Gastro Acid", () => { game.override.battleStyle("double"); game.override.startingLevel(1); game.override.enemyLevel(100); - game.override.ability(Abilities.NONE); + game.override.ability(Abilities.BALL_FETCH); game.override.moveset([Moves.GASTRO_ACID, Moves.WATER_GUN, Moves.SPLASH, Moves.CORE_ENFORCER]); game.override.enemySpecies(Species.BIDOOF); game.override.enemyMoveset(Moves.SPLASH); @@ -40,7 +40,7 @@ describe("Moves - Gastro Acid", () => { * - player mon 1 should have dealt damage, player mon 2 should have not */ - await game.startBattle(); + await game.classicMode.startBattle(); game.move.select(Moves.GASTRO_ACID, 0, BattlerIndex.ENEMY); game.move.select(Moves.SPLASH, 1); @@ -63,7 +63,7 @@ describe("Moves - Gastro Acid", () => { it("fails if used on an enemy with an already-suppressed ability", async () => { game.override.battleStyle("single"); - await game.startBattle(); + await game.classicMode.startBattle(); game.move.select(Moves.CORE_ENFORCER); // Force player to be slower to enable Core Enforcer to proc its suppression effect @@ -77,4 +77,27 @@ describe("Moves - Gastro Acid", () => { expect(game.scene.getPlayerPokemon()!.getLastXMoves()[0].result).toBe(MoveResult.FAIL); }); + + it("should suppress the passive of a target even if its main ability is unsuppressable and not suppress main abli", async () => { + game.override + .enemyAbility(Abilities.COMATOSE) + .enemyPassiveAbility(Abilities.WATER_ABSORB) + .moveset([Moves.SPLASH, Moves.GASTRO_ACID, Moves.WATER_GUN]); + await game.classicMode.startBattle([Species.MAGIKARP]); + + const enemyPokemon = game.scene.getEnemyPokemon(); + + game.move.select(Moves.GASTRO_ACID); + await game.toNextTurn(); + expect(enemyPokemon?.summonData.abilitySuppressed).toBe(true); + + game.move.select(Moves.WATER_GUN); + await game.toNextTurn(); + expect(enemyPokemon?.getHpRatio()).toBeLessThan(1); + + game.move.select(Moves.SPORE); + await game.phaseInterceptor.to("BerryPhase"); + + expect(enemyPokemon?.status?.effect).toBeFalsy(); + }); });