mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Fix gyro ball base power
This commit is contained in:
parent
77c584981b
commit
a0b692a279
@ -1698,8 +1698,17 @@ export class BattleStatRatioPowerAttr extends VariablePowerAttr {
|
|||||||
const statThresholds = [ 0.25, 1 / 3, 0.5, 1, -1 ];
|
const statThresholds = [ 0.25, 1 / 3, 0.5, 1, -1 ];
|
||||||
let statThresholdPowers = [ 150, 120, 80, 60, 40 ];
|
let statThresholdPowers = [ 150, 120, 80, 60, 40 ];
|
||||||
|
|
||||||
if (this.invert)
|
if (this.invert) {
|
||||||
statThresholdPowers = statThresholdPowers.reverse();
|
// 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;
|
let w = 0;
|
||||||
while (w < statThresholds.length - 1 && statRatio > statThresholds[w]) {
|
while (w < statThresholds.length - 1 && statRatio > statThresholds[w]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user