1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-12-20 16:55:19 +01:00

add bow damage

This commit is contained in:
2016-05-04 15:20:02 +02:00
parent 7f7e6f0fa7
commit e9d29dc779
9 changed files with 30 additions and 2 deletions

View File

@@ -38,6 +38,7 @@ local THROWING_ARROW_ENTITY={
collisionbox = {0,0,0,0,0,0},
node = "",
player = "",
bow_damage = 0,
}
THROWING_ARROW_ENTITY.on_step = function(self, dtime)
@@ -55,6 +56,9 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
puncher = minetest.get_player_by_name(self.player)
end
local damage = 0.5
if self.bow_damage and self.bow_damage > 0 then
damage = damage + (self.bow_damage/12)
end
obj:punch(puncher, 1.0, {
full_punch_interval=1.0,
damage_groups={fleshy=damage},