From f308be38fda32e3fed0fc7bcaccb14cef6917339 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 19 Feb 2021 10:52:26 -0800 Subject: [PATCH] More tweaks --- PKHeX.Core/Legality/BulkAnalysis.cs | 3 +++ PKHeX.Core/Legality/Evolutions/EncounterOrigin.cs | 10 ++-------- PKHeX.Core/Legality/Restrictions/GBRestrictions.cs | 6 ++++++ PKHeX.Core/Legality/Restrictions/Locale3DS.cs | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/PKHeX.Core/Legality/BulkAnalysis.cs b/PKHeX.Core/Legality/BulkAnalysis.cs index 6bdd27516..0c98ae0d9 100644 --- a/PKHeX.Core/Legality/BulkAnalysis.cs +++ b/PKHeX.Core/Legality/BulkAnalysis.cs @@ -8,6 +8,9 @@ namespace PKHeX.Core { + /// + /// Analyzes content within a for overall legality analysis. + /// public sealed class BulkAnalysis { public readonly IReadOnlyList AllData; diff --git a/PKHeX.Core/Legality/Evolutions/EncounterOrigin.cs b/PKHeX.Core/Legality/Evolutions/EncounterOrigin.cs index e6b3833ff..ac0025b99 100644 --- a/PKHeX.Core/Legality/Evolutions/EncounterOrigin.cs +++ b/PKHeX.Core/Legality/Evolutions/EncounterOrigin.cs @@ -78,14 +78,8 @@ private static IReadOnlyList GetOriginChain(PKM pkm, int maxSpecies foreach (var evo in chain) { - // Check for invalid evolutions, or cases where they may be under-leveled encounters of an evolution. - if (evo.Level > maxLevel) - evo.Level = maxLevel; - if (evo.MinLevel <= maxLevel) - continue; - evo.MinLevel = maxLevel; - if (evo.RequiresLvlUp) - maxLevel--; + evo.Level = maxLevel; + evo.MinLevel = minLevel; } return chain; } diff --git a/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs b/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs index 3c55d6a67..81d9b6a37 100644 --- a/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs +++ b/PKHeX.Core/Legality/Restrictions/GBRestrictions.cs @@ -39,6 +39,9 @@ internal static class GBRestrictions (int)Kabuto, }; + /// + /// Species that have a specific minimum amount of moves based on their evolution state. + /// private static readonly HashSet SpecialMinMoveSlots = new() { (int)Pikachu, @@ -61,6 +64,9 @@ internal static class GBRestrictions internal static bool TypeIDExists(int type) => Types_Gen1.Contains(type); + /// + /// Valid type IDs extracted from the Personal Table used for R/G/B/Y games. + /// private static readonly HashSet Types_Gen1 = new() { 0, 1, 2, 3, 4, 5, 7, 8, 20, 21, 22, 23, 24, 25, 26 diff --git a/PKHeX.Core/Legality/Restrictions/Locale3DS.cs b/PKHeX.Core/Legality/Restrictions/Locale3DS.cs index 9b3fb6fc3..09c039cb7 100644 --- a/PKHeX.Core/Legality/Restrictions/Locale3DS.cs +++ b/PKHeX.Core/Legality/Restrictions/Locale3DS.cs @@ -5,6 +5,7 @@ namespace PKHeX.Core /// /// Provides information for and data. /// + /// These values were specific to the 3DS games (Generations 6 and 7, excluding LGP/E) public static class Locale3DS { /// @@ -16,8 +17,8 @@ public static class Locale3DS public static bool IsConsoleRegionCountryValid(int consoleRegion, int country) => consoleRegion switch { 0 => country is 1, // Japan - 1 => (8 <= country && country <= 52) || (country is 153 or 156 or 168 or 174 or 186), // Americas - 2 => (64 <= country && country <= 127) || (country is 169 or 184 or 185), // Europe + 1 => country is (>= 8 and <= 52) or 153 or 156 or 168 or 174 or 186, // Americas + 2 => country is (>= 64 and <= 127) or 169 or 184 or 185, // Europe 4 => country is 144 or 160, // China 5 => country is 136, // Korea 6 => country is 144 or 128, // Taiwan