Skip to content

EA 23.47 Nightly

December 3, 2024

18 files modified.

Important Changes

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

AM_Adv (1)

cs
public void SetAction(Func<bool> _action = null, bool _canTurbo = true, bool _willEndTurn = true, bool _waitForTurn = true) 
public void SetAction(Func<bool> _action = null, bool _canTurbo = true, bool _willEndTurn = true, bool _waitForTurn = true, bool _canRepeat = false) 

AI_PlayMusic

@@ -505,11 +505,11 @@ public void ThrowReward(Chara c, bool punish)

cs
	owner.Pick(thing);
	if (thing.id == "money" && !owner.IsPCParty)
	{
		if (thing.GetRootCard() != owner) 
		if (thing.GetRootCard() != owner && !thing.isDestroyed) 
		{
			thing.Destroy();
		}
		else if (owner.GetCurrency() >= (owner.Evalue(241) * 10 + 100) / ((owner.IsPCFaction && owner.memberType == FactionMemberType.Default) ? 1 : 10)) 
		if (owner.GetCurrency() >= (owner.Evalue(241) * 10 + 100) / ((owner.IsPCFaction && owner.memberType == FactionMemberType.Default) ? 1 : 10)) 
		{
			owner.c_allowance += num;
			owner.ModCurrency(-num);

AM_Adv

@@ -52,7 +52,7 @@ public void Init(ButtonState _button = null)

cs
			axis = Vector2.zero;
		}

		public void SetAction(Func<bool> _action = null, bool _canTurbo = true, bool _willEndTurn = true, bool _waitForTurn = true) 
		public void SetAction(Func<bool> _action = null, bool _canTurbo = true, bool _willEndTurn = true, bool _waitForTurn = true, bool _canRepeat = false) 
		{
			plan = null;
			action = _action;

@@ -60,7 +60,7 @@ public void SetAction(Func<bool> _action = null, bool _canTurbo = true, bool _wi

cs
		willEndTurn = _willEndTurn;
		waitForTurn = _waitForTurn;
		hideRightInfo = false;
		repeat = false; 
		repeat = _canRepeat; 
		ignoreCount = false;
		act = null;
	}

@@ -457,7 +457,7 @@ public void OnBecomeNoGoal()

cs
	}
	if (EClass.rnd(30) == 0 && EClass.pc.HasElement(1559))
	{
		List<Thing> list = EClass.pc.things.List((Thing a) => a.trait is TraitPotion); 
		List<Thing> list = EClass.pc.things.List((Thing a) => a.trait is TraitPotion, onlyAccessible: true); 
		if (list.Count > 0)
		{
			EClass.pc.Drink(list.RandomItem());

@@ -1125,7 +1125,7 @@ public void AxisMove()

cs
		else
		{
			pressedAction.axis = EInput.axis;
			pressedAction.SetAction(planKeyboard.GetAction(), _canTurbo: true, planKeyboard.WillEndTurn); 
			pressedAction.SetAction(planKeyboard.GetAction(), _canTurbo: true, planKeyboard.WillEndTurn, _waitForTurn: true, planKeyboard.canRepeat); 
		}
		return;
	}

Card

@@ -4901,7 +4901,7 @@ public virtual void OnLand()

cs

	public int ResistLvFrom(int ele)
	{
		return ResistLv(EClass.sources.elements.alias[EClass.sources.elements.map[ele].aliasRef].id); 
		return ResistLv(EClass.sources.elements.alias.TryGetValue(EClass.sources.elements.map[ele].aliasRef)?.id ?? 0); 
	}

	public int ResistLv(int res)

Chara

@@ -3307,7 +3307,7 @@ public void TickConditions()

cs
					AddCondition<ConBlind>(200);
				}
			}
			if (turn % (2000 * (100 + Evalue(412) * 2) / (100 + Evalue(409) * 10)) == 0) 
			if (turn % (2000 * (100 + Evalue(412) * 2) / Mathf.Max(100 + Evalue(409) * 10, 100)) == 0) 
			{
				ModCorruption(1);
			}

