mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-20 16:42:45 +02:00
Update turn-start-phase.ts
This commit is contained in:
parent
4ab2a33578
commit
93740ae3a2
@ -223,12 +223,11 @@ export class TurnStartPhase extends FieldPhase {
|
||||
}
|
||||
|
||||
private handleFightCommand(turnCommand: TurnCommand, pokemon: Pokemon) {
|
||||
if (!turnCommand.move) {
|
||||
const queuedMove = turnCommand.move;
|
||||
if (!queuedMove) {
|
||||
return;
|
||||
}
|
||||
|
||||
const queuedMove = turnCommand.move;
|
||||
|
||||
// TODO: This seems somewhat dubious
|
||||
const move =
|
||||
pokemon.getMoveset().find(m => m.moveId === queuedMove.move && m.ppUsed < m.getMovePp()) ??
|
||||
@ -238,18 +237,12 @@ export class TurnStartPhase extends FieldPhase {
|
||||
globalScene.phaseManager.unshiftNew("MoveHeaderPhase", pokemon, move);
|
||||
}
|
||||
|
||||
// TODO: Review what a `-1` cursor means
|
||||
if (pokemon.isPlayer() && turnCommand.cursor === -1) {
|
||||
globalScene.phaseManager.pushNew("MovePhase", pokemon, turnCommand.targets ?? queuedMove.targets, move);
|
||||
} else {
|
||||
globalScene.phaseManager.pushNew(
|
||||
"MovePhase",
|
||||
pokemon,
|
||||
turnCommand.targets ?? turnCommand.move.targets,
|
||||
move,
|
||||
false,
|
||||
queuedMove.useMode,
|
||||
);
|
||||
}
|
||||
globalScene.phaseManager.pushNew(
|
||||
"MovePhase",
|
||||
pokemon,
|
||||
turnCommand.targets ?? queuedMove.targets,
|
||||
move,
|
||||
queuedMove.useMode,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user