diff --git a/src/battle-phases.ts b/src/battle-phases.ts index 482a2d139..0f454fa35 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -1007,9 +1007,11 @@ export class CommandPhase extends FieldPhase { case Command.FIGHT: let useStruggle = false; if (cursor === -1 || playerPokemon.trySelectMove(cursor, args[0] as boolean) || (useStruggle = cursor > -1 && !playerPokemon.getMoveset().filter(m => m.isUsable(playerPokemon)).length)) { - const moveId = !useStruggle ? playerPokemon.getMoveset()[cursor].moveId : Moves.STRUGGLE; - const turnCommand: TurnCommand = { command: Command.FIGHT, cursor: cursor, move: cursor > -1 ? { move: moveId, targets: [] } : null, args: args }; - const moveTargets: MoveTargetSet = args.length < 3 ? getMoveTargets(playerPokemon, cursor > -1 ? moveId : Moves.NONE) : args[2]; + const moveId = !useStruggle ? cursor > -1 ? playerPokemon.getMoveset()[cursor].moveId : Moves.NONE : Moves.STRUGGLE; + const turnCommand: TurnCommand = { command: Command.FIGHT, cursor: cursor, move: { move: moveId, targets: [] }, args: args }; + const moveTargets: MoveTargetSet = args.length < 3 ? getMoveTargets(playerPokemon, moveId) : args[2]; + if (!moveId) + turnCommand.targets = [ this.fieldIndex ]; console.log(moveTargets, playerPokemon.name); if (moveTargets.targets.length <= 1 || moveTargets.multiple) turnCommand.move.targets = moveTargets.targets; @@ -1416,7 +1418,7 @@ export class MovePhase extends BattlePhase { console.log(Moves[this.move.moveId]); if (!this.canMove()) { - if (this.pokemon.summonData.disabledMove === this.move.moveId) + if (this.move.moveId && this.pokemon.summonData.disabledMove === this.move.moveId) this.scene.queueMessage(`${this.move.getName()} is disabled!`); this.end(); return; @@ -1457,7 +1459,9 @@ export class MovePhase extends BattlePhase { const moveQueue = this.pokemon.getMoveQueue(); - this.showMoveText(); + if (this.move.moveId) + this.showMoveText(); + if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) { moveQueue.shift(); this.cancel(); diff --git a/src/data/battler-tag.ts b/src/data/battler-tag.ts index 9d4fa3445..22b2651c3 100644 --- a/src/data/battler-tag.ts +++ b/src/data/battler-tag.ts @@ -110,7 +110,6 @@ export class RechargingTag extends BattlerTag { lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { super.lapse(pokemon, lapseType); - (pokemon.scene.getCurrentPhase() as MovePhase).cancel(); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' must\nrecharge!')); return true; diff --git a/src/data/move.ts b/src/data/move.ts index 8511459a9..ed4451599 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2378,7 +2378,7 @@ export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet { } export const allMoves: Move[] = [ - new StatusMove(Moves.NONE, "-", Type.NORMAL, MoveCategory.STATUS, -1, -1, "", -1, 0, 1), + new SelfStatusMove(Moves.NONE, "-", Type.NORMAL, MoveCategory.STATUS, -1, -1, "", -1, 0, 1), ]; export function initMoves() { diff --git a/src/pokemon.ts b/src/pokemon.ts index 233899812..d6c8ada96 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -2033,7 +2033,7 @@ export class PokemonMove { } isUsable(pokemon: Pokemon, ignorePp?: boolean): boolean { - if (pokemon.summonData?.disabledMove === this.moveId) + if (this.moveId && pokemon.summonData?.disabledMove === this.moveId) return false; return ignorePp || this.ppUsed < this.getMove().pp + this.ppUp || this.getMove().pp === -1; }