Skip to content

EA 23.95 Nyaightly

February 22, 2025

14 files modified.

Important Changes

None.

AM_MoveInstalled

@@ -244,7 +244,7 @@ public override void OnProcessTiles(Point point, int dir)

cs
			ActPlan actPlan = new ActPlan
			{
				pos = point.Copy(),
				ignoreAdddCondition = true, 
				ignoreAddCondition = true, 
				input = ActInput.AllAction,
				altAction = true
			};

ActEffect

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

cs
			}
			if (id == EffectId.Gate && CC.IsPC)
			{
				foreach (Chara member in EClass.pc.party.members) 
				foreach (Chara chara2 in EClass._map.charas) 
				{
					if (!member.HasHost && member != tc) 
					if (!chara2.HasHost && chara2 != tc && (chara2.IsPCParty || chara2.IsPCPartyMinion)) 
					{
						member.Teleport(tc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? tc.pos); 
						chara2.Teleport(tc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? tc.pos); 
					}
				}
			}

ActPlan

@@ -154,7 +154,7 @@ public bool Perform(bool repeated = false)

cs

	public bool altAction;

	public bool ignoreAdddCondition; 
	public bool ignoreAddCondition; 

	private bool _canInteractNeighbor;

@@ -366,7 +366,7 @@ public bool TrySetAct(string lang, Func<bool> onPerform, CursorInfo cursor = nul

cs

	public bool TrySetAct(Act _act, Card _tc = null)
	{
		if (!ignoreAdddCondition && !_act.CanPerform(cc, _tc, pos)) 
		if (!ignoreAddCondition && !_act.CanPerform(cc, _tc, pos)) 
		{
			return false;
		}

Card

@@ -870,6 +870,18 @@ public bool isRestocking

cs
		}
	}

	public bool hasSpawned 
	{ 
		get 
		{ 
			return _bits2[8]; 
		} 
		set 
		{ 
			_bits2[8] = value; 
		} 
	} 

	public bool isBackerContent => c_idBacker != 0;

	public SourceBacker.Row sourceBacker

@@ -3962,9 +3974,9 @@ public void DamageHP(int dmg, int ele, int eleP = 100, AttackSource attackSource

cs
			}
			else
			{
				if (attackSource != AttackSource.Finish && IsPCParty && Chara.host == null && EClass.pc.ai is GoalAutoCombat) 
				if (attackSource != AttackSource.Finish && IsPCParty && Chara.host == null) 
				{
					if (!EClass.player.invlunerable && (EClass.pc.ai as GoalAutoCombat).listHealthy.Contains(Chara)) 
					if (EClass.pc.ai is GoalAutoCombat && !EClass.player.invlunerable && (EClass.pc.ai as GoalAutoCombat).listHealthy.Contains(Chara)) 
					{
						EClass.core.actionsNextFrame.Add(delegate
						{

@@ -4079,6 +4091,8 @@ public void DamageHP(int dmg, int ele, int eleP = 100, AttackSource attackSource

cs
		}
		if (!isDestroyed)
		{
			Debug.Log(EClass.player.invlunerable); 
			Debug.Log(EClass.pc.ai?.ToString() + "/" + EClass.pc.ai.IsRunning); 
			Die(e, origin, attackSource);
			ProcAbsorb();
			if (EClass.pc.Evalue(1355) > 0 && (IsPCFactionOrMinion || (origin != null && origin.IsPCParty)))

@@ -4798,7 +4812,7 @@ public void SpawnLoot(Card origin)

cs
		item4.isHidden = false;
		item4.SetInt(116);
		EClass._zone.AddCard(item4, nearestPoint);
		if (!item4.IsEquipmentOrRanged || item4.rarity < Rarity.Superior || item4.IsCursed) 
		if (!item4.IsEquipment || item4.rarity < Rarity.Superior || item4.IsCursed) 
		{
			continue;
		}

Chara

@@ -1356,7 +1356,6 @@ public override void OnCreate(int genLv)

cs
	if (source.mainElement.Length != 0)
	{
		int _genLv = Mathf.Min(genLv, 100);
		Debug.Log(genLv + "/" + _genLv); 
		List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
		string[] mainElement = source.mainElement;
		for (int i = 0; i < mainElement.Length; i++)

CharaGen

@@ -11,10 +11,6 @@ public static Chara _Create(string id, int idMat = -1, int lv = -1)

cs
		}
		objLv = lv;
		chara.Create(id, idMat, lv);
		if (EClass.player != null) 
		{ 
			EClass.player.codex.AddSpawn(id); 
		} 
		return chara;
	}

DNA

@@ -457,16 +457,16 @@ void AddVal(int id, int v, bool allowStack, Func<int, int> funcCost)

cs
					vals.Add(id);
					vals.Add(v);
				}
				cost += funcCost(num); 
				cost += Mathf.Max(0, funcCost(num)); 
			}
		}
	}

	public void CalcCost()
	{
		for (int i = 0; i < vals.Count; i += 2) 
		if (cost < 0) 
		{
			Element.Create(vals[i], vals[i + 1]); 
			cost = 0; 
		}
	}

@@ -485,6 +485,10 @@ public void CalcSlot()

cs
				slot = element.source.geneSlot;
			}
		}
		if (slot < 0) 
		{ 
			slot = 0; 
		} 
	}

	public static Type GetType(string idMat)

