Exemple #1
0
        private void B_Randomize_Click(object sender, EventArgs e)
        {
            saveEntry();

            // input settings
            var rnd = new PersonalRandomizer(Main.SpeciesStat, Main.Config)
            {
                TypeCount                = CB_Type1.Items.Count,
                ModifyCatchRate          = CHK_CatchRate.Checked,
                ModifyEggGroup           = CHK_EggGroup.Checked,
                ModifyStats              = CHK_Stats.Checked,
                StatsToRandomize         = rstat_boxes.Select(g => g.Checked).ToArray(),
                ModifyAbilities          = CHK_Ability.Checked,
                ModifyLearnsetTM         = CHK_TM.Checked,
                ModifyLearnsetHM         = CHK_HM.Checked,
                ModifyLearnsetTypeTutors = CHK_Tutors.Checked,
                ModifyLearnsetMoveTutors = Main.Config.ORAS && CHK_ORASTutors.Checked,
                ModifyTypes              = CHK_Type.Checked,
                ModifyHeldItems          = CHK_Item.Checked,
                SameTypeChance           = NUD_TypePercent.Value,
                SameEggGroupChance       = NUD_Egg.Value,
                StatDeviation            = NUD_StatDev.Value,
                AllowWonderGuard         = CHK_WGuard.Checked
            };

            rnd.Execute();

            readEntry();
            WinFormsUtil.Alert("All relevant Pokémon Personal Entries have been randomized!");
        }
Exemple #2
0
        private void B_RandPersonal_Click(object sender, EventArgs e)
        {
            SaveCurrent();
            var settings = (PersonalRandSettings)PG_Personal.SelectedObject;
            var rand     = new PersonalRandomizer(Editor.Personal, ROM.Info, Editor.Evolve.LoadAll())
            {
                Settings = settings
            };

            rand.Execute();
            LoadIndex(CB_Species.SelectedIndex);
            System.Media.SystemSounds.Asterisk.Play();
        }
Exemple #3
0
        private void B_Randomize_Click(object sender, EventArgs e)
        {
            if (WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Randomize all? This will also randomize Move Power and Acc. Cannot undo.", "Double check Randomization settings in the Enhancements tab.") != DialogResult.Yes)
            {
                return;
            }
            saveEntry();

            // input settings
            var rnd = new PersonalRandomizer(Main.SpeciesStat, Main.Config)
            {
                TypeCount                = CB_Type1.Items.Count,
                ModifyCatchRate          = CHK_CatchRate.Checked,
                ModifyEggGroup           = CHK_EggGroup.Checked,
                ModifyStats              = CHK_Stats.Checked,
                ShuffleStats             = CHK_Shuffle.Checked,
                StatsToRandomize         = rstat_boxes.Select(g => g.Checked).ToArray(),
                ModifyAbilities          = CHK_Ability.Checked,
                ModifyLearnsetTM         = CHK_TM.Checked,
                ModifyLearnsetHM         = CHK_HM.Checked,
                ModifyLearnsetTypeTutors = CHK_Tutors.Checked,
                ModifyLearnsetMoveTutors = Main.Config.ORAS && CHK_ORASTutors.Checked,
                ModifyTypes              = CHK_Type.Checked,
                ModifyHeldItems          = CHK_Item.Checked,
                SameTypeChance           = NUD_TypePercent.Value,
                SameEggGroupChance       = NUD_Egg.Value,
                StatDeviation            = NUD_StatDev.Value,
                AllowWonderGuard         = CHK_WGuard.Checked,
                MoveIDsTMs               = TMs,
            };

            Move[] newMoves = rnd.Execute2();
            Main.Config.Moves = newMoves;
            Main.SpeciesStat.Select(z => z.Write()).ToArray().CopyTo(files, 0);

            readEntry();
            WinFormsUtil.Alert("Randomized all Pokémon Personal data entries according to specification!", "Press the Dump All button to view the new Personal data!");
        }