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

◆ Perform()

override bool Terraria.GameContent.Generation.ShapeRunner.Perform ( Point origin,
GenAction action )
inline

Definition at line 25 of file ShapeRunner.cs.

26 {
27 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
28 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
29 //IL_005d: Unknown result type (might be due to invalid IL or missing references)
30 //IL_003f: Unknown result type (might be due to invalid IL or missing references)
31 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
32 //IL_0081: Unknown result type (might be due to invalid IL or missing references)
33 //IL_009a: Unknown result type (might be due to invalid IL or missing references)
34 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
35 //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
36 //IL_0198: Unknown result type (might be due to invalid IL or missing references)
37 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
38 //IL_019b: Unknown result type (might be due to invalid IL or missing references)
39 //IL_01a0: Unknown result type (might be due to invalid IL or missing references)
40 //IL_0102: Unknown result type (might be due to invalid IL or missing references)
41 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
42 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
43 //IL_01a7: Unknown result type (might be due to invalid IL or missing references)
44 //IL_01a9: Unknown result type (might be due to invalid IL or missing references)
45 //IL_01ae: Unknown result type (might be due to invalid IL or missing references)
46 //IL_01af: Unknown result type (might be due to invalid IL or missing references)
47 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
48 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
49 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
50 //IL_01e0: Unknown result type (might be due to invalid IL or missing references)
51 //IL_01f9: Unknown result type (might be due to invalid IL or missing references)
52 //IL_01fe: Unknown result type (might be due to invalid IL or missing references)
53 //IL_0203: Unknown result type (might be due to invalid IL or missing references)
54 //IL_0205: Unknown result type (might be due to invalid IL or missing references)
55 //IL_0207: Unknown result type (might be due to invalid IL or missing references)
56 //IL_020c: Unknown result type (might be due to invalid IL or missing references)
57 //IL_0211: Unknown result type (might be due to invalid IL or missing references)
58 //IL_0216: Unknown result type (might be due to invalid IL or missing references)
59 //IL_021b: Unknown result type (might be due to invalid IL or missing references)
60 double num = _steps;
61 double num2 = _steps;
62 double num3 = _startStrength;
63 Vector2D val = default(Vector2D);
64 ((Vector2D)(ref val))._002Ector((double)origin.X, (double)origin.Y);
65 Vector2D val2 = ((_startVelocity == Vector2D.Zero) ? Utils.RandomVector2D(GenBase._random, -1.0, 1.0) : _startVelocity);
66 while (num > 0.0 && num3 > 0.0)
67 {
68 num3 = _startStrength * (num / num2);
69 num -= 1.0;
70 int num4 = Math.Max(1, (int)(val.X - num3 * 0.5));
71 int num5 = Math.Max(1, (int)(val.Y - num3 * 0.5));
72 int num6 = Math.Min(GenBase._worldWidth, (int)(val.X + num3 * 0.5));
73 int num7 = Math.Min(GenBase._worldHeight, (int)(val.Y + num3 * 0.5));
74 for (int i = num4; i < num6; i++)
75 {
76 for (int j = num5; j < num7; j++)
77 {
78 if (!(Math.Abs((double)i - val.X) + Math.Abs((double)j - val.Y) >= num3 * 0.5 * (1.0 + (double)GenBase._random.Next(-10, 11) * 0.015)))
79 {
80 UnitApply(action, origin, i, j);
81 }
82 }
83 }
84 int num8 = (int)(num3 / 50.0) + 1;
85 num -= (double)num8;
86 val += val2;
87 for (int k = 0; k < num8; k++)
88 {
89 val += val2;
90 val2 += Utils.RandomVector2D(GenBase._random, -0.5, 0.5);
91 }
92 val2 += Utils.RandomVector2D(GenBase._random, -0.5, 0.5);
93 val2 = Vector2D.Clamp(val2, -Vector2D.One, Vector2D.One);
94 }
95 return true;
96 }
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static double Abs(double value)
static byte Max(byte val1, byte val2)
Definition Math.cs:738
static UnifiedRandom _random
Definition GenBase.cs:9
bool UnitApply(GenAction action, Point origin, int x, int y, params object[] args)
Definition GenShape.cs:13
static Vector2D Zero
Definition Vector2D.cs:24
static Vector2D Clamp(Vector2D value1, Vector2D min, Vector2D max)
Definition Vector2D.cs:126
static Vector2D One
Definition Vector2D.cs:26

References Terraria.WorldBuilding.GenBase._random, Terraria.GameContent.Generation.ShapeRunner._startStrength, Terraria.GameContent.Generation.ShapeRunner._startVelocity, Terraria.GameContent.Generation.ShapeRunner._steps, Terraria.WorldBuilding.GenBase._worldHeight, Terraria.WorldBuilding.GenBase._worldWidth, System.Math.Abs(), System.action, ReLogic.Utilities.Vector2D.Clamp(), System.Math.Max(), System.Math.Min(), ReLogic.Utilities.Vector2D.One, Terraria.Utils.RandomVector2D(), Terraria.WorldBuilding.GenShape.UnitApply(), Microsoft.Xna.Framework.Point.X, ReLogic.Utilities.Vector2D.X, Microsoft.Xna.Framework.Point.Y, ReLogic.Utilities.Vector2D.Y, and ReLogic.Utilities.Vector2D.Zero.