mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +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) {
|
private handleFightCommand(turnCommand: TurnCommand, pokemon: Pokemon) {
|
||||||
if (!turnCommand.move) {
|
const queuedMove = turnCommand.move;
|
||||||
|
if (!queuedMove) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const queuedMove = turnCommand.move;
|
|
||||||
|
|
||||||
// TODO: This seems somewhat dubious
|
// TODO: This seems somewhat dubious
|
||||||
const move =
|
const move =
|
||||||
pokemon.getMoveset().find(m => m.moveId === queuedMove.move && m.ppUsed < m.getMovePp()) ??
|
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);
|
globalScene.phaseManager.unshiftNew("MoveHeaderPhase", pokemon, move);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Review what a `-1` cursor means
|
globalScene.phaseManager.pushNew(
|
||||||
if (pokemon.isPlayer() && turnCommand.cursor === -1) {
|
"MovePhase",
|
||||||
globalScene.phaseManager.pushNew("MovePhase", pokemon, turnCommand.targets ?? queuedMove.targets, move);
|
pokemon,
|
||||||
} else {
|
turnCommand.targets ?? queuedMove.targets,
|
||||||
globalScene.phaseManager.pushNew(
|
move,
|
||||||
"MovePhase",
|
queuedMove.useMode,
|
||||||
pokemon,
|
);
|
||||||
turnCommand.targets ?? turnCommand.move.targets,
|
|
||||||
move,
|
|
||||||
false,
|
|
||||||
queuedMove.useMode,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user