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

# Class OpponentHighHpPowerAttr

Attribute used for moves whose base power scales with the opponent's HP Used for Crush Grip, Wring Out, and Hard Press maxBasePower 100 for Hard Press, 120 for others

#### Hierarchy (View Summary)

- VariablePowerAttr
  - OpponentHighHpPowerAttr

- Defined in src/data/moves/move.ts:3977

##### Index

### Constructors

constructor

### Properties

maxBasePower
selfTarget

### Methods

apply
getCondition
getFailedText
getTargetBenefitScore
getUserBenefitScore

## Constructors

### constructor

- new OpponentHighHpPowerAttr(maxBasePower: number): OpponentHighHpPowerAttr

  #### Parameters

  - maxBasePower: number

  #### Returns OpponentHighHpPowerAttr

  Overrides VariablePowerAttr.constructor

  - Defined in src/data/moves/move.ts:3980

## Properties

### maxBasePower

maxBasePower: number

- Defined in src/data/moves/move.ts:3978

### selfTarget

selfTarget: boolean

Should this `Move` target the user?

Inherited from VariablePowerAttr.selfTarget

- Defined in src/data/moves/move.ts:1071

## Methods

### apply

- apply(user: default , target: default , move: default , args: any[]): boolean

  Changes the base power of the move to be the target's HP ratio times the maxBasePower with a min value of 1

  #### Parameters

  - user: default

    n/a

  - target: default

    the Pokemon being attacked

  - move: default

    n/a

  - args: any[]

    holds the base power of the move at args[0]

  #### Returns boolean

  true

  Overrides VariablePowerAttr.apply

  - Defined in src/data/moves/move.ts:3993

### getCondition

- getCondition(): null | MoveCondition | MoveConditionFunc

  #### Returns null | MoveCondition | MoveConditionFunc

  the `MoveCondition` or MoveConditionFunc for this `Move`

  Inherited from VariablePowerAttr.getCondition

  - Defined in src/data/moves/move.ts:1095

### getFailedText

- getFailedText(user: default , target: default , move: default ): undefined | string

  #### Parameters

  - user: default

    `Pokemon` using the move

  - target: default

    `Pokemon` target of the move

  - move: default

    `Move` with this attribute

  #### Returns undefined | string

  the string representing failure of this `Move`

  Inherited from VariablePowerAttr.getFailedText

  - Defined in src/data/moves/move.ts:1106

### getTargetBenefitScore

- getTargetBenefitScore(user: default , target: default , move: default ): 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 VariablePowerAttr.getTargetBenefitScore

  - Defined in src/data/moves/move.ts:1124

### getUserBenefitScore

- getUserBenefitScore(user: default , target: default , move: default ): 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`

  Inherited from VariablePowerAttr.getUserBenefitScore

  - Defined in src/data/moves/move.ts:1115