Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ChambersEntrance.cs
Go to the documentation of this file.
1using System;
7
9
10public static class ChambersEntrance
11{
12 private struct PathConnection
13 {
14 public readonly Vector2D Position;
15
16 public readonly double Direction;
17
18 public PathConnection(Point position, int direction)
19 {
20 //IL_000f: Unknown result type (might be due to invalid IL or missing references)
21 //IL_0014: Unknown result type (might be due to invalid IL or missing references)
22 Position = new Vector2D((double)position.X, (double)position.Y);
23 Direction = direction;
24 }
25 }
26
27 public static void Place(DesertDescription description)
28 {
29 int num = description.Desert.Center.X + WorldGen.genRand.Next(-40, 41);
30 Point position = new Point(num, description.Surface[num]);
31 PlaceAt(description, position);
32 }
33
34 private static void PlaceAt(DesertDescription description, Point position)
35 {
36 //IL_0286: Unknown result type (might be due to invalid IL or missing references)
37 //IL_0292: Unknown result type (might be due to invalid IL or missing references)
38 //IL_02c0: Unknown result type (might be due to invalid IL or missing references)
39 //IL_02da: Unknown result type (might be due to invalid IL or missing references)
40 //IL_02e4: Unknown result type (might be due to invalid IL or missing references)
41 //IL_02ed: Unknown result type (might be due to invalid IL or missing references)
42 //IL_0311: Unknown result type (might be due to invalid IL or missing references)
43 //IL_0322: Unknown result type (might be due to invalid IL or missing references)
44 //IL_0329: Unknown result type (might be due to invalid IL or missing references)
45 //IL_0330: Unknown result type (might be due to invalid IL or missing references)
46 //IL_0335: Unknown result type (might be due to invalid IL or missing references)
47 //IL_0337: Unknown result type (might be due to invalid IL or missing references)
48 //IL_033b: Unknown result type (might be due to invalid IL or missing references)
49 //IL_0340: Unknown result type (might be due to invalid IL or missing references)
50 //IL_0342: Unknown result type (might be due to invalid IL or missing references)
51 //IL_0346: Unknown result type (might be due to invalid IL or missing references)
52 //IL_034b: Unknown result type (might be due to invalid IL or missing references)
53 //IL_034d: Unknown result type (might be due to invalid IL or missing references)
54 //IL_0351: Unknown result type (might be due to invalid IL or missing references)
56 Point origin = new Point(position.X, position.Y + 2);
59 ShapeData data = new ShapeData();
60 int num = description.Hive.Top - position.Y;
61 int num2 = ((genRand.Next(2) != 0) ? 1 : (-1));
63 {
64 new PathConnection(new Point(position.X + -num2 * 26, position.Y - 8), num2)
65 };
66 int num3 = genRand.Next(2, 4);
67 for (int i = 0; i < num3; i++)
68 {
69 int num4 = (int)((double)(i + 1) / (double)num3 * (double)num) + genRand.Next(-8, 9);
70 int num5 = num2 * genRand.Next(20, 41);
71 int num6 = genRand.Next(18, 29);
72 WorldUtils.Gen(position, new Shapes.Circle(num6 / 2, 3), Actions.Chain(new Modifiers.Offset(num5, num4), new Modifiers.Blotches(), new Actions.Clear().Output(data), new Actions.PlaceWall(187)));
73 list.Add(new PathConnection(new Point(num5 + num6 / 2 * -num2 + position.X, num4 + position.Y), -num2));
74 num2 *= -1;
75 }
76 WorldUtils.Gen(position, new ModShapes.OuterOutline(data), Actions.Chain(new Modifiers.Expand(1), new Modifiers.OnlyTiles(53), new Actions.SetTile(397), new Actions.PlaceWall(187)));
78 Vector2D val2 = default(Vector2D);
79 for (int j = 1; j < list.Count; j++)
80 {
83 double num7 = Math.Abs(pathConnection2.Position.X - pathConnection.Position.X) * 1.5;
84 for (double num8 = 0.0; num8 <= 1.0; num8 += 0.02)
85 {
86 Vector2D val = new Vector2D(pathConnection.Position.X + pathConnection.Direction * num7 * num8, pathConnection.Position.Y);
87 ((Vector2D)(ref val2))._002Ector(pathConnection2.Position.X + pathConnection2.Direction * num7 * (1.0 - num8), pathConnection2.Position.Y);
92 }
93 }
94 WorldUtils.Gen(origin, new Shapes.Rectangle(new Rectangle(-29, -12, 58, 12)), Actions.Chain(new Modifiers.NotInShape(shapeData), new Modifiers.Expand(1), new Actions.PlaceWall(0)));
95 }
96}
static double Abs(double value)
static void Place(DesertDescription description)
static void PlaceAt(DesertDescription description, Point position)
static GenAction Chain(params GenAction[] actions)
Definition Actions.cs:470
GenAction Output(ShapeData data)
Definition GenAction.cs:39
static bool Gen(Point origin, GenShape shape, GenAction action)
Definition WorldUtils.cs:17
static UnifiedRandom genRand
Definition WorldGen.cs:1215
static Vector2D Lerp(Vector2D value1, Vector2D value2, double amount)
Definition Vector2D.cs:216