From d0427f0322cb391ea3fe58b4feca082050128f20 Mon Sep 17 00:00:00 2001 From: wwwwwwzx Date: Sun, 26 Mar 2017 20:21:44 -0700 Subject: [PATCH 1/3] Fix hgss swarm slots replacement note that dppt only have grass swarm --- PKHeX/Legality/Core.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index c32f6d452..55f2f5c46 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -246,15 +246,18 @@ private static void MarkG4SlotsGreatMarsh(ref EncounterArea[] Areas, int locatio } private static void MarkG4SwarmSlots(ref EncounterArea[] Areas, EncounterArea[] SwarmAreas) { - // Swarm slots replace slots 0 and 1 from encounters data + // Grass Swarm slots replace slots 0 and 1 from encounters data + // for surfing only replace slots 0 from encounters data + // for fishing replace one or several random slots from encounters data, but all slots have the same level, it's ok to only replace the first // Species id are not included in encounter tables but levels can be copied from the encounter raw data - foreach(EncounterArea Area in Areas) + foreach (EncounterArea Area in Areas) { var SwarmSlots = SwarmAreas.Where(a => a.Location == Area.Location).SelectMany(s => s.Slots); var OutputSlots = new List(); foreach (EncounterSlot SwarmSlot in SwarmSlots) { - foreach (var swarmSlot in Area.Slots.Where(s => s.Type == SwarmSlot.Type).Take(2).Select(slot => slot.Clone())) + int slotsnum = SwarmSlot.Type == SlotType.Grass ? 2 : 1; + foreach (var swarmSlot in Area.Slots.Where(s => s.Type == SwarmSlot.Type).Take(slotsnum).Select(slot => slot.Clone())) { swarmSlot.Species = SwarmSlot.Species; OutputSlots.Add(swarmSlot); From 543e7bab88f729a8c4a9f3a4ed4c03b7283612a2 Mon Sep 17 00:00:00 2001 From: wwwwwwzx Date: Sun, 26 Mar 2017 20:23:45 -0700 Subject: [PATCH 2/3] Add daily changing pokemon in Great Marsh (dppt) add batch encounterarea generation function --- PKHeX/Legality/Core.cs | 8 +++--- PKHeX/Legality/Structures/EncounterArea.cs | 31 ++++++++++++++++++++++ PKHeX/Legality/Tables4.cs | 14 ++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index 55f2f5c46..387532c8b 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -499,6 +499,8 @@ private static EncounterArea[] getTables2(GameVersion Version) var Pt_Slots = getEncounterTables(GameVersion.Pt); var HG_Slots = getEncounterTables(GameVersion.HG); var SS_Slots = getEncounterTables(GameVersion.SS); + var DP_GreatMarshAlt = EncounterArea.getSimpleEncounterArea(DP_GreatMarshAlt_Speices, new[] {22,22, 24,24, 26,26}, 52, SlotType.Grass_Safari); + var Pt_GreatMarshAlt = EncounterArea.getSimpleEncounterArea(Pt_GreatMarshAlt_Speices, new[] {27,30}, 52, SlotType.Grass_Safari); var DP_Trophy = EncounterArea.getTrophyArea(TrophyDP, new[] {16, 18}); var Pt_Trophy = EncounterArea.getTrophyArea(TrophyPt, new[] {22, 22}); var HG_Headbutt_Slots = EncounterArea.getArray4HGSS_Headbutt(Data.unpackMini(Resources.encunters_hb_hg, "hg")); @@ -533,9 +535,9 @@ private static EncounterArea[] getTables2(GameVersion Version) MarkG4SlotsGreatMarsh(ref P_Slots, 52); MarkG4SlotsGreatMarsh(ref Pt_Slots, 52); - SlotsD = addExtraTableSlots(D_Slots, D_HoneyTrees_Slots, SlotsDPPPtAlt, DP_Trophy); - SlotsP = addExtraTableSlots(P_Slots, P_HoneyTrees_Slots, SlotsDPPPtAlt, DP_Trophy); - SlotsPt = addExtraTableSlots(Pt_Slots, Pt_HoneyTrees_Slots, SlotsDPPPtAlt, Pt_Trophy); + SlotsD = addExtraTableSlots(D_Slots, D_HoneyTrees_Slots, DP_GreatMarshAlt, SlotsDPPPtAlt, DP_Trophy); + SlotsP = addExtraTableSlots(P_Slots, P_HoneyTrees_Slots, DP_GreatMarshAlt, SlotsDPPPtAlt, DP_Trophy); + SlotsPt = addExtraTableSlots(Pt_Slots, Pt_HoneyTrees_Slots, Pt_GreatMarshAlt, SlotsDPPPtAlt, Pt_Trophy); SlotsHG = addExtraTableSlots(HG_Slots, HG_Headbutt_Slots, SlotsHGSSAlt); SlotsSS = addExtraTableSlots(SS_Slots, SS_Headbutt_Slots, SlotsHGSSAlt); diff --git a/PKHeX/Legality/Structures/EncounterArea.cs b/PKHeX/Legality/Structures/EncounterArea.cs index 4683694f6..a69eadb75 100644 --- a/PKHeX/Legality/Structures/EncounterArea.cs +++ b/PKHeX/Legality/Structures/EncounterArea.cs @@ -890,6 +890,37 @@ public static EncounterArea[] getTrophyArea(IEnumerable species, int[] lvls return new[] { new EncounterArea { Location = 68, Slots = l.ToArray() } }; } + /// + /// Gets the encounter areas for species with same level range and same slottype at same location + /// + /// List of species that exist in the Area. + /// Paired LevelMins and LevelMaxs of the encounter slots. + /// Location index of the encounter area. + /// Encounter slot type of the encounter area. + /// + public static EncounterArea[] getSimpleEncounterArea(IEnumerable species, int[] lvls, int location, SlotType t) + { + var l = new List(); + // levels data not paired + if ((lvls.Length & 1) == 1) + return new[] { new EncounterArea { Location = location, Slots = l.ToArray() } }; + + foreach (var s in species) + { + for (int i = 0; i < lvls.Length;) + { + l.Add(new EncounterSlot + { + LevelMin = lvls[i++], + LevelMax = lvls[i++], + Species = s, + Type = t + }); + } + } + return new[] { new EncounterArea { Location = location, Slots = l.ToArray() } }; + } + public static EncounterArea[] getArray(byte[][] entries) { if (entries == null) diff --git a/PKHeX/Legality/Tables4.cs b/PKHeX/Legality/Tables4.cs index f89b46f45..1af461542 100644 --- a/PKHeX/Legality/Tables4.cs +++ b/PKHeX/Legality/Tables4.cs @@ -992,6 +992,20 @@ public static partial class Legal private static int[] TrophyDP = {035, 039, 052, 113, 133, 137, 173, 174, 183, 298, 311, 312, 351, 438, 439, 440}; // Porygon private static int[] TrophyPt = {035, 039, 052, 113, 133, 132, 173, 174, 183, 298, 311, 312, 351, 438, 439, 440}; // Ditto + private static readonly int[] DP_GreatMarshAlt_Speices = + { + // Daily changing Pokemon are not in the raw data http://bulbapedia.bulbagarden.net/wiki/Great_Marsh + 055,315,397,451,453,455, + 183,194,195,298,399,400, // Pre-National Pokédex + 046,102,115,193,285,316,452,454 // Post-National Pokédex + }; + private static readonly int[] Pt_GreatMarshAlt_Speices = + { + 114,193,195,357,451,453,455, + 194, // Pre-National Pokédex + 046,102,115,285,316,352,452,454 // Post-National Pokédex + }; + private static readonly int[] Shellos_EastSeaLocation_DP = { 28, // Route 213 From dbab260a819fdef0e6b18ccd74447bccc1901c52 Mon Sep 17 00:00:00 2001 From: wwwwwwzx Date: Sun, 26 Mar 2017 20:25:17 -0700 Subject: [PATCH 3/3] Misc fixes - Add data from serebii for safari zone in hgss - Fix several typos - Update chinese translation --- PKHeX/Legality/Tables4.cs | 29 +++++++++---------- .../text/zh/LegalityCheckStrings_zh.txt | 17 ++++++++++- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/PKHeX/Legality/Tables4.cs b/PKHeX/Legality/Tables4.cs index 1af461542..e28d67aaa 100644 --- a/PKHeX/Legality/Tables4.cs +++ b/PKHeX/Legality/Tables4.cs @@ -595,10 +595,10 @@ public static partial class Legal Slots = new[] { // Bug Contest Pre-National Pokédex - new EncounterSlot { Species = 010, LevelMin = 07, LevelMax = 08, Type = SlotType.BugContest }, // Caterpie + new EncounterSlot { Species = 010, LevelMin = 07, LevelMax = 18, Type = SlotType.BugContest }, // Caterpie new EncounterSlot { Species = 011, LevelMin = 09, LevelMax = 18, Type = SlotType.BugContest }, // Metapod new EncounterSlot { Species = 012, LevelMin = 12, LevelMax = 15, Type = SlotType.BugContest }, // Butterfree - new EncounterSlot { Species = 013, LevelMin = 07, LevelMax = 08, Type = SlotType.BugContest }, // Weedle + new EncounterSlot { Species = 013, LevelMin = 07, LevelMax = 18, Type = SlotType.BugContest }, // Weedle new EncounterSlot { Species = 014, LevelMin = 09, LevelMax = 18, Type = SlotType.BugContest }, // Kakuna new EncounterSlot { Species = 015, LevelMin = 12, LevelMax = 15, Type = SlotType.BugContest }, // Beedrill new EncounterSlot { Species = 046, LevelMin = 10, LevelMax = 17, Type = SlotType.BugContest }, // Paras @@ -711,7 +711,7 @@ public static partial class Legal new EncounterSlot { Species = 074, LevelMin = 45, LevelMax = 45, Type = SlotType.Grass_Safari }, // Geodude new EncounterSlot { Species = 113, LevelMin = 42, LevelMax = 42, Type = SlotType.Grass_Safari }, // Chansey new EncounterSlot { Species = 129, LevelMin = 15, LevelMax = 17, Type = SlotType.Surf_Safari }, // Magikarp - new EncounterSlot { Species = 129, LevelMin = 15, LevelMax = 17, Type = SlotType.Old_Rod_Safari }, // Magikarp + new EncounterSlot { Species = 129, LevelMin = 12, LevelMax = 15, Type = SlotType.Old_Rod_Safari }, // Magikarp new EncounterSlot { Species = 129, LevelMin = 22, LevelMax = 24, Type = SlotType.Good_Rod_Safari }, // Magikarp new EncounterSlot { Species = 130, LevelMin = 28, LevelMax = 28, Type = SlotType.Good_Rod_Safari }, // Gyarados new EncounterSlot { Species = 130, LevelMin = 42, LevelMax = 42, Type = SlotType.Super_Rod_Safari }, // Gyarados @@ -824,7 +824,6 @@ public static partial class Legal new EncounterSlot { Species = 455, LevelMin = 41, LevelMax = 41, Type = SlotType.Grass_Safari }, // Carnivine // Mountain Zone new EncounterSlot { Species = 019, LevelMin = 15, LevelMax = 16, Type = SlotType.Grass_Safari }, // Rattata - new EncounterSlot { Species = 019, LevelMin = 15, LevelMax = 16, Type = SlotType.Grass_Safari }, // Rattata new EncounterSlot { Species = 020, LevelMin = 15, LevelMax = 17, Type = SlotType.Grass_Safari }, // Raticate new EncounterSlot { Species = 041, LevelMin = 15, LevelMax = 17, Type = SlotType.Grass_Safari }, // Zubat new EncounterSlot { Species = 042, LevelMin = 15, LevelMax = 17, Type = SlotType.Grass_Safari }, // Golbat @@ -854,12 +853,10 @@ public static partial class Legal new EncounterSlot { Species = 098, LevelMin = 16, LevelMax = 17, Type = SlotType.Grass_Safari }, // Krabby new EncounterSlot { Species = 098, LevelMin = 13, LevelMax = 15, Type = SlotType.Old_Rod_Safari }, // Krabby new EncounterSlot { Species = 098, LevelMin = 22, LevelMax = 25, Type = SlotType.Good_Rod_Safari }, // Krabby - new EncounterSlot { Species = 098, LevelMin = 17, LevelMax = 17, Type = SlotType.Old_Rod_Safari }, // Krabby - new EncounterSlot { Species = 098, LevelMin = 18, LevelMax = 18, Type = SlotType.Old_Rod_Safari }, // Krabby + new EncounterSlot { Species = 098, LevelMin = 17, LevelMax = 18, Type = SlotType.Old_Rod_Safari }, // Krabby new EncounterSlot { Species = 099, LevelMin = 38, LevelMax = 39, Type = SlotType.Super_Rod_Safari }, // Kingler new EncounterSlot { Species = 099, LevelMin = 40, LevelMax = 40, Type = SlotType.Grass_Safari }, // Kingler - // new EncounterSlot { Species = 099, Type = SlotType.Good_Rod_Safari }, // Kingler Unknown level - // new EncounterSlot { Species = 099, Type = SlotType.Good_Rod_Safari }, // Kingler Unknown level + new EncounterSlot { Species = 099, LevelMin = 26, LevelMax = 27, Type = SlotType.Good_Rod_Safari }, // Kingler *Serebii new EncounterSlot { Species = 118, LevelMin = 13, LevelMax = 15, Type = SlotType.Old_Rod_Safari }, // Goldeen new EncounterSlot { Species = 118, LevelMin = 22, LevelMax = 22, Type = SlotType.Good_Rod_Safari }, // Goldeen new EncounterSlot { Species = 118, LevelMin = 35, LevelMax = 38, Type = SlotType.Super_Rod_Safari }, // Goldeen @@ -869,8 +866,8 @@ public static partial class Legal new EncounterSlot { Species = 129, LevelMin = 15, LevelMax = 16, Type = SlotType.Surf_Safari }, // Magikarp new EncounterSlot { Species = 131, LevelMin = 15, LevelMax = 16, Type = SlotType.Surf_Safari }, // Lapras new EncounterSlot { Species = 131, LevelMin = 36, LevelMax = 36, Type = SlotType.Surf_Safari }, // Lapras - // new EncounterSlot { Species = 131, Type = SlotType.Surf_Safari }, // Lapras Unknown level - new EncounterSlot { Species = 131, LevelMin = 41, LevelMax = 46, Type = SlotType.Surf_Safari }, // Lapras + new EncounterSlot { Species = 131, LevelMin = 37, LevelMax = 47, Type = SlotType.Surf_Safari }, // Lapras *Serebii + // new EncounterSlot { Species = 131, LevelMin = 41, LevelMax = 46, Type = SlotType.Surf_Safari }, // Lapras *overlapped new EncounterSlot { Species = 179, LevelMin = 43, LevelMax = 43, Type = SlotType.Grass_Safari }, // Mareep new EncounterSlot { Species = 304, LevelMin = 45, LevelMax = 45, Type = SlotType.Grass_Safari }, // Aron new EncounterSlot { Species = 309, LevelMin = 42, LevelMax = 42, Type = SlotType.Grass_Safari }, // Electrike @@ -921,8 +918,8 @@ public static partial class Legal new EncounterSlot { Species = 054, LevelMin = 16, LevelMax = 17, Type = SlotType.Surf_Safari }, // Psyduck new EncounterSlot { Species = 055, LevelMin = 17, LevelMax = 17, Type = SlotType.Grass_Safari }, // Golduck new EncounterSlot { Species = 055, LevelMin = 40, LevelMax = 40, Type = SlotType.Grass_Safari }, // Golduck - new EncounterSlot { Species = 055, LevelMin = 45, LevelMax = 45, Type = SlotType.Surf_Safari }, // Golduck - // new EncounterSlot { Species = 055, Type = SlotType.Surf_Safari }, // Golduck Unknown level + // new EncounterSlot { Species = 055, LevelMin = 45, LevelMax = 45, Type = SlotType.Surf_Safari }, // Golduck *overlapped + new EncounterSlot { Species = 055, LevelMin = 37, LevelMax = 45, Type = SlotType.Surf_Safari }, // Golduck *Serebii new EncounterSlot { Species = 060, LevelMin = 12, LevelMax = 15, Type = SlotType.Old_Rod_Safari }, // Poliwag new EncounterSlot { Species = 060, LevelMin = 22, LevelMax = 24, Type = SlotType.Good_Rod_Safari }, // Poliwag new EncounterSlot { Species = 060, LevelMin = 36, LevelMax = 37, Type = SlotType.Super_Rod_Safari }, // Poliwag @@ -935,8 +932,8 @@ public static partial class Legal new EncounterSlot { Species = 000, LevelMin = 41, LevelMax = 41, Type = SlotType.Grass_Safari }, // Farfetch'd new EncounterSlot { Species = 084, LevelMin = 45, LevelMax = 46, Type = SlotType.Grass_Safari }, // Doduo new EncounterSlot { Species = 129, LevelMin = 12, LevelMax = 15, Type = SlotType.Old_Rod_Safari }, // Magikarp - // new EncounterSlot { Species = 130, Type = SlotType.Super_Rod_Safari }, // Gyarados Unknown level - new EncounterSlot { Species = 130, LevelMin = 47, LevelMax = 47, Type = SlotType.Super_Rod_Safari }, // Gyarados + new EncounterSlot { Species = 130, LevelMin = 45, LevelMax = 48, Type = SlotType.Super_Rod_Safari }, // Gyarados *Serebii + //new EncounterSlot { Species = 130, LevelMin = 47, LevelMax = 47, Type = SlotType.Super_Rod_Safari }, // Gyarados *overlapped new EncounterSlot { Species = 132, LevelMin = 17, LevelMax = 17, Type = SlotType.Grass_Safari }, // Ditto new EncounterSlot { Species = 132, LevelMin = 41, LevelMax = 41, Type = SlotType.Grass_Safari }, // Ditto new EncounterSlot { Species = 161, LevelMin = 15, LevelMax = 17, Type = SlotType.Grass_Safari }, // Sentret @@ -965,7 +962,7 @@ public static partial class Legal new EncounterSlot { Species = 190, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Aipom new EncounterSlot { Species = 214, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Heracross new EncounterSlot { Species = 265, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Wurmple - new EncounterSlot { Species = 412, LevelMin = 5, LevelMax = 15, Form = 0, Type = SlotType.HoneyTree }, // Burmy Plant Cloak + new EncounterSlot { Species = 412, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree, Form = 0, }, // Burmy Plant Cloak new EncounterSlot { Species = 415, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Combee new EncounterSlot { Species = 420, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Cheruby new EncounterSlot { Species = 446, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Munchlax @@ -1053,7 +1050,7 @@ public static partial class Legal 37, // Route 222 47, // Valley Windworks 49, // Fuego Ironworks - 58, //Floaroma Meadow + 58, // Floaroma Meadow }; private static readonly EncounterArea[] SlotsDPPT_Swarm = diff --git a/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt b/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt index daa48fa99..92d2d26d5 100644 --- a/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt +++ b/PKHeX/Resources/text/zh/LegalityCheckStrings_zh.txt @@ -23,6 +23,10 @@ V177 = 通过升级习得。 V330 = 在第{0}世代通过升级习得。 V332 = 在第{0}世代通过招式教学习得。 V333 = 配信蛋招式。 +V344 = 遗传了蛋招式。 +V345 = 遗传了升级招式。 +V346 = 遗传了教学招式。 +V349 = 遗传了TM/HM招式。 V203 = 无性别宝可梦不能有性别。 V201 = 未设置加密常数。 V204 = 持有物未解禁。 @@ -259,4 +263,15 @@ V335 = 初代专属招式。与无法追踪的遗传招式冲突。 V336 = 遗传招式。与配信蛋招式冲突。 V337 = 配信蛋招式。与遗传招式冲突。 V338 = 清除浓雾与潮旋。两者在传到5代以前必须被移除。 -V339 = 第{0}世代秘传学习器(HM招式)。应在传至第{1}世代前被移除。 \ No newline at end of file +V339 = 第{0}世代秘传学习器(HM招式)。应在传至第{1}世代前被移除。 +V340 = 不应有的遗传招式 +V341 = 遗传了遗传招式。配信的蛋不应有。 +V342 = 缺失配信蛋招式. +V343 = 应该是该招式: {0} +V347 = 遗传了升级招式。配信的蛋不应有。 +V348 = 遗传了教学招式。配信的蛋不应有。 +V350 = 遗传了TM/HM招式。配信的蛋不应有。 +V351 = 不合法遇见地点,应该为传送或王冠。 +V352 = 来自初始之间的阿尔宙斯,未发布的配信。 +V353 = 非日版来自边境的小岛的梦幻,未发布的配信。 +V354 = 非白金版来自花之乐园的谢米,未发布的配信。 \ No newline at end of file