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

◆ DesertCloudIsland()

static void Terraria.WorldGen.DesertCloudIsland ( int i,
int j )
inlinestatic

Definition at line 67759 of file WorldGen.cs.

67760 {
67761 //IL_0089: Unknown result type (might be due to invalid IL or missing references)
67762 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
67763 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
67764 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
67765 //IL_011a: Unknown result type (might be due to invalid IL or missing references)
67766 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
67767 //IL_0563: Unknown result type (might be due to invalid IL or missing references)
67768 //IL_0574: Unknown result type (might be due to invalid IL or missing references)
67769 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
67770 //IL_05c9: Unknown result type (might be due to invalid IL or missing references)
67771 //IL_05de: Unknown result type (might be due to invalid IL or missing references)
67772 //IL_05f9: Unknown result type (might be due to invalid IL or missing references)
67773 //IL_02d3: Unknown result type (might be due to invalid IL or missing references)
67774 //IL_02d4: Unknown result type (might be due to invalid IL or missing references)
67775 //IL_02d5: Unknown result type (might be due to invalid IL or missing references)
67776 //IL_02da: Unknown result type (might be due to invalid IL or missing references)
67777 //IL_02ff: Unknown result type (might be due to invalid IL or missing references)
67778 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
67779 //IL_0320: Unknown result type (might be due to invalid IL or missing references)
67780 //IL_01dc: Unknown result type (might be due to invalid IL or missing references)
67781 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
67782 //IL_0341: Unknown result type (might be due to invalid IL or missing references)
67783 //IL_01ee: Unknown result type (might be due to invalid IL or missing references)
67784 //IL_0362: Unknown result type (might be due to invalid IL or missing references)
67785 //IL_0659: Unknown result type (might be due to invalid IL or missing references)
67786 //IL_0775: Unknown result type (might be due to invalid IL or missing references)
67787 //IL_0776: Unknown result type (might be due to invalid IL or missing references)
67788 //IL_0777: Unknown result type (might be due to invalid IL or missing references)
67789 //IL_077c: Unknown result type (might be due to invalid IL or missing references)
67790 //IL_07a1: Unknown result type (might be due to invalid IL or missing references)
67791 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
67792 //IL_0224: Unknown result type (might be due to invalid IL or missing references)
67793 //IL_0694: Unknown result type (might be due to invalid IL or missing references)
67794 //IL_07c2: Unknown result type (might be due to invalid IL or missing references)
67795 //IL_06a6: Unknown result type (might be due to invalid IL or missing references)
67796 //IL_069c: Unknown result type (might be due to invalid IL or missing references)
67797 //IL_07e3: Unknown result type (might be due to invalid IL or missing references)
67798 //IL_06b8: Unknown result type (might be due to invalid IL or missing references)
67799 //IL_0804: Unknown result type (might be due to invalid IL or missing references)
67800 //IL_06dc: Unknown result type (might be due to invalid IL or missing references)
67801 //IL_06eb: Unknown result type (might be due to invalid IL or missing references)
67802 double num = genRand.Next(100, 150);
67803 double num2 = num;
67804 double num3 = genRand.Next(20, 30);
67805 int num4 = i;
67806 int num5 = i;
67807 int num6 = i;
67808 int num7 = j;
67809 Vector2D val = default(Vector2D);
67810 val.X = i;
67811 val.Y = j;
67812 Vector2D val2 = default(Vector2D);
67813 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67814 while (val2.X > -2.0 && val2.X < 2.0)
67815 {
67816 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67817 }
67818 val2.Y = (double)genRand.Next(-20, -10) * 0.02;
67819 while (num > 0.0 && num3 > 0.0)
67820 {
67821 num -= (double)genRand.Next(4);
67822 num3 -= 1.0;
67823 int num8 = (int)(val.X - num * 0.5);
67824 int num9 = (int)(val.X + num * 0.5);
67825 int num10 = (int)(val.Y - num * 0.5);
67826 int num11 = (int)(val.Y + num * 0.5);
67827 if (num8 < 0)
67828 {
67829 num8 = 0;
67830 }
67831 if (num9 > Main.maxTilesX)
67832 {
67833 num9 = Main.maxTilesX;
67834 }
67835 if (num10 < 0)
67836 {
67837 num10 = 0;
67838 }
67839 if (num11 > Main.maxTilesY)
67840 {
67841 num11 = Main.maxTilesY;
67842 }
67843 num2 = num * (double)genRand.Next(80, 120) * 0.01;
67844 double num12 = val.Y + 1.0;
67845 for (int k = num8; k < num9; k++)
67846 {
67847 if (genRand.Next(2) == 0)
67848 {
67849 num12 += (double)genRand.Next(-1, 2);
67850 }
67851 if (num12 < val.Y)
67852 {
67853 num12 = val.Y;
67854 }
67855 if (num12 > val.Y + 2.0)
67856 {
67857 num12 = val.Y + 2.0;
67858 }
67859 for (int l = num10; l < num11; l++)
67860 {
67861 if (!((double)l > num12))
67862 {
67863 continue;
67864 }
67865 double num13 = Math.Abs((double)k - val.X);
67866 double num14 = Math.Abs((double)l - val.Y) * 3.0;
67867 if (Math.Sqrt(num13 * num13 + num14 * num14) < num2 * 0.4)
67868 {
67869 if (k < num4)
67870 {
67871 num4 = k;
67872 }
67873 if (k > num5)
67874 {
67875 num5 = k;
67876 }
67877 if (l < num6)
67878 {
67879 num6 = l;
67880 }
67881 if (l > num7)
67882 {
67883 num7 = l;
67884 }
67885 Main.tile[k, l].active(active: true);
67886 Main.tile[k, l].type = 189;
67888 }
67889 }
67890 }
67891 val += val2;
67892 val2.X += (double)genRand.Next(-20, 21) * 0.05;
67893 if (val2.X > 1.0)
67894 {
67895 val2.X = 1.0;
67896 }
67897 if (val2.X < -1.0)
67898 {
67899 val2.X = -1.0;
67900 }
67901 if (val2.Y > 0.2)
67902 {
67903 val2.Y = -0.2;
67904 }
67905 if (val2.Y < -0.2)
67906 {
67907 val2.Y = -0.2;
67908 }
67909 }
67910 int num15 = num4;
67911 int num17;
67912 for (num15 += genRand.Next(5); num15 < num5; num15 += genRand.Next(num17, (int)((double)num17 * 1.5)))
67913 {
67914 int num16 = num7;
67915 while (!Main.tile[num15, num16].active())
67916 {
67917 num16--;
67918 }
67919 num16 += genRand.Next(-3, 4);
67920 num17 = genRand.Next(4, 8);
67921 int num18 = 189;
67922 if (genRand.Next(4) == 0)
67923 {
67924 num18 = 196;
67925 }
67926 for (int m = num15 - num17; m <= num15 + num17; m++)
67927 {
67928 for (int n = num16 - num17; n <= num16 + num17; n++)
67929 {
67930 if (n > num6)
67931 {
67932 double num19 = Math.Abs(m - num15);
67933 double num20 = Math.Abs(n - num16) * 2;
67934 if (Math.Sqrt(num19 * num19 + num20 * num20) < (double)(num17 + genRand.Next(2)))
67935 {
67936 Main.tile[m, n].active(active: true);
67937 Main.tile[m, n].type = (ushort)num18;
67939 }
67940 }
67941 }
67942 }
67943 }
67944 num = genRand.Next(80, 95);
67945 num2 = num;
67946 num3 = genRand.Next(10, 15);
67947 val.X = i;
67948 val.Y = num6;
67949 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67950 while (val2.X > -2.0 && val2.X < 2.0)
67951 {
67952 val2.X = (double)genRand.Next(-20, 21) * 0.2;
67953 }
67954 val2.Y = (double)genRand.Next(-20, -10) * 0.02;
67955 while (num > 0.0 && num3 > 0.0)
67956 {
67957 num -= (double)genRand.Next(4);
67958 num3 -= 1.0;
67959 int num8 = (int)(val.X - num * 0.5);
67960 int num9 = (int)(val.X + num * 0.5);
67961 int num10 = num6 - 1;
67962 int num11 = (int)(val.Y + num * 0.5);
67963 if (num8 < 0)
67964 {
67965 num8 = 0;
67966 }
67967 if (num9 > Main.maxTilesX)
67968 {
67969 num9 = Main.maxTilesX;
67970 }
67971 if (num10 < 0)
67972 {
67973 num10 = 0;
67974 }
67975 if (num11 > Main.maxTilesY)
67976 {
67977 num11 = Main.maxTilesY;
67978 }
67979 num2 = num * (double)genRand.Next(80, 120) * 0.01;
67980 double num21 = val.Y + 1.0;
67981 for (int num22 = num8; num22 < num9; num22++)
67982 {
67983 if (genRand.Next(2) == 0)
67984 {
67985 num21 += (double)genRand.Next(-1, 2);
67986 }
67987 if (num21 < val.Y)
67988 {
67989 num21 = val.Y;
67990 }
67991 if (num21 > val.Y + 2.0)
67992 {
67993 num21 = val.Y + 2.0;
67994 }
67995 for (int num23 = num10; num23 < num11; num23++)
67996 {
67997 if ((double)num23 > num21)
67998 {
67999 double num24 = Math.Abs((double)num22 - val.X);
68000 double num25 = Math.Abs((double)num23 - val.Y) * 3.0;
68001 if (Math.Sqrt(num24 * num24 + num25 * num25) < num2 * 0.4 && Main.tile[num22, num23].type == 189)
68002 {
68003 Main.tile[num22, num23].type = 53;
68005 }
68006 }
68007 }
68008 }
68009 val += val2;
68010 val2.X += (double)genRand.Next(-20, 21) * 0.05;
68011 if (val2.X > 1.0)
68012 {
68013 val2.X = 1.0;
68014 }
68015 if (val2.X < -1.0)
68016 {
68017 val2.X = -1.0;
68018 }
68019 if (val2.Y > 0.2)
68020 {
68021 val2.Y = -0.2;
68022 }
68023 if (val2.Y < -0.2)
68024 {
68025 val2.Y = -0.2;
68026 }
68027 }
68028 int num26 = num4;
68029 num26 += genRand.Next(5);
68030 while (num26 < num5)
68031 {
68032 int num27 = num7;
68033 while ((!Main.tile[num26, num27].active() || Main.tile[num26, num27].type != 0) && num26 < num5)
68034 {
68035 num27--;
68036 if (num27 < num6)
68037 {
68038 num27 = num7;
68039 num26 += genRand.Next(1, 4);
68040 }
68041 }
68042 if (num26 >= num5)
68043 {
68044 continue;
68045 }
68046 num27 += genRand.Next(0, 4);
68047 int num28 = genRand.Next(2, 5);
68048 int num29 = 189;
68049 for (int num30 = num26 - num28; num30 <= num26 + num28; num30++)
68050 {
68051 for (int num31 = num27 - num28; num31 <= num27 + num28; num31++)
68052 {
68053 if (num31 > num6)
68054 {
68055 double num32 = Math.Abs(num30 - num26);
68056 double num33 = Math.Abs(num31 - num27) * 2;
68057 if (Math.Sqrt(num32 * num32 + num33 * num33) < (double)num28)
68058 {
68059 Main.tile[num30, num31].type = (ushort)num29;
68061 }
68062 }
68063 }
68064 }
68065 num26 += genRand.Next(num28, (int)((double)num28 * 1.5));
68066 }
68067 for (int num34 = num4 - 20; num34 <= num5 + 20; num34++)
68068 {
68069 for (int num35 = num6 - 20; num35 <= num7 + 20; num35++)
68070 {
68071 bool flag = true;
68072 for (int num36 = num34 - 1; num36 <= num34 + 1; num36++)
68073 {
68074 for (int num37 = num35 - 1; num37 <= num35 + 1; num37++)
68075 {
68076 if (!Main.tile[num36, num37].active())
68077 {
68078 flag = false;
68079 }
68080 }
68081 }
68082 if (flag)
68083 {
68084 Main.tile[num34, num35].wall = 73;
68086 }
68087 }
68088 }
68089 for (int num38 = num4; num38 <= num5; num38++)
68090 {
68091 int num39;
68092 for (num39 = num6 - 10; !Main.tile[num38, num39 + 1].active(); num39++)
68093 {
68094 }
68095 if (num39 >= num7 || Main.tile[num38, num39 + 1].type != 189)
68096 {
68097 continue;
68098 }
68099 if (genRand.Next(10) == 0)
68100 {
68101 int num40 = genRand.Next(1, 3);
68102 for (int num41 = num38 - num40; num41 <= num38 + num40; num41++)
68103 {
68104 if (Main.tile[num41, num39].type == 189 && WillWaterPlacedHereStayPut(num41, num39))
68105 {
68106 Main.tile[num41, num39].active(active: false);
68107 Main.tile[num41, num39].liquid = byte.MaxValue;
68108 Main.tile[num41, num39].lava(lava: false);
68110 }
68111 if (Main.tile[num41, num39 + 1].type == 189 && WillWaterPlacedHereStayPut(num41, num39 + 1))
68112 {
68113 Main.tile[num41, num39 + 1].active(active: false);
68114 Main.tile[num41, num39 + 1].liquid = byte.MaxValue;
68115 Main.tile[num41, num39 + 1].lava(lava: false);
68117 }
68118 if (num41 > num38 - num40 && num41 < num38 + 2 && Main.tile[num41, num39 + 2].type == 189 && WillWaterPlacedHereStayPut(num41, num39 + 2))
68119 {
68120 Main.tile[num41, num39 + 2].active(active: false);
68121 Main.tile[num41, num39 + 2].liquid = byte.MaxValue;
68122 Main.tile[num41, num39 + 2].lava(lava: false);
68124 }
68125 }
68126 }
68127 if (genRand.Next(5) == 0 && WillWaterPlacedHereStayPut(num38, num39))
68128 {
68129 Main.tile[num38, num39].liquid = byte.MaxValue;
68130 }
68131 Main.tile[num38, num39].lava(lava: false);
68133 }
68134 int num42 = genRand.Next(4);
68135 for (int num43 = 0; num43 <= num42; num43++)
68136 {
68137 int num44 = genRand.Next(num4 - 5, num5 + 5);
68138 int num45 = num6 - genRand.Next(20, 40);
68139 int num46 = genRand.Next(4, 8);
68140 int num47 = 189;
68141 if (genRand.Next(2) == 0)
68142 {
68143 num47 = 196;
68144 }
68145 for (int num48 = num44 - num46; num48 <= num44 + num46; num48++)
68146 {
68147 for (int num49 = num45 - num46; num49 <= num45 + num46; num49++)
68148 {
68149 double num50 = Math.Abs(num48 - num44);
68150 double num51 = Math.Abs(num49 - num45) * 2;
68151 if (Math.Sqrt(num50 * num50 + num51 * num51) < (double)(num46 + genRand.Next(-1, 2)))
68152 {
68153 Main.tile[num48, num49].active(active: true);
68154 Main.tile[num48, num49].type = (ushort)num47;
68156 }
68157 }
68158 }
68159 for (int num52 = num44 - num46 + 2; num52 <= num44 + num46 - 2; num52++)
68160 {
68161 int num53;
68162 for (num53 = num45 - num46; !Main.tile[num52, num53].active(); num53++)
68163 {
68164 }
68166 {
68167 Main.tile[num52, num53].active(active: false);
68168 Main.tile[num52, num53].liquid = byte.MaxValue;
68170 }
68171 }
68172 }
68173 }
static double Sqrt(double d)
static double Abs(double value)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void SquareWallFrame(int i, int j, bool resetFrame=true)
static bool WillWaterPlacedHereStayPut(int x, int y)
static void SquareTileFrame(int i, int j, bool resetFrame=true)

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

Referenced by Terraria.WorldGen.GenerateWorld().