- local line_of_sight = minetest.line_of_sight(pos, pos2)
- if line_of_sight == true then
- self.punch_timer = 1
- object:punch(self.object, 2,
- {
- full_punch_interval=1.5,
- damage_groups = {fleshy=2},
- },vector.direction(pos,pos2))
+ local meta = object:get_meta()
+ local player_punch_timer = meta:get_float("player_punch_timer")
+ if player_punch_timer <= 0 then
+ local line_of_sight = minetest.line_of_sight(pos, pos2)
+ if line_of_sight == true then
+ self.punch_timer = 0.25
+ object:punch(self.object, 2,
+ {
+ full_punch_interval=1.5,
+ damage_groups = {damage=self.attack_damage},
+ },vector.direction(pos,pos2))
+ end