53134 {
53135 if (Main.netMode == 1)
53136 {
53137 return;
53138 }
53141 while (true)
53142 {
53143 tile = Main.tile[x,
num];
53144 if (tile.liquid <= 0 ||
num <= 50)
53145 {
53146 break;
53147 }
53149 }
53152 while (true)
53153 {
53154 tile = Main.tile[x, i];
53155 if (tile.active())
53156 {
53157 bool[] tileSolid = Main.tileSolid;
53158 tile = Main.tile[x, i];
53159 if (tileSolid[tile.type])
53160 {
53161 bool[] tileSolidTop = Main.tileSolidTop;
53162 tile = Main.tile[x, i];
53163 if (!tileSolidTop[tile.type])
53164 {
53165 break;
53166 }
53167 }
53168 }
53169 if (i >= Main.maxTilesY - 50)
53170 {
53171 break;
53172 }
53173 i++;
53174 }
53176 while (true)
53177 {
53178 tile = Main.tile[x,
num];
53179 if (!tile.active())
53180 {
53181 break;
53182 }
53183 tile = Main.tile[x,
num];
53184 if (tile.type != 519)
53185 {
53186 break;
53187 }
53189 }
53191 tile = Main.tile[x,
num];
53192 if (tile.frameX == 90)
53193 {
53194 tile = Main.tile[x,
num - 1];
53195 if (tile.active())
53196 {
53197 bool[] tileCut = Main.tileCut;
53198 tile = Main.tile[x,
num - 1];
53199 if (tileCut[tile.type])
53200 {
53202 if (Main.netMode == 2)
53203 {
53204 NetMessage.SendData(17, -1, -1,
null, 0, x,
num - 1);
53205 }
53206 }
53207 }
53208 }
53209 tile = Main.tile[x,
num - 1];
53210 if (tile.active())
53211 {
53212 return;
53213 }
53214 tile = Main.tile[x,
num];
53215 if (tile.frameX == 0)
53216 {
53217 tile = Main.tile[x,
num];
53218 tile.frameX = 18;
53220 if (Main.netMode == 2)
53221 {
53222 NetMessage.SendTileSquare(-1, x,
num);
53223 }
53224 }
53225 else
53226 {
53227 tile = Main.tile[x,
num];
53228 if (tile.frameX == 18)
53229 {
53230 tile = Main.tile[x,
num];
53231 tile.frameX = (short)(18 *
genRand.Next(2, 5));
53232 tile = Main.tile[x,
num - 1];
53233 tile.active(active:
true);
53234 tile = Main.tile[x,
num - 1];
53235 tile.type = 519;
53236 tile = Main.tile[x,
num - 1];
53237 tile.frameX = 90;
53238 tile = Main.tile[x,
num - 1];
53239 ref short frameY =
ref tile.frameY;
53240 tile = Main.tile[x,
num];
53241 frameY = tile.frameY;
53242 tile = Main.tile[x,
num - 1];
53243 tile.halfBrick(halfBrick:
false);
53244 tile = Main.tile[x,
num - 1];
53245 tile.slope(0);
53246 tile = Main.tile[x,
num - 1];
53247 tile.CopyPaintAndCoating(Main.tile[x,
num]);
53249 if (Main.netMode == 2)
53250 {
53251 NetMessage.SendTileSquare(-1, x,
num);
53252 }
53253 }
53254 else
53255 {
53256 tile = Main.tile[x,
num];
53257 if (tile.frameX == 90)
53258 {
53259 tile = Main.tile[x,
num - 1];
53260 if (tile.liquid == 0)
53261 {
53262 tile = Main.tile[x,
num - 2];
53263 if (!tile.active())
53264 {
53265 tile = Main.tile[x,
num];
53266 if (tile.liquid <= 0)
53267 {
53268 tile = Main.tile[x,
num + 1];
53269 if (tile.liquid <= 0)
53270 {
53271 tile = Main.tile[x,
num + 2];
53272 if (tile.liquid <= 0)
53273 {
53275 }
53276 }
53277 }
53279 {
53280 tile = Main.tile[x,
num];
53281 tile.frameX = 108;
53282 tile = Main.tile[x,
num - 1];
53283 tile.active(active:
true);
53284 tile = Main.tile[x,
num - 1];
53285 tile.type = 519;
53286 tile = Main.tile[x,
num - 1];
53287 tile.frameX = 90;
53288 tile = Main.tile[x,
num - 1];
53290 tile = Main.tile[x,
num];
53292 tile = Main.tile[x,
num - 1];
53293 tile.halfBrick(halfBrick:
false);
53294 tile = Main.tile[x,
num - 1];
53295 tile.slope(0);
53296 tile = Main.tile[x,
num - 1];
53297 tile.CopyPaintAndCoating(Main.tile[x,
num]);
53300 }
53301 }
53303 }
53304 tile = Main.tile[x,
num];
53305 tile.frameX = 108;
53306 tile = Main.tile[x,
num - 1];
53307 tile.active(active:
true);
53308 tile = Main.tile[x,
num - 1];
53309 tile.type = 519;
53310 tile = Main.tile[x,
num - 1];
53311 tile.frameX = 90;
53312 tile = Main.tile[x,
num - 1];
53314 tile = Main.tile[x,
num];
53316 tile = Main.tile[x,
num - 1];
53317 tile.halfBrick(halfBrick:
false);
53318 tile = Main.tile[x,
num - 1];
53319 tile.slope(0);
53320 tile = Main.tile[x,
num - 1];
53321 tile.CopyPaintAndCoating(Main.tile[x,
num]);
53323 }
53324 }
53325 }
53329 if (Main.netMode == 2)
53330 {
53331 NetMessage.SendTileSquare(-1, x,
num - 1, 1, 2);
53332 }
53333 return;
53336 tile = Main.tile[x,
num];
53337 tile.frameX = (short)(126 +
num2 * 18);
53338 tile = Main.tile[x,
num - 1];
53339 tile.active(active:
true);
53340 tile = Main.tile[x,
num - 1];
53341 tile.type = 519;
53342 tile = Main.tile[x,
num - 1];
53343 tile.frameX = (short)(180 +
num2 * 18);
53344 tile = Main.tile[x,
num - 1];
53346 tile = Main.tile[x,
num];
53348 tile = Main.tile[x,
num - 1];
53349 tile.halfBrick(halfBrick:
false);
53350 tile = Main.tile[x,
num - 1];
53351 tile.slope(0);
53352 tile = Main.tile[x,
num - 1];
53353 tile.CopyPaintAndCoating(Main.tile[x,
num]);
53356 }
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static UnifiedRandom genRand
static void SquareTileFrame(int i, int j, bool resetFrame=true)