mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-21 09:53:14 +00:00
ef3cb34387
* Make EvolutionCriteria struct 8 bytes per object instead of 26 Unify LevelMin/LevelMax to match EncounterTemplate bubble up precise array type for better iteration * Inline queue operations, less allocation * Inline some logic * Update EvolutionChain.cs * Improve clarity on duplicate move check * Search reverse For a dual stage chain, finds it first iteration rather than second.
33 lines
1 KiB
C#
33 lines
1 KiB
C#
using static PKHeX.Core.Encounters8Nest;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Generation 8 Nest Encounter (Distributed Crystal Data)
|
|
/// </summary>
|
|
/// <inheritdoc cref="EncounterStatic8Nest{T}"/>
|
|
public sealed record EncounterStatic8NC(GameVersion Version) : EncounterStatic8Nest<EncounterStatic8NC>(Version)
|
|
{
|
|
protected override bool IsMatchLocation(PKM pkm)
|
|
{
|
|
var loc = pkm.Met_Location;
|
|
return loc is SharedNest or Watchtower;
|
|
}
|
|
|
|
protected override bool IsMatchLevel(PKM pkm, IDexLevel 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;
|
|
if (pkm.Met_Location == Watchtower && pkm.IsShiny)
|
|
return false; // host cannot downlevel and be shiny
|
|
return lvl % 5 == 0;
|
|
}
|
|
}
|
|
}
|