From 934fc0ef86478369e9ebfc73eaeabcd396688a34 Mon Sep 17 00:00:00 2001 From: Tempoanon <163687446+TempsRay@users.noreply.github.com> Date: Sat, 20 Apr 2024 01:43:37 -0400 Subject: [PATCH] Fix gyro ball base power (#206) * Fix gyro ball base power * Update gyro ball for gen6+ --- src/data/move.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 3f7bed9960d..2b2698968bc 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1707,8 +1707,18 @@ 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) { + // Gen 6+ always have 1 base power + power.value = 1; + return true; + } + let bp = Math.floor(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]) {