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);
591 text =
Lang.
GetList((base.category.id ==
"fish") ?
"quality_fish" :
"quality_general")[Mathf.Clamp(base.tier, 0, 3)] + text;
601 if (!base.c_refText.IsEmpty())
603 text =
"_named".lang(base.c_refText, text);
605 if (base.IsIdentified)
609 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hIT != 0 || dMG != 0) && source.offense.Length != 0)
612 if (
source.offense[0] != 0)
614 text9 = text9 +
source.offense[0] +
"d" + base.c_diceDim;
618 text9 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dMG.ToText() : (dMG.ToString() ??
""));
622 text9 = text9 + ((dMG != 0 ||
source.offense[0] != 0) ?
", " :
"") + hIT;
624 text2 = text2 +
" (" + text9.IsEmpty(
" - ") +
") ";
628 if (dV != 0 || pV != 0)
631 text2 = text2 + dV +
", " + pV;
636 text2 = text2 +
" " +
"itemCharges".lang(base.c_charges.ToString() ??
"");
639 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
641 text2 =
"(" + base.TextRarity.ToTitleCase() +
")";
645 text =
"rotten".lang() + text;
647 else if (base.IsRotting)
649 text =
"rotting".lang() + text;
651 if (base.IsIdentified)
653 if (base.blessedState != 0)
655 text4 = (
"bs" + base.blessedState).lang();
662 text = (isEquipmentOrRangedOrAmmo ? text.Bracket(3) : text);
668 if (isEquipmentOrRangedOrAmmo)
672 sig = AliasGen.GetRandomAlias().Bracket((base.rarity ==
Rarity.Mythical) ? 3 : 2);
674 sig = Lang.space + sig;
681 if (base.category.tag.Contains(
"enc"))
683 if (base.c_altName.IsEmpty())
686 text =
"_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text);
691 sig = sig + Lang.space + ((base.encLV > 0) ? (
"+" + base.encLV) : (base.encLV.ToString() ??
""));
694 if (base.c_lockLv != 0 && base.c_revealLock)
696 sig = sig + Lang.space +
"+" + base.c_lockLv;
698 if (base.isLostProperty)
700 text =
"_lostproperty".lang(text);
704 text5 +=
"equippedItem".lang();
708 string text10 = base.c_note;
709 if (text10.StartsWith(
'@'))
711 text10 =
Lang.
Note.map.TryGetValue(text10.TrimStart(
'@'))?.GetText(
"text") ?? base.c_note;
713 string text11 = (base.category.IsChildOf(
"book") ?
"_written" :
"_engraved");
714 if (
id ==
"grave_dagger1" ||
id ==
"grave_dagger2")
716 text11 =
"_daggerGrave";
718 text = ((!text10.Contains(
"_bracketLeft".lang())) ? text11.lang(text10, text) : (text11 +
"Alt").lang(text10, text));
720 text = (flag ? ((num <= 1) ? (text4 + text) :
"_unit".lang(num.ToFormat() ??
"", text4 + text, text6)) : ((
trait is
TraitAbility) ? text.ToTitleCase(wholeText:
true) : ((!text6.IsEmpty() && (base.IsIdentified ||
source.unknown.IsEmpty())) ?
"_unit".lang((num == 1) ?
"" : (num.ToFormat() ??
""), text, (text4 + text6).AddArticle(num, style2,
source.unit)) : (text4 + text).AddArticle(num, style2,
source.name))));
721 if (base.rarity >=
Rarity.Legendary)
723 text = text.ToTitleCase(wholeText:
true);
732 text5 =
"_limitedStock".lang(text5);
734 return text5 + text3 + text + sig + text2 + text12;
738 if (
source.naming ==
"ma")
740 text = base.material.GetName();
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];
863 text2 = recipe.GetName();
865 if (trait.CraftNum > 1)
867 text2 = text2 +
" x " + trait.CraftNum;
880 uIItem.
image2.Rect().pivot =
new Vector2(0.5f, 0.5f);
881 string text4 = base.Num.ToFormat() ??
"";
882 string text5 = (Mathf.Ceil(0.01f * (
float)base.ChildrenAndSelfWeight) * 0.1f).ToString(
"F1") +
"s";
883 if (things.Count > 0)
885 text4 = text4 +
" (" + things.Count +
")";
887 if (base.ChildrenAndSelfWeight != SelfWeight)
889 text5 = text5 +
" (" + (Mathf.Ceil(0.01f * (
float)SelfWeight) * 0.1f).ToString(
"F1") +
"s)";
891 text2 =
"_quantity".lang(text4 ??
"", text5);
894 text2 = text2 +
" " +
"_recipe_lv".lang(recipe.RecipeLv.ToString() ??
"");
897 if (showEQStats && flag2)
900 if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
904 text2 = text2 +
"DMG".lang() + ((base.DMG > 0) ?
"+" :
"") + base.DMG +
", ";
908 text2 = text2 +
"HIT".lang() + ((base.HIT > 0) ?
"+" :
"") + base.HIT +
", ";
912 text2 = text2 +
"DV".lang() + ((DV > 0) ?
"+" :
"") + DV +
", ";
916 text2 = text2 +
"PV".lang() + ((PV > 0) ?
"+" :
"") + PV +
", ";
918 if (Penetration != 0)
920 text2 = text2 +
"PEN".lang() + ((Penetration > 0) ?
"+" :
"") + Penetration +
"%, ";
922 text2 = text2.TrimEnd(
' ').TrimEnd(
',');
924 if (!text2.IsEmpty())
926 n.
AddText(
"NoteText_eqstats", text2);
930 n.
AddText(
"NoteText_eqstats",
"tip_range".lang(traitToolRange.BestDist.ToString() ??
""));
938 int totalQuality = GetTotalQuality();
939 int totalQuality2 = GetTotalQuality(applyBonus:
false);
940 text6 = text6 +
"Lv. " + base.LV +
" TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ?
"" : (
" (" + totalQuality2 +
")"));
944 text6 = text6 + (text6.IsEmpty() ?
"" :
" ") +
"_nutrition".lang(Evalue(10).ToFormat() ??
"");
946 if ((base.category.IsChildOf(
"resource") || trait.IsTool) && !(trait is
TraitAbility))
948 text6 = text6 + (text6.IsEmpty() ?
"" :
" ") +
"_hardness".lang(base.material.hardness.ToString() ??
"");
952 text6 = text6 + (text6.IsEmpty() ?
"" :
" ") +
"_max_quality".lang(recipe.GetQualityBonus().ToString() ??
"");
954 if (!text6.IsEmpty())
956 n.
AddText(
"NoteText_eqstats", text6);
960 string detail = GetDetail();
961 if (!detail.IsEmpty())
963 LayoutElement component = n.
AddText(
"NoteText_flavor", detail).GetComponent<LayoutElement>();
966 component.preferredWidth = 400f;
974 n.
AddText(
"NoteText_flavor", traitBookPlan.
source.GetDetail());
977 if (traitAbility !=
null)
988 n.
AddText(
"(id:" +
id +
" tile:" + (source.
tiles.IsEmpty() ?
"-" : ((
object)source.
tiles[0]))?.ToString() +
") lv:" + base.LV +
" price:" + GetPrice());
990 Card rootCard = GetRootCard();
999 AddText(
"isCategorized".lang(base.category.GetText()),
FontColor.Default);
1000 if (base.category.skill != 0)
1002 int key = base.category.skill;
1004 if (base.IsRangedWeapon && !base.IsMeleeWeapon)
1012 if (Evalue(482) > 0)
1019 if (base.IsContainer)
1021 AddText(
"isContainer".lang(things.MaxCapacity.ToString() ??
""),
FontColor.Default);
1023 if (base.c_lockLv != 0)
1025 AddText((base.c_lockedHard ?
"isLockedHard" :
"isLocked").lang(base.c_lockLv.ToString() ??
""),
FontColor.Warning);
1027 if (base.isCrafted && recipe ==
null)
1029 AddText(
"isCrafted".lang(),
FontColor.Default);
1031 if (trait.Decay > 0)
1034 text7 = (base.IsDecayed ?
"isRotten" : (base.IsRotting ?
"isRotting" : ((!base.IsFresn) ?
"isNotFresh" :
"isFresh")));
1035 AddText(text7.lang(),
FontColor.Default);
1039 AddText(
"isDyed".lang(base.DyeMat.GetName() ??
""),
FontColor.Default);
1041 if (base.IsEquipment)
1043 text2 =
"isEquipable".lang(
Element.
Get(base.category.slot).GetText());
1046 if (base.isFireproof)
1048 AddText(
"isFreproof",
FontColor.Default);
1050 if (base.isAcidproof)
1052 AddText(
"isAcidproof",
FontColor.Default);
1054 if (trait.Electricity > 0)
1056 AddText(
"isGenerateElectricity".lang(trait.Electricity.ToString() ??
""),
FontColor.Default);
1058 if (trait.Electricity < 0)
1060 AddText(
"isConsumeElectricity".lang(Mathf.Abs(trait.Electricity).ToString() ??
""),
FontColor.Default);
1064 AddText(
"isPrecious",
FontColor.Default);
1070 if (flag && HasTag(
CTAG.noMix))
1076 AddText(
"isNoProcessIng",
FontColor.Default);
1078 if (!trait.CanBeDestroyed)
1080 AddText(
"isIndestructable",
FontColor.Default);
1082 if (GetInt(107) > 0)
1090 if (!base.c_idDeity.IsEmpty())
1095 if (base.isGifted && GetRoot() !=
EClass.
pc)
1099 if (base.isNPCProperty)
1101 AddText(
"isNPCProperty",
FontColor.Ether);
1103 if (base.c_priceFix != 0)
1105 AddText(((base.c_priceFix > 0) ?
"isPriceUp" :
"isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ??
""),
FontColor.Ether);
1111 if (trait.IsOnlyUsableByPc)
1113 AddText(
"isOnlyUsableByPC",
FontColor.Ether);
1119 if (base.c_isImportant)
1121 AddText(
"isMarkedImportant",
FontColor.Ether);
1123 if (GetInt(25) != 0)
1125 AddText(
"isDangerLv".lang((GetInt(25) + 1).ToString() ??
"", (
EClass.
pc.
FameLv + 10).ToString() ??
""),
FontColor.Default);
1130 if (HasElement(220))
1132 AddText(
"canMine".lang(), col2);
1134 if (HasElement(225))
1136 AddText(
"canLumberjack".lang(), col2);
1137 AddText(
"canLumberjack2".lang(), col2);
1139 if (HasElement(230))
1141 AddText(
"canDig", col2);
1143 if (HasElement(286))
1145 AddText(
"canFarm", col2);
1147 if (HasElement(245))
1149 AddText(
"canFish", col2);
1151 if (HasElement(237))
1153 AddText(
"canTame", col2);
1158 AddText(
"canPlayMusic".lang(), col2);
1160 if (
Lang.
Has(
"hint_" + trait.ToString()))
1162 AddText(
"hint_" + trait.ToString(),
FontColor.Util);
1164 if (
Lang.
Has(
"hint_" + trait.ToString() +
"2"))
1166 AddText(
"hint_" + trait.ToString() +
"2",
FontColor.Util);
1168 if (HasTag(
CTAG.tourism))
1172 string langPlaceType = base.TileType.LangPlaceType;
1173 if (langPlaceType ==
"place_Door" || langPlaceType ==
"place_WallMount")
1175 AddText(base.TileType.LangPlaceType +
"_hint".lang(),
FontColor.Util);
1177 if (trait.IsHomeItem)
1179 AddText(
"isHomeItem".lang(),
FontColor.Util);
1181 if (HasTag(
CTAG.throwWeapon))
1183 AddText(
"isThrowWeapon",
FontColor.Default);
1187 AddText(
"isThrowWeaponEnemy",
FontColor.Default);
1193 if (HasTag(
CTAG.rareResource))
1195 AddText(
"isRareResource",
FontColor.Great);
1199 AddText(
"isBed".lang(traitBed.MaxHolders.ToString() ??
""),
FontColor.Default);
1201 bool flag3 = base.IsEquipmentOrRangedOrAmmo || base.IsThrownWeapon;
1202 bool showTraits = !flag3 || base.ShowFoodEnc;
1204 List<Element> listTrait = ListValidTraits(isCraft:
false, !infoMode);
1205 List<Element> list = ListValidTraits(isCraft:
false, limit:
false);
1206 if (list.Count - listTrait.Count <= 1)
1212 Element element = elements.GetElement(653);
1213 if (element !=
null)
1215 AddText(
"isAlive".lang(element.
vBase.ToString() ??
"", (element.
vExp / 10).ToString() ??
"", (element.
ExpToNext / 10).ToString() ??
""),
FontColor.Great);
1219 string[] rangedSubCats =
new string[2] {
"eleConvert",
"eleAttack" };
1220 elements.AddNote(n, delegate(
Element e)
1226 if (e.
IsTrait || (showTraits && listTrait.Contains(e)))
1230 if (e.
source.categorySub ==
"eleAttack" && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon)
1234 return (!showEQStats || (e.
id != 64 && e.
id != 65 && e.
id != 66 && e.
id != 67)) ?
true :
false;
1237 if (sockets !=
null)
1239 foreach (
int socket
in sockets)
1241 AddText((socket == 0) ?
"emptySocket".lang() :
"socket".lang(
EClass.
sources.
elements.map[socket / 100].GetName(), (socket % 100).ToString() ??
""),
FontColor.Gray);
1245 trait.WriteNote(n, flag2);
1246 if (flag2 && showTraits)
1251 string text13 = e.
source.GetText(
"textExtra");
1252 if (!text13.IsEmpty())
1255 if (e.id == 2 && mode == IInspect.NoteMode.Product)
1257 int num2 = recipe.GetQualityBonus() / 10;
1262 text14 =
"qualityLimit".lang(num2.ToString() ??
"");
1264 int num3 = e.
Value / 10;
1265 num3 = ((e.
Value < 0) ? (num3 - 1) : (num3 + 1));
1266 text13 =
"Lv." + num3 + text14 +
" " + text13;
1269 text13 +=
"traitAdditive".lang();
1271 text12 += (
" <size=12>" + text13 +
"</size>").TagColor(
FontColor.Passive);
1277 if (listTrait.Count != list.Count)
1279 AddText(
"traitOther".lang((list.Count - listTrait.Count).ToString() ??
""),
FontColor.Default);
1284 AddText(
"isUnidentified".lang(),
FontColor.Flavor);
1285 if (base.c_IDTState == 1)
1287 AddText(
"isUnidentified2".lang(),
FontColor.Flavor);
1292 n.AddHeader(
"HeaderAdditionalTrait",
"additional_trait");
1298 string text10 = e.
source.GetText(
"textExtra");
1299 if (!text10.IsEmpty())
1302 int num = e.Value / 10;
1303 num = ((e.Value < 0) ? (num - 1) : (num + 1));
1304 text10 =
"Lv." + num + text11 +
" " + text10;
1305 if (infoMode && e.IsFoodTraitMain)
1307 text10 +=
"traitAdditive".lang();
1309 text9 += (
" <size=12>" + text10 +
"</size>").TagColor(
FontColor.Passive);
1317 n.AddText(
"decay:" + base.decay);
1318 n.AddText(base.isDyed +
"/" +
id +
"/" + base.refVal +
"/" + base.LV +
"/" + trait);
1319 if (source.
origin !=
null)
1324 if (
id ==
"statue_weird")
1326 AddText(
"weirdStatue",
FontColor.Default);
1330 AddText(
"isReplica",
FontColor.Passive);
1339 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara !=
null)
1341 AddAttackEvaluation(n, chara,
this);
1343 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1345 n.AddHeader(
"headerAttackEval");
1348 text8 = text8.TagColor(() =>
true);
1352 if (base.ammoData !=
null)
1354 n.AddHeader(
"headerAttackAmmo");
1355 n.AddText(base.ammoData.Name);
1357 onWriteNote?.Invoke(n);
1360 AddText(
"isProductWarning",
FontColor.Default);
1368 foreach (
Element value
in elements.dict.Values)
1374 void AddText(
string text,
FontColor col)
1376 n.AddText(
"NoteText_enc", text, col);
1378 void AddTextWithIcon(
string text, Sprite sprite,
FontColor col)
1380 UIItem uIItem2 = n.AddText(
"NoteText_enc", text, col);
1381 uIItem2.
image1.SetActive(enable:
true);
1382 uIItem2.image1.sprite = sprite;
1398 if (slot.
thing == current)
1400 text = text.TagColor(() =>
true);
1409 text2 = text2.TagColor(() =>
true);
1416 p.matColor = base.colorInt;
1417 p.mat = base.material;
1418 if (!renderer.usePass)
1422 switch (trait.tileMode)
1425 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1427 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1431 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1435 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1437 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1441 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1443 if (source.
anime.Length == 0 || !trait.IsAnimeOn)
1447 if (source.
anime.Length > 2)
1449 float num = Time.realtimeSinceStartup * 1000f / (float)source.
anime[1] % (
float)source.
anime[2];
1450 if ((
int)num == source.
anime[0] - 1 && source.anime.Length > 3)
1452 PlaySound(
"anime_sound" + source.
anime[3]);
1454 if (!(num >= (
float)source.
anime[0]))
1456 p.tile += num * (float)((!flipX) ? 1 : (-1));
1461 float num2 = Time.realtimeSinceStartup * 1000f / (float)source.
anime[1] % (
float)source.
anime[0];
1462 p.tile += num2 * (float)((!flipX) ? 1 : (-1));
1466 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1468 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1472 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1474 if (animeCounter > 0f && source.
anime.Length != 0)
1476 animeCounter += Time.deltaTime;
1477 int num3 = (int)(animeCounter / (0.001f * (
float)source.
anime[1]));
1478 if (num3 > ((source.
anime.Length > 2) ? source.
anime[2] : source.
anime[0]))
1484 p.tile += num3 % source.
anime[0] * ((!flipX) ? 1 : (-1));
1489 if (base.isOn || base.isRoofItem)
1491 int num4 = (int)((
float)base.uid + Time.realtimeSinceStartup * 5f);
1492 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1493 p.tile = (sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1498 else if (num5 % 11 == 0)
1504 p.color = 13107200f;
1509 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1513 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1515 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1519 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1521 if (parent is
Zone && pos.cell.HasFullBlock)
1523 p.tile += ((p.tile < 0f) ? (-64) : 64);
1527 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1531 if (trait.IdSkin != 0)
1533 int index = trait.IdSkin - 1;
1534 if (sourceCard.
skins.Length != 0)
1536 p.tile += ((p.tile < 0f) ? (-sourceCard.
skins.TryGet(index)) : sourceCard.
skins.TryGet(index));
1546 if (!renderer.data.subCrate.enable)
1550 return renderer.data.subCrate;
1573 if (!trait.CanStackTo(to))
1577 if (base.noSell != to.
noSell || base.isCopy != to.
isCopy)
1605 if (trait.IsRequireFuel && base.c_charges != to.
c_charges)
1613 if (base.Num + to.
Num <= 0)
1621 if (windowSaveData !=
null && windowSaveData.
compress)
1628 if (base.encLV != to.
encLV && !base.IsFood)
1636 foreach (
Element value
in elements.dict.Values)
1643 int num2 = (to.encLV = Mathf.CeilToInt(1f * (
float)(base.encLV * base.Num + to.encLV * to.
Num) / (
float)(base.Num + to.
Num)));
1645 foreach (
Element value2
in elements.dict.Values)
1648 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.
Num) / (base.Num + to.
Num));
1652 if (base.encLV != to.
encLV)
1660 foreach (
Element value3
in elements.dict.Values)
1662 Element element2 = to.elements.GetElement(value3.
id);
1663 if (element2 ==
null || value3.
vBase / 10 * 10 != element2.
vBase / 10 * 10)
1673 if (ing.CanSetThing(
this))
1677 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1681 foreach (
Thing thing
in things)
1693 if (GetRootCard().Dist(
EClass.
pc) > 1 || !ing.CanSetThing(
this))
1716 bool buy = trans !=
null;
1718 UIItem itemSlider =
null;
1727 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1730 buttonBuy = i.
AddButton(
"invBuy", delegate
1735 i.onDestroy = delegate
1743 if ((
bool)buttonBuy)
1745 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1752 Debug.Log(
"Split bug1");
1756 Debug.Log(
"Split bug2");
1760 Debug.Log(
"Split bug3");
1762 else if (count != 0 && !Input.GetMouseButton(1))
1766 trans.Process(startTransaction:
true);
1771 if (count != base.Num)
1775 thing.invX = dragItemCard.
from.
invX;
1776 thing.invY = dragItemCard.
from.
invY;
1786 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1787 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1788 if ((
bool)buttonBuy)
1790 buttonBuy.mainText.SetText(trans.GetTextDetail());
1791 buttonBuy.mainText.RebuildLayoutTo<
UIButton>();
1792 buttonBuy.interactable = trans.IsValid();
1793 buttonBuy.RebuildLayout(recursive:
true);
1794 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1804 UIItem itemSlider =
null;
1805 itemSlider = uIContextMenu.
AddSlider(
"sliderSplitMenu",
"adjustmentNum", (
float a) => (!
EClass.
core.
IsGameStarted) ?
"" : (
"/" + base.Num), count, delegate(
float b)
1809 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1810 buttonBuy = uIContextMenu.
AddButton(
"invBuy", delegate
1814 uIContextMenu.onDestroy = delegate
1817 uIContextMenu.
Show();
1818 if ((
bool)buttonBuy)
1820 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1827 Debug.Log(
"Split bug1");
1831 Debug.Log(
"Split bug2");
1835 Debug.Log(
"Split bug3");
1837 else if (count != 0 && !Input.GetMouseButton(1))
1839 onSplit?.Invoke(count);
1844 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1845 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1848 buttonBuy.interactable =
true;
1849 buttonBuy.RebuildLayout(recursive:
true);
1878 if ((!
neg || !row.tag.Contains(
"flag")) && func(row) && row.LV < num2)
1892 num4 +=
item.chance;
1896 bool flag = text ==
"skill" || text ==
"attribute" || text ==
"resist";
1897 float num5 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt(lv *
item.encFactor / 100);
1898 int num6 = (item.mtp +
EClass.
rnd(
item.mtp + (
int)num5)) / item.mtp * ((!(flag &&
neg)) ? 1 : (-1));
1899 if (
item.encFactor == 0 && num6 > 25)
1911 if (!base.IsEquipment || base.IsCursed || base.rarity <=
Rarity.Normal || GetInt(107) > 0)
1921 c.
Say(
"lick", c,
this);
1922 PlaySound(
"offering");
1923 PlayEffect(
"mutation");
1925 Element element = AddEnchant(base.LV);
1926 if (element !=
null)
1928 SetInt(107, element.
id);
1934 List<Element> list =
new List<Element>();
1935 foreach (
Element value
in elements.dict.Values)
1937 if (value.
id != 67 && value.
id != 66 && value.
id != 64 && value.
id != 65)
1944 Element element2 = list.RandomItem();
1945 elements.ModBase(element2.
id, Mathf.Max(
EClass.
rnd(Mathf.Abs(element2.
vBase / 5)), 1));
1946 SetInt(107, element2.
id);
1950 c.
Say(
"lick2", c, tg, slot.
name.ToLower());
1951 tg.PlaySound(
"offering");
1952 tg.PlayEffect(
"mutation");
1960 if (base.IsToolbelt || base.IsLightsource)
1965 if (enchant ==
null)
1969 return elements.ModBase(enchant.Item1.id, enchant.Item2);
1978 if (base.IsIdentified)
1986 @ref = GetName(
NameStyle.Full, base.Num);
1988 Rarity rarity = idtSource
switch
1990 IDTSource.SkillHigh =>
Rarity.Legendary,
1991 IDTSource.Skill =>
Rarity.Superior,
1994 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >=
Rarity.Mythical))
1996 base.c_IDTState = 3;
1998 else if (base.rarity >=
Rarity.Mythical && idtSource !=
IDTSource.SuperiorIdentify)
2000 base.c_IDTState = 1;
2004 base.c_IDTState = 0;
2008 text = GetName(
NameStyle.Full, base.Num);
2009 if (base.c_IDTState == 0)
2011 Msg.
Say(
"identified", @ref, text);
2015 Msg.
Say((idtSource ==
IDTSource.Skill) ?
"identified3" :
"identified2", @ref, text, base.TextRarity);
2018 if (base.IsIdentified)
2020 GetRootCard()?.TryStack(
this);
2030 DNA dNA = base.c_DNA;
2035 for (
int i = 0; i < dNA.
vals.Count; i += 2)
2038 if (row.
name.ToLower().Contains(s))
2042 if (row.
GetName().ToLower().Contains(s))
2050 if (!base.IsIdentified)
2054 foreach (
Element value
in elements.dict.Values)
2056 if (value.
Value != 0)
2058 if (value.
source.name.ToLower().Contains(s))
2062 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)
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)