Exemplo n.º 1
0
        private static void GetSlots4WaterFishingDPPt(EncounterArea4 area, byte[] data, int ofs, int numslots)
        {
            var slots = new List <EncounterSlot4>();

            for (int i = 0; i < numslots; i++)
            {
                // max, min, unused, unused, [32bit species]
                int Species = BitConverter.ToInt32(data, ofs + 4 + (i * 8));
                if (Species <= 0)
                {
                    continue;
                }
                // Fishing and Surf slots without a species ID are not added
                // DPPt does not have fishing or surf swarms, and does not have any Rock Smash encounters.
                slots.Add(new EncounterSlot4
                {
                    LevelMax   = data[ofs + 0 + (i * 8)],
                    LevelMin   = data[ofs + 1 + (i * 8)],
                    Species    = Species,
                    SlotNumber = i,
                });
            }

            area.Slots = slots.ToArray();
            EncounterUtil.MarkEncountersStaticMagnetPull <EncounterSlot4>(new [] { area }, PersonalTable.HGSS);
        }
        private static IEnumerable <EncounterSlot4> GetSlots4WaterFishingHGSS(EncounterArea4 area, byte[] data, int ofs, int numslots, SlotType t)
        {
            var slots = new List <EncounterSlot4>();

            for (int i = 0; i < numslots; i++)
            {
                // min, max, [16bit species]
                int Species = BitConverter.ToInt16(data, ofs + 2 + (i * 4));
                if (t == SlotType.Rock_Smash && Species <= 0)
                {
                    continue;
                }
                // Fishing and surf Slots without a species ID are added too; these are needed for the swarm encounters.
                // These empty slots will will be deleted after we add swarm slots.

                slots.Add(new EncounterSlot4
                {
                    LevelMin   = data[ofs + 0 + (i * 4)],
                    LevelMax   = data[ofs + 1 + (i * 4)],
                    Species    = Species,
                    SlotNumber = i,
                });
            }

            area.Slots = slots.ToArray();
            EncounterUtil.MarkEncountersStaticMagnetPull <EncounterSlot4>(new [] { area }, PersonalTable.HGSS);
            return(slots);
        }