using static PKHeX.Core.Species; namespace PKHeX.Core { /// /// Dynamax Level used by format entity data. /// public interface IDynamaxLevel { byte DynamaxLevel { get; set; } } public static class DynamaxLevelExtensions { /// /// Checks if the species is allowed to have a non-zero value for . /// public static bool CanHaveDynamaxLevel(this IDynamaxLevel _, PKM pkm) { if (pkm.IsEgg) return false; if (pkm.BDSP || pkm.LA) return false; return CanHaveDynamaxLevel(pkm.Species); } /// /// Checks if the species is prevented from gaining any via candy in . /// private static bool CanHaveDynamaxLevel(int species) { return species is not ((int)Zacian or (int)Zamazenta or (int)Eternatus); } } }