From f8cf53da3b76b7d04e60c798aadaedb40b19aa21 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 13 Mar 2017 18:38:56 -0700 Subject: [PATCH] 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. --- PKHeX/Legality/Checks.cs | 9 ++++----- PKHeX/Legality/Tables7.cs | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs index fd5a9f73c..46323b07b 100644 --- a/PKHeX/Legality/Checks.cs +++ b/PKHeX/Legality/Checks.cs @@ -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; } diff --git a/PKHeX/Legality/Tables7.cs b/PKHeX/Legality/Tables7.cs index 58114b909..c5d8fed4c 100644 --- a/PKHeX/Legality/Tables7.cs +++ b/PKHeX/Legality/Tables7.cs @@ -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