private void Search7_Egg() { var rng = new TinyMT(Status); int min = (int)Frame_min.Value; int max = (int)Frame_max.Value; bool CheckRandomNumber(uint rn) { int sv = (int)Pokemon.getTSV(rn); return(sv == TSV.Value || ConsiderOtherTSV.Checked && OtherTSVList.Contains(sv)); } // Advance for (int i = 0; i < min; i++) { rng.Next(); } // Prepare getsetting(rng); // Start for (int i = min; i <= max; i++, RNGPool.AddNext(rng)) { var result = RNGPool.GenerateEgg7() as EggResult; if (!(filter.CheckResult(result) || ShinyRemind.Checked && CheckRandomNumber(result.RandNum))) { continue; } Frames.Add(new Frame(result, frame: i)); if (Frames.Count > MAX_RESULTS_NUM) { return; } } }
private void Search7_Egg() { var rng = new TinyMT(Status); int min = (int)Frame_min.Value; int max = (int)Frame_max.Value; // Advance for (int i = 0; i < min; i++) { rng.Next(); } // Prepare getsetting(rng); // Start for (int i = min; i <= max; i++, RNGPool.AddNext(rng)) { var result = RNGPool.GenerateEgg7() as EggResult; if (!(filter.CheckResult(result) || ShinyRemind.Checked && CheckRandomNumber(result.RandNum))) { continue; } Frames.Add(new Frame(result, frame: i)); if (Frames.Count > 100000) { return; } } }
private void Search7_EggList() { var rng = new TinyMT(Status); int min = (int)Egg_min.Value - 1; int max = (int)Egg_max.Value - 1; int target = (int)TargetFrame.Value; bool gotresult = false; // Advance for (int i = 0; i < min; i++) { rng.Next(); } TinyMT Seedrng = new TinyMT(rng.status); // Prepare getsetting(rng); // Start int frame = 0; int advance = 0; for (int i = 0; i <= max; i++) { var result = RNGPool.GenerateEgg7() as EggResult; advance = result.FramesUsed; if (!gotresult && frame <= target && target < frame + advance) { Egg_Instruction.Text = getEggListString(i, target - frame); gotresult = true; } frame += advance; for (int j = advance; j > 0; j--) { RNGPool.AddNext(rng); } if (i < min || !filter.CheckResult(result)) { continue; } Frames.Add(new Frame(result, frame: frame - advance, eggnum: i + 1)); if (Frames.Count > MAX_RESULTS_NUM) { break; } } if (!gotresult) { Egg_Instruction.Text = getEggListString(-1, -1); } }
private void Search7_EggShortestPath() { var rng = new TinyMT(Status); int max = (int)TargetFrame.Value; int rejectcount = 0; List <EggResult> ResultsList = new List <EggResult>(); // Prepare getsetting(rng); // Start for (int i = 0; i <= max; i++, RNGPool.AddNext(rng)) { ResultsList.Add(RNGPool.GenerateEgg7() as EggResult); } var FrameIndexList = Gen7EggPath.Calc(ResultsList.Select(egg => egg.FramesUsed).ToArray()); max = FrameIndexList.Count; for (int i = 0; i < max; i++) { int index = FrameIndexList[i]; var result = ResultsList[index]; result.hiddenpower = (byte)Pokemon.getHiddenPowerValue(result.IVs); var Frame = new Frame(result, frame: index, eggnum: i + 1); if (i == max - 1 || FrameIndexList[i + 1] - index > 1) { Frame.FrameUsed = StringItem.EGGACCEPT_STR[lindex, 0]; } else { Frame.FrameUsed = StringItem.EGGACCEPT_STR[lindex, 1]; rejectcount++; } Frames.Add(Frame); } Egg_Instruction.Text = getEggListString(max - rejectcount - 1, rejectcount, true); }