64244 {
64246 {
64247 return;
64248 }
64250 {
64251 int type = Main.tile[
i,
j].type;
64252 int num = -1;
64259 {
64260 case 23:
64261 num = 0;
64268 {
64269 return;
64270 }
64271 break;
64272 case 199:
64273 num = 0;
64280 {
64281 return;
64282 }
64283 break;
64284 case 661:
64285 num = 59;
64292 {
64293 return;
64294 }
64295 break;
64296 case 662:
64297 num = 59;
64304 {
64305 return;
64306 }
64307 break;
64308 case 60:
64309 num = 59;
64312 break;
64313 case 70:
64314 num = 59;
64317 break;
64318 case 633:
64319 num = 57;
64322 break;
64323 }
64324 bool flag = false;
64326 {
64327 flag = true;
64329 {
64330 Main.tile[
i,
minJ].CopyPaintAndCoating(Main.tile[i,
j]);
64331 }
64332 if (Main.netMode == 2 && Main.tile[i,
minJ].active())
64333 {
64334 NetMessage.SendTileSquare(-1, i,
minJ);
64335 }
64336 }
64337 if (num != -1)
64338 {
64339 bool flag2 =
false;
64340 TileColorCache color = Main.tile[
i,
j].BlockColorAndCoating();
64342 {
64344 {
64345 if (!
InWorld(
k,
l, 10) || (i ==
k &&
j ==
l) || !Main.tile[
k,
l].active())
64346 {
64347 continue;
64348 }
64349 if (Main.tile[
k,
l].type == num)
64350 {
64352 if (Main.tile[
k,
l].type ==
num4)
64353 {
64356 }
64357 }
64358 else if (
num2 > -1 &&
num5 > -1 && Main.tile[
k,
l].type ==
num2)
64359 {
64361 if (Main.tile[
k,
l].type ==
num5)
64362 {
64365 }
64366 }
64367 }
64368 }
64369 if (Main.netMode == 2 &&
flag2)
64370 {
64371 NetMessage.SendTileSquare(-1, i,
j, 3);
64372 }
64373 }
64375 {
64376 case 60:
64377 {
64378 if (flag ||
genRand.Next(25) != 0 || Main.tile[i,
minJ].liquid != 0)
64379 {
64380 break;
64381 }
64382 if (Main.hardMode &&
NPC.downedMechBoss1 &&
NPC.downedMechBoss2 &&
NPC.downedMechBoss3 &&
genRand.Next(60) == 0)
64383 {
64387 {
64389 {
64391 {
64393 break;
64394 }
64395 }
64396 }
64398 {
64403 if (Main.tile[i,
minJ].type == 238 && Main.netMode == 2)
64404 {
64405 NetMessage.SendTileSquare(-1, i,
minJ, 5);
64406 }
64407 }
64408 }
64409 int maxValue2 = (Main.expertMode ? 30 : 40);
64411 {
64414 if (Main.expertMode)
64415 {
64417 }
64419 {
64421 {
64423 {
64425 break;
64426 }
64427 }
64428 }
64430 {
64434 if (Main.tile[i,
minJ].type == 236 && Main.netMode == 2)
64435 {
64436 NetMessage.SendTileSquare(-1, i,
minJ, 4);
64437 }
64438 }
64439 break;
64440 }
64442 if (Main.tile[i,
minJ].type != 233)
64443 {
64444 break;
64445 }
64446 if (Main.netMode == 2)
64447 {
64448 NetMessage.SendTileSquare(-1, i,
minJ, 4);
64449 break;
64450 }
64452 if (Main.tile[i,
minJ].type == 233 && Main.netMode == 2)
64453 {
64454 NetMessage.SendTileSquare(-1, i,
minJ, 3);
64455 }
64456 break;
64457 }
64458 case 70:
64459 if (Main.tile[i,
j - 1].liquid > 0)
64460 {
64462 }
64464 {
64466 }
64467 break;
64468 }
64469 return;
64470 }
64471 int num10 = Main.tile[
i,
j].type;
64473 {
64474 case 2:
64475 case 23:
64476 case 32:
64477 case 109:
64478 case 199:
64479 case 352:
64480 case 477:
64481 case 492:
64482 case 661:
64483 case 662:
64484 {
64486 {
64490 {
64492 {
64494 {
64496 }
64497 }
64498 }
64500 {
64502 if (Main.netMode == 2 && Main.tile[i,
minJ].type == 254)
64503 {
64504 NetMessage.SendTileSquare(-1, i - 1,
minJ - 1, 2, 2);
64505 }
64506 }
64507 }
64508 if (!Main.tile[i,
minJ].active() && Main.tile[i,
minJ].liquid == 0)
64509 {
64512 {
64514 }
64516 {
64518 }
64520 {
64522 }
64524 {
64526 }
64528 {
64530 }
64532 {
64534 }
64536 {
64538 }
64540 {
64541 Main.tile[
i,
minJ].CopyPaintAndCoating(Main.tile[i,
j]);
64542 if (Main.netMode == 2)
64543 {
64544 NetMessage.SendTileSquare(-1, i,
minJ);
64545 }
64546 }
64547 }
64548 bool flag6 =
false;
64550 {
64551 case 32:
64554 {
64555 return;
64556 }
64557 break;
64558 case 352:
64561 {
64562 return;
64563 }
64564 break;
64565 case 477:
64567 break;
64568 case 492:
64570 break;
64571 }
64575 {
64578 }
64580 {
64583 }
64586 {
64588 {
64590 {
64591 continue;
64592 }
64595 {
64596 continue;
64597 }
64598 TileColorCache
color3 = Main.tile[
i,
j].BlockColorAndCoating();
64600 {
64603 {
64605 }
64607 {
64613 {
64615 }
64616 }
64618 {
64621 }
64622 }
64624 {
64627 {
64629 }
64631 {
64632 case 492:
64634 break;
64635 case 109:
64637 break;
64638 }
64640 {
64642 }
64644 {
64646 }
64648 {
64651 }
64652 }
64653 }
64654 }
64655 if (Main.netMode == 2 &&
flag6)
64656 {
64657 NetMessage.SendTileSquare(-1, i,
j, 3);
64658 }
64659 break;
64660 }
64661 case 70:
64662 {
64663 if (!Main.tile[i,
j].inActive())
64664 {
64665 if (!Main.tile[i,
minJ].active() &&
genRand.Next(10) == 0)
64666 {
64668 if (Main.tile[i,
minJ].active())
64669 {
64670 Main.tile[
i,
minJ].CopyPaintAndCoating(Main.tile[i,
j]);
64671 }
64672 if (Main.netMode == 2 && Main.tile[i,
minJ].active())
64673 {
64674 NetMessage.SendTileSquare(-1, i,
minJ);
64675 }
64676 }
64678 {
64681 {
64683 }
64684 }
64685 }
64686 bool flag9 =
false;
64687 TileColorCache
color4 = Main.tile[
i,
j].BlockColorAndCoating();
64689 {
64691 {
64693 {
64696 {
64699 }
64700 }
64701 }
64702 }
64703 if (Main.netMode == 2 &&
flag9)
64704 {
64705 NetMessage.SendTileSquare(-1, i,
j, 3);
64706 }
64707 break;
64708 }
64709 case 60:
64710 {
64711 if (!Main.tile[i,
minJ].active() &&
genRand.Next(7) == 0)
64712 {
64714 if (Main.tile[i,
minJ].active())
64715 {
64716 Main.tile[
i,
minJ].CopyPaintAndCoating(Main.tile[i,
j]);
64717 }
64718 if (Main.netMode == 2 && Main.tile[i,
minJ].active())
64719 {
64720 NetMessage.SendTileSquare(-1, i,
minJ);
64721 }
64722 }
64723 else if (
genRand.Next(500) == 0 && (!Main.tile[i,
minJ].active() || Main.tile[i,
minJ].type == 61 || Main.tile[i,
minJ].type == 74 || Main.tile[i,
minJ].type == 69))
64724 {
64726 {
64728 }
64729 }
64730 else if (
genRand.Next(25) == 0 && Main.tile[i,
minJ].liquid == 0)
64731 {
64733 if (Main.tile[i,
minJ].type == 233)
64734 {
64735 if (Main.netMode == 2)
64736 {
64737 NetMessage.SendTileSquare(-1, i,
minJ, 4);
64738 }
64739 else
64740 {
64742 if (Main.tile[i,
minJ].type == 233 && Main.netMode == 2)
64743 {
64744 NetMessage.SendTileSquare(-1, i,
minJ, 3);
64745 }
64746 }
64747 }
64748 }
64750 TileColorCache
color5 = Main.tile[
i,
j].BlockColorAndCoating();
64752 {
64754 {
64756 {
64759 {
64762 }
64763 }
64764 }
64765 }
64766 if (Main.netMode == 2 &&
flag10)
64767 {
64768 NetMessage.SendTileSquare(-1, i,
j, 3);
64769 }
64770 break;
64771 }
64772 case 633:
64773 {
64774 if (!Main.tile[i,
minJ].active() &&
genRand.Next(10) == 0)
64775 {
64777 if (Main.tile[i,
minJ].active())
64778 {
64779 Main.tile[
i,
minJ].CopyPaintAndCoating(Main.tile[i,
j]);
64780 }
64781 if (Main.netMode == 2 && Main.tile[i,
minJ].active())
64782 {
64783 NetMessage.SendTileSquare(-1, i,
minJ);
64784 }
64785 }
64786 TileColorCache
color2 = Main.tile[
i,
j].BlockColorAndCoating();
64787 bool flag5 =
false;
64789 {
64791 {
64793 {
64796 {
64799 }
64800 }
64801 }
64802 }
64803 if (Main.netMode == 2 &&
flag5)
64804 {
64805 NetMessage.SendTileSquare(-1, i,
j, 3);
64806 }
64807 break;
64808 }
64809 }
64810 }
static bool AllowedToSpreadInfections
static bool PlaceTile(int i, int j, int Type, bool mute=false, bool forced=false, int plr=-1, int style=0)
static UnifiedRandom genRand
static Point PlaceCatTail(int x, int j)
static void TreeGrowFXCheck(int x, int y)
static bool PlayerLOS(int x, int y)
static void PlaceJunglePlant(int X2, int Y2, ushort type, int styleX, int styleY)
static void PlacePumpkin(int x, int superY)
static bool GrowTree(int i, int y)
static void SpreadGrass(int i, int j, int dirt=0, int grass=2, bool repeat=true, TileColorCache color=default(TileColorCache))
static bool InWorld(int x, int y, int fluff=0)
static void SquareTileFrame(int i, int j, bool resetFrame=true)