From a0b692a27922181238ed3c7c8d0950eccee21f6f Mon Sep 17 00:00:00 2001 From: Temps Ray Date: Sat, 20 Apr 2024 00:54:17 -0400 Subject: [PATCH] Fix gyro ball base power --- src/data/move.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index bb88066caca..90227637aaf 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1698,8 +1698,17 @@ export class BattleStatRatioPowerAttr extends VariablePowerAttr { const statThresholds = [ 0.25, 1 / 3, 0.5, 1, -1 ]; let statThresholdPowers = [ 150, 120, 80, 60, 40 ]; - if (this.invert) - statThresholdPowers = statThresholdPowers.reverse(); + if (this.invert) { + // Gyro ball uses a specific formula + let userSpeed = user.getStat(this.stat); + if (userSpeed < 1) { + // Prevent division by zero + userSpeed = 1; + } + let bp = Math.min(150, 25 * target.getStat(this.stat) / userSpeed + 1); + power.value = bp; + return true; + } let w = 0; while (w < statThresholds.length - 1 && statRatio > statThresholds[w]) {