2019-09-13 06:20:52 +00:00
|
|
|
|
using System.Collections.Generic;
|
2020-08-30 17:23:22 +00:00
|
|
|
|
using System.Linq;
|
2019-09-13 06:20:52 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// <see cref="GameVersion.GO"/> encounter area for <see cref="GameVersion.GG"/>
|
|
|
|
|
/// </summary>
|
2020-08-30 17:23:22 +00:00
|
|
|
|
public sealed class EncounterArea7g : EncounterArea
|
2019-09-13 06:20:52 +00:00
|
|
|
|
{
|
2020-08-30 18:08:21 +00:00
|
|
|
|
private EncounterArea7g() : base(GameVersion.GO) { }
|
|
|
|
|
|
2020-08-30 17:23:22 +00:00
|
|
|
|
internal static EncounterArea7g[] GetArea()
|
|
|
|
|
{
|
|
|
|
|
var area = new EncounterArea7g { Location = 50, Type = SlotType.GoPark };
|
2020-08-30 18:08:21 +00:00
|
|
|
|
static EncounterSlot7GO GetSlot(EncounterArea7g area, int species, int form)
|
2020-08-30 17:23:22 +00:00
|
|
|
|
{
|
2020-08-30 18:08:21 +00:00
|
|
|
|
return new EncounterSlot7GO(area, species, form, 1, 40);
|
2020-08-30 17:23:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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, // Ninetales
|
|
|
|
|
050, // Diglett
|
|
|
|
|
051, // Dugtrio
|
|
|
|
|
052, // Meowth
|
|
|
|
|
053, // Persian
|
|
|
|
|
074, // Geodude
|
|
|
|
|
075, // Graveler
|
|
|
|
|
076, // Golem
|
|
|
|
|
088, // Grimer
|
|
|
|
|
089, // Muk
|
|
|
|
|
103, // Exeggutor
|
|
|
|
|
105, // Marowak
|
|
|
|
|
|
|
|
|
|
// Level 15+
|
|
|
|
|
026, // Raichu
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var regular = obtainable.Select(z => GetSlot(area, z, 0));
|
|
|
|
|
var alolan = AlolanKanto.Select(z => GetSlot(area, z, 1));
|
|
|
|
|
var slots = regular.Concat(alolan).ToArray();
|
|
|
|
|
|
2020-08-30 18:08:21 +00:00
|
|
|
|
slots[slots.Length - 1].ClampMinRaid(15); // Raichu
|
|
|
|
|
slots[(int)Species.Mewtwo - 1].ClampMinRaid(15);
|
|
|
|
|
slots[(int)Species.Articuno - 1].ClampMinRaid(15);
|
|
|
|
|
slots[(int)Species.Zapdos - 1].ClampMinRaid(15);
|
|
|
|
|
slots[(int)Species.Moltres - 1].ClampMinRaid(15);
|
2020-08-30 17:23:22 +00:00
|
|
|
|
|
|
|
|
|
area.Slots = slots;
|
|
|
|
|
return new[] { area };
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-21 23:35:49 +00:00
|
|
|
|
public override IEnumerable<EncounterSlot> GetMatchingSlots(PKM pkm, IReadOnlyList<EvoCriteria> chain)
|
2019-09-13 06:20:52 +00:00
|
|
|
|
{
|
2020-08-21 23:35:49 +00:00
|
|
|
|
foreach (var slot in Slots)
|
2019-09-13 06:20:52 +00:00
|
|
|
|
{
|
2020-08-21 23:35:49 +00:00
|
|
|
|
foreach (var evo in chain)
|
2019-09-13 06:20:52 +00:00
|
|
|
|
{
|
2020-08-21 23:35:49 +00:00
|
|
|
|
if (slot.Species != evo.Species)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (!slot.IsLevelWithinRange(pkm.Met_Level))
|
|
|
|
|
break;
|
|
|
|
|
if (slot.Form != evo.Form)
|
|
|
|
|
break;
|
|
|
|
|
|
2019-09-13 06:20:52 +00:00
|
|
|
|
yield return slot;
|
2020-08-21 23:35:49 +00:00
|
|
|
|
break;
|
2019-09-13 06:20:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|