rahonejm wrote:Bugged on the latest version :( The game shuts when you shot...
MirceaKitsune wrote:This is a very nice mod! Seems to work a lot like the MC bow as well. This one I hope will be included as part of the default mod and Minetest.
Only objection is the crafting pattern for the bow. Instead of using planks there, I believe using sticks would be more appropriate. Otherwise, looks excellent and I'll try it out soon :)
-- Arrow_entity.on_step()--> called when arrow is moving
THROWING_ARROW_ENTITY.on_step = function(self, dtime)
self.timer=self.timer+dtime
local pos = self.object:getpos()
local node = minetest.env:get_node(pos)
-- When arrow is away from player (after 0.2 seconds): Cause damage to mobs and players
if self.timer>0.2 then
local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 2)
for k, obj in pairs(objs) do
if obj:get_luaentity() ~= nil then
name = obj:get_luaentity().name
else
name = nil
end
if name ~= "throwing:arrow_entity" and obj:get_hp() > 0 then
obj:set_hp(obj:get_hp()-ARROW_DAMAGE)
if obj:get_hp()<=0 then
obj:remove()
end
self.object:remove()
return
end
end
end
-- Become item when hitting a node
if self.lastpos.x~=nil then --If there is no lastpos for some reason
if node.name ~= "air" then
minetest.env:add_item(self.lastpos, 'throwing:arrow')
self.object:remove()
return
end
end
self.lastpos={x=pos.x, y=pos.y, z=pos.z} -- Set lastpos-->Item will be added at last pos outside the node
end
I have the junglegrass mod installed
Stef wrote:im will try to make morearrows mod, including:
-TNT arrows
-FIRE arrows
other arrows needed???
Stef wrote:im will try to make morearrows mod, including:
-TNT arrows
-FIRE arrows
other arrows needed???
Users browsing this forum: No registered users and 4 guests