Hot cobble hurts.
This commit is contained in:
parent
80c2d32129
commit
12b65b8fb6
2 changed files with 19 additions and 1 deletions
18
nodes.lua
18
nodes.lua
|
@ -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"},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue