';
@@ -1864,20 +1877,16 @@
if (color > 360) color = 360;
buf += '
';
}
- if (this.curTeam.gen > 2) buf += '
Remaining:
';
+ if (this.curTeam.gen > 2 && supportsEVs) buf += '
Remaining:
';
buf += '
EVs
';
+ buf += '
' + (supportsEVs ? 'EVs' : 'AVs') + '
';
var totalev = 0;
this.plus = '';
this.minus = '';
for (var i in stats) {
var val;
- if (this.curTeam.gen > 2) {
- val = '' + (set.evs[i] || '');
- } else {
- val = (set.evs[i] === undefined ? '252' : '' + set.evs[i]);
- }
+ val = '' + ((set.evs[i] === undefined ? defaultEV : set.evs[i]) || '');
if (nature.plus === i) {
val += '+';
this.plus = i;
@@ -1889,12 +1898,12 @@
buf += '
';
totalev += (set.evs[i] || 0);
}
- if (this.curTeam.gen > 2) {
- var maxEv = 510;
- if (totalev <= maxEv) {
- buf += '
' + (totalev > (maxEv - 2) ? 0 : (maxEv - 2) - totalev) + '
';
+ if (this.curTeam.gen > 2 && supportsEVs) {
+ var maxTotalEVs = 510;
+ if (totalev <= maxTotalEVs) {
+ buf += '
' + (totalev > (maxTotalEVs - 2) ? 0 : (maxTotalEVs - 2) - totalev) + '
';
} else {
- buf += '
' + (maxEv - totalev) + '
';
+ buf += '
' + (maxTotalEVs - totalev) + '
';
}
}
buf += '
';
@@ -1902,7 +1911,7 @@
buf += '
';
for (var i in stats) {
if (i === 'spd' && this.curTeam.gen === 1) continue;
- buf += '
';
+ buf += '
';
}
buf += '
';
@@ -3135,12 +3144,23 @@
}
}
- if (this.curTeam && this.ignoreEVLimits) {
+ var supportsEVs = !this.curTeam.format.startsWith('gen7letsgo');
+ var supportsAVs = !supportsEVs && this.curTeam.format.endsWith('norestrictions');
+
+ if (supportsAVs) {
+ evs = {hp:200, atk:200, def:200, spa:200, spd:200, spe:200};
+ if (!moveCount['PhysicalAttack']) evs.atk = 0;
+ if (!moveCount['PhysicalAttack']) evs.atk = 0;
+ if (!moveCount['SpecialAttack']) evs.spa = 0;
+ if (hasMove['gyroball'] || hasMove['trickroom']) evs.spe = 0;
+ } else if (!supportsEVs) {
+ evs = {};
+ } else if (this.curTeam && this.ignoreEVLimits) {
evs = {hp:252, atk:252, def:252, spa:252, spd:252, spe:252};
- if (!moveCount['PhysicalAttack']) delete evs.atk;
- if (!moveCount['SpecialAttack'] && this.curTeam.gen > 1) delete evs.spa;
- if (hasMove['gyroball'] || hasMove['trickroom']) delete evs.spe;
- if (this.curTeam.gen === 1) delete evs.spd;
+ if (!moveCount['PhysicalAttack']) evs.atk = 0;
+ if (!moveCount['SpecialAttack'] && this.curTeam.gen > 1) evs.spa = 0;
+ if (hasMove['gyroball'] || hasMove['trickroom']) evs.spe = 0;
+ if (this.curTeam.gen === 1) evs.spd = 0;
if (this.curTeam.gen < 3) return evs;
} else {
if (!statChart[role]) return {};