1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-16 15:30:30 +01:00

Added 50% of chance to not drop for arrows

This commit is contained in:
LeMagnesium 2015-07-27 21:44:55 +02:00
parent b4bf593874
commit 5357fc996b
4 changed files with 12 additions and 4 deletions

View File

@ -55,11 +55,13 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
damage_groups={fleshy=damage}, damage_groups={fleshy=damage},
}, nil) }, nil)
self.object:remove() self.object:remove()
if math.random(0,100) % 2 == 0 then -- 50% of chance to drop //MFF (Mg|07/27/15)
minetest.add_item(self.lastpos, "throwing:arrow_dig") minetest.add_item(self.lastpos, "throwing:arrow_dig")
end end
end end
end end
end end
end
if self.lastpos.x~=nil then if self.lastpos.x~=nil then
if node.name ~= "air" then if node.name ~= "air" then

View File

@ -55,11 +55,13 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
damage_groups={fleshy=damage}, damage_groups={fleshy=damage},
}, nil) }, nil)
self.object:remove() self.object:remove()
if math.random(0,100) % 2 == 0 then -- 50% of chance to drop //MFF (Mg|07/27/15)
minetest.add_item(self.lastpos, 'default:stick') minetest.add_item(self.lastpos, 'default:stick')
end end
end end
end end
end end
end
if self.lastpos.x~=nil then if self.lastpos.x~=nil then
if node.name ~= "air" and node.name ~= "throwing:light" then if node.name ~= "air" and node.name ~= "throwing:light" then

View File

@ -58,7 +58,9 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
}, nil) }, nil)
self.object:remove() self.object:remove()
if math.random() < toughness then if math.random() < toughness then
if math.random(0,100) % 2 == 0 then
minetest.add_item(self.lastpos, 'throwing:arrow_' .. kind) minetest.add_item(self.lastpos, 'throwing:arrow_' .. kind)
end
else else
minetest.add_item(self.lastpos, 'default:stick') minetest.add_item(self.lastpos, 'default:stick')
end end

View File

@ -58,7 +58,9 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
self.object:remove() self.object:remove()
local toughness = 0.9 local toughness = 0.9
if math.random() < toughness then if math.random() < toughness then
if math.random(0,100) % 2 == 0 then -- 50% of chance to drop //MFF (Mg|07/27/15)
minetest.add_item(self.lastpos, 'throwing:arrow_torch') minetest.add_item(self.lastpos, 'throwing:arrow_torch')
end
else else
minetest.add_item(self.lastpos, 'default:stick') minetest.add_item(self.lastpos, 'default:stick')
end end