Skip to content

EA 23.346 Nightly โ€‹

September 19, 2026

25 files modified. 3 new files created.

Important Changes โ€‹

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

ActEffect (1) โ€‹

cs
public static Point GetTeleportPos(Point org, int radius = 6)
public static Point GetTeleportPos(Point org, int radius = 6, Chara target = null)

ConTransmute (1) โ€‹

cs
public void Change()
public virtual void Change()

RenderData (1) โ€‹

cs
public void DrawRepeatTo(RenderParam p, float maxY, float height, ref Vector3 peakFix, bool skipFirst = false, int fire = 0, bool isBlock = false)
public void DrawRepeatTo(RenderParam p, float maxY, float height, ref Vector3 peakFix, int skipRepeat = 0, int fire = 0, bool isBlock = false)

ActEffect โ€‹

void AddCon<T>(int rate, int p2) where T : Condition

cs
	{
		return;
	}
	Thing thing = ThingGen.Create("mine");
	thing.c_idRefCard = "dog_mine";
	Thing thing3 = ThingGen.Create("mine");
	thing3.c_idRefCard = "dog_mine";
	Zone.ignoreSpawnAnime = true;
	EClass._zone.AddCard(thing, CC.pos).Install();
	EClass._zone.AddCard(thing3, CC.pos).Install();
	break;
}
case EffectId.LittleSisterMigration:
case EffectId.SilverCatMigration:
{
	bool flag5 = id == EffectId.SilverCatMigration;
	if (!EClass.game.IsSurvival && ((flag5 && EClass._zone.id != "startVillage2") || (!flag5 && !(EClass._zone is Zone_LittleGarden))))
	bool flag2 = id == EffectId.SilverCatMigration;
	if (!EClass.game.IsSurvival && ((flag2 && EClass._zone.id != "startVillage2") || (!flag2 && !(EClass._zone is Zone_LittleGarden))))
	{
		Msg.SayNothingHappen();
		return;
	}
	List<Chara> list = new List<Chara>();
	bool flag6 = false;
	bool flag3 = false;
	foreach (Chara chara3 in EClass._map.charas)
	{
		if (!chara3.IsPCFactionOrMinion && chara3.id == (flag5 ? "cat_silver" : "littleOne"))
		if (!chara3.IsPCFactionOrMinion && chara3.id == (flag2 ? "cat_silver" : "littleOne"))
		{
			if (flag6)
			if (flag3)
			{
				flag6 = false;
				flag3 = false;
				continue;
			}
			list.Add(chara3);
			flag6 = true;
			flag3 = true;
		}
	}
	if (list.Count == 0)

void AddCon<T>(int rate, int p2) where T : Condition

cs
	item2.PlayEffect("revive");
	item2.Destroy();
}
Msg.Say(flag5 ? "cat_migration" : "little_migration", list.Count.ToString() ?? "");
Msg.Say(flag2 ? "cat_migration" : "little_migration", list.Count.ToString() ?? "");
EClass._zone.ModInfluence(list.Count);
if (flag5)
if (flag2)
{
	EClass.player.stats.catDepart += list.Count;
	break;

void AddCon<T>(int rate, int p2) where T : Condition

cs
TC.PlaySound("curse3");
TC.PlayEffect("curse");
TC.Say("forgetItems", TC);
int num3 = power / 50 + 1 + EClass.rnd(3);
int num8 = power / 50 + 1 + EClass.rnd(3);
List<Thing> source = TC.things.List((Thing thing8) => thing8.c_IDTState == 0);
for (int num4 = 0; num4 < num3; num4++)
for (int num9 = 0; num9 < num8; num9++)
{
	source.RandomItem().c_IDTState = 5;
}

void AddCon<T>(int rate, int p2) where T : Condition

cs
case EffectId.EnchantArmorGreat:
{
	bool armor = id == EffectId.EnchantArmor || id == EffectId.EnchantArmorGreat;
	bool flag3 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
	bool flag8 = id == EffectId.EnchantWeaponGreat || id == EffectId.EnchantArmorGreat;
	if (!tc.isThing)
	{
		LayerDragGrid.CreateEnchant(CC, armor, flag3, state);
		LayerDragGrid.CreateEnchant(CC, armor, flag8, state);
		return;
	}
	cc.PlaySound("identify");

void AddCon<T>(int rate, int p2) where T : Condition

cs
	tc.ModEncLv(-1);
	break;
}
int num5 = (flag3 ? 4 : 2) + (blessed ? 1 : 0);
if (tc.encLV >= num5)
int num10 = (flag8 ? 4 : 2) + (blessed ? 1 : 0);
if (tc.encLV >= num10)
{
	cc.Say("enc_resist", tc);
	break;

void AddCon<T>(int rate, int p2) where T : Condition

cs
case EffectId.Identify:
case EffectId.GreaterIdentify:
{
	bool flag4 = id == EffectId.GreaterIdentify;
	bool flag7 = id == EffectId.GreaterIdentify;
	if (flag)
	{
		Redirect(EffectId.ForgetItems, flag4 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
		Redirect(EffectId.ForgetItems, flag7 ? BlessedState.Cursed : BlessedState.Normal, default(ActRef));
		break;
	}
	if (!tc.isThing || (actRef.refThing == null && cc.IsPC && tc.GetRootCard() == tc))
	{
		int count = ((!blessed) ? 1 : (flag4 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))));
		LayerDragGrid.CreateIdentify(tc.isChara ? tc.Chara : CC, flag4, state, 0, count);
		int count = ((!blessed) ? 1 : (flag7 ? (2 + EClass.rnd(2)) : (3 + EClass.rnd(3))));
		LayerDragGrid.CreateIdentify(tc.isChara ? tc.Chara : CC, flag7, state, 0, count);
		return;
	}
	cc.PlaySound("identify");
	cc.PlayEffect("identify");
	tc.Thing.Identify(cc.IsPCParty, (!flag4) ? IDTSource.Identify : IDTSource.SuperiorIdentify);
	tc.Thing.Identify(cc.IsPCParty, (!flag7) ? IDTSource.Identify : IDTSource.SuperiorIdentify);
	break;
}
case EffectId.Uncurse:

void AddCon<T>(int rate, int p2) where T : Condition

cs
		LayerDragGrid.CreateUncurse(CC, state);
		return;
	}
	Thing thing2 = tc.Thing;
	if (thing2.blessedState == BlessedState.Cursed)
	Thing thing4 = tc.Thing;
	if (thing4.blessedState == BlessedState.Cursed)
	{
		thing2.SetBlessedState(BlessedState.Normal);
		thing4.SetBlessedState(BlessedState.Normal);
	}
	else if (thing2.blessedState == BlessedState.Doomed)
	else if (thing4.blessedState == BlessedState.Doomed)
	{
		thing2.SetBlessedState(BlessedState.Normal);
		thing4.SetBlessedState(BlessedState.Normal);
	}
	thing2.GetRootCard()?.TryStack(thing2);
	LayerInventory.SetDirty(thing2);
	thing4.GetRootCard()?.TryStack(thing4);
	LayerInventory.SetDirty(thing4);
	break;
}
case EffectId.Lighten:

void AddCon<T>(int rate, int p2) where T : Condition

cs
}
cc.PlaySound("offering");
cc.PlayEffect("buff");
int num7 = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
int num = (tc.isWeightChanged ? tc.c_weight : tc.Thing.source.weight);
tc.isWeightChanged = true;
Element orCreateElement = tc.elements.GetOrCreateElement(64);
Element orCreateElement2 = tc.elements.GetOrCreateElement(65);
Element orCreateElement3 = tc.elements.GetOrCreateElement(67);
Element orCreateElement4 = tc.elements.GetOrCreateElement(66);
bool flag7 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
bool flag4 = tc.IsEquipmentOrRangedOrAmmo || tc.IsThrownWeapon;
if (flag)
{
	num7 = (int)(0.01f * (float)num7 * (float)power * 0.75f + 500f);
	if (num7 < 0 || num7 > 10000000)
	num = (int)(0.01f * (float)num * (float)power * 0.75f + 500f);
	if (num < 0 || num > 10000000)
	{
		num7 = 10000000;
		flag7 = false;
		num = 10000000;
		flag4 = false;
	}
	if (flag7)
	if (flag4)
	{
		if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
		{

void AddCon<T>(int rate, int p2) where T : Condition

cs
}
else
{
	num7 = num7 * (100 - power / 10) / 100;
	num = num * (100 - power / 10) / 100;
	if (blessed)
	{
		power /= 4;
	}
	if (flag7)
	if (flag4)
	{
		if (tc.IsWeapon || tc.IsThrownWeapon || tc.IsAmmo)
		{

void AddCon<T>(int rate, int p2) where T : Condition

cs
	}
	cc.Say("lighten", tc);
}
tc.c_weight = num7;
tc.c_weight = num;
tc.SetDirtyWeight();
if (tc.parent == null)
{

void AddCon<T>(int rate, int p2) where T : Condition

cs
	cc.PlayEffect("identify");
	cc.Say("reconstruct", tc);
	EClass.game.cards.uidNext += EClass.rnd(30);
	int num6 = Mathf.Max(tc.genLv, tc.LV, EClass.player.stats.deepest);
	int num7 = Mathf.Max(tc.genLv, tc.LV, EClass.player.stats.deepest);
	CardBlueprint.Set(new CardBlueprint
	{
		blesstedState = state
	});
	Thing thing3 = ThingGen.Create(tc.id, -1, (int)((long)num6 * (long)power / 400));
	thing3.genLv = num6;
	thing3.idSkin = tc.idSkin;
	Thing thing2 = ThingGen.Create(tc.id, -1, (int)((long)num7 * (long)power / 400));
	thing2.genLv = num7;
	thing2.idSkin = tc.idSkin;
	if (tc.c_uidAttune != 0)
	{
		thing3.c_uidAttune = tc.c_uidAttune;
		if (thing3.id == "amulet_engagement" || thing3.id == "ring_engagement")
		thing2.c_uidAttune = tc.c_uidAttune;
		if (thing2.id == "amulet_engagement" || thing2.id == "ring_engagement")
		{
			if (tc.c_uidAttune != EClass.pc.uid)
			{
				thing3.elements.ModBase(484, 3);
				thing2.elements.ModBase(484, 3);
			}
			if (thing3.rarity < Rarity.Mythical)
			if (thing2.rarity < Rarity.Mythical)
			{
				thing3.rarity = Rarity.Mythical;
				thing2.rarity = Rarity.Mythical;
			}
		}
	}
	tc.Destroy();
	CC.Pick(thing3, msg: false);
	CC.Pick(thing2, msg: false);
	if (!CC.IsPC)
	{
		CC.TryEquip(thing3);
		CC.TryEquip(thing2);
	}
	break;
}

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	tc = tc.Split(1);
}
string name = tc.Name;
string name2 = tc.Name;
if (row == null)
{
	bool num = id == EffectId.ChangeMaterialGreater;
	bool flag2 = id == EffectId.ChangeMaterialLesser;
	bool num4 = id == EffectId.ChangeMaterialGreater;
	bool flag6 = id == EffectId.ChangeMaterialLesser;
	string text = tc.Thing.source.tierGroup;
	Dictionary<string, SourceMaterial.TierList> tierMap = SourceMaterial.tierMap;
	int num2 = 1;
	int num5 = 1;
	if (flag)
	{
		num2 -= 2;
		num5 -= 2;
	}
	if (blessed)
	{
		num2++;
		num5++;
	}
	if (num)
	if (num4)
	{
		num2++;
		num5++;
	}
	if (flag2)
	if (flag6)
	{
		num2 -= 2;
		num5 -= 2;
	}
	num2 = Mathf.Clamp(num2 + EClass.rnd(2), 0, 4);
	num5 = Mathf.Clamp(num5 + EClass.rnd(2), 0, 4);
	if (EClass.rnd(10) == 0)
	{
		text = ((text == "metal") ? "leather" : "metal");
	}
	SourceMaterial.TierList tierList = (text.IsEmpty() ? tierMap.RandomItem() : tierMap[text]);
	for (int i = 0; i < 1000; i++)
	for (int num6 = 0; num6 < 1000; num6++)
	{
		row = tierList.tiers[num2].Select();
		row = tierList.tiers[num5].Select();
		if (row != tc.material)
		{
			break;

void AddCon<T>(int rate, int p2) where T : Condition

cs
	DNA.Type type = DNA.GetType(tc.material.alias);
	tc.c_DNA.Generate(type);
}
cc.Say("materialChanged", name, row.GetName());
cc.Say("materialChanged", name2, row.GetName());
if (CC != null)
{
	if (tc.parent == null)

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	tc = tc.Split(1);
}
string name2 = tc.Name;
string name = tc.Name;
cc.PlaySound("offering");
cc.PlayEffect("buff");
bool flag8 = tc.rarity == Rarity.Legendary;
bool flag5 = tc.rarity == Rarity.Legendary;
CardBlueprint.Set(new CardBlueprint
{
	rarity = (flag8 ? Rarity.Mythical : Rarity.Legendary),
	rarity = (flag5 ? Rarity.Mythical : Rarity.Legendary),
	generation = CardBlueprint.Generation.GarokkHammer
});
Rand.SetBaseSeed(tc.uid + 1);
Rand.SetSeed(tc.uid + 2);
Thing thing4 = ThingGen.Create(tc.id, tc.idMaterial, tc.genLv);
Thing thing = ThingGen.Create(tc.id, tc.idMaterial, tc.genLv);
Rand.SetSeed();
Rand.SetBaseSeed();
thing4.SetEncLv(tc.encLV);
thing4.SetBlessedState(tc.blessedState);
int num8 = 0;
foreach (Element item4 in thing4.elements.dict.Values.ToList().Shuffle())
thing.SetEncLv(tc.encLV);
thing.SetBlessedState(tc.blessedState);
int num2 = 0;
foreach (Element item4 in thing.elements.dict.Values.ToList().Shuffle())
{
	int num9 = (tc.elements.Has(item4.id) ? tc.elements.GetElement(item4.id).vBase : 0);
	if (num9 != 0 && (Mathf.Abs(item4.vBase) <= Mathf.Abs(num9) || !MathEx.IsSameSign(item4.vBase, num9)))
	int num3 = (tc.elements.Has(item4.id) ? tc.elements.GetElement(item4.id).vBase : 0);
	if (num3 != 0 && (Mathf.Abs(item4.vBase) <= Mathf.Abs(num3) || !MathEx.IsSameSign(item4.vBase, num3)))
	{
		continue;
	}

void AddCon<T>(int rate, int p2) where T : Condition

cs
		{
			if ((uint)(id2 - 64) > 3u)
			{
				num8++;
				num2++;
			}
			tc.elements.SetBase(item4.id, item4.vBase);
			Debug.Log(item4.Name + "/" + item4.vBase);
			if (flag8 && num8 >= 2)
			if (flag5 && num2 >= 2)
			{
				break;
			}
		}
	}
	tc.isCrafted = false;
	tc.rarity = (flag8 ? Rarity.Mythical : Rarity.Legendary);
	EClass.pc.Say("reconstruct", name2);
	tc.rarity = (flag5 ? Rarity.Mythical : Rarity.Legendary);
	EClass.pc.Say("reconstruct", name);
	break;
}
case EffectId.ChangeAlias:

void AddCon<T>(int rate, int p2) where T : Condition

cs
EClass.ui.AddLayer<LayerList>().SetStringList(delegate
{
	List<string> list13 = new List<string>();
	for (int j = 0; j < 10; j++)
	for (int i = 0; i < 10; i++)
	{
		list13.Add(AliasGen.GetRandomAlias());
	}

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	if (!flag)
	{
		if (id == EffectId.TeleportShort)
		if (id != EffectId.Gate && tc.isChara && tc.Chara.IsInCombat && tc.Chara.enemy != null && (tc.IsPCParty || id == EffectId.TeleportShort))
		{
			tc.Teleport(GetTeleportPos(tc.pos, 6, tc.Chara.enemy));
		}
		else if (id == EffectId.TeleportShort)
		{
			tc.Teleport(GetTeleportPos(tc.pos));
		}

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	break;
}
int num21 = 0;
int num22 = 0;
foreach (Condition condition5 in TC.conditions)
{
	if (condition5.Type == ConditionType.Debuff)
	{
		num21++;
		num22++;
	}
}
if (num21 == 0)
if (num22 == 0)
{
	CC.SayNothingHappans();
	break;

void AddCon<T>(int rate, int p2) where T : Condition

cs
TC.Say("abShutterHex", TC);
Point center = CC.pos.Copy();
List<Chara> list10 = TC.pos.ListCharasInRadius(TC, 4, (Chara chara3) => chara3 == TC || chara3.IsHostile(CC));
for (int num22 = 0; num22 < num21; num22++)
for (int num23 = 0; num23 < num22; num23++)
{
	TweenUtil.Delay((float)num22 * 0.1f, delegate
	TweenUtil.Delay((float)num23 * 0.1f, delegate 
	{
		center.PlaySound("shutterhex");
	});

void AddCon<T>(int rate, int p2) where T : Condition

cs
Color startColor = (componentInChildren.endColor = EClass.Colors.elementColors["eleHoly"]);
componentInChildren.startColor = startColor;
Point pos = item6.pos.Copy();
TweenUtil.Delay((float)num22 * 0.1f, delegate
TweenUtil.Delay((float)num23 * 0.1f, delegate 
{
	effect.Play(center, 0f, pos);
});

void AddCon<T>(int rate, int p2) where T : Condition

cs
List<Thing> list9 = new List<Thing>();
TC.things.Foreach(delegate(Thing thing8)
{
	int num25 = 0;
	int num26 = 0;
	if ((thing8.isEquipped || thing8.IsRangedWeapon || blessed) && thing8.blessedState < BlessedState.Normal)
	{
		if (thing8.blessedState == BlessedState.Cursed)
		{
			num25 = EClass.rnd(200);
			num26 = EClass.rnd(200);
		}
		if (thing8.blessedState == BlessedState.Doomed)
		{
			num25 = EClass.rnd(1000);
			num26 = EClass.rnd(1000);
		}
		if (blessed)
		{
			num25 /= 2;
			num26 /= 2;
		}
		if (id == EffectId.UncurseEQGreater)
		{
			num25 /= 10;
			num26 /= 10;
		}
		if (power >= num25)
		if (power >= num26)
		{
			TC.Say("uncurseEQ_success", thing8);
			thing8.SetBlessedState(BlessedState.Normal);

void AddCon<T>(int rate, int p2) where T : Condition

cs
bool hex = CC.IsHostile(TC);
List<SourceStat.Row> list7 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex ? "Debuff" : "Buff")).ToList();
int power2 = power;
for (int num20 = 0; num20 < 4 + EClass.rnd(2); num20++)
for (int num21 = 0; num21 < 4 + EClass.rnd(2); num21++)
{
	SourceStat.Row row2 = list7.RandomItem();
	list7.Remove(row2);

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	power = power * 2 / 3;
}
int num13 = TC.WIL * (isPowerful ? 20 : 5);
int num14 = TC.WIL * (isPowerful ? 20 : 5);
ConHolyVeil condition3 = TC.GetCondition<ConHolyVeil>();
if (condition3 != null)
{
	num13 += condition3.power * 5;
	num14 += condition3.power * 5;
}
num13 /= EClass.sources.stats.alias[n].hexPower;
if (id != EffectId.DebuffKizuami && EClass.rnd(power) < num13)
num14 /= EClass.sources.stats.alias[n].hexPower;
if (id != EffectId.DebuffKizuami && EClass.rnd(power) < num14)
{
	int num14 = 10;
	int num15 = (TC.IsPowerful ? 40 : 90);
	int num15 = 10;
	int num16 = (TC.IsPowerful ? 40 : 90);
	if (CC.IsPCFaction)
	{
		num14 += EClass.curve(CC.LER, 100, 50) / 10;
		num15 += EClass.curve(CC.LER, 100, 50) / 10;
	}
	if (TC.IsPowerful)
	{
		num14 /= 2;
		num15 /= 2;
	}
	if (condition3 != null)
	{
		num14 /= 5;
		num15 /= 5;
	}
	if (num14 >= num15)
	if (num15 >= num16)
	{
		num14 = num15;
		num15 = num16;
	}
	Debug.Log(num14);
	if (EClass.rnd(100) > num14)
	Debug.Log(num15);
	if (EClass.rnd(100) > num15)
	{
		TC.Say("debuff_resist", TC);
		CC.DoHostileAction(TC);

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	tc.PlaySound("mutation");
	tc.PlayEffect("mutation");
	int num17 = ((actRef.refThing != null) ? actRef.refThing.GetInt(118) : actRef.refVal);
	if (num17 == 0)
	int num18 = ((actRef.refThing != null) ? actRef.refThing.GetInt(118) : actRef.refVal);
	if (num18 == 0)
	{
		num17 = tc.GetInt(118);
		if (num17 == 0)
		num18 = tc.GetInt(118);
		if (num18 == 0)
		{
			num17 = EClass.game.seed + tc.uid;
			num18 = EClass.game.seed + tc.uid;
		}
		num17++;
		num18++;
	}
	tc.Say("transBlood", tc);
	tc.Talk("tail");
	tc.c_bloodData = null;
	tc.SetInt(118, num17);
	tc.SetInt(118, num18);
	break;
}
case EffectId.ResetFeat:

void AddCon<T>(int rate, int p2) where T : Condition

cs
		break;
	}
}
int num10 = 0;
int num11 = 0;
foreach (Element item8 in list3)
{
	int dNABonus = item8.GetDNABonus(EClass.pc);
	if (dNABonus < item8.vBase)
	{
		for (int num11 = 0; num11 < item8.vBase - dNABonus; num11++)
		for (int num12 = 0; num12 < item8.vBase - dNABonus; num12++)
		{
			num10 += item8.source.cost.TryGet(num11);
			num11 += item8.source.cost.TryGet(num12);
		}
		EClass.pc.SetFeat(item8.id, dNABonus);
	}
}
EClass.pc.feat += num10;
EClass.pc.feat += num11;
EClass.pc.Refresh();
EClass.pc.RefreshFaithElement();
LayerAbility.Redraw();

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	bool flag9 = id == EffectId.DamageBody || id == EffectId.DamageBodyGreat;
	bool mind = id == EffectId.DamageMind || id == EffectId.DamageMindGreat;
	int num18 = ((id == EffectId.DamageBody || id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4)));
	int num19 = ((id == EffectId.DamageBody || id == EffectId.DamageMind) ? 1 : (4 + EClass.rnd(4)));
	if (id == EffectId.Weaken)
	{
		flag9 = EClass.rnd(2) == 0;
		mind = !flag9;
		num18 = 1;
		num19 = 1;
	}
	else
	{

void AddCon<T>(int rate, int p2) where T : Condition

cs
	TC.PlaySound("debuff");
}
TC.Say(flag9 ? "damageBody" : "damageMind", TC);
for (int num19 = 0; num19 < num18; num19++)
for (int num20 = 0; num20 < num19; num20++)
{
	TC.DamageTempElements(power, flag9, mind, id != EffectId.Weaken);
}

void AddCon<T>(int rate, int p2) where T : Condition

cs
case EffectId.Heal:
case EffectId.JureHeal:
{
	long num12 = Dice.Create((actRef.act != null && EClass.sources.calc.map.ContainsKey(actRef.act.ID)) ? actRef.act.ID : "SpHealLight", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
	long num13 = Dice.Create((actRef.act != null && EClass.sources.calc.map.ContainsKey(actRef.act.ID)) ? actRef.act.ID : "SpHealLight", power, CC, (actRef.refThing != null) ? null : actRef.act).Roll();
	if (actRef.refThing != null)
	{
		num12 = num12 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
		num13 = num13 * (100 + actRef.refThing.Evalue(750) * 10) / 100;
	}
	if (flag)
	{
		TC.DamageHP(num12 / 2, 919, power);
		TC.DamageHP(num13 / 2, 919, power);
		break;
	}
	if (id == EffectId.JureHeal)
	{
		EClass.game.religions.Healing.Talk("ability");
		num12 += TC.MaxHP / 4;
		num13 += TC.MaxHP / 4;
		TC.AddCondition<ConInvulnerable>();
		TC.HealHP(num12, HealSource.Item);
		TC.HealHP(num13, HealSource.Item);
		TC.Cure(CureType.Heal, power, state);
	}
	else
	{
		TC.HealHPHost(num12, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
		TC.HealHPHost(num13, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item);
		TC.CureHost(CureType.Heal, power, state);
	}
	TC.Say((power >= 300) ? "heal_heavy" : "heal_light", TC);

void AddCon<T>(int rate, int p2) where T : Condition

cs
if (TC.HasElement(1211))
{
	TC.Say("drinkSaltWater_snail", TC);
	int num16 = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
	TC.DamageHP(num16, AttackSource.None, CC);
	int num17 = ((TC.hp > 10) ? (TC.hp - EClass.rnd(10)) : 10000);
	TC.DamageHP(num17, AttackSource.None, CC);
}
else if (TC.IsPC)
{

void AddCon<T>(int rate, int p2) where T : Condition

cs
{
	TC.PlayEffect("buff");
	TC.PlaySound("offering");
	int num23 = TC.Evalue(1423);
	if (num23 > 0)
	int num24 = TC.Evalue(1423);
	if (num24 > 0)
	{
		int num24 = 0;
		if (flag && num23 > 1)
		int num25 = 0;
		if (flag && num24 > 1)
		{
			num24 = -1;
			num25 = -1;
		}
		else if (num23 < 15)
		else if (num24 < 15)
		{
			num24 = ((!blessed) ? 1 : 2);
			if (num24 + num23 > 15)
			num25 = ((!blessed) ? 1 : 2);
			if (num25 + num24 > 15)
			{
				num24 = 1;
				num25 = 1;
			}
		}
		if (num24 != 0)
		if (num25 != 0)
		{
			TC.SetFeat(1423, num23 + num24, msg: true);
			TC.SetInt(134, TC.GetInt(134) + num24);
			TC.SetFeat(1423, num24 + num25, msg: true);
			TC.SetInt(134, TC.GetInt(134) + num25);
		}
	}
}

public static void GeneMiracle(Chara tc, Chara c, DNA.Type type)

cs
	tc.GiveBirth(t, effect: true);
}

public static Point GetTeleportPos(Point org, int radius = 6)
public static Point GetTeleportPos(Point org, int radius = 6, Chara target = null)
{
	Point point = new Point();
	for (int i = 0; i < 10000; i++)

public static Point GetTeleportPos(Point org, int radius = 6)

cs
point.Set(org);
point.x += EClass.rnd(radius) - EClass.rnd(radius);
point.z += EClass.rnd(radius) - EClass.rnd(radius);
if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs())
if (point.IsValid && point.IsInBounds && !point.cell.blocked && point.Distance(org) >= radius / 3 + 1 - i / 50 && !point.cell.HasZoneStairs() && (target == null || i >= 100 || Los.IsVisible(point, target.pos)))
{
	return point;
}

public static Point GetTeleportPos(Point org, int radius = 6)

cs
	return org.GetRandomNeighbor().GetNearestPoint();
}

public static Point GetShortTeleportPos(Point org, Point targetPos, int destDist, int maxOffset = 6)
{
	for (int i = 0; i <= maxOffset; i++)
	{
		int destDist2 = destDist + i;
		List<Point> list = EClass._map.ListPointsOnEdge(targetPos, destDist2);
		list.RemoveAll((Point p) => !ValidPos(p));
		if (list.Count > 0)
		{
			return list.RandomItem();
		}
		if (i == 0)
		{
			continue;
		}
		destDist2 = destDist - i;
		if (destDist2 >= 1)
		{
			list = EClass._map.ListPointsOnEdge(targetPos, destDist2);
			list.RemoveAll((Point p) => !ValidPos(p));
			if (list.Count > 0)
			{
				return list.RandomItem();
			}
		}
	}
	return GetTeleportPos(org);
	static bool ValidPos(Point p)
	{
		if (!p.IsValid || !p.IsInBounds || p.cell.blocked || p.cell.HasZoneStairs())
		{
			return false;
		}
		return true;
	}
}
public static bool Wish(string s, string name, int power, BlessedState state)
{
	Msg.thirdPerson1.Set(EClass.pc);

ActorEx โ€‹

using System.Collections.Generic;

cs
using System.Collections.Generic;
using UnityEngine;

public class ActorEx : Actor

public enum Type

cs
	JukeBox
}

public static readonly List<ActorEx> instances = new List<ActorEx>();
public Type type;

public Card owner;

public enum Type

cs
public SoundData data;

private int sameSoundCount = 1;
public void SetOwner(Card c)
{
	owner = c;

public void SetOwner(Card c)

cs
		audioSource.clip = data.clip;
		audioSource.pitch = data.pitch * (1f + ((data.randomPitch == 0f) ? 0f : Rand.Range(0f - data.randomPitch, data.randomPitch)));
	}
	RefreshNearbyCounts();
	Refresh();
}

public float GetVolume()

cs
{
	num2 *= outsideRoomVolume;
}
num2 /= (float)sameSoundCount;
if (num2 <= 0f)
{
	return 0f;

public void Kill()

cs
	{
		Object.Destroy(base.gameObject);
	}
	private void OnEnable()
	{
		if (!instances.Contains(this))
		{
			instances.Add(this);
		}
		RefreshNearbyCounts();
	}
	private void OnDisable()
	{
		instances.Remove(this);
		RefreshNearbyCounts();
	}
	private void RefreshNearbyCounts()
	{
		foreach (ActorEx instance in instances)
		{
			if ((bool)instance)
			{
				instance.UpdateSameSoundCount();
			}
		}
	}
	private void UpdateSameSoundCount()
	{
		sameSoundCount = 1;
		if (!audioSource || !audioSource.clip)
		{
			return;
		}
		sameSoundCount = 0;
		float num = 4f;
		AudioClip clip = audioSource.clip;
		Vector3 position = base.transform.position;
		foreach (ActorEx instance in instances)
		{
			if ((bool)instance && (bool)instance.audioSource && !(instance.audioSource.clip != clip) && !((instance.transform.position - position).sqrMagnitude > num))
			{
				sameSoundCount++;
			}
		}
		sameSoundCount = Mathf.Max(1, sameSoundCount);
	}
}

BaseTileMap โ€‹

public virtual void DrawTile()

cs
		fogged = true;
	}
}
goto IL_7d7f;
IL_7215:
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && !snowed && !this.cell.isClearSnow && ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock)))
goto IL_7da3;
IL_7da3:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
	snowed = true;
	return;
}
if (this.cell.effect != null)
int num3 = 0;
thingPos.x = 0f;
thingPos.y = 0f;
thingPos.z = 0f;
freePos.x = (freePos.y = (freePos.z = 0f));
if (this.cell.HasRamp)
{
	if (this.cell.effect.IsLiquid)
	Vector3 rampFix = sourceBlock.tileType.GetRampFix(this.cell.blockDir);
	param.x += rampFix.x;
	param.y += rampFix.y;
	param.z += rampFix.z;
	freePos.x += rampFix.x;
	freePos.y += rampFix.y;
	freePos.z += rampFix.z;
}
param.y += (flag ? 0f : ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight));
orgPos.x = (orgX = param.x);
orgPos.y = (orgY = param.y);
orgPos.z = (orgZ = param.z);
if (flag && liquidLv > 0)
{
	if (liquidLv > 10)
	{
		SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
		SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
		tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4;
		param.tile = tile + this.cell.sourceEffect._tiles[0];
		param.mat = defaultMaterial;
		param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color);
		sourceEffect.renderData.Draw(param);
		liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
	}
	else
	liquidLv -= (int)(floatY * 0.5f);
	param.liquidLv = liquidLv;
	param.y -= TileType.FloorWaterShallow.FloorHeight;
}
Thing thing = null;
bool shadow2 = liquidLv == 0;
float num4 = 0f;
float num5 = 0f;
float num6 = 0f;
float num7 = 0f;
bool flag6 = false;
float num8 = 0f;
bool flag7 = false;
float num9 = 0f;
if (detail.things.Count > 0 && isSeen)
{
	_ = zSetting.max1;
	float num10 = 0f;
	for (int j = 0; j < detail.things.Count; j++)
	{
		param.tile = this.cell.effect.source._tiles[0];
		SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
		if (sourceEffect2.anime.Length != 0)
		Thing t = detail.things[j];
		if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction && !buildMode) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
		{
			if (sourceEffect2.anime.Length > 2)
			{
				float num3 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
				if (!(num3 >= (float)sourceEffect2.anime[0]))
				{
					param.tile += num3;
				}
			}
			else
			{
				float num4 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
				param.tile += num4;
			}
			continue;
		}
		if (this.cell.effect.IsFire)
		TileType tileType = t.trait.tileType;
		bool isInstalled = t.IsInstalled;
		SourcePref pref = t.Pref;
		if (!isInstalled && t.category.tileDummy != 0)
		{
			rendererEffect.Draw(param);
			pref = rendererObjDummy.shadowPref;
		}
		else
		float num11 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
		if (t.ignoreStackHeight)
		{
			this.cell.effect.source.renderData.Draw(param);
			thingPos.y -= num4;
			thingPos -= altitudeFix * num5;
		}
	}
}
param.color = floorLight;
if (this.cell.critter != null)
{
	Critter critter = this.cell.critter;
	int snowTile = critter.tile;
	if (snowed && critter.SnowTile != 0)
	{
		critter.x = 0.06f;
		critter.y = -0.06f;
		snowTile = critter.SnowTile;
	}
	else
	{
		critter.Update();
	}
	pass = passObjSS;
	batch = pass.batches[pass.batchIdx];
	batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f;
	batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f;
	batch.matrices[pass.idx].m23 = param.z;
	batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1));
	batch.colors[pass.idx] = floorLight;
	pass.idx++;
	if (pass.idx == pass.batchSize)
	{
		pass.NextBatch();
	}
}
if (detail != null)
{
	TransAnime anime3 = detail.anime;
	if (anime3 != null && !anime3.animeBlock)
	{
		TransAnime anime4 = detail.anime;
		param.x += anime4.v.x;
		param.y += anime4.v.y;
		param.z += anime4.v.z;
	}
}
if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
{
	SourceObj.Row sourceObj = this.cell.sourceObj;
	if (!snowed || sourceObj.snowTile <= 0)
	{
		param.snow = snowed;
		param.mat = this.cell.matObj;
		orgY = param.y;
		if (param.liquidLv > 0)
		shadow2 = thingPos.y < 0.16f && num9 < 0.16f && t.altitude >= 0;
		if (flag6 && t.altitude > 0)
		{
			if (sourceObj.pref.Float)
			shadow2 = false;
		}
		_ = pref.bypassShadow;
		param.shadowFix = 0f - thingPos.y;
		param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);
		if (t.isRoofItem)
		{
			param.snow = isSnowCovered && !this.cell.isClearSnow;
			SetRoofHeight(param, this.cell, cx, cz);
			_actorPos.x = param.x;
			_actorPos.y = param.y;
			_actorPos.z = param.z + num10;
			if (this.room != null)
			{
				param.y += 0.01f * floatY;
				if (liquidLv > 10)
				param.color = GetRoofLight(this.room.lot);
			}
			shadow2 = false;
			param.liquidLv = 0;
		}
		else
		{
			param.snow = snowed;
			_actorPos.x = orgX + num7;
			_actorPos.y = orgY;
			_actorPos.z = orgZ + num10 + thingPos.z;
			if (tileType.CanStack || !isInstalled)
			{
				if (thing?.id != t.id)
				{
					liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
					_actorPos.x += thingPos.x;
				}
				liquidLv -= (int)(floatY * 0.5f);
				param.liquidLv = liquidLv;
				_actorPos.y += thingPos.y;
				if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
				{
					thingPos.y -= num4;
					if (thing != null)
					{
						_actorPos.z -= 0.2f;
						thingPos.z -= 0.2f;
					}
					_actorPos.y -= num4;
				}
				_actorPos.z += renderSetting.thingZ + (float)j * -0.01f + zSetting.mod1 * thingPos.y;
			}
			if (sourceObj.tileType.IsWaterTop)
			if (isInstalled)
			{
				param.liquidLv = 0;
				if (t.TileType.IsRamp)
				{
					Vector3 rampFix2 = t.TileType.GetRampFix(t.dir, pref);
					orgX += rampFix2.x;
					orgY += rampFix2.y;
					orgZ += rampFix2.z;
					freePos.x += rampFix2.x;
					freePos.y += rampFix2.y;
					freePos.z += rampFix2.z;
					if (!this.cell.IsTopWater || t.altitude > 0)
					{
						num9 += rampFix2.y;
					}
					liquidLv -= (int)(rampFix2.y * 150f);
					if (liquidLv < 0)
					{
						liquidLv = 0;
					}
				}
				else if (!flag7 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
				{
					orgY += num11 + (float)t.altitude * altitudeFix.y;
					orgZ += (float)t.altitude * altitudeFix.z;
					freePos.y += num11 + (float)t.altitude * altitudeFix.y;
					if (!this.cell.IsTopWater || t.altitude > 0)
					{
						num9 += num11 + (float)t.altitude * altitudeFix.y;
					}
					_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
					_actorPos.z += pref.z;
					thingPos.z += pref.z;
					liquidLv -= (int)(num11 * 150f);
					if (liquidLv < 0)
					{
						liquidLv = 0;
					}
				}
				else
				{
					thingPos.y += num11;
					if (tileType.UseMountHeight)
					{
						if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow && !this.cell.toggleOcclusion)
						{
							if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
							{
								continue;
							}
							if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
							{
								Room room = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
								if (t.trait.AlwaysHideOnLowWall)
								{
									if (room == null || !room.data.showWallItem)
									{
										continue;
									}
								}
								else if (t.altitude >= lowWallObjAltitude)
								{
									continue;
								}
							}
						}
						if (tileType.UseHangZFix)
						{
							flag6 = true;
						}
						tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
						shadow2 = false;
						param.liquidLv = 0;
						if (t.freePos)
						{
							_actorPos.x += t.fx;
							_actorPos.y += t.fy;
						}
					}
					else
					{
						if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow && !this.cell.toggleOcclusion && noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
						{
							continue;
						}
						thingPos.y += (float)t.altitude * altitudeFix.y;
						thingPos.z += (float)t.altitude * altitudeFix.z;
					}
					_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
					_actorPos.z += pref.z;
					if (pref.height >= 0f)
					{
						thingPos.z += pref.z;
					}
				}
				if (!tileType.UseMountHeight && j > 10)
				{
					flag7 = true;
				}
			}
			else
			{
				param.liquidLv += sourceObj.pref.liquidMod;
				if (param.liquidLv < 1)
				thingPos.y += num11;
				_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
				_actorPos.z += pref.z;
				thingPos.z += pref.z;
			}
			if (t.isFloating && isWater && !hasBridge && !flag)
			{
				flag = true;
				float num12 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
				orgY += 0.01f * floatY - num12;
				if (!t.trait.IsChangeFloorHeight)
				{
					param.liquid = 1f;
					num8 = num11;
				}
				else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
				_actorPos.y += 0.01f * floatY - num12;
				if (liquidLv > 10)
				{
					param.liquidLv = 99 + sourceObj.pref.liquidModMax;
					liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
				}
				liquidLv -= (int)(floatY * 0.5f);
				if (liquidLv < 0)
				{
					liquidLv = 0;
				}
				param.liquidLv = liquidLv;
			}
		}
		if (sourceObj.useAltColor)
		{
			param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
		}
		else
		{
			param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
		}
		if (sourceObj.HasGrowth)
		{
			this.cell.growth.OnRenderTileMap(param);
		}
		else
		{
			if (this.cell.autotileObj != 0)
			num4 = num11;
			if (t.sourceCard.multisize && !t.trait.IsGround)
			{
				param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
				num10 += zSetting.multiZ;
			}
			else if (sourceObj.tileType.IsUseBlockDir)
			orgZ += t.renderer.data.stackZ;
			if (param.liquidLv > 0)
			{
				param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
				param.liquidLv += pref.liquidMod;
				if (param.liquidLv < 1)
				{
					param.liquidLv = 1;
				}
				else if (param.liquidLv > 99 + pref.liquidModMax)
				{
					param.liquidLv = 99 + pref.liquidModMax;
				}
			}
			else
		} 
		if (!isInstalled || !tileType.UseMountHeight)
		{
			if (t.altitude != 0)
			{
				param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
				_actorPos += altitudeFix * t.altitude;
				if (!t.isRoofItem)
				{
					num6 += (float)t.altitude;
					num5 = t.altitude;
				}
			}
			if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
			if (num6 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
			{
				param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
				continue;
			}
			orgY = param.y;
			orgZ = param.z;
			param.y += sourceObj.pref.y;
			param.z += sourceObj.pref.z;
			sourceObj.renderData.Draw(param);
			param.y = orgY;
			param.z = orgZ;
			int shadow2 = sourceObj.pref.shadow;
			if (shadow2 > 1 && !this.cell.ignoreObjShadow)
			if (t.freePos)
			{
				if (t.isRoofItem)
				{
					_actorPos.x += t.fx;
					_actorPos.y += t.fy - (float)t.altitude * altitudeFix.y;
				}
				else
				{
					_actorPos.x = orgX + t.fx - freePos.x;
					_actorPos.y = orgY + t.fy - freePos.y;
				}
			}
			if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
			{
				passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow2], sourceObj.pref, 0, param.snow);
				_actorPos.z += -0.5f;
			}
			param.y = orgY;
		}
	}
}
if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
	passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
	switch (ActionMode.FlagCell.mode)
	{
	case AM_FlagCell.Mode.flagWallPillar:
		if (this.cell.isToggleWallPillar)
		{
			passArea.Add(param, 34f, 0f);
		}
		break;
	case AM_FlagCell.Mode.flagOcclusion:
		if (this.cell.toggleOcclusion)
		{
			passArea.Add(param, 34f, 0f);
		}
		break;
	case AM_FlagCell.Mode.flagSnow:
		if (this.cell.isClearSnow)
		if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
		{
			passArea.Add(param, 34f, 0f);
			if (iconMode != CardIconMode.None)
			{
				int num13 = 0;
				switch (iconMode)
				{
				case CardIconMode.Visibility:
					if (t.isMasked)
					{
						num13 = 17;
					}
					break;
				case CardIconMode.State:
					if (t.placeState == PlaceState.installed)
					{
						num13 = 18;
					}
					break;
				case CardIconMode.Deconstruct:
					if (t.isDeconstructing)
					{
						num13 = 14;
					}
					break;
				}
				if (t.isNPCProperty && !EMono.debug.godBuild)
				{
					num13 = 13;
				}
				if (num13 != 0)
				{
					passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num13);
				}
			}
			t.SetRenderParam(param);
			if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
			{
				param.tile += ((param.tile < 0f) ? (-64) : 64);
			}
			if (t.trait is TraitTrolley && EMono.pc.ai is AI_Trolley aI_Trolley && aI_Trolley.trolley.owner == t)
			{
				RenderParam _param = new RenderParam(param);
				EMono.core.actionsLateUpdate.Add(delegate
				{
					t.SetRenderParam(_param);
					_actorPos.x = EMono.pc.renderer.position.x;
					_actorPos.y = EMono.pc.renderer.position.y - pref.height;
					_actorPos.z = EMono.pc.renderer.position.z + 0.02f;
					t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow2 || tileType.AlwaysShowShadow));
				});
			}
			else
			{
				if (t.trait.UsePositionFix)
				{
					t.trait.PositionFix(ref _actorPos);
				}
				t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow2 || tileType.AlwaysShowShadow));
			}
		}
		break;
	case AM_FlagCell.Mode.flagFloat:
		if (this.cell.isForceFloat)
		if (isInstalled)
		{
			passArea.Add(param, 34f, 0f);
			num7 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
		}
		break;
	case AM_FlagCell.Mode.flagClear:
		if (this.cell.isClearArea)
		param.x = orgX;
		param.y = orgY;
		param.z = orgZ;
		param.color = floorLight;
		thing = t;
		if (pref.Float)
		{
			passArea.Add(param, 34f, 0f);
			liquidLv = 0;
		}
		break;
	}
}
if (detail == null)
orgY += num8;
if (detail.charas.Count <= 0)
{
	return;
}
if (highlightArea && detail.area != null)
{
	passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
}
if (detail.footmark != null && sourceFloor.id != 0)
{
	param.tile = detail.footmark.tile;
	param.mat = matFloor;
	param.matColor = 104025f;
	renderFootmark.Draw(param);
}
goto IL_7d7f;
IL_16be:
if (this.cell.isSlopeEdge)
param.shadowFix = 0f - num9;
param.color += 1310720f;
float max = zSetting.max2;
for (int num14 = 0; num14 < detail.charas.Count; num14++)
{
	float num5 = (float)height * _heightMod.y;
	orgY = param.y;
	orgZ = param.z;
	param.dir = this.cell.blockDir;
	if (snowed)
	{
		param.color = floorLight;
	}
	SourceBlock.Row defBlock;
	if (sourceBlock.tileType.IsFullBlock)
	Chara chara = detail.charas[num14];
	if (chara.host != null)
	{
		defBlock = sourceBlock;
		param.mat = matBlock;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		continue;
	}
	else
	if (chara != EMono.pc && chara != LayerDrama.alwaysVisible)
	{
		defBlock = sourceFloor._defBlock;
		param.mat = matFloor;
		param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
		if (defBlock.id != 1)
		if (chara.mimicry != null && chara.mimicry.IsThing)
		{
			param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
			if (flag3 || fogged || !this.cell.isSeen)
			{
				continue;
			}
		}
		else
		else if (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))
		{
			param.matColor = 104025f;
			continue;
		}
	}
	for (int j = 0; (float)j < num5 / heightBlockSize; j++)
	_actorPos.x = orgX;
	_actorPos.y = orgY;
	_actorPos.z = orgZ;
	if (this.cell.IsBlocked && chara.IsAstralBody)
	{
		param.y += ugFix.y;
		param.z += ugFix.z + slopeFixZ * (float)j;
		defBlock.renderData.Draw(param);
		if (this.cell.pcSync && EMono.player.lightPower > 0f)
		{
			float num6 = param.tile;
			param.tile = 0f;
			rendererFov.Draw(param);
			param.tile = num6;
		}
		_actorPos.z += EMono.setting.render.astralBodyFixZ;
	}
	param.y = orgY;
	param.z = orgZ;
}
param.color = floorLight;
if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
{
	orgY = param.y;
	orgZ = param.z;
	int num7 = 0;
	if (sourceBlock.tileType.IsFullBlock)
	chara.SetRenderParam(param);
	_ = chara.IsAliveInCurrentZone;
	if (chara.isRestrained)
	{
		SourceBlock.Row row3 = sourceBlock;
		num7 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
		TraitShackle restrainer = chara.GetRestrainer();
		if (restrainer != null)
		{
			Vector3 getRestrainPos = restrainer.GetRestrainPos;
			if (getRestrainPos != default(Vector3))
			{
				Vector3 position = restrainer.owner.renderer.position;
				float defCharaHeight = EMono.setting.render.defCharaHeight;
				float num15 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height);
				_actorPos.x = position.x + getRestrainPos.x * (float)((restrainer.owner.dir % 2 == 0) ? 1 : (-1));
				_actorPos.y = position.y + num15;
				_actorPos.z = position.z + getRestrainPos.z;
				param.liquidLv = 0;
				param.shadowFix = orgY - _actorPos.y;
				chara.renderer.SetFirst(first: true);
				chara.renderer.Draw(param, ref _actorPos, drawShadow: true);
				param.shadowFix = 0f;
				continue;
			}
		}
	}
	else
	if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
	{
		SourceBlock.Row row3 = sourceFloor._defBlock;
		num7 = row3._tiles[this.cell.blockDir % row3._tiles.Length];
	}
	if (((this.cell.Front.shore / 12) & 1) == 0 && this.cell.Front.sourceFloor.tileType.IsWater && this.cell.Front.height <= height && this.cell.Front.sourceBlock.tileType.RenderWaterBlock)
	{
		param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Front.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Front.height * _heightMod.y;
		param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
		param.tile = num7 + ((!this.cell.Front.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
		rendererWaterBlock.Draw(param);
	}
	if (((this.cell.Right.shore / 12) & 8) == 0 && this.cell.Right.sourceFloor.tileType.IsWater && this.cell.Right.height <= height && this.cell.Right.sourceBlock.tileType.RenderWaterBlock)
	{
		param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Right.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Right.height * _heightMod.y;
		param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
		param.tile = num7 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
		rendererWaterBlock.Draw(param);
		if (chara.IsDeadOrSleeping && chara.IsPCC)
		{
			float num16 = chara.renderer.data.size.y * 0.3f;
			if (thingPos.y > max)
			{
				thingPos.y = max;
			}
			float num17 = thingPos.y + num16;
			float num18 = (float)num14 * -0.01f;
			if (num17 > zSetting.thresh1)
			{
				num18 = zSetting.mod1;
			}
			_actorPos.x += thingPos.x;
			_actorPos.y += thingPos.y;
			_actorPos.z += renderSetting.laydownZ + num18;
			param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
			thingPos.y += num16 * 0.8f;
			chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
		}
		else
		{
			param.liquidLv = liquidLv;
			if (isUnderwater)
			{
				if (chara.Pref.FloatUnderwater)
				{
					float num19 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
					float num20 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
					orgY += 0.01f * num20 - num19;
					_actorPos.y += 0.01f * num20 - num19;
					param.shadowFix -= 0.01f * num20 - num19;
				}
			}
			else if (liquidLv > 0)
			{
				if (chara.Pref.Float && !flag && !hasBridge)
				{
					if (liquidLv > 20)
					{
						float num21 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
						orgY += 0.01f * floatY - num21;
						_actorPos.y += 0.01f * floatY - num21;
						int num22 = TileType.FloorWaterShallow.LiquidLV * 10;
						num22 -= (int)(floatY * 0.5f);
						param.liquidLv = num22;
					}
					else
					{
						param.liquidLv -= 20;
					}
				}
				param.liquidLv += chara.Pref.liquidMod;
				if (param.liquidLv < 1)
				{
					param.liquidLv = 1;
				}
				else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
				{
					param.liquidLv = 99 + chara.Pref.liquidModMax;
				}
			}
			if (!chara.IsPC && EMono.pc.host != chara && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC))
			{
				_actorPos += renderSetting.charaPos[1 + ((num3 < 4) ? num3 : 3)];
			}
			_actorPos.z += 0.01f * (float)num14 + renderSetting.charaZ;
			num3++;
			if (flag6)
			{
				_actorPos.z += chara.renderer.data.hangedFixZ;
			}
			chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
		}
	}
	param.x = orgX;
	param.y = orgY;
	param.z = orgZ;
}
if (showBorder && !this.cell.outOfBounds)
return;
IL_7239:
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && !snowed && !this.cell.isClearSnow && ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock)))
{
	param.matColor = 104025f;
	if (cx == EMono._map.bounds.x)
	{
		renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
	}
	else if (cx == EMono._map.bounds.maxX)
	{
		renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
	}
	if (cz == EMono._map.bounds.z)
	snowed = true;
}
if (this.cell.effect != null)
{
	if (this.cell.effect.IsLiquid)
	{
		renderBorder.Draw(param, 14 + (EMono.world.date.IsNight ? 4 : 0));
		SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
		SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
		tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4;
		param.tile = tile + this.cell.sourceEffect._tiles[0];
		param.mat = defaultMaterial;
		param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color);
		sourceEffect.renderData.Draw(param);
	}
	else if (cz == EMono._map.bounds.maxZ)
	else
	{
		renderBorder.Draw(param, 15 + (EMono.world.date.IsNight ? 4 : 0));
		param.tile = this.cell.effect.source._tiles[0];
		SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
		if (sourceEffect2.anime.Length != 0)
		{
			if (sourceEffect2.anime.Length > 2)
			{
				float num23 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
				if (!(num23 >= (float)sourceEffect2.anime[0]))
				{
					param.tile += num23;
				}
			}
			else
			{
				float num24 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
				param.tile += num24;
			}
		}
		if (this.cell.effect.IsFire)
		{
			rendererEffect.Draw(param);
		}
		else
		{
			this.cell.effect.source.renderData.Draw(param);
		}
	}
}
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
param.color = floorLight;
if (this.cell.critter != null)
{
	orgY = param.y;
	orgZ = param.z;
	SourceBlock.Row defBlock2 = sourceFloor._defBlock;
	param.mat = matFloor;
	param.tile = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
	if (defBlock2.id != 1)
	Critter critter = this.cell.critter;
	int snowTile = critter.tile;
	if (snowed && critter.SnowTile != 0)
	{
		param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
		critter.x = 0.06f;
		critter.y = -0.06f;
		snowTile = critter.SnowTile;
	}
	else
	{
		param.matColor = 104025f;
		critter.Update();
	}
	for (int k = 0; k < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); k++)
	pass = passObjSS;
	batch = pass.batches[pass.batchIdx];
	batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f;
	batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f;
	batch.matrices[pass.idx].m23 = param.z;
	batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1));
	batch.colors[pass.idx] = floorLight;
	pass.idx++;
	if (pass.idx == pass.batchSize)
	{
		param.y += ugFix.y;
		param.z += ugFix.z + slopeFixZ * (float)k;
		defBlock2.renderData.Draw(param);
		pass.NextBatch();
	}
	param.y = orgY;
	param.z = orgZ;
}
if (!sourceFloor.tileType.IsSkipFloor)
if (detail != null)
{
	if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
	{
		floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
		if (snowed)
		{
			floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
		}
		else
		{
			floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
		}
		param.color = floorLight2;
		if (this.cell.lotShade)
		{
			floorLight = floorLight2;
		}
	}
	floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
	if (isWater && flag)
	TransAnime anime3 = detail.anime;
	if (anime3 != null && !anime3.animeBlock)
	{
		param.y -= 0.01f * floatY;
		TransAnime anime4 = detail.anime;
		param.x += anime4.v.x;
		param.y += anime4.v.y;
		param.z += anime4.v.z;
	}
	if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
} 
if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
{
	SourceObj.Row sourceObj = this.cell.sourceObj;
	if (!snowed || sourceObj.snowTile <= 0)
	{
		param.mat = matFloor;
		param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
		param.matColor = floorMatColor;
		param.snow = snowed;
		if (sourceFloor.anime.Length != 0)
		{
			int num8 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
			param.tile += num8;
		}
		if (this.cell.isDeck)
		param.mat = this.cell.matObj;
		orgY = param.y;
		if (param.liquidLv > 0)
		{
			param.z += 1f;
			if ((bool)sourceFloor.renderData.subData)
			if (sourceObj.pref.Float)
			{
				sourceFloor.renderData.subData.Draw(param);
				param.y += 0.01f * floatY;
				if (liquidLv > 10)
				{
					liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
				}
				liquidLv -= (int)(floatY * 0.5f);
				param.liquidLv = liquidLv;
			}
			sourceFloor.renderData.Draw(param);
			param.z -= 1f;
			if (sourceObj.tileType.IsWaterTop)
			{
				param.liquidLv = 0;
			}
			else
			{
				param.liquidLv += sourceObj.pref.liquidMod;
				if (param.liquidLv < 1)
				{
					param.liquid = 1f;
				}
				else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
				{
					param.liquidLv = 99 + sourceObj.pref.liquidModMax;
				}
			}
		}
		if (sourceObj.useAltColor)
		{
			param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
		}
		else
		{
			if ((bool)sourceFloor.renderData.subData)
			{
				sourceFloor.renderData.subData.Draw(param);
			}
			sourceFloor.renderData.Draw(param);
			param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
		}
		int num9 = 0;
		if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
		if (sourceObj.HasGrowth)
		{
			if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
			this.cell.growth.OnRenderTileMap(param);
		}
		else
		{
			if (this.cell.autotileObj != 0)
			{
				num9++;
				param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
			}
			if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
			else if (sourceObj.tileType.IsUseBlockDir)
			{
				num9 += 2;
				param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
			}
			if (num9 != 0)
			else
			{
				param.tile = 448 + num9 + 12;
				param.z -= 0.1f;
				sourceFloor.renderData.Draw(param);
				param.z += 0.1f;
				param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
			}
		}
		if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
		{
			if (snowed)
			if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
			{
				if (sourceFloor == FLOOR.sourceSnow)
				{
					param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
					param.z -= 0.01f;
					sourceFloor.renderData.Draw(param);
				}
			}
			else
			{
				pass = passEdge;
				batch = pass.batches[pass.batchIdx];
				batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
				batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
				batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
				batch.tiles[pass.idx] = 448 + this.cell.shadow;
				batch.colors[pass.idx] = param.color;
				batch.matColors[pass.idx] = 104025f;
				pass.idx++;
				if (pass.idx == pass.batchSize)
				{
					pass.NextBatch();
				}
			}
			if (!sourceFloor.ignoreTransition && !snowed)
			{
				Cell back = this.cell.Back;
				if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
				{
					pass = passFloor;
					batch = pass.batches[pass.batchIdx];
					batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
					batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
					batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
					batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
					batch.colors[pass.idx] = param.color;
					batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
					pass.idx++;
					if (pass.idx == pass.batchSize)
					{
						pass.NextBatch();
					}
				}
				back = this.cell.Left;
				if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
				{
					pass = passFloor;
					batch = pass.batches[pass.batchIdx];
					batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
					batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
					batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
					batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
					batch.colors[pass.idx] = param.color;
					batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
					pass.idx++;
					if (pass.idx == pass.batchSize)
					{
						pass.NextBatch();
					}
				}
				param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
			}
		}
		if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num9 == 0)
		{
			pass = (isWater ? passAutoTileWater : passAutoTile);
			batch = pass.batches[pass.batchIdx];
			batch.matrices[pass.idx].m03 = param.x;
			batch.matrices[pass.idx].m13 = param.y;
			batch.matrices[pass.idx].m23 = param.z + ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
			batch.tiles[pass.idx] = (26 + sourceFloor.autotile / 2) * 32 + sourceFloor.autotile % 2 * 16 + this.cell.autotile;
			batch.colors[pass.idx] = param.color + (float)((int)(sourceFloor.autotileBrightness * 100f) * 262144);
			batch.matColors[pass.idx] = param.matColor;
			pass.idx++;
			if (pass.idx == pass.batchSize)
			orgY = param.y;
			orgZ = param.z;
			param.y += sourceObj.pref.y;
			param.z += sourceObj.pref.z;
			sourceObj.renderData.Draw(param);
			param.y = orgY;
			param.z = orgZ;
			int shadow3 = sourceObj.pref.shadow;
			if (shadow3 > 1 && !this.cell.ignoreObjShadow)
			{
				pass.NextBatch();
				passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow3], sourceObj.pref, 0, param.snow);
			}
			param.y = orgY;
		}
	}
	if (isWater)
} 
if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
	passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
	switch (ActionMode.FlagCell.mode)
	{
		int num10 = 12;
		int num11 = this.cell.shore / num10;
		int num12 = this.cell.shore % num10;
		bool isShoreSand = this.cell.isShoreSand;
		if (this.cell.shore != 0)
		{
			Cell cell = (((num11 & 1) != 0) ? this.cell.Back : (((num11 & 2) != 0) ? this.cell.Right : (((num11 & 4) != 0) ? this.cell.Front : this.cell.Left)));
			if (isShoreSand && !cell.sourceFloor.isBeach)
			{
				cell = (((num11 & 8) != 0) ? this.cell.Left : (((num11 & 4) != 0) ? this.cell.Front : (((num11 & 2) != 0) ? this.cell.Right : this.cell.Back)));
			}
			if (!cell.IsSnowTile)
			{
				param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
				if (isShoreSand)
				{
					pass = passShore;
					batch = pass.batches[pass.batchIdx];
					batch.matrices[pass.idx].m03 = param.x;
					batch.matrices[pass.idx].m13 = param.y;
					batch.matrices[pass.idx].m23 = param.z;
					batch.tiles[pass.idx] = 768 + this.cell.shore / num10;
					batch.colors[pass.idx] = param.color;
					batch.matColors[pass.idx] = param.matColor;
					pass.idx++;
					if (pass.idx == pass.batchSize)
					{
						pass.NextBatch();
					}
					num12 = 2;
				}
				else
				{
					num12 = cell.sourceFloor.edge;
				}
				param.tile = (24 + num12 / 2) * 32 + num12 % 2 * 16 + num11;
				rendererShore.Draw(param);
			}
		}
		if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num10) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num10) & 1) != 0)
	case AM_FlagCell.Mode.flagWallPillar:
		if (this.cell.isToggleWallPillar)
		{
			param.tile = 785f;
			param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(60);
			passArea.Add(param, 34f, 0f);
		}
		if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num10) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num10) & 1) != 0)
		break;
	case AM_FlagCell.Mode.flagOcclusion:
		if (this.cell.toggleOcclusion)
		{
			param.tile = 786f;
			param.matColor = GetColorInt(ref this.cell.BackRight.matFloor.matColor, this.cell.BackRight.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(56);
			passArea.Add(param, 34f, 0f);
		}
		if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num10) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num10) & 4) != 0)
		break;
	case AM_FlagCell.Mode.flagSnow:
		if (this.cell.isClearSnow)
		{
			param.tile = 787f;
			param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(48);
			passArea.Add(param, 34f, 0f);
		}
		if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num10) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num10) & 4) != 0)
		break;
	case AM_FlagCell.Mode.flagFloat:
		if (this.cell.isForceFloat)
		{
			param.tile = 788f;
			param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(52);
			passArea.Add(param, 34f, 0f);
		}
		if (this.cell._bridge != 0 && this.cell.isBridgeEdge && !this.cell.hidePillar)
		break;
	case AM_FlagCell.Mode.flagClear:
		if (this.cell.isClearArea)
		{
			pass = passEdge;
			batch = pass.batches[pass.batchIdx];
			batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
			batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
			batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
			batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
			batch.colors[pass.idx] = param.color;
			batch.matColors[pass.idx] = 104025f;
			pass.idx++;
			if (pass.idx == pass.batchSize)
			{
				pass.NextBatch();
			}
			passArea.Add(param, 34f, 0f);
		}
		bool flag6 = false;
		if (isShoreSand)
		break;
	}
}
if (detail == null)
{
	return;
}
if (highlightArea && detail.area != null)
{
	passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
}
if (detail.footmark != null && sourceFloor.id != 0)
{
	param.tile = detail.footmark.tile;
	param.mat = matFloor;
	param.matColor = 104025f;
	renderFootmark.Draw(param);
}
goto IL_7da3;
IL_71d9:
int num25;
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
	param.tile = num25;
	rendererFov.Draw(param);
}
goto IL_7239;
IL_16be:
if (this.cell.isSlopeEdge)
{
	float num26 = (float)height * _heightMod.y;
	orgY = param.y;
	orgZ = param.z;
	param.dir = this.cell.blockDir;
	if (snowed)
	{
		param.color = floorLight;
	}
	SourceBlock.Row defBlock;
	if (sourceBlock.tileType.IsFullBlock)
	{
		defBlock = sourceBlock;
		param.mat = matBlock;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
	}
	else
	{
		defBlock = sourceFloor._defBlock;
		param.mat = matFloor;
		param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
		if (defBlock.id != 1)
		{
			if ((num11 & 1) != 0)
			{
				if ((num11 & 8) != 0)
				{
					if ((num11 & 2) == 0 && (num11 & 4) == 0)
					{
						Draw(16);
					}
					flag6 = true;
				}
				if ((num11 & 2) != 0)
				{
					if ((num11 & 8) == 0 && (num11 & 4) == 0)
					{
						Draw(20);
					}
					flag6 = true;
				}
			}
			if ((num11 & 4) != 0)
			{
				if ((num11 & 8) != 0)
				{
					if ((num11 & 2) == 0 && (num11 & 1) == 0)
					{
						Draw(24);
					}
					flag6 = true;
				}
				if ((num11 & 2) != 0)
				{
					if ((num11 & 8) == 0 && (num11 & 1) == 0)
					{
						Draw(28);
					}
					flag6 = true;
				}
			}
			if (!flag6)
			{
				if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
				{
					Draw(8);
				}
				if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
				{
					Draw(12);
				}
			}
			param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
		}
		if (!flag6)
		else
		{
			if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
			{
				pass = passEdge;
				batch = pass.batches[pass.batchIdx];
				batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
				batch.matColors[pass.idx] = 104025f;
				if (((this.cell.shore / num10) & 1) != 0)
				{
					if (isShoreSand)
					{
						param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
						batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
						batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
						batch.tiles[pass.idx] = 640 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
						batch.matColors[pass.idx] = param.matColor;
					}
					else
					{
						batch.matrices[pass.idx].m03 = param.x;
						batch.matrices[pass.idx].m13 = param.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
					}
				}
				else
				{
					batch.matrices[pass.idx].m03 = param.x;
					batch.matrices[pass.idx].m13 = param.y;
					batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
					batch.tiles[pass.idx] += 12f;
				}
				batch.colors[pass.idx] = param.color;
				pass.idx++;
				if (pass.idx == pass.batchSize)
				{
					pass.NextBatch();
				}
			}
			if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
			{
				pass = passEdge;
				batch = pass.batches[pass.batchIdx];
				batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
				batch.matColors[pass.idx] = 104025f;
				if (((this.cell.shore / num10) & 8) != 0)
				{
					if (isShoreSand)
					{
						param.matColor = GetColorInt(ref this.cell.Left.matFloor.matColor, this.cell.Left.sourceFloor.colorMod);
						batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
						batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
						batch.tiles[pass.idx] = 644 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
						batch.matColors[pass.idx] = param.matColor;
					}
					else
					{
						batch.matrices[pass.idx].m03 = param.x;
						batch.matrices[pass.idx].m13 = param.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
					}
				}
				else
				{
					batch.matrices[pass.idx].m03 = param.x;
					batch.matrices[pass.idx].m13 = param.y;
					batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
					batch.tiles[pass.idx] += 12f;
				}
				batch.colors[pass.idx] = param.color;
				pass.idx++;
				if (pass.idx == pass.batchSize)
				{
					pass.NextBatch();
				}
			}
			param.matColor = 104025f;
		}
		if (flag)
	} 
	for (int num27 = 0; (float)num27 < num26 / heightBlockSize; num27++)
	{
		param.y += ugFix.y;
		param.z += ugFix.z + slopeFixZ * (float)num27;
		defBlock.renderData.Draw(param);
		if (this.cell.pcSync && EMono.player.lightPower > 0f)
		{
			param.y += 0.01f * floatY;
			float num28 = param.tile;
			param.tile = 0f;
			rendererFov.Draw(param);
			param.tile = num28;
		}
	}
	if (flag)
	param.y = orgY;
	param.z = orgZ;
}
param.color = floorLight;
if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
{
	orgY = param.y;
	orgZ = param.z;
	int num29 = 0;
	if (sourceBlock.tileType.IsFullBlock)
	{
		param.z -= 1f;
		SourceBlock.Row row3 = sourceBlock;
		num29 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
	}
	else
	{
		SourceBlock.Row row3 = sourceFloor._defBlock;
		num29 = row3._tiles[this.cell.blockDir % row3._tiles.Length];
	}
	if (((this.cell.Front.shore / 12) & 1) == 0 && this.cell.Front.sourceFloor.tileType.IsWater && this.cell.Front.height <= height && this.cell.Front.sourceBlock.tileType.RenderWaterBlock)
	{
		param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Front.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Front.height * _heightMod.y;
		param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
		param.tile = num29 + ((!this.cell.Front.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
		rendererWaterBlock.Draw(param);
	}
	if (((this.cell.Right.shore / 12) & 8) == 0 && this.cell.Right.sourceFloor.tileType.IsWater && this.cell.Right.height <= height && this.cell.Right.sourceBlock.tileType.RenderWaterBlock)
	{
		param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Right.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Right.height * _heightMod.y;
		param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
		param.tile = num29 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
		rendererWaterBlock.Draw(param);
	}
	param.y = orgY;
	param.z = orgZ;
}
if (this.cell.skipRender)
if (showBorder && !this.cell.outOfBounds)
{
	if (this.cell.pcSync)
	param.matColor = 104025f;
	if (cx == EMono._map.bounds.x)
	{
		param.tile = 0f;
		rendererFov.Draw(param);
		renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
	}
	else if (cx == EMono._map.bounds.maxX)
	{
		renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
	}
	if (cz == EMono._map.bounds.z)
	{
		renderBorder.Draw(param, 14 + (EMono.world.date.IsNight ? 4 : 0));
	}
	else if (cz == EMono._map.bounds.maxZ)
	{
		renderBorder.Draw(param, 15 + (EMono.world.date.IsNight ? 4 : 0));
	}
	return;
}
if (hasBridge)
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
{
	param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
	param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
	if (flag)
	orgY = param.y;
	orgZ = param.z;
	SourceBlock.Row defBlock2 = sourceFloor._defBlock;
	param.mat = matFloor;
	param.tile = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
	if (defBlock2.id != 1)
	{
		param.y += 0.01f * floatY;
		param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
	}
	param.color = floorLight;
	param.mat = matBridge;
	floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
	param.dir = this.cell.floorDir;
	param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
	param.matColor = floorMatColor;
	sourceBridge.renderData.Draw(param);
	if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
	else
	{
		pass = passAutoTile;
		batch = pass.batches[pass.batchIdx];
		batch.matrices[pass.idx].m03 = param.x;
		batch.matrices[pass.idx].m13 = param.y;
		batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
		batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
		batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
		batch.matColors[pass.idx] = param.matColor;
		pass.idx++;
		if (pass.idx == pass.batchSize)
		{
			pass.NextBatch();
		}
		param.matColor = 104025f;
	}
	for (int num30 = 0; num30 < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); num30++)
	{
		param.y += ugFix.y;
		param.z += ugFix.z + slopeFixZ * (float)num30;
		defBlock2.renderData.Draw(param);
	}
	if (this.cell.shadow != 0)
	param.y = orgY;
	param.z = orgZ;
}
if (!sourceFloor.tileType.IsSkipFloor)
{
	if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
	{
		if (sourceBridge == FLOOR.sourceSnow)
		floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
		if (snowed)
		{
			param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
			param.z -= 0.01f;
			sourceBridge.renderData.Draw(param);
			floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
		}
		else
		{
			pass = passEdge;
			batch = pass.batches[pass.batchIdx];
			batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
			batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
			batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
			batch.tiles[pass.idx] = 448 + this.cell.shadow;
			batch.colors[pass.idx] = blockLight;
			batch.matColors[pass.idx] = 104025f;
			pass.idx++;
			if (pass.idx == pass.batchSize)
			{
				pass.NextBatch();
			}
			floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
		}
		param.color = floorLight2;
		if (this.cell.lotShade)
		{
			floorLight = floorLight2;
		}
	}
	if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && !this.cell.hidePillar && !noSlopMode)
	floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
	if (isWater && flag)
	{
		orgY = param.y;
		orgZ = param.z;
		param.y += bridgeFix.y;
		param.z += bridgeFix.z;
		param.dir = 0;
		SourceBlock.Row row4 = sourceBridge._bridgeBlock;
		float num13 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
		if (this.cell.sourceFloor.tileType == TileType.Sky)
		param.y -= 0.01f * floatY;
	}
	if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
	{
		param.mat = matFloor;
		param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
		param.matColor = floorMatColor;
		param.snow = snowed;
		if (sourceFloor.anime.Length != 0)
		{
			num13 += (float)EMono._map.config.skyBlockHeight;
			int num31 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
			param.tile += num31;
		}
		int num14 = (int)(num13 / heightBlockSize) + 2;
		if (this.cell.bridgePillar != 0)
		if (this.cell.isDeck)
		{
			row4 = EMono.sources.blocks[this.cell.bridgePillar];
			param.tile = row4._tiles[0] + ((num14 == 2) ? 32 : 0);
			param.mat = ((sourceBridge.DefaultMaterial == row4.DefaultMaterial) ? sourceBridge.DefaultMaterial : row4.DefaultMaterial);
			param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, row4.colorMod));
			param.z += 1f;
			if ((bool)sourceFloor.renderData.subData)
			{
				sourceFloor.renderData.subData.Draw(param);
			}
			sourceFloor.renderData.Draw(param);
			param.z -= 1f;
		}
		else
		{
			param.mat = matBlock;
			param.tile = row4._tiles[0] + 32;
			param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
			if ((bool)sourceFloor.renderData.subData)
			{
				sourceFloor.renderData.subData.Draw(param);
			}
			sourceFloor.renderData.Draw(param);
		}
		param.y += ugFixBridgeTop.y;
		param.z += ugFixBridgeTop.z;
		for (int l = 0; l < num14; l++)
		int num32 = 0;
		if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
		{
			if (l == num14 - 1)
			if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
			{
				param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y + ugFixBridgeBottom.y;
				param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z + ugFixBridgeBottom.z;
				num32++;
			}
			if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
			{
				num32 += 2;
			}
			if (num32 != 0)
			{
				param.tile = 448 + num32 + 12;
				param.z -= 0.1f;
				sourceFloor.renderData.Draw(param);
				param.z += 0.1f;
			}
		}
		if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
		{
			if (snowed)
			{
				if (sourceFloor == FLOOR.sourceSnow)
				{
					param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
					param.z -= 0.01f;
					sourceFloor.renderData.Draw(param);
				}
			}
			else
			{
				param.y += ugFixBridge.y;
				param.z += ugFixBridge.z;
				pass = passEdge;
				batch = pass.batches[pass.batchIdx];
				batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
				batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
				batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
				batch.tiles[pass.idx] = 448 + this.cell.shadow;
				batch.colors[pass.idx] = param.color;
				batch.matColors[pass.idx] = 104025f;
				pass.idx++;
				if (pass.idx == pass.batchSize)
				{
					pass.NextBatch();
				}
			}
			if (!sourceFloor.ignoreTransition && !snowed)
			{
				Cell back = this.cell.Back;
				if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
				{
					pass = passFloor;
					batch = pass.batches[pass.batchIdx];
					batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
					batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
					batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
					batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
					batch.colors[pass.idx] = param.color;
					batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
					pass.idx++;
					if (pass.idx == pass.batchSize)
					{
						pass.NextBatch();
					}
				}
				back = this.cell.Left;
				if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
				{
					pass = passFloor;
					batch = pass.batches[pass.batchIdx];
					batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
					batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
					batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
					batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
					batch.colors[pass.idx] = param.color;
					batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
					pass.idx++;
					if (pass.idx == pass.batchSize)
					{
						pass.NextBatch();
					}
				}
			}
			row4.renderData.Draw(param);
		}
		param.y = orgY;
		param.z = orgZ;
	}
}
if (this.cell._deco != 0)
{
	param.mat = matFloor;
	param.matColor = ((sourceDeco.colorMod == 0) ? 104025 : GetColorInt(ref matDeco.matColor, sourceDeco.colorMod));
	param.snow = snowed;
	if (sourceDeco.autotile != 0)
	{
		if (this.cell.autotileDeco != 0)
		if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num32 == 0)
		{
			param.tile = (26 + sourceDeco.autotile / 2) * 32 + sourceDeco.autotile % 2 * 16 + this.cell.autotileDeco;
			sourceDeco.renderData.Draw(param);
			param.z = orgZ;
			pass = (isWater ? passAutoTileWater : passAutoTile);
			batch = pass.batches[pass.batchIdx];
			batch.matrices[pass.idx].m03 = param.x;
			batch.matrices[pass.idx].m13 = param.y;
			batch.matrices[pass.idx].m23 = param.z + ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
			batch.tiles[pass.idx] = (26 + sourceFloor.autotile / 2) * 32 + sourceFloor.autotile % 2 * 16 + this.cell.autotile;
			batch.colors[pass.idx] = param.color + (float)((int)(sourceFloor.autotileBrightness * 100f) * 262144);
			batch.matColors[pass.idx] = param.matColor;
			pass.idx++;
			if (pass.idx == pass.batchSize)
			{
				pass.NextBatch();
			}
		}
	}
	else
	{
		param.tile = sourceDeco._tiles[floorDir % sourceDeco._tiles.Length];
		sourceDeco.renderData.Draw(param);
	}
}
if (!buildMode && this.cell.highlight != 0)
{
	if (this.cell._block != 0 && !this.cell.hasDoor)
	{
		screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
	}
	else
	{
		passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
	}
}
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
{
	snowed = false;
}
int num15 = 0;
if (sourceBlock.id != 0)
{
	this.tileType = sourceBlock.tileType;
	roomHeight = 0f;
	int blockDir = this.cell.blockDir;
	bool num16 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
	bool flag7 = false;
	if (!num16)
	if (isWater)
	{
		switch (wallClipMode)
		int num33 = 12; 
		int num34 = this.cell.shore / num33; 
		int num35 = this.cell.shore % num33; 
		bool isShoreSand = this.cell.isShoreSand; 
		if (this.cell.shore != 0)
		{
		case WallClipMode.ByRoom:
			if (!this.tileType.RepeatBlock)
			{
				break;
			}
			if (currentRoom == null || showFullWall)
			{
				this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
				_lowblock = lowBlock;
			}
			else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
			Cell cell = (((num34 & 1) != 0) ? this.cell.Back : (((num34 & 2) != 0) ? this.cell.Right : (((num34 & 4) != 0) ? this.cell.Front : this.cell.Left)));
			if (isShoreSand && !cell.sourceFloor.isBeach)
			{
				this.room = this.cell.Front.room;
				_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
				cell = (((num34 & 8) != 0) ? this.cell.Left : (((num34 & 4) != 0) ? this.cell.Front : (((num34 & 2) != 0) ? this.cell.Right : this.cell.Back)));
			}
			else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
			if (!cell.IsSnowTile)
			{
				this.room = this.cell.Right.room;
				_lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
				param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
				if (isShoreSand)
				{
					pass = passShore;
					batch = pass.batches[pass.batchIdx];
					batch.matrices[pass.idx].m03 = param.x;
					batch.matrices[pass.idx].m13 = param.y;
					batch.matrices[pass.idx].m23 = param.z;
					batch.tiles[pass.idx] = 768 + this.cell.shore / num33;
					batch.colors[pass.idx] = param.color;
					batch.matColors[pass.idx] = param.matColor;
					pass.idx++;
					if (pass.idx == pass.batchSize)
					{
						pass.NextBatch();
					}
					num35 = 2;
				}
				else
				{
					num35 = cell.sourceFloor.edge;
				}
				param.tile = (24 + num35 / 2) * 32 + num35 % 2 * 16 + num34;
				rendererShore.Draw(param);
			}
			else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
		} 
		if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num33) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num33) & 1) != 0)
		{
			param.tile = 785f;
			param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(60);
		}
		if (this.cell.Back.isShoreSand && ((this.cell.Back.shore / num33) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num33) & 1) != 0)
		{
			param.tile = 786f;
			param.matColor = GetColorInt(ref this.cell.BackRight.matFloor.matColor, this.cell.BackRight.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(56);
		}
		if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num33) & 2) != 0 && this.cell.Right.isShoreSand && ((this.cell.Right.shore / num33) & 4) != 0)
		{
			param.tile = 787f;
			param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(48);
		}
		if (this.cell.Front.isShoreSand && ((this.cell.Front.shore / num33) & 8) != 0 && this.cell.Left.isShoreSand && ((this.cell.Left.shore / num33) & 4) != 0)
		{
			param.tile = 788f;
			param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
			passShore.Add(param);
			Draw(52);
		}
		if (this.cell._bridge != 0 && this.cell.isBridgeEdge && !this.cell.hidePillar)
		{
			pass = passEdge;
			batch = pass.batches[pass.batchIdx];
			batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
			batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
			batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
			batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
			batch.colors[pass.idx] = param.color;
			batch.matColors[pass.idx] = 104025f;
			pass.idx++;
			if (pass.idx == pass.batchSize)
			{
				this.room = this.cell.FrontRight.room;
				_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
				pass.NextBatch();
			}
			else
		} 
		bool flag8 = false;
		if (isShoreSand)
		{
			if ((num34 & 1) != 0)
			{
				this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
				_lowblock = true;
				if (!this.tileType.IsFullBlock)
				if ((num34 & 8) != 0)
				{
					if (this.cell.lotWall)
					if ((num34 & 2) == 0 && (num34 & 4) == 0)
					{
						_lowblock = false;
						Draw(16);
					}
					else if (this.room == currentRoom)
					flag8 = true;
				}
				if ((num34 & 2) != 0)
				{
					if ((num34 & 8) == 0 && (num34 & 4) == 0)
					{
						_lowblock = !this.cell.fullWall;
						Draw(20);
					}
					flag8 = true;
				}
			}
			flag7 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
			if (flag7)
			{
				_lowblock = false;
			}
			if (this.room == null && alwaysLowblock)
			{
				_lowblock = true;
				roomHeight = 0f;
			}
			if (this.room != null)
			if ((num34 & 4) != 0)
			{
				maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
				if (showRoof)
				if ((num34 & 8) != 0)
				{
					roomHeight = this.room.lot.realHeight;
					break;
					if ((num34 & 2) == 0 && (num34 & 1) == 0)
					{
						Draw(24);
					}
					flag8 = true;
				}
				if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
				if ((num34 & 2) != 0)
				{
					roomHeight = 0f;
					break;
					if ((num34 & 8) == 0 && (num34 & 1) == 0)
					{
						Draw(28);
					}
					flag8 = true;
				}
				int num17 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
				roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num17) ? this.room.lot.height : num17) + 0.01f * (float)this.room.lot.heightFix;
			}
			break;
		case WallClipMode.ByLot:
			if (defaultBlockHeight > 0f || isIndoor)
			if (!flag8)
			{
				_lowblock = cx != 0 && cz != Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock);
				if (!_lowblock)
				if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
				{
					roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
					maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
					Draw(8);
				}
				if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
				{
					Draw(12);
				}
				break;
			}
			if (showFullWall)
		} 
		if (!flag8)
		{
			if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
			{
				_lowblock = this.room != null;
				if (_lowblock)
				pass = passEdge;
				batch = pass.batches[pass.batchIdx];
				batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
				batch.matColors[pass.idx] = 104025f;
				if (((this.cell.shore / num33) & 1) != 0)
				{
					if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
					if (isShoreSand)
					{
						_lowblock = false;
						param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
						batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
						batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
						batch.tiles[pass.idx] = 640 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
						batch.matColors[pass.idx] = param.matColor;
					}
					else
					{
						batch.matrices[pass.idx].m03 = param.x;
						batch.matrices[pass.idx].m13 = param.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
					}
				}
				else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
				else
				{
					_lowblock = true;
					batch.matrices[pass.idx].m03 = param.x;
					batch.matrices[pass.idx].m13 = param.y;
					batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
					batch.tiles[pass.idx] += 12f;
				}
				batch.colors[pass.idx] = param.color;
				pass.idx++;
				if (pass.idx == pass.batchSize)
				{
					pass.NextBatch();
				}
			}
			else
			{
				_lowblock = lowBlock;
			}
			if (this.tileType.RepeatBlock)
			if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
			{
				this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
				if (this.room != null && (!noRoofMode || currentRoom != null) && (!showFullWall || currentRoom == null || this.room.lot == currentRoom.lot))
				pass = passEdge;
				batch = pass.batches[pass.batchIdx];
				batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
				batch.matColors[pass.idx] = 104025f;
				if (((this.cell.shore / num33) & 8) != 0)
				{
					roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
					maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
					if (isShoreSand)
					{
						param.matColor = GetColorInt(ref this.cell.Left.matFloor.matColor, this.cell.Left.sourceFloor.colorMod);
						batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
						batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
						batch.tiles[pass.idx] = 644 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
						batch.matColors[pass.idx] = param.matColor;
					}
					else
					{
						batch.matrices[pass.idx].m03 = param.x;
						batch.matrices[pass.idx].m13 = param.y;
						batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
					}
				}
				else
				{
					batch.matrices[pass.idx].m03 = param.x;
					batch.matrices[pass.idx].m13 = param.y;
					batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
					batch.tiles[pass.idx] += 12f;
				}
				batch.colors[pass.idx] = param.color;
				pass.idx++;
				if (pass.idx == pass.batchSize)
				{
					pass.NextBatch();
				}
			}
			break;
		}
		if (flag)
		{
			param.y += 0.01f * floatY;
		}
	}
	if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
	if (flag)
	{
		num15 = 1;
		param.z -= 1f;
	}
	else if (lowBlock)
} 
if (this.cell.skipRender)
{
	if (this.cell.pcSync)
	{
		num15 = 2;
		param.tile = 0f;
		rendererFov.Draw(param);
	}
	param.mat = matBlock;
	param.dir = this.cell.blockDir;
	param.snow = snowed;
	switch (this.tileType.blockRenderMode)
	return; 
}
if (hasBridge)
{
	param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
	param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
	if (flag)
	{
	case BlockRenderMode.FullBlock:
		param.y += 0.01f * floatY;
	}
	param.color = floorLight;
	param.mat = matBridge;
	floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
	param.dir = this.cell.floorDir;
	param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
	param.matColor = floorMatColor;
	sourceBridge.renderData.Draw(param);
	if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
	{
		bool invisible = sourceBlock.tileType.Invisible;
		if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
		{
			break;
		}
		if (this.cell.isSurrounded)
		{
			switch (innerMode)
			{
			case InnerMode.InnerBlock:
			case InnerMode.BuildMode:
				blockLight = _baseBrightness + fogBrightness;
				param.color = (int)(50f * blockLight) * 262144;
				param.matColor = 104025f;
				param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
				rendererInnerBlock.Draw(param);
				return;
			case InnerMode.None:
			case InnerMode.Height:
				param.color = blockLight;
				break;
			}
		}
		if (snowed)
		{
			param.color = floorLight;
		}
		param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
		if (currentRoom != null && !showFullWall)
		{
			_lowblock = true;
			roomHeight = 0f;
			if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
			{
				_lowblock = false;
			}
			if (!_lowblock)
			{
				int num19 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
				roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num19) ? currentRoom.lot.height : num19) + 0.01f * (float)currentRoom.lot.heightFix;
			}
		}
		if (flag7)
		{
			_lowblock = (!this.cell.Front.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Front.HasFullBlock || !this.cell.Left.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Left.HasFullBlock);
			if (_lowblock)
			{
				roomHeight = 0f;
			}
		}
		if (invisible)
		pass = passAutoTile;
		batch = pass.batches[pass.batchIdx];
		batch.matrices[pass.idx].m03 = param.x;
		batch.matrices[pass.idx].m13 = param.y;
		batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
		batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
		batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
		batch.matColors[pass.idx] = param.matColor;
		pass.idx++;
		if (pass.idx == pass.batchSize)
		{
			roomHeight = 0f;
			_lowblock = false;
			pass.NextBatch();
		}
		if (this.cell.Things.Count > 0)
	} 
	if (this.cell.shadow != 0)
	{
		if (sourceBridge == FLOOR.sourceSnow)
		{
			_lowblock = false;
			param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
			param.z -= 0.01f;
			sourceBridge.renderData.Draw(param);
		}
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + (_lowblock ? 3000000 : 0);
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		if (roomHeight == 0f)
		else
		{
			if (!this.cell.hasDoor)
			pass = passEdge;
			batch = pass.batches[pass.batchIdx];
			batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
			batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
			batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
			batch.tiles[pass.idx] = 448 + this.cell.shadow;
			batch.colors[pass.idx] = blockLight;
			batch.matColors[pass.idx] = 104025f;
			pass.idx++;
			if (pass.idx == pass.batchSize)
			{
				sourceBlock.renderData.Draw(param);
				pass.NextBatch();
			}
		}
		else
		{
			sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0, isBlock: true);
		}
		Room room = this.cell.Front.room ?? this.cell.room;
		if (room == null && this.cell.Right.room != null)
	} 
	if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && !this.cell.hidePillar && !noSlopMode)
	{
		orgY = param.y;
		orgZ = param.z;
		param.y += bridgeFix.y;
		param.z += bridgeFix.z;
		param.dir = 0;
		SourceBlock.Row row4 = sourceBridge._bridgeBlock;
		float num36 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
		if (this.cell.sourceFloor.tileType == TileType.Sky)
		{
			room = this.cell.Right.room;
			num36 += (float)EMono._map.config.skyBlockHeight;
		}
		if (!invisible && room != null)
		int num37 = (int)(num36 / heightBlockSize) + 2;
		if (this.cell.bridgePillar != 0)
		{
			if (room.lot.idDeco != 0 && !this.cell.hasDoor)
			{
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco);
				param.matColor = room.lot.colDeco;
				float y = param.y;
				param.y += (float)room.lot.decoFix * 0.01f;
				rendererWallDeco.Draw(param);
				param.y = y;
			}
			if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
			{
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco2);
				param.matColor = room.lot.colDeco2;
				float y2 = param.y;
				float num20 = param.z;
				param.y += (float)room.lot.decoFix2 * 0.01f;
				param.z += (float)room.lot.decoFix2 * 0.01f * heightModDeco;
				rendererWallDeco.Draw(param);
				param.y = y2;
				param.z = num20;
			}
			row4 = EMono.sources.blocks[this.cell.bridgePillar];
			param.tile = row4._tiles[0] + ((num37 == 2) ? 32 : 0);
			param.mat = ((sourceBridge.DefaultMaterial == row4.DefaultMaterial) ? sourceBridge.DefaultMaterial : row4.DefaultMaterial);
			param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, row4.colorMod));
		}
		room = this.cell.Right.room ?? this.cell.room;
		if (room == null && this.cell.Front.room != null)
		else
		{
			room = this.cell.Front.room;
			param.mat = matBlock;
			param.tile = row4._tiles[0] + 32;
			param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
		}
		if (!invisible && room != null)
		param.y += ugFixBridgeTop.y;
		param.z += ugFixBridgeTop.z;
		for (int num38 = 0; num38 < num37; num38++)
		{
			if (room.lot.idDeco != 0 && !this.cell.hasDoor)
			if (num38 == num37 - 1)
			{
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco) * -1;
				param.matColor = room.lot.colDeco;
				float y3 = param.y;
				param.y += (float)room.lot.decoFix * 0.01f;
				rendererWallDeco.Draw(param);
				param.y = y3;
				param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y + ugFixBridgeBottom.y;
				param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z + ugFixBridgeBottom.z;
			}
			if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
			else
			{
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room.lot.idDeco2) * -1;
				param.matColor = room.lot.colDeco2;
				float y4 = param.y;
				float num21 = param.z;
				param.y += (float)room.lot.decoFix2 * 0.01f;
				param.z += (float)room.lot.decoFix2 * 0.01f * heightModDeco;
				rendererWallDeco.Draw(param);
				param.y = y4;
				param.z = num21;
				param.y += ugFixBridge.y;
				param.z += ugFixBridge.z;
			}
			row4.renderData.Draw(param);
		}
		break;
		param.y = orgY;
		param.z = orgZ;
	}
	case BlockRenderMode.WallOrFence:
}
if (this.cell._deco != 0)
{
	param.mat = matFloor;
	param.matColor = ((sourceDeco.colorMod == 0) ? 104025 : GetColorInt(ref matDeco.matColor, sourceDeco.colorMod));
	param.snow = snowed;
	if (sourceDeco.autotile != 0)
	{
		if (map.config.fullWallHeight)
		{
			showFullWall = true;
			_lowblock = false;
		}
		orgY = param.y;
		orgZ = param.z;
		param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
		bool flag8 = blockDir == 1 || _lowblock || flag7;
		bool flag9 = blockDir == 0 || _lowblock || flag7;
		if (!showFullWall && currentRoom != null)
		if (this.cell.autotileDeco != 0)
		{
			if (!flag8)
			{
				if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
				{
					if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
					{
						flag8 = true;
					}
				}
				else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
				{
					flag8 = true;
				}
			}
			if (!flag9)
			{
				if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
				{
					if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
					{
						flag9 = true;
					}
				}
				else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
				{
					flag9 = true;
				}
			}
			param.tile = (26 + sourceDeco.autotile / 2) * 32 + sourceDeco.autotile % 2 * 16 + this.cell.autotileDeco;
			sourceDeco.renderData.Draw(param);
			param.z = orgZ;
		}
		if (blockDir == 0 || blockDir == 2)
	} 
	else
	{
		param.tile = sourceDeco._tiles[floorDir % sourceDeco._tiles.Length];
		sourceDeco.renderData.Draw(param);
	}
}
if (!buildMode && this.cell.highlight != 0)
{
	if (this.cell._block != 0 && !this.cell.hasDoor)
	{
		screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
	}
	else
	{
		passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
	}
}
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
{
	snowed = false;
}
num25 = 0;
if (sourceBlock.id != 0)
{
	this.tileType = sourceBlock.tileType;
	roomHeight = 0f;
	int blockDir = this.cell.blockDir;
	bool num39 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
	bool flag9 = false;
	if (!num39)
	{
		switch (wallClipMode)
		{
			param.dir = 0;
			Room room2 = this.cell.Front.room ?? this.cell.room;
			if (room2 != null && this.tileType.IsWall)
			{
				if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
				{
					param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room2.lot.idDeco);
					param.matColor = room2.lot.colDeco;
					param.y += (float)room2.lot.decoFix * 0.01f;
					rendererWallDeco.Draw(param);
					param.y = orgY;
				}
				if (room2.lot.idDeco2 != 0 && roomHeight != 0f && !flag8 && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
				{
					param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room2.lot.idDeco2);
					param.matColor = room2.lot.colDeco2;
					param.y += (float)room2.lot.decoFix2 * 0.01f;
					param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
					rendererWallDeco.Draw(param);
					param.y = orgY;
					param.z = orgZ;
				}
			}
			Cell left = this.cell.Left;
			if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
		case WallClipMode.ByRoom:
			if (!this.tileType.RepeatBlock)
			{
				_sourceBlock = left.sourceBlock;
				param.mat = left.matBlock;
				break;
			}
			else
			if (currentRoom == null || showFullWall)
			{
				_sourceBlock = sourceBlock;
				param.mat = matBlock;
				this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
				_lowblock = lowBlock;
			}
			this.tileType = _sourceBlock.tileType;
			param.tile = (tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock) ? 32 : 0));
			if (_sourceBlock.useAltColor)
			else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
			{
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
				this.room = this.cell.Front.room;
				_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
			}
			else
			else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
			{
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
				this.room = this.cell.Right.room;
				_lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
			}
			if (roomHeight == 0f || flag8 || !this.tileType.RepeatBlock)
			else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
			{
				if (!this.cell.hasDoor)
				{
					_sourceBlock.renderData.Draw(param);
				}
				this.room = this.cell.FrontRight.room;
				_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
			}
			else
			{
				_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
			}
			param.z += cornerWallFix2.z;
			if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
			{
				if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
				{
					param.snow = true;
				}
				param.tile = _sourceBlock._tiles[0] + ((flag8 && flag9 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				if (roomHeight == 0f || !this.tileType.RepeatBlock || (flag8 && flag9 && !flag7))
				{
					_sourceBlock.renderData.Draw(param);
				}
				else
				this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
				_lowblock = true;
				if (!this.tileType.IsFullBlock)
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
					if (this.cell.lotWall)
					{
						_lowblock = false;
					}
					else if (this.room == currentRoom)
					{
						_lowblock = !this.cell.fullWall;
					}
				}
			}
			if (!flag8 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
			flag9 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
			if (flag9)
			{
				orgX = param.x;
				param.tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				param.x += cornerWallFix3.x;
				param.y += cornerWallFix3.y;
				param.z += cornerWallFix3.z;
				if (!flag7 && (roomHeight == 0f || flag8))
				{
					_sourceBlock.renderData.Draw(param);
				}
				else
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
				}
				param.x = orgX;
				_lowblock = false;
			}
			else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag8 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar && !this.cell.Left.isToggleWallPillar)
			if (this.room == null && alwaysLowblock)
			{
				orgX = param.x;
				param.tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				param.x += cornerWallFix.x;
				param.y += cornerWallFix.y;
				param.z += cornerWallFix.z;
				if (!flag7 && (roomHeight == 0f || flag8))
				{
					_sourceBlock.renderData.Draw(param);
				}
				else
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
				}
				param.x = orgX;
				_lowblock = true;
				roomHeight = 0f;
			}
		}
		if (blockDir == 1 || blockDir == 2)
		{
			param.y = orgY;
			param.z = orgZ;
			param.dir = 1;
			Room room3 = this.cell.Right.room ?? this.cell.room;
			if (room3 != null && this.tileType.IsWall)
			if (this.room != null)
			{
				if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
				maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
				if (showRoof)
				{
					param.tile = -EMono.sources.blocks[0].ConvertTile(1000 + room3.lot.idDeco);
					param.matColor = room3.lot.colDeco;
					param.y += (float)room3.lot.decoFix * 0.01f;
					rendererWallDeco.Draw(param);
					param.y = orgY;
					roomHeight = this.room.lot.realHeight;
					break;
				}
				if (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag9 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
				if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
				{
					param.tile = -EMono.sources.blocks[0].ConvertTile(1000 + room3.lot.idDeco2);
					param.matColor = room3.lot.colDeco2;
					param.y += (float)room3.lot.decoFix2 * 0.01f;
					param.z += (float)room3.lot.decoFix2 * 0.01f * heightModDeco;
					rendererWallDeco.Draw(param);
					param.y = orgY;
					param.z = orgZ;
					roomHeight = 0f;
					break;
				}
				int num40 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
				roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num40) ? this.room.lot.height : num40) + 0.01f * (float)this.room.lot.heightFix;
			}
			if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
			break;
		case WallClipMode.ByLot:
			if (defaultBlockHeight > 0f || isIndoor)
			{
				Room room4 = this.cell.Right.room;
				maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room4.lot.mh * _heightMod.y;
				if (showRoof)
				_lowblock = cx != 0 && cz != Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock);
				if (!_lowblock)
				{
					roomHeight = room4.lot.realHeight;
					roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
					maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
				}
				else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
				break;
			}
			if (showFullWall)
			{
				_lowblock = this.room != null;
				if (_lowblock)
				{
					roomHeight = 0f;
					if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
					{
						_lowblock = false;
					}
				}
				else
				else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
				{
					int num22 = ((room4.data.maxHeight == 0) ? 2 : room4.data.maxHeight);
					roomHeight = EMono.setting.render.roomHeightMod * (float)((room4.lot.height < num22) ? room4.lot.height : num22) + 0.01f * (float)room4.lot.heightFix;
					_lowblock = true;
				}
			}
			Cell back2 = this.cell.Back;
			if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
			{
				_sourceBlock = back2.sourceBlock;
				param.mat = back2.matBlock;
			}
			else
			{
				_sourceBlock = sourceBlock;
				param.mat = matBlock;
				_lowblock = lowBlock;
			}
			this.tileType = _sourceBlock.tileType;
			param.tile = (tile = -_sourceBlock._tiles[0] + ((flag9 && this.tileType.UseLowBlock) ? (-32) : 0));
			if (_sourceBlock.useAltColor)
			if (this.tileType.RepeatBlock)
			{
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
				this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
				if (this.room != null && (!noRoofMode || currentRoom != null) && (!showFullWall || currentRoom == null || this.room.lot == currentRoom.lot))
				{
					roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
					maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
				}
			}
			else
			break;
		}
	}
	if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
	{
		num25 = 1;
	}
	else if (lowBlock)
	{
		num25 = 2;
	}
	param.mat = matBlock;
	param.dir = this.cell.blockDir;
	param.snow = snowed;
	switch (this.tileType.blockRenderMode)
	{
	case BlockRenderMode.FullBlock:
	{
		bool invisible = sourceBlock.tileType.Invisible;
		if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
		{
			break;
		}
		if (this.cell.isSurrounded)
		{
			switch (innerMode)
			{
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
			case InnerMode.InnerBlock:
			case InnerMode.BuildMode:
				blockLight = _baseBrightness + fogBrightness;
				param.color = (int)(50f * blockLight) * 262144;
				param.matColor = 104025f;
				param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
				rendererInnerBlock.Draw(param);
				return;
			case InnerMode.None:
			case InnerMode.Height:
				param.color = blockLight;
				break;
			}
			param.color += _rightWallShade;
			if (roomHeight == 0f || flag9 || !this.tileType.RepeatBlock)
		} 
		if (snowed)
		{
			param.color = floorLight;
		}
		param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
		if (currentRoom != null && !showFullWall)
		{
			_lowblock = true;
			roomHeight = 0f;
			if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
			{
				if (!this.cell.hasDoor)
				{
					_sourceBlock.renderData.Draw(param);
				}
				_lowblock = false;
			}
			else
			if (!_lowblock)
			{
				_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
				int num42 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
				roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num42) ? currentRoom.lot.height : num42) + 0.01f * (float)currentRoom.lot.heightFix;
			}
			if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
		} 
		if (flag9)
		{
			_lowblock = (!this.cell.Front.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Front.HasFullBlock || !this.cell.Left.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Left.HasFullBlock);
			if (_lowblock)
			{
				if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
				{
					param.snow = true;
				}
				orgX = param.x;
				param.tile = _sourceBlock._tiles[0] + ((flag9 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				if (!flag7 && (roomHeight == 0f || !this.tileType.RepeatBlock || flag9))
				{
					_sourceBlock.renderData.Draw(param);
				}
				else
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
				}
				param.x = orgX;
				roomHeight = 0f;
			}
		}
		param.y = orgY;
		param.z = orgZ;
		break;
	}
	case BlockRenderMode.HalfBlock:
		param.color = floorLight;
		_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks[matBlock.defBlock] : sourceBlock);
		param.tile = _sourceBlock._tiles[0];
		param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.colorMod));
		param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];
		param.halfBlockColor = ((_sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.sourceAutoFloor.colorMod));
		sourceBlock.renderData.Draw(param);
		break;
	case BlockRenderMode.Pillar:
	{
		RenderData renderData2 = sourceBlock.renderData;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		int num18 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
		if (num18 == 0)
		if (invisible)
		{
			renderData2.Draw(param);
			roomHeight = 0f;
			_lowblock = false;
		}
		else
		if (this.cell.Things.Count > 0)
		{
			renderData2.DrawRepeat(param, num18, sourceBlock.tileType.RepeatSize);
			_lowblock = false;
		}
		param.tile = renderData2.idShadow;
		SourcePref shadowPref2 = renderData2.shadowPref;
		int shadow3 = shadowPref2.shadow;
		passShadow.AddShadow(param.x + renderData2.offsetShadow.x, param.y + renderData2.offsetShadow.y, param.z + renderData2.offsetShadow.z, ShadowData.Instance.items[shadow3], shadowPref2, 0, param.snow);
		break;
	}
	case BlockRenderMode.Floor:
		param.color = floorLight;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		sourceBlock.renderData.Draw(param);
		break;
	default:
		param.color = floorLight;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowBlock) ? 3000000 : 0);
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + (_lowblock ? 3000000 : 0);
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		if (roomHeight == 0f)
		{
			sourceBlock.renderData.Draw(param);
			if (!this.cell.hasDoor)
			{
				sourceBlock.renderData.Draw(param);
			}
		}
		else
		{
			sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
		}
		break;
	}
}
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
{
	if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
	{
		goto IL_71b5;
	}
	if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
	{
		Room obj = this.cell.FrontRight.room;
		if (obj == null || !obj.HasRoof)
		{
			goto IL_71b5;
		}
	}
}
goto IL_7215;
IL_71b5:
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
	param.tile = num15;
	rendererFov.Draw(param);
}
goto IL_7215;
IL_7d7f:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
	return;
}
int num23 = 0;
thingPos.x = 0f;
thingPos.y = 0f;
thingPos.z = 0f;
freePos.x = (freePos.y = (freePos.z = 0f));
if (this.cell.HasRamp)
{
	Vector3 rampFix = sourceBlock.tileType.GetRampFix(this.cell.blockDir);
	param.x += rampFix.x;
	param.y += rampFix.y;
	param.z += rampFix.z;
	freePos.x += rampFix.x;
	freePos.y += rampFix.y;
	freePos.z += rampFix.z;
}
param.y += (flag ? 0f : ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight));
orgPos.x = (orgX = param.x);
orgPos.y = (orgY = param.y);
orgPos.z = (orgZ = param.z);
if (flag && liquidLv > 0)
{
	if (liquidLv > 10)
	{
		liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
	}
	liquidLv -= (int)(floatY * 0.5f);
	param.liquidLv = liquidLv;
	param.y -= TileType.FloorWaterShallow.FloorHeight;
}
Thing thing = null;
bool shadow4 = liquidLv == 0;
float num24 = 0f;
float num25 = 0f;
float num26 = 0f;
float num27 = 0f;
bool flag10 = false;
float num28 = 0f;
bool flag11 = false;
float num29 = 0f;
if (detail.things.Count > 0 && isSeen)
{
	_ = zSetting.max1;
	float num30 = 0f;
	for (int m = 0; m < detail.things.Count; m++)
	{
		Thing t = detail.things[m];
		if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction && !buildMode) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
		{
			continue;
			sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.traitDoor?.height ?? 0, this.cell.effect?.FireAmount ?? 0, isBlock: true);
		}
		TileType tileType = t.trait.tileType;
		bool isInstalled = t.IsInstalled;
		SourcePref pref = t.Pref;
		if (!isInstalled && t.category.tileDummy != 0)
		Room room2 = this.cell.Front.room ?? this.cell.room;
		if (room2 == null && this.cell.Right.room != null)
		{
			pref = rendererObjDummy.shadowPref;
			room2 = this.cell.Right.room;
		}
		float num31 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
		if (t.ignoreStackHeight)
		if (!invisible && room2 != null)
		{
			thingPos.y -= num24;
			thingPos -= altitudeFix * num25;
			if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
			{
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room2.lot.idDeco);
				param.matColor = room2.lot.colDeco;
				float y = param.y;
				param.y += (float)room2.lot.decoFix * 0.01f;
				rendererWallDeco.Draw(param);
				param.y = y;
			}
			if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
			{
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room2.lot.idDeco2);
				param.matColor = room2.lot.colDeco2;
				float y2 = param.y;
				float num43 = param.z;
				param.y += (float)room2.lot.decoFix2 * 0.01f;
				param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
				rendererWallDeco.Draw(param);
				param.y = y2;
				param.z = num43;
			}
		}
		shadow4 = thingPos.y < 0.16f && num29 < 0.16f && t.altitude >= 0;
		if (flag10 && t.altitude > 0)
		room2 = this.cell.Right.room ?? this.cell.room;
		if (room2 == null && this.cell.Front.room != null)
		{
			shadow4 = false;
			room2 = this.cell.Front.room;
		}
		_ = pref.bypassShadow;
		param.shadowFix = 0f - thingPos.y;
		param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);
		if (t.isRoofItem)
		if (!invisible && room2 != null)
		{
			param.snow = isSnowCovered && !this.cell.isClearSnow;
			SetRoofHeight(param, this.cell, cx, cz);
			_actorPos.x = param.x;
			_actorPos.y = param.y;
			_actorPos.z = param.z + num30;
			if (this.room != null)
			if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
			{
				param.color = GetRoofLight(this.room.lot);
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room2.lot.idDeco) * -1;
				param.matColor = room2.lot.colDeco;
				float y3 = param.y;
				param.y += (float)room2.lot.decoFix * 0.01f;
				rendererWallDeco.Draw(param);
				param.y = y3;
			}
			if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
			{
				param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room2.lot.idDeco2) * -1;
				param.matColor = room2.lot.colDeco2;
				float y4 = param.y;
				float num44 = param.z;
				param.y += (float)room2.lot.decoFix2 * 0.01f;
				param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
				rendererWallDeco.Draw(param);
				param.y = y4;
				param.z = num44;
			}
			shadow4 = false;
			param.liquidLv = 0;
		}
		else
		break;
	}
	case BlockRenderMode.WallOrFence:
	{
		if (map.config.fullWallHeight)
		{
			param.snow = snowed;
			_actorPos.x = orgX + num27;
			_actorPos.y = orgY;
			_actorPos.z = orgZ + num30 + thingPos.z;
			if (tileType.CanStack || !isInstalled)
			showFullWall = true;
			_lowblock = false;
		}
		orgY = param.y;
		orgZ = param.z;
		param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
		bool flag10 = blockDir == 1 || _lowblock || flag9;
		bool flag11 = blockDir == 0 || _lowblock || flag9;
		if (!showFullWall && currentRoom != null)
		{
			if (!flag10)
			{
				if (thing?.id != t.id)
				{
					_actorPos.x += thingPos.x;
				}
				_actorPos.y += thingPos.y;
				if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
				if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
				{
					thingPos.y -= num24;
					if (thing != null)
					if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
					{
						_actorPos.z -= 0.2f;
						thingPos.z -= 0.2f;
						flag10 = true;
					}
					_actorPos.y -= num24;
				}
				_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y;
				else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
				{
					flag10 = true;
				}
			}
			if (isInstalled)
			if (!flag11)
			{
				if (t.TileType.IsRamp)
				if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
				{
					Vector3 rampFix2 = t.TileType.GetRampFix(t.dir, pref);
					orgX += rampFix2.x;
					orgY += rampFix2.y;
					orgZ += rampFix2.z;
					freePos.x += rampFix2.x;
					freePos.y += rampFix2.y;
					freePos.z += rampFix2.z;
					if (!this.cell.IsTopWater || t.altitude > 0)
					{
						num29 += rampFix2.y;
					}
					liquidLv -= (int)(rampFix2.y * 150f);
					if (liquidLv < 0)
					if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
					{
						liquidLv = 0;
						flag11 = true;
					}
				}
				else if (!flag11 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
				else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
				{
					orgY += num31 + (float)t.altitude * altitudeFix.y;
					orgZ += (float)t.altitude * altitudeFix.z;
					freePos.y += num31 + (float)t.altitude * altitudeFix.y;
					if (!this.cell.IsTopWater || t.altitude > 0)
					{
						num29 += num31 + (float)t.altitude * altitudeFix.y;
					}
					_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
					_actorPos.z += pref.z;
					thingPos.z += pref.z;
					liquidLv -= (int)(num31 * 150f);
					if (liquidLv < 0)
					{
						liquidLv = 0;
					}
					flag11 = true;
				}
				else
			} 
		}
		if (blockDir == 0 || blockDir == 2)
		{
			param.dir = 0;
			Room room3 = this.cell.Front.room ?? this.cell.room;
			if (room3 != null && this.tileType.IsWall)
			{
				if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
				{
					thingPos.y += num31;
					if (tileType.UseMountHeight)
					{
						if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow && !this.cell.toggleOcclusion)
						{
							if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
							{
								continue;
							}
							if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
							{
								Room room5 = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
								if (t.trait.AlwaysHideOnLowWall)
								{
									if (room5 == null || !room5.data.showWallItem)
									{
										continue;
									}
								}
								else if (t.altitude >= lowWallObjAltitude)
								{
									continue;
								}
							}
						}
						if (tileType.UseHangZFix)
						{
							flag10 = true;
						}
						tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
						shadow4 = false;
						param.liquidLv = 0;
						if (t.freePos)
						{
							_actorPos.x += t.fx;
							_actorPos.y += t.fy;
						}
					}
					else
					{
						if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow && !this.cell.toggleOcclusion && noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
						{
							continue;
						}
						thingPos.y += (float)t.altitude * altitudeFix.y;
						thingPos.z += (float)t.altitude * altitudeFix.z;
					}
					_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
					_actorPos.z += pref.z;
					if (pref.height >= 0f)
					{
						thingPos.z += pref.z;
					}
					param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room3.lot.idDeco);
					param.matColor = room3.lot.colDeco;
					param.y += (float)room3.lot.decoFix * 0.01f;
					rendererWallDeco.Draw(param);
					param.y = orgY;
				}
				if (!tileType.UseMountHeight && m > 10)
				if (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag10 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
				{
					flag11 = true;
					param.tile = EMono.sources.blocks[0].ConvertTile(1000 + room3.lot.idDeco2);
					param.matColor = room3.lot.colDeco2;
					param.y += (float)room3.lot.decoFix2 * 0.01f;
					param.z += (float)room3.lot.decoFix2 * 0.01f * heightModDeco;
					rendererWallDeco.Draw(param);
					param.y = orgY;
					param.z = orgZ;
				}
			}
			Cell left = this.cell.Left;
			if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
			{
				_sourceBlock = left.sourceBlock;
				param.mat = left.matBlock;
			}
			else
			{
				thingPos.y += num31;
				_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
				_actorPos.z += pref.z;
				thingPos.z += pref.z;
				_sourceBlock = sourceBlock;
				param.mat = matBlock;
			}
			if (t.isFloating && isWater && !hasBridge && !flag)
			this.tileType = _sourceBlock.tileType;
			param.tile = (tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock) ? 32 : 0));
			if (_sourceBlock.useAltColor)
			{
				flag = true;
				float num32 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
				orgY += 0.01f * floatY - num32;
				if (!t.trait.IsChangeFloorHeight)
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
			}
			else
			{
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
			}
			if (roomHeight == 0f || flag10 || !this.tileType.RepeatBlock)
			{
				if (!this.cell.hasDoor)
				{
					num28 = num31;
					_sourceBlock.renderData.Draw(param);
				}
				_actorPos.y += 0.01f * floatY - num32;
				if (liquidLv > 10)
			} 
			else
			{
				_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.traitDoor?.height ?? 0, this.cell.effect?.FireAmount ?? 0);
			}
			param.z += cornerWallFix2.z;
			if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
			{
				if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
				{
					liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
					param.snow = true;
				}
				param.tile = _sourceBlock._tiles[0] + ((flag10 && flag11 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				if (roomHeight == 0f || !this.tileType.RepeatBlock || (flag10 && flag11 && !flag9))
				{
					_sourceBlock.renderData.Draw(param);
				}
				else
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
				}
			}
			if (!flag10 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
			{
				orgX = param.x;
				param.tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				param.x += cornerWallFix3.x;
				param.y += cornerWallFix3.y;
				param.z += cornerWallFix3.z;
				if (!flag9 && (roomHeight == 0f || flag10))
				{
					_sourceBlock.renderData.Draw(param);
				}
				else
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
				}
				param.x = orgX;
			}
			else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag10 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar && !this.cell.Left.isToggleWallPillar)
			{
				orgX = param.x;
				param.tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				param.x += cornerWallFix.x;
				param.y += cornerWallFix.y;
				param.z += cornerWallFix.z;
				if (!flag9 && (roomHeight == 0f || flag10))
				{
					_sourceBlock.renderData.Draw(param);
				}
				else
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
				}
				param.x = orgX;
			}
		}
		if (blockDir == 1 || blockDir == 2)
		{
			param.y = orgY;
			param.z = orgZ;
			param.dir = 1;
			Room room4 = this.cell.Right.room ?? this.cell.room;
			if (room4 != null && this.tileType.IsWall)
			{
				if (room4.lot.idDeco != 0 && !this.cell.hasDoor)
				{
					param.tile = -EMono.sources.blocks[0].ConvertTile(1000 + room4.lot.idDeco);
					param.matColor = room4.lot.colDeco;
					param.y += (float)room4.lot.decoFix * 0.01f;
					rendererWallDeco.Draw(param);
					param.y = orgY;
				}
				if (room4.lot.idDeco2 != 0 && roomHeight != 0f && !flag11 && (float)room4.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
				{
					param.tile = -EMono.sources.blocks[0].ConvertTile(1000 + room4.lot.idDeco2);
					param.matColor = room4.lot.colDeco2;
					param.y += (float)room4.lot.decoFix2 * 0.01f;
					param.z += (float)room4.lot.decoFix2 * 0.01f * heightModDeco;
					rendererWallDeco.Draw(param);
					param.y = orgY;
					param.z = orgZ;
				}
			}
			if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
			{
				Room room5 = this.cell.Right.room;
				maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room5.lot.mh * _heightMod.y;
				if (showRoof)
				{
					roomHeight = room5.lot.realHeight;
				}
				else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
				{
					roomHeight = 0f;
				}
				liquidLv -= (int)(floatY * 0.5f);
				if (liquidLv < 0)
				else
				{
					liquidLv = 0;
					int num45 = ((room5.data.maxHeight == 0) ? 2 : room5.data.maxHeight);
					roomHeight = EMono.setting.render.roomHeightMod * (float)((room5.lot.height < num45) ? room5.lot.height : num45) + 0.01f * (float)room5.lot.heightFix;
				}
				param.liquidLv = liquidLv;
			}
			num24 = num31;
			if (t.sourceCard.multisize && !t.trait.IsGround)
			Cell back2 = this.cell.Back;
			if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
			{
				num30 += zSetting.multiZ;
				_sourceBlock = back2.sourceBlock;
				param.mat = back2.matBlock;
			}
			orgZ += t.renderer.data.stackZ;
			if (param.liquidLv > 0)
			else
			{
				param.liquidLv += pref.liquidMod;
				if (param.liquidLv < 1)
				{
					param.liquidLv = 1;
				}
				else if (param.liquidLv > 99 + pref.liquidModMax)
				{
					param.liquidLv = 99 + pref.liquidModMax;
				}
				_sourceBlock = sourceBlock;
				param.mat = matBlock;
			}
		}
		if (!isInstalled || !tileType.UseMountHeight)
		{
			if (t.altitude != 0)
			this.tileType = _sourceBlock.tileType;
			param.tile = (tile = -_sourceBlock._tiles[0] + ((flag11 && this.tileType.UseLowBlock) ? (-32) : 0));
			if (_sourceBlock.useAltColor)
			{
				_actorPos += altitudeFix * t.altitude;
				if (!t.isRoofItem)
				{
					num26 += (float)t.altitude;
					num25 = t.altitude;
				}
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
			}
			if (num26 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
			else
			{
				continue;
				param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
			}
			if (t.freePos)
			param.color += _rightWallShade;
			if (roomHeight == 0f || flag11 || !this.tileType.RepeatBlock)
			{
				if (t.isRoofItem)
				{
					_actorPos.x += t.fx;
					_actorPos.y += t.fy - (float)t.altitude * altitudeFix.y;
				}
				else
				if (!this.cell.hasDoor)
				{
					_actorPos.x = orgX + t.fx - freePos.x;
					_actorPos.y = orgY + t.fy - freePos.y;
					_sourceBlock.renderData.Draw(param);
				}
			}
			if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
			else
			{
				_actorPos.z += -0.5f;
				_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.traitDoor?.height ?? 0, this.cell.effect?.FireAmount ?? 0);
			}
		}
		if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
		{
			if (iconMode != CardIconMode.None)
			if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
			{
				int num33 = 0;
				switch (iconMode)
				if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
				{
				case CardIconMode.Visibility:
					if (t.isMasked)
					{
						num33 = 17;
					}
					break;
				case CardIconMode.State:
					if (t.placeState == PlaceState.installed)
					{
						num33 = 18;
					}
					break;
				case CardIconMode.Deconstruct:
					if (t.isDeconstructing)
					{
						num33 = 14;
					}
					break;
					param.snow = true;
				}
				if (t.isNPCProperty && !EMono.debug.godBuild)
				orgX = param.x;
				param.tile = _sourceBlock._tiles[0] + ((flag11 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
				if (!flag9 && (roomHeight == 0f || !this.tileType.RepeatBlock || flag11))
				{
					num33 = 13;
					_sourceBlock.renderData.Draw(param);
				}
				if (num33 != 0)
				else
				{
					passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num33);
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
				}
				param.x = orgX;
			}
			t.SetRenderParam(param);
			if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
			{
				param.tile += ((param.tile < 0f) ? (-64) : 64);
			}
			if (t.trait is TraitTrolley && EMono.pc.ai is AI_Trolley aI_Trolley && aI_Trolley.trolley.owner == t)
			{
				RenderParam _param = new RenderParam(param);
				EMono.core.actionsLateUpdate.Add(delegate
				{
					t.SetRenderParam(_param);
					_actorPos.x = EMono.pc.renderer.position.x;
					_actorPos.y = EMono.pc.renderer.position.y - pref.height;
					_actorPos.z = EMono.pc.renderer.position.z + 0.02f;
					t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow4 || tileType.AlwaysShowShadow));
				});
			}
			else
			{
				t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow4 || tileType.AlwaysShowShadow));
			}
		}
		if (isInstalled)
		{
			num27 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
		}
		param.x = orgX;
		param.y = orgY;
		param.z = orgZ;
		break;
	}
	case BlockRenderMode.HalfBlock:
		param.color = floorLight;
		thing = t;
		if (pref.Float)
		_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks[matBlock.defBlock] : sourceBlock);
		param.tile = _sourceBlock._tiles[0];
		param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.colorMod));
		param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];
		param.halfBlockColor = ((_sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.sourceAutoFloor.colorMod));
		sourceBlock.renderData.Draw(param);
		break;
	case BlockRenderMode.Pillar:
	{
		RenderData renderData2 = sourceBlock.renderData;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		int num41 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
		if (num41 == 0)
		{
			liquidLv = 0;
			renderData2.Draw(param);
		}
		else
		{
			renderData2.DrawRepeat(param, num41, sourceBlock.tileType.RepeatSize);
		}
		param.tile = renderData2.idShadow;
		SourcePref shadowPref2 = renderData2.shadowPref;
		int shadow4 = shadowPref2.shadow;
		passShadow.AddShadow(param.x + renderData2.offsetShadow.x, param.y + renderData2.offsetShadow.y, param.z + renderData2.offsetShadow.z, ShadowData.Instance.items[shadow4], shadowPref2, 0, param.snow);
		break;
	}
}
orgY += num28;
if (detail.charas.Count <= 0)
{
	return;
}
param.shadowFix = 0f - num29;
param.color += 1310720f;
float max = zSetting.max2;
for (int num34 = 0; num34 < detail.charas.Count; num34++)
{
	Chara chara = detail.charas[num34];
	if (chara.host != null)
	{
		continue;
	}
	if (chara != EMono.pc && chara != LayerDrama.alwaysVisible)
	{
		if (chara.mimicry != null && chara.mimicry.IsThing)
	case BlockRenderMode.Floor:
		param.color = floorLight;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		sourceBlock.renderData.Draw(param);
		break;
	default:
		param.color = floorLight;
		param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowBlock) ? 3000000 : 0);
		param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
		if (roomHeight == 0f)
		{
			if (flag3 || fogged || !this.cell.isSeen)
			{
				continue;
			}
			sourceBlock.renderData.Draw(param);
		}
		else if (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))
		else
		{
			continue;
			sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
		}
		break;
	}
	_actorPos.x = orgX;
	_actorPos.y = orgY;
	_actorPos.z = orgZ;
	if (this.cell.IsBlocked && chara.IsAstralBody)
	{
		_actorPos.z += EMono.setting.render.astralBodyFixZ;
	}
	chara.SetRenderParam(param);
	_ = chara.IsAliveInCurrentZone;
	if (chara.isRestrained)
} 
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
{
	if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
	{
		TraitShackle restrainer = chara.GetRestrainer();
		if (restrainer != null)
		{
			Vector3 getRestrainPos = restrainer.GetRestrainPos;
			if (getRestrainPos != default(Vector3))
			{
				Vector3 position = restrainer.owner.renderer.position;
				float defCharaHeight = EMono.setting.render.defCharaHeight;
				float num35 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height);
				_actorPos.x = position.x + getRestrainPos.x * (float)((restrainer.owner.dir % 2 == 0) ? 1 : (-1));
				_actorPos.y = position.y + num35;
				_actorPos.z = position.z + getRestrainPos.z;
				param.liquidLv = 0;
				param.shadowFix = orgY - _actorPos.y;
				chara.renderer.SetFirst(first: true);
				chara.renderer.Draw(param, ref _actorPos, drawShadow: true);
				param.shadowFix = 0f;
				continue;
			}
		}
		goto IL_71d9;
	}
	if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
	if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
	{
		if (chara.IsDeadOrSleeping && chara.IsPCC)
		{
			float num36 = chara.renderer.data.size.y * 0.3f;
			if (thingPos.y > max)
			{
				thingPos.y = max;
			}
			float num37 = thingPos.y + num36;
			float num38 = (float)num34 * -0.01f;
			if (num37 > zSetting.thresh1)
			{
				num38 = zSetting.mod1;
			}
			_actorPos.x += thingPos.x;
			_actorPos.y += thingPos.y;
			_actorPos.z += renderSetting.laydownZ + num38;
			param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
			thingPos.y += num36 * 0.8f;
			chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
		}
		else
		Room obj = this.cell.FrontRight.room;
		if (obj == null || !obj.HasRoof)
		{
			param.liquidLv = liquidLv;
			if (isUnderwater)
			{
				if (chara.Pref.FloatUnderwater)
				{
					float num39 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
					float num40 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
					orgY += 0.01f * num40 - num39;
					_actorPos.y += 0.01f * num40 - num39;
					param.shadowFix -= 0.01f * num40 - num39;
				}
			}
			else if (liquidLv > 0)
			{
				if (chara.Pref.Float && !flag && !hasBridge)
				{
					if (liquidLv > 20)
					{
						float num41 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
						orgY += 0.01f * floatY - num41;
						_actorPos.y += 0.01f * floatY - num41;
						int num42 = TileType.FloorWaterShallow.LiquidLV * 10;
						num42 -= (int)(floatY * 0.5f);
						param.liquidLv = num42;
					}
					else
					{
						param.liquidLv -= 20;
					}
				}
				param.liquidLv += chara.Pref.liquidMod;
				if (param.liquidLv < 1)
				{
					param.liquidLv = 1;
				}
				else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
				{
					param.liquidLv = 99 + chara.Pref.liquidModMax;
				}
			}
			if (!chara.IsPC && EMono.pc.host != chara && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC))
			{
				_actorPos += renderSetting.charaPos[1 + ((num23 < 4) ? num23 : 3)];
			}
			_actorPos.z += 0.01f * (float)num34 + renderSetting.charaZ;
			num23++;
			if (flag10)
			{
				_actorPos.z += chara.renderer.data.hangedFixZ;
			}
			chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
			goto IL_71d9;
		}
	}
	param.x = orgX;
	param.y = orgY;
	param.z = orgZ;
}
goto IL_7239;
void Draw(int tile)
{
	pass = passEdge;

Card โ€‹

public void RenderMarker(Point point, bool active, HitResult result, bool main,โ€ฆ)

cs
	{
		renderer.actor.RefreshSprite();
	}
	renderer.sync = -1L;
	renderer.Draw(renderParam, ref v, drawShadow: false);
}

