mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 22:40:22 +00:00
Add WC6/WC7 IV check
Closes thread 40025
This commit is contained in:
parent
898dbaf5da
commit
d9c93aa88e
1 changed files with 21 additions and 0 deletions
|
@ -302,6 +302,27 @@ namespace PKHeX.Core
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (EncounterIsMysteryGift)
|
||||
{
|
||||
int[] IVs;
|
||||
switch (((MysteryGift) EncounterMatch).Format)
|
||||
{
|
||||
case 6: IVs = ((WC6)EncounterMatch).IVs; break;
|
||||
case 7: IVs = ((WC7)EncounterMatch).IVs; break;
|
||||
default: IVs = null; break;
|
||||
}
|
||||
|
||||
if (IVs != null)
|
||||
{
|
||||
var pkIVs = pkm.IVs;
|
||||
bool valid = true;
|
||||
for (int i = 0; i < 6; i++)
|
||||
if (IVs[i] <= 31 && IVs[i] != pkIVs[i])
|
||||
valid = false;
|
||||
if (!valid)
|
||||
AddLine(Severity.Invalid, "IVs do not match Mystery Gift Data.", CheckIdentifier.IVs);
|
||||
}
|
||||
}
|
||||
if (pkm.IVs.Sum() == 0)
|
||||
AddLine(Severity.Fishy, "All IVs are zero.", CheckIdentifier.IVs);
|
||||
else if (pkm.IVs[0] < 30 && pkm.IVs.All(iv => pkm.IVs[0] == iv))
|
||||
|
|
Loading…
Reference in a new issue