From a91764b28394dfa7cd78c115fc3d420014ccceb7 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 10 Jul 2017 18:56:13 -0700 Subject: [PATCH] Add hot springs as valid egg location for gen6 split table references, remove per-format calculations as they all behaved the same as the main method --- PKHeX.Core/Legality/Tables6.cs | 2 +- PKHeX.Core/Legality/Tables7.cs | 1 + PKHeX.Core/PKM/PK3.cs | 1 - PKHeX.Core/PKM/PK4.cs | 1 - PKHeX.Core/PKM/PK5.cs | 3 --- PKHeX.Core/PKM/PK6.cs | 1 - PKHeX.Core/PKM/PK7.cs | 1 - PKHeX.Core/PKM/PKM.cs | 6 +++--- 8 files changed, 5 insertions(+), 11 deletions(-) diff --git a/PKHeX.Core/Legality/Tables6.cs b/PKHeX.Core/Legality/Tables6.cs index 30f7c29d1..419a4557d 100644 --- a/PKHeX.Core/Legality/Tables6.cs +++ b/PKHeX.Core/Legality/Tables6.cs @@ -226,7 +226,7 @@ public static partial class Legal #endregion - internal static readonly int[] EggLocations = {60002, 30002}; + internal static readonly int[] EggLocations6 = {60002, 30002, 60004}; internal static readonly int[] ValidMet_XY = { 006, 008, 009, 010, 012, 013, 014, 016, 017, 018, 020, 021, 022, 024, 026, 028, 029, 030, 032, 034, 035, 036, diff --git a/PKHeX.Core/Legality/Tables7.cs b/PKHeX.Core/Legality/Tables7.cs index 4e1f6abbf..c0a2fdaac 100644 --- a/PKHeX.Core/Legality/Tables7.cs +++ b/PKHeX.Core/Legality/Tables7.cs @@ -461,6 +461,7 @@ public static partial class Legal 687, // Core Enforcer }; + internal static readonly int[] EggLocations7 = {60002, 30002}; internal static readonly int[] ValidMet_SM = { 006, 008, 010, 012, 014, 016, 018, 020, 022, 024, 026, 028, 030, 032, 034, 036, 038, 040, 042, 044, 046, 048, diff --git a/PKHeX.Core/PKM/PK3.cs b/PKHeX.Core/PKM/PK3.cs index f1ac11c40..193c71049 100644 --- a/PKHeX.Core/PKM/PK3.cs +++ b/PKHeX.Core/PKM/PK3.cs @@ -157,7 +157,6 @@ public PK3(byte[] decryptedData = null, string ident = null) public override int PSV => (int)((PID >> 16 ^ PID & 0xFFFF) >> 3); public override int TSV => (TID ^ SID) >> 3; public bool Japanese => IsEgg || Language == 1; - public override bool WasEgg => Met_Level == 0; public override bool WasEvent => Met_Location == 255; // Fateful public override bool WasIngameTrade => Met_Location == 254; // Trade public override bool WasGiftEgg => IsEgg && Met_Location == 253; // Gift Egg, indistinguible from normal eggs after hatch diff --git a/PKHeX.Core/PKM/PK4.cs b/PKHeX.Core/PKM/PK4.cs index d6f6acb2e..17309b769 100644 --- a/PKHeX.Core/PKM/PK4.cs +++ b/PKHeX.Core/PKM/PK4.cs @@ -345,7 +345,6 @@ public override int Characteristic } } // Legality Extensions - public override bool WasEgg => GenNumber < 4 ? base.WasEgg : Species == 490 && Egg_Location == 3001 || Legal.EggLocations4.Contains(Egg_Location); public override bool WasEvent => Met_Location >= 3000 && Met_Location <= 3076 || FatefulEncounter; public override bool WasIngameTrade => Met_Location == 2001; // Trade public override bool WasEventEgg => WasEgg && Species == 490; // Manaphy was the only generation 4 released event egg diff --git a/PKHeX.Core/PKM/PK5.cs b/PKHeX.Core/PKM/PK5.cs index ac4356c63..4d385dbed 100644 --- a/PKHeX.Core/PKM/PK5.cs +++ b/PKHeX.Core/PKM/PK5.cs @@ -265,9 +265,6 @@ public override int Characteristic return pm6stat * 5 + maxIV % 5; } } - - // Legality Extensions - public override bool WasEgg => GenNumber < 5 ? base.WasEgg : Legal.EggLocations5.Contains(Egg_Location); // Maximums public override int MaxMoveID => Legal.MaxMoveID_5; diff --git a/PKHeX.Core/PKM/PK6.cs b/PKHeX.Core/PKM/PK6.cs index 958e9b69d..6b226d9bc 100644 --- a/PKHeX.Core/PKM/PK6.cs +++ b/PKHeX.Core/PKM/PK6.cs @@ -569,7 +569,6 @@ public void TradeMemory(bool Bank) // Legality Properties public override bool WasLink => Met_Location == 30011; - public override bool WasEgg => GenNumber < 6 ? base.WasEgg : Legal.EggLocations.Contains(Egg_Location); public override bool WasEvent => Met_Location > 40000 && Met_Location < 50000 || FatefulEncounter; public override bool WasEventEgg => GenNumber < 5 ? base.WasEventEgg : ((Egg_Location > 40000 && Egg_Location < 50000) || (FatefulEncounter && Egg_Location == 30002)) && Met_Level == 1; public override bool WasTradedEgg => Egg_Location == 30002 || GenNumber == 4 && Egg_Location == 2002; diff --git a/PKHeX.Core/PKM/PK7.cs b/PKHeX.Core/PKM/PK7.cs index d5c6e06bb..8c7e51a2f 100644 --- a/PKHeX.Core/PKM/PK7.cs +++ b/PKHeX.Core/PKM/PK7.cs @@ -604,7 +604,6 @@ public void TradeMemory(bool Bank) // Legality Properties public override bool WasLink => Met_Location == 30011; - public override bool WasEgg => GenNumber < 6 ? base.WasEgg : Legal.EggLocations.Contains(Egg_Location); public override bool WasEvent => Met_Location > 40000 && Met_Location < 50000 || FatefulEncounter; public override bool WasEventEgg => GenNumber < 5 ? base.WasEventEgg : ((Egg_Location > 40000 && Egg_Location < 50000) || (FatefulEncounter && Egg_Location == 30002)) && Met_Level == 1; public override bool WasTradedEgg => Egg_Location == 30002 || GenNumber == 4 && Egg_Location == 2002; diff --git a/PKHeX.Core/PKM/PKM.cs b/PKHeX.Core/PKM/PKM.cs index dcacfb8ea..613786d30 100644 --- a/PKHeX.Core/PKM/PKM.cs +++ b/PKHeX.Core/PKM/PKM.cs @@ -448,7 +448,7 @@ public virtual int HPType public bool Gen2_NotTradeback => TradebackStatus == TradebackType.Gen2_NotTradeback; public virtual bool WasLink => false; private bool _WasEgg; - public virtual bool WasEgg + public bool WasEgg { get { @@ -456,8 +456,8 @@ public virtual bool WasEgg { case 4: return Legal.EggLocations4.Contains(Egg_Location) || (Species == 490 && Egg_Location == 3001) || (Egg_Location == 3002 && PtHGSS); // faraway case 5: return Legal.EggLocations5.Contains(Egg_Location); - case 6: - case 7: return Legal.EggLocations.Contains(Egg_Location); + case 6: return Legal.EggLocations6.Contains(Egg_Location); + case 7: return Legal.EggLocations7.Contains(Egg_Location); } // Gen 1/2 and pal park Gen 3 return _WasEgg;