Hot cobble hurts.

This commit is contained in:
Duane Robertson 2016-04-26 18:04:48 -05:00
parent 80c2d32129
commit 12b65b8fb6
2 changed files with 19 additions and 1 deletions

View file

@ -419,6 +419,24 @@ minetest.register_node("fun_caves:hot_cobble", {
}),
})
minetest.register_abm({
nodenames = {"group:hot"},
interval = 2,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 0.95)) do
if not minetest.registered_nodes[node.name] then
return
end
local dps = minetest.registered_nodes[node.name]["damage_per_second"]
if object.set_hp and object.get_hp and dps then
--print("damage. "..object:get_hp().." hit points left")
object:set_hp(object:get_hp() - dps)
end
end
end})
-- mushroom growth
minetest.register_abm({
nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"},