Update src/data/ability.ts

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
PrabbyDD 2024-10-24 11:19:15 -07:00 committed by GitHub
parent a4e772a1ba
commit b2371def06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -338,8 +338,14 @@ export class FriendGuardAbAttr extends PreDefendAbAttr {
this.damageMultiplier = damageMultiplier;
}
applyPreDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, cancelled: Utils.BooleanHolder, args: any[]): boolean {
(args[0] as Utils.NumberHolder).value = Utils.toDmgValue((args[0] as Utils.NumberHolder).value * this.damageMultiplier);
/**
* Handles the damage reduction
* @param args
* - `[0]` {@linkcode Utils.NumberHolder} - The damage being dealt
*/
override applyPreDefend(_pokemon: Pokemon, _passive: boolean, _simulated: boolean, _attacker: Pokemon, _move: Move, _cancelled: Utils.BooleanHolder, args: any[]): boolean {
const damage = args[0] as Utils.NumberHolder;
damage.value = Utils.toDmgValue(damage.value * this.damageMultiplier);
return true;
}
}