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

# Class Arena

- Defined in src/field/arena.ts:46

##### Index

### Constructors

constructor

### Properties

bgm
biomeType
eventTarget
ignoreAbilities
ignoringEffectSource
playerFaints
playerTerasUsed
tags
terrain
weather

### Methods

addTag
applyTags
applyTagsForSide
canSetTerrain
canSetWeather
findTags
findTagsOnSide
getAttackTypeMultiplier
getBgmLoopPoint
getBgTerrainColorRatioForBiome
getDayTint
getDuskTint
getNightTint
getSpeciesFormIndex
getTag
getTagOnSide
getTerrainType
getTimeOfDay
getTrainerChance
getWeatherType
hasTag
init
isMoveTerrainCancelled
isMoveWeatherCancelled
isOutside
lapseTags
overrideTint
preloadBgm
randomSpecies
randomTrainerType
removeAllTags
removeTag
removeTagOnSide
resetArenaEffects
resetPlayerFaintCount
setIgnoreAbilities
triggerWeatherBasedFormChanges
triggerWeatherBasedFormChangesToNormal
trySetTerrain
trySetWeather
trySetWeatherOverride
updatePoolsForTimeOfDay

## Constructors

### constructor

- new Arena(biome: Biome , bgm: string, playerFaints?: number): Arena

  #### Parameters

  - biome: Biome
  - bgm: string
  - playerFaints: number = 0

  #### Returns Arena

  - Defined in src/field/arena.ts:68

## Properties

### bgm

bgm: string

- Defined in src/field/arena.ts:51

### biomeType

biomeType: Biome

- Defined in src/field/arena.ts:47

### `Readonly` eventTarget

eventTarget: EventTarget = ...

- Defined in src/field/arena.ts:66

### ignoreAbilities

ignoreAbilities: boolean

- Defined in src/field/arena.ts:52

### ignoringEffectSource

ignoringEffectSource: null | BattlerIndex

- Defined in src/field/arena.ts:53

### playerFaints

playerFaints: number

Saves the number of times a party pokemon faints during a arena encounter. `globalScene.currentBattle.enemyFaints` is the corresponding faint counter for the enemy (this resets every wave).

- Defined in src/field/arena.ts:59

### playerTerasUsed

playerTerasUsed: number

- Defined in src/field/arena.ts:54

### tags

tags: ArenaTag []

- Defined in src/field/arena.ts:50

### terrain

terrain: null | Terrain

- Defined in src/field/arena.ts:49

### weather

weather: null | Weather

- Defined in src/field/arena.ts:48

## Methods

### addTag

- addTag(
  tagType: ArenaTagType ,
  turnCount: number,
  sourceMove: undefined | Moves ,
  sourceId: number,
  side?: ArenaTagSide ,
  quiet?: boolean,
  targetIndex?: BattlerIndex ,
  ): boolean

  Adds a new tag to the arena

  #### Parameters

  - tagType: ArenaTagType

    `ArenaTagType` the tag being added

  - turnCount: number

    How many turns the tag lasts

  - sourceMove: undefined | Moves

    `Moves` the move the tag came from, or `undefined` if not from a move

  - sourceId: number

    The ID of the pokemon in play the tag came from (see BattleScene.getPokemonById)

  - side: ArenaTagSide = ArenaTagSide.BOTH

    `ArenaTagSide` which side(s) the tag applies to

  - quiet: boolean = false

    If a message should be queued on screen to announce the tag being added

  - `Optional` targetIndex: BattlerIndex

    The `BattlerIndex` of the target pokemon

  #### Returns boolean

  `false` if there already exists a tag of this type in the Arena

  - Defined in src/field/arena.ts:685

### applyTags

