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
|
using System;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient
{
internal struct XBulletCore
{
public float InitHeight
{
get
{
return this._init_h;
}
}
public long Token
{
get
{
return this._token;
}
}
public bool FlyWithTerrain
{
get
{
return this._with_terrain;
}
}
public bool Demonstration
{
get
{
return this._demonstration;
}
}
public bool Warning
{
get
{
return this._warning;
}
}
public bool HasTarget
{
get
{
return this.Target != null;
}
}
public Vector3 WarningPos
{
get
{
return this._warning_pos;
}
}
public XResultData Result
{
get
{
return this._result;
}
}
public XSkillCore SkillCore
{
get
{
return this._core;
}
}
public XEntity Firer
{
get
{
return this._firer;
}
}
public ulong FirerID
{
get
{
return this._firer_id;
}
}
public XEntity Target
{
get
{
return XEntity.ValideEntity(this._target) ? this._target : null;
}
}
public string Prefab
{
get
{
return this.Result.LongAttackData.Prefab;
}
}
public int Sequnce
{
get
{
return this._sequnce;
}
}
public int ResultTime
{
get
{
return this._result_time;
}
}
public uint ResultID
{
get
{
return this._result_id;
}
}
public bool TriggerMove
{
get
{
return this._trigger_move;
}
}
public float Life
{
get
{
return this.Result.LongAttackData.Runningtime + this.Result.LongAttackData.Stickytime;
}
}
public float Running
{
get
{
return this.Result.LongAttackData.Runningtime;
}
}
public float Velocity
{
get
{
return this._velocity;
}
}
public float Radius
{
get
{
return this.Result.LongAttackData.Radius;
}
}
private XSkillCore _core;
private XResultData _result;
private XEntity _firer;
private XEntity _target;
private ulong _firer_id;
private long _token;
private Vector3 _warning_pos;
private int _sequnce;
private int _result_time;
private uint _result_id;
private bool _warning;
private float _velocity;
private float _init_h;
private bool _demonstration;
private bool _with_terrain;
private bool _trigger_move;
public Ray BulletRay;
public XBulletCore(long token, XEntity firer, XEntity target, XSkillCore core, XResultData data, uint resultID, int diviation, bool demonstration, int wid)
{
this._token = token;
this._result = data;
this._sequnce = data.Index;
this._result_id = resultID;
this._result_time = data.Token;
this._firer = firer;
this._firer_id = firer.ID;
this._target = (XEntity.ValideEntity(target) ? target : null);
this._core = core;
this._demonstration = demonstration;
string value = XSingleton<XGlobalConfig>.singleton.GetValue("BulletSkillName");
bool flag = !string.IsNullOrEmpty(value) && value.Contains(core.Soul.Name);
if (flag)
{
this._trigger_move = true;
}
else
{
this._trigger_move = false;
}
this._warning_pos = Vector3.zero;
bool attack_All = data.Attack_All;
if (attack_All)
{
this._warning_pos = this._target.EngineObject.Position;
}
else
{
bool warning = data.Warning;
if (warning)
{
this._warning_pos = this._core.WarningPosAt[data.Warning_Idx][wid].WarningAt;
}
}
this._warning = (this._warning_pos.sqrMagnitude > 0f);
Vector3 vector = this._firer.EngineObject.Position;
vector.y += this._firer.Height * 0.5f;
Vector3 v = this._warning ? (this._warning_pos - firer.EngineObject.Position) : ((data.LongAttackData.Reinforce && this._target != null) ? (this._target.EngineObject.Position - firer.EngineObject.Position) : firer.EngineObject.Forward);
vector += this._firer.EngineObject.Rotation * new Vector3(this._result.LongAttackData.At_X, this._result.LongAttackData.At_Y, this._result.LongAttackData.At_Z);
float num = 0f;
bool flag2 = !XSingleton<XScene>.singleton.TryGetTerrainY(vector, out num) || num < 0f;
if (flag2)
{
vector.x = this._firer.EngineObject.Position.x;
vector.z = this._firer.EngineObject.Position.z;
}
v.y = 0f;
Vector3 vector2 = XSingleton<XCommon>.singleton.HorizontalRotateVetor3(v, (float)diviation, true);
float runningtime = this._result.LongAttackData.Runningtime;
this._velocity = (this._warning ? ((this._warning_pos - vector).magnitude / runningtime) : this._result.LongAttackData.Velocity);
float num2 = 0f;
bool flag3 = this._target != null && this._result.LongAttackData.AimTargetCenter;
if (flag3)
{
num2 = vector.y - this._target.EngineObject.Position.y - this._target.Height * 0.5f;
bool flag4 = Mathf.Abs(num2) > 2f;
if (flag4)
{
num2 = 2f * (num2 / Mathf.Abs(num2));
}
}
vector2 = ((num2 == 0f || this._velocity == 0f) ? vector2 : (num2 * Vector3.down + this._velocity * runningtime * vector2).normalized);
this.BulletRay = new Ray(vector, vector2);
this._init_h = vector.y - XSingleton<XScene>.singleton.TerrainY(vector);
bool flag5 = this._init_h < 0f;
if (flag5)
{
this._init_h = 0f;
}
this._with_terrain = this._result.LongAttackData.FlyWithTerrain;
}
}
}
|