Private
currentThe currently-running phase
Holds priority queues for dynamically ordered phases
Private
Readonly
phasePhaseQueue: dequeue/remove the first element to get the next phase
Private
standbyThe phase put on standby if overridePhase
is called
Finds and cancels the first MovePhase
meeting the condition
The condition
function
Finds the first MovePhase
meeting the condition and changes its move
The condition
function
The move
to use in replacement
Private
checkHelper method to queue a phase as dynamic if necessary
The phase to check
The Phase
or a DynamicPhaseMarker
to be used in its place
Clears all phase queues and the standby phase
Clears the phaseQueue
If true
, leaves the top level of the tree intact; default false
Dynamically create the named phase from the provided arguments
The name of the phase to create.
The arguments to pass to the phase constructor.
The requested phase instance
Finds the first MovePhase
meeting the condition and forces it last
The condition
function
Finds the first MovePhase
meeting the condition and forces it next
The condition
function
Finds the first MovePhase
meeting the condition
The condition
function
The MovePhase, or undefined
if it does not exist
Determine if there is a queued Phase
meeting the specified conditions.
The type
of phase to search for
Optional
condition: PhaseConditionFunc<T>An optional PhaseConditionFunc
to add conditions to the search
Whether a matching phase exists
Hides the ability bar if it is currently visible
Prevents end of turn effects from triggering when transitioning to a new biome on a X0 wave
Create a new phase and immediately push it to the phase queue. Equivalent to calling create
followed by pushPhase
.
The name of the phase to create
The arguments to pass to the phase constructor
Create a new phase and queue it to run after all others queued by the currently running phase.
The name of the phase to create
The arguments to pass to the phase constructor
Add a FaintPhase
to the queue
The arguments to pass to the phase constructor
Adds a MessagePhase
to the queue
string for MessagePhase
Optional
callbackDelay: null | numberoptional param for MessagePhase constructor
Optional
prompt: null | booleanoptional param for MessagePhase constructor
Optional
promptDelay: null | numberoptional param for MessagePhase constructor
Optional
defer: null | booleanIf true
, push the phase instead of unshifting; default false
MessagePhase
for more details on the parameters
Queues phases which run at the end of each turn
Removes all Phase
s of the given type from the queue
This is not intended to be used with dynamically ordered phases, and does not operate on the dynamic queue.
However, it does remove DynamicPhaseMarker
s and so would prevent such phases from activating.
Determines the next phase to run and starts it.
Private
startHelper method to start and log the current phase.
Clear all previously set phases, then add a new TitlePhase
to transition to the title screen.
Whether to add a new LoginPhase
before the TitlePhase
(but reset everything else).
Default false
Attempt to find and remove the first queued Phase
matching the given conditions.
The type
of phase to search for
Optional
phaseFilter: PhaseConditionFunc<T>An optional PhaseConditionFunc
to add conditions to the search
Whether a phase was successfully removed
Private
turnClear all dynamic queues and begin a new TurnInitPhase
for the new turn.
Called whenever the current phase queue is empty.
Create a new phase and immediately unshift it to the phase queue. Equivalent to calling create
followed by unshiftPhase
.
The name of the phase to create
The arguments to pass to the phase constructor
PhaseManager is responsible for managing the phases in the battle scene