Elin Decompiled Documentation EA 23.321 Nightly Patch 1
Loading...
Searching...
No Matches
SourceRace.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3
4public class SourceRace : SourceDataString<SourceRace.Row>
5{
6 [Serializable]
7 public class Row : BaseRow
8 {
9 public string id;
10
11 public string name_JP;
12
13 public string name;
14
15 public int playable;
16
17 public string[] tag;
18
19 public int life;
20
21 public int mana;
22
23 public int vigor;
24
25 public int DV;
26
27 public int PV;
28
29 public int PDR;
30
31 public int EDR;
32
33 public int EP;
34
35 public int STR;
36
37 public int END;
38
39 public int DEX;
40
41 public int PER;
42
43 public int LER;
44
45 public int WIL;
46
47 public int MAG;
48
49 public int CHA;
50
51 public int SPD;
52
53 public int INT;
54
55 public int martial;
56
57 public int pen;
58
59 public int[] elements;
60
61 public string skill;
62
63 public string figure;
64
65 public int geneCap;
66
67 public string material;
68
69 public string[] corpse;
70
71 public string[] loot;
72
73 public int blood;
74
75 public string meleeStyle;
76
77 public string castStyle;
78
79 public string[] EQ;
80
81 public int sex;
82
83 public int[] age;
84
85 public int height;
86
87 public int breeder;
88
89 public string[] food;
90
91 public string fur;
92
93 public string detail_JP;
94
95 public string detail;
96
97 public Dictionary<int, int> elementMap;
98
99 [NonSerialized]
100 public string name_L;
101
102 [NonSerialized]
103 public string detail_L;
104
105 public override bool UseAlias => false;
106
107 public override string GetAlias => "n";
108
109 public bool IsAnimal => tag.Contains("animal");
110
111 public bool IsHuman => tag.Contains("human");
112
113 public bool IsUndead => tag.Contains("undead");
114
115 public bool IsMachine => tag.Contains("machine");
116
117 public bool IsHorror => tag.Contains("horror");
118
119 public bool IsFish => tag.Contains("fish");
120
121 public bool IsFairy => tag.Contains("fairy");
122
123 public bool IsGod => tag.Contains("god");
124
125 public bool IsDragon => tag.Contains("dragon");
126
127 public bool IsPlant => tag.Contains("plant");
128 }
129
130 public static readonly IReadOnlyDictionary<string, int> RowMapping = new Dictionary<string, int>
131 {
132 ["id"] = 0,
133 ["name_JP"] = 1,
134 ["name"] = 2,
135 ["playable"] = 3,
136 ["tag"] = 4,
137 ["life"] = 5,
138 ["mana"] = 6,
139 ["vigor"] = 7,
140 ["DV"] = 8,
141 ["PV"] = 9,
142 ["PDR"] = 10,
143 ["EDR"] = 11,
144 ["EP"] = 12,
145 ["STR"] = 13,
146 ["END"] = 14,
147 ["DEX"] = 15,
148 ["PER"] = 16,
149 ["LER"] = 17,
150 ["WIL"] = 18,
151 ["MAG"] = 19,
152 ["CHA"] = 20,
153 ["SPD"] = 21,
154 ["INT"] = 23,
155 ["martial"] = 24,
156 ["pen"] = 25,
157 ["elements"] = 26,
158 ["skill"] = 27,
159 ["figure"] = 28,
160 ["geneCap"] = 29,
161 ["material"] = 30,
162 ["corpse"] = 31,
163 ["loot"] = 32,
164 ["blood"] = 33,
165 ["meleeStyle"] = 34,
166 ["castStyle"] = 35,
167 ["EQ"] = 36,
168 ["sex"] = 37,
169 ["age"] = 38,
170 ["height"] = 39,
171 ["breeder"] = 40,
172 ["food"] = 41,
173 ["fur"] = 42,
174 ["detail_JP"] = 43,
175 ["detail"] = 44
176 };
177
178 public static readonly IReadOnlyDictionary<string, string> TypeMapping = new Dictionary<string, string>
179 {
180 ["id"] = "string",
181 ["name_JP"] = "string",
182 ["name"] = "string",
183 ["playable"] = "int",
184 ["tag"] = "string[]",
185 ["life"] = "int",
186 ["mana"] = "int",
187 ["vigor"] = "int",
188 ["DV"] = "int",
189 ["PV"] = "int",
190 ["PDR"] = "int",
191 ["EDR"] = "int",
192 ["EP"] = "int",
193 ["STR"] = "int",
194 ["END"] = "int",
195 ["DEX"] = "int",
196 ["PER"] = "int",
197 ["LER"] = "int",
198 ["WIL"] = "int",
199 ["MAG"] = "int",
200 ["CHA"] = "int",
201 ["SPD"] = "int",
202 ["INT"] = "int",
203 ["martial"] = "int",
204 ["pen"] = "int",
205 ["elements"] = "elements",
206 ["skill"] = "string",
207 ["figure"] = "string",
208 ["geneCap"] = "int",
209 ["material"] = "string",
210 ["corpse"] = "string[]",
211 ["loot"] = "string[]",
212 ["blood"] = "int",
213 ["meleeStyle"] = "string",
214 ["castStyle"] = "string",
215 ["EQ"] = "string[]",
216 ["sex"] = "int",
217 ["age"] = "int[]",
218 ["height"] = "int",
219 ["breeder"] = "int",
220 ["food"] = "string[]",
221 ["fur"] = "string",
222 ["detail_JP"] = "string",
223 ["detail"] = "string"
224 };
225
226 public override Row CreateRow()
227 {
228 return new Row
229 {
230 id = SourceData.GetString(0),
231 name_JP = SourceData.GetString(1),
232 name = SourceData.GetString(2),
233 playable = SourceData.GetInt(3),
234 tag = SourceData.GetStringArray(4),
235 life = SourceData.GetInt(5),
236 mana = SourceData.GetInt(6),
237 vigor = SourceData.GetInt(7),
238 DV = SourceData.GetInt(8),
239 PV = SourceData.GetInt(9),
240 PDR = SourceData.GetInt(10),
241 EDR = SourceData.GetInt(11),
242 EP = SourceData.GetInt(12),
243 STR = SourceData.GetInt(13),
244 END = SourceData.GetInt(14),
245 DEX = SourceData.GetInt(15),
246 PER = SourceData.GetInt(16),
247 LER = SourceData.GetInt(17),
248 WIL = SourceData.GetInt(18),
249 MAG = SourceData.GetInt(19),
250 CHA = SourceData.GetInt(20),
251 SPD = SourceData.GetInt(21),
252 INT = SourceData.GetInt(23),
253 martial = SourceData.GetInt(24),
254 pen = SourceData.GetInt(25),
255 elements = Core.ParseElements(SourceData.GetStr(26)),
256 skill = SourceData.GetString(27),
258 geneCap = SourceData.GetInt(29),
260 corpse = SourceData.GetStringArray(31),
261 loot = SourceData.GetStringArray(32),
262 blood = SourceData.GetInt(33),
263 meleeStyle = SourceData.GetString(34),
264 castStyle = SourceData.GetString(35),
265 EQ = SourceData.GetStringArray(36),
266 sex = SourceData.GetInt(37),
267 age = SourceData.GetIntArray(38),
268 height = SourceData.GetInt(39),
269 breeder = SourceData.GetInt(40),
272 detail_JP = SourceData.GetString(43),
273 detail = SourceData.GetString(44)
274 };
275 }
276
277 public override Row CreateRowByMapping(IReadOnlyDictionary<string, int> mapping)
278 {
279 return new Row
280 {
281 id = SourceData.GetString(mapping["id"]),
282 name_JP = SourceData.GetString(mapping["name_JP"]),
283 name = SourceData.GetString(mapping["name"]),
284 playable = SourceData.GetInt(mapping["playable"]),
285 tag = SourceData.GetStringArray(mapping["tag"]),
286 life = SourceData.GetInt(mapping["life"]),
287 mana = SourceData.GetInt(mapping["mana"]),
288 vigor = SourceData.GetInt(mapping["vigor"]),
289 DV = SourceData.GetInt(mapping["DV"]),
290 PV = SourceData.GetInt(mapping["PV"]),
291 PDR = SourceData.GetInt(mapping["PDR"]),
292 EDR = SourceData.GetInt(mapping["EDR"]),
293 EP = SourceData.GetInt(mapping["EP"]),
294 STR = SourceData.GetInt(mapping["STR"]),
295 END = SourceData.GetInt(mapping["END"]),
296 DEX = SourceData.GetInt(mapping["DEX"]),
297 PER = SourceData.GetInt(mapping["PER"]),
298 LER = SourceData.GetInt(mapping["LER"]),
299 WIL = SourceData.GetInt(mapping["WIL"]),
300 MAG = SourceData.GetInt(mapping["MAG"]),
301 CHA = SourceData.GetInt(mapping["CHA"]),
302 SPD = SourceData.GetInt(mapping["SPD"]),
303 INT = SourceData.GetInt(mapping["INT"]),
304 martial = SourceData.GetInt(mapping["martial"]),
305 pen = SourceData.GetInt(mapping["pen"]),
306 elements = Core.ParseElements(SourceData.GetStr(mapping["elements"])),
307 skill = SourceData.GetString(mapping["skill"]),
308 figure = SourceData.GetString(mapping["figure"]),
309 geneCap = SourceData.GetInt(mapping["geneCap"]),
310 material = SourceData.GetString(mapping["material"]),
311 corpse = SourceData.GetStringArray(mapping["corpse"]),
312 loot = SourceData.GetStringArray(mapping["loot"]),
313 blood = SourceData.GetInt(mapping["blood"]),
314 meleeStyle = SourceData.GetString(mapping["meleeStyle"]),
315 castStyle = SourceData.GetString(mapping["castStyle"]),
316 EQ = SourceData.GetStringArray(mapping["EQ"]),
317 sex = SourceData.GetInt(mapping["sex"]),
318 age = SourceData.GetIntArray(mapping["age"]),
319 height = SourceData.GetInt(mapping["height"]),
320 breeder = SourceData.GetInt(mapping["breeder"]),
321 food = SourceData.GetStringArray(mapping["food"]),
322 fur = SourceData.GetString(mapping["fur"]),
323 detail_JP = SourceData.GetString(mapping["detail_JP"]),
324 detail = SourceData.GetString(mapping["detail"])
325 };
326 }
327
328 public override void SetRow(Row r)
329 {
330 map[r.id] = r;
331 }
332
333 public override IReadOnlyDictionary<string, int> GetRowMapping()
334 {
335 return RowMapping;
336 }
337
338 public override IReadOnlyDictionary<string, string> GetTypeMapping()
339 {
340 return TypeMapping;
341 }
342
343 public override void OnInit()
344 {
345 foreach (Row row in rows)
346 {
347 Dictionary<int, int> dictionary = new Dictionary<int, int>();
348 dictionary[70] = row.STR;
349 dictionary[71] = row.END;
350 dictionary[72] = row.DEX;
351 dictionary[73] = row.PER;
352 dictionary[74] = row.LER;
353 dictionary[75] = row.WIL;
354 dictionary[76] = row.MAG;
355 dictionary[77] = row.CHA;
356 dictionary[79] = row.SPD;
357 dictionary[80] = row.INT;
358 dictionary[100] = row.martial;
359 dictionary[60] = row.life;
360 dictionary[61] = row.mana;
361 dictionary[62] = row.vigor;
362 dictionary[65] = row.PV;
363 dictionary[64] = row.DV;
364 dictionary[55] = row.PDR;
365 dictionary[56] = row.EDR;
366 dictionary[57] = row.EP;
367 dictionary[261] = 1;
368 dictionary[225] = 1;
369 dictionary[255] = 1;
370 dictionary[220] = 1;
371 dictionary[250] = 1;
372 dictionary[101] = 1;
373 dictionary[102] = 1;
374 dictionary[103] = 1;
375 dictionary[107] = 1;
376 dictionary[106] = 1;
377 dictionary[110] = 1;
378 dictionary[111] = 1;
379 dictionary[104] = 1;
380 dictionary[109] = 1;
381 dictionary[108] = 1;
382 dictionary[123] = 1;
383 dictionary[122] = 1;
384 dictionary[120] = 1;
385 dictionary[150] = 1;
386 dictionary[301] = 1;
387 dictionary[306] = 1;
388 row.elementMap = Element.GetElementMap(row.elements, dictionary);
389 }
390 }
391}
Definition: Core.cs:14
static int[] ParseElements(string str)
Definition: Core.cs:726
static Dictionary< int, int > GetElementMap(int[] list)
Definition: ELEMENT.cs:538
static string[] GetStringArray(int id)
Definition: SourceData.cs:1011
static string GetString(int id)
Definition: SourceData.cs:1016
static int GetInt(int id)
Definition: SourceData.cs:981
static string GetStr(int id, bool useDefault=false)
Definition: SourceData.cs:1021
static int[] GetIntArray(int id)
Definition: SourceData.cs:1006
string[] corpse
Definition: SourceRace.cs:69
string name_JP
Definition: SourceRace.cs:11
override string GetAlias
Definition: SourceRace.cs:107
string material
Definition: SourceRace.cs:67
string[] loot
Definition: SourceRace.cs:71
string detail_JP
Definition: SourceRace.cs:93
override bool UseAlias
Definition: SourceRace.cs:105
string figure
Definition: SourceRace.cs:63
string meleeStyle
Definition: SourceRace.cs:75
int[] elements
Definition: SourceRace.cs:59
string[] tag
Definition: SourceRace.cs:17
string castStyle
Definition: SourceRace.cs:77
string[] food
Definition: SourceRace.cs:89
Dictionary< int, int > elementMap
Definition: SourceRace.cs:97
string[] EQ
Definition: SourceRace.cs:79
string detail_L
Definition: SourceRace.cs:103
string detail
Definition: SourceRace.cs:95
string skill
Definition: SourceRace.cs:61
static readonly IReadOnlyDictionary< string, string > TypeMapping
Definition: SourceRace.cs:178
override Row CreateRow()
Definition: SourceRace.cs:226
override IReadOnlyDictionary< string, int > GetRowMapping()
Definition: SourceRace.cs:333
override IReadOnlyDictionary< string, string > GetTypeMapping()
Definition: SourceRace.cs:338
override Row CreateRowByMapping(IReadOnlyDictionary< string, int > mapping)
Definition: SourceRace.cs:277
static readonly IReadOnlyDictionary< string, int > RowMapping
Definition: SourceRace.cs:130
override void OnInit()
Definition: SourceRace.cs:343
override void SetRow(Row r)
Definition: SourceRace.cs:328