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

◆ Check3x6()

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

Definition at line 45129 of file WorldGen.cs.

45130 {
45131 if (destroyObject)
45132 {
45133 return;
45134 }
45135 bool flag = false;
45136 int num = i;
45137 int num2 = j;
45138 num = Main.tile[i, j].frameX / 18;
45139 int num3 = 0;
45140 while (num >= 3)
45141 {
45142 num3++;
45143 num -= 3;
45144 }
45145 int num4 = i - num;
45146 int num5 = 54 * num3;
45147 int num6 = Main.tile[i, j].frameY % 96 / 18;
45148 if (num >= 4)
45149 {
45150 num -= 3;
45151 }
45152 num = i - num;
45153 num2 -= num6;
45154 for (int k = num; k < num + 3; k++)
45155 {
45156 for (int l = num2; l < num2 + 6; l++)
45157 {
45158 if (Main.tile[k, l] == null)
45159 {
45160 Main.tile[k, l] = new Tile();
45161 }
45162 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)
45163 {
45164 flag = true;
45165 }
45166 }
45167 }
45168 for (int m = num; m < num + 3; m++)
45169 {
45170 if (Main.tile[m, num2 + 6] == null)
45171 {
45172 Main.tile[m, num2 + 6] = new Tile();
45173 }
45174 if (!SolidTileAllowBottomSlope(m, num2 + 6))
45175 {
45176 flag = true;
45177 break;
45178 }
45179 }
45180 if (!flag)
45181 {
45182 return;
45183 }
45184 destroyObject = true;
45185 for (int n = num; n < num + 3; n++)
45186 {
45187 for (int num7 = num2; num7 < num2 + 6; num7++)
45188 {
45189 if (Main.tile[n, num7].type == type && Main.tile[n, num7].active())
45190 {
45191 KillTile(n, num7);
45192 }
45193 }
45194 }
45195 if (type == 548)
45196 {
45197 if (num3 >= 7)
45198 {
45199 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4902 + num3 - 7);
45200 }
45201 else
45202 {
45203 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4435 + num3);
45204 }
45205 }
45206 if (type == 614)
45207 {
45208 Item.NewItem(GetItemSource_FromTileBreak(i, j), i * 16, j * 16, 32, 32, 4906);
45209 }
45210 destroyObject = false;
45211 for (int num8 = num - 1; num8 < num + 4; num8++)
45212 {
45213 for (int num9 = num2 - 1; num9 < num2 + 7; num9++)
45214 {
45216 }
45217 }
45218 }
static bool destroyObject
Definition WorldGen.cs:1020
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.Item.NewItem(), Terraria.DataStructures.Tile, Terraria.Main.tile, and System.type.