Skip to content

EA 23.69 Nightly

December 30, 2024

28 files modified. 2 new files created.

Important Changes

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

Chara (1)

cs
public void ModAffinity(Chara c, int a, bool show = true) 
public void ModAffinity(Chara c, int a, bool show = true, bool showOnlyEmo = false) 

InvOwnerMod (1)

cs
public static bool IsValidMod(Thing t, SourceElement.Row row) 

LayerInventory (1)

cs
public static LayerInventory GetPCLayer() 

TraitGodStatue (1)

cs
public Thing GetManiGene() 

AI_Fuck

@@ -23,6 +23,8 @@ public enum FuckType

cs

	public int progress;

	public int totalAffinity; 

	public virtual FuckType Type => FuckType.fuck;

	public override bool PushChara => false;

@@ -111,11 +113,21 @@ public override IEnumerable<Status> Run()

cs
			{
				tc.AddCondition<ConFear>(50);
			}
			if (i % 5 == 0) 
			{ 
				tc.PlaySound("brushing"); 
				int num = cc.CHA + cc.Evalue(237) - tc.CHA * 2; 
				int num2 = ((EClass.rnd(cc.CHA + cc.Evalue(237)) <= EClass.rnd(tc.CHA)) ? (-5 + Mathf.Clamp(num / 10, -30, 0)) : (5 + Mathf.Clamp(num / 10, 0, 20))); 
				totalAffinity += num2; 
				tc.ModAffinity(EClass.pc, num2, show: true, showOnlyEmo: true); 
				Debug.Log(num2 + "/" + tc._affinity); 
			} 
			tc.interest -= (tc.IsPCFaction ? 20 : (tc.IsHuman ? 6 : 2)); 
			if (i == 0 || i == 10)
			{
				cc.Talk("goodBoy");
			}
			cc.elements.ModExp(237, 10); 
			cc.elements.ModExp(237, 15); 
			break;
		}
	}

@@ -131,6 +143,10 @@ public void Finish()

cs
		return;
	}
	bool flag = EClass.rnd(2) == 0;
	int num; 
	int num2; 
	int num3; 
	bool flag3; 
	switch (Type)
	{
	case FuckType.fuck:

@@ -158,7 +174,7 @@ public void Finish()

cs
				chara2.AddCondition<ConInsane>(100 + EClass.rnd(100));
			}
		}
		int num = CalcMoney.Whore(chara2, chara); 
		int num4 = CalcMoney.Whore(chara2, chara); 
		chara.Talk("tail_after");
		bool flag2 = false;
		if (succubus)

@@ -177,24 +193,24 @@ public void Finish()

cs
				chara = chara5;
				chara2 = chara4;
			}
			Debug.Log("buyer:" + chara.Name + " seller:" + chara2.Name + " money:" + num); 
			Debug.Log("buyer:" + chara.Name + " seller:" + chara2.Name + " money:" + num4); 
			if (!chara.IsPC)
			{
				chara.ModCurrency(EClass.rndHalf(num)); 
				chara.ModCurrency(EClass.rndHalf(num4)); 
			}
			if (!chara2.IsPC && chara.GetCurrency() < num && EClass.rnd(2) == 0) 
			if (!chara2.IsPC && chara.GetCurrency() < num4 && EClass.rnd(2) == 0) 
			{
				num = chara.GetCurrency(); 
				num4 = chara.GetCurrency(); 
			}
			Debug.Log("money:" + num + " buyer:" + chara.GetCurrency()); 
			if (chara.GetCurrency() >= num) 
			Debug.Log("money:" + num4 + " buyer:" + chara.GetCurrency()); 
			if (chara.GetCurrency() >= num4) 
			{
				chara.Talk("tail_pay");
			}
			else
			{
				chara.Talk("tail_nomoney");
				num = chara.GetCurrency(); 
				num4 = chara.GetCurrency(); 
				chara2.Say("angry", chara2);
				chara2.Talk("angry");
				flag = (sell ? true : false);

@@ -203,25 +219,25 @@ public void Finish()

cs
					flag2 = true;
				}
			}
			chara.ModCurrency(-num); 
			chara.ModCurrency(-num4); 
			if (chara2 == EClass.pc)
			{
				if (num > 0) 
				if (num4 > 0) 
				{
					EClass.player.DropReward(ThingGen.Create("money").SetNum(num)); 
					EClass.player.DropReward(ThingGen.Create("money").SetNum(num4)); 
					EClass.player.ModKarma(-1);
				}
			}
			else
			{
				int num2 = (chara2.CHA * 10 + 100) / ((chara2.IsPCFaction && chara2.memberType == FactionMemberType.Default) ? 1 : 10); 
				if (chara2.GetCurrency() - num2 > 0) 
				int num5 = (chara2.CHA * 10 + 100) / ((chara2.IsPCFaction && chara2.memberType == FactionMemberType.Default) ? 1 : 10); 
				if (chara2.GetCurrency() - num5 > 0) 
				{
					chara2.c_allowance += num; 
					chara2.c_allowance += num4; 
				}
				else
				{
					chara2.ModCurrency(num); 
					chara2.ModCurrency(num4); 
				}
			}
			chara = chara4;

