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

# Class InverseBattleChallenge

Implements an inverse battle challenge.

#### Hierarchy (View Summary)

- Challenge
  - InverseBattleChallenge

- Defined in src/data/challenge.ts:851

##### Index

### Constructors

constructor

### Properties

conditions
id
maxSeverity
maxValue
severity
value

### Methods

applyFixedBattle
applyFlipStat
applyGameModeModify
applyLevelChange
applyMoveAccessLevel
applyMoveSlot
applyMoveWeight
applyPassiveAccess
applyPokemonInBattle
applyStarterChoice
applyStarterCost
applyStarterModify
applyStarterPoints
applyTypeEffectiveness
condition
decreaseSeverity
decreaseValue
getDescription
getDifficulty
geti18nKey
getMinDifficulty
getName
getValue
hasSeverity
increaseSeverity
increaseValue
isUnlocked
reset
loadChallenge

## Constructors

### constructor

- new InverseBattleChallenge(): InverseBattleChallenge

  #### Returns InverseBattleChallenge

  Overrides Challenge.constructor

  - Defined in src/data/challenge.ts:852

## Properties

### conditions

conditions: ChallengeCondition[]

Inherited from Challenge.conditions

- Defined in src/data/challenge.ts:122

### id

id: Challenges

Inherited from Challenge.id

- Defined in src/data/challenge.ts:115

### maxSeverity

maxSeverity: number

Inherited from Challenge.maxSeverity

- Defined in src/data/challenge.ts:120

### maxValue

maxValue: number

Inherited from Challenge.maxValue

- Defined in src/data/challenge.ts:118

### severity

severity: number

Inherited from Challenge.severity

- Defined in src/data/challenge.ts:119

### value

value: number

Inherited from Challenge.value

- Defined in src/data/challenge.ts:117

## Methods

### applyFixedBattle

- applyFixedBattle(_waveIndex: number, _battleConfig: FixedBattleConfig ): boolean

  An apply function for FIXED_BATTLE challenges. Derived classes should alter this.

  #### Parameters

  - _waveIndex: number

    Number The current wave index.

  - _battleConfig: FixedBattleConfig

    FixedBattleConfig The battle config to modify.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyFixedBattle

  - Defined in src/data/challenge.ts:338

### applyFlipStat

- applyFlipStat(_pokemon: default , _baseStats: number[]): boolean

  An apply function for FlipStats. Derived classes should alter this.

  #### Parameters

  - _pokemon: default

    Pokemon What pokemon would learn the move.

  - _baseStats: number[]

    What are the stats to flip.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyFlipStat

  - Defined in src/data/challenge.ts:426

### applyGameModeModify

- applyGameModeModify(): boolean

  An apply function for GAME_MODE_MODIFY challenges. Derived classes should alter this.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyGameModeModify

  - Defined in src/data/challenge.ts:387

### applyLevelChange

- applyLevelChange(
  _level: NumberHolder ,
  _levelCap: number,
  _isTrainer: boolean,
  _isBoss: boolean,
  ): boolean

  An apply function for AI_LEVEL challenges. Derived classes should alter this.

  #### Parameters

  - _level: NumberHolder

    Utils.NumberHolder The generated level.

  - _levelCap: number

    Number The current level cap.

  - _isTrainer: boolean

    Boolean Whether this is a trainer pokemon.

  - _isBoss: boolean

    Boolean Whether this is a non-trainer boss pokemon.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyLevelChange

  - Defined in src/data/challenge.ts:359

### applyMoveAccessLevel

- applyMoveAccessLevel(
  _pokemon: default ,
  _moveSource: MoveSourceType ,
  _move: Moves ,
  _level: NumberHolder ,
  ): boolean

  An apply function for MOVE_ACCESS. Derived classes should alter this.

  #### Parameters

  - _pokemon: default

    Pokemon What pokemon would learn the move.

  - _moveSource: MoveSourceType

    MoveSourceType What source the pokemon would get the move from.

  - _move: Moves

    Moves The move in question.

  - _level: NumberHolder

    Utils.NumberHolder The level threshold for access.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyMoveAccessLevel

  - Defined in src/data/challenge.ts:399

