Skip to content

EA 23.81

January 24, 2025

14 files modified.

Important Changes

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

ELEMENT (1)

cs
public void AddText(string text) 
public void AddText(string text, FontColor col = FontColor.Warning) 

AI_UseCrafter

@@ -310,7 +310,7 @@ bool IsIngValid(Thing t, int i)

cs
			return false;
		}
		Card rootCard = t.GetRootCard();
		if (rootCard != null && rootCard.isChara && !rootCard.IsPC) 
		if (rootCard != null && rootCard.isChara && !rootCard.IsPCFaction) 
		{
			return false;
		}

ActMelee

@@ -216,7 +216,6 @@ void Attack(Card _tc, Point _tp, float mtp, bool subAttack)

cs
		{
			Act.TC = _tc;
			Act.TP = _tp;
			Debug.Log(w.Name + "/" + chaser + "/" + Act.TC.Name); 
			AttackProcess.Current.Prepare(Act.CC, w, Act.TC, Act.TP, count);
			int num6 = 1;
			if (chaser > 0)

ActPray

@@ -66,7 +66,7 @@ public static bool TryPray(Chara c, bool passive = false)

cs
		}
		else
		{
			Pray(c, passive && EClass._zone.IsRegion); 
			Pray(c, passive); 
		}
	}
	return true;

ActRanged

@@ -102,7 +102,10 @@ public override bool Perform()

