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