From 905fec92e9655822d050b6062828237efb417245 Mon Sep 17 00:00:00 2001 From: Dean <69436131+emdeann@users.noreply.github.com> Date: Wed, 26 Feb 2025 13:39:08 -0800 Subject: [PATCH] [Bug] Fix Neutralizing Gas not Deactivating on Faint and Capture (#5423) --- src/data/ability.ts | 3 ++- test/abilities/neutralizing_gas.test.ts | 27 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index dcbaa4026f4..8c4b2ba380a 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -6877,7 +6877,8 @@ export function initAbilities() { .attr(PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) - .attr(NoTransformAbilityAbAttr), + .attr(NoTransformAbilityAbAttr) + .bypassFaint(), new Ability(Abilities.PASTEL_VEIL, 8) .attr(PostSummonUserFieldRemoveStatusEffectAbAttr, StatusEffect.POISON, StatusEffect.TOXIC) .attr(UserFieldStatusEffectImmunityAbAttr, StatusEffect.POISON, StatusEffect.TOXIC) diff --git a/test/abilities/neutralizing_gas.test.ts b/test/abilities/neutralizing_gas.test.ts index 8b9c374f1cc..a0612078e64 100644 --- a/test/abilities/neutralizing_gas.test.ts +++ b/test/abilities/neutralizing_gas.test.ts @@ -2,6 +2,7 @@ import { BattlerIndex } from "#app/battle"; import { Abilities } from "#enums/abilities"; import { ArenaTagType } from "#enums/arena-tag-type"; import { Moves } from "#enums/moves"; +import { PokeballType } from "#enums/pokeball"; import { Species } from "#enums/species"; import { Stat } from "#enums/stat"; import GameManager from "#test/testUtils/gameManager"; @@ -135,4 +136,30 @@ describe("Abilities - Neutralizing Gas", () => { expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeUndefined(); }); + it("should deactivate when the pokemon faints", async () => { + game.override.ability(Abilities.BALL_FETCH) + .enemyAbility(Abilities.NEUTRALIZING_GAS); + + await game.classicMode.startBattle([ Species.FEEBAS ]); + game.move.select(Moves.SPLASH); + expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined(); + await game.doKillOpponents(); + + expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeUndefined(); + }); + + it("should deactivate upon catching a wild pokemon", async () => { + game.override + .battleType("single") + .enemyAbility(Abilities.NEUTRALIZING_GAS) + .ability(Abilities.BALL_FETCH); + await game.classicMode.startBattle([ Species.MAGIKARP ]); + expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeDefined(); + + game.scene.pokeballCounts[PokeballType.MASTER_BALL] = 1; + game.doThrowPokeball(PokeballType.MASTER_BALL); + await game.phaseInterceptor.to("TurnEndPhase"); + + expect(game.scene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS)).toBeUndefined(); + }); });