Skip to content

EA 23.136 Nightly

May 11, 2025

16 files modified. 1 new file created.

Important Changes

None.

ActEffect

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

cs
		float radius2 = ((id == EffectId.Suicide) ? 3.5f : ((float)((id == EffectId.BallBubble) ? 2 : 5)));
		if (id == EffectId.Explosive && actRef.refThing != null)
		{
			radius2 = 2f; 
			radius2 = 2 + actRef.refThing.Evalue(666); 
		}
		if (id == EffectId.Suicide)
		{

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

cs
			TC.Say((actRef.n1 == "money") ? "abStealNegateMoney" : "abStealNegate", TC);
			break;
		}
		Thing thing6 = null; 
		bool flag7 = actRef.n1 == "food"; 
		Thing thing4 = null; 
		bool flag6 = actRef.n1 == "food"; 
		if (actRef.n1 == "money")
		{
			int currency = TC.GetCurrency();
			if (currency > 0)
			{
				currency = Mathf.Clamp(EClass.rnd(currency / 10), 1, 100 + EClass.rndHalf(CC.LV * 200));
				thing6 = ThingGen.Create("money").SetNum(currency); 
				thing4 = ThingGen.Create("money").SetNum(currency); 
				TC.ModCurrency(-currency);
			}
		}
		else
		{
			Func<Thing, bool> func = (Thing t) => true;
			if (flag7) 
			if (flag6) 
			{
				func = (Thing t) => t.IsFood;
			}
			List<Thing> list6 = TC.things.List(delegate(Thing t) 
			List<Thing> list3 = TC.things.List(delegate(Thing t) 
			{
				if (t.parentCard?.trait is TraitChestMerchant || t.trait is TraitTool || t.IsThrownWeapon)
				{

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

cs
				}
				return t.trait.CanBeDestroyed && t.things.Count == 0 && t.invY != 1 && t.trait.CanBeStolen && !t.trait.CanOnlyCarry && !t.IsUnique && !t.isEquipped && t.blessedState == BlessedState.Normal && func(t);
			}, onlyAccessible: true);
			if (list6.Count > 0) 
			if (list3.Count > 0) 
			{
				thing6 = list6.RandomItem(); 
				if (thing6.Num > 1) 
				thing4 = list3.RandomItem(); 
				if (thing4.Num > 1) 
				{
					thing6 = thing6.Split(1); 
					thing4 = thing4.Split(1); 
				}
			}
			CC.AddCooldown(6640, 200);
		}
		if (thing6 == null) 
		if (thing4 == null) 
		{
			CC.Say("abStealNothing", CC, TC);
			break;
		}
		thing6.SetInt(116, 1); 
		TC.PlaySound(thing6.material.GetSoundDrop(thing6.sourceCard)); 
		CC.Pick(thing6, msg: false); 
		CC.Say("abSteal", CC, TC, thing6.Name); 
		thing4.SetInt(116, 1); 
		TC.PlaySound(thing4.material.GetSoundDrop(thing4.sourceCard)); 
		CC.Pick(thing4, msg: false); 
		CC.Say("abSteal", CC, TC, thing4.Name); 
		if (actRef.n1 == "food")
		{
			if (CC.hunger.value != 0)
			{
				CC.InstantEat(thing6); 
				CC.InstantEat(thing4); 
			}
		}
		else

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

cs
		{
			break;
		}
		List<Thing> list3 = TC.things.List(delegate(Thing t) 
		List<Thing> list5 = TC.things.List(delegate(Thing t) 
		{
			if (!t.isEquipped || t.blessedState == BlessedState.Doomed || t.IsToolbelt)
			{

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

cs
			}
			return (t.blessedState < BlessedState.Blessed || EClass.rnd(10) == 0) ? true : false;
		});
		if (list3.Count == 0) 
		if (list5.Count == 0) 
		{
			CC.SayNothingHappans();
			break;
		}
		Thing thing4 = list3.RandomItem(); 
		TC.Say("curse_hit", TC, thing4); 
		thing4.SetBlessedState((thing4.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed); 
		LayerInventory.SetDirty(thing4); 
		Thing thing6 = list5.RandomItem(); 
		TC.Say("curse_hit", TC, thing6); 
		thing6.SetBlessedState((thing6.blessedState == BlessedState.Cursed) ? BlessedState.Doomed : BlessedState.Cursed); 
		LayerInventory.SetDirty(thing6); 
		break;
	}
	case EffectId.UncurseEQ:

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

cs
	{
		EClass.game.religions.Trickery.Talk("ability");
		bool hex2 = CC.IsHostile(TC);
		List<SourceStat.Row> list4 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex2 ? "Debuff" : "Buff")).ToList(); 
		List<SourceStat.Row> list6 = EClass.sources.stats.rows.Where((SourceStat.Row con) => con.tag.Contains("random") && con.group == (hex2 ? "Debuff" : "Buff")).ToList(); 
		int power2 = power;
		for (int k = 0; k < 4 + EClass.rnd(2); k++)
		{
			SourceStat.Row row2 = list4.RandomItem(); 
			list4.Remove(row2); 
			Proc(hex2 ? EffectId.Debuff : EffectId.Buff, CC, TC, power2, new ActRef
			SourceStat.Row row2 = list6.RandomItem(); 
			list6.Remove(row2); 
			Proc(hex2 ? EffectId.DebuffKizuami : EffectId.Buff, CC, TC, power2, new ActRef
			{
				n1 = row2.alias
			});

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

cs
		break;
	}
	case EffectId.Debuff:
	case EffectId.DebuffKizuami:
	{
		CC.DoHostileAction(TC);
		bool isPowerful = TC.IsPowerful;

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

cs
		{
			num8 += condition3.power * 5;
		}
		if (EClass.rnd(a2) < num8 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0) 
		if (id != EffectId.DebuffKizuami && EClass.rnd(a2) < num8 / EClass.sources.stats.alias[n].hexPower && EClass.rnd(10) != 0) 
		{
			TC.Say("debuff_resist", TC);
			CC.DoHostileAction(TC);

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

cs
	case EffectId.RestoreBody:
	case EffectId.RestoreMind:
	{
		bool flag6 = id == EffectId.RestoreBody; 
		bool flag7 = id == EffectId.RestoreBody; 
		if (flag)
		{
			Redirect(flag6 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef)); 
			Redirect(flag7 ? EffectId.DamageBodyGreat : EffectId.DamageMindGreat, BlessedState.Normal, default(ActRef)); 
			break;
		}
		TC.Say(flag6 ? "restoreBody" : "restoreMind", TC); 
		TC.Say(flag7 ? "restoreBody" : "restoreMind", TC); 
		TC.PlaySound("heal");
		TC.PlayEffect("heal");
		TC.CureHost(flag6 ? CureType.CureBody : CureType.CureMind, power, state); 
		TC.CureHost(flag7 ? CureType.CureBody : CureType.CureMind, power, state); 
		if (blessed)
		{
			Redirect(flag6 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef)); 
			Redirect(flag7 ? EffectId.EnhanceBodyGreat : EffectId.EnhanceMindGreat, BlessedState.Normal, default(ActRef)); 
		}
		break;
	}

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

cs
			TC.DamageHP(num9 / 2, 919, power);
			break;
		}
		TC.HealHPHost(num9, (actRef.refThing == null) ? HealSource.Magic : HealSource.Item); 
		TC.HealHPHost(num9, (actRef.refThing == null && id != EffectId.JureHeal) ? HealSource.Magic : HealSource.Item); 
		TC.CureHost(CureType.Heal, power, state);
		TC.Say((power >= 300) ? "heal_heavy" : "heal_light", TC);
		break;

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

cs
		{
			power /= 4;
		}
		List<Thing> list5 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false); 
		if (list5.Count != 0) 
		List<Thing> list4 = TC.things.List((Thing t) => (t.Num <= 1 && t.IsEquipmentOrRanged && !t.IsToolbelt && !t.IsLightsource && t.isEquipped) ? true : false); 
		if (list4.Count != 0) 
		{
			Thing thing5 = list5.RandomItem(); 
			Thing thing5 = list4.RandomItem(); 
			TC.Say("acid_hit", TC);
			if (thing5.isAcidproof)
			{

BaseTileMap

@@ -298,9 +298,15 @@ public enum ScreenHighlight

cs
	[NonSerialized]
	public bool fogged;

	[NonSerialized] 
	public int[] floatVs = new int[10] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; 
	[NonSerialized]
	public float[] lightLookUp;

	[NonSerialized] 
	public float[] floatYs = new float[10] { 0f, 1f, 2f, 3f, 4f, 5f, 6f, 7f, 8f, 9f }; 
	[NonSerialized]
	public float _lightMod;

@@ -467,6 +473,8 @@ public enum ScreenHighlight

cs

	protected bool showBorder;

	protected bool isUnderwater; 
	protected Vector3 thingPos;

	protected Vector3 orgPos;

@@ -552,6 +560,7 @@ public virtual void Draw()

cs
	cinemaMode = ActionMode.Cinema.IsActive;
	isMining = EMono.scene.actionMode == ActionMode.Mine;
	iconMode = EMono.scene.actionMode.cardIconMode;
	isUnderwater = EMono._zone.IsUnderwater; 
	showAllCards = buildMode;
	highlightCells = ActionMode.FlagCell.IsActive;
	subtleHighlightArea = EMono.scene.actionMode.AreaHihlight != 0 && (EMono.scene.actionMode.AreaHihlight == AreaHighlightMode.Build || EMono.scene.actionMode.AreaHihlight != AreaHighlightMode.Edit);

@@ -608,16 +617,21 @@ public virtual void Draw()

cs
	if (floatTimer > floatSpeed)
	{
		floatTimer -= floatSpeed;
		floatY += floatV; 
		if (floatY >= (float)maxFloat) 
		{ 
			floatV *= -1; 
		} 
		if (floatY < 0f) 
		for (int i = 0; i < floatYs.Length; i++) 
		{
			floatV *= -1; 
			floatYs[i] += floatVs[i]; 
			if (floatYs[i] >= (float)maxFloat) 
			{ 
				floatVs[i] = -1; 
			} 
			if (floatYs[i] < 0f) 
			{ 
				floatVs[i] = 1; 
			} 
		}
	}
	floatY = floatYs[0]; 
	floatV = floatVs[0]; 
	waterAnimeTimer += num2;
	if (waterAnimeTimer > 0.5f)
	{

@@ -854,18 +868,18 @@ public virtual void Draw()

cs
	int valueOrDefault = (this.room?.lot?.idBGM).GetValueOrDefault();
	if (valueOrDefault == 0)
	{
		goto IL_1671; 
		goto IL_16b9; 
	}
	if (!(EMono.Sound.currentPlaylist != EMono.Sound.plLot))
	{
		BGMData data = EMono.Sound.plLot.list[0].data;
		if ((object)data != null && data.id == valueOrDefault)
		{
			goto IL_1671; 
			goto IL_16b9; 
		}
	}
	goto IL_1690; 
	IL_169a: 
	goto IL_16d8; 
	IL_16e2: 
	if (this.room != lastRoom)
	{
		screen.RefreshWeather();

@@ -874,15 +888,15 @@ public virtual void Draw()

cs
		SoundManager.bgmVolumeMod = ((!LayerDrama.maxBGMVolume && !EMono._map.IsIndoor && this.room != null && !this.room.data.atrium && this.room.HasRoof) ? (-0.6f) : 0f);
		screenHighlight = ScreenHighlight.None;
		return;
		IL_1690: 
		EMono._zone.RefreshBGM(); 
		goto IL_169a; 
		IL_1671: 
		IL_16b9: 
		if (valueOrDefault == 0 && EMono.Sound.currentPlaylist == EMono.Sound.plLot)
		{
			goto IL_1690; 
			goto IL_16d8; 
		}
		goto IL_169a; 
		goto IL_16e2; 
		IL_16d8: 
		EMono._zone.RefreshBGM(); 
		goto IL_16e2; 
	}

	public void RefreshHeight()

@@ -978,7 +992,7 @@ public virtual void DrawTile()

cs
	{
		blockLight -= heightLightMod * (float)(currentHeight - height);
	}
	liquidLv = (param.liquidLv = ((!flag) ? (((this.cell.liquidLv + this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.LiquidLV : sourceFloor.tileType.LiquidLV) * 10) : 0)); 
	liquidLv = (param.liquidLv = ((!flag && !isUnderwater) ? (((this.cell.liquidLv + this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.LiquidLV : sourceFloor.tileType.LiquidLV) * 10) : 0)); 
	if (this.cell.shore != 0 && liquidLv > 20)
	{
		liquidLv = (param.liquidLv = 20);

@@ -1183,7 +1197,7 @@ public virtual void DrawTile()

cs
	bool flag4 = this.cell.isSurrounded && innerMode != 0 && sourceBlock.tileType.IsFullBlock;
	if (!(!isSeen || flag4))
	{
		goto IL_167b; 
		goto IL_1683; 
	}
	bool isRoomEdge = this.cell.IsRoomEdge;
	orgY = param.y;

@@ -1245,7 +1259,7 @@ public virtual void DrawTile()

cs
	{
		if (isRoomEdge)
		{
			goto IL_167b; 
			goto IL_1683; 
		}
		if (detail == null || !EMono.pc.hasTelepathy)
		{

@@ -1256,591 +1270,142 @@ public virtual void DrawTile()

cs
			fogged = true;
		}
	}
	goto IL_7b80; 
	IL_7b80: 
	if (detail.things.Count == 0 && detail.charas.Count == 0) 
	{ 
		return; 
	} 
	int num3 = 0; 
	thingPos.x = 0f; 
	thingPos.y = 0f; 
	thingPos.z = 0f; 
	freePos.x = (freePos.y = (freePos.z = 0f)); 
	if (this.cell.HasRamp) 
	goto IL_7b88; 
	IL_6fcd: 
	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))) 
	{
		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; 
		snowed = true; 
	}
	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 (this.cell.effect != null) 
	{
		if (liquidLv > 10) 
		if (this.cell.effect.IsLiquid) 
		{
			liquidLv = TileType.FloorWaterShallow.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 -= (int)(floatY * 0.5f); 
		param.liquidLv = liquidLv; 
		param.y -= TileType.FloorWaterShallow.FloorHeight; 
	} 
	Thing thing = null; 
	bool shadow = liquidLv == 0; 
	float num4 = 0f; 
	float num5 = 0f; 
	bool flag6 = false; 
	float num6 = 0f; 
	bool flag7 = false; 
	float num7 = 0f; 
	if (detail.things.Count > 0 && isSeen) 
	{ 
		_ = zSetting.max1; 
		float num8 = 0f; 
		for (int j = 0; j < detail.things.Count; j++) 
		else
		{
			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) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem)) 
			{ 
				continue; 
			} 
			TileType tileType = t.trait.tileType; 
			bool isInstalled = t.IsInstalled; 
			SourcePref pref = t.Pref; 
			if (!isInstalled && t.category.tileDummy != 0) 
			{ 
				pref = rendererObjDummy.shadowPref; 
			} 
			float num9 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height))); 
			if (t.ignoreStackHeight) 
			{ 
				thingPos.y -= num4; 
			} 
			shadow = thingPos.y < 0.16f && num7 < 0.16f; 
			_ = 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 + num8; 
				if (this.room != null) 
				{ 
					param.color = GetRoofLight(this.room.lot); 
				} 
				shadow = false; 
				param.liquidLv = 0; 
			} 
			else
			param.tile = this.cell.effect.source._tiles[0]; 
			SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect; 
			if (sourceEffect2.anime.Length != 0) 
			{
				param.snow = snowed; 
				_actorPos.x = orgX + num5; 
				_actorPos.y = orgY; 
				_actorPos.z = orgZ + num8 + thingPos.z; 
				if (tileType.CanStack || !isInstalled) 
				{ 
					if (thing?.id != t.id) 
					{ 
						_actorPos.x += thingPos.x; 
					} 
					_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 (isInstalled) 
				if (sourceEffect2.anime.Length > 2) 
				{
					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) 
						{ 
							num7 += rampFix2.y; 
						} 
						liquidLv -= (int)(rampFix2.y * 150f); 
						if (liquidLv < 0) 
						{ 
							liquidLv = 0; 
						} 
					} 
					else if (!flag7 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight) 
					{ 
						orgY += num9 + (float)t.altitude * altitudeFix.y; 
						orgZ += (float)t.altitude * altitudeFix.z; 
						freePos.y += num9 + (float)t.altitude * altitudeFix.y; 
						if (!this.cell.IsTopWater || t.altitude > 0) 
						{ 
							num7 += num9 + (float)t.altitude * altitudeFix.y; 
						} 
						_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1)); 
						_actorPos.z += pref.z; 
						thingPos.z += pref.z; 
						liquidLv -= (int)(num9 * 150f); 
						if (liquidLv < 0) 
						{ 
							liquidLv = 0; 
						} 
					} 
					else
					{ 
						thingPos.y += num9; 
						_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) 
					float num3 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2]; 
					if (!(num3 >= (float)sourceEffect2.anime[0])) 
					{
						flag7 = true; 
						param.tile += num3; 
					}
				}
				else
				{
					thingPos.y += num9; 
					_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1)); 
					_actorPos.z += pref.z; 
					thingPos.z += pref.z; 
					float num4 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0]; 
					param.tile += num4; 
				}
				if (t.isFloating && isWater && !hasBridge && !flag) 
			} 
			if (this.cell.effect.IsFire) 
			{ 
				rendererEffect.Draw(param); 
			} 
			else
			{ 
				this.cell.effect.source.renderData.Draw(param); 
			} 
		} 
	} 
	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) 
			{ 
				if (sourceObj.pref.Float) 
				{
					flag = true; 
					float num10 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight); 
					orgY += 0.01f * floatY - num10; 
					num6 = num9; 
					_actorPos.y += 0.01f * floatY - num10; 
					param.y += 0.01f * floatY; 
					if (liquidLv > 10)
					{
						liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
					}
					liquidLv -= (int)(floatY * 0.5f);
					if (liquidLv < 0) 
					{ 
						liquidLv = 0; 
					} 
					param.liquidLv = liquidLv;
				}
				num4 = num9; 
				if (t.sourceCard.multisize && !t.trait.IsGround) 
				if (sourceObj.tileType.IsWaterTop) 
				{
					num8 += zSetting.multiZ; 
					param.liquidLv = 0; 
				}
				orgZ += t.renderer.data.stackZ; 
				if (param.liquidLv > 0) 
				else
				{
					param.liquidLv += pref.liquidMod; 
					param.liquidLv += sourceObj.pref.liquidMod; 
					if (param.liquidLv < 1)
					{
						param.liquidLv = 1; 
						param.liquid = 1f; 
					}
					else if (param.liquidLv > 99 + pref.liquidModMax) 
					else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax) 
					{
						param.liquidLv = 99 + pref.liquidModMax; 
						param.liquidLv = 99 + sourceObj.pref.liquidModMax; 
					}
				}
			}
			if (isInstalled && tileType.UseMountHeight) 
			if (sourceObj.useAltColor) 
			{
				if (tileType != TileType.Illumination || !this.cell.HasObj) 
				{ 
					if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude) 
					{ 
						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); 
				shadow = false; 
				param.liquidLv = 0; 
				if (t.freePos) 
				{ 
					_actorPos.x += t.fx; 
					_actorPos.y += t.fy; 
				} 
			} 
			else
			{ 
				if (t.altitude != 0) 
				{ 
					_actorPos += altitudeFix * t.altitude; 
					if (t.altitude > 2 && ((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))) 
					{ 
						continue; 
					} 
				} 
				if (t.freePos) 
				{ 
					_actorPos.x = orgX + t.fx - freePos.x; 
					_actorPos.y = orgY + t.fy - freePos.y; 
				} 
				if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen()) 
				{ 
					_actorPos.z += -0.5f; 
				} 
			} 
			if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz)) 
			{ 
				if (iconMode != 0) 
				{ 
					int num11 = 0; 
					switch (iconMode) 
					{ 
					case CardIconMode.Visibility: 
						if (t.isMasked) 
						{ 
							num11 = 17; 
						} 
						break; 
					case CardIconMode.State: 
						if (t.placeState == PlaceState.installed) 
						{ 
							num11 = 18; 
						} 
						break; 
					case CardIconMode.Deconstruct: 
						if (t.isDeconstructing) 
						{ 
							num11 = 14; 
						} 
						break; 
					} 
					if (t.isNPCProperty && !EMono.debug.godBuild) 
					{ 
						num11 = 13; 
					} 
					if (num11 != 0) 
					{ 
						passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num11); 
					} 
				} 
				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 && (shadow || tileType.AlwaysShowShadow)); 
					}); 
				} 
				else
				{ 
					t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow)); 
				} 
			} 
			if (isInstalled) 
			{ 
				num5 += pref.stackX * (float)((!t.flipX) ? 1 : (-1)); 
			} 
			param.x = orgX; 
			param.y = orgY; 
			param.z = orgZ; 
			param.color = floorLight; 
			thing = t; 
			if (pref.Float) 
			{ 
				liquidLv = 0; 
			} 
		} 
	} 
	orgY += num6; 
	if (detail.charas.Count <= 0) 
	{ 
		return; 
	} 
	param.shadowFix = 0f - num7; 
	param.color += 1310720f; 
	float max = zSetting.max2; 
	for (int k = 0; k < detail.charas.Count; k++) 
	{ 
		Chara chara = detail.charas[k]; 
		if (chara.host != null || (chara != EMono.pc && chara != LayerDrama.alwaysVisible && (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara))))) 
		{ 
			continue; 
		} 
		_actorPos.x = orgX; 
		_actorPos.y = orgY; 
		_actorPos.z = orgZ; 
		chara.SetRenderParam(param); 
		_ = chara.IsAliveInCurrentZone; 
		if (chara.isRestrained) 
		{ 
			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 num12 = 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 + num12; 
					_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; 
				} 
			} 
		} 
		if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz)) 
		{ 
			if (chara.IsDeadOrSleeping && chara.IsPCC) 
			{ 
				float num13 = chara.renderer.data.size.y * 0.3f; 
				if (thingPos.y > max) 
				{ 
					thingPos.y = max; 
				} 
				float num14 = thingPos.y + num13; 
				float num15 = (float)k * -0.01f; 
				if (num14 > zSetting.thresh1) 
				{ 
					num15 = zSetting.mod1; 
				} 
				_actorPos.x += thingPos.x; 
				_actorPos.y += thingPos.y; 
				_actorPos.z += renderSetting.laydownZ + num15; 
				param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0); 
				thingPos.y += num13 * 0.8f; 
				chara.renderer.Draw(param, ref _actorPos, liquidLv == 0); 
			} 
			else
			{ 
				param.liquidLv = liquidLv; 
				if (liquidLv > 0) 
				{ 
					if (chara.Pref.Float && !flag && !hasBridge) 
					{ 
						if (liquidLv > 20) 
						{ 
							float num16 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight); 
							orgY += 0.01f * floatY - num16; 
							_actorPos.y += 0.01f * floatY - num16; 
							int num17 = TileType.FloorWaterShallow.LiquidLV * 10; 
							num17 -= (int)(floatY * 0.5f); 
							param.liquidLv = num17; 
						} 
						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 && !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)k + 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; 
	} 
	return; 
	IL_6fc5: 
	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))) 
	{ 
		snowed = true; 
	} 
	if (this.cell.effect != null) 
	{ 
		if (this.cell.effect.IsLiquid) 
		{ 
			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
		{ 
			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 num18 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2]; 
					if (!(num18 >= (float)sourceEffect2.anime[0])) 
					{ 
						param.tile += num18; 
					} 
				} 
				else
				{ 
					float num19 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0]; 
					param.tile += num19; 
				} 
			} 
			if (this.cell.effect.IsFire) 
			{ 
				rendererEffect.Draw(param); 
			} 
			else
			{ 
				this.cell.effect.source.renderData.Draw(param); 
			} 
		} 
	} 
	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) 
			{ 
				if (sourceObj.pref.Float) 
				{ 
					param.y += 0.01f * floatY; 
					if (liquidLv > 10) 
					{ 
						liquidLv = TileType.FloorWaterShallow.LiquidLV * 10; 
					} 
					liquidLv -= (int)(floatY * 0.5f); 
					param.liquidLv = liquidLv; 
				} 
				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
			{ 
				param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod)); 
			} 
			if (sourceObj.HasGrowth) 
			{ 
				this.cell.growth.OnRenderTileMap(param); 
				if (this.cell.obj == 118 && Core.fixedFrame % 10f == 0f && sourceObj.growth.IsMature) 
				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); 
				if (this.cell.obj == 118 && Core.fixedFrame % 10f == 0f && sourceObj.growth.IsMature) 
				{
					EMono.scene.psFey.transform.position = new Vector3(param.x, param.y, param.z - 2f);
					EMono.scene.psFey.Emit(1);

@@ -1929,19 +1494,11 @@ public virtual void DrawTile()

cs
		param.matColor = 104025f;
		renderFootmark.Draw(param);
	}
	goto IL_7b80; 
	IL_6f65: 
	int num20; 
	if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null) 
	{ 
		param.tile = num20; 
		rendererFov.Draw(param); 
	} 
	goto IL_6fc5; 
	IL_167b: 
	goto IL_7b88; 
	IL_1683: 
	if (this.cell.isSlopeEdge)
	{
		float num21 = (float)height * _heightMod.y; 
		float num5 = (float)height * _heightMod.y; 
		orgY = param.y;
		orgZ = param.z;
		param.dir = this.cell.blockDir;

@@ -1971,17 +1528,17 @@ public virtual void DrawTile()

cs
				param.matColor = 104025f;
			}
		}
		for (int l = 0; (float)l < num21 / heightBlockSize; l++) 
		for (int j = 0; (float)j < num5 / heightBlockSize; j++) 
		{
			param.y += ugFix.y;
			param.z += ugFix.z + slopeFixZ * (float)l; 
			param.z += ugFix.z + slopeFixZ * (float)j; 
			defBlock.renderData.Draw(param);
			if (this.cell.pcSync && EMono.player.lightPower > 0f)
			{
				float num22 = param.tile; 
				float num6 = param.tile; 
				param.tile = 0f;
				rendererFov.Draw(param);
				param.tile = num22; 
				param.tile = num6; 
			}
		}
		param.y = orgY;

