From 985a1c178bd0c9927d205b0b5bc611560c4061ce Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Wed, 28 Sep 2011 07:32:41 +0000
Subject: [PATCH] Flameshock is now a stun effect; damage over time increased

git-svn-id: http://svn.net-core.org/repos/t-engine4@4486 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../modules/tome/data/talents/spells/fire.lua |  4 +--
 .../tome/data/timed_effects/physical.lua      | 26 +++++++++++++------
 ideas/todo                                    |  2 --
 3 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/game/modules/tome/data/talents/spells/fire.lua b/game/modules/tome/data/talents/spells/fire.lua
index 21c395e3f4..67b3b11a4e 100644
--- a/game/modules/tome/data/talents/spells/fire.lua
+++ b/game/modules/tome/data/talents/spells/fire.lua
@@ -91,7 +91,7 @@ newTalent{
 	target = function(self, t)
 		return {type="cone", range=self:getTalentRange(t), radius=self:getTalentRadius(t), selffire=false, talent=t}
 	end,
-	getDamage = function(self, t) return self:combatTalentSpellDamage(t, 10, 120) end,
+	getDamage = function(self, t) return self:combatTalentSpellDamage(t, 10, 250) end,
 	getStunDuration = function(self, t) return self:getTalentLevelRaw(t) + 2 end,
 	action = function(self, t)
 		local tg = self:getTalentTarget(t)
@@ -117,7 +117,7 @@ newTalent{
 		local damage = t.getDamage(self, t)
 		local stunduration = t.getStunDuration(self, t)
 		local radius = self:getTalentRadius(t)
-		return ([[Conjures up a cone of flame with radius %d. Any target caught in the area will take %0.2f fire damage and be paralyzed for %d turns.
+		return ([[Conjures up a cone of flame with radius %d. Any target caught in the area will take %0.2f fire damage and be stunned for %d turns.
 		The damage will increase with your Spellpower.]]):
 		format(radius, damDesc(self, DamageType.FIRE, damage), stunduration)
 	end,
diff --git a/game/modules/tome/data/timed_effects/physical.lua b/game/modules/tome/data/timed_effects/physical.lua
index 44fc86f1ba..e8872a04fc 100644
--- a/game/modules/tome/data/timed_effects/physical.lua
+++ b/game/modules/tome/data/timed_effects/physical.lua
@@ -258,24 +258,34 @@ newEffect{
 newEffect{
 	name = "BURNING_SHOCK",
 	desc = "Burning Shock",
-	long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn and unable to act."):format(eff.power) end,
+	long_desc = function(self, eff) return ("The target is on fire, taking %0.2f fire damage per turn, reducing damage by 70%%, healing received by 50%%, putting random talents on cooldown and reducing movement speed by 50%%. While flameshocked talents do not cooldown."):format(eff.power) end,
 	type = "physical",
 	subtype = { fire=true, stun=true },
 	status = "detrimental",
 	parameters = {},
-	on_gain = function(self, err) return "#Target# is paralyzed by the burning flame!", "+Burning Shock" end,
-	on_lose = function(self, err) return "#Target# is not paralyzed anymore.", "-Burning Shock" end,
+	on_gain = function(self, err) return "#Target# is stunned by the burning flame!", "+Burning Shock" end,
+	on_lose = function(self, err) return "#Target# is not stunned anymore.", "-Burning Shock" end,
 	activate = function(self, eff)
-		eff.tmpid = self:addTemporaryValue("paralyzed", 1)
-		-- Start the stun counter only if this is the first stun
-		if self.paralyzed == 1 then self.paralyzed_counter = (self:attr("stun_immune") or 0) * 100 end
+		eff.tmpid = self:addTemporaryValue("stunned", 1)
+		eff.speedid = self:addTemporaryValue("movement_speed", -0.5)
+
+		local tids = {}
+		for tid, lev in pairs(self.talents) do
+			local t = self:getTalentFromId(tid)
+			if t and not self.talents_cd[tid] and t.mode == "activated" and not t.innate then tids[#tids+1] = t end
+		end
+		for i = 1, 4 do
+			local t = rng.tableRemove(tids)
+			if not t then break end
+			self.talents_cd[t.id] = 1 -- Just set cooldown to 1 since cooldown does not decrease while stunned
+		end
 	end,
 	on_timeout = function(self, eff)
 		DamageType:get(DamageType.FIRE).projector(eff.src, self.x, self.y, DamageType.FIRE, eff.power)
 	end,
 	deactivate = function(self, eff)
-		self:removeTemporaryValue("paralyzed", eff.tmpid)
-		if not self:attr("paralyzed") then self.paralyzed_counter = nil end
+		self:removeTemporaryValue("stunned", eff.tmpid)
+		self:removeTemporaryValue("movement_speed", eff.speedid)
 	end,
 }
 
diff --git a/ideas/todo b/ideas/todo
index 36d1393407..e3c0c1fb0e 100644
--- a/ideas/todo
+++ b/ideas/todo
@@ -1,4 +1,2 @@
-* check forced saveGame in alchemist/merchant turnin
 * autoexport character entity on death/win(/save?)
 * RSS feed of events in a character's life, exportable to FB
-* while frozen disable talents that woulndt have an effect
-- 
GitLab