Merge pull request #947 from javierhimura/master

Gen 3 and 4 Encounter Slots, Gen 3 to 5 Evolves
This commit is contained in:
Kurt 2017-03-19 09:21:03 -07:00 committed by GitHub
commit 07b4db8bbe
25 changed files with 3956 additions and 2747 deletions

View file

@ -127,6 +127,16 @@ namespace PKHeX.Core
byte[] tables = null;
switch (Game)
{
case GameVersion.R: return EncounterArea.getArray3(Data.unpackMini(Resources.encounter_r, "ru"));
case GameVersion.S: return EncounterArea.getArray3(Data.unpackMini(Resources.encounter_s, "sa"));
case GameVersion.E: return EncounterArea.getArray3(Data.unpackMini(Resources.encounter_e, "em"));
case GameVersion.FR: return EncounterArea.getArray3(Data.unpackMini(Resources.encounter_fr, "fr"));
case GameVersion.LG: return EncounterArea.getArray3(Data.unpackMini(Resources.encounter_lg, "lg"));
case GameVersion.D: return EncounterArea.getArray4DPPt(Data.unpackMini(Resources.encounter_d, "da"));
case GameVersion.P: return EncounterArea.getArray4DPPt(Data.unpackMini(Resources.encounter_p, "pe"));
case GameVersion.Pt: return EncounterArea.getArray4DPPt(Data.unpackMini(Resources.encounter_pt, "pt"));
case GameVersion.HG: return EncounterArea.getArray4HGSS(Data.unpackMini(Resources.encounter_hg, "hg"));
case GameVersion.SS: return EncounterArea.getArray4HGSS(Data.unpackMini(Resources.encounter_ss, "ss"));
case GameVersion.B: ident = "51"; tables = Resources.encounter_b; break;
case GameVersion.W: ident = "51"; tables = Resources.encounter_w; break;
case GameVersion.B2: ident = "52"; tables = Resources.encounter_b2; break;
@ -156,7 +166,36 @@ namespace PKHeX.Core
}
return GameSlots;
}
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
// Group areas by location id, the raw data have areas with different slots but the same location id
Areas = Areas.Where(a => (a.Location < 188 || a.Location > 194)).
GroupBy(a => a.Location).
Select(a =>
new EncounterArea()
{ Location = a.First().Location, Slots = a.SelectMany(m => m.Slots).ToArray() }).
ToArray();
}
private static void MarkG3Slots_RSE(ref EncounterArea[] Areas)
{
// Group areas by location id, the raw data have areas with different slots but the same location id
Areas = Areas.GroupBy(a => a.Location).
Select(a =>
new EncounterArea()
{ Location = a.First().Location, Slots = a.SelectMany(m => m.Slots).ToArray() }).
ToArray();
}
private static void MarkG4Slots(ref EncounterArea[] Areas)
{
// Group areas by location id, the raw data have areas with different slots but the same location id
Areas = Areas.GroupBy(a => a.Location).
Select(a =>
new EncounterArea()
{ Location = a.First().Location, Slots = a.SelectMany(m => m.Slots).ToArray() }).
ToArray();
}
private static void MarkG5Slots(ref EncounterArea[] Areas)
{
foreach (var area in Areas)
@ -187,6 +226,12 @@ namespace PKHeX.Core
} while (ctr != area.Slots.Length);
area.Slots = area.Slots.Where(slot => slot.Species != 0).ToArray();
}
// Group areas by location id, the raw data have areas with different slots but the same location id
Areas = Areas.GroupBy(a => a.Location).
Select(a =>
new EncounterArea()
{ Location = a.First().Location, Slots = a.SelectMany(m => m.Slots).ToArray() }).
ToArray();
}
private static void MarkG6XYSlots(ref EncounterArea[] Areas)
{
@ -272,13 +317,25 @@ namespace PKHeX.Core
StaticFR = getStaticEncounters(GameVersion.FR);
StaticLG = getStaticEncounters(GameVersion.LG);
SlotsR = getEncounterTables(GameVersion.R);
SlotsS = getEncounterTables(GameVersion.S);
SlotsE = getEncounterTables(GameVersion.E);
SlotsFR = getEncounterTables(GameVersion.FR);
SlotsLG = getEncounterTables(GameVersion.LG);
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);
//Evolves3 = new EvolutionTree(Data.unpackMini(Resources.evos_rs, "rs"), GameVersion.RS, PersonalTable.RS, MaxSpeciesID_3);
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);
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);
Evolves3 = new EvolutionTree(new[] { Resources.evos_g3 }, GameVersion.RS, PersonalTable.RS, MaxSpeciesID_3);
// Update Personal Entries with TM/Tutor Data
var TMHM = Data.unpackMini(Resources.hmtm_g3, "g3");
@ -296,13 +353,33 @@ namespace PKHeX.Core
StaticHG = getStaticEncounters(GameVersion.HG);
StaticSS = getStaticEncounters(GameVersion.SS);
SlotsD = getEncounterTables(GameVersion.D);
SlotsP = getEncounterTables(GameVersion.P);
SlotsPt = getEncounterTables(GameVersion.Pt);
SlotsHG = getEncounterTables(GameVersion.HG);
SlotsSS = getEncounterTables(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);
var HG_Headbutt_Slots = EncounterArea.getArray4HGSS_Headbutt(Data.unpackMini(Resources.encunters_hb_hg, "hg"));
var SS_Headbutt_Slots = EncounterArea.getArray4HGSS_Headbutt(Data.unpackMini(Resources.encunters_hb_ss, "ss"));
//Evolves4 = new EvolutionTree(Data.unpackMini(Resources.evos_dp, "dp"), GameVersion.DP, PersonalTable.DP, MaxSpeciesID_4);
var D_HoneyTrees_Slots = SlotsD_HoneyTree.Clone(HoneyTreesLocation);
var P_HoneyTrees_Slots = SlotsP_HoneyTree.Clone(HoneyTreesLocation);
var Pt_HoneyTrees_Slots = SlotsPt_HoneyTree.Clone(HoneyTreesLocation);
MarkG4Slots(ref D_Slots);
MarkG4Slots(ref P_Slots);
MarkG4Slots(ref Pt_Slots);
MarkG4Slots(ref HG_Slots);
MarkG4Slots(ref SS_Slots);
MarkG4Slots(ref HG_Headbutt_Slots);
MarkG4Slots(ref SS_Headbutt_Slots);
SlotsD = addExtraTableSlots(addExtraTableSlots(D_Slots, D_HoneyTrees_Slots), SlotsDPPPtAlt);
SlotsP = addExtraTableSlots(addExtraTableSlots(P_Slots, P_HoneyTrees_Slots), SlotsDPPPtAlt);
SlotsPt = addExtraTableSlots(addExtraTableSlots(Pt_Slots, Pt_HoneyTrees_Slots), SlotsDPPPtAlt);
SlotsHG = addExtraTableSlots(addExtraTableSlots(HG_Slots, HG_Headbutt_Slots), SlotsHGSSAlt);
SlotsSS = addExtraTableSlots(addExtraTableSlots(SS_Slots, SS_Headbutt_Slots), SlotsHGSSAlt);
Evolves4 = new EvolutionTree(new[] { Resources.evos_g4 }, GameVersion.DP, PersonalTable.DP, MaxSpeciesID_4);
// Update Personal Entries with Tutor Data
var tutors = Data.unpackMini(Resources.tutors_g4, "g4");
@ -325,7 +402,7 @@ namespace PKHeX.Core
MarkG5Slots(ref SlotsB2);
MarkG5Slots(ref SlotsW2);
//Evolves5 = new EvolutionTree(Data.unpackMini(Resources.evos_bw, "bw"), GameVersion.BW, PersonalTable.BW, MaxSpeciesID_5);
Evolves5 = new EvolutionTree(new[] { Resources.evos_g5 }, GameVersion.BW, PersonalTable.BW, MaxSpeciesID_5);
}
// Gen 6
{
@ -363,10 +440,6 @@ namespace PKHeX.Core
Evolves7 = new EvolutionTree(Data.unpackMini(Resources.evos_sm, "sm"), GameVersion.SM, PersonalTable.SM, MaxSpeciesID_7);
}
// Temp
Evolves3 = Evolves4 = Evolves5 = Evolves6;
}
// Moves

