diff --git a/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs b/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs
index 90f9a6b4d..8cd689ea7 100644
--- a/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs
+++ b/PKHeX.Core/Legality/Encounters/EncounterMisc/EncounterEgg.cs
@@ -130,10 +130,10 @@ private static void SetPINGA(PKM pk, EncounterCriteria criteria)
pk.StatNature = nature;
}
- private static void SetMetData(PKM pk)
+ private void SetMetData(PKM pk)
{
- pk.Met_Level = EncounterSuggestion.GetSuggestedEncounterEggMetLevel(pk);
- pk.Met_Location = Math.Max(0, EncounterSuggestion.GetSuggestedEggMetLocation(pk));
+ pk.Met_Level = EggStateLegality.GetEggLevelMet(Version, Generation);
+ pk.Met_Location = Math.Max(0, EggStateLegality.GetEggHatchLocation(Version, Generation));
}
private void SetEncounterMoves(PKM pk, GameVersion version)
diff --git a/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs b/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs
index 45237077d..b44aef585 100644
--- a/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs
+++ b/PKHeX.Core/Legality/Encounters/Information/EncounterSuggestion.cs
@@ -71,36 +71,8 @@ private static EncounterSuggestionData GetSuggestedEncounter(PKM pkm, IEncounter
return new EncounterSuggestionData(pkm, enc, met);
}
- ///
- /// Gets a valid Egg hatch location for the origin game.
- ///
- /// Pokémon data to suggest for
- public static int GetSuggestedEggMetLocation(PKM pkm) => (GameVersion)pkm.Version switch
- {
- R or S or E or FR or LG => pkm.Format switch
- {
- 3 => (pkm.FRLG ? Locations.HatchLocationFRLG : Locations.HatchLocationRSE),
- 4 => Locations.Transfer3, // Pal Park
- _ => Locations.Transfer4,
- },
-
- D or P or Pt => pkm.Format > 4 ? Locations.Transfer4 : Locations.HatchLocationDPPt,
- HG or SS => pkm.Format > 4 ? Locations.Transfer4 : Locations.HatchLocationHGSS,
-
- B or W or B2 or W2 => Locations.HatchLocation5,
-
- X or Y => Locations.HatchLocation6XY,
- AS or OR => Locations.HatchLocation6AO,
-
- SN or MN or US or UM => Locations.HatchLocation7,
- RD or BU or GN or YW => Locations.Transfer1,
- GD or SV or C => Locations.Transfer2,
- GSC or RBY => pkm.Met_Level == 0 ? 0 : Locations.HatchLocationC,
-
- SW or SH => Locations.HatchLocation8,
- BD or SP => Locations.HatchLocation8b,
- _ => -1,
- };
+ ///
+ public static int GetSuggestedEggMetLocation(PKM pkm) => EggStateLegality.GetEggHatchLocation((GameVersion)pkm.Version, pkm.Format);
///
/// Gets the correct Transfer Met location for the origin game.
diff --git a/PKHeX.Core/Legality/Verifiers/Egg/EggStateLegality.cs b/PKHeX.Core/Legality/Verifiers/Egg/EggStateLegality.cs
index a97b8c16a..e25f2c962 100644
--- a/PKHeX.Core/Legality/Verifiers/Egg/EggStateLegality.cs
+++ b/PKHeX.Core/Legality/Verifiers/Egg/EggStateLegality.cs
@@ -1,4 +1,6 @@
-namespace PKHeX.Core
+using static PKHeX.Core.GameVersion;
+
+namespace PKHeX.Core
{
///
/// Provides information for what values an Egg can have, while it still is an egg.
@@ -63,6 +65,18 @@ public static int GetMaximumEggHatchCycles(PKM pk, IEncounterTemplate enc)
/// Generation the egg is given in
public static int GetEggLevel(int generation) => generation >= 4 ? 1 : 5;
+ ///
+ /// Met Level which eggs are given to the player. May change if transferred to future games.
+ ///
+ /// Game the egg is obtained in
+ /// Generation the egg is given in
+ public static int GetEggLevelMet(GameVersion version, int generation) => generation switch
+ {
+ 2 => version is C ? 1 : 0, // GS do not store met data
+ 3 or 4 => 0,
+ _ => 1,
+ };
+
///
/// Checks if the and associated details can be set for the provided egg .
///
@@ -90,5 +104,35 @@ public static int GetMaximumEggHatchCycles(PKM pk, IEncounterTemplate enc)
///
public static bool IsNicknameFlagSet(PKM pk) => IsNicknameFlagSet(new LegalityAnalysis(pk).EncounterMatch, pk);
+
+ ///
+ /// Gets a valid Egg hatch location for the origin game, permitting future format transfers.
+ ///
+ public static int GetEggHatchLocation(GameVersion game, int format) => game switch
+ {
+ R or S or E or FR or LG => format switch
+ {
+ 3 => game is FR or LG ? Locations.HatchLocationFRLG : Locations.HatchLocationRSE,
+ 4 => Locations.Transfer3, // Pal Park
+ _ => Locations.Transfer4,
+ },
+
+ D or P or Pt => format > 4 ? Locations.Transfer4 : Locations.HatchLocationDPPt,
+ HG or SS => format > 4 ? Locations.Transfer4 : Locations.HatchLocationHGSS,
+
+ B or W or B2 or W2 => Locations.HatchLocation5,
+
+ X or Y => Locations.HatchLocation6XY,
+ AS or OR => Locations.HatchLocation6AO,
+ SN or MN or US or UM => Locations.HatchLocation7,
+
+ GSC or C when format <= 2 => Locations.HatchLocationC,
+ RD or BU or GN or YW => Locations.Transfer1,
+ GD or SV or C => Locations.Transfer2,
+
+ SW or SH => Locations.HatchLocation8,
+ BD or SP => Locations.HatchLocation8b,
+ _ => -1,
+ };
}
}