@@ -1992,29 +1549,29 @@ public virtual void DrawTile()

cs
	{
		orgY = param.y;
		orgZ = param.z;
		int num23 = 0; 
		int num7 = 0; 
		if (sourceBlock.tileType.IsFullBlock)
		{
			SourceBlock.Row row3 = sourceBlock;
			num23 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length]; 
			num7 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length]; 
		}
		else
		{
			SourceBlock.Row row3 = sourceFloor._defBlock;
			num23 = row3._tiles[this.cell.blockDir % row3._tiles.Length]; 
			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 = num23 + ((!this.cell.Front.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0); 
			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 = num23 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0); 
			param.tile = num7 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0); 
			rendererWaterBlock.Draw(param);
		}
		param.y = orgY;

@@ -2055,10 +1612,10 @@ public virtual void DrawTile()

cs
		{
			param.matColor = 104025f;
		}
		for (int m = 0; m < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); m++) 
		for (int k = 0; k < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); k++) 
		{
			param.y += ugFix.y;
			param.z += ugFix.z + slopeFixZ * (float)m; 
			param.z += ugFix.z + slopeFixZ * (float)k; 
			defBlock2.renderData.Draw(param);
		}
		param.y = orgY;

@@ -2112,20 +1669,20 @@ public virtual void DrawTile()

