diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs index 8d71488e1..dfe6ecdc5 100644 --- a/PKHeX/Legality/Checks.cs +++ b/PKHeX/Legality/Checks.cs @@ -699,6 +699,20 @@ private void verifyAbility() } } } + if (pkm.GenNumber == 7) + { + if (EncounterType == typeof(EncounterSlot[]) && pkm.AbilityNumber == 4) + { + var slots = (EncounterSlot[])EncounterMatch; + bool valid = slots.Any(slot => slot.Type == SlotType.SOS); + + if (!valid) + { + AddLine(Severity.Invalid, "Hidden Ability on non-SOS wild encounter.", CheckIdentifier.Ability); + return; + } + } + } } if (pkm.GenNumber >= 6 && abilities[pkm.AbilityNumber >> 1] != pkm.Ability) diff --git a/PKHeX/Legality/Structures/SlotType.cs b/PKHeX/Legality/Structures/SlotType.cs index 7cf270384..8acfe3d02 100644 --- a/PKHeX/Legality/Structures/SlotType.cs +++ b/PKHeX/Legality/Structures/SlotType.cs @@ -16,5 +16,6 @@ public enum SlotType Horde, FriendSafari, Special, + SOS, } }