Add GO encounter area/slots

Level ranges per species TBD
This commit is contained in:
Kurt 2018-11-14 17:40:41 -08:00
parent adb6b345be
commit 830c2cbb29
4 changed files with 36 additions and 2 deletions

View File

@ -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();

View File

@ -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<EncounterSlot> 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};
}
}
}

View File

@ -503,6 +503,7 @@ private static IEnumerable<EncounterArea> GetEncounterTable(PKM pkm, GameVersion
case GameVersion.GP: return SlotsGP;
case GameVersion.GE: return SlotsGE;
case GameVersion.GO: return SlotsGO_GG;
default: return Enumerable.Empty<EncounterArea>();
}

View File

@ -105,6 +105,8 @@ public enum SlotType
Purple_Flowers = 1 << 19,
Red_Flowers = 1 << 20,
GoPark = 1 << 21,
// Combined
Headbutt_Special = Headbutt | Special,