Elin Modding Docs Doc
Loading...
Searching...
No Matches
PointTarget.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x02000626 RID: 1574
6public class PointTarget : EClass
7{
8 // Token: 0x17000C99 RID: 3225
9 // (get) Token: 0x06002C24 RID: 11300 RVA: 0x000F8211 File Offset: 0x000F6411
10 public Chara TargetChara
11 {
12 get
13 {
14 if (this.card != null)
15 {
16 return this.card.Chara;
17 }
18 return null;
19 }
20 }
21
22 // Token: 0x06002C25 RID: 11301 RVA: 0x000F8228 File Offset: 0x000F6428
23 public void Update(Point _pos)
24 {
25 this.pos.Set(_pos);
26 this.isValid = this.pos.IsValid;
27 this.cards.Clear();
28 if (!this.isValid || this.pos.IsHidden || EClass.ui.BlockMouseOverUpdate || (this.mouse && (EClass.ui.isPointerOverUI || !EClass.scene.actionMode.ShowMouseoverTarget)))
29 {
30 this.Clear();
31 return;
32 }
33 this.card = null;
34 this.area = null;
35 this.task = null;
36 this.block = (BlockInfo._CanInspect(this.pos) ? BlockInfo.GetTemp(this.pos) : null);
37 if (this.pos.sourceBlock.tileType.Invisible && !EClass.scene.actionMode.IsBuildMode)
38 {
39 this.block = null;
40 }
41 this.obj = (ObjInfo._CanInspect(this.pos) ? ObjInfo.GetTemp(this.pos) : null);
42 if (this.obj != null)
43 {
44 this.target = this.obj;
45 }
46 else if (this.block != null)
47 {
48 this.target = this.block;
49 }
50 else
51 {
52 this.target = null;
53 }
54 this.drawHighlight = (this.target != null);
55 CellDetail detail = this.pos.detail;
56 if (detail != null)
57 {
58 this.area = detail.area;
59 this.task = detail.designation;
60 Thing thing = null;
61 Chara chara = null;
62 foreach (Chara chara2 in detail.charas)
63 {
64 if (!this.ShouldIgnore(chara2))
65 {
66 this.cards.Add(chara2);
67 if (chara == null || chara2.hostility < chara.hostility)
68 {
69 chara = chara2;
70 }
71 }
72 }
73 foreach (Thing thing2 in detail.things)
74 {
75 if (!this.ShouldIgnore(thing2))
76 {
77 this.cards.Add(thing2);
78 thing = thing2;
79 }
80 }
81 if (chara != null)
82 {
83 this.target = (this.card = chara);
84 this.drawHighlight = true;
85 }
86 else if (thing != null)
87 {
88 this.target = (this.card = thing);
89 this.drawHighlight = true;
90 }
91 else if (this.task != null)
92 {
93 this.target = this.task;
94 this.drawHighlight = true;
95 }
96 else if (this.area != null && EClass.scene.actionMode.AreaHihlight != AreaHighlightMode.None)
97 {
98 this.target = this.area;
99 }
100 if (this.cards.Count > 0 && EClass.scene.actionMode.IsBuildMode)
101 {
102 this.target = (this.card = this.cards[Mathf.Abs(this.index) % this.cards.Count]);
103 this.drawHighlight = true;
104 }
105 }
106 if ((this.target == null || this.target is Chara) && EClass._zone.IsRegion)
107 {
108 Zone zone = EClass.scene.elomap.GetZone(this.pos);
109 if (zone != null)
110 {
111 this.target = zone;
112 }
113 }
114 this.hasInteraction = (this.target != null);
115 this.CheckLastTarget();
116 }
117
118 // Token: 0x06002C26 RID: 11302 RVA: 0x000F8594 File Offset: 0x000F6794
119 public bool ShouldIgnore(Card c)
120 {
121 if (c.isChara)
122 {
123 if (c.Chara.host != null)
124 {
125 return true;
126 }
127 if (EClass.scene.actionMode.IsBuildMode)
128 {
129 if (!EClass.debug.ignoreBuildRule && (c.IsPC || !c.IsPCFaction))
130 {
131 return true;
132 }
133 }
134 else
135 {
136 if ((!EClass.pc.hasTelepathy || !c.Chara.race.visibleWithTelepathy) && c.isHidden && !EClass.pc.canSeeInvisible)
137 {
138 return true;
139 }
140 if (c.IsPC)
141 {
142 return true;
143 }
144 if (!c.isSynced || !EClass.player.CanSee(c.Chara))
145 {
146 return true;
147 }
148 }
149 return false;
150 }
151 else
152 {
153 if (c.trait.IsGround && !this.pos.cell.IsFloorWater && c.Cell.IsFloorWater)
154 {
155 return true;
156 }
157 if (EClass.scene.actionMode.IsBuildMode)
158 {
159 if (EClass.scene.actionMode.IsRoofEditMode(null))
160 {
161 if (!c.isRoofItem)
162 {
163 return true;
164 }
165 }
166 else if (c.isRoofItem)
167 {
168 return true;
169 }
170 }
171 else if (c.isHidden || c.isRoofItem || c.isMasked)
172 {
173 return true;
174 }
175 return false;
176 }
177 }
178
179 // Token: 0x06002C27 RID: 11303 RVA: 0x000F86C6 File Offset: 0x000F68C6
180 public void CycleTarget(int a)
181 {
182 SE.Rotate();
183 this.index += a;
184 this.Update(Scene.HitPoint);
185 if (WidgetMouseover.Instance)
186 {
187 WidgetMouseover.Instance.Refresh();
188 }
189 }
190
191 // Token: 0x06002C28 RID: 11304 RVA: 0x000F86FC File Offset: 0x000F68FC
192 public bool CanCycle()
193 {
194 return this.cards.Count >= 2;
195 }
196
197 // Token: 0x06002C29 RID: 11305 RVA: 0x000F870F File Offset: 0x000F690F
198 public void Clear()
199 {
200 this.card = null;
201 this.area = null;
202 this.target = null;
203 this.hasInteraction = false;
204 this.CheckLastTarget();
205 }
206
207 // Token: 0x06002C2A RID: 11306 RVA: 0x000F8734 File Offset: 0x000F6934
208 public void CheckLastTarget()
209 {
210 this.hasTargetChanged = (this.target != this.lastTarget || !this.pos.Equals(this.lastPos));
211 this.hasValidTarget = (this.target != null);
212 this.lastTarget = this.target;
213 this.lastPos.Set(this.pos);
214 }
215
216 // Token: 0x040018B9 RID: 6329
217 public Card card;
218
219 // Token: 0x040018BA RID: 6330
220 public Area area;
221
222 // Token: 0x040018BB RID: 6331
223 public ObjInfo obj;
224
225 // Token: 0x040018BC RID: 6332
226 public BlockInfo block;
227
228 // Token: 0x040018BD RID: 6333
229 public TaskPoint task;
230
231 // Token: 0x040018BE RID: 6334
232 public IInspect target;
233
234 // Token: 0x040018BF RID: 6335
235 public IInspect lastTarget;
236
237 // Token: 0x040018C0 RID: 6336
238 public bool hasTargetChanged;
239
240 // Token: 0x040018C1 RID: 6337
241 public bool hasValidTarget;
242
243 // Token: 0x040018C2 RID: 6338
244 public bool drawHighlight;
245
246 // Token: 0x040018C3 RID: 6339
247 public bool mouse = true;
248
249 // Token: 0x040018C4 RID: 6340
250 public bool hasInteraction;
251
252 // Token: 0x040018C5 RID: 6341
253 public bool isValid;
254
255 // Token: 0x040018C6 RID: 6342
256 public Point pos = new Point();
257
258 // Token: 0x040018C7 RID: 6343
259 public Point lastPos = new Point();
260
261 // Token: 0x040018C8 RID: 6344
262 public int index;
263
264 // Token: 0x040018C9 RID: 6345
265 public List<Card> cards = new List<Card>();
266}
Definition Area.cs:6
Definition Card.cs:13
Definition Chara.cs:12
Definition Point.cs:11
Definition Scene.cs:10
Definition Thing.cs:10
Definition Zone.cs:14