mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-12-21 17:15:32 +01:00
remove spears, improve and fix bug in throwing mod
This commit is contained in:
@@ -50,11 +50,15 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
for k, obj in pairs(objs) do
|
||||
local objpos = obj:getpos()
|
||||
if throwing_is_player(self.player, obj) or throwing_is_entity(obj) then
|
||||
if (pos.x - objpos.x < 0.5 and pos.x - objpos.x > -0.5) and (pos.z - objpos.z < 0.5 and pos.z - objpos.z > -0.5) then
|
||||
obj:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=eq},
|
||||
}, nil)
|
||||
if throwing_touch(pos, objpos) then
|
||||
local puncher = self.object
|
||||
if self.player and minetest.get_player_by_name(self.player) then
|
||||
puncher = minetest.get_player_by_name(self.player)
|
||||
end
|
||||
obj:punch(puncher, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=eq},
|
||||
}, nil)
|
||||
if math.random() < toughness then
|
||||
if math.random(0,100) % 2 == 0 then
|
||||
minetest.add_item(self.lastpos, 'throwing:arrow_' .. kind)
|
||||
@@ -67,7 +71,12 @@ function throwing_register_arrow_standard (kind, desc, eq, toughness, craft)
|
||||
end
|
||||
end
|
||||
end
|
||||
if node.name ~= "air" and not string.find(node.name, 'water_') and not string.find(node.name, 'grass') and not string.find(node.name, 'flowers:') and not string.find(node.name, 'farming:') and not string.find(node.name, 'fire:') then
|
||||
if node.name ~= "air"
|
||||
and not string.find(node.name, 'water_')
|
||||
and not (string.find(node.name, 'grass') and not string.find(node.name, 'dirt'))
|
||||
and not (string.find(node.name, 'farming:') and not string.find(node.name, 'soil'))
|
||||
and not string.find(node.name, 'flowers:')
|
||||
and not string.find(node.name, 'fire:') then
|
||||
if math.random() < toughness then
|
||||
minetest.add_item(self.lastpos, 'throwing:arrow_' .. kind)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user