Add HOME nickname verification rules

This commit is contained in:
Kurt 2021-02-02 19:14:38 -08:00
parent 107d9a71d5
commit 3d99902023

View file

@ -77,6 +77,12 @@ namespace PKHeX.Core
if (string.IsNullOrWhiteSpace(nick))
{
if (n is WC8 {IsHOMEGift: true})
{
VerifyHomeGiftNickname(data, enc, pkm, nickname);
return;
}
if (pkm.IsNicknamed)
data.AddLine(Get(LEncGiftNicknamed, Severity.Invalid));
return;
@ -103,6 +109,16 @@ namespace PKHeX.Core
data.AddLine(Get(LEncGiftNicknamed, severity));
}
private void VerifyHomeGiftNickname(LegalityAnalysis data, IEncounterTemplate enc, ILangNick pkm, string nickname)
{
// can nickname on redemption
if (!pkm.IsNicknamed)
return;
var orig = SpeciesName.GetSpeciesNameGeneration(enc.Species, pkm.Language, enc.Generation);
if (nickname == orig)
data.AddLine(GetInvalid(LNickMatchLanguageFlag));
}
private bool VerifyUnNicknamedEncounter(LegalityAnalysis data, PKM pkm, string nickname)
{
if (pkm.IsNicknamed)