Esempio n. 1
0
        private void Search6_Egg()
        {
            var rng = new MersenneTwister(Seed.Value);
            int min = (int)Frame_min.Value;
            int max = (int)Frame_max.Value;

            if (AroundTarget.Checked)
            {
                min = (int)TargetFrame.Value - 100; max = (int)TargetFrame.Value + 100;
            }
            // Advance
            for (int i = 0; i < min; i++)
            {
                rng.Next();
            }
            // Prepare
            getsetting(rng);

            // The egg already have
            uint[] key    = { Key0.Value, Key1.Value };
            var    eggnow = RNGPool.GenerateAnEgg6(key);

            eggnow.hiddenpower = (byte)Pokemon.getHiddenPowerValue(eggnow.IVs);
            if (RNGPool.IsMainRNGEgg)
            {
                eggnow.PID = 0xFFFFFFFF;
            }
            eggnow.Status = "Current";
            Frames.Add(new Frame(eggnow, frame: -1));

            // Start
            for (int i = min; i <= max; i++, RNGPool.AddNext(rng))
            {
                var result = RNGPool.GenerateEgg6();
                if (!filter.CheckResult(result))
                {
                    continue;
                }
                Frames.Add(new Frame(result, frame: i, time: i - min));
                if (Frames.Count > 100000)
                {
                    return;
                }
            }
        }