View file

@ -27,6 +27,28 @@ namespace PKHeX.Core
}
}
public EncounterArea Clone(int location)
{
EncounterArea Areas = new EncounterArea();
Areas.Location = location;
Areas.Slots = new EncounterSlot[Slots.Length];
for (int i = 0; i < Slots.Length; i++)
{
Areas.Slots[i] = Slots[i].Clone();
}
return Areas;
}
public EncounterArea[] Clone(int[] locations)
{
EncounterArea[] Areas = new EncounterArea[locations.Length];
for(int i=0;i<locations.Length;i++)
{
Areas[i] = Clone(locations[i]);
}
return Areas;
}
private static EncounterSlot1[] getSlots1_GW(byte[] data, ref int ofs, SlotType t)
{
int rate = data[ofs++];
@ -224,6 +246,442 @@ namespace PKHeX.Core
return head.Concat(rock);
}
private static IEnumerable<EncounterSlot> getSlots3(byte[] data, ref int ofs, int numslots, SlotType t)
{
var slots = new List<EncounterSlot>();
int Ratio = data[ofs];
//1 byte padding
if (Ratio > 0)
{
for (int i = 0; i < numslots; i++)
{
int levelmin = data[ofs + 2 + i * 4];
int levelmax = data[ofs + 3 + i * 4];
int Species = PKX.getG4Species(BitConverter.ToUInt16(data, ofs + 4 + i * 4));
if (Species > 0)
slots.Add(new EncounterSlot()
{
LevelMin = levelmin,
LevelMax = levelmax,
Species = Species,
Type = t
});
}
}
ofs += 2 + numslots * 4;
return slots;
}
private static IEnumerable<EncounterSlot> getSlots3_F(byte[] data, ref int ofs, int numslots)
{
var slots = new List<EncounterSlot>();
int Ratio = data[ofs];
//1 byte padding
if (Ratio > 0)
{
for (int i = 0; i < numslots; i++)
{
SlotType t = i < 2 ? SlotType.Old_Rod : i < 5 ? SlotType.Good_Rod : SlotType.Super_Rod;
int levelmin = data[ofs + 2 + i * 4];
int levelmax = data[ofs + 3 + i * 4];
int Species = PKX.getG4Species(BitConverter.ToUInt16(data, ofs + 4 + i * 4));
if (Species > 0)
slots.Add(new EncounterSlot()
{
LevelMin = levelmin,
LevelMax = levelmax,
Species = Species,
Type = t
});
}
}
ofs += 2 + numslots * 4;
return slots;
}
private static EncounterSlot[] getSlots4_DPPt_G(byte[] data, ref int ofs, int numslots, SlotType t)
{
var slots = new EncounterSlot[numslots];
for (int i = 0; i < numslots; i++)
{
int levelmin = data[ofs + 2 + i * 4];
int levelmax = data[ofs + 3 + i * 4];
int Species = BitConverter.ToUInt16(data, ofs + 4 + i * 4);
int level = (int)BitConverter.ToUInt32(data, ofs + i * 8);
int species = (int)BitConverter.ToUInt32(data, ofs + i * 8);
slots[i] = new EncounterSlot()
{
LevelMax = level,
LevelMin = level,
Species = species,
Type = t
};
}
ofs += numslots * 8;
return slots;
}
private static EncounterSlot[] getSlots4_HGSS_G(byte[] data, ref int ofs, int numslots, SlotType t)
{
var slots = new EncounterSlot[numslots * 3];
// First 36 slots are morning, day and night grass slots
// The order is 12 level values, 12 morning species, 12 day species and 12 night species
for (int i = 0; i < numslots; i++)
{
int level = data[ofs + i];
int species = BitConverter.ToUInt16(data, ofs + numslots + i * 2);
slots[i] = new EncounterSlot()
{
LevelMin = level,
LevelMax = level,
Species = species,
Type = t
};
}
for (int i = 0; i < numslots; i++)
{
slots[numslots + i] = slots[i].Clone();
slots[numslots + i].Species = (int)BitConverter.ToUInt16(data, ofs + numslots * 3 + i * 2);
slots[numslots + i].Type = t;
}
for (int i = 0; i < numslots; i++)
{
slots[numslots * 2 + i] = slots[i].Clone();
slots[numslots * 2 + i].Species = (int)BitConverter.ToUInt16(data, ofs + numslots * 5 + i * 2);
slots[numslots * 2 + i].Type = t;
}
ofs += numslots * 7;
return slots;
}
private static IEnumerable<EncounterSlot> getSlots4DPPt_G_Replace(byte[] data, ref int ofs, int numslots, EncounterSlot[] ReplacedSlots, int StartReplace, SlotType t)
{
//Special slots like GBA Dual Slot. Those slot only contain the info the species, the level is copy from one of the first grass slots
var slots = new List<EncounterSlot>();
for (int i = 0; i < numslots; i++)
{
if(ReplacedSlots[StartReplace + i].LevelMin > 0)
{
var Species = (int)BitConverter.ToUInt32(data, ofs + i * 4);
if (Species > 0)
{
var slot = ReplacedSlots[StartReplace + i].Clone();
slot.Type = t;
slot.Species = Species;
slots.Add(slot);
}
}
}
ofs += numslots * 4;
return slots;
}
private static IEnumerable<EncounterSlot> getSlots4HGSS_G_Replace(byte[] data, ref int ofs, int numslots, EncounterSlot[] ReplacedSlots, int StartReplace, SlotType t)
{
//Special slots like GBA Dual Slot. Those slot only contain the info the species, the level is copy from one of the first grass slots
var slots = new List<EncounterSlot>();
for (int i = 0; i < numslots; i++)
{
if (ReplacedSlots[StartReplace + i].LevelMin > 0)
{
var Species = (int)BitConverter.ToUInt16(data, ofs + i * 2);
if (Species > 0)
{
var slot = ReplacedSlots[StartReplace + i].Clone();
slot.Type = t;
slot.Species = Species;
slots.Add(slot);
}
}
}
ofs += numslots * 2;
return slots;
}
private static IEnumerable<EncounterSlot> getSlots4_G_TimeReplace(byte[] data, ref int ofs, EncounterSlot[] GrassSlots, SlotType t)
{
var slots = new List<EncounterSlot>();
int[] CountReplaced = new int[2];
// Slots for day, morning and night slots IN DPPt. Only contain species data, level is copy from grass slot
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 2; j++)
{
var slot = GrassSlots[2 + j].Clone();
slot.Type = t;
slot.Species = (int)BitConverter.ToUInt32(data, ofs + i * 4);
if (slot.Species > 0)
{
CountReplaced[j] += 1;
slots.Add(slot);
}
}
ofs += 8;
}
// If the grass slot is replaced by all the time slots that means the species in the grass slot will never be used
// Unlike raid slot and gba dual slot the time of the day is always day, morning or night
if (CountReplaced[0] == 3)
GrassSlots[2].Species = 0;
if (CountReplaced[1] == 3)
GrassSlots[3].Species = 0;
return GrassSlots.Where(s => s.Species > 0).Concat(slots);
}
private static IEnumerable<EncounterSlot> getSlots4DPPt_WFR(byte[] data, ref int ofs, int numslots, SlotType t)
{
var slots = new List<EncounterSlot>();
for (int i = 0; i < numslots; i++)
{
int levelmin = data[ofs + 0 + i * 8];
int levelmax = data[ofs + 1 + i * 8];
//2 bytes padding
int Species = (int)BitConverter.ToUInt32(data, ofs + 4 + i * 8);
if (Species > 0)
slots.Add(new EncounterSlot()
{
LevelMin = levelmin,
LevelMax = levelmax,
Species = Species,
Type = t
});
}
ofs += numslots * 8;
return slots;
}
private static IEnumerable<EncounterSlot> getSlots4HGSS_WFR(byte[] data, ref int ofs, int numslots, SlotType t)
{
var slots = new List<EncounterSlot>();
for (int i = 0; i < numslots; i++)
{
int levelmin = data[ofs + 0 + i * 4];
int levelmax = data[ofs + 1 + i * 4];
int Species = (int)BitConverter.ToUInt16(data, ofs + 2 + i * 4);
if (Species > 0)
slots.Add(new EncounterSlot()
{
LevelMin = levelmin,
LevelMax = levelmax,
Species = Species,
Type = t
});
}
ofs += numslots * 4;
return slots;
}
private static EncounterArea getArea3(byte[] data)
{
EncounterArea Area3 = new EncounterArea();
bool HaveGrassSlots = false;
bool HaveSurfSlots = false;
bool HaveRockSmashSlots = false;
bool HaveFishingSlots = false;
if (data.Length < 6)
{ Area3.Location = 0; Area3.Slots = new EncounterSlot[0]; return Area3; }
Area3.Location = data[0];
HaveGrassSlots = data[1] == 1;
HaveSurfSlots = data[2] == 1;
HaveRockSmashSlots = data[3] == 1;
HaveFishingSlots = data[4] == 1;
int offset = 5;
var slots = new List<EncounterSlot>();
if (HaveGrassSlots)
slots.AddRange(getSlots3(data, ref offset, 12, SlotType.Grass));
if (HaveSurfSlots)
slots.AddRange(getSlots3(data, ref offset, 5, SlotType.Surf));
if (HaveRockSmashSlots)
slots.AddRange(getSlots3(data, ref offset, 5, SlotType.Rock_Smash));
if (HaveFishingSlots)
slots.AddRange(getSlots3_F(data, ref offset, 10));
Area3.Slots = slots.ToArray();
return Area3;
}
private static EncounterArea getArea4DPPt(byte[] data)
{
int ofs = 0;
int GrassRatio = 0;
int SurfRatio = 0;
int OldRodRatio = 0;
int GoodRodRatio = 0;
int SuperRodRatio = 0;
EncounterArea Area4 = new EncounterArea();
if (data.Length != 426)
{ Area4.Location = 0; Area4.Slots = new EncounterSlot[0]; return Area4; }
var Slots = new List<EncounterSlot>();
Area4.Location = BitConverter.ToUInt16(data, 0);
GrassRatio = (int)BitConverter.ToUInt32(data, 2);
ofs = 6;
if (GrassRatio > 0)
{
EncounterSlot[] GrassSlots = getSlots4_DPPt_G(data, ref ofs, 12, SlotType.Grass);
//Morning, Day and Night slots replace slots 2 and 3
Slots.AddRange(getSlots4_G_TimeReplace(data, ref ofs, GrassSlots, SlotType.Grass));
//Pokéradar slots replace slots 6,7,10 and 11
//Pokeradar is marked with different slot type because it have different PID-IV generation
Slots.AddRange(getSlots4DPPt_G_Replace(data, ref ofs, 2, GrassSlots, 6, SlotType.Pokeradar));
Slots.AddRange(getSlots4DPPt_G_Replace(data, ref ofs, 2, GrassSlots, 10, SlotType.Pokeradar));
ofs += 24; //24 bytes padding
//Dual Slots replace slots 8 and 9
Slots.AddRange(getSlots4DPPt_G_Replace(data, ref ofs, 2, GrassSlots, 8, SlotType.Grass)); //DualSlot_Ruby
Slots.AddRange(getSlots4DPPt_G_Replace(data, ref ofs, 2, GrassSlots, 8, SlotType.Grass)); //DualSlot_Sapphire
Slots.AddRange(getSlots4DPPt_G_Replace(data, ref ofs, 2, GrassSlots, 8, SlotType.Grass)); //DualSlot_Emerald
Slots.AddRange(getSlots4DPPt_G_Replace(data, ref ofs, 2, GrassSlots, 8, SlotType.Grass)); //DualSlot_FireRed
Slots.AddRange(getSlots4DPPt_G_Replace(data, ref ofs, 2, GrassSlots, 8, SlotType.Grass)); //DualSlot_LeafGreen
}
else
ofs = 206;
SurfRatio = (int)BitConverter.ToUInt32(data, ofs);
ofs += 4;
if (SurfRatio > 0)
Slots.AddRange(getSlots4DPPt_WFR(data, ref ofs, 5, SlotType.Surf));
else
ofs += 40;
ofs += 44; //44 bytes padding
OldRodRatio = (int)BitConverter.ToUInt32(data, 294);
ofs += 4;
if (OldRodRatio > 0)
Slots.AddRange(getSlots4DPPt_WFR(data, ref ofs, 5, SlotType.Old_Rod));
else
ofs += 40;
GoodRodRatio = (int)BitConverter.ToUInt32(data, 338);
ofs += 4;
if (GoodRodRatio > 0)
Slots.AddRange(getSlots4DPPt_WFR(data, ref ofs, 5, SlotType.Good_Rod));
else
ofs += 40;
SuperRodRatio = (int)BitConverter.ToUInt32(data, 382);
ofs += 4;
if (SuperRodRatio > 0)
Slots.AddRange(getSlots4DPPt_WFR(data, ref ofs, 5, SlotType.Super_Rod));
else
ofs += 40;
Area4.Slots = Slots.ToArray();
return Area4;
}
private static EncounterArea getArea4HGSS(byte[] data)
{
int GrassRatio = 0;
int SurfRatio = 0;
int OldRodRatio = 0;
int GoodRodRatio = 0;
int SuperRodRatio = 0;
int RockSmashRatio = 0;
EncounterArea Area4 = new EncounterArea();
if (data.Length != 198)
{ Area4.Location = 0; Area4.Slots = new EncounterSlot[0]; return Area4; }
var Slots = new List<EncounterSlot>();
Area4.Location = BitConverter.ToUInt16(data, 0);
GrassRatio = data[2];
SurfRatio = data[3];
RockSmashRatio = data[4];
OldRodRatio = data[5];
GoodRodRatio = data[6];
SuperRodRatio = data[7];
// 2 bytes padding
int ofs = 10;
EncounterSlot[] GrassSlots = null;
if (GrassRatio > 0)
{
// First 36 slots are morning, day and night grass slots
// The order is 12 level values, 12 morning species, 12 day species and 12 night species
GrassSlots = getSlots4_HGSS_G(data, ref ofs, 12, SlotType.Grass);
Slots.AddRange(GrassSlots.Where(s => s.Species > 0));
// Hoeen Sound and Shinno Soundreplace slots 4 and 5
Slots.AddRange(getSlots4HGSS_G_Replace(data, ref ofs, 2, GrassSlots, 4, SlotType.Grass));
Slots.AddRange(getSlots4HGSS_G_Replace(data, ref ofs, 2, GrassSlots, 4, SlotType.Grass));
}
else
ofs = 102;
if (SurfRatio > 0)
Slots.AddRange(getSlots4HGSS_WFR(data, ref ofs, 5, SlotType.Surf));
else
ofs += 20;
if (RockSmashRatio > 0)
Slots.AddRange(getSlots4HGSS_WFR(data, ref ofs, 2, SlotType.Rock_Smash));
else
ofs += 8;
if (OldRodRatio > 0)
Slots.AddRange(getSlots4HGSS_WFR(data, ref ofs, 5, SlotType.Old_Rod));
else
ofs += 20;
if (GoodRodRatio > 0)
Slots.AddRange(getSlots4HGSS_WFR(data, ref ofs, 5, SlotType.Good_Rod));
else
ofs += 20;
if (SuperRodRatio > 0)
Slots.AddRange(getSlots4HGSS_WFR(data, ref ofs, 5, SlotType.Super_Rod));
else
ofs += 20;
if (GrassRatio > 0)
{
// National Radio replaces slots 4 and 5
Slots.AddRange(getSlots4HGSS_G_Replace(data, ref ofs, 2, GrassSlots, 4, SlotType.Grass));
}
// 4 bytes padding
Area4.Slots = Slots.ToArray();
return Area4;
}
private static EncounterArea getArea4HGSS_Headbutt(byte[] data)
{
EncounterArea Area4 = new EncounterArea();
if (data.Length < 78)
{ Area4.Location = 0; Area4.Slots = new EncounterSlot[0]; return Area4; }
Area4.Location = BitConverter.ToUInt16(data, 0);
//4 bytes padding
var Slots = new List<EncounterSlot>();
// 00-11 Normal trees
// 12-17 Special trees
for (int i = 0; i < 18; i++)
{
int Species = BitConverter.ToUInt16(data, 6 + i * 4);
if (Species > 0)
{
Slots.Add(new EncounterSlot()
{
Species = Species,
LevelMin = data[8 + i * 4],
LevelMax = data[9 + i * 4],
Type = SlotType.Headbutt
});
}
}
Area4.Slots = Slots.ToArray();
return Area4;
}
/// <summary>
/// RBY Format Slot Getter from data.
/// </summary>
@ -375,6 +833,86 @@ namespace PKHeX.Core
return getAreas2_H(data, ref ofs).ToArray();
}
/// <summary>
/// Gets the encounter areas with <see cref="EncounterSlot"/> information from Generation 3 data.
/// </summary>
/// <param name="entries">Raw data, one byte array per encounter area</param>
/// <returns>Array of encounter areas.</returns>
public static EncounterArea[] getArray3(byte[][] entries)
{
if (entries == null)
return null;
var Areas = new List<EncounterArea>();
for (int i = 0; i < entries.Length; i++)
{
EncounterArea Area = getArea3(entries[i]);
if (Area.Slots.Any())
Areas.Add(Area);
}
return Areas.ToArray();
}
/// <summary>
/// Gets the encounter areas with <see cref="EncounterSlot"/> information from Generation 4 Diamond, Pearl and Platinum data.
/// </summary>
/// <param name="entries">Raw data, one byte array per encounter area</param>
/// <returns>Array of encounter areas.</returns>
public static EncounterArea[] getArray4DPPt(byte[][] entries)
{
if (entries == null)
return null;
var Areas = new List<EncounterArea>();
for (int i = 0; i < entries.Length; i++)
{
EncounterArea Area = getArea4DPPt(entries[i]);
if (Area.Slots.Any())
Areas.Add(Area);
}
return Areas.ToArray();
}
/// <summary>
/// Gets the encounter areas with <see cref="EncounterSlot"/> information from Generation 4 Hearth Gold and Soul Silver data.
/// </summary>
/// <param name="entries">Raw data, one byte array per encounter area</param>
/// <returns>Array of encounter areas.</returns>
public static EncounterArea[] getArray4HGSS(byte[][] entries)
{
if (entries == null)
return null;
var Areas = new List<EncounterArea>();
for (int i = 0; i < entries.Length; i++)
{
EncounterArea Area = getArea4HGSS(entries[i]);
if (Area.Slots.Any())
Areas.Add(Area);
}
return Areas.ToArray();
}
/// <summary>
/// Gets the encounter areas with <see cref="EncounterSlot"/> information from Generation 4 Hearth Gold and Soul Silver Headbutt tree data.
/// </summary>
/// <param name="entries">Raw data, one byte array per encounter area</param>
/// <returns>Array of encounter areas.</returns>
public static EncounterArea[] getArray4HGSS_Headbutt(byte[][] entries)
{
if (entries == null)
return null;
var Areas = new List<EncounterArea>();
for (int i = 0; i < entries.Length; i++)
{
EncounterArea Area = getArea4HGSS_Headbutt(entries[i]);
if (Area.Slots.Any())
Areas.Add(Area);
}
return Areas.ToArray();
}
public static EncounterArea[] getArray(byte[][] entries)
{
if (entries == null)

View file

@ -25,6 +25,15 @@ namespace PKHeX.Core
case GameVersion.GSC:
Entries = EvolutionSet2.getArray(data[0], maxSpeciesTree);
break;
case GameVersion.RS:
Entries = EvolutionSet3.getArray(data[0]);
break;
case GameVersion.DP:
Entries = EvolutionSet4.getArray(data[0]);
break;
case GameVersion.BW:
Entries = EvolutionSet5.getArray(data[0]);
break;
case GameVersion.ORAS:
Entries.AddRange(data.Select(d => new EvolutionSet6(d)));
break;
@ -256,6 +265,164 @@ namespace PKHeX.Core
return evos;
}
}
public class EvolutionSet3 : EvolutionSet
{
private static EvolutionMethod getMethod(byte[] data, int offset)
{
int method = BitConverter.ToUInt16(data, offset + 0);
int arg = BitConverter.ToUInt16(data, offset + 2);
int species = PKX.getG4Species(BitConverter.ToUInt16(data, offset + 4));
//2 bytes padding
switch (method)
{
case 1: /* Friendship*/
case 2: /* Friendship day*/
case 3: /* Friendship night*/
case 5: /* Trade */
case 6: /* Trade while holding */
return new EvolutionMethod { Method = method, Species = species, Argument = arg };
case 4: /* Level Up */
return new EvolutionMethod { Method = 4, Species = species, Level = arg, Argument = arg };
case 7: /* Use item */
case 15: /* Beauty evolution*/
return new EvolutionMethod { Method = method + 1, Species = species, Argument = arg };
case 8: /* Tyrogue -> Hitmonchan */
case 9: /* Tyrogue -> Hitmonlee */
case 10: /* Tyrogue -> Hitmontop*/
case 11: /* Wurmple -> Silcoon evolution */
case 12: /* Wurmple -> Cascoon evolution */
case 13: /* Nincada -> Ninjask evolution */
case 14: /* Shedinja spawn in Nincada -> Ninjask evolution */
return new EvolutionMethod { Method = method + 1, Species = species, Level = arg, Argument = arg };
}
return null;
}
public static List<EvolutionSet> getArray(byte[] data)
{
EvolutionSet[] evos = new EvolutionSet[Legal.MaxSpeciesID_3 + 1];
evos[0] = new EvolutionSet3 { PossibleEvolutions = new EvolutionMethod[0] };
for (int i = 0; i <= Legal.MaxSpeciesIndex_3; i++)
{
int g4species = PKX.getG4Species(i);
if (g4species == 0)
continue;
int offset = i * 40;
var m_list = new List<EvolutionMethod>();
for (int j = 0; j < 5; j++)
{
EvolutionMethod m = getMethod(data, offset);
if(m!=null)
m_list.Add(m);
else
break;
offset += 8;
}
evos[g4species] = new EvolutionSet3 { PossibleEvolutions = m_list.ToArray() };
}
return evos.ToList();
}
}
public class EvolutionSet4 : EvolutionSet
{
private static EvolutionMethod getMethod(byte[] data, int offset)
{
int[] argEvos = { 6, 8, 16, 17, 18, 19, 20, 21, 22 };
int method = BitConverter.ToUInt16(data, offset + 0);
int arg = BitConverter.ToUInt16(data, offset + 2);
int species = BitConverter.ToUInt16(data, offset + 4);
if (method == 0)
return null;
// To have the same estructure as gen 6
// Gen 4 Method 6 is Gen 6 Method 7, G4 7 = G6 8, and so on
if (method > 6)
method++;
var evo = new EvolutionMethod
{
Method = method,
Argument = arg,
Species = species,
Level = arg,
};
if (argEvos.Contains(evo.Method))
evo.Level = 0;
return evo;
}
public static List<EvolutionSet> getArray(byte[] data)
{
var evos = new List<EvolutionSet>();
for (int i = 0; i <= Legal.MaxSpeciesIndex_4_HGSSPt; i++)
{
/* 44 bytes per species,
* for every species 7 evolutions with 6 bytes per evolution,
* last 2 bytes of every specie is padding*/
int offset = i * 44;
var m_list = new List<EvolutionMethod>();
for (int j = 0; j < 7; j++)
{
EvolutionMethod m = getMethod(data, offset);
if (m != null)
m_list.Add(m);
else
break;
offset += 6;
}
evos.Add(new EvolutionSet4 { PossibleEvolutions = m_list.ToArray() });
}
return evos.ToList();
}
}
public class EvolutionSet5 : EvolutionSet
{
private static EvolutionMethod getMethod(byte[] data, int offset)
{
int[] argEvos = { 6, 8, 16, 17, 18, 19, 20, 21, 22 };
int method = BitConverter.ToUInt16(data, offset + 0);
int arg = BitConverter.ToUInt16(data, offset + 2);
int species = BitConverter.ToUInt16(data, offset + 4);
if (method == 0)
return null;
var evo = new EvolutionMethod
{
Method = method,
Argument = arg,
Species = species,
Level = arg,
};
if (argEvos.Contains(evo.Method))
evo.Level = 0;
return evo;
}
public static List<EvolutionSet> getArray(byte[] data)
{
var evos = new List<EvolutionSet>();
for (int i = 0; i <= Legal.MaxSpeciesIndex_5_B2W2; i++)
{
/* 42 bytes per species,
* for every species 7 evolutions with 6 bytes per evolution*/
int offset = i * 42;
var m_list = new List<EvolutionMethod>();
for (int j = 0; j < 7; j++)
{
EvolutionMethod m = getMethod(data, offset);
if (m != null)
m_list.Add(m);
else
break;
offset += 6;
}
evos.Add(new EvolutionSet5 { PossibleEvolutions = m_list.ToArray() });
}
return evos.ToList();
}
}
public class EvolutionSet6 : EvolutionSet
{
private const int SIZE = 6;

View file

@ -19,5 +19,7 @@
SOS,
Swarm,
Headbutt,
Pokeradar,
HoneyTree
}
}

