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

◆ PlacePot()

static bool Terraria.WorldGen.PlacePot ( int x,
int y,
ushort type = 28,
int style = 0 )
inlinestatic

Definition at line 45687 of file WorldGen.cs.

45688 {
45689 bool flag = true;
45690 if (remixWorldGen && (double)x > (double)Main.maxTilesX * 0.48 && (double)x < (double)Main.maxTilesX * 0.52 && y > Main.maxTilesY - 220)
45691 {
45692 flag = false;
45693 }
45694 for (int i = x; i < x + 2; i++)
45695 {
45696 for (int j = y - 1; j < y + 1; j++)
45697 {
45698 if (Main.tile[i, j] == null)
45699 {
45700 Main.tile[i, j] = new Tile();
45701 }
45702 if (Main.tile[i, j].active())
45703 {
45704 flag = false;
45705 }
45706 }
45707 if (Main.tile[i, y + 1] == null)
45708 {
45709 Main.tile[i, y + 1] = new Tile();
45710 }
45711 if (!Main.tile[i, y + 1].nactive() || Main.tile[i, y + 1].halfBrick() || Main.tile[i, y + 1].slope() != 0 || !Main.tileSolid[Main.tile[i, y + 1].type])
45712 {
45713 flag = false;
45714 }
45715 }
45716 if (flag)
45717 {
45718 int num = genRand.Next(3) * 36;
45719 for (int k = 0; k < 2; k++)
45720 {
45721 for (int l = -1; l < 1; l++)
45722 {
45723 int num2 = k * 18 + num;
45724 int num3 = (l + 1) * 18;
45725 Main.tile[x + k, y + l].active(active: true);
45726 Main.tile[x + k, y + l].frameX = (short)num2;
45727 Main.tile[x + k, y + l].frameY = (short)(num3 + style * 36);
45728 Main.tile[x + k, y + l].type = type;
45729 Main.tile[x + k, y + l].halfBrick(halfBrick: false);
45730 }
45731 }
45732 return true;
45733 }
45734 return false;
45735 }
static bool remixWorldGen
Definition WorldGen.cs:1148
static UnifiedRandom genRand
Definition WorldGen.cs:1215

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

Referenced by Terraria.WorldGen.Spread.Spider().