Gen 1/2 VC filtered OT name legality (#4155)

This commit is contained in:
abcboy101
2024-01-09 04:34:44 +08:00
committed by GitHub
parent 01131e59f0
commit 3ba2e8e376
2 changed files with 79 additions and 0 deletions

View File

@@ -120,6 +120,11 @@ public void VerifyOTGB(LegalityAnalysis data)
private void VerifyGBOTWithinBounds(LegalityAnalysis data, ReadOnlySpan<char> str)
{
var pk = data.Entity;
// Filtered OT names use unavailable characters and can be too long
if (str.SequenceEqual(StringConverter12Transporter.GetFilteredOT(pk.Language, pk.Version)))
return;
if (pk.Japanese)
{
if (str.Length > 5)

View File

@@ -147,6 +147,80 @@ private static bool IsAnyKataOnly(ReadOnlySpan<char> chars)
5 => "Trainer",
7 => "Entrenador",
//8 => "트레이너",
//9 => "训练家",
//10 => "訓練家",
_ => string.Empty,
};
public static string GetFilteredOT(int language, int version) => version switch
{
(int)GameVersion.RD => language switch
{
1 => "レッド.",
2 => "Red*",
3 => "Rouge*",
4 => "Rosso*",
5 => "Rot*",
7 => "Rojo*",
_ => string.Empty,
},
(int)GameVersion.GN => language switch
{
1 => "グリーン.",
2 => "Blue*",
3 => "Bleu*",
4 => "Blu*",
5 => "Blau*",
7 => "Azul*",
_ => string.Empty,
},
(int)GameVersion.BU => language switch
{
1 => "ブルー.",
_ => string.Empty,
},
(int)GameVersion.YW => language switch
{
1 => "イエロー.",
2 => "Yellow*",
3 => "Jaune*",
4 => "Giallo*",
5 => "Gelb*",
7 => "Amarillo*",
_ => string.Empty,
},
(int)GameVersion.GD => language switch
{
1 => "ゴールド.",
2 => "Gold*",
3 => "Or*",
4 => "Oro*",
5 => "Gold*",
7 => "Oro*",
8 => "금.",
_ => string.Empty,
},
(int)GameVersion.SI => language switch
{
1 => "シルバー.",
2 => "Silver*",
3 => "Argent*",
4 => "Argento*",
5 => "Silber*",
7 => "Plata*",
8 => "은.",
_ => string.Empty,
},
(int)GameVersion.C => language switch
{
1 => "クリスタル.",
2 => "Crystal*",
3 => "Cristal*",
4 => "Cristallo*",
5 => "Kristall*",
7 => "Cristal*",
_ => string.Empty,
},
_ => string.Empty,
};
}