EA 23.86 Nightly
February 5, 2025
16 files modified. 1 new file created.
Important Changes
None.
COBJ
@@ -31,4 +31,6 @@ public class COBJ
public const int charaGenes = 15;
public const int corruptionHistory = 16;
public const int socketList = 17;
}
Card
@@ -870,18 +870,6 @@ public bool isRestocking
}
}
public bool isRuneAdded
{
get
{
return _bits2[8];
}
set
{
_bits2[8] = value;
}
}
public bool isBackerContent => c_idBacker != 0;
public SourceBacker.Row sourceBacker
@@ -1693,6 +1681,18 @@ public Thing ammoData
}
}
public List<SocketData> socketList
{
get
{
return GetObj<List<SocketData>>(17);
}
set
{
SetObj(17, value);
}
}
public Thing c_copyContainer
{
get
@@ -3288,6 +3288,58 @@ public void EjectSockets()
}
}
public SocketData AddRune(Card rune)
{
return AddRune(rune.refVal, rune.encLV);
}
public SocketData AddRune(int idEle, int v)
{
if (socketList == null)
{
socketList = new List<SocketData>();
}
SocketData socketData = new SocketData
{
idEle = idEle,
value = v,
type = SocketData.Type.Rune
};
socketList.Add(socketData);
elements.SetTo(idEle, v);
return socketData;
}
public SocketData GetRuneEnc(int idEle)
{
if (socketList != null)
{
foreach (SocketData socket in socketList)
{
if (socket.type == SocketData.Type.Rune && socket.idEle == idEle)
{
return socket;
}
}
}
return null;
}
public bool HasRune()
{
if (socketList != null)
{
foreach (SocketData socket in socketList)
{
if (socket.type == SocketData.Type.Rune && !socket.dontConsumeSlot)
{
return true;
}
}
}
return false;
}
public void OnChildNumChange(Card c)
{
if (ShouldTrySetDirtyInventory() && c.isThing)
CoreRef
@@ -53,6 +53,24 @@ public class Affinity
public Sprite love;
}
[Serializable]
public class Enc
{
public Sprite mat;
public Sprite cat;
public Sprite enc;
public Sprite rune;
public Sprite trait;
public Sprite mod;
public Sprite weaponEnc;
}
public Sprite suspend;
public Sprite resume;
@@ -105,6 +123,8 @@ public class Affinity
public Affinity affnity;
public Enc enc;
public UDInvTab invTab;
public UDIconWeather weather;
ELEMENT
@@ -649,7 +649,17 @@ public void _WriteNote(UINote n, Chara c, Act act)
{
n.Space(4);
UIItem uIItem = n.AddExtra<UIItem>("costPrice");
uIItem.text1.SetText(cost.cost.ToString() ?? "", (((cost.type == Act.CostType.MP) ? c.mana.value : c.stamina.value) >= cost.cost) ? FontColor.Good : FontColor.Bad);
int num = cost.cost;
if (cost.type == Act.CostType.MP && c.Evalue(483) > 0)
{
num = cost.cost * 100 / (100 + (int)Mathf.Sqrt(c.Evalue(483) * 10) * 3);
}
string text4 = cost.cost.ToString() ?? "";
if (num != cost.cost)
{
text4 = num + " (" + text4 + ")";
}
uIItem.text1.SetText(text4, (((cost.type == Act.CostType.MP) ? c.mana.value : c.stamina.value) >= num) ? FontColor.Good : FontColor.Bad);
uIItem.image1.sprite = ((cost.type == Act.CostType.MP) ? EClass.core.refs.icons.mana : EClass.core.refs.icons.stamina);
uIItem.image1.SetNativeSize();
}
ElementContainer
{
text = funcText(e, text);
}
n.AddText("NoteText_prefwidth", text, color);
UIItem uIItem = n.AddText("NoteText_enc", text, color);
Sprite sprite = EClass.core.refs.icons.enc.enc;
Thing thing = Card?.Thing;
if (thing != null)
{
if (thing.material.HasEnc(e.id))
{
sprite = EClass.core.refs.icons.enc.mat;
}
if (thing.GetRuneEnc(e.id) != null)
{
sprite = EClass.core.refs.icons.enc.rune;
}
}
if ((bool)sprite)
{
uIItem.image1.SetActive(enable: true);
uIItem.image1.sprite = sprite;
}
bool enable = e.HasTag("weaponEnc") || e is Ability || e.source.categorySub == "eleConvert" || e.source.categorySub == "eleAttack";
uIItem.image2.SetActive(enable);
onAddNote?.Invoke(n, e);
continue;
}
}
UIItem uIItem = n.AddTopic("TopicAttribute", e.Name, "".TagColor((e.ValueWithoutLink > 0) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad, e.ValueWithoutLink.ToString() ?? ""));
if ((bool)uIItem.button1)
UIItem uIItem2 = n.AddTopic("TopicAttribute", e.Name, "".TagColor((e.ValueWithoutLink > 0) ? SkinManager.CurrentColors.textGood : SkinManager.CurrentColors.textBad, e.ValueWithoutLink.ToString() ?? ""));
if ((bool)uIItem2.button1)
{
uIItem.button1.tooltip.onShowTooltip = delegate(UITooltip t)
uIItem2.button1.tooltip.onShowTooltip = delegate(UITooltip t)
{
e.WriteNote(t.note, EClass.pc.elements);
};
}
e.SetImage(uIItem.image1);
Image image = uIItem.image2;
e.SetImage(uIItem2.image1);
Image image = uIItem2.image2;
int value = (e.Potential - 80) / 20;
image.enabled = e.Potential != 80;
image.sprite = EClass.core.refs.spritesPotential[Mathf.Clamp(Mathf.Abs(value), 0, EClass.core.refs.spritesPotential.Count - 1)];
HotItemHeld
@@ -31,7 +31,7 @@ public static bool CanRotate()
{
return false;
}
if (!(EClass._zone is Zone_Tent) && !EClass._zone.IsPCFaction && EClass.pc.held.trait.CanBeOnlyBuiltInHome)
if (!(EClass._zone is Zone_Tent) && !EClass._zone.IsPCFactionOrTent && EClass.pc.held.trait.CanBeOnlyBuiltInHome)
{
return false;
}
InvOwnerChangeMaterial
@@ -21,7 +21,7 @@ public override bool ShouldShowGuide(Thing t)
{
return true;
}
if (!t.category.IsChildOf("currency") && !t.IsUnique && !t.isRuneAdded && t.trait.CanBeDropped && !t.source.fixedMaterial && !(t.trait is TraitCatalyst) && !(t.trait is TraitTile) && !(t.trait is TraitMaterialHammer))
if (!t.category.IsChildOf("currency") && !t.IsUnique && t.trait.CanBeDropped && !t.source.fixedMaterial && !(t.trait is TraitCatalyst) && !(t.trait is TraitTile) && !(t.trait is TraitMaterialHammer))
{
return !(t.trait is TraitSeed);
}
InvOwnerMod
@@ -16,14 +16,11 @@ public static bool IsValidRuneMod(Thing t, SourceElement.Row row, string idMat)
}
}
}
foreach (int key in t.material.elementMap.Keys)
if (t.material.HasEnc(row.id))
{
if (key == row.id)
{
return false;
}
return false;
}
if (t.category.slot != 0 && !t.isRuneAdded)
if (t.category.slot != 0 && !t.HasRune())
{
return !t.IsUnique;
}
@@ -84,8 +81,7 @@ public override void _OnProcess(Thing t)
{
SE.Play("intonation");
EClass.pc.PlayEffect("intonation");
t.elements.SetBase(owner.refVal, owner.encLV);
t.isRuneAdded = true;
t.AddRune(owner);
owner.ModNum(-1);
}
else
RecipeCard
@@ -234,7 +234,7 @@ public override Thing Craft(BlessedState blessed, bool sound = false, List<Thing
{
if (ing2.trait is TraitRune)
{
thing.elements.ModBase(ing2.refVal, ing2.encLV);
thing.AddRune(ing2).dontConsumeSlot = true;
}
}
}
+SocketData
File Created
using System.Runtime.Serialization;
using Newtonsoft.Json;
public class SocketData : EClass
{
public enum Type
{
Socket,
Rune
}
[JsonProperty]
public int[] ints = new int[5];
public BitArray32 bits;
public Type type
{
get
{
return ints[0].ToEnum<Type>();
}
set
{
ints[0] = (int)value;
}
}
public int idEle
{
get
{
return ints[1];
}
set
{
ints[1] = value;
}
}
public int value
{
get
{
return ints[2];
}
set
{
ints[2] = value;
}
}
public bool dontConsumeSlot
{
get
{
return bits[0];
}
set
{
bits[0] = value;
}
}
[OnSerializing]
private void _OnSerializing(StreamingContext context)
{
ints[4] = (int)bits.Bits;
}
[OnDeserialized]
private void _OnDeserialized(StreamingContext context)
{
bits.Bits = (uint)ints[4];
}
}
SourceMaterial
@@ -122,6 +122,18 @@ public void SetTiles()
{
}
public bool HasEnc(int id)
{
foreach (int key in elementMap.Keys)
{
if (key == id)
{
return true;
}
}
return false;
}
public void AddBlood(Point p, int a = 1)
{
if (decal == 0)
TaskBuild
@@ -83,7 +83,7 @@ public bool CanRotateBlock()
{
return false;
}
if (!(EClass._zone is Zone_Tent) && !EClass._zone.IsPCFaction && EClass.pc.held.trait.CanBeOnlyBuiltInHome)
if (!(EClass._zone is Zone_Tent) && !EClass._zone.IsPCFactionOrTent && EClass.pc.held.trait.CanBeOnlyBuiltInHome)
{
return false;
}
@@ -177,7 +177,7 @@ public override HitResult GetHitResult()
}
if (!EClass.debug.ignoreBuildRule && !EClass._zone.IsPCFaction)
{
if (!(EClass._zone is Zone_Tent) && !EClass._zone.IsPCFaction && EClass.pc.held.trait.CanBeOnlyBuiltInHome)
if (!(EClass._zone is Zone_Tent) && !EClass._zone.IsPCFactionOrTent && EClass.pc.held.trait.CanBeOnlyBuiltInHome)
{
return HitResult.Invalid;
}
Thing
CheckJustCooked();
}
n.Clear();
string text = "";
string text2 = "";
TraitAbility traitAbility = trait as TraitAbility;
bool showEQStats = base.IsEquipmentOrRanged || base.IsAmmo;
bool flag = mode == IInspect.NoteMode.Product;
bool flag2 = base.IsIdentified || flag;
text = base.Name;
text2 = base.Name;
if (base.rarity == Rarity.Legendary || base.rarity == Rarity.Mythical)
{
string text2 = (text.Contains("『") ? "『" : (text.Contains("《") ? "《" : ""));
if (text2 != "")
string text3 = (text2.Contains("『") ? "『" : (text2.Contains("《") ? "《" : ""));
if (text3 != "")
{
string[] array = text.Split(text2);
text = array[0] + Environment.NewLine + text2 + array[1];
string[] array = text2.Split(text3);
text2 = array[0] + Environment.NewLine + text3 + array[1];
}
}
if (flag)
{
text = recipe.GetName();
text2 = recipe.GetName();
}
if (mode != IInspect.NoteMode.Recipe)
{
}
else
{
UIItem uIItem = n.AddHeaderCard(text);
UIItem uIItem = n.AddHeaderCard(text2);
SetImage(uIItem.image2);
uIItem.image2.Rect().pivot = new Vector2(0.5f, 0.5f);
string text3 = base.Num.ToFormat() ?? "";
string text4 = (Mathf.Ceil(0.01f * (float)base.ChildrenAndSelfWeight) * 0.1f).ToString("F1") + "s";
string text4 = base.Num.ToFormat() ?? "";
string text5 = (Mathf.Ceil(0.01f * (float)base.ChildrenAndSelfWeight) * 0.1f).ToString("F1") + "s";
if (things.Count > 0)
{
text3 = text3 + " (" + things.Count + ")";
text4 = text4 + " (" + things.Count + ")";
}
if (base.ChildrenAndSelfWeight != SelfWeight)
{
text4 = text4 + " (" + (Mathf.Ceil(0.01f * (float)SelfWeight) * 0.1f).ToString("F1") + "s)";
text5 = text5 + " (" + (Mathf.Ceil(0.01f * (float)SelfWeight) * 0.1f).ToString("F1") + "s)";
}
text = "_quantity".lang(text3 ?? "", text4);
text2 = "_quantity".lang(text4 ?? "", text5);
if (flag && recipe != null && (bool)LayerCraft.Instance)
{
text = text + " " + "_recipe_lv".lang(recipe.RecipeLv.ToString() ?? "");
text2 = text2 + " " + "_recipe_lv".lang(recipe.RecipeLv.ToString() ?? "");
}
uIItem.text2.SetText(text);
uIItem.text2.SetText(text2);
if (showEQStats && flag2)
{
if (!flag)
{
text = "";
text2 = "";
if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
{
if (base.DMG != 0)
{
text = text + "DMG".lang() + ((base.DMG > 0) ? "+" : "") + base.DMG + ", ";
text2 = text2 + "DMG".lang() + ((base.DMG > 0) ? "+" : "") + base.DMG + ", ";
}
if (base.HIT != 0)
{
text = text + "HIT".lang() + ((base.HIT > 0) ? "+" : "") + base.HIT + ", ";
text2 = text2 + "HIT".lang() + ((base.HIT > 0) ? "+" : "") + base.HIT + ", ";
}
if (DV != 0)
{
text = text + "DV".lang() + ((DV > 0) ? "+" : "") + DV + ", ";
text2 = text2 + "DV".lang() + ((DV > 0) ? "+" : "") + DV + ", ";
}
if (PV != 0)
{
text = text + "PV".lang() + ((PV > 0) ? "+" : "") + PV + ", ";
text2 = text2 + "PV".lang() + ((PV > 0) ? "+" : "") + PV + ", ";
}
if (Penetration != 0)
{
text = text + "PEN".lang() + ((Penetration > 0) ? "+" : "") + Penetration + "%, ";
text2 = text2 + "PEN".lang() + ((Penetration > 0) ? "+" : "") + Penetration + "%, ";
}
text = text.TrimEnd(' ').TrimEnd(',');
text2 = text2.TrimEnd(' ').TrimEnd(',');
}
if (!text.IsEmpty())
if (!text2.IsEmpty())
{
n.AddText("NoteText_eqstats", text);
n.AddText("NoteText_eqstats", text2);
}
}
if (trait is TraitToolRange traitToolRange)
}
else
{
string text5 = "";
string text6 = "";
if (EClass.debug.showExtra)
{
int totalQuality = GetTotalQuality();
int totalQuality2 = GetTotalQuality(applyBonus: false);
text5 = text5 + "Lv. " + base.LV + " TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ? "" : (" (" + totalQuality2 + ")"));
text6 = text6 + "Lv. " + base.LV + " TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ? "" : (" (" + totalQuality2 + ")"));
}
if (HasElement(10))
{
text5 = text5 + (text5.IsEmpty() ? "" : " ") + "_nutrition".lang(Evalue(10).ToFormat() ?? "");
text6 = text6 + (text6.IsEmpty() ? "" : " ") + "_nutrition".lang(Evalue(10).ToFormat() ?? "");
}
if ((base.category.IsChildOf("resource") || trait.IsTool) && !(trait is TraitAbility))
{
text5 = text5 + (text5.IsEmpty() ? "" : " ") + "_hardness".lang(base.material.hardness.ToString() ?? "");
text6 = text6 + (text6.IsEmpty() ? "" : " ") + "_hardness".lang(base.material.hardness.ToString() ?? "");
}
if (flag && recipe != null && (bool)LayerCraft.Instance)
{
text5 = text5 + (text5.IsEmpty() ? "" : " ") + "_max_quality".lang(recipe.GetQualityBonus().ToString() ?? "");
text6 = text6 + (text6.IsEmpty() ? "" : " ") + "_max_quality".lang(recipe.GetQualityBonus().ToString() ?? "");
}
if (!text5.IsEmpty())
if (!text6.IsEmpty())
{
n.AddText("NoteText_eqstats", text5);
n.AddText("NoteText_eqstats", text6);
}
}
}
@@ -990,9 +990,9 @@ public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns
}
if (flag2)
{
n.AddText("isMadeOf".lang(base.material.GetText(), base.material.hardness.ToString() ?? ""));
AddTextWithIcon("isMadeOf".lang(base.material.GetText(), base.material.hardness.ToString() ?? ""), EClass.core.refs.icons.enc.mat, FontColor.Default);
}
n.AddText("isCategorized".lang(base.category.GetText()));
AddText("isCategorized".lang(base.category.GetText()), FontColor.Default);
if (base.category.skill != 0)
{
int key = base.category.skill;
key = 305;
key2 = 304;
}
n.AddText("isUseSkill".lang(EClass.sources.elements.map[key].GetName().ToTitleCase(wholeText: true), EClass.sources.elements.map[key2].GetName().ToTitleCase(wholeText: true)));
AddText("isUseSkill".lang(EClass.sources.elements.map[key].GetName().ToTitleCase(wholeText: true), EClass.sources.elements.map[key2].GetName().ToTitleCase(wholeText: true)), FontColor.Default);
}
if (base.IsContainer)
{
n.AddText("isContainer".lang(things.MaxCapacity.ToString() ?? ""));
AddText("isContainer".lang(things.MaxCapacity.ToString() ?? ""), FontColor.Default);
}
if (base.c_lockLv != 0)
{
n.AddText((base.c_lockedHard ? "isLockedHard" : "isLocked").lang(base.c_lockLv.ToString() ?? ""), FontColor.Warning);
AddText((base.c_lockedHard ? "isLockedHard" : "isLocked").lang(base.c_lockLv.ToString() ?? ""), FontColor.Warning);
}
if (base.isCrafted && recipe == null)
{
n.AddText("isCrafted".lang());
AddText("isCrafted".lang(), FontColor.Default);
}
if (trait.Decay > 0)
{
string text6 = "";
text6 = (base.IsDecayed ? "isRotten" : (base.IsRotting ? "isRotting" : ((!base.IsFresn) ? "isNotFresh" : "isFresh")));
n.AddText(text6.lang());
string text7 = "";
text7 = (base.IsDecayed ? "isRotten" : (base.IsRotting ? "isRotting" : ((!base.IsFresn) ? "isNotFresh" : "isFresh")));
AddText(text7.lang(), FontColor.Default);
}
if (base.isDyed)
{
n.AddText("isDyed".lang());
AddText("isDyed".lang(), FontColor.Default);
}
if (base.IsEquipment)
{
text = "isEquipable".lang(Element.Get(base.category.slot).GetText());
n.AddText(text);
text2 = "isEquipable".lang(Element.Get(base.category.slot).GetText());
AddText(text2, FontColor.Default);
}
if (base.isFireproof)
{
n.AddText("isFreproof");
AddText("isFreproof", FontColor.Default);
}
if (base.isAcidproof)
{
n.AddText("isAcidproof");
AddText("isAcidproof", FontColor.Default);
}
if (trait.Electricity > 0)
{
n.AddText("isGenerateElectricity".lang(trait.Electricity.ToString() ?? ""));
AddText("isGenerateElectricity".lang(trait.Electricity.ToString() ?? ""), FontColor.Default);
}
if (trait.Electricity < 0)
{
n.AddText("isConsumeElectricity".lang(Mathf.Abs(trait.Electricity).ToString() ?? ""));
AddText("isConsumeElectricity".lang(Mathf.Abs(trait.Electricity).ToString() ?? ""), FontColor.Default);
}
if (base.IsUnique)
{
n.AddText("isPrecious");
AddText("isPrecious", FontColor.Default);
}
if (base.isCopy)
{
n.AddText("isCopy");
AddText("isCopy", FontColor.Default);
}
if (!trait.CanBeDestroyed)
{
n.AddText("isIndestructable");
AddText("isIndestructable", FontColor.Default);
}
if (GetInt(107) > 0)
{
n.AddText("isLicked", FontColor.Great);
AddText("isLicked", FontColor.Great);
}
if (base.isRuneAdded)
if (HasRune())
{
n.AddText("isRuneAdded", FontColor.Great);
AddTextWithIcon("isRuneAdded", EClass.core.refs.icons.enc.rune, FontColor.Great);
}
if (!base.c_idDeity.IsEmpty())
{
Religion religion = EClass.game.religions.Find(base.c_idDeity) ?? EClass.game.religions.Eyth;
n.AddText("isDeity".lang(religion.Name), FontColor.Myth);
AddText("isDeity".lang(religion.Name), FontColor.Myth);
}
if (base.isGifted && GetRoot() != EClass.pc)
{
n.AddText("isGifted", FontColor.Ether);
AddText("isGifted", FontColor.Ether);
}
if (base.isNPCProperty)
{
n.AddText("isNPCProperty", FontColor.Ether);
AddText("isNPCProperty", FontColor.Ether);
}
if (base.c_priceFix != 0)
{
n.AddText(((base.c_priceFix > 0) ? "isPriceUp" : "isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ?? ""), FontColor.Ether);
AddText(((base.c_priceFix > 0) ? "isPriceUp" : "isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ?? ""), FontColor.Ether);
}
if (base.noSell)
{
n.AddText("isNoSell", FontColor.Ether);
AddText("isNoSell", FontColor.Ether);
}
if (base.isStolen)
{
n.AddText("isStolen", FontColor.Ether);
AddText("isStolen", FontColor.Ether);
}
if (base.c_isImportant)
{
n.AddText("isMarkedImportant", FontColor.Ether);
AddText("isMarkedImportant", FontColor.Ether);
}
if (GetInt(25) != 0)
{
n.AddText("isDangerLv".lang((GetInt(25) + 1).ToString() ?? "", (EClass.pc.FameLv + 10).ToString() ?? ""));
AddText("isDangerLv".lang((GetInt(25) + 1).ToString() ?? "", (EClass.pc.FameLv + 10).ToString() ?? ""), FontColor.Default);
}
FontColor color = FontColor.Util;
FontColor col2 = FontColor.Util;
if (trait is TraitTool && !(trait is TraitToolRange))
{
if (HasElement(220))
{
n.AddText("canMine".lang(), color);
AddText("canMine".lang(), col2);
}
if (HasElement(225))
{
n.AddText("canLumberjack".lang(), color);
n.AddText("canLumberjack2".lang(), color);
AddText("canLumberjack".lang(), col2);
AddText("canLumberjack2".lang(), col2);
}
if (HasElement(230))
{
n.AddText("canDig", color);
AddText("canDig", col2);
}
if (HasElement(286))
{
n.AddText("canFarm", color);
AddText("canFarm", col2);
}
if (HasElement(245))
{
n.AddText("canFish", color);
AddText("canFish", col2);
}
if (HasElement(237))
{
n.AddText("canTame", color);
AddText("canTame", col2);
}
}
if (trait is TraitToolMusic)
{
n.AddText("canPlayMusic".lang(), color);
AddText("canPlayMusic".lang(), col2);
}
if (Lang.Has("hint_" + trait.ToString()))
{
n.AddText("hint_" + trait.ToString(), FontColor.Util);
AddText("hint_" + trait.ToString(), FontColor.Util);
}
if (Lang.Has("hint_" + trait.ToString() + "2"))
{
n.AddText("hint_" + trait.ToString() + "2", FontColor.Util);
AddText("hint_" + trait.ToString() + "2", FontColor.Util);
}
if (HasTag(CTAG.tourism))
{
n.AddText("isTourism", FontColor.Util);
AddText("isTourism", FontColor.Util);
}
string langPlaceType = base.TileType.LangPlaceType;
if (langPlaceType == "place_Door" || langPlaceType == "place_WallMount")
{
n.AddText(base.TileType.LangPlaceType + "_hint".lang(), FontColor.Util);
AddText(base.TileType.LangPlaceType + "_hint".lang(), FontColor.Util);
}
if (trait.IsHomeItem)
{
n.AddText("isHomeItem".lang(), FontColor.Util);
AddText("isHomeItem".lang(), FontColor.Util);
}
if (HasTag(CTAG.throwWeapon))
{
n.AddText("isThrowWeapon");
AddText("isThrowWeapon", FontColor.Default);
}
if (EClass.debug.showExtra && HasTag(CTAG.throwWeaponEnemy))
{
n.AddText("isThrowWeaponEnemy");
AddText("isThrowWeaponEnemy", FontColor.Default);
}
if (HasElement(10))
{
n.AddText("isEdible");
AddText("isEdible", FontColor.Default);
}
if (HasTag(CTAG.rareResource))
{
n.AddText("isRareResource", FontColor.Great);
AddText("isRareResource", FontColor.Great);
}
if (trait is TraitBed traitBed)
{
n.AddText("isBed".lang(traitBed.MaxHolders.ToString() ?? ""));
AddText("isBed".lang(traitBed.MaxHolders.ToString() ?? ""), FontColor.Default);
}
bool flag3 = base.IsEquipmentOrRanged || base.IsAmmo || base.IsThrownWeapon;
if (flag2)
Element element = elements.GetElement(653);
if (element != null)
{
n.AddText("isAlive".lang(element.vBase.ToString() ?? "", (element.vExp / 10).ToString() ?? "", (element.ExpToNext / 10).ToString() ?? ""), FontColor.Great);
AddText("isAlive".lang(element.vBase.ToString() ?? "", (element.vExp / 10).ToString() ?? "", (element.ExpToNext / 10).ToString() ?? ""), FontColor.Great);
}
string[] rangedSubCats = new string[2] { "eleConvert", "eleAttack" };
elements.AddNote(n, delegate(Element e)
{
foreach (int socket in sockets)
{
n.AddText((socket == 0) ? "emptySocket".lang() : "socket".lang(EClass.sources.elements.map[socket / 100].GetName(), (socket % 100).ToString() ?? ""), FontColor.Gray);
AddText((socket == 0) ? "emptySocket".lang() : "socket".lang(EClass.sources.elements.map[socket / 100].GetName(), (socket % 100).ToString() ?? ""), FontColor.Gray);
}
}
}
else
{
n.AddText("isUnidentified".lang(), FontColor.Flavor);
AddText("isUnidentified".lang(), FontColor.Flavor);
if (base.c_IDTState == 1)
{
n.AddText("isUnidentified2".lang(), FontColor.Flavor);
AddText("isUnidentified2".lang(), FontColor.Flavor);
}
}
trait.WriteNote(n, flag2);
}
elements.AddNote(n, (Element e) => list.Contains(e), null, ElementContainer.NoteMode.Trait, addRaceFeat: false, delegate(Element e, string s)
{
string text11 = s;
string text12 = e.source.GetText("textExtra");
if (!text12.IsEmpty())
string text12 = s;
string text13 = e.source.GetText("textExtra");
if (!text13.IsEmpty())
{
string text13 = "";
string text14 = "";
if (e.id == 2 && mode == IInspect.NoteMode.Product)
{
int num2 = recipe.GetQualityBonus() / 10;
{
num2++;
}
text13 = "qualityLimit".lang(num2.ToString() ?? "");
text14 = "qualityLimit".lang(num2.ToString() ?? "");
}
int num3 = e.Value / 10;
num3 = ((e.Value < 0) ? (num3 - 1) : (num3 + 1));
text12 = "Lv." + num3 + text13 + " " + text12;
text13 = "Lv." + num3 + text14 + " " + text13;
if (infoMode && e.IsFoodTraitMain)
{
text12 += "traitAdditive".lang();
text13 += "traitAdditive".lang();
}
text11 += (" <size=12>" + text12 + "</size>").TagColor(FontColor.Passive);
text12 += (" <size=12>" + text13 + "</size>").TagColor(FontColor.Passive);
}
return text11;
return text12;
}, delegate
{
});
{
if (FoodEffect.IsHumanFlesh(this))
{
n.AddText("foodHuman".lang(), FontColor.Ether);
AddText("foodHuman".lang(), FontColor.Ether);
}
if (FoodEffect.IsUndeadFlesh(this))
{
n.AddText("foodUndead".lang(), FontColor.Ether);
AddText("foodUndead".lang(), FontColor.Ether);
}
}
if (list.Count != list2.Count)
{
n.AddText("traitOther".lang((list2.Count - list.Count).ToString() ?? ""));
AddText("traitOther".lang((list2.Count - list.Count).ToString() ?? ""), FontColor.Default);
}
if (mode == IInspect.NoteMode.Product && HasTag(CTAG.dish_bonus))
{
n.AddHeader("HeaderAdditionalTrait", "additional_trait");
source.model.elements.AddNote(n, (Element e) => e.IsFoodTraitMain, null, ElementContainer.NoteMode.Trait, addRaceFeat: false, delegate(Element e, string s)
{
string text8 = s;
string text9 = e.source.GetText("textExtra");
if (!text9.IsEmpty())
string text9 = s;
string text10 = e.source.GetText("textExtra");
if (!text10.IsEmpty())
{
string text10 = "";
string text11 = "";
int num = e.Value / 10;
num = ((e.Value < 0) ? (num - 1) : (num + 1));
text9 = "Lv." + num + text10 + " " + text9;
text10 = "Lv." + num + text11 + " " + text10;
if (infoMode && e.IsFoodTraitMain)
{
text9 += "traitAdditive".lang();
text10 += "traitAdditive".lang();
}
text8 += (" <size=12>" + text9 + "</size>").TagColor(FontColor.Passive);
text9 += (" <size=12>" + text10 + "</size>").TagColor(FontColor.Passive);
}
return text8;
return text9;
});
}
}
}
if (id == "statue_weird")
{
n.AddText("weirdStatue");
AddText("weirdStatue", FontColor.Default);
}
if (base.isReplica)
{
n.AddText("isReplica", FontColor.Passive);
AddText("isReplica", FontColor.Passive);
}
if (flag2)
{
{
n.AddHeader("headerAttackEval");
AttackProcess.Current.Prepare(chara ?? EClass.pc, this, null, null, 0, base.IsThrownWeapon);
string text7 = AttackProcess.Current.GetText();
text7 = text7.TagColor(() => true);
n.AddText(text7);
string text8 = AttackProcess.Current.GetText();
text8 = text8.TagColor(() => true);
n.AddText(text8);
}
}
if (base.ammoData != null)
}
}
n.Build();
void AddText(string text, FontColor col)
{
n.AddText("NoteText_enc", text, col);
}
void AddTextWithIcon(string text, Sprite sprite, FontColor col)
{
UIItem uIItem2 = n.AddText("NoteText_enc", text, col);
uIItem2.image1.SetActive(enable: true);
uIItem2.image1.sprite = sprite;
}
}
public static void AddAttackEvaluation(UINote n, Chara chara, Thing current = null)
@@ -1881,7 +1891,7 @@ public void DoAct(Act act)
public void TryLickEnchant(Chara c, bool msg = true, Chara tg = null, BodySlot slot = null)
{
if (!base.IsEquipmentOrRanged || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0 || base.isRuneAdded)
if (!base.IsEquipmentOrRanged || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0)
{
return;
}
TraitCrafter
@@ -306,10 +306,10 @@ public virtual Thing Craft(AI_UseCrafter ai)
case MixType.Sculpture:
{
t = ThingGen.Create(thing3);
List<CardRow> list = EClass.player.codex.ListKills();
list.Add(EClass.sources.cards.map["putty"]);
list.Add(EClass.sources.cards.map["snail"]);
CardRow cardRow = list.RandomItemWeighted((CardRow a) => Mathf.Max(50 - a.LV, Mathf.Clamp(EClass.pc.Evalue(258) / 2, 1, a.LV * 2)));
List<CardRow> list2 = EClass.player.codex.ListKills();
list2.Add(EClass.sources.cards.map["putty"]);
list2.Add(EClass.sources.cards.map["snail"]);
CardRow cardRow = list2.RandomItemWeighted((CardRow a) => Mathf.Max(50 - a.LV, Mathf.Clamp(EClass.pc.Evalue(258) / 2, 1, a.LV * 2)));
t.c_idRefCard = cardRow.id;
t.ChangeMaterial(thing.material);
t.SetEncLv(Mathf.Min(EClass.rnd(EClass.rnd(Mathf.Max(5 + EClass.pc.Evalue(258) - cardRow.LV, 1))), 12));
@@ -321,22 +321,32 @@ public virtual Thing Craft(AI_UseCrafter ai)
Thing eq = ai.ings[0];
Thing thing7 = eq.Duplicate(1);
thing7.SetEncLv(0);
List<Element> list2 = thing7.elements.ListRune();
if (list2.Count == 0)
List<Element> list = thing7.elements.ListRune();
if (list.Count == 0)
{
Msg.SayNothingHappen();
break;
}
foreach (Element item in list)
{
SocketData runeEnc = eq.GetRuneEnc(item.id);
if (runeEnc != null)
{
item.vBase = runeEnc.value;
item.vSource = 0;
}
}
if (eq.material.hardness > owner.material.hardness && !EClass.debug.enable)
{
Msg.Say("rune_tooHard", owner);
break;
}
EClass.ui.AddLayer<LayerList>().SetList2(list2, (Element a) => a.Name, delegate(Element a, ItemGeneral b)
EClass.ui.AddLayer<LayerList>().SetList2(list, (Element a) => a.Name, delegate(Element a, ItemGeneral b)
{
owner.ModNum(-1);
eq.Destroy();
Thing thing8 = ThingGen.Create("rune");
thing8.ChangeMaterial(owner.material);
thing8.refVal = a.id;
thing8.encLV = a.vBase + a.vSource;
EClass.pc.Pick(thing8);
TraitKettle
@@ -48,7 +48,7 @@ public override bool CanJoinParty
public override bool CanCopy(Thing t)
{
if (t.noSell || t.isRuneAdded || t.HasElement(1229))
if (t.noSell || t.HasRune() || t.HasElement(1229))
{
return false;
}
TraitObj
public class TraitObj : TraitTile
{
public override TileRow source => EClass.sources.objs.rows[owner.refVal];
public override bool CanBeOnlyBuiltInHome => true;
}
Zone
@@ -463,6 +463,18 @@ public bool CanEnterBuildModeAnywhere
public bool IsPCFaction => base.mainFaction == EClass.pc.faction;
public bool IsPCFactionOrTent
{
get
{
if (base.mainFaction != EClass.pc.faction)
{
return EClass._zone is Zone_Tent;
}
return true;
}
}
public bool IsStartZone => this == EClass.game.StartZone;
public bool IsInstance => instance != null;