Skip to content

EA 23.67 Hotfix 5

December 28, 2024

18 files modified. 1 new file created.

Important Changes

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

ActEffect (1)

cs
public static bool Wish(string s, string name, int power) 
public static bool Wish(string s, string name, int power, BlessedState state) 

AI_Idle

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

cs
		}
		else if (EClass.player.stats.turns > owner.turnLastSeen + 50 && Los.IsVisible(EClass.pc, owner) && owner.CanSee(EClass.pc))
		{
			if (EClass.rnd(5) == 0 && owner.hostility >= Hostility.Neutral && EClass.pc.IsPCC && EClass.pc.pccData.state == PCCState.Undie && EClass.pc.pos.cell.IsTopWaterAndNoSnow) 
			if (EClass.rnd(5) == 0 && owner.hostility >= Hostility.Neutral && EClass.pc.IsPCC && EClass.pc.pccData.state == PCCState.Undie && !EClass.pc.pos.cell.IsTopWaterAndNoSnow) 
			{
				owner.Talk("pervert3");
			}

ActEffect

@@ -1234,15 +1234,15 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		{
			break;
		}
		int hex = 0; 
		int hex2 = 0; 
		foreach (Condition condition4 in TC.conditions)
		{
			if (condition4.Type == ConditionType.Debuff)
			{
				hex++; 
				hex2++; 
			}
		}
		if (hex == 0) 
		if (hex2 == 0) 
		{
			CC.SayNothingHappans();
			break;

@@ -1266,7 +1266,7 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
				{
					break;
				}
				int dmg2 = Dice.Create("SpShutterHex", power * hex, CC, actRef.act).Roll(); 
				int dmg2 = Dice.Create("SpShutterHex", power * hex2, CC, actRef.act).Roll(); 
				item3.DamageHP(dmg2, 919, power, AttackSource.None, CC);
			}
		});

