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