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

◆ SlopeTile()

static bool Terraria.WorldGen.SlopeTile ( int i,
int j,
int slope = 0,
bool noEffects = false )
inlinestatic

Definition at line 70878 of file WorldGen.cs.

70879 {
70880 if (!CanPoundTile(i, j))
70881 {
70882 return false;
70883 }
70884 Main.tile[i, j].halfBrick(halfBrick: false);
70885 Main.tile[i, j].slope((byte)slope);
70886 if (!gen)
70887 {
70888 if (!noEffects)
70889 {
70891 }
70892 SoundEngine.PlaySound(0, i * 16, j * 16);
70893 SquareTileFrame(i, j);
70894 if (Main.tile[i, j].slope() == 0)
70895 {
70896 Rectangle rectangle = new Rectangle(i * 16, j * 16, 16, 16);
70897 for (int k = 0; k < 255; k++)
70898 {
70899 if (Main.player[k].active && !Main.player[k].dead && rectangle.Intersects(new Rectangle((int)Main.player[k].position.X, (int)Main.player[k].position.Y, Main.player[k].width, Main.player[k].height)))
70900 {
70901 Main.player[k].gfxOffY += Main.player[k].position.Y + (float)Main.player[k].height - (float)rectangle.Y;
70902 Main.player[k].position.Y = rectangle.Y - Main.player[k].height;
70903 }
70904 }
70905 }
70906 }
70907 return true;
70908 }
static void PlaySound(int type, Vector2 position, int style=1)
static volatile bool gen
Definition WorldGen.cs:972
static bool CanPoundTile(int x, int y)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), and Terraria.Main.tile.

Referenced by Terraria.Projectile.AI_010(), Terraria.WorldBuilding.Actions.SetSlope.Apply(), Terraria.MessageBuffer.GetData(), Terraria.Player.ItemCheck_UseMiningTools_TryPoundingTile(), Terraria.Projectile.Kill(), Terraria.TileObject.Place(), Terraria.Player.PlaceThing_Tiles_BlockPlacementForAssortedThings(), Terraria.Player.PlaceThing_Tiles_PlaceIt_SpinSmartPlatform(), Terraria.Player.PlaceThing_Tiles_PlaceIt_UnslopeForSolids(), and Terraria.DelegateMethods.SpreadDirt().