mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 06:20:25 +00:00
a601180821
Simplify some GUI interactions when changing strain. Changing the day selection will update the visibility, no need to manually do it again.
17 lines
507 B
C#
17 lines
507 B
C#
namespace PKHeX.Core;
|
|
|
|
public static class Pokerus
|
|
{
|
|
public static int GetMaxDuration(int strain) => (strain & 3) + 1;
|
|
|
|
public static bool IsObtainable(PKM pkm) => pkm is not PA8; // don't care about PK1
|
|
|
|
public static bool IsStrainValid(PKM pkm, int strain, int days) => IsObtainable(pkm) && IsStrainValid(strain, days);
|
|
|
|
public static bool IsStrainValid(int strain, int days) => strain switch
|
|
{
|
|
0 when days is not 0 => false,
|
|
8 => false,
|
|
_ => true,
|
|
};
|
|
}
|