mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-22 18:33:14 +00:00
0b32cbf132
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com> Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com> Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
26 lines
650 B
C#
26 lines
650 B
C#
using static PKHeX.Core.Species;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public interface IDynamaxLevel
|
|
{
|
|
byte DynamaxLevel { get; set; }
|
|
}
|
|
|
|
public static class DynamaxLevelExtensions
|
|
{
|
|
public static bool CanHaveDynamaxLevel(this IDynamaxLevel _, PKM pkm)
|
|
{
|
|
if (pkm.IsEgg)
|
|
return false;
|
|
if (pkm.BDSP || pkm.LA)
|
|
return false;
|
|
return CanHaveDynamaxLevel(pkm.Species);
|
|
}
|
|
|
|
private static bool CanHaveDynamaxLevel(int species)
|
|
{
|
|
return species is not ((int)Zacian or (int)Zamazenta or (int)Eternatus);
|
|
}
|
|
}
|
|
}
|