diff --git a/PKHeX.Core/Legality/Encounters/Data/Encounters6.cs b/PKHeX.Core/Legality/Encounters/Data/Encounters6.cs index e59d0d376..d4c050a04 100644 --- a/PKHeX.Core/Legality/Encounters/Data/Encounters6.cs +++ b/PKHeX.Core/Legality/Encounters/Data/Encounters6.cs @@ -42,7 +42,6 @@ static Encounters6() MarkEncounterTradeStrings(TradeGift_AO, TradeAO); SlotsXYAlt.SetVersion(GameVersion.XY); - FriendSafari.SelectMany(z => z).SetVersion(GameVersion.XY); SlotsX.SetVersion(GameVersion.X); SlotsY.SetVersion(GameVersion.Y); SlotsA.SetVersion(GameVersion.AS); @@ -67,6 +66,7 @@ EncounterSlot FriendSafariSlot(int d) LevelMax = 30, Form = 0, Type = SlotType.FriendSafari, + Version = GameVersion.XY, }; } area.Slots = Legal.FriendSafari.Select(FriendSafariSlot).ToArray(); diff --git a/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs b/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs index e06b93c56..9b589ae3c 100644 --- a/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs +++ b/PKHeX.Core/Legality/Encounters/Data/Encounters7b.cs @@ -1,4 +1,6 @@ -using static PKHeX.Core.EncounterUtil; +using System.Collections.Generic; +using System.Linq; +using static PKHeX.Core.EncounterUtil; namespace PKHeX.Core { @@ -7,6 +9,7 @@ internal static class Encounters7b internal static readonly EncounterArea[] SlotsGP = GetEncounterTables(GameVersion.GP); internal static readonly EncounterArea[] SlotsGE = GetEncounterTables(GameVersion.GE); internal static readonly EncounterStatic[] StaticGP, StaticGE; + internal static readonly EncounterArea[] SlotsGO_GG = GetGoParkArea(); static Encounters7b() { @@ -77,5 +80,33 @@ static Encounters7b() new EncounterTrade { Species = 103, Level = 46, Form = 1, TrainerNames = T7, TID7 = 060310, OTGender = 0, Location = -1, IsNicknamed = false }, // Exeggutor new EncounterTrade { Species = 074, Level = 16, Form = 1, TrainerNames = T8, TID7 = 551873, OTGender = 0, Location = -1, IsNicknamed = false }, // Geodude }; + + 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 + { + Area = area, + Generation = 7, + Species = species, + LevelMin = 2, // todo + LevelMax = 60, // todo + Form = form, + Type = SlotType.GoPark, + Version = GameVersion.GO, + }; + } + area.Slots = Enumerable.Range(1, 149).Concat(Enumerable.Range(808, 2)).SelectMany(GetAllSlot).ToArray(); + return new[] {area}; + } } } diff --git a/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs b/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs index 929839712..d0153e51e 100644 --- a/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs +++ b/PKHeX.Core/Legality/Encounters/Generator/EncounterSlotGenerator.cs @@ -503,6 +503,7 @@ private static IEnumerable GetEncounterTable(PKM pkm, GameVersion case GameVersion.GP: return SlotsGP; case GameVersion.GE: return SlotsGE; + case GameVersion.GO: return SlotsGO_GG; default: return Enumerable.Empty(); } diff --git a/PKHeX.Core/Legality/Enums/SlotType.cs b/PKHeX.Core/Legality/Enums/SlotType.cs index 85cf3382b..d2036a33e 100644 --- a/PKHeX.Core/Legality/Enums/SlotType.cs +++ b/PKHeX.Core/Legality/Enums/SlotType.cs @@ -105,6 +105,8 @@ public enum SlotType Purple_Flowers = 1 << 19, Red_Flowers = 1 << 20, + GoPark = 1 << 21, + // Combined Headbutt_Special = Headbutt | Special,