2020-10-16 14:51:07 -07:00
|
|
|
minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
|
|
|
|
if tool_capabilities.damage_groups.nopunch then return end
|
|
|
|
local class = ctf_classes.get(hitter)
|
2020-10-13 20:00:21 -07:00
|
|
|
|
2020-10-16 14:51:07 -07:00
|
|
|
if class.properties.melee_bonus and hitter:get_wielded_item():get_name():find("sword") then
|
|
|
|
if time_from_last_punch > 0.75 then
|
|
|
|
time_from_last_punch = 0.75
|
2020-10-13 20:00:21 -07:00
|
|
|
end
|
|
|
|
|
2020-10-16 14:51:07 -07:00
|
|
|
player:punch(hitter, 1, {damage_groups = {fleshy = time_from_last_punch*2, nopunch = 1}}, dir)
|
2020-10-13 08:42:41 -07:00
|
|
|
end
|
2020-10-16 14:51:07 -07:00
|
|
|
end)
|