More Gen2 legality prep

This commit is contained in:
Kurt
2017-02-26 09:36:53 -08:00
parent 5874a8bfa6
commit 2a9e57618c
4 changed files with 54 additions and 2 deletions

View File

@@ -23,6 +23,8 @@ public static GameVersion getMetLocationVersionGroup(GameVersion Version)
return GameVersion.RBY;
case GameVersion.GS:
case GameVersion.GD:
case GameVersion.SV:
case GameVersion.C:
return GameVersion.GSC;

View File

@@ -8,7 +8,6 @@ public enum GameVersion
BATREV = -7,
RSBOX = -5,
GS = -4,
C = -3,
// Indicators
Invalid = -2,
@@ -23,6 +22,7 @@ public enum GameVersion
/*Gen7*/ SN = 30, MN = 31,
/* GO */ GO = 34,
/* VC */ RD = 35, GN = 36, BU = 37, YW = 38, // GN = Blue for international release
GD, SV, C,
// Game Groupings (SaveFile type)
RBY = 98,

View File

@@ -21,6 +21,8 @@ public static partial class Legal
private static readonly Learnset[] LevelUpGS = Learnset1.getArray(Resources.lvlmove_gs, MaxSpeciesID_2);
private static readonly Learnset[] LevelUpC = Learnset1.getArray(Resources.lvlmove_c, MaxSpeciesID_2);
private static readonly EvolutionTree Evolves2;
private static readonly EncounterArea[] SlotsGSC;
private static readonly EncounterStatic[] StaticGSC;
// Gen 6
private static readonly EggMoves[] EggMovesXY = EggMoves6.getArray(Data.unpackMini(Resources.eggmove_xy, "xy"));
@@ -46,6 +48,9 @@ private static EncounterStatic[] getStaticEncounters(GameVersion Game)
{
case GameVersion.RBY:
return Encounter_RBY; // GameVersion filtering not possible, return immediately
case GameVersion.GSC:
return Encounter_GSC;
case GameVersion.X: case GameVersion.Y:
table = Encounter_XY;
break;
@@ -161,6 +166,10 @@ private static void MarkG7SMSlots(ref EncounterArea[] Areas)
// Gen 2
{
Evolves2 = new EvolutionTree(new[] { Resources.evos_gsc }, GameVersion.GSC, PersonalTable.C, MaxSpeciesID_2);
SlotsGSC = new EncounterArea[0]; // todo
StaticGSC = getStaticEncounters(GameVersion.GSC);
}
// Gen 6
{
@@ -1072,6 +1081,11 @@ private static IEnumerable<EncounterArea> getEncounterSlots(PKM pkm, int lvl = -
case GameVersion.GN: case GameVersion.YW:
return getSlots(pkm, SlotsRBY, lvl);
case GameVersion.GSC:
case GameVersion.GD: case GameVersion.SV:
case GameVersion.C:
return getSlots(pkm, SlotsGSC, lvl);
case GameVersion.X:
return getSlots(pkm, SlotsX, lvl);
case GameVersion.Y:
@@ -1097,6 +1111,11 @@ private static IEnumerable<EncounterStatic> getStaticEncounters(PKM pkm, int lvl
case GameVersion.GN: case GameVersion.YW:
return getStatic(pkm, StaticRBY, lvl);
case GameVersion.GSC:
case GameVersion.GD: case GameVersion.SV:
case GameVersion.C:
return getStatic(pkm, StaticGSC, lvl);
case GameVersion.X:
return getStatic(pkm, StaticX, lvl);
case GameVersion.Y:
@@ -1346,6 +1365,23 @@ private static IEnumerable<int> getMoves(PKM pkm, int species, int lvl, int form
r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
break;
}
case 2:
{
int index = PersonalTable.C.getFormeIndex(species, 0);
var pi_c = (PersonalInfoG1)PersonalTable.C[index];
if (LVL)
{
r.AddRange(LevelUpGS[index].getMoves(lvl));
r.AddRange(LevelUpC[index].getMoves(lvl));
}
if (Machine)
{
r.AddRange(TMHM_GSC.Where((t, m) => pi_c.TMHM[m]));
}
if (moveTutor)
r.AddRange(getTutorMoves(pkm, species, form, specialTutors));
break;
}
case 6:
switch (ver)
{

View File

@@ -35,15 +35,29 @@ public static partial class Legal
10, 05, 10, 20, 20, 40, 15, 10, 20, 20, 25, 05, 15, 10, 05, 20, 15, 20, 25, 20, 05, 30, 05, 10, 20, 40, 05, 20, 40, 20, 15, 35, 10, 05, 05, 05, 15, 05, 20, 05, 05, 15, 20, 10, 05, 05, 15, 15, 15, 15,
10, 00, 00, 00, 00
};
internal static readonly int[] TMHM_GSC =
{
223, 029, 174, 205, 046, 092, 192, 249, 244, 237,
241, 230, 173, 059, 063, 196, 182, 240, 202, 203,
218, 076, 231, 225, 087, 089, 216, 091, 094, 247,
189, 104, 008, 207, 214, 188, 201, 126, 129, 111,
009, 138, 197, 156, 213, 168, 211, 007, 210, 171,
015, 019, 057, 070, 148, 250, 127
};
internal static readonly int[] WildPokeBalls2 = { 4 };
internal static readonly int[] FutureEvolutionsGen2 =
{
424,429,430,461,462,463,464,465,466,467,468,469,470,471,472,473,474,700
};
internal static readonly EncounterStatic[] Encounter_GSC =
{
// todo
};
internal static readonly EncounterTrade[] TradeGift_GSC =
{
// todo
};
}
}