mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-15 00:37:11 +00:00
Add HOME nickname verification rules
This commit is contained in:
parent
107d9a71d5
commit
3d99902023
1 changed files with 16 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue