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

◆ Place2xX()

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

Definition at line 34249 of file WorldGen.cs.

34250 {
34251 int num = style * 36;
34252 int num2 = 0;
34253 int num3 = 3;
34254 if (type == 105 && style == 34)
34255 {
34256 type = 349;
34257 style = 0;
34258 num = 0;
34259 }
34260 if (type == 105)
34261 {
34262 int num4 = style / 55;
34263 num -= 1980 * num4;
34264 num2 += 54 * num4;
34265 }
34266 if (type == 104)
34267 {
34268 num3 = 5;
34269 }
34270 if (type == 207)
34271 {
34272 num3 = 4;
34273 }
34274 bool flag = true;
34275 for (int i = y - num3 + 1; i < y + 1; i++)
34276 {
34277 if (Main.tile[x, i] == null)
34278 {
34279 Main.tile[x, i] = new Tile();
34280 }
34281 if (Main.tile[x, i].active())
34282 {
34283 flag = false;
34284 }
34285 if (Main.tile[x + 1, i] == null)
34286 {
34287 Main.tile[x + 1, i] = new Tile();
34288 }
34289 if (Main.tile[x + 1, i].active())
34290 {
34291 flag = false;
34292 }
34293 }
34294 if (flag && SolidTile2(x, y + 1) && SolidTile2(x + 1, y + 1))
34295 {
34296 for (int j = 0; j < num3; j++)
34297 {
34298 Main.tile[x, y - num3 + 1 + j].active(active: true);
34299 Main.tile[x, y - num3 + 1 + j].frameY = (short)(num2 + j * 18);
34300 Main.tile[x, y - num3 + 1 + j].frameX = (short)num;
34301 Main.tile[x, y - num3 + 1 + j].type = type;
34302 Main.tile[x + 1, y - num3 + 1 + j].active(active: true);
34303 Main.tile[x + 1, y - num3 + 1 + j].frameY = (short)(num2 + j * 18);
34304 Main.tile[x + 1, y - num3 + 1 + j].frameX = (short)(num + 18);
34305 Main.tile[x + 1, y - num3 + 1 + j].type = type;
34306 }
34307 }
34308 }
static bool SolidTile2(Tile testTile)

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