Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CheckProjectilePressurePad_GetPossiblePlacementDirections()

static void Terraria.WorldGen.CheckProjectilePressurePad_GetPossiblePlacementDirections ( int i,
int j,
out bool canUp,
out bool canLeft,
out bool canRight,
out bool canDown )
inlinestaticprivate

Definition at line 76299 of file WorldGen.cs.

76300 {
76301 canUp = false;
76302 canLeft = false;
76303 canRight = false;
76304 canDown = false;
76305 _ = Main.tile[i, j];
76306 Tile tile = Main.tile[i, j - 1];
76307 Tile tile2 = Main.tile[i, j + 1];
76308 Tile tile3 = Main.tile[i - 1, j];
76309 Tile tile4 = Main.tile[i + 1, j];
76310 Tile tile5 = Main.tile[i - 1, j + 1];
76311 Tile tile6 = Main.tile[i + 1, j + 1];
76312 Tile tile7 = Main.tile[i - 1, j - 1];
76313 Tile tile8 = Main.tile[i + 1, j - 1];
76314 int num = -1;
76315 int num2 = -1;
76316 int num3 = -1;
76317 int num4 = -1;
76318 int tree = -1;
76319 int tree2 = -1;
76320 int tree3 = -1;
76321 int tree4 = -1;
76322 if (tile != null && tile.nactive() && !tile.bottomSlope())
76323 {
76324 num2 = tile.type;
76325 }
76326 if (tile2 != null && tile2.nactive() && !tile2.halfBrick() && !tile2.topSlope())
76327 {
76328 num = tile2.type;
76329 }
76330 if (tile3 != null && tile3.nactive() && (tile3.slope() == 0 || tile3.slope() % 2 != 1))
76331 {
76332 num3 = tile3.type;
76333 }
76334 if (tile4 != null && tile4.nactive() && (tile4.slope() == 0 || tile4.slope() % 2 != 0))
76335 {
76336 num4 = tile4.type;
76337 }
76338 if (tile5 != null && tile5.nactive())
76339 {
76340 tree = tile5.type;
76341 }
76342 if (tile6 != null && tile6.nactive())
76343 {
76344 tree2 = tile6.type;
76345 }
76346 if (tile7 != null && tile7.nactive())
76347 {
76348 tree3 = tile7.type;
76349 }
76350 if (tile8 != null && tile8.nactive())
76351 {
76352 tree4 = tile8.type;
76353 }
76354 if (num >= 0 && Main.tileSolid[num] && (!Main.tileNoAttach[num] || TileID.Sets.Platforms[num]) && (tile2.bottomSlope() || tile2.slope() == 0) && !tile2.halfBrick())
76355 {
76356 canDown = true;
76357 }
76358 if (num2 >= 0 && Main.tileSolid[num2] && (!Main.tileNoAttach[num2] || (TileID.Sets.Platforms[num2] && tile.halfBrick())) && (tile.topSlope() || tile.slope() == 0 || tile.halfBrick()))
76359 {
76360 canUp = true;
76361 }
76362 if ((num3 >= 0 && Main.tileSolid[num3] && !Main.tileNoAttach[num3] && (tile3.leftSlope() || tile3.slope() == 0) && !tile3.halfBrick()) || (num3 >= 0 && TileID.Sets.IsBeam[num3]) || (IsTreeType(num3) && IsTreeType(tree3) && IsTreeType(tree)))
76363 {
76364 canLeft = true;
76365 }
76366 if ((num4 >= 0 && Main.tileSolid[num4] && !Main.tileNoAttach[num4] && (tile4.rightSlope() || tile4.slope() == 0) && !tile4.halfBrick()) || (num4 >= 0 && TileID.Sets.IsBeam[num4]) || (IsTreeType(num4) && IsTreeType(tree4) && IsTreeType(tree2)))
76367 {
76368 canRight = true;
76369 }
76370 }
static bool[] IsBeam
Definition TileID.cs:161
static bool[] Platforms
Definition TileID.cs:163
static bool IsTreeType(int tree)

References Terraria.Tile.bottomSlope(), Terraria.Tile.halfBrick(), Terraria.ID.TileID.Sets.IsBeam, Terraria.Tile.nactive(), Terraria.ID.TileID.Sets.Platforms, Terraria.Tile.slope(), Terraria.Main.tile, Terraria.Main.tileNoAttach, Terraria.Main.tileSolid, Terraria.Tile.topSlope(), and Terraria.Tile.type.