15 return Scene.HitPoint;
22 this.screen = _screen;
23 if (this.lightLookUp ==
null)
25 this.lightLookUp =
new float[256];
26 for (
int i = 0; i < 256; i++)
28 this.lightLookUp[i] =
EMono.scene.profile.global.lightLookupCurve.Evaluate((
float)i / 255f);
31 this.selector = this.screen.tileSelector;
32 this.renderSetting =
EMono.setting.render;
33 this.zSetting = this.renderSetting.zSetting;
34 RenderObject.syncList =
EMono.scene.syncList;
35 RenderObject.altitudeFix = this.altitudeFix.y;
36 if (Rand.bytes ==
null)
44 public unsafe
virtual void Draw()
48 this.Size = this.map.Size;
49 this.SizeXZ = this.map.SizeXZ;
50 this.isIndoor =
EMono._map.IsIndoor;
53 this.pcX =
EMono.pc.pos.x;
54 this.pcZ =
EMono.pc.pos.z;
55 float zoom =
EMono.scene.camSupport.Zoom;
57 this.lightSetting = profile.light;
58 this.buildMode =
EMono.scene.actionMode.IsBuildMode;
61 this.buildMode =
false;
64 this.isMining = (EMono.scene.actionMode ==
ActionMode.Mine);
65 this.iconMode =
EMono.scene.actionMode.cardIconMode;
66 this.showAllCards = this.buildMode;
67 this.highlightCells =
ActionMode.FlagCell.IsActive;
68 this.subtleHighlightArea = (EMono.scene.actionMode.AreaHihlight != AreaHighlightMode.None && (EMono.scene.actionMode.AreaHihlight == AreaHighlightMode.Build || (EMono.scene.actionMode.AreaHihlight != AreaHighlightMode.Edit &&
EMono.game.config.areaHighlight)));
69 this.highlightArea = (EMono.scene.actionMode.AreaHihlight == AreaHighlightMode.Edit || this.subtleHighlightArea);
70 this.nightRatio = profile.light.nightRatioCurve.Evaluate(
EMono.scene.timeRatio);
71 this._rightWallShade = (float)((
int)(50f * this.rightWallShade) * 262144);
72 this.alwaysLowblock =
EMono._zone.AlwaysLowblock;
73 this.lowWallObjAltitude =
EMono.game.config.lowWallObjAltitude;
74 this.showBorder = ((EMono.core.config.game.showBorder == 1 && EMono._zone is
Zone_Field && !
EMono._zone.IsPlayerFaction) || (EMono.core.config.game.showBorder == 2 && !EMono._zone.map.IsIndoor && !EMono._zone.IsSkyLevel && !
EMono._zone.IsRegion));
75 this.snowLimit = profile.global.snowLimit.Evaluate(
EMono.scene.timeRatio);
76 this.snowLight = profile.global.snowLight;
77 this.snowColor = profile.global.snowColor;
78 this.snowColor2 = profile.global.snowColor2;
79 this.snowColorToken = (int)((
float)profile.global.snowRGB.x *
this.nightRatio) * 4096 + (int)((
float)profile.global.snowRGB.y *
this.nightRatio) * 64 + (int)((
float)profile.global.snowRGB.z *
this.nightRatio);
80 this.isSnowCovered = zone.IsSnowCovered;
81 if (
EMono.game.config.reverseSnow &&
this.buildMode)
83 this.isSnowCovered = !this.isSnowCovered;
85 this.roofLightLimitMod = profile.global.roofLightLimitMod.Evaluate(
EMono.scene.timeRatio);
86 this.fogBounds = ((EMono._map.config.forceHideOutbounds && (!EMono.debug.godBuild || !this.buildMode)) || (EMono.core.config.game.dontRenderOutsideMap && !this.buildMode));
87 this.heightLightMod = ((EMono._map.config.heightLightMod == 0f) ? 0.005f :
EMono._map.config.heightLightMod);
88 this.modSublight1 = profile.global.modSublight1;
89 this.modSublight2 = profile.global.modSublight2 * this.nightRatio;
90 this.pcMaxLight = EMono.player.lightPower * 2f * (float)(
EMono.player.lightRadius - 2);
91 this.fogBrightness = this.lightSetting.fogBrightness.Evaluate(
EMono.scene.timeRatio);
92 this.lightLimit = this.lightSetting.lightLimit.Evaluate(
EMono.scene.timeRatio);
93 this._lightMod = this.lightSetting.lightMod * this.lightSetting.lightModCurve.Evaluate(
EMono.scene.timeRatio);
94 this.destBrightness = this.lightSetting.baseBrightness * this.lightSetting.baseBrightnessCurve.Evaluate(
EMono.scene.timeRatio);
95 float num = this.destBrightness;
96 this.destBrightness = this.destBrightness * this.lightSetting.dynamicBrightnessCurve2.Evaluate(
EMono.scene.timeRatio) + this.lightSetting.dynamicBrightnessCurve.Evaluate(
EMono.scene.timeRatio) * (float)
EMono.pc.pos.cell.light + ((
EMono.pc.pos.cell.light == 0) ? 0f :
this.lightSetting.dynamicBrightnessLightBonus);
97 if (this.destBrightness > num)
99 this.destBrightness = num;
101 if (!Mathf.Approximately(
this._baseBrightness,
this.destBrightness))
103 this._baseBrightness = Mathf.Lerp(this._baseBrightness, this.destBrightness, Core.delta *
this.lightSetting.dynamicBrightnessSpeed);
105 if (this.activeCount == 0)
107 this._baseBrightness = this.destBrightness;
110 if (this.buildMode &&
EMono.game.config.buildLight)
112 this._baseBrightness = 0.7f;
114 Fov.nonGradientMod = profile.global.fovModNonGradient;
115 this.shadowStrength = this.lightSetting.shadowCurve.Evaluate(
EMono.scene.timeRatio);
116 this.floorShadowStrength = this.lightSetting.shadowCurveFloor.Evaluate(
EMono.scene.timeRatio);
117 float num2 = Core.delta * (float)
EMono.game.config.animeSpeed * 0.01f;
118 this.floatTimer += num2;
119 if (this.floatTimer > this.floatSpeed)
121 this.floatTimer -= this.floatSpeed;
122 this.floatY += (float)this.floatV;
123 if (this.floatY >= (
float)this.maxFloat)
127 if (this.floatY < 0f)
132 this.waterAnimeTimer += num2;
133 if (this.waterAnimeTimer > 0.5f)
135 this.waterAnimeTimer = 0f;
136 this.waterAnimeIndex++;
142 this.lightSetting = profile.light;
143 this.lightLimit = this.lightSetting.lightLimit.Evaluate(
EMono.scene.timeRatio);
144 this._lightMod += this.lightSetting.lightMod * this.lightSetting.lightModCurve.Evaluate(
EMono.scene.timeRatio) * (0.01f * (float)cinemaConfig.light);
145 this.destBrightness += 0.01f * (float)cinemaConfig.brightness;
146 EMono.scene.camSupport.grading.cinemaBrightness = 0.01f * (float)cinemaConfig.brightness;
147 EMono.scene.camSupport.grading.SetGrading();
148 this.heightLightMod = 0f;
150 this.map.rooms.Refresh();
151 this.noSlopMode = (EInput.isAltDown && EInput.isShiftDown);
152 this.RefreshHeight();
153 this.innerMode = ((this.buildMode || !this.isIndoor) ? BaseTileMap.InnerMode.None : this.defaultInnerMode);
154 if (
EMono.pc.IsInActiveZone)
156 this.currentHeight = (int)
EMono.pc.pos.cell.TopHeight;
157 this.currentRoom =
EMono.pc.pos.cell.room;
161 this.currentHeight = 0;
162 this.currentRoom =
null;
165 this.defaultBlockHeight = this.map.config.blockHeight;
166 this.noRoofMode =
false;
167 bool flag = !this.isIndoor || EMono._zone is
Zone_Tent;
168 if (this.usingHouseBoard ||
ActionMode.Bird.IsActive)
170 this.lowBlock = (this.hideRoomFog = (this.hideHang =
false));
171 this.showRoof = (this.showFullWall = flag);
174 this.fogBounds =
false;
177 else if (this.buildMode)
179 this.defaultBlockHeight = 0f;
180 if (this.HitPoint.IsValid)
182 this.currentRoom = this.HitPoint.cell.room;
184 this.hideRoomFog =
true;
185 this.showRoof = (flag &&
EMono.game.config.showRoof);
186 this.showFullWall = (this.showRoof ||
EMono.game.config.showWall);
187 this.lowBlock = !this.showFullWall;
188 this.hideHang = !this.showFullWall;
191 this.hideRoomFog = !this.showRoof;
196 this.noRoofMode = (EMono.game.config.noRoof || this.screen.focusOption !=
null);
197 if (
EMono.pc.pos.cell.Front.UseLowBlock ||
EMono.pc.pos.cell.Right.UseLowBlock ||
EMono.pc.pos.cell.Front.Right.UseLowBlock ||
EMono.pc.pos.cell.UseLowBlock || (
EMono.pc.pos.cell.Front.Right.isWallEdge &&
EMono.pc.pos.cell.Front.Right.Right.UseLowBlock))
199 if (!
EMono.pc.IsMoving)
201 this.lowblockTimer = 0.1f;
204 else if (!EInput.rightMouse.pressing)
206 this.lowblockTimer = 0f;
208 this.x =
EMono.pc.pos.x;
209 this.z =
EMono.pc.pos.z;
213 this.currentRoom = room;
215 if (this.currentRoom !=
null)
217 this.currentRoom.data.visited =
true;
221 room.data.visited =
true;
223 this.lowBlock = (this.lowblockTimer > 0f);
224 this.hideRoomFog = (this.currentRoom !=
null && (this.currentRoom.HasRoof || this.isIndoor));
225 if (this.hideRoomFog)
227 this.lowBlock =
true;
231 this.hideRoomFog =
true;
232 this.showRoof = (this.showFullWall =
false);
236 this.showRoof = (this.showFullWall = (flag && !this.lowBlock && !this.hideRoomFog));
238 this.hideHang = this.lowBlock;
239 EMono.game.config.showRoof = !this.hideRoomFog;
242 this.hideHang =
false;
243 BaseTileMap.forceShowHang =
false;
248 this.lowBlock = (this.hideRoomFog = (this.hideHang =
false));
249 this.showRoof = (this.showFullWall =
true);
251 Room room2 = this.currentRoom;
252 this.currentLot = (((room2 !=
null) ? room2.lot :
null) ??
null);
253 Vector3 mposWorld = EInput.mposWorld;
255 Vector3Int vector3Int = this.screen.grid.WorldToCell(mposWorld);
256 this.mx = -vector3Int.y;
257 this.mz = vector3Int.x - 1;
258 this.HitPoint.Set(this.mx, this.mz);
259 bool isAltDown = EInput.isAltDown;
260 for (
int i = this.maxColliderCheck; i >= 0; i--)
262 this.TestPoint.x = this.mx + i;
263 this.TestPoint.z = this.mz - i;
264 if (this.TestPoint.x >= 0 &&
this.TestPoint.x <
this.Size &&
this.TestPoint.z >= 0 &&
this.TestPoint.z <
this.Size)
266 this.mouseCollider.transform.position = (isAltDown ? (*this.TestPoint.Position((
int)this.TestPoint.cell.height)) : (*
this.TestPoint.Position())) + this.colliderFix;
267 Physics2D.SyncTransforms();
268 if (Physics2D.RaycastNonAlloc(mposWorld, Vector2.zero,
this.rays) > 0)
270 this.HitPoint.Set(this.TestPoint);
274 this.TestPoint.x = this.mx + i - 1;
275 this.TestPoint.z = this.mz - i;
276 if (this.TestPoint.x >= 0 &&
this.TestPoint.x <
this.Size &&
this.TestPoint.z >= 0 &&
this.TestPoint.z <
this.Size)
278 this.mouseCollider.transform.position = (isAltDown ? (*this.TestPoint.Position((
int)this.TestPoint.cell.height)) : (*
this.TestPoint.Position())) + this.colliderFix;
279 Physics2D.SyncTransforms();
280 if (Physics2D.RaycastNonAlloc(mposWorld, Vector2.zero,
this.rays) > 0)
282 this.HitPoint.Set(this.TestPoint);
286 this.TestPoint.x = this.mx + i;
287 this.TestPoint.z = this.mz - i + 1;
288 if (this.TestPoint.x >= 0 &&
this.TestPoint.x <
this.Size &&
this.TestPoint.z >= 0 &&
this.TestPoint.z <
this.Size)
290 this.mouseCollider.transform.position = (isAltDown ? (*this.TestPoint.Position((
int)this.TestPoint.cell.height)) : (*
this.TestPoint.Position())) + this.colliderFix;
291 Physics2D.SyncTransforms();
292 if (Physics2D.RaycastNonAlloc(mposWorld, Vector2.zero,
this.rays) > 0)
294 this.HitPoint.Set(this.TestPoint);
299 this.HitPoint.Clamp(
false);
300 bool flag2 = EMono._zone.UseFog && !
EMono.scene.bg.wall;
302 while (this.z < this.screen.height)
305 while (this.x < this.screen.width)
307 this.cx = this.screen.scrollX - this.screen.scrollY + this.x - (this.z + 1) / 2;
308 this.cz = this.screen.scrollY + this.screen.scrollX + this.x + this.z / 2;
309 if (((this.cz < 0 && this.cx >= -this.cz && this.cx > 0 && this.cx < this.Size - this.cz) || (this.cx >= this.Size && this.cx < this.Size * 2 - this.cz - 1 && this.cz >= -this.cx && this.cz < this.Size - 1)) &&
EMono.scene.bg.wall)
311 this.param.x = (float)(this.cx + this.cz) * this.screen.tileAlign.x + this.edgeBlockFix.x;
312 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y + this.edgeBlockFix.y;
313 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z + (float)this.z * this.edgeBlockFix.z;
314 this.blockLight = 10485760f;
315 this.pass = this.passInner;
316 this.batch = this.pass.batches[this.pass.batchIdx];
317 this.batch.matrices[this.pass.idx].m03 = this.param.x;
318 this.batch.matrices[this.pass.idx].m13 = this.param.y;
319 this.batch.matrices[this.pass.idx].m23 = this.param.z;
320 this.batch.tiles[this.pass.idx] = (float)(4 + ((this.cx >= this.Size) ? 1 : 0));
321 this.batch.colors[this.pass.idx] = this.blockLight;
322 this.batch.matColors[this.pass.idx] = 104025f;
324 if (this.pass.idx ==
this.pass.batchSize)
326 this.pass.NextBatch();
329 else if (this.cx < 0 || this.cz < 0 || this.cx >= this.Size || this.cz >= this.Size)
333 this.param.x = (float)(this.cx + this.cz) * this.screen.tileAlign.x;
334 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.height * this._heightMod.y;
335 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z + (float)this.height * this._heightMod.z;
336 this.param.tile = 0f;
337 this.rendererFov2.Draw(this.param);
350 using (List<Lot>.Enumerator enumerator = this.map.rooms.listLot.GetEnumerator())
352 while (enumerator.MoveNext())
354 Lot lot = enumerator.Current;
365 foreach (
Lot lot2
in this.map.rooms.listLot)
371 EMono.scene.sfxFire.SetVolume(Mathf.Clamp(0.1f * (
float)
this.totalFire + ((
this.totalFire != 0) ? 0.2f : 0f), 0f, 1f));
372 this.room =
EMono.pc.pos.cell.room;
373 Room room3 = this.room;
381 Lot lot3 = room3.lot;
382 num3 = ((lot3 !=
null) ?
new int?(lot3.idBGM) :
null);
385 int valueOrDefault = num4.GetValueOrDefault();
386 if (valueOrDefault != 0)
388 if (
EMono.Sound.currentPlaylist !=
EMono.Sound.plLot)
392 BGMData data =
EMono.Sound.plLot.list[0].data;
393 if (data ==
null || data.id != valueOrDefault)
398 if (valueOrDefault != 0 || !(
EMono.Sound.currentPlaylist ==
EMono.Sound.plLot))
403 EMono._zone.RefreshBGM();
405 if (this.room != this.lastRoom)
407 this.screen.RefreshWeather();
408 this.lastRoom = this.room;
410 SoundManager.bgmVolumeMod = ((!LayerDrama.maxBGMVolume && !EMono._map.IsIndoor && this.room !=
null && !this.room.data.atrium && this.room.HasRoof) ? -0.6f : 0f);
411 this.screenHighlight =
BaseTileMap.ScreenHighlight.None;
415 public void RefreshHeight()
417 if (
EMono.game ==
null)
421 float num = ((this.buildMode && !
EMono.game.config.slope) || this.noSlopMode) ? 0f : ((float)EMono.game.config.slopeMod * 0.01f);
422 this._heightMod = this.heightMod;
423 this._heightMod.x = num;
424 this._heightMod.y = this._heightMod.y * num;
425 this._heightMod.z = this._heightMod.z * num;
429 public virtual void DrawTile()
432 CS$<>8__locals1.<>4__this =
this;
434 this.index = this.cx + this.cz * this.Size;
435 this.cell = (this.param.cell = this.map.cells[this.cx, this.cz]);
436 this.detail = this.cell.detail;
437 this.isSeen = this.cell.isSeen;
438 this.room = this.cell.room;
439 this.roof = this.cell.HasRoof;
440 this.matBlock = this.cell.matBlock;
441 this.sourceBlock = this.cell.sourceBlock;
442 bool flag = this.cell.isFloating;
443 this.snowed = (this.isSnowCovered && !this.roof && !this.cell.isClearSnow && !this.cell.isDeck && !flag);
444 this._shadowStrength = (this.snowed ? (this.shadowStrength * 0.4f) : this.shadowStrength);
445 this.floorDir = this.cell.floorDir;
446 if (this.snowed && !this.cell.sourceFloor.ignoreSnow)
448 if (this.cell.IsFloorWater)
450 this.sourceFloor =
FLOOR.sourceIce;
451 this.matFloor = this.cell.matFloor;
455 if (this.cell.sourceObj.snowTile > 0)
457 this.sourceFloor =
FLOOR.sourceSnow2;
458 this.floorDir = this.cell.sourceObj.snowTile - 1;
460 else if (this.index % 3 == 0 && Rand.bytes[
this.index % Rand.MaxBytes] < 8 && !
this.cell.HasObj &&
this.cell.FirstThing ==
null)
462 this.sourceFloor =
FLOOR.sourceSnow2;
463 this.floorDir = (int)Rand.bytes[
this.index % Rand.MaxBytes];
467 this.sourceFloor =
FLOOR.sourceSnow;
469 this.matFloor =
MATERIAL.sourceSnow;
474 this.sourceFloor = this.cell.sourceFloor;
475 this.matFloor = this.cell.matFloor;
477 bool isWater = this.sourceFloor.tileType.IsWater;
478 this.light = (float)(this.cell.pcSync ?
this.cell.light : (
this.cell.light / 3 * 2));
479 this._lowblock = this.lowBlock;
480 this.height = (int)this.cell.height;
481 this.hasBridge = (this.cell._bridge > 0);
482 this.blockLight = this._lightMod * this.lightLookUp[(int)this.light] + this._baseBrightness + ((this.roof || this.cell.isShadowed) ?
this._shadowStrength : 0f);
485 if ((
int)this.cell.bridgeHeight <
this.currentHeight)
487 this.blockLight -= this.heightLightMod * (float)(this.currentHeight - (
int)this.cell.bridgeHeight);
489 if (this.snowed && !this.cell.sourceBridge.ignoreSnow)
491 if (this.cell.IsBridgeWater)
493 this.sourceBridge =
FLOOR.sourceIce;
494 this.matBridge = this.cell.matBridge;
498 this.sourceBridge =
FLOOR.sourceSnow;
499 this.matBridge =
MATERIAL.sourceSnow;
504 this.sourceBridge = this.cell.sourceBridge;
505 this.matBridge = this.cell.matBridge;
508 else if (this.height < this.currentHeight)
510 this.blockLight -= this.heightLightMod * (float)(this.currentHeight - this.height);
512 this.liquidLv = (this.param.liquidLv = (flag ? 0 : (((this.cell.liquidLv + (int)this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.LiquidLV : this.sourceFloor.tileType.LiquidLV) * 10)));
513 if (this.cell.shore != 0 &&
this.liquidLv > 20)
515 this.liquidLv = (this.param.liquidLv = 20);
517 if (this.liquidLv > 99)
519 this.liquidLv = (this.param.liquidLv = 99);
522 if (effect !=
null && effect.IsFire)
524 this.blockLight += 0.2f;
527 if (this.blockLight > this.lightLimit)
529 this.blockLight = this.lightLimit;
531 this.blockLight += this.shadowModStrength * (float)this.cell.shadowMod *
this._heightMod.x *
this._shadowStrength;
532 if (this.room !=
null)
534 this.room.lot.sync =
true;
535 if (this.room.lot.light <
this.blockLight)
537 this.room.lot.light = this.blockLight;
540 if (this.currentLot !=
null && this.currentLot.idRoofStyle != 0)
543 if (this.cell.IsRoomEdge)
545 Room room = this.cell.Front.room;
546 if (((room !=
null) ? room.lot :
null) !=
this.currentLot)
548 Room room2 = this.cell.Right.room;
549 if (((room2 !=
null) ? room2.lot :
null) !=
this.currentLot)
551 Room room3 = this.cell.FrontRight.room;
552 flag2 = (((room3 !=
null) ? room3.lot :
null) == this.currentLot);
566 if ((this.room !=
null && this.room.lot ==
this.currentLot) || flag3)
568 this.blockLight += this.lotLight;
572 this.blockLight += (this.isSnowCovered ? -0.02f : this.lotLight2);
576 if (this.cell.outOfBounds && !
this.cinemaMode)
578 this.blockLight -= 0.1f;
584 this.floorLight = this.blockLight;
585 this.param.color = (this.blockLight = (float)((int)(this.blockLight * 50f) * 262144 + (int)(((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096) + (int)(((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64) + (int)((this.cell.lightB >= 64) ? 63 : this.cell.lightB)));
588 this.floorLight += this.snowLight;
589 if (this.floorLight > this.lightLimit * this.snowLimit)
591 this.floorLight = this.lightLimit * this.snowLimit;
593 this.floorLight = (float)((
int)(this.floorLight * 50f) * 262144 + (
int)((
float)((this.cell.lightR >= 50) ? 50 :
this.cell.lightR) *
this.snowColor) * 4096 + (
int)((
float)((
this.cell.lightG >= 50) ? 50 :
this.cell.lightG) *
this.snowColor) * 64 + (
int)((
float)((
this.cell.lightB >= 50) ? 50 :
this.cell.lightB) *
this.snowColor) +
this.snowColorToken);
595 else if (this.isSnowCovered && !this.roof)
597 this.floorLight = (float)((
int)(this.floorLight * 50f) * 262144 + (
int)((
float)((this.cell.lightR >= 50) ? 50 :
this.cell.lightR) *
this.snowColor2) * 4096 + (
int)((
float)((
this.cell.lightG >= 50) ? 50 :
this.cell.lightG) *
this.snowColor2) * 64 + (
int)((
float)((
this.cell.lightB >= 50) ? 50 :
this.cell.lightB) *
this.snowColor2) +
this.snowColorToken);
601 this.floorLight = this.blockLight;
603 bool flag4 = this.room !=
null && this.sourceBlock.tileType.CastShadowSelf && !this.cell.hasDoor;
604 bool flag5 = this.room !=
null && this.showRoof && this.room.lot.idRoofStyle != 0 && !this.room.data.atrium && !this.sourceBlock.tileType.Invisible;
605 if (flag5 && this.cell.hasDoor &&
this.cell.IsLotEdge)
609 if (flag4 || !this.isSeen || flag5)
611 this.floorLight += -3145728f;
613 if (this.cell.isWatered && !
this.snowed)
615 this.floorLight += -2359296f;
617 this.param.snow =
false;
618 this.param.x = (float)(this.cx + this.cz) * this.screen.tileAlign.x;
619 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.height * this._heightMod.y;
620 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z + (float)this.height * this._heightMod.z;
623 this.param.y += 0.01f * this.floatY;
625 if (this.detail !=
null)
628 if (anime !=
null && anime.animeBlock)
631 this.param.x += anime2.v.x;
632 this.param.y += anime2.v.y;
633 this.param.z += anime2.v.z;
635 if (this.detail.designation !=
null)
637 this.detail.designation.Draw(this.cx, this.cz, this.param);
640 if (this.screenHighlight !=
BaseTileMap.ScreenHighlight.None &&
this.screenHighlight ==
BaseTileMap.ScreenHighlight.SunMap &&
Map.sunMap.Contains(
this.index))
642 this.screen.guide.passGuideFloor.Add(this.param.x,
this.param.y,
this.param.z - 10f, 11f, 0f);
644 if (this.cell._roofBlock != 0 && (
this.isSeen || !
EMono._zone.UseFog) &&
this.showRoof && !
this.lowBlock)
648 this.tileType = row.tileType;
649 this.param.mat = row2;
650 this.param.dir = (int)(this.cell._roofBlockDir % 4);
651 this.param.snow = this.isSnowCovered;
652 this.orgX = this.param.x;
653 this.orgY = this.param.y;
654 this.orgZ = this.param.z;
655 this.SetRoofHeight(this.param, this.cell, this.cx, this.cz, 0, (
int)(this.cell._roofBlockDir / 4),
this.tileType.IsWallOrFence ?
this.param.dir : -1,
false);
656 switch (this.tileType.blockRenderMode)
658 case BlockRenderMode.FullBlock:
659 this.param.color -= (float)((
int)(this._shadowStrength * 50f) * 262144);
660 this.param.tile = (float)row._tiles[
this.param.dir % row._tiles.Length];
661 this.param.matColor = (float)((row.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref row2.matColor, row.colorMod));
662 row.renderData.Draw(this.param);
664 case BlockRenderMode.WallOrFence:
666 this._lowblock =
true;
667 int dir = this.param.dir;
668 if (dir == 0 || dir == 2)
671 this._sourceBlock = row;
672 this.tileType = this._sourceBlock.tileType;
673 if (this._sourceBlock.useAltColor)
675 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.altColor,
this._sourceBlock.colorMod));
679 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.matColor,
this._sourceBlock.colorMod));
681 this.param.tile = (float)(this.tile = this._sourceBlock._tiles[0] + ((
this._lowblock && !
this.tileType.IsFence) ? 32 : 0));
682 this._sourceBlock.renderData.Draw(this.param);
683 this.param.z -= 0.01f;
685 if (dir == 1 || dir == 2)
688 this._sourceBlock = row;
689 this.tileType = this._sourceBlock.tileType;
690 if (this._sourceBlock.useAltColor)
692 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.altColor,
this._sourceBlock.colorMod));
696 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.matColor,
this._sourceBlock.colorMod));
698 this.param.tile = (float)(this.tile = -this._sourceBlock._tiles[0] + ((
this._lowblock && !
this.tileType.IsFence) ? -32 : 0));
699 this._sourceBlock.renderData.Draw(this.param);
703 case BlockRenderMode.Pillar:
706 this.param.tile = (float)row._tiles[
this.param.dir % row._tiles.Length];
707 this.param.matColor = (float)((row.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref row2.matColor, row.colorMod));
708 renderData.Draw(this.param);
709 this.param.tile = (float)renderData.idShadow;
710 SourcePref shadowPref = renderData.shadowPref;
711 int shadow = shadowPref.shadow;
712 this.passShadow.AddShadow(this.param.x + renderData.offsetShadow.x,
this.param.y + renderData.offsetShadow.y,
this.param.z + renderData.offsetShadow.z,
ShadowData.Instance.items[shadow], shadowPref, 0,
this.param.snow);
715 case BlockRenderMode.HalfBlock:
716 this._sourceBlock = ((row.id == 5) ?
EMono.sources.blocks.rows[row2.defBlock] : row);
717 this.param.tile = (float)this._sourceBlock._tiles[0];
718 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref row2.matColor,
this._sourceBlock.colorMod));
719 this.param.tile2 = this._sourceBlock.sourceAutoFloor._tiles[0];
720 this.param.halfBlockColor = ((this._sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref row2.matColor,
this._sourceBlock.sourceAutoFloor.colorMod));
721 row.renderData.Draw(this.param);
724 this.param.tile = (float)row._tiles[
this.param.dir % row._tiles.Length];
725 this.param.matColor = (float)((row.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref row2.matColor, row.colorMod));
726 row.renderData.Draw(this.param);
729 this.param.x = this.orgX;
730 this.param.y = this.orgY;
731 this.param.z = this.orgZ;
732 this.param.color = this.blockLight;
735 bool flag6 = this.cell.isSurrounded && this.innerMode != BaseTileMap.InnerMode.None && this.sourceBlock.tileType.IsFullBlock;
736 if (!this.isSeen || flag6)
738 bool isRoomEdge = this.cell.IsRoomEdge;
739 this.orgY = this.param.y;
740 this.orgZ = this.param.z;
741 this.param.color = (float)((
int)(50f * (this._baseBrightness + this.fogBrightness)) * 262144);
742 this.param.matColor = 104025f;
745 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.cell.bridgeHeight *
this._heightMod.y +
this.ugFixBridgeBottom.x;
746 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z + (float)this.cell.bridgeHeight *
this._heightMod.z;
748 bool flag7 = (!this.isSeen &&
EMono._zone.UseFog) || flag6;
751 this.param.tile = 7f;
752 this.rendererFogFloorSolid.Draw(this.param);
753 this.param.tile = 0f;
754 this.rendererFov2.Draw(this.param);
756 else if (this.cell.HasFloodBlock && isRoomEdge)
758 this.param.tile = 9f;
759 this.rendererFogRoomWallSolid.Draw(this.param);
763 this.param.tile = 8f;
764 this.rendererFogRoomSolid.Draw(this.param);
766 if ((this.cell.isSlopeEdge ||
this.hasBridge) && (flag7 || !isRoomEdge))
768 float num = (float)this.cell.TopHeight *
this._heightMod.y;
769 this.param.tile = 0f;
771 while ((
float)num2 < num / this.heightBlockSize)
773 this.param.y += this.ugFix.y;
774 this.param.z += this.ugFix.z + this.slopeFixZ * (float)num2;
777 this.rendererFogBlockSolid.Draw(this.param);
781 this.rendererFogRoomBlockSolid.Draw(this.param);
786 this.param.y = this.orgY;
787 this.param.z = this.orgZ;
788 this.param.color = this.blockLight;
791 if (this.detail ==
null || !
EMono.pc.hasTelepathy)
797 else if (!isRoomEdge)
799 if (this.detail !=
null &&
EMono.pc.hasTelepathy)
803 if (this.noRoofMode || this.detail ==
null)
811 if (this.cell.isSlopeEdge)
813 float num3 = (float)this.height * this._heightMod.y;
814 this.orgY = this.param.y;
815 this.orgZ = this.param.z;
816 this.param.dir = this.cell.blockDir;
819 this.param.color = this.floorLight;
822 if (this.sourceBlock.tileType.IsFullBlock)
824 defBlock = this.sourceBlock;
825 this.param.mat = this.matBlock;
826 this.param.tile = (float)this.sourceBlock._tiles[
this.cell.blockDir %
this.sourceBlock._tiles.Length];
827 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matBlock.matColor,
this.sourceBlock.colorMod));
831 defBlock = this.sourceFloor._defBlock;
832 this.param.mat = this.matFloor;
833 this.param.tile = (float)defBlock._tiles[
this.cell.blockDir % defBlock._tiles.Length];
834 if (defBlock.id != 1)
836 this.param.matColor = (float)((this.sourceFloor.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matFloor.matColor,
this.sourceFloor.colorMod));
840 this.param.matColor = 104025f;
844 while ((
float)num4 < num3 / this.heightBlockSize)
846 this.param.y += this.ugFix.y;
847 this.param.z += this.ugFix.z + this.slopeFixZ * (float)num4;
848 defBlock.renderData.Draw(this.param);
849 if (this.cell.pcSync &&
EMono.player.lightPower > 0f)
851 float num5 = this.param.tile;
852 this.param.tile = 0f;
853 this.rendererFov.Draw(this.param);
854 this.param.tile = num5;
858 this.param.y = this.orgY;
859 this.param.z = this.orgZ;
861 this.param.color = this.floorLight;
862 if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater ||
this.cell.Right.sourceFloor.tileType.IsWater) &&
this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
864 this.orgY = this.param.y;
865 this.orgZ = this.param.z;
867 if (this.sourceBlock.tileType.IsFullBlock)
870 num6 = this.sourceBlock._tiles[this.cell.blockDir % this.sourceBlock._tiles.Length];
875 num6 = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
877 if ((this.cell.Front.shore / 12 & 1) == 0 &&
this.cell.Front.sourceFloor.tileType.IsWater && (
int)
this.cell.Front.height <=
this.height &&
this.cell.Front.sourceBlock.tileType.RenderWaterBlock)
879 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y - (this.cell.Front.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (
float)this.cell.Front.height * this._heightMod.y;
880 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z;
881 this.param.tile = (float)(num6 + (this.cell.Front.sourceFloor.tileType.IsDeepWater ? 0 : 3000000));
882 this.rendererWaterBlock.Draw(this.param);
884 if ((this.cell.Right.shore / 12 & 8) == 0 &&
this.cell.Right.sourceFloor.tileType.IsWater && (
int)
this.cell.Right.height <=
this.height &&
this.cell.Right.sourceBlock.tileType.RenderWaterBlock)
886 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y - (this.cell.Right.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (
float)this.cell.Right.height * this._heightMod.y;
887 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z;
888 this.param.tile = (float)(num6 + (this.cell.Right.sourceFloor.tileType.IsDeepWater ? 0 : 3000000));
889 this.rendererWaterBlock.Draw(this.param);
891 this.param.y = this.orgY;
892 this.param.z = this.orgZ;
894 if (this.showBorder && !this.cell.outOfBounds)
896 this.param.matColor = 104025f;
897 if (this.cx ==
EMono._map.bounds.x)
899 this.renderBorder.Draw(this.param, 12 + (
EMono.world.date.IsNight ? 4 : 0));
901 else if (this.cx ==
EMono._map.bounds.maxX)
903 this.renderBorder.Draw(this.param, 13 + (
EMono.world.date.IsNight ? 4 : 0));
905 if (this.cz ==
EMono._map.bounds.z)
907 this.renderBorder.Draw(this.param, 14 + (
EMono.world.date.IsNight ? 4 : 0));
909 else if (this.cz ==
EMono._map.bounds.maxZ)
911 this.renderBorder.Draw(this.param, 15 + (
EMono.world.date.IsNight ? 4 : 0));
914 if (this.cell.isSkyFloor || (
this.detail !=
null &&
this.detail.anime !=
null &&
this.detail.anime.drawBlock))
916 this.orgY = this.param.y;
917 this.orgZ = this.param.z;
919 this.param.mat = this.matFloor;
920 this.param.tile = (float)defBlock3._tiles[
this.cell.blockDir % defBlock3._tiles.Length];
921 if (defBlock3.id != 1)
923 this.param.matColor = (float)((this.sourceFloor.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matFloor.matColor,
this.sourceFloor.colorMod));
927 this.param.matColor = 104025f;
929 for (
int i = 0; i < (this.cell.isSkyFloor ? EMono._map.config.skyBlockHeight : 1); i++)
931 this.param.y += this.ugFix.y;
932 this.param.z += this.ugFix.z + this.slopeFixZ * (float)i;
933 defBlock3.renderData.Draw(this.param);
935 this.param.y = this.orgY;
936 this.param.z = this.orgZ;
938 if (!this.sourceFloor.tileType.IsSkipFloor)
940 if ((this.hasBridge && this.sourceBridge.tileType.CastShadowSelf) ||
this.cell.castFloorShadow)
942 this.floorLight2 = this._lightMod * this.light * 0.2f + this._baseBrightness + this._shadowStrength * this.floorShadowStrength * (isWater ? 0.7f : (this.hasBridge ? 1f : (0.6f * (1f - this.nightRatio))));
945 this.floorLight2 = (float)((
int)((
double)this.floorLight2 * 0.85 * 50.0) * 262144 + this.snowColorToken);
949 this.floorLight2 = (float)((
int)(this.floorLight2 * 50f) * 262144 + (
int)(((this.cell.lightR >= 64) ? 63 :
this.cell.lightR) * 4096) + (
int)(((
this.cell.lightG >= 64) ? 63 :
this.cell.lightG) * 64) + (
int)((
this.cell.lightB >= 64) ? 63 :
this.cell.lightB));
951 this.param.color = this.floorLight2;
952 if (this.cell.lotShade)
954 this.floorLight = this.floorLight2;
957 this.floorMatColor = ((this.sourceFloor.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref this.matFloor.matColor,
this.sourceFloor.colorMod));
960 this.param.y -= 0.01f * this.floatY;
962 if (!this.sourceBlock.tileType.IsSkipFloor ||
this.sourceBlock.transparent ||
this.hasBridge ||
this.cell.hasDoor ||
this.cell.skipRender)
964 this.param.mat = this.matFloor;
965 this.param.tile = (float)this.sourceFloor._tiles[
this.floorDir %
this.sourceFloor._tiles.Length];
966 this.param.matColor = (float)this.floorMatColor;
967 this.param.snow = this.snowed;
968 if (this.cell.isDeck)
971 if (this.sourceFloor.renderData.subData)
973 this.sourceFloor.renderData.subData.Draw(this.param);
975 this.sourceFloor.renderData.Draw(this.param);
980 if (this.sourceFloor.renderData.subData)
982 this.sourceFloor.renderData.subData.Draw(this.param);
984 this.sourceFloor.renderData.Draw(this.param);
987 if (this.isSnowCovered && this.sourceFloor ==
FLOOR.sourceSnow && !
this.cell.hasDoor)
989 if (!this.cell.Right.IsSnowTile &&
this.cell.Right.topHeight ==
this.cell.topHeight)
993 if (!this.cell.Front.IsSnowTile &&
this.cell.Front.topHeight ==
this.cell.topHeight)
999 this.param.tile = (float)(448 + num7 + 12);
1000 this.param.z -= 0.1f;
1001 this.sourceFloor.renderData.Draw(this.param);
1002 this.param.z += 0.1f;
1005 if (this.cell.shadow != 0 && !
this.hasBridge && !
this.cell.skipRender)
1009 if (this.sourceFloor ==
FLOOR.sourceSnow)
1011 this.param.tile = (float)(448 + (
int)this.cell.shadow + 8 + (
this.cell.HasFence ? 4 : 0));
1012 this.param.z -= 0.01f;
1013 this.sourceFloor.renderData.Draw(this.param);
1018 this.pass = this.passEdge;
1019 this.batch = this.pass.batches[this.pass.batchIdx];
1020 this.batch.matrices[this.pass.idx].m03 = this.param.x + this.ambientShadowFix[(int)this.cell.shadow].x;
1021 this.batch.matrices[this.pass.idx].m13 = this.param.y + this.ambientShadowFix[(int)this.cell.shadow].y;
1022 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.ambientShadowFix[(int)this.cell.shadow].z;
1023 this.batch.tiles[this.pass.idx] = (float)(448 + (
int)this.cell.shadow);
1024 this.batch.colors[this.pass.idx] = this.param.color;
1025 this.batch.matColors[this.pass.idx] = 104025f;
1027 if (this.pass.idx ==
this.pass.batchSize)
1029 this.pass.NextBatch();
1032 if (!this.sourceFloor.ignoreTransition && !
this.snowed)
1034 Cell cell = this.cell.Back;
1035 if (cell.sourceBlock.transition[0] != -1 && cell.isSeen && !cell.hasDoor)
1037 this.pass = this.passFloor;
1038 this.batch = this.pass.batches[this.pass.batchIdx];
1039 this.batch.matrices[this.pass.idx].m03 = this.param.x + this.transitionFix[0].x;
1040 this.batch.matrices[this.pass.idx].m13 = this.param.y + this.transitionFix[0].y;
1041 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.transitionFix[0].z;
1042 this.batch.tiles[this.pass.idx] = (float)(480 + cell.sourceBlock.transition[0] + (
int)Rand.bytes[
this.index % Rand.MaxBytes] % cell.sourceBlock.transition[1]);
1043 this.batch.colors[this.pass.idx] = this.param.color;
1044 this.batch.matColors[this.pass.idx] = (float)
BaseTileMap.GetColorInt(ref cell.matBlock.matColor, cell.sourceBlock.colorMod);
1046 if (this.pass.idx ==
this.pass.batchSize)
1048 this.pass.NextBatch();
1051 cell = this.cell.Left;
1052 if (cell.sourceBlock.transition[0] != -1 && cell.isSeen && !cell.hasDoor)
1054 this.pass = this.passFloor;
1055 this.batch = this.pass.batches[this.pass.batchIdx];
1056 this.batch.matrices[this.pass.idx].m03 = this.param.x + this.transitionFix[1].x;
1057 this.batch.matrices[this.pass.idx].m13 = this.param.y + this.transitionFix[1].y;
1058 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.transitionFix[1].z;
1059 this.batch.tiles[this.pass.idx] = (float)(512 + cell.sourceBlock.transition[0] + (
int)Rand.bytes[
this.index % Rand.MaxBytes] % cell.sourceBlock.transition[1]);
1060 this.batch.colors[this.pass.idx] = this.param.color;
1061 this.batch.matColors[this.pass.idx] = (float)
BaseTileMap.GetColorInt(ref cell.matBlock.matColor, cell.sourceBlock.colorMod);
1063 if (this.pass.idx ==
this.pass.batchSize)
1065 this.pass.NextBatch();
1070 if (this.cell.autotile != 0 &&
this.sourceFloor.autotile != 0 && (!
this.hasBridge ||
this.cell.bridgeHeight -
this.cell.height > 3) && !
this.cell.skipRender && num7 == 0)
1072 this.pass = (isWater ? this.passAutoTileWater : this.passAutoTile);
1073 this.batch = this.pass.batches[this.pass.batchIdx];
1074 this.batch.matrices[this.pass.idx].m03 = this.param.x;
1075 this.batch.matrices[this.pass.idx].m13 = this.param.y;
1076 this.batch.matrices[this.pass.idx].m23 = this.param.z + ((this.hasBridge || this.cell._block != 0) ? 0.8f : 0f);
1077 this.batch.tiles[this.pass.idx] = (float)((26 + this.sourceFloor.autotile / 2) * 32 +
this.sourceFloor.autotile % 2 * 16 + (
int)
this.cell.autotile);
1078 this.batch.colors[this.pass.idx] = this.param.color + (float)((
int)(this.sourceFloor.autotileBrightness * 100f) * 262144);
1079 this.batch.matColors[this.pass.idx] = this.param.matColor;
1081 if (this.pass.idx ==
this.pass.batchSize)
1083 this.pass.NextBatch();
1090 int num9 = (int)this.cell.shore / num8;
1091 int num10 = (int)this.cell.shore % num8;
1092 bool isShoreSand = this.cell.isShoreSand;
1093 if (this.cell.shore != 0)
1095 Cell cell2 = ((num9 & 1) != 0) ? this.cell.Back : (((num9 & 2) != 0) ? this.cell.Right : (((num9 & 4) != 0) ? this.cell.Front : this.cell.Left));
1096 if (isShoreSand && !cell2.sourceFloor.isBeach)
1098 cell2 = (((num9 & 8) != 0) ? this.cell.Left : (((num9 & 4) != 0) ? this.cell.Front : (((num9 & 2) != 0) ? this.cell.Right : this.cell.Back)));
1100 if (!cell2.IsSnowTile)
1102 this.param.matColor = (float)
BaseTileMap.GetColorInt(ref cell2.matFloor.matColor, cell2.sourceFloor.colorMod);
1105 this.pass = this.passShore;
1106 this.batch = this.pass.batches[this.pass.batchIdx];
1107 this.batch.matrices[this.pass.idx].m03 = this.param.x;
1108 this.batch.matrices[this.pass.idx].m13 = this.param.y;
1109 this.batch.matrices[this.pass.idx].m23 = this.param.z;
1110 this.batch.tiles[this.pass.idx] = (float)(768 + (
int)this.cell.shore / num8);
1111 this.batch.colors[this.pass.idx] = this.param.color;
1112 this.batch.matColors[this.pass.idx] = this.param.matColor;
1114 if (this.pass.idx ==
this.pass.batchSize)
1116 this.pass.NextBatch();
1122 num10 = cell2.sourceFloor.edge;
1124 this.param.tile = (float)((24 + num10 / 2) * 32 + num10 % 2 * 16 + num9);
1125 this.rendererShore.Draw(this.param);
1128 if (this.cell.Back.isShoreSand && ((
int)
this.cell.Back.shore / num8 & 8) != 0 &&
this.cell.Left.isShoreSand && ((
int)
this.cell.Left.shore / num8 & 1) != 0)
1130 this.param.tile = 785f;
1131 this.param.matColor = (float)
BaseTileMap.GetColorInt(ref
this.cell.BackLeft.matFloor.matColor,
this.cell.BackLeft.sourceFloor.colorMod);
1132 this.passShore.Add(this.param);
1133 CS$<>8__locals1.<DrawTile>g__Draw|0(60);
1135 if (this.cell.Back.isShoreSand && ((
int)
this.cell.Back.shore / num8 & 2) != 0 &&
this.cell.Right.isShoreSand && ((
int)
this.cell.Right.shore / num8 & 1) != 0)
1137 this.param.tile = 786f;
1138 this.param.matColor = (float)
BaseTileMap.GetColorInt(ref
this.cell.BackRight.matFloor.matColor,
this.cell.BackRight.sourceFloor.colorMod);
1139 this.passShore.Add(this.param);
1140 CS$<>8__locals1.<DrawTile>g__Draw|0(56);
1142 if (this.cell.Front.isShoreSand && ((
int)
this.cell.Front.shore / num8 & 2) != 0 &&
this.cell.Right.isShoreSand && ((
int)
this.cell.Right.shore / num8 & 4) != 0)
1144 this.param.tile = 787f;
1145 this.param.matColor = (float)
BaseTileMap.GetColorInt(ref
this.cell.FrontRight.matFloor.matColor,
this.cell.FrontRight.sourceFloor.colorMod);
1146 this.passShore.Add(this.param);
1147 CS$<>8__locals1.<DrawTile>g__Draw|0(48);
1149 if (this.cell.Front.isShoreSand && ((
int)
this.cell.Front.shore / num8 & 8) != 0 &&
this.cell.Left.isShoreSand && ((
int)
this.cell.Left.shore / num8 & 4) != 0)
1151 this.param.tile = 788f;
1152 this.param.matColor = (float)
BaseTileMap.GetColorInt(ref
this.cell.FrontLeft.matFloor.matColor,
this.cell.FrontLeft.sourceFloor.colorMod);
1153 this.passShore.Add(this.param);
1154 CS$<>8__locals1.<DrawTile>g__Draw|0(52);
1156 if (this.cell._bridge != 0 &&
this.cell.isBridgeEdge &&
this.cell.bridgePillar != 255)
1158 this.pass = this.passEdge;
1159 this.batch = this.pass.batches[this.pass.batchIdx];
1160 this.batch.matrices[this.pass.idx].m03 = this.param.x + this.waterEdgeBridgeFix.x;
1161 this.batch.matrices[this.pass.idx].m13 = this.param.y + this.waterEdgeBridgeFix.y;
1162 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.waterEdgeBridgeFix.z;
1163 this.batch.tiles[this.pass.idx] = (float)(616 + this.waterAnimeIndex % 4);
1164 this.batch.colors[this.pass.idx] = this.param.color;
1165 this.batch.matColors[this.pass.idx] = 104025f;
1167 if (this.pass.idx ==
this.pass.batchSize)
1169 this.pass.NextBatch();
1175 if ((num9 & 1) != 0)
1177 if ((num9 & 8) != 0)
1179 CS$<>8__locals1.<DrawTile>g__Draw|0(16);
1182 if ((num9 & 2) != 0)
1184 CS$<>8__locals1.<DrawTile>g__Draw|0(20);
1188 if ((num9 & 4) != 0)
1190 if ((num9 & 8) != 0)
1192 CS$<>8__locals1.<DrawTile>g__Draw|0(24);
1195 if ((num9 & 2) != 0)
1197 CS$<>8__locals1.<DrawTile>g__Draw|0(28);
1203 if (!this.cell.Front.sourceFloor.tileType.IsWater && !
this.cell.Front.isDeck)
1205 CS$<>8__locals1.<DrawTile>g__Draw|0(8);
1207 if (!this.cell.Right.sourceFloor.tileType.IsWater && !
this.cell.Right.isDeck)
1209 CS$<>8__locals1.<DrawTile>g__Draw|0(12);
1215 if (!this.cell.Back.sourceFloor.tileType.IsWater && !
this.cell.Back.isDeck)
1217 this.pass = this.passEdge;
1218 this.batch = this.pass.batches[this.pass.batchIdx];
1219 this.batch.tiles[this.pass.idx] = (float)(608 + this.waterAnimeIndex % 4);
1220 this.batch.matColors[this.pass.idx] = 104025f;
1221 if (((
int)this.cell.shore / num8 & 1) != 0)
1225 this.param.matColor = (float)
BaseTileMap.GetColorInt(ref
this.cell.Back.matFloor.matColor,
this.cell.Back.sourceFloor.colorMod);
1226 this.batch.matrices[this.pass.idx].m03 = this.param.x + this.waterEdgeFixShoreSand.x;
1227 this.batch.matrices[this.pass.idx].m13 = this.param.y + this.waterEdgeFixShoreSand.y;
1228 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.waterEdgeFixShoreSand.z;
1229 this.batch.tiles[this.pass.idx] = (float)(640 + this.seaAnimeIndexes[this.waterAnimeIndex % this.seaAnimeIndexes.Length]);
1230 this.batch.matColors[this.pass.idx] = this.param.matColor;
1234 this.batch.matrices[this.pass.idx].m03 = this.param.x;
1235 this.batch.matrices[this.pass.idx].m13 = this.param.y;
1236 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.waterEdgeFixShore.z;
1241 this.batch.matrices[this.pass.idx].m03 = this.param.x;
1242 this.batch.matrices[this.pass.idx].m13 = this.param.y;
1243 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.waterEdgeFix.z;
1244 this.batch.tiles[this.pass.idx] += 12f;
1246 this.batch.colors[this.pass.idx] = this.param.color;
1248 if (this.pass.idx ==
this.pass.batchSize)
1250 this.pass.NextBatch();
1253 if (!this.cell.Left.sourceFloor.tileType.IsWater && !
this.cell.Left.isDeck)
1255 this.pass = this.passEdge;
1256 this.batch = this.pass.batches[this.pass.batchIdx];
1257 this.batch.tiles[this.pass.idx] = (float)(612 + this.waterAnimeIndex % 4);
1258 this.batch.matColors[this.pass.idx] = 104025f;
1259 if (((
int)this.cell.shore / num8 & 8) != 0)
1263 this.param.matColor = (float)
BaseTileMap.GetColorInt(ref
this.cell.Left.matFloor.matColor,
this.cell.Left.sourceFloor.colorMod);
1264 this.batch.matrices[this.pass.idx].m03 = this.param.x + this.waterEdgeFixShoreSand.x;
1265 this.batch.matrices[this.pass.idx].m13 = this.param.y + this.waterEdgeFixShoreSand.y;
1266 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.waterEdgeFixShoreSand.z;
1267 this.batch.tiles[this.pass.idx] = (float)(644 + this.seaAnimeIndexes[this.waterAnimeIndex % this.seaAnimeIndexes.Length]);
1268 this.batch.matColors[this.pass.idx] = this.param.matColor;
1272 this.batch.matrices[this.pass.idx].m03 = this.param.x;
1273 this.batch.matrices[this.pass.idx].m13 = this.param.y;
1274 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.waterEdgeFixShore.z;
1279 this.batch.matrices[this.pass.idx].m03 = this.param.x;
1280 this.batch.matrices[this.pass.idx].m13 = this.param.y;
1281 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.waterEdgeFix.z;
1282 this.batch.tiles[this.pass.idx] += 12f;
1284 this.batch.colors[this.pass.idx] = this.param.color;
1286 if (this.pass.idx ==
this.pass.batchSize)
1288 this.pass.NextBatch();
1294 this.param.y += 0.01f * this.floatY;
1302 if (this.cell.skipRender)
1304 if (this.cell.pcSync)
1306 this.param.tile = 0f;
1307 this.rendererFov.Draw(this.param);
1313 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.cell.bridgeHeight *
this._heightMod.y;
1314 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z + (float)this.cell.bridgeHeight *
this._heightMod.z;
1317 this.param.y += 0.01f * this.floatY;
1319 this.param.color = this.floorLight;
1320 this.param.mat = this.matBridge;
1321 this.floorMatColor = ((this.sourceBridge.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref this.matBridge.matColor,
this.sourceBridge.colorMod));
1322 this.param.dir = this.cell.floorDir;
1323 this.param.tile = (float)this.sourceBridge._tiles[
this.cell.floorDir %
this.sourceBridge._tiles.Length];
1324 this.param.matColor = (float)this.floorMatColor;
1325 this.sourceBridge.renderData.Draw(this.param);
1326 if (this.cell.autotileBridge != 0 &&
this.sourceBridge.autotile != 0)
1328 this.pass = this.passAutoTile;
1329 this.batch = this.pass.batches[this.pass.batchIdx];
1330 this.batch.matrices[this.pass.idx].m03 = this.param.x;
1331 this.batch.matrices[this.pass.idx].m13 = this.param.y;
1332 this.batch.matrices[this.pass.idx].m23 = this.param.z + ((this.cell._block != 0) ? 0.8f : 0f);
1333 this.batch.tiles[this.pass.idx] = (float)((26 + this.sourceBridge.autotile / 2) * 32 +
this.sourceBridge.autotile % 2 * 16 + (
int)
this.cell.autotileBridge);
1334 this.batch.colors[this.pass.idx] = this.param.color + (float)((
int)(this.sourceBridge.autotileBrightness * 100f) * 262144);
1335 this.batch.matColors[this.pass.idx] = this.param.matColor;
1337 if (this.pass.idx ==
this.pass.batchSize)
1339 this.pass.NextBatch();
1342 if (this.cell.shadow != 0)
1344 if (this.sourceBridge ==
FLOOR.sourceSnow)
1346 this.param.tile = (float)(448 + (
int)this.cell.shadow + 8 + (
this.cell.HasFence ? 4 : 0));
1347 this.param.z -= 0.01f;
1348 this.sourceBridge.renderData.Draw(this.param);
1352 this.pass = this.passEdge;
1353 this.batch = this.pass.batches[this.pass.batchIdx];
1354 this.batch.matrices[this.pass.idx].m03 = this.param.x + this.ambientShadowFix[(int)this.cell.shadow].x;
1355 this.batch.matrices[this.pass.idx].m13 = this.param.y + this.ambientShadowFix[(int)this.cell.shadow].y;
1356 this.batch.matrices[this.pass.idx].m23 = this.param.z + this.ambientShadowFix[(int)this.cell.shadow].z;
1357 this.batch.tiles[this.pass.idx] = (float)(448 + (
int)this.cell.shadow);
1358 this.batch.colors[this.pass.idx] = this.blockLight;
1359 this.batch.matColors[this.pass.idx] = 104025f;
1361 if (this.pass.idx ==
this.pass.batchSize)
1363 this.pass.NextBatch();
1367 if (this.cell.isBridgeEdge &&
this.cell.bridgeHeight -
this.cell.height >= 3 &&
this.cell.bridgePillar != 255 && !
this.noSlopMode)
1369 this.orgY = this.param.y;
1370 this.orgZ = this.param.z;
1371 this.param.y += this.bridgeFix.y;
1372 this.param.z += this.bridgeFix.z;
1375 float num11 = (float)(this.cell.bridgeHeight -
this.cell.height) * this._heightMod.y;
1376 if (this.cell.sourceFloor.tileType ==
TileType.Sky)
1378 num11 += (float)
EMono._map.config.skyBlockHeight;
1380 int num12 = (int)(num11 / this.heightBlockSize) + 2;
1381 if (this.cell.bridgePillar != 0)
1383 row3 =
EMono.sources.blocks.rows[(int)this.cell.bridgePillar];
1384 this.param.tile = (float)(row3._tiles[0] + ((num12 == 2) ? 32 : 0));
1385 this.param.mat = ((this.sourceBridge.DefaultMaterial == row3.DefaultMaterial) ? this.sourceBridge.DefaultMaterial : row3.DefaultMaterial);
1386 this.param.matColor = (float)((row3.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.matColor, row3.colorMod));
1390 this.param.mat = this.matBlock;
1391 this.param.tile = (float)(row3._tiles[0] + 32);
1392 this.param.matColor = (float)((row3.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matBridge.matColor, row3.colorMod));
1394 this.param.y += this.ugFixBridgeTop.y;
1395 this.param.z += this.ugFixBridgeTop.z;
1396 for (
int j = 0; j < num12; j++)
1400 this.param.y = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.height * this._heightMod.y +
this.ugFixBridgeBottom.y;
1401 this.param.z = 1000f + this.param.x * this.screen.tileWeight.x + this.param.y * this.screen.tileWeight.z + (float)this.height * this._heightMod.z +
this.ugFixBridgeBottom.z;
1405 this.param.y += this.ugFixBridge.y;
1406 this.param.z += this.ugFixBridge.z;
1408 row3.renderData.Draw(this.param);
1410 this.param.y = this.orgY;
1411 this.param.z = this.orgZ;
1414 if (!this.buildMode && this.cell.highlight != 0)
1416 if (this.cell._block != 0)
1418 this.screen.guide.DrawWall(this.cell.GetPoint(),
EMono.Colors.blockColors.MapHighlight,
true, 0f);
1422 this.passGuideFloor.Add(this.cell.GetPoint(), (
float)
this.cell.highlight, 0f);
1425 this.param.color = this.blockLight;
1426 if (this.isSnowCovered && (this.sourceBlock.id != 0 ||
this.cell.hasDoor))
1428 if (this.snowed || this.cell.isClearSnow)
1430 if (this.cell.Front.HasRoof ||
this.cell.Right.HasRoof)
1432 this.snowed =
false;
1435 else if ((!this.cell.Front.HasRoof && !
this.cell.Front.HasBlock) || (!
this.cell.Right.HasRoof && !
this.cell.Right.HasBlock))
1441 if (this.sourceBlock.id != 0)
1443 this.tileType = this.sourceBlock.tileType;
1444 this.roomHeight = 0f;
1445 int blockDir = this.cell.blockDir;
1447 BaseTileMap.WallClipMode wallClipMode = this.wallClipMode;
1448 if (wallClipMode !=
BaseTileMap.WallClipMode.ByRoom)
1450 if (wallClipMode ==
BaseTileMap.WallClipMode.ByLot)
1452 if (this.defaultBlockHeight > 0f || this.isIndoor)
1454 this._lowblock = (this.cx != 0 && this.cz != this.Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock));
1455 if (!this._lowblock)
1457 this.roomHeight = this.defaultBlockHeight *
EMono.setting.render.roomHeightMod;
1458 this.maxHeight = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.cell.TopHeight *
this._heightMod.y;
1463 if (this.showFullWall)
1465 this._lowblock = (this.room !=
null);
1468 if (this.cell.Back.IsRoomEdge &&
this.cell.Right.IsRoomEdge &&
this.cell.Back.room ==
null &&
this.cell.Right.room ==
null)
1470 Room room4 = this.cell.Right.Front.room;
1471 Lot lot = (room4 !=
null) ? room4.lot :
null;
1472 Room room5 = this.room;
1473 if (lot == ((room5 !=
null) ? room5.lot :
null))
1475 this._lowblock =
false;
1479 else if (this.cell.Back.room !=
null)
1481 Lot lot2 = this.cell.Back.room.lot;
1482 Room room6 = this.cell.Front.room ?? this.cell.Right.room;
1483 if (lot2 == ((room6 !=
null) ? room6.lot :
null))
1485 this._lowblock =
true;
1491 this._lowblock = this.lowBlock;
1493 if (this.tileType.RepeatBlock)
1496 if ((room7 = this.room) ==
null && (room7 = this.cell.Front.room) ==
null)
1498 room7 = (this.cell.Right.room ?? this.cell.FrontRight.room);
1501 if (this.room !=
null && !this.noRoofMode && (!this.showFullWall || this.currentRoom ==
null || this.room.lot ==
this.currentRoom.lot))
1503 this.roomHeight = ((this._lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
1504 this.maxHeight = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.room.lot.mh *
this._heightMod.y;
1510 else if (this.tileType.RepeatBlock)
1512 if (this.currentRoom ==
null || this.showFullWall)
1515 if ((room8 = this.room) ==
null && (room8 = this.cell.Front.room) ==
null)
1517 room8 = (this.cell.Right.room ?? this.cell.FrontRight.room);
1520 this._lowblock = this.lowBlock;
1524 if (this.room != this.cell.Front.room)
1526 if (this.cell.Front.room !=
this.currentRoom)
1528 Room room9 = this.room;
1529 if (((room9 !=
null) ? room9.lot :
null) ==
this.currentLot)
1533 Room room10 = this.cell.Front.room;
1534 if (((room10 !=
null) ? room10.lot :
null) !=
this.currentLot)
1539 this.room = this.cell.Front.room;
1540 this._lowblock = (!this.cell.Front.lotWall && !this.cell.Front.fullWall);
1544 if (this.room != this.cell.Right.room)
1546 if (this.cell.Right.room !=
this.currentRoom)
1548 Room room11 = this.room;
1549 if (((room11 !=
null) ? room11.lot :
null) ==
this.currentLot)
1553 Room room12 = this.cell.Right.room;
1554 if (((room12 !=
null) ? room12.lot :
null) !=
this.currentLot)
1559 this.room = this.cell.Right.room;
1560 this._lowblock = (!this.cell.Right.lotWall && !this.cell.Right.fullWall);
1564 if (this.tileType.IsFullBlock &&
this.room !=
this.cell.FrontRight.room)
1566 if (this.cell.FrontRight.room !=
this.currentRoom)
1568 Room room13 = this.room;
1569 if (((room13 !=
null) ? room13.lot :
null) ==
this.currentLot)
1573 Room room14 = this.cell.FrontRight.room;
1574 if (((room14 !=
null) ? room14.lot :
null) !=
this.currentLot)
1579 this.room = this.cell.FrontRight.room;
1580 this._lowblock = (!this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall);
1585 if ((room15 = this.room) ==
null && (room15 = this.cell.Front.room) ==
null)
1587 room15 = (this.cell.Right.room ?? this.cell.FrontRight.room);
1590 this._lowblock =
true;
1591 if (!this.tileType.IsFullBlock)
1593 if (this.cell.lotWall)
1595 this._lowblock =
false;
1597 else if (this.room == this.currentRoom)
1599 this._lowblock = !this.cell.fullWall;
1604 flag9 = ((this.room !=
null && this.room.data.atrium) || (this.cell.room !=
null && this.cell.room.data.atrium));
1607 this._lowblock =
false;
1609 if (this.room ==
null && this.alwaysLowblock)
1611 this._lowblock =
true;
1612 this.roomHeight = 0f;
1614 if (this.room !=
null)
1616 this.maxHeight = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.room.lot.mh *
this._heightMod.y;
1619 this.roomHeight = this.room.lot.realHeight;
1621 else if (this.noRoofMode || (this._lowblock && !this.tileType.ForceRpeatBlock))
1623 this.roomHeight = 0f;
1627 int num14 = (this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight;
1628 this.roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num14) ?
this.room.lot.height : num14) + 0.01f * (float)this.room.lot.heightFix;
1632 if (!this._lowblock && (
double)this.roomHeight > 1.2 && this.tileType.RepeatBlock)
1636 else if (this.lowBlock)
1640 this.param.mat = this.matBlock;
1641 this.param.dir = this.cell.blockDir;
1642 this.param.snow = this.snowed;
1643 switch (this.tileType.blockRenderMode)
1645 case BlockRenderMode.FullBlock:
1647 bool invisible = this.sourceBlock.tileType.Invisible;
1648 if (!invisible || this.buildMode ||
ActionMode.Cinema.IsActive)
1650 if (this.cell.isSurrounded)
1652 switch (this.innerMode)
1656 this.param.color = this.blockLight;
1660 this.blockLight = this._baseBrightness + this.fogBrightness;
1661 this.param.color = (float)((
int)(50f * this.blockLight) * 262144);
1662 this.param.matColor = 104025f;
1663 this.param.tile = (float)((this.buildMode ? 1 : 2) + ((this._lowblock || this.defaultBlockHeight > 0f) ? 3000000 : 0));
1664 this.rendererInnerBlock.Draw(this.param);
1670 this.param.color = this.floorLight;
1672 this.param.color -= (float)((
int)(this._shadowStrength * 0.8f * 50f) * 262144);
1673 if (this.currentRoom !=
null && !this.showFullWall)
1675 this._lowblock =
true;
1676 this.roomHeight = 0f;
1677 if (this.cell.room !=
this.currentRoom && (
this.cell.Front.room ==
this.currentRoom ||
this.cell.Right.room ==
this.currentRoom ||
this.cell.FrontRight.room ==
this.currentRoom) && (
this.cell.Back.room !=
this.currentRoom ||
this.cell.Right.room !=
this.currentRoom) && (
this.cell.Front.room !=
this.currentRoom ||
this.cell.Left.room !=
this.currentRoom))
1679 this._lowblock =
false;
1681 if (!this._lowblock)
1683 int num15 = (this.currentRoom.data.maxHeight == 0) ? 2 : this.currentRoom.data.maxHeight;
1684 this.roomHeight = EMono.setting.render.roomHeightMod * (float)((this.currentRoom.lot.height < num15) ?
this.currentRoom.lot.height : num15) + 0.01f * (float)this.currentRoom.lot.heightFix;
1689 this._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));
1692 this.roomHeight = 0f;
1697 this.roomHeight = 0f;
1698 this._lowblock =
false;
1700 if (this.cell.Things.Count > 0)
1702 this._lowblock =
false;
1704 this.param.tile = (float)(this.sourceBlock._tiles[
this.cell.blockDir %
this.sourceBlock._tiles.Length] + (
this._lowblock ? 3000000 : 0));
1705 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matBlock.matColor,
this.sourceBlock.colorMod));
1706 if (this.roomHeight == 0f)
1708 if (!this.cell.hasDoor)
1710 this.sourceBlock.renderData.Draw(this.param);
1715 RenderData renderData2 = this.sourceBlock.renderData;
1717 float maxY = this.maxHeight;
1718 float num16 = this.roomHeight;
1720 bool hasDoor = this.cell.hasDoor;
1722 renderData2.DrawRepeatTo(p, maxY, num16, ref renderSetting.peakFixBlock, hasDoor, (effect2 !=
null) ? effect2.FireAmount : 0,
true);
1724 Room room16 = this.cell.Front.room ?? this.cell.room;
1725 if (room16 ==
null && this.cell.Right.room !=
null)
1727 room16 = this.cell.Right.room;
1729 if (!invisible && room16 !=
null)
1731 if (room16.lot.idDeco != 0 && !
this.cell.hasDoor)
1733 this.param.tile = (float)
EMono.sources.blocks.rows[0].ConvertTile(1000 + room16.lot.idDeco);
1734 this.param.matColor = (float)room16.lot.colDeco;
1735 float y = this.param.y;
1736 this.param.y += (float)room16.lot.decoFix * 0.01f;
1737 this.rendererWallDeco.Draw(this.param);
1740 if (room16.lot.idDeco2 != 0 &&
this.roomHeight != 0f && (
float)room16.lot.decoFix2 * 0.01f +
this.heightLimitDeco <
this.roomHeight +
this.maxHeight -
this.param.y)
1742 this.param.tile = (float)
EMono.sources.blocks.rows[0].ConvertTile(1000 + room16.lot.idDeco2);
1743 this.param.matColor = (float)room16.lot.colDeco2;
1744 float y2 = this.param.y;
1745 float num17 = this.param.z;
1746 this.param.y += (float)room16.lot.decoFix2 * 0.01f;
1747 this.param.z += (float)room16.lot.decoFix2 * 0.01f *
this.heightModDeco;
1748 this.rendererWallDeco.Draw(this.param);
1750 this.param.z = num17;
1753 room16 = (this.cell.Right.room ?? this.cell.room);
1754 if (room16 ==
null && this.cell.Front.room !=
null)
1756 room16 = this.cell.Front.room;
1758 if (!invisible && room16 !=
null)
1760 if (room16.lot.idDeco != 0 && !
this.cell.hasDoor)
1762 this.param.tile = (float)(
EMono.sources.blocks.rows[0].ConvertTile(1000 + room16.lot.idDeco) * -1);
1763 this.param.matColor = (float)room16.lot.colDeco;
1764 float y3 = this.param.y;
1765 this.param.y += (float)room16.lot.decoFix * 0.01f;
1766 this.rendererWallDeco.Draw(this.param);
1769 if (room16.lot.idDeco2 != 0 &&
this.roomHeight != 0f && (
float)room16.lot.decoFix2 * 0.01f +
this.heightLimitDeco <
this.roomHeight +
this.maxHeight -
this.param.y)
1771 this.param.tile = (float)(
EMono.sources.blocks.rows[0].ConvertTile(1000 + room16.lot.idDeco2) * -1);
1772 this.param.matColor = (float)room16.lot.colDeco2;
1773 float y4 = this.param.y;
1774 float num18 = this.param.z;
1775 this.param.y += (float)room16.lot.decoFix2 * 0.01f;
1776 this.param.z += (float)room16.lot.decoFix2 * 0.01f *
this.heightModDeco;
1777 this.rendererWallDeco.Draw(this.param);
1779 this.param.z = num18;
1785 case BlockRenderMode.WallOrFence:
1787 if (this.map.config.fullWallHeight)
1789 this.showFullWall =
true;
1790 this._lowblock =
false;
1792 this.orgY = this.param.y;
1793 this.orgZ = this.param.z;
1794 this.param.color = (this.tileType.IsFence ? (this.floorLight - (float)((int)(this._shadowStrength * 0.8f * 50f) * 262144)) : this.blockLight);
1795 bool flag10 = blockDir == 1 || this._lowblock || flag9;
1796 bool flag11 = blockDir == 0 || this._lowblock || flag9;
1797 if (!this.showFullWall && this.currentRoom !=
null)
1801 if (this.currentRoom != this.cell.room)
1803 if (this.cell.lotWall)
1805 Room room17 = this.cell.room;
1806 if (((room17 !=
null) ? room17.lot :
null) ==
this.currentLot &&
this.cell.Front.room !=
this.currentRoom)
1811 if (this.cell.Front.lotWall)
1813 Room room18 = this.cell.Front.room;
1814 if (((room18 !=
null) ? room18.lot :
null) ==
this.currentLot)
1819 if (this.cell.Front.room !=
this.currentRoom)
1827 if (!this.cell.IsRoomEdge || (
this.cell.Front.room !=
this.cell.room &&
this.cell.FrontRight.room !=
this.cell.room))
1835 if (this.currentRoom != this.cell.room)
1837 if (this.cell.lotWall)
1839 Room room19 = this.cell.room;
1840 if (((room19 !=
null) ? room19.lot :
null) ==
this.currentLot &&
this.cell.Right.room !=
this.currentRoom)
1845 if (this.cell.Right.lotWall)
1847 Room room20 = this.cell.Right.room;
1848 if (((room20 !=
null) ? room20.lot :
null) ==
this.currentLot)
1853 if (this.cell.Right.room !=
this.currentRoom)
1861 if (!this.cell.IsRoomEdge || (
this.cell.Right.room !=
this.cell.room &&
this.cell.FrontRight.room !=
this.cell.room))
1868 if (blockDir == 0 || blockDir == 2)
1871 Room room21 = this.cell.Front.room ?? this.cell.room;
1872 if (room21 !=
null && this.tileType.IsWall)
1874 if (room21.lot.idDeco != 0 && !
this.cell.hasDoor)
1876 this.param.tile = (float)
EMono.sources.blocks.rows[0].ConvertTile(1000 + room21.lot.idDeco);
1877 this.param.matColor = (float)room21.lot.colDeco;
1878 this.param.y += (float)room21.lot.decoFix * 0.01f;
1879 this.rendererWallDeco.Draw(this.param);
1880 this.param.y = this.orgY;
1882 if (room21.lot.idDeco2 != 0 &&
this.roomHeight != 0f && !flag10 && (
float)room21.lot.decoFix2 * 0.01f +
this.heightLimitDeco <
this.roomHeight +
this.maxHeight -
this.param.y)
1884 this.param.tile = (float)
EMono.sources.blocks.rows[0].ConvertTile(1000 + room21.lot.idDeco2);
1885 this.param.matColor = (float)room21.lot.colDeco2;
1886 this.param.y += (float)room21.lot.decoFix2 * 0.01f;
1887 this.param.z += (float)room21.lot.decoFix2 * 0.01f *
this.heightModDeco;
1888 this.rendererWallDeco.Draw(this.param);
1889 this.param.y = this.orgY;
1890 this.param.z = this.orgZ;
1893 Cell left = this.cell.Left;
1894 if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence)
1896 this._sourceBlock = left.sourceBlock;
1897 this.param.mat = left.matBlock;
1901 this._sourceBlock = this.sourceBlock;
1902 this.param.mat = this.matBlock;
1904 this.tileType = this._sourceBlock.tileType;
1905 this.param.tile = (float)(this.tile = this._sourceBlock._tiles[0] + ((flag10 && !
this.tileType.IsFence) ? 32 : 0));
1906 if (this._sourceBlock.useAltColor)
1908 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.altColor,
this._sourceBlock.colorMod));
1912 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.matColor,
this._sourceBlock.colorMod));
1914 if (this.roomHeight == 0f || flag10)
1916 if (!this.cell.hasDoor)
1918 this._sourceBlock.renderData.Draw(this.param);
1923 RenderData renderData3 = this._sourceBlock.renderData;
1925 float maxY2 = this.maxHeight;
1926 float num19 = this.roomHeight;
1928 bool hasDoor2 = this.cell.hasDoor;
1930 renderData3.DrawRepeatTo(p2, maxY2, num19, ref renderSetting2.peakFix, hasDoor2, (effect3 !=
null) ? effect3.FireAmount : 0,
false);
1932 this.param.z += this.cornerWallFix2.z;
1933 if ((blockDir == 2 || (this.cell.Front.HasWallOrFence &&
this.cell.Front.blockDir != 0)) !=
this.cell.isToggleWallPillar)
1935 if (this.cell.Back.IsSnowTile &&
this.cell.Right.IsSnowTile)
1937 this.param.snow =
true;
1939 this.param.tile = (float)(this._sourceBlock._tiles[0] + ((flag10 && flag11 && !
this.tileType.IsFence && !flag9) ? 32 : 0) + (
this.tileType.IsFence ? 32 : 64));
1940 if (this.roomHeight == 0f || !this.tileType.RepeatBlock || (flag10 && flag11 && !flag9))
1942 this._sourceBlock.renderData.Draw(this.param);
1946 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFix,
false, 0,
false);
1949 if (!flag10 && !this.showRoof && this.cell.Left.HasWallOrFence &&
this.cell.Left.blockDir != 0 && !
this.cell.isToggleWallPillar)
1951 this.orgX = this.param.x;
1952 this.param.tile = (float)(this._sourceBlock._tiles[0] + ((flag10 && !
this.tileType.IsFence && !flag9) ? 32 : 0) + (
this.tileType.IsFence ? 32 : 64));
1953 this.param.x += this.cornerWallFix3.x;
1954 this.param.y += this.cornerWallFix3.y;
1955 this.param.z += this.cornerWallFix3.z;
1956 if (!flag9 && (this.roomHeight == 0f || flag10))
1958 this._sourceBlock.renderData.Draw(this.param);
1962 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight + this.cornerWallFix.y, ref
this.renderSetting.peakFix,
false, 0,
false);
1964 this.param.x = this.orgX;
1966 else if (this.cell.FrontLeft.HasWallOrFence &&
this.cell.FrontLeft.blockDir != 0 && (!flag10 || !
this.cell.Left.HasWall) && !
this.cell.isToggleWallPillar)
1968 this.orgX = this.param.x;
1969 this.param.tile = (float)(this._sourceBlock._tiles[0] + ((flag10 && !
this.tileType.IsFence && !flag9) ? 32 : 0) + (
this.tileType.IsFence ? 32 : 64));
1970 this.param.x += this.cornerWallFix.x;
1971 this.param.y += this.cornerWallFix.y;
1972 this.param.z += this.cornerWallFix.z;
1973 if (!flag9 && (this.roomHeight == 0f || flag10))
1975 this._sourceBlock.renderData.Draw(this.param);
1979 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight + this.cornerWallFix.y, ref
this.renderSetting.peakFix,
false, 0,
false);
1981 this.param.x = this.orgX;
1984 if (blockDir == 1 || blockDir == 2)
1986 this.param.y = this.orgY;
1987 this.param.z = this.orgZ;
1989 Room room22 = this.cell.Right.room ?? this.cell.room;
1990 if (room22 !=
null && this.tileType.IsWall)
1992 if (room22.lot.idDeco != 0 && !
this.cell.hasDoor)
1994 this.param.tile = (float)(-(
float)
EMono.sources.blocks.rows[0].ConvertTile(1000 + room22.lot.idDeco));
1995 this.param.matColor = (float)room22.lot.colDeco;
1996 this.param.y += (float)room22.lot.decoFix * 0.01f;
1997 this.rendererWallDeco.Draw(this.param);
1998 this.param.y = this.orgY;
2000 if (room22.lot.idDeco2 != 0 &&
this.roomHeight != 0f && !flag11 && (
float)room22.lot.decoFix2 * 0.01f +
this.heightLimitDeco <
this.roomHeight +
this.maxHeight -
this.param.y)
2002 this.param.tile = (float)(-(
float)
EMono.sources.blocks.rows[0].ConvertTile(1000 + room22.lot.idDeco2));
2003 this.param.matColor = (float)room22.lot.colDeco2;
2004 this.param.y += (float)room22.lot.decoFix2 * 0.01f;
2005 this.param.z += (float)room22.lot.decoFix2 * 0.01f *
this.heightModDeco;
2006 this.rendererWallDeco.Draw(this.param);
2007 this.param.y = this.orgY;
2008 this.param.z = this.orgZ;
2011 if (blockDir == 2 && this.cell.room ==
null &&
this.cell.Right.room !=
null)
2013 Room room23 = this.cell.Right.room;
2014 this.maxHeight = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)room23.lot.mh *
this._heightMod.y;
2017 this.roomHeight = room23.lot.realHeight;
2019 else if (this.noRoofMode || (this._lowblock && !this.tileType.ForceRpeatBlock))
2021 this.roomHeight = 0f;
2025 int num20 = (room23.data.maxHeight == 0) ? 2 : room23.data.maxHeight;
2026 this.roomHeight = EMono.setting.render.roomHeightMod * (float)((room23.lot.height < num20) ? room23.lot.height : num20) + 0.01f * (float)room23.lot.heightFix;
2029 Cell back = this.cell.Back;
2030 if (blockDir == 2 && back.sourceBlock.tileType.IsWallOrFence)
2032 this._sourceBlock = back.sourceBlock;
2033 this.param.mat = back.matBlock;
2037 this._sourceBlock = this.sourceBlock;
2038 this.param.mat = this.matBlock;
2040 this.tileType = this._sourceBlock.tileType;
2041 this.param.tile = (float)(this.tile = -this._sourceBlock._tiles[0] + ((flag11 && !
this.tileType.IsFence) ? -32 : 0));
2042 if (this._sourceBlock.useAltColor)
2044 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.altColor,
this._sourceBlock.colorMod));
2048 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.matColor,
this._sourceBlock.colorMod));
2050 this.param.color += this._rightWallShade;
2051 if (this.roomHeight == 0f || flag11 || !this.tileType.RepeatBlock)
2053 if (!this.cell.hasDoor)
2055 this._sourceBlock.renderData.Draw(this.param);
2060 RenderData renderData4 = this._sourceBlock.renderData;
2062 float maxY3 = this.maxHeight;
2063 float num21 = this.roomHeight;
2065 bool hasDoor3 = this.cell.hasDoor;
2067 renderData4.DrawRepeatTo(p3, maxY3, num21, ref renderSetting3.peakFix, hasDoor3, (effect4 !=
null) ? effect4.FireAmount : 0,
false);
2069 if ((this.cell.Right.HasWallOrFence &&
this.cell.Right.blockDir != 1) !=
this.cell.isToggleWallPillar && (blockDir != 2 || !
this.cell.isToggleWallPillar))
2071 if (this.cell.Left.IsSnowTile &&
this.cell.Front.IsSnowTile)
2073 this.param.snow =
true;
2075 this.orgX = this.param.x;
2076 this.param.tile = (float)(this._sourceBlock._tiles[0] + ((flag11 && !
this.tileType.IsFence && !flag9) ? 32 : 0) + (
this.tileType.IsFence ? 32 : 64));
2077 if (!flag9 && (this.roomHeight == 0f || !this.tileType.RepeatBlock || flag11))
2079 this._sourceBlock.renderData.Draw(this.param);
2083 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFix,
false, 0,
false);
2085 this.param.x = this.orgX;
2088 this.param.y = this.orgY;
2089 this.param.z = this.orgZ;
2092 case BlockRenderMode.Pillar:
2094 RenderData renderData5 = this.sourceBlock.renderData;
2095 this.param.tile = (float)this.sourceBlock._tiles[
this.cell.blockDir %
this.sourceBlock._tiles.Length];
2096 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matBlock.matColor,
this.sourceBlock.colorMod));
2097 int num22 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
2100 renderData5.Draw(this.param);
2104 renderData5.DrawRepeat(this.param, num22, this.sourceBlock.tileType.RepeatSize,
false);
2106 this.param.tile = (float)renderData5.idShadow;
2107 SourcePref shadowPref2 = renderData5.shadowPref;
2108 int shadow2 = shadowPref2.shadow;
2109 this.passShadow.AddShadow(this.param.x + renderData5.offsetShadow.x,
this.param.y + renderData5.offsetShadow.y,
this.param.z + renderData5.offsetShadow.z,
ShadowData.Instance.items[shadow2], shadowPref2, 0,
this.param.snow);
2112 case BlockRenderMode.HalfBlock:
2113 this.param.color = this.floorLight;
2114 this._sourceBlock = ((this.sourceBlock.id == 5) ?
EMono.sources.blocks.rows[this.matBlock.defBlock] : this.sourceBlock);
2115 this.param.tile = (float)this._sourceBlock._tiles[0];
2116 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matBlock.matColor,
this._sourceBlock.colorMod));
2117 this.param.tile2 = this._sourceBlock.sourceAutoFloor._tiles[0];
2118 this.param.halfBlockColor = ((this._sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref this.matBlock.matColor,
this._sourceBlock.sourceAutoFloor.colorMod));
2119 this.sourceBlock.renderData.Draw(this.param);
2122 this.param.color = this.floorLight;
2123 this.param.tile = (float)(this.sourceBlock._tiles[
this.cell.blockDir %
this.sourceBlock._tiles.Length] + ((
this._lowblock &&
this.tileType.UseLowWallTiles) ? 3000000 : 0));
2124 this.param.matColor = (float)((this.sourceBlock.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.matBlock.matColor,
this.sourceBlock.colorMod));
2125 if (this.roomHeight == 0f)
2127 this.sourceBlock.renderData.Draw(this.param);
2131 this.sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFixBlock,
false, 0,
false);
2136 if (this.cell.pcSync &&
EMono.player.lightPower > 0f && !
this.cinemaMode)
2139 if (this.cell.room ==
null &&
this.cell.IsRoomEdge &&
this.showRoof)
2141 if (this.cell._block == 0 || !
this.cell.sourceBlock.tileType.RepeatBlock)
2143 Room room24 = this.cell.FrontRight.room;
2144 flag12 = (room24 !=
null && room24.HasRoof);
2155 if (!flag12 && (!this.showRoof || !this.roof || this.cell.room ==
null ||
this.cell.Front.room ==
null ||
this.cell.Right.room ==
null))
2157 this.param.tile = (float)num13;
2158 this.rendererFov.Draw(this.param);
2161 if (this.cell.effect !=
null)
2163 if (this.cell.effect.IsLiquid)
2167 this.tile = (int)(4 + Rand.bytes[
this.index % Rand.MaxBytes] % 4);
2168 this.param.tile = (float)(this.tile + this.cell.sourceEffect._tiles[0]);
2169 this.param.mat = defaultMaterial;
2170 this.param.matColor = (float)((this.cell.effect.color == 0) ?
BaseTileMap.GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) :
this.cell.effect.color);
2171 sourceEffect.renderData.Draw(this.param);
2175 this.param.tile = (float)this.cell.effect.source._tiles[0];
2177 if (sourceEffect2.anime.Length != 0)
2179 if (sourceEffect2.anime.Length > 2)
2181 float num23 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (
float)sourceEffect2.anime[2];
2182 if (num23 < (
float)sourceEffect2.anime[0])
2184 this.param.tile += num23;
2189 float num24 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (
float)sourceEffect2.anime[0];
2190 this.param.tile += num24;
2193 if (this.cell.effect.IsFire)
2195 this.rendererEffect.Draw(this.param, 0);
2199 this.cell.effect.source.renderData.Draw(this.param);
2203 this.param.color = this.floorLight;
2204 if (this.cell.critter !=
null)
2206 Critter critter = this.cell.critter;
2207 int snowTile = critter.tile;
2208 if (this.snowed && critter.SnowTile != 0)
2212 snowTile = critter.SnowTile;
2218 this.pass = this.passObjSS;
2219 this.batch = this.pass.batches[this.pass.batchIdx];
2220 this.batch.matrices[this.pass.idx].m03 = this.param.x + (float)((
int)(critter.x * 100f)) * 0.01f;
2221 this.batch.matrices[this.pass.idx].m13 = this.param.y + (float)((
int)(critter.y * 100f)) * 0.01f;
2222 this.batch.matrices[this.pass.idx].m23 = this.param.z;
2223 this.batch.tiles[this.pass.idx] = (float)(snowTile * (critter.reverse ? -1 : 1));
2224 this.batch.colors[this.pass.idx] = this.floorLight;
2226 if (this.pass.idx ==
this.pass.batchSize)
2228 this.pass.NextBatch();
2231 if (this.detail !=
null)
2234 if (anime3 !=
null && !anime3.animeBlock)
2237 this.param.x += anime4.v.x;
2238 this.param.y += anime4.v.y;
2239 this.param.z += anime4.v.z;
2242 if (this.cell.obj != 0 && !
this.cell.sourceObj.renderData.SkipOnMap)
2245 if (!this.snowed || sourceObj.snowTile <= 0)
2247 this.param.snow = this.snowed;
2248 this.param.mat = this.cell.matObj;
2249 this.orgY = this.param.y;
2250 if (this.param.liquidLv > 0)
2252 if (sourceObj.pref.Float)
2254 this.param.y += 0.01f * this.floatY;
2255 if (this.liquidLv > 10)
2257 this.liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
2259 this.liquidLv -= (int)(this.floatY * 0.5f);
2260 this.param.liquidLv = this.liquidLv;
2262 if (sourceObj.tileType.IsWaterTop)
2264 this.param.liquidLv = 0;
2268 this.param.liquidLv += sourceObj.pref.liquidMod;
2269 if (this.param.liquidLv < 1)
2271 this.param.liquid = 1f;
2273 else if (this.param.liquidLv > 99 + sourceObj.pref.liquidModMax)
2275 this.param.liquidLv = 99 + sourceObj.pref.liquidModMax;
2279 if (sourceObj.useAltColor)
2281 this.param.matColor = (float)((sourceObj.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.altColor, sourceObj.colorMod));
2285 this.param.matColor = (float)((sourceObj.colorMod == 0) ? 104025 :
BaseTileMap.GetColorInt(ref
this.param.mat.matColor, sourceObj.colorMod));
2287 if (sourceObj.HasGrowth)
2289 this.cell.growth.OnRenderTileMap(this.param);
2293 if (this.cell.autotileObj != 0)
2295 this.param.tile = (float)(sourceObj._tiles[0] + (
int)
this.cell.autotileObj);
2297 else if (sourceObj.tileType.IsUseBlockDir)
2299 this.param.tile = (float)sourceObj._tiles[
this.cell.blockDir % sourceObj._tiles.Length];
2303 this.param.tile = (float)sourceObj._tiles[
this.cell.objDir % sourceObj._tiles.Length];
2305 if (this._lowblock && sourceObj.tileType.IsSkipLowBlock)
2307 this.param.tile += (float)(((this.param.tile > 0f) ? 1 : -1) * 3000000);
2309 this.orgY = this.param.y;
2310 this.orgZ = this.param.z;
2311 this.param.y += sourceObj.pref.y;
2312 this.param.z += sourceObj.pref.z;
2313 sourceObj.renderData.Draw(this.param);
2314 this.param.y = this.orgY;
2315 this.param.z = this.orgZ;
2316 int shadow3 = sourceObj.pref.shadow;
2317 if (shadow3 > 1 && !this.cell.ignoreObjShadow)
2319 this.passShadow.AddShadow(this.param.x + sourceObj.renderData.offsetShadow.x,
this.param.y + sourceObj.renderData.offsetShadow.y,
this.param.z + sourceObj.renderData.offsetShadow.z,
ShadowData.Instance.items[shadow3], sourceObj.pref, 0,
this.param.snow);
2321 this.param.y = this.orgY;
2325 if (this.cell.decal != 0 &&
this.sourceFloor.tileType.AllowBlood)
2327 this.passDecal.Add(this.param, (
float)this.cell.decal,
this.floorLight, 0f);
2329 if (this.highlightCells)
2334 if (this.cell.isClearSnow)
2336 this.passArea.Add(this.param, 34f, 0f, 0f);
2340 if (this.cell.isForceFloat)
2342 this.passArea.Add(this.param, 34f, 0f, 0f);
2346 if (this.cell.isToggleWallPillar)
2348 this.passArea.Add(this.param, 34f, 0f, 0f);
2352 if (this.cell.isClearArea)
2354 this.passArea.Add(this.param, 34f, 0f, 0f);
2359 if (this.detail ==
null)
2363 if (this.highlightArea && this.detail.area !=
null)
2365 this.passArea.Add(this.param, (
float)(this.detail.area.GetTile(
this.index) - (
this.subtleHighlightArea ? 0 : 1)), 0f, 0f);
2367 if (this.detail.footmark !=
null &&
this.sourceFloor.id != 0)
2369 this.param.tile = (float)this.detail.footmark.tile;
2370 this.param.mat = this.matFloor;
2371 this.param.matColor = 104025f;
2372 this.renderFootmark.Draw(this.param);
2375 if (this.detail.things.Count == 0 &&
this.detail.charas.Count == 0)
2380 this.thingPos.x = 0f;
2381 this.thingPos.y = 0f;
2382 this.thingPos.z = 0f;
2383 this.freePos.x = (this.freePos.y = (this.freePos.z = 0f));
2384 if (this.cell.HasRamp)
2386 Vector3 rampFix = this.sourceBlock.tileType.GetRampFix(this.cell.blockDir);
2387 this.param.x += rampFix.x;
2388 this.param.y += rampFix.y;
2389 this.param.z += rampFix.z;
2390 this.freePos.x = this.freePos.x + rampFix.x;
2391 this.freePos.y = this.freePos.y + rampFix.y;
2392 this.freePos.z = this.freePos.z + rampFix.z;
2394 this.param.y += (flag ? 0f : ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : this.sourceFloor.tileType.FloorHeight));
2395 this.orgPos.x = (this.orgX = this.param.x);
2396 this.orgPos.y = (this.orgY = this.param.y);
2397 this.orgPos.z = (this.orgZ = this.param.z);
2398 if (flag && this.liquidLv > 0)
2400 if (this.liquidLv > 10)
2402 this.liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
2404 this.liquidLv -= (int)(this.floatY * 0.5f);
2405 this.param.liquidLv = this.liquidLv;
2406 this.param.y -=
TileType.FloorWaterShallow.FloorHeight;
2409 CS$<>8__locals1.shadow = (this.liquidLv == 0);
2412 bool flag13 =
false;
2414 bool flag14 =
false;
2416 if (this.detail.things.Count > 0 &&
this.isSeen)
2418 float max = this.zSetting.max1;
2420 for (
int k = 0; k < this.detail.things.Count; k++)
2422 Thing t = this.detail.things[k];
2423 if ((!this.fogged || t.isRoofItem) && ((!t.isHidden && !t.trait.HideInAdv && !t.isMasked) ||
EMono.scene.actionMode.ShowMaskedThings) && (!t.isRoofItem || ((
this.room !=
null ||
this.sourceBlock.tileType.IsFullBlock ||
EMono._zone.IsPCFaction) && (!
this.lowBlock ||
this.showFullWall ||
this.room ==
null) && !
this.noRoofMode)) && (!flag5 || t.isRoofItem))
2425 TileType tileType = t.trait.tileType;
2426 bool isInstalled = t.IsInstalled;
2428 if (!isInstalled && t.category.tileDummy != 0)
2430 pref = this.rendererObjDummy.shadowPref;
2432 float num31 = (tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height));
2433 if (t.ignoreStackHeight)
2435 this.thingPos.y = this.thingPos.y - num26;
2437 CS$<>8__locals1.shadow = (this.thingPos.y < 0.16f && num29 < 0.16f);
2438 bool bypassShadow = pref.bypassShadow;
2439 this.param.shadowFix = -this.thingPos.y;
2440 this.param.liquidLv = ((this.thingPos.y + (float)t.altitude < 0.1f) ? this.liquidLv : 0);
2443 this.param.snow = (this.isSnowCovered && !this.cell.isClearSnow);
2444 this.SetRoofHeight(this.param, this.cell, this.cx, this.cz, 0, 0, -1,
false);
2445 this._actorPos.x = this.param.x;
2446 this._actorPos.y = this.param.y;
2447 this._actorPos.z = this.param.z + num30;
2448 if (this.room !=
null)
2450 this.param.color = (float)this.GetRoofLight(this.room.lot);
2452 CS$<>8__locals1.shadow =
false;
2453 this.param.liquidLv = 0;
2457 this.param.snow = this.snowed;
2458 this._actorPos.x = this.orgX + num27;
2459 this._actorPos.y = this.orgY;
2460 this._actorPos.z = this.orgZ + num30 + this.thingPos.z;
2461 if (tileType.CanStack || !isInstalled)
2463 if (((thing !=
null) ? thing.id :
null) != t.id)
2465 this._actorPos.x = this._actorPos.x + this.thingPos.x;
2467 this._actorPos.y = this._actorPos.y + this.thingPos.y;
2468 if (t.trait.IgnoreLastStackHeight && (thing ==
null || !thing.trait.IgnoreLastStackHeight))
2470 this._actorPos.y = this._actorPos.y - num26;
2472 this._actorPos.z = this._actorPos.z + (this.renderSetting.thingZ + (float)k * -0.01f + this.zSetting.mod1 * this.thingPos.y);
2476 if (t.TileType.IsRamp)
2478 Vector3 rampFix2 = t.TileType.GetRampFix(t.dir);
2479 this.orgX += rampFix2.x;
2480 this.orgY += rampFix2.y;
2481 this.orgZ += rampFix2.z;
2482 this.freePos.x = this.freePos.x + rampFix2.x;
2483 this.freePos.y = this.freePos.y + rampFix2.y;
2484 this.freePos.z = this.freePos.z + rampFix2.z;
2485 if (!this.cell.IsTopWater || t.altitude > 0)
2487 num29 += rampFix2.y;
2489 this.liquidLv -= (int)(rampFix2.y * 150f);
2490 if (this.liquidLv < 0)
2495 else if (!flag14 && t.trait.IsChangeFloorHeight)
2497 this.orgY += num31 + (float)t.altitude *
this.altitudeFix.y;
2498 this.orgZ += (float)t.altitude *
this.altitudeFix.z;
2499 this.freePos.y = this.freePos.y + (num31 + (float)t.altitude * this.altitudeFix.y);
2500 if (!this.cell.IsTopWater || t.altitude > 0)
2502 num29 += num31 + (float)t.altitude *
this.altitudeFix.y;
2504 this._actorPos.x = this._actorPos.x + pref.x * (float)(t.flipX ? -1 : 1);
2505 this._actorPos.z = this._actorPos.z + pref.z;
2506 this.thingPos.z = this.thingPos.z + pref.z;
2507 this.liquidLv -= (int)(num31 * 150f);
2508 if (this.liquidLv < 0)
2515 this.thingPos.y = this.thingPos.y + num31;
2516 this._actorPos.x = this._actorPos.x + pref.x * (float)(t.flipX ? -1 : 1);
2517 this._actorPos.z = this._actorPos.z + pref.z;
2518 if (pref.height >= 0f)
2520 this.thingPos.z = this.thingPos.z + pref.z;
2523 if (!tileType.UseMountHeight && k > 1)
2530 this.thingPos.y = this.thingPos.y + num31;
2531 this._actorPos.x = this._actorPos.x + pref.x * (float)(t.flipX ? -1 : 1);
2532 this._actorPos.z = this._actorPos.z + pref.z;
2533 this.thingPos.z = this.thingPos.z + pref.z;
2535 if (t.isFloating && isWater && !
this.hasBridge && !flag)
2538 float num32 = (this.cell._bridge != 0) ? this.sourceBridge.tileType.FloorHeight : this.sourceFloor.tileType.FloorHeight;
2539 this.orgY += 0.01f * this.floatY - num32;
2541 this._actorPos.y = this._actorPos.y + (0.01f * this.floatY - num32);
2542 if (this.liquidLv > 10)
2544 this.liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
2546 this.liquidLv -= (int)(this.floatY * 0.5f);
2547 if (this.liquidLv < 0)
2551 this.param.liquidLv = this.liquidLv;
2554 if (t.sourceCard.multisize && !t.trait.IsGround)
2556 num30 += this.zSetting.multiZ;
2558 this.orgZ += t.renderer.data.stackZ;
2559 if (this.param.liquidLv > 0)
2561 this.param.liquidLv += pref.liquidMod;
2562 if (this.param.liquidLv < 1)
2564 this.param.liquidLv = 1;
2566 else if (this.param.liquidLv > 99 + pref.liquidModMax)
2568 this.param.liquidLv = 99 + pref.liquidModMax;
2572 if (isInstalled && tileType.UseMountHeight)
2574 if (tileType !=
TileType.Illumination || !
this.cell.HasObj)
2576 if (this.noRoofMode && t.altitude >=
this.lowWallObjAltitude)
2582 Room room25 = this.cell.room;
2583 if (((room25 !=
null) ? room25.lot :
null) !=
this.currentLot || (!
this.cell.lotWall &&
this.cell.room !=
this.currentRoom))
2585 Room room26 = (t.dir == 0) ? this.cell.Back.room : this.cell.Left.room;
2586 if (t.trait.AlwaysHideOnLowWall)
2592 if (!room26.data.showWallItem)
2597 else if (t.altitude >=
this.lowWallObjAltitude)
2604 if (tileType.UseHangZFix)
2608 tileType.GetMountHeight(ref this._actorPos,
Point.shared.Set(
this.index), t.dir, t);
2609 CS$<>8__locals1.shadow =
false;
2610 this.param.liquidLv = 0;
2613 this._actorPos.x = this._actorPos.x + t.fx;
2614 this._actorPos.y = this._actorPos.y + t.fy;
2619 if (t.altitude != 0)
2621 this._actorPos += this.altitudeFix * (float)t.altitude;
2622 if (t.altitude > 2 && ((
this.cell.Back.room !=
null &&
this.cell.Back.IsRoomEdge) || (
this.cell.Left.room !=
null &&
this.cell.Left.IsRoomEdge)) &&
this.hideHang)
2624 Room room27 = this.cell.room;
2625 if (((room27 !=
null) ? room27.lot :
null) !=
this.currentLot || (!
this.cell.lotWall &&
this.cell.room !=
this.currentRoom))
2633 this._actorPos.x = this.orgX + t.fx - this.freePos.x;
2634 this._actorPos.y = this.orgY + t.fy - this.freePos.y;
2638 this._actorPos.z = this._actorPos.z + -0.5f;
2641 if (!t.sourceCard.multisize || (t.pos.x ==
this.cx && t.pos.z ==
this.cz))
2643 if (this.iconMode !=
BaseTileMap.CardIconMode.None)
2646 switch (this.iconMode)
2649 if (t.isDeconstructing)
2655 if (t.placeState == PlaceState.installed)
2667 if (t.isNPCProperty && !
EMono.debug.godBuild)
2673 this.passGuideBlock.Add(this._actorPos.x,
this._actorPos.y,
this._actorPos.z - 10f, (
float)num33, 0f);
2676 t.SetRenderParam(this.param);
2677 if (this._lowblock && t.trait.UseLowblock && !
this.cell.HasFullBlock)
2679 this.param.tile += (float)((this.param.tile < 0f) ? -64 : 64);
2684 if (ai_Trolley !=
null && ai_Trolley.trolley.owner == t)
2687 EMono.core.actionsLateUpdate.Add(delegate
2689 t.SetRenderParam(_param);
2690 CS$<>8__locals1.<>4__this._actorPos.x =
EMono.pc.renderer.position.x;
2691 CS$<>8__locals1.<>4__this._actorPos.y = EMono.pc.renderer.position.y - pref.height;
2692 CS$<>8__locals1.<>4__this._actorPos.z = EMono.pc.renderer.position.z + 0.02f;
2693 t.renderer.Draw(_param, ref CS$<>8__locals1.<>4__this._actorPos, !t.noShadow && (CS$<>8__locals1.shadow || tileType.AlwaysShowShadow));
2698 t.renderer.Draw(this.param, ref this._actorPos, !t.noShadow && (CS$<>8__locals1.shadow || tileType.AlwaysShowShadow));
2703 num27 += pref.stackX * (float)(t.flipX ? -1 : 1);
2705 this.param.x = this.orgX;
2706 this.param.y = this.orgY;
2707 this.param.z = this.orgZ;
2708 this.param.color = this.floorLight;
2719 if (this.detail.charas.Count > 0)
2721 this.param.shadowFix = -num29;
2722 this.param.color += 1310720f;
2723 float max2 = this.zSetting.max2;
2724 for (
int l = 0; l < this.detail.charas.Count; l++)
2726 Chara chara = this.detail.charas[l];
2727 if (chara.host ==
null && (chara ==
EMono.pc || chara ==
LayerDrama.alwaysVisible || (!flag5 && !
this.fogged && (
this.showAllCards ||
EMono.player.CanSee(chara)))))
2729 this._actorPos.x = this.orgX;
2730 this._actorPos.y = this.orgY;
2731 this._actorPos.z = this.orgZ;
2732 chara.SetRenderParam(this.param);
2733 bool isAliveInCurrentZone = chara.IsAliveInCurrentZone;
2734 if (chara.isRestrained)
2737 if (restrainer !=
null)
2739 Vector3 getRestrainPos = restrainer.GetRestrainPos;
2740 if (getRestrainPos !=
default(Vector3))
2742 Vector3 position = restrainer.owner.renderer.position;
2743 float defCharaHeight =
EMono.setting.render.defCharaHeight;
2744 float num34 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height);
2745 this._actorPos.x = position.x + getRestrainPos.x * (float)((restrainer.owner.dir % 2 == 0) ? 1 : -1);
2746 this._actorPos.y = position.y + num34;
2747 this._actorPos.z = position.z + getRestrainPos.z;
2748 this.param.liquidLv = 0;
2749 this.param.shadowFix = this.orgY - this._actorPos.y;
2750 chara.renderer.SetFirst(
true);
2751 chara.renderer.Draw(this.param, ref this._actorPos,
true);
2752 this.param.shadowFix = 0f;
2757 if (!chara.sourceCard.multisize || (chara.pos.x ==
this.cx && chara.pos.z ==
this.cz))
2759 if (chara.IsDeadOrSleeping && chara.IsPCC)
2761 float num35 = chara.renderer.data.size.y * 0.3f;
2762 if (this.thingPos.y > max2)
2764 this.thingPos.y = max2;
2766 float num36 = this.thingPos.y + num35;
2767 float num37 = (float)l * -0.01f;
2768 if (num36 > this.zSetting.thresh1)
2770 num37 = this.zSetting.mod1;
2772 this._actorPos.x = this._actorPos.x + this.thingPos.x;
2773 this._actorPos.y = this._actorPos.y + this.thingPos.y;
2774 this._actorPos.z = this._actorPos.z + (this.renderSetting.laydownZ + num37);
2775 this.param.liquidLv = ((this.thingPos.y == 0f && this.liquidLv > 0) ? 90 : 0);
2776 this.thingPos.y = this.thingPos.y + num35 * 0.8f;
2777 chara.renderer.Draw(this.param, ref this._actorPos, this.liquidLv == 0);
2781 this.param.liquidLv = this.liquidLv;
2782 if (this.param.liquidLv > 0)
2784 this.param.liquidLv += chara.Pref.liquidMod;
2785 if (this.param.liquidLv < 1)
2787 this.param.liquidLv = 1;
2789 else if (this.param.liquidLv > 99 + chara.Pref.liquidModMax)
2791 this.param.liquidLv = 99 + chara.Pref.liquidModMax;
2794 if (!chara.IsPC && !chara.renderer.IsMoving &&
this.detail.charas.Count > 1 && (
this.detail.charas.Count != 2 || !
this.detail.charas[0].IsDeadOrSleeping || !
this.detail.charas[0].IsPCC))
2796 this._actorPos += this.renderSetting.charaPos[1 + ((num25 < 4) ? num25 : 3)];
2798 this._actorPos.z = this._actorPos.z + (0.01f * (float)l + this.renderSetting.charaZ);
2802 this._actorPos.z = this._actorPos.z + chara.renderer.data.hangedFixZ;
2804 chara.renderer.Draw(this.param, ref this._actorPos, this.liquidLv == 0);
2807 this.param.x = this.orgX;
2808 this.param.y = this.orgY;
2809 this.param.z = this.orgZ;
2817 public Vector3 GetThingPosition(
Card tg,
Point p)
2819 Vector3 vector = Vector3.zero;
2822 this.sourceFloor = this.cell.sourceFloor;
2823 if (!tg.TileType.UseMountHeight)
2825 if (this.cell.isFloating && !
this.cell.IsSnowTile)
2829 else if (!tg.sourceCard.multisize)
2831 float num2 = (this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : this.sourceFloor.tileType.FloorHeight;
2833 vector.z -= num2 * this.heightMod.z;
2835 if (this.cell.HasRamp)
2837 Vector3 rampFix = this.cell.sourceBlock.tileType.GetRampFix(this.cell.blockDir);
2838 vector.x += rampFix.x;
2839 vector.y += rampFix.y;
2840 vector.z += rampFix.z;
2843 if (tg.sourceCard.multisize)
2847 vector.x += tg.Pref.x * (float)(tg.flipX ? -1 : 1);
2848 vector.z += tg.Pref.z;
2849 this.detail = this.cell.detail;
2855 if (tg.TileType.UseMountHeight && !
EMono.scene.actionMode.IsRoofEditMode(tg))
2859 else if (!tg.TileType.CanStack ||
EMono.scene.actionMode.IsRoofEditMode(tg))
2861 if (tg.altitude != 0)
2863 vector += this.altitudeFix * (float)tg.altitude;
2867 if (
EMono.scene.actionMode.IsRoofEditMode(tg))
2872 if (this.detail !=
null && this.detail.things.Count > 0)
2874 for (
int i = 0; i < this.detail.things.Count; i++)
2876 Thing thing = this.detail.things[i];
2878 TileType tileType = thing.trait.tileType;
2879 float num4 = tileType.UseMountHeight ? 0f : ((pref.height == 0f) ? 0.1f : pref.height);
2880 if (thing.IsInstalled && thing !=
ActionMode.Inspect.target)
2882 if (thing.TileType.IsRamp)
2884 Vector3 rampFix2 = thing.TileType.GetRampFix(thing.dir);
2885 vector.x += rampFix2.x;
2886 vector.y += rampFix2.y;
2887 vector.z += rampFix2.z;
2889 if (!flag && tileType.CanStack)
2891 if (thing.ignoreStackHeight)
2896 vector.x += pref.stackX * (float)(thing.flipX ? -1 : 1);
2897 vector.z += pref.z + thing.renderer.data.stackZ;
2898 if (!tileType.UseMountHeight && thing.altitude != 0)
2900 vector += this.altitudeFix * (float)thing.altitude;
2901 num4 += this.altitudeFix.y * (float)thing.altitude;
2904 vector.z += this.renderSetting.thingZ + num + (float)i * -0.01f + this.zSetting.mod1 * vector.y;
2905 if (thing.sourceCard.multisize)
2907 num += this.zSetting.multiZ;
2917 if (tg.ignoreStackHeight)
2921 if (tg.altitude != 0)
2923 vector += this.altitudeFix * (float)tg.altitude;
2929 public int GetApproximateBlocklight(
Cell cell)
2931 float num = this._baseBrightness + 0.05f;
2932 if (cell.IsSnowTile)
2934 num = (float)((
int)(num * 50f) * 262144 + (
int)((
float)((cell.lightR >= 50) ? 50 : cell.lightR) *
this.snowColor) * 4096 + (
int)((
float)((cell.lightG >= 50) ? 50 : cell.lightG) *
this.snowColor) * 64 + (
int)((
float)((cell.lightB >= 50) ? 50 : cell.lightB) *
this.snowColor) +
this.snowColorToken);
2938 num = (float)((
int)(num * 50f) * 262144 + (
int)(((cell.lightR >= 64) ? 63 : cell.lightR) * 4096) + (
int)(((cell.lightG >= 64) ? 63 : cell.lightG) * 64) + (
int)((cell.lightB >= 64) ? 63 : cell.lightB));
2944 public int GetRoofLight(
Lot lot)
2946 float num = Mathf.Sqrt(lot.light) * this.roofLightMod;
2947 if (num > this.lightLimit * this.roofLightLimitMod)
2949 num = this.lightLimit * this.roofLightLimitMod;
2951 if (this.isSnowCovered)
2953 num += this.roofLightSnow * (1f - this.nightRatio);
2955 int num2 = (int)(num * 50f) * 262144;
2956 if (this.isSnowCovered)
2958 num2 += this.snowColorToken;
2964 public void DrawRoof(
Lot lot)
2966 RoofStyle roofStyle = this.roofStyles[lot.idRoofStyle];
2967 if (roofStyle.type ==
RoofStyle.Type.None)
2971 bool reverse = lot.reverse;
2978 num = lot.z - roofStyle.h;
2979 num2 = lot.x - roofStyle.w;
2980 num3 = lot.mz + 1 + roofStyle.h;
2981 num4 = lot.mx + 1 + roofStyle.w;
2982 if (num2 > 1 && num > 0 && this.map.cells[num2 - 1, num].HasFullBlock)
2986 if (num3 < this.Size && num4 < this.Size && this.map.cells[num4 - 1, num3].HasFullBlock)
2993 num = lot.x - roofStyle.w;
2994 num2 = lot.z - roofStyle.h;
2995 num3 = lot.mx + 1 + roofStyle.w;
2996 num4 = lot.mz + 1 + roofStyle.h;
2997 if (num2 > 0 && num > 1 && this.map.cells[num - 1, num2].HasFullBlock)
3001 if (num3 < this.Size && num4 < this.Size && this.map.cells[num3 - 1, num4].HasFullBlock)
3006 bool flag = roofStyle.wing && lot.height > 1;
3012 int num5 = num4 + (reverse ? roofStyle.w : roofStyle.h) * 2 - num2;
3013 int idRoofTile = lot.idRoofTile;
3014 int num6 = lot.idBlock;
3016 if (num6 >=
EMono.sources.blocks.rows.Count)
3018 num6 = EMono.sources.blocks.rows.Count - 1;
3020 if (num7 >=
EMono.sources.floors.rows.Count)
3022 num7 = EMono.sources.floors.rows.Count - 1;
3024 int num8 = lot.idRamp;
3025 if (num8 >=
EMono.sources.blocks.rows.Count)
3027 num8 = EMono.sources.blocks.rows.Count - 1;
3030 int num9 = num5 / 2 - roofStyle.flatW;
3031 int num10 = num5 / 2 + roofStyle.flatW + ((num5 % 2 == 0) ? 0 : 1);
3032 SourceBlock.Row row = roofStyle.useDefBlock ? this.cell.sourceFloor._defBlock :
EMono.sources.blocks.rows[num6];
3034 int num12 = flag ? -1 : 0;
3036 Vector3 vector = lot.fullblock ? roofStyle.posFixBlock : roofStyle.posFix;
3037 switch (roofStyle.type)
3040 flag2 = (num5 % 2 == 1 && roofStyle.flatW == 0);
3044 num9 = roofStyle.flatW;
3045 num10 = num5 - roofStyle.flatW;
3050 if (roofStyle.type !=
RoofStyle.Type.FlatFloor)
3064 while (this.cz < num4)
3067 while (this.cx < num3)
3069 if (this.cx >= 0 && this.cz >= 0 && this.cx < this.Size && this.cz < this.Size)
3077 this.cell = this.map.cells[num14, num15];
3078 if (roofStyle.wing &&
this.cz == num4 - 1 &&
this.cell.Right.Right.room !=
null &&
this.cell.Right.Right.room.lot != lot)
3087 this.cell = this.map.cells[num14, num15];
3088 if (roofStyle.wing &&
this.cz == 0 &&
this.cell.Front.Front.room !=
null &&
this.cell.Front.Front.room.lot != lot)
3093 int num16 = num15 - num14;
3094 this.room = this.cell.room;
3095 if (this.room ==
null || this.room.lot == lot)
3098 if (roofStyle.type ==
RoofStyle.Type.Flat)
3102 if (this.cell.HasFullBlock &&
this.cell.room ==
null)
3104 Room room = this.cell.Left.room;
3105 if (((room !=
null) ? room.lot :
null) == lot &&
this.cell.Right.room !=
null)
3112 Room room2 = this.cell.Front.room;
3113 if (((room2 !=
null) ? room2.lot :
null) == lot)
3115 Room room3 = this.cell.FrontRight.room;
3116 num13 = ((((room3 !=
null) ? room3.lot :
null) == lot) ? 1 : 2);
3121 Room room4 = this.cell.Right.room;
3122 if (((room4 !=
null) ? room4.lot :
null) != lot)
3124 Room room5 = this.cell.FrontRight.room;
3125 if (((room5 !=
null) ? room5.lot :
null) != lot)
3135 else if (this.cell.Left.room ==
null ||
this.cell.Left.room.lot != lot)
3137 num13 = (this.cell.Left.HasFullBlock ? 1 : 0);
3139 else if (this.cell.Right.room ==
null ||
this.cell.Right.room.lot != lot)
3141 num13 = ((this.cell.HasFullBlock && this.cell.Right.HasFullBlock && this.cell.Right.room !=
null) ? 1 : 2);
3148 else if (this.cell.HasFullBlock &&
this.cell.room ==
null)
3150 Room room6 = this.cell.Right.room;
3151 if (((room6 !=
null) ? room6.lot :
null) == lot)
3153 Room room7 = this.cell.FrontRight.room;
3154 num13 = ((((room7 !=
null) ? room7.lot :
null) == lot) ? 1 : 0);
3159 Room room8 = this.cell.Front.room;
3160 if (((room8 !=
null) ? room8.lot :
null) != lot)
3162 Room room9 = this.cell.FrontRight.room;
3163 if (((room9 !=
null) ? room9.lot :
null) != lot)
3172 else if (this.cell.Front.room ==
null ||
this.cell.Front.room.lot != lot)
3174 num13 = ((this.cell.HasFullBlock && this.cell.Front.HasFullBlock && this.cell.Front.room !=
null) ? 1 : 0);
3176 else if (this.cell.Back.room ==
null ||
this.cell.Back.room.lot != lot)
3178 num13 = (this.cell.Back.HasFullBlock ? 1 : 2);
3187 if (this.room !=
null || roofStyle.coverLot || flag3)
3189 this.index = this.cx + this.cz * this.Size;
3190 this.height = (int)this.cell.TopHeight;
3191 bool flag4 = this.isSnowCovered && !this.cell.isClearSnow;
3192 float num17 = (float)num16 * this.screen.tileAlign.y + (
float)lot.mh * this._heightMod.y + lot.realHeight + this.roofFix.y + vector.y;
3193 float num18 = 1000f + this.param.x * this.screen.tileWeight.x + (float)lot.mh *
this._heightMod.z + lot.realHeight *
this.roofFix3.z +
this.roofFix.z + vector.z;
3194 if (lot.height == 1 && lot.heightFix < 20)
3196 num17 += roofStyle.lowRoofFix.y;
3197 num18 += roofStyle.lowRoofFix.z;
3199 this.param.x = (float)(this.cx + this.cz) * this.screen.tileAlign.x + this.roofFix.x + (float)num12 * this.roofFix2.x + vector.x * (
float)(reverse ? 1 : -1);
3200 this.param.y = num17 + (float)num12 * this.roofFix2.y;
3201 this.param.z = num18 + this.param.y * this.screen.tileWeight.z + (float)num12 * this.roofFix2.z;
3202 this.param.color = (float)this.GetRoofLight(lot);
3203 this.param.snow = (idRoofTile == 0 && flag4);
3204 this.param.shadowFix = 0f;
3209 if (roofStyle.type ==
RoofStyle.Type.FlatFloor)
3211 if (this.cell.HasFullBlock &&
this.cell.IsRoomEdge)
3215 renderRow =
EMono.sources.floors.rows[num7];
3216 renderRow.SetRenderParam(this.param, mat, 0);
3217 this.param.matColor = (float)lot.colRoof;
3222 renderRow.SetRenderParam(this.param, mat, 0);
3223 this.param.matColor = (float)lot.colBlock;
3225 renderRow.renderData.Draw(this.param);
3226 if (idRoofTile != 0)
3228 renderRow =
EMono.sources.blocks.rows[
EMono.sources.objs.rows[idRoofTile].idRoof];
3229 int num19 = (reverse ? 1 : 0) + (flag2 ? 0 : 2);
3230 renderRow.SetRenderParam(this.param,
MATERIAL.sourceGold, num19);
3231 this.param.matColor = (float)lot.colRoof;
3232 if (roofStyle.type ==
RoofStyle.Type.FlatFloor)
3234 this.param.x += roofStyle.posFixBlock.x;
3235 this.param.y += roofStyle.posFixBlock.y;
3236 this.param.z += roofStyle.posFixBlock.z;
3240 this.param.z += 0.5f;
3244 this.param.matColor = 104025f;
3245 if (roofStyle.type !=
RoofStyle.Type.FlatFloor)
3247 this.param.z += roofStyle.snowZ;
3249 this.param.tile = (float)(renderRow.renderData.ConvertTile(renderRow.snowTile) + num19);
3250 renderRow.renderData.Draw(this.param);
3254 renderRow.renderData.Draw(this.param);
3257 else if (flag4 && roofStyle.type ==
RoofStyle.Type.FlatFloor)
3259 this.param.matColor = 104025f;
3260 this.param.tile = 10f;
3261 this.param.x += roofStyle.snowFix.x;
3262 this.param.y += roofStyle.snowFix.y;
3263 this.param.z += roofStyle.snowZ + roofStyle.snowFix.z;
3264 renderRow.renderData.Draw(this.param);
3269 if (idRoofTile != 0)
3271 int num20 = reverse ? ((num13 == 0) ? 3 : 1) : ((num13 == 0) ? 0 : 2);
3272 if (lot.altRoof && !flag2 && (roofStyle.type ==
RoofStyle.Type.Default || roofStyle.type ==
RoofStyle.Type.DefaultNoTop))
3274 this.param.shadowFix = (float)(num20 + 1);
3277 renderRow.SetRenderParam(this.param,
MATERIAL.sourceGold, num20);
3278 this.param.matColor = (float)lot.colRoof;
3281 this.param.matColor = 104025f;
3282 this.param.z += roofStyle.snowZ;
3283 this.param.tile = (float)(renderRow.renderData.ConvertTile(renderRow.snowTile) + num20 + (lot.altRoof ? 8 : 0));
3284 renderRow.renderData.Draw(this.param);
3288 this.param.tile += (float)(lot.altRoof ? 8 : 0);
3289 renderRow.renderData.Draw(this.param);
3291 this.param.shadowFix = 0f;
3295 this.param.y += this.roofRampFix.y;
3296 this.param.z += this.roofRampFix.z;
3298 renderRow.SetRenderParam(this.param,
MATERIAL.sourceGold, reverse ? ((num13 == 0) ? 3 : 1) : ((num13 == 0) ? 0 : 2));
3299 this.param.matColor = (float)lot.colBlock;
3300 renderRow.renderData.Draw(this.param);
3304 if (effect !=
null && effect.FireAmount > 0)
3306 this.rendererEffect.Draw(this.param, this.cell.effect.FireAmount);
3310 if (roofStyle.type !=
RoofStyle.Type.Flat)
3312 this.param.snow =
false;
3314 for (
int i = 0; i < num12; i++)
3316 this.param.x = (float)(this.cx + this.cz) * this.screen.tileAlign.x + this.roofFix.x + (float)i * this.roofFix2.x + vector.x * (
float)(reverse ? 1 : -1);
3317 this.param.y = num17 + (float)i * this.roofFix2.y;
3318 this.param.z = num18 + this.param.y * this.screen.tileWeight.z + (float)i * this.roofFix2.z;
3320 renderRow.SetRenderParam(this.param,
MATERIAL.sourceGold, 0);
3321 this.param.matColor = (float)lot.colBlock;
3322 renderRow.renderData.Draw(this.param);
3325 if (effect2 !=
null && effect2.FireAmount > 0 && Rand.bytes[
this.index % Rand.MaxBytes] % 3 == 0)
3327 this.rendererEffect.Draw(this.param, this.cell.effect.FireAmount);
3338 if (roofStyle.type !=
RoofStyle.Type.Flat)
3349 num12 += ((num13 == 0) ? 1 : ((num13 == 1) ? 0 : -1));
3356 public static int GetColorInt(ref Color matColor,
int p)
3362 return p * 262144 + (int)(matColor.r * 50f) * 4096 + (int)(matColor.g * 50f) * 64 + (int)(matColor.b * 50f);
3366 public void SetRoofHeight(
MeshPassParam _param,
Cell _cell,
int _cx,
int _cz,
int h = 0,
int altitude = 0,
int dirWall = -1,
bool ignoreAltitudeY =
false)
3368 Room room = _cell.room;
3369 if (room ==
null && dirWall != -1)
3371 if (dirWall == 0 && _cell.Front.room !=
null)
3373 room = _cell.Front.room;
3374 _cell = _cell.Front;
3376 else if (_cell.Right.room !=
null)
3378 room = _cell.Right.room;
3379 _cell = _cell.Right;
3385 RoofStyle roofStyle = this.roofStyles[lot.idRoofStyle];
3386 float num = (float)(_cz - _cx) * this.screen.tileAlign.y + (float)lot.mh *
this._heightMod.y + lot.realHeight +
this.roofFix.y;
3387 float num2 = 1000f + this.param.x * this.screen.tileWeight.x + (float)lot.mh *
this._heightMod.z + lot.realHeight *
this.roofFix3.z +
this.roofFix.z + roofStyle.posFix.z;
3388 if (lot.height == 1)
3390 num += roofStyle.lowRoofFix.y;
3391 num2 += roofStyle.lowRoofFix.z;
3393 _param.x = (float)(_cx + _cz) * this.screen.tileAlign.x + this.roofFix.x + (float)h * this.roofFix2.x;
3394 _param.y = num + (float)h * this.roofFix2.y;
3395 _param.z = num2 + _param.y * this.screen.tileWeight.z + (float)h * this.roofFix2.z +
this.heightModRoofBlock.y;
3397 if (!ignoreAltitudeY || room !=
null)
3399 _param.y += (float)altitude * this._heightMod.y;
3401 _param.z += (float)altitude * this.heightModRoofBlock.z;
3405 public static bool forceShowHang;
3411 [Header(
"Mouse Hit")]
3412 public Collider2D mouseCollider;
3415 public Vector3 colliderFix;
3418 public int maxColliderCheck;
3422 public float heightBlockSize;
3425 public float slopeFixZ;
3428 public float heightModDeco;
3431 public float heightLimitDeco;
3434 public Vector3 heightMod;
3437 public Vector3 ugFix;
3440 public Vector3 ugFixBridge;
3443 public Vector3 ugFixBridgeBottom;
3446 public Vector3 ugFixBridgeTop;
3449 public Vector3 heightModRoofBlock;
3453 public float rightWallShade;
3456 public Vector3 roofRampFix;
3459 public Vector3 roofFix;
3462 public Vector3 roofFix2;
3465 public Vector3 roofFix3;
3468 public float roofLightMod;
3471 public float lotLight;
3474 public float lotLight2;
3477 public float roofLightSnow;
3481 public BaseTileMap.WallClipMode wallClipMode;
3484 public BaseTileMap.InnerMode defaultInnerMode;
3487 public Vector3 edgeBlockFix;
3490 public Vector3 bridgeFix;
3493 public Vector3 cornerWallFix;
3496 public Vector3 cornerWallFix2;
3499 public Vector3 cornerWallFix3;
3502 public Vector3 altitudeFix;
3505 public Vector3 waterEdgeFix;
3508 public Vector3 waterEdgeBridgeFix;
3511 public Vector3 waterEdgeFixShore;
3514 public Vector3 waterEdgeFixShoreSand;
3517 public Vector3[] ambientShadowFix;
3520 public Vector3[] transitionFix;
3523 public Vector3[] wallHangFix;
3526 public Vector3[] waterEdgeBlockFix;
3532 public float floatSpeed;
3535 public float shadowModStrength;
3538 public int maxFloat;
3541 public int[] seaAnimeIndexes;
3544 [Header(
"References")]
3545 public NoiseLayer layerGroundLights;
3695 protected BaseTileMap.InnerMode innerMode;
3731 public int activeCount;
3735 public int floatV = 1;
3739 public byte[] groundLights;
3743 public bool lowBlock;
3751 public bool highlightArea;
3755 public bool subtleHighlightArea;
3759 public bool hideRoomFog;
3763 public bool showRoof;
3767 public bool showFullWall;
3771 public bool hideHang;
3775 public bool usingHouseBoard;
3779 public bool noRoofMode;
3787 public float[] lightLookUp;
3791 public float _lightMod;
3795 public float _baseBrightness;
3799 public float lowblockTimer;
3803 public float heightLightMod;
3807 public float _rightWallShade;
3811 public float roofLightLimitMod;
3815 public float floatY;
3819 public float floorShadowStrength;
3823 public Vector3 _heightMod;
3827 public BaseTileMap.ScreenHighlight screenHighlight;
3830 protected RaycastHit2D[] rays =
new RaycastHit2D[1];
3833 protected BaseTileMap.CardIconMode iconMode;
3836 protected bool isMining;
3839 protected bool buildMode;
3842 protected bool hasBridge;
3845 protected bool _lowblock;
3848 protected bool isIndoor;
3869 protected int liquidLv;
3872 protected int index;
3875 protected int totalFire;
3878 protected int snowColorToken;
3881 protected int waterAnimeIndex;
3884 protected int lowWallObjAltitude;
3896 protected float blockLight;
3899 protected float floorLight;
3902 protected float floorLight2;
3905 protected float light;
3908 protected float pcMaxLight;
3911 protected float orgX;
3914 protected float orgY;
3917 protected float orgZ;
3920 protected float roomHeight;
3923 protected float maxHeight;
3926 protected float snowLight;
3929 protected float waterAnimeTimer;
3932 protected float floatTimer;
3935 protected float destBrightness;
3938 protected float lightLimit;
3941 protected float modSublight1;
3944 protected float modSublight2;
3947 protected float shadowStrength;
3950 protected float _shadowStrength;
3953 protected float fogBrightness;
3956 protected float defaultBlockHeight;
3959 protected float snowLimit;
3962 protected float snowColor;
3965 protected float snowColor2;
3968 protected float nightRatio;
3977 protected Vector3 _actorPos;
3980 protected Vector3 freePos;
3986 protected int floorMatColor;
3989 protected int height;
3992 protected int currentHeight;
4001 protected int floorDir;
4004 protected bool roof;
4007 protected bool isSeen;
4010 protected bool showAllCards;
4013 protected bool fogBounds;
4016 protected bool snowed;
4019 protected bool isSnowCovered;
4022 protected bool highlightCells;
4025 protected bool cinemaMode;
4028 protected bool alwaysLowblock;
4031 protected bool showBorder;
4034 protected Vector3 thingPos;
4037 protected Vector3 orgPos;
4040 protected Cell cell;
4055 protected Room currentRoom;
4058 protected Room lastRoom;
4061 protected Room room;
4064 protected Lot currentLot;
4076 private bool noSlopMode;
4082 public const int DefColor = 104025;
4085 public const int BlocklightToken = 262144;
4088 public const int BlocklightMTP = 50;
4091 public enum WallClipMode
4100 public enum InnerMode
4113 public enum CardIconMode
4128 public enum ScreenHighlight