GamePrincipal

@@ -12,16 +12,22 @@ public class GamePrincipal : EClass

cs
	public int socre;

	[JsonProperty]
	public int bonusLoot; 
	public int dropRateMtp; 

	[JsonProperty]
	public bool deathPenaltyProtection; 
	public bool ignoreEvaluate; 

	[JsonProperty] 
	public bool disableDeathPenaltyProtection; 

	[JsonProperty] 
	public bool tax; 

	[JsonProperty]
	public bool opMilk;

	[JsonProperty]
	public bool manualSave; 
	public bool disableManualSave; 

	[JsonProperty]
	public bool permadeath;

@@ -30,16 +36,16 @@ public class GamePrincipal : EClass

cs
	public bool infiniteMarketFund;

	[JsonProperty]
	public bool moreFood; 
	public bool disableUsermapBenefit; 

	[JsonProperty]
	public bool moreReward; 
	public bool dropRate; 

	public bool IsCustom => idTemplate == -1;

	public int GetGrade(int score)
	{
		return Mathf.Clamp(score / 100, 0, 5); 
		return Mathf.Clamp(score / 20, 0, 5); 
	}

	public string GetTitle()

@@ -50,28 +56,68 @@ public string GetTitle()

cs

	public int GetScore()
	{
		int num = 300; 
		if (ignoreEvaluate) 
		{ 
			return 0; 
		} 
		int num = 0; 
		if (tax) 
		{ 
			num += GetScore("tax"); 
		} 
		if (disableManualSave) 
		{ 
			num += GetScore("disableManualSave"); 
		} 
		if (disableDeathPenaltyProtection) 
		{ 
			num += GetScore("disableDeathPenaltyProtection"); 
		} 
		if (disableUsermapBenefit) 
		{ 
			num += GetScore("disableUsermapBenefit"); 
		} 
		if (permadeath)
		{
			num += 200; 
			num += GetScore("permadeath"); 
		}
		if (infiniteMarketFund)
		{
			num -= 200; 
			num += GetScore("infiniteMarketFund"); 
		}
		if (opMilk)
		{
			num -= 200; 
			num += GetScore("opMilk"); 
		} 
		if (dropRate) 
		{ 
			num += GetScore("dropRate"); 
		}
		if (manualSave) 
		if (num >= 0) 
		{
			num -= 100; 
			return num; 
		}
		if (deathPenaltyProtection) 
		return 0; 
	} 

	public int GetScore(string s) 
	{ 
		if (ignoreEvaluate) 
		{
			num -= 50; 
			return 0; 
		}
		return num; 
		return s switch
		{ 
			"tax" => 20,  
			"disableManualSave" => 20,  
			"disableDeathPenaltyProtection" => 10,  
			"disableUsermapBenefit" => 20,  
			"permadeath" => 50,  
			"infiniteMarketFund" => -40,  
			"opMilk" => -40,  
			"dropRate" => 20 + dropRateMtp * -10,  
			_ => 0,  
		}; 
	}

	public int GetValidScore()

