Misc heavy ball tweak/fix

Legends weren't in inherit table (no breeding)
Move lineage fetch into check so that it is not calculated & unused for
other pkms
Instead of iterating over inherit table, just use a precomputed list

only 5 possible encounters are stored in the int[], there's more cases
where heavy ball is invalid but there's no possible encounter for them
which would already be flagged by another check.
This commit is contained in:
Kurt 2017-03-13 18:38:56 -07:00
parent 6913567a75
commit f8cf53da3b
2 changed files with 5 additions and 5 deletions

View File

@ -1033,14 +1033,13 @@ private void verifyBall()
return;
}
var lineage = Legal.getLineage(pkm);
if (pkm.Ball == 0x14 && pkm.Gen7) // Heavy Ball
{
if (lineage.Any(e => Legal.Inherit_Apricorn7.Contains(e) && (PersonalTable.SM[e].CatchRate > 20 || PersonalTable.SM[e].Weight >= 1000)))
AddLine(Severity.Valid, "Apricorn Ball possible for species.", CheckIdentifier.Ball);
var lineage = Legal.getLineage(pkm);
if (lineage.Any(e => Legal.AlolanCaptureNoHeavyBall.Contains(e)))
AddLine(Severity.Invalid, "Heavy ball not possible for light, low-catch rate species in Gen VII.", CheckIdentifier.Ball);
else
AddLine(Severity.Invalid, "Heavy ball not possible for light, low-catch rate species in Gen VII", CheckIdentifier.Ball);
AddLine(Severity.Valid, "Apricorn Ball possible for species.", CheckIdentifier.Ball);
return;
}

View File

@ -430,6 +430,7 @@ public static partial class Legal
769, 771, 774, 775, 776, 777, 778, 779, 780, 781,
782
};
internal static readonly int[] AlolanCaptureNoHeavyBall = {374, 785, 786, 787}; // Beldum & Tapus
internal static readonly int[] Inherit_ApricornMale7 =
{
100, // Voltorb