From 9bfca0b46dbe60de62dd76d448138cd869a257f8 Mon Sep 17 00:00:00 2001 From: sora10pls <17801814+sora10pls@users.noreply.github.com> Date: Wed, 23 Sep 2026 12:36:49 -0400 Subject: [PATCH] Final touches on GO changes --- .../Templates/GO/EncounterSlot8GO.cs | 15 +++++++++++ .../Encounters/Templates/GO/PogoType.cs | 27 ++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs b/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs index a51b5ea64..63bf5d2e1 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/GO/EncounterSlot8GO.cs @@ -60,9 +60,24 @@ public bool IsBallValid(Ball ball, ushort currentSpecies, PKM pk) return ball == Ball.Poke; if (ball == Ball.Master && pk.MetDate < new DateOnly(2023, 5, 21)) return false; + if (ball == Ball.Strange && Type == PogoType.SpecialResearch && SpeciesCategory.IsSpecialPokemon(currentSpecies)) + return false; + if (ball == Ball.Strange && !IsValidWildAreaDate(pk.MetDate)) + return false; return BallRestrict.IsValidBall(ball, Type, Flags); } + private static bool IsValidWildAreaDate(DateOnly? date) => date?.DayNumber switch + { + >= 739204 and <= 739207 => true, // Pokémon GO Wild Area 2024: Fukuoka + >= 739211 and <= 739214 => true, // Pokémon GO Wild Area 2024: Global + >= 739560 and <= 739564 => true, // Pokémon GO Wild Area 2025: Nagasaki + >= 739568 and <= 739571 => true, // Pokémon GO Wild Area 2025: Global + >= 739924 and <= 739928 => true, // Pokémon GO Wild Area 2026: Sendai • Tohoku / Mexico City + >= 739932 and <= 739935 => true, // Pokémon GO Wild Area 2026: Global + _ => false, + }; + private PKM GetBlank() => OriginFormat switch { PogoImportFormat.PK7 => new PK8(), diff --git a/PKHeX.Core/Legality/Encounters/Templates/GO/PogoType.cs b/PKHeX.Core/Legality/Encounters/Templates/GO/PogoType.cs index 5a6dcd51d..d9b7a3f7b 100644 --- a/PKHeX.Core/Legality/Encounters/Templates/GO/PogoType.cs +++ b/PKHeX.Core/Legality/Encounters/Templates/GO/PogoType.cs @@ -76,6 +76,11 @@ or PogoType.RaidUltraBeast or PogoType.RaidShadow or PogoType.RaidShadowMythical or PogoType.RaidShadowUltraBeast; + + public bool IsMaxBattle => type is PogoType.MaxBattle + or PogoType.MaxBattleMythical + or PogoType.MaxBattleUltraBeast + or PogoType.MaxBattleGigantamax; } extension(PogoBallRestriction ball) @@ -94,7 +99,7 @@ public bool IsValidBall(Ball current, PogoType type, PogoFlags flags) if (current is Master) return ball.IsMasterBallUsable(type); if (current is TransferSafariBall) - return ball.IsSafariBallUsable(flags); + return ball.IsSafariBallUsable(type, flags); return ball switch { @@ -108,8 +113,24 @@ public bool IsValidBall(Ball current, PogoType type, PogoFlags flags) }; } - public bool IsMasterBallUsable(PogoType type) => ball is PogoBallRestriction.StandardMaster || type.IsRaid; - public bool IsSafariBallUsable(PogoFlags flags) => ball is PogoBallRestriction.OnlySafari || flags.HasFlag(PogoFlags.FeaturedWildArea); + public bool IsMasterBallUsable(PogoType type) => ball is not (PogoBallRestriction.Standard or PogoBallRestriction.OnlyPoke or PogoBallRestriction.OnlyBeast); + + public bool IsSafariBallUsable(PogoType type, PogoFlags flags) + { + if (ball is PogoBallRestriction.OnlySafari) + return true; + if (!flags.HasFlag(PogoFlags.FeaturedWildArea) && (type.IsRaid || type.IsMaxBattle)) + return false; + + return type switch + { + PogoType.Egg or PogoType.Egg12km => false, + PogoType.ResearchBreakthrough or PogoType.VivillonCollector or PogoType.ReferralBonus => false, + PogoType.GBL or PogoType.GBLMythical or PogoType.GBLEvent => false, + PogoType.Shadow or PogoType.ShadowMythical or PogoType.ShadowUltraBeast => false, + _ => true, + }; + } } }