cs
				}
				sourceFloor.renderData.Draw(param);
			}
			int num24 = 0; 
			int num8 = 0; 
			if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
			{
				if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
				{
					num24++; 
					num8++; 
				}
				if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
				{
					num24 += 2; 
					num8 += 2; 
				}
				if (num24 != 0) 
				if (num8 != 0) 
				{
					param.tile = 448 + num24 + 12; 
					param.tile = 448 + num8 + 12; 
					param.z -= 0.1f;
					sourceFloor.renderData.Draw(param);
					param.z += 0.1f;

@@ -2196,7 +1753,7 @@ public virtual void DrawTile()

cs
					}
				}
			}
			if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num24 == 0) 
			if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num8 == 0) 
			{
				pass = (isWater ? passAutoTileWater : passAutoTile);
				batch = pass.batches[pass.batchIdx];

@@ -2215,16 +1772,16 @@ public virtual void DrawTile()

cs
		}
		if (isWater)
		{
			int num25 = 12; 
			int num26 = this.cell.shore / num25; 
			int num27 = this.cell.shore % num25; 
			int num9 = 12; 
			int num10 = this.cell.shore / num9; 
			int num11 = this.cell.shore % num9; 
			bool isShoreSand = this.cell.isShoreSand;
			if (this.cell.shore != 0)
			{
				Cell cell = ((((uint)num26 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num26 & 2u) != 0) ? this.cell.Right : ((((uint)num26 & 4u) != 0) ? this.cell.Front : this.cell.Left))); 
				Cell cell = ((((uint)num10 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num10 & 2u) != 0) ? this.cell.Right : ((((uint)num10 & 4u) != 0) ? this.cell.Front : this.cell.Left))); 
				if (isShoreSand && !cell.sourceFloor.isBeach)
				{
					cell = ((((uint)num26 & 8u) != 0) ? this.cell.Left : ((((uint)num26 & 4u) != 0) ? this.cell.Front : ((((uint)num26 & 2u) != 0) ? this.cell.Right : this.cell.Back))); 
					cell = ((((uint)num10 & 8u) != 0) ? this.cell.Left : ((((uint)num10 & 4u) != 0) ? this.cell.Front : ((((uint)num10 & 2u) != 0) ? this.cell.Right : this.cell.Back))); 
				}
				if (!cell.IsSnowTile)
				{

@@ -2236,7 +1793,7 @@ public virtual void DrawTile()

cs
						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 / num25; 
						batch.tiles[pass.idx] = 768 + this.cell.shore / num9; 
						batch.colors[pass.idx] = param.color;
						batch.matColors[pass.idx] = param.matColor;
						pass.idx++;

@@ -2244,38 +1801,38 @@ public virtual void DrawTile()

cs
						{
							pass.NextBatch();
						}
						num27 = 2; 
						num11 = 2; 
					}
					else
					{
						num27 = cell.sourceFloor.edge; 
						num11 = cell.sourceFloor.edge; 
					}
					param.tile = (24 + num27 / 2) * 32 + num27 % 2 * 16 + num26; 
					param.tile = (24 + num11 / 2) * 32 + num11 % 2 * 16 + num10; 
					rendererShore.Draw(param);
				}
			}
			if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num25) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num25) & (true ? 1u : 0u)) != 0) 
			if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num9) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num9) & (true ? 1u : 0u)) != 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 && ((uint)(this.cell.Back.shore / num25) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num25) & (true ? 1u : 0u)) != 0) 
			if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num9) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num9) & (true ? 1u : 0u)) != 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 && ((uint)(this.cell.Front.shore / num25) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num25) & 4u) != 0) 
			if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num9) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num9) & 4u) != 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 && ((uint)(this.cell.Front.shore / num25) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num25) & 4u) != 0) 
			if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num9) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num9) & 4u) != 0) 
			{
				param.tile = 788f;
				param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);

