diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index bcebb78a0..e8af5bde2 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -523,6 +523,7 @@ export class TormentedTag extends BattlerTag { pokemon.scene.queueMessage(getPokemonMessage(pokemon, 'is no longer\ntormented!')); } + //At the end of each turn, if this pokemon executed a move this turn, set its unselectableMove to that move, unless it is struggle, in which case unset it. lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { const ret = lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType); if (ret) { diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 74b062736..b03dbd062 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3283,6 +3283,9 @@ export class PokemonSummonData { public moveQueue: QueuedMove[] = []; public disabledMove: Moves = Moves.NONE; public disabledTurns: integer = 0; + /* + * Moves that can not be selected in the UI, but don't fail when used for other reasons. Currently just used by Torment. + */ public unselectableMove: Moves = Moves.NONE; public tags: BattlerTag[] = []; public abilitySuppressed: boolean = false; diff --git a/src/phases.ts b/src/phases.ts index c33962742..67f51e698 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -1667,7 +1667,8 @@ export class CommandPhase extends FieldPhase { this.handleCommand(Command.FIGHT, -1, false, false); else { const moveIndex = playerPokemon.getMoveset().findIndex(m => m.moveId === queuedMove.move); - if (moveIndex > -1 && playerPokemon.getMoveset()[moveIndex].isUsable(playerPokemon, queuedMove.ignorePP)) { + if (moveIndex > -1 && playerPokemon.getMoveset()[moveIndex].isUsable(playerPokemon, queuedMove.ignorePP)) { + //if the player already has a move queued (e.g. due to outrage), have arg1 be true in handleCommand this.handleCommand(Command.FIGHT, moveIndex, queuedMove.ignorePP, true, { targets: queuedMove.targets, multiple: queuedMove.targets.length > 1 }); } else this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex); @@ -1686,7 +1687,8 @@ export class CommandPhase extends FieldPhase { let useStruggleA = false; let useStruggleB = false; let useStruggleC = false; - const encoreTag = playerPokemon.getTag(EncoreTag) as EncoreTag; + const encoreTag = playerPokemon.getTag(EncoreTag) as EncoreTag; + //Lengthy check for whether or not the player's choice is legal, and if they should struggle. if (cursor === -1 || playerPokemon.trySelectMove(cursor, args[0] as boolean, args[1] as boolean) || (useStruggleA = cursor > -1 && (!playerPokemon.getMoveset().filter(m => m.isSelectable(playerPokemon)).length) && !args[1]) ||