From abf7cda272edf38a2f3d5a80a070ac871ddefcc8 Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 22 Nov 2016 17:04:53 -0800 Subject: [PATCH] Add gen7 SOS check To be added shortly, false flags will happen until then. Split binaries for regular & SOS encounters --- PKHeX/Legality/Checks.cs | 14 ++++++++++++++ PKHeX/Legality/Structures/SlotType.cs | 1 + 2 files changed, 15 insertions(+) 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, } }