Add tsdoc comments

This commit is contained in:
Matthew Ross 2024-05-11 18:47:30 -07:00
parent 60ac0a1ab8
commit 7ff81c3638

View File

@ -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;
}