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

◆ PlaceBamboo()

static bool Terraria.WorldGen.PlaceBamboo ( int x,
int y )
inlinestaticprivate

Definition at line 49324 of file WorldGen.cs.

49325 {
49326 int num = 2;
49327 int num2 = 5;
49328 int num3 = genRand.Next(1, 21);
49329 Tile tile = Main.tile[x, y];
49330 if (tile.wall > 0 && (double)y <= Main.worldSurface)
49331 {
49332 return false;
49333 }
49334 if (tile.active() && tile.type == 314)
49335 {
49336 return false;
49337 }
49338 Tile tile2 = Main.tile[x, y + 1];
49339 if (tile2.type == 571 || tile2.type == 60)
49340 {
49341 int waterDepth = GetWaterDepth(x, y);
49343 {
49344 return false;
49345 }
49346 int num4 = CountGrowingPlantTiles(x, y, 5, 571);
49347 int i = 1;
49348 if (tile2.type == 571)
49349 {
49350 for (; !SolidTile(x, y + i); i++)
49351 {
49352 }
49353 if (i + num4 / genRand.Next(1, 21) > num3)
49354 {
49355 return false;
49356 }
49357 }
49358 else
49359 {
49360 num4 += 25;
49361 }
49362 num4 += i * 2;
49363 if (num4 > genRand.Next(40, 61))
49364 {
49365 return false;
49366 }
49367 tile = Main.tile[x, y];
49368 tile.active(active: true);
49369 tile.type = 571;
49370 tile.frameX = 0;
49371 tile.frameY = 0;
49372 tile.slope(0);
49373 tile.halfBrick(halfBrick: false);
49374 SquareTileFrame(x, y);
49375 return true;
49376 }
49377 return false;
49378 }
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static int GetWaterDepth(int x, int y)
static int CountGrowingPlantTiles(int x, int y, int range, int type)
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.Tile.active(), Terraria.Tile.halfBrick(), Terraria.Tile.slope(), Terraria.Enums.SolidTile, Terraria.Main.tile, Terraria.Tile.type, Terraria.Tile.wall, and Terraria.Main.worldSurface.