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

◆ PlaceBanner()

static void Terraria.WorldGen.PlaceBanner ( int x,
int y,
ushort type,
int style = 0 )
inlinestatic

Definition at line 37167 of file WorldGen.cs.

37168 {
37169 int num = style * 18;
37170 int num2 = 0;
37171 if (style >= 90)
37172 {
37173 num -= 1620;
37174 num2 += 54;
37175 }
37176 if (Main.tile[x, y - 1] == null)
37177 {
37178 Main.tile[x, y - 1] = new Tile();
37179 }
37180 if (Main.tile[x, y] == null)
37181 {
37182 Main.tile[x, y] = new Tile();
37183 }
37184 if (Main.tile[x, y + 1] == null)
37185 {
37186 Main.tile[x, y + 1] = new Tile();
37187 }
37188 if (Main.tile[x, y + 2] == null)
37189 {
37190 Main.tile[x, y + 2] = new Tile();
37191 }
37192 if (Main.tile[x, y - 1].nactive() && Main.tileSolid[Main.tile[x, y - 1].type] && !Main.tileSolidTop[Main.tile[x, y - 1].type] && !Main.tile[x, y].active() && !Main.tile[x, y + 1].active() && !Main.tile[x, y + 2].active())
37193 {
37194 Main.tile[x, y].active(active: true);
37195 Main.tile[x, y].frameY = (short)num2;
37196 Main.tile[x, y].frameX = (short)num;
37197 Main.tile[x, y].type = type;
37198 Main.tile[x, y + 1].active(active: true);
37199 Main.tile[x, y + 1].frameY = (short)(num2 + 18);
37200 Main.tile[x, y + 1].frameX = (short)num;
37201 Main.tile[x, y + 1].type = type;
37202 Main.tile[x, y + 2].active(active: true);
37203 Main.tile[x, y + 2].frameY = (short)(num2 + 36);
37204 Main.tile[x, y + 2].frameX = (short)num;
37205 Main.tile[x, y + 2].type = type;
37206 }
37207 }

References Terraria.DataStructures.Tile, Terraria.Main.tile, Terraria.Main.tileSolid, Terraria.Main.tileSolidTop, and System.type.