Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ UpdateWorld_UndergroundTile()

static void Terraria.WorldGen.UpdateWorld_UndergroundTile ( int i,
int j,
bool checkNPCSpawns,
int wallDist )
inlinestaticprivate

Definition at line 63262 of file WorldGen.cs.

63263 {
63264 int num = i - 1;
63265 int num2 = i + 2;
63266 int num3 = j - 1;
63267 int num4 = j + 2;
63268 if (num < 10)
63269 {
63270 num = 10;
63271 }
63272 if (num2 > Main.maxTilesX - 10)
63273 {
63274 num2 = Main.maxTilesX - 10;
63275 }
63276 if (num3 < 10)
63277 {
63278 num3 = 10;
63279 }
63280 if (num4 > Main.maxTilesY - 10)
63281 {
63282 num4 = Main.maxTilesY - 10;
63283 }
63284 if (Main.tile[i, j] == null)
63285 {
63286 return;
63287 }
63288 if (Main.tile[i, j].type == 655 && !NPC.AnyNPCs(262))
63289 {
63290 KillTile(i, j);
63291 if (Main.netMode == 2)
63292 {
63293 NetMessage.SendData(17, -1, -1, null, 0, i, j);
63294 }
63295 }
63296 if (Main.tileAlch[Main.tile[i, j].type])
63297 {
63298 GrowAlch(i, j);
63299 }
63300 else if (Main.tile[i, j].nactive())
63301 {
63302 hardUpdateWorld(i, j);
63303 if (Main.rand.Next(2500) == 0)
63304 {
63305 plantDye(i, j);
63306 }
63307 else if (Main.hardMode && Main.rand.Next(10000) == 0)
63308 {
63309 plantDye(i, j, exoticPlant: true);
63310 }
63311 if (Main.tile[i, j].type == 519)
63312 {
63313 CheckCatTail(i, j);
63314 if (Main.tile[i, j].active() && genRand.Next(2) == 0)
63315 {
63316 GrowCatTail(i, j);
63317 CheckCatTail(i, j);
63318 }
63319 }
63320 if (Main.tile[i, j].type == 549)
63321 {
63322 GrowCheckSeaweed(i, j);
63323 }
63324 else if (Main.tile[i, j].type == 53 && !Main.tile[i, j].topSlope() && !Main.tile[i, j].halfBrick() && !Main.tile[i, j - 1].active() && genRand.Next(20) == 0)
63325 {
63326 GrowCheckSeaweed(i, j);
63327 }
63328 else if (TileID.Sets.SpreadUnderground[Main.tile[i, j].type])
63329 {
63331 int type = Main.tile[i, j].type;
63332 if ((type == 32 || type == 352) && genRand.Next(3) == 0)
63333 {
63334 if (type == 32)
63335 {
63336 GrowSpike(i, j, 32, 23);
63337 }
63338 else
63339 {
63340 GrowSpike(i, j, 352, 199);
63341 }
63342 }
63343 }
63344 else if (Main.tile[i, j].type == 61 && genRand.Next(3) == 0)
63345 {
63346 if (Main.tile[i, j].frameX < 144)
63347 {
63348 if (Main.rand.Next(4) == 0)
63349 {
63350 Main.tile[i, j].frameX = (short)(162 + genRand.Next(8) * 18);
63351 }
63352 Main.tile[i, j].type = 74;
63353 if (Main.netMode == 2)
63354 {
63355 NetMessage.SendTileSquare(-1, i, j);
63356 }
63357 }
63358 }
63359 else if ((Main.tile[i, j].type == 60 || Main.tile[i, j].type == 62) && genRand.Next(5) == 0 && GrowMoreVines(i, j))
63360 {
63361 if (!Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava())
63362 {
63363 bool flag = false;
63364 for (int num5 = j; num5 > j - 10; num5--)
63365 {
63366 if (Main.tile[i, num5].bottomSlope())
63367 {
63368 flag = false;
63369 break;
63370 }
63371 if (Main.tile[i, num5].active() && Main.tile[i, num5].type == 60 && !Main.tile[i, num5].bottomSlope())
63372 {
63373 flag = true;
63374 break;
63375 }
63376 }
63377 if (flag)
63378 {
63379 int num6 = j + 1;
63380 Main.tile[i, num6].type = 62;
63381 Main.tile[i, num6].active(active: true);
63383 Main.tile[i, num6].CopyPaintAndCoating(Main.tile[i, num6 - 1]);
63384 if (Main.netMode == 2)
63385 {
63386 NetMessage.SendTileSquare(-1, i, num6);
63387 }
63388 }
63389 }
63390 }
63391 else if ((Main.tile[i, j].type == 633 || Main.tile[i, j].type == 638) && GrowMoreVines(i, j))
63392 {
63393 if (!Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava())
63394 {
63395 int maxValue = 70;
63396 if (Main.tile[i, j].type == 638)
63397 {
63398 maxValue = 7;
63399 }
63400 if (genRand.Next(maxValue) == 0)
63401 {
63402 bool flag2 = false;
63403 for (int num7 = j; num7 > j - 10; num7--)
63404 {
63405 if (Main.tile[i, num7].bottomSlope())
63406 {
63407 flag2 = false;
63408 break;
63409 }
63410 if (Main.tile[i, num7].active() && Main.tile[i, num7].type == 633 && !Main.tile[i, num7].bottomSlope())
63411 {
63412 flag2 = true;
63413 break;
63414 }
63415 }
63416 if (flag2)
63417 {
63418 int num8 = j + 1;
63419 Main.tile[i, num8].type = 638;
63420 Main.tile[i, num8].active(active: true);
63421 Main.tile[i, num8].CopyPaintAndCoating(Main.tile[i, num8 - 1]);
63423 if (Main.netMode == 2)
63424 {
63425 NetMessage.SendTileSquare(-1, i, num8);
63426 }
63427 }
63428 }
63429 }
63430 }
63431 else if ((Main.tile[i, j].type == 70 || Main.tile[i, j].type == 528) && GrowMoreVines(i, j))
63432 {
63433 if (!Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava())
63434 {
63435 int maxValue2 = 70;
63436 if (Main.tile[i, j].type == 528)
63437 {
63438 maxValue2 = 7;
63439 }
63440 if (genRand.Next(maxValue2) == 0)
63441 {
63442 bool flag3 = false;
63443 for (int num9 = j; num9 > j - 10; num9--)
63444 {
63445 if (Main.tile[i, num9].bottomSlope())
63446 {
63447 flag3 = false;
63448 break;
63449 }
63450 if (Main.tile[i, num9].active() && Main.tile[i, num9].type == 70 && !Main.tile[i, num9].bottomSlope())
63451 {
63452 flag3 = true;
63453 break;
63454 }
63455 }
63456 if (flag3)
63457 {
63458 int num10 = j + 1;
63459 Main.tile[i, num10].type = 528;
63460 Main.tile[i, num10].active(active: true);
63461 Main.tile[i, num10].CopyPaintAndCoating(Main.tile[i, num10 - 1]);
63463 if (Main.netMode == 2)
63464 {
63465 NetMessage.SendTileSquare(-1, i, num10);
63466 }
63467 }
63468 }
63469 }
63470 }
63471 else if ((Main.tile[i, j].type == 661 || Main.tile[i, j].type == 636) && GrowMoreVines(i, j))
63472 {
63473 if (!Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava())
63474 {
63475 int maxValue3 = 70;
63476 if (Main.tile[i, j].type == 636)
63477 {
63478 maxValue3 = 7;
63479 }
63480 if (genRand.Next(maxValue3) == 0)
63481 {
63482 bool flag4 = false;
63483 for (int num11 = j; num11 > j - 10; num11--)
63484 {
63485 if (Main.tile[i, num11].bottomSlope())
63486 {
63487 flag4 = false;
63488 break;
63489 }
63490 if (Main.tile[i, num11].active() && Main.tile[i, num11].type == 661 && !Main.tile[i, num11].bottomSlope())
63491 {
63492 flag4 = true;
63493 break;
63494 }
63495 }
63496 if (flag4)
63497 {
63498 int num12 = j + 1;
63499 Main.tile[i, num12].type = 636;
63500 Main.tile[i, num12].active(active: true);
63501 Main.tile[i, num12].CopyPaintAndCoating(Main.tile[i, num12 - 1]);
63503 if (Main.netMode == 2)
63504 {
63505 NetMessage.SendTileSquare(-1, i, num12);
63506 }
63507 }
63508 }
63509 }
63510 }
63511 else if ((Main.tile[i, j].type == 662 || Main.tile[i, j].type == 205) && GrowMoreVines(i, j))
63512 {
63513 if (!Main.tile[i, j + 1].active() && !Main.tile[i, j + 1].lava())
63514 {
63515 int maxValue4 = 70;
63516 if (Main.tile[i, j].type == 205)
63517 {
63518 maxValue4 = 7;
63519 }
63520 if (genRand.Next(maxValue4) == 0)
63521 {
63522 bool flag5 = false;
63523 for (int num13 = j; num13 > j - 10; num13--)
63524 {
63525 if (Main.tile[i, num13].bottomSlope())
63526 {
63527 flag5 = false;
63528 break;
63529 }
63530 if (Main.tile[i, num13].active() && Main.tile[i, num13].type == 662 && !Main.tile[i, num13].bottomSlope())
63531 {
63532 flag5 = true;
63533 break;
63534 }
63535 }
63536 if (flag5)
63537 {
63538 int num14 = j + 1;
63539 Main.tile[i, num14].type = 205;
63540 Main.tile[i, num14].active(active: true);
63541 Main.tile[i, num14].CopyPaintAndCoating(Main.tile[i, num14 - 1]);
63543 if (Main.netMode == 2)
63544 {
63545 NetMessage.SendTileSquare(-1, i, num14);
63546 }
63547 }
63548 }
63549 }
63550 }
63551 else if ((Main.tile[i, j].type == 60 || Main.tile[i, j].type == 62) && genRand.Next(80) == 0 && !PlayerLOS(i, j))
63552 {
63553 bool flag6 = true;
63554 int num15 = j;
63555 if (Main.tile[i, j].type == 60)
63556 {
63557 num15++;
63558 }
63559 for (int k = i; k < i + 2; k++)
63560 {
63561 int num16 = num15 - 1;
63562 if (!AnchorValid(Framing.GetTileSafely(k, num16), AnchorType.SolidTile) || Main.tile[k, num16].bottomSlope())
63563 {
63564 flag6 = false;
63565 }
63566 if (Main.tile[k, num16].liquid > 0 || Main.wallHouse[Main.tile[k, num16].wall])
63567 {
63568 flag6 = false;
63569 }
63570 if (!flag6)
63571 {
63572 break;
63573 }
63574 for (int l = num15; l < num15 + 2; l++)
63575 {
63576 if ((Main.tile[k, l].active() && (!Main.tileCut[Main.tile[k, l].type] || Main.tile[k, l].type == 444)) || Main.tile[k, l].lava())
63577 {
63578 flag6 = false;
63579 }
63580 if (!flag6)
63581 {
63582 break;
63583 }
63584 }
63585 if (!flag6)
63586 {
63587 break;
63588 }
63589 }
63590 if (flag6 && CountNearBlocksTypes(i, j, 20, 1, 444) > 0)
63591 {
63592 flag6 = false;
63593 }
63594 if (flag6)
63595 {
63596 for (int m = i; m < i + 2; m++)
63597 {
63598 Main.tile[m, num15 - 1].slope(0);
63599 Main.tile[m, num15 - 1].halfBrick(halfBrick: false);
63600 for (int n = num15; n < num15 + 2; n++)
63601 {
63602 if (Main.tile[m, n].active())
63603 {
63604 KillTile(m, n);
63605 }
63606 }
63607 }
63608 for (int num17 = i; num17 < i + 2; num17++)
63609 {
63610 for (int num18 = num15; num18 < num15 + 2; num18++)
63611 {
63612 Main.tile[num17, num18].active(active: true);
63613 Main.tile[num17, num18].type = 444;
63614 Main.tile[num17, num18].frameX = (short)((num17 - i) * 18);
63615 Main.tile[num17, num18].frameY = (short)((num18 - num15) * 18);
63616 }
63617 }
63618 if (Main.netMode == 2)
63619 {
63620 NetMessage.SendTileSquare(-1, i, num15 - 1, 2, 3);
63621 }
63622 }
63623 }
63624 else if (Main.tile[i, j].type == 396 && genRand.Next(80) == 0 && !PlayerLOS(i, j))
63625 {
63626 bool flag7 = true;
63627 int num19 = j - 1;
63628 for (int num20 = i; num20 < i + 2; num20++)
63629 {
63630 int num21 = num19 + 1;
63631 if (!AnchorValid(Framing.GetTileSafely(num20, num21), AnchorType.SolidTile) || Main.tile[num20, num21].topSlope())
63632 {
63633 flag7 = false;
63634 }
63635 if (Main.tile[num20, num21].liquid > 0 || Main.wallHouse[Main.tile[num20, num21].wall])
63636 {
63637 flag7 = false;
63638 }
63639 if (!flag7)
63640 {
63641 break;
63642 }
63643 for (int num22 = num19 - 2; num22 < num19; num22++)
63644 {
63645 if ((Main.tile[num20, num22].active() && (!Main.tileCut[Main.tile[num20, num22].type] || Main.tile[num20, num22].type == 485)) || Main.tile[num20, num22].lava())
63646 {
63647 flag7 = false;
63648 }
63649 if (!flag7)
63650 {
63651 break;
63652 }
63653 }
63654 if (!flag7)
63655 {
63656 break;
63657 }
63658 }
63659 if (flag7 && CountNearBlocksTypes(i, j, 20, 1, 485) > 0)
63660 {
63661 flag7 = false;
63662 }
63663 if (flag7)
63664 {
63665 bool flag8 = true;
63666 for (int num23 = -1; num23 >= -3; num23--)
63667 {
63668 if (Main.tile[i, j + num23].active())
63669 {
63670 flag8 = false;
63671 break;
63672 }
63673 }
63674 if (flag8)
63675 {
63676 PlaceTile(i, j - 1, 485, mute: true, forced: false, -1, genRand.Next(4));
63677 if (Main.netMode == 2)
63678 {
63679 NetMessage.SendTileSquare(-1, i, j - 2, 2, 2);
63680 }
63681 }
63682 }
63683 }
63684 else if (Main.tile[i, j].type == 69)
63685 {
63686 GrowSpike(i, j, 69, 60);
63687 }
63688 else if (Main.tile[i, j].type == 147 || Main.tile[i, j].type == 161 || Main.tile[i, j].type == 163 || Main.tile[i, j].type == 164 || Main.tile[i, j].type == 200)
63689 {
63690 if (Main.rand.Next(10) == 0 && !Main.tile[i, j + 1].active() && !Main.tile[i, j + 2].active())
63691 {
63692 int num24 = i - 3;
63693 int num25 = i + 4;
63694 int num26 = 0;
63695 for (int num27 = num24; num27 < num25; num27++)
63696 {
63697 if (Main.tile[num27, j].type == 165 && Main.tile[num27, j].active())
63698 {
63699 num26++;
63700 }
63701 if (Main.tile[num27, j + 1].type == 165 && Main.tile[num27, j + 1].active())
63702 {
63703 num26++;
63704 }
63705 if (Main.tile[num27, j + 2].type == 165 && Main.tile[num27, j + 2].active())
63706 {
63707 num26++;
63708 }
63709 if (Main.tile[num27, j + 3].type == 165 && Main.tile[num27, j + 3].active())
63710 {
63711 num26++;
63712 }
63713 }
63714 if (num26 < 2)
63715 {
63716 PlaceTight(i, j + 1);
63717 SquareTileFrame(i, j + 1);
63718 if (Main.netMode == 2 && Main.tile[i, j + 1].active())
63719 {
63720 NetMessage.SendTileSquare(-1, i, j + 1, 1, 2);
63721 }
63722 }
63723 }
63724 }
63725 else if (Main.tileMoss[Main.tile[i, j].type] || TileID.Sets.tileMossBrick[Main.tile[i, j].type])
63726 {
63727 int type2 = Main.tile[i, j].type;
63728 bool flag9 = false;
63729 TileColorCache color = Main.tile[i, j].BlockColorAndCoating();
63730 for (int num28 = num; num28 < num2; num28++)
63731 {
63732 for (int num29 = num3; num29 < num4; num29++)
63733 {
63734 if ((i != num28 || j != num29) && Main.tile[num28, num29].active() && (Main.tile[num28, num29].type == 1 || Main.tile[num28, num29].type == 38))
63735 {
63736 int type3 = Main.tile[num28, num29].type;
63738 SpreadGrass(num28, num29, Main.tile[num28, num29].type, num30, repeat: false, color);
63739 if (Main.tile[num28, num29].type == num30)
63740 {
63742 flag9 = true;
63743 }
63744 }
63745 }
63746 }
63747 if (Main.netMode == 2 && flag9)
63748 {
63749 NetMessage.SendTileSquare(-1, i, j, 3);
63750 }
63751 if (genRand.Next(6) == 0)
63752 {
63753 int num31 = i;
63754 int num32 = j;
63755 switch (genRand.Next(4))
63756 {
63757 case 0:
63758 num31--;
63759 break;
63760 case 1:
63761 num31++;
63762 break;
63763 case 2:
63764 num32--;
63765 break;
63766 default:
63767 num32++;
63768 break;
63769 }
63770 if (!Main.tile[num31, num32].active())
63771 {
63772 if (PlaceTile(num31, num32, 184, mute: true))
63773 {
63774 Main.tile[num31, num32].CopyPaintAndCoating(Main.tile[i, j]);
63775 }
63776 if (Main.netMode == 2 && Main.tile[num31, num32].active())
63777 {
63778 NetMessage.SendTileSquare(-1, num31, num32);
63779 }
63780 }
63781 }
63782 }
63783 else if (Main.tile[i, j].type == 20)
63784 {
63785 if (genRand.Next(5) == 0)
63786 {
63788 }
63789 }
63790 else if (Main.tile[i, j].type == 590)
63791 {
63792 if (genRand.Next(5) == 0)
63793 {
63795 }
63796 }
63797 else if (Main.tile[i, j].type == 595)
63798 {
63799 if (genRand.Next(5) == 0)
63800 {
63802 }
63803 }
63804 else if (Main.tile[i, j].type == 615 && genRand.Next(5) == 0)
63805 {
63807 }
63808 }
63809 else
63810 {
63811 if (Main.tile[i, j].wall == 62 && Main.tile[i, j].liquid == 0)
63812 {
63813 GrowWeb(i, j);
63814 }
63815 if (checkNPCSpawns)
63816 {
63818 }
63819 }
63821 {
63822 if (Main.tile[i, j].wall == 81 || Main.tile[i, j].wall == 83 || (Main.tile[i, j].type == 199 && Main.tile[i, j].active()))
63823 {
63824 int num33 = i + genRand.Next(-2, 3);
63825 int num34 = j + genRand.Next(-2, 3);
63826 if (InWorld(num33, num34, 10) && Main.tile[num33, num34].wall >= 63 && Main.tile[num33, num34].wall <= 68)
63827 {
63828 bool flag10 = false;
63829 for (int num35 = i - wallDist; num35 < i + wallDist; num35++)
63830 {
63831 for (int num36 = j - wallDist; num36 < j + wallDist; num36++)
63832 {
63833 if (Main.tile[num35, num36].active())
63834 {
63835 int type4 = Main.tile[num35, num36].type;
63836 if (type4 == 199 || type4 == 200 || type4 == 201 || type4 == 203 || type4 == 205 || type4 == 234 || type4 == 352 || type4 == 662)
63837 {
63838 flag10 = true;
63839 break;
63840 }
63841 }
63842 }
63843 }
63844 if (flag10)
63845 {
63846 Main.tile[num33, num34].wall = 81;
63847 if (Main.netMode == 2)
63848 {
63849 NetMessage.SendTileSquare(-1, num33, num34);
63850 }
63851 }
63852 }
63853 }
63854 else if (Main.tile[i, j].wall == 69 || Main.tile[i, j].wall == 3 || (Main.tile[i, j].type == 23 && Main.tile[i, j].active()))
63855 {
63856 int num37 = i + genRand.Next(-2, 3);
63857 int num38 = j + genRand.Next(-2, 3);
63858 if (InWorld(num37, num38, 10) && Main.tile[num37, num38].wall >= 63 && Main.tile[num37, num38].wall <= 68)
63859 {
63860 bool flag11 = false;
63861 for (int num39 = i - wallDist; num39 < i + wallDist; num39++)
63862 {
63863 for (int num40 = j - wallDist; num40 < j + wallDist; num40++)
63864 {
63865 if (Main.tile[num39, num40].active())
63866 {
63867 int type5 = Main.tile[num39, num40].type;
63868 if (type5 == 22 || type5 == 23 || type5 == 24 || type5 == 25 || type5 == 32 || type5 == 112 || type5 == 163 || type5 == 636 || type5 == 661)
63869 {
63870 flag11 = true;
63871 break;
63872 }
63873 }
63874 }
63875 }
63876 if (flag11)
63877 {
63878 Main.tile[num37, num38].wall = 69;
63879 if (Main.netMode == 2)
63880 {
63881 NetMessage.SendTileSquare(-1, num37, num38);
63882 }
63883 }
63884 }
63885 }
63886 else if (Main.tile[i, j].wall == 70 || (Main.tile[i, j].type == 109 && Main.tile[i, j].active()))
63887 {
63888 int num41 = i + genRand.Next(-2, 3);
63889 int num42 = j + genRand.Next(-2, 3);
63890 if ((InWorld(num41, num42, 10) && Main.tile[num41, num42].wall == 63) || Main.tile[num41, num42].wall == 65 || Main.tile[num41, num42].wall == 66 || Main.tile[num41, num42].wall == 68)
63891 {
63892 bool flag12 = false;
63893 for (int num43 = i - wallDist; num43 < i + wallDist; num43++)
63894 {
63895 for (int num44 = j - wallDist; num44 < j + wallDist; num44++)
63896 {
63897 if (Main.tile[num43, num44].active())
63898 {
63899 int type6 = Main.tile[num43, num44].type;
63900 if (type6 == 109 || type6 == 110 || type6 == 113 || type6 == 115 || type6 == 116 || type6 == 117 || type6 == 164)
63901 {
63902 flag12 = true;
63903 break;
63904 }
63905 }
63906 }
63907 }
63908 if (flag12)
63909 {
63910 Main.tile[num41, num42].wall = 70;
63911 if (Main.netMode == 2)
63912 {
63913 NetMessage.SendTileSquare(-1, num41, num42);
63914 }
63915 }
63916 }
63917 }
63919 }
63920 if (!Main.tile[i, j].nactive())
63921 {
63922 return;
63923 }
63924 if (Main.tile[i, j].type == 61 && genRand.Next(3) == 0 && Main.tile[i, j].frameX < 144)
63925 {
63926 if (Main.rand.Next(4) == 0)
63927 {
63928 Main.tile[i, j].frameX = (short)(162 + genRand.Next(8) * 18);
63929 }
63930 Main.tile[i, j].type = 74;
63931 if (Main.netMode == 2)
63932 {
63933 NetMessage.SendTileSquare(-1, i, j);
63934 }
63935 }
63936 if ((Main.tile[i, j].type == 60 || Main.tile[i, j].type == 62) && GrowMoreVines(i, j))
63937 {
63938 int maxValue5 = 30;
63939 if (Main.tile[i, j].type == 62)
63940 {
63941 maxValue5 = 10;
63942 }
63943 if (genRand.Next(maxValue5) != 0 || Main.tile[i, j + 1].active() || Main.tile[i, j + 1].lava())
63944 {
63945 return;
63946 }
63947 bool flag13 = false;
63948 for (int num45 = j; num45 > j - 10; num45--)
63949 {
63950 if (Main.tile[i, num45].bottomSlope())
63951 {
63952 flag13 = false;
63953 break;
63954 }
63955 if (Main.tile[i, num45].active() && Main.tile[i, num45].type == 60 && !Main.tile[i, num45].bottomSlope())
63956 {
63957 flag13 = true;
63958 break;
63959 }
63960 }
63961 if (flag13)
63962 {
63963 int num46 = j + 1;
63964 Main.tile[i, num46].type = 62;
63965 Main.tile[i, num46].active(active: true);
63966 Main.tile[i, num46].CopyPaintAndCoating(Main.tile[i, num46 - 1]);
63968 if (Main.netMode == 2)
63969 {
63970 NetMessage.SendTileSquare(-1, i, num46);
63971 }
63972 }
63973 }
63974 else if ((Main.tile[i, j].type == 633 || Main.tile[i, j].type == 638) && GrowMoreVines(i, j))
63975 {
63976 int maxValue6 = 70;
63977 if (Main.tile[i, j].type == 638)
63978 {
63979 maxValue6 = 7;
63980 }
63981 if (genRand.Next(maxValue6) != 0 || Main.tile[i, j + 1].active() || Main.tile[i, j + 1].lava())
63982 {
63983 return;
63984 }
63985 bool flag14 = false;
63986 for (int num47 = j; num47 > j - 10; num47--)
63987 {
63988 if (Main.tile[i, num47].bottomSlope())
63989 {
63990 flag14 = false;
63991 break;
63992 }
63993 if (Main.tile[i, num47].active() && Main.tile[i, num47].type == 633 && !Main.tile[i, num47].bottomSlope())
63994 {
63995 flag14 = true;
63996 break;
63997 }
63998 }
63999 if (flag14)
64000 {
64001 int num48 = j + 1;
64002 Main.tile[i, num48].type = 638;
64003 Main.tile[i, num48].active(active: true);
64004 Main.tile[i, num48].CopyPaintAndCoating(Main.tile[i, num48 - 1]);
64006 if (Main.netMode == 2)
64007 {
64008 NetMessage.SendTileSquare(-1, i, num48);
64009 }
64010 }
64011 }
64012 else
64013 {
64014 if ((Main.tile[i, j].type != 70 && Main.tile[i, j].type != 528) || !GrowMoreVines(i, j))
64015 {
64016 return;
64017 }
64018 int maxValue7 = 70;
64019 if (Main.tile[i, j].type == 528)
64020 {
64021 maxValue7 = 7;
64022 }
64023 if (genRand.Next(maxValue7) != 0 || Main.tile[i, j + 1].active() || Main.tile[i, j + 1].lava())
64024 {
64025 return;
64026 }
64027 bool flag15 = false;
64028 for (int num49 = j; num49 > j - 10; num49--)
64029 {
64030 if (Main.tile[i, num49].bottomSlope())
64031 {
64032 flag15 = false;
64033 break;
64034 }
64035 if (Main.tile[i, num49].active() && Main.tile[i, num49].type == 70 && !Main.tile[i, num49].bottomSlope())
64036 {
64037 flag15 = true;
64038 break;
64039 }
64040 }
64041 if (flag15)
64042 {
64043 int num50 = j + 1;
64044 Main.tile[i, num50].type = 528;
64045 Main.tile[i, num50].active(active: true);
64046 Main.tile[i, num50].CopyPaintAndCoating(Main.tile[i, num50 - 1]);
64048 if (Main.netMode == 2)
64049 {
64050 NetMessage.SendTileSquare(-1, i, num50);
64051 }
64052 }
64053 }
64054 }
static bool[] SpreadUnderground
Definition TileID.cs:309
static bool[] tileMossBrick
Definition TileID.cs:219
static void GrowAlch(int x, int y)
static void UpdateWorld_GrassGrowth(int i, int j, int minI, int maxI, int minJ, int maxJ, bool underground)
static bool AttemptToGrowTreeFromSapling(int x, int y, bool underground)
static bool AllowedToSpreadInfections
Definition WorldGen.cs:1008
static int CountNearBlocksTypes(int i, int j, int radius, int cap=0, params int[] tiletypes)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
static void GrowCheckSeaweed(int x, int y)
static bool PlaceTile(int i, int j, int Type, bool mute=false, bool forced=false, int plr=-1, int style=0)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void SpreadDesertWalls(int wallDist, int i, int j)
static void GrowSpike(int i, int j, ushort spikeType, ushort landType)
static bool PlayerLOS(int x, int y)
static void plantDye(int i, int j, bool exoticPlant=false)
static bool GrowMoreVines(int x, int y)
static void TrySpawningTownNPC(int x, int y)
static int MossConversion(int thisType, int otherType)
static void hardUpdateWorld(int i, int j)
static void GrowWeb(int i, int j)
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)
Definition WorldGen.cs:5816
static bool AnchorValid(Tile tileCache, AnchorType anchor)
static void SquareTileFrame(int i, int j, bool resetFrame=true)
static void CheckCatTail(int x, int j)
static void PlaceTight(int x, int y, bool spiders=false)
static void GrowCatTail(int x, int j)

References Terraria.NPC.AnyNPCs(), Terraria.Framing.GetTileSafely(), Terraria.Main.hardMode, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.netMode, Terraria.Main.rand, Terraria.NetMessage.SendData(), Terraria.NetMessage.SendTileSquare(), Terraria.ID.TileID.Sets.SpreadUnderground, Terraria.Main.tile, Terraria.Main.tileAlch, Terraria.Main.tileCut, Terraria.Main.tileMoss, Terraria.ID.TileID.Sets.tileMossBrick, System.type, and Terraria.Main.wallHouse.