示例#1
0
        private void Search7_FishyTimeline()
        {
            SFMT sfmt        = new SFMT(Seed.Value);
            int  start_frame = (int)Frame_min.Value;
            int  targetframe = (int)TargetFrame.Value;

            // Advance
            for (int i = 0; i < start_frame; i++)
            {
                sfmt.Next();
            }
            // Prepare
            ModelStatus status = new ModelStatus(Modelnum, sfmt)
            {
                raining = Raining.Checked
            };

            getsetting(sfmt);
            int totaltime = (int)TimeSpan.Value * 30;
            int frameinput1 = (int)Frame_min.Value;         // Input 1: Cast the rod
            int frameadvance, fishingdelay, frameinput2;    // Input 2: Pull the rod off water
            var fsetting   = getFishingSetting;
            int Timewindow = 2;

            // Start
            for (int i = 0; i <= totaltime; i++)
            {
                RNGPool.Save();

                // 2 Frames for delay calc
                // USUM v1.1 sub_39E2F0
                RNGPool.Rewind(0); RNGPool.CopyStatus(status);
                fishingdelay = (int)(RNGPool.getrand64 % 60) + fsetting.basedelay;
                if (Overview.Checked)
                {
                    RNGPool.Advance(1); // Keep timewindow at 2 to avoid calculation
                }
                else
                {
                    Timewindow = (int)(RNGPool.getrand64 % 15) + fsetting.platdelay + 14;
                }

                // Fishing Delay
                RNGPool.time_elapse7(fishingdelay);

                // Bitechance
                if (fsetting.suctioncups || (int)(RNGPool.getrand64 % 100) < 50)
                {
                    RNGPool.time_elapse7(1);
                    frameinput2 = RNGPool.index + frameinput1;
                    RNGPool.SaveStatus();

                    for (int j = 2; j <= Timewindow; j++)
                    {
                        RNGPool.LoadStatus();
                        RNGPool.time_elapse7(1);
                        frameinput2 += RNGPool.index;
                        RNGPool.SaveStatus();
                        RNGPool.DelayTime = fsetting.pkmdelay + Math.Max(0, fsetting.platdelay - j); //  Duplicates

                        var result = RNGPool.Generate7() as ResultW7;

                        if (!filter.CheckResult(result))
                        {
                            continue;
                        }
                        if (Overview.Checked)
                        {
                            result.RandNum = RNGPool.getsavepoint;
                        }
                        result.FrameDelayUsed += frameinput2 - frameinput1;
                        Frames.Add(new Frame(result, frame: frameinput2, time: (i + j + fishingdelay) * 2)
                        {
                            Frame0 = frameinput1
                        });
                    }
                }

                RNGPool.Load();

                if (Frames.Count > MAX_RESULTS_NUM)
                {
                    break;
                }

                // Move to next Frame, Update RNGPool
                frameadvance = status.NextState();
                frameinput1 += frameadvance;
                for (int j = 0; j < frameadvance; j++)
                {
                    RNGPool.AddNext(sfmt);
                }
            }
        }