LayerWorldSetting

@@ -8,6 +8,8 @@ public class LayerWorldSetting : ELayer

cs

	public List<UIButton> buttonTemplates;

	public UIButton toggleEvaluate; 

	public UIButton toggleDeathPenaltyProtection;

	public UIButton toggleManualSave;

@@ -18,12 +20,20 @@ public class LayerWorldSetting : ELayer

cs

	public UIButton toggleOPMilk;

	public UIButton toggleUsermapBenefit; 

	public UIButton toggleDropRate; 

	public UIButton toggleTax; 

	public UIText textScore;

	public UIText textTitle;

	public UIText textValidScore;

	public UISlider sliderDropRate; 

	public Image imageScoreBar;

	public GamePrincipal pp => ELayer.game.principal;

@@ -65,26 +75,57 @@ public void SetTemplate(int idx)

cs

	public void Refresh()
	{
		groupTemplate.Select(pp.IsCustom ? IdxCustom : pp.idTemplate); 
		toggleDeathPenaltyProtection.SetToggle(pp.deathPenaltyProtection, delegate(bool a) 
		if (pp.IsCustom) 
		{
			Toggle(ref pp.deathPenaltyProtection, a); 
		}); 
		toggleManualSave.SetToggle(pp.manualSave, delegate(bool a) 
			groupTemplate.Select(buttonTemplates.LastItem()); 
		} 
		else
		{
			Toggle(ref pp.manualSave, a); 
		}); 
		togglePermadeath.SetToggle(pp.permadeath, delegate(bool a) 
			groupTemplate.Select(pp.idTemplate); 
		} 
		toggleEvaluate.SetToggleWithScore(pp.ignoreEvaluate, delegate(bool a) 
		{ 
			Toggle(ref pp.ignoreEvaluate, a); 
			Refresh(); 
		}, 0); 
		toggleTax.SetToggleWithScore(pp.tax, delegate(bool a) 
		{ 
			Toggle(ref pp.tax, a); 
		}, pp.GetScore("tax")); 
		toggleDeathPenaltyProtection.SetToggleWithScore(pp.disableDeathPenaltyProtection, delegate(bool a) 
		{ 
			Toggle(ref pp.disableDeathPenaltyProtection, a); 
		}, pp.GetScore("disableDeathPenaltyProtection")); 
		toggleManualSave.SetToggleWithScore(pp.disableManualSave, delegate(bool a) 
		{ 
			Toggle(ref pp.disableManualSave, a); 
		}, pp.GetScore("disableManualSave")); 
		toggleUsermapBenefit.SetToggleWithScore(pp.disableUsermapBenefit, delegate(bool a) 
		{ 
			Toggle(ref pp.disableUsermapBenefit, a); 
		}, pp.GetScore("disableUsermapBenefit")); 
		toggleDropRate.SetToggleWithScore(pp.dropRate, delegate(bool a) 
		{ 
			Toggle(ref pp.dropRate, a); 
		}, pp.GetScore("dropRate")); 
		togglePermadeath.SetToggleWithScore(pp.permadeath, delegate(bool a) 
		{
			Toggle(ref pp.permadeath, a);
		}); 
		toggleInfiniteMarketFund.SetToggle(pp.infiniteMarketFund, delegate(bool a) 
		}, pp.GetScore("permadeath")); 
		toggleInfiniteMarketFund.SetToggleWithScore(pp.infiniteMarketFund, delegate(bool a) 
		{
			Toggle(ref pp.infiniteMarketFund, a);
		}); 
		toggleOPMilk.SetToggle(pp.opMilk, delegate(bool a) 
		}, pp.GetScore("infiniteMarketFund")); 
		toggleOPMilk.SetToggleWithScore(pp.opMilk, delegate(bool a) 
		{
			Toggle(ref pp.opMilk, a);
		}, pp.GetScore("opMilk")); 
		sliderDropRate.SetSlider(pp.dropRateMtp, (float a) => (float)(int)a * 0.5f + "x", 0, 10, notify: false); 
		sliderDropRate.onValueChanged.RemoveAllListeners(); 
		sliderDropRate.onValueChanged.AddListener(delegate(float a) 
		{ 
			pp.dropRateMtp = (int)a; 
			Refresh(); 
		});
		RefreshScore();
		void Toggle(ref bool flag, bool on)