@@ -2298,48 +1855,48 @@ public virtual void DrawTile()

cs
					pass.NextBatch();
				}
			}
			bool flag8 = false; 
			bool flag6 = false; 
			if (isShoreSand)
			{
				if (((uint)num26 & (true ? 1u : 0u)) != 0) 
				if (((uint)num10 & (true ? 1u : 0u)) != 0) 
				{
					if (((uint)num26 & 8u) != 0) 
					if (((uint)num10 & 8u) != 0) 
					{
						if ((num26 & 2) == 0 && (num26 & 4) == 0) 
						if ((num10 & 2) == 0 && (num10 & 4) == 0) 
						{
							Draw(16);
						}
						flag8 = true; 
						flag6 = true; 
					}
					if (((uint)num26 & 2u) != 0) 
					if (((uint)num10 & 2u) != 0) 
					{
						if ((num26 & 8) == 0 && (num26 & 4) == 0) 
						if ((num10 & 8) == 0 && (num10 & 4) == 0) 
						{
							Draw(20);
						}
						flag8 = true; 
						flag6 = true; 
					}
				}
				if (((uint)num26 & 4u) != 0) 
				if (((uint)num10 & 4u) != 0) 
				{
					if (((uint)num26 & 8u) != 0) 
					if (((uint)num10 & 8u) != 0) 
					{
						if ((num26 & 2) == 0 && (num26 & 1) == 0) 
						if ((num10 & 2) == 0 && (num10 & 1) == 0) 
						{
							Draw(24);
						}
						flag8 = true; 
						flag6 = true; 
					}
					if (((uint)num26 & 2u) != 0) 
					if (((uint)num10 & 2u) != 0) 
					{
						if ((num26 & 8) == 0 && (num26 & 1) == 0) 
						if ((num10 & 8) == 0 && (num10 & 1) == 0) 
						{
							Draw(28);
						}
						flag8 = true; 
						flag6 = true; 
					}
				}
				if (!flag8) 
				if (!flag6) 
				{
					if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
					{

@@ -2351,7 +1908,7 @@ public virtual void DrawTile()

cs
					}
				}
			}
			if (!flag8) 
			if (!flag6) 
			{
				if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
				{

@@ -2359,7 +1916,7 @@ public virtual void DrawTile()

cs
					batch = pass.batches[pass.batchIdx];
					batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
					batch.matColors[pass.idx] = 104025f;
					if (((uint)(this.cell.shore / num25) & (true ? 1u : 0u)) != 0) 
					if (((uint)(this.cell.shore / num9) & (true ? 1u : 0u)) != 0) 
					{
						if (isShoreSand)
						{

@@ -2397,7 +1954,7 @@ public virtual void DrawTile()

cs
					batch = pass.batches[pass.batchIdx];
					batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
					batch.matColors[pass.idx] = 104025f;
					if (((uint)(this.cell.shore / num25) & 8u) != 0) 
					if (((uint)(this.cell.shore / num9) & 8u) != 0) 
					{
						if (isShoreSand)
						{

@@ -2513,16 +2070,16 @@ public virtual void DrawTile()

cs
			param.z += bridgeFix.z;
			param.dir = 0;
			SourceBlock.Row row4 = sourceBridge._bridgeBlock;
			float num28 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y; 
			float num12 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y; 
			if (this.cell.sourceFloor.tileType == TileType.Sky)
			{
				num28 += (float)EMono._map.config.skyBlockHeight; 
				num12 += (float)EMono._map.config.skyBlockHeight; 
			}
			int num29 = (int)(num28 / heightBlockSize) + 2; 
			int num13 = (int)(num12 / heightBlockSize) + 2; 
			if (this.cell.bridgePillar != 0)
			{
				row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
				param.tile = row4._tiles[0] + ((num29 == 2) ? 32 : 0); 
				param.tile = row4._tiles[0] + ((num13 == 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));
			}

@@ -2534,9 +2091,9 @@ public virtual void DrawTile()

cs
			}
			param.y += ugFixBridgeTop.y;
			param.z += ugFixBridgeTop.z;
			for (int n = 0; n < num29; n++) 
			for (int l = 0; l < num13; l++) 
			{
				if (n == num29 - 1) 
				if (l == num13 - 1) 
				{
					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;

@@ -2568,13 +2125,13 @@ public virtual void DrawTile()

cs
	{
		snowed = false;
	}
	num20 = 0; 
	int num14 = 0; 
	if (sourceBlock.id != 0)
	{
		this.tileType = sourceBlock.tileType;
		roomHeight = 0f;
		int blockDir = this.cell.blockDir;
		bool flag9 = false; 
		bool flag7 = false; 
		switch (wallClipMode)
		{
		case WallClipMode.ByRoom:

@@ -2618,8 +2175,8 @@ public virtual void DrawTile()

cs
					}
				}
			}
			flag9 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium); 
			if (flag9) 
			flag7 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium); 
			if (flag7) 
			{
				_lowblock = false;
			}

@@ -2641,8 +2198,8 @@ public virtual void DrawTile()

cs
					roomHeight = 0f;
					break;
				}
				int num30 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight); 
				roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num30) ? this.room.lot.height : num30) + 0.01f * (float)this.room.lot.heightFix; 
				int num15 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight); 
				roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num15) ? this.room.lot.height : num15) + 0.01f * (float)this.room.lot.heightFix; 
			}
			break;
		case WallClipMode.ByLot:

