Add WC6/WC7 ability checks

Ability type not possible to generate ability -> flag it. Thanks Sonic
Blader!
This commit is contained in:
Kurt 2017-03-05 22:08:00 -08:00
parent c1ab0699d3
commit a4e04fc2fe

View File

@ -916,6 +916,15 @@ private void verifyAbility()
}
if (pkm.GenNumber == 6)
{
if (EncounterIsMysteryGift)
{
var wc = EncounterMatch as WC6;
var type = wc?.AbilityType;
if (type < 3 && pkm.AbilityNumber != 1 << type) // set number
AddLine(Severity.Invalid, "Ability does not match Mystery Gift.", CheckIdentifier.Ability);
else if (type == 3 && pkm.AbilityNumber == 4) // 1/2 only
AddLine(Severity.Invalid, "Ability does not match Mystery Gift.", CheckIdentifier.Ability);
}
if (EncounterType == typeof(EncounterSlot[]) && pkm.AbilityNumber == 4)
{
var slots = (EncounterSlot[])EncounterMatch;
@ -932,6 +941,15 @@ private void verifyAbility()
}
if (pkm.GenNumber == 7)
{
if (EncounterIsMysteryGift)
{
var wc = EncounterMatch as WC7;
var type = wc?.AbilityType;
if (type < 3 && pkm.AbilityNumber != 1 << type) // set number
AddLine(Severity.Invalid, "Ability does not match Mystery Gift.", CheckIdentifier.Ability);
else if (type == 3 && pkm.AbilityNumber == 4) // 1/2 only
AddLine(Severity.Invalid, "Ability does not match Mystery Gift.", CheckIdentifier.Ability);
}
if (EncounterType == typeof(EncounterSlot[]) && pkm.AbilityNumber == 4)
{
var slots = (EncounterSlot[])EncounterMatch;