9 public override string LangPlaceType
13 return "place_WallMount";
19 public override bool CanStack
29 public override bool IsBlockMount
39 public override bool UseMountHeight
49 public override bool UseHangZFix
59 public virtual bool NoBackSide
68 public override int GetDesiredDir(
Point p,
int d)
70 if (
EClass.scene.actionMode !=
null &&
EClass.scene.actionMode.IsRoofEditMode(
null))
75 TileTypeWallHang.DIRS[0] = (cell.Back.sourceBlock.tileType.IsMountBlock && (!cell.Back.sourceBlock.tileType.IsWallOrFence || cell.Back.blockDir != 1));
76 TileTypeWallHang.DIRS[1] = (cell.Left.sourceBlock.tileType.IsMountBlock && (!cell.Left.sourceBlock.tileType.IsWallOrFence || cell.Left.blockDir != 0));
84 TileTypeWallHang.DIRS[2] = (cell.Front.sourceBlock.tileType.IsMountBlock && (!cell.Front.sourceBlock.tileType.IsWallOrFence || cell.Front.blockDir != 1));
85 TileTypeWallHang.DIRS[3] = (cell.Right.sourceBlock.tileType.IsMountBlock && (!cell.Right.sourceBlock.tileType.IsWallOrFence || cell.Right.blockDir != 0));
93 for (
int i = 0; i < 4; i++)
109 public unsafe
override void GetMountHeight(ref Vector3 v,
Point p,
int d,
Card target =
null)
111 if (d == 0 && p.z <
EClass._map.Size - 1)
113 Point.shared2.Set(p.x, p.z + 1);
114 Vector3 vector = *
Point.shared2.Position();
116 v.y = vector.y +
Point.shared2.sourceBlock.tileType.MountHeight;
118 if (
Point.shared2.HasWallOrFence)
120 v +=
EClass.screen.tileMap.wallHangFix[0];
122 v += EClass.screen.tileMap.altitudeFix * (float)target.altitude;
125 if (d == 1 && p.x > 0)
127 Point.shared2.Set(p.x - 1, p.z);
128 Vector3 vector2 = *
Point.shared2.Position();
130 v.y = vector2.y +
Point.shared2.sourceBlock.tileType.MountHeight;
132 if (
Point.shared2.HasWallOrFence)
134 v +=
EClass.screen.tileMap.wallHangFix[1];
136 v += EClass.screen.tileMap.altitudeFix * (float)target.altitude;
139 if (d == 2 && p.z > 0)
141 Point.shared2.Set(p.x, p.z - 1);
142 Vector3 vector3 = *p.Position();
144 v.y = vector3.y + p.sourceBlock.tileType.MountHeight;
146 if (
Point.shared2.HasWallOrFence)
148 v +=
EClass.screen.tileMap.wallHangFix[2];
150 v += EClass.screen.tileMap.altitudeFix * (float)target.altitude;
153 if (d == 3 && p.x <
EClass._map.Size - 1)
155 Point.shared2.Set(p.x + 1, p.z);
156 Vector3 vector4 = *p.Position();
158 v.y = vector4.y + p.sourceBlock.tileType.MountHeight;
160 if (
Point.shared2.HasWallOrFence)
162 v +=
EClass.screen.tileMap.wallHangFix[3];
164 v += EClass.screen.tileMap.altitudeFix * (float)target.altitude;
167 v.y += p.sourceBlock.tileType.MountHeight;
171 protected override HitResult HitTest(
Point pos)
173 if (this.GetDesiredDir(pos, -1) == -1)
175 return HitResult.Invalid;
177 return base.HitTest(pos);
181 public static bool[] DIRS =
new bool[4];