mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-01 23:32:02 -05:00
Properly calculate EV spreads for level 1
This commit is contained in:
@@ -2624,7 +2624,7 @@
|
||||
var i = statChart[role][0];
|
||||
var stat = this.getStat(i, null, 252, plusStat === i ? 1.1 : 1.0);
|
||||
var ev = 252;
|
||||
while (stat <= this.getStat(i, null, ev - 4, plusStat === i ? 1.1 : 1.0)) ev -= 4;
|
||||
while (ev > 0 && stat <= this.getStat(i, null, ev - 4, plusStat === i ? 1.1 : 1.0)) ev -= 4;
|
||||
evs[i] = ev;
|
||||
evTotal += ev;
|
||||
|
||||
@@ -2633,8 +2633,7 @@
|
||||
var stat = this.getStat(i, null, 252, plusStat === i ? 1.1 : 1.0);
|
||||
var ev = 252;
|
||||
if (i === 'hp' && (hasMove['substitute'] || hasMove['transform']) && stat == Math.floor(stat / 4) * 4) stat -= 1;
|
||||
while (stat <= this.getStat(i, null, ev - 4, plusStat === i ? 1.1 : 1.0)) ev -= 4;
|
||||
if (ev < 0) ev = 0;
|
||||
while (ev > 0 && stat <= this.getStat(i, null, ev - 4, plusStat === i ? 1.1 : 1.0)) ev -= 4;
|
||||
evs[i] = ev;
|
||||
evTotal += ev;
|
||||
|
||||
@@ -2648,11 +2647,11 @@
|
||||
hp += 4;
|
||||
evTotal += 4;
|
||||
}
|
||||
while (hp && this.getStat('hp', null, hp, 1) % 2 !== hpParity) {
|
||||
while (hp > 0 && this.getStat('hp', null, hp, 1) % 2 !== hpParity) {
|
||||
hp -= 4;
|
||||
evTotal -= 4;
|
||||
}
|
||||
while (hp && this.getStat('hp', null, hp - 4, 1) % 2 === hpParity) {
|
||||
while (hp > 0 && this.getStat('hp', null, hp - 4, 1) % 2 === hpParity) {
|
||||
hp -= 4;
|
||||
evTotal -= 4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user