14 id = SourceData.GetInt(0),
15 alias = SourceData.GetString(1),
16 name_JP = SourceData.GetString(2),
17 name = SourceData.GetString(3),
18 category = SourceData.GetString(4),
19 tag = SourceData.GetStringArray(5),
20 thing = SourceData.GetString(6),
21 goods = SourceData.GetStringArray(7),
22 minerals = SourceData.GetStringArray(8),
23 decal = SourceData.GetInt(9),
24 decay = SourceData.GetInt(10),
25 grass = SourceData.GetInt(11),
26 defFloor = SourceData.GetInt(12),
27 defBlock = SourceData.GetInt(13),
28 edge = SourceData.GetInt(14),
29 ramp = SourceData.GetInt(15),
30 idSound = SourceData.GetString(16),
31 soundFoot = SourceData.GetString(17),
32 hardness = SourceData.GetInt(18),
33 groups = SourceData.GetStringArray(19),
34 tier = SourceData.GetInt(20),
35 chance = SourceData.GetInt(21),
36 weight = SourceData.GetInt(22),
37 value = SourceData.GetInt(23),
38 quality = SourceData.GetInt(24),
39 atk = SourceData.GetInt(25),
40 dmg = SourceData.GetInt(26),
41 dv = SourceData.GetInt(27),
42 pv = SourceData.GetInt(28),
43 dice = SourceData.GetInt(29),
44 bits = SourceData.GetStringArray(30),
45 elements = Core.ParseElements(SourceData.GetStr(31,
false)),
46 altName = SourceData.GetStringArray(32),
47 altName_JP = SourceData.GetStringArray(33)
58 public override void OnInit()
60 Cell.matList = this.rows;
67 row.elementMap =
Element.GetElementMap(row.elements);
68 if (!row.groups.IsEmpty())
70 foreach (
string key
in row.groups)
80 tier.sum += row.chance;
83 string category = row.category;
84 if (!(category ==
"gem"))
86 if (category ==
"ore")
90 tier2.sum += row.chance;
97 tier3.sum += row.chance;
103 public override void OnAfterImportData()
112 CS$<>8__locals1.list =
new List<int>(r.elements);
113 for (
int i = 0; i < r.elements.Length; i += 2)
115 SourceMaterial.<OnImportRow>g__Add|8_0(r.elements[i], r.elements[i + 1], ref CS$<>8__locals1);
117 SourceMaterial.<OnImportRow>g__Add|8_0(13, r.hardness, ref CS$<>8__locals1);
118 r.elements = CS$<>8__locals1.list.ToArray();
123 public override string[] ImportFields
136 internal static void <OnImportRow>g__Add|8_0(
int ele,
int a, ref
SourceMaterial.<>c__DisplayClass8_0 A_2)
147 public class Row : SourceData.BaseRow
151 public override bool UseAlias
161 public override string GetAlias
170 public override void OnImportData(SourceData data)
172 base.OnImportData(data);
179 MatColors matColors = Core.Instance.Colors.matColors.TryGetValue(this.alias,
null);
180 this.matColor = matColors.main;
181 this.altColor = matColors.alt;
186 public void SetTiles()
191 public void AddBlood(
Point p,
int a = 1)
197 if (p.cell.IsSnowTile &&
this !=
MATERIAL.sourceSnow)
202 for (
int i = 0; i < a; i++)
204 EClass._map.AddDecal(p.x + ((
EClass.rnd(2) == 0) ? 0 : (
EClass.rnd(3) - 1)), p.z + ((
EClass.rnd(2) == 0) ? 0 : (
EClass.rnd(3) - 1)),
this.decal, 1,
true);
209 public void PlayHitEffect(
Point p)
211 Effect.Get(
"mine2").Play(p, 0f,
null,
null).SetParticleColor(this.GetColor()).Emit(2 +
EClass.rnd(4));
215 public Color GetColor()
217 return Core.Instance.Colors.matColors[this.alias].main;
221 public string TryGetSound(
string suffx,
RenderRow c =
null)
223 string soundImpact = this.GetSoundImpact(c);
224 if (
EClass.Sound.Exist(soundImpact +
"_" + suffx))
226 return soundImpact +
"_" + suffx;
232 public string GetSoundDead(
RenderRow c =
null)
234 return this.TryGetSound(
"dead", c);
238 public string GetSoundDrop(
RenderRow c =
null)
240 return this.TryGetSound(
"drop", c);
244 public string GetSoundCraft(
RenderRow c =
null)
246 if (this.category ==
"wood")
248 return "build_progress";
250 return this.TryGetSound(
"craft", c);
254 public string GetSoundImpact(
RenderRow c =
null)
256 if (c !=
null && !c.idSound.IsEmpty())
258 return "Material/" + c.idSound;
260 return "Material/" + this.idSound;
264 public void CreateByProduct(
Thing container,
int num)
267 CS$<>8__locals1.<>4__this =
this;
268 CS$<>8__locals1.num = num;
269 CS$<>8__locals1.container = container;
271 thing.ModNum(CS$<>8__locals1.num,
true);
272 CS$<>8__locals1.container.AddThing(thing,
true, -1, -1);
273 this.<CreateByProduct>g__C|52_0(
"dye", ref CS$<>8__locals1);
274 string text = this.category;
275 uint num2 = <PrivateImplementationDetails>.ComputeStringHash(text);
276 if (num2 <= 1167392201U)
278 if (num2 <= 270655681U)
280 if (num2 != 174734082U)
282 if (num2 == 270655681U)
286 this.<CreateByProduct>g__C|52_0(
"thread", ref CS$<>8__locals1);
287 this.<CreateByProduct>g__C|52_0(
"texture", ref CS$<>8__locals1);
288 this.<CreateByProduct>g__C|52_0(
"string", ref CS$<>8__locals1);
292 else if (text ==
"soil")
294 this.<CreateByProduct>g__C|52_0(
"glass", ref CS$<>8__locals1);
295 this.<CreateByProduct>g__C|52_0(
"clay", ref CS$<>8__locals1);
296 this.<CreateByProduct>g__C|52_0(
"brick", ref CS$<>8__locals1);
299 else if (num2 != 862676408U)
301 if (num2 != 974867124U)
303 if (num2 == 1167392201U)
305 if (text ==
"crystal")
307 this.<CreateByProduct>g__C|52_0(
"glass", ref CS$<>8__locals1);
308 this.<CreateByProduct>g__C|52_0(
"gem", ref CS$<>8__locals1);
312 else if (text ==
"rock")
314 this.<CreateByProduct>g__C|52_0(
"rock", ref CS$<>8__locals1);
315 this.<CreateByProduct>g__C|52_0(
"pebble", ref CS$<>8__locals1);
316 this.<CreateByProduct>g__C|52_0(
"cutstone", ref CS$<>8__locals1);
319 else if (text ==
"skin")
321 this.<CreateByProduct>g__C|52_0(
"texture", ref CS$<>8__locals1);
324 else if (num2 <= 1527558748U)
326 if (num2 != 1237752336U)
328 if (num2 == 1527558748U)
332 this.<CreateByProduct>g__C|52_0(
"cutstone", ref CS$<>8__locals1);
333 this.<CreateByProduct>g__C|52_0(
"ingot", ref CS$<>8__locals1);
334 this.<CreateByProduct>g__C|52_0(
"gem", ref CS$<>8__locals1);
338 else if (!(text ==
"water"))
342 else if (num2 != 2226448744U)
344 if (num2 != 2585652531U)
346 if (num2 == 3683705231U)
350 this.<CreateByProduct>g__C|52_0(
"glass", ref CS$<>8__locals1);
351 this.<CreateByProduct>g__C|52_0(
"stick", ref CS$<>8__locals1);
355 else if (text ==
"ore")
357 this.<CreateByProduct>g__C|52_0(
"cutstone", ref CS$<>8__locals1);
358 this.<CreateByProduct>g__C|52_0(
"ingot", ref CS$<>8__locals1);
361 else if (text ==
"wood")
363 this.<CreateByProduct>g__C|52_0(
"plank", ref CS$<>8__locals1);
364 this.<CreateByProduct>g__C|52_0(
"stick", ref CS$<>8__locals1);
365 this.<CreateByProduct>g__C|52_0(
"bark", ref CS$<>8__locals1);
367 foreach (
string text2
in this.goods)
369 this.<CreateByProduct>g__C|52_0(text2, ref CS$<>8__locals1);
395 private void <CreateByProduct>g__C|52_0(
string _id, ref
SourceMaterial.
Row.<>c__DisplayClass52_0 A_2)
398 thing.ChangeMaterial(this.
id);
399 thing.ModNum(A_2.num,
true);
400 A_2.container.AddThing(thing,
true, -1, -1);
410 public string name_JP;
416 public string category;
425 public string[] goods;
428 public string[] minerals;
452 public string idSound;
455 public string soundFoot;
461 public string[] groups;
494 public string[] bits;
497 public int[] elements;
500 public string[] altName;
503 public string[] altName_JP;
507 public Color matColor;
511 public Color altColor;
514 public Dictionary<int, int> elementMap;
517 public static string[] IDPick =
new string[]
527 public static string[] IDAxe =
new string[]
533 public string name_L;
536 public string detail_L;
539 public string[] altName_L;
549 for (
int i = 0; i < 5; i++)
566 int num2 =
EClass.rnd(this.sum);