Update stadium check again

#2065
This commit is contained in:
Kurt 2018-07-20 05:57:57 -07:00
parent 1ff8ebf777
commit c9abeda508

View file

@ -62,7 +62,7 @@ namespace PKHeX.Core
VerifyG1OTWithinBounds(data, tr);
if (data.EncounterOriginal is EncounterStatic s && (s.Version == GameVersion.Stadium || s.Version == GameVersion.Stadium2))
data.AddLine(VerifyG1OTStadium(data, tr));
data.AddLine(VerifyG1OTStadium(pkm, tr, s));
if (pkm.Species == 151)
{
@ -97,17 +97,16 @@ namespace PKHeX.Core
data.AddLine(GetInvalid(V421));
}
}
private CheckResult VerifyG1OTStadium(LegalityAnalysis data, string tr)
private CheckResult VerifyG1OTStadium(PKM pkm, string tr, EncounterStatic s)
{
var pkm = data.pkm;
bool jp = pkm.Japanese;
bool valid = pkm.TID == 2000 && tr == GetStadiumOT(data.Info.Generation, jp);
bool valid;
if (s.Version == GameVersion.Stadium)
valid = pkm.TID == 1999 && tr == (jp ? "スタジアム" : "STADIUM");
else // == GameVersion.Stadium2
valid = pkm.TID == 2000 && tr == (jp ? "スタジアム" : "Stadium");
return valid ? GetValid(jp ? V404 : V403) : GetInvalid(V402);
}
private static string GetStadiumOT(int gen, bool jp)
{
return jp ? "スタジアム" : (gen == 1 ? "STADIUM" : "Stadium");
}
private bool IsOTNameSuspicious(string name)
{