Skip to content

EA 23.67 Hotfix 2

December 25, 2024

27 files modified.

Important Changes

None.

Card

@@ -2006,7 +2006,7 @@ public bool ShowFoodEnc

cs
{
	get
	{
		if (!IsFood && !category.IsChildOf("seed") && !(id == "pasture")) 
		if (!IsFood && Evalue(10) <= 0 && !category.IsChildOf("seed") && !(id == "pasture") && !(id == "grass")) 
		{
			return category.IsChildOf("drug");
		}

@@ -4465,15 +4465,19 @@ public void SpawnLoot(Card origin)

cs
		}
		if (!isBackerContent && !flag)
		{
			int num2 = ((this.rarity >= Rarity.Legendary) ? 1 : 0); 
			if (EClass.rnd(20) == 0) 
			int num2 = ((EClass._zone.Boss == this) ? 2 : ((this.rarity >= Rarity.Legendary) ? 1 : 0)); 
			if (EClass._zone is Zone_Void) 
			{ 
				num2++; 
			} 
			if (EClass.rnd(5) == 0) 
			{
				num2++;
			}
			string text2 = id;
			if (text2 == "big_daddy" || text2 == "santa")
			{
				num2++; 
				num2 += 2; 
			}
			List<Thing> list2 = new List<Thing>();
			foreach (Thing thing4 in things)

@@ -4492,7 +4496,7 @@ public void SpawnLoot(Card origin)

cs
					{
						list2.Add(thing4);
					}
					else if (EClass.rnd(150) == 0) 
					else if (EClass.rnd(100) == 0) 
					{
						list.Add(thing4);
					}

@@ -4508,6 +4512,7 @@ public void SpawnLoot(Card origin)

cs
				for (int j = 0; j < list2.Count && j < num2; j++)
				{
					list.Add(list2[j]);
					num2--; 
				}
			}
			if (this.rarity >= Rarity.Legendary && !IsUnique && c_bossType != BossType.Evolved)

@@ -4522,22 +4527,30 @@ public void SpawnLoot(Card origin)

cs
				}
				if (num3 == 0)
				{
					Rand.SetSeed(uid); 
					if (EClass.rnd((EClass._zone.events.GetEvent<ZoneEventDefenseGame>() != null) ? 3 : 2) == 0) 
					int num4 = ((!(EClass._zone is Zone_Void)) ? 1 : 2); 
					if (num2 < num4) 
					{
						Rarity rarity = ((EClass.rnd(20) == 0) ? Rarity.Mythical : Rarity.Legendary); 
						CardBlueprint.Set(new CardBlueprint
						{ 
							rarity = rarity 
						}); 
						Thing item = ThingGen.CreateFromFilter("eq", LV); 
						list.Add(item); 
						num2 = num4; 
					}
					else if (EClass.rnd(3) == 0) 
					for (int k = 0; k < num2; k++) 
					{
						list.Add(ThingGen.Create("medal")); 
						Rand.SetSeed(uid + k); 
						if (EClass.rnd((EClass._zone.events.GetEvent<ZoneEventDefenseGame>() != null) ? 3 : 2) == 0) 
						{ 
							Rarity rarity = ((EClass.rnd(20) == 0) ? Rarity.Mythical : Rarity.Legendary); 
							CardBlueprint.Set(new CardBlueprint
							{ 
								rarity = rarity 
							}); 
							Thing item = ThingGen.CreateFromFilter("eq", LV); 
							list.Add(item); 
						} 
						else if (EClass.rnd(3) == 0) 
						{ 
							list.Add(ThingGen.Create("medal")); 
						} 
						Rand.SetSeed(); 
					}
					Rand.SetSeed(); 
				}
			}
		}

Chara

@@ -2746,11 +2746,6 @@ public void DestroyPath(Point pos)

cs
				}
				broke = true;
			}
			if (_p.HasBridge) 
			{ 
				EClass._map.MineFloor(_p); 
				broke = true; 
			} 
			if (_p.HasObj && _p.IsBlocked)
			{
				EClass._map.MineObj(_p, null, this);

CharaAbility

@@ -29,9 +29,9 @@ public void Refresh()

cs
			pt = (array.Length > 2)
		});
	}
	if (owner.trait.UseRandomAbility && owner._listAbility == null) 
	if (owner.trait.MaxRandomAbility > 0 && owner._listAbility == null) 
	{
		int num = 3 + EClass.rnd(2) - list.items.Count; 
		int num = owner.trait.MaxRandomAbility + EClass.rnd(2) - list.items.Count; 
		if (num > 1)
		{
			if (randomAbilities.Count == 0)

ContentPolicy

@@ -74,6 +74,10 @@ public void RefreshPolicyList(UIList list, string cat, string plan)

cs
				{
					EClass.pc.faction.SetGlobalPolicyActive(2711, a.active);
				}
				if (a.id == 2712) 
				{ 
					EClass.pc.faction.SetGlobalPolicyActive(2712, a.active); 
				} 
				EClass.Branch.policies.RefreshEffects();
				RefreshPolicyIcons();
			});

