From 9f2a785fddb995401a663202794a3f635091b4ae Mon Sep 17 00:00:00 2001 From: NightKev <34855794+DayKev@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:37:42 -0700 Subject: [PATCH] Separate tag lapsing out of the status resolution function --- src/phases/move-phase.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/phases/move-phase.ts b/src/phases/move-phase.ts index e94bf3557d3..a2573abf3a1 100644 --- a/src/phases/move-phase.ts +++ b/src/phases/move-phase.ts @@ -96,6 +96,8 @@ export class MovePhase extends BattlePhase { this.resolvePreMoveStatusEffects(); + this.lapsePreMoveAndMoveTags(); + this.resolveFinalPreMoveCancellationChecks(); if (this.cancelled || this.failed) { @@ -160,8 +162,13 @@ export class MovePhase extends BattlePhase { this.pokemon.updateInfo(); } } + } - // Lapse tags that triggered before a move is used, regardless of whether or not it failed. + /** + * Lapse `PRE_MOVE` tags that trigger before a move is used, regardless of whether or not it failed. + * Also lapse `MOVE` tags if the move should be successful. + */ + lapsePreMoveAndMoveTags() { this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE); // TODO: does this intentionally happen before the no targets/Moves.NONE on queue cancellation case is checked?