CardRenderer โ€‹

public override void Draw(RenderParam p, ref Vector3 v, bool drawShadow)

cs
if (skip)
{
	skip = false;
	return;
}
sync = RenderObject.syncFrame;
RenderObject.currentParam = p;
p.dir = owner.dir;
if (!isSynced)
{
	OnEnterScreen();
	RenderObject.syncList.Add(this);
}
if (isChara && owner.parent == EClass.game.activeZone)
else
{
	if (owner.Chara.bossText && !EClass.ui.IsActive && !SplashText.Instance && !LayerDrama.Instance)
	if (sync == RenderObject.syncFrame)
	{
		ShowBossText();
		return;
	}
	if (owner.Chara.host == null)
	sync = RenderObject.syncFrame;
	RenderObject.currentParam = p;
	p.dir = owner.dir;
	if (!isSynced)
	{
		UpdatePosition(ref v, p);
		OnEnterScreen();
		RenderObject.syncList.Add(this);
	}
	if (owner.Chara.ai is AI_Trolley { IsRunning: not false } aI_Trolley)
	if (isChara && owner.parent == EClass.game.activeZone)
	{
		drawShadow = false;
		if (aI_Trolley.trolley.HideChara)
		if (owner.Chara.bossText && !EClass.ui.IsActive && !SplashText.Instance && !LayerDrama.Instance)
		{
			if (hasActor)
			{
				actor.SetActive(enable: false);
			}
			if ((bool)orbit)
			ShowBossText();
		}
		if (owner.Chara.host == null)
		{
			UpdatePosition(ref v, p);
		}
		if (owner.Chara.ai is AI_Trolley { IsRunning: not false } aI_Trolley)
		{
			drawShadow = false;
			if (aI_Trolley.trolley.HideChara)
			{
				orbit.Refresh();
				if (hasActor)
				{
					actor.SetActive(enable: false);
				}
				if ((bool)orbit)
				{
					orbit.Refresh();
				}
				return;
			}
			return;
		}
		if (hasActor)
		{
			actor.SetActive(enable: true);
		}
	}
	if (hasActor)
	else
	{
		actor.SetActive(enable: true);
		p.x = (position.x = v.x);
		p.y = (position.y = v.y);
		p.z = (position.z = v.z);
	}
}
else
{
	p.x = (position.x = v.x);
	p.y = (position.y = v.y);
	p.z = (position.z = v.z);
}
if ((bool)orbit)
{
	orbit.Refresh();
}
else
{
	TrySpawnOrbit();
}
if (anime != null)
{
	anime.Update();
}
if (owner.trait is TraitFakeObj)
{
	TraitFakeObj traitFakeObj = owner.trait as TraitFakeObj;
	if (traitFakeObj.growth != null)
	if ((bool)orbit)
	{
		traitFakeObj.growth?.OnRenderTileMap(p, owner.IsInstalled && owner.altitude == 0 && owner.pos.FirstThing == owner);
		return;
		orbit.Refresh();
	}
}
if (!isChara && !owner.IsInstalled && owner.category.tileDummy != 0 && !owner.isRoofItem && owner.ExistsOnMap && owner.trait.UseDummyTile)
{
	SubPassData.Current = SubPassData.Default;
	RenderDataObjDummy rendererObjDummy = EClass.scene.screenElin.tileMap.rendererObjDummy;
	p.tile = rendererObjDummy.tile;
	p.dir = 0;
	if (hasActor)
	else
	{
		actor.SetActive(enable: false);
		TrySpawnOrbit();
	}
	rendererObjDummy.Draw(p);
	if (drawShadow && !owner.pos.cell.ignoreObjShadow)
	if (anime != null)
	{
		EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + rendererObjDummy.offsetShadow.x, position.y + rendererObjDummy.offsetShadow.y + p.shadowFix, position.z + rendererObjDummy.offsetShadow.z, ShadowData.Instance.items[rendererObjDummy.shadowPref.shadow], rendererObjDummy.shadowPref, 0, p.snow);
		anime.Update();
	}
}
else
{
	SubPassData.Current = owner.GetSubPassData();
	SourcePref pref = GetPref();
	RenderData renderData = data;
	int prefIndex = owner.PrefIndex;
	if (Player.seedHallucination != 0 && CanBeHallucinated())
	if (owner.trait is TraitFakeObj)
	{
		Rand.SetSeed(Player.seedHallucination + owner.uid);
		CardRow cardRow = null;
		bool flag = false;
		for (int i = 0; i < 20; i++)
		TraitFakeObj traitFakeObj = owner.trait as TraitFakeObj;
		if (traitFakeObj.growth != null)
		{
			if (owner.isChara)
			{
				cardRow = EClass.sources.charas.rows.RandomItem();
				if (cardRow.multisize)
				{
					continue;
				}
			}
			else
			{
				cardRow = EClass.sources.things.rows.RandomItem();
				if (cardRow.tileType != owner.TileType)
				{
					continue;
				}
			}
			if (cardRow.chance != 0 && cardRow._tiles.Length != 0 && cardRow.idActor.IsEmpty() && cardRow.idExtra.IsEmpty() && SubPassData.Current == SubPassData.Default && !(cardRow._idRenderData != owner.sourceCard._idRenderData))
			{
				flag = true;
				break;
			}
			traitFakeObj.growth?.OnRenderTileMap(p, owner.IsInstalled && owner.altitude == 0 && owner.pos.FirstThing == owner);
			return;
		}
	}
	if (!isChara && !owner.IsInstalled && owner.category.tileDummy != 0 && !owner.isRoofItem && owner.ExistsOnMap && owner.trait.UseDummyTile)
	{
		SubPassData.Current = SubPassData.Default;
		RenderDataObjDummy rendererObjDummy = EClass.scene.screenElin.tileMap.rendererObjDummy;
		p.tile = rendererObjDummy.tile;
		p.dir = 0;
		if (hasActor)
		{
			actor.SetActive(enable: false);
		}
		if (flag)
		rendererObjDummy.Draw(p);
		if (drawShadow && !owner.pos.cell.ignoreObjShadow)
		{
			renderData = cardRow.renderData;
			pref = cardRow.pref;
			cardRow.model.dir = owner.dir;
			cardRow.model.SetRenderParam(p);
			prefIndex = cardRow.model.PrefIndex;
			EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + rendererObjDummy.offsetShadow.x, position.y + rendererObjDummy.offsetShadow.y + p.shadowFix, position.z + rendererObjDummy.offsetShadow.z, ShadowData.Instance.items[rendererObjDummy.shadowPref.shadow], rendererObjDummy.shadowPref, 0, p.snow);
		}
		Rand.SetSeed();
	}
	if (owner.trait is TraitFigure)
	else
	{
		if (!owner.c_idRefCard.IsEmpty() && (owner.IsInstalled || (EClass.pc.held != owner && !owner.ExistsOnMap) || owner.isRoofItem))
		SubPassData.Current = owner.GetSubPassData();
		SourcePref pref = GetPref();
		RenderData renderData = data;
		int prefIndex = owner.PrefIndex;
		if (Player.seedHallucination != 0 && CanBeHallucinated())
		{
			TraitFigure traitFigure = owner.trait as TraitFigure;
			SourceChara.Row row = EClass.sources.charas.map.TryGetValue(owner.c_idRefCard) ?? EClass.sources.charas.map["putty"];
			renderData = row.renderData;
			pref = row.pref;
			int matColor = traitFigure.GetMatColor();
			drawShadow = traitFigure.ShowShadow;
			if (row._tiles.Length == 0 || data.pass == null)
			Rand.SetSeed(Player.seedHallucination + owner.uid);
			CardRow cardRow = null;
			bool flag = false;
			for (int i = 0; i < 20; i++)
			{
				if (traitFigure.extraRenderer == null)
				if (owner.isChara)
				{
					traitFigure.extraRenderer = new CharaRenderer();
					traitFigure.extraRenderer.SetOwner(CharaGen.Create(row.id));
					cardRow = EClass.sources.charas.rows.RandomItem();
					if (cardRow.multisize)
					{
						continue;
					}
				}
				if (matColor >= -3)
				else
				{
					if (matColor == -3)
					cardRow = EClass.sources.things.rows.RandomItem();
					if (cardRow.tileType != owner.TileType)
					{
						MatColors matColors = EClass.core.Colors.matColors["ether"];
						p.matColor = BaseTileMap.GetColorInt(ref matColors.main, 100) * -1;
						continue;
					}
				}
				else
				if (cardRow.chance != 0 && cardRow._tiles.Length != 0 && cardRow.idActor.IsEmpty() && cardRow.idExtra.IsEmpty() && SubPassData.Current == SubPassData.Default && !(cardRow._idRenderData != owner.sourceCard._idRenderData))
				{
					p.matColor = matColor;
					flag = true;
					break;
				}
				traitFigure.extraRenderer.Draw(p, ref v, drawShadow);
				return;
			}
			if (EClass.core.config.game.antiSpider && row.skinAntiSpider != 0)
			if (flag)
			{
				owner.refVal = row.skinAntiSpider;
				renderData = cardRow.renderData;
				pref = cardRow.pref;
				cardRow.model.dir = owner.dir;
				cardRow.model.SetRenderParam(p);
				prefIndex = cardRow.model.PrefIndex;
			}
			p.tile = row._tiles[owner.refVal % row._tiles.Length] * ((owner.dir % 2 == 0) ? 1 : (-1));
			p.matColor = matColor;
			pref = row.pref;
			p.x += pref.x * (float)((owner.dir % 2 == 0) ? 1 : (-1));
			p.z += pref.z;
			switch (row.id)
			Rand.SetSeed(); 
		}
		if (owner.trait is TraitFigure)
		{
			if (!owner.c_idRefCard.IsEmpty() && (owner.IsInstalled || (EClass.pc.held != owner && !owner.ExistsOnMap) || owner.isRoofItem))
			{
			case "bike_kane":
			case "bike_kane_custom":
			case "bike_leet":
				p.z -= 0.1f;
				break;
			default:
				p.y += pref.y;
				break;
				TraitFigure traitFigure = owner.trait as TraitFigure;
				SourceChara.Row row = EClass.sources.charas.map.TryGetValue(owner.c_idRefCard) ?? EClass.sources.charas.map["putty"];
				renderData = row.renderData;
				pref = row.pref;
				int matColor = traitFigure.GetMatColor();
				drawShadow = traitFigure.ShowShadow;
				if (row._tiles.Length == 0 || data.pass == null)
				{
					if (traitFigure.extraRenderer == null)
					{
						traitFigure.extraRenderer = new CharaRenderer();
						traitFigure.extraRenderer.SetOwner(CharaGen.Create(row.id));
					}
					if (matColor >= -3)
					{
						if (matColor == -3)
						{
							MatColors matColors = EClass.core.Colors.matColors["ether"];
							p.matColor = BaseTileMap.GetColorInt(ref matColors.main, 100) * -1;
						}
					}
					else
					{
						p.matColor = matColor;
					}
					traitFigure.extraRenderer.Draw(p, ref v, drawShadow);
					return;
				}
				if (EClass.core.config.game.antiSpider && row.skinAntiSpider != 0)
				{
					owner.refVal = row.skinAntiSpider;
				}
				p.tile = row._tiles[owner.refVal % row._tiles.Length] * ((owner.dir % 2 == 0) ? 1 : (-1));
				p.matColor = matColor;
				pref = row.pref;
				p.x += pref.x * (float)((owner.dir % 2 == 0) ? 1 : (-1));
				p.z += pref.z;
				switch (row.id)
				{
				case "bike_kane":
				case "bike_kane_custom":
				case "bike_leet":
					p.z -= 0.1f;
					break;
				default:
					p.y += pref.y;
					break;
				}
				if (owner.noShadow || !owner.IsInstalled)
				{
					drawShadow = false;
				}
			}
			if (owner.noShadow || !owner.IsInstalled)
			else
			{
				drawShadow = false;
				renderData = owner.sourceCard.renderData;
			}
		}
		else
		if (replacer != null)
		{
			renderData = owner.sourceCard.renderData;
			renderData = replacer.data;
			pref = replacer.pref;
			SubPassData.Current = SubPassData.Default;
		}
	}
	if (replacer != null)
	{
		renderData = replacer.data;
		pref = replacer.pref;
		SubPassData.Current = SubPassData.Default;
	}
	if (isChara || hasActor)
	{
		p.x += pref.x * (float)((!owner.flipX) ? 1 : (-1));
		p.z += pref.z;
	}
	p.y += pref.y;
	int shadow = pref.shadow;
	bool flag2 = isChara && owner.isHidden && !EClass.pc.canSeeInvisible && (!EClass.pc.hasTelepathy || !owner.Chara.visibleWithTelepathy);
	if (drawShadow && shadow != 1 && SubPassData.Current.shadow && (!flag2 || owner.IsPC))
	{
		bool flag3 = ((!isChara) ? (owner.dir % 2 == 1) : (owner.dir == 1 || owner.dir == 2));
		EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + (flag3 ? (-1f) : 1f) * renderData.offsetShadow.x, position.y + renderData.offsetShadow.y + (owner.TileType.UseMountHeight ? 0f : p.shadowFix) - (owner.isChara ? 0f : (RenderObject.altitudeFix * (float)owner.altitude)), position.z + renderData.offsetShadow.z, ShadowData.Instance.items[shadow], pref, prefIndex, p.snow);
	}
	if (usePass)
	{
		if (owner.noSnow)
		if (isChara || hasActor)
		{
			p.snow = false;
			p.x += pref.x * (float)((!owner.flipX) ? 1 : (-1));
			p.z += pref.z;
		}
		if (!flag2)
		p.y += pref.y;
		int shadow = pref.shadow;
		bool flag2 = isChara && owner.isHidden && !EClass.pc.canSeeInvisible && (!EClass.pc.hasTelepathy || !owner.Chara.visibleWithTelepathy);
		if (drawShadow && shadow != 1 && SubPassData.Current.shadow && (!flag2 || owner.IsPC))
		{
			renderData.Draw(p);
			bool flag3 = ((!isChara) ? (owner.dir % 2 == 1) : (owner.dir == 1 || owner.dir == 2));
			EClass.scene.screenElin.tileMap.passShadow.AddShadow(position.x + (flag3 ? (-1f) : 1f) * renderData.offsetShadow.x, position.y + renderData.offsetShadow.y + (owner.TileType.UseMountHeight ? 0f : p.shadowFix) - (owner.isChara ? 0f : (RenderObject.altitudeFix * (float)owner.altitude)), position.z + renderData.offsetShadow.z, ShadowData.Instance.items[shadow], pref, prefIndex, p.snow);
		}
	}
	else if (hasActor)
	{
		if (owner.isChara && owner.Chara.ride != null && (EClass.core.config.game.showRide == 2 || (EClass.core.config.game.showRide == 1 && !owner.Cell.HasRoof && !EClass._map.IsIndoor)) && !owner.IsDeadOrSleeping)
		if (usePass)
		{
			Chara ride = owner.Chara.ride;
			CharaActorPCC charaActorPCC = ride.renderer.actor as CharaActorPCC;
			CharaActorPCC charaActorPCC2 = actor as CharaActorPCC;
			ride.angle = owner.angle;
			if (charaActorPCC != null && charaActorPCC2 != null)
			if (owner.noSnow)
			{
				charaActorPCC.provider.currentDir = charaActorPCC2.provider.currentDir;
				charaActorPCC.provider.currentFrame = charaActorPCC2.provider.currentFrame;
				charaActorPCC.provider.SetSpriteMain();
				charaActorPCC.RefreshSprite();
				p.snow = false;
			}
			PCCData.RideData ride2 = (ride.renderer as CharaRenderer).pccData.ride;
			float x = p.x;
			float y = p.y;
			float z = p.z;
			Vector3 v2 = new Vector3(v.x, v.y, v.z);
			ride.renderer.Draw(p, ref v2, drawShadow: false);
			int currentDir = actor.currentDir;
			p.x = x + RenderObject.renderSetting.ridePos[currentDir].x + ride2.x * (float)(currentDir switch
			if (!flag2)
			{
				2 => -1,  
				1 => 1,  
				_ => 0,  
			});
			p.y = y + RenderObject.renderSetting.ridePos[currentDir].y + ride2.y + ride2.jump * (float)((actor.GetFrame() % 2 == 1) ? 1 : 0);
			p.z = z + RenderObject.renderSetting.ridePos[currentDir].z - ride2.z;
				renderData.Draw(p);
			}
		}
		if (flag2)
		else if (hasActor)
		{
			actor.SetActive(enable: false);
			if (owner.isChara && owner.Chara.ride != null && (EClass.core.config.game.showRide == 2 || (EClass.core.config.game.showRide == 1 && !owner.Cell.HasRoof && !EClass._map.IsIndoor)) && !owner.IsDeadOrSleeping)
			{
				Chara ride = owner.Chara.ride;
				CharaActorPCC charaActorPCC = ride.renderer.actor as CharaActorPCC;
				CharaActorPCC charaActorPCC2 = actor as CharaActorPCC;
				ride.angle = owner.angle;
				if (charaActorPCC != null && charaActorPCC2 != null)
				{
					charaActorPCC.provider.currentDir = charaActorPCC2.provider.currentDir;
					charaActorPCC.provider.currentFrame = charaActorPCC2.provider.currentFrame;
					charaActorPCC.provider.SetSpriteMain();
					charaActorPCC.RefreshSprite();
				}
				PCCData.RideData ride2 = (ride.renderer as CharaRenderer).pccData.ride;
				float x = p.x;
				float y = p.y;
				float z = p.z;
				Vector3 v2 = new Vector3(v.x, v.y, v.z);
				ride.renderer.Draw(p, ref v2, drawShadow: false);
				int currentDir = actor.currentDir;
				p.x = x + RenderObject.renderSetting.ridePos[currentDir].x + ride2.x * (float)(currentDir switch
				{
					2 => -1,
					1 => 1,
					_ => 0,
				});
				p.y = y + RenderObject.renderSetting.ridePos[currentDir].y + ride2.y + ride2.jump * (float)((actor.GetFrame() % 2 == 1) ? 1 : 0);
				p.z = z + RenderObject.renderSetting.ridePos[currentDir].z - ride2.z;
			}
			if (flag2)
			{
				actor.SetActive(enable: false);
			}
			else
			{
				actor.SetActive(enable: true);
				actor.OnRender(p);
			}
		}
		else
		if (isChara)
		{
			actor.SetActive(enable: true);
			actor.OnRender(p);
			if (owner.Chara.parasite != null)
			{
				owner.Chara.parasite.renderer.position = position;
			}
			if (owner.Chara.ride != null)
			{
				owner.Chara.ride.renderer.position = position;
			}
		}
		SubPassData.Current = SubPassData.Default;
	}
	if (isChara)
	if (listTC.Count > 0)
	{
		if (owner.Chara.parasite != null)
		{
			owner.Chara.parasite.renderer.position = position;
		}
		if (owner.Chara.ride != null)
		RenderObject.tempV = position;
		RenderObject.tempV.y += data.offset.y + data.size.y + owner.Pref.heightFix;
		for (int num = listTC.Count - 1; num >= 0; num--)
		{
			owner.Chara.ride.renderer.position = position;
			listTC[num].OnDraw(ref RenderObject.tempV);
		}
	}
	SubPassData.Current = SubPassData.Default;
} 
if (listTC.Count > 0)
{
	RenderObject.tempV = position;
	RenderObject.tempV.y += data.offset.y + data.size.y + owner.Pref.heightFix;
	for (int num = listTC.Count - 1; num >= 0; num--)
	if (owner.trait.RenderExtra)
	{
		listTC[num].OnDraw(ref RenderObject.tempV);
		owner.trait.OnRenderExtra(p);
	}
}
if (owner.trait.RenderExtra)
{
	owner.trait.OnRenderExtra(p);
}
bool CanBeHallucinated()
{
	if (!usePass || !owner.ExistsOnMap || !owner.trait.CanBeHallucinated)

Cell โ€‹

public class Cell : WeightCell, IFloodCell

cs
public Room room;

public TraitDoor traitDoor;
public bool pcSync;

public const int DIV_LIQUID = 10;

public bool isShadowed

cs
	}
}

