From 1484a52fd70adbce0e8ac5f7ce07fadae998465c Mon Sep 17 00:00:00 2001 From: Matt Ross <13306707+mattrossdev@users.noreply.github.com> Date: Fri, 3 May 2024 12:54:21 -0700 Subject: [PATCH] Add variable power attribute for knock off (#426) * feature/add-variable-power-knock-off * Remove console logs --- src/data/move.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/data/move.ts b/src/data/move.ts index 264f5576e..5f86911ae 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2021,6 +2021,17 @@ 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; + return true; + } + + return false; + } +} + export class VariableAtkAttr extends MoveAttr { constructor() { super(); @@ -4583,6 +4594,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)