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

◆ GrowAlch()

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

Definition at line 36708 of file WorldGen.cs.

36709 {
36710 if (!Main.tile[x, y].active())
36711 {
36712 return;
36713 }
36714 if (Main.tile[x, y].liquid > 0)
36715 {
36716 int num = Main.tile[x, y].frameX / 18;
36717 if ((!Main.tile[x, y].lava() || num != 5) && (Main.tile[x, y].liquidType() != 0 || (num != 1 && num != 4)))
36718 {
36719 KillTile(x, y);
36720 if (Main.netMode == 2)
36721 {
36722 NetMessage.SendTileSquare(-1, x, y);
36723 }
36724 SquareTileFrame(x, y);
36725 }
36726 }
36727 if (Main.tile[x, y].type == 82)
36728 {
36729 if (genRand.Next(50) == 0)
36730 {
36731 bool flag = false;
36732 if (Main.tile[x, y].frameX == 108)
36733 {
36734 if (genRand.Next(2) == 0)
36735 {
36736 flag = true;
36737 }
36738 }
36739 else
36740 {
36741 flag = true;
36742 }
36743 if (flag)
36744 {
36745 Main.tile[x, y].type = 83;
36746 if (Main.netMode == 2)
36747 {
36748 NetMessage.SendTileSquare(-1, x, y);
36749 }
36750 SquareTileFrame(x, y);
36751 }
36752 }
36753 else if (Main.dayTime && Main.tile[x, y].type == 82 && Main.tile[x, y].frameX == 0 && genRand.Next(50) == 0)
36754 {
36755 Main.tile[x, y].type = 83;
36756 if (Main.netMode == 2)
36757 {
36758 NetMessage.SendTileSquare(-1, x, y);
36759 }
36760 SquareTileFrame(x, y);
36761 }
36762 else if (!Main.dayTime && Main.tile[x, y].type == 82 && Main.tile[x, y].frameX == 18 && genRand.Next(50) == 0)
36763 {
36764 Main.tile[x, y].type = 83;
36765 if (Main.netMode == 2)
36766 {
36767 NetMessage.SendTileSquare(-1, x, y);
36768 }
36769 SquareTileFrame(x, y);
36770 }
36771 else if (Main.raining && Main.tile[x, y].type == 82 && Main.tile[x, y].frameX == 72 && genRand.Next(50) == 0)
36772 {
36773 Main.tile[x, y].type = 83;
36774 if (Main.netMode == 2)
36775 {
36776 NetMessage.SendTileSquare(-1, x, y);
36777 }
36778 SquareTileFrame(x, y);
36779 }
36780 else if ((double)y > Main.worldSurface && Main.tile[x, y].type == 82 && Main.tile[x, y].frameX == 36 && genRand.Next(50) == 0)
36781 {
36782 Main.tile[x, y].type = 83;
36783 if (Main.netMode == 2)
36784 {
36785 NetMessage.SendTileSquare(-1, x, y);
36786 }
36787 SquareTileFrame(x, y);
36788 }
36789 else if (y > Main.maxTilesY - 200 && Main.tile[x, y].type == 82 && Main.tile[x, y].frameX == 90 && genRand.Next(50) == 0)
36790 {
36791 Main.tile[x, y].type = 83;
36792 if (Main.netMode == 2)
36793 {
36794 NetMessage.SendTileSquare(-1, x, y);
36795 }
36796 SquareTileFrame(x, y);
36797 }
36798 }
36799 else if (Main.tile[x, y].frameX == 36 && genRand.Next(3) != 0)
36800 {
36801 if (Main.tile[x, y].type == 83)
36802 {
36803 if (genRand.Next(2) == 0)
36804 {
36805 Main.tile[x, y].type = 84;
36806 if (Main.netMode == 2)
36807 {
36808 NetMessage.SendTileSquare(-1, x, y);
36809 }
36810 }
36811 }
36812 else if (Main.tile[x, y].type == 84 || genRand.Next(5) == 0)
36813 {
36814 Main.tile[x, y].type = 83;
36815 if (Main.netMode == 2)
36816 {
36817 NetMessage.SendTileSquare(-1, x, y);
36818 }
36819 }
36820 }
36821 else if (Main.tile[x, y].frameX == 108 && Main.tile[x, y].type == 83 && genRand.Next(30) == 0)
36822 {
36823 Main.tile[x, y].type = 84;
36824 if (Main.netMode == 2)
36825 {
36826 NetMessage.SendTileSquare(-1, x, y);
36827 }
36828 SquareTileFrame(x, y);
36829 }
36830 }
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.Main.dayTime, Terraria.Main.maxTilesY, Terraria.Main.netMode, Terraria.Main.raining, Terraria.NetMessage.SendTileSquare(), Terraria.Main.tile, and Terraria.Main.worldSurface.