From 639f61597102908f6a2a6494e7818689e2b7cd25 Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 19 Feb 2025 15:45:24 -0800 Subject: [PATCH] Add documentation --- src/data/ability.ts | 10 ++++++++-- src/data/arena-tag.ts | 7 +++++++ src/test/abilities/neutralizing_gas.test.ts | 3 +-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 3dc54dedc04..d7d5e83af99 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2045,6 +2045,9 @@ export class PostSummonRemoveArenaTagAbAttr extends PostSummonAbAttr { } } +/** + * Generic class to add an arena tag upon switching in + */ export class PostSummonAddArenaTagAbAttr extends PostSummonAbAttr { private tagType: ArenaTagType; private turnCount: number; @@ -2779,6 +2782,9 @@ export class PreLeaveFieldClearWeatherAbAttr extends PreLeaveFieldAbAttr { } } +/** + * Updates the active {@linkcode SuppressAbilitiesTag} when a pokemon with {@linkcode Abilities.NEUTRALIZING_GAS} leaves the field + */ export class PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr extends PreLeaveFieldAbAttr { constructor() { super(false); @@ -2789,10 +2795,10 @@ export class PreLeaveFieldRemoveSuppressAbilitiesSourceAbAttr extends PreLeaveFi const suppressTag = globalScene.arena.getTag(ArenaTagType.NEUTRALIZING_GAS) as SuppressAbilitiesTag; if (suppressTag) { suppressTag.onSourceLeave(globalScene.arena); + return true; } - return false; } - return true; + return false; } } diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index be08c38c3d7..f2c97319e49 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -1221,6 +1221,13 @@ export class FairyLockTag extends ArenaTag { } +/** + * Arena tag class for {@link https://bulbapedia.bulbagarden.net/wiki/Neutralizing_Gas_(Ability) Neutralizing Gas} + * + * Keeps track of the number of pokemon on the field with Neutralizing Gas - If it drops to zero, the effect is ended and abilities are reactivated + * + * Additionally ends onLose abilities when it is activated + */ export class SuppressAbilitiesTag extends ArenaTag { sourceCount: number; diff --git a/src/test/abilities/neutralizing_gas.test.ts b/src/test/abilities/neutralizing_gas.test.ts index e3a577bf173..5e6a56f37ad 100644 --- a/src/test/abilities/neutralizing_gas.test.ts +++ b/src/test/abilities/neutralizing_gas.test.ts @@ -55,8 +55,7 @@ describe("Abilities - Neutralizing Gas", () => { expect(game.scene.getPlayerPokemon()?.getStatStage(Stat.ATK)).toBe(1); }); - // Note - this passes right now because ability order doesn't consider speed at all - it("should activate before other abilities", async () => { + it.todo("should activate before other abilities", async () => { game.override.enemySpecies(Species.ACCELGOR) .enemyLevel(100) .enemyAbility(Abilities.INTIMIDATE);