cs
	bool hasHit = false;
	int numFire = effectData.num;
	int numFireWithoutDamageLoss = numFire;
	int num = weapon.Evalue(602); 
	int num = GetWeaponEnc(602); 
	int drill = GetWeaponEnc(606); 
	int scatter = GetWeaponEnc(607); 
	int chaser = GetWeaponEnc(620); 
	if (num > 0)
	{
		numFire += num / 10 + ((num % 10 > EClass.rnd(10)) ? 1 : 0);

@@ -110,8 +113,6 @@ public override bool Perform()

cs
	numFire += Act.CC.Evalue(1652);
	int num2 = numFire;
	int num3 = 1 + weapon.material.hardness / 30 + EClass.rnd(3);
	int drill = weapon.Evalue(606); 
	int scatter = weapon.Evalue(607); 
	int num4 = weapon.Evalue(604);
	if (num4 > 0)
	{

@@ -254,6 +255,10 @@ public override bool Perform()

cs
		}
	}
	return true;
	int GetWeaponEnc(int ele) 
	{ 
		return weapon.Evalue(ele) + EClass.pc.faction.charaElements.Value(ele); 
	} 
	void Shoot(Card _tc, Point _tp)
	{
		float dmgMulti = 1f;

@@ -295,11 +300,31 @@ void Shoot(Card _tc, Point _tp)

cs
			{
				dmgMulti = Mathf.Clamp(1.2f - 0.2f * (float)Act.CC.Dist(Act.TP) - (Act.TP.Equals(orgTP) ? 0f : 0.4f), 0.2f, 1f);
			}
			for (int j = 0; j < numFire; j++) 
			int num5 = 1; 
			bool flag3 = false; 
			if (chaser > 0) 
			{ 
				for (int j = 0; j < 10; j++) 
				{ 
					if (chaser > EClass.rnd(4 + (int)Mathf.Pow(4f, j + 2))) 
					{ 
						num5++; 
					} 
				} 
			} 
			for (int k = 0; k < numFire + num5; k++) 
			{
				if (AttackProcess.Current.Perform(j, hasHit, dmgMulti)) 
				if (k >= numFire) 
				{ 
					if (flag3) 
					{ 
						break; 
					} 
					Act.CC.Say("attack_chaser"); 
				} 
				if (AttackProcess.Current.Perform(k, hasHit, dmgMulti)) 
				{
					hasHit = true; 
					flag3 = (hasHit = true); 
				}
				if (Act.TC == null || !Act.TC.IsAliveInCurrentZone)
				{

AttackProcess

@@ -158,7 +158,7 @@ public void Prepare(Chara _CC, Thing _weapon, Card _TC = null, Point _TP = null,

cs
		attackType = AttackType.Blunt;
		dBonus = CC.DMG + (CC.IsPCParty ? 3 : 7);
		dNum = 2;
		dDim = (((!CC.IsPCParty) ? CC.LV : 0) + CC.STR + CC.Evalue(108)) * num2 * num3 / 10000 / 2; 
		dDim = (((!CC.IsPCParty) ? CC.LV : 0) + CC.STR + CC.Evalue(108)) * num2 / 100 * num3 / 100 / 2; 
		dMulti = 1f;
		toHitBase = EClass.curve(CC.DEX / 4 + CC.STR / 2 + weaponSkill.Value, 50, 25) + (CC.IsPCFaction ? 75 : 250);
		toHitFix = CC.HIT + weapon.HIT;

BaseListPeople

@@ -122,27 +122,11 @@ public override void OnInstantiate(Chara a, ItemGeneral b)

cs

	public void AddSubButtonWork(ItemGeneral b, Chara a)
	{
		BaseArea roomWork = null; 
		BaseArea roomWork = a.GetRoomWork(); 
		bool flag = true;
		foreach (Hobby item in a.ListWorks()) 
		{ 
			AIWork aI = item.GetAI(a); 
			if (aI.SetDestination()) 
			{ 
				if (aI.destArea != null) 
				{ 
					roomWork = aI.destArea; 
				} 
				else if (aI.destThing != null) 
				{ 
					roomWork = aI.destThing.pos.cell.room; 
				} 
				break; 
			} 
		} 
		foreach (Hobby item2 in a.ListWorks().Concat(a.ListHobbies())) 
		foreach (Hobby item in a.ListWorks().Concat(a.ListHobbies())) 
		{
			if (item2.GetEfficiency(a) <= 0) 
			if (item.GetEfficiency(a) <= 0) 
			{
				flag = false;
				break;

Card

@@ -1900,7 +1900,7 @@ public int ChildrenWeight

cs

	public SourceCategory.Row category => _category ?? (_category = EClass.sources.categories.map[sourceCard.category]);

	public SourceMaterial.Row material => _material ?? (_material = EClass.sources.materials.map[idMaterial]); 
	public SourceMaterial.Row material => _material ?? (_material = EClass.sources.materials.map.TryGetValue(idMaterial, 3)); 

	public virtual string AliasMaterialOnCreate => DefaultMaterial.alias;

Chara

@@ -1331,20 +1331,24 @@ public override void OnCreate(int genLv)

cs
	}
	if (source.mainElement.Length != 0)
	{
		int maxEleLv = Mathf.Min(genLv, 100); 
		int _genLv = Mathf.Min(genLv, 100); 
		if (EClass._zone != null && EClass._zone.ScaleMonsterLevel) 
		{ 
			_genLv = ((genLv - 1) % 50 + 5) * 150 / 100; 
		} 
		List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
		string[] mainElement = source.mainElement;
		for (int i = 0; i < mainElement.Length; i++)
		{
			string[] array = mainElement[i].Split('/');
			SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
			int num2 = source.LV * row.eleP / 100 + base.LV - source.LV; 
			if (list.Count == 0 || num2 < maxEleLv || array[0] == bp.idEle) 
			int num2 = source.LV * row.eleP / 100; 
			if (list.Count == 0 || num2 < _genLv || array[0] == bp.idEle) 
			{
				list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
			}
		}
		Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (maxEleLv - a.Item3) * 25)); 
		Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25)); 
		if (!bp.idEle.IsEmpty())
		{
			tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle).FirstOrDefault() ?? tuple;

@@ -4651,18 +4655,17 @@ public void ApplyDeathPenalty()

cs
		return;
	}
	int currency = GetCurrency();
	if (currency <= 0) 
	{ 
		return; 
	} 
	int num = currency / 3 + EClass.rnd(currency / 3 + 1); 
	if (num <= 0) 
	if (currency > 0) 
	{
		num = 1; 
		int num = currency / 3 + EClass.rnd(currency / 3 + 1); 
		if (num <= 0) 
		{ 
			num = 1; 
		} 
		Msg.Say("panaltyMoney", this, Lang._currency(num)); 
		ModCurrency(-num); 
		EClass._zone.AddCard(ThingGen.CreateCurrency(num), EClass.pc.pos); 
	}
	Msg.Say("panaltyMoney", this, Lang._currency(num)); 
	ModCurrency(-num); 
	EClass._zone.AddCard(ThingGen.CreateCurrency(num), EClass.pc.pos); 
	foreach (Element value in EClass.pc.elements.dict.Values)
	{
		if (EClass.rnd(5) == 0 && value.IsMainAttribute)

@@ -7322,7 +7325,7 @@ public void GiveGift(Chara c, Thing t)

cs
		Msg.Say("affinityNone", c, this);
		return;
	}
	if (t.IsCursed && t.IsEquipmentOrRanged && c.HasElement(1414)) 
	if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && c.HasElement(1414)) 
	{
		bool num = t.blessedState == BlessedState.Doomed;
		int num2 = 200 + t.LV * 3;

@@ -7922,6 +7925,28 @@ public void SetAIImmediate(AIAct g)

cs
		}
	}

	public BaseArea GetRoomWork() 
	{ 
		BaseArea result = null; 
		foreach (Hobby item in ListWorks()) 
		{ 
			AIWork aI = item.GetAI(this); 
			if (aI.SetDestination()) 
			{ 
				if (aI.destArea != null) 
				{ 
					result = aI.destArea; 
				} 
				else if (aI.destThing != null) 
				{ 
					result = aI.destThing.pos.cell.room; 
				} 
				break; 
			} 
		} 
		return result; 
	} 

	public List<Hobby> ListWorks(bool useMemberType = true)
	{
		listHobby.Clear();

ELEMENT

@@ -95,10 +95,10 @@ public void CheckFirst()

cs
			}
		}

		public void AddText(string text) 
		public void AddText(string text, FontColor col = FontColor.Warning) 
		{
			CheckFirst();
			n.AddText("_bullet".lang() + text, FontColor.Warning); 
			n.AddText("_bullet".lang() + text, col); 
		}

		public void AddText(int v, string text, string textBad = null)

@@ -187,21 +187,33 @@ public void WriteNote()

cs
		{
			c.RefreshSpeed(this);
		}
		if (id == 78 && c.IsPCFactionOrMinion) 
		{ 
			int num2 = EClass.player.CountKeyItem("lucky_coin"); 
			if (num2 > 0) 
			{ 
				AddText(EClass.sources.keyItems.alias["lucky_coin"].GetName() + " (+" + num2 * 2 + ")", FontColor.Great); 
			} 
			if (EClass.pc.faction.charaElements.Has(663)) 
			{ 
				AddFix(100, EClass.sources.elements.map[663].GetName()); 
			} 
		} 
		if (!c.race.IsMachine && !(c.id == "android"))
		{
			return;
		}
		int num2 = c.Evalue(664); 
		if (num2 > 0) 
		int num3 = c.Evalue(664); 
		if (num3 > 0) 
		{
			switch (id)
			{
			case 64:
			case 65:
				AddFix(num2 / 2, EClass.sources.elements.map[664].GetName()); 
				AddFix(num3 / 2, EClass.sources.elements.map[664].GetName()); 
				break;
			case 79:
				AddFix(num2, EClass.sources.elements.map[664].GetName()); 
				AddFix(num3, EClass.sources.elements.map[664].GetName()); 
				break;
			}
		}

InvOwnerAlly

@@ -40,12 +40,12 @@ public bool Process(ButtonGrid button)

cs
		{
			return false;
		}
		ButtonGrid buttonGrid = LayerDragGrid.Instance.buttons[0]; 
		if (buttonGrid.card != null) 
		ButtonGrid currentButton = LayerDragGrid.Instance.CurrentButton; 
		if (currentButton.card != null) 
		{
			buttonGrid.card = null; 
			currentButton.card = null; 
		}
		return new Transaction(new DragItemCard.DragInfo(button), new DragItemCard.DragInfo(buttonGrid)).Process(startTransaction: true); 
		return new Transaction(new DragItemCard.DragInfo(button), new DragItemCard.DragInfo(currentButton)).Process(startTransaction: true); 
	}

	public override string GetAutoUseLang(ButtonGrid button)

InvOwnerCraft

@@ -2,6 +2,8 @@ public class InvOwnerCraft : InvOwnerDraglet

cs
{
	public TraitCrafter crafter;

	public override bool CanTargetAlly => crafter is TraitToolTalisman; 

	public override bool ShowFuel => crafter.IsRequireFuel;

	public override string langTransfer => crafter.CrafterTitle;

ListPeopleBed

@@ -12,7 +12,10 @@ public override void OnInstantiate(Chara c, ItemGeneral i)

cs
		{
		});
		uIButton.icon.SetAlpha((c.FindBed() != null) ? 0.9f : 0.4f);
		uIButton.tooltip.enable = false; 
		uIButton.SetTooltip(delegate(UITooltip t) 
		{ 
			WriteHobbies(t, c, c.GetRoomWork()); 
		}); 
	}

	public override void OnClick(Chara c, ItemGeneral i)

TCOrbitChara

@@ -72,10 +72,6 @@ public void RefreshAll()

cs
		{
			emo = owner.trait.GetRestockedIcon();
		}
		else if (EMono.player.currentHotItem.Thing != null && EMono.player.currentHotItem.Thing.trait.GetHeldEmo(owner) != 0) 
		{ 
			emo = EMono.player.currentHotItem.Thing.trait.GetHeldEmo(owner); 
		} 
		else
		{
			bool flag = false;

@@ -122,6 +118,10 @@ public void RefreshAll()

cs
			}
		}
	}
	if (EMono.player.currentHotItem.Thing != null && EMono.player.currentHotItem.Thing.trait.GetHeldEmo(owner) != 0) 
	{ 
		emo = EMono.player.currentHotItem.Thing.trait.GetHeldEmo(owner); 
	} 
	showIcon = emo != Emo2.none;
	if (showIcon)
	{

Zone

@@ -887,6 +887,7 @@ public void Activate()

cs
		});
	}
	isStarted = true;
	Map.isDirtySunMap = true; 
	map.RefreshAllTiles();
	if (events.listPreEnter.Count > 0)
	{