@@ -2688,11 +2245,11 @@ public virtual void DrawTile()

cs
		}
		if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
		{
			num20 = 1; 
			num14 = 1; 
		}
		else if (lowBlock)
		{
			num20 = 2; 
			num14 = 2; 
		}
		param.mat = matBlock;
		param.dir = this.cell.blockDir;

@@ -2739,11 +2296,11 @@ public virtual void DrawTile()

cs
				}
				if (!_lowblock)
				{
					int num31 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight); 
					roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num31) ? currentRoom.lot.height : num31) + 0.01f * (float)currentRoom.lot.heightFix; 
					int num16 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight); 
					roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num16) ? currentRoom.lot.height : num16) + 0.01f * (float)currentRoom.lot.heightFix; 
				}
			}
			if (flag9) 
			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)

@@ -2773,62 +2330,62 @@ public virtual void DrawTile()

cs
			{
				sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0, isBlock: true);
			}
			Room room2 = this.cell.Front.room ?? this.cell.room; 
			if (room2 == null && this.cell.Right.room != null) 
			Room room = this.cell.Front.room ?? this.cell.room; 
			if (room == null && this.cell.Right.room != null) 
			{
				room2 = this.cell.Right.room; 
				room = this.cell.Right.room; 
			}
			if (!invisible && room2 != null) 
			if (!invisible && room != null) 
			{
				if (room2.lot.idDeco != 0 && !this.cell.hasDoor) 
				if (room.lot.idDeco != 0 && !this.cell.hasDoor) 
				{
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco); 
					param.matColor = room2.lot.colDeco; 
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco); 
					param.matColor = room.lot.colDeco; 
					float y = param.y;
					param.y += (float)room2.lot.decoFix * 0.01f; 
					param.y += (float)room.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) 
				if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y) 
				{
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2); 
					param.matColor = room2.lot.colDeco2; 
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco2); 
					param.matColor = room.lot.colDeco2; 
					float y2 = param.y;
					float num32 = param.z; 
					param.y += (float)room2.lot.decoFix2 * 0.01f; 
					param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco; 
					float num17 = 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 = num32; 
					param.z = num17; 
				}
			}
			room2 = this.cell.Right.room ?? this.cell.room; 
			if (room2 == null && this.cell.Front.room != null) 
			room = this.cell.Right.room ?? this.cell.room; 
			if (room == null && this.cell.Front.room != null) 
			{
				room2 = this.cell.Front.room; 
				room = this.cell.Front.room; 
			}
			if (!invisible && room2 != null) 
			if (!invisible && room != null) 
			{
				if (room2.lot.idDeco != 0 && !this.cell.hasDoor) 
				if (room.lot.idDeco != 0 && !this.cell.hasDoor) 
				{
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco) * -1; 
					param.matColor = room2.lot.colDeco; 
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco) * -1; 
					param.matColor = room.lot.colDeco; 
					float y3 = param.y;
					param.y += (float)room2.lot.decoFix * 0.01f; 
					param.y += (float)room.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) 
				if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y) 
				{
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2) * -1; 
					param.matColor = room2.lot.colDeco2; 
					param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco2) * -1; 
					param.matColor = room.lot.colDeco2; 
					float y4 = param.y;
					float num33 = param.z; 
					param.y += (float)room2.lot.decoFix2 * 0.01f; 
					param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco; 
					float num18 = 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 = num33; 
					param.z = num18; 
				}
			}
			break;

@@ -2843,56 +2400,167 @@ public virtual void DrawTile()

