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
|
using System;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace XMainClient
{
internal class XLevelWave
{
public int _id;
public LevelSpawnType _spawnType;
public float _time;
public int _loopInterval;
public uint _EnemyID;
public int _randomID;
public int _yRotate;
public bool _repeat;
public string _exString;
public List<int> _preWave = new List<int>();
public float _preWavePercent;
public Dictionary<int, Vector3> _monsterPos = new Dictionary<int, Vector3>();
public Dictionary<int, Vector3> _monsterRot = new Dictionary<int, Vector3>();
public float _roundRidus;
public int _roundCount;
public string _levelscript;
protected void ParseInfo(string data)
{
InfoType infoType = InfoType.TypeNone;
bool flag = data.StartsWith("id");
if (flag)
{
infoType = InfoType.TypeId;
}
else
{
bool flag2 = data.StartsWith("bi");
if (flag2)
{
infoType = InfoType.TypeBaseInfo;
}
else
{
bool flag3 = data.StartsWith("pw");
if (flag3)
{
infoType = InfoType.TypePreWave;
}
else
{
bool flag4 = data.StartsWith("ei");
if (flag4)
{
infoType = InfoType.TypeEditor;
}
else
{
bool flag5 = data.StartsWith("mi");
if (flag5)
{
infoType = InfoType.TypeMonsterInfo;
}
else
{
bool flag6 = data.StartsWith("si");
if (flag6)
{
infoType = InfoType.TypeScript;
}
else
{
bool flag7 = data.StartsWith("es");
if (flag7)
{
infoType = InfoType.TypeExString;
}
else
{
bool flag8 = data.StartsWith("st");
if (flag8)
{
infoType = InfoType.TypeSpawnType;
}
}
}
}
}
}
}
}
string text = data.Substring(3);
switch (infoType)
{
case InfoType.TypeId:
this._id = int.Parse(text);
break;
case InfoType.TypeBaseInfo:
{
string[] array = text.Split(new char[]
{
','
});
this._time = float.Parse(array[0]);
this._loopInterval = int.Parse(array[1]);
this._EnemyID = uint.Parse(array[2]);
this._yRotate = int.Parse(array[5]);
bool flag9 = array.Length > 6;
if (flag9)
{
this._roundRidus = float.Parse(array[6]);
}
bool flag10 = array.Length > 7;
if (flag10)
{
this._roundCount = int.Parse(array[7]);
}
bool flag11 = array.Length > 8;
if (flag11)
{
this._randomID = int.Parse(array[8]);
}
bool flag12 = array.Length > 11;
if (flag12)
{
this._repeat = bool.Parse(array[11]);
}
break;
}
case InfoType.TypePreWave:
{
string[] array2 = text.Split(new char[]
{
'|'
});
bool flag13 = array2.Length != 0;
if (flag13)
{
string text2 = array2[0];
bool flag14 = text2.Length > 0;
if (flag14)
{
string[] array3 = text2.Split(new char[]
{
','
});
for (int i = 0; i < array3.Length; i++)
{
int item = 0;
bool flag15 = int.TryParse(array3[i], out item);
if (flag15)
{
this._preWave.Add(item);
}
}
}
}
bool flag16 = array2.Length > 1;
if (flag16)
{
int num = int.Parse(array2[1]);
this._preWavePercent = (float)num / 100f;
}
break;
}
case InfoType.TypeMonsterInfo:
{
string[] array4 = text.Split(new char[]
{
','
});
int key = int.Parse(array4[0]);
float num2 = float.Parse(array4[1]);
float num3 = float.Parse(array4[2]);
float num4 = float.Parse(array4[3]);
Vector3 value;
value= new Vector3(num2, num3, num4);
this._monsterPos.Add(key, value);
Vector3 value2;
value2= new Vector3(0f, 0f, 0f);
bool flag17 = array4.Length > 4;
if (flag17)
{
value2.y = float.Parse(array4[4]);
}
this._monsterRot.Add(key, value2);
break;
}
case InfoType.TypeScript:
{
string[] array5 = text.Split(new char[]
{
','
});
bool flag18 = array5.Length != 0;
if (flag18)
{
this._levelscript = array5[0];
}
break;
}
case InfoType.TypeExString:
this._exString = text;
break;
case InfoType.TypeSpawnType:
this._spawnType = (LevelSpawnType)int.Parse(text);
break;
}
}
public void ReadFromFile(StreamReader sr)
{
string text = sr.ReadLine();
bool flag = text != "bw";
if (!flag)
{
for (;;)
{
text = sr.ReadLine();
bool flag2 = text == "ew";
if (flag2)
{
break;
}
this.ParseInfo(text);
}
}
}
public bool IsScriptWave()
{
return this._levelscript != null && this._levelscript.Length > 0;
}
}
}
|