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

◆ CreateBrickBoxForWallOfFlesh()

void Terraria.NPC.CreateBrickBoxForWallOfFlesh ( )
inlineprivate

Definition at line 84664 of file NPC.cs.

84665 {
84666 int num = (int)(position.X + (float)(width / 2)) / 16;
84667 int num2 = (int)(position.Y + (float)(height / 2)) / 16;
84668 int num3 = width / 2 / 16 + 1;
84669 for (int i = num - num3; i <= num + num3; i++)
84670 {
84671 for (int j = num2 - num3; j <= num2 + num3; j++)
84672 {
84673 Tile tile;
84674 if (i == num - num3 || i == num + num3 || j == num2 - num3 || j == num2 + num3)
84675 {
84676 tile = Main.tile[i, j];
84677 if (!tile.active())
84678 {
84679 tile = Main.tile[i, j];
84680 tile.type = (ushort)(WorldGen.crimson ? 347u : 140u);
84681 tile = Main.tile[i, j];
84682 tile.active(active: true);
84683 }
84684 }
84685 tile = Main.tile[i, j];
84686 tile.lava(lava: false);
84687 tile = Main.tile[i, j];
84688 tile.liquid = 0;
84689 if (Main.netMode == 2)
84690 {
84691 NetMessage.SendTileSquare(-1, i, j);
84692 }
84693 else
84694 {
84695 WorldGen.SquareTileFrame(i, j);
84696 }
84697 }
84698 }
84699 }
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
Definition Entity.cs:21
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51

References Terraria.Entity.active, Terraria.Tile.active(), Terraria.WorldGen.crimson, Terraria.Entity.height, Terraria.Tile.lava(), Terraria.Main.netMode, Terraria.Entity.position, Terraria.NetMessage.SendTileSquare(), Terraria.WorldGen.SquareTileFrame(), Terraria.Main.tile, and Terraria.Entity.width.

Referenced by Terraria.NPC.DoDeathEvents().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: