Fix gyro ball base power (#206)
* Fix gyro ball base power * Update gyro ball for gen6+
This commit is contained in:
parent
9ec505bf35
commit
934fc0ef86
|
@ -1707,8 +1707,18 @@ 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) {
|
||||||
|
// 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;
|
let w = 0;
|
||||||
while (w < statThresholds.length - 1 && statRatio > statThresholds[w]) {
|
while (w < statThresholds.length - 1 && statRatio > statThresholds[w]) {
|
||||||
|
|
Loading…
Reference in New Issue