diff --git a/src/data/ability.ts b/src/data/ability.ts index a811da27b9f..491a14ba621 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2540,6 +2540,7 @@ export class PreApplyBattlerTagAbAttr extends AbAttr { */ export class PreApplyBattlerTagImmunityAbAttr extends PreApplyBattlerTagAbAttr { private immuneTagType: BattlerTagType; + private battlerTag: BattlerTag; constructor(immuneTagType: BattlerTagType) { super(); @@ -2550,6 +2551,7 @@ export class PreApplyBattlerTagImmunityAbAttr extends PreApplyBattlerTagAbAttr { applyPreApplyBattlerTag(pokemon: Pokemon, passive: boolean, tag: BattlerTag, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (tag.tagType === this.immuneTagType) { cancelled.value = true; + this.battlerTag = tag; return true; } @@ -2560,7 +2562,7 @@ export class PreApplyBattlerTagImmunityAbAttr extends PreApplyBattlerTagAbAttr { return i18next.t("abilityTriggers:battlerTagImmunity", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), abilityName, - battlerTagName: (args[0] as BattlerTag).getDescriptor() + battlerTagName: this.battlerTag.getDescriptor() }); } } @@ -4837,7 +4839,7 @@ export function initAbilities() { .attr(MoveTypeChangeAttr, Type.ICE, 1.2, (user, target, move) => move.type === Type.NORMAL), new Ability(Abilities.SWEET_VEIL, 6) .attr(UserFieldStatusEffectImmunityAbAttr, StatusEffect.SLEEP) - .attr(BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) + .attr(UserFieldBattlerTagImmunityAbAttr, BattlerTagType.DROWSY) .ignorable() .partial(), // Mold Breaker ally should not be affected by Sweet Veil new Ability(Abilities.STANCE_CHANGE, 6)