View file

@ -4,6 +4,7 @@ namespace PKHeX.Core
{
public static partial class Legal
{
internal const int MaxSpeciesIndex_3 = 412;
internal const int MaxSpeciesID_3 = 386;
internal const int MaxMoveID_3 = 354;
internal const int MaxItemID_3 = 374;
@ -143,5 +144,83 @@ namespace PKHeX.Core
//todo
};
#region AltSlots
private static readonly EncounterArea[] SlotsRSEAlt =
{
new EncounterArea {
Location = 34, // Route 119
Slots = new[]
{
new EncounterSlot { Species = 349, LevelMin = 20, LevelMax = 25, Type = SlotType.Super_Rod, Form = 25 }, // Feebas
},}
};
private static readonly EncounterArea[] SlotsFRLGAlt =
{
new EncounterArea {
Location = 188, // Monean Chamber
Slots = new[]
{
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 0 }, // Unown A
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 26 }, // Unown ?
},},
new EncounterArea {
Location = 189, // Liptoo Chamber
Slots = new[]
{
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 2 }, // Unown C
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 3 }, // Unown D
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 7 }, // Unown H
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 14 }, // Unown O
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 20 }, // Unown U
},},
new EncounterArea {
Location = 190, // Weepth Chamber
Slots = new[]
{
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 4 }, // Unown E
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 8 }, // Unown I
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 13 }, // Unown N
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 18 }, // Unown S
},},
new EncounterArea {
Location = 191, // Dilford Chamber
Slots = new[]
{
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 9 }, // Unown J
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 11 }, // Unown L
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 15 }, // Unown P
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 16 }, // Unown Q
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 17 }, // Unown R
},},
new EncounterArea {
Location = 192, // Scufib Chamber
Slots = new[]
{
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 5 }, // Unown F
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 6 }, // Unown G
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 10 }, // Unown K
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 19 }, // Unown T
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 24 }, // Unown Y
},},
new EncounterArea {
Location = 193, // Rixy Chamber
Slots = new[]
{
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 1 }, // Unown B
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 12 }, // Unown M
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 21 }, // Unown V
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 22 }, // Unown W
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 23 }, // Unown X
},},
new EncounterArea {
Location = 193, // Viapois Chamber
Slots = new[]
{
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 25 }, // Unown Z
new EncounterSlot { Species = 201, LevelMin = 25, LevelMax = 25, Type = SlotType.Grass, Form = 27 }, // Unown !
},}
};
#endregion
}
}

