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.
This commit is contained in:
Kurt
2022-06-29 19:39:08 -07:00
parent 43c9cc6bc1
commit 10cfb45e55
2 changed files with 7 additions and 20 deletions

View File

@@ -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<int> 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<int> PastGenAlolanScans = new()
{
(int)Bellsprout,

View File

@@ -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);