2019-09-12 23:20:52 -07:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2019-09-13 09:08:12 -07:00
|
|
|
|
/// <inheritdoc />
|
2019-09-12 23:20:52 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// <see cref="GameVersion.Gen7"/> encounter area
|
|
|
|
|
/// </summary>
|
|
|
|
|
public sealed class EncounterArea7 : EncounterArea32
|
|
|
|
|
{
|
2020-08-21 16:35:49 -07:00
|
|
|
|
public override IEnumerable<EncounterSlot> GetMatchingSlots(PKM pkm, IReadOnlyList<EvoCriteria> chain)
|
2019-09-12 23:20:52 -07:00
|
|
|
|
{
|
2020-08-21 16:35:49 -07:00
|
|
|
|
foreach (var slot in Slots)
|
2019-09-12 23:20:52 -07:00
|
|
|
|
{
|
2020-08-21 16:35:49 -07:00
|
|
|
|
foreach (var evo in chain)
|
2019-09-12 23:20:52 -07:00
|
|
|
|
{
|
2020-08-21 16:35:49 -07:00
|
|
|
|
if (slot.Species != evo.Species)
|
|
|
|
|
continue;
|
2019-09-12 23:20:52 -07:00
|
|
|
|
|
2020-08-21 16:35:49 -07:00
|
|
|
|
if (!slot.IsLevelWithinRange(pkm.Met_Level))
|
|
|
|
|
break;
|
2019-09-12 23:20:52 -07:00
|
|
|
|
|
2020-08-21 16:35:49 -07:00
|
|
|
|
if (slot.Form != evo.Form && !Legal.WildChangeFormAfter.Contains(slot.Species))
|
|
|
|
|
{
|
|
|
|
|
if (slot.Species != (int)Species.Minior) // Random Color, edge case
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-09-12 23:20:52 -07:00
|
|
|
|
|
2020-08-21 16:35:49 -07:00
|
|
|
|
yield return slot;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-09-12 23:20:52 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-21 16:35:49 -07:00
|
|
|
|
}
|