@@ -238,29 +254,58 @@ public void Finish()

cs
		}
		SuccubusExp(chara, chara2);
		SuccubusExp(chara2, chara);
		chara2.ModAffinity(chara, flag ? 10 : (-5)); 
		break;
	}
	case FuckType.tame:
		if (CanTame()) 
		{
			if (flag) 
			num = ((!chara2.IsPCFaction) ? (chara2.IsHuman ? 10 : 5) : (chara2.IsHuman ? 5 : 0)); 
			if (totalAffinity > 0) 
			{ 
				chara.Say("brush_success", target, owner); 
			} 
			else
			{ 
				chara.Say("brush_fail", target, owner); 
				num *= 5; 
			} 
			if (CanTame() && !EClass._zone.IsInstance && chara2.c_bossType == BossType.none) 
			{ 
				num2 = (chara2.trait.CanInvite ? 1 : 0); 
				if (num2 != 0 && chara2.affinity.CanInvite()) 
				{ 
					num3 = ((EClass.pc.GetBestAttribute() > chara2.CHA) ? 1 : 0); 
					goto IL_04ad; 
				} 
			} 
			else
			{ 
				num2 = 0; 
			} 
			num3 = 0; 
			goto IL_04ad; 
		} 
		IL_04ad: 
		flag3 = (byte)num3 != 0; 
		if (num2 != 0) 
		{ 
			if (flag3) 
			{
				chara.Say("tame_success", owner, target);
				chara2.MakeAlly();
				chara.elements.ModExp(237, 200); 
			}
			else
			{
				chara.Say("tame_fail", chara, chara2);
			}
		}
		else
		if (num > EClass.rnd(100)) 
		{
			chara.Say("tame_invalid", chara2); 
			chara2.DoHostileAction(chara); 
			chara2.calmCheckTurn *= 3; 
		}
		break;
	}
	chara2.ModAffinity(chara, flag ? 10 : (-5)); 
	static int StaminaCost(Chara c1, Chara c2)
	{
		return (int)Mathf.Max(10f * (float)c1.END / (float)Mathf.Max(c2.END, 1), 0f);

AI_Slaughter

@@ -14,7 +14,7 @@ public override string GetText(string str = "")

cs
	{
		string[] list = Lang.GetList("fur");
		string text = list[Mathf.Clamp(target.c_fur / 10, 0, list.Length - 1)];
		return "AI_Shear".lang() + "(" + text + ")"; 
		return "AI_Slaughter".lang() + "(" + text + ")"; 
	}

	public override bool IsValidTC(Card c)

@@ -39,7 +39,7 @@ public override IEnumerable<Status> Run()

cs
		{
			target.PlaySound("slaughter");
			target.SetCensored(enable: true);
			owner.Say("disassemble_start", owner, target); 
			owner.Say("disassemble_start", owner, owner.Tool, target.Name); 
		},
		onProgress = delegate(Progress_Custom p)
		{

@@ -62,7 +62,10 @@ public override IEnumerable<Status> Run()

cs
		},
		onProgressComplete = delegate
		{
			target.Chara.ModAffinity(owner, 1); 
			bool num = target.HasElement(1237) || target.HasElement(701); 
			target.pos.PlayEffect("revive"); 
			target.Chara.ModAffinity(owner, -50); 
			owner.ShowEmo(Emo.love); 
			target.SetCensored(enable: false);
			if (target.HaveFur())
			{

@@ -71,6 +74,7 @@ public override IEnumerable<Status> Run()

cs
			}
			slaughtering = true;
			target.Die();
			Msg.Say("goto_heaven", target); 
			slaughtering = false;
			if (target.Chara.trait.IsUnique)
			{

@@ -81,10 +85,15 @@ public override IEnumerable<Status> Run()

cs
					target.Chara.homeBranch.BanishMember(target.Chara, skipMsg: true);
				}
				owner.elements.ModExp(237, 250);
				owner.elements.ModExp(290, 100); 
				owner.elements.ModExp(290, 250); 
				EClass.pc.stamina.Mod(-3);
				if (num) 
				{ 
					Msg.Say("killcat"); 
					EClass.player.ModKarma(-3); 
				} 
			}
		}.SetDuration(5000 / (100 + owner.Tool.material.hardness * 2), 3); 
		}.SetDuration(6000 / (100 + owner.Tool.material.hardness * 2), 3); 
		yield return Do(seq);
	}

