Add PostSummonRemoveBattlerTag and give it to oblivious and own tempo

This commit is contained in:
Dean 2025-02-23 22:25:41 -08:00
parent 0c3c918cbc
commit 85925ee727

View File

@ -2208,6 +2208,29 @@ export class PostSummonAddBattlerTagAbAttr extends PostSummonAbAttr {
} }
} }
export class PostSummonRemoveBattlerTagAbAttr extends PostSummonAbAttr {
private immuneTags: BattlerTagType[];
private tagRemoved: BattlerTagType;
/**
* @param immuneEffects - The status effects to which the Pokémon is immune.
*/
constructor(...immuneTags: BattlerTagType[]) {
super();
this.immuneTags = immuneTags;
}
public override applyPostSummon(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
let removed = false;
for (const tag of this.immuneTags) {
if (pokemon.removeTag(tag)) {
removed = true;
}
}
return removed;
}
}
export class PostSummonStatStageChangeAbAttr extends PostSummonAbAttr { export class PostSummonStatStageChangeAbAttr extends PostSummonAbAttr {
private stats: BattleStat[]; private stats: BattleStat[];
private stages: number; private stages: number;
@ -6003,6 +6026,7 @@ export function initAbilities() {
.ignorable(), .ignorable(),
new Ability(Abilities.OBLIVIOUS, 3) new Ability(Abilities.OBLIVIOUS, 3)
.attr(BattlerTagImmunityAbAttr, [ BattlerTagType.INFATUATED, BattlerTagType.TAUNT ]) .attr(BattlerTagImmunityAbAttr, [ BattlerTagType.INFATUATED, BattlerTagType.TAUNT ])
.attr(PostSummonRemoveBattlerTagAbAttr, BattlerTagType.INFATUATED, BattlerTagType.TAUNT)
.attr(IntimidateImmunityAbAttr) .attr(IntimidateImmunityAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.CLOUD_NINE, 3) new Ability(Abilities.CLOUD_NINE, 3)
@ -6033,6 +6057,7 @@ export function initAbilities() {
.ignorable(), .ignorable(),
new Ability(Abilities.OWN_TEMPO, 3) new Ability(Abilities.OWN_TEMPO, 3)
.attr(BattlerTagImmunityAbAttr, BattlerTagType.CONFUSED) .attr(BattlerTagImmunityAbAttr, BattlerTagType.CONFUSED)
.attr(PostSummonRemoveBattlerTagAbAttr, BattlerTagType.CONFUSED)
.attr(IntimidateImmunityAbAttr) .attr(IntimidateImmunityAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.SUCTION_CUPS, 3) new Ability(Abilities.SUCTION_CUPS, 3)