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

◆ Check2x5()

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

Definition at line 47373 of file WorldGen.cs.

47374 {
47375 if (destroyObject)
47376 {
47377 return;
47378 }
47379 bool flag = false;
47380 int num = i;
47381 int num2 = j;
47382 num = Main.tile[i, j].frameX / 18;
47383 int num3 = 0;
47384 while (num >= 2)
47385 {
47386 num3++;
47387 num -= 2;
47388 }
47389 int num4 = i - num;
47390 int num5 = 36 * num3;
47391 int num6 = Main.tile[i, j].frameY % 80 / 18;
47392 if (num >= 3)
47393 {
47394 num -= 2;
47395 }
47396 num = i - num;
47397 num2 -= num6;
47398 for (int k = num; k < num + 2; k++)
47399 {
47400 for (int l = num2; l < num2 + 5; l++)
47401 {
47402 if (Main.tile[k, l] == null)
47403 {
47404 Main.tile[k, l] = default(Tile);
47405 }
47406 if (!Main.tile[k, l].active() || Main.tile[k, l].type != type || Main.tile[k, l].frameX != (k - num4) * 18 + num5 || Main.tile[k, l].frameY != (l - num2) * 18)
47407 {
47408 flag = true;
47409 }
47410 }
47411 }
47412 for (int m = num; m < num + 2; m++)
47413 {
47414 if (Main.tile[m, num2 + 5] == null)
47415 {
47416 Main.tile[m, num2 + 5] = default(Tile);
47417 }
47418 if (!SolidTileAllowBottomSlope(m, num2 + 5))
47419 {
47420 flag = true;
47421 break;
47422 }
47423 }
47424 if (!flag)
47425 {
47426 return;
47427 }
47428 destroyObject = true;
47429 bool drop = TileLoader.Drop(i, j, type);
47430 for (int n = num; n < num + 2; n++)
47431 {
47432 for (int num7 = num2; num7 < num2 + 5; num7++)
47433 {
47434 if (Main.tile[n, num7].type == type && Main.tile[n, num7].active())
47435 {
47436 KillTile(n, num7);
47437 }
47438 }
47439 }
47440 using (new Item.DisableNewItemMethod(!drop))
47441 {
47442 switch (type)
47443 {
47444 case 547:
47445 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4430 + num3);
47446 break;
47447 case 623:
47448 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 5081 + num3);
47449 break;
47450 }
47451 destroyObject = false;
47452 for (int num8 = num - 1; num8 < num + 3; num8++)
47453 {
47454 for (int num9 = num2 - 1; num9 < num2 + 6; num9++)
47455 {
47457 }
47458 }
47459 }
47460 }
static bool Drop(int i, int j, int type, bool includeLargeObjectDrops=true)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
static bool destroyObject
Definition WorldGen.cs:1258
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
static bool SolidTileAllowBottomSlope(int i, int j)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.ModLoader.TileLoader.Drop(), Terraria.Item.NewItem(), and Terraria.Main.tile.

+ Here is the call graph for this function: