mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 13:58:33 +00:00
Add level check
Met level > Current Level
This commit is contained in:
parent
b3337cbf24
commit
d57533ea77
2 changed files with 9 additions and 2 deletions
|
@ -8,7 +8,7 @@ namespace PKHeX
|
|||
private readonly PK6 pk6;
|
||||
private WC6 MatchedWC6;
|
||||
private object EncounterMatch;
|
||||
private LegalityCheck ECPID, Nickname, IDs, IVs, EVs, Encounter;
|
||||
private LegalityCheck ECPID, Nickname, IDs, IVs, EVs, Encounter, Level;
|
||||
|
||||
public bool Valid = true;
|
||||
public bool SecondaryChecked;
|
||||
|
@ -46,6 +46,7 @@ namespace PKHeX
|
|||
IDs = verifyID();
|
||||
IVs = verifyIVs();
|
||||
EVs = verifyEVs();
|
||||
Level = verifyLevel();
|
||||
SecondaryChecked = true;
|
||||
}
|
||||
private string getLegalityReport()
|
||||
|
@ -53,7 +54,7 @@ namespace PKHeX
|
|||
if (!pk6.Gen6)
|
||||
return "Analysis only available for Pokémon that originate from X/Y & OR/AS.";
|
||||
|
||||
var chks = new[] { ECPID, Nickname, IVs, EVs, IDs, Encounter};
|
||||
var chks = new[] { ECPID, Nickname, IVs, EVs, IDs, Encounter, Level};
|
||||
|
||||
string r = "";
|
||||
for (int i = 0; i < 4; i++)
|
||||
|
|
|
@ -209,6 +209,12 @@ namespace PKHeX
|
|||
}
|
||||
return new LegalityCheck(Severity.Invalid, "Not a valid encounter.");
|
||||
}
|
||||
private LegalityCheck verifyLevel()
|
||||
{
|
||||
return pk6.CurrentLevel < pk6.Met_Level
|
||||
? new LegalityCheck(Severity.Invalid, "Current level is below met level.")
|
||||
: new LegalityCheck(Severity.Valid, "Current level is not below met level.");
|
||||
}
|
||||
private LegalityCheck[] verifyMoves()
|
||||
{
|
||||
int[] Moves = pk6.Moves;
|
||||
|
|
Loading…
Add table
Reference in a new issue