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

◆ FloatingIsland()

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

Definition at line 68986 of file WorldGen.cs.

68987 {
68988 //IL_007a: Unknown result type (might be due to invalid IL or missing references)
68989 //IL_008b: Unknown result type (might be due to invalid IL or missing references)
68990 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
68991 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
68992 //IL_010b: Unknown result type (might be due to invalid IL or missing references)
68993 //IL_0120: Unknown result type (might be due to invalid IL or missing references)
68994 //IL_0180: Unknown result type (might be due to invalid IL or missing references)
68995 //IL_02a5: Unknown result type (might be due to invalid IL or missing references)
68996 //IL_02ba: Unknown result type (might be due to invalid IL or missing references)
68997 //IL_02d0: Unknown result type (might be due to invalid IL or missing references)
68998 //IL_02e5: Unknown result type (might be due to invalid IL or missing references)
68999 //IL_01bb: Unknown result type (might be due to invalid IL or missing references)
69000 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
69001 //IL_01c3: Unknown result type (might be due to invalid IL or missing references)
69002 //IL_01df: Unknown result type (might be due to invalid IL or missing references)
69003 //IL_0206: Unknown result type (might be due to invalid IL or missing references)
69004 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
69005 //IL_03db: Unknown result type (might be due to invalid IL or missing references)
69006 //IL_03dc: Unknown result type (might be due to invalid IL or missing references)
69007 //IL_03dd: Unknown result type (might be due to invalid IL or missing references)
69008 //IL_03e2: Unknown result type (might be due to invalid IL or missing references)
69009 //IL_0407: Unknown result type (might be due to invalid IL or missing references)
69010 //IL_0428: Unknown result type (might be due to invalid IL or missing references)
69011 //IL_0355: Unknown result type (might be due to invalid IL or missing references)
69012 //IL_0449: Unknown result type (might be due to invalid IL or missing references)
69013 //IL_036a: Unknown result type (might be due to invalid IL or missing references)
69014 //IL_0379: Unknown result type (might be due to invalid IL or missing references)
69015 //IL_046a: Unknown result type (might be due to invalid IL or missing references)
69016 double num = genRand.Next(80, 120);
69017 double num2 = num;
69018 double num3 = genRand.Next(20, 25);
69019 Vector2D val = default(Vector2D);
69020 val.X = i;
69021 val.Y = j;
69022 Vector2D val2 = default(Vector2D);
69023 val2.X = (double)genRand.Next(-20, 21) * 0.2;
69024 while (val2.X > -2.0 && val2.X < 2.0)
69025 {
69026 val2.X = (double)genRand.Next(-20, 21) * 0.2;
69027 }
69028 val2.Y = (double)genRand.Next(-20, -10) * 0.02;
69029 while (num > 0.0 && num3 > 0.0)
69030 {
69031 num -= (double)genRand.Next(4);
69032 num3 -= 1.0;
69033 int num4 = (int)(val.X - num * 0.5);
69034 int num5 = (int)(val.X + num * 0.5);
69035 int num6 = (int)(val.Y - num * 0.5);
69036 int num7 = (int)(val.Y + num * 0.5);
69037 if (num4 < 0)
69038 {
69039 num4 = 0;
69040 }
69041 if (num5 > Main.maxTilesX)
69042 {
69043 num5 = Main.maxTilesX;
69044 }
69045 if (num6 < 0)
69046 {
69047 num6 = 0;
69048 }
69049 if (num7 > Main.maxTilesY)
69050 {
69051 num7 = Main.maxTilesY;
69052 }
69053 num2 = num * (double)genRand.Next(80, 120) * 0.01;
69054 double num8 = val.Y + 1.0;
69055 for (int k = num4; k < num5; k++)
69056 {
69057 if (genRand.Next(2) == 0)
69058 {
69059 num8 += (double)genRand.Next(-1, 2);
69060 }
69061 if (num8 < val.Y)
69062 {
69063 num8 = val.Y;
69064 }
69065 if (num8 > val.Y + 2.0)
69066 {
69067 num8 = val.Y + 2.0;
69068 }
69069 for (int l = num6; l < num7; l++)
69070 {
69071 if (!((double)l > num8))
69072 {
69073 continue;
69074 }
69075 double num9 = Math.Abs((double)k - val.X);
69076 double num10 = Math.Abs((double)l - val.Y) * 2.0;
69077 if (Math.Sqrt(num9 * num9 + num10 * num10) < num2 * 0.4)
69078 {
69079 Main.tile[k, l].active(active: true);
69080 if (Main.tile[k, l].type == 59)
69081 {
69082 Main.tile[k, l].type = 0;
69083 }
69084 }
69085 }
69086 }
69087 num4 = (int)(val.X - num * 0.4);
69088 num5 = (int)(val.X + num * 0.4);
69089 num6 = (int)(val.Y - num * 0.4);
69090 num7 = (int)(val.Y + num * 0.4);
69091 if (num4 < 0)
69092 {
69093 num4 = 0;
69094 }
69095 if (num5 > Main.maxTilesX)
69096 {
69097 num5 = Main.maxTilesX;
69098 }
69099 if (num6 < 0)
69100 {
69101 num6 = 0;
69102 }
69103 if (num7 > Main.maxTilesY)
69104 {
69105 num7 = Main.maxTilesY;
69106 }
69107 num2 = num * (double)genRand.Next(80, 120) * 0.01;
69108 for (int m = num4; m < num5; m++)
69109 {
69110 for (int n = num6; n < num7; n++)
69111 {
69112 if ((double)n > val.Y + 2.0)
69113 {
69114 double num11 = Math.Abs((double)m - val.X);
69115 double num12 = Math.Abs((double)n - val.Y) * 2.0;
69116 if (Math.Sqrt(num11 * num11 + num12 * num12) < num2 * 0.4)
69117 {
69118 Main.tile[m, n].wall = 2;
69119 }
69120 }
69121 }
69122 }
69123 val += val2;
69124 val2.Y += (double)genRand.Next(-10, 11) * 0.05;
69125 if (val2.X > 1.0)
69126 {
69127 val2.X = 1.0;
69128 }
69129 if (val2.X < -1.0)
69130 {
69131 val2.X = -1.0;
69132 }
69133 if (val2.Y > 0.2)
69134 {
69135 val2.Y = -0.2;
69136 }
69137 if (val2.Y < -0.2)
69138 {
69139 val2.Y = -0.2;
69140 }
69141 }
69142 }
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, ReLogic.Utilities.Vector2D.X, and ReLogic.Utilities.Vector2D.Y.