2017-01-04 04:51:33 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-05-12 04:34:18 +00:00
|
|
|
|
using System.IO;
|
2016-02-23 06:52:48 +00:00
|
|
|
|
using System.Linq;
|
2017-04-10 22:59:16 +00:00
|
|
|
|
using static PKHeX.Core.LegalityCheckStrings;
|
2016-02-23 06:52:48 +00:00
|
|
|
|
|
2017-01-08 07:54:09 +00:00
|
|
|
|
namespace PKHeX.Core
|
2016-02-23 06:52:48 +00:00
|
|
|
|
{
|
|
|
|
|
public static partial class Legal
|
|
|
|
|
{
|
2017-06-19 05:27:40 +00:00
|
|
|
|
/// <summary>Event Database for Generation 3</summary>
|
|
|
|
|
public static MysteryGift[] MGDB_G3 { get; private set; } = new MysteryGift[0];
|
|
|
|
|
|
|
|
|
|
/// <summary>Event Database for Generation 4</summary>
|
|
|
|
|
public static MysteryGift[] MGDB_G4 { get; private set; } = new MysteryGift[0];
|
|
|
|
|
|
|
|
|
|
/// <summary>Event Database for Generation 5</summary>
|
|
|
|
|
public static MysteryGift[] MGDB_G5 { get; private set; } = new MysteryGift[0];
|
|
|
|
|
|
|
|
|
|
/// <summary>Event Database for Generation 6</summary>
|
|
|
|
|
public static MysteryGift[] MGDB_G6 { get; private set; } = new MysteryGift[0];
|
|
|
|
|
|
|
|
|
|
/// <summary>Event Database for Generation 7</summary>
|
|
|
|
|
public static MysteryGift[] MGDB_G7 { get; private set; } = new MysteryGift[0];
|
2017-03-12 23:36:23 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>Setting to specify if an analysis should permit data sourced from the physical cartridge era of GameBoy games.</summary>
|
2017-06-19 05:27:40 +00:00
|
|
|
|
public static bool AllowGBCartEra { get; set; }
|
|
|
|
|
public static bool AllowGen1Tradeback { get; set; }
|
2017-05-10 02:07:21 +00:00
|
|
|
|
public static bool AllowGen2VCTransfer => AllowGen1Tradeback;
|
2017-06-19 05:27:40 +00:00
|
|
|
|
public static bool AllowGen2VCCrystal => false;
|
2017-06-09 03:57:30 +00:00
|
|
|
|
public static bool AllowGen2Crystal => AllowGBCartEra || AllowGen2VCCrystal;
|
2017-06-07 23:15:13 +00:00
|
|
|
|
public static bool AllowGen2MoveReminder => AllowGBCartEra;
|
2016-07-03 03:24:17 +00:00
|
|
|
|
|
2017-06-19 05:27:40 +00:00
|
|
|
|
/// <summary> e-Reader Berry originates from a Japanese SaveFile </summary>
|
|
|
|
|
public static bool SavegameJapanese { get; set; }
|
|
|
|
|
/// <summary> e-Reader Berry is Enigma or special berry </summary>
|
|
|
|
|
public static bool EReaderBerryIsEnigma { get; set; } = true;
|
|
|
|
|
/// <summary> e-Reader Berry Name </summary>
|
|
|
|
|
public static string EReaderBerryName { get; set; } = string.Empty;
|
|
|
|
|
/// <summary> e-Reader Berry Name formatted in Title Case </summary>
|
2017-06-18 01:37:19 +00:00
|
|
|
|
public static string EReaderBerryDisplayName => string.Format(V372, Util.ToTitleCase(EReaderBerryName.ToLower()));
|
2017-06-19 05:27:40 +00:00
|
|
|
|
|
|
|
|
|
public static string Savegame_OT { private get; set; } = string.Empty;
|
|
|
|
|
public static int Savegame_TID { private get; set; }
|
|
|
|
|
public static int Savegame_SID { private get; set; }
|
|
|
|
|
public static int Savegame_Gender { private get; set; }
|
|
|
|
|
public static GameVersion Savegame_Version { private get; set; } = GameVersion.Any;
|
2017-04-10 23:47:08 +00:00
|
|
|
|
|
2017-02-11 23:20:44 +00:00
|
|
|
|
// Gen 1
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static readonly Learnset[] LevelUpRB = Learnset1.GetArray(Util.GetBinaryResource("lvlmove_rb.pkl"), MaxSpeciesID_1);
|
|
|
|
|
private static readonly Learnset[] LevelUpY = Learnset1.GetArray(Util.GetBinaryResource("lvlmove_y.pkl"), MaxSpeciesID_1);
|
2017-02-11 23:20:44 +00:00
|
|
|
|
private static readonly EvolutionTree Evolves1;
|
2017-02-12 17:52:26 +00:00
|
|
|
|
private static readonly EncounterArea[] SlotsRBY;
|
|
|
|
|
private static readonly EncounterStatic[] StaticRBY;
|
2017-02-11 23:20:44 +00:00
|
|
|
|
|
2017-02-25 20:37:01 +00:00
|
|
|
|
// Gen 2
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static readonly EggMoves[] EggMovesGS = EggMoves2.GetArray(Util.GetBinaryResource("eggmove_gs.pkl"), MaxSpeciesID_2);
|
|
|
|
|
private static readonly Learnset[] LevelUpGS = Learnset1.GetArray(Util.GetBinaryResource("lvlmove_gs.pkl"), MaxSpeciesID_2);
|
|
|
|
|
private static readonly EggMoves[] EggMovesC = EggMoves2.GetArray(Util.GetBinaryResource("eggmove_c.pkl"), MaxSpeciesID_2);
|
|
|
|
|
private static readonly Learnset[] LevelUpC = Learnset1.GetArray(Util.GetBinaryResource("lvlmove_c.pkl"), MaxSpeciesID_2);
|
2017-02-25 20:37:01 +00:00
|
|
|
|
private static readonly EvolutionTree Evolves2;
|
2017-03-21 00:50:35 +00:00
|
|
|
|
private static readonly EncounterArea[] SlotsGSC, SlotsGS, SlotsC;
|
|
|
|
|
private static readonly EncounterStatic[] StaticGSC, StaticGS, StaticC;
|
2017-02-25 20:37:01 +00:00
|
|
|
|
|
2017-03-18 23:50:34 +00:00
|
|
|
|
// Gen 3
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static readonly Learnset[] LevelUpE = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_e.pkl"), "em"));
|
|
|
|
|
private static readonly Learnset[] LevelUpRS = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_rs.pkl"), "rs"));
|
|
|
|
|
private static readonly Learnset[] LevelUpFR = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_fr.pkl"), "fr"));
|
|
|
|
|
private static readonly Learnset[] LevelUpLG = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_lg.pkl"), "lg"));
|
|
|
|
|
private static readonly EggMoves[] EggMovesRS = EggMoves6.GetArray(Data.UnpackMini(Util.GetBinaryResource("eggmove_rs.pkl"), "rs"));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
private static readonly EvolutionTree Evolves3;
|
|
|
|
|
private static readonly EncounterArea[] SlotsR, SlotsS, SlotsE, SlotsFR, SlotsLG;
|
2017-04-10 23:47:08 +00:00
|
|
|
|
private static readonly EncounterStatic[] StaticR, StaticS, StaticE, StaticFR, StaticLG;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
|
|
|
|
// Gen 4
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static readonly Learnset[] LevelUpDP = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_dp.pkl"), "dp"));
|
|
|
|
|
private static readonly Learnset[] LevelUpPt = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_pt.pkl"), "pt"));
|
|
|
|
|
private static readonly Learnset[] LevelUpHGSS = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_hgss.pkl"), "hs"));
|
|
|
|
|
private static readonly EggMoves[] EggMovesDPPt = EggMoves6.GetArray(Data.UnpackMini(Util.GetBinaryResource("eggmove_dppt.pkl"), "dp"));
|
|
|
|
|
private static readonly EggMoves[] EggMovesHGSS = EggMoves6.GetArray(Data.UnpackMini(Util.GetBinaryResource("eggmove_hgss.pkl"), "hs"));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
private static readonly EvolutionTree Evolves4;
|
|
|
|
|
private static readonly EncounterArea[] SlotsD, SlotsP, SlotsPt, SlotsHG, SlotsSS;
|
|
|
|
|
private static readonly EncounterStatic[] StaticD, StaticP, StaticPt, StaticHG, StaticSS;
|
|
|
|
|
|
|
|
|
|
// Gen 5
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static readonly Learnset[] LevelUpBW = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_bw.pkl"), "51"));
|
|
|
|
|
private static readonly Learnset[] LevelUpB2W2 = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_b2w2.pkl"), "52"));
|
|
|
|
|
private static readonly EggMoves[] EggMovesBW = EggMoves6.GetArray(Data.UnpackMini(Util.GetBinaryResource("eggmove_bw.pkl"), "bw"));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
private static readonly EvolutionTree Evolves5;
|
|
|
|
|
private static readonly EncounterArea[] SlotsB, SlotsW, SlotsB2, SlotsW2;
|
|
|
|
|
private static readonly EncounterStatic[] StaticB, StaticW, StaticB2, StaticW2;
|
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
// Gen 6
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static readonly EggMoves[] EggMovesXY = EggMoves6.GetArray(Data.UnpackMini(Util.GetBinaryResource("eggmove_xy.pkl"), "xy"));
|
|
|
|
|
private static readonly Learnset[] LevelUpXY = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_xy.pkl"), "xy"));
|
|
|
|
|
private static readonly EggMoves[] EggMovesAO = EggMoves6.GetArray(Data.UnpackMini(Util.GetBinaryResource("eggmove_ao.pkl"), "ao"));
|
|
|
|
|
private static readonly Learnset[] LevelUpAO = Learnset6.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_ao.pkl"), "ao"));
|
2016-11-15 02:25:08 +00:00
|
|
|
|
private static readonly EvolutionTree Evolves6;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
private static readonly EncounterArea[] SlotsX, SlotsY, SlotsA, SlotsO;
|
|
|
|
|
private static readonly EncounterStatic[] StaticX, StaticY, StaticA, StaticO;
|
|
|
|
|
|
|
|
|
|
// Gen 7
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static readonly EggMoves[] EggMovesSM = EggMoves7.GetArray(Data.UnpackMini(Util.GetBinaryResource("eggmove_sm.pkl"), "sm"));
|
|
|
|
|
private static readonly Learnset[] LevelUpSM = Learnset7.GetArray(Data.UnpackMini(Util.GetBinaryResource("lvlmove_sm.pkl"), "sm"));
|
2016-11-15 02:25:08 +00:00
|
|
|
|
private static readonly EvolutionTree Evolves7;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
private static readonly EncounterArea[] SlotsSN, SlotsMN;
|
|
|
|
|
private static readonly EncounterStatic[] StaticSN, StaticMN;
|
|
|
|
|
|
|
|
|
|
// Setup Help
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static HashSet<MysteryGift> GetPCDDB(byte[] bin)
|
2017-05-12 04:34:18 +00:00
|
|
|
|
{
|
|
|
|
|
var db = new HashSet<MysteryGift>();
|
|
|
|
|
for (int i = 0; i < bin.Length; i += PCD.Size)
|
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PCD.Size];
|
|
|
|
|
Buffer.BlockCopy(bin, i, data, 0, PCD.Size);
|
|
|
|
|
db.Add(new PCD(data));
|
|
|
|
|
}
|
|
|
|
|
return db;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static HashSet<MysteryGift> GetPGFDB(byte[] bin)
|
2017-05-12 04:34:18 +00:00
|
|
|
|
{
|
|
|
|
|
var db = new HashSet<MysteryGift>();
|
|
|
|
|
for (int i = 0; i < bin.Length; i += PGF.Size)
|
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PGF.Size];
|
|
|
|
|
Buffer.BlockCopy(bin, i, data, 0, PGF.Size);
|
|
|
|
|
db.Add(new PGF(data));
|
|
|
|
|
}
|
|
|
|
|
return db;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static HashSet<MysteryGift> GetWC6DB(byte[] wc6bin, byte[] wc6full)
|
2017-05-12 04:34:18 +00:00
|
|
|
|
{
|
|
|
|
|
var db = new HashSet<MysteryGift>();
|
|
|
|
|
for (int i = 0; i < wc6bin.Length; i += WC6.Size)
|
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[WC6.Size];
|
|
|
|
|
Buffer.BlockCopy(wc6bin, i, data, 0, WC6.Size);
|
|
|
|
|
db.Add(new WC6(data));
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < wc6full.Length; i += WC6.SizeFull)
|
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[WC6.SizeFull];
|
|
|
|
|
Buffer.BlockCopy(wc6full, i, data, 0, WC6.SizeFull);
|
|
|
|
|
db.Add(new WC6(data));
|
|
|
|
|
}
|
|
|
|
|
return db;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static HashSet<MysteryGift> GetWC7DB(byte[] wc7bin, byte[] wc7full)
|
2017-05-12 04:34:18 +00:00
|
|
|
|
{
|
|
|
|
|
var db = new HashSet<MysteryGift>();
|
|
|
|
|
for (int i = 0; i < wc7bin.Length; i += WC7.Size)
|
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[WC7.Size];
|
|
|
|
|
Buffer.BlockCopy(wc7bin, i, data, 0, WC7.Size);
|
|
|
|
|
db.Add(new WC7(data));
|
|
|
|
|
}
|
|
|
|
|
for (int i = 0; i < wc7full.Length; i += WC7.SizeFull)
|
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[WC7.SizeFull];
|
|
|
|
|
Buffer.BlockCopy(wc7full, i, data, 0, WC7.SizeFull);
|
|
|
|
|
db.Add(new WC7(data));
|
|
|
|
|
}
|
|
|
|
|
return db;
|
|
|
|
|
}
|
|
|
|
|
public static void RefreshMGDB(string localDbPath)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var g4 = GetPCDDB(Util.GetBinaryResource("pcd.pkl"));
|
|
|
|
|
var g5 = GetPGFDB(Util.GetBinaryResource("pgf.pkl"));
|
|
|
|
|
var g6 = GetWC6DB(Util.GetBinaryResource("wc6.pkl"), Util.GetBinaryResource("wc6full.pkl"));
|
|
|
|
|
var g7 = GetWC7DB(Util.GetBinaryResource("wc7.pkl"), Util.GetBinaryResource("wc7full.pkl"));
|
2017-05-12 04:34:18 +00:00
|
|
|
|
|
|
|
|
|
if (Directory.Exists(localDbPath))
|
|
|
|
|
foreach (var file in Directory.GetFiles(localDbPath, "*", SearchOption.AllDirectories))
|
|
|
|
|
{
|
|
|
|
|
var fi = new FileInfo(file);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
if (!MysteryGift.IsMysteryGift(fi.Length))
|
2017-05-12 04:34:18 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var gift = MysteryGift.GetMysteryGift(File.ReadAllBytes(file), fi.Extension);
|
2017-05-12 04:34:18 +00:00
|
|
|
|
switch (gift?.Format)
|
|
|
|
|
{
|
|
|
|
|
case 4: g4.Add(gift); continue;
|
|
|
|
|
case 5: g5.Add(gift); continue;
|
|
|
|
|
case 6: g6.Add(gift); continue;
|
|
|
|
|
case 7: g7.Add(gift); continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-29 07:48:25 +00:00
|
|
|
|
MGDB_G3 = Encounter_WC3; // hardcoded
|
2017-05-12 16:33:12 +00:00
|
|
|
|
MGDB_G4 = g4.ToArray();
|
|
|
|
|
MGDB_G5 = g5.ToArray();
|
|
|
|
|
MGDB_G6 = g6.ToArray();
|
|
|
|
|
MGDB_G7 = g7.ToArray();
|
2017-05-12 04:34:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EncounterStatic[] GetStaticEncounters(GameVersion Game)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
|
|
|
|
EncounterStatic[] table;
|
2016-10-23 19:48:49 +00:00
|
|
|
|
switch (Game)
|
|
|
|
|
{
|
2017-02-12 17:52:26 +00:00
|
|
|
|
case GameVersion.RBY:
|
2017-02-14 02:06:01 +00:00
|
|
|
|
return Encounter_RBY; // GameVersion filtering not possible, return immediately
|
2017-03-21 00:50:35 +00:00
|
|
|
|
case GameVersion.GS:
|
|
|
|
|
return Encounter_GS;
|
|
|
|
|
case GameVersion.C:
|
|
|
|
|
return Encounter_C;
|
2017-02-26 17:36:53 +00:00
|
|
|
|
case GameVersion.GSC:
|
|
|
|
|
return Encounter_GSC;
|
|
|
|
|
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case GameVersion.R: case GameVersion.S: case GameVersion.E:
|
|
|
|
|
table = Encounter_RSE;
|
|
|
|
|
break;
|
|
|
|
|
case GameVersion.FR: case GameVersion.LG:
|
|
|
|
|
table = Encounter_FRLG;
|
|
|
|
|
break;
|
2017-04-30 19:17:27 +00:00
|
|
|
|
case GameVersion.CXD:
|
|
|
|
|
table = Encounter_CXD;
|
|
|
|
|
break;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
|
|
|
|
case GameVersion.D: case GameVersion.P: case GameVersion.Pt:
|
|
|
|
|
table = Encounter_DPPt;
|
|
|
|
|
break;
|
|
|
|
|
case GameVersion.HG: case GameVersion.SS:
|
2017-03-25 17:13:02 +00:00
|
|
|
|
table = Encounter_HGSS.Concat(Encounter_PokeWalker).ToArray();
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GameVersion.B: case GameVersion.W:
|
2017-03-25 17:13:02 +00:00
|
|
|
|
table = Encounter_BW.Concat(BW_DreamWorld).ToArray();
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
case GameVersion.B2: case GameVersion.W2:
|
2017-03-25 17:13:02 +00:00
|
|
|
|
table = Encounter_B2W2.Concat(B2W2_DreamWorld).ToArray();
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2017-02-12 17:52:26 +00:00
|
|
|
|
case GameVersion.X: case GameVersion.Y:
|
2016-10-23 19:48:49 +00:00
|
|
|
|
table = Encounter_XY;
|
|
|
|
|
break;
|
2017-02-12 17:52:26 +00:00
|
|
|
|
case GameVersion.AS: case GameVersion.OR:
|
2016-10-23 19:48:49 +00:00
|
|
|
|
table = Encounter_AO;
|
|
|
|
|
break;
|
2017-02-12 17:52:26 +00:00
|
|
|
|
case GameVersion.SN: case GameVersion.MN:
|
2016-10-23 19:48:49 +00:00
|
|
|
|
table = Encounter_SM;
|
|
|
|
|
break;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
|
|
|
|
default: return null;
|
2016-10-23 19:48:49 +00:00
|
|
|
|
}
|
2017-03-26 09:39:13 +00:00
|
|
|
|
return table?.Where(s => s.Version.Contains(Game)).ToArray();
|
2016-03-23 02:47:13 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EncounterArea[] GetEncounterTables(GameVersion Game)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
|
|
|
|
string ident = null;
|
|
|
|
|
byte[] tables = null;
|
|
|
|
|
switch (Game)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
case GameVersion.R: return EncounterArea.GetArray3(Data.UnpackMini(Util.GetBinaryResource("encounter_r.pkl"), "ru"));
|
|
|
|
|
case GameVersion.S: return EncounterArea.GetArray3(Data.UnpackMini(Util.GetBinaryResource("encounter_s.pkl"), "sa"));
|
|
|
|
|
case GameVersion.E: return EncounterArea.GetArray3(Data.UnpackMini(Util.GetBinaryResource("encounter_e.pkl"), "em"));
|
|
|
|
|
case GameVersion.FR: return EncounterArea.GetArray3(Data.UnpackMini(Util.GetBinaryResource("encounter_fr.pkl"), "fr"));
|
|
|
|
|
case GameVersion.LG: return EncounterArea.GetArray3(Data.UnpackMini(Util.GetBinaryResource("encounter_lg.pkl"), "lg"));
|
|
|
|
|
case GameVersion.D: return EncounterArea.GetArray4DPPt(Data.UnpackMini(Util.GetBinaryResource("encounter_d.pkl"), "da"));
|
|
|
|
|
case GameVersion.P: return EncounterArea.GetArray4DPPt(Data.UnpackMini(Util.GetBinaryResource("encounter_p.pkl"), "pe"));
|
|
|
|
|
case GameVersion.Pt: return EncounterArea.GetArray4DPPt(Data.UnpackMini(Util.GetBinaryResource("encounter_pt.pkl"), "pt"));
|
|
|
|
|
case GameVersion.HG: return EncounterArea.GetArray4HGSS(Data.UnpackMini(Util.GetBinaryResource("encounter_hg.pkl"), "hg"));
|
|
|
|
|
case GameVersion.SS: return EncounterArea.GetArray4HGSS(Data.UnpackMini(Util.GetBinaryResource("encounter_ss.pkl"), "ss"));
|
|
|
|
|
case GameVersion.B: ident = "51"; tables = Util.GetBinaryResource("encounter_b.pkl"); break;
|
|
|
|
|
case GameVersion.W: ident = "51"; tables = Util.GetBinaryResource("encounter_w.pkl"); break;
|
|
|
|
|
case GameVersion.B2: ident = "52"; tables = Util.GetBinaryResource("encounter_b2.pkl"); break;
|
|
|
|
|
case GameVersion.W2: ident = "52"; tables = Util.GetBinaryResource("encounter_w2.pkl"); break;
|
|
|
|
|
case GameVersion.X: ident = "xy"; tables = Util.GetBinaryResource("encounter_x.pkl"); break;
|
|
|
|
|
case GameVersion.Y: ident = "xy"; tables = Util.GetBinaryResource("encounter_y.pkl"); break;
|
|
|
|
|
case GameVersion.AS: ident = "ao"; tables = Util.GetBinaryResource("encounter_a.pkl"); break;
|
|
|
|
|
case GameVersion.OR: ident = "ao"; tables = Util.GetBinaryResource("encounter_o.pkl"); break;
|
|
|
|
|
case GameVersion.SN: ident = "sm"; tables = Util.GetBinaryResource("encounter_sn.pkl"); break;
|
|
|
|
|
case GameVersion.MN: ident = "sm"; tables = Util.GetBinaryResource("encounter_mn.pkl"); break;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
|
|
|
|
if (ident == null)
|
2017-03-18 23:50:34 +00:00
|
|
|
|
return new EncounterArea[0];
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetEncounterTables(tables, ident);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EncounterArea[] GetEncounterTables(byte[] mini, string ident)
|
2016-11-23 01:37:18 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return EncounterArea.GetArray(Data.UnpackMini(mini, ident));
|
2016-11-23 01:37:18 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EncounterArea[] AddExtraTableSlots(params EncounterArea[][] tables)
|
2016-03-18 03:20:34 +00:00
|
|
|
|
{
|
2017-03-26 08:25:21 +00:00
|
|
|
|
return tables.SelectMany(s => s).GroupBy(l => l.Location)
|
|
|
|
|
.Select(t => t.Count() == 1
|
|
|
|
|
? t.First() // only one table, just return the area
|
|
|
|
|
: new EncounterArea {Location = t.First().Location, Slots = t.SelectMany(s => s.Slots).ToArray()})
|
|
|
|
|
.ToArray();
|
2016-03-18 03:20:34 +00:00
|
|
|
|
}
|
2017-05-17 04:09:53 +00:00
|
|
|
|
private static void MarkEncountersStaticMagnetPull(ref EncounterArea[] Areas, PersonalTable t)
|
|
|
|
|
{
|
|
|
|
|
const int steel = 8;
|
|
|
|
|
const int electric = 12;
|
|
|
|
|
foreach (EncounterArea Area in Areas)
|
|
|
|
|
{
|
|
|
|
|
var s = new List<EncounterSlot>(); // Static
|
|
|
|
|
var m = new List<EncounterSlot>(); // Magnet Pull
|
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
|
|
|
|
var types = t[Slot.Species].Types;
|
|
|
|
|
if (types[0] == steel || types[1] == steel)
|
|
|
|
|
m.Add(Slot);
|
|
|
|
|
if (types[0] == electric || types[1] == electric)
|
|
|
|
|
s.Add(Slot);
|
|
|
|
|
}
|
|
|
|
|
foreach (var slot in s)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
slot.Permissions.Static = true;
|
|
|
|
|
slot.Permissions.StaticCount = s.Count;
|
2017-05-17 04:09:53 +00:00
|
|
|
|
}
|
|
|
|
|
foreach (var slot in m)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
slot.Permissions.MagnetPull = true;
|
|
|
|
|
slot.Permissions.MagnetPullCount = s.Count;
|
2017-05-17 04:09:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
private static void MarkEncountersGeneration(ref EncounterStatic[] Encounters, int Generation)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterStatic Encounter in Encounters)
|
|
|
|
|
Encounter.Generation = Generation;
|
|
|
|
|
}
|
|
|
|
|
private static void MarkEncountersGeneration(ref EncounterArea[] Areas, int Generation)
|
|
|
|
|
{
|
2017-04-09 02:05:29 +00:00
|
|
|
|
foreach (EncounterArea Area in Areas)
|
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
Slot.Generation = Generation;
|
|
|
|
|
}
|
2017-03-21 07:20:51 +00:00
|
|
|
|
private static void ReduceAreasSize(ref EncounterArea[] Areas)
|
2017-03-19 12:42:59 +00:00
|
|
|
|
{
|
|
|
|
|
// Group areas by location id, the raw data have areas with different slots but the same location id
|
2017-03-21 07:20:51 +00:00
|
|
|
|
Areas = Areas.GroupBy(a => a.Location).Select(a => new EncounterArea
|
2017-03-20 23:00:29 +00:00
|
|
|
|
{
|
|
|
|
|
Location = a.First().Location,
|
|
|
|
|
Slots = a.SelectMany(m => m.Slots).ToArray()
|
|
|
|
|
}).ToArray();
|
2017-03-19 12:42:59 +00:00
|
|
|
|
}
|
2017-03-21 07:20:51 +00:00
|
|
|
|
private static void MarkG2Slots(ref EncounterArea[] Areas)
|
2017-03-19 12:42:59 +00:00
|
|
|
|
{
|
2017-03-21 07:20:51 +00:00
|
|
|
|
ReduceAreasSize(ref Areas);
|
|
|
|
|
}
|
|
|
|
|
private static void MarkG3Slots_FRLG(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
// Remove slots for unown, those slots does not contains alt form info, it will be added manually in SlotsRFLGAlt
|
2017-03-19 12:42:59 +00:00
|
|
|
|
// Group areas by location id, the raw data have areas with different slots but the same location id
|
2017-03-21 07:20:51 +00:00
|
|
|
|
Areas = Areas.Where(a => a.Location < 188 || a.Location > 194).GroupBy(a => a.Location).Select(a => new EncounterArea
|
2017-03-20 23:00:29 +00:00
|
|
|
|
{
|
|
|
|
|
Location = a.First().Location,
|
|
|
|
|
Slots = a.SelectMany(m => m.Slots).ToArray()
|
|
|
|
|
}).ToArray();
|
2017-03-19 12:42:59 +00:00
|
|
|
|
}
|
2017-03-21 07:20:51 +00:00
|
|
|
|
private static void MarkG3Slots_RSE(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
ReduceAreasSize(ref Areas);
|
|
|
|
|
}
|
2017-03-26 20:46:05 +00:00
|
|
|
|
private static void MarkG3SlotsSafariZones(ref EncounterArea[] Areas, int location)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterArea Area in Areas.Where(a => a.Location == location))
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
|
|
|
|
SlotType t;
|
|
|
|
|
switch (Slot.Type)
|
|
|
|
|
{
|
|
|
|
|
case SlotType.Grass: t = SlotType.Grass_Safari; break;
|
|
|
|
|
case SlotType.Surf: t = SlotType.Surf_Safari; break;
|
|
|
|
|
case SlotType.Old_Rod: t = SlotType.Old_Rod_Safari; break;
|
|
|
|
|
case SlotType.Good_Rod: t = SlotType.Good_Rod_Safari; break;
|
|
|
|
|
case SlotType.Super_Rod: t = SlotType.Super_Rod_Safari; break;
|
|
|
|
|
case SlotType.Rock_Smash: t = SlotType.Rock_Smash_Safari; break;
|
|
|
|
|
default: continue;
|
|
|
|
|
}
|
|
|
|
|
Slot.Type = t;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-25 17:13:02 +00:00
|
|
|
|
private static void MarkG4PokeWalker(ref EncounterStatic[] t)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterStatic s in t)
|
|
|
|
|
{
|
|
|
|
|
s.Location = 233; //Pokéwalker
|
|
|
|
|
s.Gift = true; //Pokeball only
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-26 20:46:05 +00:00
|
|
|
|
private static void MarkG4SlotsGreatMarsh(ref EncounterArea[] Areas, int location)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterArea Area in Areas.Where(a => a.Location == location))
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
|
|
|
|
SlotType t;
|
|
|
|
|
switch (Slot.Type)
|
|
|
|
|
{
|
|
|
|
|
case SlotType.Grass: t = SlotType.Grass_Safari; break;
|
|
|
|
|
case SlotType.Surf: t = SlotType.Surf_Safari; break;
|
|
|
|
|
case SlotType.Old_Rod: t = SlotType.Old_Rod_Safari; break;
|
|
|
|
|
case SlotType.Good_Rod: t = SlotType.Good_Rod_Safari; break;
|
|
|
|
|
case SlotType.Super_Rod: t = SlotType.Super_Rod_Safari; break;
|
|
|
|
|
case SlotType.Pokeradar: t = SlotType.Pokeradar_Safari; break;
|
|
|
|
|
default: continue;
|
|
|
|
|
}
|
|
|
|
|
Slot.Type = t;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-20 14:49:05 +00:00
|
|
|
|
private static void MarkG4SwarmSlots(ref EncounterArea[] Areas, EncounterArea[] SwarmAreas)
|
|
|
|
|
{
|
2017-03-27 03:21:44 +00:00
|
|
|
|
// Grass Swarm slots replace slots 0 and 1 from encounters data
|
|
|
|
|
// for surfing only replace slots 0 from encounters data
|
|
|
|
|
// for fishing replace one or several random slots from encounters data, but all slots have the same level, it's ok to only replace the first
|
2017-03-20 14:49:05 +00:00
|
|
|
|
// Species id are not included in encounter tables but levels can be copied from the encounter raw data
|
2017-03-27 03:21:44 +00:00
|
|
|
|
foreach (EncounterArea Area in Areas)
|
2017-03-20 14:49:05 +00:00
|
|
|
|
{
|
2017-03-20 23:00:29 +00:00
|
|
|
|
var SwarmSlots = SwarmAreas.Where(a => a.Location == Area.Location).SelectMany(s => s.Slots);
|
|
|
|
|
var OutputSlots = new List<EncounterSlot>();
|
|
|
|
|
foreach (EncounterSlot SwarmSlot in SwarmSlots)
|
2017-03-20 14:49:05 +00:00
|
|
|
|
{
|
2017-03-27 03:21:44 +00:00
|
|
|
|
int slotsnum = SwarmSlot.Type == SlotType.Grass ? 2 : 1;
|
|
|
|
|
foreach (var swarmSlot in Area.Slots.Where(s => s.Type == SwarmSlot.Type).Take(slotsnum).Select(slot => slot.Clone()))
|
2017-03-20 23:00:29 +00:00
|
|
|
|
{
|
|
|
|
|
swarmSlot.Species = SwarmSlot.Species;
|
|
|
|
|
OutputSlots.Add(swarmSlot);
|
|
|
|
|
}
|
2017-03-20 14:49:05 +00:00
|
|
|
|
}
|
2017-03-20 23:00:29 +00:00
|
|
|
|
Area.Slots = Area.Slots.Concat(OutputSlots).Where(a => a.Species > 0).ToArray();
|
2017-03-20 14:49:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-21 07:20:51 +00:00
|
|
|
|
// Gen 4 raw encounter data does not contains info for alt slots
|
|
|
|
|
// Shellos and Gastrodom East Sea form should be modified
|
|
|
|
|
private static void MarkG4AltFormSlots(ref EncounterArea[] Areas, int Species, int form, int[] Locations)
|
2017-03-19 13:38:30 +00:00
|
|
|
|
{
|
2017-03-21 07:20:51 +00:00
|
|
|
|
foreach(EncounterArea Area in Areas.Where(a => Locations.Contains(a.Location)))
|
2017-03-20 22:50:23 +00:00
|
|
|
|
{
|
2017-03-21 07:20:51 +00:00
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots.Where(s=>s.Species == Species))
|
|
|
|
|
{
|
|
|
|
|
Slot.Form = form;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private static void MarkG4Slots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
ReduceAreasSize(ref Areas);
|
2017-03-19 13:38:30 +00:00
|
|
|
|
}
|
2017-05-28 04:17:53 +00:00
|
|
|
|
private static EncounterType GetEncounterTypeBySlotDPPt(SlotType Type, EncounterType GrassType)
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
{
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
|
|
|
|
case SlotType.Pokeradar:
|
2017-04-25 20:40:10 +00:00
|
|
|
|
case SlotType.Pokeradar_Safari:
|
|
|
|
|
case SlotType.Swarm:
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
case SlotType.Grass: return GrassType;
|
|
|
|
|
case SlotType.Surf:
|
|
|
|
|
case SlotType.Old_Rod:
|
|
|
|
|
case SlotType.Good_Rod:
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
case SlotType.Super_Rod:
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
case SlotType.Surf_Safari:
|
|
|
|
|
case SlotType.Old_Rod_Safari:
|
|
|
|
|
case SlotType.Good_Rod_Safari:
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
case SlotType.Super_Rod_Safari: return EncounterType.Surfing_Fishing;
|
|
|
|
|
case SlotType.Grass_Safari: return EncounterType.MarshSafari;
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
case SlotType.HoneyTree: return EncounterType.None;
|
|
|
|
|
}
|
|
|
|
|
return EncounterType.None;
|
|
|
|
|
}
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
private static EncounterType GetEncounterTypeBySlotHGSS(SlotType Type, EncounterType GrassType, EncounterType HeadbuttType)
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
{
|
|
|
|
|
switch (Type)
|
|
|
|
|
{
|
|
|
|
|
// HGSS Safari encounters have normal water/grass encounter type, not safari encounter type
|
|
|
|
|
case SlotType.Grass:
|
2017-04-24 17:42:27 +00:00
|
|
|
|
case SlotType.Grass_Safari:
|
|
|
|
|
case SlotType.BugContest: return GrassType;
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
case SlotType.Surf:
|
|
|
|
|
case SlotType.Old_Rod:
|
|
|
|
|
case SlotType.Good_Rod:
|
|
|
|
|
case SlotType.Super_Rod:
|
|
|
|
|
case SlotType.Surf_Safari:
|
|
|
|
|
case SlotType.Old_Rod_Safari:
|
|
|
|
|
case SlotType.Good_Rod_Safari:
|
|
|
|
|
case SlotType.Super_Rod_Safari: return EncounterType.Surfing_Fishing;
|
|
|
|
|
case SlotType.Rock_Smash:
|
|
|
|
|
case SlotType.Rock_Smash_Safari: return EncounterType.RockSmash;
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
case SlotType.Headbutt: return HeadbuttType;
|
|
|
|
|
case SlotType.Headbutt_Special: return EncounterType.None;
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
}
|
|
|
|
|
return EncounterType.None;
|
|
|
|
|
}
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
private static void MarkDPPtEncounterTypeSlots_MultipleTypes(ref EncounterArea[] Areas, int Location, int SpecialEncounterFile, EncounterType NormalEncounterType)
|
|
|
|
|
{
|
|
|
|
|
// Area with two different encounter type for grass encounters
|
|
|
|
|
// SpecialEncounterFile is tall grass encounter type, the other files have the normal encounter type for this location
|
|
|
|
|
var numfile = 0;
|
|
|
|
|
foreach (EncounterArea Area in Areas.Where(x => x.Location == Location))
|
|
|
|
|
{
|
|
|
|
|
numfile++;
|
|
|
|
|
var GrassType = numfile == SpecialEncounterFile ? EncounterType.TallGrass : NormalEncounterType;
|
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
|
|
|
|
Slot.TypeEncounter = GetEncounterTypeBySlotDPPt(Slot.Type, GrassType);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private static void MarkDPPtEncounterTypeSlots_MultipleTypes(ref EncounterArea[] Areas, int Location, int[] SpecialEncounterFiles, EncounterType NormalEncounterType)
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
var numfile = 0;
|
|
|
|
|
foreach (EncounterArea Area in Areas.Where(x => x.Location == Location))
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
numfile++;
|
|
|
|
|
var GrassType = SpecialEncounterFiles.Contains(numfile) ? EncounterType.TallGrass : NormalEncounterType;
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
|
|
|
|
Slot.TypeEncounter = GetEncounterTypeBySlotDPPt(Slot.Type, GrassType);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
private static void MarkHGSSEncounterTypeSlots_MultipleTypes(ref EncounterArea[] Areas, int Location, int SpecialEncounterFile, EncounterType NormalEncounterType)
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
// Area with two different encounter type for grass encounters
|
|
|
|
|
// SpecialEncounterFile is taall grass encounter type, the other files have the normal encounter type for this location
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var HeadbuttType = GetHeadbuttEncounterType(Location);
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
var numfile = 0;
|
|
|
|
|
foreach (EncounterArea Area in Areas.Where(x => x.Location == Location))
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
numfile++;
|
|
|
|
|
var GrassType = numfile == SpecialEncounterFile ? EncounterType.TallGrass : NormalEncounterType;
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
Slot.TypeEncounter = GetEncounterTypeBySlotHGSS(Slot.Type, GrassType, HeadbuttType);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private static void MarkHGSSEncounterTypeSlots_MultipleTypes(ref EncounterArea[] Areas, int Location, int[] SpecialEncounterFiles, EncounterType NormalEncounterType)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var HeadbuttType = GetHeadbuttEncounterType(Location);
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
var numfile = 0;
|
|
|
|
|
foreach (EncounterArea Area in Areas.Where(x => x.Location == Location))
|
|
|
|
|
{
|
|
|
|
|
numfile++;
|
|
|
|
|
var GrassType = SpecialEncounterFiles.Contains(numfile) ? EncounterType.TallGrass : NormalEncounterType;
|
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
|
|
|
|
Slot.TypeEncounter = GetEncounterTypeBySlotHGSS(Slot.Type, GrassType, HeadbuttType);
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private static void MarkDPPtEncounterTypeSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
foreach(EncounterArea Area in Areas)
|
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
if (DPPt_MixInteriorExteriorLocations.Contains(Area.Location))
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
continue;
|
|
|
|
|
var GrassType = (Area.Location == 70) ? EncounterType.Building_EnigmaStone :// Old Chateau
|
|
|
|
|
DPPt_CaveLocations.Contains(Area.Location) ? EncounterType.Cave_HallOfOrigin :
|
|
|
|
|
EncounterType.TallGrass;
|
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
|
|
|
|
Slot.TypeEncounter = GetEncounterTypeBySlotDPPt(Slot.Type, GrassType);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EncounterType GetHeadbuttEncounterType(int Location)
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
{
|
|
|
|
|
// Routes with trees adjacent to water tiles
|
|
|
|
|
var allowsurf= HGSS_SurfingHeadbutt_Locations.Contains(Location);
|
|
|
|
|
// Cities
|
|
|
|
|
if (HGSS_CityLocations.Contains(Location))
|
|
|
|
|
return allowsurf ? EncounterType.Headbutt_CitySurf : EncounterType.Building_EnigmaStone;
|
|
|
|
|
// Caves with no exterior zones
|
|
|
|
|
if (!HGSS_MixInteriorExteriorLocations.Contains(Location) && HGSS_CaveLocations.Contains(Location))
|
|
|
|
|
return allowsurf ? EncounterType.Headbutt_CaveSurf : EncounterType.Cave_HallOfOrigin;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
// Routes and exterior areas
|
|
|
|
|
// Routes with trees adjacent to grass tiles
|
|
|
|
|
var allowgrass = HGSS_GrassHeadbutt_Locations.Contains(Location);
|
|
|
|
|
return allowgrass && allowsurf ? EncounterType.Headbutt_GrassSurf :
|
|
|
|
|
allowgrass ? EncounterType.Headbutt_Grass :
|
|
|
|
|
allowsurf ? EncounterType.Headbutt_Surf :
|
|
|
|
|
EncounterType.None;
|
|
|
|
|
}
|
|
|
|
|
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
private static void MarkHGSSEncounterTypeSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterArea Area in Areas)
|
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
if (HGSS_MixInteriorExteriorLocations.Contains(Area.Location))
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
continue;
|
|
|
|
|
var GrassType = HGSS_CaveLocations.Contains(Area.Location) ? EncounterType.Cave_HallOfOrigin: EncounterType.TallGrass;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var HeadbuttType = GetHeadbuttEncounterType(Area.Location);
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
foreach (EncounterSlot Slot in Area.Slots)
|
|
|
|
|
{
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
Slot.TypeEncounter = GetEncounterTypeBySlotHGSS(Slot.Type, GrassType, HeadbuttType);
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-22 00:57:23 +00:00
|
|
|
|
private static void MarkBWSwarmSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
2017-03-22 01:14:16 +00:00
|
|
|
|
foreach (EncounterSlot s in Areas.SelectMany(area => area.Slots))
|
2017-03-22 00:57:23 +00:00
|
|
|
|
{
|
2017-03-22 01:14:16 +00:00
|
|
|
|
s.LevelMin = 15; s.LevelMax = 55; s.Type = SlotType.Swarm;
|
2017-03-22 00:57:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
private static void MarkB2W2SwarmSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
2017-03-22 01:14:16 +00:00
|
|
|
|
foreach (EncounterSlot s in Areas.SelectMany(area => area.Slots))
|
2017-03-22 00:57:23 +00:00
|
|
|
|
{
|
2017-03-22 01:14:16 +00:00
|
|
|
|
s.LevelMin = 40; s.LevelMax = 55; s.Type = SlotType.Swarm;
|
2017-03-22 00:57:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-22 06:22:22 +00:00
|
|
|
|
private static void MarkG5HiddenGrottoSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterSlot s in Areas[0].Slots) //Only 1 area
|
|
|
|
|
s.Type = SlotType.HiddenGrotto;
|
|
|
|
|
}
|
2017-03-24 04:26:57 +00:00
|
|
|
|
private static void MarkG5DreamWorld(ref EncounterStatic[] t)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterStatic s in t)
|
2017-03-24 05:31:49 +00:00
|
|
|
|
{
|
2017-03-30 06:31:02 +00:00
|
|
|
|
s.Location = 75; //Entree Forest
|
2017-06-18 01:37:19 +00:00
|
|
|
|
s.Ability = PersonalTable.B2W2.GetAbilities(s.Species, s.Form)[2] == 0 ? 1 : 4; // Check if has HA
|
2017-03-24 05:31:49 +00:00
|
|
|
|
}
|
2017-05-11 02:00:56 +00:00
|
|
|
|
|
|
|
|
|
// Split encounters with multiple permitted special moves -- a pkm can only be obtained with 1 of the special moves!
|
|
|
|
|
var list = new List<EncounterStatic>();
|
|
|
|
|
foreach (EncounterStatic s in t)
|
|
|
|
|
{
|
|
|
|
|
if (s.Moves == null || s.Moves.Length <= 1) // no special moves
|
|
|
|
|
{
|
|
|
|
|
list.Add(s);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var loc = s.Location;
|
|
|
|
|
for (int i = 0; i < s.Moves.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
var clone = s.Clone(loc);
|
|
|
|
|
clone.Moves = new[] {s.Moves[i]};
|
|
|
|
|
list.Add(clone);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
t = list.ToArray();
|
2017-03-24 04:26:57 +00:00
|
|
|
|
}
|
2017-03-19 07:00:15 +00:00
|
|
|
|
private static void MarkG5Slots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
foreach (var area in Areas)
|
|
|
|
|
{
|
|
|
|
|
int ctr = 0;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < 12; i++)
|
|
|
|
|
area.Slots[ctr++].Type = SlotType.Grass; // Single
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 12; i++)
|
|
|
|
|
area.Slots[ctr++].Type = SlotType.Grass; // Double
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 12; i++)
|
|
|
|
|
area.Slots[ctr++].Type = SlotType.Grass; // Shaking
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 5; i++) // 5
|
|
|
|
|
area.Slots[ctr++].Type = SlotType.Surf; // Surf
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 5; i++) // 5
|
|
|
|
|
area.Slots[ctr++].Type = SlotType.Surf; // Surf Spot
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 5; i++) // 5
|
|
|
|
|
area.Slots[ctr++].Type = SlotType.Super_Rod; // Fish
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 5; i++) // 5
|
|
|
|
|
area.Slots[ctr++].Type = SlotType.Super_Rod; // Fish Spot
|
|
|
|
|
} while (ctr != area.Slots.Length);
|
|
|
|
|
area.Slots = area.Slots.Where(slot => slot.Species != 0).ToArray();
|
|
|
|
|
}
|
2017-03-21 07:20:51 +00:00
|
|
|
|
ReduceAreasSize(ref Areas);
|
2017-03-19 07:00:15 +00:00
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
private static void MarkG6XYSlots(ref EncounterArea[] Areas)
|
2016-02-25 00:36:26 +00:00
|
|
|
|
{
|
2016-10-24 05:03:19 +00:00
|
|
|
|
foreach (var area in Areas)
|
2016-03-23 02:47:13 +00:00
|
|
|
|
{
|
|
|
|
|
int slotct = area.Slots.Length;
|
|
|
|
|
for (int i = slotct - 15; i < slotct; i++)
|
|
|
|
|
area.Slots[i].Type = SlotType.Horde;
|
|
|
|
|
}
|
2017-03-21 07:20:51 +00:00
|
|
|
|
ReduceAreasSize(ref Areas);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
|
|
|
|
private static void MarkG6AOSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
foreach (var area in Areas)
|
2016-03-23 02:47:13 +00:00
|
|
|
|
{
|
|
|
|
|
for (int i = 32; i < 37; i++)
|
|
|
|
|
area.Slots[i].Type = SlotType.Rock_Smash;
|
|
|
|
|
int slotct = area.Slots.Length;
|
|
|
|
|
for (int i = slotct - 15; i < slotct; i++)
|
|
|
|
|
area.Slots[i].Type = SlotType.Horde;
|
2016-04-21 02:47:40 +00:00
|
|
|
|
|
|
|
|
|
for (int i = 0; i < slotct; i++)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
area.Slots[i].Permissions.AllowDexNav = area.Slots[i].Type != SlotType.Rock_Smash;
|
2016-03-23 02:47:13 +00:00
|
|
|
|
}
|
2017-03-21 07:20:51 +00:00
|
|
|
|
ReduceAreasSize(ref Areas);
|
|
|
|
|
}
|
|
|
|
|
private static void MarkG7REGSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
ReduceAreasSize(ref Areas);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
2016-11-23 01:37:18 +00:00
|
|
|
|
private static void MarkG7SMSlots(ref EncounterArea[] Areas)
|
|
|
|
|
{
|
|
|
|
|
foreach (EncounterSlot s in Areas.SelectMany(area => area.Slots))
|
|
|
|
|
s.Type = SlotType.SOS;
|
2017-03-21 07:20:51 +00:00
|
|
|
|
ReduceAreasSize(ref Areas);
|
2016-11-23 01:37:18 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EncounterArea[] GetTables1()
|
2017-03-18 23:50:34 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var red_gw = EncounterArea.GetArray1_GW(Util.GetBinaryResource("encounter_red.pkl"));
|
|
|
|
|
var blu_gw = EncounterArea.GetArray1_GW(Util.GetBinaryResource("encounter_blue.pkl"));
|
|
|
|
|
var ylw_gw = EncounterArea.GetArray1_GW(Util.GetBinaryResource("encounter_yellow.pkl"));
|
|
|
|
|
var rb_fish = EncounterArea.GetArray1_F(Util.GetBinaryResource("encounter_rb_f.pkl"));
|
|
|
|
|
var ylw_fish = EncounterArea.GetArray1_FY(Util.GetBinaryResource("encounter_yellow_f.pkl"));
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var table = AddExtraTableSlots(red_gw, blu_gw, ylw_gw, rb_fish, ylw_fish);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
Array.Resize(ref table, table.Length + 1);
|
|
|
|
|
table[table.Length - 1] = FishOldGood_RBY;
|
|
|
|
|
|
|
|
|
|
return table;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EncounterArea[] GetTables2(GameVersion Version)
|
2017-03-18 23:50:34 +00:00
|
|
|
|
{
|
2017-03-21 00:50:35 +00:00
|
|
|
|
EncounterArea[] Slots = null;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
// Fishing
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var f = EncounterArea.GetArray2_F(Util.GetBinaryResource("encounter_gsc_f.pkl"));
|
2017-03-22 03:17:21 +00:00
|
|
|
|
if (Version == GameVersion.GS || Version == GameVersion.GSC)
|
2017-03-21 00:50:35 +00:00
|
|
|
|
{
|
|
|
|
|
// Grass/Water
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var g = EncounterArea.GetArray2_GW(Util.GetBinaryResource("encounter_gold.pkl"));
|
|
|
|
|
var s = EncounterArea.GetArray2_GW(Util.GetBinaryResource("encounter_silver.pkl"));
|
2017-03-21 00:50:35 +00:00
|
|
|
|
// Headbutt/Rock Smash
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var h_g = EncounterArea.GetArray2_H(Util.GetBinaryResource("encounter_gold_h.pkl"));
|
|
|
|
|
var h_s = EncounterArea.GetArray2_H(Util.GetBinaryResource("encounter_silver_h.pkl"));
|
2017-03-21 00:50:35 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Slots = AddExtraTableSlots(g, s, h_g, h_s, f, EncounterBCC_GSC);
|
2017-03-21 00:50:35 +00:00
|
|
|
|
}
|
|
|
|
|
if (Version == GameVersion.C || Version == GameVersion.GSC)
|
|
|
|
|
{
|
|
|
|
|
// Grass/Water
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var c = EncounterArea.GetArray2_GW(Util.GetBinaryResource("encounter_crystal.pkl"));
|
2017-03-21 00:50:35 +00:00
|
|
|
|
// Headbutt/Rock Smash
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var h_c = EncounterArea.GetArray2_H(Util.GetBinaryResource("encounter_crystal_h.pkl"));
|
2017-03-21 00:50:35 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var extra = AddExtraTableSlots(c, h_c, f, EncounterBCC_GSC);
|
|
|
|
|
return Version == GameVersion.C ? extra : AddExtraTableSlots(Slots, extra);
|
2017-03-21 00:50:35 +00:00
|
|
|
|
}
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-03-21 00:50:35 +00:00
|
|
|
|
return Slots;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
2017-03-21 00:50:35 +00:00
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
static Legal() // Setup
|
|
|
|
|
{
|
2017-02-11 23:20:44 +00:00
|
|
|
|
// Gen 1
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
StaticRBY = GetStaticEncounters(GameVersion.RBY);
|
|
|
|
|
SlotsRBY = GetTables1();
|
2017-03-21 07:20:51 +00:00
|
|
|
|
// Gen 1 is the only gen where ReduceAreasSize is not needed
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
MarkEncountersGeneration(ref SlotsRBY, 1);
|
|
|
|
|
MarkEncountersGeneration(ref StaticRBY, 1);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Evolves1 = new EvolutionTree(new[] { Util.GetBinaryResource("evos_rby.pkl") }, GameVersion.RBY, PersonalTable.Y, MaxSpeciesID_1);
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
FixPersonalTableY();
|
2017-02-11 23:20:44 +00:00
|
|
|
|
}
|
2017-02-25 20:37:01 +00:00
|
|
|
|
// Gen 2
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
StaticGS = GetStaticEncounters(GameVersion.GS);
|
|
|
|
|
StaticC = GetStaticEncounters(GameVersion.C);
|
|
|
|
|
StaticGSC = GetStaticEncounters(GameVersion.GSC);
|
|
|
|
|
SlotsGS = GetTables2(GameVersion.GS);
|
|
|
|
|
SlotsC = GetTables2(GameVersion.C);
|
|
|
|
|
SlotsGSC = GetTables2(GameVersion.GSC);
|
2017-03-21 07:20:51 +00:00
|
|
|
|
MarkG2Slots(ref SlotsGS);
|
|
|
|
|
MarkG2Slots(ref SlotsC);
|
|
|
|
|
MarkG2Slots(ref SlotsGSC);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
MarkEncountersGeneration(ref SlotsGS, 2);
|
|
|
|
|
MarkEncountersGeneration(ref SlotsC, 2);
|
|
|
|
|
MarkEncountersGeneration(ref SlotsGSC, 2);
|
|
|
|
|
MarkEncountersGeneration(ref StaticGS, 2);
|
|
|
|
|
MarkEncountersGeneration(ref StaticC, 2);
|
|
|
|
|
MarkEncountersGeneration(ref StaticGSC, 2);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Evolves2 = new EvolutionTree(new[] { Util.GetBinaryResource("evos_gsc.pkl") }, GameVersion.GSC, PersonalTable.C, MaxSpeciesID_2);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
// Gen3
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
StaticR = GetStaticEncounters(GameVersion.R);
|
|
|
|
|
StaticS = GetStaticEncounters(GameVersion.S);
|
|
|
|
|
StaticE = GetStaticEncounters(GameVersion.E);
|
|
|
|
|
StaticFR = GetStaticEncounters(GameVersion.FR);
|
|
|
|
|
StaticLG = GetStaticEncounters(GameVersion.LG);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var R_Slots = GetEncounterTables(GameVersion.R);
|
|
|
|
|
var S_Slots = GetEncounterTables(GameVersion.S);
|
|
|
|
|
var E_Slots = GetEncounterTables(GameVersion.E);
|
|
|
|
|
var FR_Slots = GetEncounterTables(GameVersion.FR);
|
|
|
|
|
var LG_Slots = GetEncounterTables(GameVersion.LG);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-03-19 12:42:59 +00:00
|
|
|
|
MarkG3Slots_RSE(ref R_Slots);
|
|
|
|
|
MarkG3Slots_RSE(ref S_Slots);
|
|
|
|
|
MarkG3Slots_RSE(ref E_Slots);
|
|
|
|
|
MarkG3Slots_FRLG(ref FR_Slots);
|
|
|
|
|
MarkG3Slots_FRLG(ref LG_Slots);
|
2017-03-26 20:46:05 +00:00
|
|
|
|
MarkG3SlotsSafariZones(ref R_Slots, 57);
|
|
|
|
|
MarkG3SlotsSafariZones(ref S_Slots, 57);
|
|
|
|
|
MarkG3SlotsSafariZones(ref E_Slots, 57);
|
|
|
|
|
MarkG3SlotsSafariZones(ref FR_Slots, 136);
|
|
|
|
|
MarkG3SlotsSafariZones(ref LG_Slots, 136);
|
2017-03-19 12:42:59 +00:00
|
|
|
|
|
2017-05-17 04:09:53 +00:00
|
|
|
|
MarkEncountersStaticMagnetPull(ref R_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref S_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref E_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref FR_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref LG_Slots, PersonalTable.SM);
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SlotsR = AddExtraTableSlots(R_Slots, SlotsRSEAlt);
|
|
|
|
|
SlotsS = AddExtraTableSlots(S_Slots, SlotsRSEAlt);
|
|
|
|
|
SlotsE = AddExtraTableSlots(E_Slots, SlotsRSEAlt);
|
|
|
|
|
SlotsFR = AddExtraTableSlots(FR_Slots, SlotsFRLGAlt);
|
|
|
|
|
SlotsLG = AddExtraTableSlots(LG_Slots, SlotsFRLGAlt);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Evolves3 = new EvolutionTree(new[] { Util.GetBinaryResource("evos_g3.pkl") }, GameVersion.RS, PersonalTable.RS, MaxSpeciesID_3);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
|
|
|
|
// Update Personal Entries with TM/Tutor Data
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var TMHM = Data.UnpackMini(Util.GetBinaryResource("hmtm_g3.pkl"), "g3");
|
2017-03-18 23:50:34 +00:00
|
|
|
|
for (int i = 0; i <= MaxSpeciesID_3; i++)
|
2017-03-20 22:50:23 +00:00
|
|
|
|
PersonalTable.E[i].AddTMHM(TMHM[i]);
|
2017-03-20 17:53:16 +00:00
|
|
|
|
// Tutors g3 contains tutor compatiblity data extracted from emerald,
|
|
|
|
|
// fire red and leaf green tutors data is a subset of emerald data
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var tutors = Data.UnpackMini(Util.GetBinaryResource("tutors_g3.pkl"), "g3");
|
2017-03-18 23:50:34 +00:00
|
|
|
|
for (int i = 0; i <= MaxSpeciesID_3; i++)
|
2017-03-20 17:53:16 +00:00
|
|
|
|
PersonalTable.E[i].AddTypeTutors(tutors[i]);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
// Gen 4
|
|
|
|
|
{
|
2017-03-25 17:13:02 +00:00
|
|
|
|
MarkG4PokeWalker(ref Encounter_PokeWalker);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
StaticD = GetStaticEncounters(GameVersion.D);
|
|
|
|
|
StaticP = GetStaticEncounters(GameVersion.P);
|
|
|
|
|
StaticPt = GetStaticEncounters(GameVersion.Pt);
|
|
|
|
|
StaticHG = GetStaticEncounters(GameVersion.HG);
|
|
|
|
|
StaticSS = GetStaticEncounters(GameVersion.SS);
|
|
|
|
|
|
|
|
|
|
var D_Slots = GetEncounterTables(GameVersion.D);
|
|
|
|
|
var P_Slots = GetEncounterTables(GameVersion.P);
|
|
|
|
|
var Pt_Slots = GetEncounterTables(GameVersion.Pt);
|
|
|
|
|
var HG_Slots = GetEncounterTables(GameVersion.HG);
|
|
|
|
|
var SS_Slots = GetEncounterTables(GameVersion.SS);
|
2017-05-17 04:09:53 +00:00
|
|
|
|
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref D_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref P_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref Pt_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref HG_Slots, PersonalTable.SM);
|
|
|
|
|
MarkEncountersStaticMagnetPull(ref SS_Slots, PersonalTable.SM);
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var DP_Trophy = EncounterArea.GetTrophyArea(TrophyDP, new[] {16, 18});
|
|
|
|
|
var Pt_Trophy = EncounterArea.GetTrophyArea(TrophyPt, new[] {22, 22});
|
|
|
|
|
var HG_Headbutt_Slots = EncounterArea.GetArray4HGSS_Headbutt(Data.UnpackMini(Util.GetBinaryResource("encunters_hb_hg.pkl"), "hg"));
|
|
|
|
|
var SS_Headbutt_Slots = EncounterArea.GetArray4HGSS_Headbutt(Data.UnpackMini(Util.GetBinaryResource("encunters_hb_ss.pkl"), "ss"));
|
2017-03-19 13:38:30 +00:00
|
|
|
|
|
2017-03-19 15:44:36 +00:00
|
|
|
|
var D_HoneyTrees_Slots = SlotsD_HoneyTree.Clone(HoneyTreesLocation);
|
|
|
|
|
var P_HoneyTrees_Slots = SlotsP_HoneyTree.Clone(HoneyTreesLocation);
|
|
|
|
|
var Pt_HoneyTrees_Slots = SlotsPt_HoneyTree.Clone(HoneyTreesLocation);
|
2017-04-07 04:18:02 +00:00
|
|
|
|
|
2017-03-20 14:49:05 +00:00
|
|
|
|
MarkG4SwarmSlots(ref HG_Slots, SlotsHG_Swarm);
|
|
|
|
|
MarkG4SwarmSlots(ref SS_Slots, SlotsSS_Swarm);
|
|
|
|
|
|
2017-03-21 07:20:51 +00:00
|
|
|
|
MarkG4AltFormSlots(ref D_Slots, 422, 1, Shellos_EastSeaLocation_DP);
|
|
|
|
|
MarkG4AltFormSlots(ref D_Slots, 423, 1, Gastrodon_EastSeaLocation_DP);
|
|
|
|
|
MarkG4AltFormSlots(ref P_Slots, 422, 1, Shellos_EastSeaLocation_DP);
|
|
|
|
|
MarkG4AltFormSlots(ref P_Slots, 423, 1, Gastrodon_EastSeaLocation_DP);
|
|
|
|
|
MarkG4AltFormSlots(ref Pt_Slots, 422, 1, Shellos_EastSeaLocation_Pt);
|
|
|
|
|
MarkG4AltFormSlots(ref Pt_Slots, 423, 1, Gastrodon_EastSeaLocation_Pt);
|
|
|
|
|
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
// Route 209
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref D_Slots, 24, 1, EncounterType.Building_EnigmaStone);
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref P_Slots, 24, 1, EncounterType.Building_EnigmaStone);
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref Pt_Slots, 24, 1, EncounterType.Building_EnigmaStone);
|
|
|
|
|
|
|
|
|
|
// Stark Mountain
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref D_Slots, 84, 1, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref P_Slots, 84, 1, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref Pt_Slots, 84, 1, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
// Mt Coronet
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref D_Slots, 50, DPPt_MtCoronetExteriorEncounters, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref P_Slots, 50, DPPt_MtCoronetExteriorEncounters, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
MarkDPPtEncounterTypeSlots_MultipleTypes(ref Pt_Slots, 50, DPPt_MtCoronetExteriorEncounters, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
|
|
|
|
|
// Ruins of Alph
|
|
|
|
|
MarkHGSSEncounterTypeSlots_MultipleTypes(ref HG_Slots, 209, 1, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
MarkHGSSEncounterTypeSlots_MultipleTypes(ref SS_Slots, 209, 1, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
// Mt Silver Cave
|
|
|
|
|
MarkHGSSEncounterTypeSlots_MultipleTypes(ref HG_Slots, 219, HGSS_MtSilverCaveExteriorEncounters, EncounterType.Cave_HallOfOrigin);
|
|
|
|
|
MarkHGSSEncounterTypeSlots_MultipleTypes(ref SS_Slots, 219, HGSS_MtSilverCaveExteriorEncounters, EncounterType.Cave_HallOfOrigin);
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
|
2017-03-19 13:38:30 +00:00
|
|
|
|
MarkG4Slots(ref D_Slots);
|
|
|
|
|
MarkG4Slots(ref P_Slots);
|
|
|
|
|
MarkG4Slots(ref Pt_Slots);
|
|
|
|
|
MarkG4Slots(ref HG_Slots);
|
|
|
|
|
MarkG4Slots(ref SS_Slots);
|
2017-03-19 15:23:46 +00:00
|
|
|
|
MarkG4Slots(ref HG_Headbutt_Slots);
|
|
|
|
|
MarkG4Slots(ref SS_Headbutt_Slots);
|
2017-03-19 13:38:30 +00:00
|
|
|
|
|
2017-03-26 20:46:05 +00:00
|
|
|
|
MarkG4SlotsGreatMarsh(ref D_Slots, 52);
|
|
|
|
|
MarkG4SlotsGreatMarsh(ref P_Slots, 52);
|
|
|
|
|
MarkG4SlotsGreatMarsh(ref Pt_Slots, 52);
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SlotsD = AddExtraTableSlots(D_Slots, D_HoneyTrees_Slots, DP_GreatMarshAlt, SlotsDPPPtAlt, DP_Trophy);
|
|
|
|
|
SlotsP = AddExtraTableSlots(P_Slots, P_HoneyTrees_Slots, DP_GreatMarshAlt, SlotsDPPPtAlt, DP_Trophy);
|
|
|
|
|
SlotsPt = AddExtraTableSlots(Pt_Slots, Pt_HoneyTrees_Slots, Pt_GreatMarshAlt, SlotsDPPPtAlt, Pt_Trophy);
|
|
|
|
|
SlotsHG = AddExtraTableSlots(HG_Slots, HG_Headbutt_Slots, SlotsHGSSAlt);
|
|
|
|
|
SlotsSS = AddExtraTableSlots(SS_Slots, SS_Headbutt_Slots, SlotsHGSSAlt);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-04-24 17:42:27 +00:00
|
|
|
|
MarkDPPtEncounterTypeSlots(ref SlotsD);
|
|
|
|
|
MarkDPPtEncounterTypeSlots(ref SlotsP);
|
|
|
|
|
MarkDPPtEncounterTypeSlots(ref SlotsPt);
|
|
|
|
|
MarkHGSSEncounterTypeSlots(ref SlotsHG);
|
|
|
|
|
MarkHGSSEncounterTypeSlots(ref SlotsSS);
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Evolves4 = new EvolutionTree(new[] { Util.GetBinaryResource("evos_g4.pkl") }, GameVersion.DP, PersonalTable.DP, MaxSpeciesID_4);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
|
|
|
|
// Update Personal Entries with Tutor Data
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var tutors = Data.UnpackMini(Util.GetBinaryResource("tutors_g4.pkl"), "g4");
|
2017-03-18 23:50:34 +00:00
|
|
|
|
for (int i = 0; i <= MaxSpeciesID_4; i++)
|
|
|
|
|
PersonalTable.HGSS[i].AddTypeTutors(tutors[i]);
|
|
|
|
|
}
|
|
|
|
|
// Gen 5
|
|
|
|
|
{
|
2017-03-24 04:26:57 +00:00
|
|
|
|
MarkG5DreamWorld(ref BW_DreamWorld);
|
|
|
|
|
MarkG5DreamWorld(ref B2W2_DreamWorld);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
StaticB = GetStaticEncounters(GameVersion.B);
|
|
|
|
|
StaticW = GetStaticEncounters(GameVersion.W);
|
|
|
|
|
StaticB2 = GetStaticEncounters(GameVersion.B2);
|
|
|
|
|
StaticW2 = GetStaticEncounters(GameVersion.W2);
|
2017-02-26 17:36:53 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var BSlots = GetEncounterTables(GameVersion.B);
|
|
|
|
|
var WSlots = GetEncounterTables(GameVersion.W);
|
2017-03-22 00:57:23 +00:00
|
|
|
|
MarkG5Slots(ref BSlots);
|
|
|
|
|
MarkG5Slots(ref WSlots);
|
|
|
|
|
MarkBWSwarmSlots(ref SlotsB_Swarm);
|
|
|
|
|
MarkBWSwarmSlots(ref SlotsW_Swarm);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SlotsB = AddExtraTableSlots(BSlots, SlotsB_Swarm);
|
|
|
|
|
SlotsW = AddExtraTableSlots(WSlots, SlotsW_Swarm, WhiteForestSlot);
|
2017-03-22 00:57:23 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var B2Slots = GetEncounterTables(GameVersion.B2);
|
|
|
|
|
var W2Slots = GetEncounterTables(GameVersion.W2);
|
2017-03-22 00:57:23 +00:00
|
|
|
|
MarkG5Slots(ref B2Slots);
|
|
|
|
|
MarkG5Slots(ref W2Slots);
|
|
|
|
|
MarkB2W2SwarmSlots(ref SlotsB2_Swarm);
|
|
|
|
|
MarkB2W2SwarmSlots(ref SlotsW2_Swarm);
|
2017-03-22 06:22:22 +00:00
|
|
|
|
MarkG5HiddenGrottoSlots(ref SlotsB2_HiddenGrotto);
|
|
|
|
|
MarkG5HiddenGrottoSlots(ref SlotsW2_HiddenGrotto);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SlotsB2 = AddExtraTableSlots(B2Slots, SlotsB2_Swarm, SlotsB2_HiddenGrotto);
|
|
|
|
|
SlotsW2 = AddExtraTableSlots(W2Slots, SlotsW2_Swarm, SlotsW2_HiddenGrotto);
|
2017-03-03 02:24:50 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Evolves5 = new EvolutionTree(new[] { Util.GetBinaryResource("evos_g5.pkl") }, GameVersion.BW, PersonalTable.BW, MaxSpeciesID_5);
|
2017-02-25 20:37:01 +00:00
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
// Gen 6
|
2016-03-23 02:47:13 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
StaticX = GetStaticEncounters(GameVersion.X);
|
|
|
|
|
StaticY = GetStaticEncounters(GameVersion.Y);
|
|
|
|
|
StaticA = GetStaticEncounters(GameVersion.AS);
|
|
|
|
|
StaticO = GetStaticEncounters(GameVersion.OR);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var XSlots = GetEncounterTables(GameVersion.X);
|
|
|
|
|
var YSlots = GetEncounterTables(GameVersion.Y);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
MarkG6XYSlots(ref XSlots);
|
|
|
|
|
MarkG6XYSlots(ref YSlots);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SlotsX = AddExtraTableSlots(XSlots, SlotsXYAlt);
|
|
|
|
|
SlotsY = AddExtraTableSlots(YSlots, SlotsXYAlt);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SlotsA = GetEncounterTables(GameVersion.AS);
|
|
|
|
|
SlotsO = GetEncounterTables(GameVersion.OR);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
MarkG6AOSlots(ref SlotsA);
|
|
|
|
|
MarkG6AOSlots(ref SlotsO);
|
2016-11-15 02:25:08 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Evolves6 = new EvolutionTree(Data.UnpackMini(Util.GetBinaryResource("evos_ao.pkl"), "ao"), GameVersion.ORAS, PersonalTable.AO, MaxSpeciesID_6);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
|
|
|
|
// Gen 7
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
StaticSN = GetStaticEncounters(GameVersion.SN);
|
|
|
|
|
StaticMN = GetStaticEncounters(GameVersion.MN);
|
|
|
|
|
var REG_SN = GetEncounterTables(GameVersion.SN);
|
|
|
|
|
var REG_MN = GetEncounterTables(GameVersion.MN);
|
|
|
|
|
var SOS_SN = GetEncounterTables(Util.GetBinaryResource("encounter_sn_sos.pkl"), "sm");
|
|
|
|
|
var SOS_MN = GetEncounterTables(Util.GetBinaryResource("encounter_mn_sos.pkl"), "sm");
|
2017-03-21 07:20:51 +00:00
|
|
|
|
MarkG7REGSlots(ref REG_SN);
|
|
|
|
|
MarkG7REGSlots(ref REG_MN);
|
2016-11-23 01:37:18 +00:00
|
|
|
|
MarkG7SMSlots(ref SOS_SN);
|
|
|
|
|
MarkG7SMSlots(ref SOS_MN);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
SlotsSN = AddExtraTableSlots(REG_SN, SOS_SN, Encounter_Pelago_SM, Encounter_Pelago_SN);
|
|
|
|
|
SlotsMN = AddExtraTableSlots(REG_MN, SOS_MN, Encounter_Pelago_SM, Encounter_Pelago_MN);
|
2016-11-15 02:25:08 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Evolves7 = new EvolutionTree(Data.UnpackMini(Util.GetBinaryResource("evos_sm.pkl"), "sm"), GameVersion.SM, PersonalTable.SM, MaxSpeciesID_7);
|
2016-04-21 02:47:40 +00:00
|
|
|
|
}
|
2016-02-26 15:52:08 +00:00
|
|
|
|
}
|
2016-03-23 02:47:13 +00:00
|
|
|
|
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
private static void FixPersonalTableY()
|
|
|
|
|
{
|
|
|
|
|
// Personal Table from Yellow do not have yellow catch rate for Pikachu and Kadabra, have RedBlue instead
|
|
|
|
|
PersonalTable.Y[25].CatchRate = 163; // Pikachu
|
|
|
|
|
PersonalTable.Y[64].CatchRate = 96; // Kadabra
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
// Moves
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int[] GetMinLevelLearnMove(int species, int Generation, List<int> moves)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
|
|
|
|
var r = new int[moves.Count];
|
|
|
|
|
switch (Generation)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.RB.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
|
|
|
|
|
var pi_rb = (PersonalInfoG1)PersonalTable.RB[index];
|
|
|
|
|
var pi_y = (PersonalInfoG1)PersonalTable.Y[index];
|
|
|
|
|
|
|
|
|
|
for (int m = 0; m < moves.Count; m++)
|
|
|
|
|
{
|
|
|
|
|
if (pi_rb.Moves.Contains(moves[m]) || pi_y.Moves.Contains(moves[m]))
|
|
|
|
|
r[m] = 1;
|
|
|
|
|
else
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var rb_level = LevelUpRB[index].GetLevelLearnMove(moves[m]);
|
|
|
|
|
var y_level = LevelUpY[index].GetLevelLearnMove(moves[m]);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
// 0 means it is not learned in that game, select the other game
|
|
|
|
|
r[m] = rb_level == 0 ? y_level :
|
|
|
|
|
y_level == 0 ? rb_level :
|
|
|
|
|
Math.Min(rb_level, y_level);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return r;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int[] GetMaxLevelLearnMove(int species, int Generation, List<int> moves)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
|
|
|
|
var r = new int[moves.Count];
|
|
|
|
|
switch (Generation)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.RB.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
|
|
|
|
|
var pi_rb = (PersonalInfoG1)PersonalTable.RB[index];
|
|
|
|
|
var pi_y = (PersonalInfoG1)PersonalTable.Y[index];
|
|
|
|
|
|
|
|
|
|
for (int m = 0; m < moves.Count; m++)
|
|
|
|
|
{
|
|
|
|
|
if (pi_rb.Moves.Contains(moves[m]) && pi_y.Moves.Contains(moves[m]))
|
|
|
|
|
r[m] = 1;
|
|
|
|
|
else
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r[m] = Math.Max(LevelUpRB[index].GetLevelLearnMove(moves[m]), LevelUpY[index].GetLevelLearnMove(moves[m]));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return r;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static List<int>[] GetExclusiveMoves(int species1, int species2, int Generation, IEnumerable<int> tmhm, IEnumerable<int> moves)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
|
|
|
|
// Return from two species the exclusive moves that only one could learn and also the current pokemon have it in its current moveset
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var moves1 = GetLvlMoves(species1, 0, Generation, 1, 100).Distinct().ToList();
|
|
|
|
|
var moves2 = GetLvlMoves(species2, 0, Generation, 1, 100).Distinct().ToList();
|
|
|
|
|
|
|
|
|
|
// Remove common moves and remove tmhm, remove not learned moves
|
|
|
|
|
var common = new HashSet<int>(moves1.Intersect(moves2).Concat(tmhm));
|
|
|
|
|
var hashMoves = new HashSet<int>(moves);
|
|
|
|
|
moves1.RemoveAll(x => !hashMoves.Contains(x) || common.Contains(x));
|
|
|
|
|
moves2.RemoveAll(x => !hashMoves.Contains(x) || common.Contains(x));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
return new[] { moves1, moves2 };
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static IEnumerable<int> GetLvlMoves(int species, int form, int Generation, int minlvl, int lvl, GameVersion Version = GameVersion.Any)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
|
|
|
|
var r = new List<int>();
|
|
|
|
|
var ver = Version;
|
|
|
|
|
switch (Generation)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.RB.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
|
|
|
|
|
var pi_rb = (PersonalInfoG1)PersonalTable.RB[index];
|
|
|
|
|
var pi_y = (PersonalInfoG1)PersonalTable.Y[index];
|
|
|
|
|
if (minlvl == 1)
|
|
|
|
|
{
|
|
|
|
|
r.AddRange(pi_rb.Moves);
|
|
|
|
|
r.AddRange(pi_y.Moves);
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpRB[index].GetMoves(lvl, minlvl));
|
|
|
|
|
r.AddRange(LevelUpY[index].GetMoves(lvl, minlvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 2:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.C.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpGS[index].GetMoves(lvl));
|
2017-06-07 04:59:29 +00:00
|
|
|
|
if (AllowGen2Crystal)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpC[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 3:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.E.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
if (index == 386)
|
|
|
|
|
{
|
|
|
|
|
switch (form)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
case 0: r.AddRange(LevelUpRS[index].GetMoves(lvl)); break;
|
|
|
|
|
case 1: r.AddRange(LevelUpFR[index].GetMoves(lvl)); break;
|
|
|
|
|
case 2: r.AddRange(LevelUpLG[index].GetMoves(lvl)); break;
|
|
|
|
|
case 3: r.AddRange(LevelUpE[index].GetMoves(lvl)); break;
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Emerald level up table are equals to R/S level up tables
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpE[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
// fire red and leaf green are equals between each other but different than RSE
|
|
|
|
|
// Do not use FR Levelup table. It have 67 moves for charmander but Leaf Green moves table is correct
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpLG[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.HGSS.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpDP[index].GetMoves(lvl));
|
|
|
|
|
r.AddRange(LevelUpPt[index].GetMoves(lvl));
|
|
|
|
|
r.AddRange(LevelUpHGSS[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.B2W2.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpBW[index].GetMoves(lvl));
|
|
|
|
|
r.AddRange(LevelUpB2W2[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
switch (ver)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.Any: // Start at the top, hit every table
|
|
|
|
|
case GameVersion.X:
|
|
|
|
|
case GameVersion.Y:
|
|
|
|
|
case GameVersion.XY:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.XY.GetFormeIndex(species, form);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpXY[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (ver == GameVersion.Any) // Fall Through
|
|
|
|
|
goto case GameVersion.ORAS;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case GameVersion.AS:
|
|
|
|
|
case GameVersion.OR:
|
|
|
|
|
case GameVersion.ORAS:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.AO.GetFormeIndex(species, form);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpAO[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
switch (ver)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.Any:
|
|
|
|
|
case GameVersion.SN:
|
|
|
|
|
case GameVersion.MN:
|
|
|
|
|
case GameVersion.SM:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.SM.GetFormeIndex(species, form);
|
|
|
|
|
r.AddRange(LevelUpSM[index].GetMoves(lvl));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
|
return r;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static List<int>[] GetValidMovesAllGens(PKM pkm, DexLevel[][] evoChains, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = true, bool Tutor = true, bool Machine = true, bool MoveReminder = true, bool RemoveTransferHM = true)
|
2017-03-25 12:27:42 +00:00
|
|
|
|
{
|
2017-03-25 20:53:33 +00:00
|
|
|
|
List<int>[] Moves = new List<int>[evoChains.Length];
|
2017-03-25 12:27:42 +00:00
|
|
|
|
for (int i = 1; i < evoChains.Length; i++)
|
2017-03-25 17:19:38 +00:00
|
|
|
|
if (evoChains[i].Any())
|
2017-06-18 01:37:19 +00:00
|
|
|
|
Moves[i] = GetValidMoves(pkm, evoChains[i], i, minLvLG1, minLvLG2, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM).ToList();
|
2017-03-26 05:23:54 +00:00
|
|
|
|
else
|
|
|
|
|
Moves[i] = new List<int>();
|
2017-03-25 12:27:42 +00:00
|
|
|
|
return Moves;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetValidMoves(PKM pkm, DexLevel[][] evoChains, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = true, bool Tutor = true, bool Machine = true, bool MoveReminder = true, bool RemoveTransferHM = true)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
2016-11-09 06:10:32 +00:00
|
|
|
|
GameVersion version = (GameVersion)pkm.Version;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
if (!pkm.IsUntraded)
|
2016-11-09 06:10:32 +00:00
|
|
|
|
version = GameVersion.Any;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetValidMoves(pkm, version, evoChains, minLvLG1: minLvLG1, minLvLG2: minLvLG2, LVL: LVL, Relearn: false, Tutor: Tutor, Machine: Machine, MoveReminder: MoveReminder, RemoveTransferHM: RemoveTransferHM);
|
2017-02-15 22:33:59 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetValidMoves(PKM pkm, DexLevel[] evoChain, int generation, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = true, bool Tutor = true, bool Machine = true, bool MoveReminder = true, bool RemoveTransferHM = true)
|
2017-02-15 22:33:59 +00:00
|
|
|
|
{
|
|
|
|
|
GameVersion version = (GameVersion)pkm.Version;
|
|
|
|
|
if (!pkm.IsUntraded)
|
|
|
|
|
version = GameVersion.Any;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetValidMoves(pkm, version, evoChain, generation, minLvLG1: minLvLG1, minLvLG2: minLvLG2, LVL: LVL, Relearn: false, Tutor: Tutor, Machine: Machine, MoveReminder: MoveReminder, RemoveTransferHM: RemoveTransferHM);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetValidRelearn(PKM pkm, int species, bool inheritlvlmoves)
|
2016-02-23 06:52:48 +00:00
|
|
|
|
{
|
2016-03-04 06:12:22 +00:00
|
|
|
|
List<int> r = new List<int> { 0 };
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (pkm.GenNumber < 6 || pkm.VC)
|
2017-02-12 17:52:26 +00:00
|
|
|
|
return r;
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetRelearnLVLMoves(pkm, species, 1, pkm.AltForm));
|
2016-11-12 06:13:40 +00:00
|
|
|
|
|
|
|
|
|
int form = pkm.AltForm;
|
|
|
|
|
if (pkm.Format == 6 && pkm.Species != 678)
|
|
|
|
|
form = 0;
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetEggMoves(pkm, species, form));
|
2017-06-07 03:10:05 +00:00
|
|
|
|
if (inheritlvlmoves)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetRelearnLVLMoves(pkm, species, 100, pkm.AltForm));
|
2016-03-12 17:16:41 +00:00
|
|
|
|
return r.Distinct();
|
2016-02-23 06:52:48 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static List<int>[] GetShedinjaEvolveMoves(PKM pkm, int lvl = -1, int generation = 0)
|
Shedinja evolution moves and some egg fixes (#1015)
* Add getMoves function with min level and max level, usefull for shedjina evolves moves (min level 20) and generation 1 moves ( no move reminder, min level is min encounter level + 1)
Also for gen1 encounters another function should be created to get by the encounter level the four moves that the pokemon learn by default, the last four in its movepool up until the encounter level
* getShedinjaEvolveMoves, function that return the moves that shedinja could learn from Ninjask move pool at the moment when Nincada evolves, in the same format that getValidMovesAllGens
* Add validation in parse moves for shedinja evolve moves.
Shedinja could have any gen3/4 moves from Ninjas learnset but only one is allowed
* Shedinja evolve moves text resources
* Fix egg moves pre-gen 6 validation:
Add skipoption variable to getEggMoves function from pre-gen6 games, to verify egg moves from split breed species
Flag illegal combinations of base egg moves and special egg moves
Return crystal egg moves for gen2 pokemon that can be tradeback to gen 1 games
* Fix for mix between event egg moves and base egg moves
* Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move
* Revert "Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move"
Revert the last change, i search in bulbapedia an there wasn't any nincada distributed with special moves in generation 3 nor 4, making this complicated validation unnecessary
This reverts commit 57f5ac1bbb75e32e417b575619339cae5e5d1ef2.
* Fix error
2017-04-01 00:40:30 +00:00
|
|
|
|
{
|
|
|
|
|
var size = pkm.Format > 3 ? 4 : 3;
|
|
|
|
|
List<int>[] r = new List<int>[size + 1];
|
|
|
|
|
for (int i = 1; i <= size; i++)
|
|
|
|
|
r[i] = new List<int>();
|
|
|
|
|
if (lvl == -1)
|
|
|
|
|
lvl = pkm.CurrentLevel;
|
|
|
|
|
if (pkm.Species != 292 || lvl < 20)
|
|
|
|
|
return r;
|
2017-04-01 01:35:43 +00:00
|
|
|
|
|
Shedinja evolution moves and some egg fixes (#1015)
* Add getMoves function with min level and max level, usefull for shedjina evolves moves (min level 20) and generation 1 moves ( no move reminder, min level is min encounter level + 1)
Also for gen1 encounters another function should be created to get by the encounter level the four moves that the pokemon learn by default, the last four in its movepool up until the encounter level
* getShedinjaEvolveMoves, function that return the moves that shedinja could learn from Ninjask move pool at the moment when Nincada evolves, in the same format that getValidMovesAllGens
* Add validation in parse moves for shedinja evolve moves.
Shedinja could have any gen3/4 moves from Ninjas learnset but only one is allowed
* Shedinja evolve moves text resources
* Fix egg moves pre-gen 6 validation:
Add skipoption variable to getEggMoves function from pre-gen6 games, to verify egg moves from split breed species
Flag illegal combinations of base egg moves and special egg moves
Return crystal egg moves for gen2 pokemon that can be tradeback to gen 1 games
* Fix for mix between event egg moves and base egg moves
* Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move
* Revert "Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move"
Revert the last change, i search in bulbapedia an there wasn't any nincada distributed with special moves in generation 3 nor 4, making this complicated validation unnecessary
This reverts commit 57f5ac1bbb75e32e417b575619339cae5e5d1ef2.
* Fix error
2017-04-01 00:40:30 +00:00
|
|
|
|
// If nincada evolves into Ninjask an learn in the evolution a move from ninjask learnset pool
|
|
|
|
|
// Shedinja would appear with that move learned. Only one move above level 20 allowed, only in generations 3 and 4
|
2017-04-01 01:35:43 +00:00
|
|
|
|
switch (generation)
|
Shedinja evolution moves and some egg fixes (#1015)
* Add getMoves function with min level and max level, usefull for shedjina evolves moves (min level 20) and generation 1 moves ( no move reminder, min level is min encounter level + 1)
Also for gen1 encounters another function should be created to get by the encounter level the four moves that the pokemon learn by default, the last four in its movepool up until the encounter level
* getShedinjaEvolveMoves, function that return the moves that shedinja could learn from Ninjask move pool at the moment when Nincada evolves, in the same format that getValidMovesAllGens
* Add validation in parse moves for shedinja evolve moves.
Shedinja could have any gen3/4 moves from Ninjas learnset but only one is allowed
* Shedinja evolve moves text resources
* Fix egg moves pre-gen 6 validation:
Add skipoption variable to getEggMoves function from pre-gen6 games, to verify egg moves from split breed species
Flag illegal combinations of base egg moves and special egg moves
Return crystal egg moves for gen2 pokemon that can be tradeback to gen 1 games
* Fix for mix between event egg moves and base egg moves
* Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move
* Revert "Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move"
Revert the last change, i search in bulbapedia an there wasn't any nincada distributed with special moves in generation 3 nor 4, making this complicated validation unnecessary
This reverts commit 57f5ac1bbb75e32e417b575619339cae5e5d1ef2.
* Fix error
2017-04-01 00:40:30 +00:00
|
|
|
|
{
|
2017-04-01 01:35:43 +00:00
|
|
|
|
case 0: // Default (both)
|
|
|
|
|
case 3: // Ninjask have the same learnset in every gen 3 games
|
|
|
|
|
if (pkm.InhabitedGeneration(3))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r[3] = LevelUpE[291].GetMoves(lvl, 20).ToList();
|
2017-04-01 01:35:43 +00:00
|
|
|
|
|
|
|
|
|
if (generation == 0)
|
|
|
|
|
goto case 4;
|
|
|
|
|
break;
|
|
|
|
|
case 4: // Ninjask have the same learnset in every gen 4 games
|
|
|
|
|
if (pkm.InhabitedGeneration(4))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r[4] = LevelUpPt[291].GetMoves(lvl, 20).ToList();
|
2017-04-01 01:35:43 +00:00
|
|
|
|
break;
|
Shedinja evolution moves and some egg fixes (#1015)
* Add getMoves function with min level and max level, usefull for shedjina evolves moves (min level 20) and generation 1 moves ( no move reminder, min level is min encounter level + 1)
Also for gen1 encounters another function should be created to get by the encounter level the four moves that the pokemon learn by default, the last four in its movepool up until the encounter level
* getShedinjaEvolveMoves, function that return the moves that shedinja could learn from Ninjask move pool at the moment when Nincada evolves, in the same format that getValidMovesAllGens
* Add validation in parse moves for shedinja evolve moves.
Shedinja could have any gen3/4 moves from Ninjas learnset but only one is allowed
* Shedinja evolve moves text resources
* Fix egg moves pre-gen 6 validation:
Add skipoption variable to getEggMoves function from pre-gen6 games, to verify egg moves from split breed species
Flag illegal combinations of base egg moves and special egg moves
Return crystal egg moves for gen2 pokemon that can be tradeback to gen 1 games
* Fix for mix between event egg moves and base egg moves
* Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move
* Revert "Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move"
Revert the last change, i search in bulbapedia an there wasn't any nincada distributed with special moves in generation 3 nor 4, making this complicated validation unnecessary
This reverts commit 57f5ac1bbb75e32e417b575619339cae5e5d1ef2.
* Fix error
2017-04-01 00:40:30 +00:00
|
|
|
|
}
|
|
|
|
|
return r;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int[] GetBaseEggMoves(PKM pkm, int species, GameVersion gameSource, int lvl)
|
2016-03-06 19:19:09 +00:00
|
|
|
|
{
|
2016-10-24 05:03:19 +00:00
|
|
|
|
if (gameSource == GameVersion.Any)
|
|
|
|
|
gameSource = (GameVersion) pkm.Version;
|
2016-03-22 02:53:02 +00:00
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
switch (gameSource)
|
2016-03-22 02:53:02 +00:00
|
|
|
|
{
|
2017-03-26 02:57:38 +00:00
|
|
|
|
case GameVersion.GS:
|
|
|
|
|
if (pkm.InhabitedGeneration(2))
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
if (pkm.Format == 1)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpGS[species].GetMoves(lvl).Where(m => m <= MaxMoveID_1).ToArray();
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
else
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpGS[species].GetMoves(lvl);
|
2017-03-26 02:57:38 +00:00
|
|
|
|
break;
|
|
|
|
|
case GameVersion.C:
|
|
|
|
|
if (pkm.InhabitedGeneration(2))
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
if (pkm.Format == 1)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpC[species].GetMoves(lvl).Where(m => m <= MaxMoveID_1).ToArray();
|
Special Eggs improvement and Generation 4 Encounter Type legal analysis (#1083)
* Ignore relearn level 2-100 moves from Phione
* Cave encounter types DPPt
* Generation 4 EncounterType filter and validation
Not every generation 4 static encounter have yet their encounter type defined, i temporally included Any to those encounters
Generation 4 roaaming static encounters have been splitted in two, grass and surf
* Added new legality texts
* Added unreleased event DP Darkai, added check for surf in jhoto route 45, is impossible
Moved unreleased DP locations to valid Platinum locations only
* Improved generation 3 special egg check.
Only check special egg if pokemon knows any of the special egg moves, also in that case do check for normal egg before special egg
because special eggs will explicitly check for normal egg moves but normal eggs will not check special egg moves, it will improve the error output
* Clean up
* Fix gen 5 pokemon from issue #1011
Those pokemon have generation 4 static gift encounters and also wild encounters, the analysis was selecting the static encounter, but if there is a valid wild encounter and the static encounter does not match the pokemon ball the willd encounter should be selected instead
Also move the transfer legality to check it before the static encounters and make that check to work like generation 3 transfer legality
* Another fix for Issue 1011, suppress temporally OT and pokemon name analysis for generations 3 to 5 instead of format 3 to 5, there is no data stored yet to make those analysis
* Do not make wild encounters prevail static encounter if the pokemon was an egg
* Changed type of WildEncounter variable to EncounterSlot[]
* Fix Jhoto Route 45 to avoid return error with fishing encounters
2017-04-22 18:49:49 +00:00
|
|
|
|
else
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpC[species].GetMoves(lvl);
|
2017-03-26 02:57:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case GameVersion.R:
|
|
|
|
|
case GameVersion.S:
|
|
|
|
|
case GameVersion.RS:
|
|
|
|
|
if (pkm.InhabitedGeneration(3))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpRS[species].GetMoves(lvl);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
case GameVersion.E:
|
|
|
|
|
if (pkm.InhabitedGeneration(3))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpE[species].GetMoves(lvl);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
case GameVersion.FR:
|
|
|
|
|
case GameVersion.LG:
|
|
|
|
|
case GameVersion.FRLG:
|
|
|
|
|
// only difference in FR/LG is deoxys which doesn't breed.
|
|
|
|
|
if (pkm.InhabitedGeneration(3))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpFR[species].GetMoves(lvl);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GameVersion.D:
|
|
|
|
|
case GameVersion.P:
|
|
|
|
|
case GameVersion.DP:
|
|
|
|
|
if (pkm.InhabitedGeneration(4))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpDP[species].GetMoves(lvl);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
case GameVersion.Pt:
|
|
|
|
|
if (pkm.InhabitedGeneration(4))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpPt[species].GetMoves(lvl);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
case GameVersion.HG:
|
|
|
|
|
case GameVersion.SS:
|
|
|
|
|
case GameVersion.HGSS:
|
|
|
|
|
if (pkm.InhabitedGeneration(4))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpHGSS[species].GetMoves(lvl);
|
2017-03-25 02:24:01 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GameVersion.B:
|
|
|
|
|
case GameVersion.W:
|
|
|
|
|
case GameVersion.BW:
|
|
|
|
|
if (pkm.InhabitedGeneration(5))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpBW[species].GetMoves(lvl);
|
2017-03-25 02:24:01 +00:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GameVersion.B2:
|
|
|
|
|
case GameVersion.W2:
|
|
|
|
|
case GameVersion.B2W2:
|
|
|
|
|
if (pkm.InhabitedGeneration(5))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpBW[species].GetMoves(lvl);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
case GameVersion.X:
|
|
|
|
|
case GameVersion.Y:
|
|
|
|
|
case GameVersion.XY:
|
|
|
|
|
if (pkm.InhabitedGeneration(6))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpXY[species].GetMoves(lvl);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
break;
|
2016-03-05 04:43:00 +00:00
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
case GameVersion.AS:
|
|
|
|
|
case GameVersion.OR:
|
|
|
|
|
case GameVersion.ORAS:
|
|
|
|
|
if (pkm.InhabitedGeneration(6))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpAO[species].GetMoves(lvl);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
break;
|
2016-03-22 02:53:02 +00:00
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
case GameVersion.SN:
|
|
|
|
|
case GameVersion.MN:
|
|
|
|
|
case GameVersion.SM:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.SM.GetFormeIndex(species, pkm.AltForm);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
if (pkm.InhabitedGeneration(7))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return LevelUpSM[index].GetMoves(lvl);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
break;
|
2016-03-22 02:53:02 +00:00
|
|
|
|
}
|
2017-04-15 19:24:30 +00:00
|
|
|
|
return new int[0];
|
2016-03-05 04:43:00 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static List<int> GetValidPostEvolutionMoves(PKM pkm, int Species, DexLevel[][] evoChains, GameVersion Version)
|
2017-04-23 12:54:52 +00:00
|
|
|
|
{
|
|
|
|
|
// Return moves that the pokemon could learn after evolving
|
|
|
|
|
var moves = new List<int>();
|
|
|
|
|
for (int i = 1; i < evoChains.Length; i++)
|
|
|
|
|
if (evoChains[i].Any())
|
2017-06-18 01:37:19 +00:00
|
|
|
|
moves.AddRange(GetValidPostEvolutionMoves(pkm, Species, evoChains[i], i, Version));
|
2017-04-23 12:54:52 +00:00
|
|
|
|
if (pkm.GenNumber >= 6)
|
|
|
|
|
moves.AddRange(pkm.RelearnMoves.Where(m => m != 0));
|
|
|
|
|
return moves.Distinct().ToList();
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static IEnumerable<int> GetValidPostEvolutionMoves(PKM pkm, int Species, DexLevel[] evoChain, int Generation, GameVersion Version)
|
2017-04-23 12:54:52 +00:00
|
|
|
|
{
|
|
|
|
|
var evomoves = new List<int>();
|
|
|
|
|
var index = Array.FindIndex(evoChain, e => e.Species == Species);
|
2017-04-23 14:48:23 +00:00
|
|
|
|
for (int i = 0; i <= index; i++)
|
2017-04-23 12:54:52 +00:00
|
|
|
|
{
|
|
|
|
|
var evo = evoChain[i];
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var moves = GetMoves(pkm, evo.Species, 1, 1, evo.Level, pkm.AltForm, moveTutor: true, Version: Version, LVL: true, specialTutors: true, Machine: true, MoveReminder: true, RemoveTransferHM: false, Generation: Generation);
|
2017-04-23 14:48:23 +00:00
|
|
|
|
// Moves from Species or any species after in the evolution phase
|
|
|
|
|
evomoves.AddRange(moves);
|
2017-04-23 12:54:52 +00:00
|
|
|
|
}
|
|
|
|
|
return evomoves;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetExclusivePreEvolutionMoves(PKM pkm, int Species, DexLevel[] evoChain, int Generation, GameVersion Version)
|
Split Breed Egg Moves improvements (#1058)
* Added method getBaseEggSpecies to get the base species when the pokemon was an egg, is needed because for format 1 pokemon with egg origin every time getBaseSpecies is called is returning the gen 1 base species obtaining invalid eggmoves and base egg moves
Also getBaseEggSpecies was using Evolves1 when format = 1 even when asking for a gen2 egg base species, returning Pikachu egg moves (empty list) instead of Pichu egg moves
* Fix ability checking for generation 3 pokemon, likea de Seadra from Issue #1011
pkm.AbilityNumber have a value assuming PID match ability like a generation 4 pokemon but the validation should be ignored if is a generation 3 pokemon with only one ability in generation 3
Also changed the validation for ingame trades with fixed abilities to check only with generation 3 abilities in the case the species has two abilities generation 3, if only one was possible any PID should be valid with the generation 3 ability
Encounter Trades
Also the check for evolution was wrong, the most evolved species is the first in the evochain, not the last
* Fix evoltuion chains for gen 3 pokemon in format 4
* Fix ability for generation 3 trades. Ability could not change if there were 2 abilities in generation 3, that means it is irrelevant if the pokemon evolved in gen 4-5, the ability number must match the encounter
* Added missing skipOption to a call to getBaseEggSpecies
* Functions to obtain moves excluvie to preevolutions, like moves that Azurill/Happiny could learn throught level up or TM but Marill/Chansey could not learn, icompatible with any Marill/Chansey egg moves
Also add functions to return egg moves and base egg moves for both possible species for split breed eggs
* Check both species from split breed egg at the same time to report moves incompatibilities
* Reduced generation 4-5 was egg game check
There is no need to check every possible generation game.
For every egg species HGSS learnset tables y egg moves table contains all the moves from the same species in DP and Pt, without any move exclusive to that games except in legendaries, and they cant breed
In generation 5 is the same with B2W2 except for Exxegutte, it have a exclusive level up move from B1W1, Psychic, but it can learn the move with TM, it wont count as an egg move
* Check incompatible split breed moves in verify relearn egg
* Fix generation 1 incompatibility moves check
SolarBeam removed from Exeggcute/Exeggutor incompatiblity, Exeggutor could learn it with a TM in generation 1
Removed Vaporeon Mist and Eevee Take Down incompatiblity, Vaporeon could learn Take Down with a TM in generation 1
2017-04-14 17:11:50 +00:00
|
|
|
|
{
|
|
|
|
|
var preevomoves = new List<int>();
|
|
|
|
|
var evomoves = new List<int>();
|
|
|
|
|
var index = Array.FindIndex(evoChain, e => e.Species == Species);
|
2017-04-15 02:55:40 +00:00
|
|
|
|
for (int i = 0; i < evoChain.Length; i++)
|
Split Breed Egg Moves improvements (#1058)
* Added method getBaseEggSpecies to get the base species when the pokemon was an egg, is needed because for format 1 pokemon with egg origin every time getBaseSpecies is called is returning the gen 1 base species obtaining invalid eggmoves and base egg moves
Also getBaseEggSpecies was using Evolves1 when format = 1 even when asking for a gen2 egg base species, returning Pikachu egg moves (empty list) instead of Pichu egg moves
* Fix ability checking for generation 3 pokemon, likea de Seadra from Issue #1011
pkm.AbilityNumber have a value assuming PID match ability like a generation 4 pokemon but the validation should be ignored if is a generation 3 pokemon with only one ability in generation 3
Also changed the validation for ingame trades with fixed abilities to check only with generation 3 abilities in the case the species has two abilities generation 3, if only one was possible any PID should be valid with the generation 3 ability
Encounter Trades
Also the check for evolution was wrong, the most evolved species is the first in the evochain, not the last
* Fix evoltuion chains for gen 3 pokemon in format 4
* Fix ability for generation 3 trades. Ability could not change if there were 2 abilities in generation 3, that means it is irrelevant if the pokemon evolved in gen 4-5, the ability number must match the encounter
* Added missing skipOption to a call to getBaseEggSpecies
* Functions to obtain moves excluvie to preevolutions, like moves that Azurill/Happiny could learn throught level up or TM but Marill/Chansey could not learn, icompatible with any Marill/Chansey egg moves
Also add functions to return egg moves and base egg moves for both possible species for split breed eggs
* Check both species from split breed egg at the same time to report moves incompatibilities
* Reduced generation 4-5 was egg game check
There is no need to check every possible generation game.
For every egg species HGSS learnset tables y egg moves table contains all the moves from the same species in DP and Pt, without any move exclusive to that games except in legendaries, and they cant breed
In generation 5 is the same with B2W2 except for Exxegutte, it have a exclusive level up move from B1W1, Psychic, but it can learn the move with TM, it wont count as an egg move
* Check incompatible split breed moves in verify relearn egg
* Fix generation 1 incompatibility moves check
SolarBeam removed from Exeggcute/Exeggutor incompatiblity, Exeggutor could learn it with a TM in generation 1
Removed Vaporeon Mist and Eevee Take Down incompatiblity, Vaporeon could learn Take Down with a TM in generation 1
2017-04-14 17:11:50 +00:00
|
|
|
|
{
|
|
|
|
|
var evo = evoChain[i];
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var moves = GetMoves(pkm, evo.Species, 1, 1, evo.Level, pkm.AltForm, moveTutor: true, Version: Version, LVL: true, specialTutors: true, Machine: true, MoveReminder: true, RemoveTransferHM: false, Generation: Generation);
|
Split Breed Egg Moves improvements (#1058)
* Added method getBaseEggSpecies to get the base species when the pokemon was an egg, is needed because for format 1 pokemon with egg origin every time getBaseSpecies is called is returning the gen 1 base species obtaining invalid eggmoves and base egg moves
Also getBaseEggSpecies was using Evolves1 when format = 1 even when asking for a gen2 egg base species, returning Pikachu egg moves (empty list) instead of Pichu egg moves
* Fix ability checking for generation 3 pokemon, likea de Seadra from Issue #1011
pkm.AbilityNumber have a value assuming PID match ability like a generation 4 pokemon but the validation should be ignored if is a generation 3 pokemon with only one ability in generation 3
Also changed the validation for ingame trades with fixed abilities to check only with generation 3 abilities in the case the species has two abilities generation 3, if only one was possible any PID should be valid with the generation 3 ability
Encounter Trades
Also the check for evolution was wrong, the most evolved species is the first in the evochain, not the last
* Fix evoltuion chains for gen 3 pokemon in format 4
* Fix ability for generation 3 trades. Ability could not change if there were 2 abilities in generation 3, that means it is irrelevant if the pokemon evolved in gen 4-5, the ability number must match the encounter
* Added missing skipOption to a call to getBaseEggSpecies
* Functions to obtain moves excluvie to preevolutions, like moves that Azurill/Happiny could learn throught level up or TM but Marill/Chansey could not learn, icompatible with any Marill/Chansey egg moves
Also add functions to return egg moves and base egg moves for both possible species for split breed eggs
* Check both species from split breed egg at the same time to report moves incompatibilities
* Reduced generation 4-5 was egg game check
There is no need to check every possible generation game.
For every egg species HGSS learnset tables y egg moves table contains all the moves from the same species in DP and Pt, without any move exclusive to that games except in legendaries, and they cant breed
In generation 5 is the same with B2W2 except for Exxegutte, it have a exclusive level up move from B1W1, Psychic, but it can learn the move with TM, it wont count as an egg move
* Check incompatible split breed moves in verify relearn egg
* Fix generation 1 incompatibility moves check
SolarBeam removed from Exeggcute/Exeggutor incompatiblity, Exeggutor could learn it with a TM in generation 1
Removed Vaporeon Mist and Eevee Take Down incompatiblity, Vaporeon could learn Take Down with a TM in generation 1
2017-04-14 17:11:50 +00:00
|
|
|
|
if (i >= index)
|
|
|
|
|
// Moves from Species or any species bellow in the evolution phase
|
|
|
|
|
preevomoves.AddRange(moves);
|
|
|
|
|
else
|
|
|
|
|
// Moves in phase evolutions after the limit species, this moves should be removed
|
|
|
|
|
evomoves.AddRange(moves);
|
|
|
|
|
}
|
|
|
|
|
preevomoves.RemoveAll(x => evomoves.Contains(x));
|
|
|
|
|
return preevomoves.Distinct().ToList();
|
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
|
|
|
|
// Encounter
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static GameVersion[] GetGen2GameEncounter(PKM pkm)
|
2017-06-07 23:15:13 +00:00
|
|
|
|
{
|
|
|
|
|
return AllowGen2VCCrystal ? new[] { GameVersion.GS, GameVersion.C } : new[] { GameVersion.GS};
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static GameVersion[] GetGen1GameEncounter(PKM pkm)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
if (!(pkm is PK1 pk) || !pkm.Gen1_NotTradeback)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
return new[] { GameVersion.RD, GameVersion.YW };
|
|
|
|
|
if (25 <= pk.Species && pk.Species <= 26)
|
|
|
|
|
// Yellow Pikachu detected by its special catch rate
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return new[] { pk.Catch_Rate == 163 ? GameVersion.YW : GameVersion.RD };
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (64 <= pk.Species && pk.Species <= 65)
|
|
|
|
|
// Yellow Kadabra detected by its special catch rate
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return new[] { pk.Catch_Rate == 96 ? GameVersion.YW : GameVersion.RD };
|
|
|
|
|
if (148 <= pk.Species && pk.Species <= 149 && pk.Catch_Rate == 27)
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
// Yellow Dragonair detected by its special catch rate, is have another catch rate could be red/blue dratini or yellow dratini
|
|
|
|
|
return new[] { GameVersion.YW };
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
return new[] { GameVersion.RD, GameVersion.YW };
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetInitialMovesGBEncounter(int species, int lvl, GameVersion ver)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
2017-04-09 02:05:29 +00:00
|
|
|
|
int[] InitialMoves;
|
|
|
|
|
int[] LevelUpMoves;
|
|
|
|
|
int diff;
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
switch (ver)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.YW:
|
|
|
|
|
case GameVersion.RD:
|
|
|
|
|
case GameVersion.BU:
|
|
|
|
|
case GameVersion.GN:
|
|
|
|
|
{
|
|
|
|
|
var LevelTable = ver == GameVersion.YW ? LevelUpY : LevelUpRB;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.RB.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return new int[0];
|
2017-06-18 01:37:19 +00:00
|
|
|
|
LevelUpMoves = LevelTable[species].GetEncounterMoves(lvl);
|
2017-04-09 02:05:29 +00:00
|
|
|
|
diff = 4 - LevelUpMoves.Length;
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (diff == 0)
|
|
|
|
|
return LevelUpMoves.ToArray();
|
|
|
|
|
InitialMoves = ver == GameVersion.YW ? ((PersonalInfoG1)PersonalTable.Y[index]).Moves : ((PersonalInfoG1)PersonalTable.RB[index]).Moves;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case GameVersion.C:
|
|
|
|
|
case GameVersion.GS:
|
|
|
|
|
{
|
|
|
|
|
if (species == 235)
|
|
|
|
|
return new[] { 166 }; // Smeargle only learns Sketch, is duplicated in the level up tables
|
|
|
|
|
var LevelTable = ver == GameVersion.C ? LevelUpC : LevelUpGS;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.C.GetFormeIndex(species, 0);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return new int[0];
|
2017-06-18 01:37:19 +00:00
|
|
|
|
LevelUpMoves = LevelTable[species].GetEncounterMoves(2, lvl);
|
2017-04-09 02:05:29 +00:00
|
|
|
|
diff = 4 - LevelUpMoves.Length;
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (diff == 0)
|
|
|
|
|
return LevelUpMoves.ToArray();
|
|
|
|
|
// Level Up 1 moves are initial moves, it can be duplicated in levels 2-100
|
2017-06-18 01:37:19 +00:00
|
|
|
|
InitialMoves = LevelTable[species].GetEncounterMoves(1, 1);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
return new int[0];
|
|
|
|
|
}
|
|
|
|
|
// Initial Moves could be duplicated in the level up table
|
|
|
|
|
// level up table moves have preferences
|
2017-04-09 02:05:29 +00:00
|
|
|
|
var moves = InitialMoves.Where(p => p != 0 && !LevelUpMoves.Any(m => m == p)).ToList();
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
// If not all the personal table move cant be included the last moves have preference
|
2017-04-09 02:05:29 +00:00
|
|
|
|
int pop = moves.Count - diff;
|
|
|
|
|
if (pop > 0)
|
|
|
|
|
moves.RemoveRange(0, pop);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
// The order for the pokemon default moves are first moves from personal table and then moves from level up table
|
2017-04-09 02:05:29 +00:00
|
|
|
|
return moves.Union(LevelUpMoves).ToArray();
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int GetRequiredMoveCount(PKM pk, int[] moves, LegalInfo info, int[] initialmoves)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if (pk.Format != 1 || !pk.Gen1_NotTradeback) // No MoveDeleter
|
2017-04-10 00:43:05 +00:00
|
|
|
|
return 1; // Move deleter exits, slots from 2 onwards can allways be empty
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int required = GetRequiredMoveCount(pk, moves, info.EncounterMoves.LevelUpMoves, initialmoves);
|
2017-04-10 00:43:05 +00:00
|
|
|
|
if (required >= 4)
|
|
|
|
|
return 4;
|
|
|
|
|
|
|
|
|
|
// tm, hm and tutor moves replace a free slots if the pokemon have less than 4 moves
|
|
|
|
|
// Ignore tm, hm and tutor moves already in the learnset table
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var learn = info.EncounterMoves.LevelUpMoves;
|
|
|
|
|
var tmhm = info.EncounterMoves.TMHMMoves;
|
|
|
|
|
var tutor = info.EncounterMoves.TutorMoves;
|
2017-04-10 00:43:05 +00:00
|
|
|
|
required += moves.Where(m => m != 0 && initialmoves.Union(learn[1]).All(l => l != m) && (tmhm[1].Any(t => t == m) || tutor[1].Any(t => t == m))).Count();
|
|
|
|
|
|
|
|
|
|
return Math.Min(4, required);
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int GetRequiredMoveCount(PKM pk, int[] moves, List<int>[] learn, int[] initialmoves)
|
2017-04-10 00:43:05 +00:00
|
|
|
|
{
|
|
|
|
|
if (SpecialMinMoveSlots.Contains(pk.Species))
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetRequiredMoveCountSpecial(pk, moves, learn);
|
2017-04-10 00:43:05 +00:00
|
|
|
|
|
|
|
|
|
// A pokemon is captured with initial moves and can't forget any until have all 4 slots used
|
|
|
|
|
// If it has learn a move before having 4 it will be in one of the free slots
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int required = GetRequiredMoveSlotsRegular(pk, moves, learn, initialmoves);
|
|
|
|
|
return required != 0 ? required : GetRequiredMoveCountDecrement(pk, moves, learn, initialmoves);
|
2017-04-10 00:43:05 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int GetRequiredMoveSlotsRegular(PKM pk, int[] moves, List<int>[] learn, int[] initialmoves)
|
2017-04-10 00:43:05 +00:00
|
|
|
|
{
|
|
|
|
|
int species = pk.Species;
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
int catch_rate = (pk as PK1).Catch_Rate;
|
2017-04-10 00:43:05 +00:00
|
|
|
|
// Caterpie and Metapod evolution lines have different count of possible slots available if captured in different evolutionary phases
|
|
|
|
|
// Example: a level 7 caterpie evolved into metapod will have 3 learned moves, a captured metapod will have only 1 move
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if ((species == 011 || species == 012) && catch_rate == 120)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
// Captured as Metapod without Caterpie moves
|
|
|
|
|
return initialmoves.Union(learn[1]).Distinct().Count(lm => lm != 0 && !G1CaterpieMoves.Contains(lm));
|
|
|
|
|
// There is no valid Butterfree encounter in generation 1 games
|
2017-04-10 00:43:05 +00:00
|
|
|
|
}
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if ((species == 014 || species == 015) && (catch_rate == 45 || catch_rate == 120))
|
2017-04-10 00:43:05 +00:00
|
|
|
|
{
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if (species == 15 && catch_rate == 45) // Captured as Beedril without Weedle and Kakuna moves
|
2017-04-10 00:43:05 +00:00
|
|
|
|
return initialmoves.Union(learn[1]).Distinct().Count(lm => lm != 0 && !G1KakunaMoves.Contains(lm));
|
2017-04-09 23:41:01 +00:00
|
|
|
|
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
// Captured as Kakuna without Weedle moves
|
|
|
|
|
return initialmoves.Union(learn[1]).Distinct().Count(lm => lm != 0 && !G1WeedleMoves.Contains(lm));
|
2017-04-10 00:43:05 +00:00
|
|
|
|
}
|
2017-04-09 23:41:01 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return IsMoveCountRequired3(species, pk.CurrentLevel, moves) ? 3 : 0; // no match
|
2017-04-10 00:43:05 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static bool IsMoveCountRequired3(int species, int level, int[] moves)
|
2017-04-10 00:43:05 +00:00
|
|
|
|
{
|
|
|
|
|
// Species that evolve and learn the 4th move as evolved species at a greather level than base species
|
|
|
|
|
// The 4th move is included in the level up table set as a preevolution move,
|
|
|
|
|
// it should be removed from the used slots count if is not the learn move
|
|
|
|
|
switch (species)
|
|
|
|
|
{
|
|
|
|
|
case 017: return level < 21 && !moves.Contains(018); // Pidgeotto without Whirlwind
|
|
|
|
|
case 028: return level < 27 && !moves.Contains(040); // Sandslash without Poison Sting
|
|
|
|
|
case 047: return level < 30 && !moves.Contains(147); // Parasect without Spore
|
|
|
|
|
case 055: return level < 39 && !moves.Contains(093); // Golduck without Confusion
|
|
|
|
|
case 087: return level < 44 && !moves.Contains(156); // Dewgong without Rest
|
|
|
|
|
case 093:
|
|
|
|
|
case 094: return level < 29 && !moves.Contains(095); // Haunter/Gengar without Hypnosis
|
|
|
|
|
case 110: return level < 39 && !moves.Contains(108); // Weezing without Smoke Screen
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int GetRequiredMoveCountDecrement(PKM pk, int[] moves, List<int>[] learn, int[] initialmoves)
|
2017-04-10 00:43:05 +00:00
|
|
|
|
{
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
int catch_rate = (pk as PK1).Catch_Rate;
|
2017-04-10 00:43:05 +00:00
|
|
|
|
int usedslots = initialmoves.Union(learn[1]).Where(m => m != 0).Distinct().Count();
|
|
|
|
|
// Yellow optional moves, reduce usedslots if the yellow move is not present
|
|
|
|
|
// The count wont go bellow 1 because the yellow moves were already counted and are not the only initial or level up moves
|
|
|
|
|
if (pk.Species == 031) //Venonat
|
|
|
|
|
{
|
|
|
|
|
// ignore Venomoth, by the time Venonat evolved it will always have 4 moves
|
|
|
|
|
if (pk.CurrentLevel >= 11 && !moves.Contains(48)) // Supersonic
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
usedslots--;
|
2017-04-10 00:43:05 +00:00
|
|
|
|
if (pk.CurrentLevel >= 19 && !moves.Contains(93)) // Confusion
|
|
|
|
|
usedslots--;
|
|
|
|
|
}
|
|
|
|
|
if (pk.Species == 056 && pk.CurrentLevel >= 9 && !moves.Contains(67)) // Mankey Yellow Low Kick, Primeape will always have 4 moves
|
|
|
|
|
usedslots--;
|
2017-04-09 23:41:01 +00:00
|
|
|
|
|
2017-04-10 00:43:05 +00:00
|
|
|
|
if (064 == pk.Species || pk.Species == 065)
|
|
|
|
|
{
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if (catch_rate != 100)// Initial Yellow Kadabra Kinesis (move 134)
|
2017-04-10 00:43:05 +00:00
|
|
|
|
usedslots--;
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if (catch_rate == 200 && pk.CurrentLevel < 20) // Kadabra Disable, not learned until 20 if captured as Abra (move 50)
|
2017-04-10 00:43:05 +00:00
|
|
|
|
usedslots--;
|
|
|
|
|
}
|
|
|
|
|
if (104 == pk.Species || pk.Species == 105) // Cubone and Marowak
|
|
|
|
|
{
|
|
|
|
|
if (!moves.Contains(39)) // Initial Yellow Tail Whip
|
|
|
|
|
usedslots--;
|
|
|
|
|
if (!moves.Contains(125)) // Initial Yellow Bone Club
|
|
|
|
|
usedslots--;
|
|
|
|
|
if (pk.Species == 105 && pk.CurrentLevel < 33 && !moves.Contains(116)) // Marowak evolved without Focus Energy
|
|
|
|
|
usedslots--;
|
|
|
|
|
}
|
|
|
|
|
if (pk.Species == 113) // Chansey
|
|
|
|
|
{
|
|
|
|
|
if (!moves.Contains(39)) // Yellow Initial Tail Whip
|
|
|
|
|
usedslots--;
|
|
|
|
|
if (!moves.Contains(3)) // Yellow Lvl 12 and Initial Red/Blue Double Slap
|
|
|
|
|
usedslots--;
|
|
|
|
|
}
|
2017-04-10 12:11:07 +00:00
|
|
|
|
if (pk.Species == 130 && pk.CurrentLevel < 32) // Wild Gyarados from yellow do not learn splash, evolved gyarados do not learn tackle
|
|
|
|
|
usedslots--;
|
2017-04-10 00:43:05 +00:00
|
|
|
|
if (pk.Species == 127 && pk.CurrentLevel >= 21 && !moves.Contains(20)) // Pinsir Yellow Bind
|
|
|
|
|
usedslots--;
|
|
|
|
|
return usedslots;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int GetRequiredMoveCountSpecial(PKM pk, int[] moves, List<int>[] learn)
|
2017-04-10 00:43:05 +00:00
|
|
|
|
{
|
|
|
|
|
// Species with few mandatory slots, species with stone evolutions that could evolve at lower level and do not learn any more moves
|
|
|
|
|
// and Pikachu and Nidoran family, those only have mandatory the initial moves and a few have one level up moves,
|
|
|
|
|
// every other move could be avoided switching game or evolving
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var basespecies = GetBaseSpecies(pk);
|
2017-04-10 00:43:05 +00:00
|
|
|
|
var maxlevel = 1;
|
|
|
|
|
var minlevel = 1;
|
|
|
|
|
if (029 <= pk.Species && pk.Species <= 034 && pk.CurrentLevel >= 8)
|
|
|
|
|
maxlevel = 8; // Always lean a third move at level 8
|
|
|
|
|
if (pk.Species == 114)
|
|
|
|
|
{
|
|
|
|
|
//Tangela moves before level 32 are different in red/blue and yellow
|
|
|
|
|
minlevel = 32;
|
|
|
|
|
maxlevel = pk.CurrentLevel;
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var mandatory = minlevel <= pk.CurrentLevel ? GetLvlMoves(basespecies, 0, 1, minlevel, maxlevel).Where(m => m != 0).Distinct().ToList() : new List<int>();
|
2017-04-10 00:43:05 +00:00
|
|
|
|
if (pk.Species == 103 && pk.CurrentLevel >= 28) // Exeggutor
|
|
|
|
|
{
|
|
|
|
|
// At level 28 learn different move if is a Exeggute or Exeggutor
|
|
|
|
|
if (moves.Contains(73))
|
|
|
|
|
mandatory.Add(73); // Leech Seed level 28 Exeggute
|
|
|
|
|
if (moves.Contains(23))
|
|
|
|
|
mandatory.Add(23); // Stomp level 28 Exeggutor
|
|
|
|
|
}
|
|
|
|
|
if (pk.Species == 25 && pk.CurrentLevel >= 33)
|
|
|
|
|
mandatory.Add(97); // Pikachu always learn Agility
|
|
|
|
|
if (pk.Species == 114)
|
|
|
|
|
mandatory.Add(132); // Tangela always learn Constrict as Initial Move
|
|
|
|
|
|
|
|
|
|
// Add to used slots the non-mandatory moves from the learnset table that the pokemon have learned
|
|
|
|
|
return mandatory.Count + moves.Where(m => m != 0 && mandatory.All(l => l != m) && learn[1].Any(t => t == m)).Count();
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
2017-04-10 00:43:05 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool GetWasEgg23(PKM pkm)
|
2017-02-28 04:57:24 +00:00
|
|
|
|
{
|
2017-03-26 22:11:09 +00:00
|
|
|
|
if (pkm.IsEgg)
|
|
|
|
|
return true;
|
2017-02-28 04:57:24 +00:00
|
|
|
|
if (pkm.Format > 2 && pkm.Ball != 4)
|
|
|
|
|
return false;
|
2017-03-26 22:11:09 +00:00
|
|
|
|
if (pkm.Format == 3)
|
|
|
|
|
return pkm.WasEgg;
|
2017-02-28 04:57:24 +00:00
|
|
|
|
|
|
|
|
|
int lvl = pkm.CurrentLevel;
|
|
|
|
|
if (lvl < 5)
|
|
|
|
|
return false;
|
|
|
|
|
|
2017-04-10 00:43:05 +00:00
|
|
|
|
if (pkm.Format > 3 && pkm.Met_Level <5)
|
2017-03-26 22:11:09 +00:00
|
|
|
|
return false;
|
2017-03-27 19:10:30 +00:00
|
|
|
|
if (pkm.Format > 3 && pkm.FatefulEncounter)
|
|
|
|
|
return false;
|
2017-03-26 22:11:09 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return IsEvolutionValid(pkm);
|
2017-02-28 04:57:24 +00:00
|
|
|
|
}
|
2016-03-23 05:50:54 +00:00
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
// Generation Specific Fetching
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EvolutionTree GetEvolutionTable(PKM pkm)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetEvolutionTable(pkm.Format);
|
2017-04-13 15:48:13 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static EvolutionTree GetEvolutionTable(int generation)
|
2017-04-13 15:48:13 +00:00
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
2017-02-12 17:52:26 +00:00
|
|
|
|
case 1:
|
|
|
|
|
return Evolves1;
|
2017-02-25 20:37:01 +00:00
|
|
|
|
case 2:
|
|
|
|
|
return Evolves2;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case 3:
|
|
|
|
|
return Evolves3;
|
|
|
|
|
case 4:
|
|
|
|
|
return Evolves4;
|
|
|
|
|
case 5:
|
|
|
|
|
return Evolves5;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
case 6:
|
|
|
|
|
return Evolves6;
|
|
|
|
|
default:
|
2017-02-12 17:52:26 +00:00
|
|
|
|
return Evolves7;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static EncounterStatic[] GetEncounterStaticTable(PKM pkm, GameVersion gameSource = GameVersion.Any)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
2017-05-28 04:17:53 +00:00
|
|
|
|
if (gameSource == GameVersion.Any)
|
|
|
|
|
gameSource = (GameVersion)pkm.Version;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
switch (gameSource)
|
2017-03-18 23:50:34 +00:00
|
|
|
|
{
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.RBY:
|
|
|
|
|
case GameVersion.RD:
|
|
|
|
|
case GameVersion.BU:
|
|
|
|
|
case GameVersion.GN:
|
|
|
|
|
case GameVersion.YW:
|
|
|
|
|
return StaticRBY;
|
2017-03-24 06:15:49 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.GSC:
|
|
|
|
|
case GameVersion.GD:
|
|
|
|
|
case GameVersion.SV:
|
|
|
|
|
case GameVersion.C:
|
2017-06-07 04:59:29 +00:00
|
|
|
|
if (!AllowGen2Crystal)
|
|
|
|
|
return StaticGS;
|
2017-05-28 04:17:53 +00:00
|
|
|
|
if (pkm.Format != 2)
|
|
|
|
|
return StaticGSC;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-06-18 23:40:23 +00:00
|
|
|
|
if (pkm.HasOriginalMetLocation)
|
2017-05-28 04:17:53 +00:00
|
|
|
|
return StaticC;
|
|
|
|
|
return StaticGSC;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.R: return StaticR;
|
|
|
|
|
case GameVersion.S: return StaticS;
|
|
|
|
|
case GameVersion.E: return StaticE;
|
|
|
|
|
case GameVersion.FR: return StaticFR;
|
|
|
|
|
case GameVersion.LG: return StaticLG;
|
|
|
|
|
case GameVersion.CXD: return Encounter_CXD;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.D: return StaticD;
|
|
|
|
|
case GameVersion.P: return StaticP;
|
|
|
|
|
case GameVersion.Pt: return StaticPt;
|
|
|
|
|
case GameVersion.HG: return StaticHG;
|
|
|
|
|
case GameVersion.SS: return StaticSS;
|
2017-04-01 20:54:04 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.B: return StaticB;
|
|
|
|
|
case GameVersion.W: return StaticW;
|
|
|
|
|
case GameVersion.B2: return StaticB2;
|
|
|
|
|
case GameVersion.W2: return StaticW2;
|
2017-04-01 20:54:04 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.X: return StaticX;
|
|
|
|
|
case GameVersion.Y: return StaticY;
|
|
|
|
|
case GameVersion.AS: return StaticA;
|
|
|
|
|
case GameVersion.OR: return StaticO;
|
2017-04-01 20:54:04 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.SN: return StaticSN;
|
|
|
|
|
case GameVersion.MN: return StaticMN;
|
2017-04-01 20:54:04 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
default: return new EncounterStatic[0];
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static EncounterArea[] GetEncounterTable(PKM pkm, GameVersion gameSource = GameVersion.Any)
|
2016-11-13 21:11:53 +00:00
|
|
|
|
{
|
2017-05-28 04:17:53 +00:00
|
|
|
|
if (gameSource == GameVersion.Any)
|
|
|
|
|
gameSource = (GameVersion)pkm.Version;
|
|
|
|
|
|
|
|
|
|
switch (gameSource)
|
2016-11-13 21:11:53 +00:00
|
|
|
|
{
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.RBY:
|
|
|
|
|
case GameVersion.RD:
|
|
|
|
|
case GameVersion.BU:
|
|
|
|
|
case GameVersion.GN:
|
|
|
|
|
case GameVersion.YW:
|
|
|
|
|
return SlotsRBY;
|
2017-04-01 20:54:04 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
case GameVersion.GSC:
|
|
|
|
|
case GameVersion.GD:
|
|
|
|
|
case GameVersion.SV:
|
|
|
|
|
case GameVersion.C:
|
2017-06-07 04:59:29 +00:00
|
|
|
|
if (!AllowGen2Crystal)
|
|
|
|
|
return SlotsGS;
|
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
if (pkm.Format != 2)
|
|
|
|
|
// Gen 2 met location is lost outside gen 2 games
|
|
|
|
|
return SlotsGSC;
|
2017-04-01 20:54:04 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
if (pkm.HasOriginalMetLocation)
|
|
|
|
|
// Format 2 with met location, encounter should be from crystal
|
|
|
|
|
return SlotsC;
|
2016-12-12 01:13:59 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
if (pkm.Species > 151 && !FutureEvolutionsGen1.Contains(pkm.Species))
|
|
|
|
|
// Format 2 without met location but pokemon could not be tradeback to gen 1,
|
|
|
|
|
// encounter should be from gold or silver
|
|
|
|
|
return SlotsGS;
|
2016-11-13 21:11:53 +00:00
|
|
|
|
|
2017-05-28 04:17:53 +00:00
|
|
|
|
// Encounter could be any gen 2 game, it can have empty met location for have a g/s origin
|
|
|
|
|
// or it can be a crystal pokemon that lost met location after being tradeback to gen 1 games
|
|
|
|
|
return SlotsGSC;
|
|
|
|
|
|
|
|
|
|
case GameVersion.R: return SlotsR;
|
|
|
|
|
case GameVersion.S: return SlotsS;
|
|
|
|
|
case GameVersion.E: return SlotsE;
|
|
|
|
|
case GameVersion.FR: return SlotsFR;
|
|
|
|
|
case GameVersion.LG: return SlotsLG;
|
|
|
|
|
case GameVersion.CXD: return SlotsXD;
|
|
|
|
|
|
|
|
|
|
case GameVersion.D: return SlotsD;
|
|
|
|
|
case GameVersion.P: return SlotsP;
|
|
|
|
|
case GameVersion.Pt: return SlotsPt;
|
|
|
|
|
case GameVersion.HG: return SlotsHG;
|
|
|
|
|
case GameVersion.SS: return SlotsSS;
|
|
|
|
|
|
|
|
|
|
case GameVersion.B: return SlotsB;
|
|
|
|
|
case GameVersion.W: return SlotsW;
|
|
|
|
|
case GameVersion.B2: return SlotsB2;
|
|
|
|
|
case GameVersion.W2: return SlotsW2;
|
|
|
|
|
|
|
|
|
|
case GameVersion.X: return SlotsX;
|
|
|
|
|
case GameVersion.Y: return SlotsY;
|
|
|
|
|
case GameVersion.AS: return SlotsA;
|
|
|
|
|
case GameVersion.OR: return SlotsO;
|
|
|
|
|
|
|
|
|
|
case GameVersion.SN: return SlotsSN;
|
|
|
|
|
case GameVersion.MN: return SlotsMN;
|
|
|
|
|
|
|
|
|
|
default: return new EncounterArea[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<EncounterArea> GetDexNavAreas(PKM pkm)
|
2017-05-28 04:17:53 +00:00
|
|
|
|
{
|
|
|
|
|
switch (pkm.Version)
|
|
|
|
|
{
|
|
|
|
|
case (int)GameVersion.AS:
|
|
|
|
|
return SlotsA.Where(l => l.Location == pkm.Met_Location);
|
|
|
|
|
case (int)GameVersion.OR:
|
|
|
|
|
return SlotsO.Where(l => l.Location == pkm.Met_Location);
|
|
|
|
|
default:
|
|
|
|
|
return new EncounterArea[0];
|
2016-11-13 21:11:53 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-28 04:17:53 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetLineage(PKM pkm)
|
2016-11-08 16:43:57 +00:00
|
|
|
|
{
|
2017-02-05 21:08:25 +00:00
|
|
|
|
if (pkm.IsEgg)
|
|
|
|
|
return new[] {pkm.Species};
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var table = GetEvolutionTable(pkm);
|
|
|
|
|
var lineage = table.GetValidPreEvolutions(pkm, pkm.CurrentLevel);
|
2016-11-08 16:43:57 +00:00
|
|
|
|
return lineage.Select(evolution => evolution.Species);
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int[] GetWildBalls(PKM pkm)
|
2016-11-08 16:43:57 +00:00
|
|
|
|
{
|
|
|
|
|
switch (pkm.GenNumber)
|
|
|
|
|
{
|
2017-02-12 17:52:26 +00:00
|
|
|
|
case 1:
|
|
|
|
|
return WildPokeBalls1;
|
|
|
|
|
case 2:
|
|
|
|
|
return WildPokeBalls2;
|
|
|
|
|
case 3:
|
|
|
|
|
return WildPokeBalls3;
|
|
|
|
|
case 4:
|
|
|
|
|
return pkm.HGSS ? WildPokeBalls4_HGSS : WildPokeBalls4_DPPt;
|
|
|
|
|
case 5:
|
|
|
|
|
return WildPokeBalls5;
|
|
|
|
|
case 6:
|
|
|
|
|
return WildPokeballs6;
|
2016-11-08 16:43:57 +00:00
|
|
|
|
case 7:
|
|
|
|
|
return WildPokeballs7;
|
2017-02-12 17:52:26 +00:00
|
|
|
|
|
2016-11-08 16:43:57 +00:00
|
|
|
|
default:
|
2017-02-12 17:52:26 +00:00
|
|
|
|
return null;
|
2016-11-08 16:43:57 +00:00
|
|
|
|
}
|
2017-02-21 03:40:50 +00:00
|
|
|
|
}
|
2017-06-19 04:13:53 +00:00
|
|
|
|
internal static int GetEggHatchLevel(PKM pkm) => pkm.Format <= 3 ? 5 : 1;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int[] GetSplitBreedGeneration(PKM pkm)
|
2017-03-26 13:39:09 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetSplitBreedGeneration(pkm.GenNumber);
|
2017-03-26 13:39:09 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int[] GetSplitBreedGeneration(int generation)
|
2017-03-26 13:39:09 +00:00
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 1: return new int[0];
|
|
|
|
|
case 2: return new int[0];
|
|
|
|
|
case 3: return SplitBreed_3;
|
|
|
|
|
case 4: return SplitBreed;
|
|
|
|
|
case 5: return SplitBreed;
|
|
|
|
|
case 6: return SplitBreed;
|
|
|
|
|
case 7: return SplitBreed;
|
|
|
|
|
default: return new int[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int GetMaxSpeciesOrigin(PKM pkm)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
if (pkm.Format == 1 || pkm.VC1) // Gen1 VC could not trade with gen 2 yet
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetMaxSpeciesOrigin(1);
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if (pkm.Format == 2 || pkm.VC2)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetMaxSpeciesOrigin(2);
|
|
|
|
|
return GetMaxSpeciesOrigin(pkm.GenNumber);
|
2017-02-21 03:40:50 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int GetMaxSpeciesOrigin(int generation)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 1: return MaxSpeciesID_1;
|
|
|
|
|
case 2: return MaxSpeciesID_2;
|
|
|
|
|
case 3: return MaxSpeciesID_3;
|
|
|
|
|
case 4: return MaxSpeciesID_4;
|
|
|
|
|
case 5: return MaxSpeciesID_5;
|
|
|
|
|
case 6: return MaxSpeciesID_6;
|
|
|
|
|
case 7: return MaxSpeciesID_7;
|
|
|
|
|
default: return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetFutureGenEvolutions(int generation)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 1: return FutureEvolutionsGen1;
|
|
|
|
|
case 2: return FutureEvolutionsGen2;
|
|
|
|
|
case 3: return FutureEvolutionsGen3;
|
|
|
|
|
case 4: return FutureEvolutionsGen4;
|
|
|
|
|
case 5: return FutureEvolutionsGen5;
|
|
|
|
|
default: return new int[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static bool[] GetReleasedHeldItems(int generation)
|
2017-02-26 19:43:26 +00:00
|
|
|
|
{
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 2: return ReleasedHeldItems_2;
|
|
|
|
|
case 3: return ReleasedHeldItems_3;
|
|
|
|
|
case 4: return ReleasedHeldItems_4;
|
|
|
|
|
case 5: return ReleasedHeldItems_5;
|
|
|
|
|
case 6: return ReleasedHeldItems_6;
|
|
|
|
|
case 7: return ReleasedHeldItems_7;
|
|
|
|
|
default: return new bool[0];
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool IsHeldItemAllowed(int item, int generation)
|
2017-02-26 19:43:26 +00:00
|
|
|
|
{
|
|
|
|
|
if (item < 0)
|
|
|
|
|
return false;
|
|
|
|
|
if (item == 0)
|
|
|
|
|
return true;
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var items = GetReleasedHeldItems(generation);
|
2017-02-26 19:43:26 +00:00
|
|
|
|
return items.Length > item && items[item];
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool IsNotBaseSpecies(PKM pkm)
|
2016-03-23 05:50:54 +00:00
|
|
|
|
{
|
2017-02-05 21:08:25 +00:00
|
|
|
|
if (pkm.IsEgg)
|
|
|
|
|
return false;
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetValidPreEvolutions(pkm).Count() > 1;
|
2016-03-23 05:50:54 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static bool IsEvolvedFormChange(PKM pkm)
|
2017-02-02 05:59:39 +00:00
|
|
|
|
{
|
2017-02-05 21:08:25 +00:00
|
|
|
|
if (pkm.IsEgg)
|
|
|
|
|
return false;
|
|
|
|
|
|
2017-02-02 05:59:39 +00:00
|
|
|
|
if (pkm.Format >= 7 && EvolveToAlolanForms.Contains(pkm.Species))
|
|
|
|
|
return pkm.AltForm == 1;
|
|
|
|
|
if (pkm.Species == 678 && pkm.Gender == 1)
|
|
|
|
|
return pkm.AltForm == 1;
|
2017-03-03 02:28:43 +00:00
|
|
|
|
if (pkm.Species == 773)
|
|
|
|
|
return true;
|
2017-02-02 05:59:39 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool IsTradeEvolved(PKM pkm)
|
2016-03-23 05:50:54 +00:00
|
|
|
|
{
|
2017-02-05 21:08:25 +00:00
|
|
|
|
if (pkm.IsEgg)
|
|
|
|
|
return false;
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var table = GetEvolutionTable(pkm);
|
|
|
|
|
var lineage = table.GetValidPreEvolutions(pkm, 100, skipChecks:true);
|
2016-11-08 16:43:57 +00:00
|
|
|
|
return lineage.Any(evolution => EvolutionMethod.TradeMethods.Any(method => method == evolution.Flag)); // Trade Evolutions
|
2016-03-23 05:50:54 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool IsEvolutionValid(PKM pkm, int minSpecies = -1)
|
2016-04-08 01:19:21 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var curr = GetValidPreEvolutions(pkm);
|
|
|
|
|
var poss = GetValidPreEvolutions(pkm, lvl: 100, skipChecks: true);
|
2016-04-08 01:19:21 +00:00
|
|
|
|
|
2017-05-29 22:21:39 +00:00
|
|
|
|
if (minSpecies != -1)
|
|
|
|
|
poss = poss.Reverse().SkipWhile(z => z.Species != minSpecies); // collection is reversed, we only care about count
|
2017-06-18 01:37:19 +00:00
|
|
|
|
else if (GetSplitBreedGeneration(pkm).Contains(GetBaseSpecies(pkm, 1)))
|
2016-04-08 01:19:21 +00:00
|
|
|
|
return curr.Count() >= poss.Count() - 1;
|
|
|
|
|
return curr.Count() >= poss.Count();
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool IsEvolutionValidWithMove(PKM pkm, LegalInfo info)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
{
|
|
|
|
|
// Exclude species that do not evolve leveling with a move
|
2017-06-07 03:52:21 +00:00
|
|
|
|
// Exclude gen 1-3 formats
|
2017-06-07 03:10:05 +00:00
|
|
|
|
// Exclude Mr Mime and Snorlax for gen 1-3 games
|
|
|
|
|
if (!SpeciesEvolutionWithMove.Contains(pkm.Species) || pkm.Format <= 3 || (BabyEvolutionWithMove.Contains(pkm.Species) && pkm.GenNumber <= 3))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
var index = Array.FindIndex(SpeciesEvolutionWithMove, p => p == pkm.Species);
|
|
|
|
|
var levels = MinLevelEvolutionWithMove[index];
|
|
|
|
|
var moves = MoveEvolutionWithMove[index];
|
|
|
|
|
var allowegg = EggMoveEvolutionWithMove[index][pkm.GenNumber];
|
|
|
|
|
|
2017-06-07 03:52:21 +00:00
|
|
|
|
// Get the minimum level in any generation when the pokemon could learn the evolve move
|
2017-06-07 03:10:05 +00:00
|
|
|
|
var LearnLevel = 101;
|
2017-06-07 03:52:21 +00:00
|
|
|
|
for (int g = pkm.GenNumber; g <= pkm.Format; g++)
|
|
|
|
|
if (pkm.InhabitedGeneration(g) && levels[g] > 0)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
LearnLevel = Math.Min(LearnLevel, levels[g]);
|
|
|
|
|
|
|
|
|
|
// Check also if the current encounter include the evolve move as an special move
|
|
|
|
|
// That means the pokemon have the move from the encounter level
|
|
|
|
|
int[] SpecialMoves = (info.EncounterMatch as IMoveset)?.Moves ?? new int[0];
|
|
|
|
|
if (SpecialMoves.Any(m => moves.Contains(m)))
|
|
|
|
|
LearnLevel = Math.Min(LearnLevel, info.EncounterMatch.LevelMin);
|
|
|
|
|
|
|
|
|
|
// If the encounter is a player hatched egg check if the move could be an egg move or inherited level up move
|
|
|
|
|
if (info.EncounterMatch.EggEncounter && !pkm.WasGiftEgg && !pkm.WasEventEgg && allowegg)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
if (IsMoveInherited(pkm, info, moves))
|
2017-06-07 23:15:13 +00:00
|
|
|
|
LearnLevel = Math.Min(LearnLevel, pkm.GenNumber < 4 ? 6 : 2);
|
2017-06-07 03:10:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
2017-06-07 03:52:21 +00:00
|
|
|
|
// If has original met location the minimum evolution level is one level after met level
|
|
|
|
|
// Gen 3 pokemon in gen 4 games: minimum level is one level after transfer to generation 4
|
|
|
|
|
// VC pokemon: minimum level is one level after transfer to generation 7
|
|
|
|
|
// Sylveon: always one level after met level, for gen 4 and 5 eevees in gen 6 games minimum for evolution is one level after transfer to generation 5
|
2017-06-07 03:10:05 +00:00
|
|
|
|
if (pkm.HasOriginalMetLocation || pkm.Format == 4 && pkm.Gen3 || pkm.VC || pkm.Species == 700)
|
2017-06-07 23:15:13 +00:00
|
|
|
|
LearnLevel = Math.Max(pkm.Met_Level + 1, LearnLevel);
|
2017-06-07 03:10:05 +00:00
|
|
|
|
|
2017-06-07 23:15:13 +00:00
|
|
|
|
// Current level must be at least one the minimum learn level
|
|
|
|
|
// the level-up event that triggers the learning of the move also triggers evolution with no further level-up required
|
|
|
|
|
return pkm.CurrentLevel >= LearnLevel;
|
2017-06-07 03:10:05 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static bool IsMoveInherited(PKM pkm, LegalInfo info, int[] moves)
|
2017-06-07 03:52:21 +00:00
|
|
|
|
{
|
|
|
|
|
// In 3DS games, the inherited move must be in the relearn moves.
|
|
|
|
|
if (pkm.GenNumber >= 6)
|
|
|
|
|
return pkm.RelearnMoves.Any(moves.Contains);
|
|
|
|
|
|
|
|
|
|
// In Pre-3DS games, the move is inherited if it has the move and it can be hatched with the move.
|
|
|
|
|
if (pkm.Moves.Any(moves.Contains))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
// If the pokemon does not have the move, it still could be an egg move that was forgotten.
|
|
|
|
|
// This requires the pokemon to not have 4 other moves identified as egg moves or inherited level up moves.
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return 4 > info.Moves.Count(m => m.Source == MoveSource.EggMove || m.Source == MoveSource.InheritLevelUp);
|
2017-06-07 03:52:21 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool IsFormChangeable(PKM pkm, int species)
|
2017-02-21 05:19:25 +00:00
|
|
|
|
{
|
|
|
|
|
if (FormChange.Contains(species))
|
|
|
|
|
return true;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
if (IsEvolvedFormChange(pkm))
|
2017-02-21 05:19:25 +00:00
|
|
|
|
return true;
|
2017-03-10 22:45:09 +00:00
|
|
|
|
if (pkm.Species == 718 && pkm.InhabitedGeneration(7) && pkm.AltForm == 3)
|
2017-02-21 05:19:25 +00:00
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2017-05-28 04:17:53 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
public static int GetLowestLevel(PKM pkm, int refSpecies = -1)
|
2016-12-01 06:06:41 +00:00
|
|
|
|
{
|
|
|
|
|
if (refSpecies == -1)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
refSpecies = GetBaseSpecies(pkm);
|
2016-12-01 06:06:41 +00:00
|
|
|
|
for (int i = 0; i < 100; i++)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var table = GetEvolutionTable(pkm);
|
|
|
|
|
var evos = table.GetValidPreEvolutions(pkm, i, skipChecks:true).ToArray();
|
2016-12-01 06:06:41 +00:00
|
|
|
|
if (evos.Any(evo => evo.Species == refSpecies))
|
|
|
|
|
return evos.OrderByDescending(evo => evo.Level).First().Level;
|
|
|
|
|
}
|
|
|
|
|
return 100;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool GetCanBeCaptured(int species, int gen, GameVersion version = GameVersion.Any)
|
2016-05-06 03:35:18 +00:00
|
|
|
|
{
|
2016-10-24 05:03:19 +00:00
|
|
|
|
switch (gen)
|
2016-05-06 03:35:18 +00:00
|
|
|
|
{
|
2017-03-18 23:50:34 +00:00
|
|
|
|
// Capture Memory only obtainable via Gen 6.
|
2016-10-24 05:03:19 +00:00
|
|
|
|
case 6:
|
|
|
|
|
switch (version)
|
|
|
|
|
{
|
2016-11-09 06:10:32 +00:00
|
|
|
|
case GameVersion.Any:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetCanBeCaptured(species, SlotsX, StaticX, XY:true)
|
|
|
|
|
|| GetCanBeCaptured(species, SlotsY, StaticY, XY:true)
|
|
|
|
|
|| GetCanBeCaptured(species, SlotsA, StaticA)
|
|
|
|
|
|| GetCanBeCaptured(species, SlotsO, StaticO);
|
2016-11-09 06:10:32 +00:00
|
|
|
|
case GameVersion.X:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetCanBeCaptured(species, SlotsX, StaticX, XY:true);
|
2016-11-09 06:10:32 +00:00
|
|
|
|
case GameVersion.Y:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetCanBeCaptured(species, SlotsY, StaticY, XY:true);
|
2016-11-09 06:10:32 +00:00
|
|
|
|
case GameVersion.AS:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetCanBeCaptured(species, SlotsA, StaticA);
|
2016-11-09 06:10:32 +00:00
|
|
|
|
case GameVersion.OR:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetCanBeCaptured(species, SlotsO, StaticO);
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
2016-05-06 03:35:18 +00:00
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static bool GetCanBeCaptured(int species, IEnumerable<EncounterArea> area, IEnumerable<EncounterStatic> statics, bool XY = false)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
|
|
|
|
if (XY && FriendSafari.Contains(species))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
if (area.Any(loc => loc.Slots.Any(slot => slot.Species == species)))
|
|
|
|
|
return true;
|
|
|
|
|
if (statics.Any(enc => enc.Species == species && !enc.Gift))
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool GetCanLearnMachineMove(PKM pkm, int move, int generation, GameVersion version = GameVersion.Any)
|
2017-02-15 22:33:59 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetValidMoves(pkm, version, GetValidPreEvolutions(pkm).ToArray(), generation, Machine: true).Contains(move);
|
2017-02-15 22:33:59 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool GetCanRelearnMove(PKM pkm, int move, int generation, GameVersion version = GameVersion.Any)
|
2016-05-10 01:19:31 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetValidMoves(pkm, version, GetValidPreEvolutions(pkm).ToArray(), generation, LVL: true, Relearn: true).Contains(move);
|
2016-05-10 02:24:52 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool GetCanLearnMove(PKM pkm, int move, int generation, GameVersion version = GameVersion.Any)
|
2016-05-10 02:24:52 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetValidMoves(pkm, version, GetValidPreEvolutions(pkm).ToArray(), generation, Tutor: true, Machine: true).Contains(move);
|
2016-05-10 02:24:52 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static bool GetCanKnowMove(PKM pkm, int move, int generation, GameVersion version = GameVersion.Any)
|
2016-05-10 02:24:52 +00:00
|
|
|
|
{
|
2016-10-23 19:48:49 +00:00
|
|
|
|
if (pkm.Species == 235 && !InvalidSketch.Contains(move))
|
2016-05-10 16:03:51 +00:00
|
|
|
|
return true;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetValidMoves(pkm, version, GetValidPreEvolutions(pkm).ToArray(), generation, LVL: true, Relearn: true, Tutor: true, Machine: true).Contains(move);
|
2016-05-10 01:19:31 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int GetBaseEggSpecies(PKM pkm, int skipOption = 0)
|
2017-04-13 15:48:13 +00:00
|
|
|
|
{
|
|
|
|
|
if (pkm.Format == 1)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetBaseSpecies(pkm, skipOption : skipOption, generation : 2);
|
|
|
|
|
return GetBaseSpecies(pkm, skipOption);
|
2017-04-13 15:48:13 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int GetBaseSpecies(PKM pkm, int skipOption = 0, int generation = -1)
|
2016-02-23 06:52:48 +00:00
|
|
|
|
{
|
2016-10-23 19:48:49 +00:00
|
|
|
|
if (pkm.Species == 292)
|
2016-03-18 02:37:06 +00:00
|
|
|
|
return 290;
|
2016-10-23 19:48:49 +00:00
|
|
|
|
if (pkm.Species == 242 && pkm.CurrentLevel < 3) // Never Cleffa
|
2016-05-10 04:09:38 +00:00
|
|
|
|
return 113;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var table = generation != -1 ? GetEvolutionTable(generation): GetEvolutionTable(pkm);
|
|
|
|
|
int maxSpeciesOrigin = generation != -1 ? GetMaxSpeciesOrigin(generation) : - 1;
|
|
|
|
|
var evos = table.GetValidPreEvolutions(pkm, 100, maxSpeciesOrigin: maxSpeciesOrigin, skipChecks:true).ToArray();
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2016-02-26 15:52:08 +00:00
|
|
|
|
switch (skipOption)
|
2016-02-23 06:52:48 +00:00
|
|
|
|
{
|
2016-10-23 19:48:49 +00:00
|
|
|
|
case -1: return pkm.Species;
|
|
|
|
|
case 1: return evos.Length <= 1 ? pkm.Species : evos[evos.Length - 2].Species;
|
|
|
|
|
default: return evos.Length <= 0 ? pkm.Species : evos.Last().Species;
|
2016-02-23 06:52:48 +00:00
|
|
|
|
}
|
2016-02-26 15:52:08 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int GetMaxLevelGeneration(PKM pkm)
|
2017-02-16 10:59:07 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetMaxLevelGeneration(pkm, pkm.GenNumber);
|
2017-02-16 10:59:07 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int GetMaxLevelGeneration(PKM pkm, int generation)
|
2017-02-16 10:59:07 +00:00
|
|
|
|
{
|
|
|
|
|
if (!pkm.InhabitedGeneration(generation))
|
2017-03-30 18:58:30 +00:00
|
|
|
|
return -1;
|
2017-02-16 10:59:07 +00:00
|
|
|
|
|
|
|
|
|
if (pkm.Format <= 2)
|
|
|
|
|
{
|
|
|
|
|
if (generation == 1 && FutureEvolutionsGen1_Gen2LevelUp.Contains(pkm.Species))
|
|
|
|
|
return pkm.CurrentLevel - 1;
|
|
|
|
|
return pkm.CurrentLevel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pkm.Species == 700 && generation == 5)
|
|
|
|
|
return pkm.CurrentLevel - 1;
|
|
|
|
|
|
2017-03-26 16:45:01 +00:00
|
|
|
|
if (pkm.Gen3 && pkm.Format > 4 && pkm.Met_Level == pkm.CurrentLevel && FutureEvolutionsGen3_LevelUpGen4.Contains(pkm.Species))
|
2017-02-16 10:59:07 +00:00
|
|
|
|
return pkm.Met_Level - 1;
|
|
|
|
|
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if (!pkm.HasOriginalMetLocation)
|
|
|
|
|
return pkm.Met_Level;
|
|
|
|
|
|
|
|
|
|
return pkm.CurrentLevel;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int GetMinLevelEncounter(PKM pkm)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
{
|
2017-03-26 16:05:58 +00:00
|
|
|
|
if (pkm.Format == 3 && pkm.WasEgg)
|
2017-03-30 18:58:30 +00:00
|
|
|
|
// Only for gen 3 pokemon in format 3, after transfer to gen 4 it should return transfer level
|
2017-03-26 16:05:58 +00:00
|
|
|
|
return 5;
|
2017-03-30 18:58:30 +00:00
|
|
|
|
if (pkm.Format == 4 && pkm.GenNumber == 4 && pkm.WasEgg)
|
|
|
|
|
// Only for gen 4 pokemon in format 4, after transfer to gen 5 it should return transfer level
|
|
|
|
|
return 1;
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return pkm.HasOriginalMetLocation ? pkm.Met_Level : GetMaxLevelGeneration(pkm);
|
2017-02-16 10:59:07 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int GetMinLevelGeneration(PKM pkm)
|
2017-02-16 10:59:07 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetMinLevelGeneration(pkm, pkm.GenNumber);
|
2017-02-16 10:59:07 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static int GetMinLevelGeneration(PKM pkm, int generation)
|
2017-02-16 10:59:07 +00:00
|
|
|
|
{
|
|
|
|
|
if (!pkm.InhabitedGeneration(generation))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (pkm.Format <= 2)
|
|
|
|
|
return 2;
|
|
|
|
|
|
2017-04-13 15:48:13 +00:00
|
|
|
|
if (!pkm.HasOriginalMetLocation && generation != pkm.GenNumber)
|
2017-02-16 10:59:07 +00:00
|
|
|
|
return pkm.Met_Level;
|
|
|
|
|
|
|
|
|
|
if (pkm.GenNumber <= 3)
|
|
|
|
|
return 2;
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2017-02-21 03:40:50 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static DexLevel[][] GetEvolutionChainsAllGens(PKM pkm, IEncounterable Encounter)
|
2017-02-15 22:10:20 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var CompleteEvoChain = GetEvolutionChain(pkm, Encounter).ToArray();
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
int maxgen = pkm.Format == 1 && !pkm.Gen1_NotTradeback ? 2 : pkm.Format;
|
|
|
|
|
int mingen = pkm.Format == 2 && !pkm.Gen2_NotTradeback ? 1 : pkm.GenNumber;
|
|
|
|
|
DexLevel[][] GensEvoChains = new DexLevel[maxgen + 1][];
|
|
|
|
|
for (int i = 0; i <= maxgen; i++)
|
2017-02-21 04:25:15 +00:00
|
|
|
|
GensEvoChains[i] = new DexLevel[0];
|
2017-02-15 22:10:20 +00:00
|
|
|
|
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if (pkm.Species == 0 || pkm.Format > 2 && pkm.GenU) // Illegal origin or empty pokemon, return only chain for current format
|
2017-02-15 22:10:20 +00:00
|
|
|
|
{
|
2017-02-21 03:40:50 +00:00
|
|
|
|
GensEvoChains[pkm.Format] = CompleteEvoChain;
|
2017-02-15 22:10:20 +00:00
|
|
|
|
return GensEvoChains;
|
|
|
|
|
}
|
2017-02-21 03:40:50 +00:00
|
|
|
|
// If is egg skip the other checks and just return the evo chain for GenNumber, that will contains only the pokemon inside the egg
|
|
|
|
|
// Empty list returned if is an impossible egg (like a gen 3 infernape inside an egg)
|
|
|
|
|
if (pkm.IsEgg)
|
2017-02-16 09:35:14 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
if (GetMaxSpeciesOrigin(pkm.GenNumber) >= pkm.Species)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
GensEvoChains[pkm.GenNumber] = CompleteEvoChain;
|
2017-02-16 09:35:14 +00:00
|
|
|
|
return GensEvoChains;
|
|
|
|
|
}
|
2017-02-15 22:10:20 +00:00
|
|
|
|
|
2017-02-21 03:40:50 +00:00
|
|
|
|
int lvl = pkm.CurrentLevel;
|
|
|
|
|
|
|
|
|
|
// Iterate generations backwards because level will be decreased from current level in each generation
|
2017-02-15 22:10:20 +00:00
|
|
|
|
for (int gen = maxgen; gen >= mingen; gen--)
|
|
|
|
|
{
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if (pkm.GenNumber == 1 && pkm.Gen1_NotTradeback && gen == 2)
|
2017-02-15 22:10:20 +00:00
|
|
|
|
continue;
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if (pkm.GenNumber <= 2 && 3 <= gen && gen <= 6)
|
2017-02-15 22:10:20 +00:00
|
|
|
|
continue;
|
2017-04-13 15:48:13 +00:00
|
|
|
|
if (!pkm.HasOriginalMetLocation && pkm.Format > 2 && gen < pkm.Format && gen <= 4 && lvl > pkm.Met_Level)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
{
|
|
|
|
|
// Met location was lost at this point but it also means the pokemon existed in generations 1 to 4 with maximum level equals to met level
|
|
|
|
|
lvl = pkm.Met_Level;
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int maxspeciesgen = GetMaxSpeciesOrigin(gen);
|
2017-02-21 03:40:50 +00:00
|
|
|
|
|
|
|
|
|
// Remove future gen evolutions after a few special considerations,
|
|
|
|
|
// it the pokemon origin is illegal like a "gen 3" Infernape the list will be emptied, it didnt existed in gen 3 in any evolution phase
|
2017-02-16 09:35:14 +00:00
|
|
|
|
while (CompleteEvoChain.Any() && CompleteEvoChain.First().Species > maxspeciesgen)
|
2017-02-15 22:10:20 +00:00
|
|
|
|
{
|
2017-02-21 03:40:50 +00:00
|
|
|
|
// Eevee requires to level one time to be Sylveon, it can be deduced in gen 5 and before it existed with maximum one level bellow current
|
2017-02-15 22:10:20 +00:00
|
|
|
|
if (CompleteEvoChain.First().Species == 700 && gen == 5)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
lvl--;
|
|
|
|
|
// This is a gen 3 pokemon in a gen 4 phase evolution that requieres level up and then transfered to gen 5+
|
|
|
|
|
// We can deduce that it existed in gen 4 until met level,
|
|
|
|
|
// but if current level is met level we can also deduce it existed in gen 3 until maximum met level -1
|
|
|
|
|
if (gen == 3 && pkm.Format > 4 && lvl == pkm.CurrentLevel && CompleteEvoChain.First().Species > MaxSpeciesID_3 && CompleteEvoChain.First().RequiresLvlUp)
|
|
|
|
|
lvl--;
|
|
|
|
|
// The same condition for gen2 evolution of gen 1 pokemon, level of the pokemon in gen 1 games would be CurrentLevel -1 one level bellow gen 2 level
|
|
|
|
|
if (gen == 1 && pkm.Format == 2 && lvl == pkm.CurrentLevel && CompleteEvoChain.First().Species > MaxSpeciesID_1 && CompleteEvoChain.First().RequiresLvlUp)
|
|
|
|
|
lvl--;
|
|
|
|
|
CompleteEvoChain = CompleteEvoChain.Skip(1).ToArray();
|
2017-02-15 22:10:20 +00:00
|
|
|
|
}
|
2017-02-21 03:40:50 +00:00
|
|
|
|
|
|
|
|
|
// Alolan form evolutions, remove from gens 1-6 chains
|
|
|
|
|
if (gen < 7 && pkm.Format >= 7 && CompleteEvoChain.Any() && CompleteEvoChain.First().Form > 0 && EvolveToAlolanForms.Contains(CompleteEvoChain.First().Species))
|
|
|
|
|
CompleteEvoChain = CompleteEvoChain.Skip(1).ToArray();
|
|
|
|
|
|
|
|
|
|
if (!CompleteEvoChain.Any())
|
|
|
|
|
continue;
|
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
GensEvoChains[gen] = GetEvolutionChain(pkm, Encounter, CompleteEvoChain.First().Species, lvl);
|
2017-03-10 04:27:03 +00:00
|
|
|
|
if (gen > 2 && !pkm.HasOriginalMetLocation && gen >= pkm.GenNumber)
|
2017-02-21 03:40:50 +00:00
|
|
|
|
//Remove previous evolutions bellow transfer level
|
|
|
|
|
//For example a gen3 charizar in format 7 with current level 36 and met level 36
|
|
|
|
|
//chain level for charmander is 35, is bellow met level
|
2017-06-18 01:37:19 +00:00
|
|
|
|
GensEvoChains[gen] = GensEvoChains[gen].Where(e => e.Level >= GetMinLevelGeneration(pkm, gen)).ToArray();
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
|
|
|
|
|
if (gen == 1 && GensEvoChains[gen].LastOrDefault()?.Species > MaxSpeciesID_1)
|
|
|
|
|
// Remove generation 2 pre-evolutions
|
|
|
|
|
GensEvoChains[gen] = GensEvoChains[gen].Take(GensEvoChains[gen].Length - 1).ToArray();
|
2017-02-15 22:10:20 +00:00
|
|
|
|
}
|
|
|
|
|
return GensEvoChains;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static DexLevel[] GetEvolutionChain(PKM pkm, IEncounterable Encounter)
|
2017-02-15 21:12:06 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
return GetEvolutionChain(pkm, Encounter, pkm.Species, 100);
|
2017-02-15 21:12:06 +00:00
|
|
|
|
}
|
2017-05-28 04:17:53 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static DexLevel[] GetEvolutionChain(PKM pkm, IEncounterable Encounter, int maxspec, int maxlevel)
|
2017-01-04 04:51:33 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
DexLevel[] vs = GetValidPreEvolutions(pkm).ToArray();
|
2017-01-04 04:51:33 +00:00
|
|
|
|
|
|
|
|
|
// Evolution chain is in reverse order (devolution)
|
2017-05-28 04:17:53 +00:00
|
|
|
|
int minspec = Encounter.Species;
|
2017-01-04 04:51:33 +00:00
|
|
|
|
|
2017-02-15 21:12:06 +00:00
|
|
|
|
int minindex = Math.Max(0, Array.FindIndex(vs, p => p.Species == minspec));
|
|
|
|
|
Array.Resize(ref vs, minindex + 1);
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if (vs.Last().MinLevel > 1) // Last entry from vs is removed, turn next entry into the wild/hatched pokemon
|
2017-02-15 21:12:06 +00:00
|
|
|
|
{
|
|
|
|
|
vs.Last().MinLevel = 1;
|
|
|
|
|
vs.Last().RequiresLvlUp = false;
|
|
|
|
|
if (vs.First().MinLevel == 2 && !vs.First().RequiresLvlUp)
|
|
|
|
|
{
|
2017-02-21 03:40:50 +00:00
|
|
|
|
// Example Raichu in gen 2 or later,
|
|
|
|
|
// because Pichu requires level up Minimum level of Raichu would be 2
|
|
|
|
|
// but after removing Pichu because the origin species is Pikachu, Raichu min level should be 1
|
2017-02-15 21:12:06 +00:00
|
|
|
|
vs.First().MinLevel = 1;
|
|
|
|
|
vs.First().RequiresLvlUp = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-02-21 03:40:50 +00:00
|
|
|
|
// Maxspec is used to remove future gen evolutions, to gather evolution chain of a pokemon in previous generations
|
2017-02-15 21:12:06 +00:00
|
|
|
|
int skip = Math.Max(0, Array.FindIndex(vs, p => p.Species == maxspec));
|
2017-02-21 03:40:50 +00:00
|
|
|
|
// Maxlevel is also used for previous generations, it removes evolutions imposible before the transfer level
|
|
|
|
|
// For example a fire red charizard whose current level in XY is 50 but met level is 20, it couldnt be a Charizard in gen 3 and 4 games
|
|
|
|
|
vs = vs.Skip(skip).Where(e => e.MinLevel <= maxlevel).ToArray();
|
|
|
|
|
// Reduce the evolution chain levels to max level, because met level is the last one when the pokemon could be and learn moves in that generation
|
2017-02-15 21:12:06 +00:00
|
|
|
|
foreach (DexLevel d in vs)
|
|
|
|
|
d.Level = Math.Min(d.Level, maxlevel);
|
2017-01-04 04:51:33 +00:00
|
|
|
|
return vs;
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static string GetEncounterTypeName(IEncounterable Encounter)
|
2017-01-04 04:51:33 +00:00
|
|
|
|
{
|
2017-05-28 04:17:53 +00:00
|
|
|
|
if (Encounter == null)
|
2017-01-04 04:51:33 +00:00
|
|
|
|
return "Unknown";
|
2017-05-28 04:17:53 +00:00
|
|
|
|
return Encounter.Name;
|
2016-03-23 02:47:13 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static IEnumerable<int> GetRelearnLVLMoves(PKM pkm, int species, int lvl, int formnum)
|
2016-03-12 03:43:40 +00:00
|
|
|
|
{
|
2016-10-24 05:03:19 +00:00
|
|
|
|
List<int> moves = new List<int>();
|
2017-03-18 23:50:34 +00:00
|
|
|
|
switch (pkm.GenNumber)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case 6:
|
|
|
|
|
if (pkm.InhabitedGeneration(6))
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int ind_XY = PersonalTable.XY.GetFormeIndex(species, formnum);
|
|
|
|
|
moves.AddRange(LevelUpXY[ind_XY].GetMoves(lvl));
|
|
|
|
|
int ind_AO = PersonalTable.AO.GetFormeIndex(species, formnum);
|
|
|
|
|
moves.AddRange(LevelUpAO[ind_AO].GetMoves(lvl));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
if (pkm.InhabitedGeneration(7))
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int ind_SM = PersonalTable.SM.GetFormeIndex(species, formnum);
|
|
|
|
|
moves.AddRange(LevelUpSM[ind_SM].GetMoves(lvl));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
break;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
|
|
|
|
return moves;
|
2016-03-12 03:43:40 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<DexLevel> GetValidPreEvolutions(PKM pkm, int maxspeciesorigin = -1, int lvl = -1, bool skipChecks = false)
|
2016-02-26 15:52:08 +00:00
|
|
|
|
{
|
2016-04-08 01:19:21 +00:00
|
|
|
|
if (lvl < 0)
|
2016-10-23 19:48:49 +00:00
|
|
|
|
lvl = pkm.CurrentLevel;
|
2017-02-05 21:08:25 +00:00
|
|
|
|
if (lvl == 1 && pkm.IsEgg)
|
|
|
|
|
return new List<DexLevel>
|
|
|
|
|
{
|
2017-02-21 03:40:50 +00:00
|
|
|
|
new DexLevel { Species = pkm.Species, Level = 1, MinLevel = 1 },
|
2017-02-05 21:08:25 +00:00
|
|
|
|
};
|
2017-02-15 22:33:59 +00:00
|
|
|
|
if (pkm.Species == 292 && lvl >= 20 && (!pkm.HasOriginalMetLocation || pkm.Met_Level + 1 <= lvl))
|
2016-03-18 02:37:06 +00:00
|
|
|
|
return new List<DexLevel>
|
|
|
|
|
{
|
2017-04-10 00:43:05 +00:00
|
|
|
|
new DexLevel { Species = 292, Level = lvl, MinLevel = 20 },
|
2017-05-17 04:09:53 +00:00
|
|
|
|
new DexLevel { Species = 290, Level = lvl - 1, MinLevel = 1 }
|
2016-03-18 02:37:06 +00:00
|
|
|
|
};
|
Generation 1 and 2 legal Improvements (#1099)
* Refactor parseMovesForEncounter to gather valid moves for species encounter, some Pokemon can have valid encounters with different source species from the encounter, the valid moves change if the encounter species change because some preevolutions moves are illegal if pokemon caught already evolved.
Example, generation 1 Pikachu that can have a RBY Pikachu encounter and GSC Pichu encounter, the valid moves for the first encounters should not have any Pichu exclusive evolution moves
Also assign the encounter match from gb when parsing moves like the variable Encounter Match, to store the encounter that is valid for the pokemon moves instead the first encounter.
Store the species encounter, this will be needed to check if the evolution is valid for species that evolve leveling with a given learned move
* Add Tradeback Status to the pokemon, this variable for generations 1 and 2 use data like the catch rate to determine if trade between generations 1 and 2 was possible.
If analysis is for VC games tradeback have value NotTradeback for every gen 1 pokemon, but for cart saves some pokemon can be determine that have not been tradeback, if catch rate match species catch rate but do not match a valid generation 2 held item that means the pokemon habe been never traded to generation 2 games, that allow to discart encounters and moves from generation 2.
Also if is not tradeback catch rate is used to filter encounters, catch rate determine in what species was captured the pokemon discarting some preevolutions moves
Also add option for generation 1 cart save analysis to check legal status not allowing generation 2 games, like VC games but with Stadium allowed, like the generation 1 non tradeback rules from Smogon
Also change evolution chains to included generation 2 preevolutions for gen 1 pokemon if tradeback was possible, it is needed to avoid parsemoves to check illegal pokemon like Hitmonchan with Tyrogue level up moves
* Check legal values of generation 1 type and catch rate
Replace pokemon catch rate after changind pokemon species always if pokemon was not tradeback from generation 2, the catch rate will keep unchanged only if it can be a held item and do not match species catch rate (default item)
Also if catch rate is changed use base species catch rate to avoid legal errors if the catch rate of the evolution species if is not possible with the current moves
* Filter ingame trades and static encounters with catch rate for generation 1 non tradeback
* Fix min moves for generation 1 metapod encounter
* Clean up
* Fix encounter level for generation 1, valid moves are those with one level after the encounter level, pokemon can not learn a new move until level up
Clean up type validation
Fix generation 3 fatefull encounter eggs, the pokemon lost the fatefull mark when it hatch
* Clean-up
* Use new variable EncounterSpecies when it is needed to detect the species of the encounter, the old code wont work if the encounter is a wild slots array
* Fix generation 1 evolution chains and catch rate as default held item
* Fix Generation 1 Yellow Pikachu and Kadabra catch rates
2017-04-27 04:27:59 +00:00
|
|
|
|
if (maxspeciesorigin == -1 && pkm.InhabitedGeneration(2) && pkm.GenNumber == 1)
|
|
|
|
|
maxspeciesorigin = MaxSpeciesID_2;
|
2016-11-08 16:43:57 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
var et = maxspeciesorigin == MaxSpeciesID_2 ? GetEvolutionTable(2) : GetEvolutionTable(pkm);
|
|
|
|
|
return et.GetValidPreEvolutions(pkm, lvl: lvl, maxSpeciesOrigin: maxspeciesorigin, skipChecks: skipChecks);
|
2016-02-23 06:52:48 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static IEnumerable<int> GetValidMoves(PKM pkm, GameVersion Version, IReadOnlyList<DexLevel[]> vs, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false, bool MoveReminder = true, bool RemoveTransferHM = true)
|
2016-05-10 02:03:58 +00:00
|
|
|
|
{
|
|
|
|
|
List<int> r = new List<int> { 0 };
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if (Relearn && pkm.Format >= 6)
|
|
|
|
|
r.AddRange(pkm.RelearnMoves);
|
|
|
|
|
|
|
|
|
|
for (int gen = pkm.GenNumber; gen <= pkm.Format; gen++)
|
2017-02-15 22:33:59 +00:00
|
|
|
|
if (vs[gen].Any())
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetValidMoves(pkm, Version, vs[gen], gen, minLvLG1: minLvLG1, minLvLG2: minLvLG2, LVL: LVL, Relearn: false, Tutor: Tutor, Machine: Machine, MoveReminder: MoveReminder, RemoveTransferHM: RemoveTransferHM));
|
2017-02-21 03:40:50 +00:00
|
|
|
|
|
2017-02-15 22:33:59 +00:00
|
|
|
|
return r.Distinct().ToArray();
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static IEnumerable<int> GetValidMoves(PKM pkm, GameVersion Version, DexLevel[] vs, int Generation, int minLvLG1 = 1, int minLvLG2 = 1, bool LVL = false, bool Relearn = false, bool Tutor = false, bool Machine = false, bool MoveReminder = true, bool RemoveTransferHM = true)
|
2017-02-15 22:33:59 +00:00
|
|
|
|
{
|
|
|
|
|
List<int> r = new List<int> { 0 };
|
|
|
|
|
if (!vs.Any())
|
|
|
|
|
return r;
|
2016-10-23 19:48:49 +00:00
|
|
|
|
int species = pkm.Species;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2016-11-12 13:56:22 +00:00
|
|
|
|
// Special Type Tutors Availability
|
2016-11-27 04:02:44 +00:00
|
|
|
|
bool moveTutor = Tutor || MoveReminder; // Usually true, except when called for move suggestions (no tutored moves)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2016-05-10 02:03:58 +00:00
|
|
|
|
if (FormChangeMoves.Contains(species)) // Deoxys & Shaymin & Giratina (others don't have extra but whatever)
|
|
|
|
|
{
|
2016-10-24 05:03:19 +00:00
|
|
|
|
int formcount = pkm.PersonalInfo.FormeCount;
|
2017-03-30 19:34:48 +00:00
|
|
|
|
if (species == 386 && pkm.Format == 3)
|
|
|
|
|
// In gen 3 deoxys has different forms depending on the current game, in personal info there is no alter form info
|
|
|
|
|
formcount = 4;
|
2016-05-10 02:03:58 +00:00
|
|
|
|
for (int i = 0; i < formcount; i++)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetMoves(pkm, species, minLvLG1, minLvLG2, vs.First().Level, i, moveTutor, Version, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, Generation));
|
2016-10-23 19:48:49 +00:00
|
|
|
|
if (Relearn) r.AddRange(pkm.RelearnMoves);
|
2017-03-17 04:20:06 +00:00
|
|
|
|
return r.Distinct();
|
2016-05-10 02:03:58 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (DexLevel evo in vs)
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
{
|
2017-06-07 23:15:13 +00:00
|
|
|
|
var minlvlevo1 = 1;
|
|
|
|
|
var minlvlevo2 = 1;
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (Generation == 1)
|
|
|
|
|
{
|
|
|
|
|
// Return moves from minLvLG1 if species if the species encounters
|
|
|
|
|
// For evolutions return moves using evolution min level as min level
|
2017-06-07 23:15:13 +00:00
|
|
|
|
minlvlevo1 = minLvLG1;
|
|
|
|
|
if (evo.MinLevel > 1)
|
|
|
|
|
minlvlevo1 = Math.Min(pkm.CurrentLevel, evo.MinLevel);
|
|
|
|
|
}
|
|
|
|
|
if (Generation == 2 && !AllowGen2MoveReminder)
|
|
|
|
|
{
|
|
|
|
|
minlvlevo2 = minLvLG2;
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (evo.MinLevel > 1)
|
2017-06-07 23:15:13 +00:00
|
|
|
|
minlvlevo2 = Math.Min(pkm.CurrentLevel, evo.MinLevel);
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetMoves(pkm, evo.Species, minlvlevo1, minlvlevo2, evo.Level, pkm.AltForm, moveTutor, Version, LVL, Tutor, Machine, MoveReminder, RemoveTransferHM, Generation));
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-02-14 06:49:32 +00:00
|
|
|
|
if (pkm.Format <= 3)
|
2017-03-17 04:20:06 +00:00
|
|
|
|
return r.Distinct();
|
2017-02-15 23:56:54 +00:00
|
|
|
|
if (LVL)
|
|
|
|
|
{
|
|
|
|
|
if (species == 479 && Generation >= 4) // Rotom
|
|
|
|
|
r.Add(RotomMoves[pkm.AltForm]);
|
2017-02-21 03:40:50 +00:00
|
|
|
|
|
|
|
|
|
if (species == 718 && Generation == 7) // Zygarde
|
|
|
|
|
r.AddRange(ZygardeMoves);
|
|
|
|
|
}
|
|
|
|
|
if (Tutor)
|
|
|
|
|
{
|
|
|
|
|
if (species == 647) // Keldeo
|
|
|
|
|
r.Add(548); // Secret Sword
|
|
|
|
|
if (species == 648) // Meloetta
|
2017-02-15 23:56:54 +00:00
|
|
|
|
r.Add(547); // Relic Song
|
|
|
|
|
|
|
|
|
|
if (species == 25 && pkm.Format == 6 && Generation == 6) // Pikachu
|
2017-06-10 04:43:46 +00:00
|
|
|
|
{
|
|
|
|
|
int index = pkm.AltForm - 1;
|
|
|
|
|
if (index >= 0 && index < CosplayPikachuMoves.Length)
|
|
|
|
|
r.Add(CosplayPikachuMoves[index]);
|
|
|
|
|
}
|
2017-02-15 23:56:54 +00:00
|
|
|
|
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if ((species == 25 || species == 26) && Generation == 7) // Pikachu/Raichu Tutor
|
|
|
|
|
r.Add(344); // Volt Tackle
|
2017-02-15 23:56:54 +00:00
|
|
|
|
}
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if (Relearn && Generation >= 6)
|
|
|
|
|
r.AddRange(pkm.RelearnMoves);
|
2017-03-17 04:20:06 +00:00
|
|
|
|
return r.Distinct();
|
2016-05-10 02:03:58 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private static IEnumerable<int> GetMoves(PKM pkm, int species, int minlvlG1, int minlvlG2, int lvl, int form, bool moveTutor, GameVersion Version, bool LVL, bool specialTutors, bool Machine, bool MoveReminder, bool RemoveTransferHM, int Generation)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
|
|
|
|
List<int> r = new List<int>();
|
2016-05-10 02:03:58 +00:00
|
|
|
|
|
2016-11-09 06:10:32 +00:00
|
|
|
|
var ver = Version;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
switch (Generation)
|
2016-05-10 02:03:58 +00:00
|
|
|
|
{
|
2017-02-13 01:00:03 +00:00
|
|
|
|
case 1:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.RB.GetFormeIndex(species, 0);
|
2017-02-21 03:40:50 +00:00
|
|
|
|
if (index == 0)
|
2017-02-16 10:59:07 +00:00
|
|
|
|
return r;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
|
2017-02-21 03:40:50 +00:00
|
|
|
|
var pi_rb = (PersonalInfoG1)PersonalTable.RB[index];
|
|
|
|
|
var pi_y = (PersonalInfoG1)PersonalTable.Y[index];
|
2017-02-13 01:00:03 +00:00
|
|
|
|
if (LVL)
|
|
|
|
|
{
|
Gen 1 move analysis improvement. Adapted the valid moves to take into account that move deleter and move reminder do not exits in generation 1 (#1037)
* Fix getMoves with min level, when SkipWhile and TakeWhile is used together the index i in TakeWhile is calculated from the enumerator that results of the SkipWhile function, not the index of the initial array, those giving an incorrect index to check Levels array in the TakeWhile
* Fix getMoves when levelmin or levelmax is above max level in the levels array, TakeWhile and SkipWhile return empty list if the while goes beyond the last element of the array
* Include player hatched egg in the list of possible encounters for parseMoves only if the pokemon was an egg
Also change the valur of WasEgg for gen1,2,3 pokemon if the encounter analyzed is not an egg
add the non egg encounters to the list instead of checking the non-egg encounter inside parseMovesWasEggPreRelearn
* Fix for gen3 egg encounters
Remove non-egg encounters without special moves if there is an egg encounter because egg encounter already cover every possible move combination
Do not add daycare egg encounter for gen3 unhatched egg if there is another encounter, that means is an event or gift egg, not a daycare egg
Remove duplicate encounters
* Gift egg should not allow inherited moves even it they dont have special moves
Those gift eggs are hatched only with the species base moves
* Added getEncounterMoves functions, to be used for generation 1 encounters to find what moves have a pokemon at the moment of being caught because there is no move reminder in generation 1
* Added GBEncounterData, structure for refactor the tuples used in generation 1 and 2 encounters
* Add LevelMin and LevelMax to IEncounterable to get the encounter moves by the min level of the generation 1 EncounterLink
Add iGeneration to difference generation 1 and generation 2 encounters for GB Era pokemon
* Mark generation in gen 1 and 2 encounters
There is no need to mark the generation in gen 3 to 7 encounters because in that generations it match the pokemon generation number
* Add min level for generation 1 moves in getMoves functions
Add function to return the default moves for a GB encounters, for generation 1 games that included both moves from level up table and level 1 moves from personal table
Fix getMoves with min level when the moves list is empty, like Raichu generation 1
* Add maxSpecies to getBaseSpecies function for gen1 pokemon with a gen2 egg encounter
Refactor VC Encounter changing Tuples for GBData class
* Fixed for gen 2 Checks
Also do not search for generation1 encounter if the gen2 pokemon have met location from crystal
* Fix VC wild encounters, should be stored as array or else other verifyEncounter functions wont work
* Add generation 1 parse moves function including default moves
* Clean-up get encounters
* Verify empty moves for generation 1 encounters, in generation 1 does not exits move deleter
That means when a move slot have been used by a level up move or a TM/HM/Tutor move it cant be empty again
Does not apply if generation 2 tradeback is allowed, in generation 2 there is a move deleter
* Added two edge cases for pokemon that learn in red/blue and yellow different moves at the same level, this combinations can not exits until a later level when they learn again one of the levels in the other game, only happen for flareon and vaporeon
* Check incompatible moves between evolution species, it is for species that learn a move in a level as an evolved species and a move at a upper level as a preevolution
Also added most edge cases for the min slots used for generation 1 games, i think every weird combination is already covered
* Fix gen 1 eevee and evolutions move checks
* Cleanup
* Move the code to change valid moves for generation 1 to a function
* Fix getMoveMinLevelGBEncounter
* getUsedMoveSlots, removed wild Butterfree edge case, it is not possible
* Filter the min level of the encounter by the possible games the pokemon could be originated, yellow pikachu and kadabra can be detected
2017-04-09 00:17:20 +00:00
|
|
|
|
if (minlvlG1 == 1)
|
|
|
|
|
{
|
|
|
|
|
r.AddRange(pi_rb.Moves);
|
|
|
|
|
r.AddRange(pi_y.Moves);
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpRB[index].GetMoves(lvl, minlvlG1));
|
|
|
|
|
r.AddRange(LevelUpY[index].GetMoves(lvl, minlvlG1));
|
2017-02-13 06:31:31 +00:00
|
|
|
|
}
|
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
|
|
|
|
r.AddRange(TMHM_RBY.Where((t, m) => pi_rb.TMHM[m]));
|
|
|
|
|
r.AddRange(TMHM_RBY.Where((t, m) => pi_y.TMHM[m]));
|
2017-02-13 01:00:03 +00:00
|
|
|
|
}
|
2017-02-14 06:49:32 +00:00
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-02-13 01:00:03 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2017-02-26 17:36:53 +00:00
|
|
|
|
case 2:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.C.GetFormeIndex(species, 0);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
2017-02-26 17:36:53 +00:00
|
|
|
|
if (LVL)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpGS[index].GetMoves(lvl, minlvlG2));
|
2017-06-07 04:59:29 +00:00
|
|
|
|
if (AllowGen2Crystal)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpC[index].GetMoves(lvl, minlvlG2));
|
2017-02-26 17:36:53 +00:00
|
|
|
|
}
|
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
2017-03-18 23:50:34 +00:00
|
|
|
|
var pi_c = (PersonalInfoG2)PersonalTable.C[index];
|
2017-02-26 17:36:53 +00:00
|
|
|
|
r.AddRange(TMHM_GSC.Where((t, m) => pi_c.TMHM[m]));
|
|
|
|
|
}
|
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-02-27 18:50:16 +00:00
|
|
|
|
if (pkm.Format == 1) //tradeback gen 2 -> gen 1
|
|
|
|
|
r = r.Where(m => m <= MaxMoveID_1).ToList();
|
2017-02-26 17:36:53 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case 3:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.E.GetFormeIndex(species, 0);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
if (LVL)
|
|
|
|
|
{
|
2017-04-10 00:43:05 +00:00
|
|
|
|
if (index == 386)
|
2017-03-20 17:53:16 +00:00
|
|
|
|
{
|
|
|
|
|
switch(form)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
case 0: r.AddRange(LevelUpRS[index].GetMoves(lvl)); break;
|
|
|
|
|
case 1: r.AddRange(LevelUpFR[index].GetMoves(lvl)); break;
|
|
|
|
|
case 2: r.AddRange(LevelUpLG[index].GetMoves(lvl)); break;
|
|
|
|
|
case 3: r.AddRange(LevelUpE[index].GetMoves(lvl)); break;
|
2017-03-20 17:53:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-27 21:11:16 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Emerald level up table are equals to R/S level up tables
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpE[index].GetMoves(lvl));
|
2017-03-27 21:11:16 +00:00
|
|
|
|
// fire red and leaf green are equals between each other but different than RSE
|
|
|
|
|
// Do not use FR Levelup table. It have 67 moves for charmander but Leaf Green moves table is correct
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpLG[index].GetMoves(lvl));
|
2017-03-27 21:11:16 +00:00
|
|
|
|
}
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
2017-03-20 22:50:23 +00:00
|
|
|
|
var pi_c = PersonalTable.E[index];
|
2017-03-18 23:50:34 +00:00
|
|
|
|
r.AddRange(TM_3.Where((t, m) => pi_c.TMHM[m]));
|
2017-03-25 12:26:33 +00:00
|
|
|
|
if (!RemoveTransferHM || pkm.Format == 3) // HM moves must be removed for 3->4, only give if current format.
|
2017-03-18 23:50:34 +00:00
|
|
|
|
r.AddRange(HM_3.Where((t, m) => pi_c.TMHM[m+50]));
|
|
|
|
|
}
|
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-03-25 12:26:33 +00:00
|
|
|
|
if (RemoveTransferHM && pkm.Format > 3) //Remove HM
|
2017-03-20 17:53:16 +00:00
|
|
|
|
r = r.Except(HM_3).ToList();
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 4:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.HGSS.GetFormeIndex(species, 0);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
if (LVL)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpDP[index].GetMoves(lvl));
|
|
|
|
|
r.AddRange(LevelUpPt[index].GetMoves(lvl));
|
|
|
|
|
r.AddRange(LevelUpHGSS[index].GetMoves(lvl));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
2017-03-20 17:53:16 +00:00
|
|
|
|
var pi_hgss = PersonalTable.HGSS[index];
|
|
|
|
|
var pi_dppt = PersonalTable.Pt[index];
|
2017-03-20 18:10:50 +00:00
|
|
|
|
r.AddRange(TM_4.Where((t, m) => pi_hgss.TMHM[m]));
|
2017-03-25 12:26:33 +00:00
|
|
|
|
if (RemoveTransferHM && pkm.Format > 4)
|
2017-03-20 18:10:50 +00:00
|
|
|
|
{
|
|
|
|
|
// The combination of both these moves is illegal, it should be checked that the pokemon only learn one
|
|
|
|
|
// except if it can learn any of these moves in gen 5 or later
|
|
|
|
|
if (pi_hgss.TMHM[96])
|
|
|
|
|
r.Add(250); // Whirlpool
|
|
|
|
|
if (pi_dppt.TMHM[96])
|
|
|
|
|
r.Add(432); // Defog
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
r.AddRange(HM_DPPt.Where((t, m) => pi_dppt.TMHM[m + 92]));
|
|
|
|
|
r.AddRange(HM_HGSS.Where((t, m) => pi_hgss.TMHM[m + 92]));
|
|
|
|
|
}
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-03-25 12:26:33 +00:00
|
|
|
|
if (RemoveTransferHM && pkm.Format > 4) //Remove HM
|
2017-03-20 17:53:16 +00:00
|
|
|
|
r = r.Except(HM_4_RemovePokeTransfer).ToList();
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index1 = PersonalTable.BW.GetFormeIndex(species, form);
|
|
|
|
|
int index2 = PersonalTable.B2W2.GetFormeIndex(species, form);
|
2017-06-10 00:52:20 +00:00
|
|
|
|
if (index1 == 0 && index2 == 0)
|
2017-03-18 23:50:34 +00:00
|
|
|
|
return r;
|
|
|
|
|
if (LVL)
|
|
|
|
|
{
|
2017-06-10 00:52:20 +00:00
|
|
|
|
if (index1 != 0)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpBW[index1].GetMoves(lvl));
|
2017-06-10 00:52:20 +00:00
|
|
|
|
if (index2 != 0)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpB2W2[index2].GetMoves(lvl));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
2017-06-10 00:52:20 +00:00
|
|
|
|
var pi_c = PersonalTable.B2W2[index2];
|
2017-03-19 07:00:15 +00:00
|
|
|
|
r.AddRange(TMHM_BW.Where((t, m) => pi_c.TMHM[m]));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
case 6:
|
|
|
|
|
switch (ver)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.Any: // Start at the top, hit every table
|
|
|
|
|
case GameVersion.X: case GameVersion.Y: case GameVersion.XY:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.XY.GetFormeIndex(species, form);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
|
|
|
|
|
if (LVL)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpXY[index].GetMoves(lvl));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
|
|
|
|
PersonalInfo pi = PersonalTable.XY[index];
|
|
|
|
|
r.AddRange(TMHM_XY.Where((t, m) => pi.TMHM[m]));
|
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
|
|
|
|
if (ver == GameVersion.Any) // Fall Through
|
|
|
|
|
goto case GameVersion.ORAS;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case GameVersion.AS: case GameVersion.OR: case GameVersion.ORAS:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.AO.GetFormeIndex(species, form);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return r;
|
|
|
|
|
|
|
|
|
|
if (LVL)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpAO[index].GetMoves(lvl));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
|
|
|
|
PersonalInfo pi = PersonalTable.AO[index];
|
|
|
|
|
r.AddRange(TMHM_AO.Where((t, m) => pi.TMHM[m]));
|
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
switch (ver)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.Any:
|
|
|
|
|
case GameVersion.SN: case GameVersion.MN: case GameVersion.SM:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
int index = PersonalTable.SM.GetFormeIndex(species, form);
|
2016-11-27 04:02:44 +00:00
|
|
|
|
if (MoveReminder)
|
|
|
|
|
lvl = 100; // Move reminder can teach any level in movepool now!
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (LVL)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(LevelUpSM[index].GetMoves(lvl));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (moveTutor)
|
2017-06-18 01:37:19 +00:00
|
|
|
|
r.AddRange(GetTutorMoves(pkm, species, form, specialTutors, Generation));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
if (Machine)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
PersonalInfo pi = PersonalTable.SM.GetFormeEntry(species, form);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
r.AddRange(TMHM_SM.Where((t, m) => pi.TMHM[m]));
|
|
|
|
|
}
|
2016-10-24 05:03:19 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2016-05-10 02:03:58 +00:00
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
default:
|
|
|
|
|
return r;
|
2016-05-10 02:03:58 +00:00
|
|
|
|
}
|
|
|
|
|
return r;
|
|
|
|
|
}
|
2017-05-28 04:17:53 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static int[] GetEggMoves(PKM pkm, int species, int formnum, GameVersion Version = GameVersion.Any)
|
2016-02-23 06:52:48 +00:00
|
|
|
|
{
|
2017-06-07 03:10:05 +00:00
|
|
|
|
if (!pkm.InhabitedGeneration(pkm.GenNumber, species) || pkm.PersonalInfo.Gender == 255)
|
2017-05-28 04:17:53 +00:00
|
|
|
|
return new int[0];
|
2017-02-15 08:11:12 +00:00
|
|
|
|
|
2016-10-24 05:03:19 +00:00
|
|
|
|
switch (pkm.GenNumber)
|
|
|
|
|
{
|
2017-02-28 04:57:24 +00:00
|
|
|
|
case 1:
|
|
|
|
|
case 2:
|
2017-06-07 04:59:29 +00:00
|
|
|
|
if (!AllowGen2Crystal)
|
|
|
|
|
return EggMovesGS[species].Moves;
|
2017-03-25 17:14:57 +00:00
|
|
|
|
if (pkm.Format != 2)
|
|
|
|
|
return EggMovesC[species].Moves;
|
|
|
|
|
if (pkm.HasOriginalMetLocation)
|
|
|
|
|
return EggMovesC[species].Moves;
|
|
|
|
|
if (pkm.Species > 151 && !FutureEvolutionsGen1.Contains(pkm.Species))
|
|
|
|
|
return EggMovesGS[species].Moves;
|
Shedinja evolution moves and some egg fixes (#1015)
* Add getMoves function with min level and max level, usefull for shedjina evolves moves (min level 20) and generation 1 moves ( no move reminder, min level is min encounter level + 1)
Also for gen1 encounters another function should be created to get by the encounter level the four moves that the pokemon learn by default, the last four in its movepool up until the encounter level
* getShedinjaEvolveMoves, function that return the moves that shedinja could learn from Ninjask move pool at the moment when Nincada evolves, in the same format that getValidMovesAllGens
* Add validation in parse moves for shedinja evolve moves.
Shedinja could have any gen3/4 moves from Ninjas learnset but only one is allowed
* Shedinja evolve moves text resources
* Fix egg moves pre-gen 6 validation:
Add skipoption variable to getEggMoves function from pre-gen6 games, to verify egg moves from split breed species
Flag illegal combinations of base egg moves and special egg moves
Return crystal egg moves for gen2 pokemon that can be tradeback to gen 1 games
* Fix for mix between event egg moves and base egg moves
* Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move
* Revert "Changes just to make if there is only shedinja evolve move that is also the only base egg move change it from base egg move to evolve move, to avoid flag illegal if also the pokemon have a special egg move"
Revert the last change, i search in bulbapedia an there wasn't any nincada distributed with special moves in generation 3 nor 4, making this complicated validation unnecessary
This reverts commit 57f5ac1bbb75e32e417b575619339cae5e5d1ef2.
* Fix error
2017-04-01 00:40:30 +00:00
|
|
|
|
return EggMovesC[species].Moves;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case 3:
|
|
|
|
|
return EggMovesRS[species].Moves;
|
|
|
|
|
case 4:
|
2017-06-03 07:12:05 +00:00
|
|
|
|
switch (pkm.Version)
|
2017-03-18 23:50:34 +00:00
|
|
|
|
{
|
2017-06-03 07:12:05 +00:00
|
|
|
|
case (int)GameVersion.HG:
|
|
|
|
|
case (int)GameVersion.SS:
|
2017-03-18 23:50:34 +00:00
|
|
|
|
return EggMovesHGSS[species].Moves;
|
|
|
|
|
default:
|
2017-06-03 07:12:05 +00:00
|
|
|
|
return EggMovesDPPt[species].Moves;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
case 5:
|
|
|
|
|
return EggMovesBW[species].Moves;
|
2016-12-03 17:38:24 +00:00
|
|
|
|
case 6: // entries per species
|
2017-05-28 04:17:53 +00:00
|
|
|
|
return EggMovesAO[species].Moves.Concat(EggMovesXY[species].Moves).ToArray();
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
2017-01-30 03:03:50 +00:00
|
|
|
|
case 7: // entries per form if required
|
2016-11-08 16:43:57 +00:00
|
|
|
|
var entry = EggMovesSM[species];
|
2017-01-31 01:49:28 +00:00
|
|
|
|
if (formnum > 0 && AlolanOriginForms.Contains(species))
|
2016-11-08 16:43:57 +00:00
|
|
|
|
entry = EggMovesSM[entry.FormTableIndex + formnum - 1];
|
|
|
|
|
return entry.Moves;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
|
|
|
|
|
default:
|
2017-05-28 04:17:53 +00:00
|
|
|
|
return new int[0];
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
2016-02-23 06:52:48 +00:00
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetTMHM(PKM pkm, int species, int form, int generation, GameVersion Version = GameVersion.Any, bool RemoveTransferHM = true)
|
2017-03-26 15:07:36 +00:00
|
|
|
|
{
|
|
|
|
|
List<int> moves = new List<int>();
|
|
|
|
|
int index;
|
|
|
|
|
switch (generation)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.RB.GetFormeIndex(species, 0);
|
2017-03-26 15:07:36 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return moves;
|
|
|
|
|
var pi_rb = (PersonalInfoG1)PersonalTable.RB[index];
|
|
|
|
|
var pi_y = (PersonalInfoG1)PersonalTable.Y[index];
|
|
|
|
|
moves.AddRange(TMHM_RBY.Where((t, m) => pi_rb.TMHM[m]));
|
|
|
|
|
moves.AddRange(TMHM_RBY.Where((t, m) => pi_y.TMHM[m]));
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.C.GetFormeIndex(species, 0);
|
2017-03-26 15:07:36 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return moves;
|
|
|
|
|
var pi_c = (PersonalInfoG2)PersonalTable.C[index];
|
|
|
|
|
moves.AddRange(TMHM_GSC.Where((t, m) => pi_c.TMHM[m]));
|
|
|
|
|
if (Version == GameVersion.Any)
|
2017-04-08 18:08:16 +00:00
|
|
|
|
goto case 1; // rby
|
2017-03-26 15:07:36 +00:00
|
|
|
|
break;
|
|
|
|
|
case 3:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.E.GetFormeIndex(species, 0);
|
2017-03-26 15:07:36 +00:00
|
|
|
|
var pi_e = PersonalTable.E[index];
|
|
|
|
|
moves.AddRange(TM_3.Where((t, m) => pi_e.TMHM[m]));
|
|
|
|
|
if (!RemoveTransferHM || pkm.Format == 3) // HM moves must be removed for 3->4, only give if current format.
|
|
|
|
|
moves.AddRange(HM_3.Where((t, m) => pi_e.TMHM[m + 50]));
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.HGSS.GetFormeIndex(species, 0);
|
2017-03-26 15:07:36 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return moves;
|
|
|
|
|
var pi_hgss = PersonalTable.HGSS[index];
|
|
|
|
|
var pi_dppt = PersonalTable.Pt[index];
|
|
|
|
|
moves.AddRange(TM_4.Where((t, m) => pi_hgss.TMHM[m]));
|
|
|
|
|
// The combination of both these moves is illegal, it should be checked that the pokemon only learn one
|
|
|
|
|
// except if it can learn any of these moves in gen 5 or later
|
|
|
|
|
if (Version == GameVersion.Any || Version == GameVersion.DP || Version == GameVersion.D || Version == GameVersion.P || Version == GameVersion.Pt)
|
|
|
|
|
{
|
|
|
|
|
if (RemoveTransferHM && pkm.Format > 4)
|
|
|
|
|
{
|
|
|
|
|
if (pi_dppt.TMHM[96])
|
|
|
|
|
moves.Add(432); // Defog
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
moves.AddRange(HM_DPPt.Where((t, m) => pi_dppt.TMHM[m + 92]));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (Version == GameVersion.Any || Version == GameVersion.HGSS || Version == GameVersion.HG || Version == GameVersion.SS)
|
|
|
|
|
{
|
|
|
|
|
if (RemoveTransferHM && pkm.Format > 4)
|
|
|
|
|
{
|
|
|
|
|
if (pi_hgss.TMHM[96])
|
|
|
|
|
moves.Add(432); // Defog
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
moves.AddRange(HM_HGSS.Where((t, m) => pi_dppt.TMHM[m + 92]));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.B2W2.GetFormeIndex(species, 0);
|
2017-03-26 15:07:36 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return moves;
|
|
|
|
|
|
|
|
|
|
var pi_bw = PersonalTable.B2W2[index];
|
|
|
|
|
moves.AddRange(TMHM_BW.Where((t, m) => pi_bw.TMHM[m]));
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
switch (Version)
|
|
|
|
|
{
|
|
|
|
|
case GameVersion.Any: // Start at the top, hit every table
|
|
|
|
|
case GameVersion.X:
|
|
|
|
|
case GameVersion.Y:
|
|
|
|
|
case GameVersion.XY:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.XY.GetFormeIndex(species, form);
|
2017-03-26 15:07:36 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return moves;
|
|
|
|
|
|
|
|
|
|
PersonalInfo pi_xy = PersonalTable.XY[index];
|
|
|
|
|
moves.AddRange(TMHM_XY.Where((t, m) => pi_xy.TMHM[m]));
|
|
|
|
|
|
|
|
|
|
if (Version == GameVersion.Any) // Fall Through
|
|
|
|
|
goto case GameVersion.ORAS;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case GameVersion.AS:
|
|
|
|
|
case GameVersion.OR:
|
|
|
|
|
case GameVersion.ORAS:
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.AO.GetFormeIndex(species, form);
|
2017-03-26 15:07:36 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return moves;
|
2017-04-08 18:08:16 +00:00
|
|
|
|
|
|
|
|
|
PersonalInfo pi_ao = PersonalTable.AO[index];
|
|
|
|
|
moves.AddRange(TMHM_AO.Where((t, m) => pi_ao.TMHM[m]));
|
2017-03-26 15:07:36 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
index = PersonalTable.SM.GetFormeIndex(species, form);
|
2017-04-08 18:08:16 +00:00
|
|
|
|
if (index == 0)
|
|
|
|
|
return moves;
|
|
|
|
|
|
|
|
|
|
PersonalInfo pi_sm = PersonalTable.SM[index];
|
2017-03-26 15:07:36 +00:00
|
|
|
|
moves.AddRange(TMHM_SM.Where((t, m) => pi_sm.TMHM[m]));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return moves.Distinct();
|
|
|
|
|
}
|
2017-06-18 01:37:19 +00:00
|
|
|
|
internal static IEnumerable<int> GetTutorMoves(PKM pkm, int species, int form, bool specialTutors, int generation)
|
2016-02-23 06:52:48 +00:00
|
|
|
|
{
|
2016-11-23 02:49:23 +00:00
|
|
|
|
List<int> moves = new List<int>();
|
2017-02-28 02:22:28 +00:00
|
|
|
|
PersonalInfo info;
|
2017-02-27 18:41:15 +00:00
|
|
|
|
switch (generation)
|
2016-10-24 05:03:19 +00:00
|
|
|
|
{
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case 1:
|
|
|
|
|
if (AllowGBCartEra && pkm.Format < 3 && (pkm.Species == 25 || pkm.Species == 26)) // Surf Pikachu via Stadium
|
|
|
|
|
moves.Add(57);
|
|
|
|
|
break;
|
2017-02-27 18:41:15 +00:00
|
|
|
|
case 2:
|
2017-03-20 22:50:23 +00:00
|
|
|
|
info = PersonalTable.C[species];
|
|
|
|
|
moves.AddRange(Tutors_GSC.Where((t, i) => info.TMHM[57 + i]));
|
2017-03-08 07:13:46 +00:00
|
|
|
|
goto case 1;
|
2017-03-18 23:50:34 +00:00
|
|
|
|
case 3:
|
|
|
|
|
// E Tutors (Free)
|
|
|
|
|
// E Tutors (BP)
|
2017-03-20 22:50:23 +00:00
|
|
|
|
info = PersonalTable.E[species];
|
|
|
|
|
moves.AddRange(Tutor_E.Where((t, i) => info.TypeTutors[i]));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
// FRLG Tutors
|
2017-03-20 17:53:16 +00:00
|
|
|
|
// Only special tutor moves, normal tutor moves are already included in Emerald data
|
2017-03-20 22:50:23 +00:00
|
|
|
|
moves.AddRange(SpecialTutors_FRLG.Where((t, i) => SpecialTutors_Compatibility_FRLG[i].Any(e => e == species)));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
// XD
|
2017-03-20 22:50:23 +00:00
|
|
|
|
moves.AddRange(SpecialTutors_XD_Exclusive.Where((t, i) => SpecialTutors_Compatibility_XD_Exclusive[i].Any(e => e == species)));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
// XD (Mew)
|
|
|
|
|
if (species == 151)
|
|
|
|
|
moves.AddRange(Tutor_3Mew);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
info = PersonalTable.HGSS[species];
|
|
|
|
|
moves.AddRange(Tutors_4.Where((t, i) => info.TypeTutors[i]));
|
2017-03-20 22:50:23 +00:00
|
|
|
|
moves.AddRange(SpecialTutors_4.Where((t, i) => SpecialTutors_Compatibility_4[i].Any(e => e == species)));
|
2017-03-18 23:50:34 +00:00
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
info = PersonalTable.B2W2[species];
|
|
|
|
|
moves.AddRange(TypeTutor6.Where((t, i) => info.TypeTutors[i]));
|
|
|
|
|
if (pkm.InhabitedGeneration(5) && specialTutors)
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
PersonalInfo pi = PersonalTable.B2W2.GetFormeEntry(species, form);
|
2017-03-18 23:50:34 +00:00
|
|
|
|
for (int i = 0; i < Tutors_B2W2.Length; i++)
|
|
|
|
|
for (int b = 0; b < Tutors_B2W2[i].Length; b++)
|
|
|
|
|
if (pi.SpecialTutors[i][b])
|
|
|
|
|
moves.Add(Tutors_B2W2[i][b]);
|
|
|
|
|
}
|
2017-02-27 18:41:15 +00:00
|
|
|
|
break;
|
|
|
|
|
case 6:
|
2017-02-28 02:22:28 +00:00
|
|
|
|
info = PersonalTable.AO[species];
|
2017-02-27 18:41:15 +00:00
|
|
|
|
moves.AddRange(TypeTutor6.Where((t, i) => info.TypeTutors[i]));
|
2017-04-15 02:55:40 +00:00
|
|
|
|
if (pkm.InhabitedGeneration(6) && specialTutors && (pkm.AO || !pkm.IsUntraded))
|
2017-02-27 18:41:15 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
PersonalInfo pi = PersonalTable.AO.GetFormeEntry(species, form);
|
2017-02-27 18:41:15 +00:00
|
|
|
|
for (int i = 0; i < Tutors_AO.Length; i++)
|
|
|
|
|
for (int b = 0; b < Tutors_AO[i].Length; b++)
|
|
|
|
|
if (pi.SpecialTutors[i][b])
|
|
|
|
|
moves.Add(Tutors_AO[i][b]);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
2017-06-18 01:37:19 +00:00
|
|
|
|
info = PersonalTable.SM.GetFormeEntry(species, form);
|
2017-03-15 07:04:16 +00:00
|
|
|
|
moves.AddRange(TypeTutor6.Where((t, i) => info.TypeTutors[i]));
|
2017-02-27 18:41:15 +00:00
|
|
|
|
// No special tutors in G7
|
|
|
|
|
break;
|
2016-10-24 05:03:19 +00:00
|
|
|
|
}
|
|
|
|
|
return moves.Distinct();
|
2016-02-23 06:52:48 +00:00
|
|
|
|
}
|
2017-06-07 03:10:05 +00:00
|
|
|
|
internal static bool IsTradedKadabraG1(PKM pkm)
|
|
|
|
|
{
|
2017-06-07 03:52:21 +00:00
|
|
|
|
if (!(pkm is PK1 pk1) || pk1.Species != 64)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
return false;
|
2017-06-07 03:52:21 +00:00
|
|
|
|
if (pk1.TradebackStatus == TradebackType.WasTradeback)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
return true;
|
|
|
|
|
var IsYellow = Savegame_Version == GameVersion.Y;
|
2017-06-07 03:52:21 +00:00
|
|
|
|
if (pk1.TradebackStatus == TradebackType.Gen1_NotTradeback)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
{
|
2017-06-07 03:52:21 +00:00
|
|
|
|
// If catch rate is Abra catch rate it wont trigger as invalid trade without evolution, it could be traded as Abra
|
|
|
|
|
var catch_rate = pk1.Catch_Rate;
|
|
|
|
|
// Yellow Kadabra catch rate in Red/Blue game, must be Alakazam
|
|
|
|
|
if (!IsYellow && catch_rate == PersonalTable.Y[64].CatchRate)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
return true;
|
2017-06-07 03:52:21 +00:00
|
|
|
|
// Red/Blue Kadabra catch rate in Yellow game, must be Alakazam
|
|
|
|
|
if (IsYellow && catch_rate == PersonalTable.RB[64].CatchRate)
|
2017-06-07 03:10:05 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if (IsYellow)
|
|
|
|
|
return false;
|
|
|
|
|
// Yellow only moves in Red/Blue game, must be Allakazham
|
2017-06-07 03:52:21 +00:00
|
|
|
|
if (pk1.Moves.Contains(134)) // Kinesis, yellow only move
|
2017-06-07 03:10:05 +00:00
|
|
|
|
return true;
|
2017-06-07 03:52:21 +00:00
|
|
|
|
if (pk1.CurrentLevel < 20 && pkm.Moves.Contains(50)) // Obtaining Disable below level 20 implies a yellow only move
|
2017-06-07 03:10:05 +00:00
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
Encounter Type fix and detection of pokemon that should have evolve on trade (#1105)
* Detect encounter trades that evolve on trade and have not been evolved
Detect generation 1 pokemon with special catch rates : krabby trade and Pokemon Stadium
Detect generation 1 pokemon that evolve on trade and have been traded but not evolved
Detect pokemon with tradeback status any but with only encounters from the other GB generation, that means they are WasTradeback
Detect pokemon with moves from the other GB generation, change tradebackstatus to WasTradeback
* Fix dppt surfing and fishing encounter type, is is surfing because the battle background is the same as other surfingfishing encounters
Fix headbutt encounter type, the encounter type depends on the battle background used when battle a pokemon, for headbutt it changes with the player tile, is the player is in a city it will be building encounter, in a grass tile tall grass, in water it is surfingfishing and cave inside a cave. Some locations have more than one possible encounter type, for example routes with trees near the grass, near the water and near non-combat tiles.
Also added slot type headbutt special for the special trees, those trees are all in routes and are only adjacent to non-combat tiles
* Fix encounter type for missing areas with multiple grass encounters types: Mt Coronet, Mt Silver Cave and Stark Mountain (Issue # 1095)
* Fixes and typos
* Check for non-japanese e-reader pokemon, is unreleased
2017-05-01 15:07:20 +00:00
|
|
|
|
internal static bool IsOutsider(PKM pkm)
|
|
|
|
|
{
|
|
|
|
|
var Outsider = Savegame_TID != pkm.TID || Savegame_OT != pkm.OT_Name;
|
|
|
|
|
if (pkm.Format <= 2)
|
|
|
|
|
return Outsider;
|
|
|
|
|
Outsider |= Savegame_SID != pkm.SID;
|
|
|
|
|
if (pkm.Format == 3) // Generation 3 does not check ot geneder nor pokemon version
|
|
|
|
|
return Outsider;
|
|
|
|
|
Outsider |= Savegame_Gender != pkm.OT_Gender || Savegame_Version != (GameVersion) pkm.Version;
|
|
|
|
|
return Outsider;
|
|
|
|
|
}
|
2016-02-23 06:52:48 +00:00
|
|
|
|
}
|
|
|
|
|
}
|