Fix gyro ball base power (#206)

* Fix gyro ball base power

* Update gyro ball for gen6+
This commit is contained in:
Tempoanon authored and GitHub committed 2024-04-20 01:43:37 -04:00
1 parent 9ec505bf35
commit 934fc0ef86
1 file changed
+12 -2
+12 -2
View File
@@ -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]) {