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

◆ Lakinater()

static void Terraria.WorldGen.Lakinater ( int i,
int j,
double strengthMultiplier = 1::0 )
inlinestatic

Definition at line 69735 of file WorldGen.cs.

69736 {
69737 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
69738 //IL_0107: Unknown result type (might be due to invalid IL or missing references)
69739 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
69740 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
69741 //IL_0147: Unknown result type (might be due to invalid IL or missing references)
69742 //IL_0251: Unknown result type (might be due to invalid IL or missing references)
69743 //IL_0252: Unknown result type (might be due to invalid IL or missing references)
69744 //IL_0253: Unknown result type (might be due to invalid IL or missing references)
69745 //IL_0258: Unknown result type (might be due to invalid IL or missing references)
69746 //IL_02a1: Unknown result type (might be due to invalid IL or missing references)
69747 //IL_02c2: Unknown result type (might be due to invalid IL or missing references)
69748 //IL_01ba: Unknown result type (might be due to invalid IL or missing references)
69749 //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
69750 //IL_02e3: Unknown result type (might be due to invalid IL or missing references)
69751 //IL_0304: Unknown result type (might be due to invalid IL or missing references)
69752 double num = (double)genRand.Next(25, 50) * strengthMultiplier;
69753 double num2 = num;
69754 double num3 = genRand.Next(30, 80);
69755 if (genRand.Next(5) == 0)
69756 {
69757 num *= 1.5;
69758 num2 *= 1.5;
69759 num3 *= 1.2;
69760 }
69761 Vector2D val = default(Vector2D);
69762 val.X = i;
69763 val.Y = (double)j - num3 * 0.3;
69764 Vector2D val2 = default(Vector2D);
69765 val2.X = (double)genRand.Next(-10, 11) * 0.1;
69766 val2.Y = (double)genRand.Next(-20, -10) * 0.1;
69767 while (num > 0.0 && num3 > 0.0)
69768 {
69769 if (val.Y + num2 * 0.5 > Main.worldSurface)
69770 {
69771 num3 = 0.0;
69772 }
69773 num -= (double)genRand.Next(3);
69774 num3 -= 1.0;
69775 int num4 = (int)(val.X - num * 0.5);
69776 int num5 = (int)(val.X + num * 0.5);
69777 int num6 = (int)(val.Y - num * 0.5);
69778 int num7 = (int)(val.Y + num * 0.5);
69779 if (num4 < 0)
69780 {
69781 num4 = 0;
69782 }
69783 if (num5 > Main.maxTilesX)
69784 {
69785 num5 = Main.maxTilesX;
69786 }
69787 if (num6 < 0)
69788 {
69789 num6 = 0;
69790 }
69791 if (num7 > Main.maxTilesY)
69792 {
69793 num7 = Main.maxTilesY;
69794 }
69795 num2 = num * (double)genRand.Next(80, 120) * 0.01;
69796 for (int k = num4; k < num5; k++)
69797 {
69798 for (int l = num6; l < num7; l++)
69799 {
69800 double num8 = Math.Abs((double)k - val.X);
69801 double num9 = Math.Abs((double)l - val.Y);
69802 if (Math.Sqrt(num8 * num8 + num9 * num9) < num2 * 0.4)
69803 {
69804 if (Main.tile[k, l].active())
69805 {
69806 Main.tile[k, l].liquid = byte.MaxValue;
69807 }
69808 Main.tile[k, l].active(active: false);
69809 }
69810 }
69811 }
69812 val += val2;
69813 val2.X += (double)genRand.Next(-10, 11) * 0.05;
69814 val2.Y += (double)genRand.Next(-10, 11) * 0.05;
69815 if (val2.X > 0.5)
69816 {
69817 val2.X = 0.5;
69818 }
69819 if (val2.X < -0.5)
69820 {
69821 val2.X = -0.5;
69822 }
69823 if (val2.Y > 1.5)
69824 {
69825 val2.Y = 1.5;
69826 }
69827 if (val2.Y < 0.5)
69828 {
69829 val2.Y = 0.5;
69830 }
69831 }
69832 }
static double Sqrt(double d)
static double Abs(double value)
static UnifiedRandom genRand
Definition WorldGen.cs:1215

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