diff --git a/PKHeX.Core/Legality/LegalityCheckStrings.cs b/PKHeX.Core/Legality/LegalityCheckStrings.cs index b6fe8b83a..ca930f280 100644 --- a/PKHeX.Core/Legality/LegalityCheckStrings.cs +++ b/PKHeX.Core/Legality/LegalityCheckStrings.cs @@ -409,6 +409,10 @@ public static class LegalityCheckStrings public static string LRibbonFInvalid_0 { get; set; } = "Invalid Ribbons: {0}"; public static string LRibbonFMissing_0 { get; set; } = "Missing Ribbons: {0}"; + public static string LStatIncorrectHeight { get; set; } = "Calculated Height does not match stored value."; + public static string LStatIncorrectWeight { get; set; } = "Calculated Weight does not match stored value."; + public static string LStatIncorrectCP { get; set; } = "Calculated CP does not match stored value."; + public static string LSuperComplete { get; set; } = "Super Training complete flag mismatch."; public static string LSuperDistro { get; set; } = "Distribution Super Training missions are not released."; public static string LSuperEgg { get; set; } = "Can't Super Train an Egg."; diff --git a/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs b/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs index 7feaeb8fb..c3101a833 100644 --- a/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/MiscVerifier.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using static PKHeX.Core.LegalityCheckStrings; namespace PKHeX.Core @@ -36,6 +37,8 @@ public override void Verify(LegalityAnalysis data) if (pkm is PK7 pk7 && pk7.ResortEventStatus >= 20) data.AddLine(GetInvalid(LTransferBad)); + if (pkm is PB7 pb7) + VerifyBelugaStats(data, pb7); VerifyMiscFatefulEncounter(data); } @@ -271,5 +274,17 @@ public void VerifyVersionEvolution(LegalityAnalysis data) break; } } + + private static void VerifyBelugaStats(LegalityAnalysis data, PB7 pb7) + { + if (Math.Abs(pb7.HeightAbsolute - pb7.CalcHeightAbsolute) > 0.001 && !IsStarter(pb7)) + data.AddLine(GetInvalid(LStatIncorrectHeight, CheckIdentifier.Encounter)); + if (Math.Abs(pb7.WeightAbsolute - pb7.CalcWeightAbsolute) > 0.001) + data.AddLine(GetInvalid(LStatIncorrectWeight, CheckIdentifier.Encounter)); + if (pb7.Stat_CP != pb7.CalcCP) + data.AddLine(GetInvalid(LStatIncorrectCP, CheckIdentifier.Encounter)); + } + + private static bool IsStarter(PKM pb7) => (pb7.Species == 25 && pb7.AltForm == 8) || (pb7.Species == 133 && pb7.AltForm == 1); } } diff --git a/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs b/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs index 02d7b7a92..2b8531225 100644 --- a/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs +++ b/PKHeX.Core/Legality/Verifiers/NicknameVerifier.cs @@ -75,7 +75,7 @@ private bool VerifyUnNicknamedEncounter(LegalityAnalysis data, PKM pkm, string n data.AddLine(Get(msg, Severity.Fishy)); return true; } - if (StringConverter.HasEastAsianScriptCharacters(nickname)) // East Asian Scripts + if (StringConverter.HasEastAsianScriptCharacters(nickname) && !(pkm is PB7)) // East Asian Scripts { data.AddLine(GetInvalid(LNickInvalidChar)); return true;