Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Conditions.cs
Go to the documentation of this file.
2
3public static class Conditions
4{
5 public class IsTile : GenCondition
6 {
7 private ushort[] _types;
8
9 public IsTile(params ushort[] types)
10 {
11 _types = types;
12 }
13
14 protected override bool CheckValidity(int x, int y)
15 {
16 if (GenBase._tiles[x, y].active())
17 {
18 for (int i = 0; i < _types.Length; i++)
19 {
20 if (GenBase._tiles[x, y].type == _types[i])
21 {
22 return true;
23 }
24 }
25 }
26 return false;
27 }
28 }
29
30 public class Continue : GenCondition
31 {
32 protected override bool CheckValidity(int x, int y)
33 {
34 return false;
35 }
36 }
37
39 {
40 protected override bool CheckValidity(int x, int y)
41 {
42 if (GenBase._tiles[x, y].active() && !Main.tileCut[GenBase._tiles[x, y].type])
43 {
44 return GenBase._tiles[x, y].type != 504;
45 }
46 return false;
47 }
48 }
49
50 public class IsSolid : GenCondition
51 {
52 protected override bool CheckValidity(int x, int y)
53 {
54 if (!WorldGen.InWorld(x, y, 10))
55 {
56 return false;
57 }
58 if (GenBase._tiles[x, y].active())
59 {
60 return Main.tileSolid[GenBase._tiles[x, y].type];
61 }
62 return false;
63 }
64 }
65
66 public class HasLava : GenCondition
67 {
68 protected override bool CheckValidity(int x, int y)
69 {
70 if (GenBase._tiles[x, y].liquid > 0)
71 {
72 return GenBase._tiles[x, y].liquidType() == 1;
73 }
74 return false;
75 }
76 }
77
78 public class NotNull : GenCondition
79 {
80 protected override bool CheckValidity(int x, int y)
81 {
82 return GenBase._tiles[x, y] != null;
83 }
84 }
85}
static bool[] tileCut
Definition Main.cs:1433
static bool[] tileSolid
Definition Main.cs:1471
override bool CheckValidity(int x, int y)
Definition Conditions.cs:32
override bool CheckValidity(int x, int y)
Definition Conditions.cs:68
override bool CheckValidity(int x, int y)
Definition Conditions.cs:52
override bool CheckValidity(int x, int y)
Definition Conditions.cs:14
override bool CheckValidity(int x, int y)
Definition Conditions.cs:40
override bool CheckValidity(int x, int y)
Definition Conditions.cs:80
static bool InWorld(int x, int y, int fluff=0)
Definition WorldGen.cs:5816