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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
|
using System;
using System.Collections.Generic;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient
{
internal class XInput : XSingleton<XInput>
{
public bool Freezed
{
get
{
return XSingleton<XGesture>.singleton.Freezed && XSingleton<XVirtualTab>.singleton.Freezed;
}
set
{
bool flag = XSingleton<XScene>.singleton.bSpectator || value;
bool flag2 = flag;
if (flag2)
{
bool flag3 = this._freeze_count == 0;
if (flag3)
{
XSingleton<XGesture>.singleton.Freezed = true;
XSingleton<XVirtualTab>.singleton.Freezed = true;
XSingleton<XActionSender>.singleton.Empty();
}
this._freeze_count++;
bool flag4 = XSingleton<XGame>.singleton.CurrentStage is XConcreteStage;
if (flag4)
{
XSingleton<XDebug>.singleton.AddLog("Freeze++: ", this._freeze_count.ToString(), null, null, null, null, XDebugColor.XDebug_None);
}
}
else
{
this._freeze_count--;
bool flag5 = this._freeze_count == 0;
if (flag5)
{
XSingleton<XGesture>.singleton.Freezed = false;
XSingleton<XVirtualTab>.singleton.Freezed = false;
}
else
{
bool flag6 = this._freeze_count < 0;
if (flag6)
{
this._freeze_count = 0;
}
}
bool flag7 = XSingleton<XGame>.singleton.CurrentStage is XConcreteStage;
if (flag7)
{
XSingleton<XDebug>.singleton.AddLog("Freeze--: ", this._freeze_count.ToString(), null, null, null, null, XDebugColor.XDebug_None);
}
}
}
}
public bool HasMove
{
get
{
return this._hasMove;
}
}
public bool HasEnemy
{
get
{
return this._hasEnemy;
}
}
public bool HasNpc
{
get
{
return this._hasNpc;
}
}
public bool HasRole
{
get
{
return this._hasRole;
}
}
public bool HasDummy
{
get
{
return this._hasDummy;
}
}
public float LastMoveAt
{
get
{
return this._last_move_at;
}
}
public float LastEntityAt
{
get
{
return this._last_entity_at;
}
}
public XEntity LastEnemy
{
get
{
return this._last_enemy;
}
}
public XEntity LastNpc
{
get
{
return this._last_npc;
}
set
{
this._last_npc = value;
this._hasNpc = (this._last_npc != null);
}
}
public XEntity LastRole
{
get
{
return this._last_role;
}
}
public XEntity LastDummy
{
get
{
return this._last_dummy;
}
}
public Vector3 LastMovePoint
{
get
{
return this._last_move_point;
}
}
public Vector3 LastGroundPoint
{
get
{
return this._last_ground_point;
}
}
public bool IsFxShield
{
get
{
return this._ally_fx_shield;
}
}
public bool IsMyFxShield
{
get
{
return this._my_fx_shield;
}
}
private GameObject _45hide = null;
private XEntity _last_enemy = null;
private XEntity _last_npc = null;
private XEntity _last_role = null;
private XEntity _last_dummy = null;
private Vector3 _last_move_point = Vector3.zero;
private Vector3 _last_ground_point = Vector3.zero;
private float _last_move_at = 0f;
private float _last_entity_at = 0f;
private RaycastHit _hit;
private int _freeze_count = 0;
private bool _hasMove = false;
private bool _hasEnemy = false;
private bool _hasNpc = false;
private bool _hasRole = false;
private bool _hasDummy = false;
private bool _ally_fx_shield = false;
private bool _mob_shield = false;
private bool _my_fx_shield = false;
private XTableAsyncLoader _async_loader = null;
private XOperationTable _reader = new XOperationTable();
public override bool Init()
{
bool flag = this._async_loader == null;
if (flag)
{
this._async_loader = new XTableAsyncLoader();
this._async_loader.AddTask("Table/XOperation", this._reader, false);
this._async_loader.Execute(null);
}
bool flag2 = !this._async_loader.IsDone;
return !flag2;
}
public override void Uninit()
{
this._async_loader = null;
}
public void UnFreezed()
{
bool freezed = this.Freezed;
if (freezed)
{
this._freeze_count = 1;
this.Freezed = false;
}
}
public void OnEnterScene()
{
this._45hide = null;
this._freeze_count = 0;
XSingleton<XVirtualTab>.singleton.OnEnterScene();
XSingleton<XGesture>.singleton.OnEnterScene();
XSingleton<XGyroscope>.singleton.OnEnterScene();
this.UpdateShieldOperation();
this.UnFreezed();
}
public void OnLeaveScene()
{
this._last_npc = null;
}
public void UpdateShieldOperation()
{
XOptionsDocument specificDocument = XDocuments.GetSpecificDocument<XOptionsDocument>(XOptionsDocument.uuID);
bool flag = specificDocument != null;
if (flag)
{
this._ally_fx_shield = (specificDocument.GetValue(XOptionsDefine.OD_Shield_Skill_Fx) != 0);
this._mob_shield = (specificDocument.GetValue(XOptionsDefine.OD_Shield_Summon) != 0);
this._my_fx_shield = (specificDocument.GetValue(XOptionsDefine.OD_Shield_My_Skill_Fx) != 0);
bool flag2 = XSingleton<XEntityMgr>.singleton.Player != null;
if (flag2)
{
List<XEntity> ally = XSingleton<XEntityMgr>.singleton.GetAlly(XSingleton<XEntityMgr>.singleton.Player);
for (int i = 0; i < ally.Count; i++)
{
bool flag3 = ally[i].Skill != null && ally[i].Skill.SkillMobs != null;
if (flag3)
{
for (int j = 0; j < ally[i].Skill.SkillMobs.Count; j++)
{
ally[i].Skill.SkillMobs[j].MobShield = this.MobShield(ally[i].Skill.SkillMobs[j]);
}
}
}
}
}
}
public void UpdateDefaultCameraOperationByScene()
{
SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
XOperationTable.RowData rowData = null;
XOperationMode operationMode = XSingleton<XOperationData>.singleton.OperationMode;
if (operationMode != XOperationMode.X25D)
{
if (operationMode - XOperationMode.X3D <= 1)
{
rowData = this._reader.GetByID((int)sceneData.OperationSettings[0]);
}
}
else
{
rowData = this._reader.GetByID((int)sceneData.OperationSettings[1]);
}
bool flag = rowData != null;
if (flag)
{
XSingleton<XOperationData>.singleton.CameraAngle = rowData.Angle;
XSingleton<XOperationData>.singleton.CameraDistance = rowData.Distance;
XSingleton<XOperationData>.singleton.AllowVertical = rowData.Vertical;
XSingleton<XOperationData>.singleton.AllowHorizontal = rowData.Horizontal;
XSingleton<XOperationData>.singleton.MaxVertical = rowData.MaxV;
XSingleton<XOperationData>.singleton.MinVertical = rowData.MinV;
XSingleton<XOperationData>.singleton.OffSolo = rowData.OffSolo;
}
}
public bool FxShield(XEntity e)
{
return (this._ally_fx_shield && e != null && !e.IsPlayer && XSingleton<XEntityMgr>.singleton.IsAlly(e)) || (this._my_fx_shield && e != null && e.IsPlayer);
}
public bool MobShield(XEntity e)
{
return this._mob_shield && e != null && e.MobbedBy != null && !e.MobbedBy.IsPlayer && e.MobShieldable && XSingleton<XEntityMgr>.singleton.IsAlly(e);
}
public bool UpdateOperationMode()
{
bool isPlaying = XSingleton<XCutScene>.singleton.IsPlaying;
bool result;
if (isPlaying)
{
XSingleton<XDebug>.singleton.AddErrorLog("Cannot change operation mode during cut-scene playing!", null, null, null, null, null);
result = false;
}
else
{
bool flag = XSingleton<XGame>.singleton.CurrentStage is XConcreteStage;
if (flag)
{
this.InnerOperationModeUpdate();
result = true;
}
else
{
result = false;
}
}
return result;
}
private void InnerOperationModeUpdate()
{
XSingleton<XGyroscope>.singleton.Cancel();
XSingleton<XGesture>.singleton.Cancel();
XOperationMode operationMode = XSingleton<XOperationData>.singleton.OperationMode;
if (operationMode != XOperationMode.X25D)
{
if (operationMode - XOperationMode.X3D <= 1)
{
bool flag = this._45hide == null;
if (flag)
{
this._45hide = GameObject.Find("Scene/45hide");
}
bool flag2 = this._45hide != null && !this._45hide.activeSelf;
if (flag2)
{
this._45hide.SetActive(true);
}
}
}
else
{
bool flag3 = this._45hide == null;
if (flag3)
{
this._45hide = GameObject.Find("Scene/45hide");
}
bool flag4 = this._45hide != null && this._45hide.activeSelf;
if (flag4)
{
this._45hide.SetActive(false);
}
}
XSingleton<XScene>.singleton.GameCamera.SetSightType();
}
private XEntity HitOnEnemy()
{
return null;
}
private XEntity HitOnRole()
{
bool oneUpTouch = XSingleton<XGesture>.singleton.OneUpTouch;
if (oneUpTouch)
{
bool flag = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall && XSingleton<XScene>.singleton.GameCamera.UnityCamera != null;
if (flag)
{
Ray ray = XSingleton<XScene>.singleton.GameCamera.UnityCamera.ScreenPointToRay(XSingleton<XGesture>.singleton.TouchPosition);
int num = 1 << LayerMask.NameToLayer("Role");
bool flag2 = Physics.SphereCast(ray, 0.1f, out this._hit, float.PositiveInfinity, num);
if (flag2)
{
string s = this._hit.collider.gameObject.name.StartsWith("mount_") ? this._hit.collider.gameObject.name.Substring(6) : this._hit.collider.gameObject.name;
ulong id = 0UL;
bool flag3 = ulong.TryParse(s, out id);
if (flag3)
{
XEntity entity = XSingleton<XEntityMgr>.singleton.GetEntity(id);
return (entity != null && entity.IsRole && !entity.IsPlayer) ? entity : null;
}
return null;
}
}
}
return null;
}
private XEntity HitOnDummy()
{
bool oneUpTouch = XSingleton<XGesture>.singleton.OneUpTouch;
if (oneUpTouch)
{
bool flag = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall && XSingleton<XScene>.singleton.GameCamera.UnityCamera != null;
if (flag)
{
Ray ray = XSingleton<XScene>.singleton.GameCamera.UnityCamera.ScreenPointToRay(XSingleton<XGesture>.singleton.TouchPosition);
int num = 1 << LayerMask.NameToLayer("Dummy");
bool flag2 = Physics.SphereCast(ray, 0.1f, out this._hit, float.PositiveInfinity, num);
if (flag2)
{
ulong id = 0UL;
bool flag3 = ulong.TryParse(this._hit.collider.gameObject.name, out id);
if (flag3)
{
XEntity entityConsiderDeath = XSingleton<XEntityMgr>.singleton.GetEntityConsiderDeath(id);
return (entityConsiderDeath != null && entityConsiderDeath.IsDummy) ? entityConsiderDeath : null;
}
return null;
}
}
}
return null;
}
private XEntity HitOnNpc()
{
bool oneUpTouch = XSingleton<XGesture>.singleton.OneUpTouch;
if (oneUpTouch)
{
bool flag = XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall && XSingleton<XScene>.singleton.GameCamera.UnityCamera != null;
if (flag)
{
Ray ray = XSingleton<XScene>.singleton.GameCamera.UnityCamera.ScreenPointToRay(XSingleton<XGesture>.singleton.TouchPosition);
int num = 1 << LayerMask.NameToLayer("Npc");
bool flag2 = Physics.SphereCast(ray, 0.1f, out this._hit, float.PositiveInfinity, num);
if (flag2)
{
ulong id = 0UL;
bool flag3 = ulong.TryParse(this._hit.collider.gameObject.name, out id);
if (flag3)
{
XEntity entity = XSingleton<XEntityMgr>.singleton.GetEntity(id);
return (entity != null && entity.IsNpc) ? entity : null;
}
return null;
}
}
}
return null;
}
private Vector3 HitOnGround()
{
return Vector3.zero;
}
public void Update()
{
Vector3 vector = Vector3.zero;
this._hasMove = false;
this._hasEnemy = false;
this._hasNpc = false;
this._hasRole = false;
this._hasDummy = false;
XSingleton<XTouch>.singleton.Update();
bool gestured = XSingleton<XGesture>.singleton.Gestured;
if (gestured)
{
XEntity xentity = this.HitOnEnemy();
this._hasEnemy = (xentity != null);
XEntity xentity2 = this.HitOnNpc();
this._hasNpc = (xentity2 != null);
bool flag = !this._hasEnemy && !this._hasNpc;
if (flag)
{
xentity2 = this.HitOnRole();
this._hasRole = (xentity2 != null);
this._last_role = (this._hasRole ? xentity2 : null);
bool flag2 = !this._hasRole;
if (flag2)
{
xentity2 = this.HitOnDummy();
this._hasDummy = (xentity2 != null);
this._last_dummy = (this._hasDummy ? xentity2 : null);
bool flag3 = !this._hasDummy;
if (flag3)
{
vector = this.HitOnGround();
bool flag4 = vector != Vector3.zero;
bool oneTouch = XSingleton<XGesture>.singleton.OneTouch;
if (oneTouch)
{
this._hasMove = flag4;
bool hasMove = this._hasMove;
if (hasMove)
{
this._last_move_point = vector;
this._last_move_at = Time.time;
}
}
bool flag5 = flag4;
if (flag5)
{
this._last_ground_point = vector;
}
}
}
}
else
{
this._last_enemy = xentity;
this._last_npc = xentity2;
this._last_entity_at = Time.time;
}
}
}
}
}
|