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;