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
This commit is contained in:
Kurt
2020-12-02 21:39:45 -08:00
parent d5bd36143e
commit 3d87070cc8

View File

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