@@ -1303,26 +1303,26 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
			TC.Say((actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", TC);
			break;
		}
		Thing thing4 = null; 
		bool flag6 = actRef.n1 == "food"; 
		Thing thing6 = null; 
		bool flag8 = actRef.n1 == "food"; 
		if (actRef.n1 == "money")
		{
			int currency = TC.GetCurrency();
			if (currency > 0)
			{
				currency = Mathf.Clamp(EClass.rnd(currency / 10), 1, 100 + EClass.rndHalf(CC.LV * 200));
				thing4 = ThingGen.Create("money").SetNum(currency); 
				thing6 = ThingGen.Create("money").SetNum(currency); 
				TC.ModCurrency(-currency);
			}
		}
		else
		{
			Func<Thing, bool> func = (Thing t) => true;
			if (flag6) 
			if (flag8) 
			{
				func = (Thing t) => t.IsFood;
			}
			List<Thing> list3 = TC.things.List(delegate(Thing t) 
			List<Thing> list7 = TC.things.List(delegate(Thing t) 
			{
				if (t.parentCard?.trait is TraitChestMerchant || t.trait is TraitTool || t.IsThrownWeapon)
				{

@@ -1330,30 +1330,30 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
				}
				return t.trait.CanBeDestroyed && t.things.Count == 0 && t.invY != 1 && t.trait.CanBeStolen && !t.trait.CanOnlyCarry && !t.IsUnique && !t.isEquipped && t.blessedState == BlessedState.Normal && func(t);
			}, onlyAccessible: true);
			if (list3.Count > 0) 
			if (list7.Count > 0) 
			{
				thing4 = list3.RandomItem(); 
				if (thing4.Num > 1) 
				thing6 = list7.RandomItem(); 
				if (thing6.Num > 1) 
				{
					thing4 = thing4.Split(1); 
					thing6 = thing6.Split(1); 
				}
			}
			CC.AddCooldown(6640, 200);
		}
		if (thing4 == null) 
		if (thing6 == null) 
		{
			CC.Say("abStealNothing", CC, TC);
			break;
		}
		thing4.SetInt(116, 1); 
		TC.PlaySound(thing4.material.GetSoundDrop(thing4.sourceCard)); 
		CC.Pick(thing4, msg: false); 
		CC.Say("abSteal", CC, TC, thing4.Name); 
		thing6.SetInt(116, 1); 
		TC.PlaySound(thing6.material.GetSoundDrop(thing6.sourceCard)); 
		CC.Pick(thing6, msg: false); 
		CC.Say("abSteal", CC, TC, thing6.Name); 
		if (actRef.n1 == "food")
		{
			if (CC.hunger.value != 0)
			{
				CC.InstantEat(thing4); 
				CC.InstantEat(thing6); 
			}
		}
		else

@@ -1378,7 +1378,7 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		{
			break;
		}
		List<Thing> list5 = TC.things.List(delegate(Thing t) 
		List<Thing> list6 = TC.things.List(delegate(Thing t) 
		{
			if (!t.isEquipped || t.blessedState == BlessedState.Doomed || t.IsToolbelt)
			{

@@ -1386,12 +1386,12 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
			}
			return (t.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0) ? true : false;
		});
		if (list5.Count == 0) 
		if (list6.Count == 0) 
		{
			CC.SayNothingHappans();
			break;
		}
		Thing thing5 = list5.RandomItem(); 
		Thing thing5 = list6.RandomItem(); 
		TC.Say("curse_hit", TC, thing5);
		thing5.SetBlessedState((thing5.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed);
		LayerInventory.SetDirty(thing5);

@@ -1476,18 +1476,18 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
				text3 = text4;
			}
		}
		Condition condition = Condition.Create(text3, power, delegate(Condition con) 
		Condition condition2 = Condition.Create(text3, power, delegate(Condition con) 
		{
			if (!actRef.aliasEle.IsEmpty())
			{
				con.SetElement(EClass.sources.elements.alias[actRef.aliasEle].id);
			}
		});
		condition.isPerfume = TC.IsPC && actRef.isPerfume; 
		Condition condition2 = TC.AddCondition(condition); 
		if (condition2 != null && condition2.isPerfume) 
		condition2.isPerfume = TC.IsPC && actRef.isPerfume; 
		Condition condition3 = TC.AddCondition(condition2); 
		if (condition3 != null && condition3.isPerfume) 
		{
			condition2.value = 3; 
			condition3.value = 3; 
			Msg.Say("perfume", TC);
		}
		if (!text4.IsEmpty())

@@ -1499,14 +1499,14 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
	case EffectId.KizuamiTrick:
	{
		EClass.game.religions.Trickery.Talk("ability");
		bool hex2 = CC.IsHostile(TC); 
		List<SourceStat.Row> list7 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex2 ? "Debuff" : "Buff")).ToList(); 
		bool hex = CC.IsHostile(TC); 
		List<SourceStat.Row> list4 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex ? "Debuff" : "Buff")).ToList(); 
		int power2 = power;
		for (int l = 0; l < 4 + EClass.rnd(2); l++) 
		for (int k = 0; k < 4 + EClass.rnd(2); k++) 
		{
			SourceStat.Row row2 = list7.RandomItem(); 
			list7.Remove(row2); 
			Proc(hex2 ? EffectId.Debuff : EffectId.Buff, CC, TC, power2, new ActRef
			SourceStat.Row row2 = list4.RandomItem(); 
			list4.Remove(row2); 
			Proc(hex ? EffectId.Debuff : EffectId.Buff, CC, TC, power2, new ActRef
			{
				n1 = row2.alias
			});

@@ -1523,13 +1523,13 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		bool isPowerful = TC.IsPowerful;
		string n = actRef.n1;
		int a2 = power;
		int num7 = TC.WIL * (isPowerful ? 20 : 5); 
		ConHolyVeil condition3 = TC.GetCondition<ConHolyVeil>(); 
		if (condition3 != null) 
		int num6 = TC.WIL * (isPowerful ? 20 : 5); 
		ConHolyVeil condition = TC.GetCondition<ConHolyVeil>(); 
		if (condition != null) 
		{
			num7 += condition3.power * 5; 
			num6 += condition.power * 5; 
		}
		if (EClass.rnd(a2) < num7 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0) 
		if (EClass.rnd(a2) < num6 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0) 
		{
			TC.Say("debuff_resist", TC);
			CC.DoHostileAction(TC);

@@ -1579,13 +1579,16 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		{
			break;
		}
		Msg.Say("wishHappen"); 
		if (blessed || flag) 
		{ 
			power /= 2; 
		} 
		Dialog.InputName("dialogWish", "q", delegate(bool cancel, string text)
		{
			if (!cancel)
			{
				Msg.Say("wish", TC, text);
				Wish(text, EClass.pc.NameTitled, power); 
				Wish(text, EClass.pc.NameTitled, power, state); 
			}
		});
		break;

@@ -1671,16 +1674,16 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		break;
	case EffectId.Revive:
	{
		List<KeyValuePair<int, Chara>> list4 = EClass.game.cards.globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon && a.Value.GetInt(103) != 0).ToList(); 
		List<KeyValuePair<int, Chara>> list3 = EClass.game.cards.globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon && a.Value.GetInt(103) != 0).ToList(); 
		if (TC.IsPCFaction || TC.IsPCFactionMinion)
		{
			if (TC.IsPC && list4.Count == 0) 
			if (TC.IsPC && list3.Count == 0) 
			{
				list4 = EClass.game.cards.globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon).ToList(); 
				list3 = EClass.game.cards.globalCharas.Where((KeyValuePair<int, Chara> a) => a.Value.isDead && a.Value.faction == EClass.pc.faction && !a.Value.isSummon).ToList(); 
			}
			if (list4.Count > 0) 
			if (list3.Count > 0) 
			{
				list4.RandomItem().Value.Chara.GetRevived(); 
				list3.RandomItem().Value.Chara.GetRevived(); 
				break;
			}
		}

@@ -1723,34 +1726,34 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
	case EffectId.EnhanceBodyGreat:
	case EffectId.EnhanceMindGreat:
	{
		bool flag7 = id == EffectId.EnhanceBody || id == EffectId.EnhanceBodyGreat; 
		bool flag6 = id == EffectId.EnhanceBody || id == EffectId.EnhanceBodyGreat; 
		bool mind = id == EffectId.EnhanceMind || id == EffectId.EnhanceMindGreat;
		int num6 = ((id == EffectId.EnhanceBody || id == EffectId.EnhanceMind) ? 1 : (4 + EClass.rnd(4))); 
		TC.Say(flag7 ? "enhanceBody" : "enhanceMind", TC); 
		int num7 = ((id == EffectId.EnhanceBody || id == EffectId.EnhanceMind) ? 1 : (4 + EClass.rnd(4))); 
		TC.Say(flag6 ? "enhanceBody" : "enhanceMind", TC); 
		TC.PlayEffect("buff");
		TC.PlaySound("buff");
		for (int k = 0; k < num6; k++) 
		for (int l = 0; l < num7; l++) 
		{
			TC.EnhanceTempElements(power, flag7, mind); 
			TC.EnhanceTempElements(power, flag6, mind); 
		}
		break;
	}
	case EffectId.RestoreBody:
	case EffectId.RestoreMind:
	{
		bool flag8 = id == EffectId.RestoreBody; 
		bool flag7 = id == EffectId.RestoreBody; 
		if (flag)
		{
			Redirect(flag8 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef)); 
			Redirect(flag7 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef)); 
			break;
		}
		TC.Say(flag8 ? "restoreBody" : "restoreMind", TC); 
		TC.Say(flag7 ? "restoreBody" : "restoreMind", TC); 
		TC.PlaySound("heal");
		TC.PlayEffect("heal");
		TC.CureHost(flag8 ? CureType.CureBody : CureType.CureMind, power, state); 
		TC.CureHost(flag7 ? CureType.CureBody : CureType.CureMind, power, state); 
		if (blessed)
		{
			Redirect(flag8 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef)); 
			Redirect(flag7 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef)); 
		}
		break;
	}

