add missing changes to sweet veil(#3265)

This commit is contained in:
Adrian T. 2024-07-31 16:52:01 +08:00 committed by GitHub
parent 495284ad47
commit 59a4546a3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)