Elin Modding Docs Doc
Loading...
Searching...
No Matches
TaskPoint.cs
1using System;
2using System.Collections.Generic;
3using Newtonsoft.Json;
4using UnityEngine;
5
6// Token: 0x02000254 RID: 596
7public class TaskPoint : Task, IInspect
8{
9 // Token: 0x1700045F RID: 1119
10 // (get) Token: 0x0600108A RID: 4234 RVA: 0x0007373D File Offset: 0x0007193D
11 public override bool HasProgress
12 {
13 get
14 {
15 return false;
16 }
17 }
18
19 // Token: 0x17000460 RID: 1120
20 // (get) Token: 0x0600108B RID: 4235 RVA: 0x00073740 File Offset: 0x00071940
21 public virtual int destDist
22 {
23 get
24 {
25 return 0;
26 }
27 }
28
29 // Token: 0x17000461 RID: 1121
30 // (get) Token: 0x0600108C RID: 4236 RVA: 0x00073743 File Offset: 0x00071943
31 public virtual bool destIgnoreConnection
32 {
33 get
34 {
35 return false;
36 }
37 }
38
39 // Token: 0x17000462 RID: 1122
40 // (get) Token: 0x0600108D RID: 4237 RVA: 0x00073746 File Offset: 0x00071946
41 public virtual bool isBlock
42 {
43 get
44 {
45 return false;
46 }
47 }
48
49 // Token: 0x17000463 RID: 1123
50 // (get) Token: 0x0600108E RID: 4238 RVA: 0x00073749 File Offset: 0x00071949
51 public virtual bool Loop
52 {
53 get
54 {
55 return false;
56 }
57 }
58
59 // Token: 0x0600108F RID: 4239 RVA: 0x0007374C File Offset: 0x0007194C
60 public override bool CanManualCancel()
61 {
62 return base.IsChildRunning && this.child is AI_Goto;
63 }
64
65 // Token: 0x06001090 RID: 4240 RVA: 0x00073768 File Offset: 0x00071968
66 public override bool CanPerform()
67 {
68 if (this.owner == null)
69 {
70 this.owner = Act.CC;
71 }
72 TaskPoint.tempPos.Set(this.pos);
73 this.pos.Set(Act.TP);
74 HitResult hitResult = this.GetHitResult();
75 this.pos.Set(TaskPoint.tempPos);
76 return hitResult == HitResult.Valid || hitResult == HitResult.Warning;
77 }
78
79 // Token: 0x06001091 RID: 4241 RVA: 0x000737CC File Offset: 0x000719CC
80 public override bool _CanPerformTask(Chara chara, int radius)
81 {
82 return (radius == -1 || chara.pos.Distance(this.pos) <= radius) && !this.pos.cell.isSurrounded;
83 }
84
85 // Token: 0x06001092 RID: 4242 RVA: 0x000737FD File Offset: 0x000719FD
86 public override IEnumerable<AIAct.Status> Run()
87 {
88 if (this.owner.IsPC && AM_Adv.actCount > 0)
89 {
90 while (EInput.rightMouse.pressing)
91 {
92 this.pos.Set(Act.TP.Set(ActionMode.Adv.mouseTarget.pos));
93 if (this.CanPerform())
94 {
95 break;
96 }
97 yield return AIAct.Status.Running;
98 }
99 this.pos.Set(Act.TP.Set(ActionMode.Adv.mouseTarget.pos));
100 if (!this.CanPerform() || !EInput.rightMouse.pressing || (this.HasProgress && !this.CanProgress()))
101 {
102 yield return base.Destroy();
103 }
104 }
105 do
106 {
107 if (this.owner.pos.Distance(this.pos) > this.destDist)
108 {
109 yield return base.DoGoto(this.pos, this.destDist, this.destIgnoreConnection, null);
110 if (this.owner.pos.Distance(this.pos) > this.destDist)
111 {
112 string[] array = new string[5];
113 array[0] = AM_Adv.actCount.ToString();
114 array[1] = "/";
115 int num = 2;
116 Point point = this.pos;
117 array[num] = ((point != null) ? point.ToString() : null);
118 array[3] = "/";
119 int num2 = 4;
120 Point point2 = this.owner.pos;
121 array[num2] = ((point2 != null) ? point2.ToString() : null);
122 Debug.Log(string.Concat(array));
123 Debug.Log(this.destDist.ToString() + "/" + this.owner.pos.Distance(this.pos).ToString());
124 yield return base.Destroy();
125 }
126 }
127 if (!this.CanProgress())
128 {
129 yield return base.Destroy();
130 }
131 if (this.HasProgress)
132 {
133 yield return base.DoProgress();
134 }
135 else
136 {
137 yield return base.KeepRunning();
138 this.OnProgressComplete();
139 }
140 if (this.owner != null && this.owner.IsPC)
141 {
142 AM_Adv.actCount++;
143 }
144 }
145 while (this.Loop);
146 yield break;
147 }
148
149 // Token: 0x06001093 RID: 4243 RVA: 0x0007380D File Offset: 0x00071A0D
150 public void OnInspect()
151 {
152 }
153
154 // Token: 0x17000464 RID: 1124
155 // (get) Token: 0x06001094 RID: 4244 RVA: 0x0007380F File Offset: 0x00071A0F
156 public bool CanInspect
157 {
158 get
159 {
160 return !this.isDestroyed;
161 }
162 }
163
164 // Token: 0x17000465 RID: 1125
165 // (get) Token: 0x06001095 RID: 4245 RVA: 0x0007381A File Offset: 0x00071A1A
166 public string InspectName
167 {
168 get
169 {
170 return base.source.GetName();
171 }
172 }
173
174 // Token: 0x17000466 RID: 1126
175 // (get) Token: 0x06001096 RID: 4246 RVA: 0x00073827 File Offset: 0x00071A27
176 public Point InspectPoint
177 {
178 get
179 {
180 return this.pos;
181 }
182 }
183
184 // Token: 0x17000467 RID: 1127
185 // (get) Token: 0x06001097 RID: 4247 RVA: 0x0007382F File Offset: 0x00071A2F
186 public unsafe Vector3 InspectPosition
187 {
188 get
189 {
190 return *this.pos.Position();
191 }
192 }
193
194 // Token: 0x06001098 RID: 4248 RVA: 0x00073841 File Offset: 0x00071A41
195 public void WriteNote(UINote n, Action<UINote> onWriteNote = null, IInspect.NoteMode mode = IInspect.NoteMode.Default, Recipe recipe = null)
196 {
197 n.Clear();
198 n.AddHeaderCard(this.Name, null);
199 n.Build();
200 }
201
202 // Token: 0x04000DBA RID: 3514
203 private static Point tempPos = new Point();
204
205 // Token: 0x04000DBB RID: 3515
206 [JsonProperty]
207 public Point pos = new Point();
208
209 // Token: 0x04000DBC RID: 3516
210 public bool isRepeated;
211}
Definition AIAct.cs:7
Definition Act.2.cs:7
Definition Chara.cs:12
Definition Point.cs:11
Definition Task.cs:6