Пример #1
0
        private RNGSearch getRNGSettings()
        {
            int gender_threshold = 0;

            switch (GenderRatio.SelectedIndex)
            {
            case 1: gender_threshold = 126; break;

            case 2: gender_threshold = 30; break;

            case 3: gender_threshold = 63; break;

            case 4: gender_threshold = 189; break;
            }

            RNGSearch.createtimeline     = CreateTimeline.Checked;
            RNGSearch.Considerdelay      = ShowResultsAfterDelay.Checked;
            RNGSearch.PreDelayCorrection = (int)Correction.Value;
            RNGSearch.delaytime          = (int)Timedelay.Value / 2;
            RNGSearch.ConsiderBlink      = ConsiderBlink.Checked;
            RNGSearch.npcnumber          = (int)NPC.Value + 1;
            RNGSearch.IsSolgaleo         = Poke.SelectedIndex == SearchSetting.Solgaleo_index;
            RNGSearch.IsLunala           = Poke.SelectedIndex == SearchSetting.Lunala_index;

            var rng = new RNGSearch
            {
                Synchro_Stat  = SyncNature.SelectedIndex - 1,
                TSV           = (int)TSV.Value,
                AlwaysSynchro = AlwaysSynced.Checked,
                Honey         = Honey.Checked,
                UB            = UB.Checked,
                ShinyCharm    = ShinyCharm.Checked,
                Wild          = Wild.Checked,
                Fix3v         = Fix3v.Checked,
                gender_ratio  = gender_threshold,
                nogender      = GenderRatio.SelectedIndex == 0,
                PokeLv        = (Poke.SelectedIndex == 0) ? -1 : SearchSetting.PokeLevel[Poke.SelectedIndex - 1],
                Lv_min        = (int)Lv_min.Value,
                Lv_max        = (int)Lv_max.Value,
                UB_th         = (int)UB_th.Value,
                ShinyLocked   = SearchSetting.ShinyLocked(Poke.SelectedIndex),
            };

            return(rng);
        }
Пример #2
0
        private SearchSetting getSettings()
        {
            int[] IVup   = { (int)ivmax0.Value, (int)ivmax1.Value, (int)ivmax2.Value, (int)ivmax3.Value, (int)ivmax4.Value, (int)ivmax5.Value, };
            int[] IVlow  = { (int)ivmin0.Value, (int)ivmin1.Value, (int)ivmin2.Value, (int)ivmin3.Value, (int)ivmin4.Value, (int)ivmin5.Value, };
            int[] BS     = { (int)BS_0.Value, (int)BS_1.Value, (int)BS_2.Value, (int)BS_3.Value, (int)BS_4.Value, (int)BS_5.Value, };
            int[] Status = { (int)Stat0.Value, (int)Stat1.Value, (int)Stat2.Value, (int)Stat3.Value, (int)Stat4.Value, (int)Stat5.Value, };

            return(new SearchSetting
            {
                Nature = Nature.SelectedIndex - 1,
                HPType = HiddenPower.SelectedIndex - 1,
                Gender = Gender.SelectedIndex,
                Ability = Ability.SelectedIndex,
                Slot = SearchSetting.TranslateSlot(Slot.Text),
                IVlow = IVlow,
                IVup = IVup,
                BS = BS,
                Status = Status,
                Skip = DisableFilters.Checked,
                Lv = (int)Lv_Search.Value,
            });
        }
Пример #3
0
        private bool frameMatch(RNGSearch.RNGResult result, SearchSetting setting)
        {
            setting.getStatus(result, setting);

            if (setting.Skip)
            {
                return(true);
            }

            if (ShinyOnly.Checked && !result.Shiny)
            {
                return(false);
            }

            if (BlinkOnly.Checked && result.Blink < 5)
            {
                return(false);
            }

            if (SafeFOnly.Checked && result.Blink < 0)
            {
                return(false);
            }

            if (ByIVs.Checked && !setting.validIVs(result.IVs))
            {
                return(false);
            }

            if (ByStats.Checked && !setting.validStatus(result, setting))
            {
                return(false);
            }

            if (!setting.mezapa_check(result.IVs))
            {
                return(false);
            }

            if (setting.Nature != -1 && setting.Nature != result.Nature)
            {
                return(false);
            }

            if (Wild.Checked)
            {
                if (setting.Lv != 0 && setting.Lv != result.Lv)
                {
                    return(false);
                }

                if (EncounteredOnly.Checked && result.Encounter >= Encounter_th.Value)
                {
                    return(false);
                }

                if (UBOnly.Checked && result.UbValue >= UB_th.Value)
                {
                    return(false);
                }

                if (!UB.Checked || result.UbValue >= UB_th.Value)
                {
                    if (setting.Slot[0] && !setting.Slot[result.Slot])
                    {
                        return(false);
                    }

                    if (setting.Gender != 0 && setting.Gender != result.Gender)
                    {
                        return(false);
                    }

                    if (setting.Ability != 0 && setting.Ability != result.Ability)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }