mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-19 08:53:28 +00:00
5bcccc6d92
* Revises legality checks to account for traveling between the three game islands (PLA/BDSP/SWSH) * Adds conversion mechanisms between the three formats, as well as flexible conversion options to backfill missing data (thanks GameFreak/ILCA for opting for lossy conversion instead of updating the games). * Adds API abstractions for HOME data storage format (EKH/PKH format 1, aka EH1/PH1). * Revises some APIs for better usage: - `PKM` now exposes a `Context` to indicate the isolation context for legality purposes. - Some method signatures have changed to accept `Context` or `GameVersion` instead of a vague `int` for Generation. - Evolution History is now tracked in the Legality parse for specific contexts, rather than only per generation.
108 lines
3.2 KiB
C#
108 lines
3.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
internal static class EvolutionLegality
|
|
{
|
|
internal static readonly HashSet<int> FutureEvolutionsGen1 = new()
|
|
{
|
|
(int)Species.Crobat,
|
|
(int)Species.Bellossom,
|
|
(int)Species.Politoed,
|
|
(int)Species.Espeon,
|
|
(int)Species.Umbreon,
|
|
(int)Species.Slowking,
|
|
(int)Species.Steelix,
|
|
(int)Species.Scizor,
|
|
(int)Species.Kingdra,
|
|
(int)Species.Porygon2,
|
|
(int)Species.Blissey,
|
|
|
|
(int)Species.Magnezone,
|
|
(int)Species.Lickilicky,
|
|
(int)Species.Rhyperior,
|
|
(int)Species.Tangrowth,
|
|
(int)Species.Electivire,
|
|
(int)Species.Magmortar,
|
|
(int)Species.Leafeon,
|
|
(int)Species.Glaceon,
|
|
(int)Species.PorygonZ,
|
|
|
|
(int)Species.Sylveon,
|
|
|
|
(int)Species.Kleavor,
|
|
};
|
|
|
|
private static readonly HashSet<int> FutureEvolutionsGen2 = new()
|
|
{
|
|
(int)Species.Ambipom,
|
|
(int)Species.Mismagius,
|
|
(int)Species.Honchkrow,
|
|
(int)Species.Weavile,
|
|
(int)Species.Magnezone,
|
|
(int)Species.Lickilicky,
|
|
(int)Species.Rhyperior,
|
|
(int)Species.Tangrowth,
|
|
(int)Species.Electivire,
|
|
(int)Species.Magmortar,
|
|
(int)Species.Togekiss,
|
|
(int)Species.Yanmega,
|
|
(int)Species.Leafeon,
|
|
(int)Species.Glaceon,
|
|
(int)Species.Gliscor,
|
|
(int)Species.Mamoswine,
|
|
(int)Species.PorygonZ,
|
|
|
|
(int)Species.Sylveon,
|
|
|
|
(int)Species.Wyrdeer,
|
|
(int)Species.Ursaluna,
|
|
};
|
|
|
|
private static readonly HashSet<int> FutureEvolutionsGen3 = new()
|
|
{
|
|
(int)Species.Roserade,
|
|
(int)Species.Ambipom,
|
|
(int)Species.Mismagius,
|
|
(int)Species.Honchkrow,
|
|
(int)Species.Weavile,
|
|
(int)Species.Magnezone,
|
|
(int)Species.Lickilicky,
|
|
(int)Species.Rhyperior,
|
|
(int)Species.Tangrowth,
|
|
(int)Species.Electivire,
|
|
(int)Species.Magmortar,
|
|
(int)Species.Togekiss,
|
|
(int)Species.Yanmega,
|
|
(int)Species.Leafeon,
|
|
(int)Species.Glaceon,
|
|
(int)Species.Gliscor,
|
|
(int)Species.Mamoswine,
|
|
(int)Species.PorygonZ,
|
|
(int)Species.Gallade,
|
|
(int)Species.Probopass,
|
|
(int)Species.Dusknoir,
|
|
(int)Species.Froslass,
|
|
|
|
(int)Species.Sylveon,
|
|
};
|
|
|
|
private static readonly int[] FutureEvolutionsGen4 =
|
|
{
|
|
(int)Species.Sylveon,
|
|
};
|
|
|
|
private static readonly int[] FutureEvolutionsGen5 = FutureEvolutionsGen4;
|
|
|
|
internal static ICollection<int> GetFutureGenEvolutions(int generation) => generation switch
|
|
{
|
|
1 => FutureEvolutionsGen1,
|
|
2 => FutureEvolutionsGen2,
|
|
3 => FutureEvolutionsGen3,
|
|
4 => FutureEvolutionsGen4,
|
|
5 => FutureEvolutionsGen5,
|
|
_ => Array.Empty<int>(),
|
|
};
|
|
}
|
|
}
|