Fix hgss swarm slots replacement

note that dppt only have grass swarm
This commit is contained in:
wwwwwwzx 2017-03-26 20:21:44 -07:00
parent f014f5ed1c
commit d0427f0322

View file

@ -246,15 +246,18 @@ namespace PKHeX.Core
}
private static void MarkG4SwarmSlots(ref EncounterArea[] Areas, EncounterArea[] SwarmAreas)
{
// Swarm slots replace slots 0 and 1 from encounters data
// 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
// Species id are not included in encounter tables but levels can be copied from the encounter raw data
foreach(EncounterArea Area in Areas)
foreach (EncounterArea Area in Areas)
{
var SwarmSlots = SwarmAreas.Where(a => a.Location == Area.Location).SelectMany(s => s.Slots);
var OutputSlots = new List<EncounterSlot>();
foreach (EncounterSlot SwarmSlot in SwarmSlots)
{
foreach (var swarmSlot in Area.Slots.Where(s => s.Type == SwarmSlot.Type).Take(2).Select(slot => slot.Clone()))
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()))
{
swarmSlot.Species = SwarmSlot.Species;
OutputSlots.Add(swarmSlot);