2using System.Collections.Generic;
37 if (
source.substats.Length == 0)
91 return (
int)((long)(base.isWeightChanged ? base.c_weight :
source.weight) * (long)base.material.weight / 100);
93 if (!base.isWeightChanged)
107 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
119 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
167 return 50 + base.LV * 10 + base.encLV * 10 + (int)base.rarity * 10 + (
int)base.blessedState * 10;
180 Debug.LogWarning(
"Thing " +
id +
" not found");
192 else if (base.category.ignoreBless == 0 &&
bp.
rarity ==
Rarity.Random && base.rarity !=
Rarity.Artifact)
202 else if (
EClass.
rnd(50) == 0 && base.category.slot != 0)
212 if (text ==
"bill_tax" || text ==
"bill")
216 if (base.category.slot != 0)
219 if (base.rarity ==
Rarity.Superior)
223 else if (base.rarity ==
Rarity.Legendary)
227 else if (base.rarity ==
Rarity.Mythical)
231 else if (base.rarity >=
Rarity.Artifact)
237 for (
int i = 0; i < num; i++)
253 int num3 = ((
EClass.
rnd(10) == 0) ? 1 : 0);
254 if (base.rarity ==
Rarity.Superior)
258 else if (base.rarity ==
Rarity.Legendary)
262 else if (base.rarity ==
Rarity.Mythical)
266 else if (base.rarity >=
Rarity.Artifact)
270 if (
id ==
"bow_vindale")
276 for (
int j = 0; j < num2; j++)
280 for (
int k = 0; k <
EClass.
rnd(num2 + 1); k++)
291 if (
id ==
"shield_flower")
362 base.isReplica =
true;
367 bool flag2 = (base.isFireproof =
false);
368 base.isAcidproof = flag2;
376 if (
source.offense.Length != 0)
378 base.c_diceDim =
source.offense[1];
380 if (
source.offense.Length > 2)
382 SetBase(66,
source.offense[2]);
384 if (
source.offense.Length > 3)
386 SetBase(67,
source.offense[3]);
388 if (
source.defense.Length != 0)
390 SetBase(64,
source.defense[0]);
392 if (
source.defense.Length > 1)
394 SetBase(65,
source.defense[1]);
400 bool flag3 = !base.IsAmmo;
401 if (base.rarity <=
Rarity.Crude)
405 else if (base.rarity ==
Rarity.Superior)
409 else if (base.rarity >=
Rarity.Legendary)
413 if (
source.offense.Length != 0)
415 base.c_diceDim =
source.offense[1] * base.material.dice / (num + (flag3 ?
EClass.
rnd(25) : 0));
417 if (
source.offense.Length > 2)
419 SetBase(66,
source.offense[2] * base.material.atk * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
421 if (
source.offense.Length > 3)
423 SetBase(67,
source.offense[3] * base.material.dmg * 5 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
425 if (
source.defense.Length != 0)
427 SetBase(64,
source.defense[0] * base.material.dv * 7 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
429 if (
source.defense.Length > 1)
431 SetBase(65,
source.defense[1] * base.material.pv * 9 / (num - (flag3 ?
EClass.
rnd(30) : 0)));
436 if (
source.offense.Length != 0)
438 base.c_diceDim = Mathf.Max(
source.offense[1] / 3, 1);
440 if (
source.offense.Length > 2)
442 SetBase(66,
source.offense[2] / 3);
444 if (
source.offense.Length > 3)
446 SetBase(67,
source.offense[3] / 3);
448 if (
source.defense.Length != 0)
450 SetBase(64,
source.defense[0] / 3);
452 if (
source.defense.Length > 1)
454 SetBase(65,
source.defense[1] / 3);
457 if (base.IsEquipmentOrRangedOrAmmo)
459 if (base.IsWeapon || base.IsAmmo)
473 for (
int i = 0; i <
sockets.Count; i++)
476 int num3 = num2 / 1000;
477 if (num3 == 67 && dmgSet)
481 if (num3 == 66 && hitSet)
485 if (num3 == 65 && pvSet)
491 if (base.material ==
null || base.material.elements ==
null)
493 Debug.Log(base.idMaterial +
"/" + base.material?.name +
"/" + base.material?.elements);
496 string[] bits = base.material.bits;
497 foreach (
string text
in bits)
499 if (!(text ==
"fire"))
503 base.isAcidproof =
true;
508 base.isFireproof =
true;
511 if (base.rarity >=
Rarity.Artifact)
513 bool flag2 = (base.isFireproof =
true);
514 base.isAcidproof = flag2;
517 void SetBase(
int ele,
int a)
537 int num = ((_num == -1) ? base.Num : _num);
544 string text6 =
source.GetText(
"unit");
546 bool num2 = base.IsIdentified ||
source.unknown.IsEmpty();
547 bool isEquipmentOrRangedOrAmmo = base.IsEquipmentOrRangedOrAmmo;
548 bool flag = Lang.setting.nameStyle == 0;
551 if (base.c_idRefCard.IsEmpty() && !base.c_altName.IsEmpty())
553 text = base.c_altName;
559 if (array.Length > 1)
568 if (isEquipmentOrRangedOrAmmo && base.IsIdentified && base.rarity >=
Rarity.Legendary)
570 if (base.rarity !=
Rarity.Artifact && !base.material.GetTextArray(
"altName").IsEmpty())
572 text = base.material.GetTextArray(
"altName")[0] + Lang.space + text;
576 if (
source.naming ==
"m" || (
source.naming ==
"ms" && base.material !=
source.DefaultMaterial))
578 if (isEquipmentOrRangedOrAmmo)
580 string[] textArray = base.material.GetTextArray(
"altName");
581 if (textArray !=
null && textArray.Length >= 2)
583 text = base.material.GetTextArray(
"altName")[1] + Lang.space + text;
587 text =
"_of2".lang(base.material.GetName(), text);
592 string idUnknown =
source.GetText(
"unknown");
593 if (idUnknown.StartsWith(
"#"))
597 idUnknown =
Lang.
GetList(idUnknown.Remove(0, 1)).RandomItem();
605 text =
"_halfeaten".lang(text);
607 if (base.c_bill != 0)
609 text =
"_of".lang(
Lang.
_currency(base.c_bill, showUnit:
true, 0), text);
614 text =
Lang.
GetList((base.category.id ==
"fish") ?
"quality_fish" :
"quality_general")[Mathf.Clamp(base.tier, 0, 3)] + text;
624 if (!base.c_refText.IsEmpty())
626 text =
"_named".lang(base.c_refText, text);
628 if (base.IsIdentified)
632 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hIT != 0 || dMG != 0) && source.offense.Length != 0)
635 if (
source.offense[0] != 0)
637 text7 = text7 +
source.offense[0] +
"d" + base.c_diceDim;
641 text7 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dMG.ToText() : (dMG.ToString() ??
""));
645 text7 = text7 + ((dMG != 0 ||
source.offense[0] != 0) ?
", " :
"") + hIT;
647 text2 = text2 +
" (" + text7.IsEmpty(
" - ") +
") ";
651 if (dV != 0 || pV != 0)
654 text2 = text2 + dV +
", " + pV;
659 text2 = text2 +
" " +
"itemCharges".lang(base.c_charges.ToString() ??
"");
662 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
664 text2 = Lang.space +
"(" + base.TextRarity.ToTitleCase() +
")";
668 text =
"rotten".lang() + text;
670 else if (base.IsRotting)
672 text =
"rotting".lang() + text;
674 if (base.IsIdentified)
676 if (base.blessedState != 0)
678 text4 = (
"bs" + base.blessedState).lang();
685 text = (isEquipmentOrRangedOrAmmo ? text.Bracket(3) : text);
691 if (isEquipmentOrRangedOrAmmo)
695 sig = AliasGen.GetRandomAlias().Bracket((base.rarity ==
Rarity.Mythical) ? 3 : 2);
697 sig = Lang.space + sig;
704 if (base.category.tag.Contains(
"enc"))
706 if (base.c_altName.IsEmpty())
709 text =
"_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text);
714 sig = sig + Lang.space + ((base.encLV > 0) ? (
"+" + base.encLV) : (base.encLV.ToString() ??
""));
717 if (base.c_lockLv != 0 && base.c_revealLock)
719 sig = sig + Lang.space +
"+" + base.c_lockLv;
721 if (base.isLostProperty)
723 text =
"_lostproperty".lang(text);
727 text5 +=
"equippedItem".lang();
731 string text8 = base.c_note;
732 if (text8.StartsWith(
'@'))
734 text8 =
Lang.
Note.map.TryGetValue(text8.TrimStart(
'@'))?.GetText(
"text") ?? base.c_note;
736 string text9 = (base.category.IsChildOf(
"book") ?
"_written" :
"_engraved");
737 if (
id ==
"grave_dagger1" ||
id ==
"grave_dagger2")
739 text9 =
"_daggerGrave";
741 text = ((!text8.Contains(
"_bracketLeft".lang())) ? text9.lang(text8, text) : (text9 +
"Alt").lang(text8, text));
743 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))));
744 if (base.rarity >=
Rarity.Legendary)
746 text = text.ToTitleCase(wholeText:
true);
755 text5 =
"_limitedStock".lang(text5);
757 return text5 + text3 + text + sig + text2 + text10;
761 if (
source.naming ==
"ma")
763 text = base.material.GetName();
767 if (!base.c_idRefCard.IsEmpty() && trait.RefCardName !=
RefCardName.None)
769 string text11 = base.c_altName.IsEmpty(base.refCard.GetName());
770 if (!base.c_idRefCard2.IsEmpty())
772 text11 =
"_and".lang(text11, base.c_altName2.IsEmpty(base.refCard2.GetName()));
774 if (!(text11 ==
"*r"))
776 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)))));
780 string text12 = base.refCard.GetText(
"aka");
781 if (!text12.IsEmpty())
783 text =
"_of".lang(text12, text);
793 text = text +
" <size=14>(" +
Lang.
_weight(base.ChildrenAndSelfWeight) +
")</size> ";
796 text += Environment.NewLine;
797 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;
799 string hoverText = trait.GetHoverText();
800 if (!hoverText.IsEmpty())
802 text = text + Environment.NewLine + hoverText;
804 return base.GetHoverText() + text;
812 if (things.Count > 0)
814 text +=
"childCount".lang(things.Count.ToString() ??
"");
816 else if (trait.CanOpenContainer)
818 text +=
"empty".lang();
823 Room room = pos.cell.room;
834 List<Element> list =
new List<Element>();
835 if (base.ShowFoodEnc)
837 foreach (
Element value
in elements.dict.Values)
845 if (limit && list.Count > 5)
847 int num = list.Count - 5;
848 for (
int i = 0; i < num; i++)
850 list.RemoveAt(list.Count - 1);
859 List<Element> list = ListLimitedValidTraits(limit);
860 bool showFoodEnc = base.ShowFoodEnc;
864 foreach (
Element value
in elements.dict.Values)
872 foreach (
Element value2
in elements.dict.Values)
884 if (sourceCard.
_origin ==
"dish")
892 bool showEQStats = base.IsEquipmentOrRangedOrAmmo;
894 bool flag2 = base.IsIdentified || flag;
896 if (base.rarity ==
Rarity.Legendary || base.rarity ==
Rarity.Mythical)
898 string text4 = (text3.Contains(
"『") ?
"『" : (text3.Contains(
"《") ?
"《" :
""));
901 string[] array = text3.Split(text4);
902 text3 = array[0] + Environment.NewLine + text4 + array[1];
909 text3 = recipe.GetName();
911 if (trait.CraftNum > 1)
913 text3 = text3 +
" x " + trait.CraftNum;
926 uIItem.
image2.Rect().pivot =
new Vector2(0.5f, 0.5f);
927 string text5 = base.Num.ToFormat() ??
"";
928 string text6 = (Mathf.Ceil(0.01f * (
float)base.ChildrenAndSelfWeight) * 0.1f).ToString(
"F1") +
"s";
929 if (things.Count > 0)
931 text5 = text5 +
" (" + things.Count +
")";
933 if (base.ChildrenAndSelfWeight != SelfWeight)
935 text6 = text6 +
" (" + (Mathf.Ceil(0.01f * (
float)SelfWeight) * 0.1f).ToString(
"F1") +
"s)";
937 text3 =
"_quantity".lang(text5 ??
"", text6);
940 text3 = text3 +
" " +
"_recipe_lv".lang(recipe.RecipeLv.ToString() ??
"");
943 if (showEQStats && flag2)
946 if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
950 text3 = text3 +
"DMG".lang() + ((base.DMG > 0) ?
"+" :
"") + base.DMG +
", ";
954 text3 = text3 +
"HIT".lang() + ((base.HIT > 0) ?
"+" :
"") + base.HIT +
", ";
958 text3 = text3 +
"DV".lang() + ((DV > 0) ?
"+" :
"") + DV +
", ";
962 text3 = text3 +
"PV".lang() + ((PV > 0) ?
"+" :
"") + PV +
", ";
964 if (Penetration != 0)
966 text3 = text3 +
"PEN".lang() + ((Penetration > 0) ?
"+" :
"") + Penetration +
"%, ";
968 text3 = text3.TrimEnd(
' ').TrimEnd(
',');
970 if (!text3.IsEmpty())
972 n.
AddText(
"NoteText_eqstats", text3);
976 n.
AddText(
"NoteText_eqstats",
"tip_range".lang(traitToolRange.BestDist.ToString() ??
""));
984 int totalQuality = GetTotalQuality();
985 int totalQuality2 = GetTotalQuality(applyBonus:
false);
986 text7 = text7 +
"Lv. " + base.LV +
" TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ?
"" : (
" (" + totalQuality2 +
")"));
990 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_nutrition".lang(Evalue(10).ToFormat() ??
"");
992 if ((base.category.IsChildOf(
"throw") || base.category.IsChildOf(
"resource") || trait.IsTool) && !(trait is
TraitAbility))
994 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_hardness".lang(base.material.hardness.ToString() ??
"");
998 text7 = text7 + (text7.IsEmpty() ?
"" :
" ") +
"_max_quality".lang(recipe.GetQualityBonus().ToString() ??
"");
1000 if (!text7.IsEmpty())
1002 n.
AddText(
"NoteText_eqstats", text7);
1006 string detail = GetDetail();
1007 if (!detail.IsEmpty())
1009 LayoutElement component = n.
AddText(
"NoteText_flavor", detail).GetComponent<LayoutElement>();
1012 component.preferredWidth = 400f;
1020 n.
AddText(
"NoteText_flavor", traitBookPlan.
source.GetDetail());
1023 if (traitAbility !=
null)
1034 n.
AddText(
"(id:" +
id +
" tile:" + (source.
tiles.IsEmpty() ?
"-" : ((
object)source.
tiles[0]))?.ToString() +
") lv:" + base.LV +
" price:" + GetPrice());
1036 Card root = GetRootCard();
1045 AddText(
"isCategorized".lang(base.category.GetText()),
FontColor.Default);
1046 if (base.category.skill != 0)
1048 int key = base.category.skill;
1050 if (base.IsRangedWeapon && !base.IsMeleeWeapon)
1058 if (Evalue(482) > 0)
1065 if (base.IsContainer)
1067 AddText(
"isContainer".lang(things.MaxCapacity.ToString() ??
""),
FontColor.Default);
1069 if (base.c_lockLv != 0)
1071 AddText((base.c_lockedHard ?
"isLockedHard" :
"isLocked").lang(base.c_lockLv.ToString() ??
""),
FontColor.Warning);
1073 if (base.isCrafted && recipe ==
null)
1075 AddText(
"isCrafted".lang(),
FontColor.Default);
1077 if (trait.Decay > 0)
1080 text8 = (base.IsDecayed ?
"isRotten" : (base.IsRotting ?
"isRotting" : ((!base.IsFresn) ?
"isNotFresh" :
"isFresh")));
1081 AddText(text8.lang(),
FontColor.Default);
1085 AddText(
"isDyed".lang(base.DyeMat.GetName() ??
""),
FontColor.Default);
1087 if (base.IsEquipment)
1089 text3 =
"isEquipable".lang(
Element.
Get(base.category.slot).GetText());
1092 if (base.isFireproof)
1094 AddText(
"isFreproof",
FontColor.Default);
1096 if (base.isAcidproof)
1098 AddText(
"isAcidproof",
FontColor.Default);
1100 if (trait.OriginalElectricity > 0)
1102 AddText(
"isGenerateElectricity".lang(trait.OriginalElectricity.ToString() ??
""),
FontColor.Default);
1104 if (trait.OriginalElectricity < 0)
1106 AddText(
"isConsumeElectricity".lang(Mathf.Abs(trait.OriginalElectricity).ToString() ??
""),
FontColor.Default);
1110 AddText(
"isPrecious",
FontColor.Default);
1116 if (flag && HasTag(
CTAG.noMix))
1120 if (!trait.CanBeDestroyed)
1122 AddText(
"isIndestructable",
FontColor.Default);
1124 if (GetInt(107) > 0)
1132 if (!base.c_idDeity.IsEmpty())
1137 if (base.isGifted && GetRoot() !=
EClass.
pc)
1141 if (base.isNPCProperty)
1143 AddText(
"isNPCProperty",
FontColor.Ether);
1145 if (base.c_priceFix != 0)
1147 AddText(((base.c_priceFix > 0) ?
"isPriceUp" :
"isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ??
""),
FontColor.Ether);
1153 if (trait.IsOnlyUsableByPc)
1155 AddText(
"isOnlyUsableByPC",
FontColor.Ether);
1161 if (base.c_isImportant)
1163 AddText(
"isMarkedImportant",
FontColor.Ether);
1165 if (GetInt(25) != 0)
1167 AddText(
"isDangerLv".lang((GetInt(25) + 1).ToString() ??
"", (
EClass.
pc.
FameLv + 10).ToString() ??
""),
FontColor.Default);
1172 if (HasElement(220))
1174 AddText(
"canMine".lang(), col2);
1176 if (HasElement(225))
1178 AddText(
"canLumberjack".lang(), col2);
1179 AddText(
"canLumberjack2".lang(), col2);
1181 if (HasElement(230))
1183 AddText(
"canDig", col2);
1185 if (HasElement(286))
1187 AddText(
"canFarm", col2);
1189 if (HasElement(245))
1191 AddText(
"canFish", col2);
1193 if (HasElement(237))
1195 AddText(
"canTame", col2);
1200 AddText(
"canPlayMusic".lang(), col2);
1202 if (
Lang.
Has(
"hint_" + trait.ToString()))
1204 AddText(
"hint_" + trait.ToString(),
FontColor.Util);
1206 if (
Lang.
Has(
"hint_" + trait.ToString() +
"2"))
1208 AddText(
"hint_" + trait.ToString() +
"2",
FontColor.Util);
1210 if (HasTag(
CTAG.tourism))
1214 string langPlaceType = base.TileType.LangPlaceType;
1215 if (langPlaceType ==
"place_Door" || langPlaceType ==
"place_WallMount")
1217 AddText(base.TileType.LangPlaceType +
"_hint".lang(),
FontColor.Util);
1219 if (trait.IsHomeItem)
1221 AddText(
"isHomeItem".lang(),
FontColor.Util);
1223 if (HasTag(
CTAG.throwWeapon))
1225 AddText(
"isThrowWeapon",
FontColor.Default);
1229 AddText(
"isThrowWeaponEnemy",
FontColor.Default);
1233 AddText(
"isNoProcessIng",
FontColor.Default);
1241 AddText(
"isLeftoverable",
FontColor.Default);
1243 if (HasTag(
CTAG.rareResource))
1245 AddText(
"isRareResource",
FontColor.Great);
1249 AddText(
"isBed".lang(traitBed.MaxHolders.ToString() ??
""),
FontColor.Default);
1251 bool showAsEquipment = base.IsEquipmentOrRangedOrAmmo || base.IsThrownWeapon || trait is
TraitToolMusic;
1252 bool showTraits = !showAsEquipment || base.ShowFoodEnc;
1254 List<Element> listTrait = ListValidTraits(isCraft:
false, !infoMode);
1255 List<Element> list = ListValidTraits(isCraft:
false, limit:
false);
1256 if (list.Count - listTrait.Count <= 1)
1262 Element element = elements.GetElement(653);
1263 if (element !=
null)
1265 AddText(
"isAlive".lang(element.
vBase.ToString() ??
"", (element.
vExp / 10).ToString() ??
"", (element.
ExpToNext / 10).ToString() ??
""),
FontColor.Great);
1267 string[] rangedSubCats =
new string[2] {
"eleConvert",
"eleAttack" };
1268 elements.AddNote(n, delegate(
Element e)
1270 if (!showAsEquipment && !e.
HasTag(
"itemEnc"))
1278 if (e.
IsTrait || (showTraits && listTrait.Contains(e)))
1284 if (e.source.tag.Contains(
"weaponEnc") && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon && !(trait is TraitToolMusic))
1288 if (e.
source.IsWeaponEnc && !base.category.IsChildOf(
"shield") && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon && !(trait is
TraitToolMusic))
1293 return (!showEQStats || (e.
id != 64 && e.
id != 65 && e.
id != 66 && e.
id != 67)) ?
true :
false;
1301 if (e.
source.IsWeaponEnc && (!e.
source.tag.Contains(
"modRanged") || e.
id == 609) && isEquipped && root.
isChara)
1304 if (num4 != 482 && (uint)(num4 - 660) > 2u && num4 != 666)
1309 string text13 =
" (" + e.Value + ((e.Value == num3) ?
"" : (
" → " + num3)) +
")";
1310 string text14 =
"_bracketLeft3".lang() + e.Name +
"_bracketRight3".lang();
1311 return s + text13 +
" " + text14;
1313 if (sockets !=
null)
1315 foreach (
int socket
in sockets)
1317 AddText((socket == 0) ?
"emptySocket".lang() :
"socket".lang(
EClass.
sources.
elements.map[socket / 1000].GetName(), (socket % 1000).ToString() ??
""),
FontColor.Gray);
1321 trait.WriteNote(n, flag2);
1329 if (listTrait.Count != list.Count)
1331 AddText(
"traitOther".lang((list.Count - listTrait.Count).ToString() ??
""),
FontColor.Default);
1334 if (base.c_mixedFoodData !=
null)
1336 n.AddHeader(
"isMixedFood");
1337 foreach (
string text15
in base.c_mixedFoodData.texts)
1339 AddText(
"_bullet".lang() + text15 + text2,
FontColor.Default);
1345 AddText(
"isUnidentified".lang(),
FontColor.Flavor);
1346 if (base.c_IDTState == 1)
1348 AddText(
"isUnidentified2".lang(),
FontColor.Flavor);
1353 n.AddHeader(
"HeaderAdditionalTrait",
"additional_trait");
1361 n.AddText(
"decay:" + base.decay);
1362 n.AddText(base.isDyed +
"/" +
id +
"/" + base.refVal +
"/" + base.LV +
"/" + trait);
1363 if (source.
origin !=
null)
1368 if (
id ==
"statue_weird")
1370 AddText(
"weirdStatue",
FontColor.Default);
1374 AddText(
"isReplica",
FontColor.Passive);
1383 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara !=
null)
1385 AddAttackEvaluation(n, chara,
this);
1387 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1389 n.AddHeader(
"headerAttackEval");
1392 text9 = text9.TagColor(() =>
true);
1396 if (base.ammoData !=
null)
1398 n.AddHeader(
"headerAttackAmmo");
1399 n.AddText(base.ammoData.Name);
1401 onWriteNote?.Invoke(n);
1404 AddText(
"isProductWarning",
FontColor.Default);
1412 foreach (
Element value
in elements.dict.Values)
1418 void AddText(
string text,
FontColor col)
1420 n.AddText(
"NoteText_enc", text, col);
1422 void AddTextWithIcon(
string text, Sprite sprite,
FontColor col)
1424 UIItem uIItem2 = n.AddText(
"NoteText_enc", text, col);
1425 uIItem2.
image1.SetActive(enable:
true);
1426 uIItem2.image1.sprite = sprite;
1428 string GetTextTrait(
Element e)
1430 string text10 = e.
source.GetText(
"textExtra");
1431 if (text10.IsEmpty())
1437 text10 = text10.Replace(
"#1",
$"{0.1f * (float)(e.Value + 10):F1}");
1442 int num = recipe.GetQualityBonus() / 10;
1447 text11 =
"qualityLimit".lang(num.ToString() ??
"");
1449 int num2 = e.Value / 10;
1450 num2 = ((e.Value < 0) ? (num2 - 1) : (num2 + 1));
1451 string text12 = num2.ToString() ??
"";
1454 text12 = (int)((
float)num2 * 0.1f * (float)(Evalue(710) + 10)) +
" (" + num2 +
")";
1456 text10 =
"Lv." + text12 + text11 +
" " + text10;
1459 text10 +=
"traitAdditive".lang();
1461 return (
" <size=12>" + text10 +
"</size>").TagColor(
FontColor.Passive);
1477 if (slot.
thing == current)
1479 text = text.TagColor(() =>
true);
1488 text2 = text2.TagColor(() =>
true);
1495 p.matColor = base.colorInt;
1496 p.mat = base.material;
1497 if (!renderer.usePass)
1501 switch (trait.tileMode)
1504 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1506 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1510 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1515 p.color += 1572864f;
1521 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1523 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1527 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1529 if (animeCounter > 0f && source.
anime.Length != 0)
1531 animeCounter += Time.deltaTime;
1532 int num3 = (int)(animeCounter / (0.001f * (
float)source.
anime[1]));
1533 if (num3 > ((source.
anime.Length > 2) ? source.
anime[2] : source.
anime[0]))
1539 p.tile += num3 % source.
anime[0] * ((!flipX) ? 1 : (-1));
1544 if (base.isOn || base.isRoofItem)
1546 int num4 = (int)((
float)base.uid + Time.realtimeSinceStartup * 5f);
1547 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1548 p.tile = (sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1553 else if (num5 % 11 == 0)
1559 p.color = 13107200f;
1564 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1568 if (source.
_altTiles.Length != 0 && trait.UseAltTiles)
1570 p.tile = source.
_altTiles[base.dir % source.
_altTiles.Length] * ((!flipX) ? 1 : (-1));
1574 p.tile = sourceCard.
_tiles[base.dir % sourceCard.
_tiles.Length] * ((!flipX) ? 1 : (-1));
1576 if (parent is
Zone && pos.cell.HasFullBlock)
1578 p.tile += ((p.tile < 0f) ? (-64) : 64);
1582 p.tile += ((!(p.tile < 0f)) ? 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 float time = Time.realtimeSinceStartup;
1603 if (source.
anime.Length == 0 || !trait.IsAnimeOn)
1607 if (source.
anime.Length > 2)
1609 int num = (int)(time * 1000f / (
float)source.
anime[1] % (float)source.
anime[2]);
1610 if (num == source.
anime[0] - 1 && source.
anime.Length > 3)
1612 PlaySound(
"anime_sound" + source.
anime[3]);
1614 if (num < source.
anime[0])
1616 p.tile += num * ((!(p.tile < 0f)) ? 1 : (-1));
1621 int num2 = (int)(time * 1000f / (
float)source.
anime[1] % (float)source.
anime[0]);
1622 p.tile += num2 * ((!(p.tile < 0f)) ? 1 : (-1));
1627 if (trait.IdSkin != 0 && sourceCard.
skins.Length != 0)
1629 int num6 = sourceCard.
skins.TryGet(trait.IdSkin - 1);
1631 p.tile += ((p.tile < 0f) ? (-num6) : num6);
1640 if (!renderer.data.subCrate.enable)
1644 return renderer.data.subCrate;
1667 if (!trait.CanStackTo(to))
1671 if (base.noSell != to.
noSell || base.isCopy != to.
isCopy)
1699 if (trait.IsRequireFuel && base.c_charges != to.
c_charges)
1707 if (base.Num + to.
Num <= 0)
1715 if (windowSaveData !=
null && windowSaveData.
compress)
1722 if (base.encLV != to.
encLV && !base.IsFood)
1730 foreach (
Element value
in elements.dict.Values)
1737 int num2 = (to.encLV = Mathf.CeilToInt(1f * (
float)(base.encLV * base.Num + to.encLV * to.
Num) / (
float)(base.Num + to.
Num)));
1739 foreach (
Element value2
in elements.dict.Values)
1742 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.
Num) / (base.Num + to.
Num));
1746 if (base.encLV != to.
encLV)
1754 foreach (
Element value3
in elements.dict.Values)
1756 Element element2 = to.elements.GetElement(value3.
id);
1757 if (element2 ==
null || value3.
vBase / 10 * 10 != element2.
vBase / 10 * 10)
1767 if (ing.CanSetThing(
this))
1771 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1775 foreach (
Thing thing
in things)
1787 if (GetRootCard().Dist(
EClass.
pc) > 1 || !ing.CanSetThing(
this))
1810 bool buy = trans !=
null;
1812 UIItem itemSlider =
null;
1821 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1824 buttonBuy = i.
AddButton(
"invBuy", delegate
1829 i.onDestroy = delegate
1831 if ((!buy || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !i.
wasCanceled)
1837 if ((
bool)buttonBuy)
1839 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1846 Debug.Log(
"Split bug1");
1850 Debug.Log(
"Split bug2");
1854 Debug.Log(
"Split bug3");
1856 else if (count != 0 && !Input.GetMouseButton(1))
1860 trans.Process(startTransaction:
true);
1865 if (count != base.Num)
1869 thing.invX = dragItemCard.
from.
invX;
1870 thing.invY = dragItemCard.
from.
invY;
1880 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1881 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1882 if ((
bool)buttonBuy)
1884 buttonBuy.mainText.SetText(trans.GetTextDetail());
1885 buttonBuy.mainText.RebuildLayoutTo<
UIButton>();
1886 buttonBuy.interactable = trans.IsValid();
1887 buttonBuy.RebuildLayout(recursive:
true);
1888 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1898 UIItem itemSlider =
null;
1903 }, 1f, base.Num, isInt:
true, hideOther:
false, useInput:
true).GetComponent<UIItem>();
1904 buttonBuy = i.
AddButton(
"invBuy", delegate
1908 i.onDestroy = delegate
1910 if ((Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !i.
wasCanceled)
1916 if ((
bool)buttonBuy)
1918 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1925 Debug.Log(
"Split bug1");
1929 Debug.Log(
"Split bug2");
1933 Debug.Log(
"Split bug3");
1935 else if (count != 0 && !Input.GetMouseButton(1))
1937 onSplit?.Invoke(count);
1942 itemSlider.text1.text = GetName(
NameStyle.FullNoArticle, 1);
1943 itemSlider.text2.text =
Lang.
_weight(SelfWeight * count);
1946 buttonBuy.interactable =
true;
1947 buttonBuy.RebuildLayout(recursive:
true);
1976 if ((!
neg || !row.tag.Contains(
"flag")) && func(row) && row.LV < num2)
1990 num4 +=
item.chance;
1994 bool flag = text ==
"skill" || text ==
"attribute" || text ==
"resist";
1995 float num5 = 3f + Mathf.Min(lv / 10, 15f) + Mathf.Sqrt(lv *
item.encFactor / 100);
1996 int num6 = (item.mtp +
EClass.
rnd(
item.mtp + (
int)num5)) / item.mtp * ((!(flag &&
neg)) ? 1 : (-1));
1997 if (
item.encFactor == 0 && num6 > 25)
2009 if (!base.IsEquipment || base.IsCursed || base.rarity <=
Rarity.Normal || GetInt(107) > 0)
2019 c.
Say(
"lick", c,
this);
2020 PlaySound(
"offering");
2021 PlayEffect(
"mutation");
2023 Element element = AddEnchant(base.LV);
2024 if (element !=
null)
2026 SetInt(107, element.
id);
2032 List<Element> list =
new List<Element>();
2033 foreach (
Element value
in elements.dict.Values)
2035 if (value.
id != 67 && value.
id != 66 && value.
id != 64 && value.
id != 65)
2042 Element element2 = list.RandomItem();
2043 elements.ModBase(element2.
id, Mathf.Max(
EClass.
rnd(Mathf.Abs(element2.
vBase / 5)), 1));
2044 SetInt(107, element2.
id);
2048 c.
Say(
"lick2", c, tg, slot.
name.ToLower());
2049 tg.PlaySound(
"offering");
2050 tg.PlayEffect(
"mutation");
2058 if (base.IsToolbelt || base.IsLightsource)
2063 if (enchant ==
null)
2067 return elements.ModBase(enchant.Item1.id, enchant.Item2);
2076 if (base.IsIdentified)
2084 @ref = GetName(
NameStyle.Full, base.Num);
2086 Rarity rarity = idtSource
switch
2088 IDTSource.SkillHigh =>
Rarity.Legendary,
2089 IDTSource.Skill =>
Rarity.Superior,
2092 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >=
Rarity.Mythical))
2094 base.c_IDTState = 3;
2096 else if (base.rarity >=
Rarity.Mythical && idtSource !=
IDTSource.SuperiorIdentify)
2098 base.c_IDTState = 1;
2102 base.c_IDTState = 0;
2106 text = GetName(
NameStyle.Full, base.Num);
2107 if (base.c_IDTState == 0)
2109 Msg.
Say(
"identified", @ref, text);
2113 Msg.
Say((idtSource ==
IDTSource.Skill) ?
"identified3" :
"identified2", @ref, text, base.TextRarity);
2116 if (base.IsIdentified)
2118 GetRootCard()?.TryStack(
this);
2128 DNA dNA = base.c_DNA;
2133 for (
int i = 0; i < dNA.
vals.Count; i += 2)
2136 if (row.
name.ToLower().Contains(s))
2140 if (row.
GetName().ToLower().Contains(s))
2148 if (!base.IsIdentified)
2152 foreach (
Element value
in elements.dict.Values)
2154 if (value.
Value != 0)
2156 if (value.
source.name.ToLower().Contains(s))
2160 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
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 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)