From 0be2bd467430f281be002591c49025a05e4bebe1 Mon Sep 17 00:00:00 2001 From: ReignOfComputer Date: Fri, 3 Feb 2017 08:33:27 +0800 Subject: [PATCH 1/4] Fix Showdown Import with Null Forms Fixes https://projectpokemon.org/forums/forums/topic/40047-error-when-importing-pokemon-from-showdown/ --- PKHeX/PKM/ShowdownSet.cs | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/PKHeX/PKM/ShowdownSet.cs b/PKHeX/PKM/ShowdownSet.cs index c20573418..b00c91352 100644 --- a/PKHeX/PKM/ShowdownSet.cs +++ b/PKHeX/PKM/ShowdownSet.cs @@ -164,22 +164,29 @@ public string getText() // Showdown Quirks string form = Form; - switch (Species) + if (!string.IsNullOrWhiteSpace(form)) { - case 658: // Greninja - form = form.Replace("Ash", ""); - form = form.Replace("Active", ""); - break; - case 718: // Zygarde - form = form.Replace("-C", ""); - form = form.Replace("50%", ""); - form = form.Replace("100%", "Complete"); - break; - case 774: // Minior - if (string.IsNullOrWhiteSpace(form) || form.StartsWith("M-")) - form = "Meteor"; - form = form.Replace("C-", ""); - break; + switch (Species) + { + case 658: // Greninja + form = form.Replace("Ash", ""); + form = form.Replace("Active", ""); + break; + case 718: // Zygarde + form = form.Replace("-C", ""); + form = form.Replace("50%", ""); + form = form.Replace("100%", "Complete"); + break; + case 774: // Minior + if (form.StartsWith("M-")) + form = "Meteor"; + form = form.Replace("C-", ""); + break; + } + } + else if (Species == 774) // Minior + { + form = "Meteor"; } // First Line: Name, Nickname, Gender, Item From 42a185c682838c8660bd81b0c13e51769e1f6d4b Mon Sep 17 00:00:00 2001 From: ReignOfComputer Date: Fri, 3 Feb 2017 08:58:22 +0800 Subject: [PATCH 2/4] Additionally fix Vivillon and Furfrou Import/Exports Fixes https://github.com/kwsch/PKHeX/issues/807. --- PKHeX/PKM/ShowdownSet.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PKHeX/PKM/ShowdownSet.cs b/PKHeX/PKM/ShowdownSet.cs index b00c91352..d29912851 100644 --- a/PKHeX/PKM/ShowdownSet.cs +++ b/PKHeX/PKM/ShowdownSet.cs @@ -146,6 +146,9 @@ public ShowdownSet(string input = null) case 658: // Greninja if (Ability == 210) Form += "-Ash"; // Battle Bond break; + case 666: // Vivillon + if (Form == "Pokeball") Form = "Poké Ball"; + break; case 718: // Zygarde if (string.IsNullOrEmpty(Form)) Form = "50%"; else if (Form == "Complete") Form = "100%"; @@ -275,7 +278,9 @@ public static string getShowdownText(PKM pkm) Shiny = pkm.IsShiny, Form = pkm.AltForm > 0 && pkm.AltForm < Forms.Length ? Forms[pkm.AltForm] : "", }; + if (Set.Form == "F") Set.Gender = ""; + return Set.getText(); } From 04dcb11b54761728756486de4e477c3c51a9343f Mon Sep 17 00:00:00 2001 From: ReignOfComputer Date: Fri, 3 Feb 2017 09:02:14 +0800 Subject: [PATCH 3/4] Must have forgotten to save --- PKHeX/PKM/ShowdownSet.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PKHeX/PKM/ShowdownSet.cs b/PKHeX/PKM/ShowdownSet.cs index d29912851..e8d332afe 100644 --- a/PKHeX/PKM/ShowdownSet.cs +++ b/PKHeX/PKM/ShowdownSet.cs @@ -280,6 +280,8 @@ public static string getShowdownText(PKM pkm) }; if (Set.Form == "F") Set.Gender = ""; + else if (Set.Species == 676) Set.Form = ""; // Furfrou + else if (Set.Species == 666 && Set.Form == "Poké Ball") Set.Form = "Pokeball"; // Vivillon return Set.getText(); } From a9c32de521a56eceb1125a84d13b25e441df62d8 Mon Sep 17 00:00:00 2001 From: ReignOfComputer Date: Fri, 3 Feb 2017 09:50:58 +0800 Subject: [PATCH 4/4] Additional Greninja Fix by @egzonqj --- PKHeX/PKM/ShowdownSet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKHeX/PKM/ShowdownSet.cs b/PKHeX/PKM/ShowdownSet.cs index e8d332afe..23454ebd9 100644 --- a/PKHeX/PKM/ShowdownSet.cs +++ b/PKHeX/PKM/ShowdownSet.cs @@ -144,7 +144,7 @@ public ShowdownSet(string input = null) switch (Species) { case 658: // Greninja - if (Ability == 210) Form += "-Ash"; // Battle Bond + if (Ability == 210) Form = "Ash"; // Battle Bond break; case 666: // Vivillon if (Form == "Pokeball") Form = "Poké Ball";