EA 23.252 Stable Patch 2
December 24, 2025
5 files modified.
Important Changes
None.
BaseTileMap
cs
heightLightMod = 0f;
}
map.rooms.Refresh();
noSlopMode = EInput.isAltDown && EInput.isShiftDown;
noSlopMode = (buildMode ? (!EMono.game.config.slope) : (EInput.isAltDown && EInput.isShiftDown));
RefreshHeight();
innerMode = ((!buildMode && isIndoor) ? defaultInnerMode : InnerMode.None);
if (EMono.pc.IsInActiveZone)cs
int valueOrDefault = (this.room?.lot?.idBGM).GetValueOrDefault();
if (valueOrDefault == 0)
{
goto IL_1710;
goto IL_172c;
}
if (!(EMono.Sound.currentPlaylist != EMono.Sound.plLot))
{
BGMData data = EMono.Sound.plLot.list[0].data;
if ((object)data != null && data.id == valueOrDefault)
{
goto IL_1710;
goto IL_172c;
}
}
goto IL_172f;
IL_1739:
goto IL_174b;
IL_1755:
if (this.room != lastRoom)
{
screen.RefreshWeather();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_1710:
IL_172c:
if (valueOrDefault == 0 && EMono.Sound.currentPlaylist == EMono.Sound.plLot)
{
goto IL_172f;
goto IL_174b;
}
goto IL_1739;
IL_172f:
goto IL_1755;
IL_174b:
EMono._zone.RefreshBGM();
goto IL_1739;
goto IL_1755;
}
public void RefreshHeight()
{
if (EMono.game != null)
{
float num = (((buildMode && !EMono.game.config.slope) || noSlopMode) ? 0f : ((float)EMono.game.config.slopeMod * 0.01f));
float num = (noSlopMode ? 0f : ((float)EMono.game.config.slopeMod * 0.01f));
_heightMod = heightMod;
_heightMod.x = num;
_heightMod.y *= num;public virtual void DrawTile()
cs
}
}
goto IL_7ba5;
IL_169b:
if (this.cell.isSlopeEdge)
IL_6fea:
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)))
{
float num3 = (float)height * _heightMod.y;
orgY = param.y;
orgZ = param.z;
param.dir = this.cell.blockDir;
if (snowed)
{
param.color = floorLight;
}
SourceBlock.Row defBlock;
if (sourceBlock.tileType.IsFullBlock)
snowed = true;
}
if (this.cell.effect != null)
{
if (this.cell.effect.IsLiquid)
{
defBlock = sourceBlock;
param.mat = matBlock;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
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
{
defBlock = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
if (defBlock.id != 1)
param.tile = this.cell.effect.source._tiles[0];
SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
if (sourceEffect2.anime.Length != 0)
{
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
if (sourceEffect2.anime.Length > 2)
{
float num3 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
if (!(num3 >= (float)sourceEffect2.anime[0]))
{
param.tile += num3;
}
}
else
{
float num4 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
param.tile += num4;
}
}
else
if (this.cell.effect.IsFire)
{
param.matColor = 104025f;
rendererEffect.Draw(param);
}
}
for (int j = 0; (float)j < num3 / heightBlockSize; j++)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)j;
defBlock.renderData.Draw(param);
if (this.cell.pcSync && EMono.player.lightPower > 0f)
else
{
float num4 = param.tile;
param.tile = 0f;
rendererFov.Draw(param);
param.tile = num4;
this.cell.effect.source.renderData.Draw(param);
}
}
param.y = orgY;
param.z = orgZ;
}
param.color = floorLight;
if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
if (this.cell.critter != null)
{
orgY = param.y;
orgZ = param.z;
int num5 = 0;
if (sourceBlock.tileType.IsFullBlock)
Critter critter = this.cell.critter;
int snowTile = critter.tile;
if (snowed && critter.SnowTile != 0)
{
SourceBlock.Row row3 = sourceBlock;
num5 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
critter.x = 0.06f;
critter.y = -0.06f;
snowTile = critter.SnowTile;
}
else
{
SourceBlock.Row row3 = sourceFloor._defBlock;
num5 = 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 = num5 + ((!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 = num5 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
rendererWaterBlock.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
if (showBorder && !this.cell.outOfBounds)
{
param.matColor = 104025f;
if (cx == EMono._map.bounds.x)
{
renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
}
else if (cx == EMono._map.bounds.maxX)
{
renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
}
if (cz == EMono._map.bounds.z)
{
renderBorder.Draw(param, 14 + (EMono.world.date.IsNight ? 4 : 0));
critter.Update();
}
else if (cz == EMono._map.bounds.maxZ)
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)
{
renderBorder.Draw(param, 15 + (EMono.world.date.IsNight ? 4 : 0));
pass.NextBatch();
}
}
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
if (detail != null)
{
orgY = param.y;
orgZ = param.z;
SourceBlock.Row defBlock2 = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
if (defBlock2.id != 1)
{
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.matColor = 104025f;
}
for (int k = 0; k < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); k++)
TransAnime anime3 = detail.anime;
if (anime3 != null && !anime3.animeBlock)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)k;
defBlock2.renderData.Draw(param);
TransAnime anime4 = detail.anime;
param.x += anime4.v.x;
param.y += anime4.v.y;
param.z += anime4.v.z;
}
param.y = orgY;
param.z = orgZ;
}
if (!sourceFloor.tileType.IsSkipFloor)
if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
{
if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
SourceObj.Row sourceObj = this.cell.sourceObj;
if (!snowed || sourceObj.snowTile <= 0)
{
floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
if (snowed)
param.snow = snowed;
param.mat = this.cell.matObj;
orgY = param.y;
if (param.liquidLv > 0)
{
floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
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;
}
}
}
else
if (sourceObj.useAltColor)
{
floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
}
param.color = floorLight2;
if (this.cell.lotShade)
else
{
floorLight = floorLight2;
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
}
}
floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
if (isWater && flag)
{
param.y -= 0.01f * floatY;
}
if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
{
param.mat = matFloor;
param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
param.matColor = floorMatColor;
param.snow = snowed;
if (this.cell.isDeck)
if (sourceObj.HasGrowth)
{
param.z += 1f;
if ((bool)sourceFloor.renderData.subData)
this.cell.growth.OnRenderTileMap(param);
if (this.cell.obj == 118 && Core.fixedFrame % 10f == 0f && sourceObj.growth.IsMature)
{
sourceFloor.renderData.subData.Draw(param);
EMono.scene.psFey.transform.position = new Vector3(param.x, param.y, param.z - 2f);
EMono.scene.psFey.Emit(1);
}
sourceFloor.renderData.Draw(param);
param.z -= 1f;
}
else
{
if ((bool)sourceFloor.renderData.subData)
if (this.cell.autotileObj != 0)
{
sourceFloor.renderData.subData.Draw(param);
param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
}
sourceFloor.renderData.Draw(param);
}
int num6 = 0;
if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
{
if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
else if (sourceObj.tileType.IsUseBlockDir)
{
num6++;
param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
}
if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
else
{
num6 += 2;
param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
}
if (num6 != 0)
if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
{
param.tile = 448 + num6 + 12;
param.z -= 0.1f;
sourceFloor.renderData.Draw(param);
param.z += 0.1f;
param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
}
}
if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
{
if (snowed)
orgY = param.y;
orgZ = param.z;
param.y += sourceObj.pref.y;
param.z += sourceObj.pref.z;
sourceObj.renderData.Draw(param);
param.y = orgY;
param.z = orgZ;
int shadow3 = sourceObj.pref.shadow;
if (shadow3 > 1 && !this.cell.ignoreObjShadow)
{
if (sourceFloor == FLOOR.sourceSnow)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceFloor.renderData.Draw(param);
}
}
else
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
if (!sourceFloor.ignoreTransition && !snowed)
{
Cell back = this.cell.Back;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
back = this.cell.Left;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
}
}
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num6 == 0)
{
pass = (isWater ? passAutoTileWater : passAutoTile);
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceFloor.autotile / 2) * 32 + sourceFloor.autotile % 2 * 16 + this.cell.autotile;
batch.colors[pass.idx] = param.color + (float)((int)(sourceFloor.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow3], sourceObj.pref, 0, param.snow);
}
param.y = orgY;
}
}
if (isWater)
}
if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
switch (ActionMode.FlagCell.mode)
{
int num7 = 12;
int num8 = this.cell.shore / num7;
int num9 = this.cell.shore % num7;
bool isShoreSand = this.cell.isShoreSand;
if (this.cell.shore != 0)
case AM_FlagCell.Mode.flagWallPillar:
if (this.cell.isToggleWallPillar)
{
Cell cell = ((((uint)num8 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num8 & 2u) != 0) ? this.cell.Right : ((((uint)num8 & 4u) != 0) ? this.cell.Front : this.cell.Left)));
if (isShoreSand && !cell.sourceFloor.isBeach)
{
cell = ((((uint)num8 & 8u) != 0) ? this.cell.Left : ((((uint)num8 & 4u) != 0) ? this.cell.Front : ((((uint)num8 & 2u) != 0) ? this.cell.Right : this.cell.Back)));
}
if (!cell.IsSnowTile)
{
param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
if (isShoreSand)
{
pass = passShore;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z;
batch.tiles[pass.idx] = 768 + this.cell.shore / num7;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
num9 = 2;
}
else
{
num9 = cell.sourceFloor.edge;
}
param.tile = (24 + num9 / 2) * 32 + num9 % 2 * 16 + num8;
rendererShore.Draw(param);
}
passArea.Add(param, 34f, 0f);
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num7) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num7) & (true ? 1u : 0u)) != 0)
break;
case AM_FlagCell.Mode.flagSnow:
if (this.cell.isClearSnow)
{
param.tile = 785f;
param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(60);
passArea.Add(param, 34f, 0f);
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num7) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num7) & (true ? 1u : 0u)) != 0)
break;
case AM_FlagCell.Mode.flagFloat:
if (this.cell.isForceFloat)
{
param.tile = 786f;
param.matColor = GetColorInt(ref this.cell.BackRight.matFloor.matColor, this.cell.BackRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(56);
passArea.Add(param, 34f, 0f);
}
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num7) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num7) & 4u) != 0)
break;
case AM_FlagCell.Mode.flagClear:
if (this.cell.isClearArea)
{
param.tile = 787f;
param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(48);
passArea.Add(param, 34f, 0f);
}
break;
}
}
if (detail == null)
{
return;
}
if (highlightArea && detail.area != null)
{
passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
}
if (detail.footmark != null && sourceFloor.id != 0)
{
param.tile = detail.footmark.tile;
param.mat = matFloor;
param.matColor = 104025f;
renderFootmark.Draw(param);
}
goto IL_7ba5;
IL_6f8a:
int num5;
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num5;
rendererFov.Draw(param);
}
goto IL_6fea;
IL_7ba5:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
return;
}
int num6 = 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 num7 = 0f;
float num8 = 0f;
float num9 = 0f;
float num10 = 0f;
bool flag6 = false;
float num11 = 0f;
bool flag7 = false;
float num12 = 0f;
if (detail.things.Count > 0 && isSeen)
{
_ = zSetting.max1;
float num13 = 0f;
for (int j = 0; j < detail.things.Count; j++)
{
Thing t = detail.things[j];
if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction && !buildMode) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
{
continue;
}
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num7) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num7) & 4u) != 0)
TileType tileType = t.trait.tileType;
bool isInstalled = t.IsInstalled;
SourcePref pref = t.Pref;
if (!isInstalled && t.category.tileDummy != 0)
{
param.tile = 788f;
param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(52);
pref = rendererObjDummy.shadowPref;
}
if (this.cell._bridge != 0 && this.cell.isBridgeEdge && this.cell.bridgePillar != byte.MaxValue)
float num14 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
if (t.ignoreStackHeight)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
thingPos.y -= num7;
thingPos -= altitudeFix * num8;
}
shadow = thingPos.y < 0.16f && num12 < 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 + num13;
if (this.room != null)
{
pass.NextBatch();
param.color = GetRoofLight(this.room.lot);
}
shadow = false;
param.liquidLv = 0;
}
bool flag6 = false;
if (isShoreSand)
else
{
if (((uint)num8 & (true ? 1u : 0u)) != 0)
param.snow = snowed;
_actorPos.x = orgX + num10;
_actorPos.y = orgY;
_actorPos.z = orgZ + num13 + thingPos.z;
if (tileType.CanStack || !isInstalled)
{
if (((uint)num8 & 8u) != 0)
if (thing?.id != t.id)
{
if ((num8 & 2) == 0 && (num8 & 4) == 0)
{
Draw(16);
}
flag6 = true;
_actorPos.x += thingPos.x;
}
if (((uint)num8 & 2u) != 0)
_actorPos.y += thingPos.y;
if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
{
if ((num8 & 8) == 0 && (num8 & 4) == 0)
thingPos.y -= num7;
if (thing != null)
{
Draw(20);
_actorPos.z -= 0.2f;
thingPos.z -= 0.2f;
}
flag6 = true;
_actorPos.y -= num7;
}
_actorPos.z += renderSetting.thingZ + (float)j * -0.01f + zSetting.mod1 * thingPos.y;
}
if (((uint)num8 & 4u) != 0)
if (isInstalled)
{
if (((uint)num8 & 8u) != 0)
if (t.TileType.IsRamp)
{
if ((num8 & 2) == 0 && (num8 & 1) == 0)
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)
{
Draw(24);
num12 += rampFix2.y;
}
flag6 = true;
}
if (((uint)num8 & 2u) != 0)
liquidLv -= (int)(rampFix2.y * 150f);
if (liquidLv < 0)
{
liquidLv = 0;
}
}
else if (!flag7 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
{
if ((num8 & 8) == 0 && (num8 & 1) == 0)
orgY += num14 + (float)t.altitude * altitudeFix.y;
orgZ += (float)t.altitude * altitudeFix.z;
freePos.y += num14 + (float)t.altitude * altitudeFix.y;
if (!this.cell.IsTopWater || t.altitude > 0)
{
Draw(28);
num12 += num14 + (float)t.altitude * altitudeFix.y;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
if (liquidLv < 0)
{
liquidLv = 0;
}
}
else
{
thingPos.y += num14;
if (tileType.UseMountHeight)
{
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
{
thingPos.y += (float)t.altitude * altitudeFix.y;
thingPos.z += (float)t.altitude * altitudeFix.z;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
if (pref.height >= 0f)
{
thingPos.z += pref.z;
}
flag6 = true;
}
if (!tileType.UseMountHeight && j > 10)
{
flag7 = true;
}
}
if (!flag6)
else
{
if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
thingPos.y += num14;
_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 num15 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num15;
if (!t.trait.IsChangeFloorHeight)
{
Draw(8);
num11 = num14;
}
if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
_actorPos.y += 0.01f * floatY - num15;
if (liquidLv > 10)
{
Draw(12);
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
if (liquidLv < 0)
{
liquidLv = 0;
}
param.liquidLv = liquidLv;
}
num7 = num14;
if (t.sourceCard.multisize && !t.trait.IsGround)
{
num13 += zSetting.multiZ;
}
orgZ += t.renderer.data.stackZ;
if (param.liquidLv > 0)
{
param.liquidLv += pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquidLv = 1;
}
else if (param.liquidLv > 99 + pref.liquidModMax)
{
param.liquidLv = 99 + pref.liquidModMax;
}
}
}
if (!flag6)
if (!isInstalled || !tileType.UseMountHeight)
{
if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
if (t.altitude != 0)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num7) & (true ? 1u : 0u)) != 0)
_actorPos += altitudeFix * t.altitude;
if (!t.isRoofItem)
{
if (isShoreSand)
{
param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 640 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
}
num9 += (float)t.altitude;
num8 = t.altitude;
}
else
}
if (num9 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
continue;
}
if (t.freePos)
{
if (t.isRoofItem)
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
_actorPos.x += t.fx;
_actorPos.y += t.fy - (float)t.altitude * altitudeFix.y;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
else
{
pass.NextBatch();
_actorPos.x = orgX + t.fx - freePos.x;
_actorPos.y = orgY + t.fy - freePos.y;
}
}
if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num7) & 8u) != 0)
_actorPos.z += -0.5f;
}
}
if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
{
if (iconMode != 0)
{
int num16 = 0;
switch (iconMode)
{
if (isShoreSand)
case CardIconMode.Visibility:
if (t.isMasked)
{
param.matColor = GetColorInt(ref this.cell.Left.matFloor.matColor, this.cell.Left.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 644 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
num16 = 17;
}
else
break;
case CardIconMode.State:
if (t.placeState == PlaceState.installed)
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
num16 = 18;
}
break;
case CardIconMode.Deconstruct:
if (t.isDeconstructing)
{
num16 = 14;
}
break;
}
else
if (t.isNPCProperty && !EMono.debug.godBuild)
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
num16 = 13;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
if (num16 != 0)
{
pass.NextBatch();
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num16);
}
}
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 (flag)
if (isInstalled)
{
param.y += 0.01f * floatY;
num10 += 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;
}
}
if (flag)
{
param.z -= 1f;
}
}
if (this.cell.skipRender)
orgY += num11;
if (detail.charas.Count <= 0)
{
if (this.cell.pcSync)
{
param.tile = 0f;
rendererFov.Draw(param);
}
return;
}
if (hasBridge)
param.shadowFix = 0f - num12;
param.color += 1310720f;
float max = zSetting.max2;
for (int k = 0; k < detail.charas.Count; k++)
{
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
if (flag)
Chara chara = detail.charas[k];
if (chara.host != null || (chara != EMono.pc && chara != LayerDrama.alwaysVisible && (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))))
{
param.y += 0.01f * floatY;
continue;
}
param.color = floorLight;
param.mat = matBridge;
floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
param.dir = this.cell.floorDir;
param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
param.matColor = floorMatColor;
sourceBridge.renderData.Draw(param);
if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
_actorPos.x = orgX;
_actorPos.y = orgY;
_actorPos.z = orgZ;
chara.SetRenderParam(param);
_ = chara.IsAliveInCurrentZone;
if (chara.isRestrained)
{
pass = passAutoTile;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
TraitShackle restrainer = chara.GetRestrainer();
if (restrainer != null)
{
pass.NextBatch();
Vector3 getRestrainPos = restrainer.GetRestrainPos;
if (getRestrainPos != default(Vector3))
{
Vector3 position = restrainer.owner.renderer.position;
float defCharaHeight = EMono.setting.render.defCharaHeight;
float num17 = 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 + num17;
_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 (this.cell.shadow != 0)
if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
{
if (sourceBridge == FLOOR.sourceSnow)
if (chara.IsDeadOrSleeping && chara.IsPCC)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceBridge.renderData.Draw(param);
float num18 = chara.renderer.data.size.y * 0.3f;
if (thingPos.y > max)
{
thingPos.y = max;
}
float num19 = thingPos.y + num18;
float num20 = (float)k * -0.01f;
if (num19 > zSetting.thresh1)
{
num20 = zSetting.mod1;
}
_actorPos.x += thingPos.x;
_actorPos.y += thingPos.y;
_actorPos.z += renderSetting.laydownZ + num20;
param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
thingPos.y += num18 * 0.8f;
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
else
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = blockLight;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
param.liquidLv = liquidLv;
if (isUnderwater)
{
pass.NextBatch();
if (chara.Pref.FloatUnderwater)
{
float num21 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
float num22 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
orgY += 0.01f * num22 - num21;
_actorPos.y += 0.01f * num22 - num21;
param.shadowFix -= 0.01f * num22 - num21;
}
}
else if (liquidLv > 0)
{
if (chara.Pref.Float && !flag && !hasBridge)
{
if (liquidLv > 20)
{
float num23 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num23;
_actorPos.y += 0.01f * floatY - num23;
int num24 = TileType.FloorWaterShallow.LiquidLV * 10;
num24 -= (int)(floatY * 0.5f);
param.liquidLv = num24;
}
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 + ((num6 < 4) ? num6 : 3)];
}
_actorPos.z += 0.01f * (float)k + renderSetting.charaZ;
num6++;
if (flag6)
{
_actorPos.z += chara.renderer.data.hangedFixZ;
}
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
}
if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != byte.MaxValue && !noSlopMode)
param.x = orgX;
param.y = orgY;
param.z = orgZ;
}
return;
IL_169b:
if (this.cell.isSlopeEdge)
{
float num25 = (float)height * _heightMod.y;
orgY = param.y;
orgZ = param.z;
param.dir = this.cell.blockDir;
if (snowed)
{
orgY = param.y;
orgZ = param.z;
param.y += bridgeFix.y;
param.z += bridgeFix.z;
param.dir = 0;
SourceBlock.Row row4 = sourceBridge._bridgeBlock;
float num10 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
if (this.cell.sourceFloor.tileType == TileType.Sky)
{
num10 += (float)EMono._map.config.skyBlockHeight;
}
int num11 = (int)(num10 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
param.color = floorLight;
}
SourceBlock.Row defBlock;
if (sourceBlock.tileType.IsFullBlock)
{
defBlock = sourceBlock;
param.mat = matBlock;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
}
else
{
defBlock = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
if (defBlock.id != 1)
{
row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
param.tile = row4._tiles[0] + ((num11 == 2) ? 32 : 0);
param.mat = ((sourceBridge.DefaultMaterial == row4.DefaultMaterial) ? sourceBridge.DefaultMaterial : row4.DefaultMaterial);
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, row4.colorMod));
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.mat = matBlock;
param.tile = row4._tiles[0] + 32;
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
param.matColor = 104025f;
}
param.y += ugFixBridgeTop.y;
param.z += ugFixBridgeTop.z;
for (int l = 0; l < num11; l++)
}
for (int l = 0; (float)l < num25 / heightBlockSize; l++)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)l;
defBlock.renderData.Draw(param);
if (this.cell.pcSync && EMono.player.lightPower > 0f)
{
if (l == num11 - 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;
}
else
{
param.y += ugFixBridge.y;
param.z += ugFixBridge.z;
}
row4.renderData.Draw(param);
float num26 = param.tile;
param.tile = 0f;
rendererFov.Draw(param);
param.tile = num26;
}
param.y = orgY;
param.z = orgZ;
}
param.y = orgY;
param.z = orgZ;
}
if (!buildMode && this.cell.highlight != 0)
param.color = floorLight;
if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
{
if (this.cell._block != 0 && !this.cell.hasDoor)
orgY = param.y;
orgZ = param.z;
int num27 = 0;
if (sourceBlock.tileType.IsFullBlock)
{
screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
SourceBlock.Row row3 = sourceBlock;
num27 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
}
else
{
passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
SourceBlock.Row row3 = sourceFloor._defBlock;
num27 = 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 = num27 + ((!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 = num27 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
rendererWaterBlock.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
if (showBorder && !this.cell.outOfBounds)
{
snowed = false;
param.matColor = 104025f;
if (cx == EMono._map.bounds.x)
{
renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
}
else if (cx == EMono._map.bounds.maxX)
{
renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
}
if (cz == EMono._map.bounds.z)
{
renderBorder.Draw(param, 14 + (EMono.world.date.IsNight ? 4 : 0));
}
else if (cz == EMono._map.bounds.maxZ)
{
renderBorder.Draw(param, 15 + (EMono.world.date.IsNight ? 4 : 0));
}
}
int num12 = 0;
if (sourceBlock.id != 0)
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
{
this.tileType = sourceBlock.tileType;
roomHeight = 0f;
int blockDir = this.cell.blockDir;
bool flag7 = false;
switch (wallClipMode)
orgY = param.y;
orgZ = param.z;
SourceBlock.Row defBlock2 = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
if (defBlock2.id != 1)
{
case WallClipMode.ByRoom:
if (!this.tileType.RepeatBlock)
{
break;
}
if (currentRoom == null || showFullWall)
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.matColor = 104025f;
}
for (int m = 0; m < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); m++)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)m;
defBlock2.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
if (!sourceFloor.tileType.IsSkipFloor)
{
if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
{
floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
if (snowed)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = lowBlock;
floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
}
else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
else
{
this.room = this.cell.Front.room;
_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
}
else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
param.color = floorLight2;
if (this.cell.lotShade)
{
this.room = this.cell.Right.room;
_lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
floorLight = floorLight2;
}
else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
}
floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
if (isWater && flag)
{
param.y -= 0.01f * floatY;
}
if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
{
param.mat = matFloor;
param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
param.matColor = floorMatColor;
param.snow = snowed;
if (this.cell.isDeck)
{
this.room = this.cell.FrontRight.room;
_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
param.z += 1f;
if ((bool)sourceFloor.renderData.subData)
{
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
param.z -= 1f;
}
else
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = true;
if (!this.tileType.IsFullBlock)
if ((bool)sourceFloor.renderData.subData)
{
if (this.cell.lotWall)
{
_lowblock = false;
}
else if (this.room == currentRoom)
{
_lowblock = !this.cell.fullWall;
}
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
}
flag7 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
if (flag7)
{
_lowblock = false;
}
if (this.room == null && alwaysLowblock)
{
_lowblock = true;
roomHeight = 0f;
}
if (this.room != null)
int num28 = 0;
if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
{
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
if (showRoof)
if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
{
roomHeight = this.room.lot.realHeight;
break;
num28++;
}
if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
{
roomHeight = 0f;
break;
num28 += 2;
}
int num13 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num13) ? this.room.lot.height : num13) + 0.01f * (float)this.room.lot.heightFix;
}
break;
case WallClipMode.ByLot:
if (defaultBlockHeight > 0f || isIndoor)
{
_lowblock = cx != 0 && cz != Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock);
if (!_lowblock)
if (num28 != 0)
{
roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
param.tile = 448 + num28 + 12;
param.z -= 0.1f;
sourceFloor.renderData.Draw(param);
param.z += 0.1f;
}
break;
}
if (showFullWall)
if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
{
_lowblock = this.room != null;
if (_lowblock)
if (snowed)
{
if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
if (sourceFloor == FLOOR.sourceSnow)
{
_lowblock = false;
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceFloor.renderData.Draw(param);
}
}
else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
else
{
_lowblock = true;
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
}
else
{
_lowblock = lowBlock;
}
if (this.tileType.RepeatBlock)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
if (this.room != null && (!noRoofMode || currentRoom != null) && (!showFullWall || currentRoom == null || this.room.lot == currentRoom.lot))
if (!sourceFloor.ignoreTransition && !snowed)
{
roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
Cell back = this.cell.Back;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
back = this.cell.Left;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
}
}
break;
}
if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
{
num12 = 1;
}
else if (lowBlock)
{
num12 = 2;
}
param.mat = matBlock;
param.dir = this.cell.blockDir;
param.snow = snowed;
switch (this.tileType.blockRenderMode)
{
case BlockRenderMode.FullBlock:
{
bool invisible = sourceBlock.tileType.Invisible;
if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
{
break;
}
if (this.cell.isSurrounded)
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num28 == 0)
{
switch (innerMode)
pass = (isWater ? passAutoTileWater : passAutoTile);
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceFloor.autotile / 2) * 32 + sourceFloor.autotile % 2 * 16 + this.cell.autotile;
batch.colors[pass.idx] = param.color + (float)((int)(sourceFloor.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
case InnerMode.InnerBlock:
case InnerMode.BuildMode:
blockLight = _baseBrightness + fogBrightness;
param.color = (int)(50f * blockLight) * 262144;
param.matColor = 104025f;
param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
rendererInnerBlock.Draw(param);
return;
case InnerMode.None:
case InnerMode.Height:
param.color = blockLight;
break;
pass.NextBatch();
}
}
if (snowed)
{
param.color = floorLight;
}
param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
if (currentRoom != null && !showFullWall)
}
if (isWater)
{
int num29 = 12;
int num30 = this.cell.shore / num29;
int num31 = this.cell.shore % num29;
bool isShoreSand = this.cell.isShoreSand;
if (this.cell.shore != 0)
{
_lowblock = true;
roomHeight = 0f;
if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
Cell cell = ((((uint)num30 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num30 & 2u) != 0) ? this.cell.Right : ((((uint)num30 & 4u) != 0) ? this.cell.Front : this.cell.Left)));
if (isShoreSand && !cell.sourceFloor.isBeach)
{
_lowblock = false;
cell = ((((uint)num30 & 8u) != 0) ? this.cell.Left : ((((uint)num30 & 4u) != 0) ? this.cell.Front : ((((uint)num30 & 2u) != 0) ? this.cell.Right : this.cell.Back)));
}
if (!_lowblock)
if (!cell.IsSnowTile)
{
int num14 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num14) ? currentRoom.lot.height : num14) + 0.01f * (float)currentRoom.lot.heightFix;
param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
if (isShoreSand)
{
pass = passShore;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z;
batch.tiles[pass.idx] = 768 + this.cell.shore / num29;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
num31 = 2;
}
else
{
num31 = cell.sourceFloor.edge;
}
param.tile = (24 + num31 / 2) * 32 + num31 % 2 * 16 + num30;
rendererShore.Draw(param);
}
}
if (flag7)
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num29) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num29) & (true ? 1u : 0u)) != 0)
{
_lowblock = (!this.cell.Front.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Front.HasFullBlock || !this.cell.Left.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Left.HasFullBlock);
if (_lowblock)
{
roomHeight = 0f;
}
param.tile = 785f;
param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(60);
}
if (invisible)
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num29) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num29) & (true ? 1u : 0u)) != 0)
{
roomHeight = 0f;
_lowblock = false;
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.Things.Count > 0)
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num29) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num29) & 4u) != 0)
{
_lowblock = false;
param.tile = 787f;
param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(48);
}
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + (_lowblock ? 3000000 : 0);
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
if (roomHeight == 0f)
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num29) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num29) & 4u) != 0)
{
if (!this.cell.hasDoor)
{
sourceBlock.renderData.Draw(param);
}
}
else
{
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0, isBlock: true);
}
Room room = this.cell.Front.room ?? this.cell.room;
if (room == null && this.cell.Right.room != null)
{
room = this.cell.Right.room;
}
if (!invisible && room != null)
{
if (room.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco);
param.matColor = room.lot.colDeco;
float y = param.y;
param.y += (float)room.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y;
}
if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco2);
param.matColor = room.lot.colDeco2;
float y2 = param.y;
float num15 = 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 = num15;
}
}
room = this.cell.Right.room ?? this.cell.room;
if (room == null && this.cell.Front.room != null)
{
room = this.cell.Front.room;
param.tile = 788f;
param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(52);
}
if (!invisible && room != null)
if (this.cell._bridge != 0 && this.cell.isBridgeEdge && this.cell.bridgePillar != byte.MaxValue)
{
if (room.lot.idDeco != 0 && !this.cell.hasDoor)
{
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)room.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y3;
}
if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco2) * -1;
param.matColor = room.lot.colDeco2;
float y4 = param.y;
float num16 = 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 = num16;
pass.NextBatch();
}
}
break;
}
case BlockRenderMode.WallOrFence:
{
if (map.config.fullWallHeight)
{
showFullWall = true;
_lowblock = false;
}
orgY = param.y;
orgZ = param.z;
param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
bool flag8 = blockDir == 1 || _lowblock || flag7;
bool flag9 = blockDir == 0 || _lowblock || flag7;
if (!showFullWall && currentRoom != null)
bool flag8 = false;
if (isShoreSand)
{
if (!flag8)
if (((uint)num30 & (true ? 1u : 0u)) != 0)
{
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
if (((uint)num30 & 8u) != 0)
{
if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
if ((num30 & 2) == 0 && (num30 & 4) == 0)
{
flag8 = true;
Draw(16);
}
flag8 = true;
}
else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
if (((uint)num30 & 2u) != 0)
{
if ((num30 & 8) == 0 && (num30 & 4) == 0)
{
Draw(20);
}
flag8 = true;
}
}
if (!flag9)
if (((uint)num30 & 4u) != 0)
{
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
if (((uint)num30 & 8u) != 0)
{
if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
if ((num30 & 2) == 0 && (num30 & 1) == 0)
{
flag9 = true;
Draw(24);
}
flag8 = true;
}
else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
if (((uint)num30 & 2u) != 0)
{
flag9 = true;
if ((num30 & 8) == 0 && (num30 & 1) == 0)
{
Draw(28);
}
flag8 = true;
}
}
}
if (blockDir == 0 || blockDir == 2)
{
param.dir = 0;
Room room2 = this.cell.Front.room ?? this.cell.room;
if (room2 != null && this.tileType.IsWall)
if (!flag8)
{
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)
if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
{
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;
Draw(8);
}
}
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)
if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
{
_sourceBlock.renderData.Draw(param);
Draw(12);
}
}
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 (!flag8)
{
if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
{
if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num29) & (true ? 1u : 0u)) != 0)
{
param.snow = true;
if (isShoreSand)
{
param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 640 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
}
}
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))
else
{
_sourceBlock.renderData.Draw(param);
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
}
else
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
pass.NextBatch();
}
}
if (!flag8 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
{
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))
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num29) & 8u) != 0)
{
_sourceBlock.renderData.Draw(param);
if (isShoreSand)
{
param.matColor = GetColorInt(ref this.cell.Left.matFloor.matColor, this.cell.Left.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 644 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
}
}
else
{
_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);
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
}
else
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
pass.NextBatch();
}
param.x = orgX;
}
}
if (blockDir == 1 || blockDir == 2)
if (flag)
{
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.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 && !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.matColor = room3.lot.colDeco2;
param.y += (float)room3.lot.decoFix2 * 0.01f;
param.z += (float)room3.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = orgY;
param.z = orgZ;
}
}
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 num17 = ((room4.data.maxHeight == 0) ? 2 : room4.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((room4.lot.height < num17) ? room4.lot.height : num17) + 0.01f * (float)room4.lot.heightFix;
}
}
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] + ((flag9 && 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));
}
param.color += _rightWallShade;
if (roomHeight == 0f || flag9 || !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);
}
if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
{
if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
{
param.snow = true;
}
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag9 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
if (!flag7 && (roomHeight == 0f || !this.tileType.RepeatBlock || flag9))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
param.x = orgX;
}
param.y += 0.01f * floatY;
}
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:
if (flag)
{
RenderData renderData2 = sourceBlock.renderData;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
int num18 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
if (num18 == 0)
param.z -= 1f;
}
}
if (this.cell.skipRender)
{
if (this.cell.pcSync)
{
param.tile = 0f;
rendererFov.Draw(param);
}
return;
}
if (hasBridge)
{
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
if (flag)
{
param.y += 0.01f * floatY;
}
param.color = floorLight;
param.mat = matBridge;
floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
param.dir = this.cell.floorDir;
param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
param.matColor = floorMatColor;
sourceBridge.renderData.Draw(param);
if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
{
pass = passAutoTile;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
renderData2.Draw(param);
pass.NextBatch();
}
}
if (this.cell.shadow != 0)
{
if (sourceBridge == FLOOR.sourceSnow)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceBridge.renderData.Draw(param);
}
else
{
renderData2.DrawRepeat(param, num18, sourceBlock.tileType.RepeatSize);
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = blockLight;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
param.tile = renderData2.idShadow;
SourcePref shadowPref2 = renderData2.shadowPref;
int shadow3 = shadowPref2.shadow;
passShadow.AddShadow(param.x + renderData2.offsetShadow.x, param.y + renderData2.offsetShadow.y, param.z + renderData2.offsetShadow.z, ShadowData.Instance.items[shadow3], shadowPref2, 0, param.snow);
break;
}
default:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowBlock) ? 3000000 : 0);
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
if (roomHeight == 0f)
if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != byte.MaxValue && !noSlopMode)
{
orgY = param.y;
orgZ = param.z;
param.y += bridgeFix.y;
param.z += bridgeFix.z;
param.dir = 0;
SourceBlock.Row row4 = sourceBridge._bridgeBlock;
float num32 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
if (this.cell.sourceFloor.tileType == TileType.Sky)
{
sourceBlock.renderData.Draw(param);
num32 += (float)EMono._map.config.skyBlockHeight;
}
int num33 = (int)(num32 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
{
row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
param.tile = row4._tiles[0] + ((num33 == 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));
}
else
{
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
param.mat = matBlock;
param.tile = row4._tiles[0] + 32;
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
}
break;
param.y += ugFixBridgeTop.y;
param.z += ugFixBridgeTop.z;
for (int n = 0; n < num33; n++)
{
if (n == num33 - 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;
}
else
{
param.y += ugFixBridge.y;
param.z += ugFixBridge.z;
}
row4.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
}
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
if (!buildMode && this.cell.highlight != 0)
{
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
if (this.cell._block != 0 && !this.cell.hasDoor)
{
goto IL_6f8a;
screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
else
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
{
goto IL_6f8a;
}
passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
}
}
goto IL_6fea;
IL_6f8a:
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num12;
rendererFov.Draw(param);
}
goto IL_6fea;
IL_7ba5:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
return;
}
int num19 = 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)
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
{
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
param.y -= TileType.FloorWaterShallow.FloorHeight;
snowed = false;
}
Thing thing = null;
bool shadow = liquidLv == 0;
float num20 = 0f;
float num21 = 0f;
float num22 = 0f;
float num23 = 0f;
bool flag10 = false;
float num24 = 0f;
bool flag11 = false;
float num25 = 0f;
if (detail.things.Count > 0 && isSeen)
num5 = 0;
if (sourceBlock.id != 0)
{
_ = zSetting.max1;
float num26 = 0f;
for (int m = 0; m < detail.things.Count; m++)
this.tileType = sourceBlock.tileType;
roomHeight = 0f;
int blockDir = this.cell.blockDir;
bool flag9 = false;
switch (wallClipMode)
{
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))
case WallClipMode.ByRoom:
if (!this.tileType.RepeatBlock)
{
continue;
break;
}
TileType tileType = t.trait.tileType;
bool isInstalled = t.IsInstalled;
SourcePref pref = t.Pref;
if (!isInstalled && t.category.tileDummy != 0)
if (currentRoom == null || showFullWall)
{
pref = rendererObjDummy.shadowPref;
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = lowBlock;
}
float num27 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
if (t.ignoreStackHeight)
else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
{
thingPos.y -= num20;
thingPos -= altitudeFix * num21;
this.room = this.cell.Front.room;
_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
}
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)
else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
{
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;
this.room = this.cell.Right.room;
_lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
}
else
else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
{
param.snow = snowed;
_actorPos.x = orgX + num23;
_actorPos.y = orgY;
_actorPos.z = orgZ + num26 + thingPos.z;
if (tileType.CanStack || !isInstalled)
this.room = this.cell.FrontRight.room;
_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
}
else
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = true;
if (!this.tileType.IsFullBlock)
{
if (thing?.id != t.id)
if (this.cell.lotWall)
{
_actorPos.x += thingPos.x;
_lowblock = false;
}
_actorPos.y += thingPos.y;
if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
else if (this.room == currentRoom)
{
thingPos.y -= num20;
if (thing != null)
{
_actorPos.z -= 0.2f;
thingPos.z -= 0.2f;
}
_actorPos.y -= num20;
_lowblock = !this.cell.fullWall;
}
_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y;
}
if (isInstalled)
}
flag9 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
if (flag9)
{
_lowblock = false;
}
if (this.room == null && alwaysLowblock)
{
_lowblock = true;
roomHeight = 0f;
}
if (this.room != null)
{
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
if (showRoof)
{
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)
{
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;
if (liquidLv < 0)
{
liquidLv = 0;
}
}
else
{
thingPos.y += num27;
if (tileType.UseMountHeight)
{
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 room5 = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
if (t.trait.AlwaysHideOnLowWall)
{
if (room5 == null || !room5.data.showWallItem)
{
continue;
}
}
else if (t.altitude >= lowWallObjAltitude)
{
continue;
}
}
}
if (tileType.UseHangZFix)
{
flag10 = true;
}
tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
shadow = false;
param.liquidLv = 0;
if (t.freePos)
{
_actorPos.x += t.fx;
_actorPos.y += t.fy;
}
}
else
{
thingPos.y += (float)t.altitude * altitudeFix.y;
thingPos.z += (float)t.altitude * altitudeFix.z;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
if (pref.height >= 0f)
{
thingPos.z += pref.z;
}
}
if (!tileType.UseMountHeight && m > 10)
{
flag11 = true;
}
roomHeight = this.room.lot.realHeight;
break;
}
else
if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
{
thingPos.y += num27;
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
roomHeight = 0f;
break;
}
if (t.isFloating && isWater && !hasBridge && !flag)
int num34 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num34) ? this.room.lot.height : num34) + 0.01f * (float)this.room.lot.heightFix;
}
break;
case WallClipMode.ByLot:
if (defaultBlockHeight > 0f || isIndoor)
{
_lowblock = cx != 0 && cz != Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock);
if (!_lowblock)
{
flag = true;
float num28 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num28;
if (!t.trait.IsChangeFloorHeight)
{
num24 = num27;
}
_actorPos.y += 0.01f * floatY - num28;
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
if (liquidLv < 0)
roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
}
break;
}
if (showFullWall)
{
_lowblock = this.room != null;
if (_lowblock)
{
if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
{
liquidLv = 0;
_lowblock = false;
}
param.liquidLv = liquidLv;
}
num20 = num27;
if (t.sourceCard.multisize && !t.trait.IsGround)
else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
{
num26 += zSetting.multiZ;
_lowblock = true;
}
orgZ += t.renderer.data.stackZ;
if (param.liquidLv > 0)
}
else
{
_lowblock = lowBlock;
}
if (this.tileType.RepeatBlock)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
if (this.room != null && (!noRoofMode || currentRoom != null) && (!showFullWall || currentRoom == null || this.room.lot == currentRoom.lot))
{
param.liquidLv += pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquidLv = 1;
}
else if (param.liquidLv > 99 + pref.liquidModMax)
{
param.liquidLv = 99 + pref.liquidModMax;
}
roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
}
}
break;
}
if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
{
num5 = 1;
}
else if (lowBlock)
{
num5 = 2;
}
param.mat = matBlock;
param.dir = this.cell.blockDir;
param.snow = snowed;
switch (this.tileType.blockRenderMode)
{
case BlockRenderMode.FullBlock:
{
bool invisible = sourceBlock.tileType.Invisible;
if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
{
break;
}
if (this.cell.isSurrounded)
{
switch (innerMode)
{
case InnerMode.InnerBlock:
case InnerMode.BuildMode:
blockLight = _baseBrightness + fogBrightness;
param.color = (int)(50f * blockLight) * 262144;
param.matColor = 104025f;
param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
rendererInnerBlock.Draw(param);
return;
case InnerMode.None:
case InnerMode.Height:
param.color = blockLight;
break;
}
}
if (snowed)
{
param.color = floorLight;
}
param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
if (currentRoom != null && !showFullWall)
{
_lowblock = true;
roomHeight = 0f;
if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
{
_lowblock = false;
}
if (!_lowblock)
{
int num35 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num35) ? currentRoom.lot.height : num35) + 0.01f * (float)currentRoom.lot.heightFix;
}
}
if (flag9)
{
_lowblock = (!this.cell.Front.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Front.HasFullBlock || !this.cell.Left.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Right.HasFullBlock) && (!this.cell.Back.HasFullBlock || !this.cell.Left.HasFullBlock);
if (_lowblock)
{
roomHeight = 0f;
}
}
if (invisible)
{
roomHeight = 0f;
_lowblock = false;
}
if (this.cell.Things.Count > 0)
{
_lowblock = false;
}
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + (_lowblock ? 3000000 : 0);
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
if (roomHeight == 0f)
{
if (!this.cell.hasDoor)
{
sourceBlock.renderData.Draw(param);
}
}
if (!isInstalled || !tileType.UseMountHeight)
else
{
if (t.altitude != 0)
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)
{
room2 = this.cell.Right.room;
}
if (!invisible && room2 != null)
{
if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
{
_actorPos += altitudeFix * t.altitude;
num22 += (float)t.altitude;
num21 = t.altitude;
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco);
param.matColor = room2.lot.colDeco;
float y = param.y;
param.y += (float)room2.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y;
}
if (num22 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
continue;
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2);
param.matColor = room2.lot.colDeco2;
float y2 = param.y;
float num36 = param.z;
param.y += (float)room2.lot.decoFix2 * 0.01f;
param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y2;
param.z = num36;
}
if (t.freePos)
}
room2 = this.cell.Right.room ?? this.cell.room;
if (room2 == null && this.cell.Front.room != null)
{
room2 = this.cell.Front.room;
}
if (!invisible && room2 != null)
{
if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
{
_actorPos.x = orgX + t.fx - freePos.x;
_actorPos.y = orgY + t.fy - freePos.y;
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco) * -1;
param.matColor = room2.lot.colDeco;
float y3 = param.y;
param.y += (float)room2.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y3;
}
if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
_actorPos.z += -0.5f;
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2) * -1;
param.matColor = room2.lot.colDeco2;
float y4 = param.y;
float num37 = param.z;
param.y += (float)room2.lot.decoFix2 * 0.01f;
param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y4;
param.z = num37;
}
}
if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
break;
}
case BlockRenderMode.WallOrFence:
{
if (map.config.fullWallHeight)
{
if (iconMode != 0)
showFullWall = true;
_lowblock = false;
}
orgY = param.y;
orgZ = param.z;
param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
bool flag10 = blockDir == 1 || _lowblock || flag9;
bool flag11 = blockDir == 0 || _lowblock || flag9;
if (!showFullWall && currentRoom != null)
{
if (!flag10)
{
int num29 = 0;
switch (iconMode)
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
{
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)
if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
num29 = 14;
flag10 = true;
}
break;
}
if (t.isNPCProperty && !EMono.debug.godBuild)
{
num29 = 13;
}
if (num29 != 0)
else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
{
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num29);
flag10 = true;
}
}
t.SetRenderParam(param);
if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
if (!flag11)
{
param.tile += ((param.tile < 0f) ? (-64) : 64);
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;
}
}
else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
{
flag11 = true;
}
}
if (t.trait is TraitTrolley && EMono.pc.ai is AI_Trolley aI_Trolley && aI_Trolley.trolley.owner == t)
}
if (blockDir == 0 || blockDir == 2)
{
param.dir = 0;
Room room3 = this.cell.Front.room ?? this.cell.room;
if (room3 != null && this.tileType.IsWall)
{
RenderParam _param = new RenderParam(param);
EMono.core.actionsLateUpdate.Add(delegate
if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
{
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));
});
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)
{
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;
rendererWallDeco.Draw(param);
param.y = orgY;
param.z = orgZ;
}
}
else
Cell left = this.cell.Left;
if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
{
t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
_sourceBlock = left.sourceBlock;
param.mat = left.matBlock;
}
}
if (isInstalled)
{
num23 += 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 += num24;
if (detail.charas.Count <= 0)
{
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)))))
{
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))
else
{
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;
_sourceBlock = sourceBlock;
param.mat = matBlock;
}
}
}
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)
this.tileType = _sourceBlock.tileType;
param.tile = (tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock) ? 32 : 0));
if (_sourceBlock.useAltColor)
{
thingPos.y = max;
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
}
float num32 = thingPos.y + num31;
float num33 = (float)n * -0.01f;
if (num32 > zSetting.thresh1)
else
{
num33 = zSetting.mod1;
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
}
_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
{
param.liquidLv = liquidLv;
if (isUnderwater)
if (roomHeight == 0f || flag10 || !this.tileType.RepeatBlock)
{
if (chara.Pref.FloatUnderwater)
if (!this.cell.hasDoor)
{
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;
_sourceBlock.renderData.Draw(param);
}
}
else if (liquidLv > 0)
else
{
if (chara.Pref.Float && !flag && !hasBridge)
_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)
{
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.snow = true;
}
param.liquidLv += chara.Pref.liquidMod;
if (param.liquidLv < 1)
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))
{
param.liquidLv = 1;
_sourceBlock.renderData.Draw(param);
}
else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
else
{
param.liquidLv = 99 + chara.Pref.liquidModMax;
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
}
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 + ((num19 < 4) ? num19 : 3)];
}
_actorPos.z += 0.01f * (float)n + renderSetting.charaZ;
num19++;
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;
}
return;
IL_6fea:
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)
if (!flag10 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
{
float num38 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
if (!(num38 >= (float)sourceEffect2.anime[0]))
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix3.x;
param.y += cornerWallFix3.y;
param.z += cornerWallFix3.z;
if (!flag9 && (roomHeight == 0f || flag10))
{
_sourceBlock.renderData.Draw(param);
}
else
{
param.tile += num38;
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
}
param.x = orgX;
}
else
else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag10 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
{
float num39 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
param.tile += num39;
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix.x;
param.y += cornerWallFix.y;
param.z += cornerWallFix.z;
if (!flag9 && (roomHeight == 0f || flag10))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
}
param.x = orgX;
}
}
if (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 (blockDir == 1 || blockDir == 2)
{
if (sourceObj.pref.Float)
param.y = orgY;
param.z = orgZ;
param.dir = 1;
Room room4 = this.cell.Right.room ?? this.cell.room;
if (room4 != null && this.tileType.IsWall)
{
param.y += 0.01f * floatY;
if (liquidLv > 10)
if (room4.lot.idDeco != 0 && !this.cell.hasDoor)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
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;
}
if (room4.lot.idDeco2 != 0 && roomHeight != 0f && !flag11 && (float)room4.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
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;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
}
if (sourceObj.tileType.IsWaterTop)
{
param.liquidLv = 0;
}
else
if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
{
param.liquidLv += sourceObj.pref.liquidMod;
if (param.liquidLv < 1)
Room room5 = this.cell.Right.room;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room5.lot.mh * _heightMod.y;
if (showRoof)
{
param.liquid = 1f;
roomHeight = room5.lot.realHeight;
}
else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
{
param.liquidLv = 99 + sourceObj.pref.liquidModMax;
roomHeight = 0f;
}
else
{
int num38 = ((room5.data.maxHeight == 0) ? 2 : room5.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((room5.lot.height < num38) ? room5.lot.height : num38) + 0.01f * (float)room5.lot.heightFix;
}
}
}
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)
Cell back2 = this.cell.Back;
if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
{
EMono.scene.psFey.transform.position = new Vector3(param.x, param.y, param.z - 2f);
EMono.scene.psFey.Emit(1);
_sourceBlock = back2.sourceBlock;
param.mat = back2.matBlock;
}
}
else
{
if (this.cell.autotileObj != 0)
else
{
param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
_sourceBlock = sourceBlock;
param.mat = matBlock;
}
else if (sourceObj.tileType.IsUseBlockDir)
this.tileType = _sourceBlock.tileType;
param.tile = (tile = -_sourceBlock._tiles[0] + ((flag11 && this.tileType.UseLowBlock) ? (-32) : 0));
if (_sourceBlock.useAltColor)
{
param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
}
else
{
param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
}
if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
param.color += _rightWallShade;
if (roomHeight == 0f || flag11 || !this.tileType.RepeatBlock)
{
param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
if (!this.cell.hasDoor)
{
_sourceBlock.renderData.Draw(param);
}
}
orgY = param.y;
orgZ = param.z;
param.y += sourceObj.pref.y;
param.z += sourceObj.pref.z;
sourceObj.renderData.Draw(param);
param.y = orgY;
param.z = orgZ;
int shadow4 = sourceObj.pref.shadow;
if (shadow4 > 1 && !this.cell.ignoreObjShadow)
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
}
if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
{
passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow4], sourceObj.pref, 0, param.snow);
if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
{
param.snow = true;
}
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))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
param.x = orgX;
}
param.y = orgY;
}
param.y = orgY;
param.z = orgZ;
break;
}
}
if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
switch (ActionMode.FlagCell.mode)
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:
{
case AM_FlagCell.Mode.flagWallPillar:
if (this.cell.isToggleWallPillar)
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 num39 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
if (num39 == 0)
{
passArea.Add(param, 34f, 0f);
renderData2.Draw(param);
}
break;
case AM_FlagCell.Mode.flagSnow:
if (this.cell.isClearSnow)
else
{
passArea.Add(param, 34f, 0f);
renderData2.DrawRepeat(param, num39, 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;
case AM_FlagCell.Mode.flagFloat:
if (this.cell.isForceFloat)
}
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)
{
passArea.Add(param, 34f, 0f);
sourceBlock.renderData.Draw(param);
}
break;
case AM_FlagCell.Mode.flagClear:
if (this.cell.isClearArea)
else
{
passArea.Add(param, 34f, 0f);
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
}
break;
}
}
if (detail == null)
{
return;
}
if (highlightArea && detail.area != null)
{
passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
}
if (detail.footmark != null && sourceFloor.id != 0)
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
{
param.tile = detail.footmark.tile;
param.mat = matFloor;
param.matColor = 104025f;
renderFootmark.Draw(param);
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
{
goto IL_6f8a;
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
{
goto IL_6f8a;
}
}
}
goto IL_7ba5;
goto IL_6fea;
void Draw(int tile)
{
pass = passEdge;Card
public virtual SubPassData GetSubPassData()
cs
public void SetFreePos(Point point)
{
freePos = EClass.game.config.FreePos && isThing && TileType.FreeStyle && !sourceCard.multisize && !EClass.scene.actionMode.IsRoofEditMode(this);
freePos = EClass.game.config.FreePos && isThing && TileType.FreeStyle;
if (freePos)
{
Vector3 vector = point.Position();public void RenderMarker(Point point, bool active, HitResult result, bool main,
cs
v.y = renderParam.y;
v.z = renderParam.z;
}
if (TileType.UseMountHeight && !EClass.scene.actionMode.IsRoofEditMode(this))
else if (TileType.UseMountHeight)
{
TileType.GetMountHeight(ref v, point, this.dir, this);
}CoreDebug
public static string Fix_RemoveDemitas()
cs
if (list.Count > 1)
{
Chara chara = list[1];
chara.RemoveGlobal();
chara.homeBranch.BanishMember(chara);
chara.Destroy();
return "Demitas Removed!";public static string Fix_RemoveDemitas()
cs
return "Not enough Demitas!";
}
[ConsoleCommand("")]
public static string Fix_RemoveAshland()
{
List<Chara> list = new List<Chara>();
foreach (Chara value in EClass.game.cards.globalCharas.Values)
{
if (value.id == "ashland")
{
list.Add(value);
}
}
if (list.Count > 1)
{
Chara chara = list[1];
chara.RemoveGlobal();
chara.homeBranch.BanishMember(chara);
chara.Destroy();
return "Ashland Removed!";
}
return "Not enough Ashland!";
}
[ConsoleCommand("")]
public static string Fix_RemoveDesignations()
{DramaOutcome
public void QuestExploration_AfterCrystal()
cs
chara.MoveHome(EMono.game.StartZone);
chara.RemoveEditorTag(EditorTag.AINoMove);
chara = EMono.game.cards.globalCharas.Find("ashland");
EMono.ui.Say("Possible mod bug: 404 Ashland Not Found");
chara = CharaGen.Create("ashland");
chara.SetGlobal();
chara.MoveHome(EMono.game.StartZone);
if (chara == null)
{
EMono.ui.Say("Possible mod bug: 404 Ashland Not Found");
chara = CharaGen.Create("ashland");
chara.SetGlobal();
chara.MoveHome(EMono.game.StartZone);
}
}
public void QuestExploration_AfterComplete()TraitASMR
public class TraitASMR : Trait
cs
public override void OnCreate(int lv)
{
ExcelData.Sheet dialogSheet = Lang.GetDialogSheet("asmr");
owner.c_idRefCard = GetParam(1) ?? ((EClass.rnd(EClass.debug.enable ? 2 : 10) != 0) ? "jure" : dialogSheet.map.RandomItem()["id"]);
owner.c_idRefCard = GetParam(1) ?? ((EClass.rnd(2) != 0) ? "jure" : dialogSheet.map.RandomItem()["id"]);
}
public override void OnImportMap()