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

◆ GrowPumpkin()

static void Terraria.WorldGen.GrowPumpkin ( int i,
int j,
int type )
inlinestatic

Definition at line 44210 of file WorldGen.cs.

44211 {
44212 if (destroyObject)
44213 {
44214 return;
44215 }
44216 bool flag = false;
44217 int num = j;
44218 int num2;
44219 for (num2 = Main.tile[i, j].frameY / 18; num2 > 1; num2 -= 2)
44220 {
44221 }
44222 num -= num2;
44223 int num3 = Main.tile[i, j].frameX / 18;
44224 int num4 = 0;
44225 while (num3 > 1)
44226 {
44227 num3 -= 2;
44228 num4++;
44229 }
44230 num3 = i - num3;
44231 int num5 = num4 * 36;
44232 if (num4 >= 4)
44233 {
44234 return;
44235 }
44236 for (int k = num3; k < num3 + 2; k++)
44237 {
44238 for (int l = num; l < num + 2; l++)
44239 {
44240 if (Main.tile[k, l] == null)
44241 {
44242 Main.tile[k, l] = new Tile();
44243 }
44244 if (!Main.tile[k, l].active() || Main.tile[k, l].type != type || Main.tile[k, l].frameX != (k - num3) * 18 + num5)
44245 {
44246 flag = true;
44247 }
44248 }
44249 if (!SolidTile(k, num + 2) || (Main.tile[k, num + 2].type != 2 && Main.tile[k, num + 2].type != 477 && Main.tile[k, num + 2].type != 492 && Main.tile[k, num + 2].type != 109))
44250 {
44251 flag = true;
44252 }
44253 }
44254 if (!flag)
44255 {
44256 for (int m = num3; m < num3 + 2; m++)
44257 {
44258 for (int n = num; n < num + 2; n++)
44259 {
44260 if (Main.tile[m, n] == null)
44261 {
44262 Main.tile[m, n] = new Tile();
44263 }
44264 if (Main.tile[m, n].type == type && Main.tile[m, n].active())
44265 {
44266 Main.tile[m, n].frameX += 36;
44267 }
44268 }
44269 }
44270 }
44271 if (Main.netMode == 2)
44272 {
44273 NetMessage.SendTileSquare(-1, num3, num, 2, 2);
44274 }
44275 }
static bool destroyObject
Definition WorldGen.cs:1020

References Terraria.Main.netMode, Terraria.NetMessage.SendTileSquare(), Terraria.Enums.SolidTile, Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.