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

# Class ArenaTrapTag

Abstract class to implement arena traps.

#### Hierarchy (View Summary)

- ArenaTag
  - ArenaTrapTag

- Defined in src/data/arena-tag.ts:688

##### Index

### Constructors

constructor

### Properties

layers
maxLayers
side
sourceId?
sourceMove?
tagType
turnCount

### Methods

activateTrap
apply
getAffectedPokemon
getMatchupScoreMultiplier
getMoveName
getSourcePokemon
lapse
loadTag
onAdd
onOverlap
onRemove

## Constructors

### constructor

- new ArenaTrapTag(
  tagType: ArenaTagType ,
  sourceMove: Moves ,
  sourceId: number,
  side: ArenaTagSide ,
  maxLayers: number,
  ): ArenaTrapTag

  Creates a new instance of the ArenaTrapTag class.

  #### Parameters

  - tagType: ArenaTagType

    The type of the arena tag.

  - sourceMove: Moves

    The move that created the tag.

  - sourceId: number

    The ID of the source of the tag.

  - side: ArenaTagSide

    The side (player or enemy) the tag affects.

  - maxLayers: number

    The maximum amount of layers this tag can have.

  #### Returns ArenaTrapTag

  Overrides ArenaTag.constructor

  - Defined in src/data/arena-tag.ts:701

## Properties

### layers

layers: number

- Defined in src/data/arena-tag.ts:689

### maxLayers

maxLayers: number

- Defined in src/data/arena-tag.ts:690

### side

side: ArenaTagSide = ArenaTagSide.BOTH

Inherited from ArenaTag.side

- Defined in src/data/arena-tag.ts:46

### `Optional` sourceId

sourceId?: number

Inherited from ArenaTag.sourceId

- Defined in src/data/arena-tag.ts:45

### `Optional` sourceMove

sourceMove?: Moves

Inherited from ArenaTag.sourceMove

- Defined in src/data/arena-tag.ts:44

### tagType

tagType: ArenaTagType

Inherited from ArenaTag.tagType

- Defined in src/data/arena-tag.ts:42

### turnCount

turnCount: number

Inherited from ArenaTag.turnCount

- Defined in src/data/arena-tag.ts:43

## Methods

### activateTrap

- activateTrap(_pokemon: default , _simulated: boolean): boolean

  #### Parameters

  - _pokemon: default
  - _simulated: boolean

  #### Returns boolean

  - Defined in src/data/arena-tag.ts:731

### apply

- apply(_arena: Arena , simulated: boolean, pokemon: default ): boolean

  Activates the hazard effect onto a Pokemon when it enters the field

  #### Parameters

  - _arena: Arena

    the `Arena` containing this tag

  - simulated: boolean

    if `true`, only checks if the hazard would activate.

  - pokemon: default

    the `Pokemon` triggering this hazard

  #### Returns boolean

  `true` if this hazard affects the given Pokemon; `false` otherwise.

  Overrides ArenaTag.apply

  - Defined in src/data/arena-tag.ts:723

### getAffectedPokemon

- getAffectedPokemon(): default []

  Helper function that retrieves the Pokemon affected

  #### Returns default []

  list of PlayerPokemon or EnemyPokemon on the field

  Inherited from ArenaTag.getAffectedPokemon

  - Defined in src/data/arena-tag.ts:100

### getMatchupScoreMultiplier

- getMatchupScoreMultiplier(pokemon: default ): number

  #### Parameters

  - pokemon: default

  #### Returns number

  - Defined in src/data/arena-tag.ts:735

### getMoveName

- getMoveName(): null | string

  #### Returns null | string

  Inherited from ArenaTag.getMoveName

  - Defined in src/data/arena-tag.ts:72

### getSourcePokemon

- getSourcePokemon(): null | default

  Helper function that retrieves the source Pokemon

  #### Returns null | default

  The source `Pokemon` or `null` if none is found

  Inherited from ArenaTag.getSourcePokemon

  - Defined in src/data/arena-tag.ts:92

### lapse

- lapse(_arena: Arena ): boolean

  #### Parameters

  - _arena: Arena

  #### Returns boolean

  Inherited from ArenaTag.lapse

  - Defined in src/data/arena-tag.ts:68

### loadTag

- loadTag(source: any): void

  When given a arena tag or json representing one, load the data for it. This is meant to be inherited from by any arena tag with custom attributes

  #### Parameters

  - source: any

    An arena tag

  #### Returns void

  Overrides ArenaTag.loadTag

  - Defined in src/data/arena-tag.ts:741

### onAdd

- onAdd(_arena: Arena , _quiet?: boolean): void

  #### Parameters

  - _arena: Arena
  - _quiet: boolean = false

  #### Returns void

  Inherited from ArenaTag.onAdd

  - Defined in src/data/arena-tag.ts:53

### onOverlap

- onOverlap(arena: Arena , _source: null | default ): void

  #### Parameters

  - arena: Arena
  - _source: null | default

  #### Returns void

  Overrides ArenaTag.onOverlap

  - Defined in src/data/arena-tag.ts:708

### onRemove

- onRemove(_arena: Arena , quiet?: boolean): void

  #### Parameters

  - _arena: Arena
  - quiet: boolean = false

  #### Returns void

  Inherited from ArenaTag.onRemove

  - Defined in src/data/arena-tag.ts:55