### applyMoveSlot

- applyMoveSlot(_pokemon: default , _moveSlots: NumberHolder ): boolean

  An apply function for AI_MOVE_SLOTS challenges. Derived classes should alter this.

  #### Parameters

  - _pokemon: default
  - _moveSlots: NumberHolder

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyMoveSlot

  - Defined in src/data/challenge.ts:369

### applyMoveWeight

- applyMoveWeight(
  _pokemon: default ,
  _moveSource: MoveSourceType ,
  _move: Moves ,
  _level: NumberHolder ,
  ): boolean

  An apply function for MOVE_WEIGHT. Derived classes should alter this.

  #### Parameters

  - _pokemon: default

    Pokemon What pokemon would learn the move.

  - _moveSource: MoveSourceType

    MoveSourceType What source the pokemon would get the move from.

  - _move: Moves

    Moves The move in question.

  - _level: NumberHolder

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyMoveWeight

  - Defined in src/data/challenge.ts:416

### applyPassiveAccess

- applyPassiveAccess(_pokemon: default , _hasPassive: BooleanHolder ): boolean

  An apply function for PASSIVE_ACCESS challenges. Derived classes should alter this.

  #### Parameters

  - _pokemon: default
  - _hasPassive: BooleanHolder

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyPassiveAccess

  - Defined in src/data/challenge.ts:379

### applyPokemonInBattle

- applyPokemonInBattle(_pokemon: default , _valid: BooleanHolder ): boolean

  An apply function for POKEMON_IN_BATTLE challenges. Derived classes should alter this.

  #### Parameters

  - _pokemon: default

    Pokemon The pokemon to check the validity of.

  - _valid: BooleanHolder

    Utils.BooleanHolder A BooleanHolder, the value gets set to false if the pokemon isn't allowed.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyPokemonInBattle

  - Defined in src/data/challenge.ts:328

### applyStarterChoice

- applyStarterChoice(
  _pokemon: default ,
  _valid: BooleanHolder ,
  _dexAttr: DexAttrProps ,
  ): boolean

  An apply function for STARTER_CHOICE challenges. Derived classes should alter this.

  #### Parameters

  - _pokemon: default

    PokemonSpecies The pokemon to check the validity of.

  - _valid: BooleanHolder

    Utils.BooleanHolder A BooleanHolder, the value gets set to false if the pokemon isn't allowed.

  - _dexAttr: DexAttrProps

    DexAttrProps The dex attributes of the pokemon.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyStarterChoice

  - Defined in src/data/challenge.ts:290

### applyStarterCost

- applyStarterCost(_species: Species , _cost: NumberHolder ): boolean

  An apply function for STARTER_COST challenges. Derived classes should alter this.

  #### Parameters

  - _species: Species

    Species The pokemon to change the cost of.

  - _cost: NumberHolder

    Utils.NumberHolder The cost of the starter.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyStarterCost

  - Defined in src/data/challenge.ts:309

### applyStarterModify

- applyStarterModify(_pokemon: default ): boolean

  An apply function for STARTER_MODIFY challenges. Derived classes should alter this.

  #### Parameters

  - _pokemon: default

    Pokemon The starter pokemon to modify.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyStarterModify

  - Defined in src/data/challenge.ts:318

### applyStarterPoints

- applyStarterPoints(_points: NumberHolder ): boolean

  An apply function for STARTER_POINTS challenges. Derived classes should alter this.

  #### Parameters

  - _points: NumberHolder

    Utils.NumberHolder The amount of points you have available.

  #### Returns boolean

  boolean Whether this function did anything.

  Inherited from Challenge.applyStarterPoints

  - Defined in src/data/challenge.ts:299

### applyTypeEffectiveness

- applyTypeEffectiveness(effectiveness: NumberHolder ): boolean

  An apply function for TYPE_EFFECTIVENESS challenges. Derived classes should alter this.

  #### Parameters

  - effectiveness: NumberHolder

  #### Returns boolean

  Whether this function did anything.

  Overrides Challenge.applyTypeEffectiveness

  - Defined in src/data/challenge.ts:867

### condition

- condition(condition: ChallengeCondition): Challenge

  Adds an unlock condition to this challenge.

  #### Parameters

  - condition: ChallengeCondition

    ChallengeCondition The condition to add.

  #### Returns Challenge

  Challenge This challenge

  Inherited from Challenge.condition

  - Defined in src/data/challenge.ts:170

### decreaseSeverity

- decreaseSeverity(): boolean

  Decrease the severity of the challenge

  #### Returns boolean

  boolean Returns true if the value changed

  Inherited from Challenge.decreaseSeverity

  - Defined in src/data/challenge.ts:238

### decreaseValue

- decreaseValue(): boolean

  Decrease the value of the challenge

  #### Returns boolean

  boolean Returns true if the value changed

  Inherited from Challenge.decreaseValue

  - Defined in src/data/challenge.ts:219

### getDescription

- getDescription(overrideValue?: number): string

  Returns the description of a challenge's current value.

  #### Parameters

  - `Optional` overrideValue: number

    number The value to check for. If undefined, gets the current value.

  #### Returns string

  string The localised description for the current value.

  Inherited from Challenge.getDescription

  - Defined in src/data/challenge.ts:198

### getDifficulty

- getDifficulty(): number

  Gets the "difficulty" value of this challenge.

  #### Returns number

  integer The difficulty value.

  Overrides Challenge.getDifficulty

  - Defined in src/data/challenge.ts:863

### geti18nKey

- geti18nKey(): string

  Gets the localisation key for the challenge

  #### Returns string

  string The i18n key for this challenge

  Inherited from Challenge.geti18nKey

  - Defined in src/data/challenge.ts:149

### getMinDifficulty

- getMinDifficulty(): number

  Gets the minimum difficulty added by this challenge.

  #### Returns number

  integer The difficulty value.

  Inherited from Challenge.getMinDifficulty

  - Defined in src/data/challenge.ts:270

### getName

- getName(): string

  #### Returns string

  string The localised name of this challenge.

  Inherited from Challenge.getName

  - Defined in src/data/challenge.ts:179

### getValue

- getValue(overrideValue?: number): string

  Returns the textual representation of a challenge's current value.

  #### Parameters

  - `Optional` overrideValue: number

    number The value to check for. If undefined, gets the current value.

  #### Returns string

  string The localised name for the current value.

  Inherited from Challenge.getValue

  - Defined in src/data/challenge.ts:188

### hasSeverity

- hasSeverity(): boolean

  Whether to allow choosing this challenge's severity.

  #### Returns boolean

  Inherited from Challenge.hasSeverity

  - Defined in src/data/challenge.ts:230

### increaseSeverity

- increaseSeverity(): boolean

  Increase the severity of the challenge

  #### Returns boolean

  boolean Returns true if the value changed

  Inherited from Challenge.increaseSeverity

  - Defined in src/data/challenge.ts:250

### increaseValue

- increaseValue(): boolean

  Increase the value of the challenge

  #### Returns boolean

  boolean Returns true if the value changed

  Inherited from Challenge.increaseValue

  - Defined in src/data/challenge.ts:207

### isUnlocked

- isUnlocked(data: GameData ): boolean

  Used for unlockable challenges to check if they're unlocked.

  #### Parameters

  - data: GameData

    GameData The save data.

  #### Returns boolean

  boolean Whether this challenge is unlocked.

  Inherited from Challenge.isUnlocked

  - Defined in src/data/challenge.ts:161

### reset

- reset(): void

  Reset the challenge to a base state.

  #### Returns void

  Inherited from Challenge.reset

  - Defined in src/data/challenge.ts:140

### `Static` loadChallenge

- loadChallenge(source: any): InverseBattleChallenge

  Clones a challenge, either from another challenge or json. Chainable.

  #### Parameters

  - source: any

    The source challenge or json.

  #### Returns InverseBattleChallenge

  This challenge.

  Overrides Challenge.loadChallenge

  - Defined in src/data/challenge.ts:856