cs
			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; 
			bool flag8 = blockDir == 1 || _lowblock || flag7; 
			bool flag9 = blockDir == 0 || _lowblock || flag7; 
			if (!showFullWall && currentRoom != null)
			{
				if (!flag10) 
				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))
						{
							flag10 = true; 
							flag8 = true; 
						}
					}
					else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
					{
						flag10 = true; 
						flag8 = true; 
					}
				}
				if (!flag11) 
				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))
						{
							flag11 = true; 
							flag9 = true; 
						}
					}
					else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
					{
						flag11 = true; 
						flag9 = true; 
					}
				}
			}
			if (blockDir == 0 || blockDir == 2)
			{
				param.dir = 0;
				Room room3 = this.cell.Front.room ?? this.cell.room; 
				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.rows[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.rows[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) 
				{ 
					_sourceBlock = left.sourceBlock; 
					param.mat = left.matBlock; 
				} 
				else
				{ 
					_sourceBlock = sourceBlock; 
					param.mat = matBlock; 
				} 
				this.tileType = _sourceBlock.tileType; 
				param.tile = (tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock) ? 32 : 0)); 
				if (_sourceBlock.useAltColor) 
				{ 
					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 || flag8 || !this.tileType.RepeatBlock) 
				{ 
					if (!this.cell.hasDoor) 
					{ 
						_sourceBlock.renderData.Draw(param); 
					} 
				} 
				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
					{ 
						_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix); 
					} 
				} 
				if (!flag8 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.isToggleWallPillar) 
				{ 
					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; 
				} 
				else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag8 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar) 
				{ 
					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; 
				} 
			} 
			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 (room3.lot.idDeco != 0 && !this.cell.hasDoor)
					{
						param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco); 
						param.tile = -EMono.sources.blocks.rows[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 (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag10 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y) 
					if (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag9 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y) 
					{
						param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco2); 
						param.tile = -EMono.sources.blocks.rows[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;

@@ -2901,11 +2569,29 @@ public virtual void DrawTile()

cs
						param.z = orgZ;
					}
				}
				Cell left = this.cell.Left; 
				if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall) 
				if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null) 
				{ 
					Room room4 = this.cell.Right.room; 
					maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room4.lot.mh * _heightMod.y; 
					if (showRoof) 
					{ 
						roomHeight = room4.lot.realHeight; 
					} 
					else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock)) 
					{ 
						roomHeight = 0f; 
					} 
					else
					{ 
						int num19 = ((room4.data.maxHeight == 0) ? 2 : room4.data.maxHeight); 
						roomHeight = EMono.setting.render.roomHeightMod * (float)((room4.lot.height < num19) ? room4.lot.height : num19) + 0.01f * (float)room4.lot.heightFix; 
					} 
				} 
				Cell back2 = this.cell.Back; 
				if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall) 
				{
					_sourceBlock = left.sourceBlock; 
					param.mat = left.matBlock; 
					_sourceBlock = back2.sourceBlock; 
					param.mat = back2.matBlock; 
				}
				else
				{

@@ -2913,7 +2599,7 @@ public virtual void DrawTile()

cs
					param.mat = matBlock;
				}
				this.tileType = _sourceBlock.tileType;
				param.tile = (tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock) ? 32 : 0)); 
				param.tile = (tile = -_sourceBlock._tiles[0] + ((flag9 && this.tileType.UseLowBlock) ? (-32) : 0)); 
				if (_sourceBlock.useAltColor)
				{
					param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));

@@ -2922,7 +2608,8 @@ public virtual void DrawTile()

cs
				{
					param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
				}
				if (roomHeight == 0f || flag10 || !this.tileType.RepeatBlock) 
				param.color += _rightWallShade; 
				if (roomHeight == 0f || flag9 || !this.tileType.RepeatBlock) 
				{
					if (!this.cell.hasDoor)
					{

@@ -2933,15 +2620,15 @@ public virtual void DrawTile()

cs
				{
					_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.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar)) 
				{
					if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile) 
					if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile) 
					{
						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)) 
					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);
					}

@@ -2949,203 +2636,539 @@ public virtual void DrawTile()