CoreDebug

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

cs
	}
	if (Input.GetKeyDown(KeyCode.F2))
	{
		EClass._zone.SpawnMob(EClass.pc.pos.GetNearestPoint(), SpawnSetting.Boss(EClass._zone.DangerLv)); 
		EClass.player.recipes.OnSleep(); 
		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) 
		{ 
			EClass.pc.Pick(targetChara.MakeMilk()); 
			EClass.pc.Pick(targetChara.MakeGene()); 
			EClass.pc.Pick(targetChara.MakeBraineCell()); 
			EClass.pc.Pick(targetChara.MakeEgg(effect: true, 10)); 
		} 
		return;
	}
	if (Input.GetKeyDown(KeyCode.F3))

@@ -106,74 +106,93 @@ public void BuildIngredients(Recipe _recipe, Image _icon, Action _onValueChange,

cs
			}
			else
			{
				List<Thing> things = ListIngredients(ingredient, searchMode); 
				if (things.Count == 0) 
				bool flag = false; 
				List<int> list = EMono.player.recipes.lastIngredients.TryGetValue(recipe.id); 
				int num = recipe.ingredients.IndexOf(ingredient); 
				if (num != -1 && list != null && list.Count > num) 
				{
					if (EMono.debug.godBuild && ingredient.thing == null) 
					int uid = list[num]; 
					if (uid != 0) 
					{
						Thing thing = ThingGen.Create(ingredient.IdThing, recipe.DefaultMaterial.alias).SetNum(99); 
						things.Add(thing); 
						ingredient.SetThing(thing); 
					} 
					else
					{ 
						ingredient.SetThing(); 
						things.Insert(0, null); 
						Thing thing = EMono.pc.things.Find((Thing t) => t.uid == uid) ?? EMono._map.Stocked.Find(uid); 
						if (thing != null) 
						{ 
							ingredient.SetThing(thing); 
							flag = true; 
						} 
					}
				}
				else if (!ingredient.optional) 
				if (!flag) 
				{
					if (ingredient.thing == null) 
					List<Thing> list2 = ListIngredients(ingredient, searchMode); 
					if (list2.Count == 0) 
					{
						int num = lastMats.TryGetValue(recipe.id, -1); 
						if (num != -1) 
						if (EMono.debug.godBuild && ingredient.thing == null) 
						{
							foreach (Thing item in things) 
							Thing thing2 = ThingGen.Create(ingredient.IdThing, recipe.DefaultMaterial.alias).SetNum(99); 
							list2.Add(thing2); 
							ingredient.SetThing(thing2); 
						} 
						else
						{ 
							ingredient.SetThing(); 
							list2.Insert(0, null); 
						} 
					} 
					else if (!ingredient.optional) 
					{ 
						if (ingredient.thing == null) 
						{ 
							int num2 = lastMats.TryGetValue(recipe.id, -1); 
							if (num2 != -1) 
							{
								if (item.material.id == num && item.Num >= ingredient.req) 
								foreach (Thing item in list2) 
								{
									ingredient.SetThing(item); 
									break; 
									if (item.material.id == num2 && item.Num >= ingredient.req) 
									{ 
										ingredient.SetThing(item); 
										break; 
									} 
								}
							}
						} 
						if (ingredient.thing == null) 
						{ 
							SourceMaterial.Row defaultMaterial = recipe.DefaultMaterial; 
							foreach (Thing item2 in things) 
							if (ingredient.thing == null) 
							{
								if (item2.material.id == defaultMaterial.id && item2.Num >= ingredient.req) 
								SourceMaterial.Row defaultMaterial = recipe.DefaultMaterial; 
								foreach (Thing item2 in list2) 
								{
									ingredient.SetThing(item2); 
									break; 
									if (item2.material.id == defaultMaterial.id && item2.Num >= ingredient.req) 
									{ 
										ingredient.SetThing(item2); 
										break; 
									} 
								} 
								if (EMono.debug.godBuild && ingredient.thing == null) 
								{ 
									Thing thing3 = (ingredient.useCat ? ThingGen.CreateFromCategory(ingredient.id) : ThingGen.Create(ingredient.id, defaultMaterial.alias)).SetNum(99); 
									list2.Add(thing3); 
									ingredient.SetThing(thing3); 
								}
							}
							if (EMono.debug.godBuild && ingredient.thing == null) 
							if (ingredient.thing == null) 
							{
								Thing thing2 = (ingredient.useCat ? ThingGen.CreateFromCategory(ingredient.id) : ThingGen.Create(ingredient.id, defaultMaterial.alias)).SetNum(99); 
								things.Add(thing2); 
								ingredient.SetThing(thing2); 
								ingredient.SetThing(list2[0]); 
							}
						}
						if (ingredient.thing == null) 
						{ 
							ingredient.SetThing(things[0]); 
						} 
					} 
					else
					{ 
						bool flag = true; 
						foreach (Thing item3 in things) 
						else
						{
							if (ingredient.thing == item3) 
							bool flag2 = true; 
							foreach (Thing item3 in list2) 
							{
								flag = false; 
								break; 
								if (ingredient.thing == item3) 
								{ 
									flag2 = false; 
									break; 
								} 
							} 
							if (flag2) 
							{ 
								ingredient.SetThing(list2[0]); 
							}
						} 
						if (flag) 
						{ 
							ingredient.SetThing(things[0]); 
						}
					}
				}

@@ -181,10 +200,10 @@ public void BuildIngredients(Recipe _recipe, Image _icon, Action _onValueChange,

cs
				b.onClick.RemoveAllListeners();
				b.onClick.AddListener(delegate
				{
					things = ListIngredients(ingredient, searchMode); 
					List<Thing> list3 = ListIngredients(ingredient, searchMode); 
					if (ingredient.optional)
					{
						if (things.Count == 0 || things[0] == null) 
						if (list3.Count == 0 || list3[0] == null) 
						{
							SE.Beep();
							return;

@@ -197,7 +216,7 @@ public void BuildIngredients(Recipe _recipe, Image _icon, Action _onValueChange,

cs
					}
					if ((bool)rectDrop)
					{
						Activate(ingredient, things); 
						Activate(ingredient, list3); 
					}
				});
			}

@@ -241,6 +260,7 @@ public void Activate(Recipe.Ingredient ingredient, List<Thing> things)

cs
		{
			SE.Resource();
			ingredient.SetThing(a);
			recipe.SaveLastIngredients(); 
			OnChangeIngredient();
			if (onValueChange != null)
			{

ELEMENT

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

cs
	}
	if (!IsPurchaseFeatReqMet(owner))
	{
		WritePurchaseReq(n); 
		WritePurchaseReq(n, owner.Value(id)); 
	}
	n.Build();
}

FACTION

@@ -294,6 +294,25 @@ public bool HasMember(string id, bool includeReserve = true)

cs
		return false;
	}

	public bool IsWearingPanty(Chara c) 
	{ 
		if ((!c.IsUnique || c.bio.gender != 2) && (c.race.IsHuman || c.race.IsFairy) && !(c.trait is TraitMerchant)) 
		{ 
			return true; 
		} 
		if (IsGlobalPolicyActive(2712)) 
		{ 
			foreach (Chara value in EClass.game.cards.globalCharas.Values) 
			{ 
				if (value.id == c.id && value.IsHomeMember()) 
				{ 
					return true; 
				} 
			} 
		} 
		return false; 
	} 

	public void AddContribution(int a)
	{
		if (a != 0 && relation.type == FactionRelation.RelationType.Member)

FEAT

@@ -301,7 +301,7 @@ public override bool IsPurchaseFeatReqMet(ElementContainer owner, int lv = -1)

cs
	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((lv == -1) ? (owner.Value(id) + 1) : lv, 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 != null) ? owner.Value(id) : lv) + 1, 1, base.source.req.Length - 1)].ToInt())) 
		{
			return false;
		}

