Skip to content

EA 23.74 Hotfix 5

January 9, 2025

13 files modified.

Important Changes

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

TaskHarvest (1)

cs
public bool HaveHarvestThing() 
public string GetIdDismantled() 

CardRenderer

@@ -233,17 +233,33 @@ public override void Draw(RenderParam p, ref Vector3 v, bool drawShadow)

cs
			pref = replacer.pref;
			SubPassData.Current = SubPassData.Default;
		}
		int shadow = pref.shadow; 
		int num2 = pref.shadow; 
		bool flag2 = isChara && owner.isHidden && !EClass.pc.canSeeInvisible && (!EClass.pc.hasTelepathy || !owner.Chara.race.visibleWithTelepathy);
		if (isChara)
		{
			p.x += pref.x * (float)((!owner.flipX) ? 1 : (-1));
			if (owner.idSkin > 0) 
			{ 
				switch (owner.sourceCard.tiles.TryGet(owner.idSkin)) 
				{ 
				case 2319: 
					num2 = 33; 
					p.x += 0.04f * (float)((!owner.flipX) ? 1 : (-1)); 
					p.y += 0.08f; 
					break; 
				case 2320: 
					num2 = 7; 
					p.x += 0.08f * (float)((!owner.flipX) ? 1 : (-1)); 
					p.y += 0.2f; 
					break; 
				} 
			} 
		}
		p.y += pref.y;
		if (drawShadow && shadow != 1 && SubPassData.Current.shadow && (!flag2 || owner.IsPC)) 
		if (drawShadow && num2 != 1 && SubPassData.Current.shadow && (!flag2 || owner.IsPC)) 
		{
			bool flag3 = ((!isChara) ? (owner.dir % 2 == 1) : (owner.dir == 1 || owner.dir == 2));
			EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + (flag3 ? (-1f) : 1f) * renderData.offsetShadow.x, position.y + renderData.offsetShadow.y + (owner.TileType.UseMountHeight ? 0f : p.shadowFix) - RenderObject.altitudeFix * (float)owner.altitude, position.z + renderData.offsetShadow.z, ShadowData.Instance.items[shadow], pref, prefIndex, p.snow); 
			EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + (flag3 ? (-1f) : 1f) * renderData.offsetShadow.x, position.y + renderData.offsetShadow.y + (owner.TileType.UseMountHeight ? 0f : p.shadowFix) - RenderObject.altitudeFix * (float)owner.altitude, position.z + renderData.offsetShadow.z, ShadowData.Instance.items[num2], pref, prefIndex, p.snow); 
		}
		if (usePass)
		{

@@ -314,9 +330,9 @@ public override void Draw(RenderParam p, ref Vector3 v, bool drawShadow)

cs
	{
		RenderObject.tempV = position;
		RenderObject.tempV.y += data.offset.y + data.size.y;
		for (int num2 = listTC.Count - 1; num2 >= 0; num2--) 
		for (int num3 = listTC.Count - 1; num3 >= 0; num3--) 
		{
			listTC[num2].OnDraw(ref RenderObject.tempV); 
			listTC[num3].OnDraw(ref RenderObject.tempV); 
		}
	}
	if (owner.trait.RenderExtra)

ElementContainer

@@ -279,8 +279,9 @@ public void ModExp(int ele, int a, bool chain = false)

cs
	int value = (element.UsePotential ? element.Potential : 100);
	if (element.UseExpMod && a >= 0)
	{
		a = a * Mathf.Clamp(value, 10, 1000) / (100 + Mathf.Max(0, element.ValueWithoutLink) * 25); 
		if (a >= 0 && EClass.rnd(element.ValueWithoutLink + 1) < 10) 
		float num = (float)a * (float)Mathf.Clamp(value, 10, 1000) / (float)(100 + Mathf.Max(0, element.ValueWithoutLink) * 25); 
		a = (int)num; 
		if (EClass.rndf(1f) < num % 1f) 
		{
			a++;
		}

@@ -296,11 +297,11 @@ public void ModExp(int ele, int a, bool chain = false)

cs
	}
	if (element.vExp >= element.ExpToNext)
	{
		int num = element.vExp - element.ExpToNext; 
		int num2 = element.vExp - element.ExpToNext; 
		int vBase = element.vBase;
		ModBase(ele, 1);
		OnLevelUp(element, vBase);
		element.vExp = Mathf.Clamp(num / 2, 0, element.ExpToNext / 2); 
		element.vExp = Mathf.Clamp(num2 / 2, 0, element.ExpToNext / 2); 
		if (element.vTempPotential > 0)
		{
			element.vTempPotential -= element.vTempPotential / 4 + EClass.rnd(5) + 5;

GoalCombat

@@ -453,17 +453,16 @@ public virtual bool TryUseAbility(int dist, bool beforeMove = false)

cs
	bool flag4 = owner.HasCondition<ConDim>();
	foreach (ItemAbility ability in abilities)
	{
		if (EClass.rnd(100) >= ability.chance) 
		Act act = ability.act; 
		ability.priority = 0; 
		ability.tg = null; 
		ability.pt = false; 
		if (EClass.rnd(100) >= ability.chance || (isBlind && ability.act.HasTag("reqSight"))) 
		{
			ability.priority = 0; 
			continue;
		}
		Act act = ability.act; 
		int num = 0;
		SourceElement.Row s = act.source;
		ability.priority = 0; 
		ability.tg = null; 
		ability.pt = false; 
		if (s.abilityType.Length == 0 || (owner.IsPC && flag2 && act is Spell) || (beforeMove && !act.HasTag("before_move")))
		{
			continue;

HitSummary

@@ -55,22 +55,29 @@ public bool CanExecute()

cs
	{
		return true;
	}
	if (recipe != null && !recipe.UseStock) 
	if (recipe != null) 
	{
		foreach (Recipe.Ingredient ingredient in recipe.ingredients) 
		if (!recipe.UseStock) 
		{
			if (!ingredient.optional) 
			foreach (Recipe.Ingredient ingredient in recipe.ingredients) 
			{
				if (ingredient.thing == null) 
				if (!ingredient.optional) 
				{
					return false; 
				} 
				if (ingredient.thing.Num < ingredient.req * countValid) 
				{ 
					return false; 
					if (ingredient.thing == null) 
					{ 
						return false; 
					} 
					if (ingredient.thing.Num < ingredient.req * countValid) 
					{ 
						return false; 
					} 
				}
			}
		}
		else if (recipe.ingredients[0].thing == null || recipe.ingredients[0].thing.Num < countValid) 
		{ 
			return false; 
		} 
	}
	return true;
}

LayerFeedback

@@ -221,7 +221,7 @@ public void CollectFiles()

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

RecipeManager

@@ -231,6 +231,23 @@ public void ComeUpWithRandomRecipe(string idCat = null, int lvBonus = 0)

cs
		}
	}

	public bool CanCeomUpWithRecipe(string idRecipe) 
	{ 
		if (idRecipe.IsEmpty()) 
		{ 
			return false; 
		} 
		RecipeSource recipeSource = Get(idRecipe); 
		if (recipeSource == null || EClass.player.recipes.knownRecipes.ContainsKey(idRecipe) || (!recipeSource.NeedFactory && !recipeSource.IsQuickCraft)) 
		{ 
			return false; 
		} 
		int id = recipeSource.GetReqSkill().id; 
		_ = EClass.pc.Evalue(id) + 5; 
		_ = recipeSource.row.LV; 
		return false; 
	} 

	public void ComeUpWithRecipe(string idRecipe, int chanceForRandomRecipe = 0)
	{
		if (idRecipe.IsEmpty())

TCExtra

@@ -81,7 +81,7 @@ public override void OnDraw(ref Vector3 pos)

cs
		flag4 = !flag4;
	}
	bool flag5 = useOffsetBack && data.useOffsetBack && flag;
	if (base.owner.renderer.hasActor) 
	if (base.owner.renderer.hasActor && base.owner.isChara) 
	{
		v.x = base.owner.renderer.position.x + (flag5 ? data.offsetBack.x : data.offset.x);
		v.y = base.owner.renderer.position.y + (flag5 ? data.offsetBack.y : data.offset.y);

TaskBuild

@@ -77,9 +77,24 @@ public bool CanRotateBlock()

cs
	{
		disableRotateBlock = false;
	}
	if (useHeld && EClass.pc.held != null && EClass.pc.held.trait is TraitBlock && pos.HasBlock && !EClass.pc.held.trait.IsDoor && !disableRotateBlock) 
	if (useHeld && EClass.pc.held != null) 
	{
		return true; 
		if (EClass._zone.IsRegion) 
		{ 
			return false; 
		} 
		if (!(EClass._zone is Zone_Tent) && !EClass._zone.IsPCFaction && EClass.pc.held.trait.CanBeOnlyBuiltInHome) 
		{ 
			return false; 
		} 
		if (EClass._zone.RestrictBuild && !EClass.pc.held.trait.CanBuildInTown) 
		{ 
			return false; 
		} 
		if (EClass.pc.held.trait is TraitBlock && pos.HasBlock && !EClass.pc.held.trait.IsDoor && !disableRotateBlock) 
		{ 
			return true; 
		} 
	}
	return false;
}

TaskHarvest

@@ -77,19 +77,25 @@ public override bool CanManualCancel()

cs

	public override string GetBaseText(string str)
	{
		if (!IsReapSeed) 
		if (IsReapSeed) 
		{
			if (mode != HarvestType.Disassemble) 
			return "TaskHarvestSeed".lang(); 
		} 
		if (mode == HarvestType.Disassemble) 
		{ 
			string text = (HaveHarvestThing() ? "TaskDisassemble" : "TaskDisassemble_destroy").lang(); 
			string idRecipe = (IsObj ? pos.sourceObj.RecipeID : ((target != null) ? target.source.RecipeID : "")); 
			if (EClass.debug.enable && EClass.player.recipes.CanCeomUpWithRecipe(idRecipe)) 
			{
				if (!base.IsHarvest) 
				{ 
					return base.GetBaseText(str); 
				} 
				return "actHarvest".lang(); 
				text = text + " " + "TaskDisassemble_newrecipe".lang(); 
			}
			return (HaveHarvestThing() ? "TaskDisassemble" : "TaskDisassemble_destroy").lang(); 
			return text; 
		}
		return "TaskHarvestSeed".lang(); 
		if (!base.IsHarvest) 
		{ 
			return base.GetBaseText(str); 
		} 
		return "actHarvest".lang(); 
	}

	public override string GetTextSmall(Card c)

@@ -452,22 +458,27 @@ public override void OnCreateProgress(Progress_Custom p)

cs
		};
	}

	public bool HaveHarvestThing() 
	public string GetIdDismantled() 
	{
		string text = target.source.components[0].Split('|')[0].Split('/')[0]; 
		string result = target.source.components[0].Split('|')[0].Split('/')[0]; 
		if (target.IsEquipmentOrRanged || target.IsAmmo)
		{
			text = target.material.thing; 
			result = target.material.thing; 
		}
		return result; 
	} 

	public bool ShouldGenerateDismantled(string dest) 
	{ 
		if (target.trait is TraitGrave)
		{
			return false;
		}
		if (text.Contains("$") || text.Contains("#") || text.Contains("@") || text.Contains("-")) 
		if (dest.Contains("$") || dest.Contains("#") || dest.Contains("@") || dest.Contains("-")) 
		{
			return false;
		}
		if (text == target.id || !EClass.sources.cards.map.ContainsKey(text)) 
		if (dest == target.id || !EClass.sources.cards.map.ContainsKey(dest)) 
		{
			return false;
		}

@@ -478,13 +489,15 @@ public bool HaveHarvestThing()

cs
		return true;
	}

	public bool HaveHarvestThing() 
	{ 
		string idDismantled = GetIdDismantled(); 
		return ShouldGenerateDismantled(idDismantled); 
	} 

	public void HarvestThing()
	{
		string text = target.source.components[0].Split('|')[0].Split('/')[0]; 
		if (target.IsEquipmentOrRanged || target.IsAmmo) 
		{ 
			text = target.material.thing; 
		} 
		string text = GetIdDismantled(); 
		float num = target.Num;
		float num2 = 1.0999999f;
		if (text == "log" || text == "rock")

@@ -514,7 +527,7 @@ public void HarvestThing()

cs
	int decay = target.decay;
	int lV = target.LV;
	target.Die(null, EClass.pc);
	if (target.trait is TraitGrave || text.Contains("$") || text.Contains("#") || text.Contains("@") || text.Contains("-") || text == target.id || !EClass.sources.cards.map.ContainsKey(text) || (int)num <= 0 || target.source.components.IsEmpty()) 
	if ((int)num <= 0 || !ShouldGenerateDismantled(text)) 
	{
		return;
	}

TraitDrinkMilkMother

@@ -69,6 +69,10 @@ public override void OnDrink(Chara c)

cs
		{
			c.Say("grow_baby", c);
			c.PlaySound("ding_potential");
			if (c.id == "putty_snow" && c.idSkin >= 4) 
			{ 
				c.idSkin = 0; 
			} 
		}
		c.PlayEffect("buff");
		EClass.pc.ModExp(237, 100);

TraitFoodEggFertilized

@@ -27,6 +27,10 @@ public static Chara Incubate(Thing egg, Point pos, Card incubator = null)

cs
	chara.SetMainElement(egg.c_idMainElement, 10, elemental: true);
	chara.SetFeat(1232, (incubator != null) ? 3 : 2, msg: true);
	chara.things.DestroyAll();
	if (chara.id == "putty_snow" && chara.idSkin == 0) 
	{ 
		chara.idSkin = 4 + EClass.rnd(2); 
	} 
	if (chara.Evalue(1644) > 0)
	{
		for (int i = 0; i < chara.Evalue(1644); i++)

UI

@@ -744,7 +744,7 @@ public void ToggleFeedback()

cs
	{
		userName = array[2];
	}
	LayerFeedback.header = (flag ? "" : "(!)"); 
	LayerFeedback.header = (flag ? "" : "(!?)"); 
	LayerFeedback.userName = userName;
	LayerFeedback.playedHours = ELayer.config.maxPlayedHours;
	LayerFeedback.backerId = backerId;

Zone

@@ -778,10 +778,13 @@ public void Activate()

cs
		{
			map.AddCardOnActivate(thing5);
		}
		foreach (Chara serializedChara2 in map.serializedCharas) 
		foreach (Chara c3 in map.serializedCharas) 
		{
			map.charas.Add(serializedChara2); 
			map.AddCardOnActivate(serializedChara2); 
			if (c3.c_uidMaster == 0 || EClass.player.listSummon.Find((Chara c2) => c2.uid == c3.uid) == null) 
			{ 
				map.charas.Add(c3); 
				map.AddCardOnActivate(c3); 
			} 
		}
		map.serializedCharas.Clear();
		if (isImported && IsTown)