Skip to content

EA 23.62 Nightly hotfix 1

December 21, 2024

48 files modified. 2 new files created.

Important Changes

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

Chara (1)

cs
public List<Element> ListAvailabeFeats(bool pet = false) 
public List<Element> ListAvailabeFeats(bool pet = false, bool showAll = false) 

FEAT (1)

cs
public bool IsAvailable(ElementContainer owner, int a = 1) 

Religion (2)

cs
public void JoinFaith(Chara c) 
public void JoinFaith(Chara c, ConvertType type = ConvertType.Default) 
cs
public void LeaveFaith(Chara c, Religion newFaith) 
public void LeaveFaith(Chara c, Religion newFaith, ConvertType type) 

TraitDoor (1)

cs
public bool IsValid() 
public bool IsValid(bool shouldLookGood = true) 

ABILITY

@@ -4,6 +4,8 @@ public class ABILITY

cs
{
	public const int ActChat = 5044;

	public const int TaskBuild = 5035; 

	public const int TaskMoveInstalled = 5036;

	public const int ActNoItem = 5037;

@@ -30,11 +32,11 @@ public class ABILITY

cs

	public const int AI_OpenLock = 5049;

	public const int AI_Sleep = 5050; 
	public const int GoalIdle = 5034; 

	public const int TaskBuild = 5035; 
	public const int AI_Sleep = 5050; 

	public const int ActZap = 5051; 
	public const int ActBash = 5052; 

	public const int TaskHarvest = 5053;

@@ -62,15 +64,15 @@ public class ABILITY

cs

	public const int ActPray = 6050;

	public const int ActEscape = 6400; 
	public const int ActZap = 5051; 

	public const int ActBash = 5052; 
	public const int ActEscape = 6400; 

	public const int ActSuicide = 6410; 
	public const int ActCancelTask = 5033; 

	public const int GoalIdle = 5034; 
	public const int AI_Deconstruct = 5031; 

	public const int AI_Equip = 5032; 
	public const int ActMelee = 5001; 

	public const int Melee = 5002;

@@ -98,11 +100,11 @@ public class ABILITY

cs

	public const int TaskPlow = 5014;

	public const int TaskAttack = 5015; 
	public const int AI_Equip = 5032; 

	public const int ActCancelTask = 5033; 
	public const int TaskAttack = 5015; 

	public const int TaskTame = 5016; 
	public const int TaskTalk = 5017; 

	public const int TaskPick = 5018;

@@ -130,15 +132,13 @@ public class ABILITY

cs

	public const int AI_ReleaseHeld = 5030;

	public const int AI_Deconstruct = 5031; 

	public const int TaskTalk = 5017; 

	public const int ActMelee = 5001; 
	public const int TaskTame = 5016; 

	public const int ActDuplicate = 6420;

	public const int ActCrabBreathe = 6500; 
	public const int ActSuicide = 6410; 

	public const int breathe_Darkness = 50203; 

	public const int ActLulwyTrick = 6902;

@@ -158,10 +158,10 @@ public class ABILITY

cs

	public const int breathe_Mind = 50204;

	public const int ActJureHeal = 6901; 

	public const int breathe_Poison = 50205;

	public const int breathe_Nether = 50206; 

	public const int breathe_Sound = 50207;

	public const int breathe_Nerve = 50208;

@@ -178,19 +178,19 @@ public class ABILITY

cs

	public const int breathe_Cut = 50214;

	public const int ActWait = 5000; 
	public const int ActJureHeal = 6901; 

	public const int breathe_Nether = 50206; 
	public const int StManaCost = 6720; 

	public const int ActManaAbsorb = 6900;

	public const int breathe_Darkness = 50203; 
	public const int ActGazeDim = 6620; 

	public const int StManaCost = 6720; 
	public const int ActCurse = 6600; 

	public const int ActEntangle = 6601;

	public const int ActCurse = 6600; 
	public const int ActWait = 5000; 

	public const int ActDraw = 6602;

@@ -202,11 +202,13 @@ public class ABILITY

cs

	public const int ActTouchSleep = 6612;

	public const int StTaunt = 6700; 

	public const int ActGazeInsane = 6621;

	public const int ActGazeMutation = 6622;

	public const int ActGazeDim = 6620; 
	public const int ActDrainBlood = 6626; 

	public const int ActInsult = 6630;

@@ -224,24 +226,22 @@ public class ABILITY

cs

	public const int ActThrowPotion = 6661;

	public const int StTaunt = 6700; 

	public const int ActDrainBlood = 6626; 
	public const int ActCrabBreathe = 6500; 

	public static readonly int[] IDS = new int[113]
	{
		5044, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 5045, 
		5046, 5047, 5048, 5049, 5050, 5035, 5051, 5053, 5054, 5055, 
		6001, 6003, 6011, 6012, 6013, 6015, 6018, 6019, 6020, 6050, 
		6400, 5052, 6410, 5034, 5032, 5002, 5003, 5004, 5005, 5006, 
		5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5015, 5033, 
		5016, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 5026, 
		5027, 5028, 5029, 5030, 5031, 5017, 5001, 6420, 6500, 6902, 
		6903, 6904, 7000, 50200, 50201, 50202, 6450, 50204, 6901, 50205, 
		50207, 50208, 50209, 50210, 50211, 50212, 50213, 50214, 5000, 50206, 
		6900, 50203, 6720, 6601, 6600, 6602, 6603, 6610, 6611, 6612, 
		6621, 6622, 6620, 6630, 6631, 6640, 6641, 6642, 6650, 6660, 
		6661, 6700, 6626
		5044, 5035, 5036, 5037, 5038, 5039, 5040, 5041, 5042, 5043, 
		5045, 5046, 5047, 5048, 5049, 5034, 5050, 5052, 5053, 5054, 
		5055, 6001, 6003, 6011, 6012, 6013, 6015, 6018, 6019, 6020, 
		6050, 5051, 6400, 5033, 5031, 5001, 5002, 5003, 5004, 5005, 
		5006, 5007, 5008, 5009, 5010, 5011, 5012, 5013, 5014, 5032, 
		5015, 5017, 5018, 5019, 5020, 5021, 5022, 5023, 5024, 5025, 
		5026, 5027, 5028, 5029, 5030, 5016, 6420, 6410, 50203, 6902, 
		6903, 6904, 7000, 50200, 50201, 50202, 6450, 50204, 50205, 50206, 
		50207, 50208, 50209, 50210, 50211, 50212, 50213, 50214, 6901, 6720, 
		6900, 6620, 6600, 6601, 5000, 6602, 6603, 6610, 6611, 6612, 
		6700, 6621, 6622, 6626, 6630, 6631, 6640, 6641, 6642, 6650, 
		6660, 6661, 6500
	};
}
public class Ability : Act

AM_Build

@@ -379,6 +379,10 @@ public void ModAltitude(int a)

cs

	public void SetAltitude(int a)
	{
		if (mold == null) 
		{ 
			CreateNewMold(); 
		} 
		altitude = (mold.altitude = a);
		recipe.OnChangeAltitude(a);
		if (recipe.tileType.AltitudeAsDir && !IsRoofEditMode())

ActEffect

@@ -2206,7 +2206,7 @@ public static bool Wish(string s, string name, int power)

cs
		{
			continue;
		}
		string text = r.GetName(1).ToLower(); 
		string text = r.GetName().ToLower(); 
		int score = Compare(_s, text);
		if (score == 0)
		{

Affinity

@@ -62,6 +62,7 @@ public bool CanSleepBeside()

cs

	public Thing OnGift(Thing t)
	{
		t.CheckJustCooked(); 
		Thing result = CC.AddThing(t.Thing);
		EClass.pc.PlaySound("build_resource");
		int num = 0;

@@ -73,7 +74,7 @@ public Thing OnGift(Thing t)

cs
		flag2 = true;
	}
	num = Mathf.Clamp(t.GetPrice() / (flag2 ? 10 : (flag ? 20 : 200)), 0, 50) + (flag2 ? 20 : (flag ? 5 : 0));
	num = num * 100 / (100 + CC.LV * 10); 
	num = num * (100 + (t.HasElement(757) ? 50 : 0)) / (100 + CC.LV * 10); 
	if (num2)
	{
		num += 100;

Biography

@@ -275,8 +275,6 @@ public int age

cs
		}
	}

	public int ageOriginal => EClass.game.Prologue.year - birthYear; 

	public bool IsUnderAge => age < 18;

	public string TextAge(Chara c)

@@ -284,7 +282,7 @@ public string TextAge(Chara c)

cs
	object obj;
	if (age < 1000)
	{
		obj = (c.IsUnique ? ageOriginal : age).ToString(); 
		obj = (c.IsUnique ? GetOriginalAge(c) : age).ToString(); 
		if (obj == null)
		{
			return "";

@@ -297,6 +295,16 @@ public string TextAge(Chara c)

cs
		return (string)obj;
	}

	public int GetOriginalAge(Chara c) 
	{ 
		string[] array = c.source.bio.Split('/'); 
		if (array.Length > 1) 
		{ 
			return int.Parse(array[1]); 
		} 
		return age; 
	} 

	public void Generate(Chara c)
	{
		string bio = c.source.bio;

ButtonElement

@@ -77,12 +77,12 @@ public void Refresh()

cs
		break;
	case Mode.LandFeat:
	{
		string text2 = text + e.Name; 
		string text3 = text + e.Name; 
		if (e.HasTag("network") && EClass.Branch != null && EClass.Branch.HasNetwork)
		{
			text2 = "feat_network".lang(text2); 
			text3 = "feat_network".lang(text3); 
		}
		mainText.SetText(text2 + " " + e.Value, FontColor.Default); 
		mainText.SetText(text3 + " " + e.Value, FontColor.Default); 
		subText.horizontalOverflow = HorizontalWrapMode.Overflow;
		subText.text = e.GetDetail().SplitNewline()[0].StripLastPun();
		if ((bool)imagePotential)

@@ -96,20 +96,21 @@ public void Refresh()

cs
	case Mode.FeatMini:
		if (mode == Mode.FeatPurchase)
		{
			mainText.SetText(e.FullName, FontColor.Default); 
			e.IsPurchaseFeatReqMet(EClass.pc.elements); 
			mainText.SetText(e.FullName, e.IsPurchaseFeatReqMet(EClass.pc.elements) ? FontColor.Default : FontColor.Warning); 
			subText.text = e.GetDetail().SplitNewline()[0].StripLastPun();
			subText2.text = "".TagColor((EClass.pc.feat >= e.CostLearn) ? EClass.Colors.Skin.textGood : EClass.Colors.Skin.textBad, e.CostLearn.ToString() ?? "");
		}
		else
		{
			string text3 = ((mode == Mode.FeatMini) ? e.FullName : e.source.GetText("textPhase").SplitNewline().TryGet(e.Value - 1) 
			string text2 = ((mode == Mode.FeatMini) ? e.FullName : e.source.GetText("textPhase").SplitNewline().TryGet(e.Value - 1) 
				.StripLastPun());
			FontColor c = (e.HasTag("neg") ? FontColor.Bad : FontColor.ButtonSelectable);
			if (e.source.category == "ether")
			{
				c = FontColor.Ether;
			}
			mainText.SetText(text + text3, c); 
			mainText.SetText(text + text2, c); 
			subText.text = ((mode == Mode.FeatMini) ? "" : (e as Feat).GetHint(owner));
		}
		if ((bool)imagePotential)

@@ -145,7 +146,7 @@ public void Refresh()

cs
		imagePotential.color = ((num >= 0) ? Color.white : new Color(1f, 0.7f, 0.7f));
	}
	e.SetImage(icon);
	if (mode == Mode.FeatPurchase && e.Value > 1) 
	if (mode == Mode.FeatPurchase) 
	{
		Element refEle = Element.Create(e.id, e.Value - 1);
		SetTooltip("note", delegate(UITooltip tt)

CINT

@@ -102,6 +102,8 @@ public class CINT

cs

	public const int bossType = 65;

	public const int dateCooked = 66; 

	public const int fiamaPet = 100;

	public const int noRestock = 101;

Card

@@ -1237,6 +1237,18 @@ public int c_fur

cs
		}
	}

	public int c_dateCooked 
	{ 
		get 
		{ 
			return GetInt(66); 
		} 
		set 
		{ 
			SetInt(66, value); 
		} 
	} 

	public int c_containerSize
	{
		get

@@ -5549,6 +5561,10 @@ public void DecayNatural(int hour = 1)

cs
		{
			t.DecayNatural(hour);
		});
		if (sourceCard._origin == "dish") 
		{ 
			CheckJustCooked(); 
		} 
		if (parent is Card && (parent as Card).trait.CanChildDecay(this))
		{
			Decay(10 * hour);

@@ -5560,6 +5576,15 @@ public void DecayNatural(int hour = 1)

cs
		}
	}

	public void CheckJustCooked() 
	{ 
		if (HasElement(757) && c_dateCooked <= EClass.world.date.GetRaw() - 120) 
		{ 
			c_dateCooked = 0; 
			elements.Remove(757); 
		} 
	} 

	public void Decay(int a = 10)
	{
		Card card = parent as Card;

Chara

@@ -1547,7 +1547,7 @@ public int GetBurden(Card t = null, int num = -1)

cs

	public void CalcBurden()
	{
		int num = base.ChildrenWeight * 100 / WeightLimit; 
		int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit); 
		if (num < 0)
		{
			num = 1000;

@@ -6220,13 +6220,20 @@ public void ShowDialog()

cs
		{
			string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
			ShowDialog("guild_doorman", "main", tag);
			return; 
		}
		else if (trait is TraitGuildClerk) 
		if (trait is TraitGuildClerk) 
		{
			string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
			ShowDialog("guild_clerk", "main", tag2);
			return; 
		} 
		bool flag = true; 
		if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing)) 
		{ 
			flag = false; 
		}
		else if (File.Exists(CorePath.DramaData + id + ".xlsx")) 
		if (flag && File.Exists(CorePath.DramaData + id + ".xlsx")) 
		{
			ShowDialog(id);
		}

@@ -8577,14 +8584,14 @@ public void ModCorruption(int a)

cs
		corruption = num2 * 100 + corruption % 100;
	}

	public List<Element> ListAvailabeFeats(bool pet = false) 
	public List<Element> ListAvailabeFeats(bool pet = false, bool showAll = false) 
	{
		List<Element> list = new List<Element>();
		foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
		{
			Feat feat = elements.GetOrCreateElement(item.id) as Feat;
			int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
			if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && feat.IsAvailable(elements, feat.Value)) 
			if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements))) 
			{
				list.Add(Element.Create(feat.id, num) as Feat);
			}

ContentConfigGame

@@ -45,6 +45,8 @@ public class ContentConfigGame : ContentConfig

cs

	public UIButton toggleAutoBackup;

	public UIButton toggleSortEach; 

	public UISelectableGroup groupBackerFilter;

	public UISelectableGroup groupBorder;

@@ -145,6 +147,10 @@ public override void OnInstantiate()

