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

# Class MysteryEncounterOptionBuilder

#### Implements

- Partial< IMysteryEncounterOption >

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:194

##### Index

### Constructors

constructor

### Properties

dialogue?
excludePrimaryFromSecondaryRequirements
hasDexProgress
isDisabledOnRequirementsNotMet
optionMode
primaryPokemonRequirements
requirements
secondaryPokemonRequirements

### Methods

build
withDialogue
withHasDexProgress
withOptionPhase
withPokemonCanLearnMoveRequirement
withPokemonTypeRequirement
withPostOptionPhase
withPreOptionPhase
withPrimaryPokemonRequirement
withSceneMoneyRequirement
withSceneRequirement
withSecondaryPokemonRequirement
newOptionWithMode

## Constructors

### constructor

- new MysteryEncounterOptionBuilder(): MysteryEncounterOptionBuilder

  #### Returns MysteryEncounterOptionBuilder

## Properties

### `Optional` dialogue

dialogue?: OptionTextDisplay

Implementation of Partial.dialogue

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:202

### excludePrimaryFromSecondaryRequirements

excludePrimaryFromSecondaryRequirements: boolean = false

Implementation of Partial.excludePrimaryFromSecondaryRequirements

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:199

### hasDexProgress

hasDexProgress: boolean = false

Implementation of Partial.hasDexProgress

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:201

### isDisabledOnRequirementsNotMet

isDisabledOnRequirementsNotMet: boolean = true

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:200

### optionMode

optionMode: MysteryEncounterOptionMode = MysteryEncounterOptionMode.DEFAULT

Implementation of Partial.optionMode

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:195

### primaryPokemonRequirements

primaryPokemonRequirements: EncounterPokemonRequirement [] = []

Implementation of Partial.primaryPokemonRequirements

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:197

### requirements

requirements: EncounterSceneRequirement [] = []

Implementation of Partial.requirements

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:196

### secondaryPokemonRequirements

secondaryPokemonRequirements: EncounterPokemonRequirement [] = []

Implementation of Partial.secondaryPokemonRequirements

- Defined in src/data/mystery-encounters/mystery-encounter-option.ts:198

## Methods

### build

- build(this: IMysteryEncounterOption ): default

  #### Parameters

  - this: IMysteryEncounterOption

  #### Returns default

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:338

### withDialogue

- withDialogue(dialogue: OptionTextDisplay ): MysteryEncounterOptionBuilder

  Set the full dialogue object to the option. Will override anything already set

  #### Parameters

  - dialogue: OptionTextDisplay

    see `OptionTextDisplay`

  #### Returns MysteryEncounterOptionBuilder

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:333

### withHasDexProgress

- withHasDexProgress(
  hasDexProgress: boolean,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "hasDexProgress">,
  >

  #### Parameters

  - hasDexProgress: boolean

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "hasDexProgress">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:210

### withOptionPhase

- withOptionPhase(
  onOptionPhase: OptionPhaseCallback ,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "onOptionPhase">,
  >

  MUST be defined by every `MysteryEncounterOption`

  #### Parameters

  - onOptionPhase: OptionPhaseCallback

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "onOptionPhase">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:249

### withPokemonCanLearnMoveRequirement

- withPokemonCanLearnMoveRequirement(
  move: Moves | Moves [],
  options?: CanLearnMoveRequirementOptions ,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "primaryPokemonRequirements">,
  >

  Player is required to have a pokemon that can learn a certain move/moveset

  #### Parameters

  - move: Moves | Moves []

    the required move/moves

  - `Optional` options: CanLearnMoveRequirementOptions

    see `CanLearnMoveRequirementOptions`

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "primaryPokemonRequirements">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:303

### withPokemonTypeRequirement

- withPokemonTypeRequirement(
  type: PokemonType | PokemonType [],
  excludeFainted?: boolean,
  minNumberOfPokemon?: number,
  invertQuery?: boolean,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "primaryPokemonRequirements">,
  >

  Player is required to have certain type/s of pokemon in his party (with optional min number of pokemons with that type)

  #### Parameters

  - type: PokemonType | PokemonType []

    the required type/s

  - `Optional` excludeFainted: boolean

    whether to exclude fainted pokemon

  - `Optional` minNumberOfPokemon: number

    number of pokemons to have that type

  - `Optional` invertQuery: boolean

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "primaryPokemonRequirements">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:285

### withPostOptionPhase

- withPostOptionPhase(
  onPostOptionPhase: OptionPhaseCallback ,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "onPostOptionPhase">,
  >

  #### Parameters

  - onPostOptionPhase: OptionPhaseCallback

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "onPostOptionPhase">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:253

### withPreOptionPhase

- withPreOptionPhase(
  onPreOptionPhase: OptionPhaseCallback ,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "onPreOptionPhase">,
  >

  Defines logic that runs immediately when an option is selected, but before the Encounter continues. Can determine whether or not the Encounter should continue. If there are scenarios where the Encounter should NOT continue, should return boolean instead of void.

  #### Parameters

  - onPreOptionPhase: OptionPhaseCallback

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "onPreOptionPhase">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:239

### withPrimaryPokemonRequirement

- withPrimaryPokemonRequirement(
  requirement: EncounterPokemonRequirement ,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "primaryPokemonRequirements">,
  >

  Adds a `EncounterPokemonRequirement` to `primaryPokemonRequirements`

  #### Parameters

  - requirement: EncounterPokemonRequirement

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "primaryPokemonRequirements">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:263

### withSceneMoneyRequirement

- withSceneMoneyRequirement(
  requiredMoney: number,
  scalingMultiplier?: number,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "requirements">,
  >

  #### Parameters

  - requiredMoney: number
  - `Optional` scalingMultiplier: number

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "requirements">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:229

### withSceneRequirement

- withSceneRequirement(
  requirement: EncounterSceneRequirement ,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "requirements">,
  >

  Adds a `EncounterSceneRequirement` to `requirements`

  #### Parameters

  - requirement: EncounterSceneRequirement

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "requirements">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:218

### withSecondaryPokemonRequirement

- withSecondaryPokemonRequirement(
  requirement: EncounterPokemonRequirement ,
  excludePrimaryFromSecondaryRequirements?: boolean,
  ): MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "secondaryPokemonRequirements">,
  >

  Adds a `EncounterPokemonRequirement` to `secondaryPokemonRequirements`

  #### Parameters

  - requirement: EncounterPokemonRequirement
  - excludePrimaryFromSecondaryRequirements: boolean = true

  #### Returns MysteryEncounterOptionBuilder & Required<
  Pick< IMysteryEncounterOption , "secondaryPokemonRequirements">,
  >

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:312

### `Static` newOptionWithMode

- newOptionWithMode(
  optionMode: MysteryEncounterOptionMode ,
  ): MysteryEncounterOptionBuilder & Pick<
  IMysteryEncounterOption ,
  "optionMode",
  >

  #### Parameters

  - optionMode: MysteryEncounterOptionMode

  #### Returns MysteryEncounterOptionBuilder & Pick< IMysteryEncounterOption , "optionMode">

  - Defined in src/data/mystery-encounters/mystery-encounter-option.ts:204