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