Skip to content

EA 23.61 hotfix 3

December 20, 2024

12 files modified. 2 new files created.

Important Changes

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

Zone (1)

cs
public bool TryAddThingInSpot<T>(Thing t, bool useContainer = true, bool putRandomPosIfNoSpot = true) where T : Trait
public bool TryAddThingInSpot<T>(Thing t, bool useContainer = true) where T : Trait

ActorEx

@@ -47,7 +47,7 @@ public void SetOwner(Card c)

cs

	public float GetVolume()
	{
		if (!EMono._zone.isStarted) 
		if (!EMono._zone.isStarted || !owner.IsInstalled) 
		{
			return 0f;
		}

CTAG

@@ -31,5 +31,6 @@ public enum CTAG

cs
	staticSkin,
	godArtifact,
	noWish,
	dish_bonus 
	dish_bonus, 
	dish_fail 
}

FactionBranch

@@ -624,7 +624,6 @@ void Add(Thing t)

cs
				}
				if (!TryTrash(t))
				{
					EClass._zone.AddCard(t, EClass._map.bounds.GetRandomSurface()); 
					unsortedCount++;
					if (unsortedCount >= 5)
					{

@@ -638,13 +637,13 @@ void Add(Thing t)

cs

	public bool TryTrash(Thing t)
	{
		Thing thing = ((t.id == "_poop") ? EClass._map.props.installed.FindEmptyContainer<TraitContainerCompost>(t) : (t.isFireproof ? EClass._map.props.installed.FindEmptyContainer<TraitContainerUnburnable>(t) : EClass._map.props.installed.FindEmptyContainer<TraitContainerBurnable>(t))); 
		Thing thing = ((t.id == "_poop" || t.source._origin == "dish") ? EClass._map.props.installed.FindEmptyContainer<TraitContainerCompost>(t) : (t.isFireproof ? EClass._map.props.installed.FindEmptyContainer<TraitContainerUnburnable>(t) : EClass._map.props.installed.FindEmptyContainer<TraitContainerBurnable>(t))); 
		if (thing != null)
		{
			thing.AddCard(t);
			return true;
		}
		return EClass._zone.TryAddThingInSpot<TraitSpotGarbage>(t, useContainer: false, putRandomPosIfNoSpot: false); 
		return EClass._zone.TryAddThingInSpot<TraitSpotGarbage>(t, useContainer: false); 
	}

	public void ReceivePackages(VirtualDate date)

@@ -820,7 +819,26 @@ void GetOutcome(Hobby h)

cs
								thing3.ChangeMaterial("iron");
								thing3.c_IDTState = 0;
							}
							i.TryPutShared(thing3); 
							bool flag = thing3.category.id == "garbage"; 
							if (thing3.trait is TraitFoodMeal) 
							{ 
								if (thing3.HasTag(CTAG.dish_fail)) 
								{ 
									flag = true; 
								} 
								else
								{ 
									CraftUtil.MakeDish(thing3, num4 + 10, i); 
								} 
							} 
							if (flag) 
							{ 
								TryTrash(thing3); 
							} 
							else
							{ 
								i.TryPutShared(thing3); 
							} 
						}
					}
				}

GoalCombat

@@ -517,9 +517,9 @@ public virtual bool TryUseAbility(int dist, bool beforeMove = false)

cs
				{
					num -= 40;
				}
				if (tc.id == "hedgehog_ether") 
				if (!owner.IsPC && owner.IsPCFaction && tc.id == "hedgehog_ether") 
				{
					num = -999999; 
					continue; 
				}
			}
			break;

@@ -584,7 +584,7 @@ public virtual bool TryUseAbility(int dist, bool beforeMove = false)

cs
				continue;
			}
			bool flag5 = ability.act is ActBolt;
			if (!flag || (owner.IsPCParty && (EClass._zone.IsTown || EClass._zone.IsPCFaction))) 
			if (!flag || (owner.IsPCParty && (EClass._zone.IsTown || EClass._zone.IsPCFaction)) || (act.id == 9150 && EClass._zone.IsPCFaction && owner.IsNeutralOrAbove())) 
			{
				continue;
			}

Player

@@ -740,6 +740,9 @@ public void OnLeaveZone()

cs
	[JsonProperty]
	public int seedFortune;

	[JsonProperty] 
	public int giftJure; 

	[JsonProperty]
	public float angle;

RecipeManager

