Ejemplo n.º 1
0
        private void loadData()
        {
            // get zonedata array
            var zd = ZoneData7.GetArray(zoneData);

            string[] locations = zd.Select((z, i) => $"{i:000} - {locationList[z.ParentMap]}").ToArray();
            CB_LocationID.Items.AddRange(locations);
            CB_LocationID.SelectedIndex = 0;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets an annotated Area array
        /// </summary>
        /// <param name="ed">Encounter Data GARC</param>
        /// <param name="zd">ZoneData GARC</param>
        /// <param name="wd">WorldData GARC</param>
        /// <param name="locationList">Location strings</param>
        /// <returns>Annotated Area Array</returns>
        public static Area7[] GetArray(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd, string[] locationList)
        {
            var Worlds = wd.Files.Select(f => Mini.UnpackMini(f, "WD")[0]).ToArray();

            byte[][] zdfiles   = zd.Files;
            var      worldData = zdfiles[1];
            var      zoneData  = zdfiles[0];
            var      zones     = ZoneData7.GetZoneData7Array(zoneData, worldData, locationList, Worlds);
            var      areas     = GetArray(ed, zones);

            return(areas);
        }
Ejemplo n.º 3
0
        private void loadData()
        {
            // get zonedata array
            ZoneData7[] zd = new ZoneData7[zoneData.Length / ZoneData7.SIZE];
            for (int i = 0; i < zd.Length; i++)
            {
                byte[] buff = new byte[ZoneData7.SIZE];
                Buffer.BlockCopy(zoneData, i * ZoneData7.SIZE, buff, 0, ZoneData7.SIZE);
                zd[i] = new ZoneData7(buff);
            }

            string[] locations = zd.Select((z, i) => $"{i:000} - {locationList[z.ParentMap]}").ToArray();
            CB_LocationID.Items.AddRange(locations);
            CB_LocationID.SelectedIndex = 0;
        }
Ejemplo n.º 4
0
        public SMWE(lzGARCFile ed, lzGARCFile zd, lzGARCFile wd)
        {
            InitializeComponent();

            PB_DayIcon.Image      = Properties.Resources.sun;
            PB_NightIcon.Image    = Properties.Resources.moon;
            PB_DayIcon.SizeMode   = PictureBoxSizeMode.CenterImage;
            PB_NightIcon.SizeMode = PictureBoxSizeMode.CenterImage;

            font = L_Location.Font;

            speciesList[0] = "(None)";
            locationList   = Main.getText(TextName.metlist_000000);
            locationList   = getGoodLocationList(locationList);

            nup_spec = new[]
            {
                new [] { NUP_Forme1, NUP_Forme2, NUP_Forme3, NUP_Forme4, NUP_Forme5, NUP_Forme6, NUP_Forme7, NUP_Forme8, NUP_Forme9, NUP_Forme10 },
                new [] { NUP_Forme11, NUP_Forme12, NUP_Forme13, NUP_Forme14, NUP_Forme15, NUP_Forme16, NUP_Forme17, NUP_Forme18, NUP_Forme19, NUP_Forme20 },
                new [] { NUP_Forme21, NUP_Forme22, NUP_Forme23, NUP_Forme24, NUP_Forme25, NUP_Forme26, NUP_Forme27, NUP_Forme28, NUP_Forme29, NUP_Forme30 },
                new [] { NUP_Forme31, NUP_Forme32, NUP_Forme33, NUP_Forme34, NUP_Forme35, NUP_Forme36, NUP_Forme37, NUP_Forme38, NUP_Forme39, NUP_Forme40 },
                new [] { NUP_Forme41, NUP_Forme42, NUP_Forme43, NUP_Forme44, NUP_Forme45, NUP_Forme46, NUP_Forme47, NUP_Forme48, NUP_Forme49, NUP_Forme50 },
                new [] { NUP_Forme51, NUP_Forme52, NUP_Forme53, NUP_Forme54, NUP_Forme55, NUP_Forme56, NUP_Forme57, NUP_Forme58, NUP_Forme59, NUP_Forme60 },
                new [] { NUP_Forme61, NUP_Forme62, NUP_Forme63, NUP_Forme64, NUP_Forme65, NUP_Forme66, NUP_Forme67, NUP_Forme68, NUP_Forme69, NUP_Forme70 },
                new [] { NUP_Forme71, NUP_Forme72, NUP_Forme73, NUP_Forme74, NUP_Forme75, NUP_Forme76, NUP_Forme77, NUP_Forme78, NUP_Forme79, NUP_Forme80 },
                new [] { NUP_WeatherForme1, NUP_WeatherForme2, NUP_WeatherForme3, NUP_WeatherForme4, NUP_WeatherForme5, NUP_WeatherForme6 }
            };
            cb_spec = new[]
            {
                new[] { CB_Enc1, CB_Enc2, CB_Enc3, CB_Enc4, CB_Enc5, CB_Enc6, CB_Enc7, CB_Enc8, CB_Enc9, CB_Enc10 },
                new[] { CB_Enc11, CB_Enc12, CB_Enc13, CB_Enc14, CB_Enc15, CB_Enc16, CB_Enc17, CB_Enc18, CB_Enc19, CB_Enc20 },
                new[] { CB_Enc21, CB_Enc22, CB_Enc23, CB_Enc24, CB_Enc25, CB_Enc26, CB_Enc27, CB_Enc28, CB_Enc29, CB_Enc30 },
                new[] { CB_Enc31, CB_Enc32, CB_Enc33, CB_Enc34, CB_Enc35, CB_Enc36, CB_Enc37, CB_Enc38, CB_Enc39, CB_Enc40 },
                new[] { CB_Enc41, CB_Enc42, CB_Enc43, CB_Enc44, CB_Enc45, CB_Enc46, CB_Enc47, CB_Enc48, CB_Enc49, CB_Enc50 },
                new[] { CB_Enc51, CB_Enc52, CB_Enc53, CB_Enc54, CB_Enc55, CB_Enc56, CB_Enc57, CB_Enc58, CB_Enc59, CB_Enc60 },
                new[] { CB_Enc61, CB_Enc62, CB_Enc63, CB_Enc64, CB_Enc65, CB_Enc66, CB_Enc67, CB_Enc68, CB_Enc69, CB_Enc70 },
                new[] { CB_Enc71, CB_Enc72, CB_Enc73, CB_Enc74, CB_Enc75, CB_Enc76, CB_Enc77, CB_Enc78, CB_Enc79, CB_Enc80 },
                new[] { CB_WeatherEnc1, CB_WeatherEnc2, CB_WeatherEnc3, CB_WeatherEnc4, CB_WeatherEnc5, CB_WeatherEnc6 }
            };
            rate_spec = new[]
            { L_Rate1, L_Rate2, L_Rate3, L_Rate4, L_Rate5, L_Rate6, L_Rate7, L_Rate8, L_Rate9, L_Rate10 };

            foreach (var cb_l in cb_spec)
            {
                foreach (var cb in cb_l)
                {
                    cb.Items.AddRange(speciesList); cb.SelectedIndex = 0; cb.SelectedIndexChanged += updateSpeciesForm;
                }
            }
            foreach (var nup_l in nup_spec)
            {
                foreach (var nup in nup_l)
                {
                    nup.ValueChanged += updateSpeciesForm;
                }
            }
            foreach (var l in rate_spec)
            {
                l.Text = "0%";
            }

            byte[][] zdfiles = zd.Files;
            worldData = zdfiles[1]; // 1.bin
            zoneData  = zdfiles[0]; // dec_0.bin
            Zones     = new ZoneData7[zoneData.Length / ZoneData7.SIZE];

            var Worlds = wd.Files.Select(f => mini.unpackMini(f, "WD")[0]).ToArray();

            for (int i = 0; i < Zones.Length; i++)
            {
                Zones[i] = new ZoneData7(zoneData, i)
                {
                    WorldIndex = BitConverter.ToUInt16(worldData, i * 0x2)
                };
                Zones[i].setName(locationList, i);
                var World         = Worlds[Zones[i].WorldIndex];
                var mappingOffset = BitConverter.ToInt32(World, 0x8);
                for (var ofs = mappingOffset; ofs < World.Length; ofs += 4)
                {
                    if (BitConverter.ToUInt16(World, ofs) != i)
                    {
                        continue;
                    }
                    Zones[i].AreaIndex = BitConverter.ToUInt16(World, ofs + 2);
                    break;
                }
            }

            encdata = ed;
            LoadData();
        }