2020-01-04 19:44:16 +00:00
|
|
|
|
using static PKHeX.Core.Encounters8Nest;
|
2019-11-24 06:23:43 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Generation 8 Nest Encounter (Distributed Crystal Data)
|
|
|
|
|
/// </summary>
|
2020-11-27 19:51:02 +00:00
|
|
|
|
/// <inheritdoc cref="EncounterStatic8Nest{T}"/>
|
2021-12-10 03:30:12 +00:00
|
|
|
|
public sealed record EncounterStatic8NC(GameVersion Version) : EncounterStatic8Nest<EncounterStatic8NC>(Version)
|
2019-11-24 06:23:43 +00:00
|
|
|
|
{
|
2019-12-05 03:04:36 +00:00
|
|
|
|
protected override bool IsMatchLocation(PKM pkm)
|
|
|
|
|
{
|
|
|
|
|
var loc = pkm.Met_Location;
|
2020-12-25 20:30:26 +00:00
|
|
|
|
return loc is SharedNest or Watchtower;
|
2019-12-05 03:04:36 +00:00
|
|
|
|
}
|
2020-12-26 17:31:21 +00:00
|
|
|
|
|
|
|
|
|
protected override bool IsMatchLevel(PKM pkm, DexLevel evo)
|
|
|
|
|
{
|
|
|
|
|
var lvl = pkm.Met_Level;
|
|
|
|
|
if (lvl == Level)
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
// Check downleveled (20-55)
|
|
|
|
|
if (lvl > Level)
|
|
|
|
|
return false;
|
|
|
|
|
if (lvl is < 20 or > 55)
|
|
|
|
|
return false;
|
2021-10-10 00:12:54 +00:00
|
|
|
|
if (pkm.Met_Location == Watchtower && pkm.IsShiny)
|
|
|
|
|
return false; // host cannot downlevel and be shiny
|
2020-12-26 17:31:21 +00:00
|
|
|
|
return lvl % 5 == 0;
|
|
|
|
|
}
|
2019-11-24 06:23:43 +00:00
|
|
|
|
}
|
2020-12-25 20:30:26 +00:00
|
|
|
|
}
|