View file

@ -4,6 +4,8 @@ namespace PKHeX.Core
{
public static partial class Legal
{
internal const int MaxSpeciesIndex_4_DP = 500;
internal const int MaxSpeciesIndex_4_HGSSPt = 507;
internal const int MaxSpeciesID_4 = 493;
internal const int MaxMoveID_4 = 467;
internal const int MaxItemID_4_DP = 464;
@ -419,5 +421,141 @@ namespace PKHeX.Core
new EncounterTrade { Species = 021, Ability = 1, TID = 01001, SID = 00000, OTGender = 0, Gender = 1, Nature = Nature.Hasty, Level = 20, Location = 183, Moves= new int[]{043,031,228,332}},//Webster's Spearow
new EncounterTrade { Species = 213, Ability = 2, TID = 04336, SID = 00000, OTGender = 0, Gender = 1, Nature = Nature.Relaxed, Level = 20, Location = 130, Moves= new int[]{132,117,227,219}},//Kirk's Shuckle
};
#region Alt Slots
private static readonly EncounterArea[] SlotsDPPPtAlt =
{
new EncounterArea {
Location = 50, // Mount Coronet
Slots = new[]
{
new EncounterSlot { Species = 349, LevelMin = 10, LevelMax = 20, Type = SlotType.Old_Rod }, // Feebas
new EncounterSlot { Species = 349, LevelMin = 10, LevelMax = 20, Type = SlotType.Good_Rod }, // Feebas
new EncounterSlot { Species = 349, LevelMin = 10, LevelMax = 20, Type = SlotType.Super_Rod }, // Feebas
},},
new EncounterArea {
Location = 53, //Solaceon Ruins
Slots = new[]
{
//new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 0 }, // Unown A
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 1 }, // Unown B
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 2 }, // Unown C
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 3 }, // Unown D
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 4 }, // Unown E
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 5 }, // Unown F
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 6 }, // Unown G
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 7 }, // Unown H
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 8 }, // Unown I
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 9 }, // Unown J
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 10 }, // Unown K
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 11 }, // Unown L
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 12 }, // Unown M
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 13 }, // Unown N
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 14 }, // Unown O
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 15 }, // Unown P
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 16 }, // Unown Q
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 17 }, // Unown R
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 18 }, // Unown S
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 19 }, // Unown T
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 20 }, // Unown U
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 21 }, // Unown V
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 22 }, // Unown W
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 23 }, // Unown X
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 24 }, // Unown Y
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 25 }, // Unown !
new EncounterSlot { Species = 201, LevelMin = 14, LevelMax = 30, Type = SlotType.Grass, Form = 26 }, // Unown ?
},},
};
private static readonly EncounterArea[] SlotsHGSSAlt =
{
new EncounterArea {
Location = 209, // Ruins of Alph
Slots = new[]
{
//new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 0 }, // Unown A
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 1 }, // Unown B
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 2 }, // Unown C
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 3 }, // Unown D
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 4 }, // Unown E
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 5 }, // Unown F
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 6 }, // Unown G
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 7 }, // Unown H
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 8 }, // Unown I
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 9 }, // Unown J
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 10 }, // Unown K
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 11 }, // Unown L
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 12 }, // Unown M
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 13 }, // Unown N
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 14 }, // Unown O
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 15 }, // Unown P
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 16 }, // Unown Q
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 17 }, // Unown R
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 18 }, // Unown S
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 19 }, // Unown T
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 20 }, // Unown U
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 21 }, // Unown V
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 22 }, // Unown W
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 23 }, // Unown X
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 24 }, // Unown Y
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 25 }, // Unown !
new EncounterSlot { Species = 201, LevelMin = 5, LevelMax = 5, Type = SlotType.Grass, Form = 26 }, // Unown ?
},},
};
private static readonly EncounterArea SlotsPt_HoneyTree =
new EncounterArea
{
Slots = new[]
{
new EncounterSlot { Species = 190, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Aipom
new EncounterSlot { Species = 214, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Heracross
new EncounterSlot { Species = 265, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Wurmple
new EncounterSlot { Species = 412, LevelMin = 5, LevelMax = 15, Form = 0, Type = SlotType.HoneyTree }, // Burmy Plant Cloak
new EncounterSlot { Species = 415, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Combee
new EncounterSlot { Species = 420, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Cheruby
new EncounterSlot { Species = 446, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Munchlax
},
};
private static readonly EncounterArea SlotsD_HoneyTree =
new EncounterArea {
Slots = SlotsPt_HoneyTree.Slots.Concat( new EncounterSlot[]
{
new EncounterSlot { Species = 266, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Silcoon
}).ToArray()
};
private static readonly EncounterArea SlotsP_HoneyTree =
new EncounterArea
{
Slots = SlotsPt_HoneyTree.Slots.Concat(new EncounterSlot[]
{
new EncounterSlot { Species = 268, LevelMin = 5, LevelMax = 15, Type = SlotType.HoneyTree }, // Cascoon
}).ToArray()
};
private static readonly int[] HoneyTreesLocation = new int[]
{
20, // Route 205
21, // Route 206
22, // Route 207
23, // Route 208
24, // Route 209
25, // Route 210
26, // Route 211
27, // Route 212
28, // Route 213
29, // Route 214
30, // Route 215
33, // Route 218
36, // Route 221
37, // Route 222
47, // Valley Windworks
49, // Fuego Ironworks
58, //Floaroma Meadow
};
#endregion
}
}

View file

@ -4,6 +4,8 @@ namespace PKHeX.Core
{
public static partial class Legal
{
internal const int MaxSpeciesIndex_5_BW = 667;
internal const int MaxSpeciesIndex_5_B2W2 = 708;
internal const int MaxSpeciesID_5 = 649;
internal const int MaxMoveID_5 = 559;
internal const int MaxItemID_5_BW = 632;

View file

@ -272,21 +272,36 @@
<None Include="Resources\byte\encounter_blue.pkl" />
<None Include="Resources\byte\encounter_crystal.pkl" />
<None Include="Resources\byte\encounter_crystal_h.pkl" />
<None Include="Resources\byte\encounter_d.pkl" />
<None Include="Resources\byte\encounter_e.pkl" />
<None Include="Resources\byte\encounter_fr.pkl" />
<None Include="Resources\byte\encounter_gold.pkl" />
<None Include="Resources\byte\encounter_gold_h.pkl" />
<None Include="Resources\byte\encounter_gsc_f.pkl" />
<None Include="Resources\byte\encounter_hg.pkl" />
<None Include="Resources\byte\encounter_lg.pkl" />
<None Include="Resources\byte\encounter_mn.pkl" />
<None Include="Resources\byte\encounter_mn_sos.pkl" />
<None Include="Resources\byte\encounter_p.pkl" />
<None Include="Resources\byte\encounter_pt.pkl" />
<None Include="Resources\byte\encounter_r.pkl" />
<None Include="Resources\byte\encounter_rb_f.pkl" />
<None Include="Resources\byte\encounter_red.pkl" />
<None Include="Resources\byte\encounter_s.pkl" />
<None Include="Resources\byte\encounter_silver.pkl" />
<None Include="Resources\byte\encounter_silver_h.pkl" />
<None Include="Resources\byte\encounter_sn.pkl" />
<None Include="Resources\byte\encounter_sn_sos.pkl" />
<None Include="Resources\byte\encounter_ss.pkl" />
<None Include="Resources\byte\encounter_w.pkl" />
<None Include="Resources\byte\encounter_w2.pkl" />
<None Include="Resources\byte\encounter_yellow.pkl" />
<None Include="Resources\byte\encounter_yellow_f.pkl" />
<None Include="Resources\byte\encunters_hb_hg.pkl" />
<None Include="Resources\byte\encunters_hb_ss.pkl" />
<None Include="Resources\byte\evos_g3.pkl" />
<None Include="Resources\byte\evos_g4.pkl" />
<None Include="Resources\byte\evos_g5.pkl" />
<None Include="Resources\byte\evos_gsc.pkl" />
<None Include="Resources\byte\evos_rby.pkl" />
<None Include="Resources\byte\evos_sm.pkl" />

File diff suppressed because it is too large Load diff

View file

@ -7510,4 +7510,49 @@
<data name="encounter_w2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_w2.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_d" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_d.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_e" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_e.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_fr" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_fr.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_hg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_hg.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_lg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_lg.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_p" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_p.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_pt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_pt.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_r" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_r.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_s" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_s.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encounter_ss" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encounter_ss.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="evos_g3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\evos_g3.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="evos_g4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\evos_g4.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="evos_g5" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\evos_g5.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encunters_hb_hg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encunters_hb_hg.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="encunters_hb_ss" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\byte\encunters_hb_ss.pkl;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.