Elin Modding Docs Doc
All Classes Namespaces
Thing.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.CompilerServices;
5using UnityEngine;
6using UnityEngine.UI;
7
8// Token: 0x020004E7 RID: 1255
9public class Thing : Card
10{
11 // Token: 0x17000ADC RID: 2780
12 // (get) Token: 0x06002136 RID: 8502 RVA: 0x000B4025 File Offset: 0x000B2225
13 public bool isEquipped
14 {
15 get
16 {
17 return base.c_equippedSlot != 0;
18 }
19 }
20
21 // Token: 0x17000ADD RID: 2781
22 // (get) Token: 0x06002137 RID: 8503 RVA: 0x000B4030 File Offset: 0x000B2230
23 public bool IsMeleeWithAmmo
24 {
25 get
26 {
27 return this.trait is TraitToolRange && this.isEquipped;
28 }
29 }
30
31 // Token: 0x17000ADE RID: 2782
32 // (get) Token: 0x06002138 RID: 8504 RVA: 0x000B4047 File Offset: 0x000B2247
33 public int range
34 {
35 get
36 {
37 return this.source.range;
38 }
39 }
40
41 // Token: 0x17000ADF RID: 2783
42 // (get) Token: 0x06002139 RID: 8505 RVA: 0x000B4054 File Offset: 0x000B2254
43 public int Penetration
44 {
45 get
46 {
47 if (this.source.substats.Length == 0)
48 {
49 return 0;
50 }
51 return this.source.substats[0];
52 }
53 }
54
55 // Token: 0x17000AE0 RID: 2784
56 // (get) Token: 0x0600213A RID: 8506 RVA: 0x000B4073 File Offset: 0x000B2273
57 public override bool isThing
58 {
59 get
60 {
61 return true;
62 }
63 }
64
65 // Token: 0x17000AE1 RID: 2785
66 // (get) Token: 0x0600213B RID: 8507 RVA: 0x000B4076 File Offset: 0x000B2276
67 public override CardRow sourceCard
68 {
69 get
70 {
71 return this.source;
72 }
73 }
74
75 // Token: 0x17000AE2 RID: 2786
76 // (get) Token: 0x0600213C RID: 8508 RVA: 0x000B407E File Offset: 0x000B227E
77 public override SourcePref Pref
78 {
79 get
80 {
81 if (this.source.origin == null || this.source.pref.UsePref)
82 {
83 return this.source.pref;
84 }
85 return this.source.origin.pref;
86 }
87 }
88
89 // Token: 0x17000AE3 RID: 2787
90 // (get) Token: 0x0600213D RID: 8509 RVA: 0x000B40BC File Offset: 0x000B22BC
91 public override int SelfWeight
92 {
93 get
94 {
95 if (!base.IsUnique)
96 {
97 return (base.isWeightChanged ? base.c_weight : this.source.weight) * base.material.weight / 100;
98 }
99 if (!base.isWeightChanged)
100 {
101 return this.source.weight;
102 }
103 return base.c_weight;
104 }
105 }
106
107 // Token: 0x17000AE4 RID: 2788
108 // (get) Token: 0x0600213E RID: 8510 RVA: 0x000B4116 File Offset: 0x000B2316
109 public override int[] Tiles
110 {
111 get
112 {
113 return this.sourceCard._tiles;
114 }
115 }
116
117 // Token: 0x0600213F RID: 8511 RVA: 0x000B4124 File Offset: 0x000B2324
118 public bool CanAutoFire(Chara c, Card tg, bool reloading = false)
119 {
120 if (base.GetRootCard() != c)
121 {
122 return false;
123 }
124 if (base.HasTag(CTAG.throwWeapon))
125 {
126 return true;
127 }
128 if (!this.trait.CanAutofire)
129 {
130 return false;
131 }
132 if (this.trait is TraitToolRange)
133 {
134 if ((c.IsPCFaction && c.body.IsTooHeavyToEquip(this)) || reloading)
135 {
136 return false;
137 }
138 }
139 else if (this.trait is TraitAbility && c.IsPC)
140 {
141 Act act = (this.trait as TraitAbility).act;
142 Element element = c.elements.GetElement(act.id);
143 if (act is Spell && (element == null || element.vPotential == 0))
144 {
145 return false;
146 }
147 }
148 return true;
149 }
150
151 // Token: 0x06002140 RID: 8512 RVA: 0x000B41CF File Offset: 0x000B23CF
152 public int GetEfficiency()
153 {
154 return (int)(50 + base.LV * 10 + base.encLV * 10 + base.rarity * (Rarity)10 + (int)(base.blessedState * (BlessedState)10));
155 }
156
157 // Token: 0x06002141 RID: 8513 RVA: 0x000B41FC File Offset: 0x000B23FC
158 public override void SetSource()
159 {
160 this.source = EClass.sources.things.map.TryGetValue(this.id, null);
161 if (this.source != null && this.source.isOrigin)
162 {
163 this.source = (EClass.sources.cards.firstVariations[this.id] as SourceThing.Row);
164 this.id = this.source.id;
165 }
166 if (this.source == null)
167 {
168 Debug.LogWarning("Thing " + this.id + " not found");
169 this.id = "1101";
170 this.source = EClass.sources.things.map[this.id];
171 }
172 }
173
174 // Token: 0x06002142 RID: 8514 RVA: 0x000B42C4 File Offset: 0x000B24C4
175 public override void OnCreate(int genLv)
176 {
177 if (this.bp.blesstedState != null)
178 {
179 this.SetBlessedState(this.bp.blesstedState.GetValueOrDefault());
180 }
181 else if (base.category.ignoreBless == 0 && this.bp.rarity == Rarity.Random && base.rarity != Rarity.Artifact)
182 {
183 if (EClass.rnd(25) == 0)
184 {
185 this.SetBlessedState(BlessedState.Blessed);
186 }
187 else if (EClass.rnd(25) == 0)
188 {
189 this.SetBlessedState(BlessedState.Cursed);
190 }
191 else if (EClass.rnd(50) == 0 && base.category.slot != 0)
192 {
193 this.SetBlessedState(BlessedState.Doomed);
194 }
195 }
196 if (!EClass.debug.autoIdentify && (!this.source.unknown_JP.IsEmpty() || (base.category.slot != 0 && base.rarity >= Rarity.Superior)))
197 {
198 base.c_IDTState = 5;
199 }
200 string id = this.id;
201 if (id == "bill_tax" || id == "bill")
202 {
203 base.c_bill = 100 + EClass.rnd(100);
204 }
205 if (base.category.slot != 0)
206 {
207 int num = 0;
208 if (base.rarity == Rarity.Superior)
209 {
210 num = EClass.rnd(3);
211 }
212 else if (base.rarity == Rarity.Legendary)
213 {
214 num = EClass.rnd(4) + 2;
215 }
216 else if (base.rarity == Rarity.Mythical)
217 {
218 num = EClass.rnd(3) + 5;
219 }
220 else if (base.rarity >= Rarity.Artifact)
221 {
222 num = EClass.rnd(2) + 1;
223 }
224 if (num > 0 && !base.HasTag(CTAG.godArtifact))
225 {
226 for (int i = 0; i < num; i++)
227 {
228 this.AddEnchant(genLv);
229 }
230 }
231 }
232 if (base.IsRangedWeapon && !this.IsMeleeWithAmmo)
233 {
234 if (base.HasTag(CTAG.godArtifact))
235 {
236 base.AddSocket();
237 base.AddSocket();
238 }
239 else
240 {
241 int num2 = 1;
242 int num3 = (EClass.rnd(10) == 0) ? 1 : 0;
243 if (base.rarity == Rarity.Superior)
244 {
245 num2 = 2 + num3;
246 }
247 else if (base.rarity == Rarity.Legendary)
248 {
249 num2 = EClass.rnd(2) + 3 + num3;
250 }
251 else if (base.rarity == Rarity.Mythical)
252 {
253 num2 = EClass.rnd(2) + 4 + num3;
254 }
255 else if (base.rarity >= Rarity.Artifact)
256 {
257 num2 = EClass.rnd(2) + 1;
258 }
259 if (num2 > 0)
260 {
261 for (int j = 0; j < num2; j++)
262 {
263 base.AddSocket();
264 }
265 for (int k = 0; k < EClass.rnd(num2 + 1); k++)
266 {
267 Tuple<SourceElement.Row, int> enchant = Thing.GetEnchant(genLv, (SourceElement.Row r) => r.tag.Contains("modRanged"), false);
268 if (enchant != null && InvOwnerMod.IsValidMod(this, enchant.Item1))
269 {
270 base.ApplySocket(enchant.Item1.id, enchant.Item2, null);
271 }
272 }
273 }
274 }
275 }
276 if ((this.bp.rarity != Rarity.Normal || this.bp.qualityBonus != 0) && base.rarity < Rarity.Artifact && base.category.tag.Contains("enc"))
277 {
278 int num4 = 0;
279 if (EClass.rnd(6) == 0)
280 {
281 if (this.bp.qualityBonus == 0)
282 {
283 num4 = EClass.rnd(EClass.rnd(11) + 1);
284 if (num4 == 1 && EClass.rnd(3) != 0)
285 {
286 num4 = 0;
287 }
288 }
289 else if (this.bp.qualityBonus < 0)
290 {
291 if (EClass.rnd(3) == 0)
292 {
293 num4 = 1;
294 }
295 }
296 else if (this.bp.qualityBonus >= 10)
297 {
298 num4 = Mathf.Min(this.bp.qualityBonus / 10 + 2, 7) + EClass.rnd(EClass.rnd(5) + 1);
299 }
300 }
301 if (num4 > 0)
302 {
303 base.SetEncLv(Mathf.Min(num4, 12));
304 }
305 }
306 if (base.HasTag(CTAG.randomSkin))
307 {
308 base.idSkin = EClass.rnd(this.source.skins.Length + 1);
309 }
310 }
311
312 // Token: 0x06002143 RID: 8515 RVA: 0x000B4670 File Offset: 0x000B2870
313 public override void ApplyMaterialElements(bool remove)
314 {
315 Chara chara = null;
316 if (EClass.core.IsGameStarted && this.isEquipped)
317 {
318 Card rootCard = base.GetRootCard();
319 chara = ((rootCard != null) ? rootCard.Chara : null);
320 if (chara != null)
321 {
322 this.elements.SetParent(null);
323 }
324 }
325 this.elements.ApplyMaterialElementMap(this, remove);
326 if (chara != null)
327 {
328 this.elements.SetParent(chara);
329 }
330 }
331
332 // Token: 0x06002144 RID: 8516 RVA: 0x000B46D4 File Offset: 0x000B28D4
333 public override void ApplyMaterial(bool remove = false)
334 {
335 Thing.<>c__DisplayClass27_0 CS$<>8__locals1;
336 CS$<>8__locals1.<>4__this = this;
337 if (this.source.HasTag(CTAG.replica))
338 {
339 base.isReplica = true;
340 }
341 if (remove)
342 {
343 this.ApplyMaterialElements(true);
344 base.isAcidproof = (base.isFireproof = false);
345 return;
346 }
347 CS$<>8__locals1.pvSet = false;
348 CS$<>8__locals1.dmgSet = false;
349 CS$<>8__locals1.hitSet = false;
350 if (this.sourceCard.quality == 4)
351 {
352 if (this.source.offense.Length != 0)
353 {
354 base.c_diceDim = this.source.offense[1];
355 }
356 if (this.source.offense.Length > 2)
357 {
358 this.<ApplyMaterial>g__SetBase|27_0(66, this.source.offense[2], ref CS$<>8__locals1);
359 }
360 if (this.source.offense.Length > 3)
361 {
362 this.<ApplyMaterial>g__SetBase|27_0(67, this.source.offense[3], ref CS$<>8__locals1);
363 }
364 if (this.source.defense.Length != 0)
365 {
366 this.<ApplyMaterial>g__SetBase|27_0(64, this.source.defense[0], ref CS$<>8__locals1);
367 }
368 if (this.source.defense.Length > 1)
369 {
370 this.<ApplyMaterial>g__SetBase|27_0(65, this.source.defense[1], ref CS$<>8__locals1);
371 }
372 }
373 else
374 {
375 int num = 120;
376 bool flag = !base.IsAmmo;
377 if (base.rarity <= Rarity.Crude)
378 {
379 num = 150;
380 }
381 else if (base.rarity == Rarity.Superior)
382 {
383 num = 100;
384 }
385 else if (base.rarity >= Rarity.Legendary)
386 {
387 num = 80;
388 }
389 if (this.source.offense.Length != 0)
390 {
391 base.c_diceDim = this.source.offense[1] * base.material.dice / (num + (flag ? EClass.rnd(25) : 0));
392 }
393 if (this.source.offense.Length > 2)
394 {
395 this.<ApplyMaterial>g__SetBase|27_0(66, this.source.offense[2] * base.material.atk * 9 / (num - (flag ? EClass.rnd(30) : 0)), ref CS$<>8__locals1);
396 }
397 if (this.source.offense.Length > 3)
398 {
399 this.<ApplyMaterial>g__SetBase|27_0(67, this.source.offense[3] * base.material.dmg * 5 / (num - (flag ? EClass.rnd(30) : 0)), ref CS$<>8__locals1);
400 }
401 if (this.source.defense.Length != 0)
402 {
403 this.<ApplyMaterial>g__SetBase|27_0(64, this.source.defense[0] * base.material.dv * 7 / (num - (flag ? EClass.rnd(30) : 0)), ref CS$<>8__locals1);
404 }
405 if (this.source.defense.Length > 1)
406 {
407 this.<ApplyMaterial>g__SetBase|27_0(65, this.source.defense[1] * base.material.pv * 9 / (num - (flag ? EClass.rnd(30) : 0)), ref CS$<>8__locals1);
408 }
409 }
410 if (base.isReplica)
411 {
412 if (this.source.offense.Length != 0)
413 {
414 base.c_diceDim = Mathf.Max(this.source.offense[1] / 3, 1);
415 }
416 if (this.source.offense.Length > 2)
417 {
418 this.<ApplyMaterial>g__SetBase|27_0(66, this.source.offense[2] / 3, ref CS$<>8__locals1);
419 }
420 if (this.source.offense.Length > 3)
421 {
422 this.<ApplyMaterial>g__SetBase|27_0(67, this.source.offense[3] / 3, ref CS$<>8__locals1);
423 }
424 if (this.source.defense.Length != 0)
425 {
426 this.<ApplyMaterial>g__SetBase|27_0(64, this.source.defense[0] / 3, ref CS$<>8__locals1);
427 }
428 if (this.source.defense.Length > 1)
429 {
430 this.<ApplyMaterial>g__SetBase|27_0(65, this.source.defense[1] / 3, ref CS$<>8__locals1);
431 }
432 }
433 if (base.IsEquipmentOrRanged || base.IsAmmo)
434 {
435 if (base.IsWeapon || base.IsAmmo)
436 {
437 if (CS$<>8__locals1.dmgSet)
438 {
439 this.elements.ModBase(67, base.encLV + ((base.blessedState == BlessedState.Blessed) ? 1 : 0));
440 }
441 }
442 else if (CS$<>8__locals1.pvSet)
443 {
444 this.elements.ModBase(65, (base.encLV + ((base.blessedState == BlessedState.Blessed) ? 1 : 0)) * 2);
445 }
446 }
447 if (this.sockets != null)
448 {
449 for (int i = 0; i < this.sockets.Count; i++)
450 {
451 int num2 = this.sockets[i];
452 int num3 = num2 / 100;
453 if (num3 == 67 & CS$<>8__locals1.dmgSet)
454 {
455 this.elements.ModBase(67, num2 % 100);
456 }
457 if (num3 == 66 & CS$<>8__locals1.hitSet)
458 {
459 this.elements.ModBase(66, num2 % 100);
460 }
461 if (num3 == 65 & CS$<>8__locals1.pvSet)
462 {
463 this.elements.ModBase(65, num2 % 100);
464 }
465 }
466 }
467 if (base.material == null || base.material.elements == null)
468 {
469 string[] array = new string[5];
470 array[0] = base.idMaterial.ToString();
471 array[1] = "/";
472 int num4 = 2;
473 SourceMaterial.Row material = base.material;
474 array[num4] = ((material != null) ? material.name : null);
475 array[3] = "/";
476 int num5 = 4;
477 SourceMaterial.Row material2 = base.material;
478 int[] array2 = (material2 != null) ? material2.elements : null;
479 array[num5] = ((array2 != null) ? array2.ToString() : null);
480 Debug.Log(string.Concat(array));
481 }
482 this.ApplyMaterialElements(false);
483 foreach (string a in base.material.bits)
484 {
485 if (!(a == "fire"))
486 {
487 if (a == "acid")
488 {
489 base.isAcidproof = true;
490 }
491 }
492 else
493 {
494 base.isFireproof = true;
495 }
496 }
497 if (base.rarity >= Rarity.Artifact)
498 {
499 base.isAcidproof = (base.isFireproof = true);
500 }
501 this._colorInt = 0;
502 }
503
504 // Token: 0x06002145 RID: 8517 RVA: 0x000B4C74 File Offset: 0x000B2E74
505 public override string GetName(NameStyle style, int _num = -1)
506 {
507 int num = (_num == -1) ? base.Num : _num;
508 string text = "";
509 string text2 = "";
510 string text3 = "";
511 string str = "";
512 string sig = "";
513 string text4 = "";
514 string text5 = this.source.GetText("unit", false);
515 ArticleStyle style2 = (style == NameStyle.FullNoArticle) ? ArticleStyle.None : ArticleStyle.Default;
516 bool flag = base.IsIdentified || this.source.unknown.IsEmpty();
517 bool isEquipmentOrRanged = base.IsEquipmentOrRanged;
518 bool flag2 = Lang.setting.nameStyle == 0;
519 if (flag)
520 {
521 if (base.c_idRefCard.IsEmpty() && !base.c_altName.IsEmpty())
522 {
523 text = base.c_altName;
524 }
525 else
526 {
527 string[] array = this.trait.GetName().Split(',', StringSplitOptions.None);
528 text = array[0];
529 if (array.Length > 1)
530 {
531 text5 = array[1];
532 }
533 }
534 if (text.IsEmpty())
535 {
536 text = this.id;
537 }
538 if (isEquipmentOrRanged && base.IsIdentified && base.rarity >= Rarity.Legendary)
539 {
540 if (base.rarity != Rarity.Artifact && !base.material.GetTextArray("altName").IsEmpty())
541 {
542 text = base.material.GetTextArray("altName")[0] + Lang.space + text;
543 }
544 }
545 else
546 {
547 if (this.source.naming == "m" || (this.source.naming == "ms" && base.material != this.source.DefaultMaterial))
548 {
549 if (isEquipmentOrRanged)
550 {
551 string[] textArray = base.material.GetTextArray("altName");
552 if (textArray != null && textArray.Length >= 2)
553 {
554 text = base.material.GetTextArray("altName")[1] + Lang.space + text;
555 goto IL_1F2;
556 }
557 }
558 text = "_of2".lang(base.material.GetName(), text, null, null, null);
559 }
560 IL_1F2:
561 if (this.source.naming == "ma")
562 {
563 text = base.material.GetName();
564 }
565 if (base.qualityTier > 0)
566 {
567 text = Lang.GetList("quality_general")[Mathf.Clamp(base.qualityTier, 0, 3)] + text;
568 }
569 }
570 }
571 else
572 {
573 text = "unknown";
574 string idUnknown = this.source.GetText("unknown", false);
575 if (idUnknown.StartsWith("#"))
576 {
577 Rand.UseSeed(EClass.game.seed + (this.trait.CanStack ? this.sourceCard._index : base.uid) + base.refVal, delegate
578 {
579 idUnknown = Lang.GetList(idUnknown.Remove(0, 1)).RandomItem<string>();
580 });
581 }
582 text = idUnknown;
583 }
584 if (!base.c_idRefCard.IsEmpty() && this.trait.RefCardName != RefCardName.None)
585 {
586 string text6 = base.c_altName.IsEmpty(EClass.sources.cards.map[base.c_idRefCard].GetName());
587 if (!base.c_idRefCard2.IsEmpty())
588 {
589 text6 = "_and".lang(text6, base.c_altName2.IsEmpty(EClass.sources.cards.map[base.c_idRefCard2].GetName()), null, null, null);
590 }
591 if (text6 == "*r")
592 {
593 string text7 = EClass.sources.cards.map[base.c_idRefCard].GetText("aka", false);
594 if (!text7.IsEmpty())
595 {
596 text = "_of".lang(text7, text, null, null, null);
597 }
598 }
599 else if (!this.source.name2.IsEmpty())
600 {
601 text = this.source.GetTextArray("name2")[0].Replace("#1", text6);
602 }
603 else if (this.source.naming.Contains("last"))
604 {
605 text = text + Lang.space + text6;
606 }
607 else if (this.source.naming.Contains("first"))
608 {
609 text = text6 + Lang.space + text;
610 }
611 else if (this.source.naming.Contains("of"))
612 {
613 text = "_of".lang(text6, text, null, null, null);
614 }
615 else
616 {
617 text = (text5.IsEmpty() ? "_of3" : "_of2").lang(text6, text, null, null, null);
618 }
619 }
620 if (base.c_bill != 0)
621 {
622 text = "_of".lang(Lang._currency(base.c_bill, true, 0), text, null, null, null);
623 }
624 this.trait.SetName(ref text);
625 if (style == NameStyle.Simple)
626 {
627 return text;
628 }
629 if (style == NameStyle.Ref)
630 {
631 return text;
632 }
633 if (!base.c_refText.IsEmpty())
634 {
635 text = "_named".lang(base.c_refText, text, null, null, null);
636 }
637 if (base.IsIdentified)
638 {
639 int hit = base.HIT;
640 int dmg = base.DMG;
641 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hit != 0 || dmg != 0) && this.source.offense.Length != 0)
642 {
643 string text8 = "";
644 if (this.source.offense[0] != 0)
645 {
646 text8 = text8 + this.source.offense[0].ToString() + "d" + base.c_diceDim.ToString();
647 }
648 if (dmg != 0)
649 {
650 text8 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dmg.ToText(true) : (dmg.ToString() ?? ""));
651 }
652 if (hit != 0)
653 {
654 text8 = text8 + ((dmg != 0 || this.source.offense[0] != 0) ? ", " : "") + hit.ToString();
655 }
656 text2 = text2 + " (" + text8.IsEmpty(" - ") + ") ";
657 }
658 int dv = this.DV;
659 int pv = this.PV;
660 if (dv != 0 || pv != 0)
661 {
662 text2 += " [";
663 text2 = text2 + dv.ToString() + ", " + pv.ToString();
664 text2 += "] ";
665 }
666 if (this.trait.HasCharges && this.trait.ShowCharges)
667 {
668 text2 = text2 + " " + "itemCharges".lang(base.c_charges.ToString() ?? "", null, null, null, null);
669 }
670 }
671 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
672 {
673 text2 = "(" + base.TextRarity.ToTitleCase(false) + ")";
674 }
675 if (base.IsDecayed)
676 {
677 text = "rotten".lang() + text;
678 }
679 else if (base.IsRotting)
680 {
681 text = "rotting".lang() + text;
682 }
683 if (base.IsIdentified)
684 {
685 if (base.blessedState != BlessedState.Normal)
686 {
687 str = ("bs" + base.blessedState.ToString()).lang();
688 }
689 Rarity rarity = base.rarity;
690 if (rarity - Rarity.Legendary > 1)
691 {
692 if (rarity == Rarity.Artifact)
693 {
694 style2 = ArticleStyle.None;
695 text3 = "★";
696 text = (isEquipmentOrRanged ? text.Bracket(3) : text);
697 }
698 }
699 else
700 {
701 style2 = ArticleStyle.The;
702 text3 = "☆";
703 if (isEquipmentOrRanged)
704 {
705 Rand.UseSeed(base.uid + EClass.game.seed, delegate
706 {
707 sig = AliasGen.GetRandomAlias().Bracket((this.rarity == Rarity.Mythical) ? 3 : 2);
708 });
709 sig = Lang.space + sig;
710 }
711 }
712 }
713 if (base.encLV != 0)
714 {
715 if (base.category.tag.Contains("enc"))
716 {
717 if (base.c_altName.IsEmpty())
718 {
719 string[] list = Lang.GetList("quality_furniture");
720 text = "_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text, null, null, null);
721 }
722 }
723 else
724 {
725 sig = sig + Lang.space + ((base.encLV > 0) ? ("+" + base.encLV.ToString()) : (base.encLV.ToString() ?? ""));
726 }
727 }
728 if (base.c_lockLv != 0 && base.c_revealLock)
729 {
730 sig = sig + Lang.space + "+" + base.c_lockLv.ToString();
731 }
732 if (base.isLostProperty)
733 {
734 text = "_lostproperty".lang(text, null, null, null, null);
735 }
736 if (this.trait is TraitEquipItem && EClass.player.eqBait == this && EClass.player.eqBait.GetRootCard() == EClass.pc)
737 {
738 text4 += "equippedItem".lang();
739 }
740 if (!base.c_note.IsEmpty() && (!base.isBackerContent || EClass.core.config.backer.Show(base.c_note)))
741 {
742 string text9 = base.c_note;
743 if (text9.StartsWith('@'))
744 {
745 LangNote.Row row = Lang.Note.map.TryGetValue(text9.TrimStart('@'), null);
746 text9 = (((row != null) ? row.GetText("text", false) : null) ?? base.c_note);
747 }
748 string text10 = base.category.IsChildOf("book") ? "_written" : "_engraved";
749 if (this.id == "grave_dagger1" || this.id == "grave_dagger2")
750 {
751 text10 = "_daggerGrave";
752 }
753 if (text9.Contains("_bracketLeft".lang()))
754 {
755 text = (text10 + "Alt").lang(text9, text, null, null, null);
756 }
757 else
758 {
759 text = text10.lang(text9, text, null, null, null);
760 }
761 }
762 if (flag2)
763 {
764 if (num > 1)
765 {
766 text = "_unit".lang(num.ToFormat() ?? "", str + text, text5, null, null);
767 }
768 else
769 {
770 text = str + text;
771 }
772 }
773 else if (this.trait is TraitAbility)
774 {
775 text = text.ToTitleCase(true);
776 }
777 else if (text5.IsEmpty() || (!base.IsIdentified && !this.source.unknown.IsEmpty()))
778 {
779 text = (str + text).AddArticle(num, style2, this.source.name);
780 }
781 else
782 {
783 text = "_unit".lang((num == 1) ? "" : (num.ToFormat() ?? ""), text, (str + text5).AddArticle(num, style2, this.source.unit), null, null);
784 }
785 if (base.rarity >= Rarity.Legendary)
786 {
787 text = text.ToTitleCase(true);
788 }
789 string text11 = (base.isSale && this.things.Count > 0) ? "forSale2".lang() : ((base.isSale || (base.parentThing != null && base.parentThing.isSale && TraitSalesTag.CanTagSale(this, true))) ? "forSale".lang(Lang._currency(this.GetPrice(CurrencyType.Money, true, PriceType.PlayerShop, null), "money"), null, null, null, null) : "");
790 if (this.trait is TraitSalesTag && base.isOn && !base.GetStr(11, null).IsEmpty())
791 {
792 text11 += "soldOut".lang(EClass.sources.categories.map[base.GetStr(11, null)].GetName(), null, null, null, null);
793 }
794 if (base.GetInt(101, null) != 0)
795 {
796 text4 = "_limitedStock".lang(text4, null, null, null, null);
797 }
798 return string.Concat(new string[]
799 {
800 text4,
801 text3,
802 text,
803 sig,
804 text2,
805 text11
806 });
807 }
808
809 // Token: 0x06002146 RID: 8518 RVA: 0x000B589C File Offset: 0x000B3A9C
810 public override string GetHoverText()
811 {
812 string text = "";
813 text = text + " <size=14>(" + Lang._weight(base.ChildrenAndSelfWeight, true, 0) + ")</size> ";
814 if (EClass.debug.showExtra)
815 {
816 text += Environment.NewLine;
817 string[] array = new string[15];
818 array[0] = text;
819 array[1] = "id:";
820 array[2] = this.id;
821 array[3] = " tile:";
822 array[4] = this.source.idRenderData;
823 array[5] = "/";
824 int num = 6;
825 object obj = (this.source.tiles.Length != 0) ? this.source.tiles[0] : "-";
826 array[num] = ((obj != null) ? obj.ToString() : null);
827 array[7] = " num:";
828 array[8] = base.Num.ToString();
829 array[9] = " lv:";
830 array[10] = base.LV.ToString();
831 array[11] = " enc:";
832 array[12] = base.encLV.ToString();
833 array[13] = " / ";
834 array[14] = base.material.alias;
835 text = string.Concat(array);
836 }
837 string hoverText = this.trait.GetHoverText();
838 if (!hoverText.IsEmpty())
839 {
840 text = text + Environment.NewLine + hoverText;
841 }
842 return base.GetHoverText() + text;
843 }
844
845 // Token: 0x06002147 RID: 8519 RVA: 0x000B59F4 File Offset: 0x000B3BF4
846 public override string GetExtraName()
847 {
848 string text = "";
849 if (this.trait.ShowChildrenNumber && base.c_lockLv == 0)
850 {
851 if (this.things.Count > 0)
852 {
853 text += "childCount".lang(this.things.Count.ToString() ?? "", null, null, null, null);
854 }
855 else if (this.trait.CanOpenContainer)
856 {
857 text += "empty".lang();
858 }
859 }
860 if ((this.trait is TraitRoomPlate || this.trait is TraitHouseBoard) && this.pos.IsValid)
861 {
862 Room room = this.pos.cell.room;
863 if (EClass.debug.enable && room != null && room.data.group != 0)
864 {
865 text = text + " #" + room.data.group.ToString();
866 }
867 }
868 return text;
869 }
870
871 // Token: 0x06002148 RID: 8520 RVA: 0x000B5AF0 File Offset: 0x000B3CF0
872 public List<Element> ListLimitedValidTraits(bool limit)
873 {
874 List<Element> list = new List<Element>();
875 if (base.ShowFoodEnc)
876 {
877 foreach (Element element in this.elements.dict.Values)
878 {
879 if (element.IsFoodTraitMain && element.Value > 0)
880 {
881 list.Add(element);
882 }
883 }
884 list.Sort((Element a, Element b) => ElementContainer.GetSortVal(b) - ElementContainer.GetSortVal(a));
885 if (limit && list.Count > 5)
886 {
887 int num = list.Count - 5;
888 for (int i = 0; i < num; i++)
889 {
890 list.RemoveAt(list.Count - 1);
891 }
892 }
893 }
894 return list;
895 }
896
897 // Token: 0x06002149 RID: 8521 RVA: 0x000B5BC8 File Offset: 0x000B3DC8
898 public List<Element> ListValidTraits(bool isCraft, bool limit)
899 {
900 List<Element> list = this.ListLimitedValidTraits(limit);
901 bool showFoodEnc = base.ShowFoodEnc;
902 bool flag = EClass.pc.HasElement(1650, 1);
903 if (showFoodEnc)
904 {
905 foreach (Element element in this.elements.dict.Values)
906 {
907 if (element.IsFoodTrait && !list.Contains(element) && (isCraft || flag || element.IsFoodTraitMain) && (!element.IsFoodTraitMain || element.Value < 0))
908 {
909 list.Add(element);
910 }
911 }
912 }
913 foreach (Element element2 in this.elements.dict.Values)
914 {
915 if ((isCraft || flag || ((!element2.IsFoodTrait || element2.IsFoodTraitMain) && (!showFoodEnc || !element2.IsTrait || element2.Value >= 0))) && !list.Contains(element2) && (element2.IsTrait || (element2.IsFoodTrait && !element2.IsFoodTraitMain)))
916 {
917 list.Add(element2);
918 }
919 }
920 return list;
921 }
922
923 // Token: 0x0600214A RID: 8522 RVA: 0x000B5D24 File Offset: 0x000B3F24
924 public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IInspect.NoteMode mode = IInspect.NoteMode.Default, Recipe recipe = null)
925 {
926 i.Clear();
927 TraitAbility traitAbility = this.trait as TraitAbility;
928 bool showEQStats = base.IsEquipmentOrRanged || base.IsAmmo;
929 bool flag = mode == IInspect.NoteMode.Product;
930 bool flag2 = base.IsIdentified || flag;
931 string text = base.Name;
932 if (base.rarity == Rarity.Legendary || base.rarity == Rarity.Mythical)
933 {
934 string text2 = text.Contains("『") ? "『" : (text.Contains("《") ? "《" : "");
935 if (text2 != "")
936 {
937 string[] array = text.Split(text2, StringSplitOptions.None);
938 text = array[0] + Environment.NewLine + text2 + array[1];
939 }
940 }
941 if (flag)
942 {
943 text = recipe.GetName();
944 }
945 if (mode != IInspect.NoteMode.Recipe)
946 {
947 UIItem uiitem = i.AddHeaderCard(text, null);
948 this.SetImage(uiitem.image2);
949 uiitem.image2.Rect().pivot = new Vector2(0.5f, 0.5f);
950 string text3 = base.Num.ToFormat() ?? "";
951 string text4 = (Mathf.Ceil(0.01f * (float)base.ChildrenAndSelfWeight) * 0.1f).ToString("F1") + "s";
952 if (this.things.Count > 0)
953 {
954 text3 = text3 + " (" + this.things.Count.ToString() + ")";
955 }
956 if (base.ChildrenAndSelfWeight != this.SelfWeight)
957 {
958 text4 = text4 + " (" + (Mathf.Ceil(0.01f * (float)this.SelfWeight) * 0.1f).ToString("F1") + "s)";
959 }
960 text = "_quantity".lang(text3 ?? "", text4, null, null, null);
961 if (flag && recipe != null && LayerCraft.Instance)
962 {
963 text = text + " " + "_recipe_lv".lang(recipe.RecipeLv.ToString() ?? "", null, null, null, null);
964 }
965 uiitem.text2.SetText(text);
966 if (showEQStats && flag2)
967 {
968 if (!flag)
969 {
970 text = "";
971 if (this.DV != 0 || this.PV != 0 || base.HIT != 0 || base.DMG != 0 || this.Penetration != 0)
972 {
973 if (base.DMG != 0)
974 {
975 text = string.Concat(new string[]
976 {
977 text,
978 "DMG".lang(),
979 (base.DMG > 0) ? "+" : "",
980 base.DMG.ToString(),
981 ", "
982 });
983 }
984 if (base.HIT != 0)
985 {
986 text = string.Concat(new string[]
987 {
988 text,
989 "HIT".lang(),
990 (base.HIT > 0) ? "+" : "",
991 base.HIT.ToString(),
992 ", "
993 });
994 }
995 if (this.DV != 0)
996 {
997 text = string.Concat(new string[]
998 {
999 text,
1000 "DV".lang(),
1001 (this.DV > 0) ? "+" : "",
1002 this.DV.ToString(),
1003 ", "
1004 });
1005 }
1006 if (this.PV != 0)
1007 {
1008 text = string.Concat(new string[]
1009 {
1010 text,
1011 "PV".lang(),
1012 (this.PV > 0) ? "+" : "",
1013 this.PV.ToString(),
1014 ", "
1015 });
1016 }
1017 if (this.Penetration != 0)
1018 {
1019 text = string.Concat(new string[]
1020 {
1021 text,
1022 "PEN".lang(),
1023 (this.Penetration > 0) ? "+" : "",
1024 this.Penetration.ToString(),
1025 "%, "
1026 });
1027 }
1028 text = text.TrimEnd(' ').TrimEnd(',');
1029 }
1030 if (!text.IsEmpty())
1031 {
1032 i.AddText("NoteText_eqstats", text, FontColor.DontChange);
1033 }
1034 }
1035 TraitToolRange traitToolRange = this.trait as TraitToolRange;
1036 if (traitToolRange != null)
1037 {
1038 i.AddText("NoteText_eqstats", "tip_range".lang(traitToolRange.BestDist.ToString() ?? "", null, null, null, null), FontColor.DontChange);
1039 }
1040 }
1041 else
1042 {
1043 string text5 = "";
1044 if (EClass.debug.showExtra)
1045 {
1046 int totalQuality = base.GetTotalQuality(true);
1047 int totalQuality2 = base.GetTotalQuality(false);
1048 text5 = text5 + "_quality".lang(base.GetTotalQuality(true).ToString() ?? "", null, null, null, null) + ((totalQuality == totalQuality2) ? "" : (" (" + totalQuality2.ToString() + ")"));
1049 }
1050 if (base.HasElement(10, 1))
1051 {
1052 text5 = text5 + (text5.IsEmpty() ? "" : " ") + "_nutrition".lang(base.Evalue(10).ToString() ?? "", null, null, null, null);
1053 }
1054 if ((base.category.IsChildOf("resource") || this.trait.IsTool) && !(this.trait is TraitAbility))
1055 {
1056 text5 = text5 + (text5.IsEmpty() ? "" : " ") + "_hardness".lang(base.material.hardness.ToString() ?? "", null, null, null, null);
1057 }
1058 if (flag && recipe != null && LayerCraft.Instance)
1059 {
1060 text5 = text5 + (text5.IsEmpty() ? "" : " ") + "_max_quality".lang(recipe.GetQualityBonus().ToString() ?? "", null, null, null, null);
1061 }
1062 if (!text5.IsEmpty())
1063 {
1064 i.AddText("NoteText_eqstats", text5, FontColor.DontChange);
1065 }
1066 }
1067 string detail = this.GetDetail();
1068 if (!detail.IsEmpty())
1069 {
1070 LayoutElement component = i.AddText("NoteText_flavor", detail, FontColor.DontChange).GetComponent<LayoutElement>();
1071 if (flag)
1072 {
1073 component.preferredWidth = 400f;
1074 }
1075 i.Space(8, 1);
1076 }
1077 }
1078 if (this.trait is TraitBookPlan)
1079 {
1080 TraitBookPlan traitBookPlan = this.trait as TraitBookPlan;
1081 i.AddText("NoteText_flavor", traitBookPlan.source.GetDetail(), FontColor.DontChange);
1082 i.Space(8, 1);
1083 }
1084 if (traitAbility != null)
1085 {
1086 i.Space(8, 1);
1087 Act act = traitAbility.CreateAct();
1088 Element orCreateElement = EClass.pc.elements.GetOrCreateElement(act.source.id);
1089 orCreateElement._WriteNote(i, EClass.pc.elements, null, false, false);
1090 orCreateElement._WriteNote(i, EClass.pc, act);
1091 return;
1092 }
1093 if (EClass.debug.showExtra)
1094 {
1095 string[] array2 = new string[8];
1096 array2[0] = "(id:";
1097 array2[1] = this.id;
1098 array2[2] = " tile:";
1099 int num = 3;
1100 string text6 = this.source.tiles.IsEmpty() ? "-" : this.source.tiles[0];
1101 array2[num] = ((text6 != null) ? text6.ToString() : null);
1102 array2[4] = ") lv:";
1103 array2[5] = base.LV.ToString();
1104 array2[6] = " price:";
1105 array2[7] = this.GetPrice(CurrencyType.Money, false, PriceType.Default, null).ToString();
1106 i.AddText(string.Concat(array2), FontColor.DontChange);
1107 }
1108 Card rootCard = base.GetRootCard();
1109 if (rootCard != null && rootCard != EClass.pc && rootCard != this && rootCard.ExistsOnMap)
1110 {
1111 Thing thing = this.parent as Thing;
1112 if (!(((thing != null) ? thing.trait : null) is TraitChestMerchant))
1113 {
1114 i.AddText("isChildOf".lang(base.GetRootCard().Name, null, null, null, null), FontColor.ItemName);
1115 }
1116 }
1117 if (flag2)
1118 {
1119 i.AddText("isMadeOf".lang(base.material.GetText("name", false), base.material.hardness.ToString() ?? "", null, null, null), FontColor.DontChange);
1120 }
1121 i.AddText("isCategorized".lang(base.category.GetText("name", false), null, null, null, null), FontColor.DontChange);
1122 if (base.category.skill != 0)
1123 {
1124 int key = base.category.skill;
1125 int key2 = 132;
1126 if (base.IsRangedWeapon)
1127 {
1128 key2 = 133;
1129 }
1130 if (this.trait is TraitToolRangeCane)
1131 {
1132 key2 = 304;
1133 }
1134 if (base.Evalue(482) > 0)
1135 {
1136 key = 305;
1137 key2 = 304;
1138 }
1139 i.AddText("isUseSkill".lang(EClass.sources.elements.map[key].GetName().ToTitleCase(true), EClass.sources.elements.map[key2].GetName().ToTitleCase(true), null, null, null), FontColor.DontChange);
1140 }
1141 if (base.IsContainer)
1142 {
1143 i.AddText("isContainer".lang(this.things.MaxCapacity.ToString() ?? "", null, null, null, null), FontColor.DontChange);
1144 }
1145 if (base.c_lockLv != 0)
1146 {
1147 i.AddText((base.c_lockedHard ? "isLockedHard" : "isLocked").lang(base.c_lockLv.ToString() ?? "", null, null, null, null), FontColor.Warning);
1148 }
1149 if (base.isCrafted && recipe == null)
1150 {
1151 i.AddText("isCrafted".lang(), FontColor.DontChange);
1152 }
1153 if (this.trait.Decay > 0)
1154 {
1155 string s2;
1156 if (base.IsDecayed)
1157 {
1158 s2 = "isRotten";
1159 }
1160 else if (base.IsRotting)
1161 {
1162 s2 = "isRotting";
1163 }
1164 else if (base.IsFresn)
1165 {
1166 s2 = "isFresh";
1167 }
1168 else
1169 {
1170 s2 = "isNotFresh";
1171 }
1172 i.AddText(s2.lang(), FontColor.DontChange);
1173 }
1174 if (base.isDyed)
1175 {
1176 i.AddText("isDyed".lang(), FontColor.DontChange);
1177 }
1178 if (base.IsEquipment)
1179 {
1180 text = "isEquipable".lang(Element.Get(base.category.slot).GetText("name", false), null, null, null, null);
1181 i.AddText(text, FontColor.DontChange);
1182 }
1183 if (base.isFireproof)
1184 {
1185 i.AddText("isFreproof", FontColor.DontChange);
1186 }
1187 if (base.isAcidproof)
1188 {
1189 i.AddText("isAcidproof", FontColor.DontChange);
1190 }
1191 if (this.trait.Electricity > 0)
1192 {
1193 i.AddText("isGenerateElectricity".lang(this.trait.Electricity.ToString() ?? "", null, null, null, null), FontColor.DontChange);
1194 }
1195 if (this.trait.Electricity < 0)
1196 {
1197 i.AddText("isConsumeElectricity".lang(Mathf.Abs(this.trait.Electricity).ToString() ?? "", null, null, null, null), FontColor.DontChange);
1198 }
1199 if (base.IsUnique)
1200 {
1201 i.AddText("isPrecious", FontColor.DontChange);
1202 }
1203 if (base.isCopy)
1204 {
1205 i.AddText("isCopy", FontColor.DontChange);
1206 }
1207 if (!this.trait.CanBeDestroyed)
1208 {
1209 i.AddText("isIndestructable", FontColor.DontChange);
1210 }
1211 if (base.GetInt(107, null) > 0)
1212 {
1213 i.AddText("isLicked", FontColor.DontChange);
1214 }
1215 if (!base.c_idDeity.IsEmpty())
1216 {
1217 Religion religion = EClass.game.religions.Find(base.c_idDeity) ?? EClass.game.religions.Eyth;
1218 i.AddText("isDeity".lang(religion.Name, null, null, null, null), FontColor.Myth);
1219 }
1220 if (base.isGifted && base.GetRoot() != EClass.pc)
1221 {
1222 i.AddText("isGifted", FontColor.Ether);
1223 }
1224 if (base.isNPCProperty)
1225 {
1226 i.AddText("isNPCProperty", FontColor.Ether);
1227 }
1228 if (base.c_priceFix != 0)
1229 {
1230 i.AddText(((base.c_priceFix > 0) ? "isPriceUp" : "isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ?? "", null, null, null, null), FontColor.Ether);
1231 }
1232 if (base.noSell)
1233 {
1234 i.AddText("isNoSell", FontColor.Ether);
1235 }
1236 if (base.isStolen)
1237 {
1238 i.AddText("isStolen", FontColor.Ether);
1239 }
1240 if (base.c_isImportant)
1241 {
1242 i.AddText("isMarkedImportant", FontColor.Ether);
1243 }
1244 if (base.GetInt(25, null) != 0)
1245 {
1246 i.AddText("isDangerLv".lang(base.GetInt(25, null).ToString() ?? "", null, null, null, null), FontColor.DontChange);
1247 }
1248 if (this.trait is TraitTool && !(this.trait is TraitToolRange))
1249 {
1250 FontColor color = FontColor.Util;
1251 if (base.HasElement(220, 1))
1252 {
1253 i.AddText("canMine".lang(), color);
1254 }
1255 if (base.HasElement(225, 1))
1256 {
1257 i.AddText("canLumberjack".lang(), color);
1258 i.AddText("canLumberjack2".lang(), color);
1259 }
1260 if (base.HasElement(230, 1))
1261 {
1262 i.AddText("canDig", color);
1263 }
1264 if (base.HasElement(286, 1))
1265 {
1266 i.AddText("canFarm", color);
1267 }
1268 if (base.HasElement(245, 1))
1269 {
1270 i.AddText("canFish", color);
1271 }
1272 if (base.HasElement(237, 1))
1273 {
1274 i.AddText("canTame", color);
1275 }
1276 }
1277 if (Lang.Has("hint_" + this.trait.ToString()))
1278 {
1279 i.AddText("hint_" + this.trait.ToString(), FontColor.Util);
1280 }
1281 if (Lang.Has("hint_" + this.trait.ToString() + "2"))
1282 {
1283 i.AddText("hint_" + this.trait.ToString() + "2", FontColor.Util);
1284 }
1285 if (base.HasTag(CTAG.tourism))
1286 {
1287 i.AddText("isTourism", FontColor.Util);
1288 }
1289 string langPlaceType = base.TileType.LangPlaceType;
1290 if (langPlaceType == "place_Door" || langPlaceType == "place_WallMount")
1291 {
1292 i.AddText(base.TileType.LangPlaceType + "_hint".lang(), FontColor.Util);
1293 }
1294 if (this.trait.IsHomeItem)
1295 {
1296 i.AddText("isHomeItem".lang(), FontColor.Util);
1297 }
1298 if (base.HasTag(CTAG.throwWeapon))
1299 {
1300 i.AddText("isThrowWeapon", FontColor.DontChange);
1301 }
1302 if (EClass.debug.showExtra && base.HasTag(CTAG.throwWeaponEnemy))
1303 {
1304 i.AddText("isThrowWeaponEnemy", FontColor.DontChange);
1305 }
1306 if (base.HasElement(10, 1))
1307 {
1308 i.AddText("isEdible", FontColor.DontChange);
1309 }
1310 if (base.HasTag(CTAG.rareResource))
1311 {
1312 i.AddText("isRareResource", FontColor.Great);
1313 }
1314 TraitBed traitBed = this.trait as TraitBed;
1315 if (traitBed != null)
1316 {
1317 i.AddText("isBed".lang(traitBed.MaxHolders.ToString() ?? "", null, null, null, null), FontColor.DontChange);
1318 }
1319 bool flag3 = base.IsEquipmentOrRanged || base.IsAmmo || base.IsThrownWeapon;
1320 if (flag2)
1321 {
1322 if (flag3)
1323 {
1324 Element element = this.elements.GetElement(653);
1325 if (element != null)
1326 {
1327 i.AddText("isAlive".lang(element.vBase.ToString() ?? "", (element.vExp / 10).ToString() ?? "", (element.ExpToNext / 10).ToString() ?? "", null, null), FontColor.Great);
1328 }
1329 string[] rangedSubCats = new string[]
1330 {
1331 "eleConvert",
1332 "eleAttack"
1333 };
1334 this.elements.AddNote(i, (Element e) => (!(this.trait is TraitToolRange) || this.category.slot != 0 || e is Ability || rangedSubCats.Contains(e.source.categorySub) || e.HasTag("modRanged")) && !e.IsTrait && (!(e.source.categorySub == "eleAttack") || this.IsWeapon || this.IsRangedWeapon || this.IsAmmo || this.IsThrownWeapon) && (!showEQStats || (e.id != 64 && e.id != 65 && e.id != 66 && e.id != 67)), null, ElementContainer.NoteMode.Default, false, null, null);
1335 }
1336 if (this.sockets == null)
1337 {
1338 goto IL_11A6;
1339 }
1340 using (List<int>.Enumerator enumerator = this.sockets.GetEnumerator())
1341 {
1342 while (enumerator.MoveNext())
1343 {
1344 int num2 = enumerator.Current;
1345 i.AddText((num2 == 0) ? "emptySocket".lang() : "socket".lang(EClass.sources.elements.map[num2 / 100].GetName(), (num2 % 100).ToString() ?? "", null, null, null), FontColor.Gray);
1346 }
1347 goto IL_11A6;
1348 }
1349 }
1350 i.AddText("isUnidentified".lang(), FontColor.Flavor);
1351 if (base.c_IDTState == 1)
1352 {
1353 i.AddText("isUnidentified2".lang(), FontColor.Flavor);
1354 }
1355 IL_11A6:
1356 this.trait.WriteNote(i, flag2);
1357 if (flag2 && !flag3)
1358 {
1359 bool infoMode = mode == IInspect.NoteMode.Info;
1360 List<Element> list = this.ListValidTraits(false, !infoMode);
1361 List<Element> list2 = this.ListValidTraits(false, false);
1362 if (list2.Count - list.Count <= 1)
1363 {
1364 list = list2;
1365 }
1366 this.elements.AddNote(i, (Element e) => list.Contains(e), null, ElementContainer.NoteMode.Trait, false, delegate(Element e, string s)
1367 {
1368 string text8 = s;
1369 string text9 = e.source.GetText("textExtra", false);
1370 if (!text9.IsEmpty())
1371 {
1372 string text10 = "";
1373 if (e.id == 2 && mode == IInspect.NoteMode.Product)
1374 {
1375 int num3 = recipe.GetQualityBonus() / 10;
1376 if (num3 >= 0)
1377 {
1378 num3++;
1379 }
1380 text10 = "qualityLimit".lang(num3.ToString() ?? "", null, null, null, null);
1381 }
1382 int num4 = e.Value / 10;
1383 if (num4 >= 0)
1384 {
1385 num4++;
1386 }
1387 text9 = string.Concat(new string[]
1388 {
1389 "Lv.",
1390 num4.ToString(),
1391 text10,
1392 " ",
1393 text9
1394 });
1395 if (infoMode && e.IsFoodTraitMain)
1396 {
1397 text9 += "traitAdditive".lang();
1398 }
1399 text8 += (" <size=12>" + text9 + "</size>").TagColor(FontColor.Passive, null);
1400 }
1401 return text8;
1402 }, delegate(UINote n, Element e)
1403 {
1404 });
1405 if (base.ShowFoodEnc && EClass.pc.HasElement(1650, 1))
1406 {
1407 if (FoodEffect.IsHumanFlesh(this))
1408 {
1409 i.AddText("foodHuman".lang(), FontColor.Ether);
1410 }
1411 if (FoodEffect.IsUndeadFlesh(this))
1412 {
1413 i.AddText("foodUndead".lang(), FontColor.Ether);
1414 }
1415 }
1416 if (list.Count != list2.Count)
1417 {
1418 i.AddText("traitOther".lang((list2.Count - list.Count).ToString() ?? "", null, null, null, null), FontColor.DontChange);
1419 }
1420 }
1421 if (EClass.debug.showExtra)
1422 {
1423 i.AddText("decay:" + base.decay.ToString(), FontColor.DontChange);
1424 }
1425 if (this.id == "statue_weird")
1426 {
1427 i.AddText("weirdStatue", FontColor.DontChange);
1428 }
1429 if (base.isReplica)
1430 {
1431 i.AddText("isReplica", FontColor.Passive);
1432 }
1433 if (flag2)
1434 {
1435 Chara chara = base.GetRootCard() as Chara;
1436 Card parentCard = base.parentCard;
1437 if (((parentCard != null) ? parentCard.trait : null) is TraitChestMerchant)
1438 {
1439 chara = null;
1440 }
1441 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara != null)
1442 {
1443 Thing.AddAttackEvaluation(i, chara, this);
1444 }
1445 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1446 {
1447 i.AddHeader("headerAttackEval", null);
1448 AttackProcess.Current.Prepare(chara ?? EClass.pc, this, null, null, 0, base.IsThrownWeapon);
1449 string text7 = AttackProcess.Current.GetText();
1450 text7 = text7.TagColor(() => true, null);
1451 i.AddText(text7, FontColor.DontChange);
1452 }
1453 }
1454 if (base.ammoData != null)
1455 {
1456 i.AddHeader("headerAttackAmmo", null);
1457 i.AddText(base.ammoData.Name, FontColor.DontChange);
1458 }
1459 if (onWriteNote != null)
1460 {
1461 onWriteNote(i);
1462 }
1463 if (EClass.debug.showExtra)
1464 {
1465 foreach (Element element2 in this.elements.dict.Values)
1466 {
1467 i.AddText(string.Concat(new string[]
1468 {
1469 element2.source.alias,
1470 "/",
1471 element2.Value.ToString(),
1472 "/",
1473 element2.vBase.ToString(),
1474 "/",
1475 element2.vSource.ToString()
1476 }), FontColor.DontChange);
1477 }
1478 }
1479 i.Build();
1480 }
1481
1482 // Token: 0x0600214B RID: 8523 RVA: 0x000B7294 File Offset: 0x000B5494
1483 public static void AddAttackEvaluation(UINote n, Chara chara, Thing current = null)
1484 {
1485 n.AddHeader("headerAttackEval", null);
1486 int num = 0;
1487 foreach (BodySlot bodySlot in chara.body.slots)
1488 {
1489 if (bodySlot.thing != null && bodySlot.elementId == 35 && bodySlot.thing.source.offense.Length >= 2)
1490 {
1491 AttackProcess.Current.Prepare(chara, bodySlot.thing, null, null, num, false);
1492 string text = AttackProcess.Current.GetText();
1493 if (bodySlot.thing == current)
1494 {
1495 text = text.TagColor(() => true, null);
1496 }
1497 n.AddText(text, FontColor.DontChange);
1498 num++;
1499 }
1500 }
1501 AttackProcess.Current.Prepare(chara, null, null, null, 0, false);
1502 string text2 = AttackProcess.Current.GetText();
1503 if (num == 0)
1504 {
1505 text2 = text2.TagColor(() => true, null);
1506 }
1507 n.AddText(text2, FontColor.DontChange);
1508 }
1509
1510 // Token: 0x0600214C RID: 8524 RVA: 0x000B73D4 File Offset: 0x000B55D4
1511 public override void SetRenderParam(RenderParam p)
1512 {
1513 p.matColor = (float)base.colorInt;
1514 p.mat = base.material;
1515 if (!this.renderer.usePass)
1516 {
1517 return;
1518 }
1519 switch (this.trait.tileMode)
1520 {
1521 case Trait.TileMode.Default:
1522 if (this.source._altTiles.Length != 0 && this.trait.UseAltTiles)
1523 {
1524 p.tile = (float)(this.source._altTiles[base.dir % this.source._altTiles.Length] * (this.flipX ? -1 : 1));
1525 }
1526 else
1527 {
1528 p.tile = (float)(this.sourceCard._tiles[base.dir % this.sourceCard._tiles.Length] * (this.flipX ? -1 : 1));
1529 }
1530 if (this.source.anime.Length != 0 && this.trait.IsAnimeOn)
1531 {
1532 if (this.source.anime.Length > 2)
1533 {
1534 float num = Time.realtimeSinceStartup * 1000f / (float)this.source.anime[1] % (float)this.source.anime[2];
1535 if ((int)num == this.source.anime[0] - 1 && this.source.anime.Length > 3)
1536 {
1537 base.PlaySound("anime_sound" + this.source.anime[3].ToString(), 1f, true);
1538 }
1539 if (num < (float)this.source.anime[0])
1540 {
1541 p.tile += num * (float)(this.flipX ? -1 : 1);
1542 }
1543 }
1544 else
1545 {
1546 float num2 = Time.realtimeSinceStartup * 1000f / (float)this.source.anime[1] % (float)this.source.anime[0];
1547 p.tile += num2 * (float)(this.flipX ? -1 : 1);
1548 }
1549 }
1550 break;
1551 case Trait.TileMode.Door:
1552 {
1553 if (this.source._altTiles.Length != 0 && this.trait.UseAltTiles)
1554 {
1555 p.tile = (float)(this.source._altTiles[base.dir % this.source._altTiles.Length] * (this.flipX ? -1 : 1));
1556 }
1557 else
1558 {
1559 p.tile = (float)(this.sourceCard._tiles[base.dir % this.sourceCard._tiles.Length] * (this.flipX ? -1 : 1));
1560 }
1561 if (this.parent is Zone && this.pos.cell.HasFullBlock)
1562 {
1563 p.tile += (float)((p.tile < 0f) ? -64 : 64);
1564 }
1565 TraitDoorSwing traitDoorSwing = this.trait as TraitDoorSwing;
1566 if (traitDoorSwing != null && traitDoorSwing.IsOpen())
1567 {
1568 p.tile += (float)((p.tile < 0f) ? -1 : 1);
1569 }
1570 break;
1571 }
1572 case Trait.TileMode.Illumination:
1573 if (base.isOn || base.isRoofItem)
1574 {
1575 int num3 = (int)((float)base.uid + Time.realtimeSinceStartup * 5f);
1576 int num4 = (int)(Time.realtimeSinceStartup * 5f);
1577 p.tile = (float)((this.sourceCard._tiles[base.dir % this.sourceCard._tiles.Length] + num3 % 3 + 1) * (this.flipX ? -1 : 1));
1578 if (num4 % 16 == 0)
1579 {
1580 p.color = 5242880f;
1581 }
1582 else if (num4 % 11 == 0)
1583 {
1584 p.color = 7864320f;
1585 }
1586 else
1587 {
1588 p.color = 13107200f;
1589 }
1590 }
1591 else
1592 {
1593 p.tile = (float)(this.sourceCard._tiles[base.dir % this.sourceCard._tiles.Length] * (this.flipX ? -1 : 1));
1594 }
1595 break;
1596 case Trait.TileMode.DefaultNoAnime:
1597 if (this.source._altTiles.Length != 0 && this.trait.UseAltTiles)
1598 {
1599 p.tile = (float)(this.source._altTiles[base.dir % this.source._altTiles.Length] * (this.flipX ? -1 : 1));
1600 }
1601 else
1602 {
1603 p.tile = (float)(this.sourceCard._tiles[base.dir % this.sourceCard._tiles.Length] * (this.flipX ? -1 : 1));
1604 }
1605 break;
1606 }
1607 if (base.idSkin != 0)
1608 {
1609 int num5 = base.idSkin - 1;
1610 if (this.sourceCard.skins.Length != 0)
1611 {
1612 p.tile += (float)((p.tile < 0f) ? (-(float)this.sourceCard.skins[num5]) : this.sourceCard.skins[num5]);
1613 }
1614 }
1615 }
1616
1617 // Token: 0x0600214D RID: 8525 RVA: 0x000B78B0 File Offset: 0x000B5AB0
1618 public override SubPassData GetSubPassData()
1619 {
1620 Chara chara = base.GetRootCard() as Chara;
1621 if ((this.trait.ShowAsTool && (chara != EClass.pc || !HotItemHeld.disableTool)) || (((chara != null) ? chara.held : null) != this && (this.placeState == PlaceState.installed || !this.renderer.data.subCrate.enable || !(this.parent is Zone))))
1622 {
1623 return SubPassData.Default;
1624 }
1625 if (!this.renderer.data.subCrate.enable)
1626 {
1627 return EClass.setting.pass.subCrate;
1628 }
1629 return this.renderer.data.subCrate;
1630 }
1631
1632 // Token: 0x0600214E RID: 8526 RVA: 0x000B7960 File Offset: 0x000B5B60
1633 public override bool CanStackTo(Thing to)
1634 {
1635 if (this.trait.HasCharges || to.isEquipped || base.isModified || to.isModified || to.id != this.id || to.idMaterial != base.idMaterial || to.refVal != base.refVal || to.blessedState != base.blessedState || to.rarityLv != base.rarityLv || to.qualityTier != base.qualityTier || to.idSkin != base.idSkin || to.isGifted != base.isGifted)
1636 {
1637 return false;
1638 }
1639 if ((to.isDyed || base.isDyed) && to.c_dyeMat != base.c_dyeMat)
1640 {
1641 return false;
1642 }
1643 if (base.c_idRefCard != to.c_idRefCard || base.c_idRefCard2 != to.c_idRefCard2)
1644 {
1645 return false;
1646 }
1647 if (base.IsDecayed != to.IsDecayed)
1648 {
1649 return false;
1650 }
1651 if (!this.trait.CanStackTo(to))
1652 {
1653 return false;
1654 }
1655 if (base.noSell != to.noSell || base.isCopy != to.isCopy)
1656 {
1657 return false;
1658 }
1659 if (base.isStolen != to.isStolen)
1660 {
1661 return false;
1662 }
1663 if ((to.isWeightChanged || base.isWeightChanged) && to.SelfWeight != this.SelfWeight)
1664 {
1665 return false;
1666 }
1667 if (to.c_IDTState != base.c_IDTState)
1668 {
1669 return false;
1670 }
1671 if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix)
1672 {
1673 return false;
1674 }
1675 if (to.ChildrenAndSelfWeight + base.ChildrenAndSelfWeight > 1000000000)
1676 {
1677 return false;
1678 }
1679 bool flag = false;
1680 if (to.parent is Card)
1681 {
1682 Window.SaveData windowSaveData = (to.parent as Card).GetWindowSaveData();
1683 if (windowSaveData != null && windowSaveData.compress)
1684 {
1685 flag = true;
1686 }
1687 }
1688 if (flag)
1689 {
1690 if (base.encLV != to.encLV && !base.IsFood)
1691 {
1692 return false;
1693 }
1694 if (this.elements.dict.Count<KeyValuePair<int, Element>>() != to.elements.dict.Count<KeyValuePair<int, Element>>())
1695 {
1696 return false;
1697 }
1698 foreach (Element element in this.elements.dict.Values)
1699 {
1700 if (to.elements.GetElement(element.id) == null)
1701 {
1702 return false;
1703 }
1704 }
1705 base.encLV = (to.encLV = Mathf.CeilToInt(1f * (float)(base.encLV * base.Num + to.encLV * to.Num) / (float)(base.Num + to.Num)));
1706 foreach (Element element2 in this.elements.dict.Values)
1707 {
1708 Element element3 = to.elements.GetElement(element2.id);
1709 element2.vBase = (element3.vBase = (element2.vBase * base.Num + element3.vBase * to.Num) / (base.Num + to.Num));
1710 }
1711 return true;
1712 }
1713 else
1714 {
1715 if (base.encLV != to.encLV)
1716 {
1717 return false;
1718 }
1719 if (this.elements.dict.Count<KeyValuePair<int, Element>>() != to.elements.dict.Count<KeyValuePair<int, Element>>())
1720 {
1721 return false;
1722 }
1723 foreach (Element element4 in this.elements.dict.Values)
1724 {
1725 Element element5 = to.elements.GetElement(element4.id);
1726 if (element5 == null || element4.vBase / 10 * 10 != element5.vBase / 10 * 10)
1727 {
1728 return false;
1729 }
1730 }
1731 return true;
1732 }
1733 bool result;
1734 return result;
1735 }
1736
1737 // Token: 0x0600214F RID: 8527 RVA: 0x000B7D74 File Offset: 0x000B5F74
1738 public void GetIngredients(Recipe.Ingredient ing, List<Thing> list)
1739 {
1740 if (ing.CanSetThing(this))
1741 {
1742 list.Add(this);
1743 }
1744 if (this.things.Count > 0 && base.c_lockLv == 0 && !base.isNPCProperty)
1745 {
1746 foreach (Thing thing in this.things)
1747 {
1748 thing.GetIngredients(ing, list);
1749 }
1750 }
1751 }
1752
1753 // Token: 0x06002150 RID: 8528 RVA: 0x000B7DF4 File Offset: 0x000B5FF4
1754 public bool IsValidIngredient(Recipe.Ingredient ing)
1755 {
1756 return !this.isDestroyed && base.GetRootCard().Dist(EClass.pc) <= 1 && ing.CanSetThing(this);
1757 }
1758
1759 // Token: 0x06002151 RID: 8529 RVA: 0x000B7E1F File Offset: 0x000B601F
1760 public void GetRecipes(HashSet<Recipe> recipes)
1761 {
1762 }
1763
1764 // Token: 0x06002152 RID: 8530 RVA: 0x000B7E21 File Offset: 0x000B6021
1765 public void GetDisassembles(List<Thing> list)
1766 {
1767 }
1768
1769 // Token: 0x06002153 RID: 8531 RVA: 0x000B7E23 File Offset: 0x000B6023
1770 public void Disassemble()
1771 {
1772 }
1773
1774 // Token: 0x06002154 RID: 8532 RVA: 0x000B7E28 File Offset: 0x000B6028
1775 public void ShowSplitMenu(ButtonGrid button, InvOwner.Transaction trans = null)
1776 {
1777 Thing.<>c__DisplayClass43_0 CS$<>8__locals1 = new Thing.<>c__DisplayClass43_0();
1778 CS$<>8__locals1.<>4__this = this;
1779 CS$<>8__locals1.trans = trans;
1780 CS$<>8__locals1.button = button;
1781 CS$<>8__locals1.count = 1;
1782 CS$<>8__locals1.m = EClass.ui.CreateContextMenuInteraction();
1783 CS$<>8__locals1.buy = (CS$<>8__locals1.trans != null);
1784 CS$<>8__locals1.buttonBuy = null;
1785 CS$<>8__locals1.itemSlider = null;
1786 CS$<>8__locals1.itemSlider = CS$<>8__locals1.m.AddSlider("sliderSplitMenu", "adjustmentNum", delegate(float a)
1787 {
1788 if (!EClass.core.IsGameStarted)
1789 {
1790 return "";
1791 }
1792 return "/" + CS$<>8__locals1.<>4__this.Num.ToString();
1793 }, (float)CS$<>8__locals1.count, delegate(float b)
1794 {
1795 CS$<>8__locals1.count = (int)b;
1796 if (CS$<>8__locals1.trans != null)
1797 {
1798 CS$<>8__locals1.trans.num = CS$<>8__locals1.count;
1799 }
1800 base.<ShowSplitMenu>g__UpdateButton|0();
1801 }, 1f, (float)base.Num, true, false, true).GetComponent<UIItem>();
1802 if (CS$<>8__locals1.buy)
1803 {
1804 CS$<>8__locals1.buttonBuy = CS$<>8__locals1.m.AddButton("invBuy", delegate()
1805 {
1806 base.<ShowSplitMenu>g__Process|1();
1807 }, true);
1808 }
1809 CS$<>8__locals1.m.onDestroy = delegate()
1810 {
1811 if (!CS$<>8__locals1.buy && !CS$<>8__locals1.m.wasCanceled)
1812 {
1813 base.<ShowSplitMenu>g__Process|1();
1814 }
1815 };
1816 CS$<>8__locals1.m.Show();
1817 if (CS$<>8__locals1.buttonBuy)
1818 {
1819 CS$<>8__locals1.buttonBuy.gameObject.AddComponent<CanvasGroup>();
1820 }
1821 CS$<>8__locals1.<ShowSplitMenu>g__UpdateButton|0();
1822 }
1823
1824 // Token: 0x06002155 RID: 8533 RVA: 0x000B7F44 File Offset: 0x000B6144
1825 public void DoAct(Act act)
1826 {
1827 if (!EClass.pc.HasNoGoal || (act.LocalAct && EClass._zone.IsRegion))
1828 {
1829 SE.Beep();
1830 return;
1831 }
1832 EClass.player.hotItemToRestore = EClass.player.currentHotItem;
1833 if (act.IsAct)
1834 {
1835 act.Perform(EClass.pc, null, null);
1836 return;
1837 }
1838 AIAct ai = act as AIAct;
1839 EClass.pc.SetAI(ai);
1840 ActionMode.Adv.SetTurbo(-1);
1841 }
1842
1843 // Token: 0x17000AE5 RID: 2789
1844 // (get) Token: 0x06002156 RID: 8534 RVA: 0x000B7FC0 File Offset: 0x000B61C0
1845 public bool CanSearchContents
1846 {
1847 get
1848 {
1849 return base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty && this.trait.CanSearchContents;
1850 }
1851 }
1852
1853 // Token: 0x17000AE6 RID: 2790
1854 // (get) Token: 0x06002157 RID: 8535 RVA: 0x000B7FE7 File Offset: 0x000B61E7
1855 public bool IsSharedContainer
1856 {
1857 get
1858 {
1859 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
1860 {
1861 Window.SaveData obj = base.GetObj<Window.SaveData>(2);
1862 return obj != null && obj.sharedType == ContainerSharedType.Shared;
1863 }
1864 return false;
1865 }
1866 }
1867
1868 // Token: 0x06002158 RID: 8536 RVA: 0x000B8018 File Offset: 0x000B6218
1869 public static Tuple<SourceElement.Row, int> GetEnchant(int lv, Func<SourceElement.Row, bool> func, bool neg)
1870 {
1871 List<SourceElement.Row> list = new List<SourceElement.Row>();
1872 int num = 0;
1873 int num2 = lv + 5 + EClass.rndSqrt(10);
1874 float num3 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt((float)lv);
1875 foreach (SourceElement.Row row in EClass.sources.elements.rows)
1876 {
1877 if ((!neg || !row.tag.Contains("flag")) && func(row) && row.LV < num2)
1878 {
1879 list.Add(row);
1880 num += row.chance;
1881 }
1882 }
1883 if (num == 0)
1884 {
1885 return null;
1886 }
1887 int num4 = EClass.rnd(num);
1888 int num5 = 0;
1889 foreach (SourceElement.Row row2 in list)
1890 {
1891 num5 += row2.chance;
1892 if (num4 < num5)
1893 {
1894 string category = EClass.sources.elements.map[row2.id].category;
1895 bool flag = category == "skill" || category == "attribute" || category == "resist";
1896 int item = (row2.mtp + EClass.rnd(row2.mtp + (int)num3)) / row2.mtp * ((flag && neg) ? -1 : 1);
1897 return new Tuple<SourceElement.Row, int>(row2, item);
1898 }
1899 }
1900 return null;
1901 }
1902
1903 // Token: 0x06002159 RID: 8537 RVA: 0x000B81C8 File Offset: 0x000B63C8
1904 public void TryLickEnchant(Chara c, bool msg = true, Chara tg = null, BodySlot slot = null)
1905 {
1906 if (!base.IsEquipmentOrRanged)
1907 {
1908 return;
1909 }
1910 if (base.IsCursed || base.rarity <= Rarity.Normal)
1911 {
1912 return;
1913 }
1914 if (base.GetInt(107, null) > 0)
1915 {
1916 return;
1917 }
1918 if (tg == null)
1919 {
1920 Rand.SetSeed(EClass.world.date.day + this.source._index + c.uid);
1921 if (msg)
1922 {
1923 c.Say("lick", c, this, null, null);
1924 base.PlaySound("offering", 1f, true);
1925 base.PlayEffect("mutation", true, 0f, default(Vector3));
1926 }
1927 this.AddEnchant(base.LV);
1928 }
1929 else
1930 {
1931 Rand.SetSeed(base.uid);
1932 List<Element> list = new List<Element>();
1933 foreach (Element element in this.elements.dict.Values)
1934 {
1935 if (element.id != 67 && element.id != 66 && element.id != 64 && element.id != 65)
1936 {
1937 list.Add(element);
1938 }
1939 }
1940 if (list.Count > 0)
1941 {
1942 Element element2 = list.RandomItem<Element>();
1943 this.elements.ModBase(element2.id, Mathf.Max(EClass.rnd(Mathf.Abs(element2.vBase / 5)), 1));
1944 }
1945 if (msg)
1946 {
1947 c.Say("lick2", c, tg, slot.name.ToLower(), null);
1948 tg.PlaySound("offering", 1f, true);
1949 tg.PlayEffect("mutation", true, 0f, default(Vector3));
1950 }
1951 }
1952 Rand.SetSeed(-1);
1953 base.SetInt(107, 1);
1954 }
1955
1956 // Token: 0x0600215A RID: 8538 RVA: 0x000B83A8 File Offset: 0x000B65A8
1957 public Element AddEnchant(int lv = -1)
1958 {
1959 if (base.IsToolbelt || base.IsLightsource)
1960 {
1961 return null;
1962 }
1963 Tuple<SourceElement.Row, int> enchant = Thing.GetEnchant(lv, (SourceElement.Row r) => r.IsEncAppliable(base.category), base.IsCursed);
1964 if (enchant == null)
1965 {
1966 return null;
1967 }
1968 return this.elements.ModBase(enchant.Item1.id, enchant.Item2);
1969 }
1970
1971 // Token: 0x0600215B RID: 8539 RVA: 0x000B8401 File Offset: 0x000B6601
1972 public void RemoveEnchant()
1973 {
1974 }
1975
1976 // Token: 0x0600215C RID: 8540 RVA: 0x000B8404 File Offset: 0x000B6604
1977 public Thing Identify(bool show = true, IDTSource idtSource = IDTSource.Identify)
1978 {
1979 if (base.IsIdentified)
1980 {
1981 return this;
1982 }
1983 string @ref = "";
1984 if (show)
1985 {
1986 @ref = this.GetName(NameStyle.Full, base.Num);
1987 }
1988 Rarity rarity = (idtSource == IDTSource.Skill) ? Rarity.Superior : ((idtSource == IDTSource.SkillHigh) ? Rarity.Legendary : Rarity.Normal);
1989 if (rarity != Rarity.Normal && ((base.IsEquipmentOrRanged && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
1990 {
1991 base.c_IDTState = 3;
1992 }
1993 else if (base.rarity >= Rarity.Mythical && idtSource != IDTSource.SuperiorIdentify)
1994 {
1995 base.c_IDTState = 1;
1996 }
1997 else
1998 {
1999 base.c_IDTState = 0;
2000 }
2001 if (show)
2002 {
2003 string name = this.GetName(NameStyle.Full, base.Num);
2004 if (base.c_IDTState == 0)
2005 {
2006 Msg.Say("identified", @ref, name, null, null);
2007 }
2008 else
2009 {
2010 Msg.Say((idtSource == IDTSource.Skill) ? "identified3" : "identified2", @ref, name, base.TextRarity, null);
2011 }
2012 }
2013 if (base.IsIdentified)
2014 {
2015 Card rootCard = base.GetRootCard();
2016 if (rootCard != null)
2017 {
2018 rootCard.TryStack(this);
2019 }
2020 }
2021 LayerInventory.SetDirty(this);
2022 return this;
2023 }
2024
2025 // Token: 0x0600215E RID: 8542 RVA: 0x000B84FB File Offset: 0x000B66FB
2026 [CompilerGenerated]
2027 private void <ApplyMaterial>g__SetBase|27_0(int ele, int a, ref Thing.<>c__DisplayClass27_0 A_3)
2028 {
2029 this.elements.SetBase(ele, a, 0);
2030 if (ele == 67)
2031 {
2032 A_3.dmgSet = true;
2033 }
2034 if (ele == 65)
2035 {
2036 A_3.pvSet = true;
2037 }
2038 if (ele == 66)
2039 {
2040 A_3.hitSet = true;
2041 }
2042 }
2043
2044 // Token: 0x04001121 RID: 4385
2045 public const int MaxFurnitureEnc = 12;
2046
2047 // Token: 0x04001122 RID: 4386
2048 public SourceThing.Row source;
2049
2050 // Token: 0x04001123 RID: 4387
2051 public int stackOrder;
2052
2053 // Token: 0x04001124 RID: 4388
2054 public string tempName;
2055}
Definition AIAct.cs:7
Definition Act.2.cs:7
Definition Card.cs:13
Definition Chara.cs:12
Definition Msg.cs:7
Definition Room.cs:6
Definition Thing.cs:10
Definition Trait.cs:9
Definition Zone.cs:14