From d12f76388f3d35efefa985cb48a5e9b4c1234f71 Mon Sep 17 00:00:00 2001 From: wwwwwwzx Date: Wed, 22 Mar 2017 16:47:14 -0700 Subject: [PATCH] Add Hidden Grotto Ability checking --- PKHeX/Legality/CheckStrings.cs | 1 + PKHeX/Legality/Checks.cs | 11 +++++++++++ PKHeX/Legality/Core.cs | 3 --- PKHeX/Resources/text/en/legality_en.txt | Bin 18714 -> 18832 bytes PKHeX/Resources/text/zh/legality_zh.txt | 1 + 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/PKHeX/Legality/CheckStrings.cs b/PKHeX/Legality/CheckStrings.cs index 43320f82f..05971f343 100644 --- a/PKHeX/Legality/CheckStrings.cs +++ b/PKHeX/Legality/CheckStrings.cs @@ -241,6 +241,7 @@ public static string[] getLocalization(string[] existingLines = null) public static string V110 {get; set;} = "Ability does not match Mystery Gift."; public static string V111 {get; set;} = "Hidden Ability on non-SOS wild encounter."; public static string V112 {get; set;} = "Hidden Ability not available."; + public static string V217 {get; set;} = "Hidden Grotto captures should have Hidden Ability."; public static string V115 {get; set;} = "Ability matches ability number."; // Valid public static string V113 {get; set;} = "Ability does not match PID."; diff --git a/PKHeX/Legality/Checks.cs b/PKHeX/Legality/Checks.cs index 92501bc8b..63a57c3fd 100644 --- a/PKHeX/Legality/Checks.cs +++ b/PKHeX/Legality/Checks.cs @@ -985,6 +985,17 @@ private void verifyAbility() return; } } + if (pkm.GenNumber == 5) + { + if (EncounterType == typeof(EncounterSlot[]) && !((EncounterSlot[])EncounterMatch).Any(slot => slot.Type != SlotType.HiddenGrotto)) //encounter only at HiddenGrotto + { + if (pkm.AbilityNumber != 4) + { + AddLine(Severity.Invalid, V217, CheckIdentifier.Ability); + return; + } + } + } if (pkm.GenNumber == 6) { if (EncounterIsMysteryGift) diff --git a/PKHeX/Legality/Core.cs b/PKHeX/Legality/Core.cs index d69418a5a..1a58199f9 100644 --- a/PKHeX/Legality/Core.cs +++ b/PKHeX/Legality/Core.cs @@ -247,10 +247,7 @@ private static void MarkB2W2SwarmSlots(ref EncounterArea[] Areas) private static void MarkG5HiddenGrottoSlots(ref EncounterArea[] Areas) { foreach (EncounterSlot s in Areas[0].Slots) //Only 1 area - { s.Type = SlotType.HiddenGrotto; - //todo: Ability marking and checking - } } private static void MarkG5Slots(ref EncounterArea[] Areas) { diff --git a/PKHeX/Resources/text/en/legality_en.txt b/PKHeX/Resources/text/en/legality_en.txt index 95f4363c40d3e141368db3ddc7d28da117bf9ba2..352f34b571c50cd6f995c77ad9a548b1b911c554 100644 GIT binary patch delta 62 zcmbO=iE+YY#tlJw>SYW@42BHm3