public bool hasDoor 
{
	get 
	{
		return bits[3];
	}
	set 
	{
		bits[3] = value;
	}
}
public bool hasDoor => traitDoor != null;

public bool skipRender
{

public void Refresh()

cs
outOfBounds = x < bounds.x || z < bounds.z || x > bounds.maxX || z > bounds.maxZ;
isSurrounded4d = cell.HasFullBlock && cell2.HasFullBlock && cell3.HasFullBlock && cell4.HasFullBlock;
isSurrounded = isSurrounded4d && cell5.HasFullBlock && cell6.HasFullBlock && cell7.HasFullBlock && cell8.HasFullBlock && cell3.bridgeHeight == bridgeHeight && cell2.bridgeHeight == bridgeHeight && cell4.bridgeHeight == bridgeHeight && cell.bridgeHeight == bridgeHeight;
traitDoor = null;
isFloating = isForceFloat;
hasDoor = false;
hasDoorBoat = false;
isDeck = false;
isShoreSand = false;

public void Refresh()

cs
}
if (thing.trait is TraitDoor)
{
	traitDoor = thing.trait as TraitDoor;
	blocked = false;
	hasDoor = true;
	blockSight = true;
}
else if (thing.trait.IsBlockSight)

Chara โ€‹

public bool TryFuse(float chance = 1f)

