From 5cf870d73fc089089f2140f99fcc0c7c805ce6f0 Mon Sep 17 00:00:00 2001 From: javierhimura Date: Sun, 28 May 2017 16:02:57 +0200 Subject: [PATCH] Mark OT Female trainer from Gamecube and VC pokemon as invalid. Gamecube games and generation 1 games do not have female player character. Generation 2 is not checked because if the pokemon is in format 2 and have met location data stored that means it was caught in crystal where female player is allowed, checks are not included for generation VC2 pokemon --- PKHeX.Core/Legality/Checks.cs | 12 ++++++++++++ PKHeX.Core/Legality/LegalityCheckStrings.cs | 2 ++ .../Resources/text/en/LegalityCheckStrings_en.txt | 4 +++- .../Resources/text/ko/LegalityCheckStrings_ko.txt | 4 +++- .../Resources/text/zh/LegalityCheckStrings_zh.txt | 4 +++- 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/PKHeX.Core/Legality/Checks.cs b/PKHeX.Core/Legality/Checks.cs index 6a86edcbd..2d37e26bb 100644 --- a/PKHeX.Core/Legality/Checks.cs +++ b/PKHeX.Core/Legality/Checks.cs @@ -422,9 +422,21 @@ namespace PKHeX.Core else if (pkm.SID == 0) AddLine(Severity.Fishy, V37, CheckIdentifier.Trainer); + if (pkm.OT_Gender == 1) + verifyOTFemale(); + if (pkm.VC) verifyG1OT(); } + private void verifyOTFemale() + { + if (pkm.Format < 3) // Format 2 pkm with ot gender stored are from crystal, female player is allowed + return; + if (pkm.Version == 15) + AddLine(Severity.Invalid, V407, CheckIdentifier.Trainer); + else if (pkm.VC) // If VC2 is realease probably more checks will be needed + AddLine(Severity.Invalid, V407, CheckIdentifier.Trainer); + } private void verifyG1OT() { string tr = pkm.OT_Name; diff --git a/PKHeX.Core/Legality/LegalityCheckStrings.cs b/PKHeX.Core/Legality/LegalityCheckStrings.cs index c05f50a2d..d7b9aad96 100644 --- a/PKHeX.Core/Legality/LegalityCheckStrings.cs +++ b/PKHeX.Core/Legality/LegalityCheckStrings.cs @@ -400,6 +400,8 @@ namespace PKHeX.Core public static string V402 {get; set;} = "Incorrect Stadium OT."; public static string V405 {get; set;} = "Outsider {0} should have evolved into {1}."; public static string V406 {get; set;} = "Non japanese Shadow E-reader Pokémon. Unreleased encounter."; + public static string V407 {get; set;} = "OT Trainer from Colloseum/XD could not be female."; + public static string V408 {get; set;} = "OT Trainer from generation 1 could not be female."; #endregion } diff --git a/PKHeX.Core/Resources/text/en/LegalityCheckStrings_en.txt b/PKHeX.Core/Resources/text/en/LegalityCheckStrings_en.txt index ea0faf8af..f15d389b4 100644 --- a/PKHeX.Core/Resources/text/en/LegalityCheckStrings_en.txt +++ b/PKHeX.Core/Resources/text/en/LegalityCheckStrings_en.txt @@ -336,4 +336,6 @@ V400 = Unable to match encounter conditions to a possible RNG frame. V401 = In-game trade {0} should have evolved into {1}. V402 = Incorrect Stadium OT. V405 = Outsider {0} should have evolved into {1}. -V406 = Non japanese Shadow E-reader Pokémon. Unreleased encounter. \ No newline at end of file +V406 = Non japanese Shadow E-reader Pokémon. Unreleased encounter. +V407 = OT Trainer from Colloseum/XD could not be female. +V408 = OT Trainer from generation 1 could not be female. \ No newline at end of file diff --git a/PKHeX.Core/Resources/text/ko/LegalityCheckStrings_ko.txt b/PKHeX.Core/Resources/text/ko/LegalityCheckStrings_ko.txt index 51c767771..977e9271d 100644 --- a/PKHeX.Core/Resources/text/ko/LegalityCheckStrings_ko.txt +++ b/PKHeX.Core/Resources/text/ko/LegalityCheckStrings_ko.txt @@ -337,4 +337,6 @@ V400 = Unable to match encounter conditions to a possible RNG frame. V401 = In-game trade {0} should have evolved into {1}. V402 = Incorrect Stadium OT. V405 = Outsider {0} should have evolved into {1}. -V406 = Non japanese Shadow E-reader Pokémon. Unreleased encounter. \ No newline at end of file +V406 = Non japanese Shadow E-reader Pokémon. Unreleased encounter. +V407 = OT Trainer from Colloseum/XD could not be female. +V408 = OT Trainer from generation 1 could not be female. \ No newline at end of file diff --git a/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt b/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt index f9dc1d59a..454f20455 100644 --- a/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt +++ b/PKHeX.Core/Resources/text/zh/LegalityCheckStrings_zh.txt @@ -336,4 +336,6 @@ V400 = 遇见方式无法与可能的乱数帧匹配。 V401 = 游戏内交换{0}应当进化为{1}. V402 = 不正确竞技场初训家。 V405 = 外来的{0}应当进化为{1}. -V406 = 非日版黑暗E-reader宝可梦。未解禁遇见方式。 \ No newline at end of file +V406 = 非日版黑暗E-reader宝可梦。未解禁遇见方式。 +V407 = OT Trainer from Colloseum/XD could not be female. +V408 = OT Trainer from generation 1 could not be female. \ No newline at end of file