mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-24 00:44:14 -05:00
Fix for legallity of Pokemon Box encounters to be included with gen 3 games static tables for every games.
Also split gbcartera game versions into gen 1 events, gen 2 events, stadium and stadium2, leaving GBCartEraOnly as a group of games. Added Stadium 2 gift pokemon
This commit is contained in:
@@ -40,7 +40,11 @@ public enum GameVersion
|
||||
|
||||
// Extra Game Groupings (Generation)
|
||||
Gen1, Gen2, Gen3, Gen4, Gen5, Gen6, Gen7,
|
||||
GBCartEraOnly, // Stadium
|
||||
GBCartEraOnly,
|
||||
Stadium,
|
||||
Stadium2,
|
||||
EventsGen1,
|
||||
EventsGen2,
|
||||
}
|
||||
|
||||
public static class Extension
|
||||
@@ -54,24 +58,34 @@ public static bool Contains(this GameVersion g1, GameVersion g2)
|
||||
case GameVersion.RBY:
|
||||
return (g2 == GameVersion.RD || g2 == GameVersion.BU || g2 == GameVersion.YW || g2 == GameVersion.GN);
|
||||
case GameVersion.Gen1:
|
||||
return ( GameVersion.RBY.Contains(g2) || g2 == GameVersion.GBCartEraOnly);
|
||||
return ( GameVersion.RBY.Contains(g2) || g2 == GameVersion.Stadium|| g2 == GameVersion.EventsGen1);
|
||||
case GameVersion.Stadium:
|
||||
case GameVersion.EventsGen1:
|
||||
return GameVersion.RBY.Contains(g2);
|
||||
|
||||
case GameVersion.GS: return (g2 == GameVersion.GD || g2 == GameVersion.SV);
|
||||
case GameVersion.GSC:
|
||||
return (GameVersion.GS.Contains(g2) || g2 == GameVersion.C);
|
||||
case GameVersion.Gen2:
|
||||
return (GameVersion.GSC.Contains(g2) || g2 == GameVersion.GBCartEraOnly);
|
||||
return (GameVersion.GSC.Contains(g2) || g2 == GameVersion.Stadium2 || g2 == GameVersion.EventsGen2);
|
||||
case GameVersion.Stadium2:
|
||||
case GameVersion.EventsGen2:
|
||||
return GameVersion.GSC.Contains(g2);
|
||||
case GameVersion.GBCartEraOnly:
|
||||
return g2 == GameVersion.Stadium || g2 == GameVersion.Stadium2 || g2 == GameVersion.EventsGen1 || g2 == GameVersion.EventsGen2;
|
||||
|
||||
case GameVersion.RS: return (g2 == GameVersion.R || g2 == GameVersion.S);
|
||||
case GameVersion.FRLG: return (g2 == GameVersion.FR || g2 == GameVersion.LG);
|
||||
case GameVersion.CXD: return (g2 == GameVersion.COLO || g2 == GameVersion.XD);
|
||||
case GameVersion.RSBOX: return (GameVersion.RS.Contains(g2) || g2 == GameVersion.E || GameVersion.FRLG.Contains(g2));
|
||||
case GameVersion.Gen3:
|
||||
return (GameVersion.RS.Contains(g2) || g2 == GameVersion.E || GameVersion.FRLG.Contains(g2) || GameVersion.CXD.Contains(g2) || g2 == GameVersion.RSBOX);
|
||||
|
||||
case GameVersion.DP: return (g2 == GameVersion.D || g2 == GameVersion.P);
|
||||
case GameVersion.HGSS: return (g2 == GameVersion.HG || g2 == GameVersion.SS);
|
||||
case GameVersion.BATREV: return (GameVersion.DP.Contains(g2) || g2 == GameVersion.Pt || GameVersion.HGSS.Contains(g2));
|
||||
case GameVersion.Gen4:
|
||||
return (GameVersion.DP.Contains(g2) || g2 == GameVersion.Pt || GameVersion.HGSS.Contains(g2));
|
||||
return (GameVersion.DP.Contains(g2) || g2 == GameVersion.Pt || GameVersion.HGSS.Contains(g2) || g2 == GameVersion.BATREV);
|
||||
|
||||
case GameVersion.BW: return (g2 == GameVersion.B || g2 == GameVersion.W);
|
||||
case GameVersion.B2W2: return (g2 == GameVersion.B2 || g2 == GameVersion.W2);
|
||||
|
||||
@@ -939,7 +939,7 @@ private CheckResult verifyVCEncounter(int baseSpecies)
|
||||
return new CheckResult(Severity.Invalid, V80, CheckIdentifier.Encounter);
|
||||
|
||||
var s = EncounterMatch as EncounterStatic;
|
||||
if (s != null && s.Version == GameVersion.GBCartEraOnly)
|
||||
if (s != null && GameVersion.GBCartEraOnly.Contains(s.Version))
|
||||
{
|
||||
bool exceptions = false;
|
||||
exceptions |= baseSpecies == 151 && pkm.TID == 22796;
|
||||
|
||||
@@ -942,7 +942,7 @@ internal static EncounterStatic getValidStaticEncounter(PKM pkm, GameVersion gam
|
||||
// if (e.Gift && pkm.Ball != 4) // PokéBall
|
||||
// continue;
|
||||
|
||||
if (!AllowGBCartEra && e.Version == GameVersion.GBCartEraOnly)
|
||||
if (!AllowGBCartEra && GameVersion.GBCartEraOnly.Contains(e.Version))
|
||||
continue; // disallow gb cart era encounters (as they aren't obtainable by Main/VC series)
|
||||
|
||||
return e;
|
||||
|
||||
@@ -102,8 +102,8 @@ public static partial class Legal
|
||||
// new EncounterStatic { Species = 004, Level = 10, Version = GameVersion.YW }, // Charmander (Route 24)
|
||||
// new EncounterStatic { Species = 007, Level = 10, Version = GameVersion.YW }, // Squirtle (Vermillion City)
|
||||
|
||||
new EncounterStatic { Species = 054, Level = 15, Moves = new [] { 133, 10 }, Version = GameVersion.GBCartEraOnly }, // Stadium Psyduck (Amnesia)
|
||||
new EncounterStatic { Species = 151, Level = 5, IVs = new [] {15,15,15,15,15,15}, Version = GameVersion.GBCartEraOnly }, // Event Mew
|
||||
new EncounterStatic { Species = 054, Level = 15, Moves = new [] { 133, 10 }, Version = GameVersion.Stadium }, // Stadium Psyduck (Amnesia)
|
||||
new EncounterStatic { Species = 151, Level = 5, IVs = new [] {15,15,15,15,15,15}, Version = GameVersion.EventsGen1 }, // Event Mew
|
||||
};
|
||||
internal static readonly EncounterTrade[] TradeGift_RBY =
|
||||
{
|
||||
|
||||
@@ -73,6 +73,9 @@ public static partial class Legal
|
||||
new EncounterStatic { Species = 100, Level = 23, Location = 036, Version = GameVersion.GSC }, // Voltorb @ Rocket Hideout (Mahogany Town)
|
||||
new EncounterStatic { Species = 101, Level = 23, Location = 036, Version = GameVersion.GSC }, // Electrode @ Rocket Hideout (Mahogany Town)
|
||||
new EncounterStatic { Species = 143, Level = 50, Location = 061, Version = GameVersion.GSC }, // Snorlax @ Vermillion City
|
||||
|
||||
new EncounterStatic { Species = 083, Level = 05, Moves = new [] { 226, 14, 97, 37 }, Version = GameVersion.Stadium2 }, // Stadium 2 Baton Pass Farfetch'd
|
||||
new EncounterStatic { Species = 207, Level = 05, Moves = new [] { 89, 68, 17 }, Version = GameVersion.Stadium2 }, // Stadium 2 Earthquake Gligar
|
||||
};
|
||||
|
||||
internal static readonly EncounterStatic[] Encounter_GS_Exclusive =
|
||||
@@ -102,7 +105,7 @@ public static partial class Legal
|
||||
|
||||
new EncounterStatic { Species = 249, Level = 60, Location = 031, Version = GameVersion.C }, // Lugia @ Whirl Islands
|
||||
new EncounterStatic { Species = 250, Level = 60, Location = 023, Version = GameVersion.C }, // Ho-Oh @ Tin Tower
|
||||
new EncounterStatic { Species = 251, Level = 30, Location = 014, Version = GameVersion.GBCartEraOnly }, // Celebi @ Ilex Forest
|
||||
new EncounterStatic { Species = 251, Level = 30, Location = 014, Version = GameVersion.EventsGen2 }, // Celebi @ Ilex Forest
|
||||
};
|
||||
|
||||
internal static readonly EncounterStatic[] Encounter_GS = Encounter_GSC_Common.Concat(Encounter_GS_Exclusive).ToArray();
|
||||
|
||||
Reference in New Issue
Block a user