cs
	return false;
}
List<Chara> list = ListFussableCharas(3);
if (list.Count < 8)
if (list.Count < 7)
{
	return false;
}

public bool TryFuse(float chance = 1f)

cs
Effect.Get<EffectIRenderer>("throw_fuse").Play(item, item, item.pos, pos);
item.Destroy();
num++;
if (num >= 8)
if (num >= 7)
{
	break;
}

public bool FindNewEnemy()

cs
{
	return false;
}
if (!base.IsPCFactionOrMinion && OriginalHostility == Hostility.Neutral && !(trait is TraitGuard) && id != "unicorn")
{
	return false;
}
bool flag = enemy != null || ai is GoalCombat;
int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;

ConBaseTransmuteMimic โ€‹

public override void SetOwner(Chara _owner, bool onDeserialize = false)

cs
public override void OnRemoved()
{
	owner.mimicry = null;
	owner.RemoveAllStances();
	base.OnRemoved();
}

public override void Change()
{
	owner.RemoveAllStances();
	base.Change();
}
public override void Reveal(Card attacker = null, bool surprise = false)
{
	if (attacker is Chara && owner.IsHostile(attacker.Chara))

ConTransmute โ€‹

public override void OnHit(Card attacker, AttackSource source)

cs
	}
}

public void Change()
public virtual void Change()
{
	if (owner.ai is GoalCombat { IsRunning: not false, abilities: not null } goalCombat)
	{

public void Build(List<GridItem> items)

cs
public List<Thing> ListIngredients(Recipe.Ingredient ingredient, StockSearchMode searchMode)
{
	return EMono._map.Stocked.ListThingStack(ingredient, searchMode).list;
	List<Thing> obj = EMono._map.Stocked.ListThingStack(ingredient, searchMode).list;
	obj.Sort(UIList.SortMode.ByCategory);
	return obj;
}

public void BuildIngredients(Recipe _recipe, Image _icon, Action _onValueChange, StockSearchMode _searchMode)

public void TrySelect(int a)

cs
	return;
}
Recipe.Ingredient ing = componentOf.ing;
List<Thing> list = EMono._map.Stocked.ListThingStack(ing, searchMode).list;
List<Thing> list = ListIngredients(ing, searchMode);
int num = list.IndexOf(ing.thing);
if (num != -1)
{

FactionBranch โ€‹

public Thing GetMeal(Chara c)

cs
{
	return null;
}
if (c.memberType == FactionMemberType.Livestock && policies.IsActive(2715))
{
	return null;
}
Thing thing = EClass._zone.TryGetThingFromSharedContainer((Thing t) => c.CanEat(t, shouldEat: true) && !t.c_isImportant);
if (thing != null)
{

GameSetting โ€‹

public class UD_FogSetting : UDictionary<FogType, ScreenGradingProfile.Fog>

cs
public Vector3[] rampFix;

public Vector3[] bigdoorFix;
public Vector3 vFix;

public Vector3 pccScale;

GoalCombat โ€‹

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

cs
	continue;
}
bool isHOT;
int[] list;
switch (text)
{
case "any":

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

cs
	break;
case "taunt":
{
	bool flag9 = owner.HasCondition<StanceTaunt>();
	bool flag10 = tactics.source.taunt != -1 && 100 * owner.hp / owner.MaxHP >= tactics.source.taunt;
	num = ((flag9 && !flag10) ? 100 : ((!flag9 && flag10) ? 100 : 0));
	bool flag7 = owner.HasCondition<StanceTaunt>();
	bool flag8 = tactics.source.taunt != -1 && 100 * owner.hp / owner.MaxHP >= tactics.source.taunt;
	num = ((flag7 && !flag8) ? 100 : ((!flag7 && flag8) ? 100 : 0));
	break;
}
case "song":
{
	BaseSong baseSong = owner.GetCondition(act.source.proc[1]) as BaseSong;
	bool num2 = baseSong != null;
	bool flag8 = num2 && act.GetPower(owner) > baseSong.power;
	num = ((!num2 || flag8) ? 200 : 0);
	bool flag6 = num2 && act.GetPower(owner) > baseSong.power;
	num = ((!num2 || flag6) ? 200 : 0);
	break;
}
case "melee":

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

cs
		ability.pt = true;
	}
	break;
case "restore":
	list = ((s.id == 8471) ? Element.List_Mind : Element.List_Body);
	num = ForeachChara(ability, (Chara c) => RestoreFactor(c), isFriendlyAbility: true);
	if (ability.aiPt || (owner.IsPC && tactics.CastPartyBuff))
	{
		ability.pt = true;
	}
	break;
case "dot":
case "attack":
case "attackMelee":

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

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

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

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

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

cs
	break;
case 8200:
case 8201:
	if (owner.HasElement(400))
	if (owner.HasElement(400) || (tactics.DestDist > 1 && owner.Dist(tc) == tactics.DestDist))
	{
		continue;
	}

int HealFactor(Chara c)

cs
		}
		return num7;
	}
	int RestoreFactor(Chara c)
	{
		if (c.tempElements == null)
		{
			return 0;
		}
		int num6 = 0;
		int[] array = list;
		foreach (int num7 in array)
		{
			Element element = c.tempElements.GetElement(num7);
			if (element != null && element.vBase < 0)
			{
				num6 += 20;
			}
		}
		if (num6 != 0)
		{
			return num6 + tactics.P_Heal;
		}
		return 0;
	}
}
abilities.Sort((ItemAbility a, ItemAbility b) => b.priority - a.priority);
foreach (ItemAbility ability2 in abilities)

