mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-20 22:39:31 +02:00
Cleaned up Bug Fix using frenzyMissFunc
This commit is contained in:
parent
01b71395d5
commit
15e34243e3
@ -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 });
|
||||
|
Loading…
Reference in New Issue
Block a user