From 0021da3774cc3ceb87dcb21d8216d88b024d9d65 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 4 Dec 2012 18:06:12 +0000
Subject: [PATCH] Steamroller now provides a stacking (up to 100%) +20% damage
 buff when killing a foe

git-svn-id: http://svn.net-core.org/repos/t-engine4@5918 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../talents/techniques/combat-techniques.lua  |  5 +++-
 game/modules/tome/data/talents/uber/str.lua   |  3 ++-
 .../tome/data/timed_effects/physical.lua      | 23 +++++++++++++++++++
 3 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/data/talents/techniques/combat-techniques.lua b/game/modules/tome/data/talents/techniques/combat-techniques.lua
index bb4a3f3933..1ee58e379a 100644
--- a/game/modules/tome/data/talents/techniques/combat-techniques.lua
+++ b/game/modules/tome/data/talents/techniques/combat-techniques.lua
@@ -66,7 +66,10 @@ newTalent{
 
 		-- Attack ?
 		if core.fov.distance(self.x, self.y, x, y) == 1 then
-			if self:knowTalent(self.T_STEAMROLLER) then target:setEffect(target.EFF_STEAMROLLER, 2, {src=self}) end
+			if self:knowTalent(self.T_STEAMROLLER) then
+				target:setEffect(target.EFF_STEAMROLLER, 2, {src=self})
+				self:setEffect(self.EFF_STEAMROLLER_USER, 2, {buff=20})
+			end
 
 			if self:attackTarget(target, nil, 1.2, true) and target:canBe("stun") then
 				-- Daze, no save
diff --git a/game/modules/tome/data/talents/uber/str.lua b/game/modules/tome/data/talents/uber/str.lua
index 828832dd57..fcba6b9b5b 100644
--- a/game/modules/tome/data/talents/uber/str.lua
+++ b/game/modules/tome/data/talents/uber/str.lua
@@ -110,7 +110,8 @@ uberTalent{
 	mode = "passive",
 	require = { special={desc="Know the Rush talent.", fct=function(self) return self:knowTalent(self.T_RUSH) end} },
 	info = function(self, t)
-		return ([[When you rush the creature you rush to is marked. If you kill it in the next two turns your rush cooldown is reset.]])
+		return ([[When you rush the creature you rush to is marked. If you kill it in the next two turns your rush cooldown is reset.
+		Each time this effect triggers you gain a stacking +20%% damage buff, up to 100%%.]])
 		:format()
 	end,
 }
diff --git a/game/modules/tome/data/timed_effects/physical.lua b/game/modules/tome/data/timed_effects/physical.lua
index 43d77ac511..16d4c58cc9 100644
--- a/game/modules/tome/data/timed_effects/physical.lua
+++ b/game/modules/tome/data/timed_effects/physical.lua
@@ -1928,6 +1928,29 @@ newEffect{
 	end,
 }
 
+
+newEffect{
+	name = "STEAMROLLER_USER", image = "talents/steamroller.png",
+	desc = "Steamroller",
+	long_desc = function(self, eff) return ("Grants a +%d%% damage bonus."):format(eff.buff) end,
+	type = "physical",
+	subtype = { status=true },
+	status = "beneficial",
+	parameters = { buff=20 },
+	on_merge = function(self, old_eff, new_eff)
+		new_eff.buff = math.min(100, old_eff.buff + new_eff.buff)
+		self:removeTemporaryValue("inc_damage", old_eff.buffid)
+		new_eff.buffid = self:addTemporaryValue("inc_damage", {all=new_eff.buff})
+		return new_eff
+	end,
+	activate = function(self, eff)
+		eff.buffid = self:addTemporaryValue("inc_damage", {all=eff.buff})
+	end,
+	deactivate = function(self, eff)
+		self:removeTemporaryValue("inc_damage", eff.buffid)
+	end,
+}
+
 newEffect{
 	name = "SPINE_OF_THE_WORLD", image = "talents/spine_of_the_world.png",
 	desc = "Spine of the World",
-- 
GitLab