- applyTags(
  tagType: ArenaTagType | Constructor < ArenaTag >,
  simulated: boolean,
  ...args: unknown[],
  ): void

  Applies the specified tag to both sides (ie: both user and trainer's tag that match the Tag specified) by calling `()`

  #### Parameters

  - tagType: ArenaTagType | Constructor < ArenaTag >

    Either an `ArenaTagType` string, or an actual `ArenaTag` class to filter which ones to apply

  - simulated: boolean

    if `true`, this applies arena tags without changing game state

  - ...args: unknown[]

    array of parameters that the called upon tags may need

  #### Returns void

  - Defined in src/field/arena.ts:670

### applyTagsForSide

- applyTagsForSide(
  tagType: ArenaTagType | Constructor < ArenaTag >,
  side: ArenaTagSide ,
  simulated: boolean,
  ...args: unknown[],
  ): void

  Applies each `ArenaTag` in this Arena, based on which side (self, enemy, or both) is passed in as a parameter

  #### Parameters

  - tagType: ArenaTagType | Constructor < ArenaTag >

    Either an `ArenaTagType` string, or an actual `ArenaTag` class to filter which ones to apply

  - side: ArenaTagSide

    `ArenaTagSide` which side's arena tags to apply

  - simulated: boolean

    if `true`, this applies arena tags without changing game state

  - ...args: unknown[]

    array of parameters that the called upon tags may need

  #### Returns void

  - Defined in src/field/arena.ts:647

### canSetTerrain

- canSetTerrain(terrain: TerrainType ): boolean

  Returns whether or not the terrain can be set to `terrain`

  #### Parameters

  - terrain: TerrainType

  #### Returns boolean

  - Defined in src/field/arena.ts:402

### canSetWeather

- canSetWeather(weather: WeatherType ): boolean

  Returns weather or not the weather can be changed to `weather`

  #### Parameters

  - weather: WeatherType

  #### Returns boolean

  - Defined in src/field/arena.ts:307

### findTags

- findTags(tagPredicate: (t: ArenaTag ) => boolean): ArenaTag []

  Uses `findTagsOnSide` to filter (using the parameter function) for specific tags that apply to both sides

  #### Parameters

  - tagPredicate: (t: ArenaTag ) => boolean

    a function mapping `ArenaTag`s to `boolean`s

  #### Returns ArenaTag []

  array of `ArenaTag`s from which the Arena's tags return true and apply to both sides

  - Defined in src/field/arena.ts:758

### findTagsOnSide

- findTagsOnSide(
  tagPredicate: (t: ArenaTag ) => boolean,
  side: ArenaTagSide ,
  ): ArenaTag []

  Returns specific tags from the arena that pass the `tagPredicate` function passed in as a parameter, and apply to the given side

  #### Parameters

  - tagPredicate: (t: ArenaTag ) => boolean

    a function mapping `ArenaTag`s to `boolean`s

  - side: ArenaTagSide

    The `ArenaTagSide` to look at

  #### Returns ArenaTag []

  array of `ArenaTag`s from which the Arena's tags return `true` and apply to the given side

  - Defined in src/field/arena.ts:768

### getAttackTypeMultiplier

- getAttackTypeMultiplier(attackType: PokemonType , grounded: boolean): number

  #### Parameters

  - attackType: PokemonType
  - grounded: boolean

  #### Returns number

  - Defined in src/field/arena.ts:472

### getBgmLoopPoint

- getBgmLoopPoint(): number

  The loop point of any given biome track, read as seconds and milliseconds.

  #### Returns number

  - Defined in src/field/arena.ts:837

### getBgTerrainColorRatioForBiome

- getBgTerrainColorRatioForBiome(): number

  #### Returns number

  - Defined in src/field/arena.ts:283

### getDayTint

- getDayTint(): [number, number, number]

  #### Returns [number, number, number]

  - Defined in src/field/arena.ts:588

### getDuskTint

- getDuskTint(): [number, number, number]

  #### Returns [number, number, number]

  - Defined in src/field/arena.ts:600

### getNightTint

- getNightTint(): [number, number, number]

  #### Returns [number, number, number]

  - Defined in src/field/arena.ts:614

### getSpeciesFormIndex

- getSpeciesFormIndex(species: default ): number

  #### Parameters

  - species: default

  #### Returns number

  - Defined in src/field/arena.ts:241

### getTag

- getTag(tagType: ArenaTagType | Constructor < ArenaTag >): undefined | ArenaTag

  Attempts to get a tag from the Arena via `getTagOnSide` that applies to both sides

  #### Parameters

  - tagType: ArenaTagType | Constructor < ArenaTag >

    The `ArenaTagType` or `ArenaTag` to get

  #### Returns undefined | ArenaTag

  either the `ArenaTag`, or `undefined` if it isn't there

  - Defined in src/field/arena.ts:727

### getTagOnSide

- getTagOnSide(
  tagType: ArenaTagType | Constructor < ArenaTag >,
  side: ArenaTagSide ,
  ): undefined | ArenaTag

  Attempts to get a tag from the Arena from a specific side (the tag passed in has to either apply to both sides, or the specific side only)

  eg: `MIST` only applies to the user's side, while `MUD_SPORT` applies to both user and enemy side

  #### Parameters

  - tagType: ArenaTagType | Constructor < ArenaTag >

    The `ArenaTagType` or `ArenaTag` to get

  - side: ArenaTagSide

    The `ArenaTagSide` to look at

  #### Returns undefined | ArenaTag

  either the `ArenaTag`, or `undefined` if it isn't there

  - Defined in src/field/arena.ts:743

### getTerrainType

- getTerrainType(): TerrainType

  #### Returns TerrainType

  - Defined in src/field/arena.ts:468

### getTimeOfDay

- getTimeOfDay(): TimeOfDay

  #### Returns TimeOfDay

  - Defined in src/field/arena.ts:534

### getTrainerChance

- getTrainerChance(): number

  Gets the denominator for the chance for a trainer spawn

  #### Returns number

  n where 1/n is the chance of a trainer battle

  - Defined in src/field/arena.ts:490

### getWeatherType

- getWeatherType(): WeatherType

  #### Returns WeatherType

  - Defined in src/field/arena.ts:464

### hasTag

- hasTag(tagType: ArenaTagType ): boolean

  #### Parameters

  - tagType: ArenaTagType

  #### Returns boolean

  - Defined in src/field/arena.ts:731

### init

- init(): void

  #### Returns void

  - Defined in src/field/arena.ts:78

### isMoveTerrainCancelled

- isMoveTerrainCancelled(
  user: default ,
  targets: BattlerIndex [],
  move: default ,
  ): boolean

  #### Parameters

  - user: default
  - targets: BattlerIndex []
  - move: default

  #### Returns boolean

  - Defined in src/field/arena.ts:460

### isMoveWeatherCancelled

- isMoveWeatherCancelled(user: default , move: default ): boolean

  #### Parameters

  - user: default
  - move: default

  #### Returns boolean

  - Defined in src/field/arena.ts:456

### isOutside

- isOutside(): boolean

  #### Returns boolean

  - Defined in src/field/arena.ts:557

### lapseTags

- lapseTags(): void

  #### Returns void

  - Defined in src/field/arena.ts:774

### overrideTint

- overrideTint(): [number, number, number]

  #### Returns [number, number, number]

  - Defined in src/field/arena.ts:575

### preloadBgm

- preloadBgm(): void

  #### Returns void

  - Defined in src/field/arena.ts:832

### randomSpecies

- randomSpecies(
  waveIndex: number,
  level: number,
  attempt?: number,
  luckValue?: number,
  isBoss?: boolean,
  ): default

  #### Parameters

  - waveIndex: number
  - level: number
  - `Optional` attempt: number
  - `Optional` luckValue: number
  - `Optional` isBoss: boolean

  #### Returns default

  - Defined in src/field/arena.ts:106

### randomTrainerType

- randomTrainerType(waveIndex: number, isBoss?: boolean): TrainerType

  #### Parameters

  - waveIndex: number
  - isBoss: boolean = false

  #### Returns TrainerType

  - Defined in src/field/arena.ts:209

### removeAllTags

- removeAllTags(): void

  #### Returns void

  - Defined in src/field/arena.ts:808

### removeTag

- removeTag(tagType: ArenaTagType ): boolean

  #### Parameters

  - tagType: ArenaTagType

  #### Returns boolean

  - Defined in src/field/arena.ts:785

### removeTagOnSide

- removeTagOnSide(
  tagType: ArenaTagType ,
  side: ArenaTagSide ,
  quiet?: boolean,
  ): boolean

  #### Parameters

  - tagType: ArenaTagType
  - side: ArenaTagSide
  - quiet: boolean = false

  #### Returns boolean

  - Defined in src/field/arena.ts:797

### resetArenaEffects

- resetArenaEffects(): void

  Clears weather, terrain and arena tags when entering new biome or trainer battle.

  #### Returns void

  - Defined in src/field/arena.ts:822

### resetPlayerFaintCount

- resetPlayerFaintCount(): void

  #### Returns void

  - Defined in src/field/arena.ts:915

### setIgnoreAbilities

- setIgnoreAbilities(
  ignoreAbilities: boolean,
  ignoringEffectSource?: null | BattlerIndex ,
  ): void

  #### Parameters

  - ignoreAbilities: boolean
  - ignoringEffectSource: null | BattlerIndex = null

  #### Returns void

  - Defined in src/field/arena.ts:635

### triggerWeatherBasedFormChanges

- triggerWeatherBasedFormChanges(): void

  Function to trigger all weather based form changes

  #### Returns void

  - Defined in src/field/arena.ts:374

### triggerWeatherBasedFormChangesToNormal

- triggerWeatherBasedFormChangesToNormal(): void

  Function to trigger all weather based form changes back into their normal forms

  #### Returns void

  - Defined in src/field/arena.ts:388

### trySetTerrain

- trySetTerrain(
  terrain: TerrainType ,
  ignoreAnim?: boolean,
  user?: default ,
  ): boolean

  Attempts to set a new terrain effect to the battle

  #### Parameters

  - terrain: TerrainType

    `TerrainType` new `TerrainType` to set

  - ignoreAnim: boolean = false

    boolean if the terrain animation should be ignored

  - `Optional` user: default

    `Pokemon` that caused the terrain effect

  #### Returns boolean

  true if new terrain set, false if no terrain provided or attempting to set the same terrain as currently in use

  - Defined in src/field/arena.ts:413

### trySetWeather

- trySetWeather(weather: WeatherType , user?: default ): boolean

  Attempts to set a new weather to the battle

  #### Parameters

  - weather: WeatherType

    `WeatherType` new `WeatherType` to set

  - `Optional` user: default

    `Pokemon` that caused the weather effect

  #### Returns boolean

  true if new weather set, false if no weather provided or attempting to set the same weather as currently in use

  - Defined in src/field/arena.ts:317

### trySetWeatherOverride

- trySetWeatherOverride(weather: WeatherType ): boolean

  Sets weather to the override specified in overrides.ts

  #### Parameters

  - weather: WeatherType

    new `WeatherType` to set

  #### Returns boolean

  true to force trySetWeather to return true

  - Defined in src/field/arena.ts:299

### updatePoolsForTimeOfDay

- updatePoolsForTimeOfDay(): void

  #### Returns void

  - Defined in src/field/arena.ts:93