cs
	{
		base.config.game.advancedMenu = on;
	});
	toggleSortEach.SetToggle(base.config.game.sortEach, delegate(bool on) 
	{ 
		base.config.game.sortEach = on; 
	}); 
	toggleOffhand.SetToggle(base.config.game.showOffhand, delegate(bool on)
	{
		base.config.game.showOffhand = on;

CoreConfig

@@ -108,6 +108,8 @@ public class GameConfig

cs

		public bool autoBackup;

		public bool sortEach; 

		public bool autopause;

		public bool showQuickMenuHint;

CraftUtil

@@ -151,7 +151,7 @@ public static Card MixIngredients(Card product, List<Thing> ings, MixType type,

cs
	foreach (Element value2 in product.elements.dict.Values)
	{
		int id = value2.id;
		if ((uint)(id - 914) > 1u && value2.Value >= 0 && IsValidTrait(value2)) 
		if ((uint)(id - 914) > 1u && value2.Value >= 0 && (value2.HasTag("noInherit") || IsValidTrait(value2))) 
		{
			product.elements.SetTo(value2.id, 0);
		}

@@ -222,6 +222,10 @@ public static Card MixIngredients(Card product, List<Thing> ings, MixType type,

cs
	return product;
	bool IsValidTrait(Element e)
	{
		if (e.HasTag("noInherit")) 
		{ 
			return false; 
		} 
		switch (type)
		{
		case MixType.General:

DOMAIN

@@ -2,42 +2,42 @@

cs

public class DOMAIN
{
	public const int domArcane = 804; 
	public const int domMiracle = 803; 

	public const int domTest = 800; 
	public const int domFaith = 802; 

	public const int domSurvival = 801; 
	public const int domTest = 800; 

	public const int domFaith = 802; 
	public const int domArcane = 804; 

	public const int domMiracle = 803; 
	public const int domSurvival = 801; 

	public const int domComm = 805;

	public const int domEarth = 812; 
	public const int domEyth = 814; 

	public const int domWind = 807;

	public const int domHarvest = 808; 
	public const int domEarth = 812; 

	public const int domMachine = 809; 
	public const int domElement = 806; 

	public const int domLuck = 810; 
	public const int domOblivion = 813; 

	public const int domHealing = 811; 
	public const int domHarmony = 815; 

	public const int domEyth = 814; 
	public const int domLuck = 810; 

	public const int domOblivion = 813; 
	public const int domMachine = 809; 

	public const int domElement = 806; 
	public const int domHarvest = 808; 

	public const int domHarmony = 815; 
	public const int domHealing = 811; 

	public static readonly int[] IDS = new int[16]
	{
		804, 800, 801, 802, 803, 805, 812, 807, 808, 809, 
		810, 811, 814, 813, 806, 815
		803, 802, 800, 804, 801, 805, 814, 807, 812, 806, 
		813, 815, 810, 809, 808, 811
	};
}
public class Domain : EClass

DramaActor

@@ -75,7 +75,7 @@ public void Talk(string text, List<DramaChoice> choices, bool center, bool unkno

cs
			dialog.transRank.SetActive(flag);
			if (flag)
			{
				dialog.textRank.text = "factionRank2".lang() + " " + chara.trait.GetAdvRankText(); 
				dialog.textRank.text = "factionRank2".lang() + " " + chara.trait.GetAdvRankText() + " " + ((chara.GetInt(111) > 0) ? "advDefeated".lang(chara.GetInt(111).ToString() ?? "") : ""); 
			}
		}
		if (chara != null)

DramaOutcome

@@ -58,6 +58,16 @@ public void AddMaid()

cs
	{
	}

	public void convert_Jure() 
	{ 
		EMono.game.religions.Healing.JoinFaith(EMono.pc, Religion.ConvertType.Campaign); 
		if (!EMono.player.flags.gotJurePillow) 
		{ 
			EMono.player.flags.gotJurePillow = true; 
			EMono.player.DropReward(ThingGen.Create("pillow_jure")); 
		} 
	} 

	public void QuestSharedContainer_Drop1()
	{
		EMono.player.DropReward(ThingGen.Create("chest6"));

ELEMENT

@@ -5,9 +5,9 @@

cs

public class ELEMENT
{
	public const int hotspring = 756; 
	public const int justcooked = 757; 

	public const int blood = 755; 
	public const int hotspring = 756; 

	public const int nerve = 754;

@@ -19,15 +19,17 @@ public class ELEMENT

cs

	public const int comfort = 750;

	public const int blood = 755; 

	public const int _void = 0;

	public const int d = 3; 
	public const int socket = 5; 

	public const int lv = 1;

	public const int quality = 2;

	public const int socket = 5; 
	public const int d = 3; 

	public const int nutrition = 10;

@@ -65,11 +67,12 @@ public class ELEMENT

cs

	public const int poison = 20;

	public static readonly int[] IDS = new int[30] 
	public static readonly int[] IDS = new int[31] 
	{
		756, 755, 754, 753, 752, 751, 750, 0, 3, 1, 
		2, 5, 10, 11, 12, 13, 14, 16, 17, 18, 
		15, 21, 22, 23, 24, 25, 26, 29, 85, 20
		757, 756, 754, 753, 752, 751, 750, 755, 0, 5, 
		1, 2, 3, 10, 11, 12, 13, 14, 16, 17, 
		18, 15, 21, 22, 23, 24, 25, 26, 29, 85, 
		20
	};
}
public class Element : EClass

@@ -554,7 +557,14 @@ public void WriteNoteWithRef(UINote n, ElementContainer owner, Action<UINote> on

cs
	{
		n.Clear();
		_WriteNote(n, owner, onWriteNote, isRef: false);
		refEle._WriteNote(n, owner, onWriteNote, isRef: true); 
		if (refEle.Value > 0) 
		{ 
			refEle._WriteNote(n, owner, onWriteNote, isRef: true); 
		} 
		if (!IsPurchaseFeatReqMet(owner)) 
		{ 
			WritePurchaseReq(n); 
		} 
		n.Build();
	}

@@ -844,6 +854,15 @@ public virtual void SetTextValue(UIText text)

cs
		text.text = text2;
	}

	public virtual bool IsPurchaseFeatReqMet(ElementContainer owner, int lv = -1) 
	{ 
		return false; 
	} 

	public virtual void WritePurchaseReq(UINote n, int lv = 1) 
	{ 
	} 

	public static Element Create(int id, int v = 0)
	{
		SourceElement.Row row = EClass.sources.elements.map.TryGetValue(id);

ENC

@@ -1,30 +1,28 @@

cs
public class ENC
{
	public const int noDamage = 654; 

	public const int living = 653;

	public const int eco = 652;

	public const int r_PV = 651;

	public const int r_DV = 650; 

	public const int mod_scatter = 607; 

	public const int mod_precision = 605; 
	public const int r_mana = 641; 

	public const int mod_drill = 606;

	public const int r_life = 640; 

	public const int noDamage = 654; 
	public const int mod_scatter = 607; 

	public const int r_mana = 641; 
	public const int r_life = 640; 

	public const int onlyPet = 655;

	public const int convertCold = 851; 
	public const int r_DV = 650; 

	public const int absorbHP = 660; 
	public const int permaCurse = 656; 

	public const int convertFire = 850; 

	public const int absorbMP = 661;

@@ -38,21 +36,21 @@ public class ENC

cs

	public const int meleeDistance = 666;

	public const int convertLightning = 852; 
	public const int convertCold = 851; 

	public const int mod_ammo_recover = 604; 
	public const int mod_precision = 605; 

	public const int convertImpact = 865;

	public const int convertFire = 850; 
	public const int convertLightning = 852; 

	public const int permaCurse = 656; 
	public const int absorbHP = 660; 

	public const int mod_ammo_knockback = 603; 
	public const int mod_ammo_recover = 604; 

	public const int sustain_MAG = 446; 
	public const int sustain_CHA = 447; 

	public const int mod_reload = 601; 
	public const int mod_rapid = 602; 

	public const int breathing = 429;

@@ -108,13 +106,17 @@ public class ENC

cs

	public const int negateParalysis = 422;

	public const int revealFaith = 481; 
	public const int force_weapon = 482; 

	public const int mod_reload = 601; 

	public const int mod_ammo = 600;

	public const int optimizeMana = 483;

	public const int force_weapon = 482; 
	public const int sustain_DEX = 442; 

	public const int revealFaith = 481; 

	public const int strongStomach = 480;

@@ -132,11 +134,13 @@ public class ENC

cs

	public const int bane_fairy = 462;

	public const int bane_undead = 461; 
	public const int mod_ammo_knockback = 603; 

	public const int mod_rapid = 602; 
	public const int bane_dragon = 460; 

	public const int sustain_CHA = 447; 
	public const int bane_undead = 461; 

	public const int sustain_MAG = 446; 

	public const int sustain_WIL = 445;

@@ -144,19 +148,15 @@ public class ENC

cs

	public const int sustain_PER = 443;

	public const int sustain_DEX = 442; 

	public const int bane_dragon = 460; 

	public static readonly int[] IDS = new int[74]
	{
		653, 652, 651, 650, 607, 605, 606, 640, 654, 641, 
		655, 851, 660, 661, 662, 663, 664, 665, 666, 852, 
		604, 865, 850, 656, 603, 446, 601, 429, 428, 427, 
		426, 425, 424, 423, 421, 420, 416, 415, 440, 412, 
		410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 
		400, 411, 441, 422, 481, 600, 483, 482, 480, 468, 
		467, 466, 465, 464, 463, 462, 461, 602, 447, 445, 
		444, 443, 442, 460
		654, 653, 652, 651, 641, 606, 607, 640, 655, 650, 
		656, 850, 661, 662, 663, 664, 665, 666, 851, 605, 
		865, 852, 660, 604, 447, 602, 429, 428, 427, 426, 
		425, 424, 423, 421, 420, 416, 415, 440, 412, 410, 
		409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 
		411, 441, 422, 482, 601, 600, 483, 442, 481, 480, 
		468, 467, 466, 465, 464, 463, 462, 603, 460, 461, 
		446, 445, 444, 443
	};
}

FACTION

@@ -4,25 +4,27 @@

cs

public class FACTION
{
	public const int fRation = 2207; 

	public const int bfCave = 3500;

	public const int bfPlain = 3600;

	public const int bfForest = 3601;

	public const int bfBeach = 3604; 

	public const int bfHill = 3603; 
	public const int bfSnow = 3602; 

	public const int bfSea = 3605;

	public const int bfBeach = 3604; 

	public const int fRation = 2207; 

	public const int bfFertile = 3700;

	public const int bfGeyser = 3701;

	public const int bfSnow = 3602; 
	public const int bfRuin = 3702; 

	public const int bfHill = 3603; 

	public const int fAttraction = 2206;

@@ -36,29 +38,29 @@ public class FACTION

cs

	public const int fSoil = 2200;

	public const int fTaxEvasion = 2119; 

	public const int fLuck = 2118;

	public const int fLoyal = 2117;

	public const int fEducation = 2116;

	public const int fHeirloom = 2120; 

	public const int fAdmin = 2115;

	public const int bfRuin = 3702; 
	public const int bfTranquil = 3703; 

	public const int fConstruction = 2003;

	public const int fSafety = 2205;

	public const int fTaxEvasion = 2119; 
	public const int fHeirloom = 2120; 

	public const int bfTranquil = 3703; 
	public const int bfVolcano = 3704; 

	public const int bfHunt = 3705; 
	public const int bfFish = 3706; 

	public const int bfVolcano = 3704; 
	public const int bfHunt = 3705; 

	public const int actBuildRecipe = 4005;

@@ -80,10 +82,10 @@ public class FACTION

cs

	public const int bfGum = 3803;

	public const int bfSilica = 3802; 

	public const int actBuildInspect = 4006;

	public const int bfMushroom = 3801; 

	public const int bfCoal = 3800;

	public const int bfLandmark5 = 3784;

@@ -104,18 +106,16 @@ public class FACTION

cs

	public const int bfMonster = 3707;

	public const int bfFish = 3706; 

	public const int bfMushroom = 3801; 
	public const int bfSilica = 3802; 

	public static readonly int[] IDS = new int[52]
	{
		2207, 3500, 3600, 3601, 3604, 3603, 3605, 3700, 3701, 3602, 
		2206, 2203, 2204, 2202, 2201, 2200, 2118, 2117, 2116, 2120, 
		2115, 3702, 2003, 2205, 2119, 3703, 3705, 3704, 4005, 4004, 
		4003, 4002, 4001, 4000, 3900, 3805, 3804, 3803, 3802, 4006, 
		3800, 3784, 3783, 3782, 3781, 3780, 3710, 3709, 3708, 3707, 
		3706, 3801
		3500, 3600, 3601, 3602, 3605, 3604, 2207, 3700, 3701, 3702, 
		3603, 2206, 2203, 2204, 2202, 2201, 2200, 2119, 2118, 2117, 
		2116, 2115, 3703, 2003, 2205, 2120, 3704, 3706, 3705, 4005, 
		4004, 4003, 4002, 4001, 4000, 3900, 3805, 3804, 3803, 4006, 
		3801, 3800, 3784, 3783, 3782, 3781, 3780, 3710, 3709, 3708, 
		3707, 3802
	};
}
public class Faction : EClass

@@ -379,7 +379,7 @@ public void OnAdvanceMonth()

cs
	Msg.Say("getBill", Lang._currency(num, "money"));
	TryPayBill(thing2);
	Msg.Say("bills", EClass.player.taxBills.ToString() ?? "");
	if (EClass.player.taxBills >= 4) 
	if (EClass.player.taxBills >= 4 && !EClass.debug.godMode) 
	{
		EClass.player.ModKarma(-50);
	}

FEAT

@@ -3,15 +3,13 @@

cs

public class FEAT
{
	public const int featStamina = 1612; 

	public const int featSTR = 1620;

	public const int featDEX = 1621;

	public const int featCHA = 1627; 
	public const int featEND = 1622; 

	public const int featPER = 1623; 
	public const int featLuck = 1628; 

	public const int featLER = 1624;

@@ -19,17 +17,21 @@ public class FEAT

cs

	public const int featWIL = 1626;

	public const int featEND = 1622; 
	public const int featCHA = 1627; 

	public const int featMana = 1611; 
	public const int featPER = 1623; 

	public const int featSwordsage = 1418; 
	public const int featStamina = 1612; 

	public const int featMilitant = 1419; 

	public const int featLife = 1610; 

	public const int featManaMeat = 1421;

	public const int featExecutioner = 1420;

	public const int featMilitant = 1419; 
	public const int featSwordsage = 1418; 

	public const int featWitch = 1417;

@@ -41,19 +43,19 @@ public class FEAT

cs

	public const int featFairysan = 1413;

	public const int featLuckyCat = 1412; 
	public const int featSPD = 1629; 

	public const int featLuck = 1628; 
	public const int featMana = 1611; 

	public const int featLife = 1610; 
	public const int featHardy = 1630; 

	public const int featSPD = 1629; 
	public const int featLonelySoul = 1646; 

	public const int featParty = 1645; 
	public const int featEvade = 1632; 

	public const int featDefense = 1631; 
	public const int featLuckyCat = 1412; 

	public const int featEarthStrength = 1411; 
	public const int featChef = 1658; 

	public const int featManaCost = 1657;

@@ -71,11 +73,11 @@ public class FEAT

cs

	public const int featDefender = 1649;

	public const int featRapidMagic = 1648; 
	public const int featDefense = 1631; 

	public const int featHardy = 1630; 
	public const int featRapidMagic = 1648; 

	public const int featSummoner = 1647; 
	public const int featParty = 1645; 

	public const int featBodyParts = 1644;

@@ -95,15 +97,13 @@ public class FEAT

cs

	public const int featSpotting = 1633;

	public const int featEvade = 1632; 

	public const int featLonelySoul = 1646; 
	public const int featSummoner = 1647; 

	public const int featReboot = 1410; 
	public const int featEarthStrength = 1411; 

	public const int featHeavyCasting = 1654;

	public const int featPaladin2 = 1408; 
	public const int featBoost = 1409; 

	public const int featShiva = 1224;

@@ -155,7 +155,7 @@ public class FEAT

cs

	public const int featFate = 1220;

	public const int featBoost = 1409; 
	public const int featReboot = 1410; 

	public const int featSlowFood = 1200;

@@ -203,7 +203,7 @@ public class FEAT

cs

	public const int featCosmicHorror = 1233;

	public const int featThief = 1401; 
	public const int featWizard = 1402; 

	public const int featGod_moonshadow1 = 1350;

@@ -211,31 +211,34 @@ public class FEAT

cs

	public const int featWarrior = 1400;

	public const int featWizard = 1402; 
	public const int featThief = 1401; 

	public const int featFarmer = 1403;

	public const int featPianist = 1405; 
	public const int featArcher = 1404; 

	public const int featTourist = 1406;

	public const int featArcher = 1404; 
	public const int featPianist = 1405; 

	public const int featPaladin2 = 1408; 

	public const int featPaladin = 1407;

	public static readonly int[] IDS = new int[110] 
	public static readonly int[] IDS = new int[111] 
	{
		1612, 1620, 1621, 1627, 1623, 1624, 1625, 1626, 1622, 1611, 
		1418, 1421, 1420, 1419, 1417, 1416, 1415, 1414, 1413, 1412, 
		1628, 1610, 1629, 1645, 1631, 1411, 1657, 1656, 1655, 1653, 
		1652, 1651, 1650, 1649, 1648, 1630, 1647, 1644, 1643, 1642, 
		1641, 1640, 1636, 1635, 1634, 1633, 1632, 1646, 1410, 1654, 
		1408, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 
		1620, 1621, 1622, 1628, 1624, 1625, 1626, 1627, 1623, 1612, 
		1419, 1610, 1421, 1420, 1418, 1417, 1416, 1415, 1414, 1413, 
		1629, 1611, 1630, 1646, 1632, 1412, 1658, 1657, 1656, 1655, 
		1653, 1652, 1651, 1650, 1649, 1631, 1648, 1645, 1644, 1643, 
		1642, 1641, 1640, 1636, 1635, 1634, 1633, 1647, 1411, 1654, 
		1409, 1224, 1225, 1226, 1227, 1228, 1229, 1230, 1231, 1232, 
		1234, 1235, 1236, 1237, 1300, 1305, 1310, 1315, 1320, 1325,
		1330, 1335, 1223, 1340, 1222, 1220, 1409, 1200, 1201, 1202, 
		1330, 1335, 1223, 1340, 1222, 1220, 1410, 1200, 1201, 1202, 
		1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212,
		1213, 1214, 1215, 1216, 1217, 1218, 1219, 1221, 1345, 1233,
		1401, 1350, 1355, 1400, 1402, 1403, 1405, 1406, 1404, 1407
		1402, 1350, 1355, 1400, 1401, 1403, 1404, 1406, 1405, 1408, 
		1407
	};
}
public class Feat : Element

@@ -293,12 +296,12 @@ public string GetHint(ElementContainer owner)

cs
		return text.TrimEnd(' ').TrimEnd(',');
	}

	public bool IsAvailable(ElementContainer owner, int a = 1) 
	public override bool IsPurchaseFeatReqMet(ElementContainer owner, int lv = -1) 
	{
		if (base.source.req.Length != 0)
		{
			Element element = owner.GetElement(base.source.req[0]);
			if (element == null || element.ValueWithoutLink < ((base.source.req.Length == 1) ? 1 : base.source.req[Mathf.Clamp(a, 1, base.source.req.Length - 1)].ToInt())) 
			if (element == null || element.ValueWithoutLink < ((base.source.req.Length == 1) ? 1 : base.source.req[Mathf.Clamp((lv == -1) ? (owner.Value(id) + 1) : lv, 1, base.source.req.Length - 1)].ToInt())) 
			{
				return false;
			}

@@ -306,6 +309,21 @@ public bool IsAvailable(ElementContainer owner, int a = 1)

cs
		return true;
	}

	public override void WritePurchaseReq(UINote n, int lv = -1) 
	{ 
		Debug.Log("a"); 
		if (base.source.req.Length != 0) 
		{ 
			Element element = Element.Create(base.source.req[0], (base.source.req.Length == 1) ? 1 : base.source.req[Mathf.Clamp((lv == -1) ? (owner.Value(id) + 1) : lv, 1, base.source.req.Length - 1)].ToInt()); 
			Debug.Log(element); 
			if (element != null) 
			{ 
				n.AddHeader("featReq"); 
				n.AddText(element.Name + ": " + element.Value, FontColor.Bad); 
			} 
		} 
	} 

	public List<string> Apply(int a, ElementContainer owner, bool hint = false)
	{
		if (hint)

FOOD

@@ -1,9 +1,11 @@

cs
public class FOOD
{
	public const int food_poison = 702; 
	public const int food_cat = 701; 

	public const int food_CHA = 700;

	public const int food_poison = 702; 

	public const int food_love = 703;

	public const int food_bug = 704;

@@ -12,7 +14,5 @@ public class FOOD

cs

	public const int loseWeight = 706;

	public const int food_cat = 701; 

	public static readonly int[] IDS = new int[7] { 702, 700, 703, 704, 705, 706, 701 }; 
	public static readonly int[] IDS = new int[7] { 701, 700, 702, 703, 704, 705, 706 }; 
}

FoodEffect

@@ -81,9 +81,10 @@ public static bool IsUndeadFlesh(CardRow r)

cs

	public static void Proc(Chara c, Thing food)
	{
		food.CheckJustCooked(); 
		bool flag = EClass._zone.IsPCFaction && c.IsInSpot<TraitSpotDining>();
		int num = (food.isCrafted ? ((EClass.pc.Evalue(1650) >= 3) ? 5 : 0) : 0);
		float num2 = (float)(100 + (flag ? 10 : 0) + num + Mathf.Min(food.QualityLv * 10, 100)) / 200f; 
		float num2 = (float)(100 + (food.HasElement(757) ? 10 : 0) + (flag ? 10 : 0) + num + Mathf.Min(food.QualityLv * 10, 100)) / 200f; 
		if (num2 < 0.1f)
		{
			num2 = 0.1f;

+FortuneRollData

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

public class FortuneRollData : EClass
{
	public class Prize : EClass
	{
		[JsonProperty]
		public int grade;

		[JsonProperty]
		public string id;

		[JsonProperty]
		public bool claimed;

		public Card model => EClass.sources.cards.map[id].model;

		public int GetNum()
		{
			if (id == "medal")
			{
				if (grade != 2)
				{
					if (grade != 3)
					{
						return 1;
					}
					return 10;
				}
				return 3;
			}
			if (id == "plat")
			{
				if (grade != 1)
				{
					if (grade != 2)
					{
						if (grade != 3)
						{
							return 1;
						}
						return 50;
					}
					return 20;
				}
				return 10;
			}
			if (id == "1165" && grade == 3)
			{
				return 3;
			}
			return 1;
		}

		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();
			int num = GetNum();
			if (num > 1)
			{
				text2 = text2 + " x " + num;
			}
			if (claimed)
			{
				text2 = "fortuneroll_claimed".lang();
			}
			n.AddTopic("TopicDomain", text, text2.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 };

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

	[JsonProperty]
	public int count;

	[JsonProperty]
	public int seed;

	[JsonProperty]
	public int dateNextRefresh;

	public void Refresh()
	{
		if (EClass.world.date.GetRaw() >= dateNextRefresh)
		{
			Date date = EClass.world.date.Copy();
			date.day = 1;
			date.hour = 0;
			date.min = 0;
			date.AddMonth(1);
			dateNextRefresh = date.GetRaw();
			count++;
			RefreshPrize();
		}
	}

	public void RefreshPrize()
	{
		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);
		Rand.SetSeed();
		void Add(int grade)
		{
			List<string> list2 = list[grade];
			int index = EClass.rnd(list2.Count);
			Prize item = new Prize
			{
				id = list2[index],
				grade = grade
			};
			prizes.Add(item);
			list2.RemoveAt(index);
		}
	}

	public List<List<string>> GetPrizeList()
	{
		return new List<List<string>>
		{
			new List<string> { "scrubber", "tissue", "plat" },
			new List<string>
			{
				"microchip", "1089", "150", "855", "medal", "water", "goods_charm", "electronicsS", "electronics", "plat",
				"plat"
			},
			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"
			},
			new List<string> { "goods_coin", "goods_coin", "plat", "1165", "boat3", "medal" }
		};
	}

	public void GetPrize(int grade, int seed)
	{
		Rand.SetSeed(seed);
		Prize prize = null;
		List<Prize> list = prizes.Where((Prize p) => p.grade == grade && !p.claimed).ToList();
		if (list.Count > 0)
		{
			prize = list.RandomItem();
		}
		Thing thing = null;
		if (prize != null)
		{
			thing = ThingGen.Create(prize.id).SetNum(prize.GetNum());
			if (grade != 3)
			{
				prize.claimed = true;
			}
		}
		else
		{
			thing = ThingGen.Create(GetPrizeList()[0].RandomItem());
		}
		EClass.pc.Pick(thing);
		Rand.SetSeed();
	}

	public void WriteNote(UINote n)
	{
		n.Clear();
		n.AddHeader("fortuneroll_prize");
		n.Space(4);
		foreach (Prize prize in prizes)
		{
			prize.AddNote(n);
		}
		string text = "_circle".lang().TagColor(Color.white) + "  " + Lang.GetList("fortuneroll")[0];
		n.AddTopic("TopicDomain", text, "fortuneroll_lose".lang());
		n.Build();
	}
}

Game

@@ -53,6 +53,9 @@ public class Config : EClass

cs
		[JsonProperty]
		public bool cheat;

		[JsonProperty] 
		public bool showAllFeat; 

		[JsonProperty]
		public int slopeMod = 50;

InvOwnerDraglet

@@ -75,8 +75,9 @@ public override void OnClick(ButtonGrid button)

cs
		{
			button.SetCard(null);
			dragGrid.RefreshCurrentGrid();
			dragGrid.uiIngredients.Refresh(); 
		}
		dragGrid.TryPutBack(); 
		dragGrid.uiIngredients.Refresh(); 
		SE.Equip();
		if (EClass.pc.ai is AI_UseCrafter && EClass.pc.ai.IsRunning)
		{

LayerDragGrid

@@ -5,8 +5,17 @@

cs

public class LayerDragGrid : LayerBaseCraft
{
	public class PutbackInfo
	{ 
		public Thing thing; 

		public Thing container; 
	} 

	public static LayerDragGrid Instance;

	public List<PutbackInfo> putBacks = new List<PutbackInfo>(); 

	public UIItem itemCost;

	public Image imageOwner;

@@ -310,6 +319,36 @@ public void Redraw()

cs
		LayerInventory.SetDirtyAll(immediate: true);
	}

	public void AddPutBack(Thing t, Thing container) 
	{ 
		if (container != null) 
		{ 
			putBacks.Add(new PutbackInfo
			{ 
				thing = t, 
				container = container 
			}); 
		} 
	} 

	public void TryPutBack() 
	{ 
		foreach (PutbackInfo putBack in putBacks) 
		{ 
			if (!putBack.thing.isDestroyed && putBack.thing.Num != 0 && putBack.thing.parent != putBack.container && !putBack.container.isDestroyed) 
			{ 
				putBack.container.AddCard(putBack.thing); 
			} 
		} 
		putBacks.Clear(); 
		RefreshCurrentGrid(); 
	} 

	public override void OnEndCraft() 
	{ 
		TryPutBack(); 
	} 

	public override void OnKill()
	{
		EInput.haltInput = false;

MUTATION

@@ -6,19 +6,17 @@ public class MUTATION

cs

	public const int mutationDexN = 1515;

	public const int mutationDex = 1514; 
	public const int etherPoisonHand = 1565; 

	public const int etherManaBattery = 1564; 
	public const int mutationEyeN = 1513; 

	public const int mutationEye = 1512;

	public const int mutationSkinN = 1511;

	public const int etherPoisonHand = 1565; 

	public const int mutationSpeed = 1518;

	public const int mutationEyeN = 1513; 
	public const int mutationDex = 1514; 

	public const int mutationSpeedN = 1519;

@@ -26,6 +24,8 @@ public class MUTATION

cs

	public const int mutationStrN = 1521;

	public const int etherManaBattery = 1564; 

	public const int etherProvoke = 1563;

	public const int mutationStr = 1520;

@@ -78,8 +78,8 @@ public class MUTATION

cs

	public static readonly int[] IDS = new int[38]
	{
		1517, 1516, 1515, 1514, 1564, 1512, 1511, 1565, 1518, 1513, 
		1519, 1510, 1521, 1563, 1520, 1561, 1560, 1559, 1558, 1557, 
		1517, 1516, 1515, 1565, 1513, 1512, 1511, 1518, 1514, 1519, 
		1510, 1521, 1564, 1563, 1520, 1561, 1560, 1559, 1558, 1557, 
		1556, 1555, 1554, 1553, 1552, 1562, 1551, 1522, 1524, 1525,
		1526, 1527, 1523, 1529, 1530, 1531, 1550, 1528
	};

POLICY

@@ -49,7 +49,7 @@ public class POLICY

cs

	public const int noAnimal = 2709;

	public const int inquisition = 2507; 
	public const int human_right = 2506; 

	public const int auto_farm = 2707;

@@ -65,7 +65,7 @@ public class POLICY

cs

	public const int legal_drug = 2505;

	public const int faith_tax = 2501; 
	public const int inquisition = 2507; 

	public const int nocturnal_life = 2508;

@@ -75,7 +75,7 @@ public class POLICY

cs

	public const int self_sufficient = 2511;

	public const int human_right = 2506; 
	public const int faith_tax = 2501; 

	public const int resident_wanted = 2513;

@@ -105,8 +105,8 @@ public class POLICY

cs
	{
		2816, 2711, 2800, 2810, 2811, 2812, 2813, 2814, 2815, 2817,
		2823, 2819, 2820, 2821, 2822, 2710, 2824, 2825, 2826, 2827,
		2828, 2818, 2709, 2507, 2707, 2708, 2500, 2502, 2503, 2504, 
		2505, 2501, 2508, 2509, 2510, 2511, 2506, 2513, 2705, 2512, 
		2828, 2818, 2709, 2506, 2707, 2708, 2500, 2502, 2503, 2504, 
		2505, 2507, 2508, 2509, 2510, 2511, 2501, 2513, 2705, 2512, 
		2704, 2706, 2702, 2703, 2700, 2516, 2515, 2514, 2701
	};
}

Player

@@ -419,6 +419,18 @@ public bool toggleHotbarHighlightActivated

cs
			}
		}

		public bool gotJurePillow 
		{ 
			get 
			{ 
				return bits[30]; 
			} 
			set 
			{ 
				bits[30] = value; 
			} 
		} 

		public int start
		{
			get

RecipeCard

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

cs
			if (!flag)
			{
				MakeDish(thing);
				if (EClass.pc.HasElement(1658)) 
				{ 
					thing.elements.SetBase(757, 1); 
					thing.c_dateCooked = EClass.world.date.GetRaw(); 
				} 
			}
		}
		else

Religion

@@ -4,6 +4,12 @@

cs

public class Religion : EClass
{
	public enum ConvertType
	{ 
		Default, 
		Campaign
	} 

	[JsonProperty]
	public int relation;

@@ -160,6 +166,7 @@ public string GetGodTalk(string suffix)

cs

	public int GetOfferingValue(Thing t, int num = -1)
	{
		t.CheckJustCooked(); 
		if (num == -1)
		{
			num = t.Num;

@@ -194,7 +201,7 @@ public int GetOfferingValue(Thing t, int num = -1)

cs
		{
			num2 /= 10;
		}
		num2 *= (t.LV * 2 + 100) / 100; 
		num2 = num2 * (100 + Mathf.Min(t.LV * 2, 100) + (t.HasElement(757) ? 50 : 0)) / 100; 
		return Mathf.Max(num2, 1) * num;
	}

@@ -361,7 +368,7 @@ public virtual void OnBecomeBranchFaith()

cs
	{
	}

	public void JoinFaith(Chara c) 
	public void JoinFaith(Chara c, ConvertType type = ConvertType.Default) 
	{
		if (!c.IsPC)
		{

@@ -373,9 +380,12 @@ public void JoinFaith(Chara c)

cs
	}
	if (c.faith != this)
	{
		c.faith.LeaveFaith(c, this); 
		c.faith.LeaveFaith(c, this, type); 
	} 
	if (type != ConvertType.Campaign) 
	{ 
		EClass.pc.c_daysWithGod = 0; 
	}
	EClass.pc.c_daysWithGod = 0; 
	Msg.Say("worship", Name);
	Talk("worship", c);
	EClass.Sound.Play("worship");

@@ -401,7 +411,7 @@ public void JoinFaith(Chara c)

cs
		}
	}

	public void LeaveFaith(Chara c, Religion newFaith) 
	public void LeaveFaith(Chara c, Religion newFaith, ConvertType type) 
	{
		if (IsEyth)
		{

@@ -411,7 +421,7 @@ public void LeaveFaith(Chara c, Religion newFaith)

cs
	if (c.IsPC)
	{
		Msg.Say("worship2");
		if (!flag) 
		if (!flag && type != ConvertType.Campaign) 
		{
			Punish(c);
		}

Scene

@@ -314,7 +314,7 @@ public void Init(Mode newMode)

cs
		{
			EMono.ui.widgets.Activate("QuestTracker");
		}
		if (EMono._zone is Zone_Town && !EMono._zone.isMapSaved) 
		if (EMono._zone is Zone_Town && !EMono._zone.isMapSaved && !EMono.debug.enable) 
		{
			EMono.game.Save();
		}

SerializedCards

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

cs
		card2.isImported = true;
		card2.refVal = card4.refVal;
		card2.idSkin = card4.idSkin;
		card2.c_idDeity = card4.idDeity; 
		if (isUserZone) 
		{ 
			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;

Thing

@@ -836,6 +836,10 @@ public List<Element> ListValidTraits(bool isCraft, bool limit)

cs

	public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IInspect.NoteMode mode = IInspect.NoteMode.Default, Recipe recipe = null)
	{
		if (sourceCard._origin == "dish") 
		{ 
			CheckJustCooked(); 
		} 
		n.Clear();
		string text = "";
		TraitAbility traitAbility = trait as TraitAbility;

ThingGen

@@ -181,6 +181,13 @@ public static Thing CreatePerfume(int ele, int num = 1)

cs
		return thing;
	}

	public static Thing CreateLetter(string idLetter) 
	{ 
		Thing thing = Create("letter"); 
		thing.SetStr(53, idLetter); 
		return thing; 
	} 

	public static Thing CreateCardboardBox(int uidZone = -1)
	{
		Thing thing = Create("cardboard_box", new string[5] { "pine", "wood_birch", "wood_acacia", "oak", "cedar" }.RandomItem());

Trait

@@ -1482,6 +1482,11 @@ public void OnBarter()

cs
			Thing thing4 = thing8.Duplicate(1);
			thing4.isStolen = false;
			thing4.isCopy = true;
			thing4.c_priceFix = 0; 
			foreach (Element item in thing4.elements.dict.Values.Where((Element e) => e.HasTag("noInherit")).ToList()) 
			{ 
				thing4.elements.Remove(item.id); 
			} 
			int num4 = 1;
			switch (owner.trait.CopyShop)
			{

@@ -1524,9 +1529,9 @@ public void OnBarter()

cs
			{
				break;
			}
			foreach (Thing item in new DramaOutcome().ListFelmeraBarter()) 
			foreach (Thing item2 in new DramaOutcome().ListFelmeraBarter()) 
			{
				AddThing(item); 
				AddThing(item2); 
			}
		}
		else

@@ -1733,18 +1738,18 @@ public void OnBarter()

cs
				break;
			}
			}
			foreach (RecipeSource item2 in RecipeManager.list) 
			foreach (RecipeSource item3 in RecipeManager.list) 
			{
				if (item2.row.recipeKey.IsEmpty()) 
				if (item3.row.recipeKey.IsEmpty()) 
				{
					continue;
				}
				string[] recipeKey = item2.row.recipeKey; 
				string[] recipeKey = item3.row.recipeKey; 
				for (int m = 0; m < recipeKey.Length; m++)
				{
					if (recipeKey[m] == ShopType.ToString())
					{
						NoRestock(ThingGen.CreateRecipe(item2.id)); 
						NoRestock(ThingGen.CreateRecipe(item3.id)); 
						break;
					}
				}

TraitAltar

@@ -25,7 +25,7 @@ public override void OnCreate(int lv)

cs

	public override void OnImportMap()
	{
		if (owner.c_idDeity.IsEmpty()) 
		if (owner.c_idDeity.IsEmpty() || GetParam(1) != null) 
		{
			SetDeity(GetParam(1) ?? EClass.game.religions.GetRandomReligion().id);
		}

TraitCrafter

@@ -277,8 +277,8 @@ public virtual Thing Craft(AI_UseCrafter ai)

cs
		break;
	case MixType.Resource:
	{
		string[] array3 = thing3.Split('%'); 
		t = CraftUtil.MixIngredients(ThingGen.Create(array3[0], (array3.Length > 1) ? EClass.sources.materials.alias[array3[1]].id : thing.material.id), ai.ings, CraftUtil.MixType.General, 999, EClass.pc).Thing; 
		string[] array = thing3.Split('%'); 
		t = CraftUtil.MixIngredients(ThingGen.Create(array[0], (array.Length > 1) ? EClass.sources.materials.alias[array[1]].id : thing.material.id), ai.ings, CraftUtil.MixType.General, 999, EClass.pc).Thing; 
		break;
	}
	case MixType.Dye:

@@ -344,13 +344,13 @@ public virtual Thing Craft(AI_UseCrafter ai)

cs
	case MixType.Fortune:
	{
		EClass.player.seedFortune++;
		string[] array = new string[4] { "plastic", "water", "hide_dragon", "gold" }; 
		int[] array2 = new int[4] { 1, 10, 50, 200 }; 
		int num2 = 0;
		Rand.SetSeed(EClass.game.seed + EClass.player.seedFortune); 
		FortuneRollData orCreateFortuneRollData = EClass._zone.GetOrCreateFortuneRollData(refresh: false); 
		int seed = orCreateFortuneRollData.seed + orCreateFortuneRollData.count + EClass.player.seedFortune; 
		Rand.SetSeed(seed); 
		for (int num3 = 3; num3 > 0; num3--)
		{
			if (EClass.rnd(array2[num3]) == 0) 
			if (EClass.rnd(FortuneRollData.chances[num3]) == 0) 
			{
				num2 = num3;
				break;

@@ -362,9 +362,14 @@ public virtual Thing Craft(AI_UseCrafter ai)

cs
			owner.PlaySound((num2 == 3) ? "fortuneroll_winBig" : "fortuneroll_win");
		}
		Thing thing4 = ThingGen.Create("fortune_ball");
		thing4.ChangeMaterial(array[num2]); 
		thing4.ChangeMaterial(FortuneRollData.mats[num2]); 
		EClass._zone.AddCard(thing4, owner.pos);
		owner.PlaySound("fortuneroll_ball");
		orCreateFortuneRollData.GetPrize(num2, seed); 
		if ((bool)LayerDragGrid.Instance) 
		{ 
			LayerDragGrid.Instance.info.Refresh(); 
		} 
		break;
	}
	case MixType.Incubator:

@@ -408,10 +413,6 @@ public virtual Thing Craft(AI_UseCrafter ai)

cs

	public override void TrySetAct(ActPlan p)
	{
		if (!EClass.debug.enable && this is TraitRollingFortune) 
		{ 
			return; 
		} 
		if (IsFactory)
		{
			Thing _t = owner.Thing;

TraitDoor

@@ -12,7 +12,17 @@ public class TraitDoor : Trait

cs

	public override bool HaveUpdate => true;

	public override bool IsOpenSight => IsOpen(); 
	public override bool IsOpenSight 
	{ 
		get 
		{ 
			if (!IsOpen()) 
			{ 
				return !IsValid(shouldLookGood: false); 
			} 
			return true; 
		} 
	} 

	public override bool IsDoor => true;

@@ -88,18 +98,21 @@ public virtual bool IsOpen()

cs
	{
		int dir = owner.dir;
		Cell cell = owner.pos.cell;
		if (!cell.Right.HasFullBlockOrWallOrFence && (dir == 0 || dir == 2) && cell.Front.HasFullBlockOrWallOrFence) 
		if (dir == 0 || dir == 2) 
		{
			return true; 
			if (cell.Front.HasFullBlockOrWallOrFence || cell.Back.HasFullBlockOrWallOrFence) 
			{ 
				return true; 
			} 
		}
		if (!cell.Front.HasFullBlockOrWallOrFence && (dir == 1 || dir == 3) && cell.Right.HasFullBlockOrWallOrFence) 
		else if (cell.Left.HasFullBlockOrWallOrFence || cell.Right.HasFullBlockOrWallOrFence) 
		{
			return true;
		}
		return false;
	}

	public bool IsValid() 
	public bool IsValid(bool shouldLookGood = true) 
	{
		_ = owner.dir;
		Cell cell = owner.pos.cell;

@@ -107,21 +120,26 @@ public bool IsValid()

cs
	{
		return false;
	}
	bool hasFullBlockOrWallOrFence = cell.Left.HasFullBlockOrWallOrFence; 
	bool hasFullBlockOrWallOrFence2 = cell.Right.HasFullBlockOrWallOrFence; 
	bool hasFullBlockOrWallOrFence3 = cell.Front.HasFullBlockOrWallOrFence; 
	bool hasFullBlockOrWallOrFence4 = cell.Back.HasFullBlockOrWallOrFence; 
	if ((hasFullBlockOrWallOrFence ? 1 : 0) + (hasFullBlockOrWallOrFence2 ? 1 : 0) + (hasFullBlockOrWallOrFence3 ? 1 : 0) + (hasFullBlockOrWallOrFence4 ? 1 : 0) >= 3) 
	if (shouldLookGood) 
	{
		bool hasFullBlockOrWallOrFence = cell.Left.HasFullBlockOrWallOrFence; 
		bool hasFullBlockOrWallOrFence2 = cell.Right.HasFullBlockOrWallOrFence; 
		bool hasFullBlockOrWallOrFence3 = cell.Front.HasFullBlockOrWallOrFence; 
		bool hasFullBlockOrWallOrFence4 = cell.Back.HasFullBlockOrWallOrFence; 
		if (hasFullBlockOrWallOrFence && hasFullBlockOrWallOrFence2) 
		{ 
			return true; 
		} 
		if (hasFullBlockOrWallOrFence3 && hasFullBlockOrWallOrFence4) 
		{ 
			return true; 
		} 
		return false;
	}
	if (hasFullBlockOrWallOrFence && hasFullBlockOrWallOrFence2) 
	int num = (cell.Left.HasFullBlockOrWallOrFence ? 1 : 0) + (cell.Right.HasFullBlockOrWallOrFence ? 1 : 0) + (cell.Front.HasFullBlockOrWallOrFence ? 1 : 0) + (cell.Back.HasFullBlockOrWallOrFence ? 1 : 0); 
	if (num > 0) 
	{
		return true; 
	} 
	if (hasFullBlockOrWallOrFence3 && hasFullBlockOrWallOrFence4) 
	{ 
		return true; 
		return num < 3; 
	}
	return false;
}

TraitGiftJure

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

cs
	}
	EClass.pc.Say("openDoor", EClass.pc, owner);
	SE.Play("dropReward");
	List<string> list = new List<string> { "hat_santa", "musicbox_jure", "1228", "1229", "holyFeather" }; 
	List<string> list = new List<string> { "hat_santa", "musicbox_jure", "1228", "musicbox_cat", "1229", "holyFeather" }; 
	Add(list[EClass.player.giftJure % list.Count], 1);
	foreach (string item in new List<string> { "xmas_wreath", "xmas_garland", "1232", "xmas_socks", "xmas_boot", "xmas_cane" })
	{

@@ -28,17 +28,20 @@ public override bool OnUse(Chara c)

cs
		Add("cake_festival", 3);
		Add("bushdenoel", 3);
		Add("mancookie", 3);
		Thing thing = ThingGen.CreateLetter("letter_juremas"); 
		thing.ChangeMaterial("grass_forest"); 
		EClass.pc.Pick(thing); 
		EClass.player.giftJure++;
		owner.ModNum(-1);
		return true;
		static void Add(string id, int num)
		{
			Thing thing = ThingGen.Create(id).SetNum(num).SetNoSell(); 
			Thing thing2 = ThingGen.Create(id).SetNum(num).SetNoSell(); 
			if (id == "snow_globe")
			{
				thing.idSkin = EClass.player.giftJure % 3; 
				thing2.idSkin = EClass.player.giftJure % 3; 
			}
			EClass.pc.Pick(thing); 
			EClass.pc.Pick(thing2); 
		}
	}
}

TraitGodStatue

@@ -51,14 +51,14 @@ public override void _OnUse(Chara c)

cs
	{
	case "harvest":
	{
		Thing t = ThingGen.Create("book_kumiromi"); 
		EClass.pc.Pick(t); 
		Thing t2 = ThingGen.Create("book_kumiromi"); 
		EClass.pc.Pick(t2); 
		break;
	}
	case "machine":
	{
		Thing t2 = owner.things.Find("gene") ?? GetManiGene(); 
		EClass.pc.Pick(t2); 
		Thing t = owner.things.Find("gene") ?? GetManiGene(); 
		EClass.pc.Pick(t); 
		break;
	}
	case "healing":

@@ -76,7 +76,7 @@ public override void _OnUse(Chara c)

cs
	case "element":
	{
		Rand.SetSeed(owner.c_seed);
		SourceMaterial.Row randomMaterial = MATERIAL.GetRandomMaterial(owner.LV / 2 + 20, (Religion.id == "earth") ? "metal" : "leather", tryLevelMatTier: true); 
		SourceMaterial.Row randomMaterial = MATERIAL.GetRandomMaterial(((owner.LV < 200) ? (owner.LV / 2) : (owner.LV % 50 * 2)) + 10, (Religion.id == "earth") ? "metal" : "leather", tryLevelMatTier: true); 
		Thing thing = ThingGen.Create("mathammer");
		thing.ChangeMaterial(randomMaterial);
		thing.noSell = true;

TraitMusicBox

@@ -6,7 +6,7 @@ public class TraitMusicBox : TraitJukeBox

cs

	public override bool OnUse(Chara c)
	{
		owner.refVal = 115; 
		owner.refVal = GetParam(1).ToInt(); 
		Toggle(!owner.isOn);
		return true;
	}

+TraitPartTimeMascot

File Created
cs
public class TraitPartTimeMascot : TraitChara
{
}

TraitRollingFortune

@@ -23,7 +23,7 @@ public override void OnEndAI(AI_UseCrafter ai)

cs
		}
		foreach (Card item in owner.pos.ListThings<TraitFortuneBall>(onlyInstalled: false))
		{
			EClass.pc.Pick(item.Thing, msg: false); 
			item.Destroy(); 
		}
	}
}

UIDragGridInfo

@@ -27,6 +27,8 @@ public class UIDragGridInfo : EMono

cs

	public Card owner;

	public UINote note; 

	private void Awake()
	{
		window.SetActive(enable: false);

@@ -100,6 +102,12 @@ public void Init(Card _owner)

cs
		}
	};
	list.List();
	TraitRollingFortune traitRollingFortune = owner.trait as TraitRollingFortune; 
	note.SetActive(traitRollingFortune != null); 
	if (traitRollingFortune != null) 
	{ 
		EMono._zone.GetOrCreateFortuneRollData().WriteNote(note); 
	} 
	window.SetActive(enable: true);
	window.RebuildLayout(recursive: true);
	void AddThing(string id)

UIDragGridIngredients

@@ -14,9 +14,9 @@ public class UIDragGridIngredients : EMono

cs
public void Update()
{
	bool activeSelf = goList.activeSelf;
	bool isNoGoal = EMono.pc.ai.IsNoGoal; 
	goList.SetActive(isNoGoal); 
	if (activeSelf != isNoGoal) 
	bool flag = EMono.pc.ai.IsNoGoal || !EMono.pc.ai.IsRunning; 
	goList.SetActive(flag); 
	if (activeSelf != flag) 
	{
		Refresh();
	}

@@ -28,11 +28,13 @@ public void Update()

cs
	if ((bool)componentOf && (bool)componentOf.GetComponentInParent<UIDragGridIngredients>())
	{
		Thing t = componentOf.card.Thing;
		Thing container = t.parent as Thing; 
		t.ShowSplitMenu2(componentOf, "actPutIn", delegate(int n)
		{
			Thing t2 = t.Split(n);
			t2 = EMono.pc.Pick(t2, msg: true, tryStack: false);
			int currentIndex = layer.currentIndex;
			layer.AddPutBack(t2, container); 
			layer.buttons[currentIndex].SetCardGrid(t2, layer.owner);
			layer.owner.OnProcess(t2);
		});

@@ -66,6 +68,7 @@ public void Refresh()

cs
			int currentIndex = layer.currentIndex;
			layer.buttons[currentIndex].SetCardGrid(a, layer.owner);
			layer.owner.OnProcess(a);
			layer.AddPutBack(a, a.parent as Thing); 
		},
		onInstantiate = delegate(Thing a, ButtonGrid b)
		{

UIInventory

@@ -158,6 +158,8 @@ public bool UseBG

cs

	public bool IsShop => owner.Container.trait is TraitChestMerchant;

	public bool IsAdvSort => EMono.core.config.game.sortEach; 

	public CoreRef.InventoryStyle InvStyle => EMono.core.refs.invStyle[(UseBG || IsToolbelt) ? owner.Container.trait.IDInvStyle : "transparent"];

	public bool IsMainMode

@@ -462,7 +464,7 @@ public void RefreshMenu()

cs
			foreach (UIList.SortMode sortMode in sorts)
			{
				UIList.SortMode _sort = sortMode;
				uIContextMenu2.AddButton((((IsShop ? EMono.player.pref.sortInvShop : EMono.player.pref.sortInv) == _sort) ? "context_checker".lang() : "") + _sort.ToString().lang(), delegate
				uIContextMenu2.AddButton((((IsShop ? EMono.player.pref.sortInvShop : (IsAdvSort ? data.sortMode : EMono.player.pref.sortInv)) == _sort) ? "context_checker".lang() : "") + _sort.ToString().lang(), delegate
				{
					if (IsShop)
					{

@@ -472,11 +474,12 @@ public void RefreshMenu()

cs
					{
						EMono.player.pref.sortInv = _sort;
					}
					data.sortMode = _sort; 
					Sort();
					SE.Click();
				});
			}
			uIContextMenu2.AddToggle("sort_ascending", IsShop ? EMono.player.pref.sort_ascending_shop : EMono.player.pref.sort_ascending, delegate(bool a) 
			uIContextMenu2.AddToggle("sort_ascending", IsShop ? EMono.player.pref.sort_ascending_shop : (IsAdvSort ? data.sort_ascending : EMono.player.pref.sort_ascending), delegate(bool a) 
			{
				if (IsShop)
				{

@@ -486,6 +489,7 @@ public void RefreshMenu()

cs
				{
					EMono.player.pref.sort_ascending = a;
				}
				data.sort_ascending = a; 
				Sort();
				SE.Click();
			});

@@ -995,7 +999,7 @@ public Transform ShowAdvDistribution(UIContextMenu dis, Window.SaveData data)

cs

	public void Sort(bool redraw = true)
	{
		UIList.SortMode i = (IsShop ? EMono.player.pref.sortInvShop : EMono.player.pref.sortInv); 
		UIList.SortMode i = (IsShop ? EMono.player.pref.sortInvShop : (IsAdvSort ? window.saveData.sortMode : EMono.player.pref.sortInv)); 
		bool flag = true;
		while (flag)
		{

@@ -1033,7 +1037,7 @@ public void Sort(bool redraw = true)

cs
	}
	owner.Container.things.Sort(delegate(Thing a, Thing b)
	{
		bool flag2 = (IsShop ? EMono.player.pref.sort_ascending_shop : EMono.player.pref.sort_ascending); 
		bool flag2 = (IsShop ? EMono.player.pref.sort_ascending_shop : (IsAdvSort ? window.saveData.sort_ascending : EMono.player.pref.sort_ascending)); 
		if (i == UIList.SortMode.ByName)
		{
			if (flag2)

UIPlaceHelper

@@ -21,6 +21,7 @@ public void Refresh()

cs
	base.gameObject.SetActive(flag);
	if (flag)
	{
		ActionMode.Build.recipe = recipe; 
		buttonAutoWall.SetActive(enable: false);
		buttonAutoWall.mainText.text = (EMono.game.config.autoWall ? "On" : "Off");
		buttonAutoWall.icon.SetAlpha(EMono.game.config.autoWall ? 1f : 0.4f);

WindowChara

@@ -136,6 +136,8 @@ public class WindowChara : WindowController

cs

	public UIButton buttonFeatMode;

	public UIButton buttonFeatOption; 

	public Image imageView;

	public Sprite mask;

@@ -204,6 +206,7 @@ public override void OnSwitchContent(Window window)

cs
			}
			listEquipment2.transform.parent.SetActive(flag);
			buttonFeatMode.SetActive(idTab == 2 && chara.IsPC);
			buttonFeatOption.SetActive(idTab == 2 && chara.IsPC && featMode); 
		}
	}

@@ -235,6 +238,12 @@ public void ToggleFeatMode()

cs
	{
		featMode = !featMode;
		RefreshSkill(window.idTab);
		buttonFeatOption.SetActive(featMode); 
		buttonFeatOption.SetToggle(EClass.game.config.showAllFeat, delegate(bool a) 
		{ 
			EClass.game.config.showAllFeat = a; 
			RefreshSkill(window.idTab); 
		}); 
	}

	public void RefreshFeatMode()

@@ -763,7 +772,11 @@ void List(string lang, string idSubCat)

cs
		{
			onClick = delegate(Element a, ButtonElement b)
			{
				if (EClass.pc.feat < a.CostLearn) 
				if (!a.IsPurchaseFeatReqMet(chara.elements) && !EClass.debug.enable) 
				{ 
					SE.BeepSmall(); 
				} 
				else if (EClass.pc.feat < a.CostLearn) 
				{
					SE.BeepSmall();
					Msg.Say("notEnoughFeatPoint");

@@ -787,7 +800,7 @@ void List(string lang, string idSubCat)

cs
			},
			onList = delegate
			{
				foreach (Element item9 in chara.ListAvailabeFeats()) 
				foreach (Element item9 in chara.ListAvailabeFeats(pet: false, EClass.game.config.showAllFeat)) 
				{
					if (item9.source.categorySub == idSubCat)
					{

Zone

@@ -54,6 +54,9 @@ public class PortalReturnData

cs
	[JsonProperty]
	public List<int> landFeats;

	[JsonProperty] 
	private FortuneRollData fortuneRoll; 

	public Map map;

	public MapSubset subset;

@@ -3428,4 +3431,18 @@ public void ApplyBackerPet(bool draw)

cs
			}
		}
	}

	public FortuneRollData GetOrCreateFortuneRollData(bool refresh = true) 
	{ 
		if (fortuneRoll == null) 
		{ 
			fortuneRoll = new FortuneRollData(); 
			fortuneRoll.seed = EClass.rnd(50000) + 1; 
		} 
		if (refresh || fortuneRoll.count == 0) 
		{ 
			fortuneRoll.Refresh(); 
		} 
		return fortuneRoll; 
	} 
}