2using System.Collections.Generic;
37 if (
source.substats.Length == 0)
67 return (
int)((long)(base.isWeightChanged ? base.c_weight :
source.weight) * (long)base.material.weight / 100);
69 if (!base.isWeightChanged)
83 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
95 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
143 return 50 + base.LV * 10 + base.encLV * 10 + (int)base.rarity * 10 + (
int)base.blessedState * 10;
156 Debug.LogWarning(
"Thing " +
id +
" not found");
168 else if (base.category.ignoreBless == 0 &&
bp.
rarity ==
Rarity.Random && base.rarity !=
Rarity.Artifact)
178 else if (
EClass.
rnd(50) == 0 && base.category.slot != 0)
188 if (text ==
"bill_tax" || text ==
"bill")
192 if (base.category.slot != 0)
195 if (base.rarity ==
Rarity.Superior)
199 else if (base.rarity ==
Rarity.Legendary)
203 else if (base.rarity ==
Rarity.Mythical)
207 else if (base.rarity >=
Rarity.Artifact)
213 for (
int i = 0; i < num; i++)
229 int num3 = ((
EClass.
rnd(10) == 0) ? 1 : 0);
230 if (base.rarity ==
Rarity.Superior)
234 else if (base.rarity ==
Rarity.Legendary)
238 else if (base.rarity ==
Rarity.Mythical)
242 else if (base.rarity >=
Rarity.Artifact)
248 for (
int j = 0; j < num2; j++)
252 for (
int k = 0; k <
EClass.
rnd(num2 + 1); k++)
321 base.isReplica =
true;
326 bool flag2 = (base.isFireproof =
false);
327 base.isAcidproof = flag2;
335 if (
source.offense.Length != 0)
337 base.c_diceDim =
source.offense[1];
339 if (
source.offense.Length > 2)
341 SetBase(66,
source.offense[2]);
343 if (
source.offense.Length > 3)
345 SetBase(67,
source.offense[3]);
347 if (
source.defense.Length != 0)
349 SetBase(64,
source.defense[0]);
351 if (
source.defense.Length > 1)
353 SetBase(65,
source.defense[1]);
359 bool flag3 = !base.IsAmmo;
360 if (base.rarity <=
Rarity.Crude)
364 else if (base.rarity ==
Rarity.Superior)
368 else if (base.rarity >=
Rarity.Legendary)
372 if (
source.offense.Length != 0)
374 base.c_diceDim =
source.offense[1] * base.material.dice / (num + (flag3 ?
EClass.
rnd(25) : 0));
376 if (
source.offense.Length > 2)
378 SetBase(66,
source.offense[2] * base.material.atk * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
380 if (
source.offense.Length > 3)
382 SetBase(67,
source.offense[3] * base.material.dmg * 5 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
384 if (
source.defense.Length != 0)
386 SetBase(64,
source.defense[0] * base.material.dv * 7 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
388 if (
source.defense.Length > 1)
390 SetBase(65,
source.defense[1] * base.material.pv * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
395 if (
source.offense.Length != 0)
397 base.c_diceDim = Mathf.Max(
source.offense[1] / 3, 1);
399 if (
source.offense.Length > 2)
401 SetBase(66,
source.offense[2] / 3);
403 if (
source.offense.Length > 3)
405 SetBase(67,
source.offense[3] / 3);
407 if (
source.defense.Length != 0)
409 SetBase(64,
source.defense[0] / 3);
411 if (
source.defense.Length > 1)
413 SetBase(65,
source.defense[1] / 3);
416 if (base.IsEquipmentOrRangedOrAmmo)
418 if (base.IsWeapon || base.IsAmmo)
432 for (
int i = 0; i <
sockets.Count; i++)
435 int num3 = num2 / 100;
436 if (num3 == 67 && dmgSet)
440 if (num3 == 66 && hitSet)
444 if (num3 == 65 && pvSet)
450 if (base.material ==
null || base.material.elements ==
null)
452 Debug.Log(base.idMaterial +
"/" + base.material?.name +
"/" + base.material?.elements);
455 string[] bits = base.material.bits;
456 foreach (
string text
in bits)
458 if (!(text ==
"fire"))
462 base.isAcidproof =
true;
467 base.isFireproof =
true;
470 if (base.rarity >=
Rarity.Artifact)
472 bool flag2 = (base.isFireproof =
true);
473 base.isAcidproof = flag2;
476 void SetBase(
int ele,
int a)
496 int num = ((_num == -1) ? base.Num : _num);
503 string text6 =
source.GetText(
"unit");
505 bool num2 = base.IsIdentified ||
source.unknown.IsEmpty();
506 bool isEquipmentOrRangedOrAmmo = base.IsEquipmentOrRangedOrAmmo;
507 bool flag = Lang.setting.nameStyle == 0;
510 if (base.c_idRefCard.IsEmpty() && !base.c_altName.IsEmpty())
512 text = base.c_altName;
518 if (array.Length > 1)
527 if (!isEquipmentOrRangedOrAmmo || !base.IsIdentified || base.rarity <
Rarity.Legendary)
529 if (
source.naming ==
"m" || (
source.naming ==
"ms" && base.material !=
source.DefaultMaterial))
531 if (isEquipmentOrRangedOrAmmo)
533 string[] textArray = base.material.GetTextArray(
"altName");
534 if (textArray !=
null && textArray.Length >= 2)
536 text = base.material.GetTextArray(
"altName")[1] + Lang.space + text;
540 text =
"_of2".lang(base.material.GetName(), text);
544 if (base.rarity !=
Rarity.Artifact && !base.material.GetTextArray(
"altName").IsEmpty())
546 text = base.material.GetTextArray(
"altName")[0] + Lang.space + text;
552 string idUnknown =
source.GetText(
"unknown");
553 if (idUnknown.StartsWith(
"#"))
557 idUnknown =
Lang.
GetList(idUnknown.Remove(0, 1)).RandomItem();
564 if (!base.c_idRefCard.IsEmpty() && trait.RefCardName !=
RefCardName.None)
566 string text7 = base.c_altName.IsEmpty(base.refCard.GetName());
567 if (!base.c_idRefCard2.IsEmpty())
569 text7 =
"_and".lang(text7, base.c_altName2.IsEmpty(base.refCard2.GetName()));
571 if (!(text7 ==
"*r"))
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)))));
577 string text8 = base.refCard.GetText(
"aka");
578 if (!text8.IsEmpty())
580 text =
"_of".lang(text8, text);
584 if (base.c_bill != 0)
586 text =
"_of".lang(
Lang.
_currency(base.c_bill, showUnit:
true, 0), text);
597 if (!base.c_refText.IsEmpty())
599 text =
"_named".lang(base.c_refText, text);
601 if (base.IsIdentified)
605 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hIT != 0 || dMG != 0) && source.offense.Length != 0)
608 if (
source.offense[0] != 0)
610 text9 = text9 +
source.offense[0] +
"d" + base.c_diceDim;
614 text9 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dMG.ToText() : (dMG.ToString() ??
""));
618 text9 = text9 + ((dMG != 0 ||
source.offense[0] != 0) ?
", " :
"") + hIT;
620 text2 = text2 +
" (" + text9.IsEmpty(
" - ") +
") ";
624 if (dV != 0 || pV != 0)
627 text2 = text2 + dV +
", " + pV;
632 text2 = text2 +
" " +
"itemCharges".lang(base.c_charges.ToString() ??
"");
635 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
637 text2 =
"(" + base.TextRarity.ToTitleCase() +
")";
641 text =
"rotten".lang() + text;
643 else if (base.IsRotting)
645 text =
"rotting".lang() + text;
647 if (base.IsIdentified)
649 if (base.blessedState != 0)
651 text4 = (
"bs" + base.blessedState).lang();
658 text = (isEquipmentOrRangedOrAmmo ? text.Bracket(3) : text);
664 if (isEquipmentOrRangedOrAmmo)
668 sig = AliasGen.GetRandomAlias().Bracket((base.rarity ==
Rarity.Mythical) ? 3 : 2);
670 sig = Lang.space + sig;
677 if (base.category.tag.Contains(
"enc"))
679 if (base.c_altName.IsEmpty())
682 text =
"_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text);
687 sig = sig + Lang.space + ((base.encLV > 0) ? (
"+" + base.encLV) : (base.encLV.ToString() ??
""));
690 if (base.c_lockLv != 0 && base.c_revealLock)
692 sig = sig + Lang.space +
"+" + base.c_lockLv;
694 if (base.isLostProperty)
696 text =
"_lostproperty".lang(text);
700 text5 +=
"equippedItem".lang();
704 string text10 = base.c_note;
705 if (text10.StartsWith(
'@'))
707 text10 =
Lang.
Note.map.TryGetValue(text10.TrimStart(
'@'))?.GetText(
"text") ?? base.c_note;
709 string text11 = (base.category.IsChildOf(
"book") ?
"_written" :
"_engraved");
710 if (
id ==
"grave_dagger1" ||
id ==
"grave_dagger2")
712 text11 =
"_daggerGrave";
714 text = ((!text10.Contains(
"_bracketLeft".lang())) ? text11.lang(text10, text) : (text11 +
"Alt").lang(text10, text));
716 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))));
717 if (base.rarity >=
Rarity.Legendary)
719 text = text.ToTitleCase(wholeText:
true);
728 text5 =
"_limitedStock".lang(text5);
730 return text5 + text3 + text + sig + text2 + text12;
734 if (
source.naming ==
"ma")
736 text = base.material.GetName();
738 if (base.qualityTier > 0)
740 text =
Lang.
GetList(
"quality_general")[Mathf.Clamp(base.qualityTier, 0, 3)] + text;
748 text = text +
" <size=14>(" +
Lang.
_weight(base.ChildrenAndSelfWeight) +
")</size> ";
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;
754 string hoverText = trait.GetHoverText();
755 if (!hoverText.IsEmpty())
757 text = text + Environment.NewLine + hoverText;
759 return base.GetHoverText() + text;
765 if (trait.ShowChildrenNumber && base.c_lockLv == 0)
767 if (things.Count > 0)
769 text +=
"childCount".lang(things.Count.ToString() ??
"");
771 else if (trait.CanOpenContainer)
773 text +=
"empty".lang();
778 Room room = pos.cell.room;
789 List<Element> list =
new List<Element>();
790 if (base.ShowFoodEnc)
792 foreach (
Element value
in elements.dict.Values)
800 if (limit && list.Count > 5)
802 int num = list.Count - 5;
803 for (
int i = 0; i < num; i++)
805 list.RemoveAt(list.Count - 1);
814 List<Element> list = ListLimitedValidTraits(limit);
815 bool showFoodEnc = base.ShowFoodEnc;
819 foreach (
Element value
in elements.dict.Values)
827 foreach (
Element value2
in elements.dict.Values)
839 if (sourceCard.
_origin ==
"dish")
846 bool showEQStats = base.IsEquipmentOrRangedOrAmmo;
848 bool flag2 = base.IsIdentified || flag;
850 if (base.rarity ==
Rarity.Legendary || base.rarity ==
Rarity.Mythical)
852 string text3 = (text2.Contains(
"『") ?
"『" : (text2.Contains(
"《") ?
"《" :
""));
855 string[] array = text2.Split(text3);
856 text2 = array[0] + Environment.NewLine + text3 + array[1];
861 text2 = recipe.GetName();
873 uIItem.
image2.Rect().pivot =
new Vector2(0.5f, 0.5f);
874 string text4 = base.Num.ToFormat() ??
"";
875 string text5 = (Mathf.Ceil(0.01f * (
float)base.ChildrenAndSelfWeight) * 0.1f).ToString(
"F1") +
"s";
876 if (things.Count > 0)
878 text4 = text4 +
" (" + things.Count +
")";
880 if (base.ChildrenAndSelfWeight != SelfWeight)
882 text5 = text5 +
" (" + (Mathf.Ceil(0.01f * (
float)SelfWeight) * 0.1f).ToString(
"F1") +
"s)";
884 text2 =
"_quantity".lang(text4 ??
"", text5);
887 text2 = text2 +
" " +
"_recipe_lv".lang(recipe.RecipeLv.ToString() ??
"");
890 if (showEQStats && flag2)
895 if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
899 text2 = text2 +
"DMG".lang() + ((base.DMG > 0) ?
"+" :
"") + base.DMG +
", ";
903 text2 = text2 +
"HIT".lang() + ((base.HIT > 0) ?
"+" :
"") + base.HIT +
", ";
907 text2 = text2 +
"DV".lang() + ((DV > 0) ?
"+" :
"") + DV +
", ";
911 text2 = text2 +
"PV".lang() + ((PV > 0) ?
"+" :
"") + PV +
", ";
913 if (Penetration != 0)
915 text2 = text2 +
"PEN".lang() + ((Penetration > 0) ?
"+" :
"") + Penetration +
"%, ";
917 text2 = text2.TrimEnd(
' ').TrimEnd(
',');
919 if (!text2.IsEmpty())
921 n.
AddText(
"NoteText_eqstats", text2);
926 n.
AddText(
"NoteText_eqstats",
"tip_range".lang(traitToolRange.BestDist.ToString() ??
""));
934 int totalQuality = GetTotalQuality();
935 int totalQuality2 = GetTotalQuality(applyBonus:
false);
936 text6 = text6 +
"Lv. " + base.LV +
" TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ?
"" : (
" (" + totalQuality2 +
")"));
940 text6 = text6 + (text6.IsEmpty() ?
"" :
" ") +
"_nutrition".lang(Evalue(10).ToFormat() ??
"");
942 if ((base.category.IsChildOf(
"resource") || trait.IsTool) && !(trait is
TraitAbility))
944 text6 = text6 + (text6.IsEmpty() ?
"" :
" ") +
"_hardness".lang(base.material.hardness.ToString() ??
"");
948 text6 = text6 + (text6.IsEmpty() ?
"" :
" ") +
"_max_quality".lang(recipe.GetQualityBonus().ToString() ??
"");
950 if (!text6.IsEmpty())
952 n.
AddText(
"NoteText_eqstats", text6);
956 string detail = GetDetail();
957 if (!detail.IsEmpty())
959 LayoutElement component = n.
AddText(
"NoteText_flavor", detail).GetComponent<LayoutElement>();
962 component.preferredWidth = 400f;
970 n.
AddText(
"NoteText_flavor", traitBookPlan.
source.GetDetail());
973 if (traitAbility !=
null)
984 n.
AddText(
"(id:" +
id +
" tile:" + (source.
tiles.IsEmpty() ?
"-" : ((
object)source.
tiles[0]))?.ToString() +
") lv:" + base.LV +
" price:" + GetPrice());
986 Card rootCard = GetRootCard();
995 AddText(
"isCategorized".lang(base.category.GetText()),
FontColor.Default);
996 if (base.category.skill != 0)
998 int key = base.category.skill;
1000 if (base.IsRangedWeapon && !base.IsMeleeWeapon)
1008 if (Evalue(482) > 0)
1015 if (base.IsContainer)
1017 AddText(
"isContainer".lang(things.MaxCapacity.ToString() ??
""),
FontColor.Default);
1019 if (base.c_lockLv != 0)
1021 AddText((base.c_lockedHard ?
"isLockedHard" :
"isLocked").lang(base.c_lockLv.ToString() ??
""),
FontColor.Warning);
1023 if (base.isCrafted && recipe ==
null)
1025 AddText(
"isCrafted".lang(),
FontColor.Default);
1027 if (trait.Decay > 0)
1030 text7 = (base.IsDecayed ?
"isRotten" : (base.IsRotting ?
"isRotting" : ((!base.IsFresn) ?
"isNotFresh" :
"isFresh")));
1031 AddText(text7.lang(),
FontColor.Default);
1035 AddText(
"isDyed".lang(base.DyeMat.GetName() ??
""),
FontColor.Default);
1037 if (base.IsEquipment)
1039 text2 =
"isEquipable".lang(
Element.
Get(base.category.slot).GetText());
1042 if (base.isFireproof)
1044 AddText(
"isFreproof",
FontColor.Default);
1046 if (base.isAcidproof)
1048 AddText(
"isAcidproof",
FontColor.Default);
1050 if (trait.Electricity > 0)
1052 AddText(
"isGenerateElectricity".lang(trait.Electricity.ToString() ??
""),
FontColor.Default);
1054 if (trait.Electricity < 0)
1056 AddText(
"isConsumeElectricity".lang(Mathf.Abs(trait.Electricity).ToString() ??
""),
FontColor.Default);
1060 AddText(
"isPrecious",
FontColor.Default);
1066 if (!trait.CanBeDestroyed)
1068 AddText(
"isIndestructable",
FontColor.Default);
1070 if (GetInt(107) > 0)
1078 if (!base.c_idDeity.IsEmpty())
1083 if (base.isGifted && GetRoot() !=
EClass.
pc)
1087 if (base.isNPCProperty)
1089 AddText(
"isNPCProperty",
FontColor.Ether);
1091 if (base.c_priceFix != 0)
1093 AddText(((base.c_priceFix > 0) ?
"isPriceUp" :
"isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ??
""),
FontColor.Ether);
1103 if (base.c_isImportant)
1105 AddText(
"isMarkedImportant",
FontColor.Ether);
1107 if (GetInt(25) != 0)
1109 AddText(
"isDangerLv".lang((GetInt(25) + 1).ToString() ??
"", (
EClass.
pc.
FameLv + 10).ToString() ??
""),
FontColor.Default);
1114 if (HasElement(220))
1116 AddText(
"canMine".lang(), col2);
1118 if (HasElement(225))
1120 AddText(
"canLumberjack".lang(), col2);
1121 AddText(
"canLumberjack2".lang(), col2);
1123 if (HasElement(230))
1125 AddText(
"canDig", col2);
1127 if (HasElement(286))
1129 AddText(
"canFarm", col2);
1131 if (HasElement(245))
1133 AddText(
"canFish", col2);
1135 if (HasElement(237))
1137 AddText(
"canTame", col2);
1142 AddText(
"canPlayMusic".lang(), col2);
1144 if (
Lang.
Has(
"hint_" + trait.ToString()))
1146 AddText(
"hint_" + trait.ToString(),
FontColor.Util);
1148 if (
Lang.
Has(
"hint_" + trait.ToString() +
"2"))
1150 AddText(
"hint_" + trait.ToString() +
"2",
FontColor.Util);
1152 if (HasTag(
CTAG.tourism))
1156 string langPlaceType = base.TileType.LangPlaceType;
1157 if (langPlaceType ==
"place_Door" || langPlaceType ==
"place_WallMount")
1159 AddText(base.TileType.LangPlaceType +
"_hint".lang(),
FontColor.Util);
1161 if (trait.IsHomeItem)
1163 AddText(
"isHomeItem".lang(),
FontColor.Util);
1165 if (HasTag(
CTAG.throwWeapon))
1167 AddText(
"isThrowWeapon",
FontColor.Default);
1171 AddText(
"isThrowWeaponEnemy",
FontColor.Default);
1177 if (HasTag(
CTAG.rareResource))
1179 AddText(
"isRareResource",
FontColor.Great);
1183 AddText(
"isBed".lang(traitBed.MaxHolders.ToString() ??
""),
FontColor.Default);
1185 bool flag3 = base.IsEquipmentOrRangedOrAmmo || base.IsThrownWeapon;
1190 Element element = elements.GetElement(653);
1191 if (element !=
null)
1193 AddText(
"isAlive".lang(element.
vBase.ToString() ??
"", (element.
vExp / 10).ToString() ??
"", (element.
ExpToNext / 10).ToString() ??
""),
FontColor.Great);
1195 string[] rangedSubCats =
new string[2] {
"eleConvert",
"eleAttack" };
1196 elements.AddNote(n, delegate(
Element e)
1206 if (e.
source.categorySub ==
"eleAttack" && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon)
1210 return (!showEQStats || (e.
id != 64 && e.
id != 65 && e.
id != 66 && e.
id != 67)) ?
true :
false;
1213 if (sockets !=
null)
1215 foreach (
int socket
in sockets)
1217 AddText((socket == 0) ?
"emptySocket".lang() :
"socket".lang(
EClass.
sources.
elements.map[socket / 100].GetName(), (socket % 100).ToString() ??
""),
FontColor.Gray);
1223 AddText(
"isUnidentified".lang(),
FontColor.Flavor);
1224 if (base.c_IDTState == 1)
1226 AddText(
"isUnidentified2".lang(),
FontColor.Flavor);
1229 trait.WriteNote(n, flag2);
1230 if (flag2 && !flag3)
1233 List<Element> list = ListValidTraits(isCraft:
false, !infoMode);
1234 List<Element> list2 = ListValidTraits(isCraft:
false, limit:
false);
1235 if (list2.Count - list.Count <= 1)
1242 string text13 = e.
source.GetText(
"textExtra");
1243 if (!text13.IsEmpty())
1246 if (e.id == 2 && mode == IInspect.NoteMode.Product)
1248 int num2 = recipe.GetQualityBonus() / 10;
1253 text14 =
"qualityLimit".lang(num2.ToString() ??
"");
1255 int num3 = e.
Value / 10;
1256 num3 = ((e.
Value < 0) ? (num3 - 1) : (num3 + 1));
1257 text13 =
"Lv." + num3 + text14 +
" " + text13;
1260 text13 +=
"traitAdditive".lang();
1262 text12 += (
" <size=12>" + text13 +
"</size>").TagColor(
FontColor.Passive);
1272 AddText(
"foodHuman".lang(),
FontColor.Ether);
1276 AddText(
"foodUndead".lang(),
FontColor.Ether);
1279 if (list.Count != list2.Count)
1281 AddText(
"traitOther".lang((list2.Count - list.Count).ToString() ??
""),
FontColor.Default);
1285 n.
AddHeader(
"HeaderAdditionalTrait",
"additional_trait");
1289 string text10 = e.
source.GetText(
"textExtra");
1290 if (!text10.IsEmpty())
1293 int num = e.Value / 10;
1294 num = ((e.Value < 0) ? (num - 1) : (num + 1));
1295 text10 =
"Lv." + num + text11 +
" " + text10;
1296 if (infoMode && e.IsFoodTraitMain)
1298 text10 +=
"traitAdditive".lang();
1300 text9 += (
" <size=12>" + text10 +
"</size>").TagColor(
FontColor.Passive);
1308 n.AddText(
"decay:" + base.decay);
1309 n.AddText(base.isDyed +
"/" +
id +
"/" + base.refVal +
"/" + base.LV +
"/" + trait);
1310 if (source.
origin !=
null)
1315 if (
id ==
"statue_weird")
1317 AddText(
"weirdStatue",
FontColor.Default);
1321 AddText(
"isReplica",
FontColor.Passive);
1330 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara !=
null)
1332 AddAttackEvaluation(n, chara,
this);
1334 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1336 n.AddHeader(
"headerAttackEval");
1339 text8 = text8.TagColor(() =>
true);
1343 if (base.ammoData !=
null)
1345 n.AddHeader(
"headerAttackAmmo");
1346 n.AddText(base.ammoData.Name);
1348 onWriteNote?.Invoke(n);
1355 foreach (
Element value
in elements.dict.Values)
1361 void AddText(
string text,
FontColor col)
1363 n.AddText(
"NoteText_enc", text, col);
1365 void AddTextWithIcon(
string text, Sprite sprite,
FontColor col)
1367 UIItem uIItem2 = n.AddText(
"NoteText_enc", text, col);
1368 uIItem2.
image1.SetActive(enable:
true);
1369 uIItem2.image1.sprite = sprite;
1385 if (slot.
thing == current)
1387 text = text.TagColor(() =>
true);
1396 text2 = text2.TagColor(() =>
true);
1403 p.matColor = base.colorInt;
1404 p.mat = base.material;
1405 if (!renderer.usePass)
1409 switch (trait.tileMode)
1412 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1414 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1418 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1422 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1424 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1428 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1430 if (source.
anime.Length == 0 || !trait.IsAnimeOn)
1434 if (source.
anime.Length > 2)
1436 float num = Time.realtimeSinceStartup * 1000f / (float)source.
anime[1] % (
float)source.
anime[2];
1437 if ((
int)num == source.
anime[0] - 1 && source.anime.Length > 3)
1439 PlaySound(
"anime_sound" + source.
anime[3]);
1441 if (!(num >= (
float)source.
anime[0]))
1443 p.tile += num * (float)((!flipX) ? 1 : (-1));
1448 float num2 = Time.realtimeSinceStartup * 1000f / (float)source.
anime[1] % (
float)source.
anime[0];
1449 p.tile += num2 * (float)((!flipX) ? 1 : (-1));
1453 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1455 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1459 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1461 if (animeCounter > 0f && source.
anime.Length != 0)
1463 animeCounter += Time.deltaTime;
1464 int num3 = (int)(animeCounter / (0.001f * (
float)source.
anime[1]));
1465 if (num3 > ((source.
anime.Length > 2) ? source.
anime[2] : source.
anime[0]))
1471 p.tile += num3 % source.
anime[0] * ((!flipX) ? 1 : (-1));
1476 if (base.isOn || base.isRoofItem)
1478 int num4 = (int)((
float)base.uid + Time.realtimeSinceStartup * 5f);
1479 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1480 p.tile = (sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1485 else if (num5 % 11 == 0)
1491 p.color = 13107200f;
1496 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1500 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1502 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1506 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1508 if (parent is
Zone && pos.cell.HasFullBlock)
1510 p.tile += ((p.tile < 0f) ? (-64) : 64);
1514 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1518 if (trait.IdSkin != 0)
1520 int index = trait.IdSkin - 1;
1521 if (sourceCard.
skins.Length != 0)
1523 p.tile += ((p.tile < 0f) ? (-sourceCard.
skins.TryGet(index)) : sourceCard.
skins.TryGet(index));
1533 if (!renderer.data.subCrate.enable)
1537 return renderer.data.subCrate;
1560 if (!trait.CanStackTo(to))
1564 if (base.noSell != to.
noSell || base.isCopy != to.
isCopy)
1592 if (trait.IsRequireFuel && base.c_charges != to.
c_charges)
1604 if (windowSaveData !=
null && windowSaveData.
compress)
1611 if (base.encLV != to.
encLV && !base.IsFood)
1619 foreach (
Element value
in elements.dict.Values)
1626 int num2 = (to.encLV = Mathf.CeilToInt(1f * (
float)(base.encLV * base.Num + to.encLV * to.
Num) / (
float)(base.Num + to.
Num)));
1628 foreach (
Element value2
in elements.dict.Values)
1631 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.
Num) / (base.Num + to.
Num));
1635 if (base.encLV != to.
encLV)
1643 foreach (
Element value3
in elements.dict.Values)
1645 Element element2 = to.elements.GetElement(value3.
id);
1646 if (element2 ==
null || value3.
vBase / 10 * 10 != element2.
vBase / 10 * 10)
1656 if (ing.CanSetThing(
this))
1660 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1664 foreach (
Thing thing
in things)
1676 if (GetRootCard().Dist(
EClass.
pc) > 1 || !ing.CanSetThing(
this))
1699 bool buy = trans !=
null;
1701 UIItem itemSlider =
null;
1710 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1713 buttonBuy = i.
AddButton(
"invBuy", delegate
1718 i.onDestroy = delegate
1726 if ((
bool)buttonBuy)
1728 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1735 Debug.Log(
"Split bug1");
1739 Debug.Log(
"Split bug2");
1743 Debug.Log(
"Split bug3");
1745 else if (count != 0 && !Input.GetMouseButton(1))
1749 trans.Process(startTransaction:
true);
1754 if (count != base.Num)
1758 thing.invX = dragItemCard.
from.
invX;
1759 thing.invY = dragItemCard.
from.
invY;
1769 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1770 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1771 if ((
bool)buttonBuy)
1773 buttonBuy.mainText.SetText(trans.GetTextDetail());
1774 buttonBuy.mainText.RebuildLayoutTo<
UIButton>();
1775 buttonBuy.interactable = trans.IsValid();
1776 buttonBuy.RebuildLayout(recursive:
true);
1777 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1787 UIItem itemSlider =
null;
1788 itemSlider = uIContextMenu.
AddSlider(
"sliderSplitMenu",
"adjustmentNum", (
float a) => (!
EClass.
core.
IsGameStarted) ?
"" : (
"/" + base.Num), count, delegate(
float b)
1792 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1793 buttonBuy = uIContextMenu.
AddButton(
"invBuy", delegate
1797 uIContextMenu.onDestroy = delegate
1800 uIContextMenu.
Show();
1801 if ((
bool)buttonBuy)
1803 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1810 Debug.Log(
"Split bug1");
1814 Debug.Log(
"Split bug2");
1818 Debug.Log(
"Split bug3");
1820 else if (count != 0 && !Input.GetMouseButton(1))
1822 onSplit?.Invoke(count);
1827 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1828 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1831 buttonBuy.interactable =
true;
1832 buttonBuy.RebuildLayout(recursive:
true);
1861 if ((!
neg || !row.tag.Contains(
"flag")) && func(row) && row.LV < num2)
1875 num4 +=
item.chance;
1879 bool flag = text ==
"skill" || text ==
"attribute" || text ==
"resist";
1880 float num5 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt(lv *
item.encFactor / 100);
1881 int num6 = (item.mtp +
EClass.
rnd(
item.mtp + (
int)num5)) / item.mtp * ((!(flag &&
neg)) ? 1 : (-1));
1882 if (
item.encFactor == 0 && num6 > 25)
1894 if (!base.IsEquipment || base.IsCursed || base.rarity <=
Rarity.Normal || GetInt(107) > 0)
1904 c.
Say(
"lick", c,
this);
1905 PlaySound(
"offering");
1906 PlayEffect(
"mutation");
1908 Element element = AddEnchant(base.LV);
1909 if (element !=
null)
1911 SetInt(107, element.
id);
1917 List<Element> list =
new List<Element>();
1918 foreach (
Element value
in elements.dict.Values)
1920 if (value.
id != 67 && value.
id != 66 && value.
id != 64 && value.
id != 65)
1927 Element element2 = list.RandomItem();
1928 elements.ModBase(element2.
id, Mathf.Max(
EClass.
rnd(Mathf.Abs(element2.
vBase / 5)), 1));
1929 SetInt(107, element2.
id);
1933 c.
Say(
"lick2", c, tg, slot.
name.ToLower());
1934 tg.PlaySound(
"offering");
1935 tg.PlayEffect(
"mutation");
1943 if (base.IsToolbelt || base.IsLightsource)
1948 if (enchant ==
null)
1952 return elements.ModBase(enchant.Item1.id, enchant.Item2);
1961 if (base.IsIdentified)
1969 @ref = GetName(
NameStyle.Full, base.Num);
1971 Rarity rarity = idtSource
switch
1973 IDTSource.SkillHigh =>
Rarity.Legendary,
1974 IDTSource.Skill =>
Rarity.Superior,
1977 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >=
Rarity.Mythical))
1979 base.c_IDTState = 3;
1981 else if (base.rarity >=
Rarity.Mythical && idtSource !=
IDTSource.SuperiorIdentify)
1983 base.c_IDTState = 1;
1987 base.c_IDTState = 0;
1991 text = GetName(
NameStyle.Full, base.Num);
1992 if (base.c_IDTState == 0)
1994 Msg.
Say(
"identified", @ref, text);
1998 Msg.
Say((idtSource ==
IDTSource.Skill) ?
"identified3" :
"identified2", @ref, text, base.TextRarity);
2001 if (base.IsIdentified)
2003 GetRootCard()?.TryStack(
this);
2013 DNA dNA = base.c_DNA;
2018 for (
int i = 0; i < dNA.
vals.Count; i += 2)
2021 if (row.
name.ToLower().Contains(s))
2025 if (row.
GetName().ToLower().Contains(s))
2033 if (!base.IsIdentified)
2037 foreach (
Element value
in elements.dict.Values)
2039 if (value.
Value != 0)
2041 if (value.
source.name.ToLower().Contains(s))
2045 if (value.
source.GetName().ToLower().Contains(s))
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
void SetTurbo(int mtp=-1)
void Prepare(Chara _CC, Thing _weapon, Card _TC=null, Point _TP=null, int _attackIndex=0, bool _isThrow=false)
static AttackProcess Current
string GetStr(int id, string defaultStr=null)
int GetInt(int id, int? defaultInt=null)
BlessedState? blesstedState
ElementContainerCard elements
bool HasElement(int ele, int req=1)
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Thing AddThing(string id, int lv=-1)
void ApplySocket(Thing t)
virtual void SetBlessedState(BlessedState s)
BlessedState blessedState
int ChildrenAndSelfWeight
void Say(string lang, string ref1=null, string ref2=null)
bool IsTooHeavyToEquip(Thing thing)
override bool IsPCFaction
BackerContentConfig backer
static int rndSqrt(int a)
static SourceManager sources
static GameSetting setting
static int GetSortVal(Element a)
Dictionary< int, Element > dict
void AddNote(UINote n, Func< Element, bool > isValid=null, Action onAdd=null, NoteMode mode=NoteMode.Default, bool addRaceFeat=false, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
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)
void _WriteNote(UINote n, Chara c, Act act)
static SourceElement.Row Get(int id)
static bool IsUndeadFlesh(Thing food)
static bool IsHumanFlesh(Thing food)
ReligionManager religions
virtual void OnWriteNote(Thing t, UINote n)
static bool IsValidRangedMod(Thing t, SourceElement.Row row)
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
static string[] GetList(string id)
static string _currency(object a, string IDCurrency)
static bool Has(string id)
static LayerCraft Instance
static LayerDragGrid Instance
static void SetDirty(Thing t)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
static void UseSeed(int seed, Action action)
static void SetSeed(int a=-1)
Dictionary< string, CardRow > firstVariations
override string GetName()
SourceCategory categories
static SubPassData Default
const string potionCureCorruption
void GetDisassembles(List< Thing > list)
void GetIngredients(Recipe.Ingredient ing, List< Thing > list)
override void WriteNote(UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
void GetRecipes(HashSet< Recipe > recipes)
bool IsValidIngredient(Recipe.Ingredient ing)
override void SetRenderParam(RenderParam p)
void ShowSplitMenu(ButtonGrid button, InvOwner.Transaction trans=null)
void TryLickEnchant(Chara c, bool msg=true, Chara tg=null, BodySlot slot=null)
void ShowSplitMenu2(ButtonGrid button, string lang, Action< int > onSplit=null)
override void SetSource()
override SubPassData GetSubPassData()
override bool MatchEncSearch(string s)
Element AddEnchant(int lv=-1)
override void ApplyMaterialElements(bool remove)
override string GetExtraName()
static Tuple< SourceElement.Row, int > GetEnchant(int lv, Func< SourceElement.Row, bool > func, bool neg)
List< Element > ListLimitedValidTraits(bool limit)
override string GetName(NameStyle style, int _num=-1)
override void ApplyMaterial(bool remove=false)
override string GetHoverText()
const int MaxFurnitureEnc
static void AddAttackEvaluation(UINote n, Chara chara, Thing current=null)
override CardRow sourceCard
override void OnCreate(int genLv)
bool CanAutoFire(Chara c, Card tg, bool reloading=false)
override bool CanStackTo(Thing to)
List< Element > ListValidTraits(bool isCraft, bool limit)
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
override SourceElement.Row source
static bool CanTagSale(Card t, bool insideContainer=false)
virtual bool Contains(RecipeSource r)
virtual bool CanSearchContent
virtual void SetName(ref string s)
UIItem AddHeaderCard(string text, Sprite sprite=null)
UIItem AddHeader(string text, Sprite sprite=null)
UIItem AddText(string text, FontColor color=FontColor.DontChange)
void Space(int sizeY=0, int sizeX=1)