mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-25 11:53:11 +00:00
734aa33898
Now logic is reasonably split, and each format of area has its own way of yielding slots Too much junk with checking flute boosts or catch combo applicability; just let the area dictate how slots match.
42 lines
No EOL
1.3 KiB
C#
42 lines
No EOL
1.3 KiB
C#
using System.Collections.Generic;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <inheritdoc />
|
|
/// <summary>
|
|
/// <see cref="GameVersion.GO"/> encounter area for <see cref="GameVersion.GG"/>
|
|
/// </summary>
|
|
public sealed class EncounterArea7g : EncounterArea32
|
|
{
|
|
protected override IEnumerable<EncounterSlot> GetFilteredSlots(PKM pkm, IEnumerable<EncounterSlot> slots, int minLevel)
|
|
{
|
|
int species = pkm.Species;
|
|
int form = pkm.AltForm;
|
|
|
|
if (Legal.AlolanVariantEvolutions12.Contains(species)) // match form if same species, else form 0.
|
|
{
|
|
foreach (var slot in slots)
|
|
{
|
|
if (species == slot.Species ? slot.Form == form : slot.Form == 0)
|
|
yield return slot;
|
|
}
|
|
}
|
|
else if (Legal.AlolanOriginForms.Contains(species)) // match slot form
|
|
{
|
|
foreach (var slot in slots)
|
|
{
|
|
if (slot.Form == form)
|
|
yield return slot;
|
|
}
|
|
}
|
|
else if (form == 0)
|
|
{
|
|
// enforce no form
|
|
foreach (var slot in slots)
|
|
{
|
|
yield return slot;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |