From ef5ff32c3ca40bec9452e9864ba7453f3fa0bd5a Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 2 Sep 2019 18:38:12 -0700 Subject: [PATCH] Add GO transfer restrictions for min level Closes #2381 Keep Raichu and Marowak at the end for ez referencing. Keep a separate refence for alolan kanto stuff for futureproofing Might want to improve the EncounterArea abstraction to do the slot-finding labor themselves, but whatever, hardcode stuff until swsh throws new monkey wrenches in. A good idea would be a dictionary with level forcings [species | form << 10] = X and use the dictionary to check on slot creation --- .../Legality/Encounters/Data/Encounters7b.cs | 48 +++++++++++++++---- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs b/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs index 3b772942d..5f4fd7f55 100644 --- a/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs +++ b/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs @@ -87,13 +87,6 @@ static Encounters7b() private static EncounterArea[] GetGoParkArea() { var area = new EncounterArea { Location = 50 }; - IEnumerable GetAllSlot(int species) - { - yield return GetSlot(species, 0); - if (Legal.AlolanOriginForms.Contains(species) || Legal.EvolveToAlolanForms.Contains(species)) - yield return GetSlot(species, 1); - } - EncounterSlot GetSlot(int species, int form) { return new EncounterSlot @@ -108,11 +101,48 @@ EncounterSlot GetSlot(int species, int form) Version = GameVersion.GO, }; } - area.Slots = Enumerable.Range(1, 150).Concat(Enumerable.Range(808, 2)).SelectMany(GetAllSlot).ToArray(); + + var obtainable = Enumerable.Range(1, 150).Concat(Enumerable.Range(808, 2)); // count : 152 + var AlolanKanto = new byte[] + { + // Level 1+ + 019, // Rattata + 020, // Raticate + 027, // Sandshrew + 028, // Sandslash + 037, // Vulpix + 038, // Ninetails + 050, // Diglett + 051, // Dugtrio + 052, // Meowth + 053, // Persian + 074, // Geodude + 075, // Graveler + 076, // Golem + 088, // Grimer + 089, // Muk + 103, // Exeggutor + + // Level 20+ + 026, // Raichu + 105, // Marowak + }; + + var regular = obtainable.Select(z => GetSlot(z, 0)); + var alolan = AlolanKanto.Select(z => GetSlot(z, 1)); + var slots = regular.Concat(alolan).ToArray(); + + slots[area.Slots.Length - 2].LevelMin = 20; // Raichu + slots[area.Slots.Length - 1].LevelMin = 20; // Marowak + slots[(int)Species.Mewtwo].LevelMin = 20; + slots[(int)Species.Articuno].LevelMin = 15; + slots[(int)Species.Zapdos].LevelMin = 15; + slots[(int)Species.Moltres].LevelMin = 15; + + area.Slots = slots; return new[] {area}; } - // todo: manual addition of slots private class RareSpawn { public int Species;