Builds the mystery encounter
Defines any EncounterAnim animations that are intended to be used during the encounter EncounterAnims are custom battle animations (think Ice Beam) that can be played at any point during an encounter or callback They just need to be specified here so that resources are loaded on encounter init
Rest
...encounterAnimations: EncounterAnim[]If false
, will not hide the intro visuals that are displayed at the beginning of encounter
If true, encounter will not animate the target Pokemon as part of battle animations Used for encounters where it is not a "real" battle, but still uses battle animations and commands (see FunAndGamesEncounter for an example) Default false
Can set whether catching is allowed or not on the encounter This flag can also be programmatically set inside option event functions or elsewhere
If true
, allows enemy pokemon to be caught during the encounter
If true, encounter will continuously run through multiple battles/puzzles/etc. instead of going to next wave MUST EVENTUALLY BE DISABLED TO CONTINUE TO NEXT WAVE Default false
Defines any challenges (from Challenge game mode) where the Mystery Encounter should NOT spawn
Rest
...disallowedChallenges: Challenges[]Defines any game modes where the Mystery Encounter should NOT spawn
Rest
...disallowedGameModes: GameModes[]Sets the rarity tier for an encounter If not specified, defaults to COMMON Tiers are: COMMON 32/64 odds GREAT 16/64 odds ULTRA 10/64 odds ROGUE 6/64 odds ULTRA_RARE Not currently used
If true
, will slide in intro visuals from the right side of the screen. If false, slides in from left, as normal
Default false
Can set custom encounter exp via this callback function If exp always deterministic for an encounter, this is a good way to set them
NOTE: If rewards are dependent on options selected, runtime data, etc., It may be better to programmatically set doEncounterExp elsewhere. There is a helper function in mystery-encounter utils, setEncounterExp(), which can be called programmatically to set rewards
Can set whether fleeing is allowed or not on the encounter
If false
, prevents fleeing from a wild battle (trainer battle MEs already have flee disabled)
If true
, will not show the trainerAppeared/wildAppeared/bossAppeared message for an encounter
Optional
dialogue?: TextDisplay[]Defines the sprites that will be shown on the enemy field when the encounter spawns Can be one or more sprites, recommended not to exceed 4
Sets the maximum number of times that an encounter can spawn in a given Classic run
Can be used to perform init logic before intro visuals are shown and before the MysteryEncounterPhase begins Useful for performing things like procedural generation of intro sprites, etc.
Can be used to perform some extra logic (usually animations) when the enemy field is finished sliding in
Defines an option for the encounter. Use for complex options. There should be at least 2 options defined and no more than 4.
MysteryEncounterOption to add, can use MysteryEncounterOptionBuilder to create instance
Add outro dialogue/s for the encounter
Outro dialogue(s)
Add a primary pokemon health ratio requirement
the health range to check
minimum number of pokemon to have the health range
if true will invert the query
Add a primary pokemon requirement
Add a primary pokemon status effect requirement
the status effect/s to check
minimum number of pokemon to have the effect
if true will invert the query
Can set custom encounter rewards via this callback function If rewards are always deterministic for an encounter, this is a good way to set them
NOTE: If rewards are dependent on options selected, runtime data, etc., It may be better to programmatically set doEncounterRewards elsewhere. There is a helper function in mystery-encounter utils, setEncounterRewards(), which can be called programmatically to set rewards
Specifies a party size requirement for an encounter.
min wave (or exact size if only min is given)
Optional
max: numberoptional max size. If not given, defaults to min => exact wave
if true, only counts allowed (legal in Challenge/unfainted) mons
Specifies a requirement for an encounter For example, passing requirement as "new WaveCountRequirement([2, 180])" would create a requirement that the encounter can only be spawned between waves 2 and 180 Existing Requirement objects are defined in mystery-encounter-requirements.ts, and more can always be created to meet a requirement need
Specifies a wave range requirement for an encounter.
min wave (or exact wave if only min is given)
Optional
max: numberoptional max wave. If not given, defaults to min => exact wave
Defines an option + phasefor the encounter.
Use for easy/streamlined options.
There should be at least 2 options defined and no more than 4.
If complex use MysteryEncounterBuilder.withOption
Defines an option + phasefor the encounter.
Use for easy/streamlined options.
There should be at least 2 options defined and no more than 4.
If complex use MysteryEncounterBuilder.withOption
If true, encounter will not animate the target Pokemon as part of battle animations Used for encounters where it is not a "real" battle, but still uses battle animations and commands (see FunAndGamesEncounter for an example) Default false
If true, will skip COMMAND input and go straight to FIGHT (move select) input menu Default false
Static
withthis
Defines the type of encounter which is used as an identifier, should be tied to a unique MysteryEncounterType
NOTE: if new functions are added to MysteryEncounter
class
Builder class for creating a MysteryEncounter must call
build()
at the end after specifying all params for the MysteryEncounter