예제 #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);
        }
예제 #3
0
        public static void DumpGen3()
        {
            var r = Resources.encounter_r;
            var s = Resources.encounter_s;
            var e = Resources.encounter_e;

            var f = Resources.encounter_fr;
            var l = Resources.encounter_lg;

            var ru = EncounterArea3.GetArray3(BinLinker.Unpack(r, "ru"));
            var sa = EncounterArea3.GetArray3(BinLinker.Unpack(s, "sa"));
            var em = EncounterArea3.GetArray3(BinLinker.Unpack(e, "em"));

            EncounterUtil.MarkEncountersStaticMagnetPull <EncounterSlot3>(em, PersonalTable.E);

            var fr = EncounterArea3.GetArray3(BinLinker.Unpack(f, "fr"));
            var lg = EncounterArea3.GetArray3(BinLinker.Unpack(l, "lg"));

            // Remove unreleased Altering Cave tables
            fr = fr.Where(z => z.Location != 183 || z.Slots[0].Species == (int)Species.Zubat).ToArray();
            lg = lg.Where(z => z.Location != 183 || z.Slots[0].Species == (int)Species.Zubat).ToArray();

            var rd = ru.Concat(FishFeebas).OrderBy(z => z.Location).ThenBy(z => z.Type);
            var sd = sa.Concat(FishFeebas).OrderBy(z => z.Location).ThenBy(z => z.Type);
            var ed = em.Concat(FishFeebas).OrderBy(z => z.Location).ThenBy(z => z.Type);

            var fd = fr.Concat(SlotsFRLGUnown).OrderBy(z => z.Location).ThenBy(z => z.Type);
            var ld = lg.Concat(SlotsFRLGUnown).OrderBy(z => z.Location).ThenBy(z => z.Type);

            Write(rd, "encounter_r.pkl", "ru");
            Write(sd, "encounter_s.pkl", "sa");
            Write(ed, "encounter_e.pkl", "em");
            Write(fd, "encounter_fr.pkl", "fr");
            Write(ld, "encounter_lg.pkl", "lg");

            WriteSwarm(SlotsRSEAlt, "encounter_rse_swarm.pkl", "rs");
        }
 protected static void MarkStaticMagnetPermute(IEnumerable <EncounterSlot4> grp, List <EncounterSlot4> trackPermute)
 {
     EncounterUtil.MarkEncountersStaticMagnetPullPermutation(grp, PersonalTable.HGSS, trackPermute);
 }