From 9ad1c4edc8ba2016e95178aa03291f75b844372a Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Mon, 20 Jan 2014 16:17:22 +0100
Subject: [PATCH] sowitched damage backlash to melee only to make it not
 identical to martyrdom

---
 game/modules/tome/class/Actor.lua            | 8 --------
 game/modules/tome/class/interface/Combat.lua | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index 6781c70186..0222eade01 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -2233,14 +2233,6 @@ function _M:onTakeHit(value, src, death_note)
 			game:delayedLogMessage(src, self, "lifesteal"..self.uid, "#CRIMSON##Source# steals life from #Target#!")
 		end
 	end
-	
-	-- Damage Backlash
-	if value > 0 and src and not src.dead and src.attr and src:attr("damage_backfire") then
-		local hurt = math.min(value, self.life) * src.damage_backfire / 100
-		if hurt > 0 then
-			src:takeHit(hurt, src)
-		end
-	end
 
 	-- Flat damage cap
 	if self.flat_damage_cap and self.max_life and death_note and death_note.damtype then
diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua
index e0d60ba8b4..c398dbb5a6 100644
--- a/game/modules/tome/class/interface/Combat.lua
+++ b/game/modules/tome/class/interface/Combat.lua
@@ -642,6 +642,14 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam)
 		self:incStamina(-15)
 		self.shattering_impact_last_turn = game.turn
 	end
+	
+	-- Damage Backlash
+	if dam > 0 and self.attr and self:attr("damage_backfire") then
+		local hurt = math.min(dam, target.life) * self.damage_backfire / 100
+		if hurt > 0 then
+			self:takeHit(hurt, self)
+		end
+	end
 
 	-- Burst on Hit
 	if hitted and weapon and weapon.burst_on_hit then
-- 
GitLab