2using System.Collections.Generic;
37 if (
source.substats.Length == 0)
69 return (
int)((long)(base.isWeightChanged ? base.c_weight :
source.weight) * (long)base.material.weight / 100);
71 if (!base.isWeightChanged)
101 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
113 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
161 return 50 + base.LV * 10 + base.encLV * 10 + (int)base.rarity * 10 + (
int)base.blessedState * 10;
174 Debug.LogWarning(
"Thing " +
id +
" not found");
186 else if (base.category.ignoreBless == 0 &&
bp.
rarity ==
Rarity.Random && base.rarity !=
Rarity.Artifact)
196 else if (
EClass.
rnd(50) == 0 && base.category.slot != 0)
206 if (text ==
"bill_tax" || text ==
"bill")
210 if (base.category.slot != 0)
213 if (base.rarity ==
Rarity.Superior)
217 else if (base.rarity ==
Rarity.Legendary)
221 else if (base.rarity ==
Rarity.Mythical)
225 else if (base.rarity >=
Rarity.Artifact)
231 for (
int i = 0; i < num; i++)
247 int num3 = ((
EClass.
rnd(10) == 0) ? 1 : 0);
248 if (base.rarity ==
Rarity.Superior)
252 else if (base.rarity ==
Rarity.Legendary)
256 else if (base.rarity ==
Rarity.Mythical)
260 else if (base.rarity >=
Rarity.Artifact)
264 if (
id ==
"bow_vindale")
270 for (
int j = 0; j < num2; j++)
276 for (
int k = 0; k <
EClass.
rnd(num2 + 1); k++)
288 if (
id ==
"shield_flower")
359 base.isReplica =
true;
364 bool flag2 = (base.isFireproof =
false);
365 base.isAcidproof = flag2;
373 if (
source.offense.Length != 0)
375 base.c_diceDim =
source.offense[1];
377 if (
source.offense.Length > 2)
379 SetBase(66,
source.offense[2]);
381 if (
source.offense.Length > 3)
383 SetBase(67,
source.offense[3]);
385 if (
source.defense.Length != 0)
387 SetBase(64,
source.defense[0]);
389 if (
source.defense.Length > 1)
391 SetBase(65,
source.defense[1]);
397 bool flag3 = !base.IsAmmo;
398 if (base.rarity <=
Rarity.Crude)
402 else if (base.rarity ==
Rarity.Superior)
406 else if (base.rarity >=
Rarity.Legendary)
410 if (
source.offense.Length != 0)
412 base.c_diceDim =
source.offense[1] * base.material.dice / (num + (flag3 ?
EClass.
rnd(25) : 0));
414 if (
source.offense.Length > 2)
416 SetBase(66,
source.offense[2] * base.material.atk * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
418 if (
source.offense.Length > 3)
420 SetBase(67,
source.offense[3] * base.material.dmg * 5 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
422 if (
source.defense.Length != 0)
424 SetBase(64,
source.defense[0] * base.material.dv * 7 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
426 if (
source.defense.Length > 1)
428 SetBase(65,
source.defense[1] * base.material.pv * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
433 if (
source.offense.Length != 0)
435 base.c_diceDim = Mathf.Max(
source.offense[1] / 3, 1);
437 if (
source.offense.Length > 2)
439 SetBase(66,
source.offense[2] / 3);
441 if (
source.offense.Length > 3)
443 SetBase(67,
source.offense[3] / 3);
445 if (
source.defense.Length != 0)
447 SetBase(64,
source.defense[0] / 3);
449 if (
source.defense.Length > 1)
451 SetBase(65,
source.defense[1] / 3);
454 if (base.IsEquipmentOrRangedOrAmmo)
456 if (base.IsWeapon || base.IsAmmo)
470 for (
int i = 0; i <
sockets.Count; i++)
473 int num3 = num2 / 1000;
474 if (num3 == 67 && dmgSet)
478 if (num3 == 66 && hitSet)
482 if (num3 == 65 && pvSet)
488 if (base.material ==
null || base.material.elements ==
null)
490 Debug.Log(base.idMaterial +
"/" + base.material?.name +
"/" + base.material?.elements);
493 string[] bits = base.material.bits;
494 foreach (
string text
in bits)
496 if (!(text ==
"fire"))
500 base.isAcidproof =
true;
505 base.isFireproof =
true;
508 if (base.rarity >=
Rarity.Artifact)
510 bool flag2 = (base.isFireproof =
true);
511 base.isAcidproof = flag2;
514 void SetBase(
int ele,
int a)
534 int num = ((_num == -1) ? base.Num : _num);
541 string text6 =
source.GetText(
"unit");
543 bool num2 = base.IsIdentified ||
source.unknown.IsEmpty();
544 bool isEquipmentOrRangedOrAmmo = base.IsEquipmentOrRangedOrAmmo;
545 bool flag = Lang.setting.nameStyle == 0;
548 if (base.c_idRefCard.IsEmpty() && !base.c_altName.IsEmpty())
550 text = base.c_altName;
556 if (array.Length > 1)
565 if (isEquipmentOrRangedOrAmmo && base.IsIdentified && base.rarity >=
Rarity.Legendary)
567 if (base.rarity !=
Rarity.Artifact && !base.material.GetTextArray(
"altName").IsEmpty())
569 text = base.material.GetTextArray(
"altName")[0] + Lang.space + text;
573 if (
source.naming ==
"m" || (
source.naming ==
"ms" && base.material !=
source.DefaultMaterial))
575 if (isEquipmentOrRangedOrAmmo)
577 string[] textArray = base.material.GetTextArray(
"altName");
578 if (textArray !=
null && textArray.Length >= 2)
580 text = base.material.GetTextArray(
"altName")[1] + Lang.space + text;
584 text =
"_of2".lang(base.material.GetName(), text);
589 string idUnknown =
source.GetText(
"unknown");
590 if (idUnknown.StartsWith(
"#"))
594 idUnknown =
Lang.
GetList(idUnknown.Remove(0, 1)).RandomItem();
602 text =
"_halfeaten".lang(text);
604 if (base.c_bill != 0)
606 text =
"_of".lang(
Lang.
_currency(base.c_bill, showUnit:
true, 0), text);
611 text =
Lang.
GetList((base.category.id ==
"fish") ?
"quality_fish" :
"quality_general")[Mathf.Clamp(base.tier, 0, 3)] + text;
621 if (!base.c_refText.IsEmpty())
623 text =
"_named".lang(base.c_refText, text);
625 if (base.IsIdentified)
629 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hIT != 0 || dMG != 0) && source.offense.Length != 0)
632 if (
source.offense[0] != 0)
634 text7 = text7 +
source.offense[0] +
"d" + base.c_diceDim;
638 text7 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dMG.ToText() : (dMG.ToString() ??
""));
642 text7 = text7 + ((dMG != 0 ||
source.offense[0] != 0) ?
", " :
"") + hIT;
644 text2 = text2 +
" (" + text7.IsEmpty(
" - ") +
") ";
648 if (dV != 0 || pV != 0)
651 text2 = text2 + dV +
", " + pV;
656 text2 = text2 +
" " +
"itemCharges".lang(base.c_charges.ToString() ??
"");
659 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
661 text2 = Lang.space +
"(" + base.TextRarity.ToTitleCase() +
")";
665 text =
"rotten".lang() + text;
667 else if (base.IsRotting)
669 text =
"rotting".lang() + text;
671 if (base.IsIdentified)
673 if (base.blessedState != 0)
675 text4 = (
"bs" + base.blessedState).lang();
682 text = (isEquipmentOrRangedOrAmmo ? text.Bracket(3) : text);
688 if (isEquipmentOrRangedOrAmmo)
692 sig = AliasGen.GetRandomAlias().Bracket((base.rarity ==
Rarity.Mythical) ? 3 : 2);
694 sig = Lang.space + sig;
701 if (base.category.tag.Contains(
"enc"))
703 if (base.c_altName.IsEmpty())
706 text =
"_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text);
711 sig = sig + Lang.space + ((base.encLV > 0) ? (
"+" + base.encLV) : (base.encLV.ToString() ??
""));
714 if (base.c_lockLv != 0 && base.c_revealLock)
716 sig = sig + Lang.space +
"+" + base.c_lockLv;
718 if (base.isLostProperty)
720 text =
"_lostproperty".lang(text);
724 text5 +=
"equippedItem".lang();
728 string text8 = base.c_note;
729 if (text8.StartsWith(
'@'))
731 text8 =
Lang.
Note.map.TryGetValue(text8.TrimStart(
'@'))?.GetText(
"text") ?? base.c_note;
733 string text9 = (base.category.IsChildOf(
"book") ?
"_written" :
"_engraved");
734 if (
id ==
"grave_dagger1" ||
id ==
"grave_dagger2")
736 text9 =
"_daggerGrave";
738 text = ((!text8.Contains(
"_bracketLeft".lang())) ? text9.lang(text8, text) : (text9 +
"Alt").lang(text8, text));
740 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))));
741 if (base.rarity >=
Rarity.Legendary)
743 text = text.ToTitleCase(wholeText:
true);
752 text5 =
"_limitedStock".lang(text5);
754 return text5 + text3 + text + sig + text2 + text10;
758 if (
source.naming ==
"ma")
760 text = base.material.GetName();
764 if (!base.c_idRefCard.IsEmpty() && trait.RefCardName !=
RefCardName.None)
766 string text11 = base.c_altName.IsEmpty(base.refCard.GetName());
767 if (!base.c_idRefCard2.IsEmpty())
769 text11 =
"_and".lang(text11, base.c_altName2.IsEmpty(base.refCard2.GetName()));
771 if (!(text11 ==
"*r"))
773 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)))));
777 string text12 = base.refCard.GetText(
"aka");
778 if (!text12.IsEmpty())
780 text =
"_of".lang(text12, text);
790 text = text +
" <size=14>(" +
Lang.
_weight(base.ChildrenAndSelfWeight) +
")</size> ";
793 text += Environment.NewLine;
794 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;
796 string hoverText = trait.GetHoverText();
797 if (!hoverText.IsEmpty())
799 text = text + Environment.NewLine + hoverText;
801 return base.GetHoverText() + text;
809 if (things.Count > 0)
811 text +=
"childCount".lang(things.Count.ToString() ??
"");
813 else if (trait.CanOpenContainer)
815 text +=
"empty".lang();
820 Room room = pos.cell.room;
831 List<Element> list =
new List<Element>();
832 if (base.ShowFoodEnc)
834 foreach (
Element value
in elements.dict.Values)
842 if (limit && list.Count > 5)
844 int num = list.Count - 5;
845 for (
int i = 0; i < num; i++)
847 list.RemoveAt(list.Count - 1);
856 List<Element> list = ListLimitedValidTraits(limit);
857 bool showFoodEnc = base.ShowFoodEnc;
861 foreach (
Element value
in elements.dict.Values)
869 foreach (
Element value2
in elements.dict.Values)
881 if (sourceCard.
_origin ==
"dish")
889 bool showEQStats = base.IsEquipmentOrRangedOrAmmo;
891 bool flag2 = base.IsIdentified || flag;
893 if (base.rarity ==
Rarity.Legendary || base.rarity ==
Rarity.Mythical)
895 string text4 = (text3.Contains(
"『") ?
"『" : (text3.Contains(
"《") ?
"《" :
""));
898 string[] array = text3.Split(text4);
899 text3 = array[0] + Environment.NewLine + text4 + array[1];
906 text3 = recipe.GetName();
908 if (trait.CraftNum > 1)
910 text3 = text3 +
" x " + trait.CraftNum;
923 uIItem.
image2.Rect().pivot =
new Vector2(0.5f, 0.5f);
924 string text5 = base.Num.ToFormat() ??
"";
925 string text6 = (0.01f * (float)base.ChildrenAndSelfWeight * 0.1f).ToString((base.ChildrenAndSelfWeight == 0) ?
"F0" : ((base.ChildrenAndSelfWeight >= 1000) ?
"F1" :
"F2")) +
"s";
926 if (things.Count > 0)
928 text5 = text5 +
" (" + things.Count +
")";
930 if (base.ChildrenAndSelfWeight != SelfWeight)
932 text6 = text6 +
" (" + (Mathf.Ceil(0.01f * (
float)SelfWeight) * 0.1f).ToString(
"F1") +
"s)";
934 text3 =
"_quantity".lang(text5 ??
"", text6);
937 text3 = text3 +
"(" + base.ChildrenAndSelfWeight +
")";
941 text3 = text3 +
" " +
"_recipe_lv".lang(recipe.RecipeLv.ToString() ??
"");
944 if (showEQStats && flag2)
947 if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
951 text3 = text3 +
"DMG".lang() + ((base.DMG > 0) ?
"+" :
"") + base.DMG +
", ";
955 text3 = text3 +
"HIT".lang() + ((base.HIT > 0) ?
"+" :
"") + base.HIT +
", ";
959 text3 = text3 +
"DV".lang() + ((DV > 0) ?
"+" :
"") + DV +
", ";
963 text3 = text3 +
"PV".lang() + ((PV > 0) ?
"+" :
"") + PV +
", ";
965 if (Penetration != 0)
967 text3 = text3 +
"PEN".lang() + ((Penetration > 0) ?
"+" :
"") + Penetration +
"%, ";
969 text3 = text3.TrimEnd(
' ').TrimEnd(
',');
971 if (!text3.IsEmpty())
973 n.
AddText(
"NoteText_eqstats", text3);
977 n.
AddText(
"NoteText_eqstats",
"tip_range".lang(traitToolRange.BestDist.ToString() ??
""));
985 int totalQuality = GetTotalQuality();
986 int totalQuality2 = GetTotalQuality(applyBonus:
false);
987 text7 = text7 +
"Lv. " + base.LV +
" TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ?
"" : (
" (" + totalQuality2 +
")"));
991 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_nutrition".lang(Evalue(10).ToFormat() ??
"");
993 if ((base.category.IsChildOf(
"throw") || base.category.IsChildOf(
"resource") || trait.IsTool) && !(trait is
TraitAbility))
995 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_hardness".lang(base.material.hardness.ToString() ??
"");
999 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_max_quality".lang(recipe.GetQualityBonus().ToString() ??
"");
1001 if (!text7.IsEmpty())
1003 n.
AddText(
"NoteText_eqstats", text7);
1007 string detail = GetDetail();
1008 if (!detail.IsEmpty())
1010 LayoutElement component = n.
AddText(
"NoteText_flavor", detail).GetComponent<LayoutElement>();
1013 component.preferredWidth = 400f;
1021 n.
AddText(
"NoteText_flavor", traitBookPlan.
source.GetDetail());
1024 if (traitAbility !=
null)
1035 n.
AddText(
"(id:" +
id +
" tile:" + (source.
tiles.IsEmpty() ?
"-" : ((
object)source.
tiles[0]))?.ToString() +
") lv:" + base.LV +
" price:" + GetPrice());
1037 Card root = GetRootCard();
1046 AddText(
"isCategorized".lang(base.category.GetText()),
FontColor.Default);
1047 if (base.category.skill != 0)
1049 int key = base.category.skill;
1051 if (base.IsRangedWeapon && !base.IsMeleeWeapon)
1059 if (Evalue(482) > 0)
1066 if (base.IsContainer)
1068 AddText(
"isContainer".lang(things.MaxCapacity.ToString() ??
""),
FontColor.Default);
1070 if (base.c_lockLv != 0)
1072 AddText((base.c_lockedHard ?
"isLockedHard" :
"isLocked").lang(base.c_lockLv.ToString() ??
""),
FontColor.Warning);
1074 if (base.isCrafted && recipe ==
null)
1076 AddText(
"isCrafted".lang(),
FontColor.Default);
1078 if (trait.Decay > 0)
1081 text8 = (base.IsDecayed ?
"isRotten" : (base.IsRotting ?
"isRotting" : ((!base.IsFresn) ?
"isNotFresh" :
"isFresh")));
1082 AddText(text8.lang(),
FontColor.Default);
1086 AddText(
"isDyed".lang(base.DyeMat.GetName() ??
""),
FontColor.Default);
1088 if (base.IsEquipment)
1090 text3 =
"isEquipable".lang(
Element.
Get(base.category.slot).GetText());
1093 if (base.isFireproof)
1095 AddText(
"isFreproof",
FontColor.Default);
1097 if (base.isAcidproof)
1099 AddText(
"isAcidproof",
FontColor.Default);
1101 if (trait.OriginalElectricity > 0)
1103 AddText(
"isGenerateElectricity".lang(trait.OriginalElectricity.ToString() ??
""),
FontColor.Default);
1105 if (trait.OriginalElectricity < 0)
1107 AddText(
"isConsumeElectricity".lang(Mathf.Abs(trait.OriginalElectricity).ToString() ??
""),
FontColor.Default);
1111 AddText(
"isPrecious",
FontColor.Default);
1117 if (flag && HasTag(
CTAG.noMix))
1121 if (!trait.CanBeDestroyed)
1123 AddText(
"isIndestructable",
FontColor.Default);
1125 if (GetInt(107) > 0)
1133 if (!base.c_idDeity.IsEmpty())
1138 if (base.c_uidAttune != 0)
1145 AddText(
"isPartyFood",
FontColor.Ether);
1147 if (base.isGifted && GetRoot() !=
EClass.
pc)
1151 if (base.isNPCProperty)
1153 AddText(
"isNPCProperty",
FontColor.Ether);
1155 if (base.c_priceFix != 0)
1157 AddText(((base.c_priceFix > 0) ?
"isPriceUp" :
"isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ??
""),
FontColor.Ether);
1163 if (trait.IsOnlyUsableByPc)
1165 AddText(
"isOnlyUsableByPC",
FontColor.Ether);
1171 if (base.c_isImportant)
1173 AddText(
"isMarkedImportant",
FontColor.Ether);
1175 if (GetInt(25) != 0)
1177 AddText(
"isDangerLv".lang((GetInt(25) + 1).ToString() ??
"", (
EClass.
pc.
FameLv + 10).ToString() ??
""),
FontColor.Default);
1182 if (HasElement(220))
1184 AddText(
"canMine".lang(), col2);
1186 if (HasElement(225))
1188 AddText(
"canLumberjack".lang(), col2);
1189 AddText(
"canLumberjack2".lang(), col2);
1191 if (HasElement(230))
1193 AddText(
"canDig", col2);
1195 if (HasElement(286))
1197 AddText(
"canFarm", col2);
1199 if (HasElement(245))
1201 AddText(
"canFish", col2);
1203 if (HasElement(237))
1205 AddText(
"canTame", col2);
1210 AddText(
"canPlayMusic".lang(), col2);
1212 if (
Lang.
Has(
"hint_" + trait.ToString()))
1214 AddText(
"hint_" + trait.ToString(),
FontColor.Util);
1216 if (
Lang.
Has(
"hint_" + trait.ToString() +
"2"))
1218 AddText(
"hint_" + trait.ToString() +
"2",
FontColor.Util);
1220 if (HasTag(
CTAG.tourism))
1224 string langPlaceType = base.TileType.LangPlaceType;
1225 if (langPlaceType ==
"place_Door" || langPlaceType ==
"place_WallMount")
1227 AddText(base.TileType.LangPlaceType +
"_hint".lang(),
FontColor.Util);
1229 if (trait.IsHomeItem)
1231 AddText(
"isHomeItem".lang(),
FontColor.Util);
1233 if (HasTag(
CTAG.throwWeapon))
1235 AddText(
"isThrowWeapon",
FontColor.Default);
1239 AddText(
"isThrowWeaponEnemy",
FontColor.Default);
1243 AddText(
"isNoProcessIng",
FontColor.Default);
1251 AddText(
"isLeftoverable",
FontColor.Default);
1253 if (HasTag(
CTAG.rareResource))
1255 AddText(
"isRareResource",
FontColor.Great);
1259 AddText(
"isBed".lang(traitBed.MaxHolders.ToString() ??
""),
FontColor.Default);
1261 bool showAsEquipment = base.IsEquipmentOrRangedOrAmmo || base.IsThrownWeapon || trait is
TraitToolMusic;
1262 bool showTraits = !showAsEquipment || base.ShowFoodEnc;
1264 List<Element> listTrait = ListValidTraits(isCraft:
false, !infoMode);
1265 List<Element> list = ListValidTraits(isCraft:
false, limit:
false);
1266 if (list.Count - listTrait.Count <= 1)
1272 Element element = elements.GetElement(653);
1273 if (element !=
null)
1275 AddText(
"isAlive".lang(element.
vBase.ToString() ??
"", (element.
vExp / 10).ToString() ??
"", (element.
ExpToNext / 10).ToString() ??
""),
FontColor.Great);
1277 string[] rangedSubCats =
new string[2] {
"eleConvert",
"eleAttack" };
1278 elements.AddNote(n, delegate(
Element e)
1280 if (!showAsEquipment && !e.
HasTag(
"itemEnc"))
1288 if (e.
IsTrait || (showTraits && listTrait.Contains(e)))
1294 if (e.source.tag.Contains(
"weaponEnc") && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon && !(trait is TraitToolMusic))
1298 if (e.
source.IsWeaponEnc && !base.category.IsChildOf(
"shield") && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon && !(trait is
TraitToolMusic))
1303 return (!showEQStats || (e.
id != 64 && e.
id != 65 && e.
id != 66 && e.
id != 67)) ?
true :
false;
1311 if (e.
source.IsWeaponEnc && (!e.
source.tag.Contains(
"modRanged") || e.
id == 609) && isEquipped && root.
isChara)
1314 if (num4 != 482 && (uint)(num4 - 660) > 2u && num4 != 666)
1319 string text13 =
" (" + e.Value + ((e.Value == num3) ?
"" : (
" → " + num3)) +
")";
1320 string text14 =
"_bracketLeft3".lang() + e.Name +
"_bracketRight3".lang();
1321 return s + text13 +
" " + text14;
1323 if (sockets !=
null)
1325 foreach (
int socket
in sockets)
1327 AddText((socket == 0) ?
"emptySocket".lang() :
"socket".lang(
EClass.
sources.
elements.map[socket / 1000].GetName(), (socket % 1000).ToString() ??
""),
FontColor.Gray);
1331 trait.WriteNote(n, flag2);
1339 if (listTrait.Count != list.Count)
1341 AddText(
"traitOther".lang((list.Count - listTrait.Count).ToString() ??
""),
FontColor.Default);
1344 if (base.c_mixedFoodData !=
null)
1346 n.AddHeader(
"isMixedFood");
1347 foreach (
string text15
in base.c_mixedFoodData.texts)
1349 AddText(
"_bullet".lang() + text15 + text2,
FontColor.Default);
1355 AddText(
"isUnidentified".lang(),
FontColor.Flavor);
1356 if (base.c_IDTState == 1)
1358 AddText(
"isUnidentified2".lang(),
FontColor.Flavor);
1363 n.AddHeader(
"HeaderAdditionalTrait",
"additional_trait");
1371 n.AddText(
"decay:" + base.decay);
1372 n.AddText(base.isDyed +
"/" +
id +
"/" + base.refVal +
"/" + base.LV +
"/" + trait);
1373 if (source.
origin !=
null)
1378 if (
id ==
"statue_weird")
1380 AddText(
"weirdStatue",
FontColor.Default);
1384 AddText(
"isReplica",
FontColor.Passive);
1393 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara2 !=
null)
1395 AddAttackEvaluation(n, chara2,
this);
1397 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1399 n.AddHeader(
"headerAttackEval");
1402 text9 = text9.TagColor(() =>
true);
1406 if (base.ammoData !=
null)
1408 n.AddHeader(
"headerAttackAmmo");
1409 n.AddText(base.ammoData.Name);
1411 onWriteNote?.Invoke(n);
1414 AddText(
"isProductWarning",
FontColor.Default);
1422 foreach (
Element value
in elements.dict.Values)
1428 void AddText(
string text,
FontColor col)
1430 n.AddText(
"NoteText_enc", text, col);
1432 void AddTextWithIcon(
string text, Sprite sprite,
FontColor col)
1434 UIItem uIItem2 = n.AddText(
"NoteText_enc", text, col);
1435 uIItem2.
image1.SetActive(enable:
true);
1436 uIItem2.image1.sprite = sprite;
1438 string GetTextTrait(
Element e)
1440 string text10 = e.
source.GetText(
"textExtra");
1441 if (text10.IsEmpty())
1447 text10 = text10.Replace(
"#1",
$"{0.1f * (float)(e.Value + 10):F1}");
1452 int num = recipe.GetQualityBonus() / 10;
1457 text11 =
"qualityLimit".lang(num.ToString() ??
"");
1459 int num2 = e.Value / 10;
1460 num2 = ((e.Value < 0) ? (num2 - 1) : (num2 + 1));
1461 string text12 = num2.ToString() ??
"";
1464 text12 = (int)((
float)num2 * 0.1f * (float)(Evalue(710) + 10)) +
" (" + num2 +
")";
1466 text10 =
"Lv." + text12 + text11 +
" " + text10;
1469 text10 +=
"traitAdditive".lang();
1471 return (
" <size=12>" + text10 +
"</size>").TagColor(
FontColor.Passive);
1479 foreach (
BodySlot slot
in chara.body.slots)
1487 if (slot.
thing == current)
1489 text = text.TagColor(() =>
true);
1498 text2 = text2.TagColor(() =>
true);
1505 p.matColor = base.colorInt;
1506 p.mat = base.material;
1507 if (!renderer.usePass)
1511 switch (trait.tileMode)
1514 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1516 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1520 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1529 p.color += 1572864f;
1540 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1542 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1546 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1548 if (animeCounter > 0f && source.
anime.Length != 0)
1550 animeCounter += Time.deltaTime;
1551 int num3 = (int)(animeCounter / (0.001f * (
float)source.
anime[1]));
1552 if (num3 > ((source.
anime.Length > 2) ? source.
anime[2] : source.
anime[0]))
1558 p.tile += num3 % source.
anime[0] * ((!flipX) ? 1 : (-1));
1563 if (base.isOn || base.isRoofItem)
1565 int num4 = (int)((
float)base.uid + Time.realtimeSinceStartup * 5f);
1566 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1567 p.tile = (sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1572 else if (num5 % 11 == 0)
1578 p.color = 13107200f;
1583 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1587 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1589 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1593 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1595 if (parent is
Zone && pos.cell.HasFullBlock)
1597 p.tile += ((p.tile < 0f) ? (-64) : 64);
1601 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1606 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1608 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1612 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1614 float time = Time.realtimeSinceStartup;
1622 if (source.
anime.Length == 0 || !trait.IsAnimeOn)
1626 if (source.
anime.Length > 2)
1628 int num = (int)(time * 1000f / (
float)source.
anime[1] % (float)source.
anime[2]);
1629 if (num == source.
anime[0] - 1 && source.
anime.Length > 3)
1631 PlaySound(
"anime_sound" + source.
anime[3]);
1633 if (num < source.
anime[0])
1635 p.tile += num * ((!(p.tile < 0f)) ? 1 : (-1));
1640 int num2 = (int)(time * 1000f / (
float)source.
anime[1] % (float)source.
anime[0]);
1641 p.tile += num2 * ((!(p.tile < 0f)) ? 1 : (-1));
1646 if (trait.IdSkin != 0 && sourceCard.
skins.Length != 0)
1648 int num6 = sourceCard.
skins.TryGet(trait.IdSkin - 1);
1650 p.tile += ((p.tile < 0f) ? (-num6) : num6);
1659 if (!renderer.data.subCrate.enable)
1663 return renderer.data.subCrate;
1686 if (!trait.CanStackTo(to))
1690 if (base.noSell != to.
noSell || base.isCopy != to.
isCopy)
1718 if (trait.IsRequireFuel && base.c_charges != to.
c_charges)
1726 if (base.Num + to.
Num <= 0)
1734 if (windowSaveData !=
null && windowSaveData.
compress)
1741 if (base.encLV != to.
encLV && !base.IsFood)
1749 foreach (
Element value
in elements.dict.Values)
1756 int num2 = (to.encLV = Mathf.CeilToInt(1f * (
float)(base.encLV * base.Num + to.encLV * to.
Num) / (
float)(base.Num + to.
Num)));
1758 foreach (
Element value2
in elements.dict.Values)
1761 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.
Num) / (base.Num + to.
Num));
1765 if (base.encLV != to.
encLV)
1773 foreach (
Element value3
in elements.dict.Values)
1775 Element element2 = to.elements.GetElement(value3.
id);
1776 if (element2 ==
null || value3.
vBase / 10 * 10 != element2.
vBase / 10 * 10)
1786 if (ing.CanSetThing(
this))
1790 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1794 foreach (
Thing thing
in things)
1806 if (GetRootCard().Dist(
EClass.
pc) > 1 || !ing.CanSetThing(
this))
1829 bool buy = trans !=
null;
1831 UIItem itemSlider =
null;
1840 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1843 buttonBuy = i.
AddButton(
"invBuy", delegate
1848 i.onDestroy = delegate
1850 if ((!buy || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !i.
wasCanceled)
1856 if ((
bool)buttonBuy)
1858 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1865 Debug.Log(
"Split bug1");
1869 Debug.Log(
"Split bug2");
1873 Debug.Log(
"Split bug3");
1875 else if (count != 0 && !Input.GetMouseButton(1))
1879 trans.Process(startTransaction:
true);
1884 if (count != base.Num)
1888 thing.invX = dragItemCard.
from.
invX;
1889 thing.invY = dragItemCard.
from.
invY;
1899 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1900 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1901 if ((
bool)buttonBuy)
1903 buttonBuy.mainText.SetText(trans.GetTextDetail());
1904 buttonBuy.mainText.RebuildLayoutTo<
UIButton>();
1905 buttonBuy.interactable = trans.IsValid();
1906 buttonBuy.RebuildLayout(recursive:
true);
1907 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1917 UIItem itemSlider =
null;
1922 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1923 buttonBuy = i.
AddButton(
"invBuy", delegate
1927 i.onDestroy = delegate
1929 if ((Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !i.
wasCanceled)
1935 if ((
bool)buttonBuy)
1937 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1944 Debug.Log(
"Split bug1");
1948 Debug.Log(
"Split bug2");
1952 Debug.Log(
"Split bug3");
1954 else if (count != 0 && !Input.GetMouseButton(1))
1956 onSplit?.Invoke(count);
1961 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1962 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1965 buttonBuy.interactable =
true;
1966 buttonBuy.RebuildLayout(recursive:
true);
1995 if ((!
neg || !row.tag.Contains(
"flag")) && func(row) && row.LV < num2)
2009 num4 +=
item.chance;
2013 bool flag = text ==
"skill" || text ==
"attribute" || text ==
"resist";
2014 float num5 = 3f + Mathf.Min(lv / 10, 15f) + Mathf.Sqrt(lv *
item.encFactor / 100);
2015 int num6 = (item.mtp +
EClass.
rnd(
item.mtp + (
int)num5)) / item.mtp * ((!(flag &&
neg)) ? 1 : (-1));
2016 if (
item.encFactor == 0 && num6 > 25)
2028 if (!base.IsEquipment || base.IsCursed || base.rarity <=
Rarity.Normal || GetInt(107) > 0)
2038 c.
Say(
"lick", c,
this);
2039 PlaySound(
"offering");
2040 PlayEffect(
"mutation");
2042 Element element = AddEnchant(base.LV);
2043 if (element !=
null)
2045 SetInt(107, element.
id);
2051 List<Element> list =
new List<Element>();
2052 foreach (
Element value
in elements.dict.Values)
2054 if (value.
id != 67 && value.
id != 66 && value.
id != 64 && value.
id != 65)
2061 Element element2 = list.RandomItem();
2062 elements.ModBase(element2.
id, Mathf.Max(
EClass.
rnd(Mathf.Abs(element2.
vBase / 5)), 1));
2063 SetInt(107, element2.
id);
2067 c.
Say(
"lick2", c, tg, slot.
name.ToLower());
2068 tg.PlaySound(
"offering");
2069 tg.PlayEffect(
"mutation");
2077 if (base.IsToolbelt || base.IsLightsource)
2082 if (enchant ==
null)
2086 return elements.ModBase(enchant.Item1.id, enchant.Item2);
2095 Msg.
Say(
"attuned",
this, c);
2096 base.c_uidAttune = c.
uid;
2101 if (base.IsIdentified)
2109 @ref = GetName(
NameStyle.Full, base.Num);
2111 Rarity rarity = idtSource
switch
2113 IDTSource.SkillHigh =>
Rarity.Legendary,
2114 IDTSource.Skill =>
Rarity.Superior,
2117 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >=
Rarity.Mythical))
2119 base.c_IDTState = 3;
2121 else if (base.rarity >=
Rarity.Mythical && idtSource !=
IDTSource.SuperiorIdentify)
2123 base.c_IDTState = 1;
2127 base.c_IDTState = 0;
2131 text = GetName(
NameStyle.Full, base.Num);
2132 if (base.c_IDTState == 0)
2134 Msg.
Say(
"identified", @ref, text);
2138 Msg.
Say((idtSource ==
IDTSource.Skill) ?
"identified3" :
"identified2", @ref, text, base.TextRarity);
2141 if (base.IsIdentified)
2143 GetRootCard()?.TryStack(
this);
2153 DNA dNA = base.c_DNA;
2158 for (
int i = 0; i < dNA.
vals.Count; i += 2)
2161 if (row.
name.ToLower().Contains(s))
2165 if (row.
GetName().ToLower().Contains(s))
2173 if (!base.IsIdentified)
2177 foreach (
Element value
in elements.dict.Values)
2179 if (value.
Value != 0)
2181 if (value.
source.name.ToLower().Contains(s))
2185 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
static int GetTwoHandEncBonus(Chara CC, Thing w)
string GetStr(int id, string defaultStr=null)
int GetInt(int id, int? defaultInt=null)
BlessedState? blesstedState
GlobalCharaList globalCharas
ElementContainerCard elements
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
bool HasElement(int ele, bool includeNagative=false)
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)
static SourceElement.Row GetRandomElement(int lv=1, bool useWeight=true)
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)
static Tuple< SourceElement.Row, int > GetEnchant(long lv, Func< SourceElement.Row, bool > func, bool neg)
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()
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 SourcePref GetPref()
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)