public void Execute(IEnumerable <Area7> Areas, lzGARCFile encdata)
        {
            GetTableRandSettings((RandOption)TableRandomizationOption, out int slotStart, out int slotStop, out bool copy);

            foreach (var Map in Areas)
            {
                foreach (var Table in Map.Tables)
                {
                    if (ModifyLevel)
                    {
                        Table.MinLevel = Randomizer.getModifiedLevel(Table.MinLevel, LevelAmplifier);
                        Table.MaxLevel = Randomizer.getModifiedLevel(Table.MaxLevel, LevelAmplifier);
                    }

                    RandomizeTable7(Table, slotStart, slotStop);
                    if (copy) // copy row 0 to rest
                    {
                        Table.CopySlotsToSOS();
                    }

                    Table.Write();
                }
                encdata[Map.FileNumber] = Area7.GetDayNightTableBinary(Map.Tables);
            }
        }
Exemplo n.º 2
0
        private void ModifyAllLevelRanges(object sender, EventArgs e)
        {
            if (DialogResult.Yes != WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Modify all current Level ranges?", "Cannot undo."))
            {
                return;
            }

            // Disable Interface while modifying
            Enabled = false;

            // Cycle through each location to modify levels
            var amp = NUD_LevelAmp.Value;

            foreach (var area in Areas)
            {
                var tables = area.Tables;
                foreach (var table in tables)
                {
                    table.MinLevel = Randomizer.GetModifiedLevel(table.MinLevel, amp);
                    table.MaxLevel = Randomizer.GetModifiedLevel(table.MaxLevel, amp);
                    table.Write();
                }
                encdata[area.FileNumber] = Area7.GetDayNightTableBinary(tables);
            }

            // Enable Interface... modification complete.
            Enabled = true;
            WinFormsUtil.Alert("Modified all Level ranges according to specification!", "Press the Dump Tables button to view the new Level ranges!");

            UpdatePanel(sender, e);
        }
Exemplo n.º 3
0
        private void B_Export_Click(object sender, EventArgs e)
        {
            B_Save_Click(sender, e);

            Directory.CreateDirectory("encdata");
            foreach (var Map in Areas)
            {
                var packed = Area7.GetDayNightTableBinary(Map.Tables);
                File.WriteAllBytes(Path.Combine("encdata", Map.FileNumber.ToString()), packed);
            }
            WinFormsUtil.Alert("Exported all tables!");
        }
Exemplo n.º 4
0
        private void B_Save_Click(object sender, EventArgs e)
        {
            var sum = TotalEncounterRate;

            if (sum != 100 && sum != 0)
            {
                WinFormsUtil.Error("Encounter rates must add up to either 0% or 100%.");
                return;
            }

            CurrentTable.Write();
            var area = Areas[CB_LocationID.SelectedIndex];

            area.Tables[CB_TableID.SelectedIndex] = CurrentTable;

            // Set data back to GARC
            encdata[area.FileNumber] = Area7.GetDayNightTableBinary(area.Tables);
        }