From 10cfb45e554deea5ef26f12e8265aec4ba43a790 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 29 Jun 2022 19:39:08 -0700 Subject: [PATCH] BDSP: Allow bred beast ball if species not in SWSH Remove unnecessary HashSet, all entries are not present in the first hashset comparison. Maybe was true back >4 years ago when initially implemented. --- .../Verifiers/Ball/BallBreedLegality.cs | 18 +----------------- .../Legality/Verifiers/Ball/BallVerifier.cs | 9 ++++++--- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/PKHeX.Core/Legality/Verifiers/Ball/BallBreedLegality.cs b/PKHeX.Core/Legality/Verifiers/Ball/BallBreedLegality.cs index 8a16bd060..2abc8b18f 100644 --- a/PKHeX.Core/Legality/Verifiers/Ball/BallBreedLegality.cs +++ b/PKHeX.Core/Legality/Verifiers/Ball/BallBreedLegality.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using static PKHeX.Core.Species; @@ -22,22 +22,6 @@ internal static class BallBreedLegality (int)Throh, }; - internal static readonly HashSet PastGenAlolanNativesUncapturable = new() - { - // Porygon++ - (int)Porygon, - // Gen1 Fossils - (int)Aerodactyl, (int)Omanyte, (int)Kabuto, - // Gen3 Fossils - (int)Lileep, (int)Anorith, - // Gen4 Fossils - (int)Cranidos, (int)Shieldon, - // Gen5 Fossils - (int)Tirtouga, (int)Archen, - // Gen6 Fossils - (int)Tyrunt, (int)Amaura, - }; - internal static readonly HashSet PastGenAlolanScans = new() { (int)Bellsprout, diff --git a/PKHeX.Core/Legality/Verifiers/Ball/BallVerifier.cs b/PKHeX.Core/Legality/Verifiers/Ball/BallVerifier.cs index 66ed27090..dcdc0f063 100644 --- a/PKHeX.Core/Legality/Verifiers/Ball/BallVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/Ball/BallVerifier.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using static PKHeX.Core.LegalityCheckStrings; using static PKHeX.Core.Ball; @@ -255,7 +255,7 @@ private CheckResult VerifyBallEggGen7(LegalityAnalysis data) return GetInvalid(LBallAbility); // Can't obtain Flabébé-Blue with Hidden Ability in wild if (species == (int)Species.Voltorb && IsHiddenAndNotPossible(pk)) return GetInvalid(LBallAbility); // Can't obtain with Hidden Ability in wild (can only breed with Ditto) - if ((species is >= (int)Species.Pikipek and <= (int)Species.Kommoo) || (BallBreedLegality.AlolanCaptureOffspring.Contains(species) && !BallBreedLegality.PastGenAlolanNativesUncapturable.Contains(species))) + if ((species is >= (int)Species.Pikipek and <= (int)Species.Kommoo) || BallBreedLegality.AlolanCaptureOffspring.Contains(species)) return GetValid(LBallSpeciesPass); if (BallBreedLegality.PastGenAlolanScans.Contains(species)) return GetValid(LBallSpeciesPass); @@ -341,6 +341,9 @@ private CheckResult VerifyBallEggGen8BDSP(LegalityAnalysis data) if (ball == Beast) { + // Most were already caught by Galar ball logic. Check for stuff not in SW/SH. + if (BallBreedLegality.AlolanCaptureOffspring.Contains(species)) + return GetValid(LBallSpeciesPass); if (BallBreedLegality.PastGenAlolanScans.Contains(species)) return GetValid(LBallSpeciesPass); } @@ -418,7 +421,7 @@ private CheckResult VerifyBallEggGen8(LegalityAnalysis data) { if (species == (int)Species.Flabébé && pk.Form == 3 && IsHiddenAndNotPossible(pk)) return GetInvalid(LBallAbility); // Can't obtain Flabébé-Blue with Hidden Ability in wild - if ((species is >= (int)Species.Pikipek and <= (int)Species.Kommoo) || (BallBreedLegality.AlolanCaptureOffspring.Contains(species) && !BallBreedLegality.PastGenAlolanNativesUncapturable.Contains(species))) + if ((species is >= (int)Species.Pikipek and <= (int)Species.Kommoo) || BallBreedLegality.AlolanCaptureOffspring.Contains(species)) return GetValid(LBallSpeciesPass); if (BallBreedLegality.PastGenAlolanScans.Contains(species)) return GetValid(LBallSpeciesPass);