mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-24 04:53:08 +00:00
34 lines
955 B
C#
34 lines
955 B
C#
using System.Collections.Generic;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <inheritdoc />
|
|
/// <summary>
|
|
/// <see cref="GameVersion.GG"/> encounter area
|
|
/// </summary>
|
|
public sealed class EncounterArea7b : EncounterArea32
|
|
{
|
|
private const int CatchComboBonus = 1;
|
|
|
|
public override IEnumerable<EncounterSlot> GetMatchingSlots(PKM pkm, IReadOnlyList<EvoCriteria> chain)
|
|
{
|
|
foreach (var slot in Slots)
|
|
{
|
|
foreach (var evo in chain)
|
|
{
|
|
if (slot.Species != evo.Species)
|
|
continue;
|
|
|
|
var met = pkm.Met_Level;
|
|
if (!slot.IsLevelWithinRange(met, 0, CatchComboBonus))
|
|
break;
|
|
if (slot.Form != evo.Form)
|
|
break;
|
|
|
|
yield return slot;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|