Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ReplaceWall()

static bool Terraria.WorldGen.ReplaceWall ( int x,
int y,
ushort targetWall )
inlinestatic

Definition at line 53198 of file WorldGen.cs.

53199 {
53200 if (targetWall >= WallID.Count)
53201 {
53202 return false;
53203 }
53204 Tile tile = Main.tile[x, y];
53205 if (tile.wall == 0 || targetWall == 0)
53206 {
53207 return false;
53208 }
53209 if (KillWall_CheckFailure(fail: false, tile))
53210 {
53211 return false;
53212 }
53213 int num = 10;
53214 for (int i = 0; i < num; i++)
53215 {
53216 KillWall_MakeWallDust(x, y, tile);
53217 }
53218 KillWall_PlaySounds(x, y, tile);
53219 KillWall_DropItems(x, y, tile);
53220 tile.wall = targetWall;
53221 tile.ClearWallPaintAndCoating();
53222 SquareWallFrame(x, y);
53223 return true;
53224 }
static readonly ushort Count
Definition WallID.cs:753
static void SquareWallFrame(int i, int j, bool resetFrame=true)
static bool KillWall_CheckFailure(bool fail, Tile tileCache)
static void KillWall_PlaySounds(int i, int j, Tile tileCache)
static void KillWall_DropItems(int i, int j, Tile tileCache)
static void KillWall_MakeWallDust(int i, int j, Tile tileCache)

References Terraria.Tile.ClearWallPaintAndCoating(), Terraria.ID.WallID.Count, Terraria.Main.tile, and Terraria.Tile.wall.

Referenced by Terraria.MessageBuffer.GetData(), and Terraria.Player.PlaceThing_TryReplacingWalls().