mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
Simplify showdownset form handling
replace all dashes with spaces, and vice versa Closes #1930
This commit is contained in:
parent
5cb232d474
commit
7e9b5362d0
1 changed files with 4 additions and 9 deletions
|
@ -435,7 +435,7 @@ namespace PKHeX.Core
|
||||||
switch (spec)
|
switch (spec)
|
||||||
{
|
{
|
||||||
case 550 when form == "Blue":
|
case 550 when form == "Blue":
|
||||||
return "Blue Striped";
|
return "Blue-Striped";
|
||||||
case 666 when form == "Poké Ball":
|
case 666 when form == "Poké Ball":
|
||||||
return "Pokeball"; // Vivillon
|
return "Pokeball"; // Vivillon
|
||||||
case 718: // Zygarde
|
case 718: // Zygarde
|
||||||
|
@ -458,16 +458,15 @@ namespace PKHeX.Core
|
||||||
default:
|
default:
|
||||||
if (Legal.Totem_USUM.Contains(spec) && form == "Large")
|
if (Legal.Totem_USUM.Contains(spec) && form == "Large")
|
||||||
return Legal.Totem_Alolan.Contains(spec) ? "Alola-Totem" : "Totem";
|
return Legal.Totem_Alolan.Contains(spec) ? "Alola-Totem" : "Totem";
|
||||||
if (form.StartsWith("Mega"))
|
return form.Replace(" ", "-");
|
||||||
return form.Replace(" ", "-");
|
|
||||||
return form;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static string ConvertFormFromShowdown(string form, int spec, int ability)
|
private static string ConvertFormFromShowdown(string form, int spec, int ability)
|
||||||
{
|
{
|
||||||
|
form = form.Replace(" ", "-"); // inconsistencies are great
|
||||||
switch (spec)
|
switch (spec)
|
||||||
{
|
{
|
||||||
case 550 when form == "Blue Striped": // Basculin
|
case 550 when form == "Blue-Striped": // Basculin
|
||||||
return "Blue";
|
return "Blue";
|
||||||
case 658 when ability == 210: // Greninja
|
case 658 when ability == 210: // Greninja
|
||||||
return "Ash"; // Battle Bond
|
return "Ash"; // Battle Bond
|
||||||
|
@ -484,8 +483,6 @@ namespace PKHeX.Core
|
||||||
case 718 when ability == 211:
|
case 718 when ability == 211:
|
||||||
return "-C"; // Power Construct
|
return "-C"; // Power Construct
|
||||||
|
|
||||||
case 741 when form == "Pom Pom":
|
|
||||||
return "Pom-Pom";
|
|
||||||
case 744 when ability == 020: // Rockruff-1
|
case 744 when ability == 020: // Rockruff-1
|
||||||
return "Dusk";
|
return "Dusk";
|
||||||
|
|
||||||
|
@ -504,8 +501,6 @@ namespace PKHeX.Core
|
||||||
return null;
|
return null;
|
||||||
if (Legal.Totem_USUM.Contains(spec) && form.EndsWith("Totem"))
|
if (Legal.Totem_USUM.Contains(spec) && form.EndsWith("Totem"))
|
||||||
return "Large";
|
return "Large";
|
||||||
if (form.StartsWith("Mega"))
|
|
||||||
return form.Replace("-", " ");
|
|
||||||
return form;
|
return form;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue