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

◆ CrimVein()

static void Terraria.WorldGen.CrimVein ( Vector2D position,
Vector2D velocity )
inlinestatic

Definition at line 69726 of file WorldGen.cs.

69727 {
69728 //IL_034d: Unknown result type (might be due to invalid IL or missing references)
69729 //IL_0352: Unknown result type (might be due to invalid IL or missing references)
69730 double num = genRand.Next(15, 26);
69731 bool flag = true;
69732 Vector2D vector2D = velocity;
69733 Vector2D vector2D2 = position;
69734 int num2 = genRand.Next(100, 150);
69735 if (velocity.Y < 0.0)
69736 {
69737 num2 -= 25;
69738 }
69739 while (flag)
69740 {
69741 num += (double)genRand.Next(-50, 51) * 0.02;
69742 if (num < 15.0)
69743 {
69744 num = 15.0;
69745 }
69746 if (num > 25.0)
69747 {
69748 num = 25.0;
69749 }
69750 for (int i = (int)(position.X - num / 2.0); (double)i < position.X + num / 2.0; i++)
69751 {
69752 for (int j = (int)(position.Y - num / 2.0); (double)j < position.Y + num / 2.0; j++)
69753 {
69754 double num5 = Math.Abs((double)i - position.X);
69755 double num3 = Math.Abs((double)j - position.Y);
69756 double num4 = Math.Sqrt(num5 * num5 + num3 * num3);
69757 if (num4 < num * 0.2)
69758 {
69759 Main.tile[i, j].active(active: false);
69760 Main.tile[i, j].wall = 83;
69761 }
69762 else if (num4 < num * 0.5 && Main.tile[i, j].wall != 83)
69763 {
69764 Main.tile[i, j].active(active: true);
69765 Main.tile[i, j].type = 203;
69766 if (num4 < num * 0.4)
69767 {
69768 Main.tile[i, j].wall = 83;
69769 }
69770 }
69771 }
69772 }
69773 velocity.X += (double)genRand.Next(-50, 51) * 0.05;
69774 velocity.Y += (double)genRand.Next(-50, 51) * 0.05;
69775 if (velocity.Y < vector2D.Y - 0.75)
69776 {
69777 velocity.Y = vector2D.Y - 0.75;
69778 }
69779 if (velocity.Y > vector2D.Y + 0.75)
69780 {
69781 velocity.Y = vector2D.Y + 0.75;
69782 }
69783 if (velocity.X < vector2D.X - 0.75)
69784 {
69785 velocity.X = vector2D.X - 0.75;
69786 }
69787 if (velocity.X > vector2D.X + 0.75)
69788 {
69789 velocity.X = vector2D.X + 0.75;
69790 }
69791 position += velocity;
69792 if (Math.Abs(position.X - vector2D2.X) + Math.Abs(position.Y - vector2D2.Y) > (double)num2)
69793 {
69794 flag = false;
69795 }
69796 }
69797 heartPos[heartCount] = position.ToPoint();
69798 heartCount++;
69799 }
static UnifiedRandom genRand
Definition WorldGen.cs:1455
static Point[] heartPos
Definition WorldGen.cs:1438
static int heartCount
Definition WorldGen.cs:1440

References Terraria.Main.tile.