Add gen6+ fixed ability hot path

Closes #2135
This commit is contained in:
Kurt 2018-10-06 11:24:46 -07:00
parent f507ab7081
commit 66faa43e03
3 changed files with 11 additions and 0 deletions

View file

@ -243,6 +243,7 @@ namespace PKHeX.Core
Location = Transfer1,
EggLocation = 0,
Level = pkmMetLevel,
Generation = 7,
Version = GameVersion.RBY
};
enc.FlawlessIVCount = enc.Fateful ? 5 : 3;
@ -261,6 +262,7 @@ namespace PKHeX.Core
Location = Transfer2,
EggLocation = 0,
Level = pkmMetLevel,
Generation = 7,
Version = GameVersion.GSC
};
enc.FlawlessIVCount = enc.Fateful ? 5 : 3;

View file

@ -91,6 +91,15 @@ namespace PKHeX.Core
private CheckResult VerifyFixedAbility(LegalityAnalysis data, IReadOnlyList<int> abilities, AbilityState state, int EncounterAbility, int abilval)
{
var pkm = data.pkm;
if (data.Info.EncounterMatch is IGeneration g && g.Generation >= 6)
{
if (IsAbilityCapsuleModified(pkm, abilities, EncounterAbility))
return GetValid(LAbilityCapsuleUsed);
if (pkm.AbilityNumber != EncounterAbility)
return INVALID;
return VALID;
}
if ((pkm.AbilityNumber == 4) != (EncounterAbility == 4))
return GetInvalid(LAbilityHiddenFail);