mirror of
https://github.com/kwsch/PKHeX
synced 2024-09-21 23:02:00 +00:00
Tweak nickname check severity
This commit is contained in:
parent
0ceec780a1
commit
82a9850c4a
2 changed files with 17 additions and 4 deletions
|
@ -64,6 +64,9 @@ namespace PKHeX
|
|||
return new LegalityCheck(Severity.Indeterminate, "Nickname is empty.");
|
||||
if (pk6.Species > PKX.SpeciesLang[0].Length)
|
||||
return new LegalityCheck(Severity.Indeterminate, "Species index invalid for Nickname comparison.");
|
||||
if (!Encounter.Valid)
|
||||
return new LegalityCheck(Severity.Valid, "Skipped Nickname check due to other check being invalid.");
|
||||
|
||||
if (pk6.IsEgg)
|
||||
{
|
||||
if (!pk6.IsNicknamed)
|
||||
|
@ -75,9 +78,18 @@ namespace PKHeX
|
|||
string nickname = pk6.Nickname.Replace("'", "’");
|
||||
if (pk6.IsNicknamed)
|
||||
{
|
||||
return PKX.SpeciesLang.Any(lang => lang.Contains(nickname))
|
||||
? new LegalityCheck(Severity.Invalid, "Nickname matches another species name (+language).")
|
||||
: new LegalityCheck(Severity.Valid, "Nickname does not match another species name.");
|
||||
for (int i = 0; i < PKX.SpeciesLang.Length; i++)
|
||||
{
|
||||
string[] lang = PKX.SpeciesLang[i];
|
||||
int index = Array.IndexOf(lang, nickname);
|
||||
if (index < 0)
|
||||
continue;
|
||||
|
||||
return index == pk6.Species && i != pk6.Language
|
||||
? new LegalityCheck(Severity.Fishy, "Nickname matches another species name (+language).")
|
||||
: new LegalityCheck(Severity.Fishy, "Nickname flagged, matches species name.");
|
||||
}
|
||||
return new LegalityCheck(Severity.Valid, "Nickname does not match another species name.");
|
||||
}
|
||||
// else
|
||||
{
|
||||
|
|
|
@ -379,7 +379,8 @@ namespace PKHeX
|
|||
foreach (DexLevel evo in evos)
|
||||
{
|
||||
if (lvl >= pk6.Met_Level && lvl >= evo.Level)
|
||||
dl.Add(new DexLevel { Species = evo.Species, Level = lvl });
|
||||
dl.Add(new DexLevel {Species = evo.Species, Level = lvl});
|
||||
else break;
|
||||
if (evo.Level > 1) // Level Up (from previous level)
|
||||
lvl--;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue