From b9fda10c21a882c8f67744dd58cfe93254554d6d Mon Sep 17 00:00:00 2001 From: Matthew Ross Date: Fri, 3 May 2024 12:45:15 -0700 Subject: [PATCH] feature/add-variable-power-knock-off --- src/data/move.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/data/move.ts b/src/data/move.ts index b26af03fc5e..18d1d30e4bd 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2018,6 +2018,18 @@ export class PresentPowerAttr extends VariablePowerAttr { } } +export class KnockOffPowerAttr extends VariablePowerAttr { + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + if(target.getHeldItems().length > 0){ + (args[0] as Utils.NumberHolder).value *= 1.5; + console.log(args[0]) + return true; + } + console.log(args[0]) + return false; + } +} + export class VariableAtkAttr extends MoveAttr { constructor() { super(); @@ -4580,6 +4592,7 @@ export function initMoves() { .attr(AddBattlerTagAttr, BattlerTagType.DROWSY, false, true) .condition((user, target, move) => !target.status), new AttackMove(Moves.KNOCK_OFF, Type.DARK, MoveCategory.PHYSICAL, 65, 100, 20, -1, 0, 3) + .attr(KnockOffPowerAttr) .partial(), new AttackMove(Moves.ENDEAVOR, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 5, -1, 0, 3) .attr(MatchHpAttr)