LayerInventory โ€‹

public static void SetDirty(Thing t)

cs
{
	if (item.invs[0].owner.Container == t.parent || ((bool)item.mini && item.mini.gameObject.activeInHierarchy))
	{
		item.invs[0].dirty = true;
		item.invs[0].dirty = (item.invs[0].sortDirty = true);
	}
}
if (t.invY == 1 || ELayer.pc.held == t)

Map โ€‹

public List<Point> ListPointsInSquare(Point center, int radius, bool mustBeWalkaโ€ฆ)

cs
	return list;
}

public List<Point> ListPointsOnEdge(Point center, int destDist, bool mustBeWalkable = true, bool los = true)
{
	List<Point> list = new List<Point>();
	ForeachSphere(center.x, center.z, destDist, delegate(Point p)
	{
		if (center.Distance(p) == destDist && (!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>();

Net โ€‹

public static async UniTask<List<ChatLog>> GetChat(ChatCategory cat, string idLaโ€ฆ)

cs
}
foreach (ChatLog item2 in list)
{
	item2.msg = item2.msg.Replace("\n", "").Replace("\r", "").Replace("&quot;", "\"")
	item2.msg = WebUtility.HtmlDecode(item2.msg).Replace("\n", "").Replace("\r", "")
		.ToTitleCase();
}
list.Reverse();

Props โ€‹

public ThingStack ListThingStack(Recipe.Ingredient ing, StockSearchMode searchMoโ€ฆ)

cs
{
	FindAnyFood();
}
stack.list.Sort(UIList.SortMode.ByCategory);
return stack;
void Find(string text)
{

void FindCat(string key)

cs
});
if (EClass._zone.IsPCFaction || EClass._zone is Zone_Tent || EClass.debug.enable)
{
	foreach (Thing thing2 in things)
	foreach (PropSetCategory value in categoryMap.Values)
	{
		Card obj = thing2.parent as Card;
		if (obj != null && obj.c_lockLv == 0 && thing2.category.IsChildOf(cat.id) && !thing2.IsExcludeFromCraft(ing))
		if (value.source.IsChildOf(cat))
		{
			stack.Add(thing2);
			foreach (Card item5 in value)
			{
				Thing thing = item5.Thing;
				Card obj = thing.parent as Card;
				if (obj != null && obj.c_lockLv == 0 && !thing.IsExcludeFromCraft(ing))
				{
					stack.Add(thing);
				}
			}
		}
	}
}

RenderData โ€‹

private void OnValidate()

cs
	_offset = offset;
}

public void DrawRepeatTo(RenderParam p, float maxY, float height, ref Vector3 peakFix, bool skipFirst = false, int fire = 0, bool isBlock = false)
public void DrawRepeatTo(RenderParam p, float maxY, float height, ref Vector3 peakFix, int skipRepeat = 0, int fire = 0, bool isBlock = false)
{
	int num = (int)((maxY + height + peakFix.x - p.y) / peakFix.y);
	bool snow = p.snow;
	if (num == 0)
	{
		if (!skipFirst)
		if (skipRepeat == 0)
		{
			Draw(p);
		}

public void DrawRepeatTo(RenderParam p, float maxY, float height, ref Vector3 peโ€ฆ)

cs
	p.z -= peakFix.z + peakFix.x;
	p.snow = snow;
}
if (skipFirst)
if (skipRepeat > 0)
{
	if (i != 0 && num > 1)
	if (i >= skipRepeat && num > skipRepeat)
	{
		Draw(p);
	}

TileMapElona โ€‹

public override void DrawTile()

cs
	}
	else
	{
		sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, cell.hasDoor, cell.effect?.FireAmount ?? 0);
		sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, cell.traitDoor?.height ?? 0, cell.effect?.FireAmount ?? 0);
	}
	break;
case BlockRenderMode.WallOrFence:

public override void DrawTile()

cs
}
else
{
	_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, cell.hasDoor, cell.effect?.FireAmount ?? 0);
	_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, cell.traitDoor?.height ?? 0, cell.effect?.FireAmount ?? 0);
}
param.z -= 0.01f;
if (blockDir == 2 || (cell.Front.HasWallOrFence && cell.Front.blockDir != 0))