@@ -311,11 +311,9 @@ public override bool IsPurchaseFeatReqMet(ElementContainer owner, int lv = -1)

cs

	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); 
			Element element = Element.Create(base.source.req[0], (base.source.req.Length == 1) ? 1 : base.source.req[Mathf.Clamp(((lv == -1 && owner != null) ? owner.Value(id) : lv) + 1, 1, base.source.req.Length - 1)].ToInt()); 
			if (element != null)
			{
				n.AddHeader("featReq");

FactionBranch

@@ -680,10 +680,15 @@ public void ReceivePackages(VirtualDate date)

cs
public void DailyOutcome(VirtualDate date)
{
	Thing thing = null;
	Chara i; 
	foreach (Chara member in members)
	{
		i = member; 
		Chara i = member; 
		if (EClass.rnd(EClass.debug.enable ? 2 : (360 * members.Count)) == 0 && !i.IsPC && EClass.pc.faction.IsGlobalPolicyActive(2712) && i.things.Find((Thing t) => t.id == "panty" && t.c_idRefCard == i.id) == null && !i.things.IsFull()) 
		{ 
			Thing thing2 = ThingGen.Create("panty"); 
			thing2.c_idRefCard = i.id; 
			i.AddThing(thing2); 
		} 
		if (i.IsPCParty || !i.ExistsOnMap)
		{
			continue;

@@ -737,169 +742,169 @@ public void DailyOutcome(VirtualDate date)

cs
		{
			GetOutcome(item2);
		}
	} 
	int soilCost = EClass._zone.GetSoilCost(); 
	int num = Mathf.Min(100, 70 + (MaxSoil - soilCost)); 
	int flower = 5; 
	int lv = 1; 
	EClass._map.bounds.ForeachCell(delegate(Cell cell) 
	{ 
		if (cell.obj != 0 && cell.sourceObj.tag.Contains("flower")) 
		{ 
			PlantData plantData = cell.TryGetPlant(); 
			if (plantData != null && plantData.seed != null) 
			{ 
				lv += plantData.seed.encLV + 1; 
			} 
			else
			{ 
				lv++; 
			} 
			flower++; 
		} 
	}); 
	lv /= flower; 
	int num2 = 0; 
	foreach (Thing thing6 in EClass._map.things) 
	{ 
		if (thing6.IsInstalled && thing6.trait is TraitBeekeep && !thing6.things.IsFull()) 
		{ 
			flower -= 3 + EClass.rnd(5 + num2 * 4); 
			num2++; 
			if (flower < 0) 
			{ 
				break; 
			} 
			if (EClass.rnd(100) <= num) 
			{ 
				Thing thing2 = ThingGen.Create("honey"); 
				thing2.SetEncLv(lv / 10); 
				thing2.elements.SetBase(2, EClass.curve(lv, 50, 10, 80)); 
				thing6.AddThing(thing2); 
			} 
		} 
	} 
	void GetOutcome(Hobby h) 
	{ 
		int num3 = h.GetEfficiency(i) * GetProductBonus(i) / 100; 
		int num4 = h.GetLv(i); 
		int id = EClass.sources.elements.alias[h.source.skill].id; 
		if (!i.elements.HasBase(id)) 
		{ 
			i.elements.SetBase(id, 1); 
		} 
		i.ModExp(id, 100); 
		for (int j = 0; j < h.source.things.Length; j += 2) 
		void GetOutcome(Hobby h) 
		{
			string text = h.source.things[j]; 
			int num5 = Mathf.Max(1, h.source.things[j + 1].ToInt() * num3 / 1000); 
			int num6 = num5 / 1000; 
			if (num5 % 1000 > EClass.rnd(1000)) 
			int num3 = h.GetEfficiency(i) * GetProductBonus(i) / 100; 
			int num4 = h.GetLv(i); 
			int id = EClass.sources.elements.alias[h.source.skill].id; 
			if (!i.elements.HasBase(id)) 
			{
				num6++; 
				i.elements.SetBase(id, 1); 
			}
			if (num6 != 0) 
			i.ModExp(id, 100); 
			for (int j = 0; j < h.source.things.Length; j += 2) 
			{
				if (!(text == "_egg")) 
				string text = h.source.things[j]; 
				int num5 = Mathf.Max(1, h.source.things[j + 1].ToInt() * num3 / 1000); 
				int num6 = num5 / 1000; 
				if (num5 % 1000 > EClass.rnd(1000)) 
				{
					if (text == "milk") 
					{ 
						i.MakeMilk(date.IsRealTime, num6); 
					} 
					else
					num6++; 
				} 
				if (num6 != 0) 
				{ 
					if (!(text == "_egg")) 
					{
						Thing thing3 = ((!text.StartsWith("#")) ? ThingGen.Create(h.source.things[j], -1, num4) : ThingGen.CreateFromCategory(text.Replace("#", ""), num4)); 
						if (thing3 != null) 
						if (text == "milk") 
						{
							if (!thing3.trait.CanStack) 
							{ 
								num6 = 1; 
							} 
							thing3.SetNum(thing3.trait.CraftNum * num6); 
							thing3.SetBlessedState(BlessedState.Normal); 
							thing3.TryMakeRandomItem(num4); 
							if (thing3.IsAmmo) 
							{ 
								thing3.ChangeMaterial("iron"); 
								thing3.c_IDTState = 0; 
							} 
							bool flag = thing3.category.id == "garbage"; 
							if (thing3.trait is TraitFoodMeal) 
							i.MakeMilk(date.IsRealTime, num6); 
						} 
						else
						{ 
							Thing thing4 = ((!text.StartsWith("#")) ? ThingGen.Create(h.source.things[j], -1, num4) : ThingGen.CreateFromCategory(text.Replace("#", ""), num4)); 
							if (thing4 != null) 
							{
								if (thing3.HasTag(CTAG.dish_fail)) 
								if (!thing4.trait.CanStack) 
								{
									flag = true; 
									num6 = 1; 
								} 
								thing4.SetNum(thing4.trait.CraftNum * num6); 
								thing4.SetBlessedState(BlessedState.Normal); 
								thing4.TryMakeRandomItem(num4); 
								if (thing4.IsAmmo) 
								{ 
									thing4.ChangeMaterial("iron"); 
									thing4.c_IDTState = 0; 
								} 
								bool flag = thing4.category.id == "garbage"; 
								if (thing4.trait is TraitFoodMeal) 
								{ 
									if (thing4.HasTag(CTAG.dish_fail)) 
									{ 
										flag = true; 
									} 
									else
									{ 
										CraftUtil.MakeDish(thing4, num4 + 10, i); 
									} 
								} 
								if (flag) 
								{ 
									TryTrash(thing4); 
								}
								else
								{
									CraftUtil.MakeDish(thing3, num4 + 10, i); 
									i.TryPutShared(thing4); 
								}
							}
							if (flag) 
							{ 
								TryTrash(thing3); 
							} 
							else
							{ 
								i.TryPutShared(thing3); 
							} 
						}
					}
					else
					{ 
						i.MakeEgg(date.IsRealTime, num6); 
					} 
				}
				else
			} 
			switch (h.source.alias) 
			{ 
			case "Nurse": 
			{ 
				foreach (Chara member2 in members) 
				{
					i.MakeEgg(date.IsRealTime, num6); 
					if (!member2.IsPCParty) 
					{ 
						if (member2.isDead && EClass.rnd(num3) > EClass.rnd(100)) 
						{ 
							Log("bNurse", i, member2); 
							member2.Revive(member2.pos, msg: true); 
							break; 
						} 
						if (EClass.rnd(num3) > EClass.rnd(100)) 
						{ 
							member2.CureHost(CureType.HealComplete); 
						} 
					} 
				}
				break; 
			}
		} 
		switch (h.source.alias) 
		{ 
		case "Nurse": 
		{ 
			foreach (Chara member2 in members) 
			case "Chore":
			case "Clean":
			{
				if (!member2.IsPCParty) 
				for (int k = 0; k < num3 / 2; k++) 
				{
					if (member2.isDead && EClass.rnd(num3) > EClass.rnd(100)) 
					Point randomPoint = EClass._map.bounds.GetRandomPoint(); 
					if (randomPoint.HasDecal) 
					{
						Log("bNurse", i, member2); 
						member2.Revive(member2.pos, msg: true); 
						break; 
						EClass._map.SetDecal(randomPoint.x, randomPoint.z); 
					}
					if (EClass.rnd(num3) > EClass.rnd(100)) 
				} 
				break; 
			} 
			case "TreasureHunt":
				if (EClass.rnd(num3) > EClass.rnd(EClass.debug.enable ? 100 : 5000)) 
				{ 
					Thing thing5 = EClass._zone.TryGetThingFromSharedContainer((Thing t) => t.trait is TraitScrollMapTreasure); 
					if (thing5 != null) 
					{
						member2.CureHost(CureType.HealComplete); 
						Thing thing6 = ThingGen.CreateTreasure("chest_treasure", thing5.LV); 
						i.TryPutShared(thing6); 
						thing5.Destroy(); 
						WidgetPopText.Say("foundTreasure".lang(thing6.Name)); 
					}
				}
				break; 
			}
			break; 
		}
		case "Chore": 
		case "Clean": 
	} 
	int soilCost = EClass._zone.GetSoilCost(); 
	int num = Mathf.Min(100, 70 + (MaxSoil - soilCost)); 
	int flower = 5; 
	int lv = 1; 
	EClass._map.bounds.ForeachCell(delegate(Cell cell) 
	{ 
		if (cell.obj != 0 && cell.sourceObj.tag.Contains("flower")) 
		{
			for (int k = 0; k < num3 / 2; k++) 
			PlantData plantData = cell.TryGetPlant(); 
			if (plantData != null && plantData.seed != null) 
			{
				Point randomPoint = EClass._map.bounds.GetRandomPoint(); 
				if (randomPoint.HasDecal) 
				{ 
					EClass._map.SetDecal(randomPoint.x, randomPoint.z); 
				} 
				lv += plantData.seed.encLV + 1; 
			}
			break; 
			else
			{ 
				lv++; 
			} 
			flower++; 
		}
		case "TreasureHunt":
			if (EClass.rnd(num3) > EClass.rnd(EClass.debug.enable ? 100 : 5000)) 
	}); 
	lv /= flower; 
	int num2 = 0; 
	foreach (Thing thing7 in EClass._map.things) 
	{ 
		if (thing7.IsInstalled && thing7.trait is TraitBeekeep && !thing7.things.IsFull()) 
		{ 
			flower -= 3 + EClass.rnd(5 + num2 * 4); 
			num2++; 
			if (flower < 0) 
			{
				Thing thing4 = EClass._zone.TryGetThingFromSharedContainer((Thing t) => t.trait is TraitScrollMapTreasure); 
				if (thing4 != null) 
				{ 
					Thing thing5 = ThingGen.CreateTreasure("chest_treasure", thing4.LV); 
					i.TryPutShared(thing5); 
					thing4.Destroy(); 
					WidgetPopText.Say("foundTreasure".lang(thing5.Name)); 
				} 
				break; 
			} 
			if (EClass.rnd(100) <= num) 
			{ 
				Thing thing3 = ThingGen.Create("honey"); 
				thing3.SetEncLv(lv / 10); 
				thing3.elements.SetBase(2, EClass.curve(lv, 50, 10, 80)); 
				thing7.AddThing(thing3); 
			}
			break; 
		}
	}
}

FortuneRollData

@@ -172,7 +172,7 @@ void Add(int grade)

cs

	public List<List<string>> GetPrizeList()
	{
		return new List<List<string>> 
		List<List<string>> list = new List<List<string>> 
		{
			new List<string> { "scrubber", "tissue", "plat" },
			new List<string>

@@ -195,6 +195,14 @@ public List<List<string>> GetPrizeList()

cs
				"medal"
			}
		};
		if (EClass.pc.faction.IsGlobalPolicyActive(2712)) 
		{ 
			for (int i = 0; i < (EClass.debug.enable ? 50 : 5); i++) 
			{ 
				list[2].Add("panty"); 
			} 
		} 
		return list; 
	}

	public void GetPrize(int grade, int seed)

GrowSystem

@@ -630,7 +630,7 @@ public void PopHarvest(Chara c, Thing t = null, int num = -1)

cs
	{
		Debug.Log("harvest count not set:" + source.id + "/" + source.alias);
	}
	if (num != -1) 
	if (num > 0) 
	{
		t.SetNum(num);
	}

@@ -656,9 +656,10 @@ public void ApplySeed(Thing t)

cs
		return;
	}
	int encLv = thing.encLV / 10 + ((thing.encLV > 0) ? 1 : 0);
	bool flag = t.IsFood || t.Evalue(10) > 0 || t.id == "grass"; 
	foreach (Element value in thing.elements.dict.Values)
	{
		if ((!value.IsFoodTrait || t.IsFood) && (value.IsFoodTrait || value.id == 2)) 
		if ((!value.IsFoodTrait || flag) && (value.IsFoodTrait || value.id == 2)) 
		{
			t.elements.ModBase(value.id, value.Value / 10 * 10);
		}

GrowSystemWeed

@@ -13,7 +13,7 @@ public override bool CanReapSeed()

cs

	public override void OnMineObj(Chara c = null)
	{
		TryPick(GrowSystem.cell, "grass", EClass.sources.materials.alias["grass"].id, EClass.rnd(5)); 
		PopHarvest(c ?? EClass.pc, ThingGen.Create("grass", EClass.sources.materials.alias["grass"].id), EClass.rnd(5)); 
		base.OnMineObj(c);
	}
}

LayerCraft

@@ -181,6 +181,7 @@ public void OnClickCraft()

cs
		pickaxeCrafted = true;
		break;
	}
	recipe.SaveLastIngredients(); 
	ELayer.pc.SetAI(new AI_UseCrafter
	{
		crafter = traitCrafter,

@@ -285,6 +286,10 @@ public void RefreshCategory(string cat, bool first = false)

cs
	{
		onClick = delegate(Recipe a, ButtonGrid b)
		{
			if (recipe != null) 
			{ 
				recipe.SaveLastIngredients(); 
			} 
			recipe = a;
			SE.Play("click_recipe");
			RefreshRecipe(first: true);

POLICY

@@ -11,13 +11,13 @@ public class POLICY

cs

	public const int suite_room = 2813;

	public const int noMother = 2710; 
	public const int incomeTransfer = 2711; 

	public const int open_business = 2810;

	public const int home_discount = 2800;

	public const int incomeTransfer = 2711; 
	public const int forcePanty = 2712; 

	public const int store_ripoff = 2816;

@@ -47,11 +47,13 @@ public class POLICY

cs

	public const int license_food = 2818;

	public const int noAnimal = 2709; 
	public const int noMother = 2710; 

	public const int human_right = 2506;

	public const int auto_farm = 2707; 
	public const int noDM = 2708; 

	public const int noAnimal = 2709; 

	public const int food_for_people = 2502;

@@ -65,49 +67,49 @@ public class POLICY

cs

	public const int legal_drug = 2505;

	public const int inquisition = 2507; 

	public const int nocturnal_life = 2508;

	public const int vaccination = 2509;

	public const int ban_radio = 2510; 

	public const int self_sufficient = 2511;

	public const int resident_tax = 2512;

	public const int ban_radio = 2510; 
	public const int inquisition = 2507; 

	public const int taxfree = 2514;

	public const int stop_growth = 2515; 

	public const int speed_growth = 2516; 
	public const int auto_farm = 2707; 

	public const int energy_conservation = 2700; 
	public const int resident_wanted = 2513; 

	public const int trash_sort = 2701; 
	public const int taxTransfer = 2705; 

	public const int trash_no = 2702; 
	public const int border_watch = 2704; 

	public const int weed_no = 2703;

	public const int border_watch = 2704; 

	public const int taxTransfer = 2705; 
	public const int trash_no = 2702; 

	public const int demon_invocation = 2706;

	public const int resident_wanted = 2513; 
	public const int energy_conservation = 2700; 

	public const int noDM = 2708; 
	public const int speed_growth = 2516; 

	public const int stop_growth = 2515; 

	public const int trash_sort = 2701; 

	public static readonly int[] IDS = new int[49] 
	public static readonly int[] IDS = new int[50] 
	{
		2812, 2815, 2814, 2813, 2710, 2810, 2800, 2711, 2816, 2811, 
		2812, 2815, 2814, 2813, 2711, 2810, 2800, 2712, 2816, 2811, 
		2817, 2824, 2819, 2820, 2821, 2822, 2823, 2825, 2826, 2827,
		2828, 2818, 2709, 2506, 2707, 2502, 2501, 2500, 2503, 2504, 
		2505, 2507, 2508, 2509, 2511, 2512, 2510, 2514, 2515, 2516, 
		2700, 2701, 2702, 2703, 2704, 2705, 2706, 2513, 2708
		2828, 2818, 2710, 2506, 2708, 2709, 2502, 2501, 2500, 2503, 
		2504, 2505, 2508, 2509, 2510, 2511, 2512, 2507, 2514, 2707, 
		2513, 2705, 2704, 2703, 2702, 2706, 2700, 2516, 2515, 2701
	};
}
public class Policy : EClass

Recipe

@@ -926,4 +926,15 @@ public void TryGetFirstTimeBonus()

cs
			EClass.pc.Pick(ThingGen.Create("ticket_fortune").SetNum(num));
		}
	}

	public void SaveLastIngredients() 
	{ 
		List<int> list = new List<int>(); 
		foreach (Ingredient ingredient in ingredients) 
		{ 
			int item = ((ingredient.thing != null) ? ingredient.thing.uid : 0); 
			list.Add(item); 
		} 
		EClass.player.recipes.lastIngredients[id] = list; 
	} 
}

