mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 06:49:35 +02:00
[P2 BUG] Implemented correct frenzy Tag and Movequeue reset should frenzy move fail (#4277)
This commit is contained in:
parent
cd8c9bcfd5
commit
01b71395d5
@ -412,7 +412,6 @@ export class MovePhase extends BattlePhase {
|
||||
* - Lapses `AFTER_MOVE` tags:
|
||||
* - This handles the effects of {@link Moves.SUBSTITUTE Substitute}
|
||||
* - Removes the second turn of charge moves
|
||||
* - Calls frenzyMissFunc {@link frenzyMissFunc} should the move be cancelled
|
||||
*
|
||||
* TODO: handle charge moves more gracefully
|
||||
*/
|
||||
@ -428,6 +427,21 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
|
||||
|
||||
this.pokemon.lapseTags(BattlerTagLapseType.MOVE_EFFECT);
|
||||
|
Loading…
Reference in New Issue
Block a user