Skip to content

Commit

Permalink
Revert "Fixed IV defaults for generations with hypertraining (#2140)"
Browse files Browse the repository at this point in the history
This reverts commit 105ee16.
  • Loading branch information
HoeenCoder authored Aug 29, 2023
1 parent 5fd9def commit b7ac5e0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 5 additions & 7 deletions js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1247,13 +1247,11 @@ Storage.importTeam = function (buffer, teams) {
if (line.substr(0, 14) === 'Hidden Power [') {
var hptype = line.substr(14, line.length - 15);
line = 'Hidden Power ' + hptype;
if ((parseInt(format[3], 10) || 6) < 7) { // update IVs to match hidden power if format is gen 6 or earlier
var type = Dex.types.get(hptype);
if (!curSet.ivs && type) {
curSet.ivs = {};
for (var stat in type.HPivs) {
curSet.ivs[stat] = type.HPivs[stat];
}
var type = Dex.types.get(hptype);
if (!curSet.ivs && type) {
curSet.ivs = {};
for (var stat in type.HPivs) {
curSet.ivs[stat] = type.HPivs[stat];
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/panel-teamdropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ class PSTeambuilder {
if (line.startsWith('Hidden Power [')) {
const hpType = line.slice(14, -1) as TypeName;
line = 'Hidden Power ' + hpType;
if (!set.ivs && Dex.types.isName(hpType)) {
set.ivs = {hp: 31, atk: 31, def: 31, spa: 31, spd: 31, spe: 31};
const hpIVs = Dex.types.get(hpType).HPivs || {};
for (let stat in hpIVs) {
set.ivs[stat as StatName] = hpIVs[stat as StatName]!;
}
}
}
if (line === 'Frustration' && set.happiness === undefined) {
set.happiness = 0;
Expand Down

0 comments on commit b7ac5e0

Please sign in to comment.