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

◆ GrowShroom()

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

Definition at line 23123 of file WorldGen.cs.

23124 {
23125 if (Main.tile[i - 1, y - 1].lava() || Main.tile[i - 1, y - 1].lava() || Main.tile[i + 1, y - 1].lava())
23126 {
23127 return false;
23128 }
23129 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))
23130 {
23131 if (gen && genRand.Next(3) != 0)
23132 {
23133 Main.tile[i, y].halfBrick(halfBrick: false);
23134 Main.tile[i, y].slope(0);
23135 }
23136 if (!Main.tile[i, y].halfBrick() && Main.tile[i, y].slope() == 0)
23137 {
23138 int num = genRand.Next(4, 11);
23139 for (int j = y - num; j < y; j++)
23140 {
23141 Main.tile[i, j].frameNumber((byte)genRand.Next(3));
23142 Main.tile[i, j].active(active: true);
23143 Main.tile[i, j].type = 72;
23144 int num2 = genRand.Next(3);
23145 if (num2 == 0)
23146 {
23147 Main.tile[i, j].frameX = 0;
23148 Main.tile[i, j].frameY = 0;
23149 }
23150 if (num2 == 1)
23151 {
23152 Main.tile[i, j].frameX = 0;
23153 Main.tile[i, j].frameY = 18;
23154 }
23155 if (num2 == 2)
23156 {
23157 Main.tile[i, j].frameX = 0;
23158 Main.tile[i, j].frameY = 36;
23159 }
23160 }
23161 int num3 = genRand.Next(3);
23162 if (num3 == 0)
23163 {
23164 Main.tile[i, y - num].frameX = 36;
23165 Main.tile[i, y - num].frameY = 0;
23166 }
23167 if (num3 == 1)
23168 {
23169 Main.tile[i, y - num].frameX = 36;
23170 Main.tile[i, y - num].frameY = 18;
23171 }
23172 if (num3 == 2)
23173 {
23174 Main.tile[i, y - num].frameX = 36;
23175 Main.tile[i, y - num].frameY = 36;
23176 }
23177 RangeFrame(i - 2, y - num - 1, i + 2, y + 1);
23178 if (Main.netMode == 2)
23179 {
23180 NetMessage.SendTileSquare(-1, i - 1, y - num, 3, num);
23181 }
23182 return true;
23183 }
23184 }
23185 return false;
23186 }
static volatile bool gen
Definition WorldGen.cs:972
static UnifiedRandom genRand
Definition WorldGen.cs:1215
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.