From 2db8daa07bcb426e68a114dd1ec827ec74537cc7 Mon Sep 17 00:00:00 2001 From: Kurt Date: Wed, 10 Oct 2018 16:31:40 -0700 Subject: [PATCH] Add specified ability no-hidden check ability=0 allowed abil1/2 but not 4; catch that scenario --- .../Legality/Verifiers/AbilityVerifier.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs b/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs index d71018116..1a5b59b80 100644 --- a/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/AbilityVerifier.cs @@ -55,8 +55,14 @@ namespace PKHeX.Core { var EncounterMatch = data.EncounterMatch; var eabil = GetEncounterFixedAbilityNumber(EncounterMatch); - if (eabil > 0) - return VerifyFixedAbility(data, abilities, AbilityState.CanMismatch, eabil, abilnum); + if (eabil >= 0) + { + + if ((data.pkm.AbilityNumber == 4) != (eabil == 4)) + return GetInvalid(LAbilityHiddenFail); + if (eabil > 0) + return VerifyFixedAbility(data, abilities, AbilityState.CanMismatch, eabil, abilnum); + } var gen = data.Info.Generation; switch (gen) @@ -78,8 +84,13 @@ namespace PKHeX.Core var EncounterMatch = data.EncounterMatch; int eabil = GetEncounterFixedAbilityNumber(EncounterMatch); - if (eabil > 0) - return VerifyFixedAbility(data, abilities, state, eabil, abilnum); + if (eabil >= 0) + { + if ((data.pkm.AbilityNumber == 4) != (eabil == 4)) + return GetInvalid(LAbilityHiddenFail); + if (eabil > 0) + return VerifyFixedAbility(data, abilities, state, eabil, abilnum); + } int gen = data.Info.Generation; if (gen == 5)