RecipeCard

@@ -319,7 +319,7 @@ public void MakeDish(Thing t)

cs
		if (EClass.pc.HasElement(1658))
		{
			t.elements.SetBase(757, 1);
			t.c_dateCooked = EClass.world.date.GetRaw() + (EClass.pc.Evalue(1658) - 1) * 24 * 60; 
			t.c_dateCooked = EClass.world.date.GetRaw() + (EClass.pc.Evalue(1658) - 1) * 48 * 60; 
		}
	}

RecipeManager

@@ -25,6 +25,9 @@ public class RecipeManager : EClass

cs
	[JsonProperty]
	public HashSet<string> newRecipes = new HashSet<string>();

	[JsonProperty] 
	public Dictionary<string, List<int>> lastIngredients = new Dictionary<string, List<int>>(); 

	public static void BuildList()
	{
		if (!rebuild && list.Count > 0)

SKILL

@@ -1,26 +1,26 @@

cs
public class SKILL
{
	public const int shield = 123; 
	public const int fireproof = 50; 

	public const int tactics = 132; 
	public const int marksman = 133; 

	public const int twowield = 131; 
	public const int weaponCrossbow = 109; 

	public const int twohand = 130; 
	public const int weaponScythe = 110; 

	public const int fireproof = 50; 
	public const int weaponBlunt = 111; 

	public const int armorLight = 120;

	public const int weaponBlunt = 111; 
	public const int armorHeavy = 122; 

	public const int weaponScythe = 110; 
	public const int shield = 123; 

	public const int weaponCrossbow = 109; 
	public const int twohand = 130; 

	public const int marksman = 133; 
	public const int twowield = 131; 

	public const int armorHeavy = 122; 
	public const int tactics = 132; 

	public const int eyeofmind = 134;

@@ -120,7 +120,7 @@ public class SKILL

cs

	public const int weaponPolearm = 106;

	public const int throwing = 108; 
	public const int weaponDagger = 107; 

	public const int mana = 61;

@@ -130,7 +130,7 @@ public class SKILL

cs

	public const int gathering = 250;

	public const int weaponDagger = 107; 
	public const int throwing = 108; 

	public const int blacksmith = 256;

@@ -264,13 +264,13 @@ public class SKILL

cs

	public static readonly int[] IDS = new int[131]
	{
		123, 132, 131, 130, 50, 120, 111, 110, 109, 133, 
		122, 134, 227, 150, 242, 241, 240, 237, 235, 230, 
		50, 133, 109, 110, 111, 120, 122, 123, 130, 131, 
		132, 134, 227, 150, 242, 241, 240, 237, 235, 230, 
		51, 226, 225, 220, 210, 207, 200, 152, 151, 135,
		55, 102, 57, 245, 62, 64, 65, 66, 67, 68,
		70, 71, 72, 73, 74, 75, 76, 56, 77, 79,
		80, 90, 91, 92, 100, 101, 103, 104, 105, 106,
		108, 61, 60, 78, 250, 107, 256, 916, 917, 918, 
		107, 61, 60, 78, 250, 108, 256, 916, 917, 918, 
		919, 920, 921, 922, 923, 924, 925, 950, 951, 952,
		953, 954, 955, 956, 957, 958, 959, 960, 961, 962,
		963, 964, 970, 971, 972, 255, 915, 914, 965, 912,

Trait

@@ -1869,6 +1869,7 @@ public void OnBarter()

cs
				AddThing(ThingGen.CreateRecipe("detector").SetPriceFix(700));
				AddThing(ThingGen.CreatePlan(2710)).SetPriceFix(-100);
				AddThing(ThingGen.CreatePlan(2711)).SetPriceFix(-100);
				AddThing(ThingGen.CreatePlan(2712)).SetPriceFix(200); 
				break;
			}
			if (Guild.Thief.IsCurrentZone)

TraitAdventurer

@@ -2,7 +2,7 @@ public class TraitAdventurer : TraitChara

cs
{
	public override bool UseGlobalGoal => base.owner.IsGlobal;

	public override bool UseRandomAbility => true; 
	public override int MaxRandomAbility => 3; 

	public override bool UseRandomAlias => true;

TraitBigDaddy

@@ -1,4 +1,16 @@

cs
public class TraitBigDaddy : TraitChara
{
	public override bool IsCountAsResident => true;

	public override int MaxRandomAbility
	{ 
		get
		{ 
			if (EClass._zone.DangerLv < 50) 
			{ 
				return 0; 
			} 
			return 3; 
		} 
	} 
}

TraitChara

@@ -84,7 +84,7 @@ public virtual bool CanSellPlan

cs

	public virtual bool ShowAdvRank => owner.IsPC;

	public virtual bool UseRandomAbility => false; 
	public virtual int MaxRandomAbility => 0; 

	public virtual Adv_Type AdvType => Adv_Type.None;

@@ -118,17 +118,7 @@ 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 virtual bool IsWearingPanty => EClass.pc.faction.IsWearingPanty(owner); 

	public override string IDInvStyle => "backpack";

TraitUniqueMonsterAdv

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

cs
public class TraitUniqueMonsterAdv : TraitUniqueMonster
{
	public override bool UseRandomAbility => true; 
	public override int MaxRandomAbility => 4; 

	public override bool UseRandomAlias => true;

UIMagicChest

@@ -70,10 +70,13 @@ public void Init()

cs
		int _i = i;
		b.SetOnClick(delegate
		{
			page = _i; 
			groupPage.Select(b); 
			SE.Tab(); 
			Redraw(); 
			if (!UIContextMenu.Current) 
			{ 
				page = _i; 
				groupPage.Select(b); 
				SE.Tab(); 
				Redraw(); 
			} 
		});
	}
	groupPage.Init();

@@ -109,16 +112,19 @@ public void RefreshCats()

cs
		string _c = cat;
		uIButton.SetOnClick(delegate
		{
			SE.Tab(); 
			if (idCat == _c) 
			{ 
				idCat = ""; 
			} 
			else
			if (!UIContextMenu.Current) 
			{
				idCat = _c; 
				SE.Tab(); 
				if (idCat == _c) 
				{ 
					idCat = ""; 
				} 
				else
				{ 
					idCat = _c; 
				} 
				Redraw(); 
			}
			Redraw(); 
		});
	}
	foreach (KeyValuePair<string, UIButton> item in catButton)

@@ -150,7 +156,7 @@ private void LateUpdate()

cs
			Search(inputSearch.text);
		}
	}
	if (EInput.wheel != 0) 
	if (EInput.wheel != 0 && !UIContextMenu.Current) 
	{
		SE.Tab();
		page -= EInput.wheel;

Widget

@@ -607,26 +607,29 @@ public void ShowContextMenu()

cs

	public void SetBaseContextMenu(UIContextMenu m)
	{
		UIContextMenu uIContextMenu = m.AddChild("anchor"); 
		SkinConfig cfg = config.skin;
		foreach (RectPosition p2 in Util.EnumToList<RectPosition>()) 
		if (!(this is WidgetSideScreen)) 
		{
			uIContextMenu.AddButton(((config.userAnchor == p2) ? "★ " : "") + p2.ToString().lang(), delegate
			UIContextMenu uIContextMenu = m.AddChild("anchor"); 
			foreach (RectPosition p2 in Util.EnumToList<RectPosition>()) 
			{
				SetAnchor(p2); 
				SE.ClickGeneral(); 
				m.Hide(); 
			}); 
		} 
		uIContextMenu = m.AddChild("pivot"); 
		foreach (RectPosition p in Util.EnumToList<RectPosition>()) 
		{ 
			uIContextMenu.AddButton(((config.pivot == p) ? "★ " : "") + p.ToString().lang(), delegate
				uIContextMenu.AddButton(((config.userAnchor == p2) ? "★ " : "") + p2.ToString().lang(), delegate
				{ 
					SetAnchor(p2); 
					SE.ClickGeneral(); 
					m.Hide(); 
				}); 
			} 
			uIContextMenu = m.AddChild("pivot"); 
			foreach (RectPosition p in Util.EnumToList<RectPosition>()) 
			{
				SetPivot(p); 
				SE.ClickGeneral(); 
				m.Hide(); 
			}); 
				uIContextMenu.AddButton(((config.pivot == p) ? "★ " : "") + p.ToString().lang(), delegate
				{ 
					SetPivot(p); 
					SE.ClickGeneral(); 
					m.Hide(); 
				}); 
			} 
		}
		UIContextMenuItem sliderB = null;
		Action Refresh = delegate

ZoneEventDefenseGame

@@ -53,7 +53,7 @@ public bool CanCallAlly

cs
		}
	}

	public override string TextWidgetDate => "defenseWave".lang(wave.ToString() ?? "", kills.ToString() ?? "") + ((instance != null && retreated) ? "defenseRetreating" : (CanRetreat ? "defenseRetreat" : "")).lang() + (CanCallAlly ? "defenseAlly" : "").lang(); 
	public override string TextWidgetDate => "defenseWave".lang(wave.ToString() ?? "", kills.ToString() ?? "", EClass._zone.DangerLv.ToString() ?? "") + ((instance != null && retreated) ? "defenseRetreating" : (CanRetreat ? "defenseRetreat" : "")).lang() + (CanCallAlly ? "defenseAlly" : "").lang(); 

	public virtual Chara CreateChara()
	{