Add toxtricity evo check

refer to sub_71007805B0 for algo
This commit is contained in:
Kurt
2019-11-16 11:01:00 -08:00
parent 3be4fde2d5
commit d65e3369c9
2 changed files with 16 additions and 0 deletions

View File

@@ -58,6 +58,10 @@ public bool Valid(PKM pkm, int lvl, bool skipChecks)
case TradeSpecies:
return !pkm.IsUntraded || skipChecks;
case LevelUpNatureAmped when GetAmpLowKeyResult(pkm.Nature) != pkm.AltForm && !skipChecks:
case LevelUpNatureLowKey when GetAmpLowKeyResult(pkm.Nature) != pkm.AltForm && !skipChecks:
return false;
// Special Level Up Cases -- return false if invalid
case LevelUpBeauty when !(pkm is IContestStats s) || s.CNT_Beauty < Argument:
return skipChecks;
@@ -135,5 +139,12 @@ public EvolutionMethod Copy(int species)
Level = Level
};
}
private static int GetAmpLowKeyResult(int n)
{
if ((uint)(n - 1) > 22)
return 0;
return (0x5BCA51 >> (n - 1)) & 1;
}
}
}

View File

@@ -47,6 +47,11 @@ public enum EvolutionType : byte
LevelUpDusk = 40,
LevelUpWormhole = 41,
UseItemWormhole = 42,
Crit3, // Sirfetch'd
HPDownBy49, // Runerigus
SpinType, // Alcremie
LevelUpNatureAmped, // Toxtricity
LevelUpNatureLowKey, // Toxtricity
}
public static class EvolutionTypeExtensions