From 9258e973c013c3e629f511ecc6306c25d89e8cf6 Mon Sep 17 00:00:00 2001 From: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:04:34 -0500 Subject: [PATCH 1/5] Update src/field/pokemon.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/field/pokemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 4a7a7d7f6ad..9dec69745be 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -4807,7 +4807,7 @@ export class EnemyPokemon extends Pokemon { if (moveQueue.length !== 0) { const queuedMove = moveQueue[0]; if (queuedMove) { - const moveIndex = this.getMoveset().findIndex(m => m?.moveId === moveQueue[0].move); + const moveIndex = this.getMoveset().findIndex(m => m?.moveId === queuedMove.move); if ((moveIndex > -1 && this.getMoveset()[moveIndex]!.isUsable(this, queuedMove.ignorePP)) || queuedMove.virtual) { return queuedMove; } else { From 7f46670192f1d849cdfabf4ba0e8c7c2ceedea7f Mon Sep 17 00:00:00 2001 From: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:05:17 -0500 Subject: [PATCH 2/5] Update src/phases/command-phase.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/phases/command-phase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index f96a738431b..e1f08f5522b 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -84,7 +84,7 @@ export class CommandPhase extends FieldPhase { if (moveQueue.length !== 0) { const queuedMove = moveQueue[0]; if (!queuedMove.move) { - this.handleCommand(Command.FIGHT, -1, undefined); + this.handleCommand(Command.FIGHT, -1); } else { const moveIndex = playerPokemon.getMoveset().findIndex(m => m?.moveId === queuedMove.move); if ((moveIndex > -1 && playerPokemon.getMoveset()[moveIndex]!.isUsable(playerPokemon, queuedMove.ignorePP)) || queuedMove.virtual) { // TODO: is the bang correct? From 5ccd18416c57d03598f48cd09cb12680709d5992 Mon Sep 17 00:00:00 2001 From: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:05:33 -0500 Subject: [PATCH 3/5] Update src/phases/command-phase.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/phases/command-phase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phases/command-phase.ts b/src/phases/command-phase.ts index e1f08f5522b..b1780123197 100644 --- a/src/phases/command-phase.ts +++ b/src/phases/command-phase.ts @@ -81,7 +81,7 @@ export class CommandPhase extends FieldPhase { moveQueue.shift(); } - if (moveQueue.length !== 0) { + if (moveQueue.length > 0) { const queuedMove = moveQueue[0]; if (!queuedMove.move) { this.handleCommand(Command.FIGHT, -1); From ab0d149ef44985355d92d4781524b5c36b1b922d Mon Sep 17 00:00:00 2001 From: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:05:48 -0500 Subject: [PATCH 4/5] Update src/data/move.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/move.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index 6405419f81d..175ab0835a9 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6494,7 +6494,7 @@ export class CallMoveAttr extends OverrideMoveEffectAttr { } /** - * Attribute used to call a random move + * Attribute used to call a random move. * Used for {@linkcode Moves.METRONOME} * @see {@linkcode apply} for move selection and move call * @extends OverrideMoveEffectAttr From c403574b746076c64bd4321dbd270e3275659660 Mon Sep 17 00:00:00 2001 From: schmidtc1 <62030095+schmidtc1@users.noreply.github.com> Date: Sun, 29 Dec 2024 10:06:32 -0500 Subject: [PATCH 5/5] Update src/data/move.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> --- src/data/move.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 175ab0835a9..cca0ad30949 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -6514,12 +6514,12 @@ export class RandomMoveAttr extends CallMoveAttr { /** * User calls a random moveId - * @param {Pokemon} user Pokemon that used the move and will call a random move - * @param {Pokemon} target Pokemon that will be targeted by the random move (if single target) - * @param {Move} move Move being used - * @param {any[]} args Unused - * @returns {Promise} - * Invalid moves are indicated by what is passed in to invalidMoves: @constant {invalidMetronomeMoves} + * + * Invalid moves are indicated by what is passed in to invalidMoves: {@linkcode invalidMetronomeMoves} + * @param user Pokemon that used the move and will call a random move + * @param target Pokemon that will be targeted by the random move (if single target) + * @param move Move being used + * @param args Unused */ apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise { const moveIds = Utils.getEnumValues(Moves).map(m => !this.invalidMoves.includes(m) && !allMoves[m].name.endsWith(" (N)") ? m : Moves.NONE);