| | |
| | | |
| | | private Int32 runningStep = RunningStep.None; |
| | | |
| | | public override bool Start(ZTRectangle gameRect, CancellationToken cancelToken,Int32 runningStep) |
| | | public override ZTResult Start(ZTRectangle gameRect, CancellationToken cancelToken,Int32 runningStep) |
| | | { |
| | | this.runningStep = runningStep; |
| | | this.GameRect = gameRect; |
| | |
| | | { |
| | | if (!MoveToSunan()) |
| | | { |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | |
| | | if (!MoveToShikongzhimen()) |
| | | { |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | |
| | | if (!MoveToChoiceTaskPage()) |
| | | { |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | |
| | | if (!IntoTaskRoom()) |
| | | { |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | |
| | | G.Instance.InfoWriter("成功进入副本"); |
| | |
| | | //重复刷,直到疲劳值不够了 |
| | | if (this.cancellationToken.IsCancellationRequested) |
| | | { |
| | | return false; |
| | | return ZTResult.Cancel; |
| | | } |
| | | |
| | | bool killResult = true; |
| | | |
| | | DateTime startHouse = DateTime.Now; |
| | | killResult = KillMonster(); |
| | | if (killResult) |
| | | ZTResult killResult = KillMonster(); |
| | | if (killResult==ZTResult.Success) |
| | | { |
| | | //捡东西 |
| | | G.Instance.InputControl.PressKey(RandomUtils.KeyPressDuration, HIDCode.V); |
| | |
| | | if (pilaozhi <= 0) |
| | | { |
| | | ExitToTown(); |
| | | return true; |
| | | return ZTResult.Success; |
| | | } |
| | | |
| | | ReplayGame(); |
| | |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | return killResult; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// 刷房间 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private bool KillMonster() |
| | | private ZTResult KillMonster() |
| | | { |
| | | Int32 result = 0; |
| | | bool ret = false; |
| | | |
| | | |
| | |
| | | if (!findResult) |
| | | { |
| | | G.Instance.InfoWriter("未找到进入凛冬的文字"); |
| | | return false; |
| | | return ZTResult.Failed; |
| | | } |
| | | G.Instance.InfoWriter("进入凛冬"); |
| | | |
| | |
| | | if (!ret) |
| | | { |
| | | G.Instance.InfoWriter("未找到人物所在房间"); |
| | | break; |
| | | return ZTResult.Failed; |
| | | } |
| | | |
| | | G.Instance.InfoWriter("进入房间->" + houseIndex.ToString()); |
| | |
| | | |
| | | DateTime roomStartTime = DateTime.Now; |
| | | KillMonsterStateMachine kmsm = new KillMonsterStateMachine(Houses[houseIndex], this.MinimapPoint, this.GameRect, preHouseIndex,this.runningStep); |
| | | result = kmsm.Start(cancellationToken, 5 * 60 * 1000); |
| | | ZTResult smresult = kmsm.Work(cancellationToken, 5 * 60 * 1000); |
| | | Int32 roomTotalSecond = (Int32)(DateTime.Now - roomStartTime).TotalSeconds; |
| | | G.Instance.InfoWriter("房间刷完,用时:" + (roomTotalSecond / 60) + "分" + (roomTotalSecond % 60) + "秒"); |
| | | runningStep = RunningStep.None; |
| | | if (result == JobResult.Success) |
| | | if (smresult == ZTResult.Success) |
| | | { |
| | | if (houseIndex == 15) |
| | | { |
| | | //所有房间刷完 |
| | | return true; |
| | | return ZTResult.Success; |
| | | } |
| | | |
| | | //刷其它房间 |
| | |
| | | } |
| | | else |
| | | { |
| | | break; |
| | | return smresult; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | return DnfCVHelper.IsInSaiLiYaHouse(this.GameRect); |
| | | }); |
| | | return result; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |