Skip to content

EA 23.63 Nightly

December 22, 2024

43 files modified. 1 new file created.

Important Changes

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

ModManager (1)

cs
public IniData GetElinIni() 

Point (1)

cs
public void ModFire(int value) 
public void ModFire(int value, bool extinguish = false) 

Portrait (1)

cs
public void SetPortrait(string id, Color colorOverlay = default(Color)) 
public void SetPortrait(string id, Color colorOverlay = default(Color), bool applyColorMod = true) 

SourceMaterial (1)

cs
public void PlayHitEffect(Point p) 
public void PlayHitEffect(Point p, int emit = 2) 

AI_Idle

@@ -105,7 +105,7 @@ public override IEnumerable<Status> Run()

cs
				}
			}
		}
		if (EClass.rnd(3) == 0 && owner.mana.value > 0) 
		if (EClass.rnd(3) == 0 && owner.mana.value > 0 && !EClass._zone.IsRegion) 
		{
			Act act = null;
			Act actRevive = null;

ActEffect

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

cs
		}
		if (e.id == 911)
		{
			p.ModFire(-20); 
			p.ModFire(-20, extinguish: true); 
		}
	}
	if (RapidCount == 0)

ActThrow

@@ -162,7 +162,7 @@ public static EffectIRenderer Throw(Card c, Point p, Card target, Thing t, Throw

cs
		{
			Act.TC.Say("throw_hit", t, Act.TC);
		}
		Act.TP.ModFire(-50); 
		Act.TP.ModFire(-50, extinguish: true); 
		if (Act.TC != null && Act.TC.isChara)
		{
			if (t.trait.CanDrink(Act.TC.Chara))

BaseGameScreen

@@ -531,6 +531,14 @@ public void RefreshAll()

cs
	{
		grading.material.EnableKeyword("CLOUD_ON");
	}
	if (EMono.core.config.graphic.floorEx) 
	{ 
		EMono.scene.matFloorEx.EnableKeyword("EX_ON"); 
	} 
	else
	{ 
		EMono.scene.matFloorEx.DisableKeyword("EX_ON"); 
	} 
	grading.profile.vignette.enable = EMono.scene.profile.light.vignette;
	grading.profile.vignette.vignetteColor = EMono.scene.profile.light.vignetteColor;
	RefreshSky();

BodySlot

@@ -9,7 +9,7 @@ public class BodySlot : EClass

cs

	public int index;

	public int indexHnd; 
	public int indexPart; 

	public string name => EClass.sources.elements.map[elementId].GetText();

CSTR

@@ -22,6 +22,8 @@ public class CSTR

cs

	public const int idCat = 11;

	public const int extraNameRef = 12; 

	public const int context = 20;

	public const int idTalk = 21;

Card

@@ -1477,6 +1477,18 @@ public string c_altName2

cs
		}
	}

	public string c_extraNameRef 
	{ 
		get 
		{ 
			return GetStr(12); 
		} 
		set 
		{ 
			SetStr(12, value); 
		} 
	} 

	public string c_refText
	{
		get

@@ -4844,6 +4856,7 @@ public void MakeRefFrom(Card c1, Card c2 = null)

cs
			c_idRefCard2 = c2.id;
			c_altName2 = (c2.IsPC ? c2.c_altName : c2.GetName(NameStyle.Ref, (!c2.isChara) ? 1 : 0));
		}
		c_extraNameRef = (c1.IsPC ? EClass.pc.c_altName : c1.c_extraNameRef); 
	}

	public void SetHidden(bool hide = true)

@@ -5124,6 +5137,16 @@ public void PlaySoundDrop(bool spatial = true)

cs
		PlaySound(material.GetSoundDrop(sourceCard), 1f, spatial);
	}

	public void PlaySoundImpact(bool spatial = true) 
	{ 
		PlaySound(material.GetSoundImpact(sourceCard), 1f, spatial); 
	} 

	public void PlaySoundDead(bool spatial = true) 
	{ 
		PlaySound(material.GetSoundDead(sourceCard), 1f, spatial); 
	} 

	public SoundSource PlaySound(string id, float v = 1f, bool spatial = true)
	{
		if (IsPC)

@@ -6561,6 +6584,11 @@ public void SetDeconstruct(bool deconstruct)

cs
		}
	}

	public virtual bool MatchEncSearch(string s) 
	{ 
		return false; 
	} 

	public virtual void SetSortVal(UIList.SortMode m, CurrencyType currency = CurrencyType.Money)
	{
		switch (m)

Chara

@@ -940,7 +940,7 @@ void Build(Hobby h)

cs

	public Stats sleepiness => Stats.Sleepiness.Set(_cints, 17, this);

	public Stats SAN => Stats.SAN.Set(_cints, 17, this); 
	public Stats SAN => Stats.SAN.Set(_cints, 18, this); 

	public bool CanGainConResist
	{

@@ -1689,7 +1689,7 @@ public void RefreshSpeed(Element.BonusInfo info = null)

cs
			info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
		}
	}
	else if (base.LV >= 1000) 
	else if (base.LV >= 1000 && currentZone is Zone_Void) 
	{
		num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
		info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());

@@ -8065,6 +8065,7 @@ public void InitStats(bool onDeserialize = false)

cs
		_cints[14] = 70;
		_cints[15] = 70;
		_cints[17] = 0;
		_cints[18] = 0; 
	}
	foreach (Condition condition in conditions)
	{

@@ -8487,7 +8488,10 @@ public void OnSleep(Thing bed = null, int days = 1)

cs
		{
			num += traitPillow.owner.Power / 2;
		}
		num += Evalue(750) * 5; 
		if (bed != null) 
		{ 
			num += bed.Evalue(750) * 5; 
		} 
		OnSleep(num, days);
	}

@@ -8832,7 +8836,7 @@ public void RefreshFaithElement()

cs
			int num2 = array[i + 1] * num / 50;
			if (array[i] == 79)
			{
				num2 = EClass.curve(num2, 100, 20, 60); 
				num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50); 
			}
			if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
			{

CharaBody

@@ -464,12 +464,7 @@ public int GetAttackStyleElement(AttackStyle style)

cs

	public int GetSortVal(BodySlot slot)
	{
		int num = slot.element.sort * 10; 
		if (slot.elementId == 35) 
		{ 
			num += owner.body.slots.IndexOf(slot); 
		} 
		return -num; 
		return -(slot.element.sort * 100 + owner.body.slots.IndexOf(slot)); 
	}

	public void SetBodyIndexText(BodySlot b, UIText t)

@@ -478,25 +473,25 @@ public void SetBodyIndexText(BodySlot b, UIText t)

cs
	{
		return;
	}
	if (b.elementId == 35) 
	if (b.indexPart == 0) 
	{
		if (b.indexHnd == 0) 
		int num = 0; 
		foreach (BodySlot slot in slots) 
		{
			int num = 0; 
			foreach (BodySlot slot in slots) 
			if (slot.elementId == b.element.id) 
			{
				if (slot.elementId == 35) 
				{ 
					num++; 
				} 
				if (b == slot) 
				{ 
					break; 
				} 
				num++; 
			} 
			if (b == slot) 
			{ 
				break; 
			}
			b.indexHnd = num; 
		}
		t.SetText(b.indexHnd.ToString() ?? ""); 
		b.indexPart = num; 
	} 
	if (b.elementId == 35) 
	{ 
		t.SetText(b.indexPart.ToString() ?? ""); 
		t.SetActive(enable: true);
	}
	else

ConSuffocation

@@ -40,13 +40,13 @@ public override void Tick()

cs
	}
	if (base.value >= 100 && !EClass._zone.IsRegion)
	{
		owner.DamageHP(10 + owner.MaxHP / 20, AttackSource.Condition); 
		owner.DamageHP((base.value - 100) / 10 + owner.MaxHP / 20, AttackSource.Condition); 
	}
	if (owner != null && owner.IsAliveInCurrentZone)
	{
		if (!owner.Cell.CanSuffocate())
		{
			Mod(-20); 
			Mod(-25); 
		}
		else if (!EClass._zone.IsRegion)
		{

Core

@@ -1,7 +1,11 @@

cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO; 
using System.Text; 
using DG.Tweening;
using IniParser; 
using IniParser.Model; 
using ReflexCLI;
using Steamworks;
using UnityEngine;

@@ -738,4 +742,98 @@ public void ApplySkins()

cs
			componentsInChildren[i].ApplySkin();
		}
	}

	public static IniData GetElinIni() 
	{ 
		string pathIni = CorePath.PathIni; 
		try
		{ 
			string ie = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
			FileIniDataParser fileIniDataParser = new FileIniDataParser(); 
			if (!File.Exists(pathIni)) 
			{ 
				File.CreateText(pathIni).Close(); 
			} 
			IniData iniData = fileIniDataParser.ReadFile(pathIni, Encoding.UTF8); 
			if (iniData.GetKey("pass").IsEmpty()) 
			{ 
				string text = ""; 
				for (int i = 0; i < 4; i++) 
				{ 
					text += ie.RandomItem(); 
				} 
				iniData.Global["pass"] = text; 
				fileIniDataParser.WriteFile(pathIni, iniData); 
			} 
			return iniData; 
		} 
		catch (Exception message) 
		{ 
			Debug.Log(message); 
			Debug.Log("exception: Failed to parse:" + pathIni); 
			return null; 
		} 
	} 

	public static void SaveElinIni(IniData ini) 
	{ 
		new FileIniDataParser().WriteFile(CorePath.PathIni, ini); 
	} 

	public static void TryWarnMod(Action action, bool warn = true) 
	{ 
		if (warn) 
		{ 
			IniData ini = GetElinIni(); 
			if (ini.Global["agreed_usercontens_usage_terms"] != "yes") 
			{ 
				string[] items = new string[3] { "readTerms", "agree", "disagree" }; 
				Dialog.List("dialogTermsOfUseUGC".lang(), items, (string j) => j, delegate(int c, string d) 
				{ 
					switch (c) 
					{ 
					case 0: 
						LayerHelp.Toggle("custom", "terms2"); 
						return false; 
					case 1: 
						ini.Global["agreed_usercontens_usage_terms"] = "yes"; 
						SaveElinIni(ini); 
						action(); 
						break; 
					} 
					return true; 
				}, canCancel: true); 
				return; 
			} 
		} 
		action(); 
	} 

	public static void TryWarnUpload(Action action) 
	{ 
		IniData ini = GetElinIni(); 
		if (ini.Global["agreed_usercontents_upload_terms"] != "yes") 
		{ 
			string[] items = new string[3] { "readTerms", "agree", "disagree" }; 
			Dialog.List("dialogTermsOfUse".lang(), items, (string j) => j, delegate(int c, string d) 
			{ 
				switch (c) 
				{ 
				case 0: 
					LayerHelp.Toggle("custom", "terms"); 
					return false; 
				case 1: 
					ini.Global["agreed_usercontents_upload_terms"] = "yes"; 
					SaveElinIni(ini); 
					action(); 
					break; 
				} 
				return true; 
			}, canCancel: true); 
		} 
		else
		{ 
			action(); 
		} 
	} 
}

CoreConfig

@@ -286,6 +286,8 @@ public class GraphicSetting

cs

		public bool fixedResolution;

		public bool floorEx; 

		public bool cloud;

		public bool firefly;

@@ -658,6 +660,10 @@ public static CoreConfig TryLoadConfig()

cs
		coreConfig.game.backupInterval = 8;
		coreConfig.game.autoBackup = true;
	}
	if (coreConfig.version.IsBelow(0, 23, 63)) 
	{ 
		coreConfig.graphic.floorEx = true; 
	} 
	if (coreConfig.version.IsBelow(0, 22, 17))
	{
		coreConfig.game.tutorial = true;

CoreDebug

@@ -905,8 +905,8 @@ public void UpdateInput()

cs
	}
	if (Input.GetKeyDown(KeyCode.F2))
	{
		EClass._zone.TryGenerateEvolved(force: true); 
		EClass._zone.SpawnMob(null, SpawnSetting.Boss(100)); 
		EClass.pc.Pick(EClass.pc.MakeMilk(effect: true, 10)); 
		EClass.pc.Pick(EClass.pc.MakeEgg(effect: true, 10)); 
		Chara targetChara = EClass.scene.mouseTarget.TargetChara;
		if (targetChara != null)
		{

@@ -915,17 +915,6 @@ public void UpdateInput()

cs
			EClass.pc.Pick(targetChara.MakeBraineCell());
			EClass.pc.Pick(targetChara.MakeEgg(effect: true, 10));
		}
		if (EClass.game.quests.Get<QuestDebt>() == null) 
		{ 
			Chara chara = CharaGen.Create("loytel"); 
			EClass._zone.AddCard(chara, EClass.pc.pos); 
			chara.SetGlobal(); 
			Quest q = EClass.game.quests.Add("debt", "loytel"); 
			EClass.game.quests.Start(q); 
			EClass.pc.party.RemoveMember(chara); 
			Hostility hostility2 = (chara.c_originalHostility = Hostility.Ally); 
			chara.hostility = hostility2; 
		} 
		return;
	}
	if (Input.GetKeyDown(KeyCode.F3))

FortuneRollData

@@ -13,6 +13,9 @@ public class Prize : EClass

cs
		[JsonProperty]
		public string id;

		[JsonProperty] 
		public string idRef; 

		[JsonProperty]
		public bool claimed;

@@ -20,6 +23,10 @@ public class Prize : EClass

cs

		public int GetNum()
		{
			if (id == "ration") 
			{ 
				return 10; 
			} 
			if (id == "medal")
			{
				if (grade != 2)

@@ -58,7 +65,20 @@ public int GetNum()

cs
	public void AddNote(UINote n)
	{
		string text = "_circle".lang().TagColor(EClass.sources.materials.alias[mats[grade]].GetColor()) + "  " + Lang.GetList("fortuneroll")[grade];
		string text2 = (model.IsUnique ? "★" : "") + EClass.sources.cards.map[id].GetName().ToTitleCase(); 
		string text2 = (model.IsUnique ? "★" : "") + EClass.sources.cards.map[id].GetName(); 
		string text3 = id; 
		if (!(text3 == "panty")) 
		{ 
			if (text3 == "mathammer") 
			{ 
				text2 = "_of".lang(EClass.sources.materials.alias[idRef].GetName(), text2); 
			} 
		} 
		else
		{ 
			string name = EClass.sources.cards.map[idRef].GetName(); 
			text2 = "_of".lang(name, text2); 
		} 
		int num = GetNum();
		if (num > 1)
		{

@@ -68,13 +88,13 @@ public void AddNote(UINote n)

cs
			{
				text2 = "fortuneroll_claimed".lang();
			}
			n.AddTopic("TopicDomain", text, text2.TagColor(model.IsUnique ? FontColor.Great : FontColor.Good)); 
			n.AddTopic("TopicDomain", text, text2.ToTitleCase().TagColor(model.IsUnique ? FontColor.Great : FontColor.Good)); 
		}
	}

	public static string[] mats = new string[4] { "plastic", "water", "hide_dragon", "gold" };

	public static int[] chances = new int[4] { 1, 10, 20, 50 }; 
	public static int[] chances = new int[4] { 1, 8, 25, 60 }; 

	[JsonProperty]
	public List<Prize> prizes = new List<Prize>();

@@ -108,23 +128,40 @@ public void RefreshPrize()

cs
	prizes.Clear();
	Rand.SetSeed(EClass.game.seed + seed + count);
	List<List<string>> list = GetPrizeList();
	Add(3); 
	Add(2); 
	Add(2); 
	Add(1); 
	Add(1); 
	Add(1); 
	if (EClass._zone.IsTown && EClass._zone.lv == 0) 
	{ 
		Add(3); 
		Add(2); 
		Add(2); 
		Add(1); 
		Add(1); 
		Add(1); 
	} 
	Rand.SetSeed();
	void Add(int grade)
	{
		List<string> list2 = list[grade];
		int index = EClass.rnd(list2.Count);
		Prize item = new Prize
		Prize prize = new Prize
		{
			id = list2[index],
			grade = grade
		};
		prizes.Add(item); 
		string id = prize.id; 
		if (!(id == "panty")) 
		{ 
			if (id == "mathammer") 
			{ 
				SourceMaterial.Row randomMaterial = MATERIAL.GetRandomMaterial(20); 
				prize.idRef = randomMaterial.alias; 
			} 
		} 
		else
		{ 
			IEnumerable<SourceChara.Row> ie = EClass.sources.charas.map.Values.Where((SourceChara.Row r) => (r.model.trait as TraitChara).IsWearingPanty && !r.HasTag(CTAG.noRandomProduct)); 
			prize.idRef = ie.RandomItem().id; 
		} 
		prizes.Add(prize); 
		list2.RemoveAt(index);
	}
}

@@ -137,14 +174,22 @@ public List<List<string>> GetPrizeList()

cs
			new List<string>
			{
				"microchip", "1089", "150", "855", "medal", "water", "goods_charm", "electronicsS", "electronics", "plat",
				"plat"
				"plat", "ration", "backpack2", "sister", "rp_food", "rp_block", "157"
			},
			new List<string>
			{
				"computer", "834", "1090", "goods_figure", "goods_canvas", "mb_1", "mb_2", "mb_3", "mb_4", "mb_5",
				"1174", "1085", "toilet", "714", "nobility", "plat", "1165", "mathammer", "medal"
				"1174", "1085", "toilet", "714", "nobility", "plat", "1165", "mathammer", "medal", "bbq", 
				"panty", "beehive", "ticket_resident", "lovepotion", "crystal_sun"
			},
			new List<string> { "goods_coin", "goods_coin", "plat", "1165", "boat3", "medal" } 
			new List<string>
			{ 
				(EClass.player.luckycoin < 10) ? "goods_coin" : "plat", 
				"plat", 
				"1165", 
				"boat3", 
				"medal"
			} 
		};
	}

@@ -157,10 +202,34 @@ public void GetPrize(int grade, int seed)

cs
	{
		prize = list.RandomItem();
	}
	Thing thing = null; 
	Card card = null; 
	if (prize != null)
	{
		thing = ThingGen.Create(prize.id).SetNum(prize.GetNum()); 
		if (prize.id == "sister") 
		{ 
			card = CharaGen.Create("sister"); 
		} 
		else
		{ 
			card = ThingGen.Create(prize.id).SetNum(prize.GetNum()); 
			switch (card.id) 
			{ 
			case "rp_food": 
			case "rp_block": 
				card.SetLv(10); 
				break; 
			case "goods_coin": 
				EClass.player.luckycoin++; 
				break; 
			case "mathammer": 
				card.ChangeMaterial(prize.idRef); 
				break; 
			case "panty": 
				card.c_idRefCard = prize.idRef; 
				card.rarity = Rarity.Legendary; 
				break; 
			} 
		} 
		if (grade != 3)
		{
			prize.claimed = true;

@@ -168,9 +237,17 @@ public void GetPrize(int grade, int seed)

cs
		}
		else
		{
			thing = ThingGen.Create(GetPrizeList()[0].RandomItem()); 
			card = ThingGen.Create(GetPrizeList()[0].RandomItem()); 
		} 
		if (card.isChara) 
		{ 
			EClass._zone.AddCard(card, EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false) ?? EClass.pc.pos); 
			card.Chara.MakeMinion(EClass.pc); 
		} 
		else
		{ 
			EClass.pc.Pick(card.Thing); 
		}
		EClass.pc.Pick(thing); 
		Rand.SetSeed();
	}

