2020-06-19 18:51:15 -05:00
|
|
|
|
using static PKHeX.Core.Species;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
2020-05-16 15:15:41 -07:00
|
|
|
|
{
|
|
|
|
|
public interface IDynamaxLevel
|
|
|
|
|
{
|
|
|
|
|
byte DynamaxLevel { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class DynamaxLevelExtensions
|
|
|
|
|
{
|
|
|
|
|
public static bool CanHaveDynamaxLevel(this IDynamaxLevel _, PKM pkm)
|
|
|
|
|
{
|
|
|
|
|
if (pkm.IsEgg)
|
|
|
|
|
return false;
|
2021-11-19 18:23:49 -08:00
|
|
|
|
if (pkm.BDSP)
|
|
|
|
|
return false;
|
2020-09-03 14:28:51 -07:00
|
|
|
|
return CanHaveDynamaxLevel(pkm.Species);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static bool CanHaveDynamaxLevel(int species)
|
|
|
|
|
{
|
2021-01-04 17:31:43 -08:00
|
|
|
|
return species is not ((int)Zacian or (int)Zamazenta or (int)Eternatus);
|
2020-05-16 15:15:41 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|