public override void DrawTile()

cs
}
else
{
	_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, cell.hasDoor, cell.effect?.FireAmount ?? 0);
	_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, cell.traitDoor?.height ?? 0, cell.effect?.FireAmount ?? 0);
}
if (cell.Right.HasWallOrFence && cell.Right.blockDir != 1)
{

Trait โ€‹

public virtual bool IsNightOnlyLight

cs
public virtual bool UseAltTiles => owner.isOn;

public virtual bool UsePositionFix => false;
public virtual bool UseLowblock => false;

public virtual bool UseExtra => true;

public virtual void OnUninstall()

cs
{
}

public virtual void PositionFix(ref Vector3 v)
{
}
public virtual void TryToggle()
{
	if (!owner.IsInstalled)

TraitCrafter โ€‹

public bool IsIngredient(int idx, SourceRecipe.Row r, Card c)

cs
	}
	continue;
}
string[] array3 = text.Split('@');
if (array3.Length > 1)
if (text.Contains('@'))
{
	string[] array3 = text.Split('@');
	if (c.id != array3[0] && c.sourceCard._origin != array3[0])
	{
		return false;

TraitDoor โ€‹

public override bool IsOpenSight

cs
public virtual string idSound => "door1";

public virtual int height => 1;
public override void Update()
{
	TryAutoClose();

+TraitDoorBig โ€‹

File Created
cs
public class TraitDoorBig : TraitDoor
{
	public override int height => 2;

	public override void ToggleDoor(bool sound = true, bool refresh = true)
	{
		base.ToggleDoor(sound, refresh);
		TraitDoorBig doorPair = GetDoorPair();
		if (doorPair != null && doorPair.IsOpen() != IsOpen())
		{
			doorPair.ToggleDoor(sound: false);
		}
	}

	public TraitDoorBig GetDoorPair()
	{
		int dir = owner.dir;
		Cell cell = null;
		cell = ((!(this is TraitDoorBigL)) ? ((dir == 0 || dir == 2) ? owner.Cell.Back : owner.Cell.Left) : ((dir == 0 || dir == 2) ? owner.Cell.Front : owner.Cell.Right));
		return cell.traitDoor as TraitDoorBig;
	}
}

+TraitDoorBigL โ€‹

File Created
cs
using UnityEngine;

public class TraitDoorBigL : TraitDoorBig
{
	public override TileMode tileMode => base.tileMode;

	public override bool UseAltTiles => IsOpen();

	public override bool UsePositionFix => IsOpen();

	public override void PositionFix(ref Vector3 v)
	{
		v += EClass.setting.render.bigdoorFix[(owner.dir != 0 && owner.dir != 2) ? 1 : 0];
	}
}

+TraitDoorBigR โ€‹

File Created
cs
public class TraitDoorBigR : TraitDoorBig
{
}

UIDragGridIngredients โ€‹

using System.Collections.Generic;

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

public class UIDragGridIngredients : EMono

public void Update()

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

public void Refresh()

cs
	}
	list.Sort(UIList.SortMode.ByCategory);
}
if (this.list.buttons.Count > 0 && this.list.items.SequenceEqual(list))
{
	this.list.Redraw();
	return;
}
this.list.callbacks = new UIList.Callback<Thing, ButtonGrid>
{
	onClick = delegate(Thing a, ButtonGrid b)

public void Refresh()

cs
},
onInstantiate = delegate(Thing a, ButtonGrid b)
{
	b.SetCard(a, ButtonGrid.Mode.Grid);
	b.SetOnClick(delegate
	{
	});

public void Refresh()

cs
		{
			this.list.callbacks.OnClick(a, b);
		};
	}, 
	onRedraw = delegate(Thing a, ButtonGrid b, int i)
	{
		b.SetCard(a, ButtonGrid.Mode.Grid);
	}
};
this.list.Clear();

