Skip to content

EA 23.180 Nightly

August 15, 2025

22 files modified. 2 new files created.

Important Changes

Possible breaking changes. Click the filename to view the chunk.

Card (4)

cs
public SocketData AddRune(int idEle, int v) 
public SocketData AddRune(int idEle, int v, bool free) 
cs
public int CountRune() 
public int CountRune(bool countFree = true) 
cs
public bool CanAddRune(SourceElement.Row row) 
public bool CanAddRune(TraitMod mod) 
cs
public Thing TryMakeRandomItem(int lv = -1) 
public Thing TryMakeRandomItem(int lv = -1, TryMakeRandomItemSource itemSource = TryMakeRandomItemSource.Default, Chara crafter = null) 

BaseListPeople

void AddText(Hobby h, string lang, bool fix)

cs
				{
					SourceElement.Row row = EClass.sources.elements.map[h.source.elements[j]];
					int num2 = h.source.elements[j + 1];
					float num3 = ((num2 < 0 || row.id == 2115 || row.id == 2207) ? ((float)(num2 / 10)) : Mathf.Max(0f, (long)num2 * (long)h.GetEfficiency(a) * a.homeBranch.efficiency / 100 / 1000)); 
					float num3 = ((num2 < 0 || row.id == 2115 || row.id == 2207) ? ((float)(num2 / 10)) : Mathf.Max((h.GetEfficiency(a) > 0) ? 1 : 0, (long)num2 * (long)h.GetEfficiency(a) * a.homeBranch.efficiency / 100 / 1000)); 
					t.note.AddText("NoteText_small", "・ " + "workBonus_skill".lang(row.GetName().ToTitleCase(), ((num2 > 0) ? "+" : "") + num3) + ((row.id == 2115 || row.id == 2207) ? (" " + "fixedFactionSkill".lang()) : ""), (num2 >= 0) ? FontColor.Default : FontColor.Bad);
				}
			}

Card

public virtual void ApplyMaterial(bool remove = false)

cs

	public Card ChangeMaterial(int idNew, bool ignoreFixedMaterial = false)
	{
		return ChangeMaterial(EClass.sources.materials.map[idNew], ignoreFixedMaterial); 
		return ChangeMaterial(EClass.sources.materials.map.TryGetValue(idNew, 1), ignoreFixedMaterial); 
	}

	public Card ChangeMaterial(string idNew, bool ignoreFixedMaterial = false)
	{
		return ChangeMaterial(EClass.sources.materials.alias[idNew], ignoreFixedMaterial); 
		return ChangeMaterial(EClass.sources.materials.alias.TryGetValue(idNew, "oak"), ignoreFixedMaterial); 
	}

	public Card ChangeMaterial(SourceMaterial.Row row, bool ignoreFixedMaterial = false)

public void EjectSockets()

cs

	public SocketData AddRune(Card rune)
	{
		return AddRune(rune.refVal, rune.encLV); 
		return AddRune(rune.refVal, rune.encLV, rune.trait is TraitRuneFree); 
	}

	public SocketData AddRune(int idEle, int v) 
	public SocketData AddRune(int idEle, int v, bool free) 
	{
		if (socketList == null)
		{

public SocketData AddRune(int idEle, int v)

cs
	{
		idEle = idEle,
		value = v,
		type = SocketData.Type.Rune 
		type = SocketData.Type.Rune, 
		isFree = free 
	};
	socketList.Add(socketData);
	if (IsWeapon || !row.IsWeaponEnc)

public SocketData GetRuneEnc(int idEle)

cs
		return null;
	}

	public int CountRune() 
	public int CountRune(bool countFree = true) 
	{
		int num = 0;
		if (socketList != null)
		{
			foreach (SocketData socket in socketList)
			{
				if (socket.type == SocketData.Type.Rune) 
				if (socket.type == SocketData.Type.Rune && (countFree || !socket.isFree)) 
				{
					num++;
				}

public int MaxRune()

cs
		return ((!IsUnique) ? 1 : 0) + Evalue(484);
	}

	public bool CanAddRune(SourceElement.Row row) 
	public bool CanAddRune(TraitMod mod) 
	{
		SourceElement.Row source = mod.source; 
		if (category.slot == 0)
		{
			return false;
		}
		if (material.HasEnc(row.id)) 
		if (material.HasEnc(source.id)) 
		{
			return false;
		}
		if (!IsWeapon && row.IsWeaponEnc) 
		if (!IsWeapon && source.IsWeaponEnc) 
		{
			return false;
		}
		if (row.category == "resist") 
		if (source.category == "resist") 
		{
			foreach (Element item in elements.ListElements())
			{

public bool CanAddRune(SourceElement.Row row)

cs
			}
		}
	}
	string encSlot = row.encSlot; 
	string encSlot = source.encSlot; 
	if (encSlot == null || encSlot.Length != 0)
	{
		switch (encSlot)

public bool CanAddRune(SourceElement.Row row)

cs
		default:
		{
			bool flag = false;
			string[] array = row.encSlot.Split(','); 
			string[] array = source.encSlot.Split(','); 
			foreach (string key in array)
			{
				if (EClass.sources.elements.alias[key].id == category.slot)

public bool CanAddRune(SourceElement.Row row)

cs
				break;
			}
		}
		return CountRune() < MaxRune(); 
		if (mod is TraitRuneFree) 
		{ 
			return true; 
		} 
		return CountRune(countFree: false) < MaxRune(); 
	}

	public bool HasRune()

bool chance(int i)

cs
		}
	}

	public Thing TryMakeRandomItem(int lv = -1) 
	public Thing TryMakeRandomItem(int lv = -1, TryMakeRandomItemSource itemSource = TryMakeRandomItemSource.Default, Chara crafter = null) 
	{
		if (lv == -1)
		{

public Thing TryMakeRandomItem(int lv = -1)

cs
		{
			text = "c_animal";
		}
		if (itemSource == TryMakeRandomItemSource.Cooking && crafter != null && crafter.HasElement(1205)) 
		{ 
			text = "c_human"; 
		} 
		for (int i = 0; i < 20; i++)
		{
			CardRow cardRow = SpawnList.Get(text).Select(lv + i);
			if (cardRow.model.Chara.race.corpse[0] != "_meat" && id != "milk" && id != "_egg" && id != "egg_fertilized") 
			if ((cardRow.model.Chara.race.corpse[0] != "_meat" && id != "milk" && id != "_egg" && id != "egg_fertilized") || (itemSource == TryMakeRandomItemSource.Cooking && cardRow.model.HasElement(701))) 
			{
				continue;
			}

public virtual int GetPrice(CurrencyType currency = CurrencyType.Money, bool sel

cs
			{
			case "plat":
				return 500;
			case "rune_free":
				return 1000; 
			case "whip_egg":
				return 3000;
			case "hammer_strip":

Chara

public void OnSleep(int power, int days = 1)

cs

	public void ModHeight(int a)
	{
		int height = bio.height; 
		height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1)); 
		if (height < 1) 
		{ 
			height = 1; 
		} 
		if (height != bio.height) 
		if (!HasElement(450)) 
		{
			bio.height = height; 
			Say((a > 0) ? "height_gain" : "height_lose", this); 
			int height = bio.height; 
			height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1)); 
			if (height < 1) 
			{ 
				height = 1; 
			} 
			if (height != bio.height) 
			{ 
				bio.height = height; 
				Say((a > 0) ? "height_gain" : "height_lose", this); 
			} 
		}
	}

	public void ModWeight(int a, bool ignoreLimit = false)
	{
		if (a == 0) 
		if (HasElement(450) || a == 0) 
		{
			return;
		}

CoreDebug

public void UpdateInput()

cs
			EClass.pc.Pick(targetChara.MakeGene());
			EClass.pc.Pick(targetChara.MakeBraineCell());
			EClass.pc.Pick(targetChara.MakeEgg(effect: true, 10));
			targetChara.ModAffinity(EClass.pc, 10000); 
		}
		if (EClass.game.quests.Get<QuestDebt>() == null)
		{

CraftUtil

public static void MakeDish(Thing food, int lv, Chara crafter = null)

cs
		{
			thing = ThingGen.Create("_meat");
		}
		thing = thing.TryMakeRandomItem(lv); 
		thing = thing.TryMakeRandomItem(lv, TryMakeRandomItemSource.Cooking, crafter); 
		TraitSeed.LevelSeed(thing, null, EClass.rnd(lv / 4) + 1);
		thing.SetEncLv(thing.encLV / 2);
		if (num > 0 && EClass.rnd(3) == 0)

public static Thing MakeLoveLunch(Chara c)

cs
	thing.MakeRefFrom(c);
	int num = c.uid + EClass.world.date.year * 10000 + EClass.world.date.month * 100;
	Rand.SetSeed(num);
	int num2 = 3 + EClass.rnd(3); 
	float num2 = Mathf.Clamp(1f + Mathf.Sqrt(c.Evalue(287) / 5), 2f, 6f); 
	if (!EClass.debug.autoIdentify)
	{
		thing.c_IDTState = 5;
	}
	for (int i = 0; i < num2; i++) 
	for (int i = 0; (float)i < num2; i++) 
	{
		Rand.SetSeed(num + i);
		AddIngredient(thing, c, GetRandomLoveLunchIngredient(c), writeCrafter: false);
	}
	thing.elements.SetBase(701, 0); 
	if (thing.Evalue(753) < 0) 
	{ 
		thing.elements.SetBase(753, 0); 
	} 
	Rand.SetSeed();
	return thing;
}

ENC

public class ENC

cs

	public const int r_DV = 650;

	public const int r_mana = 641; 
	public const int mod_frustration = 624;

	public const int mod_flurry = 621; 
	public const int mod_cleave = 622;

	public const int mod_feint = 623;

	public const int r_life = 640; 
	public const int noDamage = 654;

	public const int r_mana = 641; 
	public const int r_life = 640; 

	public const int onlyPet = 655;

public class ENC

cs

	public const int convertFire = 850;

	public const int mod_flurry = 621; 
	public const int mod_chaser = 620; 

	public const int convertImpact = 865;

public class ENC

cs

	public const int permaCurse = 656;

	public const int mod_chaser = 620; 
	public const int mod_talisman = 609; 

	public const int negateSleep = 424;

	public const int mod_splash = 608; 
	public const int mod_scatter = 607; 

	public const int negateShockwave = 430;

public class ENC

cs

	public const int resWeather = 408;

	public const int mod_talisman = 609; 
	public const int mod_splash = 608; 

	public const int resMutation = 406;

public class ENC

cs

	public const int sustain_PER = 443;

	public const int force_weapon = 482; 
	public const int optimizeMana = 483;

	public const int slot_rune = 484;

public class ENC

cs

	public const int creativeChef = 487;

	public const int deathagony = 488; 
	public const int revealFaith = 481; 

	public const int force_weapon = 482; 
	public const int deathagony = 488; 

	public const int mod_ammo = 600; 
	public const int mod_reload = 601; 

	public const int mod_rapid = 602; 
	public const int mod_ammo_knockback = 603; 

	public const int mod_ammo_recover = 604;

public class ENC

cs

	public const int mod_drill = 606;

	public const int mod_scatter = 607; 
	public const int sustain_DEX = 442;

	public const int mod_reload = 601; 
	public const int mod_ammo = 600; 

	public const int revealFaith = 481; 
	public const int strongStomach = 480; 

	public const int mod_ammo_knockback = 603; 
	public const int mod_rapid = 602; 

	public const int bane_all = 468; 
	public const int bane_fish = 467; 

	public const int strongStomach = 480; 
	public const int bane_all = 468; 

	public const int sustain_WIL = 445;

public class ENC

cs

	public const int sustain_LER = 444;

	public const int sustain_figure = 450; 
	public const int bane_dragon = 460;

	public const int bane_undead = 461;

	public const int bane_fairy = 462; 
	public const int sustain_CHA = 447;

	public const int bane_fairy = 462; 
	public const int bane_animal = 463;

	public const int bane_man = 464;

public class ENC

cs

	public const int bane_god = 466;

	public const int bane_fish = 467; 
	public static readonly int[] IDS = new int[91] 
	public static readonly int[] IDS = new int[92] 
	{
		653, 652, 651, 650, 624, 622, 623, 640, 654, 641, 
		655, 851, 660, 661, 662, 663, 664, 665, 666, 850, 
		621, 865, 852, 656, 620, 424, 608, 430, 429, 428, 
		427, 426, 425, 423, 422, 421, 420, 419, 418, 417, 
		416, 415, 414, 412, 411, 410, 409, 408, 609, 406, 
		405, 404, 403, 402, 401, 400, 440, 441, 407, 443, 
		483, 484, 485, 486, 487, 488, 482, 600, 602, 604, 
		605, 606, 607, 442, 601, 481, 603, 468, 480, 445, 
		446, 444, 460, 461, 462, 447, 463, 464, 465, 466, 
		467
		653, 652, 651, 650, 641, 624, 621, 622, 623, 654, 
		640, 655, 851, 660, 661, 662, 663, 664, 665, 666, 
		850, 620, 865, 852, 656, 609, 424, 607, 430, 429, 
		428, 427, 426, 425, 423, 422, 421, 420, 419, 418, 
		417, 416, 415, 414, 412, 411, 410, 409, 408, 608, 
		406, 405, 404, 403, 402, 401, 400, 440, 441, 407, 
		443, 482, 483, 484, 485, 486, 487, 481, 488, 601, 
		603, 604, 605, 606, 442, 600, 480, 602, 467, 468, 
		445, 446, 444, 450, 460, 461, 447, 462, 463, 464, 
		465, 466
	};
}

InvOwnerMod

public override bool ShouldShowGuide(Thing t)

cs
	TraitMod traitMod = owner.trait as TraitMod;
	if (traitMod is TraitRune)
	{
		if (!t.CanAddRune(traitMod.source)) 
		if (!t.CanAddRune(traitMod)) 
		{
			return false;
		}

MATERIAL

``

cs

public class MATERIAL : EClass
{
	public const byte idNull = 1; 
	public const byte oak = 1;

	public const byte granite = 3;

public class MATERIAL : EClass

cs

	public const byte sand_sea = 97;

	public const string aliasNull = "oak"; 
	public static SourceMaterial.Row sourceSnow = EClass.sources.materials.rows[48];

	public static SourceMaterial.Row sourceIce = EClass.sources.materials.rows[61];

Props

void TryAdd(Thing t)

cs
	}
	void TryAdd(Thing t)
	{
		if (t.HasElement(10) && !(t.trait is TraitFoodMeal) && !t.IsExcludeFromCraft(ing) && !stack.list.Contains(t)) 
		if (t.HasElement(10) && !(t.trait is TraitFoodMeal) && !(t.trait is TraitFoodFishSlice) && !t.IsExcludeFromCraft(ing) && !stack.list.Contains(t)) 
		{
			stack.Add(t.Thing);
		}

QuestSupplyCat

public override bool IsDestThing(Thing t)

cs

	public override void SetIdThing()
	{
		List<SourceCategory.Row> list = EClass.sources.categories.rows.Where((SourceCategory.Row c) => c._parent == "meal").ToList(); 
		List<SourceCategory.Row> list = EClass.sources.categories.rows.Where((SourceCategory.Row c) => c._parent == "meal" && c.id != "meal_lunch").ToList(); 
		idCat = list.RandomItem().id;
	}

Recipe

static string CatName(string id)

cs

		public bool IsValidIngredient(Thing t)
		{
			if (ingType == IngType.CreativeFood && t.HasElement(10)) 
			if (ingType == IngType.CreativeFood && t.HasElement(10) && !(t.trait is TraitFoodFishSlice)) 
			{
				return true;
			}

SerializedCards

public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
		}
		if (version >= 2 && card4.idDyeMat != -1)
		{
			card2.Dye(EClass.sources.materials.rows[card4.idDyeMat]); 
			card2.Dye(EClass.sources.materials.rows.TryGet(card4.idDyeMat, 1)); 
		}
		card2.mapObj = card4.obj;
		if (card2.mapObj?.TryGetValue(2) != null)

SocketData

public int value

cs
		}
	}

	public bool isFree 
	{ 
		get 
		{ 
			return bits[0]; 
		} 
		set 
		{ 
			bits[0] = value; 
		} 
	} 
	[OnSerializing]
	private void _OnSerializing(StreamingContext context)
	{

SourceAsset

using System.Collections.Generic;

cs
using System.Collections.Generic;
using System.IO; 
using UnityEngine;

public class SourceAsset : EScriptable

public void SavePrefs(string id = "prefs")

cs

	public static void _SavePrefs(string id = "prefs")
	{
		IO.CopyAs(PrefPath + id, PrefPath + id + "_bk"); 
		if (File.Exists(PrefPath + id)) 
		{ 
			IO.CopyAs(PrefPath + id, PrefPath + id + "_bk"); 
		} 
		Prefs prefs = new Prefs();
		prefs.version = 2;
		Debug.Log(EClass.sources.things.rows.Count);

SourceChara

public override void SetRow(Row r)

cs

	public override void BackupPref()
	{
		SourceAsset._SavePrefs("prefs_auto"); 
		_rows.Clear();
		foreach (Row row in rows)
		{

SourceThing

public override void SetRow(Row r)

cs

	public override void BackupPref()
	{
		SourceAsset._SavePrefs("prefs_auto"); 
		_rows.Clear();
		foreach (Row row in rows)
		{

TCOrbitChara

public void RefreshAll()

cs
	Emo2 emo = owner.emoIcon;
	if (emo == Emo2.none)
	{
		if (owner.isRestocking && (!owner.IsPCParty || EMono._zone.IsPCFaction) && owner.trait.GetRestockedIcon() != 0 && !(EMono._zone is Zone_Dungeon)) 
		if (!owner.IsPC && ((owner.affinity.CanGiveCard() && !EMono.player.codex.DroppedCard(owner.id)) || owner.GetInt(71) == -2)) 
		{
			emo = owner.trait.GetRestockedIcon(); 
			emo = Emo2.hintEvent; 
		}
		else if (!owner.IsPC && ((owner.affinity.CanGiveCard() && !EMono.player.codex.DroppedCard(owner.id)) || owner.GetInt(71) == -2)) 
		else if (owner.isRestocking && (!owner.IsPCParty || EMono._zone.IsPCFaction) && owner.trait.GetRestockedIcon() != 0 && !(EMono._zone is Zone_Dungeon)) 
		{
			emo = Emo2.hintEvent; 
			emo = owner.trait.GetRestockedIcon(); 
		}
		else
		{

TaskHarvest

public void HarvestThing()

cs
			fixedQuality = true
		});
		Thing thing = ThingGen.Create(text, 1, Mathf.Max(1, lV * 2 / 3));
		if (thing != null) 
		if (thing == null) 
		{
			thing.SetNum((int)num); 
			thing.ChangeMaterial(target.material); 
			thing.decay = decay; 
			if (thing.IsDecayed && thing.IsFood) 
			{ 
				thing.elements.SetBase(73, -10); 
			} 
			EClass._map.TrySmoothPick(pos.IsBlocked ? owner.pos : pos, thing, EClass.pc); 
			return; 
		} 
		if (EClass._zone.IsUserZone && target.isNPCProperty && thing.trait is TraitPotionLove) 
		{ 
			Msg.Say("spellbookCrumble", thing); 
			thing.Destroy(); 
			return; 
		} 
		thing.SetNum((int)num); 
		thing.ChangeMaterial(target.material); 
		thing.decay = decay; 
		if (thing.IsDecayed && thing.IsFood) 
		{ 
			thing.elements.SetBase(73, -10); 
		}
		EClass._map.TrySmoothPick(pos.IsBlocked ? owner.pos : pos, thing, EClass.pc); 
	}
}

Thing

public List<Element> ListValidTraits(bool isCraft, bool limit)

cs
{
	List<Element> list = ListLimitedValidTraits(limit);
	bool showFoodEnc = base.ShowFoodEnc;
	bool flag = EClass.pc.HasElement(1650); 
	bool flag = EClass.debug.enable || EClass.pc.HasElement(1650); 
	if (showFoodEnc)
	{
		foreach (Element value in elements.dict.Values)

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
	{
		CheckJustCooked();
	}
	string text2 = ((trait is TraitLunchLove) ? "_heart".lang().TagColor(FontColor.Bad) : ""); 
	n.Clear();
	string text2 = ""; 
	string text3 = ""; 
	TraitAbility traitAbility = trait as TraitAbility;
	bool showEQStats = base.IsEquipmentOrRangedOrAmmo;
	bool flag = mode == IInspect.NoteMode.Product;
	bool flag2 = base.IsIdentified || flag;
	text2 = base.Name; 
	text3 = base.Name; 
	if (base.rarity == Rarity.Legendary || base.rarity == Rarity.Mythical)
	{
		string text3 = (text2.Contains("『") ? "『" : (text2.Contains("《") ? "《" : "")); 
		if (text3 != "") 
		string text4 = (text3.Contains("『") ? "『" : (text3.Contains("《") ? "《" : "")); 
		if (text4 != "") 
		{
			string[] array = text2.Split(text3); 
			text2 = array[0] + Environment.NewLine + text3 + array[1]; 
			string[] array = text3.Split(text4); 
			text3 = array[0] + Environment.NewLine + text4 + array[1]; 
		}
	}
	if (flag)
	{
		if (!(trait is TraitPotionAlchemy))
		{
			text2 = recipe.GetName(); 
			text3 = recipe.GetName(); 
		}
		if (trait.CraftNum > 1)
		{
			text2 = text2 + " x " + trait.CraftNum; 
			text3 = text3 + " x " + trait.CraftNum; 
		}
	}
	if (mode != IInspect.NoteMode.Recipe)

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
		}
		else
		{
			UIItem uIItem = n.AddHeaderCard(text2); 
			UIItem uIItem = n.AddHeaderCard(text3); 
			SetImage(uIItem.image2);
			uIItem.image2.Rect().pivot = new Vector2(0.5f, 0.5f);
			string text4 = base.Num.ToFormat() ?? ""; 
			string text5 = (Mathf.Ceil(0.01f * (float)base.ChildrenAndSelfWeight) * 0.1f).ToString("F1") + "s"; 
			string text5 = base.Num.ToFormat() ?? ""; 
			string text6 = (Mathf.Ceil(0.01f * (float)base.ChildrenAndSelfWeight) * 0.1f).ToString("F1") + "s"; 
			if (things.Count > 0)
			{
				text4 = text4 + " (" + things.Count + ")"; 
				text5 = text5 + " (" + things.Count + ")"; 
			}
			if (base.ChildrenAndSelfWeight != SelfWeight)
			{
				text5 = text5 + " (" + (Mathf.Ceil(0.01f * (float)SelfWeight) * 0.1f).ToString("F1") + "s)"; 
				text6 = text6 + " (" + (Mathf.Ceil(0.01f * (float)SelfWeight) * 0.1f).ToString("F1") + "s)"; 
			}
			text2 = "_quantity".lang(text4 ?? "", text5); 
			text3 = "_quantity".lang(text5 ?? "", text6); 
			if (flag && recipe != null && (bool)LayerCraft.Instance)
			{
				text2 = text2 + "  " + "_recipe_lv".lang(recipe.RecipeLv.ToString() ?? ""); 
				text3 = text3 + "  " + "_recipe_lv".lang(recipe.RecipeLv.ToString() ?? ""); 
			}
			uIItem.text2.SetText(text2); 
			uIItem.text2.SetText(text3); 
			if (showEQStats && flag2)
			{
				text2 = ""; 
				text3 = ""; 
				if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
				{
					if (base.DMG != 0)
					{
						text2 = text2 + "DMG".lang() + ((base.DMG > 0) ? "+" : "") + base.DMG + ", "; 
						text3 = text3 + "DMG".lang() + ((base.DMG > 0) ? "+" : "") + base.DMG + ", "; 
					}
					if (base.HIT != 0)
					{
						text2 = text2 + "HIT".lang() + ((base.HIT > 0) ? "+" : "") + base.HIT + ", "; 
						text3 = text3 + "HIT".lang() + ((base.HIT > 0) ? "+" : "") + base.HIT + ", "; 
					}
					if (DV != 0)
					{
						text2 = text2 + "DV".lang() + ((DV > 0) ? "+" : "") + DV + ", "; 
						text3 = text3 + "DV".lang() + ((DV > 0) ? "+" : "") + DV + ", "; 
					}
					if (PV != 0)
					{
						text2 = text2 + "PV".lang() + ((PV > 0) ? "+" : "") + PV + ", "; 
						text3 = text3 + "PV".lang() + ((PV > 0) ? "+" : "") + PV + ", "; 
					}
					if (Penetration != 0)
					{
						text2 = text2 + "PEN".lang() + ((Penetration > 0) ? "+" : "") + Penetration + "%, "; 
						text3 = text3 + "PEN".lang() + ((Penetration > 0) ? "+" : "") + Penetration + "%, "; 
					}
					text2 = text2.TrimEnd(' ').TrimEnd(','); 
					text3 = text3.TrimEnd(' ').TrimEnd(','); 
				}
				if (!text2.IsEmpty()) 
				if (!text3.IsEmpty()) 
				{
					n.AddText("NoteText_eqstats", text2); 
					n.AddText("NoteText_eqstats", text3); 
				}
				if (trait is TraitToolRange traitToolRange)
				{

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
			}
			else
			{
				string text6 = ""; 
				string text7 = ""; 
				if (EClass.debug.showExtra)
				{
					int totalQuality = GetTotalQuality();
					int totalQuality2 = GetTotalQuality(applyBonus: false);
					text6 = text6 + "Lv. " + base.LV + " TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ? "" : (" (" + totalQuality2 + ")")); 
					text7 = text7 + "Lv. " + base.LV + " TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ? "" : (" (" + totalQuality2 + ")")); 
				}
				if (HasElement(10))
				{
					text6 = text6 + (text6.IsEmpty() ? "" : "  ") + "_nutrition".lang(Evalue(10).ToFormat() ?? ""); 
					text7 = text7 + (text7.IsEmpty() ? "" : "  ") + "_nutrition".lang(Evalue(10).ToFormat() ?? ""); 
				}
				if ((base.category.IsChildOf("throw") || base.category.IsChildOf("resource") || trait.IsTool) && !(trait is TraitAbility))
				{
					text6 = text6 + (text6.IsEmpty() ? "" : "  ") + "_hardness".lang(base.material.hardness.ToString() ?? ""); 
					text7 = text7 + (text7.IsEmpty() ? "" : "  ") + "_hardness".lang(base.material.hardness.ToString() ?? ""); 
				}
				if (flag && recipe != null && (bool)LayerCraft.Instance)
				{
					text6 = text6 + (text6.IsEmpty() ? "" : "  ") + "_max_quality".lang(recipe.GetQualityBonus().ToString() ?? ""); 
					text7 = text7 + (text7.IsEmpty() ? "" : "  ") + "_max_quality".lang(recipe.GetQualityBonus().ToString() ?? ""); 
				}
				if (!text6.IsEmpty()) 
				if (!text7.IsEmpty()) 
				{
					n.AddText("NoteText_eqstats", text6); 
					n.AddText("NoteText_eqstats", text7); 
				}
			}
		}

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
	}
	if (trait.Decay > 0)
	{
		string text7 = ""; 
		text7 = (base.IsDecayed ? "isRotten" : (base.IsRotting ? "isRotting" : ((!base.IsFresn) ? "isNotFresh" : "isFresh"))); 
		AddText(text7.lang(), FontColor.Default); 
		string text8 = ""; 
		text8 = (base.IsDecayed ? "isRotten" : (base.IsRotting ? "isRotting" : ((!base.IsFresn) ? "isNotFresh" : "isFresh"))); 
		AddText(text8.lang(), FontColor.Default); 
	}
	if (base.isDyed)
	{

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
	}
	if (base.IsEquipment)
	{
		text2 = "isEquipable".lang(Element.Get(base.category.slot).GetText()); 
		AddText(text2, FontColor.Default); 
		text3 = "isEquipable".lang(Element.Get(base.category.slot).GetText()); 
		AddText(text3, FontColor.Default); 
	}
	if (base.isFireproof)
	{

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
		{
			elements.AddNote(n, (Element e) => listTrait.Contains(e), null, ElementContainer.NoteMode.BonusTrait, addRaceFeat: false, delegate(Element e, string s)
			{
				string text12 = s; 
				string text13 = e.source.GetText("textExtra"); 
				if (!text13.IsEmpty()) 
				string text13 = s; 
				string text14 = e.source.GetText("textExtra"); 
				if (!text14.IsEmpty()) 
				{
					string text14 = ""; 
					string text15 = ""; 
					if (e.id == 2 && mode == IInspect.NoteMode.Product)
					{
						int num2 = recipe.GetQualityBonus() / 10;

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
						{
							num2++;
						}
						text14 = "qualityLimit".lang(num2.ToString() ?? ""); 
						text15 = "qualityLimit".lang(num2.ToString() ?? ""); 
					}
					int num3 = e.Value / 10;
					num3 = ((e.Value < 0) ? (num3 - 1) : (num3 + 1));
					text13 = "Lv." + num3 + text14 + " " + text13; 
					text14 = "Lv." + num3 + text15 + " " + text14; 
					if (infoMode && e.IsFoodTraitMain)
					{
						text13 += "traitAdditive".lang(); 
						text14 += "traitAdditive".lang(); 
					}
					text12 += (" <size=12>" + text13 + "</size>").TagColor(FontColor.Passive); 
					text13 += (" <size=12>" + text14 + "</size>").TagColor(FontColor.Passive); 
				}
				return text12; 
				return text13; 
			}, delegate
			{
			});

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
		if (base.c_mixedFoodData != null)
		{
			n.AddHeader("isMixedFood");
			foreach (string text15 in base.c_mixedFoodData.texts) 
			foreach (string text16 in base.c_mixedFoodData.texts) 
			{
				AddText("_bullet".lang() + text15, FontColor.Default); 
				AddText("_bullet".lang() + text16 + text2, FontColor.Default); 
			}
		}
	}

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
		{
			item.AddEncNote(n, this, ElementContainer.NoteMode.BonusTrait, delegate(Element e, string s)
			{
				string text9 = s; 
				string text10 = e.source.GetText("textExtra"); 
				if (!text10.IsEmpty()) 
				string text10 = s; 
				string text11 = e.source.GetText("textExtra"); 
				if (!text11.IsEmpty()) 
				{
					string text11 = ""; 
					string text12 = ""; 
					int num = e.Value / 10;
					num = ((e.Value < 0) ? (num - 1) : (num + 1));
					text10 = "Lv." + num + text11 + " " + text10; 
					text11 = "Lv." + num + text12 + " " + text11; 
					if (infoMode && e.IsFoodTraitMain)
					{
						text10 += "traitAdditive".lang(); 
						text11 += "traitAdditive".lang(); 
					}
					text9 += (" <size=12>" + text10 + "</size>").TagColor(FontColor.Passive); 
					text10 += (" <size=12>" + text11 + "</size>").TagColor(FontColor.Passive); 
				}
				return text9; 
				return text10; 
			});
		}
	}

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
		{
			n.AddHeader("headerAttackEval");
			AttackProcess.Current.Prepare(chara ?? EClass.pc, this, null, null, 0, base.IsThrownWeapon);
			string text8 = AttackProcess.Current.GetText(); 
			text8 = text8.TagColor(() => true); 
			n.AddText(text8); 
			string text9 = AttackProcess.Current.GetText(); 
			text9 = text9.TagColor(() => true); 
			n.AddText(text9); 
		}
	}
	if (base.ammoData != null)

ThingGen

public static Thing CreateScroll(int ele, int num = 1)

cs
		return thing;
	}

	public static Thing CreateRune(int ele, int v, bool free = false) 
	{ 
		Thing thing = Create(free ? "rune_free" : "rune"); 
		thing.refVal = ele; 
		thing.encLV = v; 
		return thing; 
	} 
	public static Thing CreateRod(int ele)
	{
		Thing thing = Create("rod");

Trait

public void OnBarter()

cs
			{
			case ShopType.Moyer:
			{
				for (int num10 = 1; num10 <= 7; num10++) 
				for (int num10 = 1; num10 <= 9; num10++) 
				{
					AddAdvWeek(num10);
				}

public void OnBarter()

cs
				Add("1165", 1, 0);
				Add("plat", 100, 0);
				AddThing(ThingGen.CreateScroll(9160).SetNum(5));
				AddThing(ThingGen.CreateRune(450, 1, free: true)); 
				break;
			case ShopType.Gun:
				Add("bullet", 1, 0).SetNum(300 + EClass.rnd(100)).ChangeMaterial("iron");

+TraitRuneFree

File Created
cs
public class TraitRuneFree : TraitRune
{
}

+TryMakeRandomItemSource

File Created
cs
public enum TryMakeRandomItemSource
{
	Default,
	Cooking
}

WidgetStatsBar

public class Extra

cs
		public bool dv;

		public bool fertility;
		public bool elec; 
	}

	public static WidgetStatsBar Instance;

public class Extra

cs

	public Sprite iconFertility;

	public Sprite iconElec; 
	private UIItem mold;

	public Extra extra => base.config.extra as Extra;

public void Build()

cs
			return (string)obj;
		}, () => ((EMono.Branch == null && !(EMono._zone is Zone_Tent)) || EMono._zone.MaxSoil - EMono._zone.GetSoilCost() >= 0) ? FontColor.Default : FontColor.Bad, () => EMono._zone.IsPCFaction || EMono._zone is Zone_Tent);
	}
	if (extra.elec) 
	{ 
		Add(null, "elec", iconElec, () => (EMono.Branch != null || EMono._zone is Zone_Tent) ? (EMono._zone.GetElectricity(cost: true) + " / " + EMono._zone.GetElectricity()) : "", () => ((EMono.Branch == null && !(EMono._zone is Zone_Tent)) || EMono._zone.GetElectricity() - EMono._zone.GetElectricity(cost: true) >= 0) ? FontColor.Default : FontColor.Bad, () => EMono._zone.IsPCFaction || EMono._zone is Zone_Tent); 
	} 
	if (extra.weight)
	{
		Add(null, "weight", iconWeight, () => ((float)EMono.pc.ChildrenWeight / 1000f).ToString("F1") + " / " + ((float)EMono.pc.WeightLimit / 1000f).ToString("F1"), () => EMono.pc.burden.GetPhase() switch

public override void OnSetContextMenu(UIContextMenu m)

cs
		extra.fertility = a;
		Build();
	});
	uIContextMenu.AddToggle("elec", extra.elec, delegate(bool a) 
	{ 
		extra.elec = a; 
		Build(); 
	}); 
	uIContextMenu.AddToggle("invWeight", extra.weight, delegate(bool a)
	{
		extra.weight = a;