Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HoneyPatchBiome.cs
Go to the documentation of this file.
3
5
7{
8 public override bool Place(Point origin, StructureMap structures)
9 {
10 if (GenBase._tiles[origin.X, origin.Y].active() && WorldGen.SolidTile(origin.X, origin.Y))
11 {
12 return false;
13 }
14 if (!WorldUtils.Find(origin, Searches.Chain(new Searches.Down(80), new Conditions.IsSolid()), out var result))
15 {
16 return false;
17 }
18 result.Y += 2;
19 Ref<int> @ref = new Ref<int>(0);
20 WorldUtils.Gen(result, new Shapes.Circle(8), Actions.Chain(new Modifiers.IsSolid(), new Actions.Scanner(@ref)));
21 if (@ref.Value < 20)
22 {
23 return false;
24 }
25 if (!structures.CanPlace(new Rectangle(result.X - 8, result.Y - 8, 16, 16)))
26 {
27 return false;
28 }
29 WorldUtils.Gen(result, new Shapes.Circle(8), Actions.Chain(new Modifiers.RadialDither(0.0, 10.0), new Modifiers.IsSolid(), new Actions.SetTile(229, setSelfFrames: true)));
30 ShapeData data = new ShapeData();
31 WorldUtils.Gen(result, new Shapes.Circle(4, 3), Actions.Chain(new Modifiers.Blotches(), new Modifiers.IsSolid(), new Actions.ClearTile(frameNeighbors: true), new Modifiers.RectangleMask(-6, 6, 0, 3).Output(data), new Actions.SetLiquid(2)));
32 WorldUtils.Gen(new Point(result.X, result.Y + 1), new ModShapes.InnerOutline(data), Actions.Chain(new Modifiers.IsEmpty(), new Modifiers.RectangleMask(-6, 6, 1, 3), new Actions.SetTile(59, setSelfFrames: true)));
33 structures.AddProtectedStructure(new Rectangle(result.X - 8, result.Y - 8, 16, 16));
34 return true;
35 }
36}
override bool Place(Point origin, StructureMap structures)
T Value
Definition Ref.cs:5
static GenAction Chain(params GenAction[] actions)
Definition Actions.cs:470
GenAction Output(ShapeData data)
Definition GenAction.cs:39
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
Definition Searches.cs:123
void AddProtectedStructure(Rectangle area, int padding=0)
bool CanPlace(Rectangle area, int padding=0)
static bool Find(Point origin, GenSearch search, out Point result)
Definition WorldUtils.cs:27
static bool Gen(Point origin, GenShape shape, GenAction action)
Definition WorldUtils.cs:17
static bool SolidTile(Tile testTile)