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

◆ PlatformProperSides()

static int Terraria.WorldGen.PlatformProperSides ( int x,
int y,
bool acceptNonOpposing = false )
inlinestatic

Definition at line 70996 of file WorldGen.cs.

70997 {
70998 Tile tile = Main.tile[x, y];
70999 if (!tile.active() || !TileID.Sets.Platforms[tile.type])
71000 {
71001 return 0;
71002 }
71003 int num = tile.slope();
71004 int num2 = -1;
71005 if (num == 1)
71006 {
71007 num2 = 2;
71008 }
71009 if (num == 2)
71010 {
71011 num2 = 1;
71012 }
71013 int num3 = 0;
71014 int num4 = 1;
71015 int num5 = 0;
71016 if (num == 1)
71017 {
71018 num5 = 1;
71019 }
71020 if (num == 2)
71021 {
71022 num5 = -1;
71023 }
71025 {
71026 if (Main.tile[x + num4, y + num5].active() && TileID.Sets.Platforms[Main.tile[x + num4, y + num5].type] && Main.tile[x + num4, y + num5].slope() != num2)
71027 {
71028 num3++;
71029 }
71030 }
71031 else if (Main.tile[x + num4, y + num5].active() && TileID.Sets.Platforms[Main.tile[x + num4, y + num5].type] && Main.tile[x + num4, y + num5].slope() == num)
71032 {
71033 num3++;
71034 }
71035 num4 *= -1;
71036 num5 *= -1;
71038 {
71039 if (Main.tile[x + num4, y + num5].active() && TileID.Sets.Platforms[Main.tile[x + num4, y + num5].type] && Main.tile[x + num4, y + num5].slope() != num2)
71040 {
71041 num3++;
71042 }
71043 }
71044 else if (Main.tile[x + num4, y + num5].active() && TileID.Sets.Platforms[Main.tile[x + num4, y + num5].type] && Main.tile[x + num4, y + num5].slope() == num)
71045 {
71046 num3++;
71047 }
71048 return num3;
71049 }
static bool[] Platforms
Definition TileID.cs:163

References Terraria.Tile.active(), Terraria.ID.TileID.Sets.Platforms, Terraria.Tile.slope(), Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.Player.PlaceThing_Tiles_PlaceIt_SpinSmartPlatform().