add comments where needed
parent
9511699b69
commit
e11c8ffe1a
|
@ -523,6 +523,7 @@ export class TormentedTag extends BattlerTag {
|
||||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, 'is no longer\ntormented!'));
|
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 {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
const ret = lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
|
const ret = lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
|
|
@ -3283,6 +3283,9 @@ export class PokemonSummonData {
|
||||||
public moveQueue: QueuedMove[] = [];
|
public moveQueue: QueuedMove[] = [];
|
||||||
public disabledMove: Moves = Moves.NONE;
|
public disabledMove: Moves = Moves.NONE;
|
||||||
public disabledTurns: integer = 0;
|
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 unselectableMove: Moves = Moves.NONE;
|
||||||
public tags: BattlerTag[] = [];
|
public tags: BattlerTag[] = [];
|
||||||
public abilitySuppressed: boolean = false;
|
public abilitySuppressed: boolean = false;
|
||||||
|
|
|
@ -1667,7 +1667,8 @@ export class CommandPhase extends FieldPhase {
|
||||||
this.handleCommand(Command.FIGHT, -1, false, false);
|
this.handleCommand(Command.FIGHT, -1, false, false);
|
||||||
else {
|
else {
|
||||||
const moveIndex = playerPokemon.getMoveset().findIndex(m => m.moveId === queuedMove.move);
|
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 });
|
this.handleCommand(Command.FIGHT, moveIndex, queuedMove.ignorePP, true, { targets: queuedMove.targets, multiple: queuedMove.targets.length > 1 });
|
||||||
} else
|
} else
|
||||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||||
|
@ -1686,7 +1687,8 @@ export class CommandPhase extends FieldPhase {
|
||||||
let useStruggleA = false;
|
let useStruggleA = false;
|
||||||
let useStruggleB = false;
|
let useStruggleB = false;
|
||||||
let useStruggleC = 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 ||
|
if (cursor === -1 ||
|
||||||
playerPokemon.trySelectMove(cursor, args[0] as boolean, args[1] as boolean) ||
|
playerPokemon.trySelectMove(cursor, args[0] as boolean, args[1] as boolean) ||
|
||||||
(useStruggleA = cursor > -1 && (!playerPokemon.getMoveset().filter(m => m.isSelectable(playerPokemon)).length) && !args[1]) ||
|
(useStruggleA = cursor > -1 && (!playerPokemon.getMoveset().filter(m => m.isSelectable(playerPokemon)).length) && !args[1]) ||
|
||||||
|
|
Loading…
Reference in New Issue