2019-11-29 18:44:52 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2019-02-15 02:12:25 +00:00
|
|
|
|
using static PKHeX.Core.Species;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
|
|
|
|
{
|
2019-02-24 21:57:10 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logic for various <see cref="PKM.AltForm"/> related requests.
|
|
|
|
|
/// </summary>
|
2017-11-10 05:52:11 +00:00
|
|
|
|
public static class FormConverter
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a list of formes that the species can have.
|
|
|
|
|
/// </summary>
|
2019-09-19 02:58:23 +00:00
|
|
|
|
/// <param name="species"><see cref="Species"/> of the Pokémon.</param>
|
2017-08-01 06:03:51 +00:00
|
|
|
|
/// <param name="types">List of type names</param>
|
|
|
|
|
/// <param name="forms">List of form names</param>
|
|
|
|
|
/// <param name="genders">List of genders names</param>
|
|
|
|
|
/// <param name="generation">Generation number for exclusive formes</param>
|
|
|
|
|
/// <returns>A list of strings corresponding to the formes that a Pokémon can have.</returns>
|
2019-09-19 02:58:23 +00:00
|
|
|
|
public static string[] GetFormList(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, IReadOnlyList<string> genders, int generation)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
2018-05-12 15:13:39 +00:00
|
|
|
|
// Mega List
|
2019-11-16 01:34:18 +00:00
|
|
|
|
if (generation < 8 && IsFormListSingleMega(species))
|
|
|
|
|
return GetMegaSingle(types, forms);
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-11-10 05:52:11 +00:00
|
|
|
|
if (generation == 7 && Legal.Totem_USUM.Contains(species))
|
|
|
|
|
return GetFormsTotem(species, types, forms);
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
|
|
|
|
if (species <= Legal.MaxSpeciesID_1)
|
|
|
|
|
return GetFormsGen1(species, types, forms, generation);
|
|
|
|
|
if (species <= Legal.MaxSpeciesID_2)
|
|
|
|
|
return GetFormsGen2(species, types, forms, generation);
|
|
|
|
|
if (species <= Legal.MaxSpeciesID_3)
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return GetFormsGen3(species, types, forms, generation);
|
2017-08-01 06:03:51 +00:00
|
|
|
|
if (species <= Legal.MaxSpeciesID_4)
|
|
|
|
|
return GetFormsGen4(species, types, forms, generation);
|
|
|
|
|
if (species <= Legal.MaxSpeciesID_5)
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return GetFormsGen5(species, types, forms, generation);
|
2017-08-01 06:03:51 +00:00
|
|
|
|
if (species <= Legal.MaxSpeciesID_6)
|
|
|
|
|
return GetFormsGen6(species, types, forms, genders);
|
2019-11-16 01:34:18 +00:00
|
|
|
|
if (species <= Legal.MaxSpeciesID_7_USUM)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return GetFormsGen7(species, types, forms);
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return GetFormsGen8(species, types, forms, genders);
|
2017-08-01 06:03:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-11-14 03:20:21 +00:00
|
|
|
|
private static bool IsGG() => GameVersion.GG.Contains(PKMConverter.Trainer.Game);
|
2018-11-01 22:38:09 +00:00
|
|
|
|
|
2017-11-10 05:52:11 +00:00
|
|
|
|
public static bool IsTotemForm(int species, int form, int generation = 7)
|
|
|
|
|
{
|
|
|
|
|
if (generation != 7)
|
|
|
|
|
return false;
|
|
|
|
|
if (form == 0)
|
|
|
|
|
return false;
|
|
|
|
|
if (!Legal.Totem_USUM.Contains(species))
|
|
|
|
|
return false;
|
2019-02-15 02:12:25 +00:00
|
|
|
|
if (species == (int)Mimikyu)
|
2017-11-10 05:52:11 +00:00
|
|
|
|
return form == 2 || form == 3;
|
|
|
|
|
if (Legal.Totem_Alolan.Contains(species))
|
|
|
|
|
return form == 2;
|
|
|
|
|
return form == 1;
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-11-10 05:52:11 +00:00
|
|
|
|
public static int GetTotemBaseForm(int species, int form)
|
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
if (species == (int)Mimikyu)
|
|
|
|
|
return form - 2;
|
2017-11-10 05:52:11 +00:00
|
|
|
|
return form - 1;
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-11-16 22:30:18 +00:00
|
|
|
|
public static bool IsValidOutOfBoundsForme(int species, int form, int generation)
|
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-11-16 22:30:18 +00:00
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Unown:
|
2017-11-16 22:30:18 +00:00
|
|
|
|
return form < (generation == 2 ? 26 : 28); // A-Z : A-Z?!
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Mothim: // Burmy base form is kept
|
2017-11-16 22:30:18 +00:00
|
|
|
|
return form < 3;
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Scatterbug:
|
|
|
|
|
case Spewpa: // Vivillon Pre-evolutions
|
2017-11-16 22:30:18 +00:00
|
|
|
|
return form < 18;
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-08 05:40:20 +00:00
|
|
|
|
private static readonly string[] EMPTY = { string.Empty };
|
2018-11-14 03:20:21 +00:00
|
|
|
|
private const string Starter = nameof(Starter);
|
2018-08-16 04:15:06 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsGen1(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, int generation)
|
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
2019-11-16 01:34:18 +00:00
|
|
|
|
case Charizard when generation < 8:
|
|
|
|
|
case Mewtwo when generation < 8:
|
|
|
|
|
return GetMegaXY(types, forms);
|
2018-11-01 22:38:09 +00:00
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Eevee when IsGG():
|
2018-11-01 22:38:09 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
2018-11-14 03:20:21 +00:00
|
|
|
|
Starter,
|
2018-11-01 22:38:09 +00:00
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Pikachu:
|
2017-08-02 17:00:24 +00:00
|
|
|
|
return GetFormsPikachu(generation, types, forms);
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
case Weezing when generation >= 8:
|
|
|
|
|
case Ponyta when generation >= 8:
|
|
|
|
|
case Rapidash when generation >= 8:
|
|
|
|
|
case MrMime when generation >= 8:
|
|
|
|
|
case Farfetchd when generation >= 8:
|
|
|
|
|
return GetFormsGalar(types, forms);
|
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
default:
|
2017-08-02 17:00:24 +00:00
|
|
|
|
return GetFormsAlolan(generation, types, forms, species);
|
2017-08-01 06:03:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsGen2(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, int generation)
|
|
|
|
|
{
|
2019-10-08 01:40:09 +00:00
|
|
|
|
return species switch
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
2019-11-16 01:34:18 +00:00
|
|
|
|
(int)Pichu when generation == 4 => GetFormsPichu(types, forms),
|
2019-10-08 01:40:09 +00:00
|
|
|
|
(int)Unown => GetFormsUnown(generation),
|
2019-11-16 01:34:18 +00:00
|
|
|
|
(int)Corsola when generation >= 8 => GetFormsGalar(types, forms),
|
2019-10-08 01:40:09 +00:00
|
|
|
|
_ => EMPTY
|
|
|
|
|
};
|
2017-08-01 06:03:51 +00:00
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
private static string[] GetFormsGen3(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, int generation)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
default:
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
case Zigzagoon when generation >= 8:
|
|
|
|
|
case Linoone when generation >= 8:
|
|
|
|
|
return GetFormsGalar(types, forms);
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Castform: // Casftorm
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[889], // Sunny
|
|
|
|
|
forms[890], // Rainy
|
|
|
|
|
forms[891], // Snowy
|
|
|
|
|
};
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Kyogre: // Kyogre
|
|
|
|
|
case Groudon: // Groudon
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[899], // Primal
|
|
|
|
|
};
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Deoxys: // Deoxys
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[902], // Attack
|
|
|
|
|
forms[903], // Defense
|
|
|
|
|
forms[904], // Speed
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsGen4(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, int generation)
|
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
default:
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Burmy:
|
|
|
|
|
case Wormadam:
|
|
|
|
|
case Mothim:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[412], // Plant
|
|
|
|
|
forms[905], // Sandy
|
|
|
|
|
forms[906], // Trash
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Cherrim:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[421], // Overcast
|
|
|
|
|
forms[909], // Sunshine
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Shellos:
|
|
|
|
|
case Gastrodon:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[422], // West
|
|
|
|
|
forms[911], // East
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Rotom:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[917], // Heat
|
|
|
|
|
forms[918], // Wash
|
|
|
|
|
forms[919], // Frost
|
|
|
|
|
forms[920], // Fan
|
|
|
|
|
forms[921], // Mow
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Giratina:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[487], // Altered
|
|
|
|
|
forms[922], // Origin
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Shaymin:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[492], // Land
|
|
|
|
|
forms[923], // Sky
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Arceus:
|
|
|
|
|
case Silvally:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return GetFormsArceus(generation, types);
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
private static string[] GetFormsGen5(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, int generation)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
default:
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Basculin:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[550], // Red
|
|
|
|
|
forms[942], // Blue
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
case Darumaka when generation >= 8:
|
|
|
|
|
return GetFormsGalar(types, forms);
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Darmanitan:
|
2019-11-16 01:34:18 +00:00
|
|
|
|
{
|
|
|
|
|
if (generation <= 7)
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[555], // Standard
|
|
|
|
|
forms[943], // Zen
|
|
|
|
|
};
|
|
|
|
|
}
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
2019-12-04 00:41:52 +00:00
|
|
|
|
forms[555], // Standard
|
|
|
|
|
forms[943], // Zen
|
|
|
|
|
forms[Galarian], // Standard
|
|
|
|
|
forms[943] + " " + forms[Galarian], // Zen
|
2017-08-01 06:03:51 +00:00
|
|
|
|
};
|
2019-11-16 01:34:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case Yamask when generation >= 8:
|
|
|
|
|
return GetFormsGalar(types, forms);
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Deerling:
|
|
|
|
|
case Sawsbuck:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[585], // Spring
|
|
|
|
|
forms[947], // Summer
|
|
|
|
|
forms[948], // Autumn
|
|
|
|
|
forms[949], // Winter
|
|
|
|
|
};
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
case Stunfisk when generation >= 8:
|
|
|
|
|
return GetFormsGalar(types, forms);
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Tornadus:
|
|
|
|
|
case Thundurus:
|
|
|
|
|
case Landorus:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[641], // Incarnate
|
|
|
|
|
forms[952], // Therian
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Kyurem:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[953], // White
|
|
|
|
|
forms[954], // Black
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Keldeo:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[647], // Ordinary
|
|
|
|
|
forms[955], // Resolute
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Meloetta:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[648], // Aria
|
|
|
|
|
forms[956], // Pirouette
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Genesect:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
types[010], // Douse (Water)
|
|
|
|
|
types[012], // Shock (Electric)
|
|
|
|
|
types[009], // Burn (Fire)
|
|
|
|
|
types[014], // Chill (Ice)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsGen6(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, IReadOnlyList<string> genders)
|
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
default:
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Greninja:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[962], // "Ash",
|
|
|
|
|
forms[1012], // "Bonded" - Active
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Scatterbug:
|
|
|
|
|
case Spewpa:
|
|
|
|
|
case Vivillon:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[666], // Icy Snow
|
|
|
|
|
forms[963], // Polar
|
|
|
|
|
forms[964], // Tundra
|
2018-05-12 15:13:39 +00:00
|
|
|
|
forms[965], // Continental
|
2017-08-01 06:03:51 +00:00
|
|
|
|
forms[966], // Garden
|
|
|
|
|
forms[967], // Elegant
|
|
|
|
|
forms[968], // Meadow
|
2018-05-12 15:13:39 +00:00
|
|
|
|
forms[969], // Modern
|
2017-08-01 06:03:51 +00:00
|
|
|
|
forms[970], // Marine
|
|
|
|
|
forms[971], // Archipelago
|
|
|
|
|
forms[972], // High-Plains
|
|
|
|
|
forms[973], // Sandstorm
|
|
|
|
|
forms[974], // River
|
|
|
|
|
forms[975], // Monsoon
|
2018-05-12 15:13:39 +00:00
|
|
|
|
forms[976], // Savannah
|
2017-08-01 06:03:51 +00:00
|
|
|
|
forms[977], // Sun
|
|
|
|
|
forms[978], // Ocean
|
|
|
|
|
forms[979], // Jungle
|
|
|
|
|
forms[980], // Fancy
|
|
|
|
|
forms[981], // Poké Ball
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Flabébé:
|
|
|
|
|
case Florges:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[669], // Red
|
|
|
|
|
forms[986], // Yellow
|
|
|
|
|
forms[987], // Orange
|
|
|
|
|
forms[988], // Blue
|
|
|
|
|
forms[989], // White
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Floette:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[669], // Red
|
|
|
|
|
forms[986], // Yellow
|
|
|
|
|
forms[987], // Orange
|
|
|
|
|
forms[988], // Blue
|
|
|
|
|
forms[989], // White
|
|
|
|
|
forms[990], // Eternal
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Furfrou:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[676], // Natural
|
|
|
|
|
forms[995], // Heart
|
|
|
|
|
forms[996], // Star
|
|
|
|
|
forms[997], // Diamond
|
|
|
|
|
forms[998], // Deputante
|
|
|
|
|
forms[999], // Matron
|
|
|
|
|
forms[1000], // Dandy
|
|
|
|
|
forms[1001], // La Reine
|
2018-05-12 15:13:39 +00:00
|
|
|
|
forms[1002], // Kabuki
|
2017-08-01 06:03:51 +00:00
|
|
|
|
forms[1003], // Pharaoh
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Meowstic:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
genders[000], // Male
|
|
|
|
|
genders[001], // Female
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Aegislash:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[681], // Shield
|
|
|
|
|
forms[1005], // Blade
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Pumpkaboo:
|
|
|
|
|
case Gourgeist:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[710], // Average
|
|
|
|
|
forms[1006], // Small
|
|
|
|
|
forms[1007], // Large
|
|
|
|
|
forms[1008], // Super
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Xerneas:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[716], // Neutral
|
|
|
|
|
forms[1012], // Active
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Hoopa:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[720], // Confined
|
|
|
|
|
forms[1018], // Unbound
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Zygarde:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[718], // 50% (Aura Break)
|
2018-09-13 04:16:14 +00:00
|
|
|
|
forms[1013], // 10% (Aura Break)
|
|
|
|
|
forms[1014] + "-C", // 10% Cell (Power Construct)
|
|
|
|
|
forms[1015] + "-C", // 50% Cell (Power Construct)
|
|
|
|
|
forms[1016], // 100% Cell (Power Construct)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsGen7(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms)
|
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
default:
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2018-05-12 15:13:39 +00:00
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Oricorio:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[741], // "RED" - Baile
|
|
|
|
|
forms[1021], // "YLW" - Pom-Pom
|
|
|
|
|
forms[1022], // "PNK" - Pa'u
|
|
|
|
|
forms[1023], // "BLU" - Sensu
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Rockruff:
|
2017-11-10 12:01:36 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[1064], // Dusk
|
|
|
|
|
};
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Lycanroc:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[745], // Midday
|
|
|
|
|
forms[1024], // Midnight
|
2017-11-08 19:31:04 +00:00
|
|
|
|
forms[1064], // Dusk
|
2017-08-01 06:03:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Wishiwashi:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[746],
|
|
|
|
|
forms[1025], // School
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Silvally:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return GetFormsArceus(7, types);
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Minior:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[774], // "R-Meteor", // Meteor Red
|
|
|
|
|
forms[1045], // "O-Meteor", // Meteor Orange
|
|
|
|
|
forms[1046], // "Y-Meteor", // Meteor Yellow
|
|
|
|
|
forms[1047], // "G-Meteor", // Meteor Green
|
|
|
|
|
forms[1048], // "B-Meteor", // Meteor Blue
|
|
|
|
|
forms[1049], // "I-Meteor", // Meteor Indigo
|
|
|
|
|
forms[1050], // "V-Meteor", // Meteor Violet
|
|
|
|
|
forms[1051], // "R-Core", // Core Red
|
|
|
|
|
forms[1052], // "O-Core", // Core Orange
|
|
|
|
|
forms[1053], // "Y-Core", // Core Yellow
|
|
|
|
|
forms[1054], // "G-Core", // Core Green
|
|
|
|
|
forms[1055], // "B-Core", // Core Blue
|
|
|
|
|
forms[1056], // "I-Core", // Core Indigo
|
|
|
|
|
forms[1057], // "V-Core", // Core Violet
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-04 03:20:16 +00:00
|
|
|
|
case Mimikyu:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[778], // Disguised
|
|
|
|
|
forms[1058], // Busted
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Necrozma:
|
2017-11-08 19:31:04 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[1065], // Dusk Mane
|
|
|
|
|
forms[1066], // Dawn Wings
|
|
|
|
|
forms[1067], // Ultra Necrozma
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Magearna:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000],
|
|
|
|
|
forms[1062], // Original
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
private static string[] GetFormsGen8(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, IReadOnlyList<string> genders)
|
|
|
|
|
{
|
|
|
|
|
switch ((Species)species)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
return EMPTY;
|
|
|
|
|
|
|
|
|
|
case Cramorant:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[Gulping],
|
|
|
|
|
forms[Gorging],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Toxtricity:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
2019-11-16 16:46:59 +00:00
|
|
|
|
forms[(int)Toxtricity], // Amped
|
2019-11-16 01:34:18 +00:00
|
|
|
|
forms[LowKey],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Indeedee:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
genders[000], // Male
|
|
|
|
|
genders[001], // Female
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Sinistea:
|
|
|
|
|
case Polteageist:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
2019-11-30 21:19:22 +00:00
|
|
|
|
"Phony",
|
|
|
|
|
"Antique",
|
2019-11-16 01:34:18 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Alcremie:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
2019-11-16 16:46:59 +00:00
|
|
|
|
forms[(int)Alcremie], // Vanilla Cream
|
2019-11-16 01:34:18 +00:00
|
|
|
|
forms[RubyCream],
|
|
|
|
|
forms[MatchaCream],
|
|
|
|
|
forms[MintCream],
|
|
|
|
|
forms[LemonCream],
|
|
|
|
|
forms[SaltedCream],
|
|
|
|
|
forms[RubySwirl],
|
|
|
|
|
forms[CaramelSwirl],
|
|
|
|
|
forms[RainbowSwirl],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Morpeko:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[HangryMode],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Eiscue:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[NoiceFace],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Zacian:
|
|
|
|
|
case Zamazenta:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[Crowned],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
case Eternatus:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[Eternamax],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-10 05:52:11 +00:00
|
|
|
|
private static string[] GetFormsAlolan (int generation, IReadOnlyList<string> types, IReadOnlyList<string> forms, int species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
if (generation < 7)
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
switch ((Species)species)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
default:
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
case Meowth when generation >= 8:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000],
|
|
|
|
|
forms[810], // Alolan
|
|
|
|
|
forms[Galarian], // Alolan
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-15 02:12:25 +00:00
|
|
|
|
case Rattata:
|
|
|
|
|
case Raichu:
|
|
|
|
|
case Sandshrew:
|
|
|
|
|
case Sandslash:
|
|
|
|
|
case Vulpix:
|
|
|
|
|
case Ninetales:
|
|
|
|
|
case Diglett:
|
|
|
|
|
case Dugtrio:
|
|
|
|
|
case Meowth:
|
|
|
|
|
case Persian:
|
|
|
|
|
case Geodude:
|
|
|
|
|
case Graveler:
|
|
|
|
|
case Golem:
|
|
|
|
|
case Grimer:
|
|
|
|
|
case Muk:
|
|
|
|
|
case Exeggutor:
|
2017-08-01 06:03:51 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000],
|
|
|
|
|
forms[810] // Alolan
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsPikachu(int generation, IReadOnlyList<string> types, IReadOnlyList<string> forms)
|
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
default:
|
2018-08-16 04:15:06 +00:00
|
|
|
|
return EMPTY;
|
2017-08-01 06:03:51 +00:00
|
|
|
|
|
|
|
|
|
case 6:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[729], // Rockstar
|
|
|
|
|
forms[730], // Belle
|
|
|
|
|
forms[731], // Pop
|
|
|
|
|
forms[732], // PhD
|
|
|
|
|
forms[733], // Libre
|
|
|
|
|
forms[734], // Cosplay
|
|
|
|
|
};
|
2019-11-16 01:34:18 +00:00
|
|
|
|
|
|
|
|
|
case 7 when IsGG():
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[813], // Original
|
|
|
|
|
forms[814], // Hoenn
|
|
|
|
|
forms[815], // Sinnoh
|
|
|
|
|
forms[816], // Unova
|
|
|
|
|
forms[817], // Kalos
|
|
|
|
|
forms[818], // Alola
|
|
|
|
|
forms[1063], // Partner
|
|
|
|
|
Starter,
|
|
|
|
|
};
|
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
case 7:
|
2019-11-16 01:34:18 +00:00
|
|
|
|
case 8:
|
|
|
|
|
return new[]
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[813], // Original
|
|
|
|
|
forms[814], // Hoenn
|
|
|
|
|
forms[815], // Sinnoh
|
|
|
|
|
forms[816], // Unova
|
|
|
|
|
forms[817], // Kalos
|
|
|
|
|
forms[818], // Alola
|
2019-11-16 01:34:18 +00:00
|
|
|
|
forms[1063], // Partner
|
2017-08-01 06:03:51 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2019-11-16 01:34:18 +00:00
|
|
|
|
private static string[] GetFormsPichu (IReadOnlyList<string> types, IReadOnlyList<string> forms)
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
2019-11-16 01:34:18 +00:00
|
|
|
|
return new[]
|
2018-07-29 20:27:48 +00:00
|
|
|
|
{
|
2019-11-16 01:34:18 +00:00
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[000], // Spiky
|
|
|
|
|
};
|
2017-08-01 06:03:51 +00:00
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsArceus (int generation, IReadOnlyList<string> types)
|
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 4:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[00], // Normal
|
|
|
|
|
types[01], // Fighting
|
|
|
|
|
types[02], // Flying
|
|
|
|
|
types[03], // Poison
|
|
|
|
|
types[04], // etc
|
|
|
|
|
types[05],
|
|
|
|
|
types[06],
|
|
|
|
|
types[07],
|
|
|
|
|
types[08],
|
|
|
|
|
"???", // ???-type arceus
|
|
|
|
|
types[09],
|
|
|
|
|
types[10],
|
|
|
|
|
types[11],
|
|
|
|
|
types[12],
|
|
|
|
|
types[13],
|
|
|
|
|
types[14],
|
|
|
|
|
types[15],
|
|
|
|
|
types[16] // No Fairy Type
|
|
|
|
|
};
|
|
|
|
|
case 5:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[00], // Normal
|
|
|
|
|
types[01], // Fighting
|
|
|
|
|
types[02], // Flying
|
|
|
|
|
types[03], // Poison
|
|
|
|
|
types[04], // etc
|
|
|
|
|
types[05],
|
|
|
|
|
types[06],
|
|
|
|
|
types[07],
|
|
|
|
|
types[08],
|
|
|
|
|
types[09],
|
|
|
|
|
types[10],
|
|
|
|
|
types[11],
|
|
|
|
|
types[12],
|
|
|
|
|
types[13],
|
|
|
|
|
types[14],
|
|
|
|
|
types[15],
|
|
|
|
|
types[16] // No Fairy type
|
|
|
|
|
};
|
|
|
|
|
default:
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[00], // Normal
|
|
|
|
|
types[01], // Fighting
|
|
|
|
|
types[02], // Flying
|
|
|
|
|
types[03], // Poison
|
|
|
|
|
types[04], // etc
|
|
|
|
|
types[05],
|
|
|
|
|
types[06],
|
|
|
|
|
types[07],
|
|
|
|
|
types[08],
|
|
|
|
|
types[09],
|
|
|
|
|
types[10],
|
|
|
|
|
types[11],
|
|
|
|
|
types[12],
|
|
|
|
|
types[13],
|
|
|
|
|
types[14],
|
|
|
|
|
types[15],
|
|
|
|
|
types[16],
|
|
|
|
|
types[17],
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2019-09-19 02:58:23 +00:00
|
|
|
|
private static string[] GetFormsTotem (int species, IReadOnlyList<string> types, IReadOnlyList<string> forms)
|
2017-11-10 05:52:11 +00:00
|
|
|
|
{
|
2019-02-15 02:12:25 +00:00
|
|
|
|
if ((Species)species == Mimikyu) // Mimikyu
|
2018-07-29 20:27:48 +00:00
|
|
|
|
{
|
2017-11-10 05:52:11 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
forms[778], // Disguised
|
|
|
|
|
forms[1058], // Busted
|
|
|
|
|
forms[1007], // Large
|
|
|
|
|
"*" + forms[1058], // Busted
|
|
|
|
|
};
|
2018-07-29 20:27:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-10 05:52:11 +00:00
|
|
|
|
if (Legal.Totem_Alolan.Contains(species))
|
2018-07-29 20:27:48 +00:00
|
|
|
|
{
|
2017-11-10 05:52:11 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[810], // Alolan
|
|
|
|
|
forms[1007], // Large
|
|
|
|
|
};
|
2018-07-29 20:27:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-11-10 05:52:11 +00:00
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[0], // Normal
|
|
|
|
|
forms[1007], // Large
|
|
|
|
|
};
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static string[] GetFormsUnown(int generation)
|
|
|
|
|
{
|
2019-10-26 19:33:58 +00:00
|
|
|
|
return generation switch
|
2017-08-01 06:03:51 +00:00
|
|
|
|
{
|
2019-10-26 19:33:58 +00:00
|
|
|
|
2 => new[]
|
|
|
|
|
{
|
|
|
|
|
"A", "B", "C", "D", "E",
|
|
|
|
|
"F", "G", "H", "I", "J",
|
|
|
|
|
"K", "L", "M", "N", "O",
|
|
|
|
|
"P", "Q", "R", "S", "T",
|
|
|
|
|
"U", "V", "W", "X", "Y",
|
|
|
|
|
"Z",
|
|
|
|
|
// "!", "?", not in Gen II
|
|
|
|
|
},
|
|
|
|
|
_ => new[]
|
|
|
|
|
{
|
|
|
|
|
"A", "B", "C", "D", "E",
|
|
|
|
|
"F", "G", "H", "I", "J",
|
|
|
|
|
"K", "L", "M", "N", "O",
|
|
|
|
|
"P", "Q", "R", "S", "T",
|
|
|
|
|
"U", "V", "W", "X", "Y",
|
|
|
|
|
"Z",
|
|
|
|
|
"!", "?",
|
|
|
|
|
}
|
|
|
|
|
};
|
2017-08-01 06:03:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static bool IsFormListSingleMega(int species) => Mega_6_Single.Contains(species);
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2017-08-01 06:03:51 +00:00
|
|
|
|
private static readonly HashSet<int> Mega_6_Single = new HashSet<int>
|
|
|
|
|
{
|
|
|
|
|
// XY
|
|
|
|
|
003, 009, 065, 094, 115, 127, 130, 142, 181, 212, 214, 229, 248, 257, 282, 303, 306, 308, 310, 354, 359,
|
|
|
|
|
380, 381, 445, 448, 460,
|
|
|
|
|
|
|
|
|
|
// AO
|
2017-08-20 01:43:36 +00:00
|
|
|
|
015, 018, 080, 208, 254, 260, 302, 319, 323, 334, 362, 373, 376, 384, 428, 475, 531, 719,
|
2017-08-01 06:03:51 +00:00
|
|
|
|
};
|
2018-07-07 00:37:07 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if the <see cref="PKM"/> data should have a drop-down selection visible for the <see cref="PKM.AltForm"/> value.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="pi">Game specific personal info</param>
|
2019-09-19 02:58:23 +00:00
|
|
|
|
/// <param name="species"><see cref="Species"/> ID</param>
|
2018-07-07 00:37:07 +00:00
|
|
|
|
/// <param name="format"><see cref="PKM.AltForm"/> ID</param>
|
|
|
|
|
/// <returns>True if has formes that can be provided by <see cref="GetFormList"/>, otherwise false for none.</returns>
|
|
|
|
|
public static bool HasFormSelection(PersonalInfo pi, int species, int format)
|
|
|
|
|
{
|
2019-09-19 02:58:23 +00:00
|
|
|
|
if (format <= 3 && species != (int)Unown)
|
2018-07-07 00:37:07 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (HasFormeValuesNotIndicatedByPersonal.Contains(species))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
int count = pi.FormeCount;
|
|
|
|
|
return count > 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static readonly HashSet<int> HasFormeValuesNotIndicatedByPersonal = new HashSet<int>
|
|
|
|
|
{
|
2019-09-19 02:58:23 +00:00
|
|
|
|
(int)Unown,
|
|
|
|
|
(int)Mothim, // (Burmy forme carried over, not cleared)
|
|
|
|
|
(int)Scatterbug, (int)Spewpa, // Vivillon pre-evos
|
2018-07-07 00:37:07 +00:00
|
|
|
|
};
|
2019-11-16 01:34:18 +00:00
|
|
|
|
|
|
|
|
|
private static string[] GetMegaSingle(IReadOnlyList<string> types, IReadOnlyList<string> forms)
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[804], // Mega
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static string[] GetMegaXY(IReadOnlyList<string> types, IReadOnlyList<string> forms)
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[805], // Mega X
|
|
|
|
|
forms[806], // Mega Y
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static string[] GetFormsGalar(IReadOnlyList<string> types, IReadOnlyList<string> forms)
|
|
|
|
|
{
|
|
|
|
|
return new[]
|
|
|
|
|
{
|
|
|
|
|
types[000], // Normal
|
|
|
|
|
forms[Galarian], // Galarian
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private const int Galarian = 1068;
|
2019-11-28 22:00:55 +00:00
|
|
|
|
// private const int Gigantamax = 1069;
|
2019-11-16 01:34:18 +00:00
|
|
|
|
private const int Gulping = 1070;
|
|
|
|
|
private const int Gorging = 1071;
|
|
|
|
|
private const int LowKey = 1072;
|
|
|
|
|
|
|
|
|
|
private const int RubyCream = 1073;
|
|
|
|
|
private const int MatchaCream = 1074;
|
|
|
|
|
private const int MintCream = 1075;
|
|
|
|
|
private const int LemonCream = 1076;
|
|
|
|
|
private const int SaltedCream = 1077;
|
|
|
|
|
private const int RubySwirl = 1078;
|
|
|
|
|
private const int CaramelSwirl = 1079;
|
|
|
|
|
private const int RainbowSwirl = 1080;
|
|
|
|
|
|
|
|
|
|
private const int NoiceFace = 1081;
|
|
|
|
|
private const int HangryMode = 1082;
|
|
|
|
|
|
|
|
|
|
private const int Crowned = 1083;
|
|
|
|
|
private const int Eternamax = 1084;
|
|
|
|
|
|
2019-11-17 17:34:04 +00:00
|
|
|
|
public static string[] GetAlcremieFormList(IReadOnlyList<string> forms)
|
|
|
|
|
{
|
|
|
|
|
var result = new string[63];
|
2019-11-28 22:00:55 +00:00
|
|
|
|
// seed form0 with the pattern
|
2019-11-17 17:34:04 +00:00
|
|
|
|
result[0 * 7] = forms[(int) Alcremie]; // Vanilla Cream
|
|
|
|
|
result[1 * 7] = forms[RubyCream];
|
|
|
|
|
result[2 * 7] = forms[MatchaCream];
|
|
|
|
|
result[3 * 7] = forms[MintCream];
|
|
|
|
|
result[4 * 7] = forms[LemonCream];
|
|
|
|
|
result[5 * 7] = forms[SaltedCream];
|
|
|
|
|
result[6 * 7] = forms[RubySwirl];
|
|
|
|
|
result[7 * 7] = forms[CaramelSwirl];
|
|
|
|
|
result[8 * 7] = forms[RainbowSwirl];
|
|
|
|
|
|
|
|
|
|
const int deco = 7;
|
|
|
|
|
const int fc = 9;
|
|
|
|
|
for (int f = 0; f < fc; f++)
|
|
|
|
|
{
|
|
|
|
|
int start = f * deco;
|
2019-11-28 22:00:55 +00:00
|
|
|
|
// iterate downwards using form0 as pattern ref, replacing on final loop
|
2019-11-17 17:34:04 +00:00
|
|
|
|
for (int i = deco - 1; i >= 0; i--)
|
|
|
|
|
{
|
2019-11-28 22:00:55 +00:00
|
|
|
|
result[start + i] = $"{result[start]} ({((AlcremieDecoration)i).ToString()})";
|
2019-11-17 17:34:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2019-11-29 18:44:52 +00:00
|
|
|
|
|
|
|
|
|
public static string[] GetFormArgumentStrings(int species, int form, int generation)
|
|
|
|
|
{
|
|
|
|
|
if (generation < 8)
|
|
|
|
|
return EMPTY;
|
|
|
|
|
|
2019-12-08 08:03:08 +00:00
|
|
|
|
static string[] GetBlank(int count)
|
|
|
|
|
{
|
|
|
|
|
var result = new string[count];
|
|
|
|
|
for (int i = 0; i < result.Length; i++)
|
|
|
|
|
result[i] = i.ToString();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-29 18:44:52 +00:00
|
|
|
|
return species switch
|
|
|
|
|
{
|
|
|
|
|
(int) Furfrou when form != 0 => new[] {"0", "1", "2", "3", "4", "5"},
|
|
|
|
|
(int) Hoopa when form == 1 => new[] {"0", "1", "2", "3"},
|
2019-12-08 08:03:08 +00:00
|
|
|
|
(int) Yamask when form == 1 => GetBlank(320),
|
|
|
|
|
(int) Runerigus when form == 0 => GetBlank(320), // max Runerigus HP
|
2019-11-29 18:44:52 +00:00
|
|
|
|
(int) Alcremie => Enum.GetNames(typeof(AlcremieDecoration)),
|
|
|
|
|
_ => EMPTY
|
|
|
|
|
};
|
|
|
|
|
}
|
2017-08-01 06:03:51 +00:00
|
|
|
|
}
|
|
|
|
|
}
|