コード例 #1
0
        private void Search6_Timeline()
        {
            if (!TTT.HasSeed)
            {
                FormUtil.Error("Please Calibrate Timeline");
                return;
            }

            var timeline = TTT.gettimeline();
            int min      = Math.Max((int)Frame_min.Value, timeline.Startingframe + 2);
            int max      = (int)TimeSpan.Value * 60 + min;

            timeline.Maxframe = max;
            timeline.Generate(ForMainForm: true);
            int listlength = timeline.TinyLength;

            // Prepare
            var rng = new MersenneTwister(Seed.Value);

            for (int i = 0; i < min; i++)
            {
                rng.Next();
            }
            getsetting(rng);
            Frame.standard = (int)(TargetFrame.Value - min);

            for (int i = 0; i < listlength; i++)
            {
                var tinyframe = timeline.results[i];
                if (tinyframe.unhitable)
                {
                    continue;
                }
                if (tinyframe.framemax < min)
                {
                    continue;
                }
                RNGPool.TinySynced = tinyframe.sync == true; // For stationary
                for (int j = tinyframe.framemin + 2; j <= tinyframe.framemax; j += 2, RNGPool.AddNext(rng), RNGPool.AddNext(rng))
                {
                    while (j < min)
                    {
                        j += 2;
                    }
                    RNGPool.tinystatus = tinyframe.tinystate.Clone();
                    RNGPool.tinystatus.Currentframe = j;
                    RNGResult result = RNGPool.Generate6();
                    if (!filter.CheckResult(result))
                    {
                        continue;
                    }
                    Frames.Add(new Frame(result, frame: j, time: j - min));
                    Frames.Last()._tinystate = new PRNGState(tinyframe.tinystate.Status);
                    if (Frames.Count > MAX_RESULTS_NUM)
                    {
                        return;
                    }
                }
            }
        }
コード例 #2
0
        private void Search6_Normal()
        {
            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);
            // Start
            for (int i = min; i <= max; i++, RNGPool.AddNext(rng))
            {
                RNGResult result = RNGPool.Generate6();
                if (!filter.CheckResult(result))
                {
                    continue;
                }
                Frames.Add(new Frame(result, frame: i, time: i - min));
                if (Frames.Count > 100000)
                {
                    break;
                }
            }
        }
コード例 #3
0
        private void Search6_Timeline()
        {
            if (!TTT.HasSeed)
            {
                Error("Please Calibrate Timeline");
                return;
            }

            RNGPool.timeline = TTT.gettimeline();
            int min = Math.Max((int)Frame_min.Value, RNGPool.timeline.Startingframe + 2);
            int max = (int)TimeSpan.Value * 60 + min;

            RNGPool.timeline.Maxframe = max;
            RNGPool.timeline.Generate(Method == 0); // Consider Stationary delay
            int listlength = RNGPool.timeline.TinyLength;

            // Prepare
            var rng = new MersenneTwister(Seed.Value);

            for (int i = 0; i < min; i++)
            {
                rng.Next();
            }
            getsetting(rng);

            for (int i = 0; i < listlength; i++)
            {
                var tinyframe = RNGPool.timeline.results[i];
                if (tinyframe.unhitable)
                {
                    continue;
                }
                if (tinyframe.framemax < min)
                {
                    continue;
                }
                for (int j = tinyframe.framemin + 2; j <= tinyframe.framemax; j += 2, RNGPool.AddNext(rng), RNGPool.AddNext(rng))
                {
                    while (j < min)
                    {
                        j += 2;
                    }
                    RNGPool.tinystatus = (TinyStatus)tinyframe.tinystate.DeepCopy();
                    RNGPool.tinystatus.Currentframe = j;
                    RNGResult result = RNGPool.Generate6();
                    if (!filter.CheckResult(result))
                    {
                        continue;
                    }
                    Frames.Add(new Frame(result, frame: j, time: j - min));
                    Frames.Last()._tinystate = new PRNGState(tinyframe.state);
                    if (Frames.Count > 100000)
                    {
                        return;
                    }
                }
            }
        }
コード例 #4
0
        private void Search6_Normal()
        {
            int counter = 0;
            int min     = (int)Frame_min.Value;
            int max     = (int)Frame_max.Value;

            while (counter <= int.Parse(MaxSeeds.Text))
            {
                var rng = new MersenneTwister(Seed.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);
                // Start
                for (int i = min; i <= max; i++, RNGPool.AddNext(rng))
                {
                    RNGResult result = RNGPool.Generate6();
                    if (!filter.CheckResult(result))
                    {
                        continue;
                    }
                    Frames.Add(new Frame(result, frame: i, time: i - min));
                    // found init seed+spread
                    if (seedsearchCheckBox.Checked == true && Frames.Count >= 1)
                    {
                        counter = int.Parse(MaxSeeds.Text) + 1;
                        break;
                    }
                    //normal search
                    else if (Frames.Count > MAX_RESULTS_NUM)
                    {
                        break;
                    }
                }
                if (seedsearchCheckBox.Checked == false)
                {
                    counter = int.Parse(MaxSeeds.Text) + 1;
                }
                else if (counter != int.Parse(MaxSeeds.Text) + 1)
                {
                    Seed.Value++;
                }
                counter++;
            }
        }
コード例 #5
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 };
            Egg6   IG     = RNGPool.igenerator as Egg6;
            var    eggnow = IG.Generate(null, key) as ResultE6;

            eggnow.hiddenpower = (byte)Pokemon.getHiddenPowerValue(eggnow.IVs);
            if (IG.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.Generate6();
                if (!filter.CheckResult(result))
                {
                    continue;
                }
                Frames.Add(new Frame(result, frame: i, time: i - min));
                if (Frames.Count > MAX_RESULTS_NUM)
                {
                    return;
                }
            }
        }