PKHeX/PKHeX.Core/Legality/Areas/EncounterArea7b.cs

28 lines
981 B
C#
Raw Normal View History

using System.Collections.Generic;
using System.Linq;
namespace PKHeX.Core
{
/// <inheritdoc />
/// <summary>
/// <see cref="GameVersion.GG"/> encounter area
/// </summary>
public sealed class EncounterArea7b : EncounterArea32
{
private const int CatchComboBonus = 1;
2019-11-16 01:34:18 +00:00
protected override IEnumerable<EncounterSlot> GetMatchFromEvoLevel(PKM pkm, IEnumerable<EvoCriteria> vs, int minLevel)
{
2020-04-13 02:41:03 +00:00
var slots = Slots.Where(slot => vs.Any(evo => evo.Species == slot.Species && evo.Form == slot.Form && evo.Level >= (slot.LevelMin - CatchComboBonus)));
// Get slots where pokemon can exist with respect to level constraints
return slots.Where(s => s.IsLevelWithinRange(minLevel, minLevel, 0, CatchComboBonus));
}
protected override IEnumerable<EncounterSlot> GetFilteredSlots(PKM pkm, IEnumerable<EncounterSlot> slots, int minLevel)
{
2020-04-13 02:41:03 +00:00
return slots;
}
}
2020-04-13 02:41:03 +00:00
}