A reference to the global Animation Manager.
This property will only be available if defined in the Scene Injection Map.
Determines the selected battle style.
A reference to the global Cache.
This property will only be available if defined in the Scene Injection Map.
The Scene Camera Manager.
This property will only be available if defined in the Scene Injection Map.
Determines what type of notification is used for Candy Upgrades
Determines the condition for a notification should be shown for Candy Upgrades
The Game Object Display List belonging to this Scene.
This property will only be available if defined in the Scene Injection Map.
A Scene specific Data Manager Plugin.
See the registry
property for the global Data Manager.
This property will only be available if defined in the Scene Injection Map and the plugin is installed.
Determines if the egg hatching animation should be skipped
Readonly
eventAllows subscribers to listen for events
Current Events:
NewArenaEvent
A Scene specific Event Emitter.
This property will only be available if defined in the Scene Injection Map.
Defines the experience gain display mode.
The expParty
can have several modes:
0
- Default: The normal experience gain display, nothing changed.1
- Level Up Notification: Displays the level up in the small frame instead of a message.2
- Skip: No level up frame nor message.Modes 1
and 2
are still compatible with stats display, level up, new move, etc.
0 - Uses the default normal experience gain display.
The Facebook Instant Games Plugin.
This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.
A reference to the Phaser.Game instance.
This property will only be available if defined in the Scene Injection Map.
The Scene Input Manager Plugin.
This property will only be available if defined in the Scene Injection Map and the plugin is installed.
Optional
lastIf the previous wave was a MysteryEncounter, tracks the object with this variable. Mostly used for visual object cleanup
The Scene Lights Manager Plugin.
This property will only be available if defined in the Scene Injection Map and the plugin is installed.
The Scene Loader Plugin.
This property will only be available if defined in the Scene Injection Map and the plugin is installed.
The Scene Game Object Creator.
This property will only be available if defined in the Scene Injection Map.
The Scene Matter Physics Plugin.
This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.
Session save data that pertains to Mystery Encounters
PhaseQueue: dequeue/remove the first element to get the next phase
The Scene Arcade Physics Plugin.
This property will only be available if defined in the Scene Injection Map, the plugin is installed and configured.
A reference to the global Plugin Manager.
The Plugin Manager is a global system that allows plugins to register themselves with it, and can then install those plugins into Scenes as required.
A reference to the global Data Manager.
This property will only be available if defined in the Scene Injection Map.
A reference to the renderer instance Phaser is using, either Canvas Renderer or WebGL Renderer.
A reference to the global Scale Manager.
This property will only be available if defined in the Scene Injection Map.
Readonly
scaledSince everything is scaled up by 6 by default using the game.canvas is annoying Until such point that we use the canvas normally, this will be easier than having to divide every width and heigh by 6 to position and scale the ui
A reference to the Scene Manager Plugin.
This property will only be available if defined in the Scene Injection Map.
A reference to the Sound Manager.
This property will only be available if defined in the Scene Injection Map and the plugin is installed.
The Scene Systems. You must never overwrite this property, or all hell will break lose.
A reference to the Texture Manager.
This property will only be available if defined in the Scene Injection Map.
The Scene Time and Clock Plugin.
This property will only be available if defined in the Scene Injection Map and the plugin is installed.
The Scene Tween Manager Plugin.
This property will only be available if defined in the Scene Injection Map and the plugin is installed.
Defines whether or not to show type effectiveness hints
Optional
ignoreUpdate: booleanOptional
instant: booleanOptional
dataSource: defaultOptional
postProcess: ((enemyPokemon: EnemyPokemon) => void)Optional
ignoreUpdate: booleanOptional
playSound: booleanOptional
virtual: booleanOptional
instant: booleanOptional
cost: numberOptional
abilityIndex: numberOptional
formIndex: numberOptional
gender: GenderOptional
shiny: booleanOptional
variant: VariantOptional
ivs: number[]Optional
nature: NatureOptional
dataSource: default | defaultOptional
postProcess: ((playerPokemon: PlayerPokemon) => void)Optional
frame: string | numberApply the first modifier that matches modifierType
The type of modifier to apply; must extend PersistentModifier
Whether to search the player (true
) or the enemy (false
); Defaults to true
Rest
...args: Parameters<T["apply"]>the first modifier that matches modifierType
and was applied; return null
if none matched
Apply all modifiers that match modifierType
The type of modifier to apply; must extend PersistentModifier
Whether to search the player (true
) or the enemy (false
); Defaults to true
Rest
...args: Parameters<T["apply"]>the list of all modifiers that matched modifierType
and were applied.
Helper function to apply all passed modifiers
Updates Exp and level values for Player's party, adding new level up phases as required
raw value of exp to split among participants, OR the base multiplier to use with waveIndex
If true, will increment Macho Brace stacks and give the party Pokemon friendship increases
Optional
useWaveIndexMultiplier: booleanDefault false. If true, will multiply expValue by a scaling waveIndex multiplier. Not needed if expValue is already scaled by level/wave
Optional
pokemonParticipantIds: Set<number>Participants. If none are defined, no exp will be given. To spread evenly among the party, should pass all ids of party members.
Apply all modifiers that match modifierType
in a random order
BattleScene
used to randomize the order of modifiers
The type of modifier to apply; must extend PersistentModifier
Whether to search the player (true
) or the enemy (false
); Defaults to true
Rest
...args: Parameters<T["apply"]>the list of all modifiers that matched modifierType
and were applied.
Removes all modifiers from enemy pokemon of PokemonHeldItemModifier
type
Removes all modifiers from enemy pokemon of PersistentModifier
type
Find the first modifier that pass the modifierFilter
function
The function used to filter a target's modifiers
Whether to search the player (true
) or the enemy (false
); Defaults to true
the first modifier that passed the modifierFilter
function; undefined
if none passed
Get all of the modifiers that pass the modifierFilter
function
The function used to filter a target's modifiers
Whether to search the player (true
) or the enemy (false
); Defaults to true
the list of all modifiers that passed the modifierFilter
function
Optional
heldModifiersConfigs: default[][]This function retrieves the sprite and audio keys for active Pokemon. Active Pokemon include both enemy and player Pokemon of the current wave. Note: Questions on garbage collection go to
a string array of active sprite and audio keys that should not be deleted
Optional
species: defaultReturns an array of EnemyPokemon of length 1 or 2 depending on if in a double battle or not. Does not actually check if the pokemon are on the field or not.
array of EnemyPokemon
Whether a pokemon that is currently switching out is valid, default true
The first EnemyPokemon
that is on the field
and is active
(aka is allowed in battle
),
or undefined
if there are no valid pokemon
Returns the ModifierBar of this scene, which is declared private and therefore not accessible elsewhere
Optional
isEnemy: booleanWhether to return the enemy's modifier bar
Get all of the modifiers that match modifierType
The type of modifier to apply; must extend PersistentModifier
Whether to search the player (true
) or the enemy (false
); Defaults to true
the list of all modifiers that matched modifierType
.
Loads or generates a mystery encounter
Optional
encounterType: MysteryEncounterTypeused to load session encounter when restarting game, etc.
Optional
canBypass: booleanoptional boolean to indicate that the request is coming from a function that needs to access a Mystery Encounter outside of gameplay requirements
Returns an array of PlayerPokemon of length 1 or 2 depending on if in a double battle or not. Does not actually check if the pokemon are on the field or not.
array of PlayerPokemon
Whether a pokemon that is currently switching out is valid, default true
The first PlayerPokemon
that is on the field
and is active
(aka is allowed in battle
),
or undefined
if there are no valid pokemon
An array of PlayerPokemon
filtered from the player's party
that are allowed in battle
.
Initialized the 2nd phase of the final boss (e.g. form-change for Eternatus)
The (enemy) pokemon
Optional
pokemon: defaultReturns if a wave COULD spawn a MysteryEncounter
.
Even if returns true
, does not guarantee that a wave will actually be a ME.
That check is made in BattleScene.isWaveMysteryEncounter instead.
Optional
waveIndex: numberOptional
battleType: BattleTypeOptional
trainerData: defaultOptional
double: booleanOptional
mysteryEncounterType: MysteryEncounterTypeTries to add the input phase to index before target phase in the phaseQueue, else simply calls unshiftPhase()
Phase
the phase to be added
Phase
the type of phase to search for in phaseQueue
boolean if a targetPhase was found and added
Adds a phase to the conditional queue and ensures it is executed only when the specified condition is met.
This method allows deferring the execution of a phase until certain conditions are met, which is useful for handling situations like abilities and entry hazards that depend on specific game states.
The phase to be added to the conditional queue.
A function that returns a boolean indicating whether the phase should be executed.
Adds a MessagePhase, either to PhaseQueuePrepend or nextCommandPhaseQueue
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 | booleanboolean for which queue to add it to, false -> add to PhaseQueuePrepend, true -> nextCommandPhaseQueue
Generates a random number using the current battle's seed
This calls Battle.randSeedInt
(scene
, range, min) in src/battle.ts
which calls randSeedInt
(range, min) in src/utils.ts
How large of a range of random numbers to choose from. If range <= 1, returns min
The minimum integer to pick, default 0
A random integer between min and (min + range - 1)
Optional
fromArenaPool: booleanOptional
speciesFilter: PokemonSpeciesFilterOptional
filterAllEvolutions: booleanRemoves a currently owned item. If the item is stacked, the entire item stack
gets removed. This function does NOT apply in-battle effects, such as Unburden.
If in-battle effects are needed, use Pokemon.loseHeldItem
instead.
The item to be removed.
If true
, remove an item owned by the enemy. If false
, remove an item owned by the player. Default is false
.
true
if the item exists and was successfully removed, false
otherwise.
Removes a PlayerPokemon
from the party, and clears modifiers for that Pokemon's id
Useful for MEs/Challenges that remove Pokemon from the player party temporarily or permanently
Default true. If true, will destroy the PlayerPokemon
after removing
Optional
fieldAssets: Sprite[]Try to transfer a held item to another pokemon. If the recepient already has the maximum amount allowed for this item, the transfer is cancelled. The quantity to transfer is automatically capped at how much the recepient can take before reaching the maximum stack size for the item. A transfer that moves a quantity smaller than what is specified in the transferQuantity parameter is still considered successful.
PokemonHeldItemModifier
item to transfer (represents the whole stack)
Pokemon
recepient in this transfer
true
to play a sound when transferring the item
How many items of the stack to transfer. Optional, defaults to 1
Optional
instant: boolean??? (Optional)
Optional
ignoreUpdate: boolean??? (Optional)
If true
, treat the item's current holder as losing the item (for now, this simply enables Unburden). Default is true
.
true
if the transfer was successful
Optional
instant: booleanOptional
args: unknown[]Rest
...args: unknown[]Optional
args: unknown[]
The Scene Game Object Factory.
This property will only be available if defined in the Scene Injection Map.