13 public bool isEquipped
17 return base.c_equippedSlot != 0;
23 public bool IsMeleeWithAmmo
37 return this.source.range;
43 public int Penetration
47 if (this.source.substats.Length == 0)
51 return this.source.substats[0];
57 public override bool isThing
67 public override CardRow sourceCard
81 if (this.source.origin ==
null ||
this.source.pref.UsePref)
83 return this.source.pref;
85 return this.source.origin.pref;
91 public override int SelfWeight
97 return (base.isWeightChanged ? base.c_weight :
this.source.weight) * base.material.weight / 100;
99 if (!base.isWeightChanged)
101 return this.source.weight;
103 return base.c_weight;
109 public override int[] Tiles
113 return this.sourceCard._tiles;
118 public bool CanAutoFire(
Chara c,
Card tg,
bool reloading =
false)
120 if (base.GetRootCard() != c)
124 if (base.HasTag(CTAG.throwWeapon))
128 if (!this.trait.CanAutofire)
134 if ((c.IsPCFaction && c.body.IsTooHeavyToEquip(
this)) || reloading)
142 Element element = c.elements.GetElement(act.id);
143 if (act is
Spell && (element ==
null || element.vPotential == 0))
152 public int GetEfficiency()
154 return (
int)(50 + base.LV * 10 + base.encLV * 10 + base.rarity * (Rarity)10 + (int)(base.blessedState * (BlessedState)10));
158 public override void SetSource()
160 this.source =
EClass.sources.things.map.TryGetValue(this.
id,
null);
161 if (this.source !=
null && this.source.isOrigin)
164 this.id = this.source.id;
166 if (this.source ==
null)
168 Debug.LogWarning(
"Thing " + this.
id +
" not found");
170 this.source =
EClass.sources.things.map[this.id];
175 public override void OnCreate(
int genLv)
177 if (this.bp.blesstedState !=
null)
179 this.SetBlessedState(this.bp.blesstedState.GetValueOrDefault());
181 else if (base.category.ignoreBless == 0 &&
this.bp.rarity == Rarity.Random && base.rarity != Rarity.Artifact)
185 this.SetBlessedState(BlessedState.Blessed);
187 else if (
EClass.rnd(25) == 0)
189 this.SetBlessedState(BlessedState.Cursed);
191 else if (
EClass.rnd(50) == 0 && base.category.slot != 0)
193 this.SetBlessedState(BlessedState.Doomed);
196 if (!
EClass.debug.autoIdentify && (!
this.source.unknown_JP.IsEmpty() || (base.category.slot != 0 && base.rarity >= Rarity.Superior)))
201 if (
id ==
"bill_tax" ||
id ==
"bill")
203 base.c_bill = 100 +
EClass.rnd(100);
205 if (base.category.slot != 0)
208 if (base.rarity == Rarity.Superior)
212 else if (base.rarity == Rarity.Legendary)
216 else if (base.rarity == Rarity.Mythical)
220 else if (base.rarity >= Rarity.Artifact)
224 if (num > 0 && !base.HasTag(CTAG.godArtifact))
226 for (
int i = 0; i < num; i++)
228 this.AddEnchant(genLv);
232 if (base.IsRangedWeapon && !
this.IsMeleeWithAmmo)
234 if (base.HasTag(CTAG.godArtifact))
242 int num3 = (
EClass.rnd(10) == 0) ? 1 : 0;
243 if (base.rarity == Rarity.Superior)
247 else if (base.rarity == Rarity.Legendary)
249 num2 =
EClass.rnd(2) + 3 + num3;
251 else if (base.rarity == Rarity.Mythical)
253 num2 =
EClass.rnd(2) + 4 + num3;
255 else if (base.rarity >= Rarity.Artifact)
261 for (
int j = 0; j < num2; j++)
265 for (
int k = 0; k <
EClass.rnd(num2 + 1); k++)
268 if (enchant !=
null &&
InvOwnerMod.IsValidMod(
this, enchant.Item1))
270 base.ApplySocket(enchant.Item1.id, enchant.Item2,
null);
276 if ((this.bp.rarity != Rarity.Normal ||
this.bp.qualityBonus != 0) && base.rarity < Rarity.Artifact && base.category.tag.Contains(
"enc"))
281 if (this.bp.qualityBonus == 0)
284 if (num4 == 1 &&
EClass.rnd(3) != 0)
289 else if (this.bp.qualityBonus < 0)
296 else if (this.bp.qualityBonus >= 10)
298 num4 = Mathf.Min(this.bp.qualityBonus / 10 + 2, 7) +
EClass.rnd(
EClass.rnd(5) + 1);
303 base.SetEncLv(Mathf.Min(num4, 12));
306 if (base.HasTag(CTAG.randomSkin))
308 base.idSkin =
EClass.rnd(this.source.skins.Length + 1);
313 public override void ApplyMaterialElements(
bool remove)
316 if (
EClass.core.IsGameStarted &&
this.isEquipped)
318 Card rootCard = base.GetRootCard();
319 chara = ((rootCard !=
null) ? rootCard.Chara :
null);
322 this.elements.SetParent(
null);
325 this.elements.ApplyMaterialElementMap(
this,
remove);
328 this.elements.SetParent(chara);
333 public override void ApplyMaterial(
bool remove =
false)
335 Thing.<>c__DisplayClass27_0 CS$<>8__locals1;
336 CS$<>8__locals1.<>4__this =
this;
337 if (this.source.HasTag(CTAG.replica))
339 base.isReplica =
true;
343 this.ApplyMaterialElements(
true);
344 base.isAcidproof = (base.isFireproof =
false);
347 CS$<>8__locals1.pvSet =
false;
348 CS$<>8__locals1.dmgSet =
false;
349 CS$<>8__locals1.hitSet =
false;
350 if (this.sourceCard.quality == 4)
352 if (this.source.offense.Length != 0)
354 base.c_diceDim = this.source.offense[1];
356 if (this.source.offense.Length > 2)
358 this.<ApplyMaterial>g__SetBase|27_0(66, this.source.offense[2], ref CS$<>8__locals1);
360 if (this.source.offense.Length > 3)
362 this.<ApplyMaterial>g__SetBase|27_0(67, this.source.offense[3], ref CS$<>8__locals1);
364 if (this.source.defense.Length != 0)
366 this.<ApplyMaterial>g__SetBase|27_0(64, this.source.defense[0], ref CS$<>8__locals1);
368 if (this.source.defense.Length > 1)
370 this.<ApplyMaterial>g__SetBase|27_0(65, this.source.defense[1], ref CS$<>8__locals1);
376 bool flag = !base.IsAmmo;
377 if (base.rarity <= Rarity.Crude)
381 else if (base.rarity == Rarity.Superior)
385 else if (base.rarity >= Rarity.Legendary)
389 if (this.source.offense.Length != 0)
391 base.c_diceDim = this.source.offense[1] * base.material.dice / (num + (flag ?
EClass.rnd(25) : 0));
393 if (this.source.offense.Length > 2)
395 this.<ApplyMaterial>g__SetBase|27_0(66, this.source.offense[2] * base.material.atk * 9 / (num - (flag ?
EClass.rnd(30) : 0)), ref CS$<>8__locals1);
397 if (this.source.offense.Length > 3)
399 this.<ApplyMaterial>g__SetBase|27_0(67, this.source.offense[3] * base.material.dmg * 5 / (num - (flag ?
EClass.rnd(30) : 0)), ref CS$<>8__locals1);
401 if (this.source.defense.Length != 0)
403 this.<ApplyMaterial>g__SetBase|27_0(64, this.source.defense[0] * base.material.dv * 7 / (num - (flag ?
EClass.rnd(30) : 0)), ref CS$<>8__locals1);
405 if (this.source.defense.Length > 1)
407 this.<ApplyMaterial>g__SetBase|27_0(65, this.source.defense[1] * base.material.pv * 9 / (num - (flag ?
EClass.rnd(30) : 0)), ref CS$<>8__locals1);
412 if (this.source.offense.Length != 0)
414 base.c_diceDim = Mathf.Max(this.source.offense[1] / 3, 1);
416 if (this.source.offense.Length > 2)
418 this.<ApplyMaterial>g__SetBase|27_0(66, this.source.offense[2] / 3, ref CS$<>8__locals1);
420 if (this.source.offense.Length > 3)
422 this.<ApplyMaterial>g__SetBase|27_0(67, this.source.offense[3] / 3, ref CS$<>8__locals1);
424 if (this.source.defense.Length != 0)
426 this.<ApplyMaterial>g__SetBase|27_0(64, this.source.defense[0] / 3, ref CS$<>8__locals1);
428 if (this.source.defense.Length > 1)
430 this.<ApplyMaterial>g__SetBase|27_0(65, this.source.defense[1] / 3, ref CS$<>8__locals1);
433 if (base.IsEquipmentOrRanged || base.IsAmmo)
435 if (base.IsWeapon || base.IsAmmo)
437 if (CS$<>8__locals1.dmgSet)
439 this.elements.ModBase(67, base.encLV + ((base.blessedState == BlessedState.Blessed) ? 1 : 0));
442 else if (CS$<>8__locals1.pvSet)
444 this.elements.ModBase(65, (base.encLV + ((base.blessedState == BlessedState.Blessed) ? 1 : 0)) * 2);
447 if (this.sockets !=
null)
449 for (
int i = 0; i < this.sockets.Count; i++)
451 int num2 = this.sockets[i];
452 int num3 = num2 / 100;
453 if (num3 == 67 & CS$<>8__locals1.dmgSet)
455 this.elements.ModBase(67, num2 % 100);
457 if (num3 == 66 & CS$<>8__locals1.hitSet)
459 this.elements.ModBase(66, num2 % 100);
461 if (num3 == 65 & CS$<>8__locals1.pvSet)
463 this.elements.ModBase(65, num2 % 100);
467 if (base.material ==
null || base.material.elements ==
null)
469 string[] array =
new string[5];
470 array[0] = base.idMaterial.ToString();
474 array[num4] = ((material !=
null) ? material.name :
null);
478 int[] array2 = (material2 !=
null) ? material2.elements :
null;
479 array[num5] = ((array2 !=
null) ? array2.ToString() :
null);
480 Debug.Log(
string.Concat(array));
482 this.ApplyMaterialElements(
false);
483 foreach (
string a
in base.material.bits)
489 base.isAcidproof =
true;
494 base.isFireproof =
true;
497 if (base.rarity >= Rarity.Artifact)
499 base.isAcidproof = (base.isFireproof =
true);
505 public override string GetName(NameStyle style,
int _num = -1)
507 int num = (_num == -1) ? base.Num : _num;
514 string text5 = this.source.GetText(
"unit",
false);
515 ArticleStyle style2 = (style == NameStyle.FullNoArticle) ? ArticleStyle.None : ArticleStyle.Default;
516 bool flag = base.IsIdentified || this.source.unknown.IsEmpty();
517 bool isEquipmentOrRanged = base.IsEquipmentOrRanged;
518 bool flag2 = Lang.setting.nameStyle == 0;
521 if (base.c_idRefCard.IsEmpty() && !base.c_altName.IsEmpty())
523 text = base.c_altName;
527 string[] array = this.trait.GetName().Split(
',', StringSplitOptions.None);
529 if (array.Length > 1)
538 if (isEquipmentOrRanged && base.IsIdentified && base.rarity >= Rarity.Legendary)
540 if (base.rarity != Rarity.Artifact && !base.material.GetTextArray(
"altName").IsEmpty())
542 text = base.material.GetTextArray(
"altName")[0] + Lang.space + text;
547 if (this.source.naming ==
"m" || (
this.source.naming ==
"ms" && base.material !=
this.source.DefaultMaterial))
549 if (isEquipmentOrRanged)
551 string[] textArray = base.material.GetTextArray(
"altName");
552 if (textArray !=
null && textArray.Length >= 2)
554 text = base.material.GetTextArray(
"altName")[1] + Lang.space + text;
558 text =
"_of2".lang(base.material.GetName(), text,
null,
null,
null);
561 if (this.source.naming ==
"ma")
563 text = base.material.GetName();
565 if (base.qualityTier > 0)
567 text = Lang.GetList(
"quality_general")[Mathf.Clamp(base.qualityTier, 0, 3)] + text;
574 string idUnknown = this.source.GetText(
"unknown",
false);
575 if (idUnknown.StartsWith(
"#"))
577 Rand.UseSeed(
EClass.game.seed + (
this.trait.CanStack ?
this.sourceCard._index : base.uid) + base.refVal, delegate
579 idUnknown = Lang.GetList(idUnknown.Remove(0, 1)).RandomItem<string>();
584 if (!base.c_idRefCard.IsEmpty() &&
this.trait.RefCardName != RefCardName.None)
586 string text6 = base.c_altName.IsEmpty(
EClass.sources.cards.map[base.c_idRefCard].GetName());
587 if (!base.c_idRefCard2.IsEmpty())
589 text6 =
"_and".lang(text6, base.c_altName2.IsEmpty(
EClass.sources.cards.map[base.c_idRefCard2].GetName()),
null,
null,
null);
593 string text7 =
EClass.sources.cards.map[base.c_idRefCard].GetText(
"aka",
false);
594 if (!text7.IsEmpty())
596 text =
"_of".lang(text7, text,
null,
null,
null);
599 else if (!this.source.name2.IsEmpty())
601 text = this.source.GetTextArray(
"name2")[0].Replace(
"#1", text6);
603 else if (this.source.naming.Contains(
"last"))
605 text = text + Lang.space + text6;
607 else if (this.source.naming.Contains(
"first"))
609 text = text6 + Lang.space + text;
611 else if (this.source.naming.Contains(
"of"))
613 text =
"_of".lang(text6, text,
null,
null,
null);
617 text = (text5.IsEmpty() ?
"_of3" :
"_of2").lang(text6, text,
null,
null,
null);
620 if (base.c_bill != 0)
622 text =
"_of".lang(Lang._currency(base.c_bill,
true, 0), text,
null,
null,
null);
624 this.trait.SetName(ref text);
625 if (style == NameStyle.Simple)
629 if (style == NameStyle.Ref)
633 if (!base.c_refText.IsEmpty())
635 text =
"_named".lang(base.c_refText, text,
null,
null,
null);
637 if (base.IsIdentified)
641 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hit != 0 || dmg != 0) &&
this.source.offense.Length != 0)
644 if (this.source.offense[0] != 0)
646 text8 = text8 + this.source.offense[0].ToString() +
"d" + base.c_diceDim.ToString();
650 text8 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dmg.ToText(
true) : (dmg.ToString() ??
""));
654 text8 = text8 + ((dmg != 0 || this.source.offense[0] != 0) ?
", " :
"") + hit.ToString();
656 text2 = text2 +
" (" + text8.IsEmpty(
" - ") +
") ";
660 if (dv != 0 || pv != 0)
663 text2 = text2 + dv.ToString() +
", " + pv.ToString();
666 if (this.trait.HasCharges &&
this.trait.ShowCharges)
668 text2 = text2 +
" " +
"itemCharges".lang(base.c_charges.ToString() ??
"",
null,
null,
null,
null);
671 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
673 text2 =
"(" + base.TextRarity.ToTitleCase(
false) +
")";
677 text =
"rotten".lang() + text;
679 else if (base.IsRotting)
681 text =
"rotting".lang() + text;
683 if (base.IsIdentified)
685 if (base.blessedState != BlessedState.Normal)
687 str = (
"bs" + base.blessedState.ToString()).lang();
689 Rarity rarity = base.rarity;
690 if (rarity - Rarity.Legendary > 1)
692 if (rarity == Rarity.Artifact)
694 style2 = ArticleStyle.None;
696 text = (isEquipmentOrRanged ? text.Bracket(3) : text);
701 style2 = ArticleStyle.The;
703 if (isEquipmentOrRanged)
705 Rand.UseSeed(base.uid +
EClass.game.seed, delegate
707 sig = AliasGen.GetRandomAlias().Bracket((this.rarity == Rarity.Mythical) ? 3 : 2);
709 sig = Lang.space + sig;
715 if (base.category.tag.Contains(
"enc"))
717 if (base.c_altName.IsEmpty())
719 string[] list = Lang.GetList(
"quality_furniture");
720 text =
"_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text,
null,
null,
null);
725 sig = sig + Lang.space + ((base.encLV > 0) ? (
"+" + base.encLV.ToString()) : (base.encLV.ToString() ??
""));
728 if (base.c_lockLv != 0 && base.c_revealLock)
730 sig = sig + Lang.space +
"+" + base.c_lockLv.ToString();
732 if (base.isLostProperty)
734 text =
"_lostproperty".lang(text,
null,
null,
null,
null);
738 text4 +=
"equippedItem".lang();
740 if (!base.c_note.IsEmpty() && (!base.isBackerContent ||
EClass.core.config.backer.Show(base.c_note)))
742 string text9 = base.c_note;
743 if (text9.StartsWith(
'@'))
745 LangNote.Row row = Lang.Note.map.TryGetValue(text9.TrimStart(
'@'),
null);
746 text9 = (((row !=
null) ? row.GetText(
"text",
false) :
null) ?? base.c_note);
748 string text10 = base.category.IsChildOf(
"book") ?
"_written" :
"_engraved";
749 if (this.
id ==
"grave_dagger1" || this.
id ==
"grave_dagger2")
751 text10 =
"_daggerGrave";
753 if (text9.Contains(
"_bracketLeft".lang()))
755 text = (text10 +
"Alt").lang(text9, text,
null,
null,
null);
759 text = text10.lang(text9, text,
null,
null,
null);
766 text =
"_unit".lang(num.ToFormat() ??
"", str + text, text5,
null,
null);
775 text = text.ToTitleCase(
true);
777 else if (text5.IsEmpty() || (!base.IsIdentified && !
this.source.unknown.IsEmpty()))
779 text = (str + text).AddArticle(num, style2, this.source.name);
783 text =
"_unit".lang((num == 1) ?
"" : (num.ToFormat() ??
""), text, (str + text5).AddArticle(num, style2,
this.source.unit),
null,
null);
785 if (base.rarity >= Rarity.Legendary)
787 text = text.ToTitleCase(
true);
789 string text11 = (base.isSale && this.things.Count > 0) ?
"forSale2".lang() : ((base.isSale || (base.parentThing !=
null && base.parentThing.isSale &&
TraitSalesTag.CanTagSale(
this,
true))) ?
"forSale".lang(Lang._currency(
this.GetPrice(CurrencyType.Money,
true, PriceType.PlayerShop,
null),
"money"),
null,
null,
null,
null) :
"");
790 if (this.trait is
TraitSalesTag && base.isOn && !base.GetStr(11,
null).IsEmpty())
792 text11 +=
"soldOut".lang(
EClass.sources.categories.map[base.GetStr(11,
null)].GetName(),
null,
null,
null,
null);
794 if (base.GetInt(101,
null) != 0)
796 text4 =
"_limitedStock".lang(text4,
null,
null,
null,
null);
798 return string.Concat(
new string[]
810 public override string GetHoverText()
813 text = text +
" <size=14>(" + Lang._weight(base.ChildrenAndSelfWeight,
true, 0) +
")</size> ";
814 if (
EClass.debug.showExtra)
816 text += Environment.NewLine;
817 string[] array =
new string[15];
822 array[4] = this.source.idRenderData;
825 object obj = (this.source.tiles.Length != 0) ? this.source.tiles[0] :
"-";
826 array[num] = ((obj !=
null) ? obj.ToString() :
null);
828 array[8] = base.Num.ToString();
830 array[10] = base.LV.ToString();
832 array[12] = base.encLV.ToString();
834 array[14] = base.material.alias;
835 text =
string.Concat(array);
837 string hoverText = this.trait.GetHoverText();
838 if (!hoverText.IsEmpty())
840 text = text + Environment.NewLine + hoverText;
842 return base.GetHoverText() + text;
846 public override string GetExtraName()
849 if (this.trait.ShowChildrenNumber && base.c_lockLv == 0)
851 if (this.things.Count > 0)
853 text +=
"childCount".lang(this.things.Count.ToString() ??
"",
null,
null,
null,
null);
855 else if (this.trait.CanOpenContainer)
857 text +=
"empty".lang();
862 Room room = this.pos.cell.room;
863 if (
EClass.debug.enable && room !=
null && room.data.group != 0)
865 text = text +
" #" + room.data.group.ToString();
872 public List<Element> ListLimitedValidTraits(
bool limit)
874 List<Element> list =
new List<Element>();
875 if (base.ShowFoodEnc)
877 foreach (
Element element
in this.elements.dict.Values)
879 if (element.IsFoodTraitMain && element.Value > 0)
885 if (limit && list.Count > 5)
887 int num = list.Count - 5;
888 for (
int i = 0; i < num; i++)
890 list.RemoveAt(list.Count - 1);
898 public List<Element> ListValidTraits(
bool isCraft,
bool limit)
900 List<Element> list = this.ListLimitedValidTraits(limit);
901 bool showFoodEnc = base.ShowFoodEnc;
902 bool flag =
EClass.pc.HasElement(1650, 1);
905 foreach (
Element element
in this.elements.dict.Values)
907 if (element.IsFoodTrait && !list.Contains(element) && (isCraft || flag || element.IsFoodTraitMain) && (!element.IsFoodTraitMain || element.Value < 0))
913 foreach (
Element element2
in this.elements.dict.Values)
915 if ((isCraft || flag || ((!element2.IsFoodTrait || element2.IsFoodTraitMain) && (!showFoodEnc || !element2.IsTrait || element2.Value >= 0))) && !list.Contains(element2) && (element2.IsTrait || (element2.IsFoodTrait && !element2.IsFoodTraitMain)))
924 public override void WriteNote(UINote n, Action<UINote> onWriteNote =
null,
IInspect.NoteMode mode =
IInspect.NoteMode.Default,
Recipe recipe =
null)
928 bool showEQStats = base.IsEquipmentOrRanged || base.IsAmmo;
929 bool flag = mode ==
IInspect.NoteMode.Product;
930 bool flag2 = base.IsIdentified || flag;
931 string text = base.Name;
932 if (base.rarity == Rarity.Legendary || base.rarity == Rarity.Mythical)
934 string text2 = text.Contains(
"『") ?
"『" : (text.Contains(
"《") ?
"《" :
"");
937 string[] array = text.Split(text2, StringSplitOptions.None);
938 text = array[0] + Environment.NewLine + text2 + array[1];
943 text = recipe.GetName();
945 if (mode !=
IInspect.NoteMode.Recipe)
947 UIItem uiitem = i.AddHeaderCard(text,
null);
948 this.SetImage(uiitem.image2);
949 uiitem.image2.Rect().pivot =
new Vector2(0.5f, 0.5f);
950 string text3 = base.Num.ToFormat() ??
"";
951 string text4 = (Mathf.Ceil(0.01f * (
float)base.ChildrenAndSelfWeight) * 0.1f).ToString(
"F1") +
"s";
952 if (this.things.Count > 0)
954 text3 = text3 +
" (" + this.things.Count.ToString() +
")";
956 if (base.ChildrenAndSelfWeight !=
this.SelfWeight)
958 text4 = text4 +
" (" + (Mathf.Ceil(0.01f * (
float)this.SelfWeight) * 0.1f).ToString(
"F1") +
"s)";
960 text =
"_quantity".lang(text3 ??
"", text4,
null,
null,
null);
961 if (flag && recipe !=
null &&
LayerCraft.Instance)
963 text = text +
" " +
"_recipe_lv".lang(recipe.RecipeLv.ToString() ??
"",
null,
null,
null,
null);
965 uiitem.text2.SetText(text);
966 if (showEQStats && flag2)
971 if (this.DV != 0 || this.PV != 0 || base.HIT != 0 || base.DMG != 0 ||
this.Penetration != 0)
975 text =
string.Concat(
new string[]
979 (base.DMG > 0) ?
"+" :
"",
986 text =
string.Concat(
new string[]
990 (base.HIT > 0) ?
"+" :
"",
997 text =
string.Concat(
new string[]
1001 (this.DV > 0) ?
"+" :
"",
1008 text =
string.Concat(
new string[]
1012 (this.PV > 0) ?
"+" :
"",
1017 if (this.Penetration != 0)
1019 text =
string.Concat(
new string[]
1023 (this.Penetration > 0) ?
"+" :
"",
1024 this.Penetration.ToString(),
1028 text = text.TrimEnd(
' ').TrimEnd(
',');
1030 if (!text.IsEmpty())
1032 i.AddText(
"NoteText_eqstats", text, FontColor.DontChange);
1036 if (traitToolRange !=
null)
1038 i.AddText(
"NoteText_eqstats",
"tip_range".lang(traitToolRange.BestDist.ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
1044 if (
EClass.debug.showExtra)
1046 int totalQuality = base.GetTotalQuality(
true);
1047 int totalQuality2 = base.GetTotalQuality(
false);
1048 text5 = text5 +
"_quality".lang(base.GetTotalQuality(
true).ToString() ??
"",
null,
null,
null,
null) + ((totalQuality == totalQuality2) ?
"" : (
" (" + totalQuality2.ToString() +
")"));
1050 if (base.HasElement(10, 1))
1052 text5 = text5 + (text5.IsEmpty() ?
"" :
" ") +
"_nutrition".lang(base.Evalue(10).ToString() ??
"",
null,
null,
null,
null);
1054 if ((base.category.IsChildOf(
"resource") ||
this.trait.IsTool) && !(
this.trait is
TraitAbility))
1056 text5 = text5 + (text5.IsEmpty() ?
"" :
" ") +
"_hardness".lang(base.material.hardness.ToString() ??
"",
null,
null,
null,
null);
1058 if (flag && recipe !=
null &&
LayerCraft.Instance)
1060 text5 = text5 + (text5.IsEmpty() ?
"" :
" ") +
"_max_quality".lang(recipe.GetQualityBonus().ToString() ??
"",
null,
null,
null,
null);
1062 if (!text5.IsEmpty())
1064 i.AddText(
"NoteText_eqstats", text5, FontColor.DontChange);
1067 string detail = this.GetDetail();
1068 if (!detail.IsEmpty())
1070 LayoutElement component = i.AddText(
"NoteText_flavor", detail, FontColor.DontChange).GetComponent<LayoutElement>();
1073 component.preferredWidth = 400f;
1081 i.AddText(
"NoteText_flavor", traitBookPlan.source.GetDetail(), FontColor.DontChange);
1084 if (traitAbility !=
null)
1087 Act act = traitAbility.CreateAct();
1088 Element orCreateElement =
EClass.pc.elements.GetOrCreateElement(act.source.id);
1089 orCreateElement._WriteNote(i,
EClass.pc.elements,
null,
false,
false);
1090 orCreateElement._WriteNote(i,
EClass.pc, act);
1093 if (
EClass.debug.showExtra)
1095 string[] array2 =
new string[8];
1097 array2[1] = this.id;
1098 array2[2] =
" tile:";
1100 string text6 = this.source.tiles.IsEmpty() ?
"-" : this.source.tiles[0];
1101 array2[num] = ((text6 !=
null) ? text6.ToString() :
null);
1102 array2[4] =
") lv:";
1103 array2[5] = base.LV.ToString();
1104 array2[6] =
" price:";
1105 array2[7] = this.GetPrice(CurrencyType.Money,
false, PriceType.Default,
null).ToString();
1106 i.AddText(
string.Concat(array2), FontColor.DontChange);
1108 Card rootCard = base.GetRootCard();
1109 if (rootCard !=
null && rootCard !=
EClass.pc && rootCard !=
this && rootCard.ExistsOnMap)
1114 i.AddText(
"isChildOf".lang(base.GetRootCard().Name,
null,
null,
null,
null), FontColor.ItemName);
1119 i.AddText(
"isMadeOf".lang(base.material.GetText(
"name",
false), base.material.hardness.ToString() ??
"",
null,
null,
null), FontColor.DontChange);
1121 i.AddText(
"isCategorized".lang(base.category.GetText(
"name",
false),
null,
null,
null,
null), FontColor.DontChange);
1122 if (base.category.skill != 0)
1124 int key = base.category.skill;
1126 if (base.IsRangedWeapon)
1134 if (base.Evalue(482) > 0)
1139 i.AddText(
"isUseSkill".lang(
EClass.sources.elements.map[key].GetName().ToTitleCase(
true),
EClass.sources.elements.map[key2].GetName().ToTitleCase(
true),
null,
null,
null), FontColor.DontChange);
1141 if (base.IsContainer)
1143 i.AddText(
"isContainer".lang(this.things.MaxCapacity.ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
1145 if (base.c_lockLv != 0)
1147 i.AddText((base.c_lockedHard ?
"isLockedHard" :
"isLocked").lang(base.c_lockLv.ToString() ??
"",
null,
null,
null,
null), FontColor.Warning);
1149 if (base.isCrafted && recipe ==
null)
1151 i.AddText(
"isCrafted".lang(), FontColor.DontChange);
1153 if (this.trait.Decay > 0)
1160 else if (base.IsRotting)
1164 else if (base.IsFresn)
1172 i.AddText(s2.lang(), FontColor.DontChange);
1176 i.AddText(
"isDyed".lang(), FontColor.DontChange);
1178 if (base.IsEquipment)
1180 text =
"isEquipable".lang(
Element.Get(base.category.slot).GetText(
"name",
false),
null,
null,
null,
null);
1181 i.AddText(text, FontColor.DontChange);
1183 if (base.isFireproof)
1185 i.AddText(
"isFreproof", FontColor.DontChange);
1187 if (base.isAcidproof)
1189 i.AddText(
"isAcidproof", FontColor.DontChange);
1191 if (this.trait.Electricity > 0)
1193 i.AddText(
"isGenerateElectricity".lang(this.trait.Electricity.ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
1195 if (this.trait.Electricity < 0)
1197 i.AddText(
"isConsumeElectricity".lang(Mathf.Abs(
this.trait.Electricity).ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
1201 i.AddText(
"isPrecious", FontColor.DontChange);
1205 i.AddText(
"isCopy", FontColor.DontChange);
1207 if (!this.trait.CanBeDestroyed)
1209 i.AddText(
"isIndestructable", FontColor.DontChange);
1211 if (base.GetInt(107,
null) > 0)
1213 i.AddText(
"isLicked", FontColor.DontChange);
1215 if (!base.c_idDeity.IsEmpty())
1218 i.AddText(
"isDeity".lang(religion.Name,
null,
null,
null,
null), FontColor.Myth);
1220 if (base.isGifted && base.GetRoot() !=
EClass.pc)
1222 i.AddText(
"isGifted", FontColor.Ether);
1224 if (base.isNPCProperty)
1226 i.AddText(
"isNPCProperty", FontColor.Ether);
1228 if (base.c_priceFix != 0)
1230 i.AddText(((base.c_priceFix > 0) ?
"isPriceUp" :
"isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ??
"",
null,
null,
null,
null), FontColor.Ether);
1234 i.AddText(
"isNoSell", FontColor.Ether);
1238 i.AddText(
"isStolen", FontColor.Ether);
1240 if (base.c_isImportant)
1242 i.AddText(
"isMarkedImportant", FontColor.Ether);
1244 if (base.GetInt(25,
null) != 0)
1246 i.AddText(
"isDangerLv".lang(base.GetInt(25,
null).ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
1250 FontColor color = FontColor.Util;
1251 if (base.HasElement(220, 1))
1253 i.AddText(
"canMine".lang(), color);
1255 if (base.HasElement(225, 1))
1257 i.AddText(
"canLumberjack".lang(), color);
1258 i.AddText(
"canLumberjack2".lang(), color);
1260 if (base.HasElement(230, 1))
1262 i.AddText(
"canDig", color);
1264 if (base.HasElement(286, 1))
1266 i.AddText(
"canFarm", color);
1268 if (base.HasElement(245, 1))
1270 i.AddText(
"canFish", color);
1272 if (base.HasElement(237, 1))
1274 i.AddText(
"canTame", color);
1277 if (Lang.Has(
"hint_" +
this.trait.ToString()))
1279 i.AddText(
"hint_" + this.trait.ToString(), FontColor.Util);
1281 if (Lang.Has(
"hint_" +
this.trait.ToString() +
"2"))
1283 i.AddText(
"hint_" + this.trait.ToString() +
"2", FontColor.Util);
1285 if (base.HasTag(CTAG.tourism))
1287 i.AddText(
"isTourism", FontColor.Util);
1289 string langPlaceType = base.TileType.LangPlaceType;
1290 if (langPlaceType ==
"place_Door" || langPlaceType ==
"place_WallMount")
1292 i.AddText(base.TileType.LangPlaceType +
"_hint".lang(), FontColor.Util);
1294 if (this.trait.IsHomeItem)
1296 i.AddText(
"isHomeItem".lang(), FontColor.Util);
1298 if (base.HasTag(CTAG.throwWeapon))
1300 i.AddText(
"isThrowWeapon", FontColor.DontChange);
1302 if (
EClass.debug.showExtra && base.HasTag(CTAG.throwWeaponEnemy))
1304 i.AddText(
"isThrowWeaponEnemy", FontColor.DontChange);
1306 if (base.HasElement(10, 1))
1308 i.AddText(
"isEdible", FontColor.DontChange);
1310 if (base.HasTag(CTAG.rareResource))
1312 i.AddText(
"isRareResource", FontColor.Great);
1315 if (traitBed !=
null)
1317 i.AddText(
"isBed".lang(traitBed.MaxHolders.ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
1319 bool flag3 = base.IsEquipmentOrRanged || base.IsAmmo || base.IsThrownWeapon;
1324 Element element = this.elements.GetElement(653);
1325 if (element !=
null)
1327 i.AddText(
"isAlive".lang(element.vBase.ToString() ??
"", (element.vExp / 10).ToString() ??
"", (element.ExpToNext / 10).ToString() ??
"",
null,
null), FontColor.Great);
1329 string[] rangedSubCats =
new string[]
1334 this.elements.AddNote(i, (
Element e) => (!(this.trait is
TraitToolRange) || this.category.slot != 0 || e is
Ability || rangedSubCats.Contains(e.source.categorySub) || e.HasTag(
"modRanged")) && !e.IsTrait && (!(e.source.categorySub ==
"eleAttack") ||
this.IsWeapon ||
this.IsRangedWeapon ||
this.IsAmmo ||
this.IsThrownWeapon) && (!showEQStats || (e.id != 64 && e.id != 65 && e.id != 66 && e.id != 67)),
null,
ElementContainer.NoteMode.Default,
false,
null,
null);
1336 if (this.sockets ==
null)
1340 using (List<int>.Enumerator enumerator = this.sockets.GetEnumerator())
1342 while (enumerator.MoveNext())
1344 int num2 = enumerator.Current;
1345 i.AddText((num2 == 0) ?
"emptySocket".lang() :
"socket".lang(
EClass.sources.elements.map[num2 / 100].GetName(), (num2 % 100).ToString() ??
"",
null,
null,
null), FontColor.Gray);
1350 i.AddText(
"isUnidentified".lang(), FontColor.Flavor);
1351 if (base.c_IDTState == 1)
1353 i.AddText(
"isUnidentified2".lang(), FontColor.Flavor);
1356 this.trait.WriteNote(i, flag2);
1357 if (flag2 && !flag3)
1359 bool infoMode = mode ==
IInspect.NoteMode.Info;
1360 List<Element> list = this.ListValidTraits(
false, !infoMode);
1361 List<Element> list2 = this.ListValidTraits(
false,
false);
1362 if (list2.Count - list.Count <= 1)
1369 string text9 = e.source.GetText(
"textExtra",
false);
1370 if (!text9.IsEmpty())
1373 if (e.id == 2 && mode ==
IInspect.NoteMode.Product)
1375 int num3 = recipe.GetQualityBonus() / 10;
1380 text10 =
"qualityLimit".lang(num3.ToString() ??
"",
null,
null,
null,
null);
1382 int num4 = e.Value / 10;
1387 text9 =
string.Concat(
new string[]
1395 if (infoMode && e.IsFoodTraitMain)
1397 text9 +=
"traitAdditive".lang();
1399 text8 += (
" <size=12>" + text9 +
"</size>").TagColor(FontColor.Passive,
null);
1402 }, delegate(UINote n,
Element e)
1405 if (base.ShowFoodEnc &&
EClass.pc.HasElement(1650, 1))
1409 i.AddText(
"foodHuman".lang(), FontColor.Ether);
1413 i.AddText(
"foodUndead".lang(), FontColor.Ether);
1416 if (list.Count != list2.Count)
1418 i.AddText(
"traitOther".lang((list2.Count - list.Count).ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
1421 if (
EClass.debug.showExtra)
1423 i.AddText(
"decay:" + base.decay.ToString(), FontColor.DontChange);
1425 if (this.
id ==
"statue_weird")
1427 i.AddText(
"weirdStatue", FontColor.DontChange);
1431 i.AddText(
"isReplica", FontColor.Passive);
1436 Card parentCard = base.parentCard;
1441 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara !=
null)
1443 Thing.AddAttackEvaluation(i, chara,
this);
1445 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1447 i.AddHeader(
"headerAttackEval",
null);
1448 AttackProcess.Current.Prepare(chara ??
EClass.pc,
this,
null,
null, 0, base.IsThrownWeapon);
1450 text7 = text7.TagColor(() =>
true,
null);
1451 i.AddText(text7, FontColor.DontChange);
1454 if (base.ammoData !=
null)
1456 i.AddHeader(
"headerAttackAmmo",
null);
1457 i.AddText(base.ammoData.Name, FontColor.DontChange);
1459 if (onWriteNote !=
null)
1463 if (
EClass.debug.showExtra)
1465 foreach (
Element element2
in this.elements.dict.Values)
1467 i.AddText(
string.Concat(
new string[]
1469 element2.source.alias,
1471 element2.Value.ToString(),
1473 element2.vBase.ToString(),
1475 element2.vSource.ToString()
1476 }), FontColor.DontChange);
1483 public static void AddAttackEvaluation(UINote n,
Chara chara,
Thing current =
null)
1485 n.AddHeader(
"headerAttackEval",
null);
1487 foreach (
BodySlot bodySlot
in chara.body.slots)
1489 if (bodySlot.thing !=
null && bodySlot.elementId == 35 && bodySlot.thing.source.offense.Length >= 2)
1491 AttackProcess.Current.Prepare(chara, bodySlot.thing,
null,
null, num,
false);
1493 if (bodySlot.thing == current)
1495 text = text.TagColor(() =>
true,
null);
1497 n.AddText(text, FontColor.DontChange);
1501 AttackProcess.Current.Prepare(chara,
null,
null,
null, 0,
false);
1505 text2 = text2.TagColor(() =>
true,
null);
1507 n.AddText(text2, FontColor.DontChange);
1511 public override void SetRenderParam(
RenderParam p)
1513 p.matColor = (float)base.colorInt;
1514 p.mat = base.material;
1515 if (!this.renderer.usePass)
1519 switch (this.trait.tileMode)
1521 case Trait.TileMode.Default:
1522 if (this.source._altTiles.Length != 0 &&
this.trait.UseAltTiles)
1524 p.tile = (float)(this.source._altTiles[base.dir %
this.source._altTiles.Length] * (
this.flipX ? -1 : 1));
1528 p.tile = (float)(this.sourceCard._tiles[base.dir %
this.sourceCard._tiles.Length] * (
this.flipX ? -1 : 1));
1530 if (this.source.anime.Length != 0 &&
this.trait.IsAnimeOn)
1532 if (this.source.anime.Length > 2)
1534 float num = Time.realtimeSinceStartup * 1000f / (float)this.source.anime[1] % (
float)this.source.anime[2];
1535 if ((
int)num == this.source.anime[0] - 1 &&
this.source.anime.Length > 3)
1537 base.PlaySound(
"anime_sound" + this.source.anime[3].ToString(), 1f,
true);
1539 if (num < (
float)this.source.anime[0])
1541 p.tile += num * (float)(this.flipX ? -1 : 1);
1546 float num2 = Time.realtimeSinceStartup * 1000f / (float)this.source.anime[1] % (
float)this.source.anime[0];
1547 p.tile += num2 * (float)(this.flipX ? -1 : 1);
1551 case Trait.TileMode.Door:
1553 if (this.source._altTiles.Length != 0 &&
this.trait.UseAltTiles)
1555 p.tile = (float)(this.source._altTiles[base.dir %
this.source._altTiles.Length] * (
this.flipX ? -1 : 1));
1559 p.tile = (float)(this.sourceCard._tiles[base.dir %
this.sourceCard._tiles.Length] * (
this.flipX ? -1 : 1));
1561 if (this.parent is
Zone && this.pos.cell.HasFullBlock)
1563 p.tile += (float)((p.tile < 0f) ? -64 : 64);
1566 if (traitDoorSwing !=
null && traitDoorSwing.IsOpen())
1568 p.tile += (float)((p.tile < 0f) ? -1 : 1);
1572 case Trait.TileMode.Illumination:
1573 if (base.isOn || base.isRoofItem)
1575 int num3 = (int)((
float)base.uid + Time.realtimeSinceStartup * 5f);
1576 int num4 = (int)(Time.realtimeSinceStartup * 5f);
1577 p.tile = (float)((this.sourceCard._tiles[base.dir %
this.sourceCard._tiles.Length] + num3 % 3 + 1) * (
this.flipX ? -1 : 1));
1582 else if (num4 % 11 == 0)
1588 p.color = 13107200f;
1593 p.tile = (float)(this.sourceCard._tiles[base.dir %
this.sourceCard._tiles.Length] * (
this.flipX ? -1 : 1));
1596 case Trait.TileMode.DefaultNoAnime:
1597 if (this.source._altTiles.Length != 0 &&
this.trait.UseAltTiles)
1599 p.tile = (float)(this.source._altTiles[base.dir %
this.source._altTiles.Length] * (
this.flipX ? -1 : 1));
1603 p.tile = (float)(this.sourceCard._tiles[base.dir %
this.sourceCard._tiles.Length] * (
this.flipX ? -1 : 1));
1607 if (base.idSkin != 0)
1609 int num5 = base.idSkin - 1;
1610 if (this.sourceCard.skins.Length != 0)
1612 p.tile += (float)((p.tile < 0f) ? (-(
float)
this.sourceCard.skins[num5]) :
this.sourceCard.skins[num5]);
1621 if ((this.trait.ShowAsTool && (chara !=
EClass.pc || !
HotItemHeld.disableTool)) || (((chara !=
null) ? chara.held :
null) !=
this && (
this.placeState == PlaceState.installed || !
this.renderer.data.subCrate.enable || !(
this.parent is
Zone))))
1625 if (!this.renderer.data.subCrate.enable)
1627 return EClass.setting.pass.subCrate;
1629 return this.renderer.data.subCrate;
1633 public override bool CanStackTo(
Thing to)
1635 if (this.trait.HasCharges || to.isEquipped || base.isModified || to.isModified || to.id !=
this.id || to.idMaterial != base.idMaterial || to.refVal != base.refVal || to.blessedState != base.blessedState || to.rarityLv != base.rarityLv || to.qualityTier != base.qualityTier || to.idSkin != base.idSkin || to.isGifted != base.isGifted)
1639 if ((to.isDyed || base.isDyed) && to.c_dyeMat != base.c_dyeMat)
1643 if (base.c_idRefCard != to.c_idRefCard || base.c_idRefCard2 != to.c_idRefCard2)
1647 if (base.IsDecayed != to.IsDecayed)
1651 if (!this.trait.CanStackTo(to))
1655 if (base.noSell != to.noSell || base.isCopy != to.isCopy)
1659 if (base.isStolen != to.isStolen)
1663 if ((to.isWeightChanged || base.isWeightChanged) && to.SelfWeight !=
this.SelfWeight)
1667 if (to.c_IDTState != base.c_IDTState)
1671 if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix)
1675 if (to.ChildrenAndSelfWeight + base.ChildrenAndSelfWeight > 1000000000)
1680 if (to.parent is
Card)
1682 Window.SaveData windowSaveData = (to.parent as
Card).GetWindowSaveData();
1683 if (windowSaveData !=
null && windowSaveData.compress)
1690 if (base.encLV != to.encLV && !base.IsFood)
1694 if (this.elements.dict.Count<KeyValuePair<int, Element>>() != to.elements.dict.Count<KeyValuePair<int, Element>>())
1698 foreach (
Element element
in this.elements.dict.Values)
1700 if (to.elements.GetElement(element.id) ==
null)
1705 base.encLV = (to.encLV = Mathf.CeilToInt(1f * (
float)(base.encLV * base.Num + to.encLV * to.Num) / (
float)(base.Num + to.Num)));
1706 foreach (
Element element2
in this.elements.dict.Values)
1708 Element element3 = to.elements.GetElement(element2.id);
1709 element2.vBase = (element3.vBase = (element2.vBase * base.Num + element3.vBase * to.Num) / (base.Num + to.Num));
1715 if (base.encLV != to.encLV)
1719 if (this.elements.dict.Count<KeyValuePair<int, Element>>() != to.elements.dict.Count<KeyValuePair<int, Element>>())
1723 foreach (
Element element4
in this.elements.dict.Values)
1725 Element element5 = to.elements.GetElement(element4.id);
1726 if (element5 ==
null || element4.vBase / 10 * 10 != element5.vBase / 10 * 10)
1740 if (ing.CanSetThing(
this))
1744 if (this.things.Count > 0 && base.c_lockLv == 0 && !base.isNPCProperty)
1746 foreach (
Thing thing
in this.things)
1748 thing.GetIngredients(ing, list);
1756 return !this.isDestroyed && base.GetRootCard().Dist(
EClass.pc) <= 1 && ing.CanSetThing(
this);
1760 public void GetRecipes(HashSet<Recipe> recipes)
1765 public void GetDisassembles(List<Thing> list)
1770 public void Disassemble()
1777 Thing.<>c__DisplayClass43_0 CS$<>8__locals1 =
new Thing.<>c__DisplayClass43_0();
1778 CS$<>8__locals1.<>4__this =
this;
1779 CS$<>8__locals1.trans = trans;
1780 CS$<>8__locals1.button = button;
1781 CS$<>8__locals1.count = 1;
1782 CS$<>8__locals1.m =
EClass.ui.CreateContextMenuInteraction();
1783 CS$<>8__locals1.buy = (CS$<>8__locals1.trans !=
null);
1784 CS$<>8__locals1.buttonBuy =
null;
1785 CS$<>8__locals1.itemSlider =
null;
1786 CS$<>8__locals1.itemSlider = CS$<>8__locals1.m.AddSlider(
"sliderSplitMenu",
"adjustmentNum", delegate(
float a)
1788 if (!
EClass.core.IsGameStarted)
1792 return "/" + CS$<>8__locals1.<>4__this.Num.ToString();
1793 }, (float)CS$<>8__locals1.count, delegate(
float b)
1795 CS$<>8__locals1.count = (int)b;
1796 if (CS$<>8__locals1.trans !=
null)
1798 CS$<>8__locals1.trans.num = CS$<>8__locals1.count;
1800 base.<ShowSplitMenu>g__UpdateButton|0();
1801 }, 1f, (float)base.Num,
true,
false,
true).GetComponent<UIItem>();
1802 if (CS$<>8__locals1.buy)
1804 CS$<>8__locals1.buttonBuy = CS$<>8__locals1.m.AddButton(
"invBuy", delegate()
1806 base.<ShowSplitMenu>g__Process|1();
1809 CS$<>8__locals1.m.onDestroy = delegate()
1811 if (!CS$<>8__locals1.buy && !CS$<>8__locals1.m.wasCanceled)
1813 base.<ShowSplitMenu>g__Process|1();
1816 CS$<>8__locals1.m.Show();
1817 if (CS$<>8__locals1.buttonBuy)
1819 CS$<>8__locals1.buttonBuy.gameObject.AddComponent<CanvasGroup>();
1821 CS$<>8__locals1.<ShowSplitMenu>g__UpdateButton|0();
1825 public void DoAct(
Act act)
1827 if (!
EClass.pc.HasNoGoal || (act.LocalAct &&
EClass._zone.IsRegion))
1832 EClass.player.hotItemToRestore =
EClass.player.currentHotItem;
1835 act.Perform(
EClass.pc,
null,
null);
1845 public bool CanSearchContents
1849 return base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty && this.trait.CanSearchContents;
1855 public bool IsSharedContainer
1859 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
1861 Window.SaveData obj = base.GetObj<Window.SaveData>(2);
1862 return obj !=
null && obj.sharedType == ContainerSharedType.Shared;
1869 public static Tuple<
SourceElement.
Row,
int> GetEnchant(
int lv, Func<SourceElement.Row, bool> func,
bool neg)
1873 int num2 = lv + 5 +
EClass.rndSqrt(10);
1874 float num3 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt((
float)lv);
1877 if ((!neg || !row.tag.Contains(
"flag")) && func(row) && row.LV < num2)
1887 int num4 =
EClass.rnd(num);
1891 num5 += row2.chance;
1894 string category =
EClass.sources.elements.map[row2.id].category;
1895 bool flag = category ==
"skill" || category ==
"attribute" || category ==
"resist";
1896 int item = (row2.mtp +
EClass.rnd(row2.mtp + (
int)num3)) / row2.mtp * ((flag && neg) ? -1 : 1);
1904 public void TryLickEnchant(
Chara c,
bool msg =
true,
Chara tg =
null,
BodySlot slot =
null)
1906 if (!base.IsEquipmentOrRanged)
1910 if (base.IsCursed || base.rarity <= Rarity.Normal)
1914 if (base.GetInt(107,
null) > 0)
1920 Rand.SetSeed(
EClass.world.date.day +
this.source._index + c.uid);
1923 c.Say(
"lick", c,
this,
null,
null);
1924 base.PlaySound(
"offering", 1f,
true);
1925 base.PlayEffect(
"mutation",
true, 0f,
default(Vector3));
1927 this.AddEnchant(base.LV);
1931 Rand.SetSeed(base.uid);
1932 List<Element> list =
new List<Element>();
1933 foreach (
Element element
in this.elements.dict.Values)
1935 if (element.id != 67 && element.id != 66 && element.id != 64 && element.id != 65)
1943 this.elements.ModBase(element2.id, Mathf.Max(
EClass.rnd(Mathf.Abs(element2.vBase / 5)), 1));
1947 c.Say(
"lick2", c, tg, slot.name.ToLower(),
null);
1948 tg.PlaySound(
"offering", 1f,
true);
1949 tg.PlayEffect(
"mutation",
true, 0f,
default(Vector3));
1953 base.SetInt(107, 1);
1957 public Element AddEnchant(
int lv = -1)
1959 if (base.IsToolbelt || base.IsLightsource)
1964 if (enchant ==
null)
1968 return this.elements.ModBase(enchant.Item1.id, enchant.Item2);
1972 public void RemoveEnchant()
1977 public Thing Identify(
bool show =
true, IDTSource idtSource = IDTSource.Identify)
1979 if (base.IsIdentified)
1986 @ref = this.GetName(NameStyle.Full, base.Num);
1988 Rarity rarity = (idtSource == IDTSource.Skill) ? Rarity.Superior : ((idtSource == IDTSource.SkillHigh) ? Rarity.Legendary : Rarity.Normal);
1989 if (rarity != Rarity.Normal && ((base.IsEquipmentOrRanged && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
1991 base.c_IDTState = 3;
1993 else if (base.rarity >= Rarity.Mythical && idtSource != IDTSource.SuperiorIdentify)
1995 base.c_IDTState = 1;
1999 base.c_IDTState = 0;
2003 string name = this.GetName(NameStyle.Full, base.Num);
2004 if (base.c_IDTState == 0)
2006 Msg.Say(
"identified", @ref, name,
null,
null);
2010 Msg.Say((idtSource == IDTSource.Skill) ?
"identified3" :
"identified2", @ref, name, base.TextRarity,
null);
2013 if (base.IsIdentified)
2015 Card rootCard = base.GetRootCard();
2016 if (rootCard !=
null)
2018 rootCard.TryStack(
this);
2027 private void <ApplyMaterial>g__SetBase|27_0(
int ele,
int a, ref
Thing.<>c__DisplayClass27_0 A_3)
2029 this.elements.SetBase(ele, a, 0);
2045 public const int MaxFurnitureEnc = 12;
2051 public int stackOrder;
2054 public string tempName;