Elin Decompiled Documentation EA 23.130 Nightly
Loading...
Searching...
No Matches
BaseTileMap.cs
Go to the documentation of this file.
1using System;
2using NoiseSystem;
3using UnityEngine;
4
5public class BaseTileMap : EMono
6{
7 public enum WallClipMode
8 {
9 ByRoom,
10 ByLot
11 }
12
13 public enum InnerMode
14 {
15 None,
17 Height,
19 }
20
21 public enum CardIconMode
22 {
23 None,
24 Inspect,
26 State,
28 }
29
30 public enum ScreenHighlight
31 {
32 None,
33 SunMap
34 }
35
36 public static bool forceShowHang;
37
38 public int count;
39
40 [Header("Mouse Hit")]
41 public Collider2D mouseCollider;
42
43 public Vector3 colliderFix;
44
45 public int maxColliderCheck;
46
47 [Header("Height")]
48 public float heightBlockSize;
49
50 public float slopeFixZ;
51
52 public float heightModDeco;
53
54 public float heightLimitDeco;
55
56 public Vector3 heightMod;
57
58 public Vector3 ugFix;
59
60 public Vector3 ugFixBridge;
61
62 public Vector3 ugFixBridgeBottom;
63
64 public Vector3 ugFixBridgeTop;
65
66 public Vector3 heightModRoofBlock;
67
68 [Header("Room")]
69 public float rightWallShade;
70
71 public Vector3 roofRampFix;
72
73 public Vector3 roofFix;
74
75 public Vector3 roofFix2;
76
77 public Vector3 roofFix3;
78
79 public float roofLightMod;
80
81 public float lotLight;
82
83 public float lotLight2;
84
85 public float roofLightSnow;
86
87 [Header("Other")]
89
91
92 public Vector3 edgeBlockFix;
93
94 public Vector3 bridgeFix;
95
96 public Vector3 cornerWallFix;
97
98 public Vector3 cornerWallFix2;
99
100 public Vector3 cornerWallFix3;
101
102 public Vector3 altitudeFix;
103
104 public Vector3 waterEdgeFix;
105
106 public Vector3 waterEdgeBridgeFix;
107
108 public Vector3 waterEdgeFixShore;
109
110 public Vector3 waterEdgeFixShoreSand;
111
112 public Vector3[] ambientShadowFix;
113
114 public Vector3[] transitionFix;
115
116 public Vector3[] wallHangFix;
117
118 public Vector3[] waterEdgeBlockFix;
119
120 public int fogTile;
121
122 public float floatSpeed;
123
124 public float shadowModStrength;
125
126 public int maxFloat;
127
128 public int[] seaAnimeIndexes;
129
130 [Header("References")]
131 public NoiseLayer layerGroundLights;
132
134
136
138
140
142
144
146
148
150
152
154
156
158
160
162
164
166
168
170
172
174
176
178
180
182
184
186
188
190
192
194
196
198
200
202
204
206
208
210
212
214
216
218
220
222
224
226
228
230
231 public Point TestPoint = new Point();
232
234
235 [NonSerialized]
236 public int Size;
237
238 [NonSerialized]
239 public int SizeXZ;
240
241 [NonSerialized]
242 public int mx;
243
244 [NonSerialized]
245 public int mz;
246
247 [NonSerialized]
248 public int x;
249
250 [NonSerialized]
251 public int z;
252
253 [NonSerialized]
254 public int cx;
255
256 [NonSerialized]
257 public int cz;
258
259 [NonSerialized]
260 public int activeCount;
261
262 [NonSerialized]
263 public int floatV = 1;
264
265 [NonSerialized]
266 public byte[] groundLights;
267
268 [NonSerialized]
269 public bool lowBlock;
270
271 [NonSerialized]
272 public bool lowObj;
273
274 [NonSerialized]
275 public bool highlightArea;
276
277 [NonSerialized]
279
280 [NonSerialized]
281 public bool hideRoomFog;
282
283 [NonSerialized]
284 public bool showRoof;
285
286 [NonSerialized]
287 public bool showFullWall;
288
289 [NonSerialized]
290 public bool hideHang;
291
292 [NonSerialized]
293 public bool usingHouseBoard;
294
295 [NonSerialized]
296 public bool noRoofMode;
297
298 [NonSerialized]
299 public bool fogged;
300
301 [NonSerialized]
302 public float[] lightLookUp;
303
304 [NonSerialized]
305 public float _lightMod;
306
307 [NonSerialized]
308 public float _baseBrightness;
309
310 [NonSerialized]
311 public float lowblockTimer;
312
313 [NonSerialized]
314 public float heightLightMod;
315
316 [NonSerialized]
317 public float _rightWallShade;
318
319 [NonSerialized]
320 public float roofLightLimitMod;
321
322 [NonSerialized]
323 public float floatY;
324
325 [NonSerialized]
327
328 [NonSerialized]
329 public Vector3 _heightMod;
330
331 [NonSerialized]
333
334 protected RaycastHit2D[] rays = new RaycastHit2D[1];
335
337
338 protected bool isMining;
339
340 protected bool buildMode;
341
342 protected bool hasBridge;
343
344 protected bool _lowblock;
345
346 protected bool isIndoor;
347
349
350 protected Map map;
351
352 protected MeshPass pass;
353
355
357
359
360 protected int liquidLv;
361
362 protected int index;
363
364 protected int totalFire;
365
366 protected int snowColorToken;
367
368 protected int waterAnimeIndex;
369
370 protected int lowWallObjAltitude;
371
373
375
377
378 protected float blockLight;
379
380 protected float floorLight;
381
382 protected float floorLight2;
383
384 protected float light;
385
386 protected float pcMaxLight;
387
388 protected float orgX;
389
390 protected float orgY;
391
392 protected float orgZ;
393
394 protected float roomHeight;
395
396 protected float maxHeight;
397
398 protected float snowLight;
399
400 protected float waterAnimeTimer;
401
402 protected float floatTimer;
403
404 protected float destBrightness;
405
406 protected float lightLimit;
407
408 protected float modSublight1;
409
410 protected float modSublight2;
411
412 protected float shadowStrength;
413
414 protected float _shadowStrength;
415
416 protected float fogBrightness;
417
418 protected float defaultBlockHeight;
419
420 protected float snowLimit;
421
422 protected float snowColor;
423
424 protected float snowColor2;
425
426 protected float nightRatio;
427
428 protected RenderParam param = new RenderParam();
429
430 protected MeshBatch batch;
431
432 protected Vector3 _actorPos;
433
434 protected Vector3 freePos;
435
436 protected int tile;
437
438 protected int floorMatColor;
439
440 protected int height;
441
442 protected int currentHeight;
443
444 protected int pcX;
445
446 protected int pcZ;
447
448 protected int floorDir;
449
450 protected bool roof;
451
452 protected bool isSeen;
453
454 protected bool showAllCards;
455
456 protected bool fogBounds;
457
458 protected bool snowed;
459
460 protected bool isSnowCovered;
461
462 protected bool highlightCells;
463
464 protected bool cinemaMode;
465
466 protected bool alwaysLowblock;
467
468 protected bool showBorder;
469
470 protected Vector3 thingPos;
471
472 protected Vector3 orgPos;
473
474 protected Cell cell;
475
477
479
481
483
484 protected Room currentRoom;
485
486 protected Room lastRoom;
487
488 protected Room room;
489
490 protected Lot currentLot;
491
493
495
497
498 private bool noSlopMode;
499
501
502 public const int DefColor = 104025;
503
504 public const int BlocklightToken = 262144;
505
506 public const int BlocklightMTP = 50;
507
509
510 public void OnActivate(BaseGameScreen _screen)
511 {
512 screen = _screen;
513 if (lightLookUp == null)
514 {
515 lightLookUp = new float[256];
516 for (int i = 0; i < 256; i++)
517 {
518 lightLookUp[i] = EMono.scene.profile.global.lightLookupCurve.Evaluate((float)i / 255f);
519 }
520 }
523 zSetting = renderSetting.zSetting;
524 RenderObject.syncList = EMono.scene.syncList;
525 RenderObject.altitudeFix = altitudeFix.y;
526 if (Rand.bytes == null)
527 {
528 Rand.InitBytes(1);
529 }
531 }
532
533 public virtual void Draw()
534 {
535 Zone zone = EMono._zone;
536 map = zone.map;
537 Size = map.Size;
538 SizeXZ = map.SizeXZ;
540 count = 0;
541 totalFire = 0;
542 pcX = EMono.pc.pos.x;
543 pcZ = EMono.pc.pos.z;
546 lightSetting = profile.light;
549 {
550 buildMode = false;
551 }
553 isMining = EMono.scene.actionMode == ActionMode.Mine;
557 subtleHighlightArea = EMono.scene.actionMode.AreaHihlight != 0 && (EMono.scene.actionMode.AreaHihlight == AreaHighlightMode.Build || EMono.scene.actionMode.AreaHihlight != AreaHighlightMode.Edit);
558 highlightArea = EMono.scene.actionMode.AreaHihlight == AreaHighlightMode.Edit || subtleHighlightArea;
560 _rightWallShade = (int)(50f * rightWallShade) * 262144;
563 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);
564 snowLimit = profile.global.snowLimit.Evaluate(EMono.scene.timeRatio);
565 snowLight = profile.global.snowLight;
566 snowColor = profile.global.snowColor;
567 snowColor2 = profile.global.snowColor2;
568 snowColorToken = (int)((float)profile.global.snowRGB.x * nightRatio) * 4096 + (int)((float)profile.global.snowRGB.y * nightRatio) * 64 + (int)((float)profile.global.snowRGB.z * nightRatio);
571 {
573 }
574 roofLightLimitMod = profile.global.roofLightLimitMod.Evaluate(EMono.scene.timeRatio);
575 fogBounds = (EMono._map.config.forceHideOutbounds && (!EMono.debug.godBuild || !buildMode)) || (EMono.core.config.game.dontRenderOutsideMap && !buildMode);
576 heightLightMod = ((EMono._map.config.heightLightMod == 0f) ? 0.005f : EMono._map.config.heightLightMod);
577 modSublight1 = profile.global.modSublight1;
578 modSublight2 = profile.global.modSublight2 * nightRatio;
579 pcMaxLight = EMono.player.lightPower * 2f * (float)(EMono.player.lightRadius - 2);
582 _lightMod = lightSetting.lightMod * lightSetting.lightModCurve.Evaluate(EMono.scene.timeRatio);
583 destBrightness = lightSetting.baseBrightness * lightSetting.baseBrightnessCurve.Evaluate(EMono.scene.timeRatio);
584 float num = destBrightness;
585 destBrightness = destBrightness * lightSetting.dynamicBrightnessCurve2.Evaluate(EMono.scene.timeRatio) + lightSetting.dynamicBrightnessCurve.Evaluate(EMono.scene.timeRatio) * (float)(int)EMono.pc.pos.cell.light + ((EMono.pc.pos.cell.light == 0) ? 0f : lightSetting.dynamicBrightnessLightBonus);
586 if (destBrightness > num)
587 {
588 destBrightness = num;
589 }
590 if (!Mathf.Approximately(_baseBrightness, destBrightness))
591 {
593 }
594 if (activeCount == 0)
595 {
597 }
598 activeCount++;
600 {
601 _baseBrightness = 0.7f;
602 }
603 Fov.nonGradientMod = profile.global.fovModNonGradient;
606 float num2 = Core.delta * (float)EMono.game.config.animeSpeed * 0.01f;
607 floatTimer += num2;
609 {
611 floatY += floatV;
612 if (floatY >= (float)maxFloat)
613 {
614 floatV *= -1;
615 }
616 if (floatY < 0f)
617 {
618 floatV *= -1;
619 }
620 }
621 waterAnimeTimer += num2;
622 if (waterAnimeTimer > 0.5f)
623 {
624 waterAnimeTimer = 0f;
626 }
627 if (cinemaMode)
628 {
629 CinemaConfig cinemaConfig = EMono.player.cinemaConfig;
630 profile = ActionMode.Cinema.profile;
631 lightSetting = profile.light;
633 _lightMod += lightSetting.lightMod * lightSetting.lightModCurve.Evaluate(EMono.scene.timeRatio) * (0.01f * (float)cinemaConfig.light);
634 destBrightness += 0.01f * (float)cinemaConfig.brightness;
635 EMono.scene.camSupport.grading.cinemaBrightness = 0.01f * (float)cinemaConfig.brightness;
636 EMono.scene.camSupport.grading.SetGrading();
637 heightLightMod = 0f;
638 }
639 map.rooms.Refresh();
640 noSlopMode = EInput.isAltDown && EInput.isShiftDown;
644 {
647 }
648 else
649 {
650 currentHeight = 0;
651 currentRoom = null;
652 }
653 lowObj = false;
655 noRoofMode = false;
656 bool flag = !isIndoor || EMono._zone is Zone_Tent;
658 {
659 lowBlock = (hideRoomFog = (hideHang = false));
660 showRoof = (showFullWall = flag);
662 {
663 fogBounds = false;
664 }
665 }
666 else if (buildMode)
667 {
669 if (HitPoint.IsValid)
670 {
672 }
673 hideRoomFog = true;
678 if (cinemaMode)
679 {
681 }
682 }
683 else if (ActionMode.IsAdv)
684 {
685 noRoofMode = EMono.game.config.noRoof || screen.focusOption != null;
687 {
688 if (!EMono.pc.IsMoving)
689 {
690 lowblockTimer = 0.1f;
691 }
692 }
693 else if (!EInput.rightMouse.pressing)
694 {
695 lowblockTimer = 0f;
696 }
697 x = EMono.pc.pos.x;
698 z = EMono.pc.pos.z;
699 Room room = null;
700 if (room != null)
701 {
703 }
704 if (currentRoom != null)
705 {
706 currentRoom.data.visited = true;
707 }
708 if (room != null)
709 {
710 room.data.visited = true;
711 }
712 lowBlock = lowblockTimer > 0f;
713 hideRoomFog = currentRoom != null && (currentRoom.HasRoof || isIndoor);
714 if (hideRoomFog)
715 {
716 lowBlock = true;
717 }
718 if (noRoofMode && (currentRoom == null || currentRoom.lot.idRoofStyle == 0))
719 {
720 hideRoomFog = true;
721 showRoof = (showFullWall = false);
722 }
723 else
724 {
725 showRoof = (showFullWall = flag && !lowBlock && !hideRoomFog);
726 }
728 EMono.game.config.showRoof = !hideRoomFog;
729 if (forceShowHang)
730 {
731 hideHang = false;
732 forceShowHang = false;
733 }
734 }
735 else
736 {
737 lowBlock = (hideRoomFog = (hideHang = false));
738 showRoof = (showFullWall = true);
739 }
740 currentLot = currentRoom?.lot ?? null;
741 Vector3 mposWorld = EInput.mposWorld;
742 mposWorld.z = 0f;
743 Vector3Int vector3Int = screen.grid.WorldToCell(mposWorld);
744 mx = -vector3Int.y;
745 mz = vector3Int.x - 1;
746 HitPoint.Set(mx, mz);
747 bool isAltDown = EInput.isAltDown;
748 for (int num3 = maxColliderCheck; num3 >= 0; num3--)
749 {
750 TestPoint.x = mx + num3;
751 TestPoint.z = mz - num3;
752 if (TestPoint.x >= 0 && TestPoint.x < Size && TestPoint.z >= 0 && TestPoint.z < Size)
753 {
754 mouseCollider.transform.position = (isAltDown ? TestPoint.Position(TestPoint.cell.height) : TestPoint.Position()) + colliderFix;
755 Physics2D.SyncTransforms();
756 if (Physics2D.RaycastNonAlloc(mposWorld, Vector2.zero, rays) > 0)
757 {
759 break;
760 }
761 }
762 TestPoint.x = mx + num3 - 1;
763 TestPoint.z = mz - num3;
764 if (TestPoint.x >= 0 && TestPoint.x < Size && TestPoint.z >= 0 && TestPoint.z < Size)
765 {
766 mouseCollider.transform.position = (isAltDown ? TestPoint.Position(TestPoint.cell.height) : TestPoint.Position()) + colliderFix;
767 Physics2D.SyncTransforms();
768 if (Physics2D.RaycastNonAlloc(mposWorld, Vector2.zero, rays) > 0)
769 {
771 break;
772 }
773 }
774 TestPoint.x = mx + num3;
775 TestPoint.z = mz - num3 + 1;
776 if (TestPoint.x >= 0 && TestPoint.x < Size && TestPoint.z >= 0 && TestPoint.z < Size)
777 {
778 mouseCollider.transform.position = (isAltDown ? TestPoint.Position(TestPoint.cell.height) : TestPoint.Position()) + colliderFix;
779 Physics2D.SyncTransforms();
780 if (Physics2D.RaycastNonAlloc(mposWorld, Vector2.zero, rays) > 0)
781 {
783 break;
784 }
785 }
786 }
787 HitPoint.Clamp();
788 bool flag2 = EMono._zone.UseFog && !EMono.scene.bg.wall;
789 for (z = 0; z < screen.height; z++)
790 {
791 for (x = 0; x < screen.width; x++)
792 {
793 cx = screen.scrollX - screen.scrollY + x - (z + 1) / 2;
794 cz = screen.scrollY + screen.scrollX + x + z / 2;
795 if (((cz < 0 && cx >= -cz && cx > 0 && cx < Size - cz) || (cx >= Size && cx < Size * 2 - cz - 1 && cz >= -cx && cz < Size - 1)) && EMono.scene.bg.wall)
796 {
797 param.x = (float)(cx + cz) * screen.tileAlign.x + edgeBlockFix.x;
798 param.y = (float)(cz - cx) * screen.tileAlign.y + edgeBlockFix.y;
799 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)z * edgeBlockFix.z;
800 blockLight = 10485760f;
801 pass = passInner;
803 batch.matrices[pass.idx].m03 = param.x;
804 batch.matrices[pass.idx].m13 = param.y;
805 batch.matrices[pass.idx].m23 = param.z;
806 batch.tiles[pass.idx] = 4 + ((cx >= Size) ? 1 : 0);
808 batch.matColors[pass.idx] = 104025f;
809 pass.idx++;
810 if (pass.idx == pass.batchSize)
811 {
812 pass.NextBatch();
813 }
814 }
815 else if (cx < 0 || cz < 0 || cx >= Size || cz >= Size)
816 {
817 if (flag2)
818 {
819 param.x = (float)(cx + cz) * screen.tileAlign.x;
820 param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y;
821 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z;
822 param.tile = 0f;
824 }
825 }
826 else
827 {
828 DrawTile();
829 }
830 }
831 }
832 if (showRoof)
833 {
834 foreach (Lot item in map.rooms.listLot)
835 {
836 if (item.sync)
837 {
838 DrawRoof(item);
839 item.sync = false;
840 item.light = 0f;
841 }
842 }
843 }
844 else
845 {
846 foreach (Lot item2 in map.rooms.listLot)
847 {
848 item2.sync = false;
849 item2.light = 0f;
850 }
851 }
852 EMono.scene.sfxFire.SetVolume(Mathf.Clamp(0.1f * (float)totalFire + ((totalFire != 0) ? 0.2f : 0f), 0f, 1f));
853 this.room = EMono.pc.pos.cell.room;
854 int valueOrDefault = (this.room?.lot?.idBGM).GetValueOrDefault();
855 if (valueOrDefault == 0)
856 {
857 goto IL_1671;
858 }
859 if (!(EMono.Sound.currentPlaylist != EMono.Sound.plLot))
860 {
861 BGMData data = EMono.Sound.plLot.list[0].data;
862 if ((object)data != null && data.id == valueOrDefault)
863 {
864 goto IL_1671;
865 }
866 }
867 goto IL_1690;
868 IL_169a:
869 if (this.room != lastRoom)
870 {
872 lastRoom = this.room;
873 }
874 SoundManager.bgmVolumeMod = ((!LayerDrama.maxBGMVolume && !EMono._map.IsIndoor && this.room != null && !this.room.data.atrium && this.room.HasRoof) ? (-0.6f) : 0f);
876 return;
877 IL_1690:
879 goto IL_169a;
880 IL_1671:
881 if (valueOrDefault == 0 && EMono.Sound.currentPlaylist == EMono.Sound.plLot)
882 {
883 goto IL_1690;
884 }
885 goto IL_169a;
886 }
887
888 public void RefreshHeight()
889 {
890 if (EMono.game != null)
891 {
892 float num = (((buildMode && !EMono.game.config.slope) || noSlopMode) ? 0f : ((float)EMono.game.config.slopeMod * 0.01f));
894 _heightMod.x = num;
895 _heightMod.y *= num;
896 _heightMod.z *= num;
897 }
898 }
899
900 public virtual void DrawTile()
901 {
902 count++;
903 index = cx + cz * Size;
904 this.cell = (param.cell = map.cells[cx, cz]);
905 detail = this.cell.detail;
906 isSeen = this.cell.isSeen;
907 this.room = this.cell.room;
908 roof = this.cell.HasRoof;
909 matBlock = this.cell.matBlock;
910 sourceBlock = this.cell.sourceBlock;
911 bool flag = this.cell.isFloating;
912 snowed = isSnowCovered && !roof && !this.cell.isClearSnow && !this.cell.isDeck && !flag;
914 floorDir = this.cell.floorDir;
915 if (snowed && !this.cell.sourceFloor.ignoreSnow)
916 {
917 if (this.cell.IsFloorWater)
918 {
920 matFloor = this.cell.matFloor;
921 }
922 else
923 {
924 if (this.cell.sourceObj.snowTile > 0)
925 {
927 floorDir = this.cell.sourceObj.snowTile - 1;
928 }
929 else if (index % 3 == 0 && Rand.bytes[index % Rand.MaxBytes] < 8 && !this.cell.HasObj && this.cell.FirstThing == null)
930 {
933 }
934 else
935 {
937 }
939 }
940 }
941 else
942 {
943 sourceFloor = this.cell.sourceFloor;
944 matFloor = this.cell.matFloor;
945 }
946 bool isWater = sourceFloor.tileType.IsWater;
947 light = (this.cell.pcSync ? this.cell.light : (this.cell.light / 3 * 2));
949 height = this.cell.height;
950 hasBridge = this.cell._bridge != 0;
952 if (hasBridge)
953 {
954 if (this.cell.bridgeHeight < currentHeight)
955 {
956 blockLight -= heightLightMod * (float)(currentHeight - this.cell.bridgeHeight);
957 }
958 if (snowed && !this.cell.sourceBridge.ignoreSnow)
959 {
960 if (this.cell.IsBridgeWater)
961 {
963 matBridge = this.cell.matBridge;
964 }
965 else
966 {
969 }
970 }
971 else
972 {
973 sourceBridge = this.cell.sourceBridge;
974 matBridge = this.cell.matBridge;
975 }
976 }
977 else if (height < currentHeight)
978 {
980 }
981 liquidLv = (param.liquidLv = ((!flag) ? (((this.cell.liquidLv + this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.LiquidLV : sourceFloor.tileType.LiquidLV) * 10) : 0));
982 if (this.cell.shore != 0 && liquidLv > 20)
983 {
984 liquidLv = (param.liquidLv = 20);
985 }
986 if (liquidLv > 99)
987 {
988 liquidLv = (param.liquidLv = 99);
989 }
990 CellEffect effect = this.cell.effect;
991 if (effect != null && effect.IsFire)
992 {
993 blockLight += 0.2f;
994 totalFire++;
995 }
997 {
999 }
1000 blockLight += shadowModStrength * (float)(int)this.cell.shadowMod * _heightMod.x * _shadowStrength;
1001 if (this.room != null)
1002 {
1003 this.room.lot.sync = true;
1004 if (this.room.lot.light < blockLight)
1005 {
1006 this.room.lot.light = blockLight;
1007 }
1008 }
1009 if (currentLot != null && currentLot.idRoofStyle != 0)
1010 {
1011 bool flag2 = this.cell.IsRoomEdge && (this.cell.Front.room?.lot == currentLot || this.cell.Right.room?.lot == currentLot || this.cell.FrontRight.room?.lot == currentLot);
1012 if (!buildMode)
1013 {
1014 if ((this.room != null && this.room.lot == currentLot) || flag2)
1015 {
1017 }
1018 else
1019 {
1020 blockLight += (isSnowCovered ? (-0.02f) : lotLight2);
1021 }
1022 }
1023 }
1024 if (this.cell.outOfBounds && !cinemaMode)
1025 {
1026 blockLight -= 0.1f;
1027 if (fogBounds)
1028 {
1029 isSeen = false;
1030 }
1031 }
1033 param.color = (blockLight = (int)(blockLight * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB));
1034 if (snowed)
1035 {
1038 {
1040 }
1041 floorLight = (int)(floorLight * 50f) * 262144 + (int)((float)((this.cell.lightR >= 50) ? 50 : this.cell.lightR) * snowColor) * 4096 + (int)((float)((this.cell.lightG >= 50) ? 50 : this.cell.lightG) * snowColor) * 64 + (int)((float)((this.cell.lightB >= 50) ? 50 : this.cell.lightB) * snowColor) + snowColorToken;
1042 }
1043 else if (isSnowCovered && !roof)
1044 {
1045 floorLight = (int)(floorLight * 50f) * 262144 + (int)((float)((this.cell.lightR >= 50) ? 50 : this.cell.lightR) * snowColor2) * 4096 + (int)((float)((this.cell.lightG >= 50) ? 50 : this.cell.lightG) * snowColor2) * 64 + (int)((float)((this.cell.lightB >= 50) ? 50 : this.cell.lightB) * snowColor2) + snowColorToken;
1046 }
1047 else
1048 {
1050 }
1051 bool num = this.room != null && sourceBlock.tileType.CastShadowSelf && !this.cell.hasDoor;
1052 bool flag3 = this.room != null && showRoof && this.room.lot.idRoofStyle != 0 && !this.room.data.atrium && !sourceBlock.tileType.Invisible;
1053 if (flag3 && this.cell.hasDoor && this.cell.IsLotEdge)
1054 {
1055 flag3 = false;
1056 }
1057 if (num || !isSeen || flag3)
1058 {
1059 floorLight += -3145728f;
1060 }
1061 if (this.cell.isWatered && !snowed)
1062 {
1063 floorLight += -2359296f;
1064 }
1065 param.snow = false;
1066 param.x = (float)(cx + cz) * screen.tileAlign.x;
1067 param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y;
1068 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z;
1069 if (flag)
1070 {
1071 param.y += 0.01f * floatY;
1072 }
1073 if (detail != null)
1074 {
1075 TransAnime anime = detail.anime;
1076 if (anime != null && anime.animeBlock)
1077 {
1078 TransAnime anime2 = detail.anime;
1079 param.x += anime2.v.x;
1080 param.y += anime2.v.y;
1081 param.z += anime2.v.z;
1082 }
1083 if (detail.designation != null)
1084 {
1086 }
1087 }
1088 if (screenHighlight != 0 && screenHighlight == ScreenHighlight.SunMap && Map.sunMap.Contains(index))
1089 {
1091 }
1092 if (this.cell._roofBlock != 0 && (isSeen || !EMono._zone.UseFog) && showRoof && !lowBlock)
1093 {
1094 SourceBlock.Row row = Cell.blockList[this.cell._roofBlock];
1095 SourceMaterial.Row row2 = Cell.matList[this.cell._roofBlockMat];
1096 this.tileType = row.tileType;
1097 param.mat = row2;
1098 param.dir = this.cell._roofBlockDir % 4;
1099 param.snow = isSnowCovered && !this.cell.isClearSnow;
1100 orgX = param.x;
1101 orgY = param.y;
1102 orgZ = param.z;
1103 SetRoofHeight(param, this.cell, cx, cz, 0, this.cell._roofBlockDir / 4, this.tileType.IsWallOrFence ? param.dir : (-1));
1104 switch (this.tileType.blockRenderMode)
1105 {
1106 case BlockRenderMode.FullBlock:
1107 param.color -= (int)(_shadowStrength * 50f) * 262144;
1108 param.tile = row._tiles[param.dir % row._tiles.Length];
1109 param.matColor = ((row.colorMod == 0) ? 104025 : GetColorInt(ref row2.matColor, row.colorMod));
1110 row.renderData.Draw(param);
1111 break;
1112 case BlockRenderMode.WallOrFence:
1113 {
1114 _lowblock = true;
1115 int dir = param.dir;
1116 if (dir == 0 || dir == 2)
1117 {
1118 param.dir = 0;
1119 _sourceBlock = row;
1120 this.tileType = _sourceBlock.tileType;
1121 if (_sourceBlock.useAltColor)
1122 {
1123 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
1124 }
1125 else
1126 {
1127 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
1128 }
1129 param.tile = (tile = _sourceBlock._tiles[0] + ((_lowblock && !this.tileType.IsFence) ? 32 : 0));
1130 _sourceBlock.renderData.Draw(param);
1131 param.z -= 0.01f;
1132 }
1133 if (dir == 1 || dir == 2)
1134 {
1135 param.dir = 1;
1136 _sourceBlock = row;
1137 this.tileType = _sourceBlock.tileType;
1138 if (_sourceBlock.useAltColor)
1139 {
1140 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
1141 }
1142 else
1143 {
1144 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
1145 }
1146 param.tile = (tile = -_sourceBlock._tiles[0] + ((_lowblock && !this.tileType.IsFence) ? (-32) : 0));
1147 _sourceBlock.renderData.Draw(param);
1148 }
1149 break;
1150 }
1151 case BlockRenderMode.HalfBlock:
1152 _sourceBlock = ((row.id == 5) ? EMono.sources.blocks.rows[row2.defBlock] : row);
1153 param.tile = _sourceBlock._tiles[0];
1154 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref row2.matColor, _sourceBlock.colorMod));
1155 param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];
1156 param.halfBlockColor = ((_sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : GetColorInt(ref row2.matColor, _sourceBlock.sourceAutoFloor.colorMod));
1157 row.renderData.Draw(param);
1158 break;
1159 case BlockRenderMode.Pillar:
1160 {
1161 RenderData renderData = row.renderData;
1162 param.tile = row._tiles[param.dir % row._tiles.Length];
1163 param.matColor = ((row.colorMod == 0) ? 104025 : GetColorInt(ref row2.matColor, row.colorMod));
1164 renderData.Draw(param);
1165 param.tile = renderData.idShadow;
1166 SourcePref shadowPref = renderData.shadowPref;
1167 int shadow2 = shadowPref.shadow;
1168 passShadow.AddShadow(param.x + renderData.offsetShadow.x, param.y + renderData.offsetShadow.y, param.z + renderData.offsetShadow.z, ShadowData.Instance.items[shadow2], shadowPref, 0, param.snow);
1169 break;
1170 }
1171 default:
1172 param.tile = row._tiles[param.dir % row._tiles.Length];
1173 param.matColor = ((row.colorMod == 0) ? 104025 : GetColorInt(ref row2.matColor, row.colorMod));
1174 row.renderData.Draw(param);
1175 break;
1176 }
1177 param.x = orgX;
1178 param.y = orgY;
1179 param.z = orgZ;
1180 param.color = blockLight;
1181 }
1182 fogged = false;
1183 bool flag4 = this.cell.isSurrounded && innerMode != 0 && sourceBlock.tileType.IsFullBlock;
1184 if (!(!isSeen || flag4))
1185 {
1186 goto IL_167b;
1187 }
1188 bool isRoomEdge = this.cell.IsRoomEdge;
1189 orgY = param.y;
1190 orgZ = param.z;
1191 param.color = (int)(50f * (_baseBrightness + fogBrightness)) * 262144;
1192 param.matColor = 104025f;
1193 if (hasBridge)
1194 {
1195 param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y + ugFixBridgeBottom.x;
1196 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
1197 }
1198 bool flag5 = (!isSeen && EMono._zone.UseFog) || flag4;
1199 if (flag5)
1200 {
1201 param.tile = 7f;
1203 param.tile = 0f;
1205 }
1206 else if (this.cell.HasFloodBlock && isRoomEdge)
1207 {
1208 param.tile = 9f;
1210 }
1211 else
1212 {
1213 param.tile = 8f;
1215 }
1216 if ((this.cell.isSlopeEdge || hasBridge) && (flag5 || !isRoomEdge))
1217 {
1218 float num2 = (float)(int)this.cell.TopHeight * _heightMod.y;
1219 param.tile = 0f;
1220 for (int i = 0; (float)i < num2 / heightBlockSize; i++)
1221 {
1222 param.y += ugFix.y;
1223 param.z += ugFix.z + slopeFixZ * (float)i;
1224 if (flag5)
1225 {
1227 }
1228 else
1229 {
1231 }
1232 }
1233 }
1234 param.y = orgY;
1235 param.z = orgZ;
1236 param.color = blockLight;
1237 if (flag5)
1238 {
1239 if (detail == null || !EMono.pc.hasTelepathy)
1240 {
1241 return;
1242 }
1243 }
1244 else
1245 {
1246 if (isRoomEdge)
1247 {
1248 goto IL_167b;
1249 }
1250 if (detail == null || !EMono.pc.hasTelepathy)
1251 {
1252 if (noRoofMode || detail == null)
1253 {
1254 return;
1255 }
1256 fogged = true;
1257 }
1258 }
1259 goto IL_7b80;
1260 IL_7b80:
1261 if (detail.things.Count == 0 && detail.charas.Count == 0)
1262 {
1263 return;
1264 }
1265 int num3 = 0;
1266 thingPos.x = 0f;
1267 thingPos.y = 0f;
1268 thingPos.z = 0f;
1269 freePos.x = (freePos.y = (freePos.z = 0f));
1270 if (this.cell.HasRamp)
1271 {
1272 Vector3 rampFix = sourceBlock.tileType.GetRampFix(this.cell.blockDir);
1273 param.x += rampFix.x;
1274 param.y += rampFix.y;
1275 param.z += rampFix.z;
1276 freePos.x += rampFix.x;
1277 freePos.y += rampFix.y;
1278 freePos.z += rampFix.z;
1279 }
1280 param.y += (flag ? 0f : ((this.cell._bridge != 0) ? this.cell.sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight));
1281 orgPos.x = (orgX = param.x);
1282 orgPos.y = (orgY = param.y);
1283 orgPos.z = (orgZ = param.z);
1284 if (flag && liquidLv > 0)
1285 {
1286 if (liquidLv > 10)
1287 {
1288 liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
1289 }
1290 liquidLv -= (int)(floatY * 0.5f);
1291 param.liquidLv = liquidLv;
1293 }
1294 Thing thing = null;
1295 bool shadow = liquidLv == 0;
1296 float num4 = 0f;
1297 float num5 = 0f;
1298 bool flag6 = false;
1299 float num6 = 0f;
1300 bool flag7 = false;
1301 float num7 = 0f;
1302 if (detail.things.Count > 0 && isSeen)
1303 {
1304 _ = zSetting.max1;
1305 float num8 = 0f;
1306 for (int j = 0; j < detail.things.Count; j++)
1307 {
1308 Thing t = detail.things[j];
1309 if ((fogged && !t.isRoofItem) || ((t.isHidden || t.trait.HideInAdv || t.isMasked) && !EMono.scene.actionMode.ShowMaskedThings) || (t.isRoofItem && ((this.room == null && !sourceBlock.tileType.IsFullBlock && !EMono._zone.IsPCFaction) || (lowBlock && !showFullWall && this.room != null) || (noRoofMode && currentRoom == null))) || (flag3 && !t.isRoofItem))
1310 {
1311 continue;
1312 }
1314 bool isInstalled = t.IsInstalled;
1315 SourcePref pref = t.Pref;
1316 if (!isInstalled && t.category.tileDummy != 0)
1317 {
1319 }
1320 float num9 = ((tileType.UseMountHeight && isInstalled) ? 0f : ((pref.height < 0f) ? 0f : ((pref.height == 0f) ? 0.1f : pref.height)));
1321 if (t.ignoreStackHeight)
1322 {
1323 thingPos.y -= num4;
1324 }
1325 shadow = thingPos.y < 0.16f && num7 < 0.16f;
1326 _ = pref.bypassShadow;
1327 param.shadowFix = 0f - thingPos.y;
1328 param.liquidLv = ((thingPos.y + (float)t.altitude < 0.1f) ? liquidLv : 0);
1329 if (t.isRoofItem)
1330 {
1331 param.snow = isSnowCovered && !this.cell.isClearSnow;
1332 SetRoofHeight(param, this.cell, cx, cz);
1333 _actorPos.x = param.x;
1334 _actorPos.y = param.y;
1335 _actorPos.z = param.z + num8;
1336 if (this.room != null)
1337 {
1338 param.color = GetRoofLight(this.room.lot);
1339 }
1340 shadow = false;
1341 param.liquidLv = 0;
1342 }
1343 else
1344 {
1345 param.snow = snowed;
1346 _actorPos.x = orgX + num5;
1347 _actorPos.y = orgY;
1348 _actorPos.z = orgZ + num8 + thingPos.z;
1349 if (tileType.CanStack || !isInstalled)
1350 {
1351 if (thing?.id != t.id)
1352 {
1353 _actorPos.x += thingPos.x;
1354 }
1355 _actorPos.y += thingPos.y;
1356 if (t.trait.IgnoreLastStackHeight && (thing == null || !thing.trait.IgnoreLastStackHeight))
1357 {
1358 thingPos.y -= num4;
1359 if (thing != null)
1360 {
1361 _actorPos.z -= 0.2f;
1362 thingPos.z -= 0.2f;
1363 }
1364 _actorPos.y -= num4;
1365 }
1366 _actorPos.z += renderSetting.thingZ + (float)j * -0.01f + zSetting.mod1 * thingPos.y;
1367 }
1368 if (isInstalled)
1369 {
1370 if (t.TileType.IsRamp)
1371 {
1372 Vector3 rampFix2 = t.TileType.GetRampFix(t.dir, pref);
1373 orgX += rampFix2.x;
1374 orgY += rampFix2.y;
1375 orgZ += rampFix2.z;
1376 freePos.x += rampFix2.x;
1377 freePos.y += rampFix2.y;
1378 freePos.z += rampFix2.z;
1379 if (!this.cell.IsTopWater || t.altitude > 0)
1380 {
1381 num7 += rampFix2.y;
1382 }
1383 liquidLv -= (int)(rampFix2.y * 150f);
1384 if (liquidLv < 0)
1385 {
1386 liquidLv = 0;
1387 }
1388 }
1389 else if (!flag7 && t.trait.IsChangeFloorHeight && !t.ignoreStackHeight)
1390 {
1391 orgY += num9 + (float)t.altitude * altitudeFix.y;
1392 orgZ += (float)t.altitude * altitudeFix.z;
1393 freePos.y += num9 + (float)t.altitude * altitudeFix.y;
1394 if (!this.cell.IsTopWater || t.altitude > 0)
1395 {
1396 num7 += num9 + (float)t.altitude * altitudeFix.y;
1397 }
1398 _actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
1399 _actorPos.z += pref.z;
1400 thingPos.z += pref.z;
1401 liquidLv -= (int)(num9 * 150f);
1402 if (liquidLv < 0)
1403 {
1404 liquidLv = 0;
1405 }
1406 }
1407 else
1408 {
1409 thingPos.y += num9;
1410 _actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
1411 _actorPos.z += pref.z;
1412 if (pref.height >= 0f)
1413 {
1414 thingPos.z += pref.z;
1415 }
1416 }
1417 if (!tileType.UseMountHeight && j > 10)
1418 {
1419 flag7 = true;
1420 }
1421 }
1422 else
1423 {
1424 thingPos.y += num9;
1425 _actorPos.x += pref.x * (float)((!t.flipX) ? 1 : (-1));
1426 _actorPos.z += pref.z;
1427 thingPos.z += pref.z;
1428 }
1429 if (t.isFloating && isWater && !hasBridge && !flag)
1430 {
1431 flag = true;
1432 float num10 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
1433 orgY += 0.01f * floatY - num10;
1434 num6 = num9;
1435 _actorPos.y += 0.01f * floatY - num10;
1436 if (liquidLv > 10)
1437 {
1438 liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
1439 }
1440 liquidLv -= (int)(floatY * 0.5f);
1441 if (liquidLv < 0)
1442 {
1443 liquidLv = 0;
1444 }
1445 param.liquidLv = liquidLv;
1446 }
1447 num4 = num9;
1448 if (t.sourceCard.multisize && !t.trait.IsGround)
1449 {
1450 num8 += zSetting.multiZ;
1451 }
1452 orgZ += t.renderer.data.stackZ;
1453 if (param.liquidLv > 0)
1454 {
1455 param.liquidLv += pref.liquidMod;
1456 if (param.liquidLv < 1)
1457 {
1458 param.liquidLv = 1;
1459 }
1460 else if (param.liquidLv > 99 + pref.liquidModMax)
1461 {
1462 param.liquidLv = 99 + pref.liquidModMax;
1463 }
1464 }
1465 }
1466 if (isInstalled && tileType.UseMountHeight)
1467 {
1468 if (tileType != TileType.Illumination || !this.cell.HasObj)
1469 {
1470 if (noRoofMode && currentRoom == null && t.altitude >= lowWallObjAltitude)
1471 {
1472 continue;
1473 }
1474 if (hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
1475 {
1476 Room room = ((t.dir == 0) ? this.cell.Back.room : this.cell.Left.room);
1478 {
1479 if (room == null || !room.data.showWallItem)
1480 {
1481 continue;
1482 }
1483 }
1484 else if (t.altitude >= lowWallObjAltitude)
1485 {
1486 continue;
1487 }
1488 }
1489 }
1491 {
1492 flag6 = true;
1493 }
1495 shadow = false;
1496 param.liquidLv = 0;
1497 if (t.freePos)
1498 {
1499 _actorPos.x += t.fx;
1500 _actorPos.y += t.fy;
1501 }
1502 }
1503 else
1504 {
1505 if (t.altitude != 0)
1506 {
1508 if (t.altitude > 2 && ((this.cell.Back.room != null && this.cell.Back.IsRoomEdge) || (this.cell.Left.room != null && this.cell.Left.IsRoomEdge)) && hideHang && (this.cell.room?.lot != currentLot || (!this.cell.lotWall && this.cell.room != currentRoom)))
1509 {
1510 continue;
1511 }
1512 }
1513 if (t.freePos)
1514 {
1515 _actorPos.x = orgX + t.fx - freePos.x;
1516 _actorPos.y = orgY + t.fy - freePos.y;
1517 }
1518 if (t.trait is TraitDoor && (t.trait as TraitDoor).IsOpen())
1519 {
1520 _actorPos.z += -0.5f;
1521 }
1522 }
1523 if (!t.sourceCard.multisize || (t.pos.x == cx && t.pos.z == cz))
1524 {
1525 if (iconMode != 0)
1526 {
1527 int num11 = 0;
1528 switch (iconMode)
1529 {
1530 case CardIconMode.Visibility:
1531 if (t.isMasked)
1532 {
1533 num11 = 17;
1534 }
1535 break;
1536 case CardIconMode.State:
1537 if (t.placeState == PlaceState.installed)
1538 {
1539 num11 = 18;
1540 }
1541 break;
1542 case CardIconMode.Deconstruct:
1543 if (t.isDeconstructing)
1544 {
1545 num11 = 14;
1546 }
1547 break;
1548 }
1550 {
1551 num11 = 13;
1552 }
1553 if (num11 != 0)
1554 {
1555 passGuideBlock.Add(_actorPos.x, _actorPos.y, _actorPos.z - 10f, num11);
1556 }
1557 }
1559 if (_lowblock && t.trait.UseLowblock && !this.cell.HasFullBlock)
1560 {
1561 param.tile += ((param.tile < 0f) ? (-64) : 64);
1562 }
1563 if (t.trait is TraitTrolley && EMono.pc.ai is AI_Trolley aI_Trolley && aI_Trolley.trolley.owner == t)
1564 {
1565 RenderParam _param = new RenderParam(param);
1566 EMono.core.actionsLateUpdate.Add(delegate
1567 {
1568 t.SetRenderParam(_param);
1569 _actorPos.x = EMono.pc.renderer.position.x;
1570 _actorPos.y = EMono.pc.renderer.position.y - pref.height;
1571 _actorPos.z = EMono.pc.renderer.position.z + 0.02f;
1572 t.renderer.Draw(_param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
1573 });
1574 }
1575 else
1576 {
1577 t.renderer.Draw(param, ref _actorPos, !t.noShadow && (shadow || tileType.AlwaysShowShadow));
1578 }
1579 }
1580 if (isInstalled)
1581 {
1582 num5 += pref.stackX * (float)((!t.flipX) ? 1 : (-1));
1583 }
1584 param.x = orgX;
1585 param.y = orgY;
1586 param.z = orgZ;
1587 param.color = floorLight;
1588 thing = t;
1589 if (pref.Float)
1590 {
1591 liquidLv = 0;
1592 }
1593 }
1594 }
1595 orgY += num6;
1596 if (detail.charas.Count <= 0)
1597 {
1598 return;
1599 }
1600 param.shadowFix = 0f - num7;
1601 param.color += 1310720f;
1602 float max = zSetting.max2;
1603 for (int k = 0; k < detail.charas.Count; k++)
1604 {
1605 Chara chara = detail.charas[k];
1606 if (chara.host != null || (chara != EMono.pc && chara != LayerDrama.alwaysVisible && (flag3 || fogged || (!showAllCards && !EMono.player.CanSee(chara)))))
1607 {
1608 continue;
1609 }
1610 _actorPos.x = orgX;
1611 _actorPos.y = orgY;
1612 _actorPos.z = orgZ;
1613 chara.SetRenderParam(param);
1614 _ = chara.IsAliveInCurrentZone;
1615 if (chara.isRestrained)
1616 {
1617 TraitShackle restrainer = chara.GetRestrainer();
1618 if (restrainer != null)
1619 {
1620 Vector3 getRestrainPos = restrainer.GetRestrainPos;
1621 if (getRestrainPos != default(Vector3))
1622 {
1623 Vector3 position = restrainer.owner.renderer.position;
1624 float defCharaHeight = EMono.setting.render.defCharaHeight;
1625 float num12 = getRestrainPos.y + defCharaHeight - ((chara.Pref.height == 0f) ? defCharaHeight : chara.source.pref.height);
1626 _actorPos.x = position.x + getRestrainPos.x * (float)((restrainer.owner.dir % 2 == 0) ? 1 : (-1));
1627 _actorPos.y = position.y + num12;
1628 _actorPos.z = position.z + getRestrainPos.z;
1629 param.liquidLv = 0;
1630 param.shadowFix = orgY - _actorPos.y;
1631 chara.renderer.SetFirst(first: true);
1632 chara.renderer.Draw(param, ref _actorPos, drawShadow: true);
1633 param.shadowFix = 0f;
1634 continue;
1635 }
1636 }
1637 }
1638 if (!chara.sourceCard.multisize || (chara.pos.x == cx && chara.pos.z == cz))
1639 {
1640 if (chara.IsDeadOrSleeping && chara.IsPCC)
1641 {
1642 float num13 = chara.renderer.data.size.y * 0.3f;
1643 if (thingPos.y > max)
1644 {
1645 thingPos.y = max;
1646 }
1647 float num14 = thingPos.y + num13;
1648 float num15 = (float)k * -0.01f;
1649 if (num14 > zSetting.thresh1)
1650 {
1651 num15 = zSetting.mod1;
1652 }
1653 _actorPos.x += thingPos.x;
1654 _actorPos.y += thingPos.y;
1655 _actorPos.z += renderSetting.laydownZ + num15;
1656 param.liquidLv = ((thingPos.y == 0f && liquidLv > 0) ? 90 : 0);
1657 thingPos.y += num13 * 0.8f;
1658 chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
1659 }
1660 else
1661 {
1662 param.liquidLv = liquidLv;
1663 if (liquidLv > 0)
1664 {
1665 if (chara.Pref.Float && !flag && !hasBridge)
1666 {
1667 if (liquidLv > 20)
1668 {
1669 float num16 = ((this.cell._bridge != 0) ? sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
1670 orgY += 0.01f * floatY - num16;
1671 _actorPos.y += 0.01f * floatY - num16;
1672 int num17 = TileType.FloorWaterShallow.LiquidLV * 10;
1673 num17 -= (int)(floatY * 0.5f);
1674 param.liquidLv = num17;
1675 }
1676 else
1677 {
1678 param.liquidLv -= 20;
1679 }
1680 }
1681 param.liquidLv += chara.Pref.liquidMod;
1682 if (param.liquidLv < 1)
1683 {
1684 param.liquidLv = 1;
1685 }
1686 else if (param.liquidLv > 99 + chara.Pref.liquidModMax)
1687 {
1688 param.liquidLv = 99 + chara.Pref.liquidModMax;
1689 }
1690 }
1691 if (!chara.IsPC && !chara.renderer.IsMoving && detail.charas.Count > 1 && (detail.charas.Count != 2 || !detail.charas[0].IsDeadOrSleeping || !detail.charas[0].IsPCC))
1692 {
1693 _actorPos += renderSetting.charaPos[1 + ((num3 < 4) ? num3 : 3)];
1694 }
1695 _actorPos.z += 0.01f * (float)k + renderSetting.charaZ;
1696 num3++;
1697 if (flag6)
1698 {
1699 _actorPos.z += chara.renderer.data.hangedFixZ;
1700 }
1701 chara.renderer.Draw(param, ref _actorPos, liquidLv == 0);
1702 }
1703 }
1704 param.x = orgX;
1705 param.y = orgY;
1706 param.z = orgZ;
1707 }
1708 return;
1709 IL_6fc5:
1710 if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && !snowed && !this.cell.isClearSnow && ((!this.cell.Front.HasRoof && !this.cell.Front.HasBlock) || (!this.cell.Right.HasRoof && !this.cell.Right.HasBlock)))
1711 {
1712 snowed = true;
1713 }
1714 if (this.cell.effect != null)
1715 {
1716 if (this.cell.effect.IsLiquid)
1717 {
1718 SourceCellEffect.Row sourceEffect = this.cell.sourceEffect;
1719 SourceMaterial.Row defaultMaterial = sourceEffect.DefaultMaterial;
1720 tile = 4 + Rand.bytes[index % Rand.MaxBytes] % 4;
1721 param.tile = tile + this.cell.sourceEffect._tiles[0];
1722 param.mat = defaultMaterial;
1723 param.matColor = ((this.cell.effect.color == 0) ? GetColorInt(ref defaultMaterial.matColor, sourceEffect.colorMod) : this.cell.effect.color);
1724 sourceEffect.renderData.Draw(param);
1725 }
1726 else
1727 {
1728 param.tile = this.cell.effect.source._tiles[0];
1729 SourceCellEffect.Row sourceEffect2 = this.cell.sourceEffect;
1730 if (sourceEffect2.anime.Length != 0)
1731 {
1732 if (sourceEffect2.anime.Length > 2)
1733 {
1734 float num18 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[2];
1735 if (!(num18 >= (float)sourceEffect2.anime[0]))
1736 {
1737 param.tile += num18;
1738 }
1739 }
1740 else
1741 {
1742 float num19 = Time.realtimeSinceStartup * 1000f / (float)sourceEffect2.anime[1] % (float)sourceEffect2.anime[0];
1743 param.tile += num19;
1744 }
1745 }
1746 if (this.cell.effect.IsFire)
1747 {
1749 }
1750 else
1751 {
1752 this.cell.effect.source.renderData.Draw(param);
1753 }
1754 }
1755 }
1756 param.color = floorLight;
1757 if (this.cell.critter != null)
1758 {
1759 Critter critter = this.cell.critter;
1760 int snowTile = critter.tile;
1761 if (snowed && critter.SnowTile != 0)
1762 {
1763 critter.x = 0.06f;
1764 critter.y = -0.06f;
1765 snowTile = critter.SnowTile;
1766 }
1767 else
1768 {
1769 critter.Update();
1770 }
1771 pass = passObjSS;
1773 batch.matrices[pass.idx].m03 = param.x + (float)(int)(critter.x * 100f) * 0.01f;
1774 batch.matrices[pass.idx].m13 = param.y + (float)(int)(critter.y * 100f) * 0.01f;
1775 batch.matrices[pass.idx].m23 = param.z;
1776 batch.tiles[pass.idx] = snowTile * ((!critter.reverse) ? 1 : (-1));
1778 pass.idx++;
1779 if (pass.idx == pass.batchSize)
1780 {
1781 pass.NextBatch();
1782 }
1783 }
1784 if (detail != null)
1785 {
1786 TransAnime anime3 = detail.anime;
1787 if (anime3 != null && !anime3.animeBlock)
1788 {
1789 TransAnime anime4 = detail.anime;
1790 param.x += anime4.v.x;
1791 param.y += anime4.v.y;
1792 param.z += anime4.v.z;
1793 }
1794 }
1795 if (this.cell.obj != 0 && !this.cell.sourceObj.renderData.SkipOnMap)
1796 {
1797 SourceObj.Row sourceObj = this.cell.sourceObj;
1798 if (!snowed || sourceObj.snowTile <= 0)
1799 {
1800 param.snow = snowed;
1801 param.mat = this.cell.matObj;
1802 orgY = param.y;
1803 if (param.liquidLv > 0)
1804 {
1805 if (sourceObj.pref.Float)
1806 {
1807 param.y += 0.01f * floatY;
1808 if (liquidLv > 10)
1809 {
1810 liquidLv = TileType.FloorWaterShallow.LiquidLV * 10;
1811 }
1812 liquidLv -= (int)(floatY * 0.5f);
1813 param.liquidLv = liquidLv;
1814 }
1815 if (sourceObj.tileType.IsWaterTop)
1816 {
1817 param.liquidLv = 0;
1818 }
1819 else
1820 {
1821 param.liquidLv += sourceObj.pref.liquidMod;
1822 if (param.liquidLv < 1)
1823 {
1824 param.liquid = 1f;
1825 }
1826 else if (param.liquidLv > 99 + sourceObj.pref.liquidModMax)
1827 {
1828 param.liquidLv = 99 + sourceObj.pref.liquidModMax;
1829 }
1830 }
1831 }
1832 if (sourceObj.useAltColor)
1833 {
1834 param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, sourceObj.colorMod));
1835 }
1836 else
1837 {
1838 param.matColor = ((sourceObj.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, sourceObj.colorMod));
1839 }
1840 if (sourceObj.HasGrowth)
1841 {
1842 this.cell.growth.OnRenderTileMap(param);
1843 if (this.cell.obj == 118 && Core.fixedFrame % 10f == 0f && sourceObj.growth.IsMature)
1844 {
1845 EMono.scene.psFey.transform.position = new Vector3(param.x, param.y, param.z - 2f);
1846 EMono.scene.psFey.Emit(1);
1847 }
1848 }
1849 else
1850 {
1851 if (this.cell.autotileObj != 0)
1852 {
1853 param.tile = sourceObj._tiles[0] + this.cell.autotileObj;
1854 }
1855 else if (sourceObj.tileType.IsUseBlockDir)
1856 {
1857 param.tile = sourceObj._tiles[this.cell.blockDir % sourceObj._tiles.Length];
1858 }
1859 else
1860 {
1861 param.tile = sourceObj._tiles[this.cell.objDir % sourceObj._tiles.Length];
1862 }
1863 if (_lowblock && sourceObj.tileType.IsSkipLowBlock)
1864 {
1865 param.tile += ((param.tile > 0f) ? 1 : (-1)) * 3000000;
1866 }
1867 orgY = param.y;
1868 orgZ = param.z;
1869 param.y += sourceObj.pref.y;
1870 param.z += sourceObj.pref.z;
1871 sourceObj.renderData.Draw(param);
1872 param.y = orgY;
1873 param.z = orgZ;
1874 int shadow3 = sourceObj.pref.shadow;
1875 if (shadow3 > 1 && !this.cell.ignoreObjShadow)
1876 {
1877 passShadow.AddShadow(param.x + sourceObj.renderData.offsetShadow.x, param.y + sourceObj.renderData.offsetShadow.y, param.z + sourceObj.renderData.offsetShadow.z, ShadowData.Instance.items[shadow3], sourceObj.pref, 0, param.snow);
1878 }
1879 param.y = orgY;
1880 }
1881 }
1882 }
1883 if (this.cell.decal != 0 && sourceFloor.tileType.AllowBlood)
1884 {
1885 passDecal.Add(param, (int)this.cell.decal, floorLight);
1886 }
1887 if (highlightCells)
1888 {
1889 switch (ActionMode.FlagCell.mode)
1890 {
1891 case AM_FlagCell.Mode.flagWallPillar:
1892 if (this.cell.isToggleWallPillar)
1893 {
1894 passArea.Add(param, 34f, 0f);
1895 }
1896 break;
1897 case AM_FlagCell.Mode.flagSnow:
1898 if (this.cell.isClearSnow)
1899 {
1900 passArea.Add(param, 34f, 0f);
1901 }
1902 break;
1903 case AM_FlagCell.Mode.flagFloat:
1904 if (this.cell.isForceFloat)
1905 {
1906 passArea.Add(param, 34f, 0f);
1907 }
1908 break;
1909 case AM_FlagCell.Mode.flagClear:
1910 if (this.cell.isClearArea)
1911 {
1912 passArea.Add(param, 34f, 0f);
1913 }
1914 break;
1915 }
1916 }
1917 if (detail == null)
1918 {
1919 return;
1920 }
1921 if (highlightArea && detail.area != null)
1922 {
1923 passArea.Add(param, (int)detail.area.GetTile(index) - ((!subtleHighlightArea) ? 1 : 0), 0f);
1924 }
1925 if (detail.footmark != null && sourceFloor.id != 0)
1926 {
1927 param.tile = detail.footmark.tile;
1928 param.mat = matFloor;
1929 param.matColor = 104025f;
1931 }
1932 goto IL_7b80;
1933 IL_6f65:
1934 int num20;
1935 if (!showRoof || !roof || this.cell.room == null || this.cell.Front.room == null || this.cell.Right.room == null)
1936 {
1937 param.tile = num20;
1939 }
1940 goto IL_6fc5;
1941 IL_167b:
1942 if (this.cell.isSlopeEdge)
1943 {
1944 float num21 = (float)height * _heightMod.y;
1945 orgY = param.y;
1946 orgZ = param.z;
1947 param.dir = this.cell.blockDir;
1948 if (snowed)
1949 {
1950 param.color = floorLight;
1951 }
1952 SourceBlock.Row defBlock;
1953 if (sourceBlock.tileType.IsFullBlock)
1954 {
1955 defBlock = sourceBlock;
1956 param.mat = matBlock;
1957 param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
1958 param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
1959 }
1960 else
1961 {
1962 defBlock = sourceFloor._defBlock;
1963 param.mat = matFloor;
1964 param.tile = defBlock._tiles[this.cell.blockDir % defBlock._tiles.Length];
1965 if (defBlock.id != 1)
1966 {
1967 param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
1968 }
1969 else
1970 {
1971 param.matColor = 104025f;
1972 }
1973 }
1974 for (int l = 0; (float)l < num21 / heightBlockSize; l++)
1975 {
1976 param.y += ugFix.y;
1977 param.z += ugFix.z + slopeFixZ * (float)l;
1978 defBlock.renderData.Draw(param);
1979 if (this.cell.pcSync && EMono.player.lightPower > 0f)
1980 {
1981 float num22 = param.tile;
1982 param.tile = 0f;
1984 param.tile = num22;
1985 }
1986 }
1987 param.y = orgY;
1988 param.z = orgZ;
1989 }
1990 param.color = floorLight;
1991 if (!isWater && (this.cell.Front.sourceFloor.tileType.IsWater || this.cell.Right.sourceFloor.tileType.IsWater) && this.cell.sourceBlock.tileType.RenderWaterBlock && !flag)
1992 {
1993 orgY = param.y;
1994 orgZ = param.z;
1995 int num23 = 0;
1996 if (sourceBlock.tileType.IsFullBlock)
1997 {
1999 num23 = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
2000 }
2001 else
2002 {
2003 SourceBlock.Row row3 = sourceFloor._defBlock;
2004 num23 = row3._tiles[this.cell.blockDir % row3._tiles.Length];
2005 }
2006 if (((this.cell.Front.shore / 12) & 1) == 0 && this.cell.Front.sourceFloor.tileType.IsWater && this.cell.Front.height <= height && this.cell.Front.sourceBlock.tileType.RenderWaterBlock)
2007 {
2008 param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Front.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Front.height * _heightMod.y;
2009 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
2010 param.tile = num23 + ((!this.cell.Front.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
2012 }
2013 if (((this.cell.Right.shore / 12) & 8) == 0 && this.cell.Right.sourceFloor.tileType.IsWater && this.cell.Right.height <= height && this.cell.Right.sourceBlock.tileType.RenderWaterBlock)
2014 {
2015 param.y = (float)(cz - cx) * screen.tileAlign.y - (this.cell.Right.sourceFloor.tileType.IsDeepWater ? 0.6f : 0.4f) + (float)(int)this.cell.Right.height * _heightMod.y;
2016 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z;
2017 param.tile = num23 + ((!this.cell.Right.sourceFloor.tileType.IsDeepWater) ? 3000000 : 0);
2019 }
2020 param.y = orgY;
2021 param.z = orgZ;
2022 }
2023 if (showBorder && !this.cell.outOfBounds)
2024 {
2025 param.matColor = 104025f;
2026 if (cx == EMono._map.bounds.x)
2027 {
2028 renderBorder.Draw(param, 12 + (EMono.world.date.IsNight ? 4 : 0));
2029 }
2030 else if (cx == EMono._map.bounds.maxX)
2031 {
2032 renderBorder.Draw(param, 13 + (EMono.world.date.IsNight ? 4 : 0));
2033 }
2034 if (cz == EMono._map.bounds.z)
2035 {
2036 renderBorder.Draw(param, 14 + (EMono.world.date.IsNight ? 4 : 0));
2037 }
2038 else if (cz == EMono._map.bounds.maxZ)
2039 {
2040 renderBorder.Draw(param, 15 + (EMono.world.date.IsNight ? 4 : 0));
2041 }
2042 }
2043 if (this.cell.isSkyFloor || (detail != null && detail.anime != null && detail.anime.drawBlock))
2044 {
2045 orgY = param.y;
2046 orgZ = param.z;
2047 SourceBlock.Row defBlock2 = sourceFloor._defBlock;
2048 param.mat = matFloor;
2049 param.tile = defBlock2._tiles[this.cell.blockDir % defBlock2._tiles.Length];
2050 if (defBlock2.id != 1)
2051 {
2052 param.matColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
2053 }
2054 else
2055 {
2056 param.matColor = 104025f;
2057 }
2058 for (int m = 0; m < ((!this.cell.isSkyFloor) ? 1 : EMono._map.config.skyBlockHeight); m++)
2059 {
2060 param.y += ugFix.y;
2061 param.z += ugFix.z + slopeFixZ * (float)m;
2062 defBlock2.renderData.Draw(param);
2063 }
2064 param.y = orgY;
2065 param.z = orgZ;
2066 }
2067 if (!sourceFloor.tileType.IsSkipFloor)
2068 {
2069 if ((hasBridge && sourceBridge.tileType.CastShadowSelf) || this.cell.castFloorShadow)
2070 {
2071 floorLight2 = _lightMod * light * 0.2f + _baseBrightness + _shadowStrength * floorShadowStrength * (isWater ? 0.7f : (hasBridge ? 1f : (0.6f * (1f - nightRatio))));
2072 if (snowed)
2073 {
2074 floorLight2 = (int)((double)floorLight2 * 0.85 * 50.0) * 262144 + snowColorToken;
2075 }
2076 else
2077 {
2078 floorLight2 = (int)(floorLight2 * 50f) * 262144 + ((this.cell.lightR >= 64) ? 63 : this.cell.lightR) * 4096 + ((this.cell.lightG >= 64) ? 63 : this.cell.lightG) * 64 + ((this.cell.lightB >= 64) ? 63 : this.cell.lightB);
2079 }
2080 param.color = floorLight2;
2081 if (this.cell.lotShade)
2082 {
2084 }
2085 }
2086 floorMatColor = ((sourceFloor.colorMod == 0) ? 104025 : GetColorInt(ref matFloor.matColor, sourceFloor.colorMod));
2087 if (isWater && flag)
2088 {
2089 param.y -= 0.01f * floatY;
2090 }
2091 if (!sourceBlock.tileType.IsSkipFloor || sourceBlock.transparent || hasBridge || this.cell.hasDoor || this.cell.skipRender)
2092 {
2093 param.mat = matFloor;
2094 param.tile = sourceFloor._tiles[floorDir % sourceFloor._tiles.Length];
2095 param.matColor = floorMatColor;
2096 param.snow = snowed;
2097 if (this.cell.isDeck)
2098 {
2099 param.z += 1f;
2100 if ((bool)sourceFloor.renderData.subData)
2101 {
2102 sourceFloor.renderData.subData.Draw(param);
2103 }
2104 sourceFloor.renderData.Draw(param);
2105 param.z -= 1f;
2106 }
2107 else
2108 {
2109 if ((bool)sourceFloor.renderData.subData)
2110 {
2111 sourceFloor.renderData.subData.Draw(param);
2112 }
2113 sourceFloor.renderData.Draw(param);
2114 }
2115 int num24 = 0;
2116 if (isSnowCovered && sourceFloor == FLOOR.sourceSnow && !this.cell.hasDoor)
2117 {
2118 if (!this.cell.Right.IsSnowTile && this.cell.Right.topHeight == this.cell.topHeight)
2119 {
2120 num24++;
2121 }
2122 if (!this.cell.Front.IsSnowTile && this.cell.Front.topHeight == this.cell.topHeight)
2123 {
2124 num24 += 2;
2125 }
2126 if (num24 != 0)
2127 {
2128 param.tile = 448 + num24 + 12;
2129 param.z -= 0.1f;
2130 sourceFloor.renderData.Draw(param);
2131 param.z += 0.1f;
2132 }
2133 }
2134 if (this.cell.shadow != 0 && !hasBridge && !this.cell.skipRender)
2135 {
2136 if (snowed)
2137 {
2139 {
2140 param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
2141 param.z -= 0.01f;
2142 sourceFloor.renderData.Draw(param);
2143 }
2144 }
2145 else
2146 {
2147 pass = passEdge;
2149 batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
2150 batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
2151 batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
2152 batch.tiles[pass.idx] = 448 + this.cell.shadow;
2154 batch.matColors[pass.idx] = 104025f;
2155 pass.idx++;
2156 if (pass.idx == pass.batchSize)
2157 {
2158 pass.NextBatch();
2159 }
2160 }
2161 if (!sourceFloor.ignoreTransition && !snowed)
2162 {
2163 Cell back = this.cell.Back;
2164 if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
2165 {
2166 pass = passFloor;
2168 batch.matrices[pass.idx].m03 = param.x + transitionFix[0].x;
2169 batch.matrices[pass.idx].m13 = param.y + transitionFix[0].y;
2170 batch.matrices[pass.idx].m23 = param.z + transitionFix[0].z;
2171 batch.tiles[pass.idx] = 480 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
2173 batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
2174 pass.idx++;
2175 if (pass.idx == pass.batchSize)
2176 {
2177 pass.NextBatch();
2178 }
2179 }
2180 back = this.cell.Left;
2181 if (back.sourceBlock.transition[0] != -1 && back.isSeen && !back.hasDoor)
2182 {
2183 pass = passFloor;
2185 batch.matrices[pass.idx].m03 = param.x + transitionFix[1].x;
2186 batch.matrices[pass.idx].m13 = param.y + transitionFix[1].y;
2187 batch.matrices[pass.idx].m23 = param.z + transitionFix[1].z;
2188 batch.tiles[pass.idx] = 512 + back.sourceBlock.transition[0] + Rand.bytes[index % Rand.MaxBytes] % back.sourceBlock.transition[1];
2190 batch.matColors[pass.idx] = GetColorInt(ref back.matBlock.matColor, back.sourceBlock.colorMod);
2191 pass.idx++;
2192 if (pass.idx == pass.batchSize)
2193 {
2194 pass.NextBatch();
2195 }
2196 }
2197 }
2198 }
2199 if (this.cell.autotile != 0 && sourceFloor.autotile != 0 && (!hasBridge || this.cell.bridgeHeight - this.cell.height > 3) && !this.cell.skipRender && num24 == 0)
2200 {
2201 pass = (isWater ? passAutoTileWater : passAutoTile);
2203 batch.matrices[pass.idx].m03 = param.x;
2204 batch.matrices[pass.idx].m13 = param.y;
2205 batch.matrices[pass.idx].m23 = param.z + ((hasBridge || this.cell._block != 0) ? 0.8f : 0f);
2206 batch.tiles[pass.idx] = (26 + sourceFloor.autotile / 2) * 32 + sourceFloor.autotile % 2 * 16 + this.cell.autotile;
2207 batch.colors[pass.idx] = param.color + (float)((int)(sourceFloor.autotileBrightness * 100f) * 262144);
2209 pass.idx++;
2210 if (pass.idx == pass.batchSize)
2211 {
2212 pass.NextBatch();
2213 }
2214 }
2215 }
2216 if (isWater)
2217 {
2218 int num25 = 12;
2219 int num26 = this.cell.shore / num25;
2220 int num27 = this.cell.shore % num25;
2221 bool isShoreSand = this.cell.isShoreSand;
2222 if (this.cell.shore != 0)
2223 {
2224 Cell cell = ((((uint)num26 & (true ? 1u : 0u)) != 0) ? this.cell.Back : ((((uint)num26 & 2u) != 0) ? this.cell.Right : ((((uint)num26 & 4u) != 0) ? this.cell.Front : this.cell.Left)));
2225 if (isShoreSand && !cell.sourceFloor.isBeach)
2226 {
2227 cell = ((((uint)num26 & 8u) != 0) ? this.cell.Left : ((((uint)num26 & 4u) != 0) ? this.cell.Front : ((((uint)num26 & 2u) != 0) ? this.cell.Right : this.cell.Back)));
2228 }
2229 if (!cell.IsSnowTile)
2230 {
2231 param.matColor = GetColorInt(ref cell.matFloor.matColor, cell.sourceFloor.colorMod);
2232 if (isShoreSand)
2233 {
2234 pass = passShore;
2236 batch.matrices[pass.idx].m03 = param.x;
2237 batch.matrices[pass.idx].m13 = param.y;
2238 batch.matrices[pass.idx].m23 = param.z;
2239 batch.tiles[pass.idx] = 768 + this.cell.shore / num25;
2242 pass.idx++;
2243 if (pass.idx == pass.batchSize)
2244 {
2245 pass.NextBatch();
2246 }
2247 num27 = 2;
2248 }
2249 else
2250 {
2251 num27 = cell.sourceFloor.edge;
2252 }
2253 param.tile = (24 + num27 / 2) * 32 + num27 % 2 * 16 + num26;
2255 }
2256 }
2257 if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num25) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num25) & (true ? 1u : 0u)) != 0)
2258 {
2259 param.tile = 785f;
2260 param.matColor = GetColorInt(ref this.cell.BackLeft.matFloor.matColor, this.cell.BackLeft.sourceFloor.colorMod);
2262 Draw(60);
2263 }
2264 if (this.cell.Back.isShoreSand && ((uint)(this.cell.Back.shore / num25) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num25) & (true ? 1u : 0u)) != 0)
2265 {
2266 param.tile = 786f;
2267 param.matColor = GetColorInt(ref this.cell.BackRight.matFloor.matColor, this.cell.BackRight.sourceFloor.colorMod);
2269 Draw(56);
2270 }
2271 if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num25) & 2u) != 0 && this.cell.Right.isShoreSand && ((uint)(this.cell.Right.shore / num25) & 4u) != 0)
2272 {
2273 param.tile = 787f;
2274 param.matColor = GetColorInt(ref this.cell.FrontRight.matFloor.matColor, this.cell.FrontRight.sourceFloor.colorMod);
2276 Draw(48);
2277 }
2278 if (this.cell.Front.isShoreSand && ((uint)(this.cell.Front.shore / num25) & 8u) != 0 && this.cell.Left.isShoreSand && ((uint)(this.cell.Left.shore / num25) & 4u) != 0)
2279 {
2280 param.tile = 788f;
2281 param.matColor = GetColorInt(ref this.cell.FrontLeft.matFloor.matColor, this.cell.FrontLeft.sourceFloor.colorMod);
2283 Draw(52);
2284 }
2285 if (this.cell._bridge != 0 && this.cell.isBridgeEdge && this.cell.bridgePillar != byte.MaxValue)
2286 {
2287 pass = passEdge;
2289 batch.matrices[pass.idx].m03 = param.x + waterEdgeBridgeFix.x;
2290 batch.matrices[pass.idx].m13 = param.y + waterEdgeBridgeFix.y;
2291 batch.matrices[pass.idx].m23 = param.z + waterEdgeBridgeFix.z;
2292 batch.tiles[pass.idx] = 616 + waterAnimeIndex % 4;
2294 batch.matColors[pass.idx] = 104025f;
2295 pass.idx++;
2296 if (pass.idx == pass.batchSize)
2297 {
2298 pass.NextBatch();
2299 }
2300 }
2301 bool flag8 = false;
2302 if (isShoreSand)
2303 {
2304 if (((uint)num26 & (true ? 1u : 0u)) != 0)
2305 {
2306 if (((uint)num26 & 8u) != 0)
2307 {
2308 if ((num26 & 2) == 0 && (num26 & 4) == 0)
2309 {
2310 Draw(16);
2311 }
2312 flag8 = true;
2313 }
2314 if (((uint)num26 & 2u) != 0)
2315 {
2316 if ((num26 & 8) == 0 && (num26 & 4) == 0)
2317 {
2318 Draw(20);
2319 }
2320 flag8 = true;
2321 }
2322 }
2323 if (((uint)num26 & 4u) != 0)
2324 {
2325 if (((uint)num26 & 8u) != 0)
2326 {
2327 if ((num26 & 2) == 0 && (num26 & 1) == 0)
2328 {
2329 Draw(24);
2330 }
2331 flag8 = true;
2332 }
2333 if (((uint)num26 & 2u) != 0)
2334 {
2335 if ((num26 & 8) == 0 && (num26 & 1) == 0)
2336 {
2337 Draw(28);
2338 }
2339 flag8 = true;
2340 }
2341 }
2342 if (!flag8)
2343 {
2344 if (!this.cell.Front.sourceFloor.tileType.IsWater && !this.cell.Front.isDeck)
2345 {
2346 Draw(8);
2347 }
2348 if (!this.cell.Right.sourceFloor.tileType.IsWater && !this.cell.Right.isDeck)
2349 {
2350 Draw(12);
2351 }
2352 }
2353 }
2354 if (!flag8)
2355 {
2356 if (!this.cell.Back.sourceFloor.tileType.IsWater && !this.cell.Back.isDeck)
2357 {
2358 pass = passEdge;
2360 batch.tiles[pass.idx] = 608 + waterAnimeIndex % 4;
2361 batch.matColors[pass.idx] = 104025f;
2362 if (((uint)(this.cell.shore / num25) & (true ? 1u : 0u)) != 0)
2363 {
2364 if (isShoreSand)
2365 {
2366 param.matColor = GetColorInt(ref this.cell.Back.matFloor.matColor, this.cell.Back.sourceFloor.colorMod);
2367 batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
2368 batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
2369 batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
2372 }
2373 else
2374 {
2375 batch.matrices[pass.idx].m03 = param.x;
2376 batch.matrices[pass.idx].m13 = param.y;
2377 batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
2378 }
2379 }
2380 else
2381 {
2382 batch.matrices[pass.idx].m03 = param.x;
2383 batch.matrices[pass.idx].m13 = param.y;
2384 batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
2385 batch.tiles[pass.idx] += 12f;
2386 }
2388 pass.idx++;
2389 if (pass.idx == pass.batchSize)
2390 {
2391 pass.NextBatch();
2392 }
2393 }
2394 if (!this.cell.Left.sourceFloor.tileType.IsWater && !this.cell.Left.isDeck)
2395 {
2396 pass = passEdge;
2398 batch.tiles[pass.idx] = 612 + waterAnimeIndex % 4;
2399 batch.matColors[pass.idx] = 104025f;
2400 if (((uint)(this.cell.shore / num25) & 8u) != 0)
2401 {
2402 if (isShoreSand)
2403 {
2404 param.matColor = GetColorInt(ref this.cell.Left.matFloor.matColor, this.cell.Left.sourceFloor.colorMod);
2405 batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
2406 batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
2407 batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
2410 }
2411 else
2412 {
2413 batch.matrices[pass.idx].m03 = param.x;
2414 batch.matrices[pass.idx].m13 = param.y;
2415 batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShore.z;
2416 }
2417 }
2418 else
2419 {
2420 batch.matrices[pass.idx].m03 = param.x;
2421 batch.matrices[pass.idx].m13 = param.y;
2422 batch.matrices[pass.idx].m23 = param.z + waterEdgeFix.z;
2423 batch.tiles[pass.idx] += 12f;
2424 }
2426 pass.idx++;
2427 if (pass.idx == pass.batchSize)
2428 {
2429 pass.NextBatch();
2430 }
2431 }
2432 }
2433 if (flag)
2434 {
2435 param.y += 0.01f * floatY;
2436 }
2437 }
2438 if (flag)
2439 {
2440 param.z -= 1f;
2441 }
2442 }
2443 if (this.cell.skipRender)
2444 {
2445 if (this.cell.pcSync)
2446 {
2447 param.tile = 0f;
2449 }
2450 return;
2451 }
2452 if (hasBridge)
2453 {
2454 param.y = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.bridgeHeight * _heightMod.y;
2455 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)(int)this.cell.bridgeHeight * _heightMod.z;
2456 if (flag)
2457 {
2458 param.y += 0.01f * floatY;
2459 }
2460 param.color = floorLight;
2461 param.mat = matBridge;
2462 floorMatColor = ((sourceBridge.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, sourceBridge.colorMod));
2463 param.dir = this.cell.floorDir;
2464 param.tile = sourceBridge._tiles[this.cell.floorDir % sourceBridge._tiles.Length];
2465 param.matColor = floorMatColor;
2466 sourceBridge.renderData.Draw(param);
2467 if (this.cell.autotileBridge != 0 && sourceBridge.autotile != 0)
2468 {
2471 batch.matrices[pass.idx].m03 = param.x;
2472 batch.matrices[pass.idx].m13 = param.y;
2473 batch.matrices[pass.idx].m23 = param.z + ((this.cell._block != 0) ? 0.8f : 0f);
2474 batch.tiles[pass.idx] = (26 + sourceBridge.autotile / 2) * 32 + sourceBridge.autotile % 2 * 16 + this.cell.autotileBridge;
2475 batch.colors[pass.idx] = param.color + (float)((int)(sourceBridge.autotileBrightness * 100f) * 262144);
2477 pass.idx++;
2478 if (pass.idx == pass.batchSize)
2479 {
2480 pass.NextBatch();
2481 }
2482 }
2483 if (this.cell.shadow != 0)
2484 {
2486 {
2487 param.tile = 448 + this.cell.shadow + 8 + (this.cell.HasFence ? 4 : 0);
2488 param.z -= 0.01f;
2489 sourceBridge.renderData.Draw(param);
2490 }
2491 else
2492 {
2493 pass = passEdge;
2495 batch.matrices[pass.idx].m03 = param.x + ambientShadowFix[this.cell.shadow].x;
2496 batch.matrices[pass.idx].m13 = param.y + ambientShadowFix[this.cell.shadow].y;
2497 batch.matrices[pass.idx].m23 = param.z + ambientShadowFix[this.cell.shadow].z;
2498 batch.tiles[pass.idx] = 448 + this.cell.shadow;
2500 batch.matColors[pass.idx] = 104025f;
2501 pass.idx++;
2502 if (pass.idx == pass.batchSize)
2503 {
2504 pass.NextBatch();
2505 }
2506 }
2507 }
2508 if (this.cell.isBridgeEdge && this.cell.bridgeHeight - this.cell.height >= 3 && this.cell.bridgePillar != byte.MaxValue && !noSlopMode)
2509 {
2510 orgY = param.y;
2511 orgZ = param.z;
2512 param.y += bridgeFix.y;
2513 param.z += bridgeFix.z;
2514 param.dir = 0;
2515 SourceBlock.Row row4 = sourceBridge._bridgeBlock;
2516 float num28 = (float)(this.cell.bridgeHeight - this.cell.height) * _heightMod.y;
2517 if (this.cell.sourceFloor.tileType == TileType.Sky)
2518 {
2519 num28 += (float)EMono._map.config.skyBlockHeight;
2520 }
2521 int num29 = (int)(num28 / heightBlockSize) + 2;
2522 if (this.cell.bridgePillar != 0)
2523 {
2524 row4 = EMono.sources.blocks.rows[this.cell.bridgePillar];
2525 param.tile = row4._tiles[0] + ((num29 == 2) ? 32 : 0);
2526 param.mat = ((sourceBridge.DefaultMaterial == row4.DefaultMaterial) ? sourceBridge.DefaultMaterial : row4.DefaultMaterial);
2527 param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, row4.colorMod));
2528 }
2529 else
2530 {
2531 param.mat = matBlock;
2532 param.tile = row4._tiles[0] + 32;
2533 param.matColor = ((row4.colorMod == 0) ? 104025 : GetColorInt(ref matBridge.matColor, row4.colorMod));
2534 }
2535 param.y += ugFixBridgeTop.y;
2536 param.z += ugFixBridgeTop.z;
2537 for (int n = 0; n < num29; n++)
2538 {
2539 if (n == num29 - 1)
2540 {
2541 param.y = (float)(cz - cx) * screen.tileAlign.y + (float)height * _heightMod.y + ugFixBridgeBottom.y;
2542 param.z = 1000f + param.x * screen.tileWeight.x + param.y * screen.tileWeight.z + (float)height * _heightMod.z + ugFixBridgeBottom.z;
2543 }
2544 else
2545 {
2546 param.y += ugFixBridge.y;
2547 param.z += ugFixBridge.z;
2548 }
2549 row4.renderData.Draw(param);
2550 }
2551 param.y = orgY;
2552 param.z = orgZ;
2553 }
2554 }
2555 if (!buildMode && this.cell.highlight != 0)
2556 {
2557 if (this.cell._block != 0 && !this.cell.hasDoor)
2558 {
2559 screen.guide.DrawWall(this.cell.GetPoint(), EMono.Colors.blockColors.MapHighlight, useMarkerPass: true);
2560 }
2561 else
2562 {
2563 passGuideFloor.Add(this.cell.GetPoint(), (int)this.cell.highlight);
2564 }
2565 }
2566 param.color = blockLight;
2567 if (isSnowCovered && (sourceBlock.id != 0 || this.cell.hasDoor) && (snowed || this.cell.isClearSnow) && (this.cell.Front.HasRoof || this.cell.Right.HasRoof))
2568 {
2569 snowed = false;
2570 }
2571 num20 = 0;
2572 if (sourceBlock.id != 0)
2573 {
2574 this.tileType = sourceBlock.tileType;
2575 roomHeight = 0f;
2576 int blockDir = this.cell.blockDir;
2577 bool flag9 = false;
2578 switch (wallClipMode)
2579 {
2580 case WallClipMode.ByRoom:
2581 if (!this.tileType.RepeatBlock)
2582 {
2583 break;
2584 }
2585 if (currentRoom == null || showFullWall)
2586 {
2587 this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
2589 }
2590 else if (this.room != this.cell.Front.room && (this.cell.Front.room == currentRoom || (this.room?.lot != currentLot && this.cell.Front.room?.lot == currentLot)))
2591 {
2592 this.room = this.cell.Front.room;
2593 _lowblock = !this.cell.Front.lotWall && !this.cell.Front.fullWall;
2594 }
2595 else if (this.room != this.cell.Right.room && (this.cell.Right.room == currentRoom || (this.room?.lot != currentLot && this.cell.Right.room?.lot == currentLot)))
2596 {
2597 this.room = this.cell.Right.room;
2598 _lowblock = !this.cell.Right.lotWall && !this.cell.Right.fullWall;
2599 }
2600 else if (this.tileType.IsFullBlock && this.room != this.cell.FrontRight.room && (this.cell.FrontRight.room == currentRoom || (this.room?.lot != currentLot && this.cell.FrontRight.room?.lot == currentLot)))
2601 {
2602 this.room = this.cell.FrontRight.room;
2603 _lowblock = !this.cell.FrontRight.lotWall && !this.cell.FrontRight.fullWall;
2604 }
2605 else
2606 {
2607 this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
2608 _lowblock = true;
2609 if (!this.tileType.IsFullBlock)
2610 {
2611 if (this.cell.lotWall)
2612 {
2613 _lowblock = false;
2614 }
2615 else if (this.room == currentRoom)
2616 {
2617 _lowblock = !this.cell.fullWall;
2618 }
2619 }
2620 }
2621 flag9 = (this.room != null && this.room.data.atrium) || (this.cell.room != null && this.cell.room.data.atrium);
2622 if (flag9)
2623 {
2624 _lowblock = false;
2625 }
2626 if (this.room == null && alwaysLowblock)
2627 {
2628 _lowblock = true;
2629 roomHeight = 0f;
2630 }
2631 if (this.room != null)
2632 {
2633 maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
2634 if (showRoof)
2635 {
2636 roomHeight = this.room.lot.realHeight;
2637 break;
2638 }
2639 if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
2640 {
2641 roomHeight = 0f;
2642 break;
2643 }
2644 int num30 = ((this.room.data.maxHeight == 0) ? 2 : this.room.data.maxHeight);
2645 roomHeight = EMono.setting.render.roomHeightMod * (float)((this.room.lot.height < num30) ? this.room.lot.height : num30) + 0.01f * (float)this.room.lot.heightFix;
2646 }
2647 break;
2648 case WallClipMode.ByLot:
2649 if (defaultBlockHeight > 0f || isIndoor)
2650 {
2651 _lowblock = cx != 0 && cz != Size - 1 && ((!this.cell.Back.HasBlock && !this.cell.Back.isWallEdge) || (!this.cell.Left.HasBlock && !this.cell.Left.isWallEdge) || !this.cell.Back.Left.HasBlock);
2652 if (!_lowblock)
2653 {
2655 maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)(int)this.cell.TopHeight * _heightMod.y;
2656 }
2657 break;
2658 }
2659 if (showFullWall)
2660 {
2661 _lowblock = this.room != null;
2662 if (_lowblock)
2663 {
2664 if (this.cell.Back.IsRoomEdge && this.cell.Right.IsRoomEdge && this.cell.Back.room == null && this.cell.Right.room == null && this.cell.Right.Front.room?.lot == this.room?.lot)
2665 {
2666 _lowblock = false;
2667 }
2668 }
2669 else if (this.cell.Back.room != null && this.cell.Back.room.lot == (this.cell.Front.room ?? this.cell.Right.room)?.lot)
2670 {
2671 _lowblock = true;
2672 }
2673 }
2674 else
2675 {
2677 }
2678 if (this.tileType.RepeatBlock)
2679 {
2680 this.room = this.room ?? this.cell.Front.room ?? this.cell.Right.room ?? this.cell.FrontRight.room;
2681 if (this.room != null && (!noRoofMode || currentRoom != null) && (!showFullWall || currentRoom == null || this.room.lot == currentRoom.lot))
2682 {
2683 roomHeight = ((_lowblock && !this.tileType.ForceRpeatBlock) ? 0f : this.room.lot.realHeight);
2684 maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)this.room.lot.mh * _heightMod.y;
2685 }
2686 }
2687 break;
2688 }
2689 if (!_lowblock && (double)roomHeight > 1.2 && this.tileType.RepeatBlock)
2690 {
2691 num20 = 1;
2692 }
2693 else if (lowBlock)
2694 {
2695 num20 = 2;
2696 }
2697 param.mat = matBlock;
2698 param.dir = this.cell.blockDir;
2699 param.snow = snowed;
2700 switch (this.tileType.blockRenderMode)
2701 {
2702 case BlockRenderMode.FullBlock:
2703 {
2704 bool invisible = sourceBlock.tileType.Invisible;
2705 if (invisible && (!buildMode || ActionMode.Cinema.IsActive))
2706 {
2707 break;
2708 }
2709 if (this.cell.isSurrounded)
2710 {
2711 switch (innerMode)
2712 {
2713 case InnerMode.InnerBlock:
2714 case InnerMode.BuildMode:
2716 param.color = (int)(50f * blockLight) * 262144;
2717 param.matColor = 104025f;
2718 param.tile = (buildMode ? 1 : 2) + ((_lowblock || defaultBlockHeight > 0f) ? 3000000 : 0);
2720 return;
2721 case InnerMode.None:
2722 case InnerMode.Height:
2723 param.color = blockLight;
2724 break;
2725 }
2726 }
2727 if (snowed)
2728 {
2729 param.color = floorLight;
2730 }
2731 param.color -= (int)(_shadowStrength * 0.8f * 50f) * 262144;
2732 if (currentRoom != null && !showFullWall)
2733 {
2734 _lowblock = true;
2735 roomHeight = 0f;
2736 if (this.cell.room != currentRoom && (this.cell.Front.room == currentRoom || this.cell.Right.room == currentRoom || this.cell.FrontRight.room == currentRoom) && (this.cell.Back.room != currentRoom || this.cell.Right.room != currentRoom) && (this.cell.Front.room != currentRoom || this.cell.Left.room != currentRoom))
2737 {
2738 _lowblock = false;
2739 }
2740 if (!_lowblock)
2741 {
2742 int num31 = ((currentRoom.data.maxHeight == 0) ? 2 : currentRoom.data.maxHeight);
2743 roomHeight = EMono.setting.render.roomHeightMod * (float)((currentRoom.lot.height < num31) ? currentRoom.lot.height : num31) + 0.01f * (float)currentRoom.lot.heightFix;
2744 }
2745 }
2746 if (flag9)
2747 {
2748 _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);
2749 if (_lowblock)
2750 {
2751 roomHeight = 0f;
2752 }
2753 }
2754 if (invisible)
2755 {
2756 roomHeight = 0f;
2757 _lowblock = false;
2758 }
2759 if (this.cell.Things.Count > 0)
2760 {
2761 _lowblock = false;
2762 }
2763 param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + (_lowblock ? 3000000 : 0);
2764 param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
2765 if (roomHeight == 0f)
2766 {
2767 if (!this.cell.hasDoor)
2768 {
2769 sourceBlock.renderData.Draw(param);
2770 }
2771 }
2772 else
2773 {
2774 sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0, isBlock: true);
2775 }
2776 Room room2 = this.cell.Front.room ?? this.cell.room;
2777 if (room2 == null && this.cell.Right.room != null)
2778 {
2779 room2 = this.cell.Right.room;
2780 }
2781 if (!invisible && room2 != null)
2782 {
2783 if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
2784 {
2785 param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco);
2786 param.matColor = room2.lot.colDeco;
2787 float y = param.y;
2788 param.y += (float)room2.lot.decoFix * 0.01f;
2790 param.y = y;
2791 }
2792 if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
2793 {
2794 param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2);
2795 param.matColor = room2.lot.colDeco2;
2796 float y2 = param.y;
2797 float num32 = param.z;
2798 param.y += (float)room2.lot.decoFix2 * 0.01f;
2799 param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
2801 param.y = y2;
2802 param.z = num32;
2803 }
2804 }
2805 room2 = this.cell.Right.room ?? this.cell.room;
2806 if (room2 == null && this.cell.Front.room != null)
2807 {
2808 room2 = this.cell.Front.room;
2809 }
2810 if (!invisible && room2 != null)
2811 {
2812 if (room2.lot.idDeco != 0 && !this.cell.hasDoor)
2813 {
2814 param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco) * -1;
2815 param.matColor = room2.lot.colDeco;
2816 float y3 = param.y;
2817 param.y += (float)room2.lot.decoFix * 0.01f;
2819 param.y = y3;
2820 }
2821 if (room2.lot.idDeco2 != 0 && roomHeight != 0f && (float)room2.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
2822 {
2823 param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room2.lot.idDeco2) * -1;
2824 param.matColor = room2.lot.colDeco2;
2825 float y4 = param.y;
2826 float num33 = param.z;
2827 param.y += (float)room2.lot.decoFix2 * 0.01f;
2828 param.z += (float)room2.lot.decoFix2 * 0.01f * heightModDeco;
2830 param.y = y4;
2831 param.z = num33;
2832 }
2833 }
2834 break;
2835 }
2836 case BlockRenderMode.WallOrFence:
2837 {
2839 {
2840 showFullWall = true;
2841 _lowblock = false;
2842 }
2843 orgY = param.y;
2844 orgZ = param.z;
2845 param.color = (this.tileType.IsFence ? (floorLight - (float)((int)(_shadowStrength * 0.8f * 50f) * 262144)) : blockLight);
2846 bool flag10 = blockDir == 1 || _lowblock || flag9;
2847 bool flag11 = blockDir == 0 || _lowblock || flag9;
2848 if (!showFullWall && currentRoom != null)
2849 {
2850 if (!flag10)
2851 {
2852 if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Front.room != currentRoom))
2853 {
2854 if (!this.cell.IsRoomEdge || (this.cell.Front.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
2855 {
2856 flag10 = true;
2857 }
2858 }
2859 else if ((!this.cell.Front.lotWall || this.cell.Front.room?.lot != currentLot) && this.cell.Front.room != currentRoom)
2860 {
2861 flag10 = true;
2862 }
2863 }
2864 if (!flag11)
2865 {
2866 if (currentRoom == this.cell.room || (this.cell.lotWall && this.cell.room?.lot == currentLot && this.cell.Right.room != currentRoom))
2867 {
2868 if (!this.cell.IsRoomEdge || (this.cell.Right.room != this.cell.room && this.cell.FrontRight.room != this.cell.room))
2869 {
2870 flag11 = true;
2871 }
2872 }
2873 else if ((!this.cell.Right.lotWall || this.cell.Right.room?.lot != currentLot) && this.cell.Right.room != currentRoom)
2874 {
2875 flag11 = true;
2876 }
2877 }
2878 }
2879 if (blockDir == 0 || blockDir == 2)
2880 {
2881 param.dir = 0;
2882 Room room3 = this.cell.Front.room ?? this.cell.room;
2883 if (room3 != null && this.tileType.IsWall)
2884 {
2885 if (room3.lot.idDeco != 0 && !this.cell.hasDoor)
2886 {
2887 param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco);
2888 param.matColor = room3.lot.colDeco;
2889 param.y += (float)room3.lot.decoFix * 0.01f;
2891 param.y = orgY;
2892 }
2893 if (room3.lot.idDeco2 != 0 && roomHeight != 0f && !flag10 && (float)room3.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
2894 {
2895 param.tile = EMono.sources.blocks.rows[0].ConvertTile(1000 + room3.lot.idDeco2);
2896 param.matColor = room3.lot.colDeco2;
2897 param.y += (float)room3.lot.decoFix2 * 0.01f;
2898 param.z += (float)room3.lot.decoFix2 * 0.01f * heightModDeco;
2900 param.y = orgY;
2901 param.z = orgZ;
2902 }
2903 }
2904 Cell left = this.cell.Left;
2905 if (blockDir == 2 && left.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
2906 {
2907 _sourceBlock = left.sourceBlock;
2908 param.mat = left.matBlock;
2909 }
2910 else
2911 {
2913 param.mat = matBlock;
2914 }
2915 this.tileType = _sourceBlock.tileType;
2916 param.tile = (tile = _sourceBlock._tiles[0] + ((flag10 && !this.tileType.IsFence) ? 32 : 0));
2917 if (_sourceBlock.useAltColor)
2918 {
2919 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
2920 }
2921 else
2922 {
2923 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
2924 }
2925 if (roomHeight == 0f || flag10 || !this.tileType.RepeatBlock)
2926 {
2927 if (!this.cell.hasDoor)
2928 {
2929 _sourceBlock.renderData.Draw(param);
2930 }
2931 }
2932 else
2933 {
2934 _sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
2935 }
2936 param.z += cornerWallFix2.z;
2937 if ((blockDir == 2 || (this.cell.Front.HasWallOrFence && this.cell.Front.blockDir != 0)) != this.cell.isToggleWallPillar)
2938 {
2939 if (this.cell.Back.IsSnowTile && this.cell.Right.IsSnowTile)
2940 {
2941 param.snow = true;
2942 }
2943 param.tile = _sourceBlock._tiles[0] + ((flag10 && flag11 && !this.tileType.IsFence && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
2944 if (roomHeight == 0f || !this.tileType.RepeatBlock || (flag10 && flag11 && !flag9))
2945 {
2946 _sourceBlock.renderData.Draw(param);
2947 }
2948 else
2949 {
2950 _sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
2951 }
2952 }
2953 if (!flag10 && !showRoof && this.cell.Left.HasWallOrFence && this.cell.Left.blockDir != 0 && !this.cell.isToggleWallPillar)
2954 {
2955 orgX = param.x;
2956 param.tile = _sourceBlock._tiles[0] + ((flag10 && !this.tileType.IsFence && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
2957 param.x += cornerWallFix3.x;
2958 param.y += cornerWallFix3.y;
2959 param.z += cornerWallFix3.z;
2960 if (!flag9 && (roomHeight == 0f || flag10))
2961 {
2962 _sourceBlock.renderData.Draw(param);
2963 }
2964 else
2965 {
2966 _sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
2967 }
2968 param.x = orgX;
2969 }
2970 else if (this.cell.FrontLeft.HasWallOrFence && this.cell.FrontLeft.blockDir != 0 && (!flag10 || !this.cell.Left.HasWall) && !this.cell.isToggleWallPillar)
2971 {
2972 orgX = param.x;
2973 param.tile = _sourceBlock._tiles[0] + ((flag10 && !this.tileType.IsFence && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
2974 param.x += cornerWallFix.x;
2975 param.y += cornerWallFix.y;
2976 param.z += cornerWallFix.z;
2977 if (!flag9 && (roomHeight == 0f || flag10))
2978 {
2979 _sourceBlock.renderData.Draw(param);
2980 }
2981 else
2982 {
2983 _sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight + cornerWallFix.y, ref renderSetting.peakFix);
2984 }
2985 param.x = orgX;
2986 }
2987 }
2988 if (blockDir == 1 || blockDir == 2)
2989 {
2990 param.y = orgY;
2991 param.z = orgZ;
2992 param.dir = 1;
2993 Room room4 = this.cell.Right.room ?? this.cell.room;
2994 if (room4 != null && this.tileType.IsWall)
2995 {
2996 if (room4.lot.idDeco != 0 && !this.cell.hasDoor)
2997 {
2998 param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room4.lot.idDeco);
2999 param.matColor = room4.lot.colDeco;
3000 param.y += (float)room4.lot.decoFix * 0.01f;
3002 param.y = orgY;
3003 }
3004 if (room4.lot.idDeco2 != 0 && roomHeight != 0f && !flag11 && (float)room4.lot.decoFix2 * 0.01f + heightLimitDeco < roomHeight + maxHeight - param.y)
3005 {
3006 param.tile = -EMono.sources.blocks.rows[0].ConvertTile(1000 + room4.lot.idDeco2);
3007 param.matColor = room4.lot.colDeco2;
3008 param.y += (float)room4.lot.decoFix2 * 0.01f;
3009 param.z += (float)room4.lot.decoFix2 * 0.01f * heightModDeco;
3011 param.y = orgY;
3012 param.z = orgZ;
3013 }
3014 }
3015 if (blockDir == 2 && this.cell.room == null && this.cell.Right.room != null)
3016 {
3017 Room room5 = this.cell.Right.room;
3018 maxHeight = (float)(cz - cx) * screen.tileAlign.y + (float)room5.lot.mh * _heightMod.y;
3019 if (showRoof)
3020 {
3021 roomHeight = room5.lot.realHeight;
3022 }
3023 else if ((noRoofMode && currentRoom == null) || (_lowblock && !this.tileType.ForceRpeatBlock))
3024 {
3025 roomHeight = 0f;
3026 }
3027 else
3028 {
3029 int num34 = ((room5.data.maxHeight == 0) ? 2 : room5.data.maxHeight);
3030 roomHeight = EMono.setting.render.roomHeightMod * (float)((room5.lot.height < num34) ? room5.lot.height : num34) + 0.01f * (float)room5.lot.heightFix;
3031 }
3032 }
3033 Cell back2 = this.cell.Back;
3034 if (blockDir == 2 && back2.sourceBlock.tileType.IsWallOrFence && !this.cell.crossWall)
3035 {
3036 _sourceBlock = back2.sourceBlock;
3037 param.mat = back2.matBlock;
3038 }
3039 else
3040 {
3042 param.mat = matBlock;
3043 }
3044 this.tileType = _sourceBlock.tileType;
3045 param.tile = (tile = -_sourceBlock._tiles[0] + ((flag11 && !this.tileType.IsFence) ? (-32) : 0));
3046 if (_sourceBlock.useAltColor)
3047 {
3048 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.altColor, _sourceBlock.colorMod));
3049 }
3050 else
3051 {
3052 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref param.mat.matColor, _sourceBlock.colorMod));
3053 }
3054 param.color += _rightWallShade;
3055 if (roomHeight == 0f || flag11 || !this.tileType.RepeatBlock)
3056 {
3057 if (!this.cell.hasDoor)
3058 {
3059 _sourceBlock.renderData.Draw(param);
3060 }
3061 }
3062 else
3063 {
3064 _sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix, this.cell.hasDoor, this.cell.effect?.FireAmount ?? 0);
3065 }
3066 if ((this.cell.Right.HasWallOrFence && this.cell.Right.blockDir != 1) != this.cell.isToggleWallPillar && (blockDir != 2 || !this.cell.isToggleWallPillar))
3067 {
3068 if (this.cell.Left.IsSnowTile && this.cell.Front.IsSnowTile)
3069 {
3070 param.snow = true;
3071 }
3072 orgX = param.x;
3073 param.tile = _sourceBlock._tiles[0] + ((flag11 && !this.tileType.IsFence && !flag9) ? 32 : 0) + (this.tileType.IsFence ? 32 : 64);
3074 if (!flag9 && (roomHeight == 0f || !this.tileType.RepeatBlock || flag11))
3075 {
3076 _sourceBlock.renderData.Draw(param);
3077 }
3078 else
3079 {
3080 _sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFix);
3081 }
3082 param.x = orgX;
3083 }
3084 }
3085 param.y = orgY;
3086 param.z = orgZ;
3087 break;
3088 }
3089 case BlockRenderMode.HalfBlock:
3090 param.color = floorLight;
3091 _sourceBlock = ((sourceBlock.id == 5) ? EMono.sources.blocks.rows[matBlock.defBlock] : sourceBlock);
3092 param.tile = _sourceBlock._tiles[0];
3093 param.matColor = ((_sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.colorMod));
3094 param.tile2 = _sourceBlock.sourceAutoFloor._tiles[0];
3095 param.halfBlockColor = ((_sourceBlock.sourceAutoFloor.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, _sourceBlock.sourceAutoFloor.colorMod));
3096 sourceBlock.renderData.Draw(param);
3097 break;
3098 case BlockRenderMode.Pillar:
3099 {
3100 RenderData renderData2 = sourceBlock.renderData;
3101 param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length];
3102 param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
3103 int num35 = this.cell.objDir + ((this.cell.objDir >= 7) ? this.cell.objDir : 0) + 1;
3104 if (num35 == 0)
3105 {
3106 renderData2.Draw(param);
3107 }
3108 else
3109 {
3110 renderData2.DrawRepeat(param, num35, sourceBlock.tileType.RepeatSize);
3111 }
3112 param.tile = renderData2.idShadow;
3113 SourcePref shadowPref2 = renderData2.shadowPref;
3114 int shadow4 = shadowPref2.shadow;
3115 passShadow.AddShadow(param.x + renderData2.offsetShadow.x, param.y + renderData2.offsetShadow.y, param.z + renderData2.offsetShadow.z, ShadowData.Instance.items[shadow4], shadowPref2, 0, param.snow);
3116 break;
3117 }
3118 default:
3119 param.color = floorLight;
3120 param.tile = sourceBlock._tiles[this.cell.blockDir % sourceBlock._tiles.Length] + ((_lowblock && this.tileType.UseLowWallTiles) ? 3000000 : 0);
3121 param.matColor = ((sourceBlock.colorMod == 0) ? 104025 : GetColorInt(ref matBlock.matColor, sourceBlock.colorMod));
3122 if (roomHeight == 0f)
3123 {
3124 sourceBlock.renderData.Draw(param);
3125 }
3126 else
3127 {
3128 sourceBlock.renderData.DrawRepeatTo(param, maxHeight, roomHeight, ref renderSetting.peakFixBlock);
3129 }
3130 break;
3131 }
3132 }
3133 if (this.cell.pcSync && EMono.player.lightPower > 0f && !cinemaMode)
3134 {
3135 if (this.cell.room != null || !this.cell.IsRoomEdge || !showRoof)
3136 {
3137 goto IL_6f65;
3138 }
3139 if (this.cell._block == 0 || !this.cell.sourceBlock.tileType.RepeatBlock)
3140 {
3141 Room obj = this.cell.FrontRight.room;
3142 if (obj == null || !obj.HasRoof)
3143 {
3144 goto IL_6f65;
3145 }
3146 }
3147 }
3148 goto IL_6fc5;
3149 void Draw(int tile)
3150 {
3151 pass = passEdge;
3154 batch.matrices[pass.idx].m03 = param.x + waterEdgeFixShoreSand.x;
3155 batch.matrices[pass.idx].m13 = param.y + waterEdgeFixShoreSand.y;
3156 batch.matrices[pass.idx].m23 = param.z + waterEdgeFixShoreSand.z;
3159 pass.idx++;
3160 if (pass.idx == pass.batchSize)
3161 {
3162 pass.NextBatch();
3163 }
3164 }
3165 }
3166
3167 public Vector3 GetThingPosition(Card tg, Point p)
3168 {
3169 Vector3 zero = Vector3.zero;
3170 float num = 0f;
3171 cell = p.cell;
3173 if (!tg.TileType.UseMountHeight)
3174 {
3176 {
3177 zero.z -= 1f;
3178 }
3179 else if (!tg.sourceCard.multisize)
3180 {
3181 float num2 = ((cell._bridge != 0) ? cell.sourceBridge.tileType.FloorHeight : sourceFloor.tileType.FloorHeight);
3182 zero.y += num2;
3183 zero.z -= num2 * heightMod.z;
3184 }
3185 if (cell.HasRamp)
3186 {
3187 Vector3 rampFix = cell.sourceBlock.tileType.GetRampFix(cell.blockDir);
3188 zero.x += rampFix.x;
3189 zero.y += rampFix.y;
3190 zero.z += rampFix.z;
3191 }
3192 }
3193 if (tg.sourceCard.multisize)
3194 {
3195 zero.z -= 1f;
3196 }
3197 zero.x += tg.Pref.x * (float)((!tg.flipX) ? 1 : (-1));
3198 zero.z += tg.Pref.z;
3199 detail = cell.detail;
3200 if (tg.isChara)
3201 {
3202 return zero;
3203 }
3204 bool flag = false;
3206 {
3207 flag = true;
3208 }
3210 {
3211 if (tg.altitude != 0)
3212 {
3213 zero += altitudeFix * tg.altitude;
3214 }
3215 flag = true;
3216 }
3218 {
3219 return zero;
3220 }
3221 float num3 = 0f;
3222 if (detail != null && detail.things.Count > 0)
3223 {
3224 Card card = null;
3225 for (int i = 0; i < detail.things.Count; i++)
3226 {
3227 Thing thing = detail.things[i];
3228 SourcePref pref = thing.Pref;
3230 float num4 = (tileType.UseMountHeight ? 0f : ((pref.height == 0f) ? 0.1f : pref.height));
3231 if (!thing.IsInstalled || thing == ActionMode.Inspect.target)
3232 {
3233 continue;
3234 }
3235 if (thing.TileType.IsRamp)
3236 {
3237 Vector3 rampFix2 = thing.TileType.GetRampFix(thing.dir, pref);
3238 zero.x += rampFix2.x;
3239 zero.y += rampFix2.y;
3240 zero.z += rampFix2.z;
3241 }
3242 if (!flag && tileType.CanStack)
3243 {
3244 if (thing.ignoreStackHeight)
3245 {
3246 zero.y -= num3;
3247 }
3248 zero.y += num4;
3249 zero.x += pref.stackX * (float)((!thing.flipX) ? 1 : (-1));
3250 zero.z += pref.z + thing.renderer.data.stackZ;
3251 if (!tileType.UseMountHeight && thing.altitude != 0)
3252 {
3253 zero += altitudeFix * thing.altitude;
3254 num4 += altitudeFix.y * (float)thing.altitude;
3255 }
3256 if (thing.trait.IgnoreLastStackHeight && (card == null || !card.trait.IgnoreLastStackHeight))
3257 {
3258 zero.y -= num3;
3259 }
3260 num3 = num4;
3261 zero.z += renderSetting.thingZ + num + (float)i * -0.01f + zSetting.mod1 * zero.y;
3262 if (thing.sourceCard.multisize)
3263 {
3264 num += zSetting.multiZ;
3265 }
3266 card = thing;
3267 }
3268 }
3269 }
3270 if (flag)
3271 {
3272 return zero;
3273 }
3274 if (tg.ignoreStackHeight)
3275 {
3276 zero.y -= num3;
3277 }
3278 if (tg.altitude != 0)
3279 {
3280 zero += altitudeFix * tg.altitude;
3281 }
3282 return zero;
3283 }
3284
3286 {
3287 float num = _baseBrightness + 0.05f;
3288 num = ((!cell.IsSnowTile) ? ((float)((int)(num * 50f) * 262144 + ((cell.lightR >= 64) ? 63 : cell.lightR) * 4096 + ((cell.lightG >= 64) ? 63 : cell.lightG) * 64 + ((cell.lightB >= 64) ? 63 : cell.lightB))) : ((float)((int)(num * 50f) * 262144 + (int)((float)((cell.lightR >= 50) ? 50 : cell.lightR) * snowColor) * 4096 + (int)((float)((cell.lightG >= 50) ? 50 : cell.lightG) * snowColor) * 64 + (int)((float)((cell.lightB >= 50) ? 50 : cell.lightB) * snowColor) + snowColorToken)));
3289 return (int)num;
3290 }
3291
3292 public int GetRoofLight(Lot lot)
3293 {
3294 float num = Mathf.Sqrt(lot.light) * roofLightMod;
3295 if (num > lightLimit * roofLightLimitMod)
3296 {
3298 }
3299 if (isSnowCovered)
3300 {
3301 num += roofLightSnow * (1f - nightRatio);
3302 }
3303 int num2 = (int)(num * 50f) * 262144;
3304 if (isSnowCovered)
3305 {
3306 num2 += snowColorToken;
3307 }
3308 return num2;
3309 }
3310
3311 public void DrawRoof(Lot lot)
3312 {
3313 RoofStyle roofStyle = roofStyles[lot.idRoofStyle];
3314 if (roofStyle.type == RoofStyle.Type.None)
3315 {
3316 return;
3317 }
3318 bool reverse = lot.reverse;
3319 int num;
3320 int num2;
3321 int num3;
3322 int num4;
3323 if (reverse)
3324 {
3325 num = lot.z - roofStyle.h;
3326 num2 = lot.x - roofStyle.w;
3327 num3 = lot.mz + 1 + roofStyle.h;
3328 num4 = lot.mx + 1 + roofStyle.w;
3329 if (num2 > 1 && num > 0 && map.cells[num2 - 1, num].HasFullBlock)
3330 {
3331 num2--;
3332 }
3333 if (num3 < Size && num4 < Size && map.cells[num4 - 1, num3].HasFullBlock)
3334 {
3335 num3++;
3336 }
3337 }
3338 else
3339 {
3340 num = lot.x - roofStyle.w;
3341 num2 = lot.z - roofStyle.h;
3342 num3 = lot.mx + 1 + roofStyle.w;
3343 num4 = lot.mz + 1 + roofStyle.h;
3344 if (num2 > 0 && num > 1 && map.cells[num - 1, num2].HasFullBlock)
3345 {
3346 num--;
3347 }
3348 if (num3 < Size && num4 < Size && map.cells[num3 - 1, num4].HasFullBlock)
3349 {
3350 num4++;
3351 }
3352 }
3353 int num5;
3354 if (roofStyle.wing)
3355 {
3356 num5 = ((lot.height > 1) ? 1 : 0);
3357 if (num5 != 0)
3358 {
3359 num2--;
3360 num4++;
3361 }
3362 }
3363 else
3364 {
3365 num5 = 0;
3366 }
3367 int num6 = num4 + (reverse ? roofStyle.w : roofStyle.h) * 2 - num2;
3368 int idRoofTile = lot.idRoofTile;
3369 int num7 = lot.idBlock;
3370 int num8 = num7;
3371 if (num7 >= EMono.sources.blocks.rows.Count)
3372 {
3373 num7 = EMono.sources.blocks.rows.Count - 1;
3374 }
3375 if (num8 >= EMono.sources.floors.rows.Count)
3376 {
3377 num8 = EMono.sources.floors.rows.Count - 1;
3378 }
3379 int num9 = lot.idRamp;
3380 if (num9 >= EMono.sources.blocks.rows.Count)
3381 {
3382 num9 = EMono.sources.blocks.rows.Count - 1;
3383 }
3384 bool flag = false;
3385 int num10 = num6 / 2 - roofStyle.flatW;
3386 int num11 = num6 / 2 + roofStyle.flatW + ((num6 % 2 != 0) ? 1 : 0);
3387 SourceBlock.Row row = (roofStyle.useDefBlock ? cell.sourceFloor._defBlock : EMono.sources.blocks.rows[num7]);
3388 int num12 = 0;
3389 int num13 = ((num5 != 0) ? (-1) : 0);
3390 int num14 = 0;
3391 Vector3 vector = (lot.fullblock ? roofStyle.posFixBlock : roofStyle.posFix);
3392 switch (roofStyle.type)
3393 {
3394 case RoofStyle.Type.Default:
3395 flag = num6 % 2 == 1 && roofStyle.flatW == 0;
3396 break;
3397 case RoofStyle.Type.Flat:
3398 case RoofStyle.Type.FlatFloor:
3399 num10 = roofStyle.flatW;
3400 num11 = num6 - roofStyle.flatW;
3401 if (num10 == 0)
3402 {
3403 num14 = 1;
3404 }
3405 if (roofStyle.type != RoofStyle.Type.FlatFloor)
3406 {
3407 num--;
3408 num3++;
3409 num2--;
3410 num4++;
3411 }
3412 break;
3413 case RoofStyle.Type.Triangle:
3414 num10 = 999;
3415 num11 = 999;
3416 break;
3417 }
3418 for (cz = num2; cz < num4; cz++)
3419 {
3420 for (cx = num; cx < num3; cx++)
3421 {
3422 if (cx < 0 || cz < 0 || cx >= Size || cz >= Size)
3423 {
3424 continue;
3425 }
3426 int num15;
3427 int num16;
3428 if (reverse)
3429 {
3430 num15 = cz;
3431 num16 = cx;
3432 cell = map.cells[num15, num16];
3433 if (roofStyle.wing && cz == num4 - 1 && cell.Right.Right.room != null && cell.Right.Right.room.lot != lot)
3434 {
3435 continue;
3436 }
3437 }
3438 else
3439 {
3440 num15 = cx;
3441 num16 = cz;
3442 cell = map.cells[num15, num16];
3443 if (roofStyle.wing && cz == 0 && cell.Front.Front.room != null && cell.Front.Front.room.lot != lot)
3444 {
3445 continue;
3446 }
3447 }
3448 int num17 = num16 - num15;
3449 room = cell.room;
3450 if (room != null && room.lot != lot)
3451 {
3452 continue;
3453 }
3454 bool flag2 = false;
3455 if (roofStyle.type == RoofStyle.Type.Flat)
3456 {
3457 if (reverse)
3458 {
3459 if (!cell.HasFullBlock || cell.room != null)
3460 {
3461 num14 = ((cell.Left.room != null && cell.Left.room.lot == lot) ? ((cell.Right.room != null && cell.Right.room.lot == lot) ? 1 : ((cell.HasFullBlock && cell.Right.HasFullBlock && cell.Right.room != null) ? 1 : 2)) : (cell.Left.HasFullBlock ? 1 : 0));
3462 }
3463 else if (cell.Left.room?.lot == lot && cell.Right.room != null)
3464 {
3465 num14 = 1;
3466 flag2 = true;
3467 }
3468 else if (cell.Front.room?.lot == lot)
3469 {
3470 num14 = ((cell.FrontRight.room?.lot == lot) ? 1 : 2);
3471 flag2 = true;
3472 }
3473 else if (cell.Right.room?.lot == lot || cell.FrontRight.room?.lot == lot)
3474 {
3475 num14 = 0;
3476 flag2 = true;
3477 }
3478 }
3479 else if (!cell.HasFullBlock || cell.room != null)
3480 {
3481 num14 = ((cell.Front.room != null && cell.Front.room.lot == lot) ? ((cell.Back.room != null && cell.Back.room.lot == lot) ? 1 : (cell.Back.HasFullBlock ? 1 : 2)) : ((cell.HasFullBlock && cell.Front.HasFullBlock && cell.Front.room != null) ? 1 : 0));
3482 }
3483 else if (cell.Right.room?.lot == lot)
3484 {
3485 num14 = ((cell.FrontRight.room?.lot == lot) ? 1 : 0);
3486 flag2 = true;
3487 }
3488 else if (cell.Front.room?.lot == lot || cell.FrontRight.room?.lot == lot)
3489 {
3490 num14 = 2;
3491 flag2 = true;
3492 }
3493 num13 = 0;
3494 }
3495 bool flag3 = isSnowCovered && !cell.isClearSnow;
3496 if (room == null && !roofStyle.coverLot && !flag2 && !(cell.HasFullBlock && cell.IsRoomEdge && flag3))
3497 {
3498 continue;
3499 }
3500 index = cx + cz * Size;
3502 float num18 = (float)num17 * screen.tileAlign.y + (float)lot.mh * _heightMod.y + lot.realHeight + roofFix.y + vector.y;
3503 float num19 = 1000f + param.x * screen.tileWeight.x + (float)lot.mh * _heightMod.z + lot.realHeight * roofFix3.z + roofFix.z + vector.z;
3504 if (lot.height == 1 && lot.heightFix < 20)
3505 {
3506 num18 += roofStyle.lowRoofFix.y;
3507 num19 += roofStyle.lowRoofFix.z;
3508 }
3509 param.x = (float)(cx + cz) * screen.tileAlign.x + roofFix.x + (float)num13 * roofFix2.x + vector.x * (float)(reverse ? 1 : (-1));
3510 param.y = num18 + (float)num13 * roofFix2.y;
3511 param.z = num19 + param.y * screen.tileWeight.z + (float)num13 * roofFix2.z;
3512 param.color = GetRoofLight(lot);
3513 param.snow = idRoofTile == 0 && flag3;
3514 param.shadowFix = 0f;
3515 if (num14 == 1)
3516 {
3518 RenderRow renderRow;
3519 if (roofStyle.type == RoofStyle.Type.FlatFloor)
3520 {
3521 if (cell.HasFullBlock && cell.IsRoomEdge && !flag3)
3522 {
3523 continue;
3524 }
3525 renderRow = EMono.sources.floors.rows[num8];
3526 renderRow.SetRenderParam(param, mat, 0);
3527 param.matColor = lot.colRoof;
3528 }
3529 else
3530 {
3531 renderRow = row;
3532 renderRow.SetRenderParam(param, mat, 0);
3533 param.matColor = lot.colBlock;
3534 }
3535 renderRow.renderData.Draw(param);
3536 if (idRoofTile != 0)
3537 {
3538 renderRow = EMono.sources.blocks.rows[EMono.sources.objs.rows[idRoofTile].idRoof];
3539 int num20 = (reverse ? 1 : 0) + ((!flag) ? 2 : 0);
3540 renderRow.SetRenderParam(param, MATERIAL.sourceGold, num20);
3541 param.matColor = lot.colRoof;
3542 if (roofStyle.type == RoofStyle.Type.FlatFloor)
3543 {
3544 param.x += roofStyle.posFixBlock.x;
3545 param.y += roofStyle.posFixBlock.y;
3546 param.z += roofStyle.posFixBlock.z;
3547 }
3548 if (!flag)
3549 {
3550 param.z += 0.5f;
3551 }
3552 if (flag3)
3553 {
3554 param.matColor = 104025f;
3555 if (roofStyle.type != RoofStyle.Type.FlatFloor)
3556 {
3557 param.z += roofStyle.snowZ;
3558 }
3559 param.tile = renderRow.renderData.ConvertTile(renderRow.snowTile) + num20;
3560 renderRow.renderData.Draw(param);
3561 }
3562 else
3563 {
3564 renderRow.renderData.Draw(param);
3565 }
3566 }
3567 else if (flag3 && roofStyle.type == RoofStyle.Type.FlatFloor)
3568 {
3569 param.matColor = 104025f;
3570 param.tile = 10f;
3571 param.x += roofStyle.snowFix.x;
3572 param.y += roofStyle.snowFix.y;
3573 param.z += roofStyle.snowZ + roofStyle.snowFix.z;
3574 renderRow.renderData.Draw(param);
3575 }
3576 }
3577 else
3578 {
3579 if (idRoofTile != 0)
3580 {
3581 int num21 = ((!reverse) ? ((num14 != 0) ? 2 : 0) : ((num14 != 0) ? 1 : 3));
3582 if (lot.altRoof && !flag && (roofStyle.type == RoofStyle.Type.Default || roofStyle.type == RoofStyle.Type.DefaultNoTop))
3583 {
3584 param.shadowFix = num21 + 1;
3585 }
3586 RenderRow renderRow = EMono.sources.objs.rows[idRoofTile];
3587 renderRow.SetRenderParam(param, MATERIAL.sourceGold, num21);
3588 param.matColor = lot.colRoof;
3589 if (flag3)
3590 {
3591 param.matColor = 104025f;
3592 param.z += roofStyle.snowZ;
3593 param.tile = renderRow.renderData.ConvertTile(renderRow.snowTile) + num21 + (lot.altRoof ? 8 : 0);
3594 renderRow.renderData.Draw(param);
3595 }
3596 else
3597 {
3598 param.tile += (lot.altRoof ? 8 : 0);
3599 renderRow.renderData.Draw(param);
3600 }
3601 param.shadowFix = 0f;
3602 }
3603 if (num13 >= 0)
3604 {
3605 param.y += roofRampFix.y;
3606 param.z += roofRampFix.z;
3607 RenderRow renderRow = EMono.sources.blocks.rows[num9];
3608 renderRow.SetRenderParam(param, MATERIAL.sourceGold, (!reverse) ? ((num14 != 0) ? 2 : 0) : ((num14 != 0) ? 1 : 3));
3609 param.matColor = lot.colBlock;
3610 renderRow.renderData.Draw(param);
3611 }
3612 }
3613 CellEffect effect = cell.effect;
3614 if (effect != null && effect.FireAmount > 0)
3615 {
3617 }
3618 if (num13 < 1)
3619 {
3620 continue;
3621 }
3622 if (roofStyle.type != RoofStyle.Type.Flat)
3623 {
3624 param.snow = false;
3625 }
3626 for (int i = 0; i < num13; i++)
3627 {
3628 param.x = (float)(cx + cz) * screen.tileAlign.x + roofFix.x + (float)i * roofFix2.x + vector.x * (float)(reverse ? 1 : (-1));
3629 param.y = num18 + (float)i * roofFix2.y;
3630 param.z = num19 + param.y * screen.tileWeight.z + (float)i * roofFix2.z;
3631 RenderRow renderRow = row;
3632 renderRow.SetRenderParam(param, MATERIAL.sourceGold, 0);
3633 param.matColor = lot.colBlock;
3634 renderRow.renderData.Draw(param);
3635 index++;
3636 CellEffect effect2 = cell.effect;
3637 if (effect2 != null && effect2.FireAmount > 0 && Rand.bytes[index % Rand.MaxBytes] % 3 == 0)
3638 {
3640 }
3641 }
3642 }
3643 num12++;
3644 if (roofStyle.type != RoofStyle.Type.Flat)
3645 {
3646 if (num12 == num10)
3647 {
3648 num14 = 1;
3649 }
3650 if (num12 == num11)
3651 {
3652 num14 = 2;
3653 num13++;
3654 }
3655 num13 += num14 switch
3656 {
3657 1 => 0,
3658 0 => 1,
3659 _ => -1,
3660 };
3661 }
3662 }
3663 }
3664
3665 public static int GetColorInt(ref Color matColor, int p)
3666 {
3667 if (p == 0)
3668 {
3669 return 104025;
3670 }
3671 return p * 262144 + (int)(matColor.r * 50f) * 4096 + (int)(matColor.g * 50f) * 64 + (int)(matColor.b * 50f);
3672 }
3673
3674 public void SetRoofHeight(MeshPassParam _param, Cell _cell, int _cx, int _cz, int h = 0, int altitude = 0, int dirWall = -1, bool ignoreAltitudeY = false)
3675 {
3676 Room room = _cell.room;
3677 if (room == null && dirWall != -1)
3678 {
3679 if (dirWall == 0 && _cell.Front.room != null)
3680 {
3681 room = _cell.Front.room;
3682 _cell = _cell.Front;
3683 }
3684 else if (_cell.Right.room != null)
3685 {
3686 room = _cell.Right.room;
3687 _cell = _cell.Right;
3688 }
3689 }
3690 if (room != null)
3691 {
3692 Lot lot = room.lot;
3693 RoofStyle roofStyle = roofStyles[lot.idRoofStyle];
3694 float num = (float)(_cz - _cx) * screen.tileAlign.y + (float)lot.mh * _heightMod.y + lot.realHeight + roofFix.y;
3695 float num2 = 1000f + param.x * screen.tileWeight.x + (float)lot.mh * _heightMod.z + lot.realHeight * roofFix3.z + roofFix.z + roofStyle.posFix.z;
3696 if (lot.height == 1)
3697 {
3698 num += roofStyle.lowRoofFix.y;
3699 num2 += roofStyle.lowRoofFix.z;
3700 }
3701 _param.x = (float)(_cx + _cz) * screen.tileAlign.x + roofFix.x + (float)h * roofFix2.x;
3702 _param.y = num + (float)h * roofFix2.y;
3703 _param.z = num2 + _param.y * screen.tileWeight.z + (float)h * roofFix2.z + heightModRoofBlock.y;
3704 }
3705 if (!ignoreAltitudeY || room != null)
3706 {
3707 _param.y += (float)altitude * _heightMod.y;
3708 }
3709 _param.z += (float)altitude * heightModRoofBlock.z;
3710 }
3711}
AreaHighlightMode
BlockRenderMode
PlaceState
Definition: PlaceState.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
TraitTrolley trolley
Definition: AI_Trolley.cs:23
SceneProfile profile
Definition: AM_Cinema.cs:5
static AM_Inspect Inspect
Definition: ActionMode.cs:23
virtual bool IsRoofEditMode(Card c=null)
Definition: ActionMode.cs:311
static bool IsAdv
Definition: ActionMode.cs:117
static AM_ViewMap ViewMap
Definition: ActionMode.cs:63
virtual BaseTileMap.CardIconMode cardIconMode
Definition: ActionMode.cs:229
virtual bool ShowMaskedThings
Definition: ActionMode.cs:221
bool IsActive
Definition: ActionMode.cs:121
static AM_FlagCell FlagCell
Definition: ActionMode.cs:77
virtual bool IsBuildMode
Definition: ActionMode.cs:181
static AM_Cinema Cinema
Definition: ActionMode.cs:73
static AM_Bird Bird
Definition: ActionMode.cs:31
static AM_Mine Mine
Definition: ActionMode.cs:33
bool showWallItem
Definition: AreaData.cs:54
bool atrium
Definition: AreaData.cs:66
int maxHeight
Definition: AreaData.cs:30
virtual byte GetTile(int index)
Definition: Area.cs:75
AreaData data
Definition: BaseArea.cs:29
List< Action > actionsLateUpdate
Definition: BaseCore.cs:29
ScreenGuide guide
Vector3 tileWeight
BaseTileSelector tileSelector
virtual void RefreshWeather()
MeshPass passArea
Definition: BaseTileMap.cs:141
Vector3 roofFix2
Definition: BaseTileMap.cs:75
MeshPass passFog
Definition: BaseTileMap.cs:169
Vector3 cornerWallFix
Definition: BaseTileMap.cs:96
const int BlocklightToken
Definition: BaseTileMap.cs:504
float maxHeight
Definition: BaseTileMap.cs:396
MeshPass passFloor
Definition: BaseTileMap.cs:145
virtual void Draw()
Definition: BaseTileMap.cs:533
int GetRoofLight(Lot lot)
MeshPass passIcon
Definition: BaseTileMap.cs:185
int floorMatColor
Definition: BaseTileMap.cs:438
RenderData rendererInnerBlock
Definition: BaseTileMap.cs:203
Vector3[] wallHangFix
Definition: BaseTileMap.cs:116
float heightModDeco
Definition: BaseTileMap.cs:52
SourceFloor.Row sourceBridge
Definition: BaseTileMap.cs:482
Collider2D mouseCollider
Definition: BaseTileMap.cs:41
MeshPass passFloorEx
Definition: BaseTileMap.cs:163
float blockLight
Definition: BaseTileMap.cs:378
MeshPass passObj
Definition: BaseTileMap.cs:153
bool showAllCards
Definition: BaseTileMap.cs:454
Vector3 roofFix3
Definition: BaseTileMap.cs:77
bool highlightArea
Definition: BaseTileMap.cs:275
int maxColliderCheck
Definition: BaseTileMap.cs:45
float slopeFixZ
Definition: BaseTileMap.cs:50
InnerMode defaultInnerMode
Definition: BaseTileMap.cs:90
Point HitPoint
Definition: BaseTileMap.cs:508
Vector3 cornerWallFix2
Definition: BaseTileMap.cs:98
ScreenHighlight screenHighlight
Definition: BaseTileMap.cs:332
SourceMaterial.Row matBridge
Definition: BaseTileMap.cs:376
MeshPass passFloorMarker
Definition: BaseTileMap.cs:181
byte[] groundLights
Definition: BaseTileMap.cs:266
RenderData rendererFogRoomSolid
Definition: BaseTileMap.cs:217
float snowLight
Definition: BaseTileMap.cs:398
const int BlocklightMTP
Definition: BaseTileMap.cs:506
InnerMode innerMode
Definition: BaseTileMap.cs:233
MeshPass passChara
Definition: BaseTileMap.cs:187
float modSublight2
Definition: BaseTileMap.cs:410
MeshPass passRamp
Definition: BaseTileMap.cs:143
RenderData rendererWaterBlock
Definition: BaseTileMap.cs:225
Vector3 waterEdgeFixShoreSand
Definition: BaseTileMap.cs:110
int GetApproximateBlocklight(Cell cell)
MeshPass passGuideBlock
Definition: BaseTileMap.cs:137
float waterAnimeTimer
Definition: BaseTileMap.cs:400
MeshPass passShadow
Definition: BaseTileMap.cs:133
bool showBorder
Definition: BaseTileMap.cs:468
bool isSnowCovered
Definition: BaseTileMap.cs:460
float floatY
Definition: BaseTileMap.cs:323
int lowWallObjAltitude
Definition: BaseTileMap.cs:370
RenderData renderBorder
Definition: BaseTileMap.cs:211
bool cinemaMode
Definition: BaseTileMap.cs:464
bool alwaysLowblock
Definition: BaseTileMap.cs:466
Vector3 waterEdgeFixShore
Definition: BaseTileMap.cs:108
bool hideRoomFog
Definition: BaseTileMap.cs:281
static int GetColorInt(ref Color matColor, int p)
float _lightMod
Definition: BaseTileMap.cs:305
Vector3 roofRampFix
Definition: BaseTileMap.cs:71
float[] lightLookUp
Definition: BaseTileMap.cs:302
TileType tileType
Definition: BaseTileMap.cs:494
float lightLimit
Definition: BaseTileMap.cs:406
int snowColorToken
Definition: BaseTileMap.cs:366
float modSublight1
Definition: BaseTileMap.cs:408
bool showFullWall
Definition: BaseTileMap.cs:287
SceneLightProfile lightSetting
Definition: BaseTileMap.cs:496
const int DefColor
Definition: BaseTileMap.cs:502
void OnActivate(BaseGameScreen _screen)
Definition: BaseTileMap.cs:510
bool fogBounds
Definition: BaseTileMap.cs:456
RenderParam param
Definition: BaseTileMap.cs:428
Vector3 ugFix
Definition: BaseTileMap.cs:58
float floorLight
Definition: BaseTileMap.cs:380
MeshPass passWaterBlock
Definition: BaseTileMap.cs:183
float lotLight2
Definition: BaseTileMap.cs:83
bool noRoofMode
Definition: BaseTileMap.cs:296
MeshPass passAutoTileWater
Definition: BaseTileMap.cs:177
new BaseGameScreen screen
Definition: BaseTileMap.cs:348
RenderData rendererFov
Definition: BaseTileMap.cs:205
WallClipMode wallClipMode
Definition: BaseTileMap.cs:88
Vector3 edgeBlockFix
Definition: BaseTileMap.cs:92
MeshPass passFov
Definition: BaseTileMap.cs:171
Vector3 heightMod
Definition: BaseTileMap.cs:56
bool usingHouseBoard
Definition: BaseTileMap.cs:293
Vector3 altitudeFix
Definition: BaseTileMap.cs:102
Vector3 thingPos
Definition: BaseTileMap.cs:470
MeshPass passDecal
Definition: BaseTileMap.cs:157
float floorShadowStrength
Definition: BaseTileMap.cs:326
RenderData rendererFov2
Definition: BaseTileMap.cs:207
Vector3[] transitionFix
Definition: BaseTileMap.cs:114
float _baseBrightness
Definition: BaseTileMap.cs:308
Vector3 waterEdgeFix
Definition: BaseTileMap.cs:104
virtual void DrawTile()
Definition: BaseTileMap.cs:900
void RefreshHeight()
Definition: BaseTileMap.cs:888
Room currentRoom
Definition: BaseTileMap.cs:484
bool noSlopMode
Definition: BaseTileMap.cs:498
MeshPass passFloorWater
Definition: BaseTileMap.cs:165
float rightWallShade
Definition: BaseTileMap.cs:69
RenderData rendererFloorMarker
Definition: BaseTileMap.cs:201
float lotLight
Definition: BaseTileMap.cs:81
Vector3 _actorPos
Definition: BaseTileMap.cs:432
GameSetting.RenderSetting renderSetting
Definition: BaseTileMap.cs:356
MeshPass passAutoTile
Definition: BaseTileMap.cs:175
Vector3 _heightMod
Definition: BaseTileMap.cs:329
float _shadowStrength
Definition: BaseTileMap.cs:414
float floatTimer
Definition: BaseTileMap.cs:402
float pcMaxLight
Definition: BaseTileMap.cs:386
float lowblockTimer
Definition: BaseTileMap.cs:311
RenderData rendererShore
Definition: BaseTileMap.cs:209
Vector3 bridgeFix
Definition: BaseTileMap.cs:94
Vector3 orgPos
Definition: BaseTileMap.cs:472
void DrawRoof(Lot lot)
float _rightWallShade
Definition: BaseTileMap.cs:317
float snowLimit
Definition: BaseTileMap.cs:420
float fogBrightness
Definition: BaseTileMap.cs:416
float floatSpeed
Definition: BaseTileMap.cs:122
Vector3 ugFixBridgeBottom
Definition: BaseTileMap.cs:62
SourceMaterial.Row matBlock
Definition: BaseTileMap.cs:372
RenderDataEffect rendererEffect
Definition: BaseTileMap.cs:229
bool hasBridge
Definition: BaseTileMap.cs:342
float nightRatio
Definition: BaseTileMap.cs:426
SourceBlock.Row _sourceBlock
Definition: BaseTileMap.cs:492
float heightBlockSize
Definition: BaseTileMap.cs:48
float destBrightness
Definition: BaseTileMap.cs:404
bool buildMode
Definition: BaseTileMap.cs:340
RenderData renderFootmark
Definition: BaseTileMap.cs:197
Vector3[] waterEdgeBlockFix
Definition: BaseTileMap.cs:118
Vector3 roofFix
Definition: BaseTileMap.cs:73
Vector3 freePos
Definition: BaseTileMap.cs:434
float defaultBlockHeight
Definition: BaseTileMap.cs:418
bool subtleHighlightArea
Definition: BaseTileMap.cs:278
MeshPass passGuideFloor
Definition: BaseTileMap.cs:139
MeshBatch batch
Definition: BaseTileMap.cs:430
MeshPass passEdge
Definition: BaseTileMap.cs:173
Vector3 ugFixBridgeTop
Definition: BaseTileMap.cs:64
RenderData rendererBlockMarker
Definition: BaseTileMap.cs:199
Point TestPoint
Definition: BaseTileMap.cs:231
MeshPass passCharaL
Definition: BaseTileMap.cs:189
MeshPass passLiquid
Definition: BaseTileMap.cs:135
float snowColor2
Definition: BaseTileMap.cs:424
Vector3[] ambientShadowFix
Definition: BaseTileMap.cs:112
float heightLimitDeco
Definition: BaseTileMap.cs:54
float heightLightMod
Definition: BaseTileMap.cs:314
MeshPass passObjSS
Definition: BaseTileMap.cs:151
float shadowModStrength
Definition: BaseTileMap.cs:124
RenderData rendererFogRoomBlockSolid
Definition: BaseTileMap.cs:219
MeshPass passShore
Definition: BaseTileMap.cs:195
float snowColor
Definition: BaseTileMap.cs:422
SourceMaterial.Row matFloor
Definition: BaseTileMap.cs:374
bool highlightCells
Definition: BaseTileMap.cs:462
float roofLightSnow
Definition: BaseTileMap.cs:85
Vector3 ugFixBridge
Definition: BaseTileMap.cs:60
Vector3 cornerWallFix3
Definition: BaseTileMap.cs:100
RenderData rendererWallDeco
Definition: BaseTileMap.cs:223
MeshPass passRoof
Definition: BaseTileMap.cs:159
CellDetail detail
Definition: BaseTileMap.cs:476
RaycastHit2D[] rays
Definition: BaseTileMap.cs:334
MeshPass passCharaLL
Definition: BaseTileMap.cs:193
SourceBlock.Row sourceBlock
Definition: BaseTileMap.cs:478
int[] seaAnimeIndexes
Definition: BaseTileMap.cs:128
MeshPass passCharaLW
Definition: BaseTileMap.cs:191
Vector3 waterEdgeBridgeFix
Definition: BaseTileMap.cs:106
float roofLightMod
Definition: BaseTileMap.cs:79
RenderData rendererFogRoomWallSolid
Definition: BaseTileMap.cs:221
RoofStyle[] roofStyles
Definition: BaseTileMap.cs:500
MeshPass passObjL
Definition: BaseTileMap.cs:155
RenderData rendererFogFloorSolid
Definition: BaseTileMap.cs:215
int waterAnimeIndex
Definition: BaseTileMap.cs:368
float roomHeight
Definition: BaseTileMap.cs:394
MeshPass passBlockMarker
Definition: BaseTileMap.cs:179
Vector3 colliderFix
Definition: BaseTileMap.cs:43
void SetRoofHeight(MeshPassParam _param, Cell _cell, int _cx, int _cz, int h=0, int altitude=0, int dirWall=-1, bool ignoreAltitudeY=false)
static bool forceShowHang
Definition: BaseTileMap.cs:36
RenderDataObjDummy rendererObjDummy
Definition: BaseTileMap.cs:227
BaseTileSelector selector
Definition: BaseTileMap.cs:354
MeshPass passObjS
Definition: BaseTileMap.cs:149
Vector3 heightModRoofBlock
Definition: BaseTileMap.cs:66
NoiseLayer layerGroundLights
Definition: BaseTileMap.cs:131
RenderData rendererFogBlockSolid
Definition: BaseTileMap.cs:213
float roofLightLimitMod
Definition: BaseTileMap.cs:320
GameSetting.RenderSetting.ZSetting zSetting
Definition: BaseTileMap.cs:358
MeshPass pass
Definition: BaseTileMap.cs:352
float shadowStrength
Definition: BaseTileMap.cs:412
bool _lowblock
Definition: BaseTileMap.cs:344
MeshPass passInner
Definition: BaseTileMap.cs:167
MeshPass passBlockEx
Definition: BaseTileMap.cs:161
SourceFloor.Row sourceFloor
Definition: BaseTileMap.cs:480
MeshPass passBlock
Definition: BaseTileMap.cs:147
CardIconMode iconMode
Definition: BaseTileMap.cs:336
float floorLight2
Definition: BaseTileMap.cs:382
Vector3 GetThingPosition(Card tg, Point p)
int currentHeight
Definition: BaseTileMap.cs:442
bool pressing
Definition: ButtonState.cs:35
ScreenGrading grading
override void Draw(RenderParam p)
Definition: CardRenderer.cs:49
Vector3 position
Definition: CardRenderer.cs:21
virtual bool IsMoving
Definition: CardRenderer.cs:31
virtual void SetFirst(bool first, Vector3 pos)
Definition: Card.cs:11
bool isMasked
Definition: Card.cs:562
string id
Definition: Card.cs:31
bool isNPCProperty
Definition: Card.cs:526
bool isFloating
Definition: Card.cs:622
bool isRoofItem
Definition: Card.cs:550
bool isRestrained
Definition: Card.cs:538
float fy
Definition: Card.cs:250
float fx
Definition: Card.cs:238
PlaceState placeState
Definition: Card.cs:79
TileType TileType
Definition: Card.cs:2035
virtual SourcePref Pref
Definition: Card.cs:2007
Point pos
Definition: Card.cs:55
Trait trait
Definition: Card.cs:49
int altitude
Definition: Card.cs:214
bool isDeconstructing
Definition: Card.cs:418
bool IsInstalled
Definition: Card.cs:2281
virtual bool isChara
Definition: Card.cs:1983
TraitShackle GetRestrainer()
Definition: Card.cs:6540
int dir
Definition: Card.cs:142
virtual CardRow sourceCard
Definition: Card.cs:2031
bool noShadow
Definition: Card.cs:790
SourceCategory.Row category
Definition: Card.cs:1949
bool freePos
Definition: Card.cs:490
CardRenderer renderer
Definition: Card.cs:57
virtual bool flipX
Definition: Card.cs:2016
bool ignoreStackHeight
Definition: Card.cs:610
TaskDesignation designation
Definition: CellDetail.cs:19
List< Thing > things
Definition: CellDetail.cs:11
TransAnime anime
Definition: CellDetail.cs:21
List< Chara > charas
Definition: CellDetail.cs:13
Area area
Definition: CellDetail.cs:15
Footmark footmark
Definition: CellDetail.cs:17
int FireAmount
Definition: CellEffect.cs:150
bool IsFire
Definition: CellEffect.cs:135
bool IsLiquid
Definition: CellEffect.cs:138
SourceCellEffect.Row source
Definition: CellEffect.cs:133
Definition: Cell.cs:7
byte _block
Definition: Cell.cs:30
Room room
Definition: Cell.cs:102
byte TopHeight
Definition: Cell.cs:117
bool HasWallOrFence
Definition: Cell.cs:831
static List< SourceBlock.Row > blockList
Definition: Cell.cs:14
SourceBlock.Row sourceBlock
Definition: Cell.cs:1052
Cell BackRight
Definition: Cell.cs:201
bool lotShade
Definition: Cell.cs:534
bool IsSnowTile
Definition: Cell.cs:782
bool castFloorShadow
Definition: Cell.cs:522
SourceMaterial.Row matBlock
Definition: Cell.cs:1030
byte autotile
Definition: Cell.cs:62
bool HasBlock
Definition: Cell.cs:643
byte shadow
Definition: Cell.cs:70
SourceFloor.Row sourceFloor
Definition: Cell.cs:1054
CellEffect effect
Definition: Cell.cs:94
byte _bridge
Definition: Cell.cs:46
bool isDeck
Definition: Cell.cs:510
Cell Back
Definition: Cell.cs:153
bool lotWall
Definition: Cell.cs:486
bool IsBridgeWater
Definition: Cell.cs:770
byte decal
Definition: Cell.cs:44
Critter critter
Definition: Cell.cs:96
bool isClearSnow
Definition: Cell.cs:450
bool isFloating
Definition: Cell.cs:474
Cell Front
Definition: Cell.cs:129
SourceMaterial.Row matObj
Definition: Cell.cs:1036
List< Thing > Things
Definition: Cell.cs:986
SourceMaterial.Row matBridge
Definition: Cell.cs:1034
bool IsFloorWater
Definition: Cell.cs:727
bool pcSync
Definition: Cell.cs:104
bool UseLowBlock
Definition: Cell.cs:861
byte shore
Definition: Cell.cs:68
bool skipRender
Definition: Cell.cs:270
ushort lightG
Definition: Cell.cs:88
byte _roofBlock
Definition: Cell.cs:50
bool IsTopWater
Definition: Cell.cs:700
byte height
Definition: Cell.cs:72
byte autotileObj
Definition: Cell.cs:66
GrowSystem growth
Definition: Cell.cs:225
ushort lightB
Definition: Cell.cs:90
bool isWatered
Definition: Cell.cs:342
SourceFloor.Row sourceBridge
Definition: Cell.cs:1056
bool isClearArea
Definition: Cell.cs:606
CellDetail detail
Definition: Cell.cs:92
bool isShadowed
Definition: Cell.cs:246
byte _roofBlockDir
Definition: Cell.cs:54
bool HasFloodBlock
Definition: Cell.cs:1017
byte autotileBridge
Definition: Cell.cs:64
bool isToggleWallPillar
Definition: Cell.cs:558
bool HasRoof
Definition: Cell.cs:648
Cell Left
Definition: Cell.cs:165
bool isSkyFloor
Definition: Cell.cs:594
SourceMaterial.Row matFloor
Definition: Cell.cs:1032
int floorDir
Definition: Cell.cs:922
byte _roofBlockMat
Definition: Cell.cs:52
bool isSeen
Definition: Cell.cs:282
byte obj
Definition: Cell.cs:38
bool isSlopeEdge
Definition: Cell.cs:354
bool isShoreSand
Definition: Cell.cs:546
SourceObj.Row sourceObj
Definition: Cell.cs:1072
byte highlight
Definition: Cell.cs:84
int objDir
Definition: Cell.cs:910
Cell BackLeft
Definition: Cell.cs:213
bool isForceFloat
Definition: Cell.cs:306
SourceCellEffect.Row sourceEffect
Definition: Cell.cs:1070
bool isSurrounded
Definition: Cell.cs:234
bool isWallEdge
Definition: Cell.cs:426
bool outOfBounds
Definition: Cell.cs:414
Point GetPoint()
Definition: Cell.cs:1101
Cell Right
Definition: Cell.cs:141
Cell FrontLeft
Definition: Cell.cs:189
bool HasRamp
Definition: Cell.cs:837
bool ignoreObjShadow
Definition: Cell.cs:378
byte bridgeHeight
Definition: Cell.cs:74
bool fullWall
Definition: Cell.cs:462
int liquidLv
Definition: Cell.cs:946
bool isBridgeEdge
Definition: Cell.cs:366
bool hasDoor
Definition: Cell.cs:258
int blockDir
Definition: Cell.cs:898
static List< SourceMaterial.Row > matList
Definition: Cell.cs:12
bool IsRoomEdge
Definition: Cell.cs:868
bool HasFullBlock
Definition: Cell.cs:817
Cell FrontRight
Definition: Cell.cs:177
ushort lightR
Definition: Cell.cs:86
byte bridgePillar
Definition: Cell.cs:82
Definition: Chara.cs:10
override bool IsAliveInCurrentZone
Definition: Chara.cs:551
AIAct ai
Definition: Chara.cs:192
override bool IsPC
Definition: Chara.cs:602
Chara host
Definition: Chara.cs:33
override bool IsDeadOrSleeping
Definition: Chara.cs:563
SourceChara.Row source
Definition: Chara.cs:148
override bool IsMoving
Definition: Chara.cs:598
override CardRow sourceCard
Definition: Chara.cs:440
bool IsInActiveZone
Definition: Chara.cs:796
override void SetRenderParam(RenderParam p)
Definition: Chara.cs:6140
override bool IsPCC
Definition: Chara.cs:672
bool hasTelepathy
Definition: Chara.cs:138
BlockColors blockColors
new GameConfig game
Definition: CoreConfig.cs:598
bool godBuild
Definition: CoreDebug.cs:303
Definition: Core.cs:14
static float fixedFrame
Definition: Core.cs:25
static float delta
Definition: Core.cs:17
CoreConfig config
Definition: Core.cs:70
bool reverse
Definition: Critter.cs:23
void Update()
Definition: Critter.cs:102
virtual int SnowTile
Definition: Critter.cs:33
int tile
Definition: Critter.cs:7
bool IsNight
Definition: Date.cs:112
Definition: EInput.cs:8
static bool isAltDown
Definition: EInput.cs:265
static bool isShiftDown
Definition: EInput.cs:261
static ButtonState rightMouse
Definition: EInput.cs:351
static Vector3 mposWorld
Definition: EInput.cs:339
Definition: EMono.cs:4
static GameSetting setting
Definition: EMono.cs:31
static ColorProfile Colors
Definition: EMono.cs:35
static Core core
Definition: EMono.cs:5
static Chara pc
Definition: EMono.cs:13
static World world
Definition: EMono.cs:37
static Player player
Definition: EMono.cs:11
static Zone _zone
Definition: EMono.cs:19
static Game game
Definition: EMono.cs:7
static Scene scene
Definition: EMono.cs:27
static SoundManager Sound
Definition: EMono.cs:39
static Map _map
Definition: EMono.cs:17
static CoreDebug debug
Definition: EMono.cs:45
static SourceManager sources
Definition: EMono.cs:41
Definition: FLOOR.cs:2
static SourceFloor.Row sourceSnow
Definition: FLOOR.cs:31
static SourceFloor.Row sourceSnow2
Definition: FLOOR.cs:33
static SourceFloor.Row sourceIce
Definition: FLOOR.cs:35
int tile
Definition: Footmark.cs:7
EffectSetting effect
Definition: GameSetting.cs:299
RenderSetting render
Definition: GameSetting.cs:301
int slopeMod
Definition: Game.cs:60
bool buildLight
Definition: Game.cs:36
int animeSpeed
Definition: Game.cs:84
bool showRoof
Definition: Game.cs:12
bool showWall
Definition: Game.cs:15
int lowWallObjAltitude
Definition: Game.cs:87
bool reverseSnow
Definition: Game.cs:48
bool slope
Definition: Game.cs:24
Config config
Definition: Game.cs:215
virtual bool IsMature
Definition: GrowSystem.cs:99
virtual void OnRenderTileMap(RenderParam p)
Definition: GrowSystem.cs:189
static Card alwaysVisible
Definition: LayerDrama.cs:22
Definition: Lot.cs:5
int colDeco2
Definition: Lot.cs:36
bool altRoof
Definition: Lot.cs:46
int colBlock
Definition: Lot.cs:32
int decoFix
Definition: Lot.cs:38
int idRamp
Definition: Lot.cs:24
int decoFix2
Definition: Lot.cs:40
int colRoof
Definition: Lot.cs:30
int mh
Definition: Lot.cs:58
int colDeco
Definition: Lot.cs:34
int idRoofStyle
Definition: Lot.cs:14
int heightFix
Definition: Lot.cs:18
float realHeight
Definition: Lot.cs:64
float light
Definition: Lot.cs:66
int idBlock
Definition: Lot.cs:22
int height
Definition: Lot.cs:12
int idDeco2
Definition: Lot.cs:28
int idDeco
Definition: Lot.cs:26
int idRoofTile
Definition: Lot.cs:20
bool reverse
Definition: Lot.cs:42
int idBGM
Definition: Lot.cs:16
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:33
static SourceMaterial.Row sourceGold
Definition: MATERIAL.cs:37
int Size
Definition: MapBounds.cs:20
int maxZ
Definition: MapBounds.cs:17
int maxX
Definition: MapBounds.cs:14
int x
Definition: MapBounds.cs:8
float heightLightMod
Definition: MapConfig.cs:53
bool fullWallHeight
Definition: MapConfig.cs:32
int skyBlockHeight
Definition: MapConfig.cs:89
float blockHeight
Definition: MapConfig.cs:68
Definition: Map.cs:13
bool IsIndoor
Definition: Map.cs:131
int SizeXZ
Definition: Map.cs:133
RoomManager rooms
Definition: Map.cs:31
Cell[,] cells
Definition: Map.cs:85
MapConfig config
Definition: Map.cs:37
static HashSet< int > sunMap
Definition: Map.cs:14
MapBounds bounds
Definition: Map.cs:52
float[] matColors
Definition: MeshBatch.cs:11
Matrix4x4[] matrices
Definition: MeshBatch.cs:5
float[] tiles
Definition: MeshBatch.cs:7
float[] colors
Definition: MeshBatch.cs:9
int batchIdx
Definition: MeshPass.cs:60
void Add(Point point, float tile=0f, float color=0f)
Definition: MeshPass.cs:122
void NextBatch()
Definition: MeshPass.cs:417
int batchSize
Definition: MeshPass.cs:63
void AddShadow(MeshPassParam p, ref Vector3 fix)
Definition: MeshPass.cs:195
List< MeshBatch > batches
Definition: MeshPass.cs:66
int idx
Definition: MeshPass.cs:57
bool CanSee(Chara c)
Definition: Player.cs:2238
CinemaConfig cinemaConfig
Definition: Player.cs:928
float lightPower
Definition: Player.cs:1013
int lightRadius
Definition: Player.cs:1005
Definition: Point.cs:9
static Point shared
Definition: Point.cs:20
ref Vector3 Position(int height)
Definition: Point.cs:536
Point Set(int _x, int _z)
Definition: Point.cs:491
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool IsValid
Definition: Point.cs:88
Point Clamp(bool useBounds=false)
Definition: Point.cs:984
Cell cell
Definition: Point.cs:51
Definition: Rand.cs:4
static int MaxBytes
Definition: Rand.cs:5
static byte[] bytes
Definition: Rand.cs:9
static void InitBytes(int a)
Definition: Rand.cs:11
new void Draw(RenderParam p, int tile=0)
void Draw(RenderParam p, int tile)
Definition: RenderData.cs:128
Vector3 offsetShadow
Definition: RenderData.cs:22
void DrawRepeat(RenderParam p, int count, float size, bool skipFirst=false)
Definition: RenderData.cs:214
float stackZ
Definition: RenderData.cs:44
int ConvertTile(int tile)
Definition: RenderData.cs:110
SourcePref shadowPref
Definition: RenderData.cs:48
int idShadow
Definition: RenderData.cs:14
float hangedFixZ
Definition: RenderData.cs:42
RenderData data
Definition: RenderObject.cs:34
SourceMaterial.Row mat
Definition: RenderParam.cs:17
int liquidLv
Definition: RenderParam.cs:7
void SetRenderParam(RenderParam p, SourceMaterial.Row mat, int dir)
Definition: RenderRow.cs:376
bool multisize
Definition: RenderRow.cs:64
RenderData renderData
Definition: RenderRow.cs:71
SourcePref pref
Definition: RenderRow.cs:68
bool useAltColor
Definition: RenderRow.cs:80
TileType tileType
Definition: RenderRow.cs:77
int[] _tiles
Definition: RenderRow.cs:12
SourceMaterial.Row DefaultMaterial
Definition: RenderRow.cs:86
int colorMod
Definition: RenderRow.cs:16
int snowTile
Definition: RenderRow.cs:28
Vector3 lowRoofFix
Definition: RoofStyle.cs:39
Vector3 posFix
Definition: RoofStyle.cs:35
int flatW
Definition: RoofStyle.cs:23
float snowZ
Definition: RoofStyle.cs:43
bool coverLot
Definition: RoofStyle.cs:33
Vector3 posFixBlock
Definition: RoofStyle.cs:37
bool wing
Definition: RoofStyle.cs:29
Vector3 snowFix
Definition: RoofStyle.cs:41
Type type
Definition: RoofStyle.cs:17
List< Lot > listLot
Definition: RoomManager.cs:20
void Refresh()
Definition: RoomManager.cs:52
Definition: Room.cs:4
bool HasRoof
Definition: Room.cs:29
Lot lot
Definition: Room.cs:21
AnimationCurve baseBrightnessCurve
AnimationCurve shadowCurveFloor
AnimationCurve dynamicBrightnessCurve2
float dynamicBrightnessLightBonus
AnimationCurve lightLimit
AnimationCurve fogBrightness
AnimationCurve dynamicBrightnessCurve
AnimationCurve shadowCurve
AnimationCurve nightRatioCurve
AnimationCurve lightModCurve
SceneGlobalProfile global
Definition: SceneProfile.cs:6
SceneLightProfile light
Definition: SceneProfile.cs:10
Definition: Scene.cs:8
List< ISyncScreen > syncList
Definition: Scene.cs:133
static Point HitPoint
Definition: Scene.cs:21
float timeRatio
Definition: Scene.cs:126
CameraSupport camSupport
Definition: Scene.cs:41
ParticleSystem psFey
Definition: Scene.cs:115
GameSetting.RenderSetting.MapBGSetting bg
Definition: Scene.cs:120
SoundSource sfxFire
Definition: Scene.cs:85
ActionMode actionMode
Definition: Scene.cs:77
SceneProfile profile
Definition: Scene.cs:73
void DrawWall(Point point, int color, bool useMarkerPass=false, float offsetZ=0f)
Definition: ScreenGuide.cs:42
MeshPass passGuideFloor
Definition: ScreenGuide.cs:7
List< Item > items
Definition: ShadowData.cs:101
static ShadowData Instance
Definition: ShadowData.cs:99
SourceObj objs
SourceBlock blocks
SourceFloor floors
bool HasGrowth
Definition: SourceObj.cs:26
GrowSystem growth
Definition: SourceObj.cs:31
bool bypassShadow
Definition: SourcePref.cs:299
int liquidModMax
Definition: SourcePref.cs:71
float height
Definition: SourcePref.cs:47
int liquidMod
Definition: SourcePref.cs:59
bool Float
Definition: SourcePref.cs:312
int shadow
Definition: SourcePref.cs:35
bool IsPlayerFaction
Definition: Spatial.cs:443
virtual bool IsRegion
Definition: Spatial.cs:501
virtual bool IsSnowCovered
Definition: Spatial.cs:531
virtual void Draw(int x, int z, RenderParam p)
Definition: Thing.cs:8
override void SetRenderParam(RenderParam p)
Definition: Thing.cs:1414
override SourcePref Pref
Definition: Thing.cs:50
override CardRow sourceCard
Definition: Thing.cs:47
int id
Definition: TileRow.cs:8
virtual bool IsUseBlockDir
Definition: TileType.cs:129
virtual bool UseHangZFix
Definition: TileType.cs:211
static TileTypeSky Sky
Definition: TileType.cs:67
virtual bool CanStack
Definition: TileType.cs:121
virtual void GetMountHeight(ref Vector3 v, Point p, int d, Card target=null)
Definition: TileType.cs:367
static TileTypeIllumination Illumination
Definition: TileType.cs:83
static TileTypeWaterShallow FloorWaterShallow
Definition: TileType.cs:57
bool IsRamp
Definition: TileType.cs:143
virtual bool AlwaysShowShadow
Definition: TileType.cs:241
virtual bool UseLowWallTiles
Definition: TileType.cs:207
virtual bool IsFullBlock
Definition: TileType.cs:165
virtual bool IsWall
Definition: TileType.cs:133
virtual bool ForceRpeatBlock
Definition: TileType.cs:245
virtual bool IsSkipLowBlock
Definition: TileType.cs:125
virtual bool UseMountHeight
Definition: TileType.cs:209
virtual bool IsFence
Definition: TileType.cs:167
virtual BlockRenderMode blockRenderMode
Definition: TileType.cs:265
Vector3 GetRampFix(int dir, SourcePref pref=null)
Definition: TileType.cs:372
virtual bool IsWaterTop
Definition: TileType.cs:175
virtual bool RepeatBlock
Definition: TileType.cs:243
virtual bool IsOpen()
Definition: TraitDoor.cs:97
virtual Vector3 GetRestrainPos
Definition: TraitShackle.cs:5
virtual bool IgnoreLastStackHeight
Definition: Trait.cs:117
virtual bool AlwaysHideOnLowWall
Definition: Trait.cs:347
virtual bool UseLowblock
Definition: Trait.cs:433
virtual TileType tileType
Definition: Trait.cs:48
virtual bool IsChangeFloorHeight
Definition: Trait.cs:72
virtual bool IsGround
Definition: Trait.cs:66
Card owner
Definition: Trait.cs:26
Vector3 v
Definition: TransAnime.cs:5
bool animeBlock
Definition: TransAnime.cs:21
bool drawBlock
Definition: TransAnime.cs:25
GameDate date
Definition: World.cs:6
Definition: Zone.cs:12
virtual bool IsSkyLevel
Definition: Zone.cs:262
void RefreshBGM()
Definition: Zone.cs:2762
virtual bool UseFog
Definition: Zone.cs:384
virtual bool AlwaysLowblock
Definition: Zone.cs:388
bool IsPCFaction
Definition: Zone.cs:464
Map map
Definition: Zone.cs:60