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

# Class SacrificialFullRestoreAttr

Attribute used for moves which self KO the user regardless if the move hits a target

#### See

`apply`

#### Hierarchy (view full)

- SacrificialAttr
  - SacrificialFullRestoreAttr

- Defined in src/data/move.ts:1312

#####
Index

### Constructors

constructor

### Properties

firstHitOnly
lastHitOnly
selfTarget
trigger

### Methods

apply
canApply
getCondition
getFailedText
getMoveChance
getTargetBenefitScore
getUserBenefitScore

## Constructors

### constructor

- new SacrificialFullRestoreAttr(): SacrificialFullRestoreAttr

- #### Returns SacrificialFullRestoreAttr

  Overrides SacrificialAttr.constructor

  - Defined in src/data/move.ts:1313

## Properties

### firstHitOnly

firstHitOnly: boolean

Should this effect only apply on the first hit?

Inherited from SacrificialAttr.firstHitOnly

- Defined in src/data/move.ts:813

### lastHitOnly

lastHitOnly: boolean

Should this effect only apply on the last hit?

Inherited from SacrificialAttr.lastHitOnly

- Defined in src/data/move.ts:815

### selfTarget

selfTarget: boolean

Should this `Move` target the user?

Inherited from SacrificialAttr.selfTarget

- Defined in src/data/move.ts:736

### trigger

trigger: MoveEffectTrigger

Defines when this effect should trigger in the move's effect order

#### See

`phases.MoveEffectPhase.start`

Inherited from SacrificialAttr.trigger

- Defined in src/data/move.ts:811

## Methods

### apply

- apply(user, target, move, args): boolean

- Deals damage to the user equal to their current hp

  #### Parameters

  - user: default

    `Pokemon` that used the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  - args: any[]

    N/A

  #### Returns boolean

  true if the function succeeds

  Overrides SacrificialAttr.apply

  - Defined in src/data/move.ts:1317

### canApply

- canApply(user, target, move, args): boolean

- Determines whether the `Move`'s effects are valid to `apply`

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  - args: any[]

    Set of unique arguments needed by this attribute

  #### Returns boolean

  true if basic application of the ability attribute should be possible

  Inherited from SacrificialAttr.canApply

  - Defined in src/data/move.ts:833

### getCondition

- getCondition(): MoveConditionFunc

- #### Returns MoveConditionFunc

  the `MoveCondition` or MoveConditionFunc for this `Move`

  Overrides SacrificialAttr.getCondition

  - Defined in src/data/move.ts:1335

### getFailedText

- getFailedText(user, target, move, cancelled): string

- #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  - cancelled: BooleanHolder

    `Utils.BooleanHolder` which stores if the move should fail

  #### Returns string

  the string representing failure of this `Move`

  Inherited from SacrificialAttr.getFailedText

  - Defined in src/data/move.ts:772

### getMoveChance

- getMoveChance(user, target, move, selfEffect?): number

- Gets the used move's additional effect chance. If user's ability has MoveEffectChanceMultiplierAbAttr or IgnoreMoveEffectsAbAttr modifies the base chance.

  #### Parameters

  - user: default

    `Pokemon` using this move

  - target: default

    `Pokemon` target of this move

  - move: default

    `Move` being used

  - `Optional` selfEffect: Boolean

    Boolean if move targets user.

  #### Returns number

  Move chance value.

  Inherited from SacrificialAttr.getMoveChance

  - Defined in src/data/move.ts:853

### getTargetBenefitScore

- getTargetBenefitScore(user, target, move): number

- Used by the Enemy AI to rank an attack based on a given target

  #### Parameters

  - user: default
  - target: default
  - move: default

  #### Returns number

  #### See

  `EnemyPokemon.getNextMove`

  Inherited from SacrificialAttr.getTargetBenefitScore

  - Defined in src/data/move.ts:790

### getUserBenefitScore

- getUserBenefitScore(user, target, move): number

- Used by the Enemy AI to rank an attack based on a given user

  #### Parameters

  - user: default
  - target: default
  - move: default

  #### Returns number

  #### See

  `EnemyPokemon.getNextMove`

  Overrides SacrificialAttr.getUserBenefitScore

  - Defined in src/data/move.ts:1331