mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 20:43:07 +00:00
723514e89c
Big thanks to @SciresM @sora10pls @Lusamine @architdate @ReignOfComputer for testing and contributing code / test cases. Can't add co-authors from the PR menu :( Builds will fail because azure pipelines not yet updated with net6.
26 lines
640 B
C#
26 lines
640 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)
|
|
return false;
|
|
return CanHaveDynamaxLevel(pkm.Species);
|
|
}
|
|
|
|
private static bool CanHaveDynamaxLevel(int species)
|
|
{
|
|
return species is not ((int)Zacian or (int)Zamazenta or (int)Eternatus);
|
|
}
|
|
}
|
|
}
|