Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AnthillEntrance.cs
Go to the documentation of this file.
4
6
7public static class AnthillEntrance
8{
9 public static void Place(DesertDescription description)
10 {
11 int num = WorldGen.genRand.Next(2, 4);
12 for (int i = 0; i < num; i++)
13 {
14 int holeRadius = WorldGen.genRand.Next(15, 18);
15 int num2 = (int)((double)(i + 1) / (double)(num + 1) * (double)description.Surface.Width);
16 num2 += description.Desert.Left;
17 int y = description.Surface[num2];
18 PlaceAt(description, new Point(num2, y), holeRadius);
19 }
20 }
21
22 private static void PlaceAt(DesertDescription description, Point position, int holeRadius)
23 {
24 //IL_0036: Unknown result type (might be due to invalid IL or missing references)
25 ShapeData data = new ShapeData();
26 Point origin = new Point(position.X, position.Y + 6);
27 WorldUtils.Gen(origin, new Shapes.Tail(holeRadius * 2, new Vector2D(0.0, (double)(-holeRadius) * 1.5)), Actions.Chain(new Actions.SetTile(53).Output(data)));
28 GenShapeActionPair genShapeActionPair = new GenShapeActionPair(new Shapes.Rectangle(1, 1), Actions.Chain(new Modifiers.Blotches(), new Modifiers.IsSolid(), new Actions.Clear(), new Actions.PlaceWall(187)));
29 GenShapeActionPair genShapeActionPair2 = new GenShapeActionPair(new Shapes.Rectangle(1, 1), Actions.Chain(new Modifiers.IsSolid(), new Actions.Clear(), new Actions.PlaceWall(187)));
31 GenShapeActionPair pair2 = new GenShapeActionPair(new Shapes.Circle(holeRadius, 3), Actions.Chain(new Modifiers.SkipWalls(187), new Actions.SetTile(53)));
32 GenShapeActionPair pair3 = new GenShapeActionPair(new Shapes.Circle(holeRadius - 2, 3), Actions.Chain(new Actions.PlaceWall(187)));
33 int num = position.X;
34 for (int i = position.Y - holeRadius - 3; i < description.Hive.Top + (position.Y - description.Desert.Top) * 2 + 12; i++)
35 {
36 WorldUtils.Gen(new Point(num, i), (i < position.Y) ? genShapeActionPair2 : genShapeActionPair);
37 WorldUtils.Gen(new Point(num, i), pair);
38 if (i % 3 == 0 && i >= position.Y)
39 {
40 num += WorldGen.genRand.Next(-1, 2);
41 WorldUtils.Gen(new Point(num, i), genShapeActionPair);
42 if (i >= position.Y + 5)
43 {
44 WorldUtils.Gen(new Point(num, i), pair2);
45 WorldUtils.Gen(new Point(num, i), pair3);
46 }
47 WorldUtils.Gen(new Point(num, i), pair);
48 }
49 }
50 WorldUtils.Gen(new Point(origin.X, origin.Y - (int)((double)holeRadius * 1.5) + 3), new Shapes.Circle(holeRadius / 2, holeRadius / 3), Actions.Chain(Actions.Chain(new Actions.ClearTile(), new Modifiers.Expand(1), new Actions.PlaceWall(0))));
51 WorldUtils.Gen(origin, new ModShapes.All(data), new Actions.Smooth());
52 }
53}
static void Place(DesertDescription description)
static void PlaceAt(DesertDescription description, Point position, int holeRadius)
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