Skip to content

Commit

Permalink
Fixed IV defaults for generations with hypertraining
Browse files Browse the repository at this point in the history
  • Loading branch information
EvGym committed Aug 28, 2023
1 parent e229e89 commit 3f869b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
12 changes: 7 additions & 5 deletions js/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1247,11 +1247,13 @@ Storage.importTeam = function (buffer, teams) {
if (line.substr(0, 14) === 'Hidden Power [') {
var hptype = line.substr(14, line.length - 15);
line = 'Hidden Power ' + hptype;
var type = Dex.types.get(hptype);
if (!curSet.ivs && type) {
curSet.ivs = {};
for (var stat in type.HPivs) {
curSet.ivs[stat] = type.HPivs[stat];
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];
}
}
}
}
Expand Down
7 changes: 0 additions & 7 deletions src/panel-teamdropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,6 @@ 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 3f869b8

Please sign in to comment.