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

◆ GrowShroom()

static bool Terraria.WorldGen.GrowShroom ( int i,
int y )
inlinestatic

Definition at line 24338 of file WorldGen.cs.

24339 {
24340 if (Main.tile[i - 1, y - 1].lava() || Main.tile[i - 1, y - 1].lava() || Main.tile[i + 1, y - 1].lava())
24341 {
24342 return false;
24343 }
24344 if (Main.tile[i, y].nactive() && Main.tile[i, y].type == 70 && Main.tile[i, y - 1].wall == 0 && Main.tile[i - 1, y].active() && Main.tile[i - 1, y].type == 70 && Main.tile[i + 1, y].active() && Main.tile[i + 1, y].type == 70 && EmptyTileCheck(i - 2, i + 2, y - 13, y - 3, 71) && EmptyTileCheck(i - 1, i + 1, y - 3, y - 1, 71))
24345 {
24346 if (gen && genRand.Next(3) != 0)
24347 {
24348 Main.tile[i, y].halfBrick(halfBrick: false);
24349 Main.tile[i, y].slope(0);
24350 }
24351 if (!Main.tile[i, y].halfBrick() && Main.tile[i, y].slope() == 0)
24352 {
24353 int num = genRand.Next(4, 11);
24354 for (int j = y - num; j < y; j++)
24355 {
24356 Main.tile[i, j].frameNumber((byte)genRand.Next(3));
24357 Main.tile[i, j].active(active: true);
24358 Main.tile[i, j].type = 72;
24359 int num2 = genRand.Next(3);
24360 if (num2 == 0)
24361 {
24362 Main.tile[i, j].frameX = 0;
24363 Main.tile[i, j].frameY = 0;
24364 }
24365 if (num2 == 1)
24366 {
24367 Main.tile[i, j].frameX = 0;
24368 Main.tile[i, j].frameY = 18;
24369 }
24370 if (num2 == 2)
24371 {
24372 Main.tile[i, j].frameX = 0;
24373 Main.tile[i, j].frameY = 36;
24374 }
24375 }
24376 int num3 = genRand.Next(3);
24377 if (num3 == 0)
24378 {
24379 Main.tile[i, y - num].frameX = 36;
24380 Main.tile[i, y - num].frameY = 0;
24381 }
24382 if (num3 == 1)
24383 {
24384 Main.tile[i, y - num].frameX = 36;
24385 Main.tile[i, y - num].frameY = 18;
24386 }
24387 if (num3 == 2)
24388 {
24389 Main.tile[i, y - num].frameX = 36;
24390 Main.tile[i, y - num].frameY = 36;
24391 }
24392 RangeFrame(i - 2, y - num - 1, i + 2, y + 1);
24393 if (Main.netMode == 2)
24394 {
24395 NetMessage.SendTileSquare(-1, i - 1, y - num, 3, num);
24396 }
24397 return true;
24398 }
24399 }
24400 return false;
24401 }
static volatile bool gen
Definition WorldGen.cs:1210
static UnifiedRandom genRand
Definition WorldGen.cs:1455
static bool EmptyTileCheck(int startX, int endX, int startY, int endY, int ignoreID=-1)
static void RangeFrame(int startX, int startY, int endX, int endY)

References Terraria.Main.netMode, Terraria.NetMessage.SendTileSquare(), and Terraria.Main.tile.

+ Here is the call graph for this function: