From b7ac5e0992ad2ab4d39f44346e8b9004cd1d8184 Mon Sep 17 00:00:00 2001 From: HoeenHero Date: Mon, 28 Aug 2023 22:29:09 -0400 Subject: [PATCH] Revert "Fixed IV defaults for generations with hypertraining (#2140)" This reverts commit 105ee1690eacc8a8f3b3b89a81022b773064263e. --- js/storage.js | 12 +++++------- src/panel-teamdropdown.tsx | 7 +++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/js/storage.js b/js/storage.js index dfacd24e17..c68acaa0b6 100644 --- a/js/storage.js +++ b/js/storage.js @@ -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]; } } } diff --git a/src/panel-teamdropdown.tsx b/src/panel-teamdropdown.tsx index 986db5bcd0..0794f16cab 100644 --- a/src/panel-teamdropdown.tsx +++ b/src/panel-teamdropdown.tsx @@ -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;