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

◆ FinishNotTheBees()

static void Terraria.WorldGen.FinishNotTheBees ( )
inlinestaticprivate

Definition at line 17483 of file WorldGen.cs.

17484 {
17485 if (!notTheBees)
17486 {
17487 return;
17488 }
17489 int num = 0;
17490 for (int i = 20; (double)i < Main.worldSurface; i++)
17491 {
17492 for (int j = 20; j < Main.maxTilesX - 20; j++)
17493 {
17494 if (Main.tile[j, i].active() && TileID.Sets.Clouds[Main.tile[j, i].type])
17495 {
17496 num = i;
17497 break;
17498 }
17499 }
17500 }
17501 for (int k = 25; k < Main.maxTilesX - 25; k++)
17502 {
17503 for (int l = 25; l < Main.maxTilesY - 25; l++)
17504 {
17505 if (Main.tile[k, l].type == 571)
17506 {
17507 TileFrame(k, l);
17508 }
17509 int num2 = 20;
17510 if (remixWorldGen)
17511 {
17512 num2 = 10;
17513 }
17514 if (Main.tile[k, l].type == 25 || (remixWorldGen && Main.tile[k, l].type == 23 && (double)l < Main.worldSurface))
17515 {
17516 for (int m = k - num2; m <= k + num2; m++)
17517 {
17518 for (int n = l - num2; n <= l + num2; n++)
17519 {
17520 if (Main.tile[m, n].type == 60)
17521 {
17522 if (Main.tile[m, n + 1].type == 444)
17523 {
17524 KillTile(m, n + 1);
17525 }
17526 Main.tile[m, n].type = 661;
17527 if (Main.tile[m, n - 1].type == 61 || Main.tile[m, n - 1].type == 74)
17528 {
17529 Main.tile[m, n - 1].active(active: false);
17530 PlaceTile(m, n - 1, 24);
17531 }
17532 }
17533 else if (Main.tile[m, n - 1].type == 233 || Main.tile[m, n - 1].type == 82)
17534 {
17535 KillTile(m, n - 1);
17536 }
17537 }
17538 }
17539 }
17540 else if (Main.tile[k, l].type == 203 || (remixWorldGen && Main.tile[k, l].type == 199 && (double)l < Main.worldSurface))
17541 {
17542 for (int num3 = k - num2; num3 <= k + num2; num3++)
17543 {
17544 for (int num4 = l - num2; num4 <= l + num2; num4++)
17545 {
17546 if (Main.tile[num3, num4].type == 60)
17547 {
17548 if (Main.tile[num3, num4 + 1].type == 444)
17549 {
17550 KillTile(num3, num4 + 1);
17551 }
17552 Main.tile[num3, num4].type = 662;
17553 if (Main.tile[num3, num4 - 1].type == 61 || Main.tile[num3, num4 - 1].type == 74)
17554 {
17555 Main.tile[num3, num4 - 1].active(active: false);
17556 PlaceTile(num3, num4 - 1, 201);
17557 }
17558 else if (Main.tile[num3, num4 - 1].type == 233 || Main.tile[num3, num4 - 1].type == 82)
17559 {
17560 KillTile(num3, num4 - 1);
17561 }
17562 }
17563 }
17564 }
17565 }
17566 if (Main.tile[k, l].type == 382 || Main.tile[k, l].type == 52)
17567 {
17568 Main.tile[k, l].type = 62;
17569 }
17570 if (l > GenVars.lavaLine + genRand.Next(-2, 3) + 2)
17571 {
17572 if (!remixWorldGen)
17573 {
17574 SpreadGrass(k, l, 59, 70);
17575 }
17576 }
17577 else
17578 {
17579 SpreadGrass(k, l, 59, 60);
17580 }
17581 if ((double)l > Main.rockLayer + 20.0 + (double)genRand.Next(-2, 3) && l <= GenVars.lavaLine + 2 - 20 - genRand.Next(-2, 3) && (k < beachDistance + 200 - 20 - genRand.Next(-2, 3) || k > Main.maxTilesX - beachDistance - 200 + 20 + genRand.Next(-2, 3)))
17582 {
17583 if (Main.tile[k, l].liquid > 0)
17584 {
17585 Main.tile[k, l].honey(honey: false);
17586 Main.tile[k, l].lava(lava: false);
17587 }
17588 if (Main.tile[k, l].type == 59)
17589 {
17590 bool flag = false;
17591 for (int num5 = k - 1; num5 <= k + 1; num5++)
17592 {
17593 for (int num6 = l - 1; num6 <= l + 1; num6++)
17594 {
17595 if (Main.tile[num5, num6].type == 60)
17596 {
17597 flag = true;
17598 }
17599 }
17600 }
17601 if (!flag)
17602 {
17603 if ((double)l < (Main.rockLayer + (double)GenVars.lavaLine) / 2.0)
17604 {
17605 Main.tile[k, l].type = 161;
17606 }
17607 else
17608 {
17609 Main.tile[k, l].type = 147;
17610 }
17611 }
17612 }
17613 }
17614 if (!remixWorldGen)
17615 {
17616 if ((Main.tile[k, l].type == 7 || Main.tile[k, l].type == 166 || Main.tile[k, l].type == 6 || Main.tile[k, l].type == 167) && (double)l > ((double)GenVars.lavaLine + Main.rockLayer * 2.0) / 3.0 + (double)genRand.Next(-2, 3) + 2.0)
17617 {
17618 Main.tile[k, l].type = 0;
17619 }
17620 }
17621 else if (!remixWorldGen && (Main.tile[k, l].type == 123 || Main.tile[k, l].type == 40) && (double)l > ((double)GenVars.lavaLine + Main.rockLayer) / 2.0 + (double)genRand.Next(-2, 3) + 2.0)
17622 {
17623 Main.tile[k, l].type = 1;
17624 }
17625 if (l <= num || (Main.tile[k, l].liquid != 0 && (Main.tile[k, l].lava() || Main.tile[k, l].shimmer())))
17626 {
17627 continue;
17628 }
17629 if (getGoodWorldGen)
17630 {
17631 if (genRand.Next(150) == 0)
17632 {
17633 PlaceTile(k, l, 231, mute: true);
17634 }
17635 }
17636 else if (genRand.Next(25) == 0)
17637 {
17638 PlaceTile(k, l, 231, mute: true);
17639 }
17640 }
17641 }
17642 for (int num7 = 20; num7 < num; num7++)
17643 {
17644 for (int num8 = 20; num8 <= Main.maxTilesX - 20; num8++)
17645 {
17646 Main.tile[num8, num7].honey(honey: false);
17647 if (Main.tile[num8, num7].type == 375)
17648 {
17649 Main.tile[num8, num7].type = 373;
17650 }
17651 if (!remixWorldGen)
17652 {
17653 if (Main.tile[num8, num7].type == 60)
17654 {
17655 Main.tile[num8, num7].type = 2;
17656 if (genRand.Next(2) == 0)
17657 {
17658 GrowTreeWithSettings(num8, num7, GrowTreeSettings.Profiles.VanityTree_Willow);
17659 }
17660 else
17661 {
17662 GrowTreeWithSettings(num8, num7, GrowTreeSettings.Profiles.VanityTree_Sakura);
17663 }
17664 if (!Main.tile[num8, num7 - 1].active())
17665 {
17666 PlaceTile(num8, num7 - 1, 3);
17667 }
17668 }
17669 if (Main.tile[num8, num7].type == 59)
17670 {
17671 Main.tile[num8, num7].type = 0;
17672 }
17673 }
17674 else
17675 {
17676 GrowTree(num8, num7);
17677 }
17678 }
17679 }
17680 }
static bool[] Clouds
Definition TileID.cs:125
static bool remixWorldGen
Definition WorldGen.cs:1148
static bool GrowTreeWithSettings(int checkedX, int checkedY, GrowTreeSettings settings)
static void KillTile(int i, int j, bool fail=false, bool effectOnly=false, bool noItem=false)
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 readonly int beachDistance
Definition WorldGen.cs:928
static void TileFrame(int i, int j, bool resetFrame=false, bool noBreak=false)
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 notTheBees
Definition WorldGen.cs:1164
static bool getGoodWorldGen
Definition WorldGen.cs:1156

References Terraria.ID.TileID.Sets.Clouds, Terraria.WorldBuilding.GenVars.lavaLine, Terraria.Main.maxTilesX, Terraria.Main.rockLayer, Terraria.Main.tile, Terraria.WorldGen.GrowTreeSettings.Profiles.VanityTree_Sakura, Terraria.WorldGen.GrowTreeSettings.Profiles.VanityTree_Willow, and Terraria.Main.worldSurface.