# MysteryEncounterPhase | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Class MysteryEncounterPhase

Will handle (in order):

- Clearing of phase queues to enter the Mystery Encounter game state
- Management of session data related to MEs
- Initialization of ME option select menu and UI
- Execute MysteryEncounter.onPreOptionPhase logic if it exists for the selected option
- Display any `OptionTextDisplay.selected` type dialogue that is set in the MysteryEncounterDialogue dialogue tree for selected option
- Queuing of the `MysteryEncounterOptionSelectedPhase`

#### Hierarchy (View Summary)

- Phase
  - MysteryEncounterPhase

- Defined in src/phases/mystery-encounter-phases.ts:41

##### Index

### Constructors

constructor

### Properties

optionSelectSettings?

### Methods

continueEncounter
end
handleOptionSelect
start

## Constructors

### constructor

- new MysteryEncounterPhase(
  optionSelectSettings?: OptionSelectSettings ,
  ): MysteryEncounterPhase

  Mostly useful for having repeated queries during a single encounter, where the queries and options may differ each time

  #### Parameters

  - `Optional` optionSelectSettings: OptionSelectSettings

    allows overriding the typical options of an encounter with new ones

  #### Returns MysteryEncounterPhase

  Overrides Phase.constructor

  - Defined in src/phases/mystery-encounter-phases.ts:49

## Properties

### `Optional` optionSelectSettings

optionSelectSettings?: OptionSelectSettings

- Defined in src/phases/mystery-encounter-phases.ts:43

## Methods

### continueEncounter

- continueEncounter(): void

  Queues `MysteryEncounterOptionSelectedPhase`, displays option.selected dialogue and ends phase

  #### Returns void

  - Defined in src/phases/mystery-encounter-phases.ts:125

### end

- end(): void

  Ends phase

  #### Returns void

  Overrides Phase.end

  - Defined in src/phases/mystery-encounter-phases.ts:170

### handleOptionSelect

- handleOptionSelect(option: default , index: number): boolean

  Triggers after a player selects an option for the encounter

  #### Parameters

  - option: default
  - index: number

  #### Returns boolean

  - Defined in src/phases/mystery-encounter-phases.ts:84

### start

- start(): void

  Updates seed offset, sets seen encounter session data, sets UI mode

  #### Returns void

  Overrides Phase.start

  - Defined in src/phases/mystery-encounter-phases.ts:57