cs
					{
						_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
					}
					param.x = orgX; 
				} 
			} 
			param.y = orgY; 
			param.z = orgZ; 
			break; 
		} 
		case BlockRenderMode.HalfBlock:
			param.color = floorLight; 
			_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[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 num20 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1; 
			if (num20 == 0) 
			{ 
				renderData2.Draw(param); 
			} 
			else
			{ 
				renderData2.DrawRepeat(param, num20, 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; 
		} 
		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) 
			{ 
				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_6f6d; 
		} 
		if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock) 
		{ 
			Room obj = this.cell.FrontRight.room; 
			if (obj == null || !obj.HasRoof) 
			{ 
				goto IL_6f6d; 
			} 
		} 
	} 
	goto IL_6fcd; 
	IL_6f6d: 
	if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null) 
	{ 
		param.tile = num14; 
		rendererFov.Draw(param); 
	} 
	goto IL_6fcd; 
	IL_7b88: 
	if (detail.things.Count == 0 && detail.charas.Count == 0) 
	{ 
		return; 
	} 
	int num21 = 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 shadow = liquidLv == 0; 
	float num22 = 0f; 
	float num23 = 0f; 
	bool flag10 = false; 
	float num24 = 0f; 
	bool flag11 = false; 
	float num25 = 0f; 
	if (detail.things.Count > 0 && isSeen) 
	{ 
		_ = zSetting.max1; 
		float num26 = 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) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem)) 
			{ 
				continue; 
			} 
			TileType tileType = t.trait.tileType; 
			bool isInstalled = t.IsInstalled; 
			SourcePref pref = t.Pref; 
			if (!isInstalled && t.category.tileDummy != 0) 
			{ 
				pref = rendererObjDummy.shadowPref; 
			} 
			float num27 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height))); 
			if (t.ignoreStackHeight) 
			{ 
				thingPos.y -= num22; 
			} 
			shadow = thingPos.y < 0.16f && num25 < 0.16f; 
			_ = 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 + num26; 
				if (this.room != null) 
				{ 
					param.color = GetRoofLight(this.room.lot); 
				} 
				shadow = false; 
				param.liquidLv = 0; 
			} 
			else
			{ 
				param.snow = snowed; 
				_actorPos.x = orgX + num23; 
				_actorPos.y = orgY; 
				_actorPos.z = orgZ + num26 + thingPos.z; 
				if (tileType.CanStack || !isInstalled) 
				{ 
					if (thing?.id != t.id) 
					{ 
						_actorPos.x += thingPos.x; 
					} 
					_actorPos.y += thingPos.y; 
					if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight)) 
					{ 
						thingPos.y -= num22; 
						if (thing != null) 
						{ 
							_actorPos.z -= 0.2f; 
							thingPos.z -= 0.2f; 
						} 
						_actorPos.y -= num22; 
					} 
					_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y; 
				}
				if (!flag10 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.isToggleWallPillar) 
				if (isInstalled) 
				{
					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)) 
					if (t.TileType.IsRamp) 
					{
						_sourceBlock.renderData.Draw(param); 
						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) 
						{ 
							num25 += rampFix2.y; 
						} 
						liquidLv -= (int)(rampFix2.y * 150f); 
						if (liquidLv < 0) 
						{ 
							liquidLv = 0; 
						} 
					} 
					else if (!flag11 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight) 
					{ 
						orgY += num27 + (float)t.altitude * altitudeFix.y; 
						orgZ += (float)t.altitude * altitudeFix.z; 
						freePos.y += num27 + (float)t.altitude * altitudeFix.y; 
						if (!this.cell.IsTopWater || t.altitude > 0) 
						{ 
							num25 += num27 + (float)t.altitude * altitudeFix.y; 
						} 
						_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1)); 
						_actorPos.z += pref.z; 
						thingPos.z += pref.z; 
						liquidLv -= (int)(num27 * 150f); 
						if (liquidLv < 0) 
						{ 
							liquidLv = 0; 
						} 
					}
					else
					{
						_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix); 
						thingPos.y += num27; 
						_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1)); 
						_actorPos.z += pref.z; 
						if (pref.height >= 0f) 
						{ 
							thingPos.z += pref.z; 
						} 
					} 
					if (!tileType.UseMountHeight && m > 10) 
					{ 
						flag11 = true; 
					}
					param.x = orgX; 
				}
				else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag10 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar) 
				else
				{
					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)) 
					thingPos.y += num27; 
					_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 num28 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight); 
					orgY += 0.01f * floatY - num28; 
					num24 = num27; 
					_actorPos.y += 0.01f * floatY - num28; 
					if (liquidLv > 10) 
					{
						_sourceBlock.renderData.Draw(param); 
						liquidLv = TileType.FloorWaterShallow.LiquidLV * 10; 
					}
					else
					liquidLv -= (int)(floatY * 0.5f); 
					if (liquidLv < 0) 
					{
						_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix); 
						liquidLv = 0; 
					}
					param.x = orgX; 
					param.liquidLv = liquidLv; 
				}
			} 
			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) 
				num22 = num27; 
				if (t.sourceCard.multisize && !t.trait.IsGround) 
				{ 
					num26 += zSetting.multiZ; 
				} 
				orgZ += t.renderer.data.stackZ; 
				if (param.liquidLv > 0) 
				{
					if (room4.lot.idDeco != 0 && !this.cell.hasDoor) 
					param.liquidLv += pref.liquidMod; 
					if (param.liquidLv < 1) 
					{
						param.tile = -EMono.sources.blocks.rows[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; 
						param.liquidLv = 1; 
					}
					if (room4.lot.idDeco2 != 0 && roomHeight != 0f && !flag11 && (float)room4.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y) 
					else if (param.liquidLv > 99 + pref.liquidModMax) 
					{
						param.tile = -EMono.sources.blocks.rows[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; 
						param.liquidLv = 99 + pref.liquidModMax; 
					}
				}
				if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null) 
			} 
			if (isInstalled && tileType.UseMountHeight) 
			{ 
				if (tileType != TileType.Illumination || !this.cell.HasObj) 
				{
					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)) 
					if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude) 
					{
						roomHeight = 0f; 
						continue; 
					}
					else
					if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom))) 
					{
						int num34 = ((room5.data.maxHeight == 0) ? 2 : room5.data.maxHeight); 
						roomHeight = EMono.setting.render.roomHeightMod * (float)((room5.lot.height < num34) ? room5.lot.height : num34) + 0.01f * (float)room5.lot.heightFix; 
						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; 
						} 
					}
				}
				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; 
				} 
				this.tileType = _sourceBlock.tileType; 
				param.tile = (tile = -_sourceBlock._tiles[0] + ((flag11 && this.tileType.UseLowBlock) ? (-32) : 0)); 
				if (_sourceBlock.useAltColor) 
				if (tileType.UseHangZFix) 
				{
					param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod)); 
					flag10 = true; 
				}
				else
				tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t); 
				shadow = false; 
				param.liquidLv = 0; 
				if (t.freePos) 
				{
					param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod)); 
					_actorPos.x += t.fx; 
					_actorPos.y += t.fy; 
				}
				param.color += _rightWallShade; 
				if (roomHeight == 0f || flag11 || !this.tileType.RepeatBlock) 
			} 
			else
			{ 
				if (t.altitude != 0) 
				{
					if (!this.cell.hasDoor) 
					_actorPos += altitudeFix * t.altitude; 
					if (t.altitude > 2 && ((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))) 
					{
						_sourceBlock.renderData.Draw(param); 
						continue; 
					}
				}
				else
				if (t.freePos) 
				{
					_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0); 
					_actorPos.x = orgX + t.fx - freePos.x; 
					_actorPos.y = orgY + t.fy - freePos.y; 
				}
				if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar)) 
				if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen()) 
				{
					if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile) 
					_actorPos.z += -0.5f; 
				} 
			} 
			if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz)) 
			{ 
				if (iconMode != 0) 
				{ 
					int num29 = 0; 
					switch (iconMode) 
					{
						param.snow = true; 
					case CardIconMode.Visibility: 
						if (t.isMasked) 
						{ 
							num29 = 17; 
						} 
						break; 
					case CardIconMode.State: 
						if (t.placeState == PlaceState.installed) 
						{ 
							num29 = 18; 
						} 
						break; 
					case CardIconMode.Deconstruct: 
						if (t.isDeconstructing) 
						{ 
							num29 = 14; 
						} 
						break; 
					}
					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)) 
					if (t.isNPCProperty && !EMono.debug.godBuild) 
					{
						_sourceBlock.renderData.Draw(param); 
						num29 = 13; 
					}
					else
					if (num29 != 0) 
					{
						_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix); 
						passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num29); 
					}
					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 && (shadow || tileType.AlwaysShowShadow)); 
					}); 
				} 
				else
				{ 
					t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow)); 
				}
			}
			param.y = orgY; 
			param.z = orgZ; 
			break; 
		} 
		case BlockRenderMode.HalfBlock:
			param.color = floorLight; 
			_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[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 num35 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1; 
			if (num35 == 0) 
			{ 
				renderData2.Draw(param); 
			} 
			else
			if (isInstalled) 
			{
				renderData2.DrawRepeat(param, num35, sourceBlock.tileType.RepeatSize); 
				num23 += pref.stackX * (float)((!t.flipX) ? 1 : (-1)); 
			}
			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; 
		} 
		default: 
			param.x = orgX; 
			param.y = orgY; 
			param.z = orgZ; 
			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) 
			{ 
				sourceBlock.renderData.Draw(param); 
			} 
			else
			thing = t; 
			if (pref.Float) 
			{
				sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock); 
				liquidLv = 0; 
			}
			break; 
		}
	}
	if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode) 
	orgY += num24; 
	if (detail.charas.Count <= 0) 
	{
		if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof) 
		return; 
	} 
	param.shadowFix = 0f - num25; 
	param.color += 1310720f; 
	float max = zSetting.max2; 
	for (int n = 0; n < detail.charas.Count; n++) 
	{ 
		Chara chara = detail.charas[n]; 
		if (chara.host != null || (chara != EMono.pc && chara != LayerDrama.alwaysVisible && (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara))))) 
		{
			goto IL_6f65; 
			continue; 
		}
		if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock) 
		_actorPos.x = orgX; 
		_actorPos.y = orgY; 
		_actorPos.z = orgZ; 
		chara.SetRenderParam(param); 
		_ = chara.IsAliveInCurrentZone; 
		if (chara.isRestrained) 
		{
			Room obj = this.cell.FrontRight.room; 
			if (obj == null || !obj.HasRoof) 
			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 num30 = 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 + num30; 
					_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; 
				} 
			} 
		} 
		if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz)) 
		{ 
			if (chara.IsDeadOrSleeping && chara.IsPCC) 
			{ 
				float num31 = chara.renderer.data.size.y * 0.3f; 
				if (thingPos.y > max) 
				{ 
					thingPos.y = max; 
				} 
				float num32 = thingPos.y + num31; 
				float num33 = (float)n * -0.01f; 
				if (num32 > zSetting.thresh1) 
				{ 
					num33 = zSetting.mod1; 
				} 
				_actorPos.x += thingPos.x; 
				_actorPos.y += thingPos.y; 
				_actorPos.z += renderSetting.laydownZ + num33; 
				param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0); 
				thingPos.y += num31 * 0.8f; 
				chara.renderer.Draw(param, ref _actorPos, liquidLv == 0); 
			} 
			else
			{
				goto IL_6f65; 
				param.liquidLv = liquidLv; 
				if (isUnderwater) 
				{ 
					if (chara.Pref.FloatUnderwater) 
					{ 
						float num34 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight); 
						float num35 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30); 
						orgY += 0.01f * num35 - num34; 
						_actorPos.y += 0.01f * num35 - num34; 
						param.shadowFix -= 0.01f * num35 - num34; 
					} 
				} 
				else if (liquidLv > 0) 
				{ 
					if (chara.Pref.Float && !flag && !hasBridge) 
					{ 
						if (liquidLv > 20) 
						{ 
							float num36 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight); 
							orgY += 0.01f * floatY - num36; 
							_actorPos.y += 0.01f * floatY - num36; 
							int num37 = TileType.FloorWaterShallow.LiquidLV * 10; 
							num37 -= (int)(floatY * 0.5f); 
							param.liquidLv = num37; 
						} 
						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 && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC)) 
				{ 
					_actorPos += renderSetting.charaPos[1 + ((num21 < 4) ? num21 : 3)]; 
				} 
				_actorPos.z += 0.01f * (float)n + renderSetting.charaZ; 
				num21++; 
				if (flag10) 
				{ 
					_actorPos.z += chara.renderer.data.hangedFixZ; 
				} 
				chara.renderer.Draw(param, ref _actorPos, liquidLv == 0); 
			}
		}
		param.x = orgX; 
		param.y = orgY; 
		param.z = orgZ; 
	}
	goto IL_6fc5; 
	void Draw(int tile)
	{
		pass = passEdge;

Biography

@@ -462,21 +462,19 @@ public void SetGender(int g)

cs

	public void SetPortrait(Chara c)
	{
		string id = c.id; 
		if (!(id == "shojo")) 
		{ 
			if (id == "sister") 
			{ 
				c.c_idPortrait = Portrait.GetRandomPortrait("special_f-littlesister"); 
			} 
			else
			{ 
				c.c_idPortrait = Portrait.GetRandomPortrait(gender, c.GetIdPortraitCat()); 
			} 
		} 
		else
		switch (c.id) 
		{
		case "shojo": 
			c.c_idPortrait = Portrait.GetRandomPortrait("special_f-littlegirl");
			break; 
		case "sister": 
		case "sister_shark": 
		case "sister_penguin": 
			c.c_idPortrait = Portrait.GetRandomPortrait("special_f-littlesister"); 
			break; 
		default: 
			c.c_idPortrait = Portrait.GetRandomPortrait(gender, c.GetIdPortraitCat()); 
			break; 
		}
	}

ConBuffStats

@@ -27,7 +27,7 @@ public override ConditionType Type

cs

	public override int EvaluateTurn(int p)
	{
		if (base.refVal2 == 267) 
		if (base.refVal2 == 268) 
		{
			return 7;
		}

@@ -95,7 +95,7 @@ public override void SetOwner(Chara _owner, bool onDeserialize = false)

cs

	public int CalcValue()
	{
		if (base.refVal2 == 267) 
		if (base.refVal2 == 268) 
		{
			return 100 + (int)Mathf.Sqrt(base.power) * 2;
		}

ELEMENT

@@ -624,7 +624,7 @@ public void _WriteNote(UINote n, Chara c, Act act)

cs
				switch (act.id)
				{
				case 6902:
					condition.SetRefVal(79, 267); 
					condition.SetRefVal(79, 268); 
					break;
				case 8510:
				case 8710:

EffectId

@@ -80,40 +80,41 @@ public enum EffectId

cs
	Buff = 256,
	Debuff = 257,
	Weaken = 258,
	Bubble = 259, 
	Web = 260, 
	MistOfDarkness = 261, 
	NeckHunt = 262, 
	Puddle = 263, 
	PuddleEffect = 264, 
	RemedyJure = 265, 
	AbsorbMana = 266, 
	LulwyTrick = 267, 
	JureHeal = 268, 
	KizuamiTrick = 269, 
	CureCorruption = 270, 
	Headpat = 271, 
	Meteor = 272, 
	Exterminate = 273, 
	Earthquake = 274, 
	MagicMap = 275, 
	Escape = 276, 
	Boost = 277, 
	EnchantWeaponGreat = 278, 
	EnchantArmorGreat = 279, 
	RemoveHex = 280, 
	RemoveHexAll = 281, 
	Duplicate = 282, 
	Suicide = 283, 
	ShutterHex = 284, 
	Draw = 285, 
	Reconstruction = 286, 
	DrainBlood = 287, 
	Steal = 288, 
	Scream = 289, 
	DropMine = 290, 
	ThrowPotion = 291, 
	DrainMana = 292, 
	Swarm = 293, 
	Sword = 294
	DebuffKizuami = 259, 
	Bubble = 260, 
	Web = 261, 
	MistOfDarkness = 262, 
	NeckHunt = 263, 
	Puddle = 264, 
	PuddleEffect = 265, 
	RemedyJure = 266, 
	AbsorbMana = 267, 
	LulwyTrick = 268, 
	JureHeal = 269, 
	KizuamiTrick = 270, 
	CureCorruption = 271, 
	Headpat = 272, 
	Meteor = 273, 
	Exterminate = 274, 
	Earthquake = 275, 
	MagicMap = 276, 
	Escape = 277, 
	Boost = 278, 
	EnchantWeaponGreat = 279, 
	EnchantArmorGreat = 280, 
	RemoveHex = 281, 
	RemoveHexAll = 282, 
	Duplicate = 283, 
	Suicide = 284, 
	ShutterHex = 285, 
	Draw = 286, 
	Reconstruction = 287, 
	DrainBlood = 288, 
	Steal = 289, 
	Scream = 290, 
	DropMine = 291, 
	ThrowPotion = 292, 
	DrainMana = 293, 
	Swarm = 294, 
	Sword = 295
}

EloMap

@@ -378,6 +378,10 @@ public bool CanBuildSite(int gx, int gy, int radius = 0, ElomapSiteType type = E

cs
		return false;
	}
	SourceGlobalTile.Row row = GetSources(gx, gy).LastItem();
	if (row == null) 
	{ 
		return false; 
	} 
	switch (type)
	{
	case ElomapSiteType.NefiaWater:

GameDate

@@ -193,6 +193,10 @@ public void AdvanceDay()

cs
	{
		EClass.game.quests.Add("fiama_starter_gift", "fiama");
	}
	if (EClass.game.quests.completedIDs.Contains("demitas_spellwriter") && !EClass.game.quests.IsAdded<QuestNegotiationDarkness>()) 
	{ 
		EClass.game.quests.Add("negotiation_darkness", "loytel"); 
	} 
	if (EClass.game.quests.IsCompleted("exploration"))
	{
		EClass.player.flags.daysAfterQuestExploration++;

PrefFlag

@@ -6,5 +6,6 @@ public enum PrefFlag

cs
	UsePref = 1,
	Test1 = 2,
	Float = 4,
	Surface = 8
	Surface = 8, 
	FloatUnderwater = 0x10
}

QuestManager

@@ -124,6 +124,22 @@ public void OnAdvanceHour()

cs
		});
	}

	public bool IsAdded<T>() where T : Quest
	{ 
		if (IsStarted<T>()) 
		{ 
			return true; 
		} 
		foreach (Quest global in globalList) 
		{ 
			if (global is T) 
			{ 
				return true; 
			} 
		} 
		return false; 
	} 
	public bool IsStarted<T>() where T : Quest
	{
		return GetPhase<T>() != -1;

+QuestNegotiationDarkness

File Created
cs
public class QuestNegotiationDarkness : QuestProgression
{
	public override string TitlePrefix => "★";

	public override bool CanUpdateOnTalk(Chara c)
	{
		return false;
	}
}

SourcePref

@@ -313,6 +313,8 @@ public bool bypassShadow

cs

	public bool Surface => (ints[1] & 8) != 0;

	public bool FloatUnderwater => (ints[1] & 0x10) != 0; 
	public void OnAfterDeserialize()
	{
		if (ints.Length >= 25)

Thing

@@ -1594,7 +1594,7 @@ public override bool CanStackTo(Thing to)

cs
	{
		return false;
	}
	if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix) 
	if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix || to.c_priceCopy != base.c_priceCopy) 
	{
		return false;
	}

TraitDeed

@@ -13,21 +13,28 @@ public override void OnRead(Chara c)

cs
		}
		Dialog.YesNo("dialog_claimLand", delegate
		{
			EClass._zone.ClaimZone(); 
			owner.ModNum(-1); 
			WidgetMenuPanel.OnChangeMode(); 
			if (EClass._zone == EClass.game.StartZone) 
			if (EClass._zone.GetInt(2) != 0) 
			{
				if (EClass.game.quests.Get<QuestHome>() != null) 
				{ 
					EClass.game.quests.Home.ChangePhase(1); 
				} 
				if (QuestMain.Phase < 200) 
				Msg.Say("claimCooldown2"); 
			} 
			else
			{ 
				EClass._zone.ClaimZone(); 
				owner.ModNum(-1); 
				WidgetMenuPanel.OnChangeMode(); 
				if (EClass._zone == EClass.game.StartZone) 
				{
					EClass.game.quests.Main.ChangePhase(200); 
					if (EClass.game.quests.Get<QuestHome>() != null) 
					{ 
						EClass.game.quests.Home.ChangePhase(1); 
					} 
					if (QuestMain.Phase < 200) 
					{ 
						EClass.game.quests.Main.ChangePhase(200); 
					} 
				}
				EClass.player.EndTurn(); 
			}
			EClass.player.EndTurn(); 
		});
	}
}

TraitDrinkMilkMother

@@ -82,6 +82,7 @@ public override void OnDrink(Chara c)

cs
			case "duck":
			case "shamo":
			case "penguin":
			case "penguin_emperor":
				c.idSkin = 0;
				break;
			}

TraitFoodEggFertilized

@@ -82,6 +82,7 @@ public static void MakeBaby(Chara c, int baby)

cs
	case "chicken":
	case "duck":
	case "penguin":
	case "penguin_emperor":
		c.idSkin = 1;
		break;
	}

Zone_Exile

@@ -1,3 +1,10 @@

cs
public class Zone_Exile : Zone_SubTown
{
	public override void OnActivate() 
	{ 
		if (EClass.game.quests.GetPhase<QuestNegotiationDarkness>() == 0) 
		{ 
			EClass.game.quests.Get<QuestNegotiationDarkness>().NextPhase(); 
		} 
	} 
}