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
This commit is contained in:
Kurt
2017-07-10 18:56:13 -07:00
parent fa642820b1
commit a91764b283
8 changed files with 5 additions and 11 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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

View File

@@ -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

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;