mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-16 09:08:02 +00:00
96f6db0e38
Closes #2457
36 lines
No EOL
1.1 KiB
C#
36 lines
No EOL
1.1 KiB
C#
using static PKHeX.Core.Encounters8Nest;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
/// <summary>
|
|
/// Generation 8 Nest Encounter (Distributed Crystal Data)
|
|
/// </summary>
|
|
public sealed class EncounterStatic8NC : EncounterStatic, IGigantamax, IDynamaxLevel
|
|
{
|
|
public bool CanGigantamax { get; set; }
|
|
public byte DynamaxLevel { get; set; }
|
|
|
|
public override bool IsMatch(PKM pkm, int lvl)
|
|
{
|
|
if (pkm is IDynamaxLevel d && d.DynamaxLevel < DynamaxLevel)
|
|
return false;
|
|
|
|
if (Version != GameVersion.SWSH && pkm.Version != (int)Version && pkm.Met_Location != SharedNest)
|
|
return false;
|
|
|
|
return base.IsMatch(pkm, lvl);
|
|
}
|
|
|
|
public override bool IsMatchDeferred(PKM pkm)
|
|
{
|
|
if (base.IsMatchDeferred(pkm))
|
|
return true;
|
|
if (Ability != A4 && pkm.AbilityNumber == 4)
|
|
return true;
|
|
if (pkm is IGigantamax g && g.CanGigantamax != CanGigantamax)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
}
|
|
} |