Creates an instance of GameManager.
The Phaser game instance.
Whether to bypass the login phase.
Readonly
challengeReadonly
classicReadonly
dailyReadonly
fieldReadonly
modifiersReadonly
moveReadonly
overrideReadonly
reloadReadonly
settingsFaint all opponents currently on the field
Revive pokemon, currently players only.
The 0-indexed position of the pokemon in your party to revive
Queue up button presses to skip taking an item on the next SelectModifierPhase
Select a pokemon from the party menu during the given phase. Only really handles the basic case of "navigate to party slot and press Action twice" - any menus that come up afterwards are ignored and must be handled separately by the caller.
The 0-indexed position of the pokemon in your party to switch to
Which phase to expect the selection to occur in. Defaults to SwitchPhase
(which is where the majority of non-command switch operations occur).
Command an in-battle switch to another Pokemon via the main battle menu.
The 0-indexed position of the party pokemon to switch to. Should never be called with 0 as that will select the currently active pokemon and freeze.
Select the BALL option from the command menu, then press Action; in the BALL menu, select a pokéball type and press Action again to throw it.
The PokeballType
to throw
End the currently running phase immediately.
Exports the save data to import it in a test game.
A promise that resolves with the exported save data.
Imports game data from a file.
The path to the data file.
A promise that resolves with a tuple containing a boolean indicating success and an integer status code.
Private
initInitialize various default overrides for starting tests, typically to alleviate randomness.
Checks if the current phase matches the target phase.
The target phase.
Whether the current phase matches the target phase
Check if the player has won the battle.
whether the player has won the battle (all opposing Pokemon have been fainted)
Faint a player or enemy pokemon instantly by setting their HP to 0.
The player/enemy pokemon being fainted
A Promise that resolves once the fainted pokemon's FaintPhase finishes running.
Adds an action to be executed on the next prompt. This can be used to (among other things) simulate inputs or run functions mid-phase.
The target phase.
The mode to wait for.
The callback function to execute on next prompt.
Optional
expireFn: () => voidOptional function to determine if the prompt has expired.
Removes all held items from enemy pokemon.
Private
resetReset a prior BattleScene
instance to the proper initial state.
Helper function to run to the final boss encounter as it's a bit tricky due to extra dialogue Also handles Major/Minor bosses from endless modes
Runs the game to a mystery encounter phase.
Optional
encounterType: MysteryEncounterTypeIf specified, will expect encounter to be the given type.
Optional
species: SpeciesId[]Optional array of species for party to start with.
A Promise that resolves when the EncounterPhase ends.
Runs the game to the title phase.
A promise that resolves when the title phase is reached.
Emulate a player's target selection after a move is chosen, usually called automatically by MoveHelper.select
.
Will trigger during the next SelectTargetPhase
The 0-indexed position of the move in the pokemon's moveset array
Optional
targetIndex: BattlerIndexThe BattlerIndex
of the attack target, or undefined
for multi-target attacks
Modifies the queue manager to return move phases in a particular order Used to manually modify Pokemon turn order. Note: This DOES NOT account for priority.
The turn order to set as an array of BattlerIndex
es.
Transition to the end of the current turn
.
Transition to the first CommandPhase
of the next turn.
A promise that resolves once the next CommandPhase
has been reached.
Queue up button presses to skip taking an item on the next SelectModifierPhase,
and then transition to the next CommandPhase
.
Class to manage the game state and transitions between phases.