mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
parent
dbda5e6934
commit
3e4127b9e1
1 changed files with 16 additions and 2 deletions
|
@ -7,7 +7,7 @@ namespace PKHeX.Core
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Logic for exporting and importing <see cref="PKM"/> data in Pokémon Showdown's text format.
|
/// Logic for exporting and importing <see cref="PKM"/> data in Pokémon Showdown's text format.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class ShowdownSet
|
public sealed class ShowdownSet : IGigantamax
|
||||||
{
|
{
|
||||||
private static readonly string[] genders = {"M", "F", ""};
|
private static readonly string[] genders = {"M", "F", ""};
|
||||||
private static readonly string[] genderForms = {"", "F", ""};
|
private static readonly string[] genderForms = {"", "F", ""};
|
||||||
|
@ -103,6 +103,11 @@ namespace PKHeX.Core
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int[] Moves { get; } = {0, 0, 0, 0};
|
public int[] Moves { get; } = {0, 0, 0, 0};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// <see cref="IGigantamax.CanGigantamax"/> of the Set entity.
|
||||||
|
/// </summary>
|
||||||
|
public bool CanGigantamax { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Any lines that failed to be parsed.
|
/// Any lines that failed to be parsed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -148,6 +153,11 @@ namespace PKHeX.Core
|
||||||
ParseLines(lines);
|
ParseLines(lines);
|
||||||
|
|
||||||
// Showdown Quirks
|
// Showdown Quirks
|
||||||
|
if (Form == Gmax)
|
||||||
|
{
|
||||||
|
CanGigantamax = true;
|
||||||
|
Form = string.Empty;
|
||||||
|
}
|
||||||
Form = ConvertFormFromShowdown(Form, Species, Ability);
|
Form = ConvertFormFromShowdown(Form, Species, Ability);
|
||||||
// Set Form
|
// Set Form
|
||||||
if (Form.Length == 0)
|
if (Form.Length == 0)
|
||||||
|
@ -275,7 +285,7 @@ namespace PKHeX.Core
|
||||||
var result = new List<string>();
|
var result = new List<string>();
|
||||||
|
|
||||||
// First Line: Name, Nickname, Gender, Item
|
// First Line: Name, Nickname, Gender, Item
|
||||||
var form = ConvertFormToShowdown(Form, Species);
|
var form = CanGigantamax ? Gmax : ConvertFormToShowdown(Form, Species);
|
||||||
result.Add(GetStringFirstLine(form));
|
result.Add(GetStringFirstLine(form));
|
||||||
|
|
||||||
// IVs
|
// IVs
|
||||||
|
@ -396,6 +406,9 @@ namespace PKHeX.Core
|
||||||
Level = Experience.GetLevel(pkm.EXP, pkm.PersonalInfo.EXPGrowth);
|
Level = Experience.GetLevel(pkm.EXP, pkm.PersonalInfo.EXPGrowth);
|
||||||
Shiny = pkm.IsShiny;
|
Shiny = pkm.IsShiny;
|
||||||
|
|
||||||
|
if (pkm is IGigantamax g)
|
||||||
|
CanGigantamax = g.CanGigantamax;
|
||||||
|
|
||||||
SetFormString(pkm.AltForm);
|
SetFormString(pkm.AltForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -602,6 +615,7 @@ namespace PKHeX.Core
|
||||||
}
|
}
|
||||||
|
|
||||||
private const string Minior = "Meteor";
|
private const string Minior = "Meteor";
|
||||||
|
private const string Gmax = "Gmax";
|
||||||
|
|
||||||
private static string ConvertFormToShowdown(string form, int spec)
|
private static string ConvertFormToShowdown(string form, int spec)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue