From a6e84f5aa97c5765bd92103a385f92eb41eb4220 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 23 Dec 2016 15:37:56 -0800 Subject: [PATCH] Adjust forme export edge cases Showdown handles these formes their own way. Match their format when exporting formes. Closes #666 --- PKHeX/PKM/ShowdownSet.cs | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/PKHeX/PKM/ShowdownSet.cs b/PKHeX/PKM/ShowdownSet.cs index 47b81a541..7f26905f8 100644 --- a/PKHeX/PKM/ShowdownSet.cs +++ b/PKHeX/PKM/ShowdownSet.cs @@ -137,16 +137,46 @@ public ShowdownSet(string input = null) IVs = IVsSpeedFirst; EVs = EVsSpeedFirst; + + // Showdown Quirks + switch (Species) + { + case 718: // Zygarde + if (string.IsNullOrEmpty(Form)) Form = "50%"; + else if (Form == "Complete") Form = "100%"; + if (Ability == 211) Form += "-C"; // Power Construct + break; + case 774: // Minior + if (!string.IsNullOrWhiteSpace(Form) && Form != "Meteor") + Form = "C-" + Form; + break; + } } public string getText() { if (Species == 0 || Species > MAX_SPECIES) return ""; + // Showdown Quirks + string form = Form; + switch (Species) + { + 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; + } + // First Line: Name, Nickname, Gender, Item string specForm = species[Species]; - if (!string.IsNullOrWhiteSpace(Form)) - specForm += "-" + Form.Replace("Mega ", "Mega-"); + if (!string.IsNullOrWhiteSpace(form)) + specForm += "-" + form.Replace("Mega ", "Mega-"); string result = Nickname != null && species[Species] != Nickname ? $"{Nickname} ({specForm})" : $"{specForm}"; if (!string.IsNullOrEmpty(Gender))