diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index 09a440f3caf..3272ecd7df6 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -3,7 +3,7 @@ import BattleScene from "#app/battle-scene"; import { applyAbAttrs, applyPostMoveUsedAbAttrs, applyPreAttackAbAttrs, BlockRedirectAbAttr, IncreasePpAbAttr, PokemonTypeChangeAbAttr, PostMoveUsedAbAttr, RedirectMoveAbAttr } from "#app/data/ability"; import { CommonAnim } from "#app/data/battle-anims"; import { BattlerTagLapseType, CenterOfAttentionTag } from "#app/data/battler-tags"; -import { allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, ChargeAttr, CopyMoveAttr, HealStatusEffectAttr, MoveFlags, PreMoveMessageAttr } from "#app/data/move"; +import { allMoves, applyMoveAttrs, BypassRedirectAttr, BypassSleepAttr, ChargeAttr, CopyMoveAttr, frenzyMissFunc, HealStatusEffectAttr, MoveFlags, PreMoveMessageAttr } from "#app/data/move"; import { SpeciesFormChangePreMoveTrigger } from "#app/data/pokemon-forms"; import { getStatusEffectActivationText, getStatusEffectHealText } from "#app/data/status-effect"; import { Type } from "#app/data/type"; @@ -427,19 +427,8 @@ export class MovePhase extends BattlePhase { this.scene.eventTarget.dispatchEvent(new MoveUsedEvent(this.pokemon?.id, this.move.getMove(), ppUsed)); } - if (this.cancelled) { - const moves = this.pokemon.getMoveQueue()[0]; - const tags = this.pokemon.summonData.tags; - const tag = tags.find(t => t.tagType === BattlerTagType.FRENZY); - if (tag) { - //remove BattlerTags - tag.onRemove(this.pokemon); - tags.splice(tags.indexOf(tag), 1); - //remove moves in moveQueue - while (this.pokemon.getMoveQueue().length && this.pokemon.getMoveQueue()[0].move === moves.move) { - this.pokemon.getMoveQueue().shift(); - } - } + if (this.cancelled && this.pokemon.summonData?.tags?.find(t => t.tagType === BattlerTagType.FRENZY)) { + frenzyMissFunc(this.pokemon, this.move.getMove()); } this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });