-
Notifications
You must be signed in to change notification settings - Fork 0
/
liquids.lua
158 lines (149 loc) · 5.35 KB
/
liquids.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
local S = moreliquids.getter
for _, state in ipairs({ "flowing", "source" }) do
-- Cryogel
minetest.register_node("moreliquids:cryogel_" .. state, {
description = S(state == "source" and "Cryogel Source" or "Flowing Cryogel"),
drawtype = (state == "source" and "liquid" or "flowingliquid"),
[state == "source" and "tiles" or "special_tiles"] = {
{
name = "cryogel_" .. state .. "_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
}
},
alpha = 160,
paramtype = "light",
paramtype2 = (state == "flowing" and "flowingliquid" or nil),
light_source = (state == "source" and 10 or 8),
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = state,
liquid_alternative_flowing = "moreliquids:cryogel_flowing",
liquid_alternative_source = "moreliquids:cryogel_source",
liquid_viscosity = LAVA_VISC,
liquid_renewable = false,
damage_per_second = 6,
post_effect_color = { a = 160, r = 100, g = 203, b = 203 },
groups = {
liquid = 2,
cold = 6,
freezing = (state == "source" and 32000 or 16000),
not_in_creative_inventory = (state == "flowing" and 1 or nil),
},
})
-- Oil
minetest.register_node("moreliquids:oil_" .. state, {
description = S(state == "source" and "Oil Source" or "Flowing Oil"),
drawtype = (state == "source" and "liquid" or "flowingliquid"),
[state == "source" and "tiles" or "special_tiles"] = {
{
name = "oil_" .. state .. "_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
}
},
paramtype = "light",
paramtype2 = (state == "flowing" and "flowingliquid" or nil),
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = state,
liquid_alternative_flowing = "moreliquids:oil_flowing",
liquid_alternative_source = "moreliquids:oil_source",
liquid_viscosity = LAVA_VISC,
liquid_renewable = false,
post_effect_color = { a = 210, r = 0, g = 0, b = 0 },
groups = {
liquid = 2,
flammable = 1,
not_in_creative_inventory = (state == "flowing" and 1 or nil),
},
})
-- Fuel
minetest.register_node("moreliquids:fuel_" .. state, {
description = S(state == "source" and "Fuel Source" or "Flowing Fuel"),
drawtype = (state == "source" and "liquid" or "flowingliquid"),
[state == "source" and "tiles" or "special_tiles"] = {
{
name = "fuel_" .. state .. "_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
}
},
alpha = 160,
paramtype = "light",
paramtype2 = (state == "flowing" and "flowingliquid" or nil),
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = state,
liquid_alternative_flowing = "moreliquids:fuel_flowing",
liquid_alternative_source = "moreliquids:fuel_source",
liquid_viscosity = LAVA_VISC,
liquid_renewable = false,
post_effect_color = { a = 90, r = 233, g = 187, b = 3 },
groups = {
liquid = 2,
flammable = 1,
not_in_creative_inventory = (state == "flowing" and 1 or nil),
},
})
-- Sewage
minetest.register_node("moreliquids:sewage_" .. state, {
description = S(state == "source" and "Sewage Source" or "Flowing Sewage"),
drawtype = (state == "source" and "liquid" or "flowingliquid"),
[state == "source" and "tiles" or "special_tiles"] = {
{
name = "sewage_" .. state .. "_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 3.0,
},
}
},
alpha = 160,
paramtype = "light",
paramtype2 = (state == "flowing" and "flowingliquid" or nil),
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
drowning = 1,
liquidtype = state,
liquid_alternative_flowing = "moreliquids:sewage_flowing",
liquid_alternative_source = "moreliquids:sewage_source",
liquid_viscosity = WATER_VISC,
liquid_renewable = true,
post_effect_color = { a = 150, r = 172, g = 97, b = 0 },
groups = {
liquid = 2,
flammable = 1,
not_in_creative_inventory = (state == "flowing" and 1 or nil),
},
})
end