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

◆ OreRunner()

static void Terraria.WorldGen.OreRunner ( int i,
int j,
double strength,
int steps,
ushort type )
inlinestatic

Definition at line 40197 of file WorldGen.cs.

40198 {
40199 //IL_005e: Unknown result type (might be due to invalid IL or missing references)
40200 //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
40201 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
40202 //IL_00cf: Unknown result type (might be due to invalid IL or missing references)
40203 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
40204 //IL_05a7: Unknown result type (might be due to invalid IL or missing references)
40205 //IL_05a8: Unknown result type (might be due to invalid IL or missing references)
40206 //IL_05a9: Unknown result type (might be due to invalid IL or missing references)
40207 //IL_05ae: Unknown result type (might be due to invalid IL or missing references)
40208 //IL_05d3: Unknown result type (might be due to invalid IL or missing references)
40209 //IL_05f4: Unknown result type (might be due to invalid IL or missing references)
40210 //IL_0139: Unknown result type (might be due to invalid IL or missing references)
40211 //IL_0148: Unknown result type (might be due to invalid IL or missing references)
40212 double num = strength;
40213 double num2 = steps;
40214 Vector2D val = default(Vector2D);
40215 val.X = i;
40216 val.Y = j;
40217 Vector2D val2 = default(Vector2D);
40218 val2.X = (double)genRand.Next(-10, 11) * 0.1;
40219 val2.Y = (double)genRand.Next(-10, 11) * 0.1;
40220 while (num > 0.0 && num2 > 0.0)
40221 {
40222 if (val.Y < 0.0 && num2 > 0.0 && type == 59)
40223 {
40224 num2 = 0.0;
40225 }
40226 num = strength * (num2 / (double)steps);
40227 num2 -= 1.0;
40228 int num3 = (int)(val.X - num * 0.5);
40229 int num4 = (int)(val.X + num * 0.5);
40230 int num5 = (int)(val.Y - num * 0.5);
40231 int num6 = (int)(val.Y + num * 0.5);
40232 if (num3 < 0)
40233 {
40234 num3 = 0;
40235 }
40236 if (num4 > Main.maxTilesX)
40237 {
40238 num4 = Main.maxTilesX;
40239 }
40240 if (num5 < 0)
40241 {
40242 num5 = 0;
40243 }
40244 if (num6 > Main.maxTilesY)
40245 {
40246 num6 = Main.maxTilesY;
40247 }
40248 for (int k = num3; k < num4; k++)
40249 {
40250 for (int l = num5; l < num6; l++)
40251 {
40252 if (Math.Abs((double)k - val.X) + Math.Abs((double)l - val.Y) < strength * 0.5 * (1.0 + (double)genRand.Next(-10, 11) * 0.015) && Main.tile[k, l].active() && (Main.tile[k, l].type == 0 || Main.tile[k, l].type == 1 || Main.tile[k, l].type == 23 || Main.tile[k, l].type == 25 || Main.tile[k, l].type == 40 || Main.tile[k, l].type == 53 || Main.tile[k, l].type == 57 || Main.tile[k, l].type == 59 || Main.tile[k, l].type == 60 || Main.tile[k, l].type == 70 || Main.tile[k, l].type == 109 || Main.tile[k, l].type == 112 || Main.tile[k, l].type == 116 || Main.tile[k, l].type == 117 || Main.tile[k, l].type == 147 || Main.tile[k, l].type == 161 || Main.tile[k, l].type == 163 || Main.tile[k, l].type == 164 || Main.tileMoss[Main.tile[k, l].type] || Main.tile[k, l].type == 199 || Main.tile[k, l].type == 200 || Main.tile[k, l].type == 203 || Main.tile[k, l].type == 234 || Main.tile[k, l].type == 396 || Main.tile[k, l].type == 397 || Main.tile[k, l].type == 401 || Main.tile[k, l].type == 403 || Main.tile[k, l].type == 400 || Main.tile[k, l].type == 398 || Main.tile[k, l].type == 399 || Main.tile[k, l].type == 402 || (Main.remixWorld && Main.tile[k, l].type == 230) || (Main.tile[k, l].type == 225 && Main.tile[k, l].wall != 108)))
40253 {
40254 Main.tile[k, l].type = type;
40255 Main.tile[k, l].ClearBlockPaintAndCoating();
40257 if (Main.netMode == 2)
40258 {
40259 NetMessage.SendTileSquare(-1, k, l);
40260 }
40261 }
40262 }
40263 }
40264 val += val2;
40265 val2.X += (double)genRand.Next(-10, 11) * 0.05;
40266 if (val2.X > 1.0)
40267 {
40268 val2.X = 1.0;
40269 }
40270 if (val2.X < -1.0)
40271 {
40272 val2.X = -1.0;
40273 }
40274 }
40275 }
static double Abs(double value)
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static void SquareTileFrame(int i, int j, bool resetFrame=true)

References System.Math.Abs(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, Terraria.Main.netMode, Terraria.NetMessage.SendTileSquare(), Terraria.Main.tile, Terraria.Main.tileMoss, System.type, ReLogic.Utilities.Vector2D.X, and ReLogic.Utilities.Vector2D.Y.