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

@ -54,12 +54,13 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
if not minetest.setting_getbool("creative_mode") then
self.inventory:remove_item("main", {name=self.stack:get_name()})
end
if self.stack:get_definition().type == "node" and self.stack:get_name() ~= "default:torch" then
minetest.place_node(self.lastpos, {name=self.stack:get_name()})
minetest.add_item(self.lastpos, {name=self.stack:get_name()})
local toughness = 0.95
if self.breaks < toughness then
minetest.add_item(self.lastpos, 'throwing:arrow_build')
else
minetest.add_item(self.lastpos, {name=self.stack:get_name()})
minetest.add_item(self.lastpos, 'default:stick')
end
minetest.add_item(self.lastpos, 'throwing:arrow_build')
end
end
end
@ -71,12 +72,12 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
if not minetest.setting_getbool("creative_mode") then
self.inventory:remove_item("main", {name=self.stack:get_name()})
end
if self.stack:get_definition().type == "node" and self.stack:get_name() ~= "default:torch" then
if not string.find(node.name, "water") and not string.find(node.name, "lava") and not string.find(node.name, "torch") and self.stack:get_definition().type == "node" and self.stack:get_name() ~= "default:torch" then
minetest.place_node(self.lastpos, {name=self.stack:get_name()})
else
minetest.add_item(self.lastpos, {name=self.stack:get_name()})
end
minetest.add_item(self.lastpos, 'throwing:arrow_build')
minetest.add_item(self.lastpos, 'default:shovel_steel')
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z}