ActionMode

@@ -625,29 +625,30 @@ public void UpdateInput()

cs
		hotElementTimer = 0f;
	}
	focusTimer += Core.delta;
	if (EClass.ui.isPointerOverUI && (EInput.leftMouse.down || EInput.rightMouse.down || (EClass.core.config.ui.autoFocusWindow && !Input.GetMouseButton(0) && focusTimer > 0.2f))) 
	if (EClass.ui.isPointerOverUI && (EInput.leftMouse.down || EInput.rightMouse.down || (EClass.core.config.ui.autoFocusWindow && !Input.GetMouseButton(0)))) 
	{
		LayerInventory componentOf2 = InputModuleEX.GetComponentOf<LayerInventory>();
		if (componentOf2 != null && EClass.ui.layerFloat.layers.Contains(componentOf2)) 
		if (componentOf2 != null) 
		{
			if (EInput.rightMouse.down) 
			LayerInventory layerInventory = LayerInventory.GetLayer(InputModuleEX.GetComponentOf<ButtonGrid>()?.card); 
			if ((bool)layerInventory) 
			{
				if (!componentOf2.mainInv && !InputModuleEX.GetComponentOf<UIButton>() && !componentOf2.windows[0].saveData.noRightClickClose) 
				{ 
					componentOf2.Close(); 
				} 
				LayerInventory.highlightInv = layerInventory.invs[0].owner; 
			}
			else
			if (focusTimer > 0.1f) 
			{
				componentOf2.transform.SetAsLastSibling(); 
				if (EClass.ui.layerFloat.layers.Contains(componentOf2) && !layerInventory) 
				{ 
					componentOf2.transform.SetAsLastSibling(); 
				} 
				LayerAbility componentOf3 = InputModuleEX.GetComponentOf<LayerAbility>(); 
				if (componentOf3 != null && EClass.ui.layerFloat.layers.Contains(componentOf3)) 
				{ 
					componentOf3.transform.SetAsLastSibling(); 
				} 
				focusTimer = 0f; 
			}
		}
		LayerAbility componentOf3 = InputModuleEX.GetComponentOf<LayerAbility>(); 
		if (componentOf3 != null && EClass.ui.layerFloat.layers.Contains(componentOf3)) 
		{ 
			componentOf3.transform.SetAsLastSibling(); 
		} 
		focusTimer = 0f; 
	}
	if ((EInput.isShiftDown && Input.GetMouseButton(0)) || (EInput.rightMouse.dragging2 && !Input.GetMouseButtonDown(1) && Input.GetMouseButton(1)))
	{

@@ -660,6 +661,11 @@ public void UpdateInput()

cs
	}
	if (EInput.rightMouse.down)
	{
		LayerInventory componentOf5 = InputModuleEX.GetComponentOf<LayerInventory>(); 
		if (componentOf5 != null && EClass.ui.layerFloat.layers.Contains(componentOf5) && EInput.rightMouse.down && !componentOf5.mainInv && !InputModuleEX.GetComponentOf<UIButton>() && !componentOf5.windows[0].saveData.noRightClickClose) 
		{ 
			componentOf5.Close(); 
		} 
		if (EClass.ui.contextMenu.isActive)
		{
			EClass.ui.contextMenu.currentMenu.Hide();

@@ -681,10 +687,10 @@ public void UpdateInput()

cs
	bool flag = (EInput.mouse3.clicked && input.mouse3Click == CoreConfig.GameFunc.AllAction) || (EInput.mouse4.clicked && input.mouse4Click == CoreConfig.GameFunc.AllAction) || (EInput.mouse3.pressedLong && input.mouse3PressLong == CoreConfig.GameFunc.AllAction) || (EInput.mouse4.pressedLong && input.mouse4PressLong == CoreConfig.GameFunc.AllAction);
	if (flag || EInput.middleMouse.down || EInput.middleMouse.clicked || EInput.middleMouse.pressedLong)
	{
		UIButton componentOf5 = InputModuleEX.GetComponentOf<UIButton>(); 
		if ((bool)componentOf5 && componentOf5.CanMiddleClick() && (flag || EInput.middleMouse.clicked || EInput.middleMouse.pressedLong)) 
		UIButton componentOf6 = InputModuleEX.GetComponentOf<UIButton>(); 
		if ((bool)componentOf6 && componentOf6.CanMiddleClick() && (flag || EInput.middleMouse.clicked || EInput.middleMouse.pressedLong)) 
		{
			componentOf5.OnMiddleClick(flag); 
			componentOf6.OnMiddleClick(flag); 
		}
	}
	if ((bool)EClass.ui.contextMenu.currentMenu)

@@ -772,18 +778,18 @@ public void UpdateInput()

cs
	}
	if (EInput.action == EAction.Examine && !IsBuildMode)
	{
		ButtonGrid componentOf6 = InputModuleEX.GetComponentOf<ButtonGrid>(); 
		ButtonGrid componentOf7 = InputModuleEX.GetComponentOf<ButtonGrid>(); 
		Card card = null;
		if ((bool)componentOf6 && componentOf6.card != null) 
		if ((bool)componentOf7 && componentOf7.card != null) 
		{
			card = componentOf6.card; 
			card = componentOf7.card; 
		}
		if (card == null)
		{
			UIItem componentOf7 = InputModuleEX.GetComponentOf<UIItem>(); 
			if ((bool)componentOf7 && componentOf7.refObj is Thing) 
			UIItem componentOf8 = InputModuleEX.GetComponentOf<UIItem>(); 
			if ((bool)componentOf8 && componentOf8.refObj is Thing) 
			{
				card = (Thing)componentOf7.refObj; 
				card = (Thing)componentOf8.refObj; 
			}
		}
		if (card == null)

Affinity

@@ -60,6 +60,28 @@ public bool CanSleepBeside()

cs
		return true;
	}

	public Sprite GetIcon() 
	{ 
		int affinity = CC._affinity; 
		if (affinity <= -100) 
		{ 
			return EClass.core.refs.icons.affnity.hate; 
		} 
		if (affinity <= -10) 
		{ 
			return EClass.core.refs.icons.affnity.dontLike; 
		} 
		if (affinity >= 100) 
		{ 
			return EClass.core.refs.icons.affnity.love; 
		} 
		if (affinity >= 10) 
		{ 
			return EClass.core.refs.icons.affnity.like; 
		} 
		return null; 
	} 

	public Thing OnGift(Thing t)
	{
		t.CheckJustCooked();

BaseListPeople

@@ -84,6 +84,14 @@ public override void OnInstantiate(Chara a, ItemGeneral b)

cs
				break;
			}
		}
		if (a.IsPCFaction) 
		{ 
			Sprite icon = a.affinity.GetIcon(); 
			if ((bool)icon) 
			{ 
				Util.Instantiate<UIItem>("UI/Element/Grid/Attach/affinity", b).image1.sprite = icon; 
			} 
		} 
		b.AddSubButton(EClass.core.refs.icons.work, delegate
		{
			if (roomWork == null)

BaseTileMap

@@ -2570,6 +2570,7 @@ public virtual void DrawTile()

cs
						if (thing != null)
						{
							_actorPos.z -= 0.2f;
							thingPos.z -= 0.2f; 
						}
						_actorPos.y -= num20;
					}

ButtonAbility

@@ -26,6 +26,8 @@ public class ButtonAbility : UIButton, IMouseHint

cs
	[NonSerialized]
	public bool dragged;

	public static Act hotkeyAct; 

	public static float hotkeyTimer;

	public void SetAct(Chara _chara, Element e)

@@ -131,13 +133,17 @@ public static bool TryUse(Act act, Card tg = null, Point pos = null, Card cataly

cs
	{
		pos = EClass.pc.pos.Copy();
	}
	if (first) 
	{ 
		hotkeyAct = act; 
	} 
	if (first && EInput.GetHotkey() != -1)
	{
		mouse = false;
		hotkeyTimer = 0f;
		Debug.Log(EInput.GetHotkey());
	}
	if (act.HaveLongPressAction) 
	if (act.HaveLongPressAction && act == hotkeyAct) 
	{
		if ((mouse && EInput.rightMouse.pressedLong) || (!mouse && hotkeyTimer >= 0.45f))
		{

Card

@@ -4408,9 +4408,9 @@ public void SpawnLoot(Card origin)

cs
	if (AI_Slaughter.slaughtering)
	{
		flag2 = true;
		num = EClass.rndHalf(4 + 5 * Chara.race.food[0].ToInt() / 100); 
		num = EClass.rndHalf(4 + 10 * (50 + Mathf.Max(0, (int)MathF.Sqrt(EClass.pc.Evalue(290) * 10))) / 100); 
	}
	if (origin != null && origin.HasElement(290)) 
	else if (origin != null && origin.HasElement(290)) 
	{
		if (!flag2 && Chara.race.corpse[1].ToInt() > EClass.rnd(150000 / (100 + (int)Mathf.Sqrt(origin.Evalue(290)) * 5)))
		{

@@ -4641,6 +4641,9 @@ public Thing TryMakeRandomItem(int lv = -1)

cs
	}
	switch (id)
	{
	case "gene": 
		DNA.CopyDNA(DNA.GenerateRandomGene(lv), Thing); 
		break; 
	case "log":
		ChangeMaterial(EClass.sources.materials.rows.Where((SourceMaterial.Row m) => m.category == "wood").RandomItem());
		break;

@@ -5457,9 +5460,9 @@ public int GetLightRadius()

cs
	if (IsPCFaction)
	{
		Thing equippedThing = Chara.body.GetEquippedThing(45);
		if (equippedThing != null) 
		if (equippedThing != null && equippedThing.trait is TraitLightSource traitLightSource) 
		{
			num2 = (equippedThing.trait as TraitLightSource).LightRadius; 
			num2 = traitLightSource.LightRadius; 
		}
		if (Chara.held != null && IsPC)
		{

Chara

@@ -6892,7 +6892,7 @@ public Room FindRoom()

cs
		return FindBed()?.owner.pos.cell.room;
	}

	public void ModAffinity(Chara c, int a, bool show = true) 
	public void ModAffinity(Chara c, int a, bool show = true, bool showOnlyEmo = false) 
	{
		if (c == this)
		{

@@ -6908,15 +6908,22 @@ public void ModAffinity(Chara c, int a, bool show = true)

cs
		a = affinity.Mod(a);
	}
	bool flag = a > 0;
	if (show) 
	if (!show) 
	{ 
		return; 
	} 
	if (a == 0) 
	{
		if (a == 0) 
		if (!showOnlyEmo) 
		{
			Say("affinityNone", this, c);
			return; 
		}
		ShowEmo((!flag) ? Emo.angry : Emo.love); 
		c.ShowEmo(flag ? Emo.love : Emo.sad); 
		return; 
	} 
	ShowEmo((!flag) ? Emo.angry : Emo.love); 
	c.ShowEmo(flag ? Emo.love : Emo.sad); 
	if (!showOnlyEmo) 
	{ 
		Say(flag ? "affinityPlus" : "affinityMinus", this, c);
	}
}

CoreDebug

@@ -905,16 +905,10 @@ public void UpdateInput()

cs
	}
	if (Input.GetKeyDown(KeyCode.F2))
	{
		EClass.pc.Pick(EClass.pc.MakeMilk(effect: true, 10)); 
		EClass.pc.Pick(EClass.pc.MakeEgg(effect: true, 10)); 
		Chara targetChara = EClass.scene.mouseTarget.TargetChara; 
		if (targetChara != null) 
		{ 
			EClass.pc.Pick(targetChara.MakeMilk()); 
			EClass.pc.Pick(targetChara.MakeGene()); 
			EClass.pc.Pick(targetChara.MakeBraineCell()); 
			EClass.pc.Pick(targetChara.MakeEgg(effect: true, 10)); 
		} 
		Thing to = ThingGen.Create("gene"); 
		to = DNA.CopyDNA(DNA.GenerateRandomGene(), to); 
		EClass.pc.Pick(to); 
		EClass.pc.Pick(ThingGen.Create("rune")); 
		return;
	}
	if (Input.GetKeyDown(KeyCode.F3))

CoreRef

@@ -41,6 +41,18 @@ public class InventoryStyle

cs
	[Serializable]
	public class Icons
	{
		[Serializable] 
		public class Affinity
		{ 
			public Sprite hate; 

			public Sprite dontLike; 

			public Sprite like; 

			public Sprite love; 
		} 

		public Sprite suspend;

		public Sprite resume;

@@ -91,6 +103,8 @@ public class Icons

cs

		public Sprite personal;

		public Affinity affnity; 

		public UDInvTab invTab;

		public UDIconWeather weather;

DNA

@@ -127,6 +127,41 @@ public static Thing GenerateGene(CardRow r, Type? type = null, int lv = -1, int

cs
		return thing;
	}

	public static Thing CopyDNA(Thing from, Thing to) 
	{ 
		to.c_DNA = from.c_DNA; 
		to.c_idRefCard = from.c_idRefCard; 
		to.ChangeMaterial(from.material); 
		return to; 
	} 

	public static Thing GenerateRandomGene(int lv = -1, int seed = -1) 
	{ 
		if (lv == -1) 
		{ 
			lv = EClass._zone.ContentLv; 
		} 
		Rand.SetSeed(seed); 
		CardRow r = SpawnList.Get("chara").Select(100); 
		Rand.SetSeed(); 
		return GenerateGene(r, Type.Superior, lv, seed); 
	} 

	public static Thing GenerateManiGene(Card owner) 
	{ 
		owner.things.DestroyAll(); 
		Debug.Log("Mani:" + owner.c_seed); 
		Rand.SetSeed(owner.c_seed); 
		CardRow r = SpawnList.Get("chara").Select(100); 
		Rand.SetSeed(owner.c_seed); 
		Thing thing = GenerateGene(r, Type.Superior, owner.LV, owner.c_seed); 
		thing.c_DNA.cost = thing.c_DNA.cost / 2; 
		thing.MakeRefFrom("mani"); 
		Rand.SetSeed(); 
		owner.c_seed++; 
		return thing; 
	} 

	public void Apply(Chara c)
	{
		if (c.c_genes == null)

Hobby

@@ -58,6 +58,15 @@ public int GetEfficiency(Chara c)

cs
			num = num * c.race.breeder / 100;
		}
		num += GetLv(c);
		return num * (100 + c.homeBranch.Evalue(3708) * 10) / 100; 
		if (c.affinity.value < 0) 
		{ 
			num += c.affinity.value; 
		} 
		num = num * (100 + c.homeBranch.Evalue(3708) * 10) / 100; 
		if (num >= 0) 
		{ 
			return num; 
		} 
		return 0; 
	}
}

InvOwnerMod

@@ -4,9 +4,18 @@ public class InvOwnerMod : InvOwnerDraglet

cs

	public override string langTransfer => "invMod";

	public static bool IsValidMod(Thing t, SourceElement.Row row) 
	public static bool IsValidRuneMod(Thing t, SourceElement.Row row, string idMat) 
	{
		if (t.trait is TraitToolRangeCane && !row.tag.Contains("cane")) 
		if (idMat == "adamantite") 
		{ 
			return t.category.slot == 35; 
		} 
		return false; 
	} 

	public static bool IsValidRangedMod(Thing t, SourceElement.Row row) 
	{ 
		if (t.trait is TraitToolRangeCane && !row.tag.Contains("modCane")) 
		{
			return false;
		}

@@ -26,7 +35,14 @@ public InvOwnerMod(Card owner = null, Card container = null, CurrencyType _curre

cs
public override bool ShouldShowGuide(Thing t)
{
	TraitMod traitMod = owner.trait as TraitMod;
	if (!IsValidMod(t, traitMod.source)) 
	if (traitMod is TraitRune) 
	{ 
		if (!IsValidRuneMod(t, traitMod.source, owner.material.alias)) 
		{ 
			return false; 
		} 
	} 
	else if (!IsValidRangedMod(t, traitMod.source)) 
	{
		return false;
	}

LayerInventory

@@ -42,12 +42,12 @@ public static LayerInventory GetTopLayer(Thing t, bool includePlayer = false, In

cs
		return result;
	}

	public static LayerInventory GetPCLayer() 
	public static LayerInventory GetLayer(Card t) 
	{
		LayerInventory result = null;
		foreach (LayerInventory item in listInv)
		{
			if (item.Inv.Container.IsPC) 
			if (item.Inv.Container == t) 
			{
				return item;
			}

@@ -55,6 +55,11 @@ public static LayerInventory GetPCLayer()

cs
		return result;
	}

	public static LayerInventory GetPCLayer() 
	{ 
		return GetLayer(ELayer.pc); 
	} 

	public static void Close(Thing t)
	{
		foreach (LayerInventory item in listInv)

RecipeCard

@@ -86,6 +86,7 @@ public override void BuildIngredientList()

cs
		ingredients.Add(new Ingredient
		{
			id = "seasoning",
			useCat = true, 
			optional = true,
			req = 1
		});

Religion

@@ -164,6 +164,11 @@ public string GetGodTalk(string suffix)

cs
		return EClass.sources.dataGodTalk.GetText(id, suffix).Split(Environment.NewLine.ToCharArray()).RandomItem();
	}

	public virtual int GetOfferingMtp(Thing t) 
	{ 
		return 0; 
	} 

	public int GetOfferingValue(Thing t, int num = -1)
	{
		t.CheckJustCooked();

@@ -171,15 +176,19 @@ public int GetOfferingValue(Thing t, int num = -1)

cs
	{
		num = t.Num;
	}
	int num2 = 0; 
	int v = 0; 
	if (t.source._origin == "meat")
	{
		num2 = Mathf.Clamp(t.SelfWeight / 10, 1, 1000); 
		v = Mathf.Clamp(t.SelfWeight / 10, 1, 1000); 
		if (t.refCard == null)
		{
			num2 /= 10; 
			v /= 10; 
		}
	}
	else if (GetOfferingMtp(t) > 0) 
	{ 
		SetValue(t.category, GetOfferingMtp(t)); 
	} 
	else
	{
		string[] cat_offer = source.cat_offer;

@@ -187,22 +196,27 @@ public int GetOfferingValue(Thing t, int num = -1)

cs
			{
				if (t.category.IsChildOf(key))
				{
					num2 = Mathf.Clamp(t.SelfWeight / 10, 50, 1000); 
					num2 *= EClass.sources.categories.map[key].offer / 100; 
					SetValue(EClass.sources.categories.map[key], 1); 
					break;
				}
			}
		}
		if (num2 == 0) 
		if (v == 0) 
		{
			return 0;
		}
		if (t.IsDecayed)
		{
			num2 /= 10; 
			v /= 10; 
		} 
		v = v * (100 + Mathf.Min(t.LV * 2, 100) + (t.HasElement(757) ? 50 : 0)) / 100; 
		v = Mathf.Max(v, 1) * num; 
		return v; 
		void SetValue(SourceCategory.Row cat, int mtp) 
		{ 
			v = Mathf.Clamp(t.SelfWeight / 10, 50, 1000); 
			v *= cat.offer * mtp / 100; 
		}
		num2 = num2 * (100 + Mathf.Min(t.LV * 2, 100) + (t.HasElement(757) ? 50 : 0)) / 100; 
		return Mathf.Max(num2, 1) * num; 
	}

	public bool TryGetGift()

ReligionMoonShadow

@@ -1,4 +1,18 @@

cs
public class ReligionMoonShadow : ReligionMinor
{
	public override string id => "moonshadow";

	public override int GetOfferingMtp(Thing t) 
	{ 
		switch (t.id) 
		{ 
		case "1134": 
		case "1218": 
		case "mochi": 
		case "kagamimochi": 
			return 2; 
		default: 
			return 0; 
		} 
	} 
}

ReligionTrickery

@@ -1,4 +1,18 @@

cs
public class ReligionTrickery : ReligionMinor
{
	public override string id => "trickery";

	public override int GetOfferingMtp(Thing t) 
	{ 
		switch (t.id) 
		{ 
		case "1134": 
		case "1218": 
		case "mochi": 
		case "kagamimochi": 
			return 2; 
		default: 
			return 0; 
		} 
	} 
}

Resistance

@@ -6,7 +6,7 @@ public class Resistance : Element

cs

	public override bool ShowXP => false;

	public override string ShortName => EClass.sources.elements.alias[base.source.aliasParent].GetName(); 
	public override string ShortName => EClass.sources.elements.alias.TryGetValue(base.source.aliasParent)?.GetName() ?? base.source.aliasParent; 

	public override bool CanLink(ElementContainer owner)
	{

TaskClean

@@ -12,24 +12,16 @@ public override string GetText(string str = "")

cs

	public static bool CanClean(Point p)
	{
		if (!p.IsBlocked) 
		if (!p.HasDirt) 
		{
			if (!p.HasDirt) 
			{ 
				return p.cell.HasLiquid; 
			} 
			return true; 
			return p.cell.HasLiquid; 
		}
		return false; 
		return true; 
	}

	public override bool CanPerform()
	{
		if (CanProgress()) 
		{ 
			return CanClean(dest); 
		} 
		return false; 
		return CanClean(dest); 
	}

	public override bool CanManualCancel()

@@ -71,7 +63,7 @@ public override IEnumerable<Status> Run()

cs
public static Point GetTarget(Point dest)
{
	List<Point> list = new List<Point>();
	foreach (Point item in EClass._map.ListPointsInCircle(dest, 3f)) 
	foreach (Point item in EClass._map.ListPointsInCircle(dest, 3f, mustBeWalkable: false)) 
	{
		if (CanClean(item))
		{

Thing

@@ -252,7 +252,7 @@ public override void OnCreate(int genLv)

cs
				for (int k = 0; k < EClass.rnd(num2 + 1); k++)
				{
					Tuple<SourceElement.Row, int> enchant = GetEnchant(genLv, (SourceElement.Row r) => r.tag.Contains("modRanged"), neg: false);
					if (enchant != null && InvOwnerMod.IsValidMod(this, enchant.Item1)) 
					if (enchant != null && InvOwnerMod.IsValidRangedMod(this, enchant.Item1)) 
					{
						ApplySocket(enchant.Item1.id, enchant.Item2);
					}

@@ -570,7 +570,7 @@ public override string GetName(NameStyle style, int _num = -1)

cs
		}
		if (!(text7 == "*r"))
		{
			text = ((!source.name2.IsEmpty()) ? source.GetTextArray("name2")[0].Replace("#1b", base.c_extraNameRef.IsEmpty((base.refCard != null) ? base.refCard.GetName() : text7)).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))))); 
			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))))); 
		}
		else
		{

TileType

@@ -330,7 +330,7 @@ public HitResult _HitTest(Point pos, Card target, bool canIgnore = true)

cs
	}
	if (pos.HasBlock)
	{
		if (!CanBuiltOnBlock && pos.sourceBlock.tileType.IsOccupyCell) 
		if (!CanBuiltOnBlock && pos.sourceBlock.tileType.IsOccupyCell && !EClass.core.config.test.allowBlockOnItem) 
		{
			return HitResult.Invalid;
		}

TraitGodStatue

@@ -1,5 +1,3 @@

cs
using UnityEngine; 

public class TraitGodStatue : TraitPowerStatue
{
	public Religion Religion => EClass.game.religions.dictAll[GetParam(1)];

@@ -21,7 +19,7 @@ public void OnChangeMaterial()

cs
	owner.rarity = (owner.isOn ? Rarity.Artifact : Rarity.Normal);
	if (Religion.id == "machine")
	{
		owner.AddCard(GetManiGene()); 
		owner.AddCard(DNA.GenerateManiGene(owner)); 
	}
	if (owner.placeState == PlaceState.installed)
	{

@@ -29,21 +27,6 @@ public void OnChangeMaterial()

cs
		}
	}

	public Thing GetManiGene() 
	{ 
		owner.things.DestroyAll(); 
		Debug.Log("Mani:" + owner.c_seed); 
		Rand.SetSeed(owner.c_seed); 
		CardRow r = SpawnList.Get("chara").Select(100); 
		Rand.SetSeed(owner.c_seed); 
		Thing thing = DNA.GenerateGene(r, DNA.Type.Superior, owner.LV, owner.c_seed); 
		thing.c_DNA.cost = thing.c_DNA.cost / 2; 
		thing.MakeRefFrom("mani"); 
		Rand.SetSeed(); 
		owner.c_seed++; 
		return thing; 
	} 

	public override void _OnUse(Chara c)
	{
		Religion.Talk("shrine");

@@ -57,7 +40,7 @@ public override void _OnUse(Chara c)

cs
	}
	case "machine":
	{
		Thing t = owner.things.Find("gene") ?? GetManiGene(); 
		Thing t = owner.things.Find("gene") ?? DNA.GenerateManiGene(owner); 
		EClass.pc.Pick(t);
		break;
	}

TraitMod

@@ -2,13 +2,15 @@

cs

public class TraitMod : TraitItem
{
	public virtual string Tag => "mod"; 

	public override bool CanStack => false;

	public SourceElement.Row source => EClass.sources.elements.map[owner.refVal];

	public override void OnCreate(int lv)
	{
		Tuple<SourceElement.Row, int> tuple = Thing.GetEnchant(lv, (SourceElement.Row r) => r.tag.Contains("modRanged"), neg: false); 
		Tuple<SourceElement.Row, int> tuple = Thing.GetEnchant(lv, (SourceElement.Row r) => r.tag.Contains(Tag), neg: false); 
		if (tuple == null)
		{
			tuple = new Tuple<SourceElement.Row, int>(EClass.sources.elements.map[600], EClass.rnd(10) + 1);

TraitModRanged

@@ -1,3 +1,4 @@

cs
public class TraitModRanged : TraitMod
{
	public override string Tag => "modRanged"; 
}

+TraitRune

File Created
cs
public class TraitRune : TraitMod
{
	public override string Tag => "modMelee";
}

+TraitToolBrush

File Created
cs
public class TraitToolBrush : TraitTool
{
	public override bool DisableAutoCombat => true;

	public override void TrySetHeldAct(ActPlan p)
	{
		foreach (Chara chara in p.pos.Charas)
		{
			if (chara.interest > 0)
			{
				p.TrySetAct(new AI_TendAnimal
				{
					target = chara
				}, chara);
			}
		}
	}
}

Zone

@@ -1456,7 +1456,6 @@ public void AddGlobalCharasOnActivate()

cs
		spawnPosPC = spawnPosPC.GetNearestPoint();
	}
	spawnPosPC = spawnPosPC.Clamp(useBounds: true).GetNearestPoint();
	Debug.Log(spawnPosPC); 
	foreach (Chara c in EClass.game.cards.globalCharas.Values)
	{
		if (c.currentZone != this)

Zone_VernisMine

@@ -1,3 +1,5 @@

cs
using UnityEngine; 

public class Zone_VernisMine : Zone_Dungeon
{
	public const int LvBoss = -8;

@@ -30,6 +32,10 @@ public override string idExport

cs
		}
	}

	public override int ContentLv => DangerLv; 

	public override int DangerLv => 5 + Mathf.Abs(base.lv); 

	public override string GetDungenID()
	{
		return "DungeonMine";