From 8efe67c3c779a5e681b77ffbfbe25e8fb119b7c5 Mon Sep 17 00:00:00 2001 From: Dean <69436131+emdeann@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:34:30 -0800 Subject: [PATCH] Update move.ts (readability) Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/move.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index f78577c2921..bb1f9f79b50 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -7673,10 +7673,16 @@ export class ForceLastAttr extends MoveEffectAttr { if (targetMovePhase && !targetMovePhase.isForcedLast() && target.scene.tryRemovePhase((phase: MovePhase) => phase.pokemon === target)) { // Finding the phase to insert the move in front of - // Either the end of the turn or in front of another, slower move which has also been forced last - const prependPhase = target.scene.findPhase((phase) => [ MovePhase, MoveEndPhase ].every(cls => !(phase instanceof cls)) - || (phase instanceof MovePhase) && phaseForcedSlower(phase, target, !!target.scene.arena.getTag(ArenaTagType.TRICK_ROOM))); + const prependPhase = target.scene.findPhase((phase) => + [ MovePhase, MoveEndPhase ].every(cls => !(phase instanceof cls)) + || (phase instanceof MovePhase) && phaseForcedSlower(phase, target, !!target.scene.arena.getTag(ArenaTagType.TRICK_ROOM)) + ); if (prependPhase) { - target.scene.phaseQueue.splice(target.scene.phaseQueue.indexOf(prependPhase), 0, new MovePhase(target.scene, target, [ ...targetMovePhase.targets ], targetMovePhase.move, false, false, true)); + target.scene.phaseQueue.splice( + target.scene.phaseQueue.indexOf(prependPhase), + 0, + new MovePhase(target.scene, target, [ ...targetMovePhase.targets ], targetMovePhase.move, false, false, true) + ); } } return true;