2using System.Collections.Generic;
37 if (
source.substats.Length == 0)
83 return (
int)((long)(base.isWeightChanged ? base.c_weight :
source.weight) * (long)base.material.weight / 100);
85 if (!base.isWeightChanged)
99 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
111 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
159 return 50 + base.LV * 10 + base.encLV * 10 + (int)base.rarity * 10 + (
int)base.blessedState * 10;
172 Debug.LogWarning(
"Thing " +
id +
" not found");
184 else if (base.category.ignoreBless == 0 &&
bp.
rarity ==
Rarity.Random && base.rarity !=
Rarity.Artifact)
194 else if (
EClass.
rnd(50) == 0 && base.category.slot != 0)
204 if (text ==
"bill_tax" || text ==
"bill")
208 if (base.category.slot != 0)
211 if (base.rarity ==
Rarity.Superior)
215 else if (base.rarity ==
Rarity.Legendary)
219 else if (base.rarity ==
Rarity.Mythical)
223 else if (base.rarity >=
Rarity.Artifact)
229 for (
int i = 0; i < num; i++)
245 int num3 = ((
EClass.
rnd(10) == 0) ? 1 : 0);
246 if (base.rarity ==
Rarity.Superior)
250 else if (base.rarity ==
Rarity.Legendary)
254 else if (base.rarity ==
Rarity.Mythical)
258 else if (base.rarity >=
Rarity.Artifact)
264 for (
int j = 0; j < num2; j++)
268 for (
int k = 0; k <
EClass.
rnd(num2 + 1); k++)
341 base.isReplica =
true;
346 bool flag2 = (base.isFireproof =
false);
347 base.isAcidproof = flag2;
355 if (
source.offense.Length != 0)
357 base.c_diceDim =
source.offense[1];
359 if (
source.offense.Length > 2)
361 SetBase(66,
source.offense[2]);
363 if (
source.offense.Length > 3)
365 SetBase(67,
source.offense[3]);
367 if (
source.defense.Length != 0)
369 SetBase(64,
source.defense[0]);
371 if (
source.defense.Length > 1)
373 SetBase(65,
source.defense[1]);
379 bool flag3 = !base.IsAmmo;
380 if (base.rarity <=
Rarity.Crude)
384 else if (base.rarity ==
Rarity.Superior)
388 else if (base.rarity >=
Rarity.Legendary)
392 if (
source.offense.Length != 0)
394 base.c_diceDim =
source.offense[1] * base.material.dice / (num + (flag3 ?
EClass.
rnd(25) : 0));
396 if (
source.offense.Length > 2)
398 SetBase(66,
source.offense[2] * base.material.atk * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
400 if (
source.offense.Length > 3)
402 SetBase(67,
source.offense[3] * base.material.dmg * 5 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
404 if (
source.defense.Length != 0)
406 SetBase(64,
source.defense[0] * base.material.dv * 7 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
408 if (
source.defense.Length > 1)
410 SetBase(65,
source.defense[1] * base.material.pv * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
415 if (
source.offense.Length != 0)
417 base.c_diceDim = Mathf.Max(
source.offense[1] / 3, 1);
419 if (
source.offense.Length > 2)
421 SetBase(66,
source.offense[2] / 3);
423 if (
source.offense.Length > 3)
425 SetBase(67,
source.offense[3] / 3);
427 if (
source.defense.Length != 0)
429 SetBase(64,
source.defense[0] / 3);
431 if (
source.defense.Length > 1)
433 SetBase(65,
source.defense[1] / 3);
436 if (base.IsEquipmentOrRangedOrAmmo)
438 if (base.IsWeapon || base.IsAmmo)
452 for (
int i = 0; i <
sockets.Count; i++)
455 int num3 = num2 / 1000;
456 if (num3 == 67 && dmgSet)
460 if (num3 == 66 && hitSet)
464 if (num3 == 65 && pvSet)
470 if (base.material ==
null || base.material.elements ==
null)
472 Debug.Log(base.idMaterial +
"/" + base.material?.name +
"/" + base.material?.elements);
475 string[] bits = base.material.bits;
476 foreach (
string text
in bits)
478 if (!(text ==
"fire"))
482 base.isAcidproof =
true;
487 base.isFireproof =
true;
490 if (base.rarity >=
Rarity.Artifact)
492 bool flag2 = (base.isFireproof =
true);
493 base.isAcidproof = flag2;
496 void SetBase(
int ele,
int a)
516 int num = ((_num == -1) ? base.Num : _num);
523 string text6 =
source.GetText(
"unit");
525 bool num2 = base.IsIdentified ||
source.unknown.IsEmpty();
526 bool isEquipmentOrRangedOrAmmo = base.IsEquipmentOrRangedOrAmmo;
527 bool flag = Lang.setting.nameStyle == 0;
530 if (base.c_idRefCard.IsEmpty() && !base.c_altName.IsEmpty())
532 text = base.c_altName;
538 if (array.Length > 1)
547 if (isEquipmentOrRangedOrAmmo && base.IsIdentified && base.rarity >=
Rarity.Legendary)
549 if (base.rarity !=
Rarity.Artifact && !base.material.GetTextArray(
"altName").IsEmpty())
551 text = base.material.GetTextArray(
"altName")[0] + Lang.space + text;
555 if (
source.naming ==
"m" || (
source.naming ==
"ms" && base.material !=
source.DefaultMaterial))
557 if (isEquipmentOrRangedOrAmmo)
559 string[] textArray = base.material.GetTextArray(
"altName");
560 if (textArray !=
null && textArray.Length >= 2)
562 text = base.material.GetTextArray(
"altName")[1] + Lang.space + text;
566 text =
"_of2".lang(base.material.GetName(), text);
571 string idUnknown =
source.GetText(
"unknown");
572 if (idUnknown.StartsWith(
"#"))
576 idUnknown =
Lang.
GetList(idUnknown.Remove(0, 1)).RandomItem();
584 text =
"_halfeaten".lang(text);
586 if (base.c_bill != 0)
588 text =
"_of".lang(
Lang.
_currency(base.c_bill, showUnit:
true, 0), text);
593 text =
Lang.
GetList((base.category.id ==
"fish") ?
"quality_fish" :
"quality_general")[Mathf.Clamp(base.tier, 0, 3)] + text;
603 if (!base.c_refText.IsEmpty())
605 text =
"_named".lang(base.c_refText, text);
607 if (base.IsIdentified)
611 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hIT != 0 || dMG != 0) && source.offense.Length != 0)
614 if (
source.offense[0] != 0)
616 text7 = text7 +
source.offense[0] +
"d" + base.c_diceDim;
620 text7 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dMG.ToText() : (dMG.ToString() ??
""));
624 text7 = text7 + ((dMG != 0 ||
source.offense[0] != 0) ?
", " :
"") + hIT;
626 text2 = text2 +
" (" + text7.IsEmpty(
" - ") +
") ";
630 if (dV != 0 || pV != 0)
633 text2 = text2 + dV +
", " + pV;
638 text2 = text2 +
" " +
"itemCharges".lang(base.c_charges.ToString() ??
"");
641 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
643 text2 = Lang.space +
"(" + base.TextRarity.ToTitleCase() +
")";
647 text =
"rotten".lang() + text;
649 else if (base.IsRotting)
651 text =
"rotting".lang() + text;
653 if (base.IsIdentified)
655 if (base.blessedState != 0)
657 text4 = (
"bs" + base.blessedState).lang();
664 text = (isEquipmentOrRangedOrAmmo ? text.Bracket(3) : text);
670 if (isEquipmentOrRangedOrAmmo)
674 sig = AliasGen.GetRandomAlias().Bracket((base.rarity ==
Rarity.Mythical) ? 3 : 2);
676 sig = Lang.space + sig;
683 if (base.category.tag.Contains(
"enc"))
685 if (base.c_altName.IsEmpty())
688 text =
"_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text);
693 sig = sig + Lang.space + ((base.encLV > 0) ? (
"+" + base.encLV) : (base.encLV.ToString() ??
""));
696 if (base.c_lockLv != 0 && base.c_revealLock)
698 sig = sig + Lang.space +
"+" + base.c_lockLv;
700 if (base.isLostProperty)
702 text =
"_lostproperty".lang(text);
706 text5 +=
"equippedItem".lang();
710 string text8 = base.c_note;
711 if (text8.StartsWith(
'@'))
713 text8 =
Lang.
Note.map.TryGetValue(text8.TrimStart(
'@'))?.GetText(
"text") ?? base.c_note;
715 string text9 = (base.category.IsChildOf(
"book") ?
"_written" :
"_engraved");
716 if (
id ==
"grave_dagger1" ||
id ==
"grave_dagger2")
718 text9 =
"_daggerGrave";
720 text = ((!text8.Contains(
"_bracketLeft".lang())) ? text9.lang(text8, text) : (text9 +
"Alt").lang(text8, text));
722 text = (flag ? ((num <= 1) ? (text4 + text) :
"_unit".lang(num.ToFormat() ??
"", text4 + text, text6)) : ((
trait is
TraitAbility) ? text.ToTitleCase(wholeText:
true) : ((!text6.IsEmpty() && (base.IsIdentified ||
source.unknown.IsEmpty())) ?
"_unit".lang((num == 1) ?
"" : (num.ToFormat() ??
""), text, (text4 + text6).AddArticle(num, style2,
source.unit)) : (text4 + text).AddArticle(num, style2,
source.name))));
723 if (base.rarity >=
Rarity.Legendary)
725 text = text.ToTitleCase(wholeText:
true);
734 text5 =
"_limitedStock".lang(text5);
736 return text5 + text3 + text + sig + text2 + text10;
740 if (
source.naming ==
"ma")
742 text = base.material.GetName();
746 if (!base.c_idRefCard.IsEmpty() && trait.RefCardName !=
RefCardName.None)
748 string text11 = base.c_altName.IsEmpty(base.refCard.GetName());
749 if (!base.c_idRefCard2.IsEmpty())
751 text11 =
"_and".lang(text11, base.c_altName2.IsEmpty(base.refCard2.GetName()));
753 if (!(text11 ==
"*r"))
755 text = ((!
source.name2.IsEmpty()) ?
source.GetTextArray(
"name2")[0].Replace(
"#1b", base.c_extraNameRef.IsEmpty((base.refCard ==
null) ? text11 : (base.refCard.isChara ? base.refCard.GetName() : base.refCard.GetText()))).Replace(
"#1", base.c_extraNameRef.IsEmpty(text11)) : (
source.naming.Contains(
"last") ? (text + Lang.space + text11) : (
source.naming.Contains(
"first") ? (text11 + Lang.space + text) : ((!
source.naming.Contains(
"of")) ? (text6.IsEmpty() ?
"_of3" :
"_of2").lang(text11, text) :
"_of".lang(text11, text)))));
759 string text12 = base.refCard.GetText(
"aka");
760 if (!text12.IsEmpty())
762 text =
"_of".lang(text12, text);
772 text = text +
" <size=14>(" +
Lang.
_weight(base.ChildrenAndSelfWeight) +
")</size> ";
775 text += Environment.NewLine;
776 text = text +
"id:" +
id +
" tile:" + source.idRenderData +
"/" + ((source.tiles.Length != 0) ? ((
object)source.
tiles[0]) :
"-")?.ToString() +
" num:" + base.Num +
" lv:" + base.LV +
" enc:" + base.encLV +
" / " + base.material.alias;
778 string hoverText = trait.GetHoverText();
779 if (!hoverText.IsEmpty())
781 text = text + Environment.NewLine + hoverText;
783 return base.GetHoverText() + text;
789 if (trait.ShowChildrenNumber && base.c_lockLv == 0)
791 if (things.Count > 0)
793 text +=
"childCount".lang(things.Count.ToString() ??
"");
795 else if (trait.CanOpenContainer)
797 text +=
"empty".lang();
802 Room room = pos.cell.room;
813 List<Element> list =
new List<Element>();
814 if (base.ShowFoodEnc)
816 foreach (
Element value
in elements.dict.Values)
824 if (limit && list.Count > 5)
826 int num = list.Count - 5;
827 for (
int i = 0; i < num; i++)
829 list.RemoveAt(list.Count - 1);
838 List<Element> list = ListLimitedValidTraits(limit);
839 bool showFoodEnc = base.ShowFoodEnc;
843 foreach (
Element value
in elements.dict.Values)
851 foreach (
Element value2
in elements.dict.Values)
863 if (sourceCard.
_origin ==
"dish")
871 bool showEQStats = base.IsEquipmentOrRangedOrAmmo;
873 bool flag2 = base.IsIdentified || flag;
875 if (base.rarity ==
Rarity.Legendary || base.rarity ==
Rarity.Mythical)
877 string text4 = (text3.Contains(
"『") ?
"『" : (text3.Contains(
"《") ?
"《" :
""));
880 string[] array = text3.Split(text4);
881 text3 = array[0] + Environment.NewLine + text4 + array[1];
888 text3 = recipe.GetName();
890 if (trait.CraftNum > 1)
892 text3 = text3 +
" x " + trait.CraftNum;
905 uIItem.
image2.Rect().pivot =
new Vector2(0.5f, 0.5f);
906 string text5 = base.Num.ToFormat() ??
"";
907 string text6 = (Mathf.Ceil(0.01f * (
float)base.ChildrenAndSelfWeight) * 0.1f).ToString(
"F1") +
"s";
908 if (things.Count > 0)
910 text5 = text5 +
" (" + things.Count +
")";
912 if (base.ChildrenAndSelfWeight != SelfWeight)
914 text6 = text6 +
" (" + (Mathf.Ceil(0.01f * (
float)SelfWeight) * 0.1f).ToString(
"F1") +
"s)";
916 text3 =
"_quantity".lang(text5 ??
"", text6);
919 text3 = text3 +
" " +
"_recipe_lv".lang(recipe.RecipeLv.ToString() ??
"");
922 if (showEQStats && flag2)
925 if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
929 text3 = text3 +
"DMG".lang() + ((base.DMG > 0) ?
"+" :
"") + base.DMG +
", ";
933 text3 = text3 +
"HIT".lang() + ((base.HIT > 0) ?
"+" :
"") + base.HIT +
", ";
937 text3 = text3 +
"DV".lang() + ((DV > 0) ?
"+" :
"") + DV +
", ";
941 text3 = text3 +
"PV".lang() + ((PV > 0) ?
"+" :
"") + PV +
", ";
943 if (Penetration != 0)
945 text3 = text3 +
"PEN".lang() + ((Penetration > 0) ?
"+" :
"") + Penetration +
"%, ";
947 text3 = text3.TrimEnd(
' ').TrimEnd(
',');
949 if (!text3.IsEmpty())
951 n.
AddText(
"NoteText_eqstats", text3);
955 n.
AddText(
"NoteText_eqstats",
"tip_range".lang(traitToolRange.BestDist.ToString() ??
""));
963 int totalQuality = GetTotalQuality();
964 int totalQuality2 = GetTotalQuality(applyBonus:
false);
965 text7 = text7 +
"Lv. " + base.LV +
" TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ?
"" : (
" (" + totalQuality2 +
")"));
969 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_nutrition".lang(Evalue(10).ToFormat() ??
"");
971 if ((base.category.IsChildOf(
"throw") || base.category.IsChildOf(
"resource") || trait.IsTool) && !(trait is
TraitAbility))
973 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_hardness".lang(base.material.hardness.ToString() ??
"");
977 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_max_quality".lang(recipe.GetQualityBonus().ToString() ??
"");
979 if (!text7.IsEmpty())
981 n.
AddText(
"NoteText_eqstats", text7);
985 string detail = GetDetail();
986 if (!detail.IsEmpty())
988 LayoutElement component = n.
AddText(
"NoteText_flavor", detail).GetComponent<LayoutElement>();
991 component.preferredWidth = 400f;
999 n.
AddText(
"NoteText_flavor", traitBookPlan.
source.GetDetail());
1002 if (traitAbility !=
null)
1013 n.
AddText(
"(id:" +
id +
" tile:" + (source.
tiles.IsEmpty() ?
"-" : ((
object)source.
tiles[0]))?.ToString() +
") lv:" + base.LV +
" price:" + GetPrice());
1015 Card rootCard = GetRootCard();
1024 AddText(
"isCategorized".lang(base.category.GetText()),
FontColor.Default);
1025 if (base.category.skill != 0)
1027 int key = base.category.skill;
1029 if (base.IsRangedWeapon && !base.IsMeleeWeapon)
1037 if (Evalue(482) > 0)
1044 if (base.IsContainer)
1046 AddText(
"isContainer".lang(things.MaxCapacity.ToString() ??
""),
FontColor.Default);
1048 if (base.c_lockLv != 0)
1050 AddText((base.c_lockedHard ?
"isLockedHard" :
"isLocked").lang(base.c_lockLv.ToString() ??
""),
FontColor.Warning);
1052 if (base.isCrafted && recipe ==
null)
1054 AddText(
"isCrafted".lang(),
FontColor.Default);
1056 if (trait.Decay > 0)
1059 text8 = (base.IsDecayed ?
"isRotten" : (base.IsRotting ?
"isRotting" : ((!base.IsFresn) ?
"isNotFresh" :
"isFresh")));
1060 AddText(text8.lang(),
FontColor.Default);
1064 AddText(
"isDyed".lang(base.DyeMat.GetName() ??
""),
FontColor.Default);
1066 if (base.IsEquipment)
1068 text3 =
"isEquipable".lang(
Element.
Get(base.category.slot).GetText());
1071 if (base.isFireproof)
1073 AddText(
"isFreproof",
FontColor.Default);
1075 if (base.isAcidproof)
1077 AddText(
"isAcidproof",
FontColor.Default);
1079 if (trait.Electricity > 0)
1081 AddText(
"isGenerateElectricity".lang(trait.Electricity.ToString() ??
""),
FontColor.Default);
1083 if (trait.Electricity < 0)
1085 AddText(
"isConsumeElectricity".lang(Mathf.Abs(trait.Electricity).ToString() ??
""),
FontColor.Default);
1089 AddText(
"isPrecious",
FontColor.Default);
1095 if (flag && HasTag(
CTAG.noMix))
1099 if (!trait.CanBeDestroyed)
1101 AddText(
"isIndestructable",
FontColor.Default);
1103 if (GetInt(107) > 0)
1111 if (!base.c_idDeity.IsEmpty())
1116 if (base.isGifted && GetRoot() !=
EClass.
pc)
1120 if (base.isNPCProperty)
1122 AddText(
"isNPCProperty",
FontColor.Ether);
1124 if (base.c_priceFix != 0)
1126 AddText(((base.c_priceFix > 0) ?
"isPriceUp" :
"isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ??
""),
FontColor.Ether);
1132 if (trait.IsOnlyUsableByPc)
1134 AddText(
"isOnlyUsableByPC",
FontColor.Ether);
1140 if (base.c_isImportant)
1142 AddText(
"isMarkedImportant",
FontColor.Ether);
1144 if (GetInt(25) != 0)
1146 AddText(
"isDangerLv".lang((GetInt(25) + 1).ToString() ??
"", (
EClass.
pc.
FameLv + 10).ToString() ??
""),
FontColor.Default);
1151 if (HasElement(220))
1153 AddText(
"canMine".lang(), col2);
1155 if (HasElement(225))
1157 AddText(
"canLumberjack".lang(), col2);
1158 AddText(
"canLumberjack2".lang(), col2);
1160 if (HasElement(230))
1162 AddText(
"canDig", col2);
1164 if (HasElement(286))
1166 AddText(
"canFarm", col2);
1168 if (HasElement(245))
1170 AddText(
"canFish", col2);
1172 if (HasElement(237))
1174 AddText(
"canTame", col2);
1179 AddText(
"canPlayMusic".lang(), col2);
1181 if (
Lang.
Has(
"hint_" + trait.ToString()))
1183 AddText(
"hint_" + trait.ToString(),
FontColor.Util);
1185 if (
Lang.
Has(
"hint_" + trait.ToString() +
"2"))
1187 AddText(
"hint_" + trait.ToString() +
"2",
FontColor.Util);
1189 if (HasTag(
CTAG.tourism))
1193 string langPlaceType = base.TileType.LangPlaceType;
1194 if (langPlaceType ==
"place_Door" || langPlaceType ==
"place_WallMount")
1196 AddText(base.TileType.LangPlaceType +
"_hint".lang(),
FontColor.Util);
1198 if (trait.IsHomeItem)
1200 AddText(
"isHomeItem".lang(),
FontColor.Util);
1202 if (HasTag(
CTAG.throwWeapon))
1204 AddText(
"isThrowWeapon",
FontColor.Default);
1208 AddText(
"isThrowWeaponEnemy",
FontColor.Default);
1212 AddText(
"isNoProcessIng",
FontColor.Default);
1220 AddText(
"isLeftoverable",
FontColor.Default);
1222 if (HasTag(
CTAG.rareResource))
1224 AddText(
"isRareResource",
FontColor.Great);
1228 AddText(
"isBed".lang(traitBed.MaxHolders.ToString() ??
""),
FontColor.Default);
1230 bool flag3 = base.IsEquipmentOrRangedOrAmmo || base.IsThrownWeapon;
1231 bool showTraits = !flag3 || base.ShowFoodEnc;
1233 List<Element> listTrait = ListValidTraits(isCraft:
false, !infoMode);
1234 List<Element> list = ListValidTraits(isCraft:
false, limit:
false);
1235 if (list.Count - listTrait.Count <= 1)
1241 Element element = elements.GetElement(653);
1242 if (element !=
null)
1244 AddText(
"isAlive".lang(element.
vBase.ToString() ??
"", (element.
vExp / 10).ToString() ??
"", (element.
ExpToNext / 10).ToString() ??
""),
FontColor.Great);
1248 string[] rangedSubCats =
new string[2] {
"eleConvert",
"eleAttack" };
1249 elements.AddNote(n, delegate(
Element e)
1255 if (e.
IsTrait || (showTraits && listTrait.Contains(e)))
1259 if (e.
source.categorySub ==
"eleAttack" && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon)
1263 return (!showEQStats || (e.
id != 64 && e.
id != 65 && e.
id != 66 && e.
id != 67)) ?
true :
false;
1266 if (sockets !=
null)
1268 foreach (
int socket
in sockets)
1270 AddText((socket == 0) ?
"emptySocket".lang() :
"socket".lang(
EClass.
sources.
elements.map[socket / 1000].GetName(), (socket % 1000).ToString() ??
""),
FontColor.Gray);
1274 trait.WriteNote(n, flag2);
1282 string text14 = e.
source.GetText(
"textExtra");
1283 if (!text14.IsEmpty())
1286 if (e.id == 2 && mode == IInspect.NoteMode.Product)
1288 int num2 = recipe.GetQualityBonus() / 10;
1293 text15 =
"qualityLimit".lang(num2.ToString() ??
"");
1295 int num3 = e.
Value / 10;
1296 num3 = ((e.
Value < 0) ? (num3 - 1) : (num3 + 1));
1297 text14 =
"Lv." + num3 + text15 +
" " + text14;
1300 text14 +=
"traitAdditive".lang();
1302 text13 += (
" <size=12>" + text14 +
"</size>").TagColor(
FontColor.Passive);
1308 if (listTrait.Count != list.Count)
1310 AddText(
"traitOther".lang((list.Count - listTrait.Count).ToString() ??
""),
FontColor.Default);
1313 if (base.c_mixedFoodData !=
null)
1316 foreach (
string text16
in base.c_mixedFoodData.texts)
1318 AddText(
"_bullet".lang() + text16 + text2,
FontColor.Default);
1324 AddText(
"isUnidentified".lang(),
FontColor.Flavor);
1325 if (base.c_IDTState == 1)
1327 AddText(
"isUnidentified2".lang(),
FontColor.Flavor);
1332 n.AddHeader(
"HeaderAdditionalTrait",
"additional_trait");
1338 string text11 = e.
source.GetText(
"textExtra");
1339 if (!text11.IsEmpty())
1342 int num = e.Value / 10;
1343 num = ((e.Value < 0) ? (num - 1) : (num + 1));
1344 text11 =
"Lv." + num + text12 +
" " + text11;
1345 if (infoMode && e.IsFoodTraitMain)
1347 text11 +=
"traitAdditive".lang();
1349 text10 += (
" <size=12>" + text11 +
"</size>").TagColor(
FontColor.Passive);
1357 n.AddText(
"decay:" + base.decay);
1358 n.AddText(base.isDyed +
"/" +
id +
"/" + base.refVal +
"/" + base.LV +
"/" + trait);
1359 if (source.
origin !=
null)
1364 if (
id ==
"statue_weird")
1366 AddText(
"weirdStatue",
FontColor.Default);
1370 AddText(
"isReplica",
FontColor.Passive);
1379 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara !=
null)
1381 AddAttackEvaluation(n, chara,
this);
1383 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1385 n.AddHeader(
"headerAttackEval");
1388 text9 = text9.TagColor(() =>
true);
1392 if (base.ammoData !=
null)
1394 n.AddHeader(
"headerAttackAmmo");
1395 n.AddText(base.ammoData.Name);
1397 onWriteNote?.Invoke(n);
1400 AddText(
"isProductWarning",
FontColor.Default);
1408 foreach (
Element value
in elements.dict.Values)
1414 void AddText(
string text,
FontColor col)
1416 n.AddText(
"NoteText_enc", text, col);
1418 void AddTextWithIcon(
string text, Sprite sprite,
FontColor col)
1420 UIItem uIItem2 = n.AddText(
"NoteText_enc", text, col);
1421 uIItem2.
image1.SetActive(enable:
true);
1422 uIItem2.image1.sprite = sprite;
1438 if (slot.
thing == current)
1440 text = text.TagColor(() =>
true);
1449 text2 = text2.TagColor(() =>
true);
1456 p.matColor = base.colorInt;
1457 p.mat = base.material;
1458 if (!renderer.usePass)
1462 switch (trait.tileMode)
1465 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1467 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1471 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1476 p.color += 1572864f;
1482 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1484 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1488 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1490 if (animeCounter > 0f && source.
anime.Length != 0)
1492 animeCounter += Time.deltaTime;
1493 int num3 = (int)(animeCounter / (0.001f * (
float)source.
anime[1]));
1494 if (num3 > ((source.
anime.Length > 2) ? source.
anime[2] : source.
anime[0]))
1500 p.tile += num3 % source.
anime[0] * ((!flipX) ? 1 : (-1));
1505 if (base.isOn || base.isRoofItem)
1507 int num4 = (int)((
float)base.uid + Time.realtimeSinceStartup * 5f);
1508 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1509 p.tile = (sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1514 else if (num5 % 11 == 0)
1520 p.color = 13107200f;
1525 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1529 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1531 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1535 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1537 if (parent is
Zone && pos.cell.HasFullBlock)
1539 p.tile += ((p.tile < 0f) ? (-64) : 64);
1543 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1547 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1549 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1553 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1555 if (source.
anime.Length == 0 || !trait.IsAnimeOn)
1559 if (source.
anime.Length > 2)
1561 float num = Time.realtimeSinceStartup * 1000f / (float)source.
anime[1] % (
float)source.
anime[2];
1562 if ((
int)num == source.
anime[0] - 1 && source.anime.Length > 3)
1564 PlaySound(
"anime_sound" + source.
anime[3]);
1566 if (!(num >= (
float)source.
anime[0]))
1568 p.tile += num * (float)((!flipX) ? 1 : (-1));
1573 float num2 = Time.realtimeSinceStartup * 1000f / (float)source.
anime[1] % (
float)source.
anime[0];
1574 p.tile += num2 * (float)((!flipX) ? 1 : (-1));
1578 if (trait.IdSkin != 0)
1580 int index = trait.IdSkin - 1;
1581 if (sourceCard.
skins.Length != 0)
1583 p.tile += ((p.tile < 0f) ? (-sourceCard.
skins.TryGet(index)) : sourceCard.
skins.TryGet(index));
1593 if (!renderer.data.subCrate.enable)
1597 return renderer.data.subCrate;
1620 if (!trait.CanStackTo(to))
1624 if (base.noSell != to.
noSell || base.isCopy != to.
isCopy)
1652 if (trait.IsRequireFuel && base.c_charges != to.
c_charges)
1660 if (base.Num + to.
Num <= 0)
1668 if (windowSaveData !=
null && windowSaveData.
compress)
1675 if (base.encLV != to.
encLV && !base.IsFood)
1683 foreach (
Element value
in elements.dict.Values)
1690 int num2 = (to.encLV = Mathf.CeilToInt(1f * (
float)(base.encLV * base.Num + to.encLV * to.
Num) / (
float)(base.Num + to.
Num)));
1692 foreach (
Element value2
in elements.dict.Values)
1695 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.
Num) / (base.Num + to.
Num));
1699 if (base.encLV != to.
encLV)
1707 foreach (
Element value3
in elements.dict.Values)
1709 Element element2 = to.elements.GetElement(value3.
id);
1710 if (element2 ==
null || value3.
vBase / 10 * 10 != element2.
vBase / 10 * 10)
1720 if (ing.CanSetThing(
this))
1724 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1728 foreach (
Thing thing
in things)
1740 if (GetRootCard().Dist(
EClass.
pc) > 1 || !ing.CanSetThing(
this))
1763 bool buy = trans !=
null;
1765 UIItem itemSlider =
null;
1774 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1777 buttonBuy = i.
AddButton(
"invBuy", delegate
1782 i.onDestroy = delegate
1790 if ((
bool)buttonBuy)
1792 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1799 Debug.Log(
"Split bug1");
1803 Debug.Log(
"Split bug2");
1807 Debug.Log(
"Split bug3");
1809 else if (count != 0 && !Input.GetMouseButton(1))
1813 trans.Process(startTransaction:
true);
1818 if (count != base.Num)
1822 thing.invX = dragItemCard.
from.
invX;
1823 thing.invY = dragItemCard.
from.
invY;
1833 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1834 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1835 if ((
bool)buttonBuy)
1837 buttonBuy.mainText.SetText(trans.GetTextDetail());
1838 buttonBuy.mainText.RebuildLayoutTo<
UIButton>();
1839 buttonBuy.interactable = trans.IsValid();
1840 buttonBuy.RebuildLayout(recursive:
true);
1841 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1851 UIItem itemSlider =
null;
1852 itemSlider = uIContextMenu.
AddSlider(
"sliderSplitMenu",
"adjustmentNum", (
float a) => (!
EClass.
core.
IsGameStarted) ?
"" : (
"/" + base.Num), count, delegate(
float b)
1856 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1857 buttonBuy = uIContextMenu.
AddButton(
"invBuy", delegate
1861 uIContextMenu.onDestroy = delegate
1864 uIContextMenu.
Show();
1865 if ((
bool)buttonBuy)
1867 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1874 Debug.Log(
"Split bug1");
1878 Debug.Log(
"Split bug2");
1882 Debug.Log(
"Split bug3");
1884 else if (count != 0 && !Input.GetMouseButton(1))
1886 onSplit?.Invoke(count);
1891 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1892 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1895 buttonBuy.interactable =
true;
1896 buttonBuy.RebuildLayout(recursive:
true);
1925 if ((!
neg || !row.tag.Contains(
"flag")) && func(row) && row.LV < num2)
1939 num4 +=
item.chance;
1943 bool flag = text ==
"skill" || text ==
"attribute" || text ==
"resist";
1944 float num5 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt(lv *
item.encFactor / 100);
1945 int num6 = (item.mtp +
EClass.
rnd(
item.mtp + (
int)num5)) / item.mtp * ((!(flag &&
neg)) ? 1 : (-1));
1946 if (
item.encFactor == 0 && num6 > 25)
1958 if (!base.IsEquipment || base.IsCursed || base.rarity <=
Rarity.Normal || GetInt(107) > 0)
1968 c.
Say(
"lick", c,
this);
1969 PlaySound(
"offering");
1970 PlayEffect(
"mutation");
1972 Element element = AddEnchant(base.LV);
1973 if (element !=
null)
1975 SetInt(107, element.
id);
1981 List<Element> list =
new List<Element>();
1982 foreach (
Element value
in elements.dict.Values)
1984 if (value.
id != 67 && value.
id != 66 && value.
id != 64 && value.
id != 65)
1991 Element element2 = list.RandomItem();
1992 elements.ModBase(element2.
id, Mathf.Max(
EClass.
rnd(Mathf.Abs(element2.
vBase / 5)), 1));
1993 SetInt(107, element2.
id);
1997 c.
Say(
"lick2", c, tg, slot.
name.ToLower());
1998 tg.PlaySound(
"offering");
1999 tg.PlayEffect(
"mutation");
2007 if (base.IsToolbelt || base.IsLightsource)
2012 if (enchant ==
null)
2016 return elements.ModBase(enchant.Item1.id, enchant.Item2);
2025 if (base.IsIdentified)
2033 @ref = GetName(
NameStyle.Full, base.Num);
2035 Rarity rarity = idtSource
switch
2037 IDTSource.SkillHigh =>
Rarity.Legendary,
2038 IDTSource.Skill =>
Rarity.Superior,
2041 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >=
Rarity.Mythical))
2043 base.c_IDTState = 3;
2045 else if (base.rarity >=
Rarity.Mythical && idtSource !=
IDTSource.SuperiorIdentify)
2047 base.c_IDTState = 1;
2051 base.c_IDTState = 0;
2055 text = GetName(
NameStyle.Full, base.Num);
2056 if (base.c_IDTState == 0)
2058 Msg.
Say(
"identified", @ref, text);
2062 Msg.
Say((idtSource ==
IDTSource.Skill) ?
"identified3" :
"identified2", @ref, text, base.TextRarity);
2065 if (base.IsIdentified)
2067 GetRootCard()?.TryStack(
this);
2077 DNA dNA = base.c_DNA;
2082 for (
int i = 0; i < dNA.
vals.Count; i += 2)
2085 if (row.
name.ToLower().Contains(s))
2089 if (row.
GetName().ToLower().Contains(s))
2097 if (!base.IsIdentified)
2101 foreach (
Element value
in elements.dict.Values)
2103 if (value.
Value != 0)
2105 if (value.
source.name.ToLower().Contains(s))
2109 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 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 IsLeftoverable(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)