Skip to content

EA 23.318 Nightly โ€‹

June 18, 2026

36 files modified.

Important Changes โ€‹

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

FoodEffect (1) โ€‹

cs
public static void ProcTrait(Chara c, Card t) 
public static void ProcTrait(Chara c, Card food) 

TaskDig (1) โ€‹

cs
public Thing GetTreasureMap() 
public Thing GetTreasureMap(Point p) 

AI_Haul โ€‹

public static Thing GetThingToClean(Chara c = null)

cs
	_list.Clear();
	foreach (Thing thing in EClass._map.things)
	{
		if (thing.placeState == PlaceState.roaming && !thing.isMasked && (thing.id == "731" || thing.id == "_egg" || thing.id == "egg_fertilized" || thing.id == "milk")) 
		if (thing.placeState == PlaceState.roaming && !thing.isMasked && (thing.id == "731" || thing.id == "_egg" || thing.id == "egg_fertilized" || thing.id == "_milk")) 
		{
			_list.Add(thing);
		}

ActPlan โ€‹

public void _Update(PointTarget target)

cs
							}
							if (!EClass._zone.IsUserZone || !t.isNPCProperty)
							{
								if (t.trait.CanEat(EClass.pc)) 
								if (t.trait.CanDrink(EClass.pc)) 
								{
									TrySetAct(new AI_Eat
									TrySetAct(new AI_Drink
									{
										target = t
									}, t);
								}
								if (t.trait.CanDrink(EClass.pc)) 
								else if (t.trait.CanEat(EClass.pc)) 
								{
									TrySetAct(new AI_Drink
									TrySetAct(new AI_Eat
									{
										target = t
									}, t);

ActThrow โ€‹

public static EffectIRenderer Throw(Card c, Point p, Card target, Thing t, Throw

cs
		{
			if (t.trait.CanDrink(Act.TC.Chara))
			{
				t.trait.OnDrink(Act.TC.Chara); 
				FoodEffect.ProcDrink(Act.TC.Chara, t); 
			}
			flag2 = t.IsNegativeGift;
			Act.TC.Chara.AddCondition<ConWet>();

ActWater โ€‹

public override bool Perform()

cs
	num = ((num <= 0) ? 1 : Mathf.Min(waterCan.owner.c_charges, 2 + num / 10));
	if (num > 1)
	{
		List<Point> list = EClass._map.ListPointsInCircle(Act.TP, num); 
		List<Point> list = EClass._map.ListPointsInSquare(Act.TP, num - 1); 
		list.Sort((Point a, Point b) => a.Distance(Act.TP) - b.Distance(Act.TP));
		foreach (Point item in list)
		{

BaseArea โ€‹

public void SetRandomName(int seed = -1)

cs

	public string GetRandomName(int seed = -1)
	{
		if (seed != -1) 
		bool flag = seed != -1; 
		if (flag) 
		{
			Rand.SetSeed(seed);
		}
		string combinedName = WordGen.GetCombinedName(EClass.Branch?.GetRandomName(), ListRoomNames().RandomItem(), room: true); 
		if (seed != -1) 
		string combinedName = WordGen.GetCombinedName(EClass.Branch?.GetRandomName(), ListRoomNames().RandomItem(), room: true, flag); 
		if (flag) 
		{
			Rand.SetSeed();
		}

BaseTaskHarvest โ€‹

public bool IsTooHard

cs

	public bool IsHarvest => pos.cell.CanHarvest();

	public virtual string IdRecipe => ""; 
	public virtual bool CanReapSeed => pos.cell.CanReapSeed();

	public virtual HarvestType harvestType => HarvestType.Block;

public bool IsTooHard

cs

	public override CursorInfo CursorIcon => CursorSystem.Cut;

	public virtual string GetIdRecipe(Point p) 
	{ 
		return ""; 
	} 
	public virtual string GetBaseText(string str)
	{
		return base.GetText(str);

public override string GetText(string str = "")

cs
	string text = "tHarvest".lang(GetBaseText(str), (EClass.pc.Tool == null) ? "hand".lang() : owner.Tool.NameSimple, toolLv.ToString() ?? "");
	if (EClass.pc.HasElement(1661))
	{
		RecipeManager.LearnState recipeLearnState = EClass.player.recipes.GetRecipeLearnState(IdRecipe); 
		RecipeManager.LearnState recipeLearnState = EClass.player.recipes.GetRecipeLearnState(GetIdRecipe(pos)); 
		switch (recipeLearnState)
		{
		case RecipeManager.LearnState.Learnable:

Card โ€‹

public void SpawnLoot(Card origin)

cs
			list.Add(thing2);
		}
	}
	bool flag2 = Chara.race.corpse[1].ToInt() > EClass.rnd(1500) || (Chara.IsPowerful && !IsPCFaction) || EClass.debug.godFood || HasTag(CTAG.alwaysDropCorpse); 
	bool flag2 = Chara.race.corpse[1].ToInt() > EClass.rnd(1500) || (Chara.IsPowerful && !IsPCFaction) || EClass.debug.godFood || (HasTag(CTAG.alwaysDropCorpse) && !IsPCFaction); 
	int num = 1;
	if (!IsMinion && Chara.IsAnimal && EClass.rnd(EClass._zone.IsPCFaction ? 3 : 5) == 0)
	{

public void SpawnLoot(Card origin)

cs
		}
		else
		{
			list.Add(ThingGen.Create("517").SetNum(num).MakeFoodFrom(this, makeRef: false)); 
			list.Add(ThingGen.Create("milk_custard").SetNum(num).MakeFoodFrom(this, makeRef: false)); 
		}
	}
	if (!IsPCFaction && (!isUserZone || !EClass.game.principal.disableUsermapBenefit) && chance(200))

public Thing TryMakeRandomItem(int lv = -1, TryMakeRandomItemSource itemSource =

cs
	case "ore":
		ChangeMaterial(MATERIAL.GetRandomMaterialFromCategory(lv, "ore", material));
		break;
	case "milk":
	case "_milk":
	case "_egg":
	case "egg_fertilized":
	case "_meat":

public Thing TryMakeRandomItem(int lv = -1, TryMakeRandomItemSource itemSource =

cs
		for (int i = 0; i < 20; i++)
		{
			CardRow cardRow = SpawnList.Get(text).Select(lv + i);
			if (cardRow.model.Chara.race.corpse[0] != "_meat" && id != "milk" && id != "_egg" && id != "egg_fertilized") 
			if (cardRow.model.Chara.race.corpse[0] != "_meat" && id != "_milk" && id != "_egg" && id != "egg_fertilized") 
			{
				continue;
			}

public Thing TryMakeRandomItem(int lv = -1, TryMakeRandomItemSource itemSource =

cs
					cardRow = crafter.source;
				}
			}
			if (id == "milk") 
			if (id == "_milk") 
			{
				if (c_idRefCard.IsEmpty())
				{

public Card MakeFoodFrom(Card c, bool makeRef = true)

cs
	bool flag = id == "meat_marble";
	int num2 = 1;
	bool flag2 = category.IsChildOf("meat");
	bool flag3 = id == "517" || id == "marshmallow_nama" || category.IsChildOf("egg") || trait is TraitGene; 
	bool flag3 = id == "marshmallow_nama" || category.IsChildOf("egg") || trait is TraitGene; 
	bool flag4 = category.IsChildOf("milk"); 
	if (flag)
	{
		num += 100;

public Card MakeFoodFrom(Card c, bool makeRef = true)

cs
		}
		elements.SetBase(71, (int)Mathf.Clamp((float)(num / 10) + Mathf.Sqrt(race.height) - 10f, 1f, 60f));
	}
	else if (flag3) 
	else if (!flag3) 
	{
		elements.SetBase(444, race.LER * race.LER / 5 * num / 100 - 10 + num / 10); 
		num2 = 2; 
		num2 = ((!flag4) ? 3 : 2); 
	}
	else
	{
		num2 = 3; 
		elements.SetBase(444, race.LER * race.LER / 5 * num / 100 - 10 + num / 10); 
		num2 = 2; 
	}
	if (flag2)
	{

public Thing MakeEgg(bool effect = true, int num = 1, bool addToZone = true, int

cs

	public Thing MakeMilk(bool effect = true, int num = 1, bool addToZone = true, BlessedState? state = null)
	{
		Thing thing = ThingGen.Create("milk").SetNum(num); 
		Thing thing = ThingGen.Create("_milk").SetNum(num); 
		if (!EClass.debug.enable && HasElement(1290) && Evalue(418) >= 0)
		{
			thing.MakeRefFrom(EClass.sources.charas.map["caladrius"].model);

Chara โ€‹

public void Drink(Card t)

cs
		Say("drink", this, t.Duplicate(1));
		Say("quaff");
		PlaySound("drink");
		hunger.Mod(-2); 
		t.ModNum(-1);
		t.trait.OnDrink(this); 
		FoodEffect.ProcDrink(this, t.Thing); 
		_ = IsPC;
	}

public bool TryUse(Thing t)

cs
		(t.trait as TraitItemProc).OnUse(this);
		return true;
	}
	if (t.trait.CanDrink(this)) 
	{ 
		Drink(t); 
		return true; 
	} 
	if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
	{
		SetAIImmediate(new AI_Eat

public bool TryUse(Thing t)

cs
		});
		return true;
	}
	if (t.trait.CanDrink(this)) 
	{ 
		Drink(t); 
		return true; 
	} 
	if (t.trait.CanRead(this))
	{
		SetAIImmediate(new AI_Read

CoreDebug โ€‹

public void QuickStart()

cs
		}
		EClass.pc.AddCard(thing);
		thing = ThingGen.Create("pouch");
		for (int k = 1; k < 5; k++) 
		for (int k = 0; k < 5; k++) 
		{
			Thing thing3 = ThingGen.Create("scrubber");
			thing3.elements.SetBase(770, k * 10); 
			thing3.elements.SetBase(770, k * 10 + 1); 
			thing.AddCard(thing3);
		}
		for (int l = 0; l < 30; l++)

public void UpdateInput()

cs
		Chara targetChara = EClass.scene.mouseTarget.TargetChara;
		if (targetChara != null)
		{
			EClass.pc.Pick(CraftUtil.MakeLoveLunch(targetChara)); 
			EClass.pc.Pick(targetChara.MakeMilk()); 
			EClass.pc.Pick(targetChara.MakeEgg(effect: true, 10));
			EClass.pc.Pick(targetChara.MakeGene());
			TraitFoodEggFertilized.Incubate(targetChara.MakeEgg(effect: false, 1, addToZone: false, 100), targetChara.pos.GetNearestPoint(allowBlock: false, allowChara: false));

public static string RegenerateNames()

cs
	EClass.core.mods.InitLang();
	NameGen.list = null;
	AliasGen.list = null;
	AliasGen.listMix.Clear(); 
	AliasGen.listBuiltin.Clear(); 
	WordGen.listMix.Clear(); 
	WordGen.listBuiltin.Clear(); 
	NameGen.Init();
	AliasGen.Init();
	foreach (Chara chara in EClass._map.charas)

CraftUtil โ€‹

public enum MixType

cs
	{
		General,
		Food,
		NoMix 
		NoMix, 
		Drink 
	}

	public enum WrapType

public static Card MixIngredients(Card product, List<Thing> ings, MixType type,

cs
{
	bool noMix = type == MixType.NoMix || product.HasTag(CTAG.noMix);
	bool isFood = type == MixType.Food;
	bool isDrink = type == MixType.Drink; 
	bool isFoodOrDrink = isFood || isDrink; 
	int nutFactor = 100 - (ings.Count - 1) * 5;
	Thing thing = ((ings.Count > 0) ? ings[0] : null);
	bool creative = crafter?.HasElement(487) ?? false;

public static Card MixIngredients(Card product, List<Thing> ings, MixType type,

cs
	{
		nutFactor -= 10;
	}
	if (isDrink) 
	{ 
		nutFactor = 100 / ings.Count; 
	} 
	if (!noMix)
	{
		foreach (Element value2 in product.elements.dict.Values)

public static Card MixIngredients(Card product, List<Thing> ings, MixType type,

cs
			product.elements.ModBase(item.id, item.Value);
		}
	}
	if (isDrink) 
	{ 
		product.elements.SetTo(10, 0); 
	} 
	if (isFood)
	{
		product.elements.SetTo(10, 5);

bool IsValidTrait(Element e)

cs
			}
			break;
		case MixType.Food:
		case MixType.Drink:
			if (e.IsFoodTrait || e.IsTrait || e.id == 2)
			{
				return true;

void MixElements(Card t)

cs
			{
				if (IsValidTrait(value3) && (!noMix || value3.id == 2))
				{
					if (isFood && value3.IsFoodTraitMain) 
					if (isFoodOrDrink && value3.IsFoodTraitMain) 
					{
						int num5 = value3.Value;
						if (product.id == "lunch_dystopia")

void MixElements(Card t)

cs
			{
				product.elements.ModBase(10, t.Evalue(10) * nutFactor / 100);
			}
			if (isDrink) 
			{ 
				product.elements.ModBase(10, Mathf.CeilToInt((float)t.Evalue(10) * (float)nutFactor / 100f)); 
			} 
		}
	}
}

CustomReligionContent โ€‹

public class CustomReligionContent : CustomSourceContent

cs

	public static CustomReligionContent CreateFromRow(SourceReligion.Row r, ModPackage owner = null)
	{
		EClass.sources.religions.map.Remove(r.id); 
		r.id = r.id.Split('#')[0]; 
		EClass.sources.religions.map[r.id] = r; 
		string text = r.id.Split('#')[0]; 
		if (owner == null)
		{
			owner = ModUtil.FindSourceRowPackage(r);
		}
		CustomReligionContent obj = new CustomReligionContent
		{
			ContentId = "Religion/" + r.id, 
			SourceId = r.id, 
			ContentId = "Religion/" + text, 
			SourceId = text, 
			Owner = owner,
			canJoin = (!r.id.Contains("#noJoin") && !r.id.Contains("#cannot")),
			isMinorGod = r.id.Contains("#minor")
		};
		EClass.sources.religions.map[text] = r; 
		if (!Portrait.modPortraits.dict.ContainsKey("UN_" + r.id) && SpriteReplacer.dictModItems.TryGetValue(r.id, out var value))
		{
			Portrait.modPortraits.Add("UN_" + r.id, new FileInfo(value + ".png"));

public static void Init()

cs
			{
				if (managed.TryGetValue(key, out var value))
				{
					bool flag = customReligionContent2.canJoin; 
					value.content.canJoin = flag; 
					bool flag2 = customReligionContent2.isMinorGod; 
					value.content.isMinorGod = flag2; 
					value.content.canJoin = customReligionContent2.canJoin; 
					value.content.isMinorGod = customReligionContent2.isMinorGod; 
					value.content.artifacts = customReligionContent2.artifacts;
					value.content.offeringMtp = customReligionContent2.offeringMtp;
					value.content.offeringValue = customReligionContent2.offeringValue;

FactionBranch โ€‹

void GetOutcome(Hobby h)

cs
				{
					if (!(text == "_egg"))
					{
						if (text == "milk") 
						if (text == "_milk") 
						{
							i.MakeMilk(date.IsRealTime, num6);
						}

FoodEffect โ€‹

public class FoodEffect : EClass

cs
{
	public static bool IsLeftoverable(Thing food)
	{
		if (food.HasElement(758) || food.HasElement(1229)) 
		{ 
			return false; 
		} 
		return food.trait is TraitLunch;
	}

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

public static void Proc(Chara c, Thing food, bool consume = true)

cs
	string idTaste = "";
	bool flag2 = food.HasElement(708);
	bool flag3 = food.HasElement(709);
	bool flag4 = c2.HasElement(1205); 
	bool flag4 = c.HasElement(1205); 
	bool flag5 = food.IsDecayed || flag3;
	bool flag6 = IsLeftoverable(food);
	bool flag7 = EClass._zone.HasField(10001) && food.GetBool(128);
	c2.AddFoodHistory(food); 
	if (c2.IsPCFaction && !c2.IsPC) 
	c.AddFoodHistory(food); 
	if (c.IsPCFaction && !c.IsPC) 
	{
		int num6 = c2.CountNumEaten(food); 
		bool flag8 = c2.GetFavFood().id == food.id; 
		int num6 = c.CountNumEaten(food); 
		bool flag8 = c.GetFavFood().id == food.id; 
		if (num6 < 2 || flag8)
		{
			if (num6 == 1 || flag8 || EClass.rnd(4) == 0)
			{
				c2.Talk("foodNice"); 
				c.Talk("foodNice"); 
			}
		}
		else if (num6 > 3 && EClass.rnd(num6) >= 3)
		{
			c2.Talk("foodBored"); 
			c.Talk("foodBored"); 
		}
	}
	if (food.IsBlessed)

public static void Proc(Chara c, Thing food, bool consume = true)

cs
		num5 = 0f;
		num2 *= 0.5f;
	}
	if (c2.HasElement(1250)) 
	if (c.HasElement(1250)) 
	{
		if (food.HasElement(710))
		{

public static void Proc(Chara c, Thing food, bool consume = true)

cs
			num3 /= 10;
		}
	}
	if (c2.HasElement(1200)) 
	if (c.HasElement(1200)) 
	{
		num2 *= 1f + (float)c2.Evalue(1200) * 0.3f; 
		num2 *= 1f + (float)c.Evalue(1200) * 0.3f; 
	}
	if (!c2.IsPC) 
	if (!c.IsPC) 
	{
		num2 *= 3f;
	}
	if (flag5 && !c2.HasElement(480)) 
	if (flag5 && !c.HasElement(480)) 
	{
		if (c2.IsPC) 
		if (c.IsPC) 
		{
			if (flag3)
			{
				c2.Say("food_undead"); 
				c.Say("food_undead"); 
			}
			c2.Say("food_rot"); 
			c.Say("food_rot"); 
		}
		num5 = 0f;
		num3 /= 2;

public static void Proc(Chara c, Thing food, bool consume = true)

cs
		switch (food.source._origin)
		{
		case "meat":
			if (c2.IsPC) 
			if (c.IsPC) 
			{
				c2.Say("food_raw_meat"); 
				c.Say("food_raw_meat"); 
			}
			num2 *= 0.7f;
			num5 = 0.5f;
			break;
		case "fish":
			if (c2.IsHuman) 
			if (c.IsHuman) 
			{
				if (c2.IsPC) 
				if (c.IsPC) 
				{
					c2.Say("food_raw_fish"); 
					c.Say("food_raw_fish"); 
				}
				num2 *= 0.9f;
				num5 = 0.5f;
			}
			break;
		case "dough":
			if (c2.IsPC) 
			if (c.IsPC) 
			{
				c2.Say("food_raw_powder"); 
				c.Say("food_raw_powder"); 
			}
			num2 *= 0.9f;
			num5 = 0.5f;
			break;
		}
	}
	float num7 = (flag7 ? num3 : Mathf.Min(c2.hunger.value, num3)); 
	if (c2.hunger.GetPhase() >= 3) 
	float num7 = (flag7 ? num3 : Mathf.Min(c.hunger.value, num3)); 
	if (c.hunger.GetPhase() >= 3) 
	{
		num7 *= 1.1f;
	}
	if (flag5 && !c2.HasElement(480)) 
	{ 
		c2.ModExp(70, -300); 
		c2.ModExp(71, -300); 
		c2.ModExp(72, -200); 
		c2.ModExp(73, -200); 
		c2.ModExp(74, -200); 
		c2.ModExp(75, 500); 
		c2.ModExp(76, -200); 
		c2.ModExp(77, -300); 
	} 
	else
	ProcNutrition(c, food, num2, num7); 
	if (!c.isDead) 
	{
		num2 = num2 * num7 / 10f; 
		if (c2.HasCondition<ConAnorexia>()) 
		{ 
			num2 = 0.01f; 
		} 
		List<Element> list = food.ListValidTraits(isCraft: true, limit: false); 
		foreach (Element value in food.elements.dict.Values) 
		ProcTrait(c, food); 
		if (!c.isDead) 
		{
			if (value.source.foodEffect.IsEmpty() || !list.Contains(value)) 
			{ 
				continue; 
			} 
			string[] foodEffect = value.source.foodEffect; 
			int id = value.id; 
			float num8 = num2 * (float)value.Value; 
			if (value.source.category == "food" && c2.IsPC) 
			num4 += (float)food.Evalue(70); 
			num4 += (float)(food.Evalue(72) / 2); 
			num4 += (float)(food.Evalue(73) / 2); 
			num4 += (float)(food.Evalue(75) / 2); 
			num4 += (float)(food.Evalue(76) * 3 / 2); 
			num4 += (float)food.Evalue(440); 
			num4 += (float)(food.Evalue(445) / 2); 
			num4 -= (float)food.Evalue(71); 
			num4 += (float)food.Evalue(18); 
			num4 += (float)(num3 / 2); 
			num4 *= num5; 
			if (idTaste.IsEmpty()) 
			{
				bool flag9 = num8 >= 0f; 
				string text = value.source.GetText(flag9 ? "textInc" : "textDec", returnNull: true); 
				if (text != null) 
				if (num4 > 100f) 
				{
					Msg.SetColor(flag9 ? "positive" : "negative"); 
					c2.Say(text); 
					idTaste = "food_great"; 
				}
			} 
			switch (foodEffect[0]) 
			{ 
			case "god": 
			{ 
				int int2 = c2.GetInt(117); 
				if (int2 < 10) 
				else if (num4 > 70f) 
				{ 
					idTaste = "food_good"; 
				} 
				else if (num4 > 50f) 
				{
					foreach (Element value2 in c2.elements.dict.Values) 
					idTaste = "food_soso"; 
				} 
				else if (num4 > 30f) 
				{ 
					idTaste = "food_average"; 
				} 
				else
				{ 
					idTaste = "food_bad"; 
				} 
				if (c.IsPC) 
				{ 
					c.Say(idTaste); 
					if (flag2) 
					{ 
						c.Say(flag4 ? "food_human_pos" : "food_human_neg"); 
					} 
					else if (flag4) 
					{
						if (value2.IsMainAttribute) 
						{ 
							c2.elements.ModPotential(value2.id, 2); 
						} 
						c.Say("food_human_whine"); 
					}
				}
				c2.Say("little_eat", c2); 
				c2.PlaySound("ding_potential"); 
				c2.elements.ModExp(306, -1000f); 
				c2.SetInt(117, int2 + 1); 
				flag6 = false; 
				break; 
			}
			case "exp": 
			if (LangGame.Has(idTaste + "2")) 
			{
				id = ((foodEffect.Length > 1) ? EClass.sources.elements.alias[foodEffect[1]].id : value.id); 
				int a = (int)(num8 * (float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3; 
				c2.ModExp(id, a); 
				break; 
				c.Say(idTaste + "2", c, food); 
			}
			case "pot": 
			if (!c.IsPCParty) 
			{
				id = ((foodEffect.Length > 1) ? EClass.sources.elements.alias[foodEffect[1]].id : value.id); 
				int vTempPotential = c2.elements.GetElement(id).vTempPotential; 
				int num9 = EClass.rndHalf((int)(num8 / 5f) + 1); 
				num9 = num9 * 100 / Mathf.Max(100, vTempPotential * 2 / 3); 
				c2.elements.ModTempPotential(id, num9, 8); 
				break; 
				num3 *= 2; 
			}
			case "karma": 
				if (c2.IsPCParty) 
				{ 
					EClass.player.ModKarma(-5); 
				} 
				break; 
			case "poison": 
				ActEffect.Poison(c2, EClass.pc, value.Value * 10); 
				if (!c2.isDead) 
				{ 
					break; 
				} 
				goto IL_0fad; 
			case "love": 
				ActEffect.LoveMiracle(c2, EClass.pc, value.Value * 10); 
				break; 
			case "loseWeight": 
				c2.ModWeight(-EClass.rndHalf(value.Value), ignoreLimit: true); 
				break; 
			case "gainWeight": 
				c2.ModWeight(EClass.rndHalf(value.Value), ignoreLimit: true); 
				break; 
			case "little": 
			num3 = num3 * (100 + c.Evalue(1235) * 10) / (100 + c.Evalue(1234) * 10 + c.Evalue(1236) * 15); 
			c.hunger.Mod(-num3); 
			if (flag2) 
			{
				int @int = c2.GetInt(112); 
				if (@int < 30) 
				if (!flag4) 
				{
					c2.Say("little_eat", c2); 
					c2.PlaySound("ding_potential"); 
					int v = Mathf.Max(5 - @int / 2, 1); 
					Debug.Log("sister eaten:" + @int + "/" + v); 
					foreach (Element value3 in c2.elements.dict.Values) 
					if (c.IsHuman) 
					{
						if (value3.IsMainAttribute) 
						{ 
							c2.elements.ModPotential(value3.id, v); 
						} 
						c.AddCondition<ConInsane>(200); 
						c.SAN.Mod(15); 
					} 
					if (EClass.rnd(c.IsHuman ? 5 : 20) == 0) 
					{ 
						c.SetFeat(1205, 1, msg: true); 
						flag4 = true; 
					}
				}
				if (c2.race.id == "mutant" && c2.elements.Base(1230) < 10) 
				if (flag4) 
				{
					c2.Say("little_adam", c2); 
					c2.SetFeat(1230, c2.elements.Base(1230) + 1); 
					c.SetInt(31, EClass.world.date.GetRaw() + 10080); 
				}
				c2.SetInt(112, @int + 1); 
				break; 
			} 
			}
		} 
	} 
	ProcTrait(c2, food); 
	num4 += (float)food.Evalue(70); 
	num4 += (float)(food.Evalue(72) / 2); 
	num4 += (float)(food.Evalue(73) / 2); 
	num4 += (float)(food.Evalue(75) / 2); 
	num4 += (float)(food.Evalue(76) * 3 / 2); 
	num4 += (float)food.Evalue(440); 
	num4 += (float)(food.Evalue(445) / 2); 
	num4 -= (float)food.Evalue(71); 
	num4 += (float)food.Evalue(18); 
	num4 += (float)(num3 / 2); 
	num4 *= num5; 
	if (idTaste.IsEmpty()) 
	{ 
		if (num4 > 100f) 
		{ 
			idTaste = "food_great"; 
		} 
		else if (num4 > 70f) 
		{ 
			idTaste = "food_good"; 
		} 
		else if (num4 > 50f) 
		{ 
			idTaste = "food_soso"; 
		} 
		else if (num4 > 30f) 
		{ 
			idTaste = "food_average"; 
		} 
		else
		{ 
			idTaste = "food_bad"; 
		} 
		if (c2.IsPC) 
		{ 
			c2.Say(idTaste); 
			if (flag2) 
			else if (flag4 && c.GetInt(31) < EClass.world.date.GetRaw()) 
			{
				c2.Say(flag4 ? "food_human_pos" : "food_human_neg"); 
				c.SetFeat(1205, 0, msg: true); 
			}
			else if (flag4) 
			if (flag5 && !c.HasElement(480)) 
			{
				c2.Say("food_human_whine"); 
				c.AddCondition<ConParalyze>(); 
				c.AddCondition<ConConfuse>(200); 
			}
		} 
	} 
	if (LangGame.Has(idTaste + "2")) 
	{ 
		c2.Say(idTaste + "2", c2, food); 
	} 
	if (!c2.IsPCParty) 
	{ 
		num3 *= 2; 
	} 
	num3 = num3 * (100 + c2.Evalue(1235) * 10) / (100 + c2.Evalue(1234) * 10 + c2.Evalue(1236) * 15); 
	c2.hunger.Mod(-num3); 
	if (flag2) 
	{ 
		if (!flag4) 
		{ 
			if (c2.IsHuman) 
			if (c.HasCondition<ConAnorexia>()) 
			{
				c2.AddCondition<ConInsane>(200); 
				c2.SAN.Mod(15); 
				c.Vomit(); 
			}
			if (EClass.rnd(c2.IsHuman ? 5 : 20) == 0) 
			if (num3 > 20 && c.HasElement(1413)) 
			{
				c2.SetFeat(1205, 1, msg: true); 
				flag4 = true; 
				Thing thing = ThingGen.Create("seed"); 
				if (EClass.rnd(EClass.debug.enable ? 2 : 10) == 0) 
				{ 
					TraitSeed.ApplySeed(thing, (EClass.rnd(4) == 0) ? 118 : ((EClass.rnd(3) == 0) ? 119 : 90)); 
				} 
				thing.SetNum(2 + EClass.rnd(3)); 
				c.Talk("vomit"); 
				c.Say("fairy_vomit", c, thing); 
				c.PickOrDrop(c.pos, thing); 
			}
			food.trait.OnEat(c); 
		}
		if (flag4) 
		{ 
			c2.SetInt(31, EClass.world.date.GetRaw() + 10080); 
		} 
	} 
	else if (flag4 && c2.GetInt(31) < EClass.world.date.GetRaw()) 
	{ 
		c2.SetFeat(1205, 0, msg: true); 
	} 
	if (flag5 && !c2.HasElement(480)) 
	{ 
		c2.AddCondition<ConParalyze>(); 
		c2.AddCondition<ConConfuse>(200); 
	} 
	if (c2.HasCondition<ConAnorexia>()) 
	{ 
		c2.Vomit(); 
	} 
	if (num3 > 20 && c2.HasElement(1413)) 
	{ 
		Thing thing = ThingGen.Create("seed"); 
		if (EClass.rnd(EClass.debug.enable ? 2 : 10) == 0) 
		{ 
			TraitSeed.ApplySeed(thing, (EClass.rnd(4) == 0) ? 118 : ((EClass.rnd(3) == 0) ? 119 : 90)); 
		} 
		thing.SetNum(2 + EClass.rnd(3)); 
		c2.Talk("vomit"); 
		c2.Say("fairy_vomit", c2, thing); 
		c2.PickOrDrop(c2.pos, thing); 
	} 
	food.trait.OnEat(c2); 
	if (food.trait is TraitDrink) 
	{ 
		food.trait.OnDrink(c2); 
	}
	goto IL_0fad; 
	IL_0fad: 
	if (consume)
	{
		num7 += 5f;

public static void Proc(Chara c, Thing food, bool consume = true)

cs
			food.ModNum(-1);
		}
	}
	if (!c2.IsCat && food.trait is TraitFoodChuryu) 
	if (c.isDead) 
	{
		int num10 = 0; 
		foreach (Chara item in c2.pos.ListCharasInRadius(c2, 5, (Chara c) => c.IsCat)) 
		return; 
	} 
	if (!c.IsCat && food.trait is TraitFoodChuryu) 
	{ 
		int num8 = 0; 
		foreach (Chara item in c.pos.ListCharasInRadius(c, 5, (Chara c) => c.IsCat)) 
		{
			item.Say("angry", item);
			item.ShowEmo(Emo.angry);
			item.PlaySound("Animal/Cat/cat_angry");
			if (c2.IsPC) 
			if (c.IsPC) 
			{
				EClass.player.ModKarma(-3);
			}
			num10++; 
			num8++; 
		}
		EClass.player.stats.angryCats += num10; 
		Debug.Log(num10 + "/" + EClass.player.stats.angryCats); 
		if (num10 >= 10) 
		EClass.player.stats.angryCats += num8; 
		Debug.Log(num8 + "/" + EClass.player.stats.angryCats); 
		if (num8 >= 10) 
		{
			Steam.GetAchievement(ID_Achievement.CHURYU);
		}
	}
	if (c2.IsPC && EClass._zone is Zone_Lothria) 
	if (c.IsPC && EClass._zone is Zone_Lothria) 
	{
		switch (food.id)
		{

public static void Proc(Chara c, Thing food, bool consume = true)

cs
			break;
		}
	}
	if (!(food.trait is TraitGene) || !c2.IsPC || !c2.HasElement(1274)) 
	if (!(food.trait is TraitGene) || !c.IsPC || !c.HasElement(1274)) 
	{
		return;
	}
	DNA c_DNA = food.c_DNA;
	int slot = c_DNA.slot;
	CharaGenes genes = c2.c_genes; 
	int excess = c2.CurrentGeneSlot + slot - c2.MaxGeneSlot; 
	CharaGenes genes = c.c_genes; 
	int excess = c.CurrentGeneSlot + slot - c.MaxGeneSlot; 
	switch (c_DNA.type)
	{
	case DNA.Type.Inferior:

public static void Proc(Chara c, Thing food, bool consume = true)

cs
		if (genes != null)
		{
			genes.items.Shuffle();
			Msg.Say("reconstruct", c2); 
			c2.Say("food_mind", c2); 
			c2.AddCondition<ConHallucination>(); 
			Msg.Say("reconstruct", c); 
			c.Say("food_mind", c); 
			c.AddCondition<ConHallucination>(); 
		}
		return;
	}

public static void Proc(Chara c, Thing food, bool consume = true)

cs
				RemoveDNA(fromOldest: true);
			}
		}
		c_DNA.Apply(c2); 
		c2.Say("little_eat", c2); 
		c2.PlaySound("ding_potential"); 
		c_DNA.Apply(c); 
		c.Say("little_eat", c); 
		c.PlaySound("ding_potential"); 
		SE.Play("mutation");
		c2.PlayEffect("identify"); 
		c.PlayEffect("identify"); 
		void RemoveDNA(bool fromOldest)
		{
			DNA dNA = (fromOldest ? genes.items[0] : genes.items.Last());
			CharaGenes.Remove(c2, dNA); 
			CharaGenes.Remove(c, dNA); 
			excess -= dNA.slot;
		}
	}

	public static void ProcTrait(Chara c, Card t) 
	public static void ProcDrink(Chara c, Thing food) 
	{ 
		int num = Mathf.Max(1, food.Evalue(10)); 
		float num2 = (float)(100 + Mathf.Min(food.QualityLv * 10, 100)) / 200f; 
		if (num2 < 0.1f) 
		{ 
			num2 = 0.1f; 
		} 
		if (c.hunger.GetPhase() <= 0) 
		{ 
			num = 0; 
		} 
		c.hunger.Mod(-num); 
		ProcNutrition(c, food, num2, num); 
		if (!c.isDead) 
		{ 
			ProcTrait(c, food); 
		} 
		if (!c.isDead) 
		{ 
			food.trait.OnDrink(c); 
		} 
	} 
	public static void ProcNutrition(Chara c, Thing food, float effP, float validFill) 
	{ 
		bool flag = food.HasElement(709); 
		if ((food.IsDecayed || flag) && !c.HasElement(480)) 
		{ 
			c.ModExp(70, -300); 
			c.ModExp(71, -300); 
			c.ModExp(72, -200); 
			c.ModExp(73, -200); 
			c.ModExp(74, -200); 
			c.ModExp(75, 500); 
			c.ModExp(76, -200); 
			c.ModExp(77, -300); 
			return; 
		} 
		effP = effP * validFill / 10f; 
		if (c.HasCondition<ConAnorexia>()) 
		{ 
			effP = 0.01f; 
		} 
		List<Element> list = food.ListValidTraits(isCraft: true, limit: false); 
		foreach (Element value in food.elements.dict.Values) 
		{ 
			if (value.source.foodEffect.IsEmpty() || !list.Contains(value)) 
			{ 
				continue; 
			} 
			string[] foodEffect = value.source.foodEffect; 
			int id = value.id; 
			float num = effP * (float)value.Value; 
			if (value.source.category == "food" && c.IsPC) 
			{ 
				bool flag2 = num >= 0f; 
				string text = value.source.GetText(flag2 ? "textInc" : "textDec", returnNull: true); 
				if (text != null) 
				{ 
					Msg.SetColor(flag2 ? "positive" : "negative"); 
					c.Say(text); 
				} 
			} 
			switch (foodEffect[0]) 
			{ 
			case "god": 
			{ 
				int int2 = c.GetInt(117); 
				if (int2 < 10) 
				{ 
					foreach (Element value2 in c.elements.dict.Values) 
					{ 
						if (value2.IsMainAttribute) 
						{ 
							c.elements.ModPotential(value2.id, 2); 
						} 
					} 
				} 
				c.Say("little_eat", c); 
				c.PlaySound("ding_potential"); 
				c.elements.ModExp(306, -1000f); 
				c.SetInt(117, int2 + 1); 
				break; 
			} 
			case "exp": 
			{ 
				id = ((foodEffect.Length > 1) ? EClass.sources.elements.alias[foodEffect[1]].id : value.id); 
				int a = (int)(num * (float)((foodEffect.Length > 2) ? foodEffect[2].ToInt() : 4)) * 2 / 3; 
				c.ModExp(id, a); 
				break; 
			} 
			case "pot": 
			{ 
				id = ((foodEffect.Length > 1) ? EClass.sources.elements.alias[foodEffect[1]].id : value.id); 
				int vTempPotential = c.elements.GetElement(id).vTempPotential; 
				int num2 = EClass.rndHalf((int)(num / 5f) + 1); 
				num2 = num2 * 100 / Mathf.Max(100, vTempPotential * 2 / 3); 
				c.elements.ModTempPotential(id, num2, 8); 
				break; 
			} 
			case "karma": 
				if (c.IsPCParty) 
				{ 
					EClass.player.ModKarma(-5); 
				} 
				break; 
			case "poison": 
				ActEffect.Poison(c, EClass.pc, value.Value * 10); 
				break; 
			case "love": 
				ActEffect.LoveMiracle(c, EClass.pc, value.Value * 10); 
				break; 
			case "loseWeight": 
				c.ModWeight(-EClass.rndHalf(value.Value), ignoreLimit: true); 
				break; 
			case "gainWeight": 
				c.ModWeight(EClass.rndHalf(value.Value), ignoreLimit: true); 
				break; 
			case "little": 
			{ 
				int @int = c.GetInt(112); 
				if (@int < 30) 
				{ 
					c.Say("little_eat", c); 
					c.PlaySound("ding_potential"); 
					int v = Mathf.Max(5 - @int / 2, 1); 
					Debug.Log("sister eaten:" + @int + "/" + v); 
					foreach (Element value3 in c.elements.dict.Values) 
					{ 
						if (value3.IsMainAttribute) 
						{ 
							c.elements.ModPotential(value3.id, v); 
						} 
					} 
				} 
				if (c.race.id == "mutant" && c.elements.Base(1230) < 10) 
				{ 
					c.Say("little_adam", c); 
					c.SetFeat(1230, c.elements.Base(1230) + 1); 
				} 
				c.SetInt(112, @int + 1); 
				break; 
			} 
			} 
		} 
	} 
	public static void ProcTrait(Chara c, Card food) 
	{
		bool flag = false;
		foreach (Element value in t.elements.dict.Values) 
		foreach (Element value in food.elements.dict.Values) 
		{
			if (!value.IsTrait)
			{

FortuneRollData โ€‹

public List<List<string>> GetPrizeList()

cs
		new List<string>
		{
			"microchip", "1089", "150", "855", "medal", "water", "goods_charm", "electronicsS", "electronics", "plat",
			"plat", "ration", "backpack2", "sister", "rp_food", "rp_block", "157", "sleepingbag"
			"plat", "ration", "backpack2", "sister", "rp_food", "rp_block", "157", "sleepingbag", "scrubber"
		},
		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", "bbq",
			"panty", "beehive", "ticket_resident", "lovepotion", "crystal_sun", "goods_crim", "ride_boat"
			"panty", "beehive", "ticket_resident", "lovepotion", "crystal_sun", "goods_crim", "ride_boat", "scrubber"
		},
		new List<string>
		{

public void GetPrize(int grade, int seed)

cs
				card.rarity = Rarity.Legendary;
				break;
			case "scrubber":
				if (grade == 3) 
				if (grade >= 1) 
				{
					card.rarity = Rarity.Legendary;
					card.elements.SetBase(770, 1 + EClass.rnd(25)); 
					card.elements.SetBase(770, (grade == 1) ? 1 : ((grade - 1) * 10)); 
				}
				break;
			}

GoalCombat โ€‹

public virtual bool TryUseAbility(int dist, bool beforeMove = false)

cs
			break;
		case "taunt":
		{
			bool flag10 = owner.HasCondition<StanceTaunt>(); 
			bool flag11 = tactics.source.taunt != -1 && 100 * owner.hp / owner.MaxHP >= tactics.source.taunt; 
			num = ((flag10 && !flag11) ? 100 : ((!flag10 && flag11) ? 100 : 0)); 
			bool flag6 = owner.HasCondition<StanceTaunt>(); 
			bool flag7 = tactics.source.taunt != -1 && 100 * owner.hp / owner.MaxHP >= tactics.source.taunt; 
			num = ((flag6 && !flag7) ? 100 : ((!flag6 && flag7) ? 100 : 0)); 
			break;
		}
		case "song":
		{
			bool flag8 = owner.HasCondition<BaseSong>(); 
			bool flag9 = owner.mana.value > owner.mana.max / 3; 
			num = ((flag8 && !flag9) ? 100 : ((!flag8 && flag9) ? 100 : 0)); 
			bool flag10 = owner.HasCondition<BaseSong>(); 
			bool flag11 = owner.mana.value > owner.mana.max / 3; 
			num = ((flag10 && !flag11) ? 100 : ((!flag10 && flag11) ? 100 : 0)); 
			break;
		}
		case "melee":

public virtual bool TryUseAbility(int dist, bool beforeMove = false)

cs
			{
				continue;
			}
			bool flag12 = text == "dot"; 
			if (flag12 && (owner.isRestrained || (tc != null && tc.IsRestrainedResident))) 
			bool flag9 = text == "dot"; 
			if (flag9 && (owner.isRestrained || (tc != null && tc.IsRestrainedResident))) 
			{
				continue;
			}
			num = ((text == "attackMelee") ? tactics.P_Melee : tactics.P_Spell) + GetAttackMod(act);
			if (num > 0 && flag12) 
			if (num > 0 && flag9) 
			{
				num += 10;
			}

public virtual bool TryUseAbility(int dist, bool beforeMove = false)

cs
			{
				continue;
			}
			bool flag6 = act is ActBolt; 
			bool flag7 = act is ActBall; 
			if ((owner.pos.IsBlocked && (flag6 || flag7)) || !flag || (owner.IsPCParty && (EClass._zone.IsTown || EClass._zone.IsPCFaction)) || (act.id == 9150 && EClass._zone.IsPCFaction && owner.IsNeutralOrAbove())) 
			bool flag8 = act is ActBolt; 
			if ((owner.pos.IsBlocked && (flag8 || act is ActBall || act is ActBreathe)) || !flag || (owner.IsPCParty && (EClass._zone.IsTown || EClass._zone.IsPCFaction)) || (act.id == 9150 && EClass._zone.IsPCFaction && owner.IsNeutralOrAbove())) 
			{
				continue;
			}
			GetNumEnemy(flag6 ? 6 : 5); 
			if (numEnemy == 0 || (owner.IsPCFactionOrMinion && GetNumNeutral(flag6 ? 6 : 5) > 0)) 
			GetNumEnemy(flag8 ? 6 : 5); 
			if (numEnemy == 0 || (owner.IsPCFactionOrMinion && GetNumNeutral(flag8 ? 6 : 5) > 0)) 
			{
				continue;
			}

int HealFactor(Chara c)

cs
			{
				return 0;
			}
			float num5 = (float)c.hp / (float)c.MaxHP; 
			if (num5 > (isHOT ? 0.85f : 0.75f)) 
			float num7 = (float)c.hp / (float)c.MaxHP; 
			if (num7 > (isHOT ? 0.85f : 0.75f)) 
			{
				return 0;
			}
			int num6 = tactics.P_Heal - (int)((float)tactics.P_Heal * num5) + (isHOT ? 50 : 25); 
			int num8 = tactics.P_Heal - (int)((float)tactics.P_Heal * num7) + (isHOT ? 50 : 25); 
			foreach (Condition condition2 in c.conditions)
			{
				if (condition2 is ConFear)
				{
					num6 += 10; 
					num8 += 10; 
				}
				else if (condition2 is ConPoison)
				{
					num6 += 2; 
					num8 += 2; 
				}
				else if (condition2 is ConConfuse)
				{
					num6 += 4; 
					num8 += 4; 
				}
				else if (condition2 is ConDim)
				{
					num6 += 6; 
					num8 += 6; 
				}
				else if (condition2 is ConBleed)
				{
					num6 += 8; 
					num8 += 8; 
				}
			}
			return num6; 
			return num8; 
		}
	}
	abilities.Sort((ItemAbility a, ItemAbility b) => b.priority - a.priority);

int ForeachChara(ItemAbility a, Func<Chara, int> func, bool isFriendlyAbility)

cs
			return func(owner);
		}
		BuildCharaList();
		int num7 = 0; 
		int num5 = 0; 
		foreach (Chara chara3 in charas)
		{
			int num8 = func(chara3); 
			if (num8 > 0) 
			int num6 = func(chara3); 
			if (num6 > 0) 
			{
				if (isFriendlyAbility)
				{

int ForeachChara(ItemAbility a, Func<Chara, int> func, bool isFriendlyAbility)

cs
					}
					if (chara3 != owner)
					{
						num8 += tactics.P_Party; 
						num6 += tactics.P_Party; 
					}
				}
				else if (!owner.IsHostile(chara3))
				{
					continue;
				}
				if (num8 >= num7) 
				if (num6 >= num5) 
				{
					a.tg = chara3;
					num7 = num8; 
					num5 = num6; 
				}
			}
		}
		return num7; 
		return num5; 
	}
	int GetAttackMod(Act a)
	{

Map โ€‹

public void TrySmoothPick(Point p, Thing t, Chara c)

cs
	{
		EClass.pc.PickOrDrop(p, t);
	}
	else if (c != null && c.IsPC && (c.pos.Equals(p) || (EClass.core.config.game.smoothPick && c.Dist(p) <= 1) || EClass._zone.IsRegion)) 
	else if (c != null && c.IsPC && (c.pos.Equals(p) || EClass.core.config.game.smoothPick || EClass._zone.IsRegion)) 
	{
		c.PickOrDrop(p, t);
	}

public List<Point> ListPointsInCircle(Point center, float radius, bool mustBeWal

cs
		return list;
	}

	public List<Point> ListPointsInSquare(Point center, int radius, bool mustBeWalkable = true, bool los = true) 
	{ 
		List<Point> list = new List<Point>(); 
		ForeachSquare(center.x, center.z, radius, delegate(Point p) 
		{ 
			if ((!mustBeWalkable || !p.cell.blocked) && (!los || Los.IsVisible(center, p))) 
			{ 
				list.Add(p.Copy()); 
			} 
		}); 
		return list; 
	} 
	public List<Chara> ListCharasInCircle(Point center, float radius, bool los = true)
	{
		List<Chara> list = new List<Chara>();

public void ForeachSphere(int _x, int _z, float r, Action<Point> action)

cs
		}
	}

	public void ForeachSquare(int _x, int _z, int r, Action<Point> action) 
	{ 
		Point point = new Point(); 
		for (int i = _x - r; i < _x + r + 1; i++) 
		{ 
			if (i < 0 || i >= Size) 
			{ 
				continue; 
			} 
			for (int j = _z - r; j < _z + r + 1; j++) 
			{ 
				if (j >= 0 && j < Size) 
				{ 
					point.Set(i, j); 
					action(point); 
				} 
			} 
		} 
	} 
	public void ForeachNeighbor(Point center, Action<Point> action)
	{
		int num = center.x;

ModManager โ€‹

public IEnumerator RefreshMods(Action onComplete, bool syncMods)

cs
	disableMod |= Application.isEditor && EClass.debug.skipMod;
	LoadLocalPackages();
	LoadCustomPackage();
	if (!disableMod) 
	if (!disableMod && dirWorkshop != null) 
	{
		_loading.Log("Loading workshop contents...");
		if (flag)
		{
			yield return LoadWorkshopPackages();
		}
		else if (dirWorkshop != null) 
		else
		{
			DirectoryInfo[] directories = dirWorkshop.GetDirectories();
			foreach (DirectoryInfo dir in directories)

public ModPackage AddPackage(DirectoryInfo dir, bool isInPackages = false)

cs

	public ModPackage AddWorkshopPackage(WorkshopItem item, bool isInPackages = false)
	{
		ulong sizeOnDisk; 
		string folderPath; 
		DateTime timeStamp; 
		bool itemInstallInfo = UserGeneratedContent.Client.GetItemInstallInfo(item.FileId, out sizeOnDisk, out folderPath, out timeStamp); 
		DirectoryInfo directoryInfo = new DirectoryInfo(folderPath); 
		if (!directoryInfo.Exists) 
		bool itemInstallInfo = UserGeneratedContent.Client.GetItemInstallInfo(item.FileId, out var _, out var folderPath, out var _); 
		if (folderPath == null) 
		{
			return null; 
			folderPath = Path.Combine(DirWorkshop.FullName, item.FileId.ToString()); 
		}
		DirectoryInfo directoryInfo = new DirectoryInfo(folderPath); 
		itemInstallInfo &= directoryInfo.Exists; 
		ModPackage modPackage = AddPackage(directoryInfo, isInPackages);
		modPackage.installed = itemInstallInfo;
		modPackage.banned = item.IsBanned;
		modPackage.workshopId = item.FileId.ToString();
		modPackage.item = item; 
		return modPackage;
	}

public void ActivatePackages()

cs
public override void ParseExtra(DirectoryInfo dir, BaseModPackage package)
{
	ModPackage modPackage = (ModPackage)package;
	switch (dir.Name) 
	switch (dir.Name.ToLower()) 
	{
	case "TalkText": 
	case "talktext": 
		modPackage.ParseTalkText(dir);
		break;
	case "Map": 
	case "map": 
		if (!package.builtin)
		{
			modPackage.ParseMap(dir);
		}
		break;
	case "Map Piece": 
	case "map piece": 
		if (!package.builtin)
		{
			modPackage.ParseMapPiece(dir);
		}
		break;
	case "Texture Replace": 
	case "texture replace": 
		replaceFiles.AddRange(modPackage.ParseTextureReplace(dir));
		break;
	case "Texture": 
	case "texture": 
		modPackage.ParseTexture(dir);
		break;
	case "Portrait": 
	case "portrait": 
		modPackage.ParsePortrait(dir);
		break;
	case "LangMod": 
	case "langmod": 
		modPackage.ParseLangMod(dir);
		break;
	case "Sound": 
	case "sound": 
		modPackage.ParseSound(dir);
		break;
	case "Lang": 
	case "lang": 
		modPackage.AddOrUpdateLang(dir);
		break;
	}

ModPackage โ€‹

public override void GenerateCustomContentProfiles()

cs
								}
								else
								{
									ModUtil.FixDefaultThingRowPref(r6); 
									customContent.Add(CustomThingContent.CreateFromRow(r6, this));
								}
							}

ModUtil โ€‹

public static Zone FindZoneByFullName(string zoneFullName = "ntyris/0", bool use

cs
	{
		return null;
	}
	zoneFullName = zoneFullName.Replace('/', '@'); 
	Zone zone = EClass.game.spatials.Find((Zone z) => z.ZoneFullName == zoneFullName); 
	if (zone != null) 
	var (zoneType, zoneId, destLv) = Zone.ParseZoneFullName(zoneFullName); 
	if (zoneId.IsEmpty()) 
	{
		return zone; 
	} 
	int num = zoneFullName.LastIndexOf('@'); 
	int destLv = 0; 
	string zoneType; 
	if (num > 0 && num < zoneFullName.Length - 1) 
	{ 
		zoneType = zoneFullName[..num]; 
		destLv = zoneFullName[(num + 1)..].ToInt(); 
	} 
	else
	{ 
		zoneType = zoneFullName.Replace("@", ""); 
		return null; 
	}
	string zoneId = zoneType.Replace("Zone_", ""); 
	zoneType = "Zone_" + zoneId; 
	zone = EClass.game.spatials.Find((Zone z) => z.GetType().Name == zoneType || z.id == zoneId)?.FindOrCreateLevel(destLv); 
	Zone zone = EClass.game.spatials.Find((Zone z) => z.GetType().Name == zoneType || z.id == zoneId)?.FindOrCreateLevel(destLv); 
	if (zone == null && (zoneId == "*" || useRandomFallback))
	{
		zone = (from z in EClass.game.spatials.map.Values.OfType<Zone>()

private static void OnPreLoadInit(GameIOContext context)

cs
private static void OnPostLoadInit(GameIOContext context)
{
	EClass.player.knownBGMs.RemoveWhere((int id) => !EClass.core.refs.dictBGM.ContainsKey(id));
	KeyValuePair<int, Spatial>[] array = EClass.game.spatials.map.ToArray(); 
	for (int i = 0; i < array.Length; i++) 
	{ 
		KeyValuePair<int, Spatial> keyValuePair = array[i]; 
		var (num2, spatial2) = (KeyValuePair<int, Spatial>)(ref keyValuePair); 
		if (spatial2.source == null) 
		{ 
			spatial2.Destroy(); 
			UnityEngine.Debug.LogWarning($"#mod-content removed invalid zone '{num2}', '{spatial2.id}', '{(spatial2 as Zone)?.ZoneFullName}'"); 
		} 
	} 
	List<ICustomContent> contents = new List<ICustomContent>();
	CustomReligionContent.LoadReligionData(context);
	LoadCustomContent<CustomZoneContent>();

private static void OnSetLang(string lang)

cs
				activatedUserMod.UpdateSourceLocalizationFile(lang);
			}
		}
		foreach (string item in LoadGodTalk()) 
		AliasGen.list = null; 
		AliasGen.listMix.Clear(); 
		AliasGen.listBuiltin.Clear(); 
		WordGen.listMix.Clear(); 
		WordGen.listBuiltin.Clear(); 
		foreach (string item in LoadAlias()) 
		{ 
			MOD.listAlias.Add(new ExcelData(item)); 
		} 
		NameGen.list = null; 
		foreach (string item2 in LoadName()) 
		{
			MOD.listGodTalk.Add(new ExcelData(item)); 
			MOD.listName.Add(new ExcelData(item2)); 
		}
		foreach (string item2 in LoadCharaTalk()) 
		foreach (string item3 in LoadGodTalk()) 
		{
			MOD.listTalk.Add(new ExcelData(item2)); 
			MOD.listGodTalk.Add(new ExcelData(item3)); 
		}
		foreach (string item3 in LoadCharaTone()) 
		foreach (string item4 in LoadCharaTalk()) 
		{
			MOD.tones.Add(new ExcelData(item3)); 
			MOD.listTalk.Add(new ExcelData(item4)); 
		} 
		foreach (string item5 in LoadCharaTone()) 
		{ 
			MOD.tones.Add(new ExcelData(item5)); 
		}
		BookList.dict = null;
		BottleMessageList.list = null;
		Lang.excelDialog = null;
		foreach (CustomFileContent item4 in _customContent.Values.OfType<CustomFileContent>()) 
		foreach (CustomFileContent item6 in _customContent.Values.OfType<CustomFileContent>()) 
		{
			item4.OnSetLang(lang); 
			item6.OnSetLang(lang); 
		}
	}

public static void AddContent(ICustomContent content)

cs
		_customContent[content.ContentId] = content;
	}

	public static bool FixDefaultRenderRowPref(RenderRow r, string id) 
	{ 
		FileInfo fileInfo = PackageIterator.GetFiles("Texture/" + id + ".pref").LastOrDefault(); 
		if (fileInfo == null) 
		{ 
			return false; 
		} 
		r.pref = SourcePref.ReadFromIni(fileInfo.FullName); 
		return true; 
	} 
	public static void FixDefaultCharaRowPref(SourceChara.Row r)
	{
		r.pref = new SourcePref
		if (!r.tag.Contains("usePref") || !FixDefaultRenderRowPref(r, r.id)) 
		{
			pivotY = -10
		}; 
			r.pref = new SourcePref
			{ 
				pivotY = -10
			}; 
		} 
	} 
	public static void FixDefaultThingRowPref(SourceThing.Row r) 
	{ 
		if (!r.tag.Contains("usePref") || !FixDefaultRenderRowPref(r, r.id)) 
		{ 
			r.pref = new SourcePref
			{ 
				shadow = 1
			}; 
		} 
	}

	public static List<Thing> GenerateMerchantStock(Card owner, string stockId = null, bool forceRestock = false)

public static List<string> LoadExcelDialog()

cs
		return list;
	}

	public static List<string> LoadAlias() 
	{ 
		List<string> list = new List<string>(); 
		FileInfo[] files = PackageIterator.GetFiles(Lang.langCode + "/Data/Alias.xlsx"); 
		foreach (FileInfo fileInfo in files) 
		{ 
			list.Add(fileInfo.FullName); 
			UnityEngine.Debug.Log("#mod-content loaded Alias " + fileInfo.ShortPath()); 
		} 
		return list; 
	} 
	public static List<string> LoadName() 
	{ 
		List<string> list = new List<string>(); 
		FileInfo[] files = PackageIterator.GetFiles(Lang.langCode + "/Data/Name.xlsx"); 
		foreach (FileInfo fileInfo in files) 
		{ 
			list.Add(fileInfo.FullName); 
			UnityEngine.Debug.Log("#mod-content loaded Name " + fileInfo.ShortPath()); 
		} 
		return list; 
	} 
	public static List<string> LoadCharaTalk()
	{
		List<string> list = new List<string>();

public static string ExportSourceDataJson(string sourceData, Formatting format =

cs
		{
			return "";
		}
		return JsonConvert.SerializeObject(sourceData2.ExportRows(), format); 
		return JsonConvert.SerializeObject(sourceData2.ExportRows(), format, GameIOContext.Settings); 
	}

	public static void ExportAllSourceDataJson(string dir)

RecipeCard โ€‹

public void MixIngredients(Thing t)

cs
		{
			list.Add(ingredient.thing);
		}
		CraftUtil.MixIngredients(t, list, CraftUtil.MixType.General, GetQualityBonus()); 
		CraftUtil.MixIngredients(t, list, (t.trait is TraitDrink) ? CraftUtil.MixType.Drink : CraftUtil.MixType.General, GetQualityBonus()); 
		Rand.SetSeed();
	}

Spatial โ€‹

public Faction mainFaction

cs
		}
	}

	public SourceZone.Row source => _source ?? (_source = EClass.sources.zones.map[id]); 
	public SourceZone.Row source => _source ?? (_source = EClass.sources.zones.map.TryGetValue(id)); 

	public bool IsPlayerFaction => mainFaction == EClass.pc.faction;

TaskDig โ€‹

using System.Collections.Generic;

cs
using System.Collections.Generic; 
public class TaskDig : BaseTaskHarvest
{
	public enum Mode

public enum Mode

cs

	public override HarvestType harvestType => HarvestType.Floor;

	public override string IdRecipe 
	{ 
		get 
		{ 
			if (!pos.HasBridge) 
			{ 
				return pos.sourceFloor.RecipeID; 
			} 
			return pos.sourceBridge.RecipeID; 
		} 
	} 
	public override int RightHand => 1101;

	public override bool IsHostileAct => true;

public override int destDist

cs

	public override CursorInfo CursorIcon => CursorSystem.Dig;

	public override string GetIdRecipe(Point p) 
	{ 
		if (!p.HasBridge) 
		{ 
			return p.sourceFloor.RecipeID; 
		} 
		return p.sourceBridge.RecipeID; 
	} 
	public override string GetTextSmall(Card c)
	{
		if (!pos.cell.HasBridge)

public override void OnCreateProgress(Progress_Custom p)

cs

	public override HitResult GetHitResult()
	{
		if (EClass._zone.IsRegion && GetTreasureMap() != null) 
		if (EClass._zone.IsRegion && GetTreasureMap(pos) != null) 
		{
			return HitResult.Valid;
		}

public override HitResult GetHitResult()

cs
		return HitResult.Default;
	}

	public Thing GetTreasureMap() 
	public Thing GetTreasureMap(Point p) 
	{
		foreach (Thing item in EClass.pc.things.List((Thing t) => t.trait is TraitScrollMapTreasure))
		{
			TraitScrollMapTreasure traitScrollMapTreasure = item.trait as TraitScrollMapTreasure;
			if (pos.Equals(traitScrollMapTreasure.GetDest(fix: true))) 
			if (p.Equals(traitScrollMapTreasure.GetDest(fix: true))) 
			{
				return item;
			}

public Thing GetTreasureMap()

cs

	public override void OnProgressComplete()
	{
		string idRecipe = IdRecipe; 
		int num = (pos.HasBridge ? pos.matBridge.hardness : pos.matFloor.hardness); 
		if (EClass._zone.IsRegion) 
		int num = owner.Tool?.Evalue(770) ?? 0; 
		num = ((num <= 0) ? 1 : (2 + num / 10)); 
		if (num > 1) 
		{
			Thing map = GetTreasureMap(); 
			if (map != null || EClass.debug.enable) 
			List<Point> list = EClass._map.ListPointsInSquare(pos, num - 1); 
			list.Sort((Point a, Point b) => a.Distance(pos) - b.Distance(pos)); 
			{
				if (map == null) 
				foreach (Point item in list) 
				{
					map = ThingGen.Create("map_treasure", -1, EClass.pc.LV); 
					if (owner == null || owner.isDead) 
					{ 
						break; 
					} 
					Dig(item); 
				}
				SE.Play("ding_skill"); 
				Msg.Say("digTreasure"); 
				Rand.UseSeed(map.refVal, delegate
				{ 
					Thing thing = ThingGen.CreateTreasure("chest_treasure", map.LV); 
					EClass._zone.AddCard(thing, EClass.pc.pos); 
					ThingGen.TryLickChest(thing); 
				}); 
				map.Destroy(); 
				EClass.player.willAutoSave = true; 
				return;
			}
		}
		switch (mode) 
		Dig(pos); 
		void Dig(Point p) 
		{
		case Mode.Default: 
			EClass._map.SetBridge(pos.x, pos.z, 0, 0, 0, 0, 0); 
			break; 
		case Mode.RemoveFloor: 
			EClass._map.MineFloor(pos, owner); 
			pos.Animate(AnimeID.Dig, animeBlock: true); 
			if (!owner.IsAgent) 
			if (GetHitResult(p) != HitResult.Invalid) 
			{
				owner.elements.ModExp(230, 20 + num / 2); 
			} 
			break; 
		case Mode.Ramp: 
			EClass._map.MineFloor(pos, owner); 
			break; 
		} 
		if (EClass._zone.IsCrime(owner, this)) 
		{ 
			EClass.player.ModKarma(-1); 
		} 
		if (EClass.rnd(2) == 0) 
		{ 
			owner.stamina.Mod(-1); 
		} 
		if (owner != null) 
		{ 
			if (owner.IsPC) 
			{ 
				EClass.player.recipes.ComeUpWithRecipe(idRecipe, 30); 
			} 
			if (owner.IsPC && owner.IsAliveInCurrentZone && EClass._zone.IsSkyLevel && !EClass.game.IsSurvival && owner.pos.IsSky) 
			{ 
				EClass.pc.FallFromZone(); 
				string idRecipe = GetIdRecipe(p); 
				int num2 = (p.HasBridge ? p.matBridge.hardness : p.matFloor.hardness); 
				if (EClass._zone.IsRegion) 
				{ 
					Thing map = GetTreasureMap(p); 
					if (map != null || EClass.debug.enable) 
					{ 
						if (map == null) 
						{ 
							map = ThingGen.Create("map_treasure", -1, EClass.pc.LV); 
						} 
						SE.Play("ding_skill"); 
						Msg.Say("digTreasure"); 
						Rand.UseSeed(map.refVal, delegate
						{ 
							Thing thing = ThingGen.CreateTreasure("chest_treasure", map.LV); 
							EClass._zone.AddCard(thing, p); 
							ThingGen.TryLickChest(thing); 
						}); 
						map.Destroy(); 
						EClass.player.willAutoSave = true; 
						return; 
					} 
				} 
				switch (mode) 
				{ 
				case Mode.Default: 
					EClass._map.SetBridge(p.x, p.z, 0, 0, 0, 0, 0); 
					break; 
				case Mode.RemoveFloor: 
					EClass._map.MineFloor(p, owner); 
					p.Animate(AnimeID.Dig, animeBlock: true); 
					if (!owner.IsAgent) 
					{ 
						owner.elements.ModExp(230, 20 + num2 / 2); 
					} 
					break; 
				case Mode.Ramp: 
					EClass._map.MineFloor(p, owner); 
					break; 
				} 
				if (EClass._zone.IsCrime(owner, this)) 
				{ 
					EClass.player.ModKarma(-1); 
				} 
				if (EClass.rnd(2) == 0) 
				{ 
					owner.stamina.Mod(-1); 
				} 
				if (owner != null) 
				{ 
					if (owner.IsPC) 
					{ 
						EClass.player.recipes.ComeUpWithRecipe(idRecipe, 30); 
					} 
					if (owner.IsPC && owner.IsAliveInCurrentZone && EClass._zone.IsSkyLevel && !EClass.game.IsSurvival && owner.pos.IsSky) 
					{ 
						EClass.pc.FallFromZone(); 
					} 
				} 
			}
		}
	}

TaskDrawWater โ€‹

using System.Collections.Generic;

cs
using System.Collections.Generic; 
public class TaskDrawWater : TaskDesignation
{
	public TraitToolWaterPot pot;

public override void OnCreateProgress(Progress_Custom p)

cs
		};
		p.onProgressComplete = delegate
		{
			Effect.Get("mine").Play(pos).SetParticleColor(pos.cell.HasBridge ? pos.matBridge.GetColor() : pos.matFloor.GetColor()) 
				.Emit(10 + EClass.rnd(10)); 
			pos.Animate(AnimeID.Dig, animeBlock: true); 
			owner.PlaySound("water");
			pot.owner.Dye(pos.HasBridge ? pos.matBridge : pos.matFloor); 
			switch ((pos.HasBridge ? pos.sourceBridge : pos.sourceFloor).alias) 
			{ 
			case "floor_water_shallow": 
				ChangeFloor("floor_water_shallow2"); 
				break; 
			case "floor_water": 
				ChangeFloor("floor_water_shallow"); 
				break; 
			case "floor_water_deep": 
				ChangeFloor("floor_water"); 
				break; 
			default: 
				ChangeFloor("floor_raw3"); 
				break; 
			} 
			pot.owner.ModCharge(1); 
			owner.elements.ModExp(286, 5f); 
			if (EClass.rnd(3) == 0) 
			int num = owner.Tool?.Evalue(770) ?? 0; 
			num = ((num <= 0) ? 1 : (2 + num / 10)); 
			if (num > 1) 
			{
				owner.stamina.Mod(-1); 
				List<Point> list = EClass._map.ListPointsInSquare(pos, num - 1); 
				list.Sort((Point a, Point b) => a.Distance(pos) - b.Distance(pos)); 
				{ 
					foreach (Point item in list) 
					{ 
						if (owner == null || owner.isDead) 
						{ 
							break; 
						} 
						Draw(item); 
					} 
					return; 
				} 
			}
			Draw(pos); 
		};
		void ChangeFloor(string id) 
		void Draw(Point p) 
		{
			SourceFloor.Row row = EClass.sources.floors.alias[id]; 
			if (pos.HasBridge) 
			if (pot.owner.c_charges < pot.MaxCharge && GetHitResult(p) != HitResult.Invalid) 
			{
				pos.cell._bridge = (byte)row.id; 
				if (id == "floor_raw3") 
				Effect.Get("mine").Play(p).SetParticleColor(p.cell.HasBridge ? p.matBridge.GetColor() : p.matFloor.GetColor()) 
					.Emit(10 + EClass.rnd(10)); 
				p.Animate(AnimeID.Dig, animeBlock: true); 
				pot.owner.Dye(p.HasBridge ? p.matBridge : p.matFloor); 
				switch ((p.HasBridge ? p.sourceBridge : p.sourceFloor).alias) 
				{
					pos.cell._bridgeMat = 45; 
				case "floor_water_shallow": 
					ChangeFloor("floor_water_shallow2"); 
					break; 
				case "floor_water": 
					ChangeFloor("floor_water_shallow"); 
					break; 
				case "floor_water_deep": 
					ChangeFloor("floor_water"); 
					break; 
				default: 
					ChangeFloor("floor_raw3"); 
					break; 
				} 
				pot.owner.ModCharge(1); 
				owner.elements.ModExp(286, 5f); 
				if (EClass.rnd(3) == 0) 
				{ 
					owner.stamina.Mod(-1); 
				}
			}
			else
			void ChangeFloor(string id) 
			{
				pos.cell._floor = (byte)row.id; 
				if (id == "floor_raw3") 
				SourceFloor.Row row = EClass.sources.floors.alias[id]; 
				if (p.HasBridge) 
				{ 
					p.cell._bridge = (byte)row.id; 
					if (id == "floor_raw3") 
					{ 
						p.cell._bridgeMat = 45; 
					} 
				} 
				else
				{
					pos.cell._floorMat = 45; 
					p.cell._floor = (byte)row.id; 
					if (id == "floor_raw3") 
					{ 
						p.cell._floorMat = 45; 
					} 
				}
				EClass._map.SetLiquid(p.x, p.z); 
				p.RefreshNeighborTiles(); 
			}
			EClass._map.SetLiquid(pos.x, pos.z); 
			pos.RefreshNeighborTiles(); 
		}
	}

TaskHarvest โ€‹

public bool IsReapSeed

cs

	public override HarvestType harvestType => mode;

	public override string IdRecipe 
	{ 
		get 
		{ 
			if (!IsObj) 
			{ 
				if (target == null) 
				{ 
					return ""; 
				} 
				return target.source.RecipeID; 
			} 
			return pos.sourceObj.RecipeID; 
		} 
	} 
	public override int RightHand => 1005;

	public override int destDist => 1;

public override bool Loop

cs
		}
	}

	public override string GetIdRecipe(Point p) 
	{ 
		if (!IsObj) 
		{ 
			if (target == null) 
			{ 
				return ""; 
			} 
			return target.source.RecipeID; 
		} 
		return p.sourceObj.RecipeID; 
	} 
	public override bool CanManualCancel()
	{
		return true;

public override void OnCreateProgress(Progress_Custom p)

cs
	};
	p.onProgressComplete = delegate
	{
		string idRecipe = IdRecipe; 
		string idRecipe = GetIdRecipe(pos); 
		SourceBacker.Row backerObj = EClass._map.GetBackerObj(pos);
		int num2 = ((EClass.rnd(3) != 0) ? 1 : 0);
		if (IsObj)

TaskMine โ€‹

public enum Mode

cs

	public override HarvestType harvestType => HarvestType.Block;

	public override string IdRecipe => pos.sourceBlock.RecipeID; 
	public override int destDist => 1;

	public override bool isBlock => true;

public enum Mode

cs

	public override bool IsHostileAct => true;

	public override string GetIdRecipe(Point p) 
	{ 
		return p.sourceBlock.RecipeID; 
	} 
	public static bool CanMine(Point pos, Card t)
	{
		if (t != null && pos.HasBlock && (!pos.HasObj || !pos.sourceObj.tileType.IsBlockMount))

public override HitResult GetHitResult()

cs

	public override void OnProgressComplete()
	{
		string idRecipe = IdRecipe; 
		string idRecipe = GetIdRecipe(pos); 
		int hardness = pos.matBlock.hardness;
		switch (mode)
		{

TaskPlow โ€‹

using System.Collections.Generic;

cs
using System.Collections.Generic; 
using UnityEngine;

public class TaskPlow : TaskDesignation

public override void OnCreateProgress(Progress_Custom p)

cs
		p.onProgressComplete = delegate
		{
			owner.PlaySound(pos.cell.HasBridge ? pos.cell.matBridge.GetSoundDead(pos.sourceBridge) : pos.cell.matFloor.GetSoundDead(pos.sourceFloor));
			Effect.Get("mine").Play(pos).SetParticleColor(pos.cell.HasBridge ? pos.matBridge.GetColor() : pos.matFloor.GetColor()) 
				.Emit(10 + EClass.rnd(10)); 
			pos.Animate(AnimeID.Dig, animeBlock: true); 
			if (pos.HasBridge) 
			int num = owner.Tool?.Evalue(770) ?? 0; 
			num = ((num <= 0) ? 1 : (2 + num / 10)); 
			if (num > 1) 
			{
				pos.cell._bridge = 4; 
				List<Point> list = EClass._map.ListPointsInSquare(pos, num - 1); 
				list.Sort((Point a, Point b) => a.Distance(pos) - b.Distance(pos)); 
				{ 
					foreach (Point item in list) 
					{ 
						if (owner == null || owner.isDead) 
						{ 
							break; 
						} 
						Plow(item); 
					} 
					return; 
				} 
			}
			else
			{ 
				pos.SetFloor(pos.matFloor.id, 4); 
			} 
			owner.elements.ModExp(286, 30f); 
			if (owner.IsPC) 
			Plow(pos); 
		}; 
		void Plow(Point p) 
		{ 
			if ((p.HasBridge ? p.sourceBridge : p.sourceFloor).tag.Contains("soil") && GetHitResult(p) != HitResult.Invalid) 
			{
				EClass.player.stats.plow++; 
				Effect.Get("mine").Play(p).SetParticleColor(p.cell.HasBridge ? p.matBridge.GetColor() : p.matFloor.GetColor()) 
					.Emit(10 + EClass.rnd(10)); 
				p.Animate(AnimeID.Dig, animeBlock: true); 
				if (p.HasBridge) 
				{ 
					p.cell._bridge = 4; 
				} 
				else
				{ 
					p.SetFloor(p.matFloor.id, 4); 
				} 
				owner.elements.ModExp(286, 30f); 
				if (owner.IsPC) 
				{ 
					EClass.player.stats.plow++; 
				} 
				owner.stamina.Mod(-1); 
			}
			owner.stamina.Mod(-1); 
		}; 
		} 
	}

	public override HitResult GetHitResult()

TaskPoint โ€‹

public override bool CanManualCancel()

cs
		return false;
	}

	public HitResult GetHitResult(Point p) 
	{ 
		Point point = pos.Copy(); 
		pos = p; 
		HitResult hitResult = GetHitResult(); 
		pos = point; 
		return hitResult; 
	} 
	public override bool CanPerform()
	{
		if (owner == null)

TaskPourWater โ€‹

using System.Collections.Generic;

cs
using System.Collections.Generic; 
public class TaskPourWater : TaskDesignation
{
	public TraitToolWaterPot pot;

public override void OnCreateProgress(Progress_Custom p)

cs
		};
		p.onProgressComplete = delegate
		{
			if (pot.owner.DyeMat == null) 
			{ 
				pot.owner.Dye(MATERIAL.sourceWaterSea); 
			} 
			switch ((pos.HasBridge ? pos.sourceBridge : pos.sourceFloor).alias) 
			{ 
			case "floor_water_shallow2": 
				ChangeFloor("floor_water_shallow"); 
				break; 
			case "floor_water_shallow": 
				ChangeFloor("floor_water"); 
				break; 
			case "floor_water": 
				ChangeFloor("floor_water_deep"); 
				break; 
			default: 
				ChangeFloor("floor_water_shallow2"); 
				break; 
			} 
			Effect.Get("mine").Play(pos).SetParticleColor(pos.cell.HasBridge ? pos.matBridge.GetColor() : pos.matFloor.GetColor()) 
				.Emit(10 + EClass.rnd(10)); 
			pos.Animate(AnimeID.Dig, animeBlock: true); 
			owner.PlaySound("water_farm");
			pot.owner.ModCharge(-1); 
			if (pot.owner.c_charges <= 0) 
			{ 
				pot.owner.Dye(EClass.sources.materials.alias["void"]); 
			} 
			owner.elements.ModExp(286, 5f); 
			if (EClass.rnd(3) == 0) 
			int num = owner.Tool?.Evalue(770) ?? 0; 
			num = ((num <= 0) ? 1 : (2 + num / 10)); 
			if (num > 1) 
			{
				owner.stamina.Mod(-1); 
				List<Point> list = EClass._map.ListPointsInSquare(pos, num - 1); 
				list.Sort((Point a, Point b) => a.Distance(pos) - b.Distance(pos)); 
				{ 
					foreach (Point item in list) 
					{ 
						if (owner == null || owner.isDead) 
						{ 
							break; 
						} 
						Pour(item); 
					} 
					return; 
				} 
			}
			Pour(pos); 
		};
		void ChangeFloor(string id) 
		void Pour(Point p) 
		{
			SourceFloor.Row row = EClass.sources.floors.alias[id]; 
			if (pos.HasBridge) 
			if (pot.owner.c_charges > 0 && GetHitResult(p) != HitResult.Invalid) 
			{
				pos.cell._bridge = (byte)row.id; 
				pos.cell._bridgeMat = (byte)pot.owner.DyeMat.id; 
				if (pot.owner.DyeMat == null) 
				{ 
					pot.owner.Dye(MATERIAL.sourceWaterSea); 
				} 
				switch ((p.HasBridge ? p.sourceBridge : p.sourceFloor).alias) 
				{ 
				case "floor_water_shallow2": 
					ChangeFloor("floor_water_shallow"); 
					break; 
				case "floor_water_shallow": 
					ChangeFloor("floor_water"); 
					break; 
				case "floor_water": 
					ChangeFloor("floor_water_deep"); 
					break; 
				default: 
					ChangeFloor("floor_water_shallow2"); 
					break; 
				} 
				Effect.Get("mine").Play(p).SetParticleColor(p.cell.HasBridge ? pos.matBridge.GetColor() : p.matFloor.GetColor()) 
					.Emit(10 + EClass.rnd(10)); 
				p.Animate(AnimeID.Dig, animeBlock: true); 
				pot.owner.ModCharge(-1); 
				if (pot.owner.c_charges <= 0) 
				{ 
					pot.owner.Dye(EClass.sources.materials.alias["void"]); 
				} 
				owner.elements.ModExp(286, 5f); 
				if (EClass.rnd(3) == 0) 
				{ 
					owner.stamina.Mod(-1); 
				} 
			}
			else
			void ChangeFloor(string id) 
			{
				pos.cell._floor = (byte)row.id; 
				pos.cell._floorMat = (byte)pot.owner.DyeMat.id; 
				SourceFloor.Row row = EClass.sources.floors.alias[id]; 
				if (p.HasBridge) 
				{ 
					p.cell._bridge = (byte)row.id; 
					p.cell._bridgeMat = (byte)pot.owner.DyeMat.id; 
				} 
				else
				{ 
					p.cell._floor = (byte)row.id; 
					p.cell._floorMat = (byte)pot.owner.DyeMat.id; 
				} 
				EClass._map.SetLiquid(p.x, p.z); 
				p.RefreshNeighborTiles(); 
			}
			EClass._map.SetLiquid(pos.x, pos.z); 
			pos.RefreshNeighborTiles(); 
		}
	}

	public override HitResult GetHitResult()
	{
		if (pos.HasBridge || pos.HasObj || pos.cell.HasFullBlock) 
		if (pos.HasBridge || pos.HasObj || pos.cell.HasFullBlock || (!pos.cell.sourceSurface.tag.Contains("soil") && !pos.cell.IsTopWater) || pos.cell.sourceSurface.alias == "floor_water_deep") 
		{
			return HitResult.Invalid;
		}

TaskWater โ€‹

public override IEnumerable<Status> Run()

cs
		num = ((num <= 0) ? 1 : Mathf.Min(waterCan.owner.c_charges, 2 + num / 10));
		if (num > 1)
		{
			List<Point> list2 = EClass._map.ListPointsInCircle(p2, num); 
			List<Point> list2 = EClass._map.ListPointsInSquare(p2, num - 1); 
			list2.Sort((Point a, Point b) => a.Distance(p2) - b.Distance(p2));
			foreach (Point item in list2)
			{

Thing โ€‹

public override string GetName(NameStyle style, int _num = -1)

cs
				{
					Rand.UseSeed(base.uid + EClass.game.seed, delegate
					{
						sig = AliasGen.GetRandomAlias().Bracket((base.rarity == Rarity.Mythical) ? 3 : 2); 
						sig = AliasGen.GetRandomAlias(builtin: true).Bracket((base.rarity == Rarity.Mythical) ? 3 : 2); 
					});
					sig = Lang.space + sig;
				}

public override void WriteNote(UINote n, Action<UINote> onWriteNote = null, IIns

cs
	{
		AddText("isNoProcessIng", FontColor.Default);
	}
	if (HasElement(10)) 
	if (trait.CanDrink(EClass.pc)) 
	{ 
		AddText("isDrinkable", FontColor.Default); 
	} 
	else if (trait.CanEat(EClass.pc)) 
	{
		AddText("isEdible", FontColor.Default);
	}

Trait โ€‹

public virtual void OnListInteraction(InvOwner.ListInteraction list, ButtonGrid

cs
				});
			}, "remove");
		}
		if (CanEat(EClass.pc)) 
		else if (CanEat(EClass.pc)) 
		{
			list.Add("invFood", 140, delegate
			{

public Thing CreateStock()

cs
			case ShopType.Milk:
				if (EClass._zone is Zone_Nefu && EClass.rnd(2) == 0)
				{
					Thing thing4 = ThingGen.Create("milk"); 
					Thing thing4 = ThingGen.Create("_milk"); 
					thing4.MakeRefFrom(EClass.sources.charas.rows.Where((SourceChara.Row r) => r.race == "mifu" || r.race == "nefu").RandomItem().model);
					Debug.Log(thing4);
					return thing4;
				}
				return Create("milk"); 
				return Create("_milk"); 
			case ShopType.Map:
				return ThingGen.CreateMap();
			case ShopType.Plan:

TraitBrewery โ€‹

public override bool OnChildDecay(Card c, bool firstDecay)

cs
		{
			return true;
		}
		if (!c.IsFood && !(c.id == "508") && !(c.id == "778") && !(c.id == "milk")) 
		if (!c.IsFood && !(c.id == "508") && !(c.id == "778") && !(c.id == "_milk")) 
		{
			return true;
		}

TraitDrink โ€‹

public override void OnDrink(Chara c)

cs
			refThing = owner.Thing,
			act = ((source != null && source.id != 0) ? ACT.Create(source) : null)
		});
		FoodEffect.ProcTrait(c, owner); 
	}

	public override void OnThrowGround(Chara c, Point p)

TraitDrinkMilkMother โ€‹

``

cs

public class TraitDrinkMilkMother : TraitDrinkMilk
{
	public override bool HoldAsDefaultInteraction => true; 
	public override bool HoldAsDefaultInteraction => owner.id == "_milk"; 

	public override Emo2 GetHeldEmo(Chara c)
	{

TraitLumiestCrimAle โ€‹

public override bool CanDrink(Chara c)

cs
	public override void OnDrink(Chara c)
	{
		ActEffect.Proc(EffectId.Booze, 500, owner.blessedState, c);
		FoodEffect.ProcTrait(c, owner); 
	}
}

Zone โ€‹

public Zone FindOrCreateLevel(int destLv, string subId = "")

cs
		return zone2;
	}

	public static (string zoneType, string zoneId, int zoneLv) ParseZoneFullName(string zoneFullName) 
	{ 
		string item = ""; 
		string item2 = ""; 
		int item3 = 0; 
		zoneFullName = zoneFullName.Replace('/', '@'); 
		if (EClass.game.spatials.Find((Zone z) => z.ZoneFullName == zoneFullName) != null) 
		{ 
			return (zoneType: item, zoneId: item2, zoneLv: item3); 
		} 
		int num = zoneFullName.LastIndexOf('@'); 
		if (num > 0 && num < zoneFullName.Length - 1) 
		{ 
			item = zoneFullName[..num]; 
			item3 = zoneFullName[(num + 1)..].ToInt(); 
		} 
		else
		{ 
			item = zoneFullName.Replace("@", ""); 
		} 
		item2 = item.Replace("Zone_", ""); 
		item = "Zone_" + item2; 
		return (zoneType: item, zoneId: item2, zoneLv: item3); 
	} 
	public int Evalue(int ele)
	{
		return elements.Value(ele);

public Chara SpawnMob(Point pos = null, SpawnSetting setting = null)

cs
		biome = ((EClass.rnd(4) != 0) ? EClass.core.refs.biomes.Water : EClass.core.refs.biomes.Sand);
	}
	SpawnList spawnList = null;
	spawnList = ((setting.idSpawnList != null) ? SpawnList.Get(setting.idSpawnList) : ((EClass._zone is Zone_DungeonYeek && EClass.rnd(5) != 0) ? SpawnListChara.Get("dungeon_yeek", (SourceChara.Row r) => r.race == "yeek" && r.quality == 0) : ((EClass._zone is Zone_DungeonDragon && EClass.rnd(5) != 0) ? SpawnListChara.Get("dungeon_dragon", (SourceChara.Row r) => (r.race == "dragon" || r.race == "drake" || r.race == "wyvern" || r.race == "lizardman" || r.race == "dinosaur") && r.quality == 0) : ((EClass._zone is Zone_DungeonMino && EClass.rnd(5) != 0) ? SpawnListChara.Get("dungeon_mino", (SourceChara.Row r) => r.race == "minotaur" && r.quality == 0) : ((setting.hostility == SpawnHostility.Neutral || (setting.hostility != SpawnHostility.Enemy && Rand.Range(0f, 1f) < ChanceSpawnNeutral)) ? SpawnList.Get(IsInstance ? "c_neutral_war" : "c_neutral") : ((biome.spawn.chara.Count <= 0) ? SpawnList.Get(biome.name, "chara", new CharaFilter
	if (setting.idSpawnList != null) 
	{ 
		spawnList = SpawnList.Get(setting.idSpawnList); 
	} 
	else if (EClass._zone is Zone_DungeonYeek && EClass.rnd(5) != 0) 
	{ 
		spawnList = SpawnListChara.Get("dungeon_yeek", (SourceChara.Row r) => r.race == "yeek" && r.quality == 0); 
	} 
	else if (EClass._zone is Zone_DungeonDragon && EClass.rnd(5) != 0) 
	{ 
		spawnList = SpawnListChara.Get("dungeon_dragon", (SourceChara.Row r) => (r.race == "dragon" || r.race == "drake" || r.race == "wyvern" || r.race == "lizardman" || r.race == "dinosaur") && r.quality == 0); 
	} 
	else if (EClass._zone is Zone_DungeonMino && EClass.rnd(5) != 0) 
	{
		ShouldPass = delegate(SourceChara.Row s) 
		spawnList = SpawnListChara.Get("dungeon_mino", (SourceChara.Row r) => r.race == "minotaur" && r.quality == 0); 
	} 
	else if (setting.hostility == SpawnHostility.Neutral || (setting.hostility != SpawnHostility.Enemy && Rand.Range(0f, 1f) < ChanceSpawnNeutral)) 
	{ 
		spawnList = SpawnList.Get(IsInstance ? "c_neutral_war" : "c_neutral"); 
	} 
	else if (biome.spawn.chara.Count > 0) 
	{ 
		string randomCharaId = biome.spawn.GetRandomCharaId(); 
		spawnList = ((!IsInstance) ? SpawnList.Get(randomCharaId) : SpawnList.Get("instance_" + randomCharaId, randomCharaId, new CharaFilter
		{ 
			ShouldPass = (SourceChara.Row s) => (!(s.hostility != "") || (!s.tag.Contains("cat") && !s.race_row.tag.Contains("cat"))) ? true : false
		})); 
	} 
	else 
	{ 
		spawnList = SpawnList.Get(biome.name, "chara", new CharaFilter
		{
			if (s.hostility != "") 
			ShouldPass = delegate(SourceChara.Row s) 
			{
				return false; 
				if (s.hostility != "") 
				{ 
					return false; 
				} 
				return s.biome == biome.name || s.biome.IsEmpty(); 
			}
			return s.biome == biome.name || s.biome.IsEmpty(); 
		} 
	}) : SpawnList.Get(biome.spawn.GetRandomCharaId(), "chara", new CharaFilter
	{ 
		ShouldPass = (SourceChara.Row s) => (!IsInstance || !(s.hostility != "") || !s.tag.Contains("cat")) ? true : false
	}))))))); 
		}); 
	} 
	int num = ((setting.dangerLv == -1) ? DangerLv : setting.dangerLv);
	CardBlueprint cardBlueprint = new CardBlueprint
	{