diff --git a/src/data/move.ts b/src/data/move.ts index 3cd90fe6ba5..3b96c9072b4 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -553,6 +553,31 @@ export class MoveEffectAttr extends MoveAttr { } } +export class RemoveBeakBlastTagArr extends MoveEffectAttr { + constructor() { + super(true, MoveEffectTrigger.PRE_APPLY, false); + } + + canApply(user: Pokemon, target: Pokemon, move: Move, args: any[]) { + // We want to remove the tag at the start of the second portion of beak blast + // to not burn lower priority contact moves like dragon tail: + // we want to return false if checking during the move effect phase of the first portion, + // and return true if checking during the move effect phase of the second portion. + // We can check the user's previous move to see if it was beak blast's (690) first portion or not + + return (user.getLastXMoves(1)[0] && user.getLastXMoves(1)[0].move == Moves.BEAK_BLAST); + } + + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]) { + const canApply = this.canApply(user, target, move, args); + + if (canApply) + user.removeTag(BattlerTagType.BEAK_BLAST); + + return canApply; + } +} + export class PreMoveMessageAttr extends MoveAttr { private message: string | ((user: Pokemon, target: Pokemon, move: Move) => string); @@ -6341,6 +6366,7 @@ export function initMoves() { .attr(ChargeAttr, ChargeAnim.BEAK_BLAST_CHARGING, "started\nheating up its beak!", BattlerTagType.BEAK_BLAST, true, true, -3) .ballBombMove() .makesContact(false) + .attr(RemoveBeakBlastTagArr) .partial(), new AttackMove(Moves.CLANGING_SCALES, Type.DRAGON, MoveCategory.SPECIAL, 110, 100, 5, 100, 0, 7) .attr(StatChangeAttr, BattleStat.DEF, -1, true)