Allow surf crossover from r223<->pkmleague

Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
This commit is contained in:
Kurt 2021-12-11 21:31:32 -08:00
parent aa968f56aa
commit 47a1fd10e4

View file

@ -47,6 +47,31 @@ namespace PKHeX.Core
return slots;
}
public override bool IsMatchLocation(int location)
{
if (base.IsMatchLocation(location))
return true;
return CanCrossoverTo(location);
}
private bool CanCrossoverTo(int location)
{
if (Type is SlotType.Surf)
{
return Location switch
{
486 => location is 167, // Route 223 -> Pokémon League
167 => location is 486, // Pokémon League -> Route 223
// All other crossover surf locations are identical slot lists.
_ => false,
};
}
// No crossover
return false;
}
public override IEnumerable<EncounterSlot> GetMatchingSlots(PKM pkm, IReadOnlyList<EvoCriteria> chain)
{
foreach (var slot in Slots)