74210 {
74211 x = Utils.Clamp(x, 1, Main.maxTilesX - 2);
74212 y = Utils.Clamp(y, 1, Main.maxTilesY - 2);
74213 for (int i = x - 1; i <= x + 1; i++)
74214 {
74215 for (
int j = y - 1;
j <= y + 1;
j++)
74216 {
74217 if (Main.tile[i,
j] ==
null)
74218 {
74219 return;
74220 }
74221 }
74222 }
74224 Tile tile = Main.tile[x, y];
74225 int num2 = tile.type;
74226 _ = Main.maxTilesX;
74227 if (y + 1 >= Main.maxTilesY)
74228 {
74230 }
74231 if (x - 1 >= 0 && Main.tile[x - 1, y] != null)
74232 {
74233 tile = Main.tile[x - 1, y];
74234 if (tile.nactive())
74235 {
74236 tile = Main.tile[x - 1, y];
74238 }
74239 }
74240 if (x + 1 < Main.maxTilesX && Main.tile[x + 1, y] != null)
74241 {
74242 tile = Main.tile[x + 1, y];
74243 if (tile.nactive())
74244 {
74245 tile = Main.tile[x + 1, y];
74247 }
74248 }
74249 if (y - 1 >= 0 && Main.tile[x, y - 1] != null)
74250 {
74251 tile = Main.tile[x, y - 1];
74252 if (tile.nactive())
74253 {
74254 tile = Main.tile[x, y - 1];
74256 }
74257 }
74258 if (y + 1 < Main.maxTilesY && Main.tile[x, y + 1] != null)
74259 {
74260 tile = Main.tile[x, y + 1];
74261 if (tile.nactive())
74262 {
74263 tile = Main.tile[x, y + 1];
74264 if (!tile.halfBrick())
74265 {
74266 tile = Main.tile[x, y + 1];
74267 if (tile.slope() == 0)
74268 {
74269 tile = Main.tile[x, y + 1];
74271 }
74272 }
74273 }
74274 }
74275 if (x - 1 >= 0 && y - 1 >= 0 && Main.tile[x - 1, y - 1] != null)
74276 {
74277 tile = Main.tile[x - 1, y - 1];
74278 if (tile.nactive())
74279 {
74280 tile = Main.tile[x - 1, y - 1];
74282 }
74283 }
74284 if (x + 1 < Main.maxTilesX && y - 1 >= 0 && Main.tile[x + 1, y - 1] != null)
74285 {
74286 tile = Main.tile[x + 1, y - 1];
74287 if (tile.nactive())
74288 {
74289 tile = Main.tile[x + 1, y - 1];
74291 }
74292 }
74293 if (x - 1 >= 0 && y + 1 < Main.maxTilesY && Main.tile[x - 1, y + 1] != null)
74294 {
74295 tile = Main.tile[x - 1, y + 1];
74296 if (tile.nactive())
74297 {
74298 tile = Main.tile[x - 1, y + 1];
74300 }
74301 }
74302 if (x + 1 < Main.maxTilesX && y + 1 < Main.maxTilesY && Main.tile[x + 1, y + 1] != null)
74303 {
74304 tile = Main.tile[x + 1, y + 1];
74305 if (tile.nactive())
74306 {
74307 tile = Main.tile[x + 1, y + 1];
74309 }
74310 }
74312 {
74313 return;
74314 }
74317 {
74318 tile = Main.tile[x, y];
74319 flag = tile.frameX == 144;
74320 }
74322 {
74323 tile = Main.tile[x, y];
74324 flag = tile.frameX == 270;
74325 }
74327 {
74328 tile = Main.tile[x, y];
74329 if (tile.frameX >= 162)
74330 {
74331 tile = Main.tile[x, y];
74332 tile.frameX = 126;
74333 }
74334 }
74336 {
74337 tile = Main.tile[x, y];
74338 if (tile.frameX >= 162)
74339 {
74340 tile = Main.tile[x, y];
74341 tile.frameX = 126;
74342 }
74343 }
74345 {
74346 case 23:
74347 case 661:
74349 tile = Main.tile[x, y];
74350 if (tile.frameX >= 162)
74351 {
74352 tile = Main.tile[x, y];
74353 tile.frameX = 126;
74354 }
74355 break;
74356 case 2:
74357 case 477:
74359 break;
74360 case 109:
74361 case 492:
74362 num2 = ((
num2 != 73) ? 110 : 113);
74363 break;
74364 case 199:
74365 case 662:
74367 break;
74368 case 60:
74370 while (true)
74371 {
74372 tile = Main.tile[x, y];
74373 if (tile.frameX > 126)
74374 {
74375 tile = Main.tile[x, y];
74376 tile.frameX -= 126;
74377 continue;
74378 }
74379 break;
74380 }
74381 break;
74382 case 70:
74384 while (true)
74385 {
74386 tile = Main.tile[x, y];
74387 if (tile.frameX <= 72)
74388 {
74389 break;
74390 }
74391 tile = Main.tile[x, y];
74392 tile.frameX -= 72;
74393 }
74394 break;
74395 }
74397 tile = Main.tile[x, y];
74398 if (
num3 != tile.type)
74399 {
74400 tile = Main.tile[x, y];
74401 tile.type = (ushort)
num2;
74403 {
74404 tile = Main.tile[x, y];
74405 tile.frameX = 144;
74407 {
74408 tile = Main.tile[x, y];
74409 tile.frameX = 270;
74410 }
74411 }
74412 }
74413 else
74414 {
74416 }
74417 }
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)