@@ -2044,20 +2047,20 @@ public static bool DamageEle(Card CC, EffectId id, int power, Element e, List<Po

cs
		{
			power /= 4;
		}
		List<Thing> list6 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false); 
		if (list6.Count != 0) 
		List<Thing> list5 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false); 
		if (list5.Count != 0) 
		{
			Thing thing6 = list6.RandomItem(); 
			Thing thing4 = list5.RandomItem(); 
			TC.Say("acid_hit", TC);
			if (thing6.isAcidproof) 
			if (thing4.isAcidproof) 
			{
				TC.Say("acid_nullify", thing6); 
				TC.Say("acid_nullify", thing4); 
			}
			else if (thing6.encLV > -5) 
			else if (thing4.encLV > -5) 
			{
				TC.Say("acid_rust", TC, thing6); 
				thing6.ModEncLv(-1); 
				LayerInventory.SetDirty(thing6); 
				TC.Say("acid_rust", TC, thing4); 
				thing4.ModEncLv(-1); 
				LayerInventory.SetDirty(thing4); 
			}
			if (TC.IsPCParty)
			{

@@ -2162,7 +2165,7 @@ public static Point GetTeleportPos(Point org, int radius = 6)

cs
		return org.GetRandomNeighbor().GetNearestPoint();
	}

	public static bool Wish(string s, string name, int power) 
	public static bool Wish(string s, string name, int power, BlessedState state) 
	{
		Msg.thirdPerson1.Set(EClass.pc);
		string netMsg = GameLang.Parse("wish".langGame(), thirdPerson: true, name, s);

@@ -2170,6 +2173,15 @@ public static bool Wish(string s, string name, int power)

cs
	List<WishItem> list = new List<WishItem>();
	int wishLv = 10 + power / 4;
	int wishValue = power * 200;
	if (state >= BlessedState.Blessed) 
	{ 
		wishLv = wishLv * 150 / 100; 
	} 
	else if (state <= BlessedState.Cursed) 
	{ 
		wishLv = wishLv * 150 / 100; 
		wishValue = 1; 
	} 
	Debug.Log(power + "/" + wishValue);
	string _s = s.ToLower();
	foreach (CardRow r in EClass.sources.cards.rows)

BaseTileMap

@@ -2566,6 +2566,11 @@ public virtual void DrawTile()

cs
					_actorPos.y += thingPos.y;
					if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
					{
						thingPos.y -= num20; 
						if (thing != null) 
						{ 
							_actorPos.z -= 0.2f; 
						} 
						_actorPos.y -= num20;
					}
					_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y;

@@ -3185,6 +3190,7 @@ public Vector3 GetThingPosition(Card tg, Point p)

cs
	float num3 = 0f;
	if (detail != null && detail.things.Count > 0)
	{
		Card card = null; 
		for (int i = 0; i < detail.things.Count; i++)
		{
			Thing thing = detail.things[i];

@@ -3216,12 +3222,17 @@ public Vector3 GetThingPosition(Card tg, Point p)

cs
					zero += altitudeFix * thing.altitude;
					num4 += altitudeFix.y * (float)thing.altitude;
				}
				if (thing.trait.IgnoreLastStackHeight && (card == null || !card.trait.IgnoreLastStackHeight)) 
				{ 
					zero.y -= num3; 
				} 
				num3 = num4;
				zero.z += renderSetting.thingZ + num + (float)i * -0.01f + zSetting.mod1 * zero.y;
				if (thing.sourceCard.multisize)
				{
					num += zSetting.multiZ;
				}
				card = thing; 
			}
		}
	}

