Esempio n. 1
0
        private DataGridViewRow getRow(int i, EggRNGSearch rng, EggRNGSearch.EggRNGResult result, DataGridView dgv)
        {
            var    true_psv    = rng.PIDRerolls > 0 ? result.PSV.ToString("d") : "-";
            string true_pid    = International.Checked || omamori.Checked ? result.PID.ToString("X8") : STR_TEMP_PID;
            string true_nature = rng.Everstone ? (rng.Both_Everstone ? (result.BE_InheritParents == 0 ? STR_FIRST : STR_SECOND) : items[0]) : natures[result.Nature];

            DataGridViewRow row = new DataGridViewRow();

            row.CreateCells(dgv);
            row.SetValues(
                i, result.FramesUsed, result.Seed128,
                result.IVs[0], result.IVs[1], result.IVs[2], result.IVs[3], result.IVs[4], result.IVs[5],
                genders[result.Gender], abilities[result.Ability], true_nature,
                true_pid, true_psv, result.EC.ToString("X8"), result.row_r.ToString("X8")
                );

            for (int k = 0; k < result.InheritStats.Length; k++)
            {
                var color = result.InheritParents[k] == 0 ? pre.ForeColor : post.ForeColor;
                row.Cells[3 + (int)result.InheritStats[k]].Style.ForeColor = color;
            }
            if (result.Shiny)
            {
                row.DefaultCellStyle.BackColor = Color.LightCyan;
            }
            return(row);
        }
Esempio n. 2
0
        private EggRNGSearch getRNGSettings()
        {
            int[] pre_parent    = { (int)pre_parent1.Value, (int)pre_parent2.Value, (int)pre_parent3.Value, (int)pre_parent4.Value, (int)pre_parent5.Value, (int)pre_parent6.Value, };
            int[] post_parent   = { (int)post_parent1.Value, (int)post_parent2.Value, (int)post_parent3.Value, (int)post_parent4.Value, (int)post_parent5.Value, (int)post_parent6.Value, };
            int   sex_threshold = 0;

            switch (sex_ratio.SelectedIndex)
            {
            case 0: sex_threshold = 126; break;

            case 1: sex_threshold = 30; break;

            case 2: sex_threshold = 63; break;

            case 3: sex_threshold = 189; break;

            case 4: sex_threshold = 0; break;

            case 5: sex_threshold = 252; break;
            }

            var rng = new EggRNGSearch
            {
                GenderRatio     = sex_threshold,
                GenderRandom    = sex_ratio.SelectedIndex < 4,
                GenderMale      = sex_ratio.SelectedIndex == 4,
                GenderFemale    = sex_ratio.SelectedIndex == 5,
                International   = International.Checked,
                ShinyCharm      = omamori.Checked,
                Heterogeneous   = pre_ditto.Checked || post_ditto.Checked || Heterogeneity.Checked,
                Both_Everstone  = pre_Items.SelectedIndex == 1 && post_Items.SelectedIndex == 1,
                Everstone       = pre_Items.SelectedIndex == 1 || post_Items.SelectedIndex == 1,
                DestinyKnot     = pre_Items.SelectedIndex == 2 || post_Items.SelectedIndex == 2,
                PowerItems      = pre_Items.SelectedIndex > 2 || post_Items.SelectedIndex > 2,
                Both_PowerItems = pre_Items.SelectedIndex > 2 && post_Items.SelectedIndex > 2,
                MalePowerStat   = pre_Items.SelectedIndex - 3,
                FemalePowerStat = post_Items.SelectedIndex - 3,
                ParentAbility   = (!post_ditto.Checked ? post_ability : pre_ability).SelectedIndex,
                ConciderTSV     = k_TSV_shiny.Checked,
                SearchOtherTSV  = other_TSV.Checked,

                TSV         = (int)TSV.Value,
                pre_parent  = pre_parent,
                post_parent = post_parent,
            };

            rng.Initialize();
            return(rng);
        }