Elin Decompiled Documentation EA 23.352 Stable
Loading...
Searching...
No Matches
Cell.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using Algorithms;
3using FloodSpill;
4using UnityEngine;
5
6public class Cell : WeightCell, IFloodCell
7{
8 public static Map map;
9
10 public static Cell Void = new Cell();
11
12 public static List<SourceMaterial.Row> matList;
13
14 public static List<SourceBlock.Row> blockList;
15
16 public static List<SourceFloor.Row> floorList;
17
18 public static List<SourceDeco.Row> decoList;
19
20 public static List<SourceCellEffect.Row> effectList;
21
22 public static List<SourceObj.Row> objList;
23
25
26 public static SourceBlock blockSource;
27
28 public static SourceFloor floorSource;
29
30 public static SourceDeco decoSource;
31
33
34 public static SourceObj objSource;
35
36 public static int Size;
37
38 public static Cell[,] cells;
39
40 public const int DivAutotile = 12;
41
42 public int _block;
43
44 public int _blockMat;
45
46 public int _floor;
47
48 public int _floorMat;
49
50 public int obj;
51
52 public int objMat;
53
54 public int _bridge;
55
56 public int _bridgeMat;
57
58 public int _roofBlock;
59
60 public int _roofBlockMat;
61
62 public int _deco;
63
64 public int _decoMat;
65
66 public byte _dirs;
67
68 public byte objVal;
69
70 public byte decal;
71
72 public byte _roofBlockDir;
73
74 public int bridgePillar;
75
76 public byte x;
77
78 public byte z;
79
80 public byte light;
81
82 public byte autotile;
83
84 public byte autotileDeco;
85
86 public byte autotileBridge;
87
88 public byte autotileObj;
89
90 public byte shore;
91
92 public byte shadow;
93
94 public byte height;
95
96 public byte bridgeHeight;
97
98 public byte shadowMod;
99
100 public byte topHeight;
101
102 public byte minHeight;
103
104 public byte highlight;
105
106 public ushort lightR;
107
108 public ushort lightG;
109
110 public ushort lightB;
111
113
115
117
119
121
122 public Room room;
123
125
126 public bool pcSync;
127
128 public const int DIV_LIQUID = 10;
129
130 private static bool openSight;
131
132 private static bool openPath;
133
134 public const int DivStage = 30;
135
136 public int index => x + z * Size;
137
138 public byte TopHeight
139 {
140 get
141 {
142 if (bridgeHeight != 0)
143 {
144 return bridgeHeight;
145 }
146 return height;
147 }
148 }
149
150 public Cell Front
151 {
152 get
153 {
154 if (z <= 0)
155 {
156 return Void;
157 }
158 return cells[x, z - 1];
159 }
160 }
161
162 public Cell Right
163 {
164 get
165 {
166 if (x + 1 >= Size)
167 {
168 return Void;
169 }
170 return cells[x + 1, z];
171 }
172 }
173
174 public Cell Back
175 {
176 get
177 {
178 if (z + 1 >= Size)
179 {
180 return Void;
181 }
182 return cells[x, z + 1];
183 }
184 }
185
186 public Cell Left
187 {
188 get
189 {
190 if (x <= 0)
191 {
192 return Void;
193 }
194 return cells[x - 1, z];
195 }
196 }
197
199 {
200 get
201 {
202 if (x + 1 >= Size || z <= 0)
203 {
204 return Void;
205 }
206 return cells[x + 1, z - 1];
207 }
208 }
209
211 {
212 get
213 {
214 if (x <= 0 || z <= 0)
215 {
216 return Void;
217 }
218 return cells[x - 1, z - 1];
219 }
220 }
221
223 {
224 get
225 {
226 if (x + 1 >= Size || z + 1 >= Size)
227 {
228 return Void;
229 }
230 return cells[x + 1, z + 1];
231 }
232 }
233
235 {
236 get
237 {
238 if (x <= 0 || z + 1 >= Size)
239 {
240 return Void;
241 }
242 return cells[x - 1, z + 1];
243 }
244 }
245
247 {
248 get
249 {
250 GrowSystem.cell = this;
251 return sourceObj.growth;
252 }
253 }
254
255 public bool isSurrounded
256 {
257 get
258 {
259 return bits[0];
260 }
261 set
262 {
263 bits[0] = value;
264 }
265 }
266
267 public bool isShadowed
268 {
269 get
270 {
271 return bits[1];
272 }
273 set
274 {
275 bits[1] = value;
276 }
277 }
278
279 public bool hasDoor => traitDoor != null;
280
281 public bool skipRender
282 {
283 get
284 {
285 return bits[4];
286 }
287 set
288 {
289 bits[4] = value;
290 }
291 }
292
293 public bool isSeen
294 {
295 get
296 {
297 return bits[6];
298 }
299 set
300 {
301 bits[6] = value;
302 }
303 }
304
305 public bool isSurrounded4d
306 {
307 get
308 {
309 return bits[7];
310 }
311 set
312 {
313 bits[7] = value;
314 }
315 }
316
317 public bool isForceFloat
318 {
319 get
320 {
321 return bits[8];
322 }
323 set
324 {
325 bits[8] = value;
326 }
327 }
328
329 public bool blockSight
330 {
331 get
332 {
333 return bits[9];
334 }
335 set
336 {
337 bits[9] = value;
338 }
339 }
340
341 public bool isHarvested
342 {
343 get
344 {
345 return bits[10];
346 }
347 set
348 {
349 bits[10] = value;
350 }
351 }
352
353 public bool isWatered
354 {
355 get
356 {
357 return bits[11];
358 }
359 set
360 {
361 bits[11] = value;
362 }
363 }
364
365 public bool isSlopeEdge
366 {
367 get
368 {
369 return bits[12];
370 }
371 set
372 {
373 bits[12] = value;
374 }
375 }
376
377 public bool isBridgeEdge
378 {
379 get
380 {
381 return bits[13];
382 }
383 set
384 {
385 bits[13] = value;
386 }
387 }
388
389 public bool ignoreObjShadow
390 {
391 get
392 {
393 return bits[14];
394 }
395 set
396 {
397 bits[14] = value;
398 }
399 }
400
401 public bool nonGradient
402 {
403 get
404 {
405 return bits[15];
406 }
407 set
408 {
409 bits[15] = value;
410 }
411 }
412
413 public bool impassable
414 {
415 get
416 {
417 return bits[16];
418 }
419 set
420 {
421 bits[16] = value;
422 }
423 }
424
425 public bool outOfBounds
426 {
427 get
428 {
429 return bits[17];
430 }
431 set
432 {
433 bits[17] = value;
434 }
435 }
436
437 public bool isWallEdge
438 {
439 get
440 {
441 return bits[20];
442 }
443 set
444 {
445 bits[20] = value;
446 }
447 }
448
449 public bool isModified
450 {
451 get
452 {
453 return bits[21];
454 }
455 set
456 {
457 bits[21] = value;
458 }
459 }
460
461 public bool isClearSnow
462 {
463 get
464 {
465 return bits[22];
466 }
467 set
468 {
469 bits[22] = value;
470 }
471 }
472
473 public bool fullWall
474 {
475 get
476 {
477 return bits[23];
478 }
479 set
480 {
481 bits[23] = value;
482 }
483 }
484
485 public bool isFloating
486 {
487 get
488 {
489 return bits[24];
490 }
491 set
492 {
493 bits[24] = value;
494 }
495 }
496
497 public bool lotWall
498 {
499 get
500 {
501 return bits[25];
502 }
503 set
504 {
505 bits[25] = value;
506 }
507 }
508
509 public bool hasDoorBoat
510 {
511 get
512 {
513 return bits[26];
514 }
515 set
516 {
517 bits[26] = value;
518 }
519 }
520
521 public bool isDeck
522 {
523 get
524 {
525 return bits[27];
526 }
527 set
528 {
529 bits[27] = value;
530 }
531 }
532
533 public bool castFloorShadow
534 {
535 get
536 {
537 return bits[28];
538 }
539 set
540 {
541 bits[28] = value;
542 }
543 }
544
545 public bool lotShade
546 {
547 get
548 {
549 return bits[29];
550 }
551 set
552 {
553 bits[29] = value;
554 }
555 }
556
557 public bool isShoreSand
558 {
559 get
560 {
561 return bits[30];
562 }
563 set
564 {
565 bits[30] = value;
566 }
567 }
568
570 {
571 get
572 {
573 return bits[31];
574 }
575 set
576 {
577 bits[31] = value;
578 }
579 }
580
581 public bool hasWindow
582 {
583 get
584 {
585 return bits2[0];
586 }
587 set
588 {
589 bits2[0] = value;
590 }
591 }
592
593 public bool isCurtainClosed
594 {
595 get
596 {
597 return bits2[1];
598 }
599 set
600 {
601 bits2[1] = value;
602 }
603 }
604
605 public bool isSkyFloor
606 {
607 get
608 {
609 return bits2[2];
610 }
611 set
612 {
613 bits2[2] = value;
614 }
615 }
616
617 public bool isClearArea
618 {
619 get
620 {
621 return bits2[3];
622 }
623 set
624 {
625 bits2[3] = value;
626 }
627 }
628
629 public bool isObjDyed
630 {
631 get
632 {
633 return bits2[4];
634 }
635 set
636 {
637 bits2[4] = value;
638 }
639 }
640
641 public bool crossWall
642 {
643 get
644 {
645 return bits2[5];
646 }
647 set
648 {
649 bits2[5] = value;
650 }
651 }
652
653 public bool hidePillar
654 {
655 get
656 {
657 return bits2[6];
658 }
659 set
660 {
661 bits2[6] = value;
662 }
663 }
664
665 public bool toggleOcclusion
666 {
667 get
668 {
669 return bits2[7];
670 }
671 set
672 {
673 bits2[7] = value;
674 }
675 }
676
677 public bool HasObj => obj != 0;
678
679 public bool HasBlock => _block != 0;
680
681 public bool HasFloor => _floor != 0;
682
683 public bool HasRoof
684 {
685 get
686 {
687 if (room != null)
688 {
689 return room.lot.idRoofStyle != 0;
690 }
691 return false;
692 }
693 }
694
695 public bool HasFloorOrBlock
696 {
697 get
698 {
699 if (_block == 0)
700 {
701 return _floor != 0;
702 }
703 return true;
704 }
705 }
706
707 public bool HasBridge => _bridge != 0;
708
709 public bool HasLiquid => effect?.IsLiquid ?? false;
710
711 public bool HasFire
712 {
713 get
714 {
715 if (effect != null)
716 {
717 return effect.IsFire;
718 }
719 return false;
720 }
721 }
722
723 public bool IsNotWaterEdge
724 {
725 get
726 {
727 if (!HasFullBlock && !floorSource[_floor].tileType.IsWater)
728 {
729 return floorSource[_floor].edge == 0;
730 }
731 return true;
732 }
733 }
734
735 public bool IsTopWater
736 {
737 get
738 {
739 if (_bridge != 0)
740 {
741 return floorSource[_bridge].tileType.IsWater;
742 }
743 return floorSource[_floor].tileType.IsWater;
744 }
745 }
746
748 {
749 get
750 {
751 if (IsTopWater)
752 {
754 {
755 return isClearSnow;
756 }
757 return true;
758 }
759 return false;
760 }
761 }
762
763 public bool IsFloorWater => floorSource[_floor].tileType.IsWater;
764
765 public bool IsFarmField
766 {
767 get
768 {
769 if (_bridge != 0)
770 {
771 return sourceBridge.Category.id == "floor_field";
772 }
773 return sourceFloor.Category.id == "floor_field";
774 }
775 }
776
777 public bool CanGrowWeed
778 {
779 get
780 {
781 if (obj == 0 && FirstThing == null && !HasBlock && !HasRoof)
782 {
783 if (!IsFarmField)
784 {
785 if (_bridge != 0)
786 {
787 if (matBridge.category == "grass")
788 {
789 return sourceBridge.tag.Contains("weed");
790 }
791 return false;
792 }
793 if (matFloor.category == "grass")
794 {
795 return sourceFloor.tag.Contains("weed");
796 }
797 return false;
798 }
799 return true;
800 }
801 return false;
802 }
803 }
804
805 public bool IsBridgeWater
806 {
807 get
808 {
809 if (_bridge != 0)
810 {
811 return floorSource[_bridge].tileType.IsWater;
812 }
813 return false;
814 }
815 }
816
817 public bool IsSnowTile
818 {
819 get
820 {
822 {
823 return !isDeck;
824 }
825 return false;
826 }
827 }
828
829 public bool IsDeepWater
830 {
831 get
832 {
833 if (sourceSurface.tileType.IsDeepWater)
834 {
835 return !IsIceTile;
836 }
837 return false;
838 }
839 }
840
841 public bool IsIceTile
842 {
843 get
844 {
846 {
847 return !isClearSnow;
848 }
849 return false;
850 }
851 }
852
853 public bool HasFullBlock => blockSource[_block].tileType.IsFullBlock;
854
856 {
857 get
858 {
859 if (!HasFullBlock)
860 {
861 return HasWallOrFence;
862 }
863 return true;
864 }
865 }
866
867 public bool HasWallOrFence => blockSource[_block].tileType.IsWallOrFence;
868
869 public bool HasWall => blockSource[_block].tileType.IsWall;
870
871 public bool HasFence => blockSource[_block].tileType.IsFence;
872
873 public bool HasRamp => blockSource[_block].tileType.IsRamp;
874
875 public bool HasLadder => blockSource[_block].tileType.IsLadder;
876
877 public bool HasRampOrLadder
878 {
879 get
880 {
881 if (!HasRamp)
882 {
883 return HasLadder;
884 }
885 return true;
886 }
887 }
888
889 public bool HasSlope => blockSource[_block].tileType == TileType.Slope;
890
891 public bool HasStairs => blockSource[_block].tileType == TileType.Stairs;
892
893 public bool HasHalfBlock => blockSource[_block].tileType == TileType.HalfBlock;
894
895 public bool HasBlockOrRamp => blockSource[_block].isBlockOrRamp;
896
897 public bool UseLowBlock => blockSource[_block].tileType.UseLowBlock;
898
899 public bool CastShadow => blockSource[_block].tileType.CastShadowSelf;
900
901 public bool CastAmbientShadow => blockSource[_block].tileType.CastAmbientShadow;
902
903 public bool IsRoomEdge
904 {
905 get
906 {
907 if (Front.room == room && Right.room == room)
908 {
909 return FrontRight.room != room;
910 }
911 return true;
912 }
913 }
914
915 public bool IsLotEdge
916 {
917 get
918 {
919 if (Front.room != null && Right.room != null && FrontRight.room != null && Back.room != null && Left.room != null && (Front.room == null || (!Front.room.data.atrium && Front.HasRoof)))
920 {
921 if (Right.room != null)
922 {
923 return Right.room.data.atrium | !Right.HasRoof;
924 }
925 return false;
926 }
927 return true;
928 }
929 }
930
931 public bool IsBlocked => blocked;
932
933 public int blockDir
934 {
935 get
936 {
937 return _dirs % 4;
938 }
939 set
940 {
941 _dirs = (byte)(_dirs - blockDir + value);
942 }
943 }
944
945 public int objDir
946 {
947 get
948 {
949 return _dirs / 4 % 8;
950 }
951 set
952 {
953 _dirs = (byte)(_dirs - objDir * 4 + value % 8 * 4);
954 }
955 }
956
957 public int floorDir
958 {
959 get
960 {
961 return _dirs / 32;
962 }
963 set
964 {
965 _dirs = (byte)(_dirs - floorDir * 32 + value * 32);
966 }
967 }
968
969 public bool IsSky
970 {
971 get
972 {
973 if (sourceFloor.tileType == TileType.Sky)
974 {
975 return !HasBridge;
976 }
977 return false;
978 }
979 }
980
981 public int liquidLv
982 {
983 get
984 {
985 if (effect != null && effect.LiquidAmount != 0)
986 {
987 return (effect?.LiquidAmount ?? 0) / 3 + 1;
988 }
989 return 0;
990 }
991 }
992
993 public int fireAmount => effect?.FireAmount ?? 0;
994
995 public bool IsVoid => this == Void;
996
998 {
999 get
1000 {
1001 CellDetail cellDetail = detail;
1002 if (cellDetail == null || cellDetail.things.Count <= 0)
1003 {
1004 return null;
1005 }
1006 return detail.things[0];
1007 }
1008 }
1009
1011 {
1012 get
1013 {
1014 if (detail == null || detail.things.Count <= 0 || !detail.things[0].IsInstalled)
1015 {
1016 return null;
1017 }
1018 return detail.things[0];
1019 }
1020 }
1021
1022 public List<Thing> Things => (detail ?? CellDetail.Empty).things;
1023
1024 public List<Chara> Charas => (detail ?? CellDetail.Empty).charas;
1025
1026 public int gatherCount
1027 {
1028 get
1029 {
1030 if (!map.gatherCounts.ContainsKey(index))
1031 {
1032 return 0;
1033 }
1034 return map.gatherCounts[index];
1035 }
1036 set
1037 {
1038 if (value == 0)
1039 {
1040 if (map.gatherCounts.ContainsKey(index))
1041 {
1042 map.gatherCounts.Remove(index);
1043 }
1044 }
1045 else
1046 {
1047 map.gatherCounts[index] = value;
1048 }
1049 }
1050 }
1051
1052 public bool HasFloodBlock
1053 {
1054 get
1055 {
1056 if (!sourceBlock.tileType.IsFloodBlock)
1057 {
1058 return hasDoor;
1059 }
1060 return true;
1061 }
1062 }
1063
1065
1067
1069
1071
1073
1075
1077 {
1078 get
1079 {
1080 if (!isObjDyed)
1081 {
1082 return matSource[objMat];
1083 }
1084 return sourceObj.DefaultMaterial;
1085 }
1086 }
1087
1089
1091
1093
1095
1097 {
1098 get
1099 {
1100 if (_bridge != 0)
1101 {
1102 return sourceBridge;
1103 }
1104 return sourceFloor;
1105 }
1106 }
1107
1109
1111
1113
1115 {
1116 get
1117 {
1118 if (!(sourceFloor.biome != null))
1119 {
1120 return EClass._zone.biome;
1121 }
1122 return sourceFloor.biome;
1123 }
1124 }
1125
1126 public override bool Equals(object obj)
1127 {
1128 return false;
1129 }
1130
1131 public override string ToString()
1132 {
1133 return "Cell(" + x + "," + z + " " + matBlock?.ToString() + "/" + matFloor?.ToString() + "/" + _block + ")";
1134 }
1135
1136 public override int GetHashCode()
1137 {
1138 return index;
1139 }
1140
1142 {
1143 return new Point(x, z);
1144 }
1145
1147 {
1148 return Point.shared.Set(x, z);
1149 }
1150
1151 public bool CanSuffocate()
1152 {
1154 {
1155 return true;
1156 }
1157 if (!IsDeepWater)
1158 {
1159 return false;
1160 }
1161 if (detail != null && detail.things.Count > 0)
1162 {
1163 foreach (Thing thing in detail.things)
1164 {
1165 if (thing.IsInstalled && thing.isFloating)
1166 {
1167 return false;
1168 }
1169 }
1170 }
1171 return true;
1172 }
1173
1174 public bool HasObstacle()
1175 {
1176 if (!blocked && _block == 0 && obj == 0)
1177 {
1178 return hasDoor;
1179 }
1180 return true;
1181 }
1182
1183 public bool CanBuildRamp(int dir)
1184 {
1185 if (HasRamp)
1186 {
1187 return blockDir == dir;
1188 }
1189 return true;
1190 }
1191
1192 public void Refresh()
1193 {
1194 Cell cell = ((x > 0) ? cells[x - 1, z] : Void);
1195 Cell cell2 = ((x + 1 < Size) ? cells[x + 1, z] : Void);
1196 Cell cell3 = ((z > 0) ? cells[x, z - 1] : Void);
1197 Cell cell4 = ((z + 1 < Size) ? cells[x, z + 1] : Void);
1198 Cell cell5 = ((x > 0 && z > 0) ? cells[x - 1, z - 1] : Void);
1199 Cell cell6 = ((x + 1 < Size && z > 0) ? cells[x + 1, z - 1] : Void);
1200 Cell cell7 = ((x > 0 && z + 1 < Size) ? cells[x - 1, z + 1] : Void);
1201 Cell cell8 = ((x + 1 < Size && z + 1 < Size) ? cells[x + 1, z + 1] : Void);
1202 Cell cell9 = ((z > 1) ? cells[x, z - 2] : Void);
1203 Cell cell10 = ((x + 2 < Size) ? cells[x + 2, z] : Void);
1204 TileType tileType = sourceBlock.tileType;
1205 TileType tileType2 = sourceFloor.tileType;
1206 MapBounds bounds = map.bounds;
1207 bool hasBridge = _bridge != 0;
1208 outOfBounds = x < bounds.x || z < bounds.z || x > bounds.maxX || z > bounds.maxZ;
1209 isSurrounded4d = cell.HasFullBlock && cell2.HasFullBlock && cell3.HasFullBlock && cell4.HasFullBlock;
1210 isSurrounded = isSurrounded4d && cell5.HasFullBlock && cell6.HasFullBlock && cell7.HasFullBlock && cell8.HasFullBlock && cell3.bridgeHeight == bridgeHeight && cell2.bridgeHeight == bridgeHeight && cell4.bridgeHeight == bridgeHeight && cell.bridgeHeight == bridgeHeight;
1211 traitDoor = null;
1213 hasDoorBoat = false;
1214 isDeck = false;
1215 isShoreSand = false;
1216 hasWindow = false;
1217 isCurtainClosed = false;
1218 isSkyFloor = tileType2 != TileType.Sky && (cell2.sourceFloor.tileType == TileType.Sky || cell3.sourceFloor.tileType == TileType.Sky);
1219 openPath = false;
1220 openSight = tileType.IsOpenSight || (cell3.hasWindow && !cell3.isCurtainClosed) || (cell2.hasWindow && !cell2.isCurtainClosed);
1221 blockSight = tileType.IsBlockSight || ((objSource[obj].growth != null) ? objSource[obj].growth.BlockSight(this) : objSource[obj].tileType.IsBlockSight);
1222 blocked = outOfBounds || tileType.IsBlockPass || (tileType2.IsBlockPass && !hasBridge) || ((objSource[obj].growth != null) ? objSource[obj].growth.BlockPass(this) : objSource[obj].tileType.IsBlockPass) || impassable;
1223 isSlopeEdge = height > cell2.height || height > cell3.height;
1224 if (hasBridge && sourceBridge.tileType.ShowPillar)
1225 {
1226 isBridgeEdge = _bridge != cell2._bridge || _bridge != cell3._bridge || bridgeHeight > cell2.bridgeHeight || bridgeHeight > cell3.bridgeHeight || _bridge != cell._bridge || _bridge != cell4._bridge || bridgeHeight > cell.bridgeHeight || bridgeHeight > cell4.bridgeHeight;
1227 }
1228 else
1229 {
1230 isBridgeEdge = false;
1231 }
1232 lotShade = false;
1233 if (room == null && !EClass._zone.IsSnowCovered)
1234 {
1235 if ((cell10.room != null && cell2.sourceBlock.tileType.CastShadowSelf) || (cell9.room != null && cell3.sourceBlock.tileType.CastShadowSelf))
1236 {
1237 lotShade = true;
1238 }
1239 else if ((cell10.Front.room != null && cell6.sourceBlock.tileType.CastShadowSelf) || (cell9.Right.room != null && cell6.sourceBlock.tileType.CastShadowSelf) || (cell6.FrontRight.room != null && cell6.Right.sourceBlock.tileType.CastShadowSelf))
1240 {
1241 lotShade = true;
1242 }
1243 else if (cell10.sourceBlock.tileType.CastShadowSelf && cell10.Right.room != null)
1244 {
1245 lotShade = true;
1246 }
1247 }
1248 isShadowed = lotShade || sourceBlock.tileType.CastShadowSelf || cell3.sourceBlock.tileType.CastShadowBack || (!HasRoof && _roofBlock != 0);
1249 castFloorShadow = lotShade || (room == null && sourceBlock.tileType.CastShadowSelf);
1250 byte b = (hasBridge ? bridgeHeight : height);
1251 byte b2 = ((cell3.bridgeHeight == 0) ? cell3.height : cell3.bridgeHeight);
1252 byte b3 = ((cell2.bridgeHeight == 0) ? cell2.height : cell2.bridgeHeight);
1253 byte b4 = ((cell9.bridgeHeight == 0) ? cell9.height : cell9.bridgeHeight);
1254 byte b5 = ((cell10.bridgeHeight == 0) ? cell10.height : cell10.bridgeHeight);
1255 int num = 0;
1256 if (b3 - b > num)
1257 {
1258 num = b3 - b;
1259 }
1260 if (b2 - b > num)
1261 {
1262 num = b2 - b;
1263 }
1264 if (b5 - b - 4 > num)
1265 {
1266 num = b5 - b - 4;
1267 }
1268 if (b4 - b - 4 > num)
1269 {
1270 num = b4 - b - 4;
1271 }
1272 num -= 4;
1273 if (num > 15)
1274 {
1275 num = 15;
1276 }
1277 if (IsTopWater)
1278 {
1279 num /= 3;
1280 }
1281 else if (isShadowed)
1282 {
1283 num /= 2;
1284 }
1285 if (num <= 0)
1286 {
1287 num = 0;
1288 }
1289 shadowMod = (byte)num;
1290 baseWeight = 0;
1291 if (detail != null && detail.things.Count > 0)
1292 {
1293 for (int i = 0; i < detail.things.Count; i++)
1294 {
1295 Thing thing = detail.things[i];
1296 if (!thing.IsInstalled)
1297 {
1298 continue;
1299 }
1300 if (thing.trait.WeightMod > baseWeight)
1301 {
1302 baseWeight = thing.trait.WeightMod;
1303 }
1304 if (thing.isHidden)
1305 {
1306 continue;
1307 }
1308 if (thing.trait.IsFloating)
1309 {
1310 isFloating = true;
1311 if (IsFloorWater)
1312 {
1313 blocked = true;
1314 }
1315 else
1316 {
1317 isDeck = true;
1318 }
1319 }
1320 else
1321 {
1322 if (thing.trait.IsOpenPath)
1323 {
1324 blocked = false;
1325 hasDoorBoat = true;
1326 openPath = true;
1327 openSight = true;
1328 }
1329 if (thing.trait.IsBlockPath)
1330 {
1331 blocked = true;
1332 }
1333 }
1334 if (thing.trait.IsOpenSight)
1335 {
1336 openSight = true;
1337 }
1338 if (thing.trait is TraitDoor)
1339 {
1340 traitDoor = thing.trait as TraitDoor;
1341 blocked = false;
1342 blockSight = true;
1343 }
1344 else if (thing.trait.IsBlockSight)
1345 {
1346 blockSight = true;
1347 }
1348 Trait trait = thing.trait;
1349 if (!(trait is TraitWindow))
1350 {
1351 if (trait is TraitCurtain)
1352 {
1353 isCurtainClosed = thing.isOn;
1354 }
1355 }
1356 else
1357 {
1358 hasWindow = true;
1359 }
1360 }
1361 }
1362 minHeight = (byte)(10 + b + ((IsTopWater && !isFloating) ? sourceFloor.tileType.FloorAltitude : 0));
1363 topHeight = (byte)(minHeight + tileType.slopeHeight);
1364 weights[0] = (byte)((Mathf.Abs(cell3.minHeight - topHeight) <= 8 || Mathf.Abs(cell3.topHeight - minHeight) <= 8) ? 1u : 0u);
1365 weights[1] = (byte)((Mathf.Abs(cell2.minHeight - topHeight) <= 8 || Mathf.Abs(cell2.topHeight - minHeight) <= 8) ? 1u : 0u);
1366 weights[2] = (byte)((Mathf.Abs(cell4.minHeight - topHeight) <= 8 || Mathf.Abs(cell4.topHeight - minHeight) <= 8) ? 1u : 0u);
1367 weights[3] = (byte)((Mathf.Abs(cell.minHeight - topHeight) <= 8 || Mathf.Abs(cell.topHeight - minHeight) <= 8) ? 1u : 0u);
1368 if (IsDeepWater)
1369 {
1370 baseWeight += 100;
1371 }
1372 ignoreObjShadow = (b2 > b && b2 - b > 6) || (b3 > b && b3 - b > 6);
1373 isWallEdge = !blocked && cell2.sourceBlock.tileType.IsWallOrFence && cell2.blockDir != 1 && cell3.sourceBlock.tileType.IsWallOrFence && cell3.blockDir != 0;
1374 if (isWallEdge)
1375 {
1376 blockSight = cell2.sourceBlock.tileType.IsBlockSight && cell3.sourceBlock.tileType.IsBlockSight;
1377 blocked = true;
1378 blockSight = true;
1379 }
1380 shadow = 0;
1381 if (!HasBlock)
1382 {
1383 if (cell.isSeen && cell.CastAmbientShadow && !cell.hasDoor && bridgeHeight == cell.bridgeHeight && !sourceFloor.ignoreTransition && (!cell.sourceBlock.tileType.IsWallOrFence || cell.blockDir != 0))
1384 {
1385 shadow++;
1386 }
1387 if (cell4.isSeen && cell4.CastAmbientShadow && !cell4.hasDoor && bridgeHeight == cell4.bridgeHeight && !sourceFloor.ignoreTransition && (!cell4.sourceBlock.tileType.IsWallOrFence || cell4.blockDir != 1))
1388 {
1389 shadow += 2;
1390 }
1391 }
1392 else
1393 {
1394 if (isFloating && (room != null || cell3.room != null || cell2.room != null || cell6.room != null))
1395 {
1396 isFloating = false;
1397 }
1398 if (sourceBlock.tileType.IsFence && !hasDoor && (blockDir != 0 || cell4.topHeight >= b - 3) && (blockDir != 1 || cell.topHeight >= b - 3))
1399 {
1400 shadow = (byte)(blockDir + 4);
1401 }
1402 }
1403 bool isFloorWater = IsFloorWater;
1404 if (isFloorWater)
1405 {
1406 shore = (byte)((((!cell4.IsNotWaterEdge && z != Size - 1 && height == cell4.height) ? 1 : 0) + ((!cell2.IsNotWaterEdge && x != Size - 1 && height == cell2.height) ? 2 : 0) + ((!cell3.IsNotWaterEdge && z != 0 && height == cell3.height) ? 4 : 0) + ((!cell.IsNotWaterEdge && x != 0 && height == cell.height) ? 8 : 0)) * 12);
1407 isShoreSand = cell4.sourceFloor.isBeach || cell2.sourceFloor.isBeach || cell3.sourceFloor.isBeach || cell.sourceFloor.isBeach;
1408 if (shore != 0)
1409 {
1410 shore += (byte)(isShoreSand ? 2 : 3);
1411 }
1412 }
1413 else
1414 {
1415 shore = 0;
1416 }
1417 if (sourceFloor.autotile > 0)
1418 {
1419 autotile = (byte)(((IsAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsAutoTileEdge(cell) && x != 0) ? 8 : 0));
1420 }
1421 else
1422 {
1423 autotile = 0;
1424 }
1425 if (sourceDeco.autotile > 0)
1426 {
1427 autotileDeco = (byte)(((IsDecoAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsDecoAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsDecoAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsDecoAutoTileEdge(cell) && x != 0) ? 8 : 0));
1428 }
1429 else
1430 {
1431 autotileDeco = 0;
1432 }
1433 if (_bridge != 0 && sourceBridge.autotile > 0)
1434 {
1435 autotileBridge = (byte)(((IsBridgeAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsBridgeAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsBridgeAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsBridgeAutoTileEdge(cell) && x != 0) ? 8 : 0));
1436 }
1437 else
1438 {
1439 autotileBridge = 0;
1440 }
1441 if (obj != 0 && sourceObj.autoTile)
1442 {
1443 autotileObj = (byte)(((IsObjAutoTileEdge(cell4) && z != Size - 1) ? 1 : 0) + ((IsObjAutoTileEdge(cell2) && x != Size - 1) ? 2 : 0) + ((IsObjAutoTileEdge(cell3) && z != 0) ? 4 : 0) + ((IsObjAutoTileEdge(cell) && x != 0) ? 8 : 0));
1444 }
1445 else
1446 {
1447 autotileObj = 0;
1448 }
1449 if (openSight)
1450 {
1451 blockSight = false;
1452 }
1453 if (openPath)
1454 {
1455 blocked = false;
1456 }
1457 bool IsAutoTileEdge(Cell cell11)
1458 {
1459 if (!sourceFloor.isBeach && !cell11.sourceFloor.isBeach && (cell11._floor != _floor || cell11._floorMat != _floorMat))
1460 {
1461 return true;
1462 }
1463 if (!isFloorWater)
1464 {
1465 return height != cell11.height;
1466 }
1467 return false;
1468 }
1469 bool IsBridgeAutoTileEdge(Cell cell11)
1470 {
1471 if (cell11._bridge != _bridge || cell11._bridgeMat != _bridgeMat)
1472 {
1473 return true;
1474 }
1475 return bridgeHeight != cell11.bridgeHeight;
1476 }
1477 bool IsDecoAutoTileEdge(Cell cell11)
1478 {
1479 if (cell11._deco != _deco || cell11._decoMat != _decoMat)
1480 {
1481 return true;
1482 }
1483 if (!hasBridge)
1484 {
1485 return topHeight != cell11.topHeight;
1486 }
1487 return bridgeHeight != cell11.bridgeHeight;
1488 }
1489 bool IsObjAutoTileEdge(Cell cell11)
1490 {
1491 if (cell11.obj != obj && (obj != 31 || (cell11.obj != 97 && cell11.obj != 98)))
1492 {
1493 return true;
1494 }
1495 if (!hasBridge)
1496 {
1497 return topHeight != cell11.topHeight;
1498 }
1499 return bridgeHeight != cell11.bridgeHeight;
1500 }
1501 }
1502
1503 public void RotateBlock(int a)
1504 {
1505 int num = blockDir;
1506 int num2 = (sourceBlock.tileType.IsWallOrFence ? 3 : sourceBlock._tiles.Length);
1507 num += a;
1508 if (num < 0)
1509 {
1510 num = num2 - 1;
1511 }
1512 if (num >= num2)
1513 {
1514 num = 0;
1516 }
1517 blockDir = num;
1518 }
1519
1520 public void RotateFloor(int a)
1521 {
1522 int num = floorDir;
1523 num += a;
1524 if (num < 0)
1525 {
1526 num = sourceFloor._tiles.Length - 1;
1527 }
1528 if (num >= sourceFloor._tiles.Length)
1529 {
1530 num = 0;
1531 }
1532 floorDir = num;
1533 }
1534
1535 public void RotateObj(bool reverse = false, bool useBlockDir = false)
1536 {
1537 int num = (useBlockDir ? blockDir : objDir);
1538 num = ((!reverse) ? (num + 1) : (num - 1));
1539 if (num < 0)
1540 {
1541 num = sourceObj._tiles.Length - 1;
1542 }
1543 if (num >= sourceObj._tiles.Length)
1544 {
1545 num = 0;
1546 }
1547 if (useBlockDir)
1548 {
1549 blockDir = num;
1550 }
1551 else
1552 {
1553 objDir = num;
1554 }
1555 }
1556
1557 public void RotateAll()
1558 {
1559 bool flag = EInput.isShiftDown || Input.GetMouseButton(1);
1561 if (mouseTarget.card != null)
1562 {
1563 mouseTarget.card.Rotate(flag);
1564 return;
1565 }
1566 if (detail == null || detail.things.Count == 0)
1567 {
1568 if (HasBlock)
1569 {
1570 if (sourceBlock.tileType.CanRotate(buildMode: false))
1571 {
1572 RotateBlock((!flag) ? 1 : (-1));
1573 }
1574 }
1575 else if (HasObj)
1576 {
1577 if (!sourceObj.tileType.CanRotate(buildMode: false))
1578 {
1579 GrowSystem growSystem = growth;
1580 if (growSystem == null || !growSystem.CanRotate())
1581 {
1582 goto IL_00da;
1583 }
1584 }
1585 RotateObj(flag, sourceObj.tileType.IsUseBlockDir);
1586 }
1587 else if (HasFloor)
1588 {
1589 RotateFloor((!flag) ? 1 : (-1));
1590 }
1591 }
1592 goto IL_00da;
1593 IL_00da:
1595 }
1596
1597 public void Reset()
1598 {
1599 _block = (_blockMat = (_floor = (_floorMat = (obj = (objMat = 0)))));
1600 decal = (objVal = 0);
1601 bits.Bits = 0u;
1602 bits2.Bits = 0u;
1603 }
1604
1606 {
1607 if (detail == null)
1608 {
1610 }
1611 return detail;
1612 }
1613
1614 public void TryDespawnDetail()
1615 {
1616 if (detail != null && detail.TryDespawn())
1617 {
1618 detail = null;
1619 }
1620 }
1621
1622 public void AddCard(Card c)
1623 {
1625 if (c.isChara)
1626 {
1627 detail.charas.Add(c.Chara);
1628 return;
1629 }
1631 c.Thing.stackOrder = detail.things.Count - 1;
1633 {
1635 }
1636 }
1637
1638 public void RemoveCard(Card c)
1639 {
1640 if (c.isChara)
1641 {
1642 if (detail != null)
1643 {
1644 detail.charas.RemoveFromEnd(c.Chara);
1645 }
1646 }
1647 else
1648 {
1649 if (detail != null)
1650 {
1651 detail.things.RemoveFromEnd(c.Thing);
1652 }
1654 {
1656 }
1657 }
1659 }
1660
1661 public string GetBlockName()
1662 {
1663 return Lang.Parse("blockName", matBlock.GetName(), sourceBlock.GetName());
1664 }
1665
1666 public string GetFloorName()
1667 {
1668 return Lang.Parse("blockName", matFloor.GetName(), sourceFloor.GetName());
1669 }
1670
1671 public string GetBridgeName()
1672 {
1673 return Lang.Parse("blockName", matBridge.GetName(), sourceBridge.GetName());
1674 }
1675
1676 public string GetObjName()
1677 {
1678 PlantData plantData = EClass._map.TryGetPlant(this);
1679 string text = sourceObj.GetName();
1680 if (sourceObj.tag.Contains("mat_name") && matObj.alias != "granite" && (sourceObj.id != 10 || !(matObj.alias == "crystal")))
1681 {
1682 text = "_of2".lang(matObj.GetName(), text);
1683 }
1684 if (plantData != null && plantData.size > 0)
1685 {
1686 text = Lang.GetList("plant_size")[plantData.size - 1] + text;
1687 }
1688 text = text.AddArticle();
1689 if (plantData != null)
1690 {
1691 if (plantData.seed != null)
1692 {
1693 if (!plantData.seed.c_refText.IsEmpty())
1694 {
1695 text = plantData.seed.c_refText;
1696 }
1697 if (plantData.seed.encLV > 0)
1698 {
1699 text = text + "+" + plantData.seed.encLV;
1700 }
1701 }
1702 if (plantData.fert != 0)
1703 {
1704 text += ((plantData.fert > 0) ? "fertilized" : "defertilized").lang();
1705 }
1706 }
1707 if (map.backerObjs.ContainsKey(index))
1708 {
1709 int key = map.backerObjs[index];
1710 SourceBacker.Row row = EClass.sources.backers.map.TryGetValue(key);
1711 if (row != null && EClass.core.config.backer.Show(row))
1712 {
1713 string name = row.Name;
1714 text = ((sourceObj.id == 82) ? "backerRemain".lang(text, name) : "backerTree".lang(text, name));
1715 }
1716 }
1717 return text;
1718 }
1719
1720 public string GetLiquidName()
1721 {
1722 return Lang.Parse("liquidName", sourceEffect.GetName());
1723 }
1724
1726 {
1727 GrowSystem.cell = this;
1728 return obj.growth?.CanGrow(date) ?? false;
1729 }
1730
1731 public void TryGrow(VirtualDate date = null)
1732 {
1733 growth?.TryGrow(date);
1734 }
1735
1736 public bool CanHarvest()
1737 {
1738 return growth?.CanHarvest() ?? false;
1739 }
1740
1741 public bool CanReapSeed()
1742 {
1743 return growth?.CanReapSeed() ?? false;
1744 }
1745
1746 public bool CanMakeStraw()
1747 {
1748 if (sourceObj.alias == "wheat")
1749 {
1750 return growth.IsLastStage();
1751 }
1752 return false;
1753 }
1754
1756 {
1757 return EClass._map.TryGetPlant(this);
1758 }
1759
1760 public void DyeObj(string id)
1761 {
1762 isObjDyed = true;
1763 objMat = EClass.sources.materials.alias[id].id;
1764 }
1765
1766 public float GetSurfaceHeight()
1767 {
1768 if (detail == null)
1769 {
1770 return 0f;
1771 }
1772 bool isTopWater = IsTopWater;
1773 for (int i = 0; i < detail.things.Count; i++)
1774 {
1775 Thing thing = detail.things[i];
1776 if (!thing.IsInstalled)
1777 {
1778 continue;
1779 }
1780 if (isTopWater)
1781 {
1782 if (thing.isFloating)
1783 {
1784 return thing.Pref.height + 0.1f;
1785 }
1786 }
1787 else if (thing.Pref.Surface)
1788 {
1789 return 0.1f * (float)thing.altitude + thing.Pref.height;
1790 }
1791 }
1792 return 0f;
1793 }
1794
1795 public bool HasZoneStairs(bool includeLocked = true)
1796 {
1797 if (detail == null)
1798 {
1799 return false;
1800 }
1801 foreach (Thing thing in detail.things)
1802 {
1803 if (thing.IsInstalled && (thing.trait is TraitStairs || (includeLocked && thing.trait is TraitStairsLocked)))
1804 {
1805 return true;
1806 }
1807 }
1808 return false;
1809 }
1810
1811 public override bool IsPathBlocked(IPathfindWalker walker, PathManager.MoveType moveType)
1812 {
1813 if (IsSky || outOfBounds)
1814 {
1815 return true;
1816 }
1817 if (moveType == PathManager.MoveType.Default)
1818 {
1819 if (walker.IsAstralBody && !EClass._zone.IsRegion)
1820 {
1821 return false;
1822 }
1823 return blocked;
1824 }
1825 if (!blocked || (walker.IsAstralBody && !EClass._zone.IsRegion))
1826 {
1827 if (detail != null)
1828 {
1829 return detail.charas.Count > 0;
1830 }
1831 return false;
1832 }
1833 return true;
1834 }
1835}
void Add(Act a, string s="")
Definition: ActPlan.cs:11
bool atrium
Definition: AreaData.cs:66
AreaData data
Definition: BaseArea.cs:29
Definition: Card.cs:11
virtual Chara Chara
Definition: Card.cs:2122
bool isFloating
Definition: Card.cs:653
string c_refText
Definition: Card.cs:1669
Trait trait
Definition: Card.cs:54
int encLV
Definition: Card.cs:329
int altitude
Definition: Card.cs:233
bool IsInstalled
Definition: Card.cs:2451
virtual void Rotate(bool reverse=false)
Definition: Card.cs:6720
virtual bool isChara
Definition: Card.cs:2135
virtual Thing Thing
Definition: Card.cs:2110
bool isHidden
Definition: Card.cs:533
bool isOn
Definition: Card.cs:545
virtual CardRow sourceCard
Definition: Card.cs:2183
bool TryDespawn()
Definition: CellDetail.cs:35
static CellDetail Empty
Definition: CellDetail.cs:23
List< Thing > things
Definition: CellDetail.cs:11
static CellDetail Spawn()
Definition: CellDetail.cs:25
List< Chara > charas
Definition: CellDetail.cs:13
int LiquidAmount
Definition: CellEffect.cs:174
int FireAmount
Definition: CellEffect.cs:162
bool IsFire
Definition: CellEffect.cs:147
bool IsLiquid
Definition: CellEffect.cs:150
SourceCellEffect.Row source
Definition: CellEffect.cs:145
Definition: Cell.cs:7
static Cell[,] cells
Definition: Cell.cs:38
int _bridgeMat
Definition: Cell.cs:56
bool HasBlockOrRamp
Definition: Cell.cs:895
override int GetHashCode()
Definition: Cell.cs:1136
bool CanHarvest()
Definition: Cell.cs:1736
byte autotileDeco
Definition: Cell.cs:84
Room room
Definition: Cell.cs:122
bool HasHalfBlock
Definition: Cell.cs:893
byte TopHeight
Definition: Cell.cs:139
bool IsBlocked
Definition: Cell.cs:931
bool HasWallOrFence
Definition: Cell.cs:867
bool CanMakeStraw()
Definition: Cell.cs:1746
void RemoveCard(Card c)
Definition: Cell.cs:1638
static List< SourceBlock.Row > blockList
Definition: Cell.cs:14
SourceBlock.Row sourceBlock
Definition: Cell.cs:1090
Cell BackRight
Definition: Cell.cs:223
bool lotShade
Definition: Cell.cs:546
bool IsSnowTile
Definition: Cell.cs:818
int _floor
Definition: Cell.cs:46
bool castFloorShadow
Definition: Cell.cs:534
SourceMaterial.Row matBlock
Definition: Cell.cs:1066
static List< SourceDeco.Row > decoList
Definition: Cell.cs:18
byte autotile
Definition: Cell.cs:82
PlantData TryGetPlant()
Definition: Cell.cs:1755
static SourceMaterial matSource
Definition: Cell.cs:24
bool HasBlock
Definition: Cell.cs:679
byte shadow
Definition: Cell.cs:92
static List< SourceFloor.Row > floorList
Definition: Cell.cs:16
bool IsIceTile
Definition: Cell.cs:842
bool CanBuildRamp(int dir)
Definition: Cell.cs:1183
SourceFloor.Row sourceFloor
Definition: Cell.cs:1092
CellEffect effect
Definition: Cell.cs:114
SourceMaterial.Row matRoofBlock
Definition: Cell.cs:1064
bool isDeck
Definition: Cell.cs:522
byte shadowMod
Definition: Cell.cs:98
SourceMaterial.Row matDeco
Definition: Cell.cs:1070
static SourceObj objSource
Definition: Cell.cs:34
Cell Back
Definition: Cell.cs:175
bool HasStairs
Definition: Cell.cs:891
bool lotWall
Definition: Cell.cs:498
bool toggleOcclusion
Definition: Cell.cs:666
void DyeObj(string id)
Definition: Cell.cs:1760
bool IsBridgeWater
Definition: Cell.cs:806
bool hasWindow
Definition: Cell.cs:582
byte decal
Definition: Cell.cs:70
int obj
Definition: Cell.cs:50
bool HasFence
Definition: Cell.cs:871
bool hasDoorBoat
Definition: Cell.cs:510
int objMat
Definition: Cell.cs:52
bool HasBridge
Definition: Cell.cs:707
Point GetSharedPoint()
Definition: Cell.cs:1146
string GetBridgeName()
Definition: Cell.cs:1671
Critter critter
Definition: Cell.cs:116
bool isHarvested
Definition: Cell.cs:342
bool IsTopWaterAndNoSnow
Definition: Cell.cs:748
bool isClearSnow
Definition: Cell.cs:462
bool isFloating
Definition: Cell.cs:486
Cell Front
Definition: Cell.cs:151
SourceMaterial.Row matObj
Definition: Cell.cs:1074
CellDetail GetOrCreateDetail()
Definition: Cell.cs:1605
List< Thing > Things
Definition: Cell.cs:1022
bool IsFarmField
Definition: Cell.cs:766
SourceMaterial.Row matBridge
Definition: Cell.cs:1072
const int DivAutotile
Definition: Cell.cs:40
bool HasLadder
Definition: Cell.cs:875
bool IsFloorWater
Definition: Cell.cs:763
void TryGrow(VirtualDate date=null)
Definition: Cell.cs:1731
int _roofBlock
Definition: Cell.cs:58
byte objVal
Definition: Cell.cs:68
BitArray32 bits2
Definition: Cell.cs:120
bool IsLotEdge
Definition: Cell.cs:916
bool HasWall
Definition: Cell.cs:869
static List< SourceObj.Row > objList
Definition: Cell.cs:22
BiomeProfile biome
Definition: Cell.cs:1115
bool blockSight
Definition: Cell.cs:330
static int Size
Definition: Cell.cs:36
bool pcSync
Definition: Cell.cs:126
bool UseLowBlock
Definition: Cell.cs:897
void Refresh()
Definition: Cell.cs:1192
void Reset()
Definition: Cell.cs:1597
static Map map
Definition: Cell.cs:8
bool HasObstacle()
Definition: Cell.cs:1174
int bridgePillar
Definition: Cell.cs:74
byte shore
Definition: Cell.cs:90
Thing Installed
Definition: Cell.cs:1011
bool skipRender
Definition: Cell.cs:282
byte topHeight
Definition: Cell.cs:100
byte minHeight
Definition: Cell.cs:102
ushort lightG
Definition: Cell.cs:108
bool isModified
Definition: Cell.cs:450
int _floorMat
Definition: Cell.cs:48
bool isCurtainClosed
Definition: Cell.cs:594
byte light
Definition: Cell.cs:80
bool IsTopWater
Definition: Cell.cs:736
List< Chara > Charas
Definition: Cell.cs:1024
bool CastAmbientShadow
Definition: Cell.cs:901
byte height
Definition: Cell.cs:94
byte autotileObj
Definition: Cell.cs:88
GrowSystem growth
Definition: Cell.cs:247
ushort lightB
Definition: Cell.cs:110
bool isWatered
Definition: Cell.cs:354
SourceFloor.Row sourceBridge
Definition: Cell.cs:1094
bool isClearArea
Definition: Cell.cs:618
CellDetail detail
Definition: Cell.cs:112
int _roofBlockMat
Definition: Cell.cs:60
const int DIV_LIQUID
Definition: Cell.cs:128
TraitDoor traitDoor
Definition: Cell.cs:124
bool HasLiquid
Definition: Cell.cs:709
bool isShadowed
Definition: Cell.cs:268
byte _roofBlockDir
Definition: Cell.cs:72
bool IsSky
Definition: Cell.cs:970
BitArray32 bits
Definition: Cell.cs:118
override string ToString()
Definition: Cell.cs:1131
bool HasFloodBlock
Definition: Cell.cs:1053
byte autotileBridge
Definition: Cell.cs:86
bool isToggleWallPillar
Definition: Cell.cs:570
byte z
Definition: Cell.cs:78
bool HasRoof
Definition: Cell.cs:684
Cell Left
Definition: Cell.cs:187
string GetFloorName()
Definition: Cell.cs:1666
static SourceBlock blockSource
Definition: Cell.cs:26
bool isSkyFloor
Definition: Cell.cs:606
SourceMaterial.Row matFloor
Definition: Cell.cs:1068
static bool openPath
Definition: Cell.cs:132
int floorDir
Definition: Cell.cs:958
bool isSeen
Definition: Cell.cs:294
void AddCard(Card c)
Definition: Cell.cs:1622
static SourceFloor floorSource
Definition: Cell.cs:28
bool isSlopeEdge
Definition: Cell.cs:366
bool hidePillar
Definition: Cell.cs:654
bool isShoreSand
Definition: Cell.cs:558
SourceObj.Row sourceObj
Definition: Cell.cs:1112
void TryDespawnDetail()
Definition: Cell.cs:1614
bool HasFire
Definition: Cell.cs:712
int _decoMat
Definition: Cell.cs:64
byte highlight
Definition: Cell.cs:104
int objDir
Definition: Cell.cs:946
static bool openSight
Definition: Cell.cs:130
Cell BackLeft
Definition: Cell.cs:235
SourceBlock.Row sourceRoofBlock
Definition: Cell.cs:1088
string GetBlockName()
Definition: Cell.cs:1661
string GetObjName()
Definition: Cell.cs:1676
bool isForceFloat
Definition: Cell.cs:318
bool HasFloor
Definition: Cell.cs:681
SourceCellEffect.Row sourceEffect
Definition: Cell.cs:1110
bool isSurrounded
Definition: Cell.cs:256
void RotateBlock(int a)
Definition: Cell.cs:1503
static SourceDeco decoSource
Definition: Cell.cs:30
bool isWallEdge
Definition: Cell.cs:438
bool outOfBounds
Definition: Cell.cs:426
int _blockMat
Definition: Cell.cs:44
int fireAmount
Definition: Cell.cs:993
byte x
Definition: Cell.cs:76
bool CanGrow(SourceObj.Row obj, VirtualDate date)
Definition: Cell.cs:1725
Point GetPoint()
Definition: Cell.cs:1141
bool impassable
Definition: Cell.cs:414
static Cell Void
Definition: Cell.cs:10
void RotateAll()
Definition: Cell.cs:1557
bool HasObj
Definition: Cell.cs:677
static SourceCellEffect effectSource
Definition: Cell.cs:32
Cell Right
Definition: Cell.cs:163
static List< SourceCellEffect.Row > effectList
Definition: Cell.cs:20
void RotateObj(bool reverse=false, bool useBlockDir=false)
Definition: Cell.cs:1535
Cell FrontLeft
Definition: Cell.cs:211
bool crossWall
Definition: Cell.cs:642
bool isObjDyed
Definition: Cell.cs:630
bool IsDeepWater
Definition: Cell.cs:830
bool HasRamp
Definition: Cell.cs:873
bool CanReapSeed()
Definition: Cell.cs:1741
bool ignoreObjShadow
Definition: Cell.cs:390
byte bridgeHeight
Definition: Cell.cs:96
bool CastShadow
Definition: Cell.cs:899
bool CanGrowWeed
Definition: Cell.cs:778
bool fullWall
Definition: Cell.cs:474
int index
Definition: Cell.cs:136
int liquidLv
Definition: Cell.cs:982
bool isBridgeEdge
Definition: Cell.cs:378
override bool IsPathBlocked(IPathfindWalker walker, PathManager.MoveType moveType)
Definition: Cell.cs:1811
bool hasDoor
Definition: Cell.cs:279
int blockDir
Definition: Cell.cs:934
SourceFloor.Row sourceSurface
Definition: Cell.cs:1097
string GetLiquidName()
Definition: Cell.cs:1720
float GetSurfaceHeight()
Definition: Cell.cs:1766
bool HasFullBlockOrWallOrFence
Definition: Cell.cs:856
bool CanSuffocate()
Definition: Cell.cs:1151
byte _dirs
Definition: Cell.cs:66
static List< SourceMaterial.Row > matList
Definition: Cell.cs:12
bool HasZoneStairs(bool includeLocked=true)
Definition: Cell.cs:1795
bool IsRoomEdge
Definition: Cell.cs:904
const int DivStage
Definition: Cell.cs:134
int _bridge
Definition: Cell.cs:54
int gatherCount
Definition: Cell.cs:1027
Thing FirstThing
Definition: Cell.cs:998
bool HasFullBlock
Definition: Cell.cs:853
void RotateFloor(int a)
Definition: Cell.cs:1520
bool IsVoid
Definition: Cell.cs:995
bool HasSlope
Definition: Cell.cs:889
SourceDeco.Row sourceDeco
Definition: Cell.cs:1108
SourceMaterial.Row matObj_fixed
Definition: Cell.cs:1077
bool IsNotWaterEdge
Definition: Cell.cs:724
Cell FrontRight
Definition: Cell.cs:199
bool HasRampOrLadder
Definition: Cell.cs:878
bool HasFloorOrBlock
Definition: Cell.cs:696
override bool Equals(object obj)
Definition: Cell.cs:1126
ushort lightR
Definition: Cell.cs:106
bool nonGradient
Definition: Cell.cs:402
int _deco
Definition: Cell.cs:62
bool isSurrounded4d
Definition: Cell.cs:306
int _block
Definition: Cell.cs:42
BackerContentConfig backer
Definition: CoreConfig.cs:633
Definition: Core.cs:14
static new Core Instance
Definition: Core.cs:15
Scene scene
Definition: Core.cs:65
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static Zone _zone
Definition: EClass.cs:21
static Map _map
Definition: EClass.cs:19
static SourceManager sources
Definition: EClass.cs:43
virtual bool CanRotate()
Definition: GrowSystem.cs:129
bool CanHarvest()
Definition: GrowSystem.cs:525
void TryGrow(VirtualDate date)
Definition: GrowSystem.cs:331
virtual bool CanReapSeed()
Definition: GrowSystem.cs:534
bool IsLastStage()
Definition: GrowSystem.cs:119
virtual bool BlockSight(Cell cell)
Definition: GrowSystem.cs:134
Definition: Lang.cs:7
static string[] GetList(string id)
Definition: Lang.cs:113
static string Parse(string idLang, string val1, string val2=null, string val3=null, string val4=null, string val5=null)
Definition: Lang.cs:146
int maxZ
Definition: MapBounds.cs:17
Definition: Map.cs:13
PlantData TryGetPlant(Point p)
Definition: Map.cs:2082
Dictionary< int, int > gatherCounts
Definition: Map.cs:64
Dictionary< int, int > backerObjs
Definition: Map.cs:70
Zone zone
Definition: Map.cs:90
MapBounds bounds
Definition: Map.cs:55
Thing seed
Definition: PlantData.cs:6
int fert
Definition: PlantData.cs:12
int size
Definition: PlantData.cs:15
Definition: Point.cs:9
static Point shared
Definition: Point.cs:20
Point Set(int _x, int _z)
Definition: Point.cs:503
void RefreshNeighborTiles()
Definition: Point.cs:1282
bool multisize
Definition: RenderRow.cs:64
Definition: Room.cs:4
PointTarget mouseTarget
Definition: Scene.cs:135
SourceMaterial materials
SourceBacker backers
string GetName(int id)
Definition: SourceObj.cs:302
bool Surface
Definition: SourcePref.cs:369
float height
Definition: SourcePref.cs:53
virtual bool IsRegion
Definition: Spatial.cs:515
virtual bool IsSnowCovered
Definition: Spatial.cs:545
Definition: Thing.cs:8
override SourcePref Pref
Definition: Thing.cs:50
static TileTypeSky Sky
Definition: TileType.cs:75
static TileTypeHalfBlock HalfBlock
Definition: TileType.cs:29
static TileTypeSlope Slope
Definition: TileType.cs:25
virtual byte slopeHeight
Definition: TileType.cs:255
static TileTypeStairs Stairs
Definition: TileType.cs:31
Definition: Trait.cs:7
virtual bool IsBlockPath
Definition: Trait.cs:54
virtual bool IsBlockSight
Definition: Trait.cs:56
virtual bool ShouldRefreshTile
Definition: Trait.cs:77
virtual bool IsOpenPath
Definition: Trait.cs:62
virtual bool IsFloating
Definition: Trait.cs:64
virtual bool IsOpenSight
Definition: Trait.cs:60
virtual byte WeightMod
Definition: Trait.cs:44
BiomeProfile biome
Definition: Zone.cs:134
virtual bool IsUserZone
Definition: Zone.cs:278
virtual bool IsUnderwater
Definition: Zone.cs:276