Ejemplo n.º 1
0
        public void ExportEncounters(string gameID, string ident, bool sm)
        {
            var reg = Gen7SlotDumper.GetRegularBinary(Areas, sm);
            var sos = Gen7SlotDumper.GetSOSBinary(Areas, Main.Config.Personal, sm);

            File.WriteAllBytes($"encounter_{gameID}.pkl", Mini.PackMini(reg, ident));
            File.WriteAllBytes($"encounter_{gameID}_sos.pkl", Mini.PackMini(sos, ident));
        }
Ejemplo n.º 2
0
        private void ExportEncounters(string gameID, string ident)
        {
            var reg = DumpRegular();
            var sos = DumpSOS();

            File.WriteAllBytes($"encounter_{gameID}.pkl", Mini.PackMini(reg, ident));
            File.WriteAllBytes($"encounter_{gameID}_sos.pkl", Mini.PackMini(sos, ident));
        }
Ejemplo n.º 3
0
 public static byte[] GetDayNightTableBinary(IList <EncounterTable> tables)
 {
     byte[][] tabs = new byte[tables.Count / 2][];
     for (int i = 0; i < tables.Count; i += 2)
     {
         var table0 = tables[i + 0].Data; // day
         var table1 = tables[i + 1].Data; // night
         var arr    = new byte[4 + table0.Length + table1.Length];
         table0.CopyTo(arr, 4);
         table1.CopyTo(arr, 4 + table0.Length);
         tabs[i / 2] = arr;
     }
     return(Mini.PackMini(tabs, PackIdentifier));
 }
Ejemplo n.º 4
0
        internal async Task SaveMoves(IEnumerable <Move> moves, ReferencedGarc garcMoves)
        {
            var list = moves.ToList();

            foreach (var move in list)
            {
                Assertions.AssertVersion(this.Version, move.GameVersion);
            }

            if (this.Version.IsORAS() || this.Version.IsGen7())
            {
                var file = Mini.PackMini(list.Select(m => m.Write()).ToArray(), "WD");
                await garcMoves.SetFile(0, file);
            }
            else
            {
                await garcMoves.SetFiles(list.Select( m => m.Write()).ToArray());
            }
        }
Ejemplo n.º 5
0
        private void SetEntry()
        {
            if (entry < 0)
            {
                return;
            }
            if (debugToolDumping)
            {
                return;
            }

            // Set the data back into the class object
            // Currently only the first two files.
            SetZoneData(); // File 0
            SetOWSData();
            // setMSData();
            // setEncounterData();
            // if (Main.Config.ORAS)
            //     setUnknown();

            // Reassemble files
            byte[][] data = CurrentZone.Write();

            // Debug Check (can stay, why not.)
            if (!locationData.Where((t, i) => !data[i].SequenceEqual(t)).Any())
            {
                return;
            }

            // Util.Alert("Zone has been edited!");
            System.Media.SystemSounds.Asterisk.Play();

            // Package the files into the permanent package file.
            byte[] raw = Mini.PackMini(data, "ZO");
            File.WriteAllBytes(filepaths[entry], raw);
        }