36410 {
36411 if (Main.tile[x, y] == null)
36412 {
36413 Main.tile[x, y] =
new Tile();
36414 }
36415 if (Main.tile[x, y + 1] == null)
36416 {
36417 Main.tile[x, y + 1] =
new Tile();
36418 }
36419 if (!Main.tile[x, y].active() && Main.tile[x, y + 1].nactive() && !Main.tile[x, y + 1].halfBrick() && Main.tile[x, y + 1].slope() == 0)
36420 {
36421 bool flag = false;
36422 switch (style)
36423 {
36424 case 0:
36425 if (Main.tile[x, y + 1].type != 2 && Main.tile[x, y + 1].type != 477 && Main.tile[x, y + 1].type != 492 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380 && Main.tile[x, y + 1].type != 109)
36426 {
36427 flag = true;
36428 }
36429 if (Main.tile[x, y].liquid > 0)
36430 {
36431 flag = true;
36432 }
36433 break;
36434 case 1:
36435 if (Main.tile[x, y + 1].type != 60 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36436 {
36437 flag = true;
36438 }
36439 if (Main.tile[x, y].liquid > 0)
36440 {
36441 flag = true;
36442 }
36443 break;
36444 case 2:
36445 if (Main.tile[x, y + 1].type != 0 && Main.tile[x, y + 1].type != 59 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36446 {
36447 flag = true;
36448 }
36449 if (Main.tile[x, y].liquid > 0)
36450 {
36451 flag = true;
36452 }
36453 break;
36454 case 3:
36455 if (Main.tile[x, y + 1].type != 661 && Main.tile[x, y + 1].type != 662 && Main.tile[x, y + 1].type != 203 && Main.tile[x, y + 1].type != 199 && Main.tile[x, y + 1].type != 23 && Main.tile[x, y + 1].type != 25 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36456 {
36457 flag = true;
36458 }
36459 if (Main.tile[x, y].liquid > 0)
36460 {
36461 flag = true;
36462 }
36463 break;
36464 case 4:
36465 if (Main.tile[x, y + 1].type != 53 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380 && Main.tile[x, y + 1].type != 116)
36466 {
36467 flag = true;
36468 }
36469 if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
36470 {
36471 flag = true;
36472 }
36473 break;
36474 case 5:
36475 if (Main.tile[x, y + 1].type != 57 && Main.tile[x, y + 1].type != 633 && Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380)
36476 {
36477 flag = true;
36478 }
36479 if (Main.tile[x, y].liquid > 0 && !Main.tile[x, y].lava())
36480 {
36481 flag = true;
36482 }
36483 break;
36484 case 6:
36485 if (Main.tile[x, y + 1].type != 78 && Main.tile[x, y + 1].type != 380 && Main.tile[x, y + 1].type != 147 && Main.tile[x, y + 1].type != 161 && Main.tile[x, y + 1].type != 163 && Main.tile[x, y + 1].type != 164 && Main.tile[x, y + 1].type != 200)
36486 {
36487 flag = true;
36488 }
36489 if (Main.tile[x, y].liquid > 0 && Main.tile[x, y].lava())
36490 {
36491 flag = true;
36492 }
36493 break;
36494 }
36495 if (!flag)
36496 {
36497 Main.tile[x, y].active(active:
true);
36498 Main.tile[x, y].type = 82;
36499 Main.tile[x, y].frameX = (
short)(18 * style);
36500 Main.tile[x, y].frameY = 0;
36501 return true;
36502 }
36503 }
36504 return false;
36505 }