More super training checks

Check the secret unlocked/complete flags for eggs
Check the count for VC, and flags too (even though they're checked
later, just do it here)
#2353
This commit is contained in:
Kurt 2019-07-07 15:04:58 -07:00
parent 15c44139c3
commit fef4dbb9dc

View file

@ -25,24 +25,41 @@ namespace PKHeX.Core
data.AddLine(GetInvalid(LSuperUnused));
int TrainCount = pkm.SuperTrainingMedalCount();
if (pkm.IsEgg && TrainCount > 0)
{
data.AddLine(GetInvalid(LSuperEgg));
return;
}
if (TrainCount > 0 && Info.Generation > 6)
{
data.AddLine(GetInvalid(LSuperUnavailable));
return;
}
if (pkm.Format >= 7)
if (pkm.IsEgg)
{
// Can't have any super training data as an egg.
if (TrainCount > 0)
data.AddLine(GetInvalid(LSuperEgg));
if (pkm.SecretSuperTrainingUnlocked)
data.AddLine(GetInvalid(LSuperNoUnlocked));
if (pkm.SecretSuperTrainingComplete)
data.AddLine(GetInvalid(LSuperNoComplete));
return;
}
if (Info.Generation >= 7 || Info.Generation <= 2)
{
// Can't have any super training data if it never visited Gen6.
if (TrainCount > 0)
data.AddLine(GetInvalid(LSuperUnavailable));
if (pkm.SecretSuperTrainingUnlocked)
data.AddLine(GetInvalid(LSuperNoUnlocked));
if (pkm.SecretSuperTrainingComplete)
data.AddLine(GetInvalid(LSuperNoComplete));
return;
}
if (pkm.Format >= 7)
{
// Gen6->Gen7 transfer wipes the two Secret flags.
if (pkm.SecretSuperTrainingUnlocked)
data.AddLine(GetInvalid(LSuperNoUnlocked));
if (pkm.SecretSuperTrainingComplete)
data.AddLine(GetInvalid(LSuperNoComplete));
return;
}
// Only reach here if Format==6.
if (TrainCount == 30 ^ pkm.SecretSuperTrainingComplete)
data.AddLine(GetInvalid(LSuperComplete));
}