UIInventory โ€‹

public class Tab

cs
public bool isList;

public bool sortDirty = true;
public Transaction lastTransaction;

public Image imageHighlight;

public void Sort(bool redraw = true)

cs
while (flag)
{
	flag = false;
	foreach (Thing thing in owner.Container.things)
	Dictionary<string, List<Thing>> dict = new Dictionary<string, List<Thing>>();
	foreach (Thing item in owner.Container.things.Copy())
	{
		if (thing.invY == 1)
		if (item.invY == 1)
		{
			continue;
		}
		foreach (Thing thing2 in owner.Container.things)
		List<Thing> orCreate = dict.GetOrCreate(item.id);
		bool flag2 = false;
		for (int i = 0; i < orCreate.Count; i++)
		{
			if (thing != thing2 && thing2.invY != 1 && thing.TryStackTo(thing2))
			if (item.TryStackTo(orCreate[i]))
			{
				flag = true;
				flag2 = true;
				break;
			}
			if (orCreate[i].TryStackTo(item))
			{
				orCreate[i] = item;
				flag2 = true;
				break;
			}
		}
		if (flag2)
		{
			flag = true;
		}
		if (flag)
		else
		{
			break;
			orCreate.Add(item);
		}
	}
}
int num = 0;
foreach (Thing thing3 in owner.Container.things)
foreach (Thing thing in owner.Container.things)
{
	if (thing3.invY != 1)
	if (thing.invY != 1)
	{
		thing3.invY = 0;
		thing3.invX = -1;
		thing.invY = 0;
		thing.invX = -1;
	}
	num++;
}

public void Sort(bool redraw = true)

cs
Vector2 sizeDelta = list.Rect().sizeDelta;
sizeDelta.x -= 60f;
sizeDelta.y -= 60f;
foreach (Thing thing4 in owner.Container.things)
foreach (Thing thing2 in owner.Container.things)
{
	if (thing4.invY != 0)
	if (thing2.invY != 0)
	{
		continue;
	}
	thing4.posInvX = num2 + 30;
	thing4.posInvY = (int)sizeDelta.y - num3 + 30;
	thing2.posInvX = num2 + 30;
	thing2.posInvY = (int)sizeDelta.y - num3 + 30;
	num2 += 40;
	if ((float)num2 > sizeDelta.x)
	{

public void Sort(bool redraw = true)

cs
		}
	}
}
sortDirty = false;
if (redraw)
{
	list.Redraw();

public void RefreshGrid()

cs
{
	if (firstMouseRightDown || (!Input.GetMouseButton(1) && !Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift)))
	{
		Sort(redraw: false);
		if (sortDirty)
		{
			Sort(redraw: false);
		}
		firstMouseRightDown = false;
		owner.Container.things.RefreshGrid(uiMagic, window.saveData);
	}
}
else
{
	if (window.saveData.alwaysSort && !sorted && (firstMouseRightDown || (!Input.GetMouseButton(1) && !Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift))))
	if (window.saveData.alwaysSort && sortDirty && !sorted && (firstMouseRightDown || (!Input.GetMouseButton(1) && !Input.GetKey(KeyCode.LeftShift) && !Input.GetKey(KeyCode.RightShift))))
	{
		sorted = true;
		Sort();

UIMagicChest โ€‹

public class UIMagicChest : EMono

cs
public int pageMax;

public int pageJump = 7;
public List<Thing> filteredList = new List<Thing>();

public Color colorCat;

public void Init()

cs
for (int i = 0; i < 9; i++)
{
	UIButton b = Util.Instantiate(t, layoutPage);
	b.mainText.text = (i + 1).ToString() ?? "";
	buttonsPage.Add(b);
	int _i = i;
	b.SetOnClick(delegate
	{
		if (!UIContextMenu.Current)
		{
			page = _i;
			groupPage.Select(b);
			page = b.refInt;
			SE.Tab();
			Redraw();
		}
	});
}
groupPage.selectOnClick = false;
groupPage.Init();
inputSearch.onValueChanged.AddListener(Search);
inputSearch.onSubmit.AddListener(Search);

public void Init()

cs
public void OnAfterRedraw()
{
	RefreshBottom();
	for (int i = 0; i < buttonsPage.Count; i++)
	int count = buttonsPage.Count;
	bool flag = pageMax >= count;
	int num = ((!flag) ? 1 : Mathf.Clamp(page - count / 2 + 1, 1, pageMax - count + 2));
	for (int i = 0; i < count; i++)
	{
		buttonsPage[i].interactable = i <= pageMax;
		UIButton uIButton = buttonsPage[i];
		int num2 = ((i != 0) ? ((flag && i == count - 1) ? pageMax : (num + i - 1)) : 0);
		bool flag2 = (i == 1 && num2 > 1) || (i == count - 2 && num2 < pageMax - 1);
		uIButton.refInt = (flag2 ? Mathf.Clamp(page + ((i == 1) ? (-pageJump) : pageJump), 0, pageMax) : num2);
		uIButton.mainText.text = (flag2 ? "โ€ฆ" : ((num2 + 1).ToString() ?? ""));
		uIButton.interactable = num2 <= pageMax;
	}
	groupPage.selected = null;
	groupPage.Select(page);
	groupPage.Select((UIButton a) => a.refInt == page);
}

public void RefreshCats()