@@ -93,7 +134,7 @@ void Toggle(ref bool flag, bool on)

cs
		if (!pp.IsCustom)
		{
			pp.idTemplate = -1;
			groupTemplate.Select(IdxCustom); 
			groupTemplate.Select(buttonTemplates.LastItem()); 
		}
		RefreshScore();
	}

@@ -102,9 +143,10 @@ void Toggle(ref bool flag, bool on)

cs
	public void RefreshScore()
	{
		textTitle.text = pp.GetTitle() ?? "";
		textScore.text = "pp_score".lang(pp.GetScore().ToString() ?? ""); 
		textScore.text = "pp_score".lang(pp.ignoreEvaluate ? " - " : (pp.GetScore().ToString() ?? "")); 
		textValidScore.text = "pp_validScore".lang(pp.GetValidScore().ToString() ?? "");
		imageScoreBar.rectTransform.sizeDelta = new Vector2(Mathf.Clamp(300f * (float)pp.GetScore() / 500f, 0f, 300f), 50f); 
		textValidScore.SetActive(!pp.ignoreEvaluate); 
		imageScoreBar.rectTransform.sizeDelta = new Vector2(Mathf.Clamp(300f * (float)pp.GetScore() / 100f, 0f, 300f), 50f); 
	}

	public override void OnKill()

Thing

@@ -1891,7 +1891,7 @@ public void DoAct(Act act)

cs

	public void TryLickEnchant(Chara c, bool msg = true, Chara tg = null, BodySlot slot = null)
	{
		if (!base.IsEquipmentOrRanged || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0) 
		if (!base.IsEquipment || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0) 
		{
			return;
		}

@@ -1905,7 +1905,7 @@ public void TryLickEnchant(Chara c, bool msg = true, Chara tg = null, BodySlot s

cs
			PlaySound("offering");
			PlayEffect("mutation");
		}
		Element element = AddEnchant(5 + Mathf.Max(EClass.pc.LUC, 0)); 
		Element element = AddEnchant(base.LV); 
		if (element != null)
		{
			SetInt(107, element.id);

TraitMoongate

@@ -52,7 +52,25 @@ public async UniTask<bool> UseMoongate()

cs
			EClass.pc.SayNothingHappans();
			return false;
		}
		Net.DownloadMeta item = list.RandomItem(); 
		List<MapMetaData> list2 = ListSavedUserMap(); 
		IList<Net.DownloadMeta> list3 = list.Copy(); 
		foreach (MapMetaData item2 in list2) 
		{ 
			foreach (Net.DownloadMeta item3 in list3) 
			{ 
				if (item3.id == item2.id && item3.version == item2.version) 
				{ 
					list3.Remove(item3); 
					break; 
				} 
			} 
		} 
		Debug.Log(list3.Count); 
		if (list3.Count == 0) 
		{ 
			list3 = list.Copy(); 
		} 
		Net.DownloadMeta item = list3.RandomItem(); 
		Zone_User zone_User = EClass.game.spatials.Find((Zone_User z) => z.id == item.id);
		if (zone_User != null)
		{

@@ -112,4 +130,23 @@ public void MoveZone(Zone zone)

cs
		};
		EClass.pc.MoveZone(zone, ZoneTransition.EnterState.Moongate);
	}

	public List<MapMetaData> ListSavedUserMap() 
	{ 
		List<MapMetaData> list = new List<MapMetaData>(); 
		foreach (FileInfo item in new DirectoryInfo(CorePath.ZoneSaveUser).GetFiles().Concat(MOD.listMaps)) 
		{ 
			if (!(item.Extension != ".z")) 
			{ 
				MapMetaData metaData = Map.GetMetaData(item.FullName); 
				if (metaData != null && metaData.IsValidVersion()) 
				{ 
					metaData.path = item.FullName; 
					metaData.date = item.LastWriteTime; 
					list.Add(metaData); 
				} 
			} 
		} 
		return list; 
	} 
}

