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

◆ GrowMoreVines()

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

Definition at line 36612 of file WorldGen.cs.

36613 {
36614 if (!InWorld(x, y, 30))
36615 {
36616 return false;
36617 }
36618 int num = 4;
36619 int num2 = 6;
36620 int num3 = 10;
36621 int num4 = 60;
36622 int num5 = 0;
36623 if (Main.tile[x, y].type == 528)
36624 {
36625 num4 /= 5;
36626 }
36627 for (int i = x - num; i <= x + num; i++)
36628 {
36629 for (int j = y - num2; j <= y + num3; j++)
36630 {
36631 if (TileID.Sets.IsVine[Main.tile[i, j].type])
36632 {
36633 num5++;
36634 if (j > y && Collision.CanHitLine(new Vector2(x * 16, y * 16), 1, 1, new Vector2(i * 16, j * 16), 1, 1))
36635 {
36636 num5 = ((Main.tile[i, j].type != 528) ? (num5 + (j - y) * 2) : (num5 + (j - y) * 20));
36637 }
36638 if (num5 > num4)
36639 {
36640 return false;
36641 }
36642 }
36643 }
36644 }
36645 return true;
36646 }
static bool[] IsVine
Definition TileID.cs:159
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:5816

References Terraria.Collision.CanHitLine(), Terraria.ID.TileID.Sets.IsVine, and Terraria.Main.tile.