Add specified ability no-hidden check

ability=0 allowed abil1/2 but not 4; catch that scenario
This commit is contained in:
Kurt 2018-10-10 16:31:40 -07:00
parent 2ad103dd46
commit 2db8daa07b

View file

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