Update 0.9.2: Introduced chance to break for many arrows, added golden bow

This commit is contained in:
echoes91
2015-03-10 16:40:18 +01:00
parent bdc555c290
commit ff044fb1f1
11 changed files with 168 additions and 31 deletions

View File

@ -49,9 +49,18 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
if obj:get_luaentity().name ~= "throwing:arrow_dig_entity" and obj:get_luaentity().name ~= "__builtin:item" then
local damage = 1.5
obj:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=damage},
}, nil)
self.object:remove()
minetest.add_item(pos, 'throwing:arrow_dig')
minetest.dig_node(pos)
local toughness = 0.9
if self.breaks < toughness then
minetest.add_item(self.lastpos, 'throwing:arrow_dig')
else
minetest.add_item(self.lastpos, 'default:stick')
end
end
end
end
@ -60,8 +69,15 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
if self.lastpos.x~=nil then
if node.name ~= "air" then
self.object:remove()
minetest.add_item(self.lastpos, 'throwing:arrow_dig')
minetest.dig_node(pos)
if node.diggable ~= false then
minetest.dig_node(pos)
end
local toughness = 0.65
if self.breaks < toughness then
minetest.add_item(self.lastpos, 'default:pick_steel')
else
minetest.add_item(self.lastpos, 'default:stick')
end
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z}