mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-22 20:13:06 +00:00
parent
8958646ae6
commit
025b8da52c
3 changed files with 22 additions and 17 deletions
|
@ -1857,9 +1857,9 @@ namespace PKHeX.Core
|
|||
if (count <= 1 && pkm.AltForm == 0)
|
||||
return; // no forms to check
|
||||
|
||||
if (pkm.AltForm >= count && !IsValidOutOfBoundsForme(pkm.Species, pkm.AltForm, Info.Generation))
|
||||
if (pkm.AltForm >= count && !FormConverter.IsValidOutOfBoundsForme(pkm.Species, pkm.AltForm, Info.Generation))
|
||||
{
|
||||
AddLine(Severity.Invalid, string.Format(V304, count, pkm.AltForm), CheckIdentifier.Form);
|
||||
AddLine(Severity.Invalid, string.Format(V304, count-1, pkm.AltForm), CheckIdentifier.Form);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2029,20 +2029,6 @@ namespace PKHeX.Core
|
|||
|
||||
AddLine(Severity.Valid, V318, CheckIdentifier.Form);
|
||||
}
|
||||
private static bool IsValidOutOfBoundsForme(int species, int form, int generation)
|
||||
{
|
||||
switch (species)
|
||||
{
|
||||
case 201: // Unown
|
||||
return form < (generation == 2 ? 26 : 28); // A-Z : A-Z?!
|
||||
case 414: // Wormadam base form is kept
|
||||
return form < 3;
|
||||
case 664: case 665: // Vivillon Pre-evolutions
|
||||
return form < 18;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private void VerifyMiscG1()
|
||||
{
|
||||
if (pkm.IsEgg)
|
||||
|
|
|
@ -61,7 +61,22 @@ namespace PKHeX.Core
|
|||
return form -2;
|
||||
return form - 1;
|
||||
}
|
||||
|
||||
public static bool IsValidOutOfBoundsForme(int species, int form, int generation)
|
||||
{
|
||||
switch (species)
|
||||
{
|
||||
case 201: // Unown
|
||||
return form < (generation == 2 ? 26 : 28); // A-Z : A-Z?!
|
||||
case 414: // Wormadam base form is kept
|
||||
return form < 3;
|
||||
case 664:
|
||||
case 665: // Vivillon Pre-evolutions
|
||||
return form < 18;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static string[] GetFormsGen1(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, int generation)
|
||||
{
|
||||
switch (species)
|
||||
|
|
|
@ -165,6 +165,10 @@ namespace PKHeX.WinForms
|
|||
errata.Add($"Game can't hold item: {GameInfo.Strings.itemlist[held]}");
|
||||
}
|
||||
|
||||
int count = SAV.Personal[pkm.Species].FormeCount;
|
||||
if (pkm.AltForm >= SAV.Personal[pkm.Species].FormeCount && !FormConverter.IsValidOutOfBoundsForme(pkm.Species, pkm.AltForm, pkm.GenNumber))
|
||||
errata.Add(string.Format(LegalityCheckStrings.V304, count-1, pkm.AltForm));
|
||||
|
||||
if (pkm.Species > GameInfo.Strings.specieslist.Length)
|
||||
errata.Add($"Species Index beyond range: {pkm.Species}");
|
||||
else if (SAV.MaxSpeciesID < pkm.Species)
|
||||
|
|
Loading…
Reference in a new issue