Tweaked rotary power proto, added water turbine and pump.

This commit is contained in:
Aaron Suen 2013-10-27 15:28:02 -04:00
parent c271b80152
commit 5f2b7c57fc

View File

@ -1,9 +1,21 @@
sz = {
facedir_to_dir = { },
pos_alldirs = {
e = { x = 1, y = 0, z = 0 },
w = { x = -1, y = 0, z = 0 },
u = { x = 0, y = 1, z = 0 },
d = { x = 0, y = -1, z = 0 },
n = { x = 0, y = 0, z = 1 },
s = { x = 0, y = 0, z = -1 },
},
pos_zero = { x = 0, y = 0, z = 0 },
pos = function(x, y, z)
return { x = x, y = y, z = z }
end,
pos_eq = function(a, b)
return a.x == b.x
and a.y == b.y
and a.z == b.z
end,
pos_add = function(a, b)
return {
x = a.x + b.x,
@ -49,16 +61,12 @@ sz = {
end,
pos_norm = function(a)
return pos_scale(a, 1 / pos_abs(a))
end
}
end,
for k, v in pairs({
{ x = 1, y = 0, z = 0 },
{ x = -1, y = 0, z = 0 },
{ x = 0, y = 1, z = 0 },
{ x = 0, y = -1, z = 0 },
{ x = 0, y = 0, z = 1 },
{ x = 0, y = 0, z = -1 },
}) do
sz.facedir_to_dir[minetest.dir_to_facedir(v)] = v
end
tbl_shuffle = function(t)
for i = 1, #t, 1 do
local j = math.random(1, #t)
t[i], t[j] = t[j], t[i]
end
end,
}