From 5b3285fa13398e482872105b9bf1d8a473d5c0dc Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Sun, 9 Feb 2014 22:42:05 +0100
Subject: [PATCH] alchemist fixes

---
 game/modules/tome/class/Actor.lua                 |  3 +++
 game/modules/tome/class/Object.lua                | 10 ++++++++--
 game/modules/tome/data/general/objects/gem.lua    |  6 +++---
 .../tome/data/talents/spells/acid-alchemy.lua     |  2 +-
 .../tome/data/talents/spells/energy-alchemy.lua   | 15 ++++++++-------
 game/modules/tome/data/timed_effects/magical.lua  |  2 +-
 6 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index aa020ad0e2..b089a81019 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -4098,10 +4098,13 @@ function _M:fireTalentCheck(event, ...)
 	if self[store] and next(self[store]) then
 		for tid, kind in pairs(self[store]) do
 			if kind == "effect" then
+				self.__project_source = self.tmp[tid]
 				ret = self:callEffect(tid, event, ...) or ret
 			else
+				self.__project_source = self.sustain_talents[tid]
 				ret = self:callTalent(tid, event, ...) or ret
 			end
+			self.__project_source = nil
 		end
 	end
 	return ret
diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua
index fb4e07f83b..d69a20d06f 100644
--- a/game/modules/tome/class/Object.lua
+++ b/game/modules/tome/class/Object.lua
@@ -1229,7 +1229,7 @@ function _M:getTextualDesc(compare_with, use_actor)
 	if self.alchemist_bomb or self.type == "gem" and use_actor:knowTalent(Talents.T_CREATE_ALCHEMIST_GEMS) then
 		local a = self.alchemist_bomb
 		if not a then
-			a = game.zone.object_list["ALCHEMIST_GEM_"..self.name:upper()]
+			a = game.zone.object_list["ALCHEMIST_GEM_"..self.name:gsub(" ", "_"):upper()]
 			if a then a = a.alchemist_bomb end
 		end
 		if a then
@@ -1239,7 +1239,13 @@ function _M:getTextualDesc(compare_with, use_actor)
 			if a.mana then desc:add(("Mana regain %d"):format(a.mana), true) end
 			if a.daze then desc:add(("%d%% chance to daze for %d turns"):format(a.daze.chance, a.daze.dur), true) end
 			if a.stun then desc:add(("%d%% chance to stun for %d turns"):format(a.stun.chance, a.stun.dur), true) end
-			if a.splash then desc:add(("Additional %d %s damage"):format(a.splash.dam, DamageType:get(DamageType[a.splash.type]).name), true) end
+			if a.splash then
+				if a.splash.desc then
+					desc:add(a.splash.desc, true)
+				else
+					desc:add(("Additional %d %s damage"):format(a.splash.dam, DamageType:get(DamageType[a.splash.type]).name), true)
+				end
+			end
 			if a.leech then desc:add(("Life regen %d%% of max life"):format(a.leech), true) end
 		end
 	end
diff --git a/game/modules/tome/data/general/objects/gem.lua b/game/modules/tome/data/general/objects/gem.lua
index 4b78f31527..4e2530553a 100644
--- a/game/modules/tome/data/general/objects/gem.lua
+++ b/game/modules/tome/data/general/objects/gem.lua
@@ -69,7 +69,7 @@ newGem("Diamond",	"object/diamond.png",5,		18,	"white",	40,	50, 5, 70,
 )
 newGem("Pearl",	"object/pearl.png",	5,		18,	"white",	40,	50, 5, 70,
 	{ resists = {all=5}, combat_armor = 5 },
-	{ splash={type="LITE", dam=100} }
+	{ splash={type="LITE", dam=100, desc = "Lights terrain (power 100)"} }
 )
 newGem("Moonstone",	"object/moonstone.png",5,	18,	"white",	40,	50, 5, 70,
 	{ combat_def=10, combat_mentalresist=10, combat_spellresist=10, combat_physresist=10, },
@@ -97,7 +97,7 @@ newGem("Turquoise",	"object/turquoise.png",4,	16,	"green",	30,	40, 4, 65,
 )
 newGem("Jade",		"object/jade.png",	4,	16,	"green",	30,	40, 4, 65,
 	{ resists = {all=4}, combat_armor = 4 },
-	{ splash={type="SLOW", dam=-1 + 1 / (1 + 0.20)} }
+	{ splash={type="SLOW", dam= 1 - 1 / (1 + 0.20), desc = "Slows by 17%"} }
 )
 newGem("Sapphire",	"object/sapphire.png",4,	16,	"blue",		30,	40, 4, 65,
 	{ combat_def=8, combat_mentalresist=8, combat_spellresist=8, combat_physresist=8, },
@@ -141,7 +141,7 @@ newGem("Aquamarine",	"object/aquamarine.png",2,	10,	"blue",		10,	20, 2, 35,
 )
 newGem("Ametrine",	"object/ametrine.png",1,	8,	"yellow",	1,	10, 1, 20,
 	{ inc_damage = {all=2}, combat_physcrit=1, combat_mindcrit=1, combat_spellcrit=1, },
-	{ splash={type="LITE", dam=1} }
+	{ splash={type="LITE", dam=10, desc = "Lights terrain (power 10)"} }
 )
 newGem("Zircon",	"object/zircon.png",1,	8,	"yellow",	1,	10, 1, 20,
 	{ resists = {all=1}, combat_armor = 1 },
diff --git a/game/modules/tome/data/talents/spells/acid-alchemy.lua b/game/modules/tome/data/talents/spells/acid-alchemy.lua
index 90470f48d3..e87e53024b 100644
--- a/game/modules/tome/data/talents/spells/acid-alchemy.lua
+++ b/game/modules/tome/data/talents/spells/acid-alchemy.lua
@@ -59,7 +59,7 @@ newTalent{
 		local duration = t.getDuration(self, t)
 		local chance = t.getChance(self, t)
 		local dam = t.getDamage(self, t)
-		golem:setEffect(golem.EFF_CAUSTIC_GOLEM, duration, {chance=chance, dam=dam})
+		golem:setEffect(golem.EFF_CAUSTIC_GOLEM, duration, {src = golem, chance=chance, dam=dam})
 	end,
 	info = function(self, t)
 		local duration = t.getDuration(self, t)
diff --git a/game/modules/tome/data/talents/spells/energy-alchemy.lua b/game/modules/tome/data/talents/spells/energy-alchemy.lua
index 45a9601f34..35afce927e 100644
--- a/game/modules/tome/data/talents/spells/energy-alchemy.lua
+++ b/game/modules/tome/data/talents/spells/energy-alchemy.lua
@@ -66,7 +66,7 @@ newTalent{
 			end
 		end
 		if did_something then
-			game.logSeen(golem, "%s is energized by the attack, reducing some talents cooldowns!", golem.name:capitalize())
+			game.logSeen(golem, "%s is energized by the attack, reducing some talent cooldowns!", golem.name:capitalize())
 		end
 	end,
 	info = function(self, t)
@@ -184,7 +184,7 @@ newTalent{
 	end,
 	activate = function(self, t)
 		game:playSoundNear(self, "talents/lightning")
-		local ret = {}
+		local ret = {name = self.name:capitalize().."'s "..t.name}
 		self:talentTemporaryValue(ret, "movement_speed", t.getSpeed(self, t))
 		ret.last_life = self.life
 		return ret
@@ -193,14 +193,15 @@ newTalent{
 		return true
 	end,
 	info = function(self, t)
-		local speed = t.getSpeed(self, t)
+		local speed = t.getSpeed(self, t) * 100
 		local dam = t.getDamage(self, t)
 		local turn = t.getTurn(self, t)
 		local range = self:getTalentRange(t)
-		return ([[Infuse your body with lightning energy, bolstering your legs (+%d%% movement speed).
-		Each turn a foe within range %d will get hit by lightning, dealing %0.2f lightning damage.
-		Each time your turn start, if you have lost over 20%% since the last turn you gain %d%% of a turn.
+		return ([[Infuse your body with lightning energy, bolstering your movement speed by +%d%%.
+		Each turn, a foe within range %d will be struck by lightning and be dealt %0.1f Lightning damage.
+		In addition, damage to your health will energize you.
+		At the start of each turn in which you have lost at least %d life (20%% of your maximum life) since your last turn, you will gain %d%% of a turn.
 		The effects increase with your Spellpower.]]):
-		format(speed, range, damDesc(self, DamageType.LIGHTNING, t.getDamage(self, t)), turn)
+		format(speed, range, damDesc(self, DamageType.LIGHTNING, t.getDamage(self, t)), self.max_life * 0.2, turn)
 	end,
 }
diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua
index 3ad9fe9a02..bb08595a25 100644
--- a/game/modules/tome/data/timed_effects/magical.lua
+++ b/game/modules/tome/data/timed_effects/magical.lua
@@ -2402,7 +2402,7 @@ newEffect{
 newEffect{
 	name = "ICE_ARMOUR", image = "talents/ice_armour.png",
 	desc = "Ice Armour",
-	long_desc = function(self, eff) return ("The target is covered in a layer of ice. Its armour is increased by %d, it deals %0.1f Cold damage to attackers that hit in melee, and 50%% of it's damage is converted to cold."):format(eff.armor, self:damDesc(DamageType.COLD, eff.dam)) end,
+	long_desc = function(self, eff) return ("The target is covered in a layer of ice. Its armour is increased by %d, it deals %0.1f Cold damage to attackers that hit in melee, and 50%% of its damage is converted to cold."):format(eff.armor, self:damDesc(DamageType.COLD, eff.dam)) end,
 	type = "magical",
 	subtype = { cold=true, armour=true, },
 	status = "beneficial",
-- 
GitLab