Elin Modding Docs Doc
Loading...
Searching...
No Matches
BaseTileMap.cs
1using System;
2using System.Collections.Generic;
3using NoiseSystem;
4using UnityEngine;
5
6// Token: 0x020001AA RID: 426
7public class BaseTileMap : EMono
8{
9 // Token: 0x170002F3 RID: 755
10 // (get) Token: 0x06000C34 RID: 3124 RVA: 0x0004CA17 File Offset: 0x0004AC17
11 public Point HitPoint
12 {
13 get
14 {
15 return Scene.HitPoint;
16 }
17 }
18
19 // Token: 0x06000C35 RID: 3125 RVA: 0x0004CA20 File Offset: 0x0004AC20
20 public void OnActivate(BaseGameScreen _screen)
21 {
22 this.screen = _screen;
23 if (this.lightLookUp == null)
24 {
25 this.lightLookUp = new float[256];
26 for (int i = 0; i < 256; i++)
27 {
28 this.lightLookUp[i] = EMono.scene.profile.global.lightLookupCurve.Evaluate((float)i / 255f);
29 }
30 }
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)
37 {
38 Rand.InitBytes(1);
39 }
40 this.RefreshHeight();
41 }
42
43 // Token: 0x06000C36 RID: 3126 RVA: 0x0004CAEC File Offset: 0x0004ACEC
44 public unsafe virtual void Draw()
45 {
46 Zone zone = EMono._zone;
47 this.map = zone.map;
48 this.Size = this.map.Size;
49 this.SizeXZ = this.map.SizeXZ;
50 this.isIndoor = EMono._map.IsIndoor;
51 this.count = 0;
52 this.totalFire = 0;
53 this.pcX = EMono.pc.pos.x;
54 this.pcZ = EMono.pc.pos.z;
55 float zoom = EMono.scene.camSupport.Zoom;
56 SceneProfile profile = EMono.scene.profile;
57 this.lightSetting = profile.light;
58 this.buildMode = EMono.scene.actionMode.IsBuildMode;
59 if (ActionMode.ViewMap.IsActive)
60 {
61 this.buildMode = false;
62 }
63 this.cinemaMode = ActionMode.Cinema.IsActive;
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)
82 {
83 this.isSnowCovered = !this.isSnowCovered;
84 }
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)
98 {
99 this.destBrightness = num;
100 }
101 if (!Mathf.Approximately(this._baseBrightness, this.destBrightness))
102 {
103 this._baseBrightness = Mathf.Lerp(this._baseBrightness, this.destBrightness, Core.delta * this.lightSetting.dynamicBrightnessSpeed);
104 }
105 if (this.activeCount == 0)
106 {
107 this._baseBrightness = this.destBrightness;
108 }
109 this.activeCount++;
110 if (this.buildMode && EMono.game.config.buildLight)
111 {
112 this._baseBrightness = 0.7f;
113 }
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)
120 {
121 this.floatTimer -= this.floatSpeed;
122 this.floatY += (float)this.floatV;
123 if (this.floatY >= (float)this.maxFloat)
124 {
125 this.floatV *= -1;
126 }
127 if (this.floatY < 0f)
128 {
129 this.floatV *= -1;
130 }
131 }
132 this.waterAnimeTimer += num2;
133 if (this.waterAnimeTimer > 0.5f)
134 {
135 this.waterAnimeTimer = 0f;
136 this.waterAnimeIndex++;
137 }
138 if (this.cinemaMode)
139 {
140 CinemaConfig cinemaConfig = EMono.player.cinemaConfig;
141 profile = ActionMode.Cinema.profile;
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;
149 }
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)
155 {
156 this.currentHeight = (int)EMono.pc.pos.cell.TopHeight;
157 this.currentRoom = EMono.pc.pos.cell.room;
158 }
159 else
160 {
161 this.currentHeight = 0;
162 this.currentRoom = null;
163 }
164 this.lowObj = false;
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)
169 {
170 this.lowBlock = (this.hideRoomFog = (this.hideHang = false));
171 this.showRoof = (this.showFullWall = flag);
172 if (ActionMode.Bird.IsActive)
173 {
174 this.fogBounds = false;
175 }
176 }
177 else if (this.buildMode)
178 {
179 this.defaultBlockHeight = 0f;
180 if (this.HitPoint.IsValid)
181 {
182 this.currentRoom = this.HitPoint.cell.room;
183 }
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;
189 if (this.cinemaMode)
190 {
191 this.hideRoomFog = !this.showRoof;
192 }
193 }
194 else if (ActionMode.IsAdv)
195 {
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))
198 {
199 if (!EMono.pc.IsMoving)
200 {
201 this.lowblockTimer = 0.1f;
202 }
203 }
204 else if (!EInput.rightMouse.pressing)
205 {
206 this.lowblockTimer = 0f;
207 }
208 this.x = EMono.pc.pos.x;
209 this.z = EMono.pc.pos.z;
210 Room room = null;
211 if (room != null)
212 {
213 this.currentRoom = room;
214 }
215 if (this.currentRoom != null)
216 {
217 this.currentRoom.data.visited = true;
218 }
219 if (room != null)
220 {
221 room.data.visited = true;
222 }
223 this.lowBlock = (this.lowblockTimer > 0f);
224 this.hideRoomFog = (this.currentRoom != null && (this.currentRoom.HasRoof || this.isIndoor));
225 if (this.hideRoomFog)
226 {
227 this.lowBlock = true;
228 }
229 if (this.noRoofMode)
230 {
231 this.hideRoomFog = true;
232 this.showRoof = (this.showFullWall = false);
233 }
234 else
235 {
236 this.showRoof = (this.showFullWall = (flag && !this.lowBlock && !this.hideRoomFog));
237 }
238 this.hideHang = this.lowBlock;
239 EMono.game.config.showRoof = !this.hideRoomFog;
240 if (BaseTileMap.forceShowHang)
241 {
242 this.hideHang = false;
243 BaseTileMap.forceShowHang = false;
244 }
245 }
246 else
247 {
248 this.lowBlock = (this.hideRoomFog = (this.hideHang = false));
249 this.showRoof = (this.showFullWall = true);
250 }
251 Room room2 = this.currentRoom;
252 this.currentLot = (((room2 != null) ? room2.lot : null) ?? null);
253 Vector3 mposWorld = EInput.mposWorld;
254 mposWorld.z = 0f;
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--)
261 {
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)
265 {
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)
269 {
270 this.HitPoint.Set(this.TestPoint);
271 break;
272 }
273 }
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)
277 {
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)
281 {
282 this.HitPoint.Set(this.TestPoint);
283 break;
284 }
285 }
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)
289 {
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)
293 {
294 this.HitPoint.Set(this.TestPoint);
295 break;
296 }
297 }
298 }
299 this.HitPoint.Clamp(false);
300 bool flag2 = EMono._zone.UseFog && !EMono.scene.bg.wall;
301 this.z = 0;
302 while (this.z < this.screen.height)
303 {
304 this.x = 0;
305 while (this.x < this.screen.width)
306 {
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)
310 {
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;
323 this.pass.idx++;
324 if (this.pass.idx == this.pass.batchSize)
325 {
326 this.pass.NextBatch();
327 }
328 }
329 else if (this.cx < 0 || this.cz < 0 || this.cx >= this.Size || this.cz >= this.Size)
330 {
331 if (flag2)
332 {
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);
338 }
339 }
340 else
341 {
342 this.DrawTile();
343 }
344 this.x++;
345 }
346 this.z++;
347 }
348 if (this.showRoof)
349 {
350 using (List<Lot>.Enumerator enumerator = this.map.rooms.listLot.GetEnumerator())
351 {
352 while (enumerator.MoveNext())
353 {
354 Lot lot = enumerator.Current;
355 if (lot.sync)
356 {
357 this.DrawRoof(lot);
358 lot.sync = false;
359 lot.light = 0f;
360 }
361 }
362 goto IL_157E;
363 }
364 }
365 foreach (Lot lot2 in this.map.rooms.listLot)
366 {
367 lot2.sync = false;
368 lot2.light = 0f;
369 }
370 IL_157E:
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;
374 int? num3;
375 if (room3 == null)
376 {
377 num3 = null;
378 }
379 else
380 {
381 Lot lot3 = room3.lot;
382 num3 = ((lot3 != null) ? new int?(lot3.idBGM) : null);
383 }
384 int? num4 = num3;
385 int valueOrDefault = num4.GetValueOrDefault();
386 if (valueOrDefault != 0)
387 {
388 if (EMono.Sound.currentPlaylist != EMono.Sound.plLot)
389 {
390 goto IL_1685;
391 }
392 BGMData data = EMono.Sound.plLot.list[0].data;
393 if (data == null || data.id != valueOrDefault)
394 {
395 goto IL_1685;
396 }
397 }
398 if (valueOrDefault != 0 || !(EMono.Sound.currentPlaylist == EMono.Sound.plLot))
399 {
400 goto IL_168F;
401 }
402 IL_1685:
403 EMono._zone.RefreshBGM();
404 IL_168F:
405 if (this.room != this.lastRoom)
406 {
407 this.screen.RefreshWeather();
408 this.lastRoom = this.room;
409 }
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;
412 }
413
414 // Token: 0x06000C37 RID: 3127 RVA: 0x0004E21C File Offset: 0x0004C41C
415 public void RefreshHeight()
416 {
417 if (EMono.game == null)
418 {
419 return;
420 }
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;
426 }
427
428 // Token: 0x06000C38 RID: 3128 RVA: 0x0004E2A8 File Offset: 0x0004C4A8
429 public virtual void DrawTile()
430 {
431 BaseTileMap.<>c__DisplayClass221_0 CS$<>8__locals1 = new BaseTileMap.<>c__DisplayClass221_0();
432 CS$<>8__locals1.<>4__this = this;
433 this.count++;
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)
447 {
448 if (this.cell.IsFloorWater)
449 {
450 this.sourceFloor = FLOOR.sourceIce;
451 this.matFloor = this.cell.matFloor;
452 }
453 else
454 {
455 if (this.cell.sourceObj.snowTile > 0)
456 {
457 this.sourceFloor = FLOOR.sourceSnow2;
458 this.floorDir = this.cell.sourceObj.snowTile - 1;
459 }
460 else if (this.index % 3 == 0 && Rand.bytes[this.index % Rand.MaxBytes] < 8 && !this.cell.HasObj && this.cell.FirstThing == null)
461 {
462 this.sourceFloor = FLOOR.sourceSnow2;
463 this.floorDir = (int)Rand.bytes[this.index % Rand.MaxBytes];
464 }
465 else
466 {
467 this.sourceFloor = FLOOR.sourceSnow;
468 }
469 this.matFloor = MATERIAL.sourceSnow;
470 }
471 }
472 else
473 {
474 this.sourceFloor = this.cell.sourceFloor;
475 this.matFloor = this.cell.matFloor;
476 }
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);
483 if (this.hasBridge)
484 {
485 if ((int)this.cell.bridgeHeight < this.currentHeight)
486 {
487 this.blockLight -= this.heightLightMod * (float)(this.currentHeight - (int)this.cell.bridgeHeight);
488 }
489 if (this.snowed && !this.cell.sourceBridge.ignoreSnow)
490 {
491 if (this.cell.IsBridgeWater)
492 {
493 this.sourceBridge = FLOOR.sourceIce;
494 this.matBridge = this.cell.matBridge;
495 }
496 else
497 {
498 this.sourceBridge = FLOOR.sourceSnow;
499 this.matBridge = MATERIAL.sourceSnow;
500 }
501 }
502 else
503 {
504 this.sourceBridge = this.cell.sourceBridge;
505 this.matBridge = this.cell.matBridge;
506 }
507 }
508 else if (this.height < this.currentHeight)
509 {
510 this.blockLight -= this.heightLightMod * (float)(this.currentHeight - this.height);
511 }
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)
514 {
515 this.liquidLv = (this.param.liquidLv = 20);
516 }
517 if (this.liquidLv > 99)
518 {
519 this.liquidLv = (this.param.liquidLv = 99);
520 }
521 CellEffect effect = this.cell.effect;
522 if (effect != null && effect.IsFire)
523 {
524 this.blockLight += 0.2f;
525 this.totalFire++;
526 }
527 if (this.blockLight > this.lightLimit)
528 {
529 this.blockLight = this.lightLimit;
530 }
531 this.blockLight += this.shadowModStrength * (float)this.cell.shadowMod * this._heightMod.x * this._shadowStrength;
532 if (this.room != null)
533 {
534 this.room.lot.sync = true;
535 if (this.room.lot.light < this.blockLight)
536 {
537 this.room.lot.light = this.blockLight;
538 }
539 }
540 if (this.currentLot != null && this.currentLot.idRoofStyle != 0)
541 {
542 bool flag2;
543 if (this.cell.IsRoomEdge)
544 {
545 Room room = this.cell.Front.room;
546 if (((room != null) ? room.lot : null) != this.currentLot)
547 {
548 Room room2 = this.cell.Right.room;
549 if (((room2 != null) ? room2.lot : null) != this.currentLot)
550 {
551 Room room3 = this.cell.FrontRight.room;
552 flag2 = (((room3 != null) ? room3.lot : null) == this.currentLot);
553 goto IL_625;
554 }
555 }
556 flag2 = true;
557 }
558 else
559 {
560 flag2 = false;
561 }
562 IL_625:
563 bool flag3 = flag2;
564 if (!this.buildMode)
565 {
566 if ((this.room != null && this.room.lot == this.currentLot) || flag3)
567 {
568 this.blockLight += this.lotLight;
569 }
570 else
571 {
572 this.blockLight += (this.isSnowCovered ? -0.02f : this.lotLight2);
573 }
574 }
575 }
576 if (this.cell.outOfBounds && !this.cinemaMode)
577 {
578 this.blockLight -= 0.1f;
579 if (this.fogBounds)
580 {
581 this.isSeen = false;
582 }
583 }
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)));
586 if (this.snowed)
587 {
588 this.floorLight += this.snowLight;
589 if (this.floorLight > this.lightLimit * this.snowLimit)
590 {
591 this.floorLight = this.lightLimit * this.snowLimit;
592 }
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);
594 }
595 else if (this.isSnowCovered && !this.roof)
596 {
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);
598 }
599 else
600 {
601 this.floorLight = this.blockLight;
602 }
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)
606 {
607 flag5 = false;
608 }
609 if (flag4 || !this.isSeen || flag5)
610 {
611 this.floorLight += -3145728f;
612 }
613 if (this.cell.isWatered && !this.snowed)
614 {
615 this.floorLight += -2359296f;
616 }
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;
621 if (flag)
622 {
623 this.param.y += 0.01f * this.floatY;
624 }
625 if (this.detail != null)
626 {
627 TransAnime anime = this.detail.anime;
628 if (anime != null && anime.animeBlock)
629 {
630 TransAnime anime2 = this.detail.anime;
631 this.param.x += anime2.v.x;
632 this.param.y += anime2.v.y;
633 this.param.z += anime2.v.z;
634 }
635 if (this.detail.designation != null)
636 {
637 this.detail.designation.Draw(this.cx, this.cz, this.param);
638 }
639 }
640 if (this.screenHighlight != BaseTileMap.ScreenHighlight.None && this.screenHighlight == BaseTileMap.ScreenHighlight.SunMap && Map.sunMap.Contains(this.index))
641 {
642 this.screen.guide.passGuideFloor.Add(this.param.x, this.param.y, this.param.z - 10f, 11f, 0f);
643 }
644 if (this.cell._roofBlock != 0 && (this.isSeen || !EMono._zone.UseFog) && this.showRoof && !this.lowBlock)
645 {
646 SourceBlock.Row row = Cell.blockList[(int)this.cell._roofBlock];
647 SourceMaterial.Row row2 = Cell.matList[(int)this.cell._roofBlockMat];
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)
657 {
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);
663 break;
664 case BlockRenderMode.WallOrFence:
665 {
666 this._lowblock = true;
667 int dir = this.param.dir;
668 if (dir == 0 || dir == 2)
669 {
670 this.param.dir = 0;
671 this._sourceBlock = row;
672 this.tileType = this._sourceBlock.tileType;
673 if (this._sourceBlock.useAltColor)
674 {
675 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
676 }
677 else
678 {
679 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
680 }
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;
684 }
685 if (dir == 1 || dir == 2)
686 {
687 this.param.dir = 1;
688 this._sourceBlock = row;
689 this.tileType = this._sourceBlock.tileType;
690 if (this._sourceBlock.useAltColor)
691 {
692 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
693 }
694 else
695 {
696 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
697 }
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);
700 }
701 break;
702 }
703 case BlockRenderMode.Pillar:
704 {
705 RenderData renderData = row.renderData;
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);
713 break;
714 }
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);
722 break;
723 default:
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);
727 break;
728 }
729 this.param.x = this.orgX;
730 this.param.y = this.orgY;
731 this.param.z = this.orgZ;
732 this.param.color = this.blockLight;
733 }
734 this.fogged = false;
735 bool flag6 = this.cell.isSurrounded && this.innerMode != BaseTileMap.InnerMode.None && this.sourceBlock.tileType.IsFullBlock;
736 if (!this.isSeen || flag6)
737 {
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;
743 if (this.hasBridge)
744 {
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;
747 }
748 bool flag7 = (!this.isSeen && EMono._zone.UseFog) || flag6;
749 if (flag7)
750 {
751 this.param.tile = 7f;
752 this.rendererFogFloorSolid.Draw(this.param);
753 this.param.tile = 0f;
754 this.rendererFov2.Draw(this.param);
755 }
756 else if (this.cell.HasFloodBlock && isRoomEdge)
757 {
758 this.param.tile = 9f;
759 this.rendererFogRoomWallSolid.Draw(this.param);
760 }
761 else
762 {
763 this.param.tile = 8f;
764 this.rendererFogRoomSolid.Draw(this.param);
765 }
766 if ((this.cell.isSlopeEdge || this.hasBridge) && (flag7 || !isRoomEdge))
767 {
768 float num = (float)this.cell.TopHeight * this._heightMod.y;
769 this.param.tile = 0f;
770 int num2 = 0;
771 while ((float)num2 < num / this.heightBlockSize)
772 {
773 this.param.y += this.ugFix.y;
774 this.param.z += this.ugFix.z + this.slopeFixZ * (float)num2;
775 if (flag7)
776 {
777 this.rendererFogBlockSolid.Draw(this.param);
778 }
779 else
780 {
781 this.rendererFogRoomBlockSolid.Draw(this.param);
782 }
783 num2++;
784 }
785 }
786 this.param.y = this.orgY;
787 this.param.z = this.orgZ;
788 this.param.color = this.blockLight;
789 if (flag7)
790 {
791 if (this.detail == null || !EMono.pc.hasTelepathy)
792 {
793 return;
794 }
795 goto IL_7A31;
796 }
797 else if (!isRoomEdge)
798 {
799 if (this.detail != null && EMono.pc.hasTelepathy)
800 {
801 goto IL_7A31;
802 }
803 if (this.noRoofMode || this.detail == null)
804 {
805 return;
806 }
807 this.fogged = true;
808 goto IL_7A31;
809 }
810 }
811 if (this.cell.isSlopeEdge)
812 {
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;
817 if (this.snowed)
818 {
819 this.param.color = this.floorLight;
820 }
821 SourceBlock.Row defBlock;
822 if (this.sourceBlock.tileType.IsFullBlock)
823 {
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));
828 }
829 else
830 {
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)
835 {
836 this.param.matColor = (float)((this.sourceFloor.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matFloor.matColor, this.sourceFloor.colorMod));
837 }
838 else
839 {
840 this.param.matColor = 104025f;
841 }
842 }
843 int num4 = 0;
844 while ((float)num4 < num3 / this.heightBlockSize)
845 {
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)
850 {
851 float num5 = this.param.tile;
852 this.param.tile = 0f;
853 this.rendererFov.Draw(this.param);
854 this.param.tile = num5;
855 }
856 num4++;
857 }
858 this.param.y = this.orgY;
859 this.param.z = this.orgZ;
860 }
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)
863 {
864 this.orgY = this.param.y;
865 this.orgZ = this.param.z;
866 int num6;
867 if (this.sourceBlock.tileType.IsFullBlock)
868 {
869 SourceBlock.Row defBlock2 = this.sourceBlock;
870 num6 = this.sourceBlock._tiles[this.cell.blockDir % this.sourceBlock._tiles.Length];
871 }
872 else
873 {
874 SourceBlock.Row defBlock2 = this.sourceFloor._defBlock;
875 num6 = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
876 }
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)
878 {
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);
883 }
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)
885 {
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);
890 }
891 this.param.y = this.orgY;
892 this.param.z = this.orgZ;
893 }
894 if (this.showBorder && !this.cell.outOfBounds)
895 {
896 this.param.matColor = 104025f;
897 if (this.cx == EMono._map.bounds.x)
898 {
899 this.renderBorder.Draw(this.param, 12 + (EMono.world.date.IsNight ? 4 : 0));
900 }
901 else if (this.cx == EMono._map.bounds.maxX)
902 {
903 this.renderBorder.Draw(this.param, 13 + (EMono.world.date.IsNight ? 4 : 0));
904 }
905 if (this.cz == EMono._map.bounds.z)
906 {
907 this.renderBorder.Draw(this.param, 14 + (EMono.world.date.IsNight ? 4 : 0));
908 }
909 else if (this.cz == EMono._map.bounds.maxZ)
910 {
911 this.renderBorder.Draw(this.param, 15 + (EMono.world.date.IsNight ? 4 : 0));
912 }
913 }
914 if (this.cell.isSkyFloor || (this.detail != null && this.detail.anime != null && this.detail.anime.drawBlock))
915 {
916 this.orgY = this.param.y;
917 this.orgZ = this.param.z;
918 SourceBlock.Row defBlock3 = this.sourceFloor._defBlock;
919 this.param.mat = this.matFloor;
920 this.param.tile = (float)defBlock3._tiles[this.cell.blockDir % defBlock3._tiles.Length];
921 if (defBlock3.id != 1)
922 {
923 this.param.matColor = (float)((this.sourceFloor.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matFloor.matColor, this.sourceFloor.colorMod));
924 }
925 else
926 {
927 this.param.matColor = 104025f;
928 }
929 for (int i = 0; i < (this.cell.isSkyFloor ? EMono._map.config.skyBlockHeight : 1); i++)
930 {
931 this.param.y += this.ugFix.y;
932 this.param.z += this.ugFix.z + this.slopeFixZ * (float)i;
933 defBlock3.renderData.Draw(this.param);
934 }
935 this.param.y = this.orgY;
936 this.param.z = this.orgZ;
937 }
938 if (!this.sourceFloor.tileType.IsSkipFloor)
939 {
940 if ((this.hasBridge && this.sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
941 {
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))));
943 if (this.snowed)
944 {
945 this.floorLight2 = (float)((int)((double)this.floorLight2 * 0.85 * 50.0) * 262144 + this.snowColorToken);
946 }
947 else
948 {
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));
950 }
951 this.param.color = this.floorLight2;
952 if (this.cell.lotShade)
953 {
954 this.floorLight = this.floorLight2;
955 }
956 }
957 this.floorMatColor = ((this.sourceFloor.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.matFloor.matColor, this.sourceFloor.colorMod));
958 if (isWater && flag)
959 {
960 this.param.y -= 0.01f * this.floatY;
961 }
962 if (!this.sourceBlock.tileType.IsSkipFloor || this.sourceBlock.transparent || this.hasBridge || this.cell.hasDoor || this.cell.skipRender)
963 {
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)
969 {
970 this.param.z += 1f;
971 if (this.sourceFloor.renderData.subData)
972 {
973 this.sourceFloor.renderData.subData.Draw(this.param);
974 }
975 this.sourceFloor.renderData.Draw(this.param);
976 this.param.z -= 1f;
977 }
978 else
979 {
980 if (this.sourceFloor.renderData.subData)
981 {
982 this.sourceFloor.renderData.subData.Draw(this.param);
983 }
984 this.sourceFloor.renderData.Draw(this.param);
985 }
986 int num7 = 0;
987 if (this.isSnowCovered && this.sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
988 {
989 if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
990 {
991 num7++;
992 }
993 if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
994 {
995 num7 += 2;
996 }
997 if (num7 != 0)
998 {
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;
1003 }
1004 }
1005 if (this.cell.shadow != 0 && !this.hasBridge && !this.cell.skipRender)
1006 {
1007 if (this.snowed)
1008 {
1009 if (this.sourceFloor == FLOOR.sourceSnow)
1010 {
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);
1014 }
1015 }
1016 else
1017 {
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;
1026 this.pass.idx++;
1027 if (this.pass.idx == this.pass.batchSize)
1028 {
1029 this.pass.NextBatch();
1030 }
1031 }
1032 if (!this.sourceFloor.ignoreTransition && !this.snowed)
1033 {
1034 Cell cell = this.cell.Back;
1035 if (cell.sourceBlock.transition[0] != -1 && cell.isSeen && !cell.hasDoor)
1036 {
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);
1045 this.pass.idx++;
1046 if (this.pass.idx == this.pass.batchSize)
1047 {
1048 this.pass.NextBatch();
1049 }
1050 }
1051 cell = this.cell.Left;
1052 if (cell.sourceBlock.transition[0] != -1 && cell.isSeen && !cell.hasDoor)
1053 {
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);
1062 this.pass.idx++;
1063 if (this.pass.idx == this.pass.batchSize)
1064 {
1065 this.pass.NextBatch();
1066 }
1067 }
1068 }
1069 }
1070 if (this.cell.autotile != 0 && this.sourceFloor.autotile != 0 && (!this.hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num7 == 0)
1071 {
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;
1080 this.pass.idx++;
1081 if (this.pass.idx == this.pass.batchSize)
1082 {
1083 this.pass.NextBatch();
1084 }
1085 }
1086 }
1087 if (isWater)
1088 {
1089 int num8 = 12;
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)
1094 {
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)
1097 {
1098 cell2 = (((num9 & 8) != 0) ? this.cell.Left : (((num9 & 4) != 0) ? this.cell.Front : (((num9 & 2) != 0) ? this.cell.Right : this.cell.Back)));
1099 }
1100 if (!cell2.IsSnowTile)
1101 {
1102 this.param.matColor = (float)BaseTileMap.GetColorInt(ref cell2.matFloor.matColor, cell2.sourceFloor.colorMod);
1103 if (isShoreSand)
1104 {
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;
1113 this.pass.idx++;
1114 if (this.pass.idx == this.pass.batchSize)
1115 {
1116 this.pass.NextBatch();
1117 }
1118 num10 = 2;
1119 }
1120 else
1121 {
1122 num10 = cell2.sourceFloor.edge;
1123 }
1124 this.param.tile = (float)((24 + num10 / 2) * 32 + num10 % 2 * 16 + num9);
1125 this.rendererShore.Draw(this.param);
1126 }
1127 }
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)
1129 {
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);
1134 }
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)
1136 {
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);
1141 }
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)
1143 {
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);
1148 }
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)
1150 {
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);
1155 }
1156 if (this.cell._bridge != 0 && this.cell.isBridgeEdge && this.cell.bridgePillar != 255)
1157 {
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;
1166 this.pass.idx++;
1167 if (this.pass.idx == this.pass.batchSize)
1168 {
1169 this.pass.NextBatch();
1170 }
1171 }
1172 bool flag8 = false;
1173 if (isShoreSand)
1174 {
1175 if ((num9 & 1) != 0)
1176 {
1177 if ((num9 & 8) != 0)
1178 {
1179 CS$<>8__locals1.<DrawTile>g__Draw|0(16);
1180 flag8 = true;
1181 }
1182 if ((num9 & 2) != 0)
1183 {
1184 CS$<>8__locals1.<DrawTile>g__Draw|0(20);
1185 flag8 = true;
1186 }
1187 }
1188 if ((num9 & 4) != 0)
1189 {
1190 if ((num9 & 8) != 0)
1191 {
1192 CS$<>8__locals1.<DrawTile>g__Draw|0(24);
1193 flag8 = true;
1194 }
1195 if ((num9 & 2) != 0)
1196 {
1197 CS$<>8__locals1.<DrawTile>g__Draw|0(28);
1198 flag8 = true;
1199 }
1200 }
1201 if (!flag8)
1202 {
1203 if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
1204 {
1205 CS$<>8__locals1.<DrawTile>g__Draw|0(8);
1206 }
1207 if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
1208 {
1209 CS$<>8__locals1.<DrawTile>g__Draw|0(12);
1210 }
1211 }
1212 }
1213 if (!flag8)
1214 {
1215 if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
1216 {
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)
1222 {
1223 if (isShoreSand)
1224 {
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;
1231 }
1232 else
1233 {
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;
1237 }
1238 }
1239 else
1240 {
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;
1245 }
1246 this.batch.colors[this.pass.idx] = this.param.color;
1247 this.pass.idx++;
1248 if (this.pass.idx == this.pass.batchSize)
1249 {
1250 this.pass.NextBatch();
1251 }
1252 }
1253 if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
1254 {
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)
1260 {
1261 if (isShoreSand)
1262 {
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;
1269 }
1270 else
1271 {
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;
1275 }
1276 }
1277 else
1278 {
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;
1283 }
1284 this.batch.colors[this.pass.idx] = this.param.color;
1285 this.pass.idx++;
1286 if (this.pass.idx == this.pass.batchSize)
1287 {
1288 this.pass.NextBatch();
1289 }
1290 }
1291 }
1292 if (flag)
1293 {
1294 this.param.y += 0.01f * this.floatY;
1295 }
1296 }
1297 if (flag)
1298 {
1299 this.param.z -= 1f;
1300 }
1301 }
1302 if (this.cell.skipRender)
1303 {
1304 if (this.cell.pcSync)
1305 {
1306 this.param.tile = 0f;
1307 this.rendererFov.Draw(this.param);
1308 }
1309 return;
1310 }
1311 if (this.hasBridge)
1312 {
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;
1315 if (flag)
1316 {
1317 this.param.y += 0.01f * this.floatY;
1318 }
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)
1327 {
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;
1336 this.pass.idx++;
1337 if (this.pass.idx == this.pass.batchSize)
1338 {
1339 this.pass.NextBatch();
1340 }
1341 }
1342 if (this.cell.shadow != 0)
1343 {
1344 if (this.sourceBridge == FLOOR.sourceSnow)
1345 {
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);
1349 }
1350 else
1351 {
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;
1360 this.pass.idx++;
1361 if (this.pass.idx == this.pass.batchSize)
1362 {
1363 this.pass.NextBatch();
1364 }
1365 }
1366 }
1367 if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != 255 && !this.noSlopMode)
1368 {
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;
1373 this.param.dir = 0;
1374 SourceBlock.Row row3 = this.sourceBridge._bridgeBlock;
1375 float num11 = (float)(this.cell.bridgeHeight - this.cell.height) * this._heightMod.y;
1376 if (this.cell.sourceFloor.tileType == TileType.Sky)
1377 {
1378 num11 += (float)EMono._map.config.skyBlockHeight;
1379 }
1380 int num12 = (int)(num11 / this.heightBlockSize) + 2;
1381 if (this.cell.bridgePillar != 0)
1382 {
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));
1387 }
1388 else
1389 {
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));
1393 }
1394 this.param.y += this.ugFixBridgeTop.y;
1395 this.param.z += this.ugFixBridgeTop.z;
1396 for (int j = 0; j < num12; j++)
1397 {
1398 if (j == num12 - 1)
1399 {
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;
1402 }
1403 else
1404 {
1405 this.param.y += this.ugFixBridge.y;
1406 this.param.z += this.ugFixBridge.z;
1407 }
1408 row3.renderData.Draw(this.param);
1409 }
1410 this.param.y = this.orgY;
1411 this.param.z = this.orgZ;
1412 }
1413 }
1414 if (!this.buildMode && this.cell.highlight != 0)
1415 {
1416 if (this.cell._block != 0)
1417 {
1418 this.screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, true, 0f);
1419 }
1420 else
1421 {
1422 this.passGuideFloor.Add(this.cell.GetPoint(), (float)this.cell.highlight, 0f);
1423 }
1424 }
1425 this.param.color = this.blockLight;
1426 if (this.isSnowCovered && (this.sourceBlock.id != 0 || this.cell.hasDoor))
1427 {
1428 if (this.snowed || this.cell.isClearSnow)
1429 {
1430 if (this.cell.Front.HasRoof || this.cell.Right.HasRoof)
1431 {
1432 this.snowed = false;
1433 }
1434 }
1435 else if ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock))
1436 {
1437 this.snowed = true;
1438 }
1439 }
1440 int num13 = 0;
1441 if (this.sourceBlock.id != 0)
1442 {
1443 this.tileType = this.sourceBlock.tileType;
1444 this.roomHeight = 0f;
1445 int blockDir = this.cell.blockDir;
1446 bool flag9 = false;
1447 BaseTileMap.WallClipMode wallClipMode = this.wallClipMode;
1448 if (wallClipMode != BaseTileMap.WallClipMode.ByRoom)
1449 {
1450 if (wallClipMode == BaseTileMap.WallClipMode.ByLot)
1451 {
1452 if (this.defaultBlockHeight > 0f || this.isIndoor)
1453 {
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)
1456 {
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;
1459 }
1460 }
1461 else
1462 {
1463 if (this.showFullWall)
1464 {
1465 this._lowblock = (this.room != null);
1466 if (this._lowblock)
1467 {
1468 if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null)
1469 {
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))
1474 {
1475 this._lowblock = false;
1476 }
1477 }
1478 }
1479 else if (this.cell.Back.room != null)
1480 {
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))
1484 {
1485 this._lowblock = true;
1486 }
1487 }
1488 }
1489 else
1490 {
1491 this._lowblock = this.lowBlock;
1492 }
1493 if (this.tileType.RepeatBlock)
1494 {
1495 Room room7;
1496 if ((room7 = this.room) == null && (room7 = this.cell.Front.room) == null)
1497 {
1498 room7 = (this.cell.Right.room ?? this.cell.FrontRight.room);
1499 }
1500 this.room = room7;
1501 if (this.room != null && !this.noRoofMode && (!this.showFullWall || this.currentRoom == null || this.room.lot == this.currentRoom.lot))
1502 {
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;
1505 }
1506 }
1507 }
1508 }
1509 }
1510 else if (this.tileType.RepeatBlock)
1511 {
1512 if (this.currentRoom == null || this.showFullWall)
1513 {
1514 Room room8;
1515 if ((room8 = this.room) == null && (room8 = this.cell.Front.room) == null)
1516 {
1517 room8 = (this.cell.Right.room ?? this.cell.FrontRight.room);
1518 }
1519 this.room = room8;
1520 this._lowblock = this.lowBlock;
1521 }
1522 else
1523 {
1524 if (this.room != this.cell.Front.room)
1525 {
1526 if (this.cell.Front.room != this.currentRoom)
1527 {
1528 Room room9 = this.room;
1529 if (((room9 != null) ? room9.lot : null) == this.currentLot)
1530 {
1531 goto IL_484C;
1532 }
1533 Room room10 = this.cell.Front.room;
1534 if (((room10 != null) ? room10.lot : null) != this.currentLot)
1535 {
1536 goto IL_484C;
1537 }
1538 }
1539 this.room = this.cell.Front.room;
1540 this._lowblock = (!this.cell.Front.lotWall && !this.cell.Front.fullWall);
1541 goto IL_4A64;
1542 }
1543 IL_484C:
1544 if (this.room != this.cell.Right.room)
1545 {
1546 if (this.cell.Right.room != this.currentRoom)
1547 {
1548 Room room11 = this.room;
1549 if (((room11 != null) ? room11.lot : null) == this.currentLot)
1550 {
1551 goto IL_4906;
1552 }
1553 Room room12 = this.cell.Right.room;
1554 if (((room12 != null) ? room12.lot : null) != this.currentLot)
1555 {
1556 goto IL_4906;
1557 }
1558 }
1559 this.room = this.cell.Right.room;
1560 this._lowblock = (!this.cell.Right.lotWall && !this.cell.Right.fullWall);
1561 goto IL_4A64;
1562 }
1563 IL_4906:
1564 if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room)
1565 {
1566 if (this.cell.FrontRight.room != this.currentRoom)
1567 {
1568 Room room13 = this.room;
1569 if (((room13 != null) ? room13.lot : null) == this.currentLot)
1570 {
1571 goto IL_49D0;
1572 }
1573 Room room14 = this.cell.FrontRight.room;
1574 if (((room14 != null) ? room14.lot : null) != this.currentLot)
1575 {
1576 goto IL_49D0;
1577 }
1578 }
1579 this.room = this.cell.FrontRight.room;
1580 this._lowblock = (!this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall);
1581 goto IL_4A64;
1582 }
1583 IL_49D0:
1584 Room room15;
1585 if ((room15 = this.room) == null && (room15 = this.cell.Front.room) == null)
1586 {
1587 room15 = (this.cell.Right.room ?? this.cell.FrontRight.room);
1588 }
1589 this.room = room15;
1590 this._lowblock = true;
1591 if (!this.tileType.IsFullBlock)
1592 {
1593 if (this.cell.lotWall)
1594 {
1595 this._lowblock = false;
1596 }
1597 else if (this.room == this.currentRoom)
1598 {
1599 this._lowblock = !this.cell.fullWall;
1600 }
1601 }
1602 }
1603 IL_4A64:
1604 flag9 = ((this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium));
1605 if (flag9)
1606 {
1607 this._lowblock = false;
1608 }
1609 if (this.room == null && this.alwaysLowblock)
1610 {
1611 this._lowblock = true;
1612 this.roomHeight = 0f;
1613 }
1614 if (this.room != null)
1615 {
1616 this.maxHeight = (float)(this.cz - this.cx) * this.screen.tileAlign.y + (float)this.room.lot.mh * this._heightMod.y;
1617 if (this.showRoof)
1618 {
1619 this.roomHeight = this.room.lot.realHeight;
1620 }
1621 else if (this.noRoofMode || (this._lowblock && !this.tileType.ForceRpeatBlock))
1622 {
1623 this.roomHeight = 0f;
1624 }
1625 else
1626 {
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;
1629 }
1630 }
1631 }
1632 if (!this._lowblock && (double)this.roomHeight > 1.2 && this.tileType.RepeatBlock)
1633 {
1634 num13 = 1;
1635 }
1636 else if (this.lowBlock)
1637 {
1638 num13 = 2;
1639 }
1640 this.param.mat = this.matBlock;
1641 this.param.dir = this.cell.blockDir;
1642 this.param.snow = this.snowed;
1643 switch (this.tileType.blockRenderMode)
1644 {
1645 case BlockRenderMode.FullBlock:
1646 {
1647 bool invisible = this.sourceBlock.tileType.Invisible;
1648 if (!invisible || this.buildMode || ActionMode.Cinema.IsActive)
1649 {
1650 if (this.cell.isSurrounded)
1651 {
1652 switch (this.innerMode)
1653 {
1654 case BaseTileMap.InnerMode.None:
1655 case BaseTileMap.InnerMode.Height:
1656 this.param.color = this.blockLight;
1657 break;
1658 case BaseTileMap.InnerMode.InnerBlock:
1659 case BaseTileMap.InnerMode.BuildMode:
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);
1665 return;
1666 }
1667 }
1668 if (this.snowed)
1669 {
1670 this.param.color = this.floorLight;
1671 }
1672 this.param.color -= (float)((int)(this._shadowStrength * 0.8f * 50f) * 262144);
1673 if (this.currentRoom != null && !this.showFullWall)
1674 {
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))
1678 {
1679 this._lowblock = false;
1680 }
1681 if (!this._lowblock)
1682 {
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;
1685 }
1686 }
1687 if (flag9)
1688 {
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));
1690 if (this._lowblock)
1691 {
1692 this.roomHeight = 0f;
1693 }
1694 }
1695 if (invisible)
1696 {
1697 this.roomHeight = 0f;
1698 this._lowblock = false;
1699 }
1700 if (this.cell.Things.Count > 0)
1701 {
1702 this._lowblock = false;
1703 }
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)
1707 {
1708 if (!this.cell.hasDoor)
1709 {
1710 this.sourceBlock.renderData.Draw(this.param);
1711 }
1712 }
1713 else
1714 {
1715 RenderData renderData2 = this.sourceBlock.renderData;
1716 RenderParam p = this.param;
1717 float maxY = this.maxHeight;
1718 float num16 = this.roomHeight;
1719 GameSetting.RenderSetting renderSetting = this.renderSetting;
1720 bool hasDoor = this.cell.hasDoor;
1721 CellEffect effect2 = this.cell.effect;
1722 renderData2.DrawRepeatTo(p, maxY, num16, ref renderSetting.peakFixBlock, hasDoor, (effect2 != null) ? effect2.FireAmount : 0, true);
1723 }
1724 Room room16 = this.cell.Front.room ?? this.cell.room;
1725 if (room16 == null && this.cell.Right.room != null)
1726 {
1727 room16 = this.cell.Right.room;
1728 }
1729 if (!invisible && room16 != null)
1730 {
1731 if (room16.lot.idDeco != 0 && !this.cell.hasDoor)
1732 {
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);
1738 this.param.y = y;
1739 }
1740 if (room16.lot.idDeco2 != 0 && this.roomHeight != 0f && (float)room16.lot.decoFix2 * 0.01f + this.heightLimitDeco < this.roomHeight + this.maxHeight - this.param.y)
1741 {
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);
1749 this.param.y = y2;
1750 this.param.z = num17;
1751 }
1752 }
1753 room16 = (this.cell.Right.room ?? this.cell.room);
1754 if (room16 == null && this.cell.Front.room != null)
1755 {
1756 room16 = this.cell.Front.room;
1757 }
1758 if (!invisible && room16 != null)
1759 {
1760 if (room16.lot.idDeco != 0 && !this.cell.hasDoor)
1761 {
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);
1767 this.param.y = y3;
1768 }
1769 if (room16.lot.idDeco2 != 0 && this.roomHeight != 0f && (float)room16.lot.decoFix2 * 0.01f + this.heightLimitDeco < this.roomHeight + this.maxHeight - this.param.y)
1770 {
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);
1778 this.param.y = y4;
1779 this.param.z = num18;
1780 }
1781 }
1782 }
1783 break;
1784 }
1785 case BlockRenderMode.WallOrFence:
1786 {
1787 if (this.map.config.fullWallHeight)
1788 {
1789 this.showFullWall = true;
1790 this._lowblock = false;
1791 }
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)
1798 {
1799 if (!flag10)
1800 {
1801 if (this.currentRoom != this.cell.room)
1802 {
1803 if (this.cell.lotWall)
1804 {
1805 Room room17 = this.cell.room;
1806 if (((room17 != null) ? room17.lot : null) == this.currentLot && this.cell.Front.room != this.currentRoom)
1807 {
1808 goto IL_5A36;
1809 }
1810 }
1811 if (this.cell.Front.lotWall)
1812 {
1813 Room room18 = this.cell.Front.room;
1814 if (((room18 != null) ? room18.lot : null) == this.currentLot)
1815 {
1816 goto IL_5AD3;
1817 }
1818 }
1819 if (this.cell.Front.room != this.currentRoom)
1820 {
1821 flag10 = true;
1822 goto IL_5AD3;
1823 }
1824 goto IL_5AD3;
1825 }
1826 IL_5A36:
1827 if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
1828 {
1829 flag10 = true;
1830 }
1831 }
1832 IL_5AD3:
1833 if (!flag11)
1834 {
1835 if (this.currentRoom != this.cell.room)
1836 {
1837 if (this.cell.lotWall)
1838 {
1839 Room room19 = this.cell.room;
1840 if (((room19 != null) ? room19.lot : null) == this.currentLot && this.cell.Right.room != this.currentRoom)
1841 {
1842 goto IL_5B34;
1843 }
1844 }
1845 if (this.cell.Right.lotWall)
1846 {
1847 Room room20 = this.cell.Right.room;
1848 if (((room20 != null) ? room20.lot : null) == this.currentLot)
1849 {
1850 goto IL_5BD1;
1851 }
1852 }
1853 if (this.cell.Right.room != this.currentRoom)
1854 {
1855 flag11 = true;
1856 goto IL_5BD1;
1857 }
1858 goto IL_5BD1;
1859 }
1860 IL_5B34:
1861 if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
1862 {
1863 flag11 = true;
1864 }
1865 }
1866 }
1867 IL_5BD1:
1868 if (blockDir == 0 || blockDir == 2)
1869 {
1870 this.param.dir = 0;
1871 Room room21 = this.cell.Front.room ?? this.cell.room;
1872 if (room21 != null && this.tileType.IsWall)
1873 {
1874 if (room21.lot.idDeco != 0 && !this.cell.hasDoor)
1875 {
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;
1881 }
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)
1883 {
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;
1891 }
1892 }
1893 Cell left = this.cell.Left;
1894 if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence)
1895 {
1896 this._sourceBlock = left.sourceBlock;
1897 this.param.mat = left.matBlock;
1898 }
1899 else
1900 {
1901 this._sourceBlock = this.sourceBlock;
1902 this.param.mat = this.matBlock;
1903 }
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)
1907 {
1908 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
1909 }
1910 else
1911 {
1912 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
1913 }
1914 if (this.roomHeight == 0f || flag10)
1915 {
1916 if (!this.cell.hasDoor)
1917 {
1918 this._sourceBlock.renderData.Draw(this.param);
1919 }
1920 }
1921 else
1922 {
1923 RenderData renderData3 = this._sourceBlock.renderData;
1924 RenderParam p2 = this.param;
1925 float maxY2 = this.maxHeight;
1926 float num19 = this.roomHeight;
1927 GameSetting.RenderSetting renderSetting2 = this.renderSetting;
1928 bool hasDoor2 = this.cell.hasDoor;
1929 CellEffect effect3 = this.cell.effect;
1930 renderData3.DrawRepeatTo(p2, maxY2, num19, ref renderSetting2.peakFix, hasDoor2, (effect3 != null) ? effect3.FireAmount : 0, false);
1931 }
1932 this.param.z += this.cornerWallFix2.z;
1933 if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
1934 {
1935 if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
1936 {
1937 this.param.snow = true;
1938 }
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))
1941 {
1942 this._sourceBlock.renderData.Draw(this.param);
1943 }
1944 else
1945 {
1946 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFix, false, 0, false);
1947 }
1948 }
1949 if (!flag10 && !this.showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.isToggleWallPillar)
1950 {
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))
1957 {
1958 this._sourceBlock.renderData.Draw(this.param);
1959 }
1960 else
1961 {
1962 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight + this.cornerWallFix.y, ref this.renderSetting.peakFix, false, 0, false);
1963 }
1964 this.param.x = this.orgX;
1965 }
1966 else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag10 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
1967 {
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))
1974 {
1975 this._sourceBlock.renderData.Draw(this.param);
1976 }
1977 else
1978 {
1979 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight + this.cornerWallFix.y, ref this.renderSetting.peakFix, false, 0, false);
1980 }
1981 this.param.x = this.orgX;
1982 }
1983 }
1984 if (blockDir == 1 || blockDir == 2)
1985 {
1986 this.param.y = this.orgY;
1987 this.param.z = this.orgZ;
1988 this.param.dir = 1;
1989 Room room22 = this.cell.Right.room ?? this.cell.room;
1990 if (room22 != null && this.tileType.IsWall)
1991 {
1992 if (room22.lot.idDeco != 0 && !this.cell.hasDoor)
1993 {
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;
1999 }
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)
2001 {
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;
2009 }
2010 }
2011 if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
2012 {
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;
2015 if (this.showRoof)
2016 {
2017 this.roomHeight = room23.lot.realHeight;
2018 }
2019 else if (this.noRoofMode || (this._lowblock && !this.tileType.ForceRpeatBlock))
2020 {
2021 this.roomHeight = 0f;
2022 }
2023 else
2024 {
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;
2027 }
2028 }
2029 Cell back = this.cell.Back;
2030 if (blockDir == 2 && back.sourceBlock.tileType.IsWallOrFence)
2031 {
2032 this._sourceBlock = back.sourceBlock;
2033 this.param.mat = back.matBlock;
2034 }
2035 else
2036 {
2037 this._sourceBlock = this.sourceBlock;
2038 this.param.mat = this.matBlock;
2039 }
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)
2043 {
2044 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, this._sourceBlock.colorMod));
2045 }
2046 else
2047 {
2048 this.param.matColor = (float)((this._sourceBlock.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, this._sourceBlock.colorMod));
2049 }
2050 this.param.color += this._rightWallShade;
2051 if (this.roomHeight == 0f || flag11 || !this.tileType.RepeatBlock)
2052 {
2053 if (!this.cell.hasDoor)
2054 {
2055 this._sourceBlock.renderData.Draw(this.param);
2056 }
2057 }
2058 else
2059 {
2060 RenderData renderData4 = this._sourceBlock.renderData;
2061 RenderParam p3 = this.param;
2062 float maxY3 = this.maxHeight;
2063 float num21 = this.roomHeight;
2064 GameSetting.RenderSetting renderSetting3 = this.renderSetting;
2065 bool hasDoor3 = this.cell.hasDoor;
2066 CellEffect effect4 = this.cell.effect;
2067 renderData4.DrawRepeatTo(p3, maxY3, num21, ref renderSetting3.peakFix, hasDoor3, (effect4 != null) ? effect4.FireAmount : 0, false);
2068 }
2069 if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
2070 {
2071 if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
2072 {
2073 this.param.snow = true;
2074 }
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))
2078 {
2079 this._sourceBlock.renderData.Draw(this.param);
2080 }
2081 else
2082 {
2083 this._sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFix, false, 0, false);
2084 }
2085 this.param.x = this.orgX;
2086 }
2087 }
2088 this.param.y = this.orgY;
2089 this.param.z = this.orgZ;
2090 break;
2091 }
2092 case BlockRenderMode.Pillar:
2093 {
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;
2098 if (num22 == 0)
2099 {
2100 renderData5.Draw(this.param);
2101 }
2102 else
2103 {
2104 renderData5.DrawRepeat(this.param, num22, this.sourceBlock.tileType.RepeatSize, false);
2105 }
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);
2110 break;
2111 }
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);
2120 break;
2121 default:
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)
2126 {
2127 this.sourceBlock.renderData.Draw(this.param);
2128 }
2129 else
2130 {
2131 this.sourceBlock.renderData.DrawRepeatTo(this.param, this.maxHeight, this.roomHeight, ref this.renderSetting.peakFixBlock, false, 0, false);
2132 }
2133 break;
2134 }
2135 }
2136 if (this.cell.pcSync && EMono.player.lightPower > 0f && !this.cinemaMode)
2137 {
2138 bool flag12;
2139 if (this.cell.room == null && this.cell.IsRoomEdge && this.showRoof)
2140 {
2141 if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
2142 {
2143 Room room24 = this.cell.FrontRight.room;
2144 flag12 = (room24 != null && room24.HasRoof);
2145 }
2146 else
2147 {
2148 flag12 = true;
2149 }
2150 }
2151 else
2152 {
2153 flag12 = false;
2154 }
2155 if (!flag12 && (!this.showRoof || !this.roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null))
2156 {
2157 this.param.tile = (float)num13;
2158 this.rendererFov.Draw(this.param);
2159 }
2160 }
2161 if (this.cell.effect != null)
2162 {
2163 if (this.cell.effect.IsLiquid)
2164 {
2165 SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
2166 SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
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);
2172 }
2173 else
2174 {
2175 this.param.tile = (float)this.cell.effect.source._tiles[0];
2176 SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
2177 if (sourceEffect2.anime.Length != 0)
2178 {
2179 if (sourceEffect2.anime.Length > 2)
2180 {
2181 float num23 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
2182 if (num23 < (float)sourceEffect2.anime[0])
2183 {
2184 this.param.tile += num23;
2185 }
2186 }
2187 else
2188 {
2189 float num24 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
2190 this.param.tile += num24;
2191 }
2192 }
2193 if (this.cell.effect.IsFire)
2194 {
2195 this.rendererEffect.Draw(this.param, 0);
2196 }
2197 else
2198 {
2199 this.cell.effect.source.renderData.Draw(this.param);
2200 }
2201 }
2202 }
2203 this.param.color = this.floorLight;
2204 if (this.cell.critter != null)
2205 {
2206 Critter critter = this.cell.critter;
2207 int snowTile = critter.tile;
2208 if (this.snowed && critter.SnowTile != 0)
2209 {
2210 critter.x = 0.06f;
2211 critter.y = -0.06f;
2212 snowTile = critter.SnowTile;
2213 }
2214 else
2215 {
2216 critter.Update();
2217 }
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;
2225 this.pass.idx++;
2226 if (this.pass.idx == this.pass.batchSize)
2227 {
2228 this.pass.NextBatch();
2229 }
2230 }
2231 if (this.detail != null)
2232 {
2233 TransAnime anime3 = this.detail.anime;
2234 if (anime3 != null && !anime3.animeBlock)
2235 {
2236 TransAnime anime4 = this.detail.anime;
2237 this.param.x += anime4.v.x;
2238 this.param.y += anime4.v.y;
2239 this.param.z += anime4.v.z;
2240 }
2241 }
2242 if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
2243 {
2244 SourceObj.Row sourceObj = this.cell.sourceObj;
2245 if (!this.snowed || sourceObj.snowTile <= 0)
2246 {
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)
2251 {
2252 if (sourceObj.pref.Float)
2253 {
2254 this.param.y += 0.01f * this.floatY;
2255 if (this.liquidLv > 10)
2256 {
2257 this.liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
2258 }
2259 this.liquidLv -= (int)(this.floatY * 0.5f);
2260 this.param.liquidLv = this.liquidLv;
2261 }
2262 if (sourceObj.tileType.IsWaterTop)
2263 {
2264 this.param.liquidLv = 0;
2265 }
2266 else
2267 {
2268 this.param.liquidLv += sourceObj.pref.liquidMod;
2269 if (this.param.liquidLv < 1)
2270 {
2271 this.param.liquid = 1f;
2272 }
2273 else if (this.param.liquidLv > 99 + sourceObj.pref.liquidModMax)
2274 {
2275 this.param.liquidLv = 99 + sourceObj.pref.liquidModMax;
2276 }
2277 }
2278 }
2279 if (sourceObj.useAltColor)
2280 {
2281 this.param.matColor = (float)((sourceObj.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.altColor, sourceObj.colorMod));
2282 }
2283 else
2284 {
2285 this.param.matColor = (float)((sourceObj.colorMod == 0) ? 104025 : BaseTileMap.GetColorInt(ref this.param.mat.matColor, sourceObj.colorMod));
2286 }
2287 if (sourceObj.HasGrowth)
2288 {
2289 this.cell.growth.OnRenderTileMap(this.param);
2290 }
2291 else
2292 {
2293 if (this.cell.autotileObj != 0)
2294 {
2295 this.param.tile = (float)(sourceObj._tiles[0] + (int)this.cell.autotileObj);
2296 }
2297 else if (sourceObj.tileType.IsUseBlockDir)
2298 {
2299 this.param.tile = (float)sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
2300 }
2301 else
2302 {
2303 this.param.tile = (float)sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
2304 }
2305 if (this._lowblock && sourceObj.tileType.IsSkipLowBlock)
2306 {
2307 this.param.tile += (float)(((this.param.tile > 0f) ? 1 : -1) * 3000000);
2308 }
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)
2318 {
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);
2320 }
2321 this.param.y = this.orgY;
2322 }
2323 }
2324 }
2325 if (this.cell.decal != 0 && this.sourceFloor.tileType.AllowBlood)
2326 {
2327 this.passDecal.Add(this.param, (float)this.cell.decal, this.floorLight, 0f);
2328 }
2329 if (this.highlightCells)
2330 {
2331 switch (ActionMode.FlagCell.mode)
2332 {
2333 case AM_FlagCell.Mode.flagSnow:
2334 if (this.cell.isClearSnow)
2335 {
2336 this.passArea.Add(this.param, 34f, 0f, 0f);
2337 }
2338 break;
2339 case AM_FlagCell.Mode.flagFloat:
2340 if (this.cell.isForceFloat)
2341 {
2342 this.passArea.Add(this.param, 34f, 0f, 0f);
2343 }
2344 break;
2345 case AM_FlagCell.Mode.flagWallPillar:
2346 if (this.cell.isToggleWallPillar)
2347 {
2348 this.passArea.Add(this.param, 34f, 0f, 0f);
2349 }
2350 break;
2351 case AM_FlagCell.Mode.flagClear:
2352 if (this.cell.isClearArea)
2353 {
2354 this.passArea.Add(this.param, 34f, 0f, 0f);
2355 }
2356 break;
2357 }
2358 }
2359 if (this.detail == null)
2360 {
2361 return;
2362 }
2363 if (this.highlightArea && this.detail.area != null)
2364 {
2365 this.passArea.Add(this.param, (float)(this.detail.area.GetTile(this.index) - (this.subtleHighlightArea ? 0 : 1)), 0f, 0f);
2366 }
2367 if (this.detail.footmark != null && this.sourceFloor.id != 0)
2368 {
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);
2373 }
2374 IL_7A31:
2375 if (this.detail.things.Count == 0 && this.detail.charas.Count == 0)
2376 {
2377 return;
2378 }
2379 int num25 = 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)
2385 {
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;
2393 }
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)
2399 {
2400 if (this.liquidLv > 10)
2401 {
2402 this.liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
2403 }
2404 this.liquidLv -= (int)(this.floatY * 0.5f);
2405 this.param.liquidLv = this.liquidLv;
2406 this.param.y -= TileType.FloorWaterShallow.FloorHeight;
2407 }
2408 Thing thing = null;
2409 CS$<>8__locals1.shadow = (this.liquidLv == 0);
2410 float num26 = 0f;
2411 float num27 = 0f;
2412 bool flag13 = false;
2413 float num28 = 0f;
2414 bool flag14 = false;
2415 float num29 = 0f;
2416 if (this.detail.things.Count > 0 && this.isSeen)
2417 {
2418 float max = this.zSetting.max1;
2419 float num30 = 0f;
2420 for (int k = 0; k < this.detail.things.Count; k++)
2421 {
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))
2424 {
2425 TileType tileType = t.trait.tileType;
2426 bool isInstalled = t.IsInstalled;
2427 SourcePref pref = t.Pref;
2428 if (!isInstalled && t.category.tileDummy != 0)
2429 {
2430 pref = this.rendererObjDummy.shadowPref;
2431 }
2432 float num31 = (tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height));
2433 if (t.ignoreStackHeight)
2434 {
2435 this.thingPos.y = this.thingPos.y - num26;
2436 }
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);
2441 if (t.isRoofItem)
2442 {
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)
2449 {
2450 this.param.color = (float)this.GetRoofLight(this.room.lot);
2451 }
2452 CS$<>8__locals1.shadow = false;
2453 this.param.liquidLv = 0;
2454 }
2455 else
2456 {
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)
2462 {
2463 if (((thing != null) ? thing.id : null) != t.id)
2464 {
2465 this._actorPos.x = this._actorPos.x + this.thingPos.x;
2466 }
2467 this._actorPos.y = this._actorPos.y + this.thingPos.y;
2468 if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
2469 {
2470 this._actorPos.y = this._actorPos.y - num26;
2471 }
2472 this._actorPos.z = this._actorPos.z + (this.renderSetting.thingZ + (float)k * -0.01f + this.zSetting.mod1 * this.thingPos.y);
2473 }
2474 if (isInstalled)
2475 {
2476 if (t.TileType.IsRamp)
2477 {
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)
2486 {
2487 num29 += rampFix2.y;
2488 }
2489 this.liquidLv -= (int)(rampFix2.y * 150f);
2490 if (this.liquidLv < 0)
2491 {
2492 this.liquidLv = 0;
2493 }
2494 }
2495 else if (!flag14 && t.trait.IsChangeFloorHeight)
2496 {
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)
2501 {
2502 num29 += num31 + (float)t.altitude * this.altitudeFix.y;
2503 }
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)
2509 {
2510 this.liquidLv = 0;
2511 }
2512 }
2513 else
2514 {
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)
2519 {
2520 this.thingPos.z = this.thingPos.z + pref.z;
2521 }
2522 }
2523 if (!tileType.UseMountHeight && k > 1)
2524 {
2525 flag14 = true;
2526 }
2527 }
2528 else
2529 {
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;
2534 }
2535 if (t.isFloating && isWater && !this.hasBridge && !flag)
2536 {
2537 flag = true;
2538 float num32 = (this.cell._bridge != 0) ? this.sourceBridge.tileType.FloorHeight : this.sourceFloor.tileType.FloorHeight;
2539 this.orgY += 0.01f * this.floatY - num32;
2540 num28 = num31;
2541 this._actorPos.y = this._actorPos.y + (0.01f * this.floatY - num32);
2542 if (this.liquidLv > 10)
2543 {
2544 this.liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
2545 }
2546 this.liquidLv -= (int)(this.floatY * 0.5f);
2547 if (this.liquidLv < 0)
2548 {
2549 this.liquidLv = 0;
2550 }
2551 this.param.liquidLv = this.liquidLv;
2552 }
2553 num26 = num31;
2554 if (t.sourceCard.multisize && !t.trait.IsGround)
2555 {
2556 num30 += this.zSetting.multiZ;
2557 }
2558 this.orgZ += t.renderer.data.stackZ;
2559 if (this.param.liquidLv > 0)
2560 {
2561 this.param.liquidLv += pref.liquidMod;
2562 if (this.param.liquidLv < 1)
2563 {
2564 this.param.liquidLv = 1;
2565 }
2566 else if (this.param.liquidLv > 99 + pref.liquidModMax)
2567 {
2568 this.param.liquidLv = 99 + pref.liquidModMax;
2569 }
2570 }
2571 }
2572 if (isInstalled && tileType.UseMountHeight)
2573 {
2574 if (tileType != TileType.Illumination || !this.cell.HasObj)
2575 {
2576 if (this.noRoofMode && t.altitude >= this.lowWallObjAltitude)
2577 {
2578 goto IL_8CCD;
2579 }
2580 if (this.hideHang)
2581 {
2582 Room room25 = this.cell.room;
2583 if (((room25 != null) ? room25.lot : null) != this.currentLot || (!this.cell.lotWall && this.cell.room != this.currentRoom))
2584 {
2585 Room room26 = (t.dir == 0) ? this.cell.Back.room : this.cell.Left.room;
2586 if (t.trait.AlwaysHideOnLowWall)
2587 {
2588 if (room26 == null)
2589 {
2590 goto IL_8CCD;
2591 }
2592 if (!room26.data.showWallItem)
2593 {
2594 goto IL_8CCD;
2595 }
2596 }
2597 else if (t.altitude >= this.lowWallObjAltitude)
2598 {
2599 goto IL_8CCD;
2600 }
2601 }
2602 }
2603 }
2604 if (tileType.UseHangZFix)
2605 {
2606 flag13 = true;
2607 }
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;
2611 if (t.freePos)
2612 {
2613 this._actorPos.x = this._actorPos.x + t.fx;
2614 this._actorPos.y = this._actorPos.y + t.fy;
2615 }
2616 }
2617 else
2618 {
2619 if (t.altitude != 0)
2620 {
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)
2623 {
2624 Room room27 = this.cell.room;
2625 if (((room27 != null) ? room27.lot : null) != this.currentLot || (!this.cell.lotWall && this.cell.room != this.currentRoom))
2626 {
2627 goto IL_8CCD;
2628 }
2629 }
2630 }
2631 if (t.freePos)
2632 {
2633 this._actorPos.x = this.orgX + t.fx - this.freePos.x;
2634 this._actorPos.y = this.orgY + t.fy - this.freePos.y;
2635 }
2636 if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
2637 {
2638 this._actorPos.z = this._actorPos.z + -0.5f;
2639 }
2640 }
2641 if (!t.sourceCard.multisize || (t.pos.x == this.cx && t.pos.z == this.cz))
2642 {
2643 if (this.iconMode != BaseTileMap.CardIconMode.None)
2644 {
2645 int num33 = 0;
2646 switch (this.iconMode)
2647 {
2648 case BaseTileMap.CardIconMode.Deconstruct:
2649 if (t.isDeconstructing)
2650 {
2651 num33 = 14;
2652 }
2653 break;
2654 case BaseTileMap.CardIconMode.State:
2655 if (t.placeState == PlaceState.installed)
2656 {
2657 num33 = 18;
2658 }
2659 break;
2660 case BaseTileMap.CardIconMode.Visibility:
2661 if (t.isMasked)
2662 {
2663 num33 = 17;
2664 }
2665 break;
2666 }
2667 if (t.isNPCProperty && !EMono.debug.godBuild)
2668 {
2669 num33 = 13;
2670 }
2671 if (num33 != 0)
2672 {
2673 this.passGuideBlock.Add(this._actorPos.x, this._actorPos.y, this._actorPos.z - 10f, (float)num33, 0f);
2674 }
2675 }
2676 t.SetRenderParam(this.param);
2677 if (this._lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
2678 {
2679 this.param.tile += (float)((this.param.tile < 0f) ? -64 : 64);
2680 }
2681 if (t.trait is TraitTrolley)
2682 {
2683 AI_Trolley ai_Trolley = EMono.pc.ai as AI_Trolley;
2684 if (ai_Trolley != null && ai_Trolley.trolley.owner == t)
2685 {
2686 RenderParam _param = new RenderParam(this.param);
2687 EMono.core.actionsLateUpdate.Add(delegate
2688 {
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));
2694 });
2695 goto IL_8C42;
2696 }
2697 }
2698 t.renderer.Draw(this.param, ref this._actorPos, !t.noShadow && (CS$<>8__locals1.shadow || tileType.AlwaysShowShadow));
2699 }
2700 IL_8C42:
2701 if (isInstalled)
2702 {
2703 num27 += pref.stackX * (float)(t.flipX ? -1 : 1);
2704 }
2705 this.param.x = this.orgX;
2706 this.param.y = this.orgY;
2707 this.param.z = this.orgZ;
2708 this.param.color = this.floorLight;
2709 thing = t;
2710 if (pref.Float)
2711 {
2712 this.liquidLv = 0;
2713 }
2714 }
2715 IL_8CCD:;
2716 }
2717 }
2718 this.orgY += num28;
2719 if (this.detail.charas.Count > 0)
2720 {
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++)
2725 {
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)))))
2728 {
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)
2735 {
2736 TraitShackle restrainer = chara.GetRestrainer();
2737 if (restrainer != null)
2738 {
2739 Vector3 getRestrainPos = restrainer.GetRestrainPos;
2740 if (getRestrainPos != default(Vector3))
2741 {
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;
2753 goto IL_928F;
2754 }
2755 }
2756 }
2757 if (!chara.sourceCard.multisize || (chara.pos.x == this.cx && chara.pos.z == this.cz))
2758 {
2759 if (chara.IsDeadOrSleeping && chara.IsPCC)
2760 {
2761 float num35 = chara.renderer.data.size.y * 0.3f;
2762 if (this.thingPos.y > max2)
2763 {
2764 this.thingPos.y = max2;
2765 }
2766 float num36 = this.thingPos.y + num35;
2767 float num37 = (float)l * -0.01f;
2768 if (num36 > this.zSetting.thresh1)
2769 {
2770 num37 = this.zSetting.mod1;
2771 }
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);
2778 }
2779 else
2780 {
2781 this.param.liquidLv = this.liquidLv;
2782 if (this.param.liquidLv > 0)
2783 {
2784 this.param.liquidLv += chara.Pref.liquidMod;
2785 if (this.param.liquidLv < 1)
2786 {
2787 this.param.liquidLv = 1;
2788 }
2789 else if (this.param.liquidLv > 99 + chara.Pref.liquidModMax)
2790 {
2791 this.param.liquidLv = 99 + chara.Pref.liquidModMax;
2792 }
2793 }
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))
2795 {
2796 this._actorPos += this.renderSetting.charaPos[1 + ((num25 < 4) ? num25 : 3)];
2797 }
2798 this._actorPos.z = this._actorPos.z + (0.01f * (float)l + this.renderSetting.charaZ);
2799 num25++;
2800 if (flag13)
2801 {
2802 this._actorPos.z = this._actorPos.z + chara.renderer.data.hangedFixZ;
2803 }
2804 chara.renderer.Draw(this.param, ref this._actorPos, this.liquidLv == 0);
2805 }
2806 }
2807 this.param.x = this.orgX;
2808 this.param.y = this.orgY;
2809 this.param.z = this.orgZ;
2810 }
2811 IL_928F:;
2812 }
2813 }
2814 }
2815
2816 // Token: 0x06000C39 RID: 3129 RVA: 0x00057564 File Offset: 0x00055764
2817 public Vector3 GetThingPosition(Card tg, Point p)
2818 {
2819 Vector3 vector = Vector3.zero;
2820 float num = 0f;
2821 this.cell = p.cell;
2822 this.sourceFloor = this.cell.sourceFloor;
2823 if (!tg.TileType.UseMountHeight)
2824 {
2825 if (this.cell.isFloating && !this.cell.IsSnowTile)
2826 {
2827 vector.z -= 1f;
2828 }
2829 else if (!tg.sourceCard.multisize)
2830 {
2831 float num2 = (this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : this.sourceFloor.tileType.FloorHeight;
2832 vector.y += num2;
2833 vector.z -= num2 * this.heightMod.z;
2834 }
2835 if (this.cell.HasRamp)
2836 {
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;
2841 }
2842 }
2843 if (tg.sourceCard.multisize)
2844 {
2845 vector.z -= 1f;
2846 }
2847 vector.x += tg.Pref.x * (float)(tg.flipX ? -1 : 1);
2848 vector.z += tg.Pref.z;
2849 this.detail = this.cell.detail;
2850 if (tg.isChara)
2851 {
2852 return vector;
2853 }
2854 bool flag = false;
2855 if (tg.TileType.UseMountHeight && !EMono.scene.actionMode.IsRoofEditMode(tg))
2856 {
2857 flag = true;
2858 }
2859 else if (!tg.TileType.CanStack || EMono.scene.actionMode.IsRoofEditMode(tg))
2860 {
2861 if (tg.altitude != 0)
2862 {
2863 vector += this.altitudeFix * (float)tg.altitude;
2864 }
2865 flag = true;
2866 }
2867 if (EMono.scene.actionMode.IsRoofEditMode(tg))
2868 {
2869 return vector;
2870 }
2871 float num3 = 0f;
2872 if (this.detail != null && this.detail.things.Count > 0)
2873 {
2874 for (int i = 0; i < this.detail.things.Count; i++)
2875 {
2876 Thing thing = this.detail.things[i];
2877 SourcePref pref = thing.Pref;
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)
2881 {
2882 if (thing.TileType.IsRamp)
2883 {
2884 Vector3 rampFix2 = thing.TileType.GetRampFix(thing.dir);
2885 vector.x += rampFix2.x;
2886 vector.y += rampFix2.y;
2887 vector.z += rampFix2.z;
2888 }
2889 if (!flag && tileType.CanStack)
2890 {
2891 if (thing.ignoreStackHeight)
2892 {
2893 vector.y -= num3;
2894 }
2895 vector.y += num4;
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)
2899 {
2900 vector += this.altitudeFix * (float)thing.altitude;
2901 num4 += this.altitudeFix.y * (float)thing.altitude;
2902 }
2903 num3 = num4;
2904 vector.z += this.renderSetting.thingZ + num + (float)i * -0.01f + this.zSetting.mod1 * vector.y;
2905 if (thing.sourceCard.multisize)
2906 {
2907 num += this.zSetting.multiZ;
2908 }
2909 }
2910 }
2911 }
2912 }
2913 if (flag)
2914 {
2915 return vector;
2916 }
2917 if (tg.ignoreStackHeight)
2918 {
2919 vector.y -= num3;
2920 }
2921 if (tg.altitude != 0)
2922 {
2923 vector += this.altitudeFix * (float)tg.altitude;
2924 }
2925 return vector;
2926 }
2927
2928 // Token: 0x06000C3A RID: 3130 RVA: 0x000579FC File Offset: 0x00055BFC
2929 public int GetApproximateBlocklight(Cell cell)
2930 {
2931 float num = this._baseBrightness + 0.05f;
2932 if (cell.IsSnowTile)
2933 {
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);
2935 }
2936 else
2937 {
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));
2939 }
2940 return (int)num;
2941 }
2942
2943 // Token: 0x06000C3B RID: 3131 RVA: 0x00057AF4 File Offset: 0x00055CF4
2944 public int GetRoofLight(Lot lot)
2945 {
2946 float num = Mathf.Sqrt(lot.light) * this.roofLightMod;
2947 if (num > this.lightLimit * this.roofLightLimitMod)
2948 {
2949 num = this.lightLimit * this.roofLightLimitMod;
2950 }
2951 if (this.isSnowCovered)
2952 {
2953 num += this.roofLightSnow * (1f - this.nightRatio);
2954 }
2955 int num2 = (int)(num * 50f) * 262144;
2956 if (this.isSnowCovered)
2957 {
2958 num2 += this.snowColorToken;
2959 }
2960 return num2;
2961 }
2962
2963 // Token: 0x06000C3C RID: 3132 RVA: 0x00057B74 File Offset: 0x00055D74
2964 public void DrawRoof(Lot lot)
2965 {
2966 RoofStyle roofStyle = this.roofStyles[lot.idRoofStyle];
2967 if (roofStyle.type == RoofStyle.Type.None)
2968 {
2969 return;
2970 }
2971 bool reverse = lot.reverse;
2972 int num;
2973 int num2;
2974 int num3;
2975 int num4;
2976 if (reverse)
2977 {
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)
2983 {
2984 num2--;
2985 }
2986 if (num3 < this.Size && num4 < this.Size && this.map.cells[num4 - 1, num3].HasFullBlock)
2987 {
2988 num3++;
2989 }
2990 }
2991 else
2992 {
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)
2998 {
2999 num--;
3000 }
3001 if (num3 < this.Size && num4 < this.Size && this.map.cells[num3 - 1, num4].HasFullBlock)
3002 {
3003 num4++;
3004 }
3005 }
3006 bool flag = roofStyle.wing && lot.height > 1;
3007 if (flag)
3008 {
3009 num2--;
3010 num4++;
3011 }
3012 int num5 = num4 + (reverse ? roofStyle.w : roofStyle.h) * 2 - num2;
3013 int idRoofTile = lot.idRoofTile;
3014 int num6 = lot.idBlock;
3015 int num7 = num6;
3016 if (num6 >= EMono.sources.blocks.rows.Count)
3017 {
3018 num6 = EMono.sources.blocks.rows.Count - 1;
3019 }
3020 if (num7 >= EMono.sources.floors.rows.Count)
3021 {
3022 num7 = EMono.sources.floors.rows.Count - 1;
3023 }
3024 int num8 = lot.idRamp;
3025 if (num8 >= EMono.sources.blocks.rows.Count)
3026 {
3027 num8 = EMono.sources.blocks.rows.Count - 1;
3028 }
3029 bool flag2 = false;
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];
3033 int num11 = 0;
3034 int num12 = flag ? -1 : 0;
3035 int num13 = 0;
3036 Vector3 vector = lot.fullblock ? roofStyle.posFixBlock : roofStyle.posFix;
3037 switch (roofStyle.type)
3038 {
3039 case RoofStyle.Type.Default:
3040 flag2 = (num5 % 2 == 1 && roofStyle.flatW == 0);
3041 break;
3042 case RoofStyle.Type.Flat:
3043 case RoofStyle.Type.FlatFloor:
3044 num9 = roofStyle.flatW;
3045 num10 = num5 - roofStyle.flatW;
3046 if (num9 == 0)
3047 {
3048 num13 = 1;
3049 }
3050 if (roofStyle.type != RoofStyle.Type.FlatFloor)
3051 {
3052 num--;
3053 num3++;
3054 num2--;
3055 num4++;
3056 }
3057 break;
3058 case RoofStyle.Type.Triangle:
3059 num9 = 999;
3060 num10 = 999;
3061 break;
3062 }
3063 this.cz = num2;
3064 while (this.cz < num4)
3065 {
3066 this.cx = num;
3067 while (this.cx < num3)
3068 {
3069 if (this.cx >= 0 && this.cz >= 0 && this.cx < this.Size && this.cz < this.Size)
3070 {
3071 int num14;
3072 int num15;
3073 if (reverse)
3074 {
3075 num14 = this.cz;
3076 num15 = this.cx;
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)
3079 {
3080 goto IL_1068;
3081 }
3082 }
3083 else
3084 {
3085 num14 = this.cx;
3086 num15 = this.cz;
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)
3089 {
3090 goto IL_1068;
3091 }
3092 }
3093 int num16 = num15 - num14;
3094 this.room = this.cell.room;
3095 if (this.room == null || this.room.lot == lot)
3096 {
3097 bool flag3 = false;
3098 if (roofStyle.type == RoofStyle.Type.Flat)
3099 {
3100 if (reverse)
3101 {
3102 if (this.cell.HasFullBlock && this.cell.room == null)
3103 {
3104 Room room = this.cell.Left.room;
3105 if (((room != null) ? room.lot : null) == lot && this.cell.Right.room != null)
3106 {
3107 num13 = 1;
3108 flag3 = true;
3109 }
3110 else
3111 {
3112 Room room2 = this.cell.Front.room;
3113 if (((room2 != null) ? room2.lot : null) == lot)
3114 {
3115 Room room3 = this.cell.FrontRight.room;
3116 num13 = ((((room3 != null) ? room3.lot : null) == lot) ? 1 : 2);
3117 flag3 = true;
3118 }
3119 else
3120 {
3121 Room room4 = this.cell.Right.room;
3122 if (((room4 != null) ? room4.lot : null) != lot)
3123 {
3124 Room room5 = this.cell.FrontRight.room;
3125 if (((room5 != null) ? room5.lot : null) != lot)
3126 {
3127 goto IL_7EB;
3128 }
3129 }
3130 num13 = 0;
3131 flag3 = true;
3132 }
3133 }
3134 }
3135 else if (this.cell.Left.room == null || this.cell.Left.room.lot != lot)
3136 {
3137 num13 = (this.cell.Left.HasFullBlock ? 1 : 0);
3138 }
3139 else if (this.cell.Right.room == null || this.cell.Right.room.lot != lot)
3140 {
3141 num13 = ((this.cell.HasFullBlock && this.cell.Right.HasFullBlock && this.cell.Right.room != null) ? 1 : 2);
3142 }
3143 else
3144 {
3145 num13 = 1;
3146 }
3147 }
3148 else if (this.cell.HasFullBlock && this.cell.room == null)
3149 {
3150 Room room6 = this.cell.Right.room;
3151 if (((room6 != null) ? room6.lot : null) == lot)
3152 {
3153 Room room7 = this.cell.FrontRight.room;
3154 num13 = ((((room7 != null) ? room7.lot : null) == lot) ? 1 : 0);
3155 flag3 = true;
3156 }
3157 else
3158 {
3159 Room room8 = this.cell.Front.room;
3160 if (((room8 != null) ? room8.lot : null) != lot)
3161 {
3162 Room room9 = this.cell.FrontRight.room;
3163 if (((room9 != null) ? room9.lot : null) != lot)
3164 {
3165 goto IL_7EB;
3166 }
3167 }
3168 num13 = 2;
3169 flag3 = true;
3170 }
3171 }
3172 else if (this.cell.Front.room == null || this.cell.Front.room.lot != lot)
3173 {
3174 num13 = ((this.cell.HasFullBlock && this.cell.Front.HasFullBlock && this.cell.Front.room != null) ? 1 : 0);
3175 }
3176 else if (this.cell.Back.room == null || this.cell.Back.room.lot != lot)
3177 {
3178 num13 = (this.cell.Back.HasFullBlock ? 1 : 2);
3179 }
3180 else
3181 {
3182 num13 = 1;
3183 }
3184 IL_7EB:
3185 num12 = 0;
3186 }
3187 if (this.room != null || roofStyle.coverLot || flag3)
3188 {
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)
3195 {
3196 num17 += roofStyle.lowRoofFix.y;
3197 num18 += roofStyle.lowRoofFix.z;
3198 }
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;
3205 if (num13 == 1)
3206 {
3207 SourceMaterial.Row mat = this.matBlock;
3208 RenderRow renderRow;
3209 if (roofStyle.type == RoofStyle.Type.FlatFloor)
3210 {
3211 if (this.cell.HasFullBlock && this.cell.IsRoomEdge)
3212 {
3213 goto IL_1068;
3214 }
3215 renderRow = EMono.sources.floors.rows[num7];
3216 renderRow.SetRenderParam(this.param, mat, 0);
3217 this.param.matColor = (float)lot.colRoof;
3218 }
3219 else
3220 {
3221 renderRow = row;
3222 renderRow.SetRenderParam(this.param, mat, 0);
3223 this.param.matColor = (float)lot.colBlock;
3224 }
3225 renderRow.renderData.Draw(this.param);
3226 if (idRoofTile != 0)
3227 {
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)
3233 {
3234 this.param.x += roofStyle.posFixBlock.x;
3235 this.param.y += roofStyle.posFixBlock.y;
3236 this.param.z += roofStyle.posFixBlock.z;
3237 }
3238 if (!flag2)
3239 {
3240 this.param.z += 0.5f;
3241 }
3242 if (flag4)
3243 {
3244 this.param.matColor = 104025f;
3245 if (roofStyle.type != RoofStyle.Type.FlatFloor)
3246 {
3247 this.param.z += roofStyle.snowZ;
3248 }
3249 this.param.tile = (float)(renderRow.renderData.ConvertTile(renderRow.snowTile) + num19);
3250 renderRow.renderData.Draw(this.param);
3251 }
3252 else
3253 {
3254 renderRow.renderData.Draw(this.param);
3255 }
3256 }
3257 else if (flag4 && roofStyle.type == RoofStyle.Type.FlatFloor)
3258 {
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);
3265 }
3266 }
3267 else
3268 {
3269 if (idRoofTile != 0)
3270 {
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))
3273 {
3274 this.param.shadowFix = (float)(num20 + 1);
3275 }
3276 RenderRow renderRow = EMono.sources.objs.rows[idRoofTile];
3277 renderRow.SetRenderParam(this.param, MATERIAL.sourceGold, num20);
3278 this.param.matColor = (float)lot.colRoof;
3279 if (flag4)
3280 {
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);
3285 }
3286 else
3287 {
3288 this.param.tile += (float)(lot.altRoof ? 8 : 0);
3289 renderRow.renderData.Draw(this.param);
3290 }
3291 this.param.shadowFix = 0f;
3292 }
3293 if (num12 >= 0)
3294 {
3295 this.param.y += this.roofRampFix.y;
3296 this.param.z += this.roofRampFix.z;
3297 RenderRow renderRow = EMono.sources.blocks.rows[num8];
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);
3301 }
3302 }
3303 CellEffect effect = this.cell.effect;
3304 if (effect != null && effect.FireAmount > 0)
3305 {
3306 this.rendererEffect.Draw(this.param, this.cell.effect.FireAmount);
3307 }
3308 if (num12 >= 1)
3309 {
3310 if (roofStyle.type != RoofStyle.Type.Flat)
3311 {
3312 this.param.snow = false;
3313 }
3314 for (int i = 0; i < num12; i++)
3315 {
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;
3319 RenderRow renderRow = row;
3320 renderRow.SetRenderParam(this.param, MATERIAL.sourceGold, 0);
3321 this.param.matColor = (float)lot.colBlock;
3322 renderRow.renderData.Draw(this.param);
3323 this.index++;
3324 CellEffect effect2 = this.cell.effect;
3325 if (effect2 != null && effect2.FireAmount > 0 && Rand.bytes[this.index % Rand.MaxBytes] % 3 == 0)
3326 {
3327 this.rendererEffect.Draw(this.param, this.cell.effect.FireAmount);
3328 }
3329 }
3330 }
3331 }
3332 }
3333 }
3334 IL_1068:
3335 this.cx++;
3336 }
3337 num11++;
3338 if (roofStyle.type != RoofStyle.Type.Flat)
3339 {
3340 if (num11 == num9)
3341 {
3342 num13 = 1;
3343 }
3344 if (num11 == num10)
3345 {
3346 num13 = 2;
3347 num12++;
3348 }
3349 num12 += ((num13 == 0) ? 1 : ((num13 == 1) ? 0 : -1));
3350 }
3351 this.cz++;
3352 }
3353 }
3354
3355 // Token: 0x06000C3D RID: 3133 RVA: 0x00058C5C File Offset: 0x00056E5C
3356 public static int GetColorInt(ref Color matColor, int p)
3357 {
3358 if (p == 0)
3359 {
3360 return 104025;
3361 }
3362 return p * 262144 + (int)(matColor.r * 50f) * 4096 + (int)(matColor.g * 50f) * 64 + (int)(matColor.b * 50f);
3363 }
3364
3365 // Token: 0x06000C3E RID: 3134 RVA: 0x00058CAC File Offset: 0x00056EAC
3366 public void SetRoofHeight(MeshPassParam _param, Cell _cell, int _cx, int _cz, int h = 0, int altitude = 0, int dirWall = -1, bool ignoreAltitudeY = false)
3367 {
3368 Room room = _cell.room;
3369 if (room == null && dirWall != -1)
3370 {
3371 if (dirWall == 0 && _cell.Front.room != null)
3372 {
3373 room = _cell.Front.room;
3374 _cell = _cell.Front;
3375 }
3376 else if (_cell.Right.room != null)
3377 {
3378 room = _cell.Right.room;
3379 _cell = _cell.Right;
3380 }
3381 }
3382 if (room != null)
3383 {
3384 Lot lot = room.lot;
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)
3389 {
3390 num += roofStyle.lowRoofFix.y;
3391 num2 += roofStyle.lowRoofFix.z;
3392 }
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;
3396 }
3397 if (!ignoreAltitudeY || room != null)
3398 {
3399 _param.y += (float)altitude * this._heightMod.y;
3400 }
3401 _param.z += (float)altitude * this.heightModRoofBlock.z;
3402 }
3403
3404 // Token: 0x04000B2E RID: 2862
3405 public static bool forceShowHang;
3406
3407 // Token: 0x04000B2F RID: 2863
3408 public int count;
3409
3410 // Token: 0x04000B30 RID: 2864
3411 [Header("Mouse Hit")]
3412 public Collider2D mouseCollider;
3413
3414 // Token: 0x04000B31 RID: 2865
3415 public Vector3 colliderFix;
3416
3417 // Token: 0x04000B32 RID: 2866
3418 public int maxColliderCheck;
3419
3420 // Token: 0x04000B33 RID: 2867
3421 [Header("Height")]
3422 public float heightBlockSize;
3423
3424 // Token: 0x04000B34 RID: 2868
3425 public float slopeFixZ;
3426
3427 // Token: 0x04000B35 RID: 2869
3428 public float heightModDeco;
3429
3430 // Token: 0x04000B36 RID: 2870
3431 public float heightLimitDeco;
3432
3433 // Token: 0x04000B37 RID: 2871
3434 public Vector3 heightMod;
3435
3436 // Token: 0x04000B38 RID: 2872
3437 public Vector3 ugFix;
3438
3439 // Token: 0x04000B39 RID: 2873
3440 public Vector3 ugFixBridge;
3441
3442 // Token: 0x04000B3A RID: 2874
3443 public Vector3 ugFixBridgeBottom;
3444
3445 // Token: 0x04000B3B RID: 2875
3446 public Vector3 ugFixBridgeTop;
3447
3448 // Token: 0x04000B3C RID: 2876
3449 public Vector3 heightModRoofBlock;
3450
3451 // Token: 0x04000B3D RID: 2877
3452 [Header("Room")]
3453 public float rightWallShade;
3454
3455 // Token: 0x04000B3E RID: 2878
3456 public Vector3 roofRampFix;
3457
3458 // Token: 0x04000B3F RID: 2879
3459 public Vector3 roofFix;
3460
3461 // Token: 0x04000B40 RID: 2880
3462 public Vector3 roofFix2;
3463
3464 // Token: 0x04000B41 RID: 2881
3465 public Vector3 roofFix3;
3466
3467 // Token: 0x04000B42 RID: 2882
3468 public float roofLightMod;
3469
3470 // Token: 0x04000B43 RID: 2883
3471 public float lotLight;
3472
3473 // Token: 0x04000B44 RID: 2884
3474 public float lotLight2;
3475
3476 // Token: 0x04000B45 RID: 2885
3477 public float roofLightSnow;
3478
3479 // Token: 0x04000B46 RID: 2886
3480 [Header("Other")]
3481 public BaseTileMap.WallClipMode wallClipMode;
3482
3483 // Token: 0x04000B47 RID: 2887
3484 public BaseTileMap.InnerMode defaultInnerMode;
3485
3486 // Token: 0x04000B48 RID: 2888
3487 public Vector3 edgeBlockFix;
3488
3489 // Token: 0x04000B49 RID: 2889
3490 public Vector3 bridgeFix;
3491
3492 // Token: 0x04000B4A RID: 2890
3493 public Vector3 cornerWallFix;
3494
3495 // Token: 0x04000B4B RID: 2891
3496 public Vector3 cornerWallFix2;
3497
3498 // Token: 0x04000B4C RID: 2892
3499 public Vector3 cornerWallFix3;
3500
3501 // Token: 0x04000B4D RID: 2893
3502 public Vector3 altitudeFix;
3503
3504 // Token: 0x04000B4E RID: 2894
3505 public Vector3 waterEdgeFix;
3506
3507 // Token: 0x04000B4F RID: 2895
3508 public Vector3 waterEdgeBridgeFix;
3509
3510 // Token: 0x04000B50 RID: 2896
3511 public Vector3 waterEdgeFixShore;
3512
3513 // Token: 0x04000B51 RID: 2897
3514 public Vector3 waterEdgeFixShoreSand;
3515
3516 // Token: 0x04000B52 RID: 2898
3517 public Vector3[] ambientShadowFix;
3518
3519 // Token: 0x04000B53 RID: 2899
3520 public Vector3[] transitionFix;
3521
3522 // Token: 0x04000B54 RID: 2900
3523 public Vector3[] wallHangFix;
3524
3525 // Token: 0x04000B55 RID: 2901
3526 public Vector3[] waterEdgeBlockFix;
3527
3528 // Token: 0x04000B56 RID: 2902
3529 public int fogTile;
3530
3531 // Token: 0x04000B57 RID: 2903
3532 public float floatSpeed;
3533
3534 // Token: 0x04000B58 RID: 2904
3535 public float shadowModStrength;
3536
3537 // Token: 0x04000B59 RID: 2905
3538 public int maxFloat;
3539
3540 // Token: 0x04000B5A RID: 2906
3541 public int[] seaAnimeIndexes;
3542
3543 // Token: 0x04000B5B RID: 2907
3544 [Header("References")]
3545 public NoiseLayer layerGroundLights;
3546
3547 // Token: 0x04000B5C RID: 2908
3548 public MeshPass passShadow;
3549
3550 // Token: 0x04000B5D RID: 2909
3551 public MeshPass passLiquid;
3552
3553 // Token: 0x04000B5E RID: 2910
3554 public MeshPass passGuideBlock;
3555
3556 // Token: 0x04000B5F RID: 2911
3557 public MeshPass passGuideFloor;
3558
3559 // Token: 0x04000B60 RID: 2912
3560 public MeshPass passArea;
3561
3562 // Token: 0x04000B61 RID: 2913
3563 public MeshPass passRamp;
3564
3565 // Token: 0x04000B62 RID: 2914
3566 public MeshPass passFloor;
3567
3568 // Token: 0x04000B63 RID: 2915
3569 public MeshPass passBlock;
3570
3571 // Token: 0x04000B64 RID: 2916
3572 public MeshPass passObjS;
3573
3574 // Token: 0x04000B65 RID: 2917
3575 public MeshPass passObjSS;
3576
3577 // Token: 0x04000B66 RID: 2918
3578 public MeshPass passObj;
3579
3580 // Token: 0x04000B67 RID: 2919
3581 public MeshPass passObjL;
3582
3583 // Token: 0x04000B68 RID: 2920
3584 public MeshPass passDecal;
3585
3586 // Token: 0x04000B69 RID: 2921
3587 public MeshPass passRoof;
3588
3589 // Token: 0x04000B6A RID: 2922
3590 public MeshPass passBlockEx;
3591
3592 // Token: 0x04000B6B RID: 2923
3593 public MeshPass passFloorEx;
3594
3595 // Token: 0x04000B6C RID: 2924
3596 public MeshPass passFloorWater;
3597
3598 // Token: 0x04000B6D RID: 2925
3599 public MeshPass passInner;
3600
3601 // Token: 0x04000B6E RID: 2926
3602 public MeshPass passFog;
3603
3604 // Token: 0x04000B6F RID: 2927
3605 public MeshPass passFov;
3606
3607 // Token: 0x04000B70 RID: 2928
3608 public MeshPass passEdge;
3609
3610 // Token: 0x04000B71 RID: 2929
3611 public MeshPass passAutoTile;
3612
3613 // Token: 0x04000B72 RID: 2930
3614 public MeshPass passAutoTileWater;
3615
3616 // Token: 0x04000B73 RID: 2931
3617 public MeshPass passBlockMarker;
3618
3619 // Token: 0x04000B74 RID: 2932
3620 public MeshPass passFloorMarker;
3621
3622 // Token: 0x04000B75 RID: 2933
3623 public MeshPass passWaterBlock;
3624
3625 // Token: 0x04000B76 RID: 2934
3626 public MeshPass passIcon;
3627
3628 // Token: 0x04000B77 RID: 2935
3629 public MeshPass passChara;
3630
3631 // Token: 0x04000B78 RID: 2936
3632 public MeshPass passCharaL;
3633
3634 // Token: 0x04000B79 RID: 2937
3635 public MeshPass passCharaLL;
3636
3637 // Token: 0x04000B7A RID: 2938
3638 public MeshPass passShore;
3639
3640 // Token: 0x04000B7B RID: 2939
3641 public RenderData renderFootmark;
3642
3643 // Token: 0x04000B7C RID: 2940
3644 public RenderData rendererBlockMarker;
3645
3646 // Token: 0x04000B7D RID: 2941
3647 public RenderData rendererFloorMarker;
3648
3649 // Token: 0x04000B7E RID: 2942
3650 public RenderData rendererInnerBlock;
3651
3652 // Token: 0x04000B7F RID: 2943
3653 public RenderData rendererFov;
3654
3655 // Token: 0x04000B80 RID: 2944
3656 public RenderData rendererFov2;
3657
3658 // Token: 0x04000B81 RID: 2945
3659 public RenderData rendererShore;
3660
3661 // Token: 0x04000B82 RID: 2946
3662 public RenderData renderBorder;
3663
3664 // Token: 0x04000B83 RID: 2947
3665 public RenderData rendererFogBlockSolid;
3666
3667 // Token: 0x04000B84 RID: 2948
3668 public RenderData rendererFogFloorSolid;
3669
3670 // Token: 0x04000B85 RID: 2949
3671 public RenderData rendererFogRoomSolid;
3672
3673 // Token: 0x04000B86 RID: 2950
3674 public RenderData rendererFogRoomBlockSolid;
3675
3676 // Token: 0x04000B87 RID: 2951
3677 public RenderData rendererFogRoomWallSolid;
3678
3679 // Token: 0x04000B88 RID: 2952
3680 public RenderData rendererWallDeco;
3681
3682 // Token: 0x04000B89 RID: 2953
3683 public RenderData rendererWaterBlock;
3684
3685 // Token: 0x04000B8A RID: 2954
3686 public RenderDataObjDummy rendererObjDummy;
3687
3688 // Token: 0x04000B8B RID: 2955
3689 public RenderDataEffect rendererEffect;
3690
3691 // Token: 0x04000B8C RID: 2956
3692 public Point TestPoint = new Point();
3693
3694 // Token: 0x04000B8D RID: 2957
3695 protected BaseTileMap.InnerMode innerMode;
3696
3697 // Token: 0x04000B8E RID: 2958
3698 [NonSerialized]
3699 public int Size;
3700
3701 // Token: 0x04000B8F RID: 2959
3702 [NonSerialized]
3703 public int SizeXZ;
3704
3705 // Token: 0x04000B90 RID: 2960
3706 [NonSerialized]
3707 public int mx;
3708
3709 // Token: 0x04000B91 RID: 2961
3710 [NonSerialized]
3711 public int mz;
3712
3713 // Token: 0x04000B92 RID: 2962
3714 [NonSerialized]
3715 public int x;
3716
3717 // Token: 0x04000B93 RID: 2963
3718 [NonSerialized]
3719 public int z;
3720
3721 // Token: 0x04000B94 RID: 2964
3722 [NonSerialized]
3723 public int cx;
3724
3725 // Token: 0x04000B95 RID: 2965
3726 [NonSerialized]
3727 public int cz;
3728
3729 // Token: 0x04000B96 RID: 2966
3730 [NonSerialized]
3731 public int activeCount;
3732
3733 // Token: 0x04000B97 RID: 2967
3734 [NonSerialized]
3735 public int floatV = 1;
3736
3737 // Token: 0x04000B98 RID: 2968
3738 [NonSerialized]
3739 public byte[] groundLights;
3740
3741 // Token: 0x04000B99 RID: 2969
3742 [NonSerialized]
3743 public bool lowBlock;
3744
3745 // Token: 0x04000B9A RID: 2970
3746 [NonSerialized]
3747 public bool lowObj;
3748
3749 // Token: 0x04000B9B RID: 2971
3750 [NonSerialized]
3751 public bool highlightArea;
3752
3753 // Token: 0x04000B9C RID: 2972
3754 [NonSerialized]
3755 public bool subtleHighlightArea;
3756
3757 // Token: 0x04000B9D RID: 2973
3758 [NonSerialized]
3759 public bool hideRoomFog;
3760
3761 // Token: 0x04000B9E RID: 2974
3762 [NonSerialized]
3763 public bool showRoof;
3764
3765 // Token: 0x04000B9F RID: 2975
3766 [NonSerialized]
3767 public bool showFullWall;
3768
3769 // Token: 0x04000BA0 RID: 2976
3770 [NonSerialized]
3771 public bool hideHang;
3772
3773 // Token: 0x04000BA1 RID: 2977
3774 [NonSerialized]
3775 public bool usingHouseBoard;
3776
3777 // Token: 0x04000BA2 RID: 2978
3778 [NonSerialized]
3779 public bool noRoofMode;
3780
3781 // Token: 0x04000BA3 RID: 2979
3782 [NonSerialized]
3783 public bool fogged;
3784
3785 // Token: 0x04000BA4 RID: 2980
3786 [NonSerialized]
3787 public float[] lightLookUp;
3788
3789 // Token: 0x04000BA5 RID: 2981
3790 [NonSerialized]
3791 public float _lightMod;
3792
3793 // Token: 0x04000BA6 RID: 2982
3794 [NonSerialized]
3795 public float _baseBrightness;
3796
3797 // Token: 0x04000BA7 RID: 2983
3798 [NonSerialized]
3799 public float lowblockTimer;
3800
3801 // Token: 0x04000BA8 RID: 2984
3802 [NonSerialized]
3803 public float heightLightMod;
3804
3805 // Token: 0x04000BA9 RID: 2985
3806 [NonSerialized]
3807 public float _rightWallShade;
3808
3809 // Token: 0x04000BAA RID: 2986
3810 [NonSerialized]
3811 public float roofLightLimitMod;
3812
3813 // Token: 0x04000BAB RID: 2987
3814 [NonSerialized]
3815 public float floatY;
3816
3817 // Token: 0x04000BAC RID: 2988
3818 [NonSerialized]
3819 public float floorShadowStrength;
3820
3821 // Token: 0x04000BAD RID: 2989
3822 [NonSerialized]
3823 public Vector3 _heightMod;
3824
3825 // Token: 0x04000BAE RID: 2990
3826 [NonSerialized]
3827 public BaseTileMap.ScreenHighlight screenHighlight;
3828
3829 // Token: 0x04000BAF RID: 2991
3830 protected RaycastHit2D[] rays = new RaycastHit2D[1];
3831
3832 // Token: 0x04000BB0 RID: 2992
3833 protected BaseTileMap.CardIconMode iconMode;
3834
3835 // Token: 0x04000BB1 RID: 2993
3836 protected bool isMining;
3837
3838 // Token: 0x04000BB2 RID: 2994
3839 protected bool buildMode;
3840
3841 // Token: 0x04000BB3 RID: 2995
3842 protected bool hasBridge;
3843
3844 // Token: 0x04000BB4 RID: 2996
3845 protected bool _lowblock;
3846
3847 // Token: 0x04000BB5 RID: 2997
3848 protected bool isIndoor;
3849
3850 // Token: 0x04000BB6 RID: 2998
3851 public new BaseGameScreen screen;
3852
3853 // Token: 0x04000BB7 RID: 2999
3854 protected Map map;
3855
3856 // Token: 0x04000BB8 RID: 3000
3857 protected MeshPass pass;
3858
3859 // Token: 0x04000BB9 RID: 3001
3860 protected BaseTileSelector selector;
3861
3862 // Token: 0x04000BBA RID: 3002
3863 protected GameSetting.RenderSetting renderSetting;
3864
3865 // Token: 0x04000BBB RID: 3003
3866 protected GameSetting.RenderSetting.ZSetting zSetting;
3867
3868 // Token: 0x04000BBC RID: 3004
3869 protected int liquidLv;
3870
3871 // Token: 0x04000BBD RID: 3005
3872 protected int index;
3873
3874 // Token: 0x04000BBE RID: 3006
3875 protected int totalFire;
3876
3877 // Token: 0x04000BBF RID: 3007
3878 protected int snowColorToken;
3879
3880 // Token: 0x04000BC0 RID: 3008
3881 protected int waterAnimeIndex;
3882
3883 // Token: 0x04000BC1 RID: 3009
3884 protected int lowWallObjAltitude;
3885
3886 // Token: 0x04000BC2 RID: 3010
3887 protected SourceMaterial.Row matBlock;
3888
3889 // Token: 0x04000BC3 RID: 3011
3890 protected SourceMaterial.Row matFloor;
3891
3892 // Token: 0x04000BC4 RID: 3012
3893 protected SourceMaterial.Row matBridge;
3894
3895 // Token: 0x04000BC5 RID: 3013
3896 protected float blockLight;
3897
3898 // Token: 0x04000BC6 RID: 3014
3899 protected float floorLight;
3900
3901 // Token: 0x04000BC7 RID: 3015
3902 protected float floorLight2;
3903
3904 // Token: 0x04000BC8 RID: 3016
3905 protected float light;
3906
3907 // Token: 0x04000BC9 RID: 3017
3908 protected float pcMaxLight;
3909
3910 // Token: 0x04000BCA RID: 3018
3911 protected float orgX;
3912
3913 // Token: 0x04000BCB RID: 3019
3914 protected float orgY;
3915
3916 // Token: 0x04000BCC RID: 3020
3917 protected float orgZ;
3918
3919 // Token: 0x04000BCD RID: 3021
3920 protected float roomHeight;
3921
3922 // Token: 0x04000BCE RID: 3022
3923 protected float maxHeight;
3924
3925 // Token: 0x04000BCF RID: 3023
3926 protected float snowLight;
3927
3928 // Token: 0x04000BD0 RID: 3024
3929 protected float waterAnimeTimer;
3930
3931 // Token: 0x04000BD1 RID: 3025
3932 protected float floatTimer;
3933
3934 // Token: 0x04000BD2 RID: 3026
3935 protected float destBrightness;
3936
3937 // Token: 0x04000BD3 RID: 3027
3938 protected float lightLimit;
3939
3940 // Token: 0x04000BD4 RID: 3028
3941 protected float modSublight1;
3942
3943 // Token: 0x04000BD5 RID: 3029
3944 protected float modSublight2;
3945
3946 // Token: 0x04000BD6 RID: 3030
3947 protected float shadowStrength;
3948
3949 // Token: 0x04000BD7 RID: 3031
3950 protected float _shadowStrength;
3951
3952 // Token: 0x04000BD8 RID: 3032
3953 protected float fogBrightness;
3954
3955 // Token: 0x04000BD9 RID: 3033
3956 protected float defaultBlockHeight;
3957
3958 // Token: 0x04000BDA RID: 3034
3959 protected float snowLimit;
3960
3961 // Token: 0x04000BDB RID: 3035
3962 protected float snowColor;
3963
3964 // Token: 0x04000BDC RID: 3036
3965 protected float snowColor2;
3966
3967 // Token: 0x04000BDD RID: 3037
3968 protected float nightRatio;
3969
3970 // Token: 0x04000BDE RID: 3038
3971 protected RenderParam param = new RenderParam();
3972
3973 // Token: 0x04000BDF RID: 3039
3974 protected MeshBatch batch;
3975
3976 // Token: 0x04000BE0 RID: 3040
3977 protected Vector3 _actorPos;
3978
3979 // Token: 0x04000BE1 RID: 3041
3980 protected Vector3 freePos;
3981
3982 // Token: 0x04000BE2 RID: 3042
3983 protected int tile;
3984
3985 // Token: 0x04000BE3 RID: 3043
3986 protected int floorMatColor;
3987
3988 // Token: 0x04000BE4 RID: 3044
3989 protected int height;
3990
3991 // Token: 0x04000BE5 RID: 3045
3992 protected int currentHeight;
3993
3994 // Token: 0x04000BE6 RID: 3046
3995 protected int pcX;
3996
3997 // Token: 0x04000BE7 RID: 3047
3998 protected int pcZ;
3999
4000 // Token: 0x04000BE8 RID: 3048
4001 protected int floorDir;
4002
4003 // Token: 0x04000BE9 RID: 3049
4004 protected bool roof;
4005
4006 // Token: 0x04000BEA RID: 3050
4007 protected bool isSeen;
4008
4009 // Token: 0x04000BEB RID: 3051
4010 protected bool showAllCards;
4011
4012 // Token: 0x04000BEC RID: 3052
4013 protected bool fogBounds;
4014
4015 // Token: 0x04000BED RID: 3053
4016 protected bool snowed;
4017
4018 // Token: 0x04000BEE RID: 3054
4019 protected bool isSnowCovered;
4020
4021 // Token: 0x04000BEF RID: 3055
4022 protected bool highlightCells;
4023
4024 // Token: 0x04000BF0 RID: 3056
4025 protected bool cinemaMode;
4026
4027 // Token: 0x04000BF1 RID: 3057
4028 protected bool alwaysLowblock;
4029
4030 // Token: 0x04000BF2 RID: 3058
4031 protected bool showBorder;
4032
4033 // Token: 0x04000BF3 RID: 3059
4034 protected Vector3 thingPos;
4035
4036 // Token: 0x04000BF4 RID: 3060
4037 protected Vector3 orgPos;
4038
4039 // Token: 0x04000BF5 RID: 3061
4040 protected Cell cell;
4041
4042 // Token: 0x04000BF6 RID: 3062
4043 protected CellDetail detail;
4044
4045 // Token: 0x04000BF7 RID: 3063
4046 protected SourceBlock.Row sourceBlock;
4047
4048 // Token: 0x04000BF8 RID: 3064
4049 protected SourceFloor.Row sourceFloor;
4050
4051 // Token: 0x04000BF9 RID: 3065
4052 protected SourceFloor.Row sourceBridge;
4053
4054 // Token: 0x04000BFA RID: 3066
4055 protected Room currentRoom;
4056
4057 // Token: 0x04000BFB RID: 3067
4058 protected Room lastRoom;
4059
4060 // Token: 0x04000BFC RID: 3068
4061 protected Room room;
4062
4063 // Token: 0x04000BFD RID: 3069
4064 protected Lot currentLot;
4065
4066 // Token: 0x04000BFE RID: 3070
4067 protected SourceBlock.Row _sourceBlock;
4068
4069 // Token: 0x04000BFF RID: 3071
4070 protected TileType tileType;
4071
4072 // Token: 0x04000C00 RID: 3072
4073 protected SceneLightProfile lightSetting;
4074
4075 // Token: 0x04000C01 RID: 3073
4076 private bool noSlopMode;
4077
4078 // Token: 0x04000C02 RID: 3074
4079 public RoofStyle[] roofStyles;
4080
4081 // Token: 0x04000C03 RID: 3075
4082 public const int DefColor = 104025;
4083
4084 // Token: 0x04000C04 RID: 3076
4085 public const int BlocklightToken = 262144;
4086
4087 // Token: 0x04000C05 RID: 3077
4088 public const int BlocklightMTP = 50;
4089
4090 // Token: 0x02000890 RID: 2192
4091 public enum WallClipMode
4092 {
4093 // Token: 0x04002491 RID: 9361
4094 ByRoom,
4095 // Token: 0x04002492 RID: 9362
4096 ByLot
4097 }
4098
4099 // Token: 0x02000891 RID: 2193
4100 public enum InnerMode
4101 {
4102 // Token: 0x04002494 RID: 9364
4103 None,
4104 // Token: 0x04002495 RID: 9365
4105 InnerBlock,
4106 // Token: 0x04002496 RID: 9366
4107 Height,
4108 // Token: 0x04002497 RID: 9367
4109 BuildMode
4110 }
4111
4112 // Token: 0x02000892 RID: 2194
4113 public enum CardIconMode
4114 {
4115 // Token: 0x04002499 RID: 9369
4116 None,
4117 // Token: 0x0400249A RID: 9370
4118 Inspect,
4119 // Token: 0x0400249B RID: 9371
4120 Deconstruct,
4121 // Token: 0x0400249C RID: 9372
4122 State,
4123 // Token: 0x0400249D RID: 9373
4124 Visibility
4125 }
4126
4127 // Token: 0x02000893 RID: 2195
4128 public enum ScreenHighlight
4129 {
4130 // Token: 0x0400249F RID: 9375
4131 None,
4132 // Token: 0x040024A0 RID: 9376
4133 SunMap
4134 }
4135}
Definition Card.cs:13
Definition Cell.cs:10
Definition Chara.cs:12
Definition EMono.cs:6
Definition FLOOR.cs:5
Definition Lot.cs:7
Definition Map.cs:15
Definition Point.cs:11
Definition Room.cs:6
Definition Scene.cs:10
Definition Thing.cs:10
Definition Zone.cs:14