diff options
author | FaceDeer <derksenmobile@gmail.com> | 2017-01-06 23:48:48 -0700 |
---|---|---|
committer | FaceDeer <derksenmobile@gmail.com> | 2017-01-06 23:48:48 -0700 |
commit | 257863b8884837623f39d8381ce4d7454b52add5 (patch) | |
tree | 4ddfeebe53138aa3c1c092d2b087392171b438c5 /node_controllers.lua | |
parent | ee0cf5538a865ebaeaafa93d5303e820dfcd1ea3 (diff) |
Add damage-dealing to the digger heads
Diffstat (limited to 'node_controllers.lua')
-rw-r--r-- | node_controllers.lua | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/node_controllers.lua b/node_controllers.lua index 6ff857e..45abebd 100644 --- a/node_controllers.lua +++ b/node_controllers.lua @@ -208,7 +208,18 @@ local execute_cycle = function(pos, clicker) player_pos.z >= layout.extents.min_z - 1 and player_pos.z <= layout.extents.max_z + 1 then move_player = true end - + + -- damage the weak flesh + if digtron.diggers_damage_creatures then + for k, location in pairs(layout.diggers) do + local target = minetest.get_node(location) + local targetdef = minetest.registered_nodes[target.name] + if targetdef.damage_creatures ~= nil then + targetdef.damage_creatures(clicker, location, digtron.find_new_pos(location, target.param2), controlling_coordinate) + end + end + end + --move the array digtron.move_digtron(facing, layout.all, layout.extents, nodes_dug, clicker:get_player_name()) local oldpos = {x=pos.x, y=pos.y, z=pos.z} |