From 105ee1690eacc8a8f3b3b89a81022b773064263e Mon Sep 17 00:00:00 2001 From: EvGym <67931795+EvGym@users.noreply.github.com> Date: Mon, 28 Aug 2023 10:55:43 -0500 Subject: [PATCH] Fixed IV defaults for generations with hypertraining (#2140) --- js/storage.js | 12 +++++++----- src/panel-teamdropdown.tsx | 7 ------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/js/storage.js b/js/storage.js index c68acaa0b6..dfacd24e17 100644 --- a/js/storage.js +++ b/js/storage.js @@ -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]; + } } } } diff --git a/src/panel-teamdropdown.tsx b/src/panel-teamdropdown.tsx index 0794f16cab..986db5bcd0 100644 --- a/src/panel-teamdropdown.tsx +++ b/src/panel-teamdropdown.tsx @@ -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;