50018 {
50021 {
50022 return false;
50023 }
50024 if (Main.tile[x, num].active() || Main.tile[x, num].liquid == 0 || Main.tile[x, num].liquidType() != 0)
50025 {
50026 return false;
50027 }
50028 while (Main.tile[x, num].liquid > 0 && num > 50)
50029 {
50030 num--;
50031 }
50032 num++;
50033 if (Main.tile[x, num].active() || Main.tile[x, num - 1].active() || Main.tile[x, num].liquid == 0 || Main.tile[x, num].liquidType() != 0)
50034 {
50035 return false;
50036 }
50037 if (Main.tile[x, num].wall != 0 && Main.tile[x, num].wall != 15 && Main.tile[x, num].wall != 70 && (Main.tile[x, num].wall < 63 || Main.tile[x, num].wall > 68))
50038 {
50039 return false;
50040 }
50044 {
50046 {
50047 if (Main.tile[i,
k].active() && Main.tile[i,
k].type == 518)
50048 {
50050 }
50051 }
50052 }
50054 {
50055 return false;
50056 }
50058 for (
l = num; (!Main.tile[x,
l].active() || !Main.tileSolid[Main.tile[x,
l].type] || Main.tileSolidTop[Main.tile[x,
l].type]) &&
l < Main.maxTilesY - 50;
l++)
50059 {
50060 if (Main.tile[x,
l].active() && Main.tile[x,
l].type == 519)
50061 {
50062 return false;
50063 }
50064 }
50066 if (
l - num >
num4)
50067 {
50068 return false;
50069 }
50071 {
50072 return false;
50073 }
50074 int type = Main.tile[x,
l].type;
50077 {
50079 }
50081 {
50083 }
50085 {
50087 }
50089 {
50090 return false;
50091 }
50092 Main.tile[x, num].active(active:
true);
50093 Main.tile[x, num].type = 518;
50095 {
50096 Main.tile[x, num].frameX = (
short)(18 *
genRand.Next(3));
50097 }
50098 else if (
genRand.Next(15) == 0)
50099 {
50100 Main.tile[x, num].frameX = (
short)(18 *
genRand.Next(18));
50101 }
50102 else
50103 {
50104 int num6 = Main.maxTilesX / 5;
50106 {
50107 Main.tile[x, num].frameX = (
short)(18 *
genRand.Next(6, 9));
50108 }
50109 else if (x <
num6 * 2)
50110 {
50111 Main.tile[x, num].frameX = (
short)(18 *
genRand.Next(9, 12));
50112 }
50113 else if (x <
num6 * 3)
50114 {
50115 Main.tile[x, num].frameX = (
short)(18 *
genRand.Next(3, 6));
50116 }
50117 else if (x <
num6 * 4)
50118 {
50119 Main.tile[x, num].frameX = (
short)(18 *
genRand.Next(15, 18));
50120 }
50121 else
50122 {
50123 Main.tile[x, num].frameX = (
short)(18 *
genRand.Next(12, 15));
50124 }
50125 }
50126 Main.tile[x, num].frameY = (
short)
num5;
50127 Main.tile[x, num].halfBrick(halfBrick:
false);
50128 Main.tile[x, num].slope(0);
50130 return true;
50131 }
static UnifiedRandom genRand
static void SquareTileFrame(int i, int j, bool resetFrame=true)