poking around with gates

master
Izzy 2019-07-23 15:24:05 -06:00
parent a8603787d1
commit da1618ff83
2 changed files with 88 additions and 0 deletions

View File

@ -1,6 +1,83 @@
local gate_list = {}
minetest.register_node("potions:gate_horizon", {
description = "Gate Horizon",
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
sunlight_propagates = true,
paramtype2 = "facedir",
tiles = {
{
name = "default_water_source_animated.png^[colorize:purple:180",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
{
name = "default_water_source_animated.png^[colorize:purple:180",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
groups = {cracky=3},
alpha = 160,
-- pointable = false,
walkable = false,
post_effect_color = {a = 103, r = 160, g = 60, b = 190},
sounds = default.node_sound_water_defaults(),
-- drop = "xpanes:" .. name .. "_flat",
node_box = {
type = "fixed",
fixed = {{-3/2, -3/2, -1/32, 3/2, 3/2, 1/32}},
},
selection_box = {
type = "fixed",
fixed = {{-3/2, -3/2, -1/32, 3/2, 3/2, 1/32}},
},
on_timer = function (pos, elapsed)
local node = minetest.get_node(pos)
local objs = minetest.get_objects_inside_radius(pos, 2)
for k, obj in pairs(objs) do
if obj:is_player() then
local objpos = obj:getpos()
if #gate_list > 0 then
local p = gate_list[math.random(#gate_list)]
obj:setpos(p)
end
print("player in gate")
end
end
return true
end,
on_construct = function(pos)
minetest.get_node_timer(pos):start(3)
end,
})
@ -28,6 +105,15 @@ local function check_gate(pos)
if not is_gate_node({x=pos.x+2, y=pos.y+3, z=pos.z}) then return false end
local center = {x=pos.x, y=pos.y + 2, z=pos.z}
minetest.set_node(center, {name="potions:gate_horizon"})
table.insert(gate_list, center);
--[[
minetest.add_particlespawner({
amount = 200,
time = 2,
@ -43,6 +129,7 @@ local function check_gate(pos)
maxsize = 5.2,
texture = "tnt_smoke.png",
})
]]
return true

View File

@ -141,6 +141,7 @@ creosote bush
pirate ships, treasure chests
quicksand
mayan temples on top of mountains
poppies
magic beanstalk
arching bridge