Add friend safari IV check

2 IVs have to be flawless
This commit is contained in:
Kurt 2016-12-31 17:20:13 -08:00
parent 7df5072af7
commit 15f2f07b4a

View file

@ -276,7 +276,7 @@ namespace PKHeX
} }
private void verifyIVs() private void verifyIVs()
{ {
if (EncounterType == typeof (EncounterStatic) && (EncounterMatch as EncounterStatic)?.IV3 == true) if ((EncounterMatch as EncounterStatic)?.IV3 == true)
{ {
if (pkm.IVs.Count(iv => iv == 31) < 3) if (pkm.IVs.Count(iv => iv == 31) < 3)
{ {
@ -284,6 +284,14 @@ namespace PKHeX
return; return;
} }
} }
if ((EncounterMatch as EncounterSlot[])?.All(slot => slot.Type == SlotType.FriendSafari) == true)
{
if (pkm.IVs.Count(iv => iv == 31) < 2)
{
AddLine(Severity.Invalid, "Friend Safari captures should have at least 2 IVs = 31.", CheckIdentifier.IVs);
return;
}
}
if (pkm.IVs.Sum() == 0) if (pkm.IVs.Sum() == 0)
AddLine(Severity.Fishy, "All IVs are zero.", CheckIdentifier.IVs); AddLine(Severity.Fishy, "All IVs are zero.", CheckIdentifier.IVs);
else if (pkm.IVs[0] < 30 && pkm.IVs.All(iv => pkm.IVs[0] == iv)) else if (pkm.IVs[0] < 30 && pkm.IVs.All(iv => pkm.IVs[0] == iv))