Card

@@ -3044,7 +3044,7 @@ public virtual bool CanStackTo(Thing to)

cs

	public bool TryStackTo(Thing to)
	{
		if (!CanStackTo(to)) 
		if (isDestroyed || to.isDestroyed || !CanStackTo(to)) 
		{
			return false;
		}

@@ -3229,15 +3229,15 @@ public void EjectSockets()

cs
		if (num != 0)
		{
			Thing thing = ThingGen.Create(isCopy ? "ash3" : "mod_ranged");
			int num2 = num / 100; 
			int num3 = num % 100; 
			int ele = num / 100; 
			int num2 = num % 100; 
			elements.ModBase(ele, -num2); 
			if (!isCopy)
			{
				thing.refVal = num2; 
				thing.encLV = num3; 
				thing.refVal = ele; 
				thing.encLV = num2; 
			}
			EClass._map.TrySmoothPick(pos.IsBlocked ? EClass.pc.pos : pos, thing, EClass.pc);
			elements.ModBase(thing.refVal, -thing.encLV); 
			sockets[i] = 0;
		}
	}

CardRenderer

@@ -369,14 +369,7 @@ public override void OnEnterScreen()

cs
	isSynced = true;
	if (!usePass)
	{
		if (hasActor) 
		{ 
			if (!data.persistActor) 
			{ 
				Debug.LogError("renderer alraedy have actor:" + owner); 
			} 
		} 
		else
		if (!hasActor) 
		{
			actor = data.CreateActor();
			if (actor == null)

Chara

@@ -2626,10 +2626,21 @@ public override MoveResult _Move(Point newPoint, MoveType type = MoveType.Walk)

cs
					{
						containerFlag = ContainerFlag.other;
					}
					if ((dataPick.noRotten && item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0) || (dataPick.userFilter && !dataPick.IsFilterPass(item.GetName(NameStyle.Full, 1)))) 
					if ((dataPick.noRotten && item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0)) 
					{
						continue;
					}
					if (dataPick.userFilter) 
					{ 
						switch (dataPick.IsFilterPass(item.GetName(NameStyle.Full, 1))) 
						{ 
						case Window.SaveData.FilterResult.PassWithoutFurtherTest: 
							Pick(item.Thing); 
							continue; 
						case Window.SaveData.FilterResult.Block: 
							continue; 
						} 
					} 
					if (dataPick.advDistribution)
					{
						foreach (int cat in dataPick.cats)

EffectIRenderer

@@ -119,6 +119,7 @@ public override void OnUpdate()

cs
		if ((bool)card.renderer.actor)
		{
			card.renderer.actor.OnRender(renderParam);
			card.renderer.isSynced = false; 
		}
	}
}

FactionBranch

@@ -1006,8 +1006,9 @@ public void CalcInnIncome()

cs
	{
		if (thing.IsInstalled && thing.trait is TraitBed traitBed && traitBed.owner.c_bedType == BedType.guest)
		{
			num2++; 
			num3 += traitBed.owner.LV; 
			int maxHolders = traitBed.MaxHolders; 
			num2 += maxHolders; 
			num3 += traitBed.owner.LV * (100 + traitBed.owner.Quality / 2 + traitBed.owner.Evalue(750) / 2) / 100 * maxHolders; 
		}
	}
	num = Mathf.Min(num, num2);

GoalCombat

@@ -521,6 +521,10 @@ public virtual bool TryUseAbility(int dist, bool beforeMove = false)

cs
				{
					continue;
				}
				if (!owner.IsPCFaction && num < 10) 
				{ 
					num = 10; 
				} 
			}
			break;
		case "range":

InvOwner

@@ -938,6 +938,10 @@ public virtual void OnShiftClick(ButtonGrid b, bool rightMouse = false)

cs
{
	InvOwner shitDestOwner = GetShitDestOwner(b, rightMouse);
	Thing thing = b.card.Thing;
	if (thing == null || thing.isDestroyed) 
	{ 
		return; 
	} 
	Card container = shitDestOwner.Container;
	if (rightMouse && !owner.IsPC)
	{

LayerFeedback

@@ -22,6 +22,8 @@ public class LayerFeedback : ELayer

cs

	public static string backerId = "";

	public static string header = ""; 

	public static int playedHours;

	public UIText textProgress;

@@ -219,9 +221,10 @@ public void CollectFiles()

cs
	{
		num += CountString(text4, c2);
	}
	ReportTitle.strAdd = header ?? ""; 
	if (num > 0)
	{
		ReportTitle.strAdd = "[ignore:" + num + "]"; 
		ReportTitle.strAdd = ReportTitle.strAdd + "[ignore:" + num + "]"; 
		ReportTitle.strAdd = ReportTitle.strAdd + " " + steamName + "/" + userName + "/" + backerId;
		ReportTitle.ignore = true;
	}

+TaskClean

File Created
cs
using System.Collections.Generic;
using System.Linq;

public class TaskClean : Task
{
	public Point dest;

	public override string GetText(string str = "")
	{
		return "actClean".lang();
	}

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

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

	public override bool CanManualCancel()
	{
		return true;
	}

	public override IEnumerable<Status> Run()
	{
		while (true)
		{
			dest = GetTarget(dest);
			if (dest == null)
			{
				yield return Success();
			}
			bool fail = false;
			yield return DoGoto(dest, 0, ignoreConnection: false, delegate
			{
				fail = true;
				return Status.Running;
			});
			yield return KeepRunning();
			if (!fail && CanClean(dest))
			{
				if (owner.Dist(dest) > 1)
				{
					yield return Cancel();
				}
				Point point = dest;
				EClass._map.SetDecal(point.x, point.z);
				EClass._map.SetLiquid(point.x, point.z, 0, 0);
				point.PlayEffect("vanish");
				EClass.pc.Say("clean", owner);
				EClass.pc.PlaySound("clean_floor");
				EClass.pc.stamina.Mod(-1);
				EClass.pc.ModExp(293, 30);
				yield return KeepRunning();
			}
		}
	}

	public static Point GetTarget(Point dest)
	{
		List<Point> list = new List<Point>();
		foreach (Point item in EClass._map.ListPointsInCircle(dest, 3f))
		{
			if (CanClean(item))
			{
				list.Add(item);
			}
		}
		if (list.Count == 0)
		{
			return null;
		}
		list.Sort((Point a, Point b) => dest.Distance(a) - dest.Distance(b));
		return list.First();
	}
}

TaskDump

@@ -173,6 +173,17 @@ public List<Thing> ListThingsToPut(Thing c)

cs
		{
			if (!ExcludeDump(t))
			{
				if (data.userFilter) 
				{ 
					switch (data.IsFilterPass(t.GetName(NameStyle.Full, 1))) 
					{ 
					case Window.SaveData.FilterResult.Block: 
						return; 
					case Window.SaveData.FilterResult.PassWithoutFurtherTest: 
						list.Add(t); 
						return; 
					} 
				} 
				if (data.advDistribution)
				{
					foreach (int cat in data.cats)

@@ -202,9 +213,23 @@ public List<Thing> ListThingsToPut(Thing c)

cs
		{
			EClass.pc.things.Foreach(delegate(Thing t)
			{
				if (!ExcludeDump(t) && t.CanStackTo(ct)) 
				if (!ExcludeDump(t)) 
				{
					list.Add(t); 
					if (data.userFilter) 
					{ 
						switch (data.IsFilterPass(t.GetName(NameStyle.Full, 1))) 
						{ 
						case Window.SaveData.FilterResult.Block: 
							return; 
						case Window.SaveData.FilterResult.PassWithoutFurtherTest: 
							list.Add(t); 
							return; 
						} 
					} 
					if (t.CanStackTo(ct)) 
					{ 
						list.Add(t); 
					} 
				}
			});
		}

@@ -222,9 +247,23 @@ public List<Thing> ListThingsToPut(Thing c)

cs
		}
		EClass.pc.things.Foreach(delegate(Thing t)
		{
			if (!ExcludeDump(t) && cats.Contains(t.category)) 
			if (!ExcludeDump(t)) 
			{
				list.Add(t); 
				if (data.userFilter) 
				{ 
					switch (data.IsFilterPass(t.GetName(NameStyle.Full, 1))) 
					{ 
					case Window.SaveData.FilterResult.Block: 
						return; 
					case Window.SaveData.FilterResult.PassWithoutFurtherTest: 
						list.Add(t); 
						return; 
					} 
				} 
				if (cats.Contains(t.category)) 
				{ 
					list.Add(t); 
				} 
			}
		});
		break;

@@ -249,10 +288,6 @@ bool ExcludeDump(Thing t)

cs
		{
			return true;
		}
		if (data.userFilter && !data.IsFilterPass(t.GetName(NameStyle.Full, 1))) 
		{ 
			return true; 
		} 
		if (!(t.parent is Card card))
		{
			return false;

ThingContainer

@@ -476,8 +476,19 @@ void TrySearchContainer(Card c)

cs
		if (c.things != this)
		{
			Window.SaveData windowSaveData = c.GetWindowSaveData();
			if (windowSaveData != null && (!windowSaveData.noRotten || !t.IsDecayed) && (!windowSaveData.onlyRottable || t.trait.Decay != 0) && (!windowSaveData.userFilter || windowSaveData.IsFilterPass(t.GetName(NameStyle.Full, 1)))) 
			if (windowSaveData != null && (!windowSaveData.noRotten || !t.IsDecayed) && (!windowSaveData.onlyRottable || t.trait.Decay != 0)) 
			{
				if (windowSaveData.userFilter) 
				{ 
					switch (windowSaveData.IsFilterPass(t.GetName(NameStyle.Full, 1))) 
					{ 
					case Window.SaveData.FilterResult.Block: 
						return; 
					case Window.SaveData.FilterResult.PassWithoutFurtherTest: 
						_listContainers.Add(c.things); 
						return; 
					} 
				} 
				if (windowSaveData.advDistribution)
				{
					foreach (int cat in windowSaveData.cats)

TraitBroom

@@ -4,19 +4,9 @@ public class TraitBroom : TraitTool

cs

	public override void TrySetHeldAct(ActPlan p)
	{
		if (p.pos.HasDirt || p.pos.cell.HasLiquid) 
		p.TrySetAct(new TaskClean
		{
			p.TrySetAct("actClean", delegate
			{ 
				EClass._map.SetDecal(p.pos.x, p.pos.z); 
				EClass._map.SetLiquid(p.pos.x, p.pos.z, 0, 0); 
				p.pos.PlayEffect("vanish"); 
				EClass.pc.Say("clean", owner); 
				EClass.pc.PlaySound("clean_floor"); 
				EClass.pc.stamina.Mod(-1); 
				EClass.pc.ModExp(293, 40); 
				return true; 
			}); 
		} 
			dest = p.pos.Copy() 
		}); 
	}
}

TraitCrafter

@@ -307,7 +307,7 @@ public virtual Thing Craft(AI_UseCrafter ai)

cs
		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, 1)); 
		CardRow cardRow = list.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));

UI

@@ -693,21 +693,22 @@ public void ToggleFeedback()

cs
		Dialog.Ok("dialog_needToLogOn");
		return;
	}
	string text2 = ""; 
	string backerId = ""; 
	try
	{
		if (!ELayer.config.rewardCode.IsEmpty())
		{
			text2 = "backer"; 
			text2 = ElinEncoder.GetID(ELayer.config.rewardCode); 
			backerId = "backer"; 
			backerId = ElinEncoder.GetID(ELayer.config.rewardCode); 
		}
	}
	catch (Exception message)
	{
		text2 = ""; 
		backerId = ""; 
		Debug.Log(message);
	}
	if (!Application.isEditor && text2.IsEmpty()) 
	bool flag = false; 
	if (!Application.isEditor) 
	{
		string pchName = "public";
		try

@@ -717,6 +718,7 @@ public void ToggleFeedback()

cs
				Dialog.Ok("dialog_feedbackTooMany");
				return;
			}
			flag = true; 
			Debug.Log(pchName);
		}
		catch

@@ -742,9 +744,10 @@ public void ToggleFeedback()

cs
	{
		userName = array[2];
	}
	LayerFeedback.header = (flag ? "" : "(!)"); 
	LayerFeedback.userName = userName;
	LayerFeedback.playedHours = ELayer.config.maxPlayedHours;
	LayerFeedback.backerId = text2; 
	LayerFeedback.backerId = backerId; 
	LayerFeedback.steamName = text;
	ELayer.ui.ToggleLayer<LayerFeedback>();
	SE.Tab();

WidgetStatsBar

@@ -348,11 +348,6 @@ public override void OnSetContextMenu(UIContextMenu m)

cs
		extra.medal = a;
		Build();
	});
	uIContextMenu.AddToggle("influence", extra.influence, delegate(bool a) 
	{ 
		extra.influence = a; 
		Build(); 
	}); 
	uIContextMenu.AddToggle("karma", extra.karma, delegate(bool a)
	{
		extra.karma = a;

@@ -363,6 +358,11 @@ public override void OnSetContextMenu(UIContextMenu m)

cs
		extra.fame = a;
		Build();
	});
	uIContextMenu.AddToggle("influence", extra.influence, delegate(bool a) 
	{ 
		extra.influence = a; 
		Build(); 
	}); 
	if ((bool)EMono.debug)
	{
		uIContextMenu.AddToggle("godMood", extra.mood, delegate(bool a)

Zone

@@ -2024,30 +2024,42 @@ Thing SearchDest()

cs
					Window.SaveData windowSaveData = thing.GetWindowSaveData();
					if (windowSaveData != null)
					{
						if (windowSaveData.priority <= priority || (windowSaveData.noRotten && t.IsDecayed) || (windowSaveData.onlyRottable && t.trait.Decay == 0) || (windowSaveData.userFilter && !windowSaveData.IsFilterPass(t.GetName(NameStyle.Full, 1)))) 
						if (windowSaveData.priority <= priority || (windowSaveData.noRotten && t.IsDecayed) || (windowSaveData.onlyRottable && t.trait.Decay == 0)) 
						{
							continue;
						}
						if (windowSaveData.advDistribution) 
						Window.SaveData.FilterResult filterResult = Window.SaveData.FilterResult.Pass; 
						if (windowSaveData.userFilter) 
						{
							bool flag2 = false; 
							foreach (int cat in windowSaveData.cats) 
							filterResult = windowSaveData.IsFilterPass(t.GetName(NameStyle.Full, 1)); 
							if (filterResult == Window.SaveData.FilterResult.Block) 
							{
								if (t.category.uid == cat) 
								continue; 
							} 
						} 
						if (filterResult != Window.SaveData.FilterResult.PassWithoutFurtherTest) 
						{ 
							if (windowSaveData.advDistribution) 
							{ 
								bool flag2 = false; 
								foreach (int cat in windowSaveData.cats) 
								{
									flag2 = true; 
									break; 
									if (t.category.uid == cat) 
									{ 
										flag2 = true; 
										break; 
									} 
								} 
								if (!flag2) 
								{ 
									continue; 
								}
							}
							if (!flag2) 
							else if (windowSaveData.flag.HasFlag(flag)) 
							{
								continue;
							}
						}
						else if (windowSaveData.flag.HasFlag(flag)) 
						{ 
							continue; 
						} 
						priority = windowSaveData.priority;
					}
					else