TraitMoongateEx

@@ -1,7 +1,5 @@

cs
using System;
using System.Collections.Generic;
using System.IO; 
using System.Linq; 

public class TraitMoongateEx : TraitMoongate
{

@@ -21,32 +19,19 @@ public override bool OnUse(Chara c)

cs

	public void _OnUse()
	{
		List<MapMetaData> list = new List<MapMetaData>(); 
		foreach (FileInfo item in new DirectoryInfo(CorePath.ZoneSaveUser).GetFiles().Concat(MOD.listMaps)) 
		{ 
			if (!(item.Extension != ".z")) 
			{ 
				MapMetaData metaData = Map.GetMetaData(item.FullName); 
				if (metaData != null && metaData.IsValidVersion()) 
				{ 
					metaData.path = item.FullName; 
					metaData.date = item.LastWriteTime; 
					list.Add(metaData); 
				} 
			} 
		} 
		List<MapMetaData> list = ListSavedUserMap(); 
		if (list.Count == 0)
		{
			EClass.pc.SayNothingHappans();
			return;
		}
		foreach (MapMetaData item2 in list) 
		foreach (MapMetaData item in list) 
		{
			bool flag = false;
			foreach (string item3 in EClass.player.favMoongate) 
			foreach (string item2 in EClass.player.favMoongate) 
			{
				_ = item3; 
				if (EClass.player.favMoongate.Contains(item2.id)) 
				_ = item2; 
				if (EClass.player.favMoongate.Contains(item.id)) 
				{
					flag = true;
					break;

@@ -54,7 +39,7 @@ public void _OnUse()

cs
		}
		if (!flag)
		{
			EClass.player.favMoongate.Remove(item2.id); 
			EClass.player.favMoongate.Remove(item.id); 
		}
	}
	Sort();

Zone

@@ -1922,6 +1922,11 @@ public Card AddCard(Card t, int x, int z)

cs
			}
			ignoreSpawnAnime = false;
		}
		if (chara != null && EClass.player != null && !chara.hasSpawned) 
		{ 
			EClass.player.codex.AddSpawn(chara.id); 
			chara.hasSpawned = true; 
		} 
		return t;
	}

Zone_User

@@ -1,3 +1,4 @@

cs
using System; 
using System.IO;
using Newtonsoft.Json;

@@ -23,12 +24,24 @@ public class Zone_User : Zone

cs
	public override void OnActivate()
	{
		base.OnActivate();
		if (EClass._map.exportSetting != null && !EClass._map.exportSetting.textWelcome.IsEmpty()) 
		if (EClass._map.exportSetting == null || EClass._map.exportSetting.textWelcome.IsEmpty()) 
		{ 
			return; 
		} 
		WidgetMainText.Instance.NewLine(); 
		string[] array = EClass._map.exportSetting.textWelcome.Replace("\\n", "").Split(Environment.NewLine.ToCharArray()); 
		int num = 0; 
		string[] array2 = array; 
		foreach (string text in array2) 
		{
			WidgetMainText.Instance.NewLine(); 
			Msg.SetColor("save");
			Msg.SayRaw("<i>" + EClass._map.exportSetting.textWelcome + "</i>"); 
			Msg.SayRaw("<i>" + text.Replace(Environment.NewLine, "") + "</i>"); 
			WidgetMainText.Instance.NewLine();
			num++; 
			if (num >= 5) 
			{ 
				break; 
			} 
		}
	}
}