Skip to content

Commit

Permalink
Update STADIUM ot checks again
Browse files Browse the repository at this point in the history
jp: 1999 if stadium1, 2000 if stadium2
en: 2000

jp: always same OT
en: lowercase if stadium2, uppercase if stadium1

https://projectpokemon.org/home/forums/topic/46893-pkhex-bug-stadium-ot-issue/
  • Loading branch information
kwsch committed Aug 3, 2018
1 parent 4103b4d commit 30a6144
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 14 additions & 0 deletions PKHeX.Core/Legality/Core.cs
Expand Up @@ -1383,5 +1383,19 @@ public static bool IsValidMissingLanguage(PKM pkm)

public static string GetG1OT_GFMew(int lang) => lang == (int)LanguageID.Japanese ? "ゲーフリ" : "GF";
public static string GetG5OT_NSparkle(int lang) => lang == (int)LanguageID.Japanese ? "" : "N";

public static string GetGBStadiumOTName(bool jp, GameVersion s)
{
if (jp)
return "スタジアム";
return s == GameVersion.Stadium2 ? "Stadium" : "STADIUM";
}

public static int GetGBStadiumOTID(bool jp, GameVersion s)
{
if (jp)
return s == GameVersion.Stadium2 ? 2000 : 1999;
return 2000;
}
}
}
8 changes: 3 additions & 5 deletions PKHeX.Core/Legality/Verifiers/TrainerNameVerifier.cs
Expand Up @@ -115,11 +115,9 @@ private void VerifyG1OTWithinBounds(LegalityAnalysis data, string str)
private CheckResult VerifyG1OTStadium(PKM pkm, string tr, IVersion s)
{
bool jp = pkm.Japanese;
bool valid;
if (s.Version == GameVersion.Stadium)
valid = pkm.TID == 1999 && tr == (jp ? "スタジアム" : "STADIUM");
else // == GameVersion.Stadium2
valid = pkm.TID == 2000 && tr == (jp ? "スタジアム" : "Stadium");
var ot = Legal.GetGBStadiumOTName(jp, s.Version);
var id = Legal.GetGBStadiumOTID(jp, s.Version);
bool valid = ot == tr && id == pkm.TID;
return valid ? GetValid(jp ? V404 : V403) : GetInvalid(V402);
}

Expand Down

0 comments on commit 30a6144

Please sign in to comment.