mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-16 00:58:01 +00:00
c666183e6c
enhance evolution checking add gen2 game corner static encounters simplify relearn checking methods that did the same thing
24 lines
853 B
C#
24 lines
853 B
C#
using static PKHeX.Core.LegalityCheckStrings;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public static class VerifyEvolution
|
|
{
|
|
// Evolutions
|
|
public static CheckResult verifyEvolution(PKM pkm, IEncounterable EncounterMatch)
|
|
{
|
|
return isValidEvolution(pkm, EncounterMatch)
|
|
? new CheckResult(CheckIdentifier.Evolution)
|
|
: new CheckResult(Severity.Invalid, V86, CheckIdentifier.Evolution);
|
|
}
|
|
private static bool isValidEvolution(PKM pkm, IEncounterable EncounterMatch)
|
|
{
|
|
int species = pkm.Species;
|
|
if (EncounterMatch.Species == species)
|
|
return true;
|
|
if (EncounterMatch.EggEncounter && species == 350)
|
|
return true;
|
|
return Legal.getEvolutionValid(pkm, EncounterMatch.Species);
|
|
}
|
|
}
|
|
}
|