Skip to content

Commit

Permalink
remove higher stat check
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed Apr 3, 2024
1 parent 2323419 commit a3a4a38
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions play.pokemonshowdown.com/src/battle-tooltips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2992,29 +2992,9 @@ function BattleStatOptimizer(set: PokemonSet, formatid: ID) {
}

const leftoverEVs = 508 - totalEVs;
if (totalEVs <= 508 && allValidEVs) {
if (leftoverEVs > curLeftoverEVs) {
curSpread = spread;
curLeftoverEVs = leftoverEVs;
} else {
// Check if we hit a jump point
let allGreaterThanOrEqual = true;
let atLeastOneGreaterThan = false;
for (const stat of Dex.statNames) {
const statVal = getStat(stat, spread.evs[stat], nature);
const curStatVal = getStat(stat, curSpread.evs?.[stat] || 0, curSpread);
if (statVal < curStatVal) {
allGreaterThanOrEqual = false;
break;
} else if (statVal > curStatVal) {
atLeastOneGreaterThan = true;
}
}
if (allGreaterThanOrEqual && atLeastOneGreaterThan) {
curSpread = spread;
curLeftoverEVs = leftoverEVs;
}
}
if (totalEVs <= 508 && allValidEVs && leftoverEVs > curLeftoverEVs) {
curSpread = spread;
curLeftoverEVs = leftoverEVs;
}
}

Expand Down

0 comments on commit a3a4a38

Please sign in to comment.