EA 23.310 Nightly Patch 1 โ
May 28, 2026
13 files modified.
Important Changes โ
Possible breaking changes. Click the filename to view the chunk.
TraitSeed (3) โ
public static Thing MakeSeed(string idSource) public static Thing MakeSeed(SourceObj.Row obj) public static Thing MakeRandomSeed(bool enc = false) AttackProcess โ
public void Prepare(Chara _CC, Thing _weapon, Card _TC = null, Point _TP = null,
dBonus = CC.DMG + (CC.IsPCParty ? 3 : 7) + Math.Min(weapon.encLV, 99);
dNum = 2;
dDim = (((!CC.IsPCParty) ? CC.LV : 0) + CC.STR + CC.Evalue(108)) * num2 / 100 * num3 / 100 / 2;
dMulti = 1f;
dMulti = 1f + (float)CC.Evalue(132) / 500f;
toHitBase = EClass.curve(CC.DEX / 4 + CC.STR / 2 + weaponSkill.Value, 50, 25) + (CC.IsPCFaction ? 75 : 250);
toHitFix = CC.HIT + weapon.HIT;
penetration = 25;BaseTaskHarvest โ
public void SetTarget(Chara c, Thing _tool = null)
{
case HarvestType.Obj:
array = pos.sourceObj.reqHarvest;
row = pos.cell.matObj;
row = (pos.cell.isObjDyed ? pos.sourceObj.DefaultMaterial : pos.cell.matObj);
break;
case HarvestType.Thing:
array = target.trait.ReqHarvest.Split(',');BaseTileMap โ
public virtual void DrawTile()
fogged = true;
}
}
goto IL_7ebe;
IL_732d:
int num3;
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num3;
rendererFov.Draw(param);
}
goto IL_738d;
IL_738d:
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && !snowed && !this.cell.isClearSnow && ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock)))
{
snowed = true;
}
if (this.cell.effect != null)
{
if (this.cell.effect.IsLiquid)
{
SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4;
param.tile = tile + this.cell.sourceEffect._tiles[0];
param.mat = defaultMaterial;
param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color);
sourceEffect.renderData.Draw(param);
}
else
{
param.tile = this.cell.effect.source._tiles[0];
SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
if (sourceEffect2.anime.Length != 0)
{
if (sourceEffect2.anime.Length > 2)
{
float num4 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
if (!(num4 >= (float)sourceEffect2.anime[0]))
{
param.tile += num4;
}
}
else
{
float num5 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
param.tile += num5;
}
}
if (this.cell.effect.IsFire)
{
rendererEffect.Draw(param);
}
else
{
this.cell.effect.source.renderData.Draw(param);
}
}
}
param.color = floorLight;
if (this.cell.critter != null)
{
Critter critter = this.cell.critter;
int snowTile = critter.tile;
if (snowed && critter.SnowTile != 0)
{
critter.x = 0.06f;
critter.y = -0.06f;
snowTile = critter.SnowTile;
}
else
{
critter.Update();
}
pass = passObjSS;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f;
batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f;
batch.matrices[pass.idx].m23 = param.z;
batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1));
batch.colors[pass.idx] = floorLight;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
if (detail != null)
{
TransAnime anime3 = detail.anime;
if (anime3 != null && !anime3.animeBlock)
{
TransAnime anime4 = detail.anime;
param.x += anime4.v.x;
param.y += anime4.v.y;
param.z += anime4.v.z;
}
}
if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
{
SourceObj.Row sourceObj = this.cell.sourceObj;
if (!snowed || sourceObj.snowTile <= 0)
{
param.snow = snowed;
param.mat = this.cell.matObj;
orgY = param.y;
if (param.liquidLv > 0)
{
if (sourceObj.pref.Float)
{
param.y += 0.01f * floatY;
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
}
if (sourceObj.tileType.IsWaterTop)
{
param.liquidLv = 0;
}
else
{
param.liquidLv += sourceObj.pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquid = 1f;
}
else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
{
param.liquidLv = 99 + sourceObj.pref.liquidModMax;
}
}
}
if (sourceObj.useAltColor)
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
}
else
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
}
if (sourceObj.HasGrowth)
{
this.cell.growth.OnRenderTileMap(param);
}
else
{
if (this.cell.autotileObj != 0)
{
param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
}
else if (sourceObj.tileType.IsUseBlockDir)
{
param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
}
else
{
param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
}
if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
{
param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
}
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)
{
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 (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
switch (ActionMode.FlagCell.mode)
{
case AM_FlagCell.Mode.flagWallPillar:
if (this.cell.isToggleWallPillar)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagSnow:
if (this.cell.isClearSnow)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagFloat:
if (this.cell.isForceFloat)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagClear:
if (this.cell.isClearArea)
{
passArea.Add(param, 34f, 0f);
}
break;
}
}
if (detail == null)
goto IL_7dad;
IL_7dad:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
return;
}
if (highlightArea && detail.area != null)
{
passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
}
if (detail.footmark != null && sourceFloor.id != 0)
{
param.tile = detail.footmark.tile;
param.mat = matFloor;
param.matColor = 104025f;
renderFootmark.Draw(param);
}
goto IL_7ebe;
IL_16c3:
if (this.cell.isSlopeEdge)
{
float num6 = (float)height * _heightMod.y;
orgY = param.y;
orgZ = param.z;
param.dir = this.cell.blockDir;
if (snowed)
{
param.color = floorLight;
}
SourceBlock.Row defBlock;
if (sourceBlock.tileType.IsFullBlock)
{
defBlock = sourceBlock;
param.mat = matBlock;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
}
else
{
defBlock = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
if (defBlock.id != 1)
{
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
else
{
param.matColor = 104025f;
}
}
for (int j = 0; (float)j < num6 / 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)
{
float num7 = param.tile;
param.tile = 0f;
rendererFov.Draw(param);
param.tile = num7;
}
}
param.y = orgY;
param.z = orgZ;
}
param.color = floorLight;
if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
{
orgY = param.y;
orgZ = param.z;
int num8 = 0;
if (sourceBlock.tileType.IsFullBlock)
{
SourceBlock.Row row3 = sourceBlock;
num8 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
}
else
{
SourceBlock.Row row3 = sourceFloor._defBlock;
num8 = 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 = num8 + ((!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 = num8 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
rendererWaterBlock.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
if (showBorder && !this.cell.outOfBounds)
int num3 = 0;
thingPos.x = 0f;
thingPos.y = 0f;
thingPos.z = 0f;
freePos.x = (freePos.y = (freePos.z = 0f));
if (this.cell.HasRamp)
{
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));
}
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;
}
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
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)
{
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++)
if (liquidLv > 10)
{
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)k;
defBlock2.renderData.Draw(param);
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
param.y = orgY;
param.z = orgZ;
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
param.y -= TileType.FloorWaterShallow.FloorHeight;
}
if (!sourceFloor.tileType.IsSkipFloor)
Thing thing = null;
bool shadow = liquidLv == 0;
float num4 = 0f;
float num5 = 0f;
float num6 = 0f;
float num7 = 0f;
bool flag6 = false;
float num8 = 0f;
bool flag7 = false;
float num9 = 0f;
if (detail.things.Count > 0 && isSeen)
{
if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
{
floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
if (snowed)
{
floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
}
else
{
floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
}
param.color = floorLight2;
if (this.cell.lotShade)
{
floorLight = floorLight2;
}
}
floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
if (isWater && flag)
{
param.y -= 0.01f * floatY;
}
if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
_ = zSetting.max1;
float num10 = 0f;
for (int j = 0; j < detail.things.Count; j++)
{
param.mat = matFloor;
param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
param.matColor = floorMatColor;
param.snow = snowed;
if (sourceFloor.anime.Length != 0)
Thing t = detail.things[j];
if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction && !buildMode) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
{
int num9 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
param.tile += num9;
continue;
}
if (this.cell.isDeck)
TileType tileType = t.trait.tileType;
bool isInstalled = t.IsInstalled;
SourcePref pref = t.Pref;
if (!isInstalled && t.category.tileDummy != 0)
{
param.z += 1f;
if ((bool)sourceFloor.renderData.subData)
{
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
param.z -= 1f;
pref = rendererObjDummy.shadowPref;
}
else
{
if ((bool)sourceFloor.renderData.subData)
{
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
float num11 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
if (t.ignoreStackHeight)
{
thingPos.y -= num4;
thingPos -= altitudeFix * num5;
}
int num10 = 0;
if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
shadow = thingPos.y < 0.16f && num9 < 0.16f;
_ = pref.bypassShadow;
param.shadowFix = 0f - thingPos.y;
param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);
if (t.isRoofItem)
{
if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
{
num10++;
}
if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
{
num10 += 2;
}
if (num10 != 0)
param.snow = isSnowCovered && !this.cell.isClearSnow;
SetRoofHeight(param, this.cell, cx, cz);
_actorPos.x = param.x;
_actorPos.y = param.y;
_actorPos.z = param.z + num10;
if (this.room != null)
{
param.tile = 448 + num10 + 12;
param.z -= 0.1f;
sourceFloor.renderData.Draw(param);
param.z += 0.1f;
param.color = GetRoofLight(this.room.lot);
}
shadow = false;
param.liquidLv = 0;
}
if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
else
{
if (snowed)
param.snow = snowed;
_actorPos.x = orgX + num7;
_actorPos.y = orgY;
_actorPos.z = orgZ + num10 + thingPos.z;
if (tileType.CanStack || !isInstalled)
{
if (sourceFloor == FLOOR.sourceSnow)
if (thing?.id != t.id)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceFloor.renderData.Draw(param);
_actorPos.x += thingPos.x;
}
}
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)
_actorPos.y += thingPos.y;
if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
{
pass.NextBatch();
thingPos.y -= num4;
if (thing != null)
{
_actorPos.z -= 0.2f;
thingPos.z -= 0.2f;
}
_actorPos.y -= num4;
}
_actorPos.z += renderSetting.thingZ + (float)j * -0.01f + zSetting.mod1 * thingPos.y;
}
if (!sourceFloor.ignoreTransition && !snowed)
if (isInstalled)
{
Cell back = this.cell.Back;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
if (t.TileType.IsRamp)
{
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)
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)
{
pass.NextBatch();
num9 += rampFix2.y;
}
liquidLv -= (int)(rampFix2.y * 150f);
if (liquidLv < 0)
{
liquidLv = 0;
}
}
back = this.cell.Left;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
else if (!flag7 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
{
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)
orgY += num11 + (float)t.altitude * altitudeFix.y;
orgZ += (float)t.altitude * altitudeFix.z;
freePos.y += num11 + (float)t.altitude * altitudeFix.y;
if (!this.cell.IsTopWater || t.altitude > 0)
{
pass.NextBatch();
num9 += num11 + (float)t.altitude * altitudeFix.y;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
liquidLv -= (int)(num11 * 150f);
if (liquidLv < 0)
{
liquidLv = 0;
}
}
else
{
thingPos.y += num11;
if (tileType.UseMountHeight)
{
if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow)
{
if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
{
continue;
}
if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
Room room = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
if (t.trait.AlwaysHideOnLowWall)
{
if (room == null || !room.data.showWallItem)
{
continue;
}
}
else if (t.altitude >= lowWallObjAltitude)
{
continue;
}
}
}
if (tileType.UseHangZFix)
{
flag6 = true;
}
tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
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 && j > 10)
{
flag7 = true;
}
}
}
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num10 == 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();
}
}
}
if (isWater)
{
int num11 = 12;
int num12 = this.cell.shore / num11;
int num13 = this.cell.shore % num11;
bool isShoreSand = this.cell.isShoreSand;
if (this.cell.shore != 0)
{
Cell cell = ((((uint)num12 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num12 & 2u) != 0) ? this.cell.Right : ((((uint)num12 & 4u) != 0) ? this.cell.Front : this.cell.Left)));
if (isShoreSand && !cell.sourceFloor.isBeach)
else
{
cell = ((((uint)num12 & 8u) != 0) ? this.cell.Left : ((((uint)num12 & 4u) != 0) ? this.cell.Front : ((((uint)num12 & 2u) != 0) ? this.cell.Right : this.cell.Back)));
thingPos.y += num11;
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
}
if (!cell.IsSnowTile)
if (t.isFloating && isWater && !hasBridge && !flag)
{
param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
if (isShoreSand)
flag = true;
float num12 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num12;
if (!t.trait.IsChangeFloorHeight)
{
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 / num11;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
num13 = 2;
num8 = num11;
}
else
_actorPos.y += 0.01f * floatY - num12;
if (liquidLv > 10)
{
num13 = cell.sourceFloor.edge;
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
param.tile = (24 + num13 / 2) * 32 + num13 % 2 * 16 + num12;
rendererShore.Draw(param);
liquidLv -= (int)(floatY * 0.5f);
if (liquidLv < 0)
{
liquidLv = 0;
}
param.liquidLv = liquidLv;
}
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num11) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num11) & (true ? 1u : 0u)) != 0)
{
param.tile = 785f;
param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(60);
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num11) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num11) & (true ? 1u : 0u)) != 0)
{
param.tile = 786f;
param.matColor = GetColorInt(ref this.cell.BackRight.matFloor.matColor, this.cell.BackRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(56);
}
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num11) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num11) & 4u) != 0)
{
param.tile = 787f;
param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(48);
}
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num11) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num11) & 4u) != 0)
{
param.tile = 788f;
param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(52);
}
if (this.cell._bridge != 0 && this.cell.isBridgeEdge && this.cell.bridgePillar != byte.MaxValue)
{
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)
num4 = num11;
if (t.sourceCard.multisize && !t.trait.IsGround)
{
pass.NextBatch();
num10 += zSetting.multiZ;
}
}
bool flag6 = false;
if (isShoreSand)
{
if (((uint)num12 & (true ? 1u : 0u)) != 0)
orgZ += t.renderer.data.stackZ;
if (param.liquidLv > 0)
{
if (((uint)num12 & 8u) != 0)
param.liquidLv += pref.liquidMod;
if (param.liquidLv < 1)
{
if ((num12 & 2) == 0 && (num12 & 4) == 0)
{
Draw(16);
}
flag6 = true;
param.liquidLv = 1;
}
if (((uint)num12 & 2u) != 0)
else if (param.liquidLv > 99 + pref.liquidModMax)
{
if ((num12 & 8) == 0 && (num12 & 4) == 0)
{
Draw(20);
}
flag6 = true;
param.liquidLv = 99 + pref.liquidModMax;
}
}
if (((uint)num12 & 4u) != 0)
}
if (!isInstalled || !tileType.UseMountHeight)
{
if (t.altitude != 0)
{
if (((uint)num12 & 8u) != 0)
{
if ((num12 & 2) == 0 && (num12 & 1) == 0)
{
Draw(24);
}
flag6 = true;
}
if (((uint)num12 & 2u) != 0)
_actorPos += altitudeFix * t.altitude;
if (!t.isRoofItem)
{
if ((num12 & 8) == 0 && (num12 & 1) == 0)
{
Draw(28);
}
flag6 = true;
num6 += (float)t.altitude;
num5 = t.altitude;
}
}
if (!flag6)
if (num6 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
continue;
}
if (t.freePos)
{
if (t.isRoofItem)
{
Draw(8);
_actorPos.x += t.fx;
_actorPos.y += t.fy - (float)t.altitude * altitudeFix.y;
}
if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
else
{
Draw(12);
_actorPos.x = orgX + t.fx - freePos.x;
_actorPos.y = orgY + t.fy - freePos.y;
}
}
if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
{
_actorPos.z += -0.5f;
}
}
if (!flag6)
if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
{
if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
if (iconMode != 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 / num11) & (true ? 1u : 0u)) != 0)
int num13 = 0;
switch (iconMode)
{
if (isShoreSand)
case CardIconMode.Visibility:
if (t.isMasked)
{
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;
num13 = 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;
num13 = 18;
}
break;
case CardIconMode.Deconstruct:
if (t.isDeconstructing)
{
num13 = 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;
num13 = 13;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
if (num13 != 0)
{
pass.NextBatch();
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num13);
}
}
if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
t.SetRenderParam(param);
if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num11) & 8u) != 0)
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
{
if (isShoreSand)
t.SetRenderParam(_param);
_actorPos.x = EMono.pc.renderer.position.x;
_actorPos.y = EMono.pc.renderer.position.y - pref.height;
_actorPos.z = EMono.pc.renderer.position.z + 0.02f;
t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
});
}
else
{
t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
}
}
if (isInstalled)
{
num7 += 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 += num8;
if (detail.charas.Count <= 0)
{
return;
}
param.shadowFix = 0f - num9;
param.color += 1310720f;
float max = zSetting.max2;
for (int k = 0; k < detail.charas.Count; k++)
{
Chara chara = detail.charas[k];
if (chara.host != null)
{
continue;
}
if (chara != EMono.pc && chara != LayerDrama.alwaysVisible)
{
if (chara.mimicry != null && chara.mimicry.IsThing)
{
if (flag3 || fogged || !this.cell.isSeen)
{
continue;
}
}
else if (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))
{
continue;
}
}
_actorPos.x = orgX;
_actorPos.y = orgY;
_actorPos.z = orgZ;
if (this.cell.IsBlocked && chara.IsAstralBody)
{
_actorPos.z += EMono.setting.render.astralBodyFixZ;
}
chara.SetRenderParam(param);
_ = chara.IsAliveInCurrentZone;
if (chara.isRestrained)
{
TraitShackle restrainer = chara.GetRestrainer();
if (restrainer != null)
{
Vector3 getRestrainPos = restrainer.GetRestrainPos;
if (getRestrainPos != default(Vector3))
{
Vector3 position = restrainer.owner.renderer.position;
float defCharaHeight = EMono.setting.render.defCharaHeight;
float num14 = 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 + num14;
_actorPos.z = position.z + getRestrainPos.z;
param.liquidLv = 0;
param.shadowFix = orgY - _actorPos.y;
chara.renderer.SetFirst(first: true);
chara.renderer.Draw(param, ref _actorPos, drawShadow: true);
param.shadowFix = 0f;
continue;
}
}
}
if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
{
if (chara.IsDeadOrSleeping && chara.IsPCC)
{
float num15 = chara.renderer.data.size.y * 0.3f;
if (thingPos.y > max)
{
thingPos.y = max;
}
float num16 = thingPos.y + num15;
float num17 = (float)k * -0.01f;
if (num16 > zSetting.thresh1)
{
num17 = zSetting.mod1;
}
_actorPos.x += thingPos.x;
_actorPos.y += thingPos.y;
_actorPos.z += renderSetting.laydownZ + num17;
param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
thingPos.y += num15 * 0.8f;
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
else
{
param.liquidLv = liquidLv;
if (isUnderwater)
{
if (chara.Pref.FloatUnderwater)
{
float num18 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
float num19 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
orgY += 0.01f * num19 - num18;
_actorPos.y += 0.01f * num19 - num18;
param.shadowFix -= 0.01f * num19 - num18;
}
}
else if (liquidLv > 0)
{
if (chara.Pref.Float && !flag && !hasBridge)
{
if (liquidLv > 20)
{
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;
float num20 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num20;
_actorPos.y += 0.01f * floatY - num20;
int num21 = TileType.FloorWaterShallow.LiquidLV * 10;
num21 -= (int)(floatY * 0.5f);
param.liquidLv = num21;
}
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.liquidLv -= 20;
}
}
else
param.liquidLv += chara.Pref.liquidMod;
if (param.liquidLv < 1)
{
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;
param.liquidLv = 1;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
{
pass.NextBatch();
param.liquidLv = 99 + chara.Pref.liquidModMax;
}
}
if (!chara.IsPC && EMono.pc.host != chara && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC))
{
_actorPos += renderSetting.charaPos[1 + ((num3 < 4) ? num3 : 3)];
}
_actorPos.z += 0.01f * (float)k + renderSetting.charaZ;
num3++;
if (flag6)
{
_actorPos.z += chara.renderer.data.hangedFixZ;
}
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
}
param.x = orgX;
param.y = orgY;
param.z = orgZ;
}
return;
IL_16c3:
if (this.cell.isSlopeEdge)
{
float num22 = (float)height * _heightMod.y;
orgY = param.y;
orgZ = param.z;
param.dir = this.cell.blockDir;
if (snowed)
{
param.color = floorLight;
}
SourceBlock.Row defBlock;
if (sourceBlock.tileType.IsFullBlock)
{
defBlock = sourceBlock;
param.mat = matBlock;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
}
else
{
defBlock = sourceFloor._defBlock;
param.mat = matFloor;
param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
if (defBlock.id != 1)
{
param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
}
if (flag)
else
{
param.y += 0.01f * floatY;
param.matColor = 104025f;
}
}
if (flag)
for (int l = 0; (float)l < num22 / heightBlockSize; l++)
{
param.z -= 1f;
param.y += ugFix.y;
param.z += ugFix.z + slopeFixZ * (float)l;
defBlock.renderData.Draw(param);
if (this.cell.pcSync && EMono.player.lightPower > 0f)
{
float num23 = param.tile;
param.tile = 0f;
rendererFov.Draw(param);
param.tile = num23;
}
}
param.y = orgY;
param.z = orgZ;
}
if (this.cell.skipRender)
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.pcSync)
orgY = param.y;
orgZ = param.z;
int num24 = 0;
if (sourceBlock.tileType.IsFullBlock)
{
param.tile = 0f;
rendererFov.Draw(param);
SourceBlock.Row row3 = sourceBlock;
num24 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
}
return;
else
{
SourceBlock.Row row3 = sourceFloor._defBlock;
num24 = 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 = num24 + ((!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 = num24 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
rendererWaterBlock.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
if (hasBridge)
if (showBorder && !this.cell.outOfBounds)
{
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.matColor = 104025f;
if (cx == EMono._map.bounds.x)
{
param.y += 0.01f * floatY;
renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
}
param.color = floorLight;
param.mat = matBridge;
floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
param.dir = this.cell.floorDir;
param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
param.matColor = floorMatColor;
sourceBridge.renderData.Draw(param);
if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
else if (cx == EMono._map.bounds.maxX)
{
pass = passAutoTile;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
}
if (this.cell.shadow != 0)
if (cz == EMono._map.bounds.z)
{
if (sourceBridge == FLOOR.sourceSnow)
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));
}
}
if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
{
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 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)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceBridge.renderData.Draw(param);
floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
}
else
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = blockLight;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
}
param.color = floorLight2;
if (this.cell.lotShade)
{
floorLight = floorLight2;
}
}
if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != byte.MaxValue && !noSlopMode)
floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
if (isWater && flag)
{
orgY = param.y;
orgZ = param.z;
param.y += bridgeFix.y;
param.z += bridgeFix.z;
param.dir = 0;
SourceBlock.Row row4 = sourceBridge._bridgeBlock;
float num14 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
if (this.cell.sourceFloor.tileType == TileType.Sky)
param.y -= 0.01f * floatY;
}
if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
{
param.mat = matFloor;
param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
param.matColor = floorMatColor;
param.snow = snowed;
if (sourceFloor.anime.Length != 0)
{
num14 += (float)EMono._map.config.skyBlockHeight;
int num25 = (int)(Time.realtimeSinceStartup * 1000f / (float)sourceFloor.anime[1] % (float)sourceFloor.anime[0]);
param.tile += num25;
}
int num15 = (int)(num14 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
if (this.cell.isDeck)
{
row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
param.tile = row4._tiles[0] + ((num15 == 2) ? 32 : 0);
param.mat = ((sourceBridge.DefaultMaterial == row4.DefaultMaterial) ? sourceBridge.DefaultMaterial : row4.DefaultMaterial);
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, row4.colorMod));
param.z += 1f;
if ((bool)sourceFloor.renderData.subData)
{
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
param.z -= 1f;
}
else
{
param.mat = matBlock;
param.tile = row4._tiles[0] + 32;
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
if ((bool)sourceFloor.renderData.subData)
{
sourceFloor.renderData.subData.Draw(param);
}
sourceFloor.renderData.Draw(param);
}
param.y += ugFixBridgeTop.y;
param.z += ugFixBridgeTop.z;
for (int l = 0; l < num15; l++)
int num26 = 0;
if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
{
if (l == num15 - 1)
if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
{
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y + ugFixBridgeBottom.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z + ugFixBridgeBottom.z;
num26++;
}
if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
{
num26 += 2;
}
if (num26 != 0)
{
param.tile = 448 + num26 + 12;
param.z -= 0.1f;
sourceFloor.renderData.Draw(param);
param.z += 0.1f;
}
}
if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
{
if (snowed)
{
if (sourceFloor == FLOOR.sourceSnow)
{
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceFloor.renderData.Draw(param);
}
}
else
{
param.y += ugFixBridge.y;
param.z += ugFixBridge.z;
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
batch.tiles[pass.idx] = 448 + this.cell.shadow;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
if (!sourceFloor.ignoreTransition && !snowed)
{
Cell back = this.cell.Back;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
back = this.cell.Left;
if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
{
pass = passFloor;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
}
}
row4.renderData.Draw(param);
}
param.y = orgY;
param.z = orgZ;
}
}
if (this.cell._deco != 0)
{
param.mat = matFloor;
param.tile = sourceDeco._tiles[floorDir % sourceDeco._tiles.Length];
param.matColor = ((sourceDeco.colorMod == 0) ? 104025 : GetColorInt(ref matDeco.matColor, sourceDeco.colorMod));
param.snow = snowed;
if (sourceDeco.autotile != 0)
{
if (this.cell.autotileDeco != 0)
if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num26 == 0)
{
pass = passAutoTile;
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 + sourceDeco.autotile / 2) * 32 + sourceDeco.autotile % 2 * 16 + this.cell.autotileDeco;
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++;public virtual void DrawTile()
}
}
}
else
{
sourceDeco.renderData.Draw(param);
}
}
if (!buildMode && this.cell.highlight != 0)
{
if (this.cell._block != 0 && !this.cell.hasDoor)
{
screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
}
else
{
passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
}
}
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
{
snowed = false;
}
num3 = 0;
if (sourceBlock.id != 0)
{
this.tileType = sourceBlock.tileType;
roomHeight = 0f;
int blockDir = this.cell.blockDir;
bool num16 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
bool flag7 = false;
if (!num16)
if (isWater)
{
switch (wallClipMode)
int num27 = 12;
int num28 = this.cell.shore / num27;
int num29 = this.cell.shore % num27;
bool isShoreSand = this.cell.isShoreSand;
if (this.cell.shore != 0)
{
case WallClipMode.ByRoom:
if (!this.tileType.RepeatBlock)
{
break;
}
if (currentRoom == null || showFullWall)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = lowBlock;
}
else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
Cell cell = ((((uint)num28 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num28 & 2u) != 0) ? this.cell.Right : ((((uint)num28 & 4u) != 0) ? this.cell.Front : this.cell.Left)));
if (isShoreSand && !cell.sourceFloor.isBeach)
{
this.room = this.cell.Front.room;
_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
cell = ((((uint)num28 & 8u) != 0) ? this.cell.Left : ((((uint)num28 & 4u) != 0) ? this.cell.Front : ((((uint)num28 & 2u) != 0) ? this.cell.Right : this.cell.Back)));
}
else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
if (!cell.IsSnowTile)
{
this.room = this.cell.Right.room;
_lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
if (isShoreSand)
{
pass = passShore;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z;
batch.tiles[pass.idx] = 768 + this.cell.shore / num27;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = param.matColor;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
num29 = 2;
}
else
{
num29 = cell.sourceFloor.edge;
}
param.tile = (24 + num29 / 2) * 32 + num29 % 2 * 16 + num28;
rendererShore.Draw(param);
}
else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num27) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num27) & (true ? 1u : 0u)) != 0)
{
param.tile = 785f;
param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(60);
}
if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num27) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num27) & (true ? 1u : 0u)) != 0)
{
param.tile = 786f;
param.matColor = GetColorInt(ref this.cell.BackRight.matFloor.matColor, this.cell.BackRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(56);
}
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num27) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num27) & 4u) != 0)
{
param.tile = 787f;
param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
passShore.Add(param);
Draw(48);
}
if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num27) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num27) & 4u) != 0)
{
param.tile = 788f;
param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
passShore.Add(param);
Draw(52);
}
if (this.cell._bridge != 0 && this.cell.isBridgeEdge && this.cell.bridgePillar != byte.MaxValue)
{
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
batch.colors[pass.idx] = param.color;
batch.matColors[pass.idx] = 104025f;
pass.idx++;
if (pass.idx == pass.batchSize)
{
this.room = this.cell.FrontRight.room;
_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
pass.NextBatch();
}
else
}
bool flag8 = false;
if (isShoreSand)
{
if (((uint)num28 & (true ? 1u : 0u)) != 0)
{
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = true;
if (!this.tileType.IsFullBlock)
if (((uint)num28 & 8u) != 0)
{
if (this.cell.lotWall)
if ((num28 & 2) == 0 && (num28 & 4) == 0)
{
_lowblock = false;
Draw(16);
}
else if (this.room == currentRoom)
flag8 = true;
}
if (((uint)num28 & 2u) != 0)
{
if ((num28 & 8) == 0 && (num28 & 4) == 0)
{
_lowblock = !this.cell.fullWall;
Draw(20);
}
flag8 = true;
}
}
flag7 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
if (flag7)
{
_lowblock = false;
}
if (this.room == null && alwaysLowblock)
if (((uint)num28 & 4u) != 0)
{
_lowblock = true;
roomHeight = 0f;
if (((uint)num28 & 8u) != 0)
{
if ((num28 & 2) == 0 && (num28 & 1) == 0)
{
Draw(24);
}
flag8 = true;
}
if (((uint)num28 & 2u) != 0)
{
if ((num28 & 8) == 0 && (num28 & 1) == 0)
{
Draw(28);
}
flag8 = true;
}
}
if (this.room != null)
if (!flag8)
{
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
if (showRoof)
if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
{
roomHeight = this.room.lot.realHeight;
break;
Draw(8);
}
if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
{
roomHeight = 0f;
break;
Draw(12);
}
int num17 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num17) ? this.room.lot.height : num17) + 0.01f * (float)this.room.lot.heightFix;
}
break;
case WallClipMode.ByLot:
if (defaultBlockHeight > 0f || isIndoor)
}
if (!flag8)
{
if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
{
_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)
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num27) & (true ? 1u : 0u)) != 0)
{
roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
if (isShoreSand)
{
param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
batch.tiles[pass.idx] = 640 + seaAnimeIndexes[waterAnimeIndex % seaAnimeIndexes.Length];
batch.matColors[pass.idx] = param.matColor;
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
}
}
else
{
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
}
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
{
pass.NextBatch();
}
break;
}
if (showFullWall)
if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
{
_lowblock = this.room != null;
if (_lowblock)
pass = passEdge;
batch = pass.batches[pass.batchIdx];
batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
batch.matColors[pass.idx] = 104025f;
if (((uint)(this.cell.shore / num27) & 8u) != 0)
{
if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
if (isShoreSand)
{
_lowblock = false;
param.matColor = GetColorInt(ref this.cell.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 if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
else
{
_lowblock = true;
batch.matrices[pass.idx].m03 = param.x;
batch.matrices[pass.idx].m13 = param.y;
batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
batch.tiles[pass.idx] += 12f;
}
}
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))
batch.colors[pass.idx] = param.color;
pass.idx++;
if (pass.idx == pass.batchSize)
{
roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
pass.NextBatch();
}
}
break;
}
if (flag)
{
param.y += 0.01f * floatY;
}
}
if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
if (flag)
{
num3 = 1;
param.z -= 1f;
}
else if (lowBlock)
}
if (this.cell.skipRender)
{
if (this.cell.pcSync)
{
num3 = 2;
param.tile = 0f;
rendererFov.Draw(param);
}
param.mat = matBlock;
param.dir = this.cell.blockDir;
param.snow = snowed;
switch (this.tileType.blockRenderMode)
return;
}
if (hasBridge)
{
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
if (flag)
{
case BlockRenderMode.FullBlock:
param.y += 0.01f * floatY;
}
param.color = floorLight;
param.mat = matBridge;
floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
param.dir = this.cell.floorDir;
param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
param.matColor = floorMatColor;
sourceBridge.renderData.Draw(param);
if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
{
bool invisible = sourceBlock.tileType.Invisible;
if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
{
break;
}
if (this.cell.isSurrounded)
{
switch (innerMode)
{
case InnerMode.InnerBlock:
case InnerMode.BuildMode:
blockLight = _baseBrightness + fogBrightness;
param.color = (int)(50f * blockLight) * 262144;
param.matColor = 104025f;
param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
rendererInnerBlock.Draw(param);
return;
case InnerMode.None:
case InnerMode.Height:
param.color = blockLight;
break;
}
}
if (snowed)
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)
{
param.color = floorLight;
pass.NextBatch();
}
param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
if (currentRoom != null && !showFullWall)
}
if (this.cell.shadow != 0)
{
if (sourceBridge == FLOOR.sourceSnow)
{
_lowblock = true;
roomHeight = 0f;
if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
{
_lowblock = false;
}
if (!_lowblock)
{
int num19 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num19) ? currentRoom.lot.height : num19) + 0.01f * (float)currentRoom.lot.heightFix;
}
param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
param.z -= 0.01f;
sourceBridge.renderData.Draw(param);
}
if (flag7)
else
{
_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)
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)
{
roomHeight = 0f;
pass.NextBatch();
}
}
if (invisible)
{
roomHeight = 0f;
_lowblock = false;
}
if (this.cell.Things.Count > 0)
}
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 num30 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
if (this.cell.sourceFloor.tileType == TileType.Sky)
{
_lowblock = false;
num30 += (float)EMono._map.config.skyBlockHeight;
}
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)
int num31 = (int)(num30 / heightBlockSize) + 2;
if (this.cell.bridgePillar != 0)
{
if (!this.cell.hasDoor)
{
sourceBlock.renderData.Draw(param);
}
row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
param.tile = row4._tiles[0] + ((num31 == 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, 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 num20 = param.z;
param.y += (float)room.lot.decoFix2 * 0.01f;
param.z += (float)room.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y2;
param.z = num20;
}
}
room = this.cell.Right.room ?? this.cell.room;
if (room == null && this.cell.Front.room != null)
{
room = this.cell.Front.room;
param.mat = matBlock;
param.tile = row4._tiles[0] + 32;
param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
}
if (!invisible && room != null)
param.y += ugFixBridgeTop.y;
param.z += ugFixBridgeTop.z;
for (int n = 0; n < num31; n++)
{
if (room.lot.idDeco != 0 && !this.cell.hasDoor)
if (n == num31 - 1)
{
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;
param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y + ugFixBridgeBottom.y;
param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z + ugFixBridgeBottom.z;
}
if (room.lot.idDeco2 != 0 && roomHeight != 0f && (float)room.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
else
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room.lot.idDeco2) * -1;
param.matColor = room.lot.colDeco2;
float y4 = param.y;
float num21 = param.z;
param.y += (float)room.lot.decoFix2 * 0.01f;
param.z += (float)room.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = y4;
param.z = num21;
param.y += ugFixBridge.y;
param.z += ugFixBridge.z;
}
row4.renderData.Draw(param);
}
break;
param.y = orgY;
param.z = orgZ;
}
case BlockRenderMode.WallOrFence:
}
if (this.cell._deco != 0)
{
param.mat = matFloor;
param.matColor = ((sourceDeco.colorMod == 0) ? 104025 : GetColorInt(ref matDeco.matColor, sourceDeco.colorMod));
param.snow = snowed;
if (sourceDeco.autotile != 0)
{
if (map.config.fullWallHeight)
{
showFullWall = true;
_lowblock = false;
}
orgY = param.y;
orgZ = param.z;
param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
bool flag8 = blockDir == 1 || _lowblock || flag7;
bool flag9 = blockDir == 0 || _lowblock || flag7;
if (!showFullWall && currentRoom != null)
if (this.cell.autotileDeco != 0)
{
if (!flag8)
{
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
{
if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
flag8 = true;
}
}
else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
{
flag8 = true;
}
}
if (!flag9)
{
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
{
if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
flag9 = true;
}
}
else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
{
flag9 = true;
}
}
param.tile = (26 + sourceDeco.autotile / 2) * 32 + sourceDeco.autotile % 2 * 16 + this.cell.autotileDeco;
param.z += ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
sourceDeco.renderData.Draw(param);
param.z = orgZ;
}
if (blockDir == 0 || blockDir == 2)
}
else
{
param.tile = sourceDeco._tiles[floorDir % sourceDeco._tiles.Length];
sourceDeco.renderData.Draw(param);
}
}
if (!buildMode && this.cell.highlight != 0)
{
if (this.cell._block != 0 && !this.cell.hasDoor)
{
screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
}
else
{
passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
}
}
param.color = blockLight;
if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
{
snowed = false;
}
int num32 = 0;
if (sourceBlock.id != 0)
{
this.tileType = sourceBlock.tileType;
roomHeight = 0f;
int blockDir = this.cell.blockDir;
bool num33 = this.tileType.blockRenderMode == BlockRenderMode.Floor;
bool flag9 = false;
if (!num33)
{
switch (wallClipMode)
{
param.dir = 0;
Room room2 = this.cell.Front.room ?? this.cell.room;
if (room2 != null && this.tileType.IsWall)
case WallClipMode.ByRoom:
if (!this.tileType.RepeatBlock)
{
if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco);
param.matColor = room2.lot.colDeco;
param.y += (float)room2.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = orgY;
}
if (room2.lot.idDeco2 != 0 && roomHeight != 0f && !flag8 && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2);
param.matColor = room2.lot.colDeco2;
param.y += (float)room2.lot.decoFix2 * 0.01f;
param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
rendererWallDeco.Draw(param);
param.y = orgY;
param.z = orgZ;
}
break;
}
Cell left = this.cell.Left;
if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
if (currentRoom == null || showFullWall)
{
_sourceBlock = left.sourceBlock;
param.mat = left.matBlock;
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = lowBlock;
}
else
else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
{
_sourceBlock = sourceBlock;
param.mat = matBlock;
this.room = this.cell.Front.room;
_lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
}
this.tileType = _sourceBlock.tileType;
param.tile = (tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock) ? 32 : 0));
if (_sourceBlock.useAltColor)
else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
{
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
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.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
this.room = this.cell.FrontRight.room;
_lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
}
if (roomHeight == 0f || flag8 || !this.tileType.RepeatBlock)
else
{
if (!this.cell.hasDoor)
this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
_lowblock = true;
if (!this.tileType.IsFullBlock)
{
_sourceBlock.renderData.Draw(param);
if (this.cell.lotWall)
{
_lowblock = false;
}
else if (this.room == currentRoom)
{
_lowblock = !this.cell.fullWall;
}
}
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
}
param.z += cornerWallFix2.z;
if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
flag9 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
if (flag9)
{
if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
{
param.snow = true;
}
param.tile = _sourceBlock._tiles[0] + ((flag8 && flag9 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
if (roomHeight == 0f || !this.tileType.RepeatBlock || (flag8 && flag9 && !flag7))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
_lowblock = false;
}
if (!flag8 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
if (this.room == null && alwaysLowblock)
{
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag8 && this.tileType.UseLowBlock && !flag7) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix3.x;
param.y += cornerWallFix3.y;
param.z += cornerWallFix3.z;
if (!flag7 && (roomHeight == 0f || flag8))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
}
param.x = orgX;
_lowblock = true;
roomHeight = 0f;
}
else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag8 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
if (this.room != null)
{
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))
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
if (showRoof)
{
_sourceBlock.renderData.Draw(param);
roomHeight = this.room.lot.realHeight;
break;
}
else
if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
roomHeight = 0f;
break;
}
param.x = orgX;
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;
}
}
if (blockDir == 1 || blockDir == 2)
{
param.y = orgY;
param.z = orgZ;
param.dir = 1;
Room room3 = this.cell.Right.room ?? this.cell.room;
if (room3 != null && this.tileType.IsWall)
break;
case WallClipMode.ByLot:
if (defaultBlockHeight > 0f || isIndoor)
{
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)
_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)
{
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;
roomHeight = defaultBlockHeight * EMono.setting.render.roomHeightMod;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
}
break;
}
if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
if (showFullWall)
{
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
_lowblock = this.room != null;
if (_lowblock)
{
int num22 = ((room4.data.maxHeight == 0) ? 2 : room4.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((room4.lot.height < num22) ? room4.lot.height : num22) + 0.01f * (float)room4.lot.heightFix;
if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
{
_lowblock = false;
}
}
}
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)
else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
{
_sourceBlock.renderData.Draw(param);
_lowblock = true;
}
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
_lowblock = lowBlock;
}
if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
if (this.tileType.RepeatBlock)
{
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
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))
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
}
param.x = orgX;
}
break;
}
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 (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
{
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)
num32 = 1;
}
else if (lowBlock)
{
num32 = 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 num36 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num36) ? currentRoom.lot.height : num36) + 0.01f * (float)currentRoom.lot.heightFix;
}
}
if (flag9)
{
renderData2.Draw(param);
_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;
}
}
else
if (invisible)
{
renderData2.DrawRepeat(param, num18, sourceBlock.tileType.RepeatSize);
roomHeight = 0f;
_lowblock = false;
}
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 BlockRenderMode.Floor:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
sourceBlock.renderData.Draw(param);
break;
default:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowBlock) ? 3000000 : 0);
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)
{
sourceBlock.renderData.Draw(param);
if (!this.cell.hasDoor)
{
sourceBlock.renderData.Draw(param);
}
}
else
{
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
}
break;
}
}
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
{
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
{
goto IL_732d;
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
{
goto IL_732d;
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0, isBlock: true);
}
}
}
goto IL_738d;
IL_7ebe:
if (detail.things.Count == 0 && detail.charas.Count == 0)
{
return;
}
int num23 = 0;
thingPos.x = 0f;
thingPos.y = 0f;
thingPos.z = 0f;
freePos.x = (freePos.y = (freePos.z = 0f));
if (this.cell.HasRamp)
{
Vector3 rampFix = sourceBlock.tileType.GetRampFix(this.cell.blockDir);
param.x += rampFix.x;
param.y += rampFix.y;
param.z += rampFix.z;
freePos.x += rampFix.x;
freePos.y += rampFix.y;
freePos.z += rampFix.z;
}
param.y += (flag ? 0f : ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight));
orgPos.x = (orgX = param.x);
orgPos.y = (orgY = param.y);
orgPos.z = (orgZ = param.z);
if (flag && liquidLv > 0)
{
if (liquidLv > 10)
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
param.y -= TileType.FloorWaterShallow.FloorHeight;
}
Thing thing = null;
bool shadow = liquidLv == 0;
float num24 = 0f;
float num25 = 0f;
float num26 = 0f;
float num27 = 0f;
bool flag10 = false;
float num28 = 0f;
bool flag11 = false;
float num29 = 0f;
if (detail.things.Count > 0 && isSeen)
{
_ = zSetting.max1;
float num30 = 0f;
for (int m = 0; m < detail.things.Count; m++)
{
Thing t = detail.things[m];
if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction && !buildMode) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
Room room2 = this.cell.Front.room ?? this.cell.room;
if (room2 == null && this.cell.Right.room != null)
{
continue;
room2 = this.cell.Right.room;
}
TileType tileType = t.trait.tileType;
bool isInstalled = t.IsInstalled;
SourcePref pref = t.Pref;
if (!isInstalled && t.category.tileDummy != 0)
if (!invisible && room2 != null)
{
pref = rendererObjDummy.shadowPref;
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;
float y = param.y;
param.y += (float)room2.lot.decoFix * 0.01f;
rendererWallDeco.Draw(param);
param.y = y;
}
if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2);
param.matColor = room2.lot.colDeco2;
float y2 = 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 = y2;
param.z = num37;
}
}
float num31 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
if (t.ignoreStackHeight)
room2 = this.cell.Right.room ?? this.cell.room;
if (room2 == null && this.cell.Front.room != null)
{
thingPos.y -= num24;
thingPos -= altitudeFix * num25;
room2 = this.cell.Front.room;
}
shadow = thingPos.y < 0.16f && num29 < 0.16f;
_ = pref.bypassShadow;
param.shadowFix = 0f - thingPos.y;
param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);
if (t.isRoofItem)
if (!invisible && room2 != null)
{
param.snow = isSnowCovered && !this.cell.isClearSnow;
SetRoofHeight(param, this.cell, cx, cz);
_actorPos.x = param.x;
_actorPos.y = param.y;
_actorPos.z = param.z + num30;
if (this.room != null)
if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
{
param.color = GetRoofLight(this.room.lot);
param.tile = EMono.sources.blocks.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 (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
{
param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2) * -1;
param.matColor = room2.lot.colDeco2;
float y4 = param.y;
float num38 = 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 = num38;
}
shadow = false;
param.liquidLv = 0;
}
else
break;
}
case BlockRenderMode.WallOrFence:
{
if (map.config.fullWallHeight)
{
param.snow = snowed;
_actorPos.x = orgX + num27;
_actorPos.y = orgY;
_actorPos.z = orgZ + num30 + thingPos.z;
if (tileType.CanStack || !isInstalled)
showFullWall = true;
_lowblock = false;
}
orgY = param.y;
orgZ = param.z;
param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
bool flag10 = blockDir == 1 || _lowblock || flag9;
bool flag11 = blockDir == 0 || _lowblock || flag9;
if (!showFullWall && currentRoom != null)
{
if (!flag10)
{
if (thing?.id != t.id)
{
_actorPos.x += thingPos.x;
}
_actorPos.y += thingPos.y;
if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
{
thingPos.y -= num24;
if (thing != null)
if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
_actorPos.z -= 0.2f;
thingPos.z -= 0.2f;
flag10 = true;
}
_actorPos.y -= num24;
}
_actorPos.z += renderSetting.thingZ + (float)m * -0.01f + zSetting.mod1 * thingPos.y;
else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
{
flag10 = true;
}
}
if (isInstalled)
if (!flag11)
{
if (t.TileType.IsRamp)
if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
{
Vector3 rampFix2 = t.TileType.GetRampFix(t.dir, pref);
orgX += rampFix2.x;
orgY += rampFix2.y;
orgZ += rampFix2.z;
freePos.x += rampFix2.x;
freePos.y += rampFix2.y;
freePos.z += rampFix2.z;
if (!this.cell.IsTopWater || t.altitude > 0)
{
num29 += rampFix2.y;
}
liquidLv -= (int)(rampFix2.y * 150f);
if (liquidLv < 0)
if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
{
liquidLv = 0;
flag11 = true;
}
}
else if (!flag11 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
{
orgY += num31 + (float)t.altitude * altitudeFix.y;
orgZ += (float)t.altitude * altitudeFix.z;
freePos.y += num31 + (float)t.altitude * altitudeFix.y;
if (!this.cell.IsTopWater || t.altitude > 0)
{
num29 += num31 + (float)t.altitude * altitudeFix.y;
}
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
liquidLv -= (int)(num31 * 150f);
if (liquidLv < 0)
{
liquidLv = 0;
}
flag11 = true;
}
else
}
}
if (blockDir == 0 || blockDir == 2)
{
param.dir = 0;
Room room3 = this.cell.Front.room ?? this.cell.room;
if (room3 != null && this.tileType.IsWall)
{
if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
{
thingPos.y += num31;
if (tileType.UseMountHeight)
{
if ((tileType != TileType.Illumination || !this.cell.HasObj) && !tileType.AlwaysShow)
{
if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude && tileType != TileType.ObjFloat)
{
continue;
}
if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
Room room5 = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
if (t.trait.AlwaysHideOnLowWall)
{
if (room5 == null || !room5.data.showWallItem)
{
continue;
}
}
else if (t.altitude >= lowWallObjAltitude)
{
continue;
}
}
}
if (tileType.UseHangZFix)
{
flag10 = true;
}
tileType.GetMountHeight(ref _actorPos, Point.shared.Set(index), t.dir, t);
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;
}
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;
}
if (!tileType.UseMountHeight && m > 10)
}
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] + ((flag10 && 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 || flag10 || !this.tileType.RepeatBlock)
{
if (!this.cell.hasDoor)
{
flag11 = true;
_sourceBlock.renderData.Draw(param);
}
}
else
{
thingPos.y += num31;
_actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
_actorPos.z += pref.z;
thingPos.z += pref.z;
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
}
if (t.isFloating && isWater && !hasBridge && !flag)
param.z += cornerWallFix2.z;
if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
{
flag = true;
float num32 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num32;
if (!t.trait.IsChangeFloorHeight)
if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
{
num28 = num31;
param.snow = true;
}
_actorPos.y += 0.01f * floatY - num32;
if (liquidLv > 10)
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))
{
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
_sourceBlock.renderData.Draw(param);
}
liquidLv -= (int)(floatY * 0.5f);
if (liquidLv < 0)
else
{
liquidLv = 0;
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
param.liquidLv = liquidLv;
}
num24 = num31;
if (t.sourceCard.multisize && !t.trait.IsGround)
if (!flag10 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.Left.isToggleWallPillar)
{
num30 += zSetting.multiZ;
orgX = param.x;
param.tile = _sourceBlock._tiles[0] + ((flag10 && this.tileType.UseLowBlock && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
param.x += cornerWallFix3.x;
param.y += cornerWallFix3.y;
param.z += cornerWallFix3.z;
if (!flag9 && (roomHeight == 0f || flag10))
{
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
}
param.x = orgX;
}
orgZ += t.renderer.data.stackZ;
if (param.liquidLv > 0)
else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag10 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
{
param.liquidLv += pref.liquidMod;
if (param.liquidLv < 1)
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))
{
param.liquidLv = 1;
_sourceBlock.renderData.Draw(param);
}
else if (param.liquidLv > 99 + pref.liquidModMax)
else
{
param.liquidLv = 99 + pref.liquidModMax;
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
}
param.x = orgX;
}
}
if (!isInstalled || !tileType.UseMountHeight)
if (blockDir == 1 || blockDir == 2)
{
if (t.altitude != 0)
param.y = orgY;
param.z = orgZ;
param.dir = 1;
Room room4 = this.cell.Right.room ?? this.cell.room;
if (room4 != null && this.tileType.IsWall)
{
_actorPos += altitudeFix * t.altitude;
if (!t.isRoofItem)
if (room4.lot.idDeco != 0 && !this.cell.hasDoor)
{
num26 += (float)t.altitude;
num25 = t.altitude;
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;
}
}
if (num26 >= 2f && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
{
continue;
}
if (t.freePos)
if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
{
if (t.isRoofItem)
Room room5 = this.cell.Right.room;
maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room5.lot.mh * _heightMod.y;
if (showRoof)
{
_actorPos.x += t.fx;
_actorPos.y += t.fy - (float)t.altitude * altitudeFix.y;
roomHeight = room5.lot.realHeight;
}
else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
{
roomHeight = 0f;
}
else
{
_actorPos.x = orgX + t.fx - freePos.x;
_actorPos.y = orgY + t.fy - freePos.y;
int num39 = ((room5.data.maxHeight == 0) ? 2 : room5.data.maxHeight);
roomHeight = EMono.setting.render.roomHeightMod * (float)((room5.lot.height < num39) ? room5.lot.height : num39) + 0.01f * (float)room5.lot.heightFix;
}
}
if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
Cell back2 = this.cell.Back;
if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
{
_actorPos.z += -0.5f;
_sourceBlock = back2.sourceBlock;
param.mat = back2.matBlock;
}
}
if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
{
if (iconMode != 0)
else
{
int num33 = 0;
switch (iconMode)
_sourceBlock = sourceBlock;
param.mat = matBlock;
}
this.tileType = _sourceBlock.tileType;
param.tile = (tile = -_sourceBlock._tiles[0] + ((flag11 && 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 || flag11 || !this.tileType.RepeatBlock)
{
if (!this.cell.hasDoor)
{
case CardIconMode.Visibility:
if (t.isMasked)
{
num33 = 17;
}
break;
case CardIconMode.State:
if (t.placeState == PlaceState.installed)
{
num33 = 18;
}
break;
case CardIconMode.Deconstruct:
if (t.isDeconstructing)
{
num33 = 14;
}
break;
_sourceBlock.renderData.Draw(param);
}
if (t.isNPCProperty && !EMono.debug.godBuild)
}
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)
{
num33 = 13;
param.snow = true;
}
if (num33 != 0)
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))
{
passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num33);
_sourceBlock.renderData.Draw(param);
}
else
{
_sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
}
param.x = orgX;
}
t.SetRenderParam(param);
if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
{
param.tile += ((param.tile < 0f) ? (-64) : 64);
}
if (t.trait is TraitTrolley && EMono.pc.ai is AI_Trolley aI_Trolley && aI_Trolley.trolley.owner == t)
}
param.y = orgY;
param.z = orgZ;
break;
}
case BlockRenderMode.HalfBlock:
param.color = floorLight;
_sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[matBlock.defBlock] : sourceBlock);
param.tile = _sourceBlock._tiles[0];
param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.colorMod));
param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];
param.halfBlockColor = ((_sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.sourceAutoFloor.colorMod));
sourceBlock.renderData.Draw(param);
break;
case BlockRenderMode.Pillar:
{
RenderData renderData2 = sourceBlock.renderData;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
int num35 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
if (num35 == 0)
{
renderData2.Draw(param);
}
else
{
renderData2.DrawRepeat(param, num35, sourceBlock.tileType.RepeatSize);
}
param.tile = renderData2.idShadow;
SourcePref shadowPref2 = renderData2.shadowPref;
int shadow3 = shadowPref2.shadow;
passShadow.AddShadow(param.x + renderData2.offsetShadow.x, param.y + renderData2.offsetShadow.y, param.z + renderData2.offsetShadow.z, ShadowData.Instance.items[shadow3], shadowPref2, 0, param.snow);
break;
}
case BlockRenderMode.Floor:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
sourceBlock.renderData.Draw(param);
break;
default:
param.color = floorLight;
param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowBlock) ? 3000000 : 0);
param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
if (roomHeight == 0f)
{
sourceBlock.renderData.Draw(param);
}
else
{
sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
}
break;
}
}
if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
{
if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
{
goto IL_721c;
}
if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
{
Room obj = this.cell.FrontRight.room;
if (obj == null || !obj.HasRoof)
{
goto IL_721c;
}
}
}
goto IL_727c;
IL_721c:
if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
{
param.tile = num32;
rendererFov.Draw(param);
}
goto IL_727c;
IL_727c:
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)
{
RenderParam _param = new RenderParam(param);
EMono.core.actionsLateUpdate.Add(delegate
float num40 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
if (!(num40 >= (float)sourceEffect2.anime[0]))
{
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 += num40;
}
}
else
{
t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
float num41 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
param.tile += num41;
}
}
if (isInstalled)
if (this.cell.effect.IsFire)
{
num27 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
rendererEffect.Draw(param);
}
param.x = orgX;
param.y = orgY;
param.z = orgZ;
param.color = floorLight;
thing = t;
if (pref.Float)
else
{
liquidLv = 0;
this.cell.effect.source.renderData.Draw(param);
}
}
}
orgY += num28;
if (detail.charas.Count <= 0)
{
return;
}
param.shadowFix = 0f - num29;
param.color += 1310720f;
float max = zSetting.max2;
for (int n = 0; n < detail.charas.Count; n++)
param.color = floorLight;
if (this.cell.critter != null)
{
Chara chara = detail.charas[n];
if (chara.host != null)
Critter critter = this.cell.critter;
int snowTile = critter.tile;
if (snowed && critter.SnowTile != 0)
{
continue;
critter.x = 0.06f;
critter.y = -0.06f;
snowTile = critter.SnowTile;
}
if (chara != EMono.pc && chara != LayerDrama.alwaysVisible)
else
{
if (chara.mimicry != null && chara.mimicry.IsThing)
{
if (flag3 || fogged || !this.cell.isSeen)
{
continue;
}
}
else if (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))
{
continue;
}
critter.Update();
}
_actorPos.x = orgX;
_actorPos.y = orgY;
_actorPos.z = orgZ;
if (this.cell.IsBlocked && chara.IsAstralBody)
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)
{
_actorPos.z += EMono.setting.render.astralBodyFixZ;
pass.NextBatch();
}
chara.SetRenderParam(param);
_ = chara.IsAliveInCurrentZone;
if (chara.isRestrained)
}
if (detail != null)
{
TransAnime anime3 = detail.anime;
if (anime3 != null && !anime3.animeBlock)
{
TraitShackle restrainer = chara.GetRestrainer();
if (restrainer != null)
{
Vector3 getRestrainPos = restrainer.GetRestrainPos;
if (getRestrainPos != default(Vector3))
{
Vector3 position = restrainer.owner.renderer.position;
float defCharaHeight = EMono.setting.render.defCharaHeight;
float num34 = 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 + num34;
_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;
}
}
TransAnime anime4 = detail.anime;
param.x += anime4.v.x;
param.y += anime4.v.y;
param.z += anime4.v.z;
}
if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
}
if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
{
SourceObj.Row sourceObj = this.cell.sourceObj;
if (!snowed || sourceObj.snowTile <= 0)
{
if (chara.IsDeadOrSleeping && chara.IsPCC)
{
float num35 = chara.renderer.data.size.y * 0.3f;
if (thingPos.y > max)
{
thingPos.y = max;
}
float num36 = thingPos.y + num35;
float num37 = (float)n * -0.01f;
if (num36 > zSetting.thresh1)
{
num37 = zSetting.mod1;
}
_actorPos.x += thingPos.x;
_actorPos.y += thingPos.y;
_actorPos.z += renderSetting.laydownZ + num37;
param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
thingPos.y += num35 * 0.8f;
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
}
else
param.snow = snowed;
param.mat = this.cell.matObj;
orgY = param.y;
if (param.liquidLv > 0)
{
param.liquidLv = liquidLv;
if (isUnderwater)
if (sourceObj.pref.Float)
{
if (chara.Pref.FloatUnderwater)
param.y += 0.01f * floatY;
if (liquidLv > 10)
{
float num38 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
float num39 = floatYs[chara.uid % 10] + 10f + (float)(chara.uid % 30);
orgY += 0.01f * num39 - num38;
_actorPos.y += 0.01f * num39 - num38;
param.shadowFix -= 0.01f * num39 - num38;
liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
}
liquidLv -= (int)(floatY * 0.5f);
param.liquidLv = liquidLv;
}
else if (liquidLv > 0)
if (sourceObj.tileType.IsWaterTop)
{
if (chara.Pref.Float && !flag && !hasBridge)
{
if (liquidLv > 20)
{
float num40 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
orgY += 0.01f * floatY - num40;
_actorPos.y += 0.01f * floatY - num40;
int num41 = TileType.FloorWaterShallow.LiquidLV * 10;
num41 -= (int)(floatY * 0.5f);
param.liquidLv = num41;
}
else
{
param.liquidLv -= 20;
}
}
param.liquidLv += chara.Pref.liquidMod;
param.liquidLv = 0;
}
else
{
param.liquidLv += sourceObj.pref.liquidMod;
if (param.liquidLv < 1)
{
param.liquidLv = 1;
param.liquid = 1f;
}
else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
{
param.liquidLv = 99 + chara.Pref.liquidModMax;
param.liquidLv = 99 + sourceObj.pref.liquidModMax;
}
}
if (!chara.IsPC && EMono.pc.host != chara && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC))
}
if (sourceObj.useAltColor)
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
}
else
{
param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
}
if (sourceObj.HasGrowth)
{
this.cell.growth.OnRenderTileMap(param);
}
else
{
if (this.cell.autotileObj != 0)
{
_actorPos += renderSetting.charaPos[1 + ((num23 < 4) ? num23 : 3)];
param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
}
_actorPos.z += 0.01f * (float)n + renderSetting.charaZ;
num23++;
if (flag10)
else if (sourceObj.tileType.IsUseBlockDir)
{
_actorPos.z += chara.renderer.data.hangedFixZ;
param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
}
chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
else
{
param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
}
if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
{
param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
}
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)
{
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);
}
param.y = orgY;
}
}
param.x = orgX;
param.y = orgY;
param.z = orgZ;
}
if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
{
passDecal.Add(param, (int)this.cell.decal, floorLight);
}
if (highlightCells)
{
switch (ActionMode.FlagCell.mode)
{
case AM_FlagCell.Mode.flagWallPillar:
if (this.cell.isToggleWallPillar)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagSnow:
if (this.cell.isClearSnow)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagFloat:
if (this.cell.isForceFloat)
{
passArea.Add(param, 34f, 0f);
}
break;
case AM_FlagCell.Mode.flagClear:
if (this.cell.isClearArea)
{
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_7dad;
void Draw(int tile)
{
pass = passEdge;Cell โ
public PlantData TryGetPlant()
return EClass._map.TryGetPlant(this);
}
public void DyeObj(string id)
{
isObjDyed = true;
objMat = (byte)EClass.sources.materials.alias[id].id;
}
public float GetSurfaceHeight()
{
if (detail == null)public override bool IsPathBlocked(IPathfindWalker walker, PathManager.MoveType
}
if (moveType == PathManager.MoveType.Default)
{
if (walker.IsAstralBody)
if (walker.IsAstralBody && !EClass._zone.IsRegion)
{
return false;
}
return blocked;
}
if (!blocked || walker.IsAstralBody)
if (!blocked || (walker.IsAstralBody && !EClass._zone.IsRegion))
{
if (detail != null)
{Chara โ
public override SourcePref Pref
{
get
{
if (spriteReplacer == null)
if (spriteReplacer != null)
{
if (base.idSkin > 0)
if (spriteReplacer.data.pref == null && !spriteReplacer.data.tryFixPrefNotLoadedAtStart)
{
switch (sourceCard.tiles.TryGet(base.idSkin))
{
case 2319:
case 2619:
case 2621:
case 2623:
case 2625:
return EClass.core.refs.prefs.sonwputit1;
case 2320:
case 2611:
case 2620:
case 2622:
case 2624:
case 2626:
case 2828:
return EClass.core.refs.prefs.snowputit2;
}
spriteReplacer.data.tryFixPrefNotLoadedAtStart = true;
spriteReplacer.data.LoadPref();
}
return spriteReplacer.data?.pref ?? EClass.core.refs.prefs.replacer1;
}
if (base.idSkin > 0)
{
switch (sourceCard.tiles.TryGet(base.idSkin))
{
case 2319:
case 2619:
case 2621:
case 2623:
case 2625:
return EClass.core.refs.prefs.sonwputit1;
case 2320:
case 2611:
case 2620:
case 2622:
case 2624:
case 2626:
case 2828:
return EClass.core.refs.prefs.snowputit2;
}
return sourceCard.replacer.data?.pref ?? sourceCard.pref;
}
return spriteReplacer.data?.pref ?? EClass.core.refs.prefs.replacer1;
return sourceCard.replacer.data?.pref ?? sourceCard.pref;
}
}public bool CanMoveTo(Point p, bool allowDestroyPath = true)
}
else
{
if ((EClass._map.cells[p.x, p.z].blocked && (!IsAstralBody || EClass._map.cells[p.x, p.z].IsSky)) || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
if ((EClass._map.cells[p.x, p.z].blocked && (!IsAstralBody || EClass._map.cells[p.x, p.z].IsSky || EClass._zone.IsRegion || !EClass._map.bounds.Contains(pos.x, pos.z))) || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
{
return false;
}public bool CanMoveTo(Point p, bool allowDestroyPath = true)
{
return false;
}
if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky))
if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
{
return false;
}public bool CanMoveTo(Point p, bool allowDestroyPath = true)
{
return false;
}
if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky))
if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
{
return false;
} break;
case 5:
case 30:
if (isWeakToSunlight && pos.IsSunLit)
if (isWeakToSunlight && pos.IsSunLit && !EClass.debug.godMode)
{
AddCondition<ConBurning>(1000, force: true);
}GrowSystem โ
public Thing TryPopSeed(Chara c)
}
if (EClass.player.isAutoFarming || EClass.rnd(num) < EClass.rnd(source.chance))
{
Thing thing = TraitSeed.MakeSeed(source, EClass._map.TryGetPlant(cell));
Thing thing = TraitSeed.MakeSeed(cell);
if (EClass.player.isAutoFarming)
{
return thing;public void PopHarvest(Chara c, Thing t = null, int num = -1)
}
}
ApplySeed(t);
if (cell.isObjDyed && source.ContainsTag("dyeable"))
{
t.Dye(cell.matObj);
}
PlantData plantData = EClass._map.TryGetPlant(cell);
bool flag = false;
if (plantData != null && plantData.size > 0)public void ApplySeed(Thing t)
t.SetEncLv(encLv);
t.c_refText = thing.c_refText;
t.isCrafted = true;
if (thing.isDyed)
{
t.Dye(thing.DyeMat);
}
}
public virtual int GetHp()GrowSystemFlower โ
public override void OnMineObj(Chara c = null)
PopHarvest(c ?? EClass.pc, ThingGen.Create(idHarvestThing.IsEmpty("flower")));
}
}
public override void OnSetObj()
{
string alias = source.alias;
if (alias == "tulip_red" || alias == "roseflower")
{
GrowSystem.cell.DyeObj("rubinus");
GrowSystem.cell.objDir = EClass.rnd(4);
}
}
}GrowSystemTree โ
public override void OnMineObj(Chara c = null)
}
if (point.IsFarmField)
{
TryPick(GrowSystem.cell, TraitSeed.MakeSeed(point.sourceObj, plant), c);
TryPick(GrowSystem.cell, TraitSeed.MakeSeed(GrowSystem.cell), c);
}
}
return;public override void OnMineObj(Chara c = null)
TryPick(GrowSystem.cell, "resin", -1, 1 + PlantBonus() / 2);
if (!EClass.player.isAutoFarming)
{
TryPick(GrowSystem.cell, TraitSeed.MakeSeed(GrowSystem.cell.sourceObj, plant).SetNum(1 + EClass.rnd(3)), c);
TryPick(GrowSystem.cell, TraitSeed.MakeSeed(GrowSystem.cell).SetNum(1 + EClass.rnd(3)), c);
if (EClass.rnd(100) == 0)
{
TryPick(GrowSystem.cell, "throw_putit");Map โ
public void DestroyObj(Point point)
{
Cell cell = point.cell;
SourceObj.Row sourceObj = cell.sourceObj;
SourceMaterial.Row matObj = cell.matObj;
SourceMaterial.Row row = (cell.isObjDyed ? sourceObj.DefaultMaterial : cell.matObj);
if (sourceObj.tileType.IsBlockPass)
{
Effect.Get("smoke").Play(point);
}
Effect.Get("mine").Play(point).SetParticleColor(cell.matObj.GetColor())
Effect.Get("mine").Play(point).SetParticleColor(row.GetColor())
.Emit(10 + EClass.rnd(10));
point.PlaySound(matObj.GetSoundDead());
matObj.AddBlood(point, 3);
point.PlaySound(row.GetSoundDead());
row.AddBlood(point, 3);
}
public void MineObj(Point point, Task task = null, Chara c = null)public void MineObj(Point point, Task task = null, Chara c = null)
}
else if (!EClass._zone.IsUserZone)
{
Thing t2 = TraitSeed.MakeSeed(sourceObj, TryGetPlant(cell)).SetNum(num2);
Thing t2 = TraitSeed.MakeSeed(cell).SetNum(num2);
EClass.pc.PickOrDrop(point, t2);
}
if (cell.growth.IsTree)Recipe โ
public virtual SourceMaterial.Row GetColorMaterial()
}
return EClass.sources.materials.map[3];
}
int num = ((ingredients.Count > 0) ? ingredients[source.colorIng].mat : 3);
int num = 3;
if (ingredients.Count > 0)
{
Ingredient ingredient = ingredients[source.colorIng];
num = ((ingredient.thing != null && ingredient.thing.isDyed) ? ingredient.thing.DyeMat.id : ingredient.mat);
}
if (num == -1)
{
num = 3;SpriteData โ
public SourcePref pref;
public bool tryFixPrefNotLoadedAtStart;
public void Init()
{
tryTaskHarvest โ
public override void OnCreateProgress(Progress_Custom p)
{
SetTarget(owner);
string i = (IsObj ? pos.cell.GetObjName() : target.Name);
SourceMaterial.Row mat = (IsObj ? pos.cell.matObj : target.material);
SourceMaterial.Row mat = ((!IsObj) ? target.material : (pos.cell.isObjDyed ? pos.sourceObj.DefaultMaterial : pos.cell.matObj));
GrowSystem growth = pos.growth;
float num = (base.IsHarvest ? 0.5f : ((!IsObj) ? 1f : ((growth != null) ? growth.MtpProgress : 1f)));
int exp = 50;TraitSeed โ
public override void WriteNote(UINote n, bool identified)
{
n.AddText("NoteText_enc", "isWaterCrop");
}
if (row.tag.Contains("dyeable"))
{
n.AddText("NoteText_enc", "isDyeableCrop");
}
if (row.growth != null)
{
if (row.growth.GrowOnLand)public void TrySprout(bool force = false, bool sucker = false, VirtualDate date
{
pos.SetObj(row.id, 1, owner.dir);
EClass._map.AddPlant(pos, owner.Thing);
if (owner.isDyed && pos.sourceObj.ContainsTag("dyeable"))
{
pos.cell.isObjDyed = true;
pos.cell.objMat = (byte)owner.DyeMat.id;
}
if (sucker)
{
Zone.Suckers.Add(owner.Thing);public void TrySprout(bool force = false, bool sucker = false, VirtualDate date
}
}
public static Thing MakeRandomSeed(bool enc = false)
{
Thing thing = ThingGen.Create("seed", null);
SourceObj.Row randomSeedObj = GetRandomSeedObj();
ApplySeed(thing, randomSeedObj.id);
return thing;
}
public static Thing MakeSeed(string idSource)
{
return MakeSeed(EClass.sources.objs.alias[idSource]);
}
public static Thing MakeSeed(SourceObj.Row obj)
{
Thing thing = ThingGen.Create("seed");
ApplySeed(thing, obj.id);
return thing;
}
public static Thing MakeSeed(Cell cell)
{
Thing thing = MakeSeed(cell.sourceObj, EClass._map.TryGetPlant(cell));
if (thing != null && cell.isObjDyed && cell.sourceObj.ContainsTag("dyeable"))
{
thing.Dye(cell.matObj);
}
return thing;
}
public static Thing MakeSeed(string id, PlantData plant = null)
{
return MakeSeed(EClass.sources.objs.alias[id], plant);public static void LevelSeed(Thing t, SourceObj.Row obj, int num)
}
}
public static Thing MakeSeed(string idSource)
{
return MakeSeed(EClass.sources.objs.alias[idSource]);
}
public static Thing ApplySeed(Thing t, int refval)
{
t.refVal = refval;public static Thing ApplySeed(Thing t, int refval)
return t;
}
public static Thing MakeSeed(SourceObj.Row obj)
{
Thing thing = ThingGen.Create("seed");
ApplySeed(thing, obj.id);
return thing;
}
public static Thing MakeRandomSeed(bool enc = false)
{
Thing thing = ThingGen.Create("seed", null);
SourceObj.Row randomSeedObj = GetRandomSeedObj();
ApplySeed(thing, randomSeedObj.id);
return thing;
}
public static SourceObj.Row GetRandomSeedObj()
{
if (listSeeds == null)