forked from minetest-mods/BobBlocks
minetest.env:* --> minetest.*
This commit is contained in:
parent
f38635c3ec
commit
42f087b67f
@ -41,7 +41,7 @@ local update_bobblock = function (pos, node)
|
|||||||
elseif node.name == 'bobblocks:whitepole_off' then nodename = 'bobblocks:whitepole'
|
elseif node.name == 'bobblocks:whitepole_off' then nodename = 'bobblocks:whitepole'
|
||||||
elseif node.name == 'bobblocks:whitepole' then nodename = 'bobblocks:whitepole_off'
|
elseif node.name == 'bobblocks:whitepole' then nodename = 'bobblocks:whitepole_off'
|
||||||
end
|
end
|
||||||
minetest.env:add_node(pos, {name = nodename})
|
minetest.add_node(pos, {name = nodename})
|
||||||
minetest.sound_play("bobblocks_glassblock",
|
minetest.sound_play("bobblocks_glassblock",
|
||||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||||
end
|
end
|
||||||
|
@ -14,7 +14,7 @@ local update_healthpack = function (pos, node)
|
|||||||
elseif node.name == 'bobblocks:health_on' then
|
elseif node.name == 'bobblocks:health_on' then
|
||||||
nodename = 'bobblocks:health_off'
|
nodename = 'bobblocks:health_off'
|
||||||
end
|
end
|
||||||
minetest.env:add_node(pos, {name = nodename})
|
minetest.add_node(pos, {name = nodename})
|
||||||
end
|
end
|
||||||
|
|
||||||
local toggle_healthpack = function (pos, node)
|
local toggle_healthpack = function (pos, node)
|
||||||
@ -69,12 +69,12 @@ minetest.register_abm(
|
|||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
minetest.sound_play("bobblocks_health",
|
minetest.sound_play("bobblocks_health",
|
||||||
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
{pos = pos, gain = 1.0, max_hear_distance = 32,})
|
||||||
obj:set_hp(obj:get_hp()+10) -- give 10HP
|
obj:set_hp(obj:get_hp()+10) -- give 10HP
|
||||||
minetest.env:remove_node(pos) -- remove the node after use
|
minetest.remove_node(pos) -- remove the node after use
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
10
trap.lua
10
trap.lua
@ -11,7 +11,7 @@ local update_bobtrap = function (pos, node)
|
|||||||
elseif node.name == 'bobblocks:trap_spike_major' then nodename = 'bobblocks:trap_spike_major_set'
|
elseif node.name == 'bobblocks:trap_spike_major' then nodename = 'bobblocks:trap_spike_major_set'
|
||||||
elseif node.name == 'bobblocks:trap_spike_major_set' then nodename = 'bobblocks:trap_spike_major'
|
elseif node.name == 'bobblocks:trap_spike_major_set' then nodename = 'bobblocks:trap_spike_major'
|
||||||
end
|
end
|
||||||
minetest.env:add_node(pos, {name = nodename})
|
minetest.add_node(pos, {name = nodename})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Punch Traps
|
-- Punch Traps
|
||||||
@ -35,7 +35,7 @@ minetest.register_abm(
|
|||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
|
|
||||||
update_bobtrap(pos, node)
|
update_bobtrap(pos, node)
|
||||||
@ -49,7 +49,7 @@ minetest.register_abm(
|
|||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
|
|
||||||
update_bobtrap(pos, node)
|
update_bobtrap(pos, node)
|
||||||
@ -158,7 +158,7 @@ minetest.register_abm(
|
|||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
obj:set_hp(obj:get_hp()-1)
|
obj:set_hp(obj:get_hp()-1)
|
||||||
minetest.sound_play("bobblocks_trap_fall",
|
minetest.sound_play("bobblocks_trap_fall",
|
||||||
@ -172,7 +172,7 @@ minetest.register_abm(
|
|||||||
interval = 1.0,
|
interval = 1.0,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local objs = minetest.env:get_objects_inside_radius(pos, 1)
|
local objs = minetest.get_objects_inside_radius(pos, 1)
|
||||||
for k, obj in pairs(objs) do
|
for k, obj in pairs(objs) do
|
||||||
obj:set_hp(obj:get_hp()-100)
|
obj:set_hp(obj:get_hp()-100)
|
||||||
minetest.sound_play("bobblocks_trap_fall",
|
minetest.sound_play("bobblocks_trap_fall",
|
||||||
|
Loading…
Reference in New Issue
Block a user