Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ActionVines.cs
Go to the documentation of this file.
3
5
6public class ActionVines : GenAction
7{
8 private int _minLength;
9
10 private int _maxLength;
11
12 private int _vineId;
13
14 public ActionVines(int minLength = 6, int maxLength = 10, int vineId = 52)
15 {
16 _minLength = minLength;
17 _maxLength = maxLength;
18 _vineId = vineId;
19 }
20
21 public override bool Apply(Point origin, int x, int y, params object[] args)
22 {
23 int num = GenBase._random.Next(_minLength, _maxLength + 1);
24 int i;
25 for (i = 0; i < num && !GenBase._tiles[x, y + i].active(); i++)
26 {
27 GenBase._tiles[x, y + i].type = (ushort)_vineId;
28 GenBase._tiles[x, y + i].active(active: true);
29 }
30 if (i > 0)
31 {
32 return UnitApply(origin, x, y, args);
33 }
34 return false;
35 }
36}
override bool Apply(Point origin, int x, int y, params object[] args)
ActionVines(int minLength=6, int maxLength=10, int vineId=52)
bool UnitApply(Point origin, int x, int y, params object[] args)
Definition GenAction.cs:15
static UnifiedRandom _random
Definition GenBase.cs:9