diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 276cfa035b8..6e8339dd54c 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -64,7 +64,7 @@ export abstract class ArenaTag { } } - onOverlap(_arena: Arena): void {} + onOverlap(_arena: Arena, _source: Pokemon | null): void {} lapse(_arena: Arena): boolean { return this.turnCount < 1 || !!--this.turnCount; @@ -706,7 +706,7 @@ export class ArenaTrapTag extends ArenaTag { this.maxLayers = maxLayers; } - onOverlap(arena: Arena): void { + onOverlap(arena: Arena, _source: Pokemon | null): void { if (this.layers < this.maxLayers) { this.layers++; @@ -1427,11 +1427,7 @@ export class SuppressAbilitiesTag extends ArenaTag { public override onAdd(_arena: Arena): void { const pokemon = this.getSourcePokemon(); if (pokemon) { - globalScene.queueMessage( - i18next.t("arenaTag:neutralizingGasOnAdd", { - pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), - }), - ); + this.playActivationMessage(pokemon); for (const fieldPokemon of globalScene.getField(true)) { if (fieldPokemon && fieldPokemon.id !== pokemon.id) { @@ -1441,8 +1437,9 @@ export class SuppressAbilitiesTag extends ArenaTag { } } - public override onOverlap(_arena: Arena): void { + public override onOverlap(_arena: Arena, source: Pokemon | null): void { this.sourceCount++; + this.playActivationMessage(source); } public onSourceLeave(arena: Arena): void { @@ -1481,6 +1478,16 @@ export class SuppressAbilitiesTag extends ArenaTag { public isBeingRemoved() { return this.beingRemoved; } + + private playActivationMessage(pokemon: Pokemon | null) { + if (pokemon) { + globalScene.queueMessage( + i18next.t("arenaTag:neutralizingGasOnAdd", { + pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), + }), + ); + } + } } // TODO: swap `sourceMove` and `sourceId` and make `sourceMove` an optional parameter diff --git a/src/field/arena.ts b/src/field/arena.ts index 997b80b3237..2c538de890f 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -673,7 +673,7 @@ export class Arena { ): boolean { const existingTag = this.getTagOnSide(tagType, side); if (existingTag) { - existingTag.onOverlap(this); + existingTag.onOverlap(this, globalScene.getPokemonById(sourceId)); if (existingTag instanceof ArenaTrapTag) { const { tagType, side, turnCount, layers, maxLayers } = existingTag as ArenaTrapTag;