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