Update move.ts (readability)
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
054bd031ce
commit
8efe67c3c7
|
@ -7673,10 +7673,16 @@ export class ForceLastAttr extends MoveEffectAttr {
|
||||||
if (targetMovePhase && !targetMovePhase.isForcedLast() && target.scene.tryRemovePhase((phase: MovePhase) => phase.pokemon === target)) {
|
if (targetMovePhase && !targetMovePhase.isForcedLast() && target.scene.tryRemovePhase((phase: MovePhase) => phase.pokemon === target)) {
|
||||||
// Finding the phase to insert the move in front of -
|
// 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
|
// 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))
|
const prependPhase = target.scene.findPhase((phase) =>
|
||||||
|| (phase instanceof MovePhase) && phaseForcedSlower(phase, target, !!target.scene.arena.getTag(ArenaTagType.TRICK_ROOM)));
|
[ MovePhase, MoveEndPhase ].every(cls => !(phase instanceof cls))
|
||||||
|
|| (phase instanceof MovePhase) && phaseForcedSlower(phase, target, !!target.scene.arena.getTag(ArenaTagType.TRICK_ROOM))
|
||||||
|
);
|
||||||
if (prependPhase) {
|
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;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue