asmrobot
2019-08-31 013a5eb0380063717241a9d6705557d9a59adbfe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
using RichCreator.Utility.Captures;
using RichCreator.Utility.CV;
using RichCreator.Utility.Structs;
using RichCreator.Utility.Utilitys;
using Emgu.CV;
using Emgu.CV.Structure;
using RichCreator.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZTImage.Configuration;
 
namespace RichCreator
{
    /// <summary>
    /// 运行步骤
    /// </summary>
    public class RunningStep
    {
        /// <summary>
        /// 一个步骤都没有
        /// </summary>
        public const Int32 None = 0;
 
        /// <summary>
        /// 选择角色
        /// </summary>
        public const Int32 SelectRole = 51;
 
        /// <summary>
        /// 赛利亚的房间
        /// </summary>
        public const Int32 Home = 52;
 
        /// <summary>
        /// 素喃
        /// </summary>
        public const Int32 Sunan = 53;
 
 
        /// <summary>
        /// 时空之门
        /// </summary>
        public const Int32 Shikongzhimen = 54;
 
        /// <summary>
        /// 选择难度界面
        /// </summary>
        public const Int32 SelectDifficulty = 55;
 
        /// <summary>
        /// 战斗界面
        /// </summary>
        public const Int32 War = 56;
 
        /// <summary>
        /// 最后一关
        /// </summary>
        public const Int32 LastLevel = 57;
 
 
        /// <summary>
        /// 得到当前步骤
        /// 51.选择角色界面,通过开始游戏按钮界定
        /// 52.赛丽亚的房间,通过邮箱界定
        /// 53.嗉喃,通过小地图上面的素喃文字界定
        /// 54.时空之门,通过小地图上面的文字界定
        /// 55.副本选择界面,通过space界定
        /// 56.战斗中界面,通过小地图界定
        /// 57.最后一关已打完,通过加号来界定
        /// </summary>
        /// <returns></returns>
        public static Int32 GetStep()
        {
            RunningModel rm = ConfigHelper.GetInstance<RunningModel>();
 
            ZTRectangle gameRect = ZTRectangle.Empty;
            if (WindowUtils.GetDnfRect(out gameRect))
            {
                Image<Rgb, byte> image = ScreenCapture.Instance.CaptureScreenReturnImage();
                ////57.最后一关已打完,通过加号来界定
                //if (DnfCVHelper.IsAllComplete(image, gameRect))
                //{
                //    return LastLevel;
                //}
 
                //56.战斗中判断
                ZTRectangle minimapRect = ZTRectangle.Empty;
                if (LindongCVHelper.ExistLingdongText(image, gameRect))
                {
                    return War;
                }
 
                //// 55.副本选择,通过space界定
                //if (LindongCVHelper.IsInChoiceTaskPage(image, gameRect))
                //{
                //    return SelectDifficulty;
                //}
 
                ////54.时空之门
                //if (LindongCVHelper.IsShikongzhimen(image, gameRect))
                //{
                //    return Shikongzhimen;
                //}
 
                ////53.素喃
                //if (LindongCVHelper.IsInSunan(image, gameRect))
                //{
                //    return Sunan;
                //}
 
                ////52.赛丽亚房间
                //if (DnfCVHelper.IsInSaiLiYaFangJian(gameRect))
                //{
                //    return Home;
                //}
 
                //51.角色选择界面
                ZTRectangle startRect = ZTRectangle.Empty;
                if (DnfCVHelper.IsSelectRoleWindow(out startRect))
                {
                    return SelectRole;
                }
            }
 
            //ZTRectangle wegameRect = ZTRectangle.Empty;
            //if (WindowUtils.GetWeGameRect(out wegameRect))
            //{
 
            //}
            return None;
        }
    }
}