From 3d87070cc8133ed49f2d96192511675d4edf30fa Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 2 Dec 2020 21:39:45 -0800 Subject: [PATCH] Require strict match for hidden ability encounters Metagross collision with wild beldum deferral API is kinda crude, hence these janky workarounds. Was originally intended to hold onto close matches when there's no more possible matches to check. I think a priority-deferral while only retaining a single encounter bad (instead of a list of retries) may work better than the current setup, but that would require more abstraction --- .../Encounters/EncounterStatic/EncounterStatic8Nest.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic8Nest.cs b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic8Nest.cs index 4126a28d0..0a48dc995 100644 --- a/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic8Nest.cs +++ b/PKHeX.Core/Legality/Encounters/EncounterStatic/EncounterStatic8Nest.cs @@ -36,6 +36,10 @@ public override bool IsMatch(PKM pkm, DexLevel evo) if (pkm is IDynamaxLevel d && d.DynamaxLevel < DynamaxLevel) return false; + // Required Ability + if (Ability == 4 && pkm.AbilityNumber != 4) + return false; // H + if (Version != GameVersion.SWSH && pkm.Version != (int)Version && pkm.Met_Location != SharedNest) return false; @@ -58,14 +62,13 @@ public sealed override bool IsMatchDeferred(PKM pkm) if (Ability != -1) // Any { + // HA-Only is a strict match. Ability Capsule and Patch can potentially change these. if (Ability == 0 && pkm.AbilityNumber == 4) return true; // 0/1 if (Ability == 1 && pkm.AbilityNumber != 1) return true; // 0 if (Ability == 2 && pkm.AbilityNumber != 2) return true; // 1 - if (Ability == 4 && pkm.AbilityNumber != 4) - return true; // H } if (Shiny != Shiny.Random)