Skip to content
Snippets Groups Projects
Commit c3609474 authored by DarkGod's avatar DarkGod
Browse files

support attack_recurse combat property

parent 09cdd1f9
No related branches found
No related tags found
No related merge requests found
......@@ -1068,6 +1068,22 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
self:attr("silent_heal", -1)
end
if self.__attacktargetwith_recursing or (weapon and weapon.attack_recurse) then
if self.__attacktargetwith_recursing then
self.__attacktargetwith_recursing = self.__attacktargetwith_recursing - 1
else
self.__attacktargetwith_recursing = weapon.attack_recurse - 1
end
if self.__attacktargetwith_recursing > 0 then
local _, newhitted, newdam = self:attackTargetWith(target, weapon, damtype, mult, force_dam)
hitted = newhitted or hitted
dam = math.max(dam, newdam)
else
self.__attacktargetwith_recursing = nil
end
end
return self:combatSpeed(weapon), hitted, dam
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment