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

# Class SubstituteTag

Tag implementing the Substitute Doll effect, for use with the moves Substitute and Shed Tail. Pokemon with this tag deflect most forms of received attack damage onto the tag. This tag also grants immunity to most Status moves and several move effects.

#### Hierarchy (View Summary)

- BattlerTag
  - SubstituteTag

- Defined in src/data/battler-tags.ts:2887

##### Index

### Constructors

constructor

### Properties

hp
isBatonPassable
lapseTypes
sourceId?
sourceInFocus
sourceMove
sprite
tagType
turnCount

### Methods

canAdd
getDescriptor
getMoveName
getSourcePokemon
isSourceLinked
lapse
loadTag
onAdd
onAfterMove
onHit
onOverlap
onPreMove
onRemove

## Constructors

### constructor

- new SubstituteTag(sourceMove: Moves , sourceId: number): SubstituteTag

  #### Parameters

  - sourceMove: Moves
  - sourceId: number

  #### Returns SubstituteTag

  Overrides BattlerTag.constructor

  - Defined in src/data/battler-tags.ts:2895

## Properties

### hp

hp: number

The substitute's remaining HP. If HP is depleted, the Substitute fades.

- Defined in src/data/battler-tags.ts:2889

### isBatonPassable

isBatonPassable: boolean

Inherited from BattlerTag.isBatonPassable

- Defined in src/data/battler-tags.ts:65

### lapseTypes

lapseTypes: BattlerTagLapseType []

Inherited from BattlerTag.lapseTypes

- Defined in src/data/battler-tags.ts:61

### `Optional` sourceId

sourceId?: number

Inherited from BattlerTag.sourceId

- Defined in src/data/battler-tags.ts:64

### sourceInFocus

sourceInFocus: boolean

Is the source Pokemon "in focus," i.e. is it fully visible on the field?

- Defined in src/data/battler-tags.ts:2893

### sourceMove

sourceMove: Moves

Inherited from BattlerTag.sourceMove

- Defined in src/data/battler-tags.ts:63

### sprite

sprite: Sprite

A reference to the sprite representing the Substitute doll

- Defined in src/data/battler-tags.ts:2891

### tagType

tagType: BattlerTagType

Inherited from BattlerTag.tagType

- Defined in src/data/battler-tags.ts:60

### turnCount

turnCount: number

Inherited from BattlerTag.turnCount

- Defined in src/data/battler-tags.ts:62

## Methods

### canAdd

- canAdd(_pokemon: default ): boolean

  #### Parameters

  - _pokemon: default

  #### Returns boolean

  Inherited from BattlerTag.canAdd

  - Defined in src/data/battler-tags.ts:83

### getDescriptor

- getDescriptor(): string

  #### Returns string

  Inherited from BattlerTag.getDescriptor

  - Defined in src/data/battler-tags.ts:97

### getMoveName

- getMoveName(): null | string

  #### Returns null | string

  Inherited from BattlerTag.getMoveName

  - Defined in src/data/battler-tags.ts:105

### getSourcePokemon

- getSourcePokemon(): null | default

  Helper function that retrieves the source Pokemon object

  #### Returns null | default

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

  Inherited from BattlerTag.getSourcePokemon

  - Defined in src/data/battler-tags.ts:124

### isSourceLinked

- isSourceLinked(): boolean

  #### Returns boolean

  Inherited from BattlerTag.isSourceLinked

  - Defined in src/data/battler-tags.ts:101

### lapse

- lapse(pokemon: default , lapseType: BattlerTagLapseType ): boolean

  #### Parameters

  - pokemon: default
  - lapseType: BattlerTagLapseType

  #### Returns boolean

  Overrides BattlerTag.lapse

  - Defined in src/data/battler-tags.ts:2948

### loadTag

- loadTag(source: any): void

  When given a battler tag or json representing one, load the data for it.

  #### Parameters

  - source: any

    A battler tag

  #### Returns void

  Overrides BattlerTag.loadTag

  - Defined in src/data/battler-tags.ts:3000

### onAdd

- onAdd(pokemon: default ): void

  Sets the Substitute's HP and queues an on-add battle animation that initializes the Substitute's sprite.

  #### Parameters

  - pokemon: default

  #### Returns void

  Overrides BattlerTag.onAdd

  - Defined in src/data/battler-tags.ts:2907

### onAfterMove

- onAfterMove(pokemon: default ): void

  Triggers an animation that brings the Pokemon out of focus after it uses a move

  #### Parameters

  - pokemon: default

  #### Returns void

  - Defined in src/data/battler-tags.ts:2970

### onHit

- onHit(pokemon: default ): void

  If the Substitute redirects damage, queue a message to indicate it.

  #### Parameters

  - pokemon: default

  #### Returns void

  - Defined in src/data/battler-tags.ts:2976

### onOverlap

- onOverlap(_pokemon: default ): void

  #### Parameters

  - _pokemon: default

  #### Returns void

  Inherited from BattlerTag.onOverlap

  - Defined in src/data/battler-tags.ts:91

### onPreMove

- onPreMove(pokemon: default ): void

  Triggers an animation that brings the Pokemon into focus before it uses a move

  #### Parameters

  - pokemon: default

  #### Returns void

  - Defined in src/data/battler-tags.ts:2964

### onRemove

- onRemove(pokemon: default ): void

  Queues an on-remove battle animation that removes the Substitute's sprite.

  #### Parameters

  - pokemon: default

  #### Returns void

  Overrides BattlerTag.onRemove

  - Defined in src/data/battler-tags.ts:2934