Skip to content
Snippets Groups Projects
Commit f2a797e4 authored by Chris Davidson's avatar Chris Davidson
Browse files

Fix friendly fire disable for talent_on procs

parent f84609ec
No related branches found
No related tags found
No related merge requests found
......@@ -756,6 +756,9 @@ function _M:attackTargetHitProcs(target, weapon, dam, apr, armor, damtype, mult,
end
-- On hit talent
-- Disable friendly fire for procs since players can't control when they happen or where they hit
local old_ff = self.nullify_all_friendlyfire
self.nullify_all_friendlyfire = true
if hitted and not target.dead and weapon and weapon.talent_on_hit and next(weapon.talent_on_hit) and not self.turn_procs.melee_talent then
for tid, data in pairs(weapon.talent_on_hit) do
if rng.percent(data.chance) then
......@@ -773,6 +776,7 @@ function _M:attackTargetHitProcs(target, weapon, dam, apr, armor, damtype, mult,
end
end
end
self.nullify_all_friendlyfire = old_ff
-- Shattering Impact
if hitted and self:attr("shattering_impact") and (not self.shattering_impact_last_turn or self.shattering_impact_last_turn < game.turn) then
......
......@@ -571,7 +571,8 @@ setDefaultProjector(function(src, x, y, type, dam, state)
if src.__projecting_for then
-- Disable friendly fire for procs since players can't control when they happen or where they hit
src.nullify_all_friendlyfire = 1
local old_ff = src.nullify_all_friendlyfire
src.nullify_all_friendlyfire = true
if src.talent_on_spell and next(src.talent_on_spell) and t.is_spell and not src.turn_procs.spell_talent then
for id, d in pairs(src.talent_on_spell) do
if rng.percent(d.chance) and t.id ~= d.talent then
......@@ -604,7 +605,7 @@ setDefaultProjector(function(src, x, y, type, dam, state)
end
end
end
src.nullify_all_friendlyfire = nil
src.nullify_all_friendlyfire = old_ff
if not target.dead and (t.is_spell or t.is_mind) and not src.turn_procs.meteoric_crash and src.knowTalent and src:knowTalent(src.T_METEORIC_CRASH) then
src.turn_procs.meteoric_crash = true
......
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