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

◆ ChasmRunnerSideways()

static void Terraria.WorldGen.ChasmRunnerSideways ( int i,
int j,
int direction,
int steps )
inlinestatic

Definition at line 65080 of file WorldGen.cs.

65081 {
65082 //IL_06f1: Unknown result type (might be due to invalid IL or missing references)
65083 //IL_06fa: Unknown result type (might be due to invalid IL or missing references)
65084 //IL_0105: Unknown result type (might be due to invalid IL or missing references)
65085 //IL_0138: Unknown result type (might be due to invalid IL or missing references)
65086 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
65087 //IL_0163: Unknown result type (might be due to invalid IL or missing references)
65088 //IL_0178: Unknown result type (might be due to invalid IL or missing references)
65089 //IL_027f: Unknown result type (might be due to invalid IL or missing references)
65090 //IL_0280: Unknown result type (might be due to invalid IL or missing references)
65091 //IL_0281: Unknown result type (might be due to invalid IL or missing references)
65092 //IL_0286: Unknown result type (might be due to invalid IL or missing references)
65093 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
65094 //IL_02da: Unknown result type (might be due to invalid IL or missing references)
65095 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
65096 //IL_01e0: Unknown result type (might be due to invalid IL or missing references)
65097 //IL_0309: Unknown result type (might be due to invalid IL or missing references)
65098 //IL_032a: Unknown result type (might be due to invalid IL or missing references)
65099 //IL_0373: Unknown result type (might be due to invalid IL or missing references)
65100 //IL_03fd: Unknown result type (might be due to invalid IL or missing references)
65101 //IL_0412: Unknown result type (might be due to invalid IL or missing references)
65102 //IL_0428: Unknown result type (might be due to invalid IL or missing references)
65103 //IL_043d: Unknown result type (might be due to invalid IL or missing references)
65104 //IL_03bb: Unknown result type (might be due to invalid IL or missing references)
65105 //IL_0394: Unknown result type (might be due to invalid IL or missing references)
65106 //IL_03dc: Unknown result type (might be due to invalid IL or missing references)
65107 //IL_0496: Unknown result type (might be due to invalid IL or missing references)
65108 //IL_04a5: Unknown result type (might be due to invalid IL or missing references)
65109 //IL_05f0: Unknown result type (might be due to invalid IL or missing references)
65110 //IL_05ff: Unknown result type (might be due to invalid IL or missing references)
65111 double num = steps;
65112 Vector2D val = default(Vector2D);
65113 val.X = i;
65114 val.Y = j;
65115 Vector2D val2 = default(Vector2D);
65116 val2.X = (double)genRand.Next(10, 21) * 0.1 * (double)direction;
65117 val2.Y = (double)genRand.Next(-10, 10) * 0.01;
65118 double num2 = genRand.Next(5) + 7;
65119 while (num2 > 0.0)
65120 {
65121 if (num > 0.0)
65122 {
65123 num2 += (double)genRand.Next(3);
65124 num2 -= (double)genRand.Next(3);
65125 if (num2 < 7.0)
65126 {
65127 num2 = 7.0;
65128 }
65129 if (num2 > 20.0)
65130 {
65131 num2 = 20.0;
65132 }
65133 if (num == 1.0 && num2 < 10.0)
65134 {
65135 num2 = 10.0;
65136 }
65137 }
65138 else
65139 {
65140 num2 -= (double)genRand.Next(4);
65141 }
65142 if (val.Y > Main.rockLayer && num > 0.0)
65143 {
65144 num = 0.0;
65145 }
65146 num -= 1.0;
65147 int num3 = (int)(val.X - num2 * 0.5);
65148 int num4 = (int)(val.X + num2 * 0.5);
65149 int num5 = (int)(val.Y - num2 * 0.5);
65150 int num6 = (int)(val.Y + num2 * 0.5);
65151 if (num3 < 0)
65152 {
65153 num3 = 0;
65154 }
65155 if (num4 > Main.maxTilesX - 1)
65156 {
65157 num4 = Main.maxTilesX - 1;
65158 }
65159 if (num5 < 0)
65160 {
65161 num5 = 0;
65162 }
65163 if (num6 > Main.maxTilesY)
65164 {
65165 num6 = Main.maxTilesY;
65166 }
65167 for (int k = num3; k < num4; k++)
65168 {
65169 for (int l = num5; l < num6; l++)
65170 {
65171 if (Math.Abs((double)k - val.X) + Math.Abs((double)l - val.Y) < num2 * 0.5 * (1.0 + (double)genRand.Next(-10, 11) * 0.015) && Main.tile[k, l].type != 31 && Main.tile[k, l].type != 22)
65172 {
65173 Main.tile[k, l].active(active: false);
65174 }
65175 }
65176 }
65177 val += val2;
65178 val2.Y += (double)genRand.Next(-10, 10) * 0.1;
65179 if (val.Y < (double)(j - 20))
65180 {
65181 val2.Y += (double)genRand.Next(20) * 0.01;
65182 }
65183 if (val.Y > (double)(j + 20))
65184 {
65185 val2.Y -= (double)genRand.Next(20) * 0.01;
65186 }
65187 if (val2.Y < -0.5)
65188 {
65189 val2.Y = -0.5;
65190 }
65191 if (val2.Y > 0.5)
65192 {
65193 val2.Y = 0.5;
65194 }
65195 val2.X += (double)genRand.Next(-10, 11) * 0.01;
65196 switch (direction)
65197 {
65198 case -1:
65199 if (val2.X > -0.5)
65200 {
65201 val2.X = -0.5;
65202 }
65203 if (val2.X < -2.0)
65204 {
65205 val2.X = -2.0;
65206 }
65207 break;
65208 case 1:
65209 if (val2.X < 0.5)
65210 {
65211 val2.X = 0.5;
65212 }
65213 if (val2.X > 2.0)
65214 {
65215 val2.X = 2.0;
65216 }
65217 break;
65218 }
65219 num3 = (int)(val.X - num2 * 1.1);
65220 num4 = (int)(val.X + num2 * 1.1);
65221 num5 = (int)(val.Y - num2 * 1.1);
65222 num6 = (int)(val.Y + num2 * 1.1);
65223 if (num3 < 1)
65224 {
65225 num3 = 1;
65226 }
65227 if (num4 > Main.maxTilesX - 1)
65228 {
65229 num4 = Main.maxTilesX - 1;
65230 }
65231 if (num5 < 0)
65232 {
65233 num5 = 0;
65234 }
65235 if (num6 > Main.maxTilesY)
65236 {
65237 num6 = Main.maxTilesY;
65238 }
65239 for (int m = num3; m < num4; m++)
65240 {
65241 for (int n = num5; n < num6; n++)
65242 {
65243 if (Math.Abs((double)m - val.X) + Math.Abs((double)n - val.Y) < num2 * 1.1 * (1.0 + (double)genRand.Next(-10, 11) * 0.015) && Main.tile[m, n].wall != 3)
65244 {
65245 if (Main.tile[m, n].type != 25 && n > j + genRand.Next(3, 20))
65246 {
65247 Main.tile[m, n].active(active: true);
65248 }
65249 Main.tile[m, n].active(active: true);
65250 if (Main.tile[m, n].type != 31 && Main.tile[m, n].type != 22)
65251 {
65252 Main.tile[m, n].type = 25;
65253 }
65254 if (Main.tile[m, n].wall == 2)
65255 {
65256 Main.tile[m, n].wall = 0;
65257 }
65258 }
65259 }
65260 }
65261 for (int num7 = num3; num7 < num4; num7++)
65262 {
65263 for (int num8 = num5; num8 < num6; num8++)
65264 {
65265 if (Math.Abs((double)num7 - val.X) + Math.Abs((double)num8 - val.Y) < num2 * 1.1 * (1.0 + (double)genRand.Next(-10, 11) * 0.015) && Main.tile[num7, num8].wall != 3)
65266 {
65267 if (Main.tile[num7, num8].type != 31 && Main.tile[num7, num8].type != 22)
65268 {
65269 Main.tile[num7, num8].type = 25;
65270 }
65271 Main.tile[num7, num8].active(active: true);
65272 PlaceWall(num7, num8, 3, mute: true);
65273 }
65274 }
65275 }
65276 }
65277 if (genRand.Next(3) == 0)
65278 {
65279 int num9 = (int)val.X;
65280 int num10;
65281 for (num10 = (int)val.Y; !Main.tile[num9, num10].active(); num10++)
65282 {
65283 }
65284 TileRunner(num9, num10, genRand.Next(2, 6), genRand.Next(3, 7), 22);
65285 }
65286 }
static double Abs(double value)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void PlaceWall(int i, int j, int type, bool mute=false)
static void TileRunner(int i, int j, double strength, int steps, int type, bool addTile=false, double speedX=0.0, double speedY=0.0, bool noYChange=false, bool overRide=true, int ignoreTileType=-1)

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