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

◆ MarblePileWithStatues()

static bool Terraria.WorldGen.MarblePileWithStatues ( int X,
int Y )
inlinestatic

Definition at line 6585 of file WorldGen.cs.

6586 {
6587 //IL_0384: Unknown result type (might be due to invalid IL or missing references)
6588 //IL_0386: Unknown result type (might be due to invalid IL or missing references)
6589 //IL_0388: Unknown result type (might be due to invalid IL or missing references)
6590 //IL_038d: Unknown result type (might be due to invalid IL or missing references)
6591 //IL_03eb: Unknown result type (might be due to invalid IL or missing references)
6592 //IL_040a: Unknown result type (might be due to invalid IL or missing references)
6593 //IL_021b: Unknown result type (might be due to invalid IL or missing references)
6594 //IL_0223: Unknown result type (might be due to invalid IL or missing references)
6595 //IL_0228: Unknown result type (might be due to invalid IL or missing references)
6596 //IL_022d: Unknown result type (might be due to invalid IL or missing references)
6597 //IL_0469: Unknown result type (might be due to invalid IL or missing references)
6598 int num = Y;
6599 while (!SolidTile(X, num))
6600 {
6601 num++;
6602 if ((double)num > Main.worldSurface)
6603 {
6604 return false;
6605 }
6606 }
6607 if (Main.tile[X, num].type != 0 && Main.tile[X, num].type != 2)
6608 {
6609 return false;
6610 }
6611 if (Main.tile[X, num].wall > 0)
6612 {
6613 return false;
6614 }
6615 int num2 = 130;
6616 int num3 = 60;
6617 int num4 = (int)MathHelper.Clamp(X - num2, 30f, Main.maxTilesX - 30);
6618 int num5 = (int)MathHelper.Clamp(X + num2, 30f, Main.maxTilesX - 30);
6619 int num6 = (int)MathHelper.Clamp(num - num3, 30f, Main.maxTilesY - 30);
6620 int num7 = (int)MathHelper.Clamp(num + num3, 30f, Main.maxTilesY - 30);
6621 for (int i = num4; i <= num5; i++)
6622 {
6623 for (int j = num6; j <= num7; j++)
6624 {
6625 if (Main.tile[i, j].active() && (Main.tile[i, j].type == 367 || Main.tile[i, j].type == 191))
6626 {
6627 return false;
6628 }
6629 }
6630 }
6631 num--;
6632 Vector2D val = default(Vector2D);
6633 ((Vector2D)(ref val))._002Ector((double)X, (double)num);
6634 Vector2D val2 = default(Vector2D);
6635 val2.X = genRand.NextDouble() * 0.6 - 0.3;
6636 val2.Y = genRand.NextDouble() * 0.5 + 0.5;
6637 double num8 = genRand.Next(2, 4);
6638 if (genRand.Next(10) == 0)
6639 {
6640 num8 += 1.0;
6641 }
6642 int num9 = genRand.Next(3, 6);
6643 while (num9 > 0)
6644 {
6645 num9--;
6646 for (int k = X - (int)num8 * 5; (double)k <= (double)X + num8 * 5.0; k++)
6647 {
6648 int num10 = num + (int)num8 * 3;
6649 while ((double)num10 > (double)num - num8 * 3.0)
6650 {
6651 double num11 = num8 * (double)genRand.Next(70, 91) * 0.01 * 1.2;
6652 Vector2D val3 = val - new Vector2D((double)k, (double)num10);
6653 if (((Vector2D)(ref val3)).Length() > 30.0)
6654 {
6655 ((Vector2D)(ref val))._002Ector((double)X, (double)num);
6656 val2.X = genRand.NextDouble() * 0.6 - 0.3;
6657 val2.Y = genRand.NextDouble() * 0.5 + 0.5;
6658 }
6659 else
6660 {
6661 val3.X *= 0.25;
6662 val3.Y *= 0.8;
6663 if (((Vector2D)(ref val3)).Length() < num11 && Main.tile[k, num10].active())
6664 {
6665 Main.tile[k, num10].active(active: true);
6666 Main.tile[k, num10].halfBrick(halfBrick: false);
6667 Main.tile[k, num10].slope(0);
6668 Main.tile[k, num10].type = 367;
6669 if (!gen)
6670 {
6672 }
6673 }
6674 }
6675 num10--;
6676 }
6677 }
6678 val += val2;
6679 val2.X += genRand.NextDouble() * 0.2 - 0.1;
6680 val2.Y += (0.1 + genRand.NextDouble() * 0.1) * 0.8;
6681 Utils.Clamp(val2.X, -0.3, 0.3);
6682 Utils.Clamp(val2.Y, 0.5, 1.0);
6683 }
6684 int num12 = 0;
6685 for (int l = X - (int)num8 * 5; (double)l <= (double)X + num8 * 5.0; l++)
6686 {
6687 if (num12 >= 3)
6688 {
6689 break;
6690 }
6691 if (l % 2 != 1 && (num12 <= 0 || genRand.Next(5) == 0))
6692 {
6693 int num13 = (int)val.Y - 20;
6694 Tile tile = Main.tile[l, num13];
6695 while (tile != null && !tile.active())
6696 {
6697 num13++;
6698 tile = Main.tile[l, num13];
6699 }
6700 if (tile != null && tile.type == 367 && !Main.tile[l, num13 - 1].active() && Statue(l, num13 - 1, 26))
6701 {
6702 num12++;
6703 }
6704 }
6705 }
6706 return true;
6707 }
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
static volatile bool gen
Definition WorldGen.cs:972
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static bool Statue(int x, int y, byte paint)
Definition WorldGen.cs:6709
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References Terraria.Tile.active(), Microsoft.Xna.Framework.MathHelper.Clamp(), Terraria.WorldGen.gen, Terraria.WorldGen.genRand, Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Enums.SolidTile, Terraria.WorldGen.SquareTileFrame(), Terraria.WorldGen.Statue(), Terraria.Main.tile, Terraria.Tile.type, Terraria.Main.worldSurface, System.X, ReLogic.Utilities.Vector2D.Y, and System.Y.