Update gyro ball for gen6+

This commit is contained in:
Temps Ray 2024-04-20 01:20:32 -04:00
parent a0b692a279
commit eb043af173

View File

@ -1702,10 +1702,11 @@ export class BattleStatRatioPowerAttr extends VariablePowerAttr {
// Gyro ball uses a specific formula
let userSpeed = user.getStat(this.stat);
if (userSpeed < 1) {
// Prevent division by zero
userSpeed = 1;
// Gen 6+ always have 1 base power
power.value = 1;
return true;
}
let bp = Math.min(150, 25 * target.getStat(this.stat) / userSpeed + 1);
let bp = Math.floor(Math.min(150, 25 * target.getStat(this.stat) / userSpeed + 1));
power.value = bp;
return true;
}