diff --git a/src/field/arena.ts b/src/field/arena.ts index 9897da7cfd77..dc9ad84f09d1 100644 --- a/src/field/arena.ts +++ b/src/field/arena.ts @@ -33,6 +33,7 @@ export class Arena { public tags: ArenaTag[]; public bgm: string; public ignoreAbilities: boolean; + public ignoringEffectSource: BattlerIndex | null; private lastTimeOfDay: TimeOfDay; @@ -569,8 +570,9 @@ export class Arena { } } - setIgnoreAbilities(ignoreAbilities: boolean = true): void { + setIgnoreAbilities(ignoreAbilities: boolean, ignoringEffectSource: BattlerIndex | null = null): void { this.ignoreAbilities = ignoreAbilities; + this.ignoringEffectSource = ignoreAbilities ? ignoringEffectSource : null; } /** diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 5af1d7c90a6f..a8d82003ca58 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1364,7 +1364,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (this.isFusion() && ability.hasAttr(NoFusionAbilityAbAttr)) { return false; } - if (this.scene?.arena.ignoreAbilities && ability.isIgnorable) { + const arena = this.scene?.arena; + if (arena.ignoreAbilities && arena.ignoringEffectSource !== this.getBattlerIndex() && ability.isIgnorable) { return false; } if (this.summonData?.abilitySuppressed && !ability.hasAttr(UnsuppressableAbilityAbAttr)) { diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index e63096360dde..0a75c32bac3f 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -74,7 +74,7 @@ export class MovePhase extends BattlePhase { if (!this.followUp) { if (this.move.getMove().checkFlag(MoveFlags.IGNORE_ABILITIES, this.pokemon, null)) { - this.scene.arena.setIgnoreAbilities(); + this.scene.arena.setIgnoreAbilities(true, this.pokemon.getBattlerIndex()); } } else { this.pokemon.turnData.hitsLeft = 0; // TODO: is `0` correct?