ContentCodex

@@ -136,7 +136,7 @@ public void RefreshInfo()

cs

	public void OnClickAddCards()
	{
		List<Thing> list = EClass.pc.things.List((Thing c) => c.id == "figure3"); 
		List<Thing> list = EClass.pc.things.List((Thing c) => c.id == "figure3", onlyAccessible: true); 
		int num = 0;
		if (list.Count > 0)
		{

HomeResourceWorth

@@ -61,7 +61,7 @@ public List<Thing> ListHeirloom()

cs
	List<Thing> list2 = new List<Thing>();
	HashSet<string> hashSet = new HashSet<string>();
	int[] array = new int[EClass._map.SizeXZ];
	int num = 0; 
	long num = 0L; 
	int num2 = branch.Evalue(2814);
	int num3 = branch.Evalue(2823);
	foreach (Thing thing in EClass._map.things)

@@ -117,7 +117,7 @@ public List<Thing> ListHeirloom()

cs
		}
	}
	int num7 = branch.Evalue(3780) + branch.Evalue(3781) + branch.Evalue(3782) + branch.Evalue(3783) + branch.Evalue(3784);
	branch.tourism = (100 + num) * (100 + num7 * 15) / 100; 
	branch.tourism = (int)((100 + num) * (100 + num7 * 15) / 100); 
	list2.Sort((Thing a, Thing b) => GetPrice(b) - GetPrice(a));
	for (int i = 0; i < branch.NumHeirloom && i < list2.Count; i++)
	{

LayerMod

@@ -63,7 +63,7 @@ public override void OnInit()

cs
			{
				Refresh();
				UIContextMenu uIContextMenu = ELayer.ui.CreateContextMenuInteraction();
				if (ELayer.debug.enable || (!BaseCore.IsOffline && a.isInPackages && !a.builtin)) 
				if (ELayer.debug.enable || (!BaseCore.IsOffline && a.isInPackages && !a.builtin && !ELayer.core.version.demo)) 
				{
					uIContextMenu.AddButton("mod_publish", delegate
					{

Net

@@ -305,6 +305,10 @@ public static async UniTask<List<VoteLog>> GetVote(string idLang)

cs

	public static async UniTask<bool> SendChat(string name, string msg, ChatCategory cat, string idLang)
	{
		if (EClass.core.version.demo) 
		{ 
			return false; 
		} 
		try
		{
			Debug.Log("Start Sending Text:");

QuestDeliver

@@ -120,7 +120,7 @@ public virtual bool IsDestThing(Thing t)

cs

	public List<Thing> ListDestThing(bool onlyFirst = false)
	{
		List<Thing> list = EClass.pc.things.List((Thing t) => IsDestThing(t)); 
		List<Thing> list = EClass.pc.things.List((Thing t) => IsDestThing(t), onlyAccessible: true); 
		if (onlyFirst && list.Count > 0)
		{
			return list;

SerializedCards

@@ -469,11 +469,14 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
	List<Thing> things = map.things;
	List<Chara> serializedCharas = map.serializedCharas;
	bool isUserZone = EClass._zone.IsUserZone;
	Dictionary<int, int> dictionary = new Dictionary<int, int>(); 
	Dictionary<int, int> dictionary2 = new Dictionary<int, int>(); 
	importedCards.Clear();
	foreach (Data card3 in cards) 
	foreach (Data card4 in cards) 
	{
		int num = card3.dir; 
		Point point = new Point(card3.x, card3.z); 
		int num = card4.dir; 
		Point point = new Point(card4.x, card4.z); 
		int index = point.index; 
		if (partial != null)
		{
			if (partial.result.ruined.Contains(point.index))

@@ -513,17 +516,17 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
			if (!partial.editMode)
			{
				Card card = null;
				string id = card3.id; 
				string id = card4.id; 
				if (!(id == "sign_spawnThing"))
				{
					if (id == "sign_spawnChara")
					{
						card = CharaGen.CreateFromFilter(card3.idRefCard.IsEmpty(EClass._zone.biome.spawn.GetRandomCharaId()), EClass._zone.DangerLv); 
						card = CharaGen.CreateFromFilter(card4.idRefCard.IsEmpty(EClass._zone.biome.spawn.GetRandomCharaId()), EClass._zone.DangerLv); 
					}
				}
				else
				{
					card = ThingGen.CreateFromFilter(card3.idRefCard.IsEmpty(EClass._zone.biome.spawn.GetRandomThingId()), EClass._zone.DangerLv); 
					card = ThingGen.CreateFromFilter(card4.idRefCard.IsEmpty(EClass._zone.biome.spawn.GetRandomThingId()), EClass._zone.DangerLv); 
				}
				if (card != null)
				{

@@ -537,15 +540,15 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
				}
			}
		}
		card3._bits1.SetInt(card3.ints[0]); 
		string text = card3.id; 
		if (card3.idV != 0) 
		card4._bits1.SetInt(card4.ints[0]); 
		string text = card4.id; 
		if (card4.idV != 0) 
		{
			text = card3.idV.ToString() ?? ""; 
			text = card4.idV.ToString() ?? ""; 
		}
		if (addToZone && partial != null && !partial.editMode)
		{
			string id = card3.id; 
			string id = card4.id; 
			if (!(id == "editor_torch"))
			{
				if (id == "editor_torch_wall")

@@ -601,17 +604,21 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
					continue;
				}
			}
			if (isUserZone && dictionary.TryGetValue(index, 0) >= 3) 
			{ 
				continue; 
			} 
			card2 = CharaGen.Create(text);
			if (card3.ints.Length > 20) 
			if (card4.ints.Length > 20) 
			{
				card2.Chara.SetLv(card3.lv); 
				if (card3.element != 0) 
				card2.Chara.SetLv(card4.lv); 
				if (card4.element != 0) 
				{
					card2.Chara.SetMainElement(card3.element); 
					card2.Chara.SetMainElement(card4.element); 
				}
			}
			card2.Chara.orgPos = point.Copy();
			if (card3.isDead) 
			if (card4.isDead) 
			{
				card2.hp = -1;
				card2.Chara.isDead = true;

@@ -621,11 +628,15 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
			{
				serializedCharas.Add(card2.Chara);
			}
			if (isUserZone) 
			{ 
				dictionary[index] = dictionary.TryGetValue(index, 0) + 1; 
			} 
		}
		else
		{
			PlaceState placeState = card3.placeState.ToEnum<PlaceState>(); 
			if (isUserZone && ((placeState != PlaceState.installed && !card3.bits1.IsOn(13)) || text == "medal")) 
			PlaceState placeState = card4.placeState.ToEnum<PlaceState>(); 
			if (isUserZone && ((dictionary2.TryGetValue(index, 0) >= 20 && text != "waystone" && text != "core_zone") || (placeState != PlaceState.installed && !card4.bits1.IsOn(13)) || text == "medal")) 
			{
				continue;
			}

@@ -634,14 +645,18 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
				text = SpawnListThing.Get("origin_" + text, (SourceThing.Row a) => a.origin == source).GetFirst().id;
			}
			card2 = ThingGen.Create(text, -1, EClass._zone.DangerLv);
			card2.ChangeMaterial((card3.idMat == -1) ? card2.DefaultMaterial.id : card3.idMat); 
			card2.ChangeMaterial((card4.idMat == -1) ? card2.DefaultMaterial.id : card4.idMat); 
			if (!addToZone)
			{
				things.Add(card2.Thing);
			}
			card2.altitude = card3.altitude; 
			card2.altitude = card4.altitude; 
			card2.placeState = placeState;
			card2.c_lightColor = card3.lightColor; 
			card2.c_lightColor = card4.lightColor; 
			if (isUserZone) 
			{ 
				dictionary2[index] = dictionary2.TryGetValue(index, 0) + 1; 
			} 
		}
		if (num < 0)
		{

@@ -649,62 +664,64 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
		}
		card2.pos = point;
		card2.dir = num;
		card2._bits1.SetInt(card3.bits1); 
		card2._bits2.SetInt(card3.bits2); 
		card2._bits1.SetInt(card4.bits1); 
		card2._bits2.SetInt(card4.bits2); 
		card2.isPlayerCreation = true;
		card2.autoRefuel = true;
		card2.c_editorTraitVal = card3.traitVals; 
		card2.c_idRefCard = card3.idRefCard; 
		card2.c_editorTraitVal = card4.traitVals; 
		card2.c_idRefCard = card4.idRefCard; 
		card2.isImported = true;
		card2.refVal = card3.refVal; 
		card2.idSkin = card3.idSkin; 
		card2.c_idDeity = card3.idDeity; 
		if (isUserZone) 
		card2.refVal = card4.refVal; 
		card2.idSkin = card4.idSkin; 
		card2.c_idDeity = card4.idDeity; 
		if (isUserZone && (card2.isHidden || card2.isMasked) && ((card2.TileType.IsBlockPass && card2.IsInstalled) || card2.trait is TraitCoreZone || card2.trait is TraitWaystone)) 
		{
			_ = card2.isRoofItem; 
			Card card3 = card2; 
			bool isHidden = (card2.isMasked = false); 
			card3.isHidden = isHidden; 
		}
		if (card3.idBacker != 0) 
		if (card4.idBacker != 0) 
		{
			Debug.Log(card3.idBacker); 
			card2.c_idBacker = card3.idBacker; 
			Debug.Log(card4.idBacker); 
			card2.c_idBacker = card4.idBacker; 
		}
		if (version >= 2 && card3.idDyeMat != -1) 
		if (version >= 2 && card4.idDyeMat != -1) 
		{
			card2.Dye(EClass.sources.materials.rows[card3.idDyeMat]); 
			card2.Dye(EClass.sources.materials.rows[card4.idDyeMat]); 
		}
		card2.mapObj = card3.obj; 
		card2.mapObj = card4.obj; 
		if (card2.mapObj?.TryGetValue(2) != null)
		{
			card2.mapObj.Remove(2);
		}
		if (card3.cstr != null) 
		if (card4.cstr != null) 
		{
			foreach (KeyValuePair<int, string> item2 in card3.cstr) 
			foreach (KeyValuePair<int, string> item2 in card4.cstr) 
			{
				card2.SetStr(item2.Key, item2.Value);
			}
		}
		if (card2.freePos)
		{
			card2.fx = (float)card3.fx * 0.001f; 
			card2.fy = (float)card3.fy * 0.001f; 
			card2.fx = (float)card4.fx * 0.001f; 
			card2.fy = (float)card4.fy * 0.001f; 
		}
		if (!card3.idEditor.IsEmpty()) 
		if (!card4.idEditor.IsEmpty()) 
		{
			card2.c_idEditor = card3.idEditor; 
			card2.c_idEditor = card4.idEditor; 
		}
		if (!card3.idTrait.IsEmpty()) 
		if (!card4.idTrait.IsEmpty()) 
		{
			card2.c_idTrait = card3.idTrait; 
			card2.c_idTrait = card4.idTrait; 
			card2.ApplyTrait();
			card2.trait.OnCreate(EClass._zone.lv);
		}
		if (!card3.tags.IsEmpty()) 
		if (!card4.tags.IsEmpty()) 
		{
			card2.c_editorTags = card3.tags; 
			card2.c_editorTags = card4.tags; 
			try
			{
				string[] array = card3.tags.Split(','); 
				string[] array = card4.tags.Split(','); 
				foreach (string value in array)
				{
					card2.ApplyEditorTags(value.ToEnum<EditorTag>());

@@ -712,13 +729,13 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
			}
			catch
			{
				Debug.LogWarning("Could not convert editor tag:" + card2.Name + "/" + card3.tags); 
				Debug.LogWarning("Could not convert editor tag:" + card2.Name + "/" + card4.tags); 
			}
		}
		if (card2.isChara)
		{
			card2.Chara.homeZone = EClass._zone;
			card2.Chara.uidEditor = card3.uidEditor; 
			card2.Chara.uidEditor = card4.uidEditor; 
			if (card2.isBackerContent)
			{
				card2.ApplyBacker(card2.c_idBacker);

TraitCoreZone

@@ -71,7 +71,7 @@ public override void TrySetAct(ActPlan p)

cs
			return false;
		}, owner);
	}
	if (Application.isEditor || (EClass.Branch.resources.worth.bestRank > 0 && EClass.Branch.resources.worth.bestRank <= 100 && !EClass._zone.name.IsEmpty())) 
	if (Application.isEditor || (EClass.Branch.resources.worth.bestRank > 0 && EClass.Branch.resources.worth.bestRank <= 100 && !EClass._zone.name.IsEmpty() && !EClass.core.version.demo)) 
	{
		p.TrySetAct("actUploadMap", delegate
		{

TraitMoongate

@@ -20,6 +20,11 @@ public override bool CanUse(Chara c)

cs

	public override bool OnUse(Chara c)
	{
		if (EClass.core.version.demo) 
		{ 
			Msg.SayNothingHappen(); 
			return false; 
		} 
		LayerProgress.StartAsync("Loading", UseMoongate());
		return false;
	}

TraitMoongateEx

@@ -6,6 +6,11 @@ public class TraitMoongateEx : TraitMoongate

cs
{
	public override bool OnUse(Chara c)
	{
		if (EClass.core.version.demo) 
		{ 
			Msg.SayNothingHappen(); 
			return false; 
		} 
		List<MapMetaData> list = new List<MapMetaData>();
		foreach (FileInfo item in new DirectoryInfo(CorePath.ZoneSaveUser).GetFiles().Concat(MOD.listMaps))
		{

TraitPainter

@@ -24,7 +24,7 @@ public override bool OnUse(Chara c)

cs

	public TraitCanvas GetCanvas()
	{
		List<Thing> list = EClass.pc.things.List((Thing t) => t.trait is TraitCanvas && (t.trait as TraitCanvas).CanvasType == PaintType && t.c_textureData == null); 
		List<Thing> list = EClass.pc.things.List((Thing t) => t.trait is TraitCanvas && (t.trait as TraitCanvas).CanvasType == PaintType && t.c_textureData == null, onlyAccessible: true); 
		if (list.Count <= 0)
		{
			return null;

UI

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

cs
		Msg.Say("bug_hal");
		return;
	}
	if (!Application.isEditor && (ELayer.debug.enable || (ELayer.core.IsGameStarted && ELayer.player.flags.debugEnabled))) 
	if (!Application.isEditor && (ELayer.debug.enable || ELayer.core.version.demo || (ELayer.core.IsGameStarted && ELayer.player.flags.debugEnabled))) 
	{
		Dialog.Ok("dialog_debugFeedback");
		return;

UIMapPreview

@@ -46,6 +46,10 @@ public void Start()

cs

	public Color colorStairs;

	public Color colorVoid; 

	public Color colorVoidWorld; 

	public Material matMap;

	public RawImage image;

@@ -271,6 +275,10 @@ public void _RefreshPoint(int x, int z, bool apply = true)

cs
			row = MATERIAL.sourceSnow;
		}
		Color color = (cell.IsSky ? colorSky : row.GetColor());
		if (row.id == 0 && EMono._zone.IsRegion) 
		{ 
			color = colorVoidWorld; 
		} 
		if (color.r > maxColor)
		{
			color.r = maxColor;

ZonePreEnterEncounter

@@ -41,7 +41,7 @@ public override void Execute()

cs
					return false;
				}
				return t.trait.CanBeDestroyed && t.things.Count == 0 && t.invY != 1 && t.trait.CanBeStolen && !t.trait.CanOnlyCarry && !t.IsUnique && !t.isEquipped;
			}); 
			}, onlyAccessible: true); 
			Thing t2 = ((list2.Count > 0) ? list2.RandomItem() : null);
			if (t2 == null)
			{