HomeResourceWorth

@@ -1,4 +1,5 @@

cs
using System.Collections.Generic;
using System.Linq; 
using Newtonsoft.Json;
using UnityEngine;

@@ -64,54 +65,60 @@ public List<Thing> ListHeirloom()

cs
	long num = 0L;
	int num2 = branch.Evalue(2814);
	int num3 = branch.Evalue(2823);
	foreach (Thing thing in EClass._map.things) 
	List<Thing> list3 = EClass._map.things.Where((Thing t) => t.IsInstalled && t.HasTag(CTAG.tourism)).ToList(); 
	foreach (Thing item in list3) 
	{ 
		item.sortVal = GetPrice(item); 
	} 
	list3.Sort((Thing a, Thing b) => b.sortVal - a.sortVal); 
	foreach (Thing item2 in list3) 
	{
		if (!thing.IsInstalled) 
		if (!item2.HasTag(CTAG.tourism)) 
		{
			continue;
		}
		if (thing.HasTag(CTAG.tourism)) 
		bool flag = item2.trait is TraitFigure; 
		if (flag) 
		{
			bool flag = thing.trait is TraitFigure; 
			if (flag) 
			{ 
				if (array[thing.pos.index] != 0) 
				{ 
					continue; 
				} 
				array[thing.pos.index]++; 
			} 
			string text = ""; 
			int num4 = 1; 
			if (flag) 
			if (array[item2.pos.index] != 0) 
			{
				text = "figure_" + thing.c_idRefCard; 
				num4 = 2; 
				continue; 
			}
			else
			{ 
				text = thing.id + "_" + thing.idSkin; 
			} 
			if (!hashSet.Contains(text)) 
			array[item2.pos.index]++; 
		} 
		string text = ""; 
		int num4 = 1; 
		if (flag) 
		{ 
			text = "figure_" + item2.c_idRefCard; 
			num4 = 2; 
		} 
		else
		{ 
			text = item2.id + "_" + item2.idSkin; 
		} 
		if (!hashSet.Contains(text)) 
		{ 
			int num5 = item2.sortVal * num4; 
			if (num3 > 0) 
			{
				int num5 = GetPrice(thing) * num4; 
				if (num3 > 0) 
				{ 
					num5 = num5 * (110 + (int)Mathf.Sqrt(num3) * 4) / 100; 
				} 
				num += num5; 
				hashSet.Add(text); 
				num5 = num5 * (110 + (int)Mathf.Sqrt(num3) * 4) / 100; 
			}
			else if (num2 > 0) 
			num += num5; 
			hashSet.Add(text); 
		} 
		else if (num2 > 0) 
		{ 
			int num6 = item2.sortVal * num4 / Mathf.Max(20, 30 - (int)Mathf.Sqrt(num2)); 
			if (num6 > 0) 
			{
				int num6 = GetPrice(thing) * num4 / Mathf.Max(20, 30 - (int)Mathf.Sqrt(num2)); 
				if (num6 > 0) 
				{ 
					num += num6; 
				} 
				num += num6; 
			}
		}
		if (thing.IsFurniture || thing.trait is TraitToolMusic) 
	} 
	foreach (Thing thing in EClass._map.things) 
	{ 
		if (thing.IsInstalled && (thing.IsFurniture || thing.trait is TraitToolMusic)) 
		{
			list2.Add(thing);
		}

HotItemHeld

@@ -396,6 +396,13 @@ public bool TrySetToolAct(ActPlan p)

cs
		{
			return true;
		}
		if (thing.HasElement(225) && p.TrySetAct(new TaskChopWoord
		{ 
			pos = pos.Copy() 
		})) 
		{ 
			return true; 
		} 
	}
	if (pos.HasChara)
	{

LayerConfig

@@ -81,6 +81,8 @@ public class LayerConfig : ELayer

cs

	public UIButton toggleBalloon;

	public UIButton toggleFloorEx; 

	public UIItem fontUI;

	public UIItem fontChatbox;

@@ -434,17 +436,34 @@ public void Refresh()

cs
	toggleFirefly.SetToggle(ELayer.config.graphic.firefly, delegate(bool on)
	{
		ELayer.config.graphic.firefly = on;
		ELayer.screen.RefreshSky(); 
		if (ELayer.core.IsGameStarted) 
		{ 
			ELayer.screen.RefreshSky(); 
		} 
	}); 
	toggleFloorEx.SetToggle(ELayer.config.graphic.floorEx, delegate(bool on) 
	{ 
		ELayer.config.graphic.floorEx = on; 
		if (ELayer.core.IsGameStarted) 
		{ 
			ELayer.screen.RefreshAll(); 
		} 
	});
	toggleGodray.SetToggle(ELayer.config.graphic.godray, delegate(bool on)
	{
		ELayer.config.graphic.godray = on;
		ELayer.screen.RefreshSky(); 
		if (ELayer.core.IsGameStarted) 
		{ 
			ELayer.screen.RefreshSky(); 
		} 
	});
	toggleBlizzard.SetToggle(ELayer.config.graphic.blizzard, delegate(bool on)
	{
		ELayer.config.graphic.blizzard = on;
		ELayer.screen.RefreshSky(); 
		if (ELayer.core.IsGameStarted) 
		{ 
			ELayer.screen.RefreshSky(); 
		} 
	});
	toggleAllyLight.SetToggle(ELayer.config.graphic.drawAllyLight, delegate(bool on)
	{

LayerEditPortrait

@@ -57,17 +57,18 @@ public void Activate(Chara _chara, PCCData _pcc = null, Action<Color> _action =

cs
	}
	uiPicker.SetColor(hairColor, hairColor, delegate(PickerState state, Color _c)
	{
		ColorUtility.TryParseHtmlString("#" + ColorUtility.ToHtmlStringRGBA(_c), out var color); 
		if (pcc == null)
		{
			chara.SetInt(105, IntColor.ToInt(_c)); 
			chara.SetInt(105, IntColor.ToInt(color)); 
		}
		else
		{
			pcc.SetColor("hair", _c); 
			pcc.SetColor("hair", color); 
		}
		portrait.SetChara(chara, pcc);
		action(_c); 
		hairColor = _c; 
		action(color); 
		hairColor = color; 
		hasColorChanged = true;
	});
	RefreshList();

LayerMod

@@ -67,9 +67,12 @@ public override void OnInit()

cs
				{
					uIContextMenu.AddButton("mod_publish", delegate
					{
						Dialog.YesNo("mod_publish_warn".lang(a.title, a.id, a.author), delegate
						Core.TryWarnUpload(delegate 
						{
							ELayer.core.steam.CreateUserContent(a); 
							Dialog.YesNo("mod_publish_warn".lang(a.title, a.id, a.author), delegate
							{ 
								ELayer.core.steam.CreateUserContent(a); 
							}); 
						});
					});
				}

LayerTitle

@@ -77,8 +77,11 @@ public void OnClickStart()

cs
	{
		if (ELayer.ui.GetTopLayer() is LayerTitle)
		{
			embark = ELayer.ui.AddLayer<LayerEditBio>(); 
			SoundManager.current.PlayBGM(CurrentTitle.bgm); 
			Core.TryWarnMod(delegate
			{ 
				embark = ELayer.ui.AddLayer<LayerEditBio>(); 
				SoundManager.current.PlayBGM(CurrentTitle.bgm); 
			}, ELayer.core.mods.CountUserMod() > 0); 
		}
	}

@@ -91,7 +94,10 @@ public void OnClickContinue()

cs
	{
		if (ELayer.ui.GetTopLayer() is LayerTitle)
		{
			ELayer.ui.AddLayer<LayerLoadGame>().Init(_backup: false); 
			Core.TryWarnMod(delegate
			{ 
				ELayer.ui.AddLayer<LayerLoadGame>().Init(_backup: false); 
			}, ELayer.core.mods.CountUserMod() > 0); 
		}
	}

LayerUploader

@@ -1,6 +1,5 @@

cs
using System;
using System.Collections.Generic;
using IniParser; 
using IniParser.Model;
using UnityEngine;
using UnityEngine.UI;

@@ -46,7 +45,7 @@ public class LayerUploader : ELayer

cs

	public override void OnInit()
	{
		ini = ELayer.core.mods.GetElinIni(); 
		ini = Core.GetElinIni(); 
		string text = ini.GetKey("pass") ?? "password";
		inputId.text = ELayer._map.custom?.id ?? "new_zone";
		inputPassword.text = text;

@@ -90,7 +89,7 @@ public void SaveID()

cs
			ELayer._map.custom.id = inputId.text;
		}
		ini.Global["pass"] = inputPassword.text;
		new FileIniDataParser().WriteFile(ModManager.PathIni, ini); 
		Core.SaveElinIni(ini); 
	}

	public void ExportMap()

@@ -102,7 +101,7 @@ public void ExportMap()

cs

	public void Upload()
	{
		if (ini.Global["agreed"].IsEmpty() || ELayer.debug.enable) 
		if (ini.Global["agreed_usercontents_upload_terms"] != "yes") 
		{
			string[] items = new string[3] { "readTerms", "agree", "disagree" };
			Dialog.List("dialogTermsOfUse".lang(), items, (string j) => j, delegate(int c, string d)

@@ -113,7 +112,7 @@ public void Upload()

cs
				LayerHelp.Toggle("custom", "terms");
				return false;
			case 1:
				ini.Global["agreed"] = "yes"; 
				ini.Global["agreed_usercontents_upload_terms"] = "yes"; 
				Upload();
				break;
			}

ModManager

@@ -2,10 +2,8 @@

cs
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text; 
using HeathenEngineering.SteamworksIntegration;
using HeathenEngineering.SteamworksIntegration.API;
using IniParser; 
using IniParser.Model;
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;

@@ -22,8 +20,6 @@ public struct SheetIndex

cs
		public int old;
	}

	public static readonly string PasswordChar = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 

	public static List<object> ListPluginObject = new List<object>();

	public static bool disableMod = false;

@@ -36,42 +32,10 @@ public struct SheetIndex

cs

	public static bool IsInitialized => BaseModManager.isInitialized;

	public static string PathIni => CorePath.PathIni; 

	public IniData GetElinIni() 
	{ 
		try
		{ 
			FileIniDataParser fileIniDataParser = new FileIniDataParser(); 
			if (!File.Exists(PathIni)) 
			{ 
				File.CreateText(PathIni).Close(); 
			} 
			IniData iniData = fileIniDataParser.ReadFile(PathIni, Encoding.UTF8); 
			if (iniData.GetKey("pass").IsEmpty()) 
			{ 
				string text = ""; 
				for (int i = 0; i < 4; i++) 
				{ 
					text += PasswordChar.RandomItem(); 
				} 
				iniData.Global["pass"] = text; 
				fileIniDataParser.WriteFile(PathIni, iniData); 
			} 
			return iniData; 
		} 
		catch (Exception message) 
		{ 
			Debug.Log(message); 
			Debug.Log("exception: Failed to parse:" + PathIni); 
			return null; 
		} 
	} 

	public override void Init(string path, string defaultPackage = "_Elona")
	{
		base.Init(path, defaultPackage);
		IniData elinIni = GetElinIni(); 
		IniData elinIni = Core.GetElinIni(); 
		Debug.Log("IsOffline:" + BaseCore.IsOffline);
		if (elinIni != null)
		{

@@ -88,7 +52,7 @@ public override void Init(string path, string defaultPackage = "_Elona")

cs
			DirectoryInfo parent = new DirectoryInfo(App.Client.GetAppInstallDirectory(SteamSettings.behaviour.settings.applicationId)).Parent.Parent;
			dirWorkshop = new DirectoryInfo(parent.FullName + "/workshop/content/2135150");
			elinIni.Global["path_workshop"] = dirWorkshop.FullName ?? "";
			new FileIniDataParser().WriteFile(PathIni, elinIni); 
			Core.SaveElinIni(elinIni); 
		}
	}
	if (dirWorkshop != null && !dirWorkshop.Exists)

@@ -325,6 +289,19 @@ public ModPackage AddWorkshopPackage(WorkshopItem item, bool isInPackages = fals

cs
		return modPackage;
	}

	public int CountUserMod() 
	{ 
		int num = 0; 
		foreach (BaseModPackage package in packages) 
		{ 
			if (!package.builtin) 
			{ 
				num++; 
			} 
		} 
		return num; 
	} 

	public override void ParseExtra(DirectoryInfo dir, BaseModPackage package)
	{
		switch (dir.Name)

Player

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

cs
	[JsonProperty]
	public int giftJure;

	[JsonProperty] 
	public int luckycoin; 

	[JsonProperty]
	public float angle;

Point

@@ -905,8 +905,14 @@ public void SetObj(int id = 0, int value = 1, int dir = 0)

cs
		map.SetObj(x, z, id, value, dir);
	}

	public void ModFire(int value) 
	public void ModFire(int value, bool extinguish = false) 
	{
		if (extinguish && cell.HasFire) 
		{ 
			PlaySound("extinguish"); 
			PlayEffect("smoke"); 
			PlayEffect("vanish"); 
		} 
		map.ModFire(x, z, value);
	}

@@ -1106,6 +1112,21 @@ public T FindThing<T>() where T : Trait

cs
		return null;
	}

	public Thing FindThing(Func<Thing, bool> func) 
	{ 
		if (detail != null) 
		{ 
			foreach (Thing thing in detail.things) 
			{ 
				if (func(thing)) 
				{ 
					return thing; 
				} 
			} 
		} 
		return null; 
	} 

	public List<Card> ListThings<T>(bool onlyInstalled = true) where T : Trait
	{
		listCard.Clear();

Portrait

@@ -210,11 +210,15 @@ public Color GetRandomHairColor(Chara c)

cs
		return randomColor;
	}

	public void SetPortrait(string id, Color colorOverlay = default(Color)) 
	public void SetPortrait(string id, Color colorOverlay = default(Color), bool applyColorMod = true) 
	{
		Sprite @object = modPortraits.GetItem(id).GetObject();
		Sprite object2 = modOverlays.GetObject(id + "-overlay");
		Sprite spriteFull = ((enableFull && (bool)imageFull) ? modFull.GetObject(id + "-full") : null);
		if (applyColorMod) 
		{ 
			colorOverlay = PCCManager.current.ApplyColorMod(colorOverlay); 
		} 
		SetPortrait(isPortrait: true, @object, object2, colorOverlay, spriteFull);
	}

Recipe

@@ -904,6 +904,10 @@ public int GetSortVal()

cs

	public bool HasFirstTimeBonus()
	{
		if (IsStaticLV()) 
		{ 
			return false; 
		} 
		if (EClass.player.recipes.craftedRecipes.Contains(id))
		{
			return false;

RecipeCard

@@ -246,7 +246,11 @@ public override Thing Craft(BlessedState blessed, bool sound = false, List<Thing

cs
	{
		if (isDish)
		{
			if (!flag) 
			if (flag) 
			{ 
				thing.ChangeMaterial("meat"); 
			} 
			else
			{
				MakeDish(thing);
				if (EClass.pc.HasElement(1658))

Scene

@@ -100,6 +100,8 @@ public enum Mode

cs

	public Tileset tileset;

	public Material matFloorEx; 

	public ParticleSystem psFoot;

	public ParticleSystem psSmoke;

SerializedCards

@@ -673,10 +673,7 @@ public void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial = nu

cs
		card2.isImported = true;
		card2.refVal = card4.refVal;
		card2.idSkin = card4.idSkin;
		if (isUserZone) 
		{ 
			card2.c_idDeity = card4.idDeity; 
		} 
		card2.c_idDeity = card4.idDeity; 
		if (isUserZone && (card2.isHidden || card2.isMasked) && ((card2.TileType.IsBlockPass && card2.IsInstalled) || card2.trait is TraitCoreZone || card2.trait is TraitWaystone))
		{
			Card card3 = card2;

SourceMaterial

@@ -136,10 +136,10 @@ public void AddBlood(Point p, int a = 1)

cs
			}
		}

		public void PlayHitEffect(Point p) 
		public void PlayHitEffect(Point p, int emit = 2) 
		{
			Effect.Get("mine2").Play(p).SetParticleColor(GetColor())
				.Emit(2 + EClass.rnd(4)); 
				.Emit(emit + EClass.rnd(4)); 
		}

		public Color GetColor()

+TaskChopWoord

File Created
cs
using System.Collections.Generic;
using UnityEngine;

public class TaskChopWoord : TaskDesignation
{
	public override CursorInfo CursorIcon => CursorSystem.Cut;

	public override int destDist => 1;

	public override bool Loop => GetLog() != null;

	public override bool CanManualCancel()
	{
		return true;
	}

	public Thing GetLog()
	{
		return pos.FindThing((Thing t) => t.id == "log");
	}

	public override HitResult GetHitResult()
	{
		if (GetLog() != null)
		{
			return HitResult.Valid;
		}
		return HitResult.Invalid;
	}

	public override bool CanProgress()
	{
		if (base.CanProgress() && GetLog() != null && owner.Tool != null && owner.Tool.trait is TraitTool)
		{
			return owner.Tool.HasElement(225);
		}
		return false;
	}

	public override void OnCreateProgress(Progress_Custom p)
	{
		p.textHint = Name;
		p.maxProgress = Mathf.Max((15 + EClass.rnd(20)) * 100 / (100 + owner.Tool.material.hardness * 3), 2);
		p.onProgressBegin = delegate
		{
			if (owner.Tool != null)
			{
				owner.Say("chopwood_start", owner, GetLog().GetName(NameStyle.Full, 1));
			}
		};
		p.onProgress = delegate
		{
			Thing log2 = GetLog();
			SourceMaterial.Row material2 = log2.material;
			log2.PlaySoundImpact();
			material2.AddBlood(pos);
			log2.PlayAnime(AnimeID.HitObj);
			material2.PlayHitEffect(pos);
			owner.renderer.NextFrame();
		};
		p.onProgressComplete = delegate
		{
			Thing log = GetLog();
			SourceMaterial.Row material = log.material;
			log.PlaySoundDead();
			material.AddBlood(pos, 3 + EClass.rnd(2));
			log.material.PlayHitEffect(pos, 10);
			Thing thing = ThingGen.Create("plank", material.id).SetNum(1 + EClass.rnd(2));
			CraftUtil.MixIngredients(thing, new List<Thing> { log }, CraftUtil.MixType.General, 999);
			log.ModNum(-1);
			owner.elements.ModExp(225, 30);
			owner.stamina.Mod(-1);
			EClass._map.TrySmoothPick(pos, thing, EClass.pc);
		};
	}
}

TaskWater

@@ -74,7 +74,7 @@ public override IEnumerable<Status> Run()

cs
			}
			if (p.cell.HasFire)
			{
				EClass._map.ModFire(p.x, p.z, -50); 
				p.ModFire(-50, extinguish: true); 
			}
			owner.PlaySound("water_farm");
			owner.Say("water_farm", owner, p.cell.GetFloorName());

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("#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))))); 
			text = ((!source.name2.IsEmpty()) ? source.GetTextArray("name2")[0].Replace("#1b", base.c_extraNameRef.IsEmpty((base.refCard != null) ? base.refCard.GetName() : text7)).Replace("#1", base.c_extraNameRef.IsEmpty(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
		{

@@ -1979,6 +1979,48 @@ public Thing Identify(bool show = true, IDTSource idtSource = IDTSource.Identify

cs
		LayerInventory.SetDirty(this);
		return this;
	}

	public override bool MatchEncSearch(string s) 
	{ 
		if (trait is TraitGene) 
		{ 
			DNA dNA = base.c_DNA; 
			if (dNA == null || dNA.type == DNA.Type.Brain || dNA.type == DNA.Type.Inferior) 
			{ 
				return false; 
			} 
			for (int i = 0; i < dNA.vals.Count; i += 2) 
			{ 
				SourceElement.Row row = EClass.sources.elements.map.TryGetValue(dNA.vals[i]); 
				if (row.name.ToLower().Contains(s)) 
				{ 
					return true; 
				} 
				if (!Lang.isEN && row.GetName().ToLower().Contains(s)) 
				{ 
					return true; 
				} 
			} 
		} 
		else
		{ 
			foreach (Element value in elements.dict.Values) 
			{ 
				if (value.Value != 0) 
				{ 
					if (value.source.name.ToLower().Contains(s)) 
					{ 
						return true; 
					} 
					if (!Lang.isEN && value.source.GetName().ToLower().Contains(s)) 
					{ 
						return true; 
					} 
				} 
			} 
		} 
		return false; 
	} 
}
public static class THING
{

ThingContainer

@@ -149,12 +149,17 @@ public void RefreshGrid(UIMagicChest magic, Window.SaveData data)

cs
	magic.cats.Clear();
	magic.catCount.Clear();
	grid = new List<Thing>(new Thing[GridSize]);
	string lastSearch = magic.lastSearch; 
	bool flag = !lastSearch.IsEmpty(); 
	string text = magic.lastSearch; 
	bool flag = !text.IsEmpty(); 
	bool flag2 = !magic.idCat.IsEmpty();
	Window.SaveData.CategoryType category = data.category;
	bool flag3 = category != Window.SaveData.CategoryType.None;
	string text = ""; 
	string text2 = ""; 
	bool flag4 = text != null && text.Length >= 2 && (text[0] == '@' || text[1] == '@'); 
	if (flag4) 
	{ 
		text = text.Substring(1); 
	} 
	using (Enumerator enumerator = GetEnumerator())
	{
		while (enumerator.MoveNext())

@@ -165,37 +170,47 @@ public void RefreshGrid(UIMagicChest magic, Window.SaveData data)

cs
				switch (category)
				{
				case Window.SaveData.CategoryType.Main:
					text = current.category.GetRoot().id; 
					text2 = current.category.GetRoot().id; 
					break;
				case Window.SaveData.CategoryType.Sub:
					text = current.category.GetSecondRoot().id; 
					text2 = current.category.GetSecondRoot().id; 
					break;
				case Window.SaveData.CategoryType.Exact:
					text = current.category.id; 
					text2 = current.category.id; 
					break;
				}
				magic.cats.Add(text); 
				if (magic.catCount.ContainsKey(text)) 
				magic.cats.Add(text2); 
				if (magic.catCount.ContainsKey(text2)) 
				{
					magic.catCount[text]++; 
					magic.catCount[text2]++; 
				}
				else
				{
					magic.catCount.Add(text, 1); 
					magic.catCount.Add(text2, 1); 
				}
			}
			if (flag)
			{
				if (current.tempName == null) 
				if (flag4) 
				{
					current.tempName = current.GetName(NameStyle.Full, 1).ToLower(); 
					if (!current.MatchEncSearch(text)) 
					{ 
						continue; 
					} 
				}
				if (!current.tempName.Contains(lastSearch) && !current.source.GetSearchName(jp: false).Contains(lastSearch) && !current.source.GetSearchName(jp: true).Contains(lastSearch)) 
				else
				{
					continue; 
					if (current.tempName == null) 
					{ 
						current.tempName = current.GetName(NameStyle.Full, 1).ToLower(); 
					} 
					if (!current.tempName.Contains(text) && !current.source.GetSearchName(jp: false).Contains(text) && !current.source.GetSearchName(jp: true).Contains(text)) 
					{ 
						continue; 
					} 
				}
			}
			if (!flag2 || !(text != magic.idCat)) 
			if (!flag2 || !(text2 != magic.idCat)) 
			{
				magic.filteredList.Add(current);
			}

TraitAdventurer

@@ -12,6 +12,8 @@ public class TraitAdventurer : TraitChara

cs

	public override bool CanBout => true;

	public override bool IsWearingPanty => true; 

	public override Adv_Type AdvType
	{
		get

TraitChara

@@ -118,6 +118,18 @@ public virtual bool CanGiveRandomQuest

cs

	public virtual bool UseRandomAlias => false;

	public virtual bool IsWearingPanty 
	{ 
		get 
		{ 
			if ((!IsUnique || owner.bio.gender != 2) && (owner.race.IsHuman || owner.race.IsFairy)) 
			{ 
				return !(this is TraitMerchant); 
			} 
			return false; 
		} 
	} 

	public override string IDInvStyle => "backpack";

	public virtual string IDRumor => "";

TraitCrafter

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

cs

	public override bool OnUse(Chara c)
	{
		if (EClass._zone.IsRegion) 
		{ 
			Msg.SayCannotUseHere(); 
			return false; 
		} 
		if (IsFactory)
		{
			Thing thing = owner.Thing;

TraitGiftJure

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

cs
	Add("cake_festival", 3);
	Add("bushdenoel", 3);
	Add("mancookie", 3);
	EClass.pc.Pick(ThingGen.CreateRecipe("xmas_tree")); 
	Thing thing = ThingGen.CreateLetter("letter_juremas");
	thing.ChangeMaterial("grass_forest");
	EClass.pc.Pick(thing);

TraitKettle

@@ -56,6 +56,16 @@ public override bool CanCopy(Thing t)

cs
		{
			return true;
		}
		if (t.sockets != null) 
		{ 
			foreach (int socket in t.sockets) 
			{ 
				if (socket != 0) 
				{ 
					return false; 
				} 
			} 
		} 
		return t.isCrafted;
	}
}

TraitMoongate

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

cs
			Msg.SayNothingHappen();
			return false;
		}
		LayerProgress.StartAsync("Loading", UseMoongate()); 
		Core.TryWarnMod(delegate
		{ 
			LayerProgress.StartAsync("Loading", UseMoongate()); 
		}, warn: false); 
		return false;
	}

TraitMoongateEx

@@ -11,6 +11,15 @@ public override bool OnUse(Chara c)

cs
			Msg.SayNothingHappen();
			return false;
		}
		Core.TryWarnMod(delegate
		{ 
			_OnUse(); 
		}, warn: false); 
		return false; 
	} 

	public void _OnUse() 
	{ 
		List<MapMetaData> list = new List<MapMetaData>();
		foreach (FileInfo item in new DirectoryInfo(CorePath.ZoneSaveUser).GetFiles().Concat(MOD.listMaps))
		{

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

cs
	if (list.Count == 0)
	{
		EClass.pc.SayNothingHappans();
		return false; 
		return; 
	}
	LayerList layer = null;
	bool skipDialog = false;

@@ -68,6 +77,5 @@ void func()

cs
			}
		}).SetSize(500f)
			.SetTitles("wMoongate") as LayerList;
		return false; 
	}
}

TraitRollingFortune

@@ -4,6 +4,8 @@ public class TraitRollingFortune : TraitCrafter

cs

	public override string CrafterTitle => "invRoll";

	public override bool CanUseFromInventory => false; 

	public override AnimeType animeType => AnimeType.Microwave;

	public override string idSoundProgress => "fortuneroll";

WidgetSearch

@@ -95,14 +95,20 @@ public override void Search(string s)

cs
	}
	s = s.ToLower();
	buttonClear.SetActive(field.text != "");
	if (s == lastSearch) 
	if (s == lastSearch || s.Length == 0) 
	{
		return;
	}
	lastSearch = s; 
	bool encSearch = s.Length >= 2 && (s[0] == '@' || s[1] == '@'); 
	if (encSearch) 
	{ 
		s = s.Substring(1); 
	} 
	HashSet<Card> newCards = new HashSet<Card>();
	if (!s.IsEmpty())
	{
		if (EMono._zone.IsTown || EMono._zone.IsPCFaction || EMono._zone is Zone_Tent) 
		if (!encSearch && (EMono._zone.IsTown || EMono._zone.IsPCFaction || EMono._zone is Zone_Tent)) 
		{
			foreach (Chara chara in EMono._map.charas)
			{

@@ -116,14 +122,32 @@ public override void Search(string s)

cs
		{
			foreach (Thing thing in EMono._map.things)
			{
				if (thing.Name.ToLower().Contains(s) || thing.sourceCard.GetSearchName(jp: false).Contains(s)) 
				if (encSearch) 
				{ 
					if (thing.MatchEncSearch(s)) 
					{ 
						newCards.Add(thing); 
					} 
				} 
				else if (thing.Name.ToLower().Contains(s) || thing.sourceCard.GetSearchName(jp: false).Contains(s)) 
				{
					newCards.Add(thing);
				}
			}
			foreach (Card value in EMono._map.props.stocked.all.Values)
			{
				if (value.parent is Thing && (value.parent as Thing).c_lockLv <= 0 && (value.Name.ToLower().Contains(s) || value.sourceCard.GetSearchName(jp: false).Contains(s))) 
				if (!(value.parent is Thing) || (value.parent as Thing).c_lockLv > 0) 
				{ 
					continue; 
				} 
				if (encSearch) 
				{ 
					if (value.MatchEncSearch(s)) 
					{ 
						newCards.Add(value); 
					} 
				} 
				else if (value.Name.ToLower().Contains(s) || value.sourceCard.GetSearchName(jp: false).Contains(s)) 
				{
					newCards.Add(value);
				}

@@ -139,9 +163,19 @@ public override void Search(string s)

cs
				}
				chara2.things.Foreach(delegate(Thing t)
				{
					if (!((t.parent as Card)?.trait is TraitChestMerchant) && (t.Name.ToLower().Contains(s) || t.source.GetSearchName(jp: false).Contains(s))) 
					if (!((t.parent as Card)?.trait is TraitChestMerchant)) 
					{
						newCards.Add(t); 
						if (encSearch) 
						{ 
							if (t.MatchEncSearch(s)) 
							{ 
								newCards.Add(t); 
							} 
						} 
						else if (t.Name.ToLower().Contains(s) || t.source.GetSearchName(jp: false).Contains(s)) 
						{ 
							newCards.Add(t); 
						} 
					}
				});
			}

@@ -153,7 +187,6 @@ public override void Search(string s)

cs
			RefreshList();
		}
		cgResult.alpha = ((list.ItemCount > 0) ? 1f : 0f);
		lastSearch = s; 
	}

	public void RefreshWords()

Zone

@@ -3437,7 +3437,7 @@ public FortuneRollData GetOrCreateFortuneRollData(bool refresh = true)

cs
	if (fortuneRoll == null)
	{
		fortuneRoll = new FortuneRollData();
		fortuneRoll.seed = EClass.rnd(50000) + 1; 
		fortuneRoll.seed = EClass._zone.uid * 100 + EClass.game.seed; 
	}
	if (refresh || fortuneRoll.count == 0)
	{