diff --git a/src/data/ability.ts b/src/data/ability.ts index e31672aa35c..e87784b2488 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -988,6 +988,12 @@ export class MoveTypeChangeAttr extends PreAttackAbAttr { } } +/** + * Class for abilities that boost the damage of moves + * For abilities that boost the base power of moves, see VariableMovePowerAbAttr + * @param damageMultiplier the amount to multiply the damage by + * @param condition the condition for this ability to be applied + */ export class DamageBoostAbAttr extends PreAttackAbAttr { private damageMultiplier: number; private condition: PokemonAttackCondition; @@ -998,9 +1004,18 @@ export class DamageBoostAbAttr extends PreAttackAbAttr { this.condition = condition; } - applyPreAttack(pokemon: Pokemon, passive: boolean, target: Pokemon, move: PokemonMove, args: any[]): boolean { - if (this.condition(pokemon, target, move.getMove())) { - (args[0] as Utils.NumberHolder).value *= this.damageMultiplier; + /** + * + * @param pokemon the attacker pokemon + * @param passive N/A + * @param defender the target pokemon + * @param move the move used by the attacker pokemon + * @param args Utils.NumberHolder as damage + * @returns true if the function succeeds + */ + applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean { + if (this.condition(pokemon, defender, move.getMove())) { + (args[0] as Utils.NumberHolder).value *= this.damageMultiplier; return true; }