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

◆ Check3x2Wall()

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

Definition at line 35847 of file WorldGen.cs.

35848 {
35849 if (destroyObject)
35850 {
35851 return;
35852 }
35853 bool flag = false;
35854 int type = Main.tile[x, y].type;
35855 int num = 0;
35856 int num2 = Main.tile[x, y].frameY / 18;
35857 while (num2 >= 2)
35858 {
35859 num2 -= 2;
35860 num++;
35861 }
35862 int num3 = y - num2;
35863 int num4 = x - Main.tile[x, y].frameX / 18;
35864 num2 = num * 36;
35865 for (int i = num4; i < num4 + 3; i++)
35866 {
35867 for (int j = num3; j < num3 + 2; j++)
35868 {
35869 if (Main.tile[i, j].type != type || !Main.tile[i, j].active() || Main.tile[i, j].wall <= 0 || Main.tile[i, j].frameY != num2 + (j - num3) * 18 || Main.tile[i, j].frameX != (i - num4) * 18)
35870 {
35871 flag = true;
35872 break;
35873 }
35874 }
35875 }
35876 if (!flag)
35877 {
35878 return;
35879 }
35880 destroyObject = true;
35881 for (int k = num4; k < num4 + 3; k++)
35882 {
35883 for (int l = num3; l < num3 + 2; l++)
35884 {
35885 if (Main.tile[k, l].type == type && Main.tile[k, l].active())
35886 {
35887 KillTile(k, l);
35888 }
35889 }
35890 }
35891 if (type == 246)
35892 {
35893 switch (num)
35894 {
35895 case 16:
35896 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 1541);
35897 break;
35898 case 17:
35899 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 1542);
35900 break;
35901 case 18:
35902 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 1908);
35903 break;
35904 case 19:
35905 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 4661);
35906 break;
35907 case 20:
35908 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 4729);
35909 break;
35910 case 21:
35911 case 22:
35912 case 23:
35913 case 24:
35914 case 25:
35915 case 26:
35916 case 27:
35917 case 28:
35918 case 29:
35919 case 30:
35920 case 31:
35921 case 32:
35922 case 33:
35923 case 34:
35924 case 35:
35925 case 36:
35926 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 5258 + num - 21);
35927 break;
35928 default:
35929 Item.NewItem(GetItemSource_FromTileBreak(x, y), x * 16, y * 16, 32, 32, 1479 + num);
35930 break;
35931 }
35932 }
35933 destroyObject = false;
35934 }
static bool destroyObject
Definition WorldGen.cs:1020
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static IEntitySource GetItemSource_FromTileBreak(int x, int y)

References Terraria.Item.NewItem(), Terraria.Main.tile, and System.type.