Exemple #1
0
        private void B_RandAll_Click(object sender, EventArgs e)
        {
            ushort[] HMs = { 15, 19, 57, 70, 127, 249, 291 };
            if (CHK_HMs.Checked && Main.ExeFSPath != null)
            {
                TMHMEditor6.GetTMHMList(out _, out HMs);
            }

            List <int> banned = new List <int> {
                165, 621
            };                                             // Struggle, Hyperspace Fury

            if (!CHK_HMs.Checked)
            {
                banned.AddRange(HMs.Select(z => (int)z));
            }

            SetList();
            var sets = files.Select(z => new EggMoves6(z)).ToArray();
            var rand = new EggMoveRandomizer(Main.Config, sets)
            {
                Expand      = CHK_Expand.Checked,
                ExpandTo    = (int)NUD_Moves.Value,
                STAB        = CHK_STAB.Checked,
                STABPercent = NUD_STAB.Value,
                BannedMoves = banned.ToArray()
            };

            rand.Execute();
            sets.Select(z => z.Write()).ToArray().CopyTo(files, 0);
            GetList();
            WinFormsUtil.Alert("All Pokémon's Egg Moves have been randomized!", "Press the Dump button to see the new Egg Moves!");
        }
        private void B_RandAll_Click(object sender, EventArgs e)
        {
            var sets = entries;
            var rand = new EggMoveRandomizer(Main.Config, sets)
            {
                Expand       = CHK_Expand.Checked,
                ExpandTo     = (int)NUD_Moves.Value,
                STAB         = CHK_STAB.Checked,
                rSTABPercent = NUD_STAB.Value,
                BannedMoves  = new[] { 165, 621, 464 }.Concat(Legal.Z_Moves).ToArray(), // Struggle, Hyperspace Fury, Dark Void
            };

            rand.Execute();
            // sets.Select(z => z.Write()).ToArray().CopyTo(files, 0);
            getList();
            WinFormsUtil.Alert("All Pokémon's Egg Moves have been randomized!", "Press the Dump All button to see the new Egg Moves!");
        }