Clarity in if statement
This commit is contained in:
parent
6c656d81de
commit
68ecc3dc19
|
@ -91,11 +91,11 @@ export class CommandPhase extends FieldPhase {
|
||||||
playerPokemon.trySelectMove(cursor, args[0] as boolean) ||
|
playerPokemon.trySelectMove(cursor, args[0] as boolean) ||
|
||||||
(useStruggle = cursor > -1 && !playerPokemon.getMoveset().filter(m => m?.isUsable(playerPokemon)).length)) {
|
(useStruggle = cursor > -1 && !playerPokemon.getMoveset().filter(m => m?.isUsable(playerPokemon)).length)) {
|
||||||
const turnMove: TurnMove | undefined = args.length === 1 ? (args[0] as TurnMove) : undefined;
|
const turnMove: TurnMove | undefined = args.length === 1 ? (args[0] as TurnMove) : undefined;
|
||||||
/* THIS NEEDS FURTHER TESTING */
|
|
||||||
let moveId: Moves;
|
let moveId: Moves;
|
||||||
if (useStruggle) {
|
if (useStruggle) {
|
||||||
moveId = Moves.STRUGGLE;
|
moveId = Moves.STRUGGLE;
|
||||||
} else if (turnMove) {
|
} else if (turnMove !== undefined) {
|
||||||
moveId = turnMove.move;
|
moveId = turnMove.move;
|
||||||
} else if (cursor > -1) {
|
} else if (cursor > -1) {
|
||||||
moveId = playerPokemon.getMoveset()[cursor]!.moveId;
|
moveId = playerPokemon.getMoveset()[cursor]!.moveId;
|
||||||
|
|
Loading…
Reference in New Issue