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

◆ SwitchCannon()

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

Definition at line 44374 of file WorldGen.cs.

44375 {
44376 Tile tile = Main.tile[i, j];
44377 int num;
44378 for (num = tile.frameX / 18; num >= 4; num -= 4)
44379 {
44380 }
44381 tile = Main.tile[i, j];
44382 int num2;
44383 for (num2 = tile.frameY / 18; num2 >= 3; num2 -= 3)
44384 {
44385 }
44386 int num3 = 1;
44387 if (num < 2)
44388 {
44389 num3 = -1;
44390 }
44391 num = i - num;
44392 num2 = j - num2;
44393 if (num3 == 1)
44394 {
44395 tile = Main.tile[num, num2];
44396 if (tile.frameY <= 52)
44397 {
44398 return;
44399 }
44400 }
44401 if (num3 == -1)
44402 {
44403 tile = Main.tile[num, num2];
44404 if (tile.frameY >= 432)
44405 {
44406 return;
44407 }
44408 }
44409 num3 *= -54;
44410 for (int k = num; k < num + 4; k++)
44411 {
44412 for (int l = num2; l < num2 + 3; l++)
44413 {
44414 if (Main.tile[k, l] == null)
44415 {
44416 tile = (Main.tile[k, l] = default(Tile));
44417 }
44418 tile = Main.tile[k, l];
44419 if (tile.active())
44420 {
44421 tile = Main.tile[k, l];
44422 if (tile.type == 209)
44423 {
44424 tile = Main.tile[k, l];
44425 ref short frameY = ref tile.frameY;
44426 tile = Main.tile[k, l];
44427 frameY = (short)(tile.frameY + num3);
44428 }
44429 }
44430 }
44431 }
44432 NetMessage.SendTileSquare(-1, num, num2, 4, 3);
44433 }

References Terraria.Tile.active(), Terraria.Tile.frameX, Terraria.Tile.frameY, Terraria.NetMessage.SendTileSquare(), Terraria.Main.tile, and Terraria.Tile.type.

+ Here is the call graph for this function: