Protected
fieldPrivate
isReadonly
phaseThe string name of the phase, used to identify the phase type for is
Private
checkHelper method for handleBallCommand
that checks if a pokeball can be thrown
and displays the appropriate error message.
Whether a pokeball can be thrown
The pokeball may not be thrown if any of the following are true:
End
biome and
Private
checkSubmethod of start
that sets the turn command to skip if this pokemon
is commanding its ally via AbilityId.COMMANDER
.
Private
clearClear out all unusable moves in front of the currently acting pokemon's move queue.
Private
computeHelper method for handleFightCommand
that returns the moveID for the phase
based on the move passed in or the cursor.
Does not check if the move is usable or not, that should be handled by the caller.
End the current phase and start a new one.
Private
handleHelper method for handleCommand
that handles the logic when the selected command is to use a pokeball.
The index of the pokeball to use
Whether the command was successfully initiated
Process the command phase logic based on the selected command
The kind of command to handle
The index of option that the cursor is on, or -1 if no option is selected
Optional
useMode: MoveUseModeThe mode to use for the move, if applicable. For switches, a boolean that specifies whether the switch is a Baton switch.
Optional
move: TurnMoveFor Command.FIGHT
, the move to use
Whether the command was successful
Process the command phase logic based on the selected command
The kind of command to handle
The index of option that the cursor is on, or -1 if no option is selected
Whether the command was successful
Process the command phase logic based on the selected command
The kind of command to handle
The index of option that the cursor is on, or -1 if no option is selected
Optional
useMode: boolean | MoveUseModeThe mode to use for the move, if applicable. For switches, a boolean that specifies whether the switch is a Baton switch.
Optional
move: TurnMoveFor Command.FIGHT
, the move to use
Whether the command was successful
Private
handleSubmethod of start
that validates field index logic for nonzero field indices.
Must only be called if the field index is nonzero.
Private
handleProcess the logic for executing a fight-related command
The command to handle (FIGHT or TERA)
The index that the cursor is placed on, or -1 if no move can be selected.
Optional
move: TurnMoveThe move to force the command to use, if any.
Private
handleHelper method for handleCommand
that handles the logic when the selected command is RUN.
Whether the pokemon is able to leave the field, indicating the command phase should end
Checks if the player is allowed to flee, and if not, queues the appropriate message.
The player cannot flee if:
End
biomePrivate
handleSubmethod of tryLeaveField
to handle the logic for effects that prevent the pokemon from leaving the field
due to trapping abilities or effects.
This method queues the proper messages in the case of trapping abilities or effects.
Whether the pokemon is currently trapped
Check if the phase is of the given type without requiring instanceof
.
The string name of the phase to check.
Whether this phase is of the provided type.
Private
queueSubmethod of handleFightCommand
responsible for queuing the provided error message when the move cannot be used
The reason why the move cannot be used
Private
queueSet the mode in preparation to show the text, and then show the text. Only works for parameterless i18next keys.
The i18next key for the text to show
Private
resetResets the cursor to the position of Command.FIGHT
if any of the following are true
Private
showShow a message indicating that the pokemon cannot escape, and then return to the command phase.
Start the current phase.
Private
tryAttempt to execute the first usable move in this Pokemon's move queue
Whether a queued move was successfully set to be executed.
Private
tryCommon helper method that attempts to have the pokemon leave the field. Checks for trapping abilities and effects.
Optional
cursor: numberThe index of the option that the cursor is on
Whether the pokemon is able to leave the field, indicating the command phase should end
Whether the command phase is handling a switch command