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 /util.lua | |
parent | ee0cf5538a865ebaeaafa93d5303e820dfcd1ea3 (diff) |
Add damage-dealing to the digger heads
Diffstat (limited to 'util.lua')
-rw-r--r-- | util.lua | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -429,4 +429,19 @@ digtron.update_builder_item = function(pos) digtron.create_builder_item = item_stack:get_name() minetest.add_entity(pos,"digtron:builder_item") end -end
\ No newline at end of file +end + +digtron.damage_creatures = function(player, pos, amount) + local objects = minetest.env:get_objects_inside_radius(pos, 1.0) + if objects ~= nil then + for _, obj in ipairs(objects) do + if obj then + obj:punch(player, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = amount}, + }, nil ) + end + end + end +end +
\ No newline at end of file |