12 public override bool Equals(
object obj)
18 public override string ToString()
20 string[] array =
new string[11];
22 array[1] = this.x.ToString();
24 array[3] = this.z.ToString();
28 array[num] = ((matBlock !=
null) ? matBlock.ToString() :
null);
32 array[num2] = ((matFloor !=
null) ? matFloor.ToString() :
null);
34 array[9] = this._block.ToString();
36 return string.Concat(array);
40 public override int GetHashCode()
51 return (
int)this.x + (int)this.z *
Cell.Size;
61 if (this.bridgeHeight != 0)
63 return this.bridgeHeight;
70 public Point GetPoint()
72 return new Point((
int)this.x, (
int)this.z);
76 public Point GetSharedPoint()
78 return Point.shared.Set((
int)this.x, (
int)this.z);
91 return Cell.cells[(int)this.x, (
int)(this.z - 1)];
101 if ((
int)(this.x + 1) >=
Cell.Size)
105 return Cell.cells[(int)(this.x + 1), (int)this.z];
115 if ((
int)(this.z + 1) >=
Cell.Size)
119 return Cell.cells[(int)this.x, (
int)(this.z + 1)];
133 return Cell.cells[(int)(this.x - 1), (int)this.z];
139 public Cell FrontRight
143 if ((
int)(this.x + 1) >=
Cell.Size ||
this.z <= 0)
147 return Cell.cells[(int)(this.x + 1), (int)(this.z - 1)];
153 public Cell FrontLeft
157 if (this.x <= 0 || this.z <= 0)
161 return Cell.cells[(int)(this.x - 1), (int)(this.z - 1)];
167 public Cell BackRight
171 if ((
int)(this.x + 1) >=
Cell.Size || (
int)(
this.z + 1) >=
Cell.Size)
175 return Cell.cells[(int)(this.x + 1), (int)(this.z + 1)];
185 if (this.x <= 0 || (
int)(this.z + 1) >=
Cell.Size)
189 return Cell.cells[(int)(this.x - 1), (int)(this.z + 1)];
199 GrowSystem.cell =
this;
200 return this.sourceObj.growth;
207 public bool isSurrounded
215 this.bits[0] = value;
222 public bool isShadowed
230 this.bits[1] = value;
245 this.bits[3] = value;
252 public bool skipRender
260 this.bits[4] = value;
275 this.bits[6] = value;
282 public bool isSurrounded4d
290 this.bits[7] = value;
297 public bool isForceFloat
305 this.bits[8] = value;
312 public bool blockSight
320 this.bits[9] = value;
327 public bool isHarvested
331 return this.bits[10];
335 this.bits[10] = value;
342 public bool isWatered
346 return this.bits[11];
350 this.bits[11] = value;
357 public bool isSlopeEdge
361 return this.bits[12];
365 this.bits[12] = value;
372 public bool isBridgeEdge
376 return this.bits[13];
380 this.bits[13] = value;
387 public bool ignoreObjShadow
391 return this.bits[14];
395 this.bits[14] = value;
402 public bool nonGradient
406 return this.bits[15];
410 this.bits[15] = value;
417 public bool impassable
421 return this.bits[16];
425 this.bits[16] = value;
432 public bool outOfBounds
436 return this.bits[17];
440 this.bits[17] = value;
447 public bool isWallEdge
451 return this.bits[20];
455 this.bits[20] = value;
462 public bool isModified
466 return this.bits[21];
470 this.bits[21] = value;
477 public bool isClearSnow
481 return this.bits[22];
485 this.bits[22] = value;
496 return this.bits[23];
500 this.bits[23] = value;
507 public bool isFloating
511 return this.bits[24];
515 this.bits[24] = value;
526 return this.bits[25];
530 this.bits[25] = value;
537 public bool hasDoorBoat
541 return this.bits[26];
545 this.bits[26] = value;
556 return this.bits[27];
560 this.bits[27] = value;
567 public bool castFloorShadow
571 return this.bits[28];
575 this.bits[28] = value;
586 return this.bits[29];
590 this.bits[29] = value;
597 public bool isShoreSand
601 return this.bits[30];
605 this.bits[30] = value;
612 public bool isToggleWallPillar
616 return this.bits[31];
620 this.bits[31] = value;
627 public bool hasWindow
631 return this.bits2[0];
635 this.bits2[0] = value;
642 public bool isCurtainClosed
646 return this.bits2[1];
650 this.bits2[1] = value;
657 public bool isSkyFloor
661 return this.bits2[2];
665 this.bits2[2] = value;
672 public bool isClearArea
676 return this.bits2[3];
680 this.bits2[3] = value;
687 public bool isObjDyed
691 return this.bits2[4];
695 this.bits2[4] = value;
715 return this._block > 0;
725 return this._floor > 0;
735 return this.room !=
null && this.room.lot.idRoofStyle != 0;
741 public bool HasFloorOrBlock
745 return this._block != 0 || this._floor > 0;
751 public bool HasBridge
755 return this._bridge > 0;
761 public bool HasLiquid
766 return cellEffect !=
null && cellEffect.IsLiquid;
776 return this.effect !=
null && this.effect.IsFire;
782 public bool IsNotWaterEdge
786 return this.HasFullBlock ||
Cell.floorList[(int)this._floor].tileType.IsWater ||
Cell.floorList[(
int)this._floor].edge == 0;
792 public bool IsTopWater
796 if (this._bridge != 0)
798 return Cell.floorList[(int)this._bridge].tileType.IsWater;
800 return Cell.floorList[(int)this._floor].tileType.IsWater;
806 public bool IsTopWaterAndNoSnow
810 return this.IsTopWater && (!Cell.map.zone.IsSnowCovered || this.HasRoof || this.isClearSnow);
816 public bool IsFloorWater
820 return Cell.floorList[(int)this._floor].tileType.IsWater;
826 public bool IsFarmField
830 if (this._bridge != 0)
832 return this.sourceBridge.alias ==
"field";
834 return this.sourceFloor.alias ==
"field";
840 public bool CanGrowWeed
844 if (this.obj != 0 || this.FirstThing !=
null || this.HasBlock || this.HasRoof)
848 if (this.IsFarmField)
852 if (this._bridge != 0)
854 return this.matBridge.category ==
"grass";
856 return this.matFloor.category ==
"grass";
862 public bool IsBridgeWater
866 return this._bridge != 0 &&
Cell.floorList[(int)this._bridge].tileType.IsWater;
872 public bool IsSnowTile
876 return Cell.map.zone.IsSnowCovered && !this.HasRoof && !this.IsTopWater && !this.isClearSnow && !this.isFloating && !this.isDeck;
882 public bool IsDeepWater
886 return this.sourceSurface.tileType.IsDeepWater && !this.IsIceTile;
891 public bool CanSuffocate()
893 if (!this.IsDeepWater)
897 if (this.detail !=
null && this.detail.things.Count > 0)
899 foreach (
Thing thing
in this.detail.things)
901 if (thing.IsInstalled && thing.isFloating)
913 public bool IsIceTile
917 return Cell.map.zone.IsSnowCovered && !this.HasRoof && this.IsTopWater && !this.isClearSnow;
923 public bool HasFullBlock
927 return Cell.blockList[(int)this._block].tileType.IsFullBlock;
933 public bool HasFullBlockOrWallOrFence
937 return this.HasFullBlock || this.HasWallOrFence;
943 public bool HasWallOrFence
947 return Cell.blockList[(int)this._block].tileType.IsWallOrFence;
957 return Cell.blockList[(int)this._block].tileType.IsWall;
967 return Cell.blockList[(int)this._block].tileType.IsFence;
977 return Cell.blockList[(int)this._block].tileType.IsRamp;
983 public bool HasLadder
987 return Cell.blockList[(int)this._block].tileType.IsLadder;
993 public bool HasRampOrLadder
997 return this.HasRamp || this.HasLadder;
1003 public bool HasSlope
1007 return Cell.blockList[(int)this._block].tileType ==
TileType.Slope;
1013 public bool HasStairs
1017 return Cell.blockList[(int)this._block].tileType ==
TileType.Stairs;
1023 public bool HasHalfBlock
1027 return Cell.blockList[(int)this._block].tileType ==
TileType.HalfBlock;
1033 public bool HasBlockOrRamp
1037 return Cell.blockList[(int)this._block].isBlockOrRamp;
1043 public bool UseLowBlock
1047 return Cell.blockList[(int)this._block].tileType.UseLowBlock;
1053 public bool CastShadow
1057 return Cell.blockList[(int)this._block].tileType.CastShadowSelf;
1063 public bool CastAmbientShadow
1067 return Cell.blockList[(int)this._block].tileType.CastAmbientShadow;
1073 public bool IsRoomEdge
1077 return this.Front.room != this.room || this.Right.room != this.room || this.FrontRight.room != this.room;
1083 public bool IsLotEdge
1087 return this.Front.room ==
null || this.Right.room ==
null || this.FrontRight.room ==
null || this.Back.room ==
null || this.Left.room ==
null || (this.Front.room !=
null && (this.Front.room.data.atrium || !this.Front.HasRoof)) || (this.Right.room !=
null && (
this.Right.room.data.atrium | !
this.Right.HasRoof));
1093 public bool IsBlocked
1097 return this.blocked;
1102 public bool HasObstacle()
1104 return this.blocked || this._block != 0 || this.obj != 0 || this.hasDoor;
1108 public bool CanBuildRamp(
int dir)
1110 return !this.HasRamp || this.blockDir == dir;
1120 return (
int)(this._dirs % 4);
1124 this._dirs = (byte)((
int)this._dirs - this.blockDir + value);
1135 return (
int)(this._dirs / 4 % 8);
1139 this._dirs = (byte)((
int)this._dirs - this.objDir * 4 + value % 8 * 4);
1150 return (
int)(this._dirs / 32);
1154 this._dirs = (byte)((
int)this._dirs - this.floorDir * 32 + value * 32);
1164 return this.sourceFloor.tileType == TileType.Sky && !this.HasBridge;
1174 if (this.effect !=
null && this.effect.LiquidAmount != 0)
1177 return ((cellEffect !=
null) ? cellEffect.LiquidAmount : 0) / 3 + 1;
1185 public int fireAmount
1190 if (cellEffect ==
null)
1194 return cellEffect.FireAmount;
1204 return this ==
Cell.Void;
1210 public Thing FirstThing
1215 if (cellDetail ==
null || cellDetail.things.Count <= 0)
1219 return this.detail.things[0];
1225 public Thing Installed
1229 if (this.detail ==
null || this.detail.things.Count <= 0 || !
this.detail.things[0].IsInstalled)
1233 return this.detail.things[0];
1239 public List<Thing> Things
1243 return (this.detail ??
CellDetail.Empty).things;
1249 public List<Chara> Charas
1253 return (this.detail ??
CellDetail.Empty).charas;
1260 public int gatherCount
1264 if (!
Cell.map.gatherCounts.ContainsKey(
this.index))
1268 return Cell.map.gatherCounts[this.index];
1274 if (
Cell.map.gatherCounts.ContainsKey(
this.index))
1276 Cell.map.gatherCounts.Remove(this.index);
1282 Cell.map.gatherCounts[this.index] = value;
1289 public bool HasFloodBlock
1293 return this.sourceBlock.tileType.IsFloodBlock || this.hasDoor;
1303 return Cell.matList[(int)this._roofBlockMat];
1313 return Cell.matList[(int)this._blockMat];
1323 return Cell.matList[(int)this._floorMat];
1333 return Cell.matList[(int)this._bridgeMat];
1343 return Cell.matList[(int)this.objMat];
1353 if (!this.isObjDyed)
1355 return Cell.matList[(int)this.objMat];
1357 return this.sourceObj.DefaultMaterial;
1367 return Cell.blockList[(int)this._roofBlock];
1377 return Cell.blockList[(int)this._block];
1387 return Cell.floorList[(int)this._floor];
1397 return Cell.floorList[(int)this._bridge];
1407 if (this._bridge != 0)
1409 return this.sourceBridge;
1411 return this.sourceFloor;
1422 return ((cellEffect !=
null) ? cellEffect.source :
null) ??
Cell.effectList[0];
1432 return Cell.objList[(int)this.obj];
1442 if (!(this.sourceFloor.biome !=
null))
1444 return EClass._zone.biome;
1446 return this.sourceFloor.biome;
1451 public void Refresh()
1453 Cell.<>c__DisplayClass311_0 CS$<>8__locals1;
1454 CS$<>8__locals1.<>4__this =
this;
1455 Cell cell = (this.x > 0) ?
Cell.cells[(
int)(this.x - 1), (
int)this.z] :
Cell.Void;
1456 Cell cell2 = ((int)(this.x + 1) <
Cell.Size) ?
Cell.cells[(
int)(this.x + 1), (
int)this.z] :
Cell.Void;
1457 Cell cell3 = (this.z > 0) ?
Cell.cells[(
int)this.x, (int)(this.z - 1)] :
Cell.Void;
1458 Cell cell4 = ((int)(this.z + 1) <
Cell.Size) ?
Cell.cells[(
int)this.x, (int)(this.z + 1)] :
Cell.Void;
1459 Cell cell5 = (this.x > 0 && this.z > 0) ?
Cell.cells[(
int)(this.x - 1), (
int)(this.z - 1)] :
Cell.Void;
1460 Cell cell6 = ((int)(this.x + 1) < Cell.Size && this.z > 0) ?
Cell.cells[(
int)(this.x + 1), (
int)(this.z - 1)] :
Cell.Void;
1461 Cell cell7 = (this.x > 0 && (int)(this.z + 1) <
Cell.Size) ?
Cell.cells[(
int)(this.x - 1), (
int)(this.z + 1)] :
Cell.Void;
1462 Cell cell8 = ((int)(this.x + 1) < Cell.Size && (int)(this.z + 1) <
Cell.Size) ?
Cell.cells[(
int)(this.x + 1), (
int)(this.z + 1)] :
Cell.Void;
1463 Cell cell9 = (this.z > 1) ?
Cell.cells[(
int)this.x, (int)(this.z - 2)] :
Cell.Void;
1464 Cell cell10 = ((int)(this.x + 2) <
Cell.Size) ?
Cell.cells[(
int)(this.x + 2), (
int)this.z] :
Cell.Void;
1465 TileType tileType = this.sourceBlock.tileType;
1466 TileType tileType2 = this.sourceFloor.tileType;
1468 bool flag = this._bridge > 0;
1469 this.outOfBounds = ((int)this.x < bounds.x || (int)this.z < bounds.z || (int)this.x > bounds.maxX || (int)this.z > bounds.maxZ);
1470 this.isSurrounded4d = (cell.HasFullBlock && cell2.HasFullBlock && cell3.HasFullBlock && cell4.HasFullBlock);
1471 this.isSurrounded = (this.isSurrounded4d && cell5.HasFullBlock && cell6.HasFullBlock && cell7.HasFullBlock && cell8.HasFullBlock && cell3.bridgeHeight == this.bridgeHeight && cell2.bridgeHeight == this.bridgeHeight && cell4.bridgeHeight == this.bridgeHeight && cell.bridgeHeight == this.bridgeHeight);
1472 this.isFloating = this.isForceFloat;
1473 this.hasDoor =
false;
1474 this.hasDoorBoat =
false;
1475 this.isDeck =
false;
1476 this.isShoreSand =
false;
1477 this.hasWindow =
false;
1478 this.isCurtainClosed =
false;
1479 this.isSkyFloor = (tileType2 != TileType.Sky && (cell2.sourceFloor.tileType == TileType.Sky || cell3.sourceFloor.tileType ==
TileType.Sky));
1480 Cell.openPath =
false;
1481 Cell.openSight = (tileType.IsOpenSight || (cell3.hasWindow && !cell3.isCurtainClosed) || (cell2.hasWindow && !cell2.isCurtainClosed));
1482 this.blockSight = (tileType.IsBlockSight || ((
Cell.objList[(int)this.obj].growth !=
null) ?
Cell.objList[(int)this.obj].growth.BlockSight(
this) :
Cell.objList[(
int)
this.obj].tileType.IsBlockSight));
1483 this.blocked = (this.outOfBounds || tileType.IsBlockPass || (tileType2.IsBlockPass && !flag) || ((
Cell.objList[(int)this.obj].growth !=
null) ?
Cell.objList[(int)this.obj].growth.BlockPass(
this) :
Cell.objList[(
int)
this.obj].tileType.IsBlockPass) ||
this.impassable);
1484 this.isSlopeEdge = (this.height > cell2.height || this.height > cell3.height);
1485 if (flag && this.sourceBridge.tileType.ShowPillar)
1487 this.isBridgeEdge = (this._bridge != cell2._bridge || this._bridge != cell3._bridge || this.bridgeHeight > cell2.bridgeHeight || this.bridgeHeight > cell3.bridgeHeight || this._bridge != cell._bridge || this._bridge != cell4._bridge || this.bridgeHeight > cell.bridgeHeight || this.bridgeHeight > cell4.bridgeHeight);
1491 this.isBridgeEdge =
false;
1493 this.lotShade =
false;
1494 if (this.room ==
null && !
EClass._zone.IsSnowCovered)
1496 if ((cell10.room !=
null && cell2.sourceBlock.tileType.CastShadowSelf) || (cell9.room !=
null && cell3.sourceBlock.tileType.CastShadowSelf))
1498 this.lotShade =
true;
1500 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))
1502 this.lotShade =
true;
1504 else if (cell10.sourceBlock.tileType.CastShadowSelf && cell10.Right.room !=
null)
1506 this.lotShade =
true;
1509 this.isShadowed = (this.lotShade || this.sourceBlock.tileType.CastShadowSelf || cell3.sourceBlock.tileType.CastShadowBack || (!this.HasRoof && this._roofBlock > 0));
1510 this.castFloorShadow = (this.lotShade || (this.room ==
null && this.sourceBlock.tileType.CastShadowSelf));
1511 byte b = flag ? this.bridgeHeight : this.height;
1512 byte b2 = (cell3.bridgeHeight == 0) ? cell3.height : cell3.bridgeHeight;
1513 byte b3 = (cell2.bridgeHeight == 0) ? cell2.height : cell2.bridgeHeight;
1514 byte b4 = (cell9.bridgeHeight == 0) ? cell9.height : cell9.bridgeHeight;
1515 byte b5 = (cell10.bridgeHeight == 0) ? cell10.height : cell10.bridgeHeight;
1517 if ((
int)(b3 - b) > num)
1519 num = (int)(b3 - b);
1521 if ((
int)(b2 - b) > num)
1523 num = (int)(b2 - b);
1525 if ((
int)(b5 - b - 4) > num)
1527 num = (int)(b5 - b - 4);
1529 if ((
int)(b4 - b - 4) > num)
1531 num = (int)(b4 - b - 4);
1538 if (this.IsTopWater)
1542 else if (this.isShadowed)
1550 this.shadowMod = (byte)num;
1551 this.baseWeight = 0;
1552 if (this.detail !=
null && this.detail.things.Count > 0)
1554 for (
int i = 0; i < this.detail.things.Count; i++)
1556 Thing thing = this.detail.things[i];
1557 if (thing.IsInstalled)
1559 if (thing.trait.WeightMod >
this.baseWeight)
1561 this.baseWeight = thing.trait.WeightMod;
1563 if (!thing.isHidden)
1565 if (thing.trait.IsFloating)
1567 this.isFloating =
true;
1568 if (this.IsFloorWater)
1570 this.blocked =
true;
1579 if (thing.trait.IsOpenPath)
1581 this.blocked =
false;
1582 this.hasDoorBoat =
true;
1583 Cell.openPath =
true;
1584 Cell.openSight =
true;
1586 if (thing.trait.IsBlockPath)
1588 this.blocked =
true;
1591 if (thing.trait.IsOpenSight)
1593 Cell.openSight =
true;
1597 this.blocked =
false;
1598 this.hasDoor =
true;
1599 this.blockSight =
true;
1601 else if (thing.trait.IsBlockSight)
1603 this.blockSight =
true;
1605 Trait trait = thing.trait;
1610 this.isCurtainClosed = thing.isOn;
1615 this.hasWindow =
true;
1621 this.minHeight = (byte)((
int)(10 + b) + ((this.IsTopWater && !this.isFloating) ? this.sourceFloor.tileType.FloorAltitude : 0));
1622 this.topHeight = this.minHeight + tileType.slopeHeight;
1623 this.weights[0] = ((Mathf.Abs((
int)(cell3.minHeight -
this.topHeight)) > 8 && Mathf.Abs((
int)(cell3.topHeight -
this.minHeight)) > 8) ? 0 : 1);
1624 this.weights[1] = ((Mathf.Abs((
int)(cell2.minHeight -
this.topHeight)) > 8 && Mathf.Abs((
int)(cell2.topHeight -
this.minHeight)) > 8) ? 0 : 1);
1625 this.weights[2] = ((Mathf.Abs((
int)(cell4.minHeight -
this.topHeight)) > 8 && Mathf.Abs((
int)(cell4.topHeight -
this.minHeight)) > 8) ? 0 : 1);
1626 this.weights[3] = ((Mathf.Abs((
int)(cell.minHeight -
this.topHeight)) > 8 && Mathf.Abs((
int)(cell.topHeight -
this.minHeight)) > 8) ? 0 : 1);
1627 if (this.IsDeepWater)
1629 this.baseWeight += 100;
1631 this.ignoreObjShadow = ((b2 > b && b2 - b > 6) || (b3 > b && b3 - b > 6));
1632 this.isWallEdge = (!this.blocked && cell2.sourceBlock.tileType.IsWallOrFence && cell2.blockDir != 1 && cell3.sourceBlock.tileType.IsWallOrFence && cell3.blockDir != 0);
1633 if (this.isWallEdge)
1635 this.blockSight = (cell2.sourceBlock.tileType.IsBlockSight && cell3.sourceBlock.tileType.IsBlockSight);
1636 this.blocked =
true;
1637 this.blockSight =
true;
1642 if (cell.isSeen && cell.CastAmbientShadow && !cell.hasDoor &&
this.bridgeHeight == cell.bridgeHeight && !
this.sourceFloor.ignoreTransition && (!cell.sourceBlock.tileType.IsWallOrFence || cell.blockDir != 0))
1646 if (cell4.isSeen && cell4.CastAmbientShadow && !cell4.hasDoor &&
this.bridgeHeight == cell4.bridgeHeight && !
this.sourceFloor.ignoreTransition && (!cell4.sourceBlock.tileType.IsWallOrFence || cell4.blockDir != 1))
1653 if (this.isFloating && (this.room !=
null || cell3.room !=
null || cell2.room !=
null || cell6.room !=
null))
1655 this.isFloating =
false;
1657 if (this.sourceBlock.tileType.IsFence && !
this.hasDoor && (
this.blockDir != 0 || cell4.topHeight >= b - 3) && (
this.blockDir != 1 || cell.topHeight >= b - 3))
1659 this.shadow = (byte)(this.blockDir + 4);
1662 CS$<>8__locals1.isFloorWater = this.IsFloorWater;
1663 if (CS$<>8__locals1.isFloorWater)
1665 this.shore = (byte)((((cell4.IsNotWaterEdge || (
int)
this.z ==
Cell.Size - 1 ||
this.height != cell4.height) ? 0 : 1) + ((cell2.IsNotWaterEdge || (
int)
this.x ==
Cell.Size - 1 ||
this.height != cell2.height) ? 0 : 2) + ((cell3.IsNotWaterEdge ||
this.z == 0 ||
this.height != cell3.height) ? 0 : 4) + ((cell.IsNotWaterEdge ||
this.x == 0 ||
this.height != cell.height) ? 0 : 8)) * 12);
1666 this.isShoreSand = (cell4.sourceFloor.isBeach || cell2.sourceFloor.isBeach || cell3.sourceFloor.isBeach || cell.sourceFloor.isBeach);
1667 if (this.shore != 0)
1669 this.shore += (this.isShoreSand ? 2 : 3);
1676 if (this.sourceFloor.autotile > 0)
1678 this.autotile = (byte)(((!this.<Refresh>g__IsAutoTileEdge|311_0(cell4, ref CS$<>8__locals1) || (
int)this.z ==
Cell.Size - 1) ? 0 : 1) + ((!
this.<Refresh>g__IsAutoTileEdge|311_0(cell2, ref CS$<>8__locals1) || (
int)this.x ==
Cell.Size - 1) ? 0 : 2) + ((!
this.<Refresh>g__IsAutoTileEdge|311_0(cell3, ref CS$<>8__locals1) || this.z == 0) ? 0 : 4) + ((!this.<Refresh>g__IsAutoTileEdge|311_0(cell, ref CS$<>8__locals1) || this.x == 0) ? 0 : 8));
1684 if (this._bridge != 0 && this.sourceBridge.autotile > 0)
1686 this.autotileBridge = (byte)(((!this.<Refresh>g__IsBridgeAutoTileEdge|311_1(cell4, ref CS$<>8__locals1) || (
int)this.z ==
Cell.Size - 1) ? 0 : 1) + ((!
this.<Refresh>g__IsBridgeAutoTileEdge|311_1(cell2, ref CS$<>8__locals1) || (
int)this.x ==
Cell.Size - 1) ? 0 : 2) + ((!
this.<Refresh>g__IsBridgeAutoTileEdge|311_1(cell3, ref CS$<>8__locals1) || this.z == 0) ? 0 : 4) + ((!this.<Refresh>g__IsBridgeAutoTileEdge|311_1(cell, ref CS$<>8__locals1) || this.x == 0) ? 0 : 8));
1690 this.autotileBridge = 0;
1692 if (this.obj != 0 && this.sourceObj.autoTile)
1694 this.autotileObj = (byte)(((!this.<Refresh>g__IsObjAutoTileEdge|311_2(cell4, ref CS$<>8__locals1) || (
int)this.z ==
Cell.Size - 1) ? 0 : 1) + ((!
this.<Refresh>g__IsObjAutoTileEdge|311_2(cell2, ref CS$<>8__locals1) || (
int)this.x ==
Cell.Size - 1) ? 0 : 2) + ((!
this.<Refresh>g__IsObjAutoTileEdge|311_2(cell3, ref CS$<>8__locals1) || this.z == 0) ? 0 : 4) + ((!this.<Refresh>g__IsObjAutoTileEdge|311_2(cell, ref CS$<>8__locals1) || this.x == 0) ? 0 : 8));
1698 this.autotileObj = 0;
1702 this.blockSight =
false;
1706 this.blocked =
false;
1711 public void RotateBlock(
int a)
1713 int num = this.blockDir;
1714 int num2 = this.sourceBlock.tileType.IsWallOrFence ? 3 : this.sourceBlock._tiles.Length;
1724 this.blockDir = num;
1728 public void RotateFloor(
int a)
1730 int num = this.floorDir;
1734 num = this.sourceFloor._tiles.Length - 1;
1736 if (num >= this.sourceFloor._tiles.Length)
1740 this.floorDir = num;
1744 public void RotateObj(
bool reverse =
false,
bool useBlockDir =
false)
1746 int num = useBlockDir ? this.blockDir : this.objDir;
1757 num = this.sourceObj._tiles.Length - 1;
1759 if (num >= this.sourceObj._tiles.Length)
1765 this.blockDir = num;
1772 public void RotateAll()
1774 bool flag = EInput.isShiftDown || Input.GetMouseButton(1);
1775 PointTarget mouseTarget = Core.Instance.scene.mouseTarget;
1776 if (mouseTarget.card !=
null)
1778 mouseTarget.card.Rotate(flag);
1781 if (this.detail ==
null || this.detail.things.Count == 0)
1785 if (this.sourceBlock.tileType.CanRotate(
false))
1787 this.RotateBlock(flag ? -1 : 1);
1790 else if (this.HasObj)
1792 if (this.sourceObj.tileType.CanRotate(
false))
1794 this.RotateObj(flag, this.sourceObj.tileType.IsUseBlockDir);
1797 else if (this.HasFloor)
1799 this.RotateFloor(flag ? -1 : 1);
1802 this.GetPoint().RefreshNeighborTiles();
1808 this._block = (this._blockMat = (this._floor = (this._floorMat = (this.obj = (this.decal = (this.objVal = (this.objMat = 0)))))));
1809 this.bits.Bits = 0U;
1810 this.bits2.Bits = 0U;
1816 if (this.detail ==
null)
1824 public void TryDespawnDetail()
1826 if (this.detail !=
null && this.detail.TryDespawn())
1833 public void AddCard(
Card c)
1835 this.GetOrCreateDetail();
1838 this.detail.charas.Add(c.Chara);
1841 this.detail.things.Add(c.Thing);
1842 c.Thing.stackOrder = this.detail.things.Count - 1;
1843 if (c.trait.ShouldRefreshTile || c.sourceCard.multisize)
1845 this.GetPoint().RefreshNeighborTiles();
1850 public void RemoveCard(
Card c)
1854 if (this.detail !=
null)
1856 this.detail.charas.Remove(c.Chara);
1861 if (this.detail !=
null)
1863 this.detail.things.Remove(c.Thing);
1865 if (c.trait.ShouldRefreshTile || c.sourceCard.multisize)
1867 this.GetPoint().RefreshNeighborTiles();
1870 this.TryDespawnDetail();
1874 public string GetBlockName()
1876 return Lang.Parse(
"blockName", this.matBlock.GetName(),
this.sourceBlock.GetName(),
null,
null,
null);
1880 public string GetFloorName()
1882 return Lang.Parse(
"blockName", this.matFloor.GetName(),
this.sourceFloor.GetName(),
null,
null,
null);
1886 public string GetBridgeName()
1888 return Lang.Parse(
"blockName", this.matBridge.GetName(),
this.sourceBridge.GetName(),
null,
null,
null);
1892 public string GetObjName()
1895 string text = this.sourceObj.GetName();
1896 if (this.sourceObj.tag.Contains(
"mat_name") &&
this.matObj.alias !=
"granite" && (
this.sourceObj.id != 10 || !(
this.matObj.alias ==
"crystal")))
1898 text =
"_of2".lang(this.matObj.GetName(), text,
null,
null,
null);
1900 if (plantData !=
null && plantData.size > 0)
1902 text = Lang.GetList(
"plant_size")[plantData.size - 1] + text;
1904 text = text.AddArticle();
1905 if (plantData !=
null)
1907 if (plantData.seed !=
null)
1909 if (!plantData.seed.c_refText.IsEmpty())
1911 text = plantData.seed.c_refText;
1913 if (plantData.seed.encLV > 0)
1915 text = text +
"+" + plantData.seed.encLV.ToString();
1918 if (plantData.fert != 0)
1920 text += ((plantData.fert > 0) ?
"fertilized" :
"defertilized").lang();
1923 if (
Cell.map.backerObjs.ContainsKey(
this.index))
1925 int key =
Cell.map.backerObjs[this.index];
1927 if (row !=
null &&
EClass.core.config.backer.Show(row))
1929 string name = row.Name;
1930 text = ((this.sourceObj.id == 82) ?
"backerRemain".lang(text, name,
null,
null,
null) :
"backerTree".lang(text, name,
null,
null,
null));
1937 public string GetLiquidName()
1939 return Lang.Parse(
"liquidName", this.sourceEffect.GetName(),
null,
null,
null,
null);
1945 GrowSystem.cell =
this;
1947 return growth !=
null && growth.CanGrow(date);
1958 growth.TryGrow(date);
1962 public bool CanHarvest()
1965 return growth !=
null && growth.CanHarvest();
1969 public bool CanReapSeed()
1972 return growth !=
null && growth.CanReapSeed();
1976 public bool CanMakeStraw()
1978 return this.sourceObj.alias ==
"wheat" && this.growth.IsLastStage();
1984 return EClass._map.TryGetPlant(
this);
1988 public float GetSurfaceHeight()
1990 if (this.detail ==
null)
1994 bool isTopWater = this.IsTopWater;
1995 for (
int i = 0; i < this.detail.things.Count; i++)
1997 Thing thing = this.detail.things[i];
1998 if (thing.IsInstalled)
2002 if (thing.isFloating)
2004 return thing.Pref.height + 0.1f;
2007 else if (thing.Pref.Surface)
2009 return 0.1f * (float)thing.altitude + thing.Pref.height;
2017 public bool HasZoneStairs(
bool includeLocked =
true)
2019 if (this.detail ==
null)
2023 foreach (
Thing thing
in this.detail.things)
2034 public override bool IsPathBlocked(
PathManager.MoveType moveType)
2038 return this.blocked;
2040 return this.blocked || (this.detail !=
null && this.detail.charas.Count > 0);
2045 private bool <Refresh>g__IsAutoTileEdge|311_0(
Cell cell, ref
Cell.<>c__DisplayClass311_0 A_2)
2047 return (cell.sourceFloor.autotilePriority <=
this.sourceFloor.autotilePriority && (!
this.sourceFloor.isBeach || !cell.sourceFloor.isBeach) && (cell._floor !=
this._floor || cell._floorMat !=
this._floorMat)) || (!A_2.isFloorWater && this.height != cell.height);
2052 private bool <Refresh>g__IsBridgeAutoTileEdge|311_1(
Cell cell, ref
Cell.<>c__DisplayClass311_0 A_2)
2054 return (cell.sourceBridge.autotilePriority <=
this.sourceBridge.autotilePriority && (cell._bridge !=
this._bridge || cell._bridgeMat !=
this._bridgeMat)) || this.bridgeHeight != cell.bridgeHeight;
2059 private bool <Refresh>g__IsObjAutoTileEdge|311_2(
Cell cell, ref
Cell.<>c__DisplayClass311_0 A_2)
2061 return (cell.obj !=
this.obj && (
this.obj != 31 || (cell.obj != 97 && cell.obj != 98))) || this.topHeight != cell.topHeight;
2065 public static Map map;
2068 public static Cell Void =
new Cell();
2086 public static int Size;
2089 public static Cell[,] cells;
2092 public const int DivAutotile = 12;
2101 public byte _blockMat;
2107 public byte _floorMat;
2122 public byte _bridge;
2125 public byte _bridgeMat;
2128 public byte _roofBlock;
2131 public byte _roofBlockMat;
2134 public byte _roofBlockDir;
2146 public byte autotile;
2149 public byte autotileBridge;
2152 public byte autotileObj;
2164 public byte bridgeHeight;
2167 public byte shadowMod;
2170 public byte topHeight;
2173 public byte minHeight;
2176 public byte bridgePillar;
2179 public byte highlight;
2182 public ushort lightR;
2185 public ushort lightG;
2188 public ushort lightB;
2200 public BitArray32 bits;
2203 public BitArray32 bits2;
2212 public const int DIV_LIQUID = 10;
2215 private static bool openSight;
2218 private static bool openPath;
2221 public const int DivStage = 30;