Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ GrowCheckSeaweed()

static void Terraria.WorldGen.GrowCheckSeaweed ( int x,
int y )
inlinestatic

Definition at line 49851 of file WorldGen.cs.

49852 {
49853 int maxValue = 1;
49854 if (Main.netMode == 1)
49855 {
49856 return;
49857 }
49858 if ((Main.tile[x, y].type == 549 && Main.tile[x, y].liquid < 200) || Main.tile[x, y - 1].liquid < 200)
49859 {
49860 if (Main.tile[x, y].active() && Main.tile[x, y].type == 549 && genRand.Next(2) == 0)
49861 {
49862 KillTile(x, y);
49863 if (Main.netMode == 2)
49864 {
49865 NetMessage.SendData(17, -1, -1, null, 0, x, y);
49866 }
49867 }
49868 }
49869 else
49870 {
49871 if (Main.tile[x, y - 1].active() || Main.tile[x, y - 2].active() || genRand.Next(maxValue) != 0 || Main.tile[x, y - 2].liquid != byte.MaxValue || Main.tile[x, y - 3].liquid != byte.MaxValue)
49872 {
49873 return;
49874 }
49875 int num = 17;
49876 int num2 = 4;
49877 int num3 = 30;
49878 int num4 = 0;
49879 for (int i = x - num2; i <= x + num2; i++)
49880 {
49881 for (int j = y; j <= y + num2 * 3; j++)
49882 {
49883 if (Main.tile[i, j].active() && Main.tile[i, j].type == 549)
49884 {
49885 num4++;
49886 if (num4 > num3)
49887 {
49888 return;
49889 }
49890 }
49891 }
49892 }
49893 int k;
49894 for (k = y; !SolidTile(x, k) && k < Main.maxTilesY - 50; k++)
49895 {
49896 }
49897 if (k - y < num - genRand.Next(20))
49898 {
49899 PlaceTile(x, y - 1, 549, mute: true);
49900 if (Main.netMode == 2)
49901 {
49902 NetMessage.SendTileSquare(-1, x, y - 1);
49903 }
49904 }
49905 }
49906 }
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static bool PlaceTile(int i, int j, int Type, bool mute=false, bool forced=false, int plr=-1, int style=0)
static UnifiedRandom genRand
Definition WorldGen.cs:1215

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