@@ -252,7 +252,7 @@ public static RecipeSource GetUnlearnedRecipe(int lvBonus, string cat, bool only

cs
	List<RecipeSource> list = new List<RecipeSource>();
	foreach (RecipeSource item in RecipeManager.list)
	{
		if ((item.NeedFactory || item.IsQuickCraft) && (cat == null || item.row.Category.IsChildOf(cat)) && (!onlyUnlearned || !EClass.player.recipes.knownRecipes.ContainsKey(item.id)) && EClass.pc.Evalue(item.GetReqSkill().id) + 5 + lvBonus >= item.row.LV) 
		if ((item.NeedFactory || item.IsQuickCraft) && (cat == null || item.row.Category.IsChildOf(cat)) && (!onlyUnlearned || !EClass.player.recipes.knownRecipes.ContainsKey(item.id)) && EClass.pc.Evalue(item.GetReqSkill().id) + 5 + lvBonus >= item.row.LV && !item.row.ContainsTag("hiddenRecipe")) 
		{
			list.Add(item);
		}

Thing

@@ -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("#1", 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.refCard != null) ? base.refCard.GetName() : text7).Replace("#1", 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
		{

Trait

@@ -1140,20 +1140,28 @@ public virtual void Toggle(bool on, bool silent = false)

cs
			if (!silent)
			{
				owner.Say(flag ? "toggle_fire" : "toggle_ele", EClass.pc, owner);
				owner.PlaySound((Electricity < 0) ? "switch_on_electricity" : (flag ? "torch_lit" : "switch_on")); 
				string id = ((Electricity < 0) ? "switch_on_electricity" : (flag ? "torch_lit" : "switch_on")); 
				if (this is TraitMusicBox) 
				{ 
					id = "switch_on_musicbox"; 
				} 
				owner.PlaySound(id); 
			}
			RefreshRenderer();
			owner.RecalculateFOV();
			break; 
		}
		else
		if (!silent) 
		{
			if (!silent) 
			string id2 = ((Electricity < 0) ? "switch_off_electricity" : (flag ? "torch_unlit" : "switch_off")); 
			if (this is TraitMusicBox) 
			{
				owner.PlaySound((Electricity < 0) ? "switch_off_electricity" : (flag ? "torch_unlit" : "switch_off")); 
				id2 = "switch_off_musicbox"; 
			}
			RefreshRenderer(); 
			owner.RecalculateFOV(); 
			owner.PlaySound(id2); 
		}
		RefreshRenderer(); 
		owner.RecalculateFOV(); 
		break;
	case ToggleType.None:
		break;

TraitGeneMachine

@@ -6,8 +6,14 @@ public class TraitGeneMachine : TraitStasisChamber

cs

	public override bool IsHomeItem => true;

	public override bool CanBeHeld => !IsTargetUsingGene(); 

	public Chara GetTarget()
	{
		if (!owner.IsInstalled) 
		{ 
			return null; 
		} 
		foreach (Chara chara in owner.pos.Charas)
		{
			ConSuspend condition = chara.GetCondition<ConSuspend>();

TraitGiftJure

@@ -16,14 +16,29 @@ public override bool OnUse(Chara c)

cs
		}
		EClass.pc.Say("openDoor", EClass.pc, owner);
		SE.Play("dropReward");
		List<string> list = new List<string> { "snow_globe", "xmas_wreath", "xmas_wreath", "xmas_garland", "xmas_garland", "hat_santa" }; 
		list.Shuffle(); 
		for (int i = 0; i < 4; i++) 
		List<string> list = new List<string> { "hat_santa", "musicbox_jure", "1228", "1229", "holyFeather" }; 
		Add(list[EClass.player.giftJure % list.Count], 1); 
		foreach (string item in new List<string> { "xmas_wreath", "xmas_garland", "1232", "xmas_socks", "xmas_boot", "xmas_cane" }) 
		{
			Thing t = ThingGen.Create(list[i]); 
			EClass.pc.Pick(t); 
			Add(item, 2 + EClass.rnd(2)); 
		}
		Add("xmas_jure", 1); 
		Add("snow_globe", 1); 
		Add("xmas_pedestal", 1); 
		Add("cake_festival", 3); 
		Add("bushdenoel", 3); 
		Add("mancookie", 3); 
		EClass.player.giftJure++; 
		owner.ModNum(-1);
		return true;
		static void Add(string id, int num) 
		{ 
			Thing thing = ThingGen.Create(id).SetNum(num).SetNoSell(); 
			if (id == "snow_globe") 
			{ 
				thing.idSkin = EClass.player.giftJure % 3; 
			} 
			EClass.pc.Pick(thing); 
		} 
	}
}

+TraitGoodsCoin

File Created
cs
public class TraitGoodsCoin : TraitItem
{
	public override bool OnUse(Chara c)
	{
		EClass.player.ModKeyItem("lucky_coin");
		owner.ModNum(-1);
		return true;
	}
}

+TraitMusicBox

File Created
cs
public class TraitMusicBox : TraitJukeBox
{
	public override ToggleType ToggleType => ToggleType.Custom;

	public override bool CanUseFromInventory => false;

	public override bool OnUse(Chara c)
	{
		owner.refVal = 115;
		Toggle(!owner.isOn);
		return true;
	}
}

Zone

@@ -1882,16 +1882,12 @@ public T GetRandomSpot<T>() where T : Trait

cs
		return EClass._map.props.installed.traits.GetRandomThing<T>() as T;
	}

	public bool TryAddThingInSpot<T>(Thing t, bool useContainer = true, bool putRandomPosIfNoSpot = true) where T : Trait
	public bool TryAddThingInSpot<T>(Thing t, bool useContainer = true) where T : Trait
	{
		Thing randomThing = EClass._map.props.installed.traits.GetRandomThing<T>();
		if (randomThing == null)
		{
			if (putRandomPosIfNoSpot) 
			{ 
				AddCard(t, EClass._map.bounds.GetRandomSurface()); 
				return true; 
			} 
			AddCard(t, EClass._map.bounds.GetRandomSurface()); 
			return false;
		}
		if (useContainer && (!t.IsContainer || t.things.Count == 0))