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

◆ CrimVein()

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

Definition at line 65686 of file WorldGen.cs.

65687 {
65688 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
65689 //IL_0013: Unknown result type (might be due to invalid IL or missing references)
65690 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
65691 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
65692 //IL_0029: Unknown result type (might be due to invalid IL or missing references)
65693 //IL_032d: Unknown result type (might be due to invalid IL or missing references)
65694 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
65695 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
65696 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
65697 //IL_022c: Unknown result type (might be due to invalid IL or missing references)
65698 //IL_0232: Unknown result type (might be due to invalid IL or missing references)
65699 //IL_01ad: Unknown result type (might be due to invalid IL or missing references)
65700 //IL_025b: Unknown result type (might be due to invalid IL or missing references)
65701 //IL_0261: Unknown result type (might be due to invalid IL or missing references)
65702 //IL_0246: Unknown result type (might be due to invalid IL or missing references)
65703 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
65704 //IL_00d7: Unknown result type (might be due to invalid IL or missing references)
65705 //IL_028a: Unknown result type (might be due to invalid IL or missing references)
65706 //IL_0290: Unknown result type (might be due to invalid IL or missing references)
65707 //IL_0275: Unknown result type (might be due to invalid IL or missing references)
65708 //IL_02b9: Unknown result type (might be due to invalid IL or missing references)
65709 //IL_02bf: Unknown result type (might be due to invalid IL or missing references)
65710 //IL_02a4: Unknown result type (might be due to invalid IL or missing references)
65711 //IL_02e8: Unknown result type (might be due to invalid IL or missing references)
65712 //IL_02e9: Unknown result type (might be due to invalid IL or missing references)
65713 //IL_02ea: Unknown result type (might be due to invalid IL or missing references)
65714 //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
65715 //IL_02f1: Unknown result type (might be due to invalid IL or missing references)
65716 //IL_02f7: Unknown result type (might be due to invalid IL or missing references)
65717 //IL_0303: Unknown result type (might be due to invalid IL or missing references)
65718 //IL_0309: Unknown result type (might be due to invalid IL or missing references)
65719 //IL_02d3: Unknown result type (might be due to invalid IL or missing references)
65720 double num = genRand.Next(15, 26);
65721 bool flag = true;
65722 Vector2D val = velocity;
65723 Vector2D val2 = position;
65724 int num2 = genRand.Next(100, 150);
65725 if (velocity.Y < 0.0)
65726 {
65727 num2 -= 25;
65728 }
65729 while (flag)
65730 {
65731 num += (double)genRand.Next(-50, 51) * 0.02;
65732 if (num < 15.0)
65733 {
65734 num = 15.0;
65735 }
65736 if (num > 25.0)
65737 {
65738 num = 25.0;
65739 }
65740 for (int i = (int)(position.X - num / 2.0); (double)i < position.X + num / 2.0; i++)
65741 {
65742 for (int j = (int)(position.Y - num / 2.0); (double)j < position.Y + num / 2.0; j++)
65743 {
65744 double num3 = Math.Abs((double)i - position.X);
65745 double num4 = Math.Abs((double)j - position.Y);
65746 double num5 = Math.Sqrt(num3 * num3 + num4 * num4);
65747 if (num5 < num * 0.2)
65748 {
65749 Main.tile[i, j].active(active: false);
65750 Main.tile[i, j].wall = 83;
65751 }
65752 else if (num5 < num * 0.5 && Main.tile[i, j].wall != 83)
65753 {
65754 Main.tile[i, j].active(active: true);
65755 Main.tile[i, j].type = 203;
65756 if (num5 < num * 0.4)
65757 {
65758 Main.tile[i, j].wall = 83;
65759 }
65760 }
65761 }
65762 }
65763 velocity.X += (double)genRand.Next(-50, 51) * 0.05;
65764 velocity.Y += (double)genRand.Next(-50, 51) * 0.05;
65765 if (velocity.Y < val.Y - 0.75)
65766 {
65767 velocity.Y = val.Y - 0.75;
65768 }
65769 if (velocity.Y > val.Y + 0.75)
65770 {
65771 velocity.Y = val.Y + 0.75;
65772 }
65773 if (velocity.X < val.X - 0.75)
65774 {
65775 velocity.X = val.X - 0.75;
65776 }
65777 if (velocity.X > val.X + 0.75)
65778 {
65779 velocity.X = val.X + 0.75;
65780 }
65781 position += velocity;
65782 if (Math.Abs(position.X - val2.X) + Math.Abs(position.Y - val2.Y) > (double)num2)
65783 {
65784 flag = false;
65785 }
65786 }
65787 heartPos[heartCount] = position.ToPoint();
65788 heartCount++;
65789 }
static double Sqrt(double d)
static double Abs(double value)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static Point[] heartPos
Definition WorldGen.cs:1200
static int heartCount
Definition WorldGen.cs:1202

References System.Math.Abs(), System.Math.Sqrt(), Terraria.Main.tile, ReLogic.Utilities.Vector2D.X, and ReLogic.Utilities.Vector2D.Y.