Code: Select all
newEffect{
name = "SOULBURN", image = "talents/soulburn.png",
desc = "Soulburn",
long_desc = function(self, eff) return ("Next spell has %d%% reduced cooldown and grants %d%% of a turn."):format(eff.cd, eff.turn) end,
type = "magical",
subtype = { darkness=true },
status = "beneficial",
parameters = { cd = 0.5, turn = 0.7 },
activate = function(self, eff)
eff.cdid = self:addTemporaryValue("spell_cooldown_reduction", eff.cd/100)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("spell_cooldown_reduction", eff.cdid)
end,
callbackOnTalentPost = function(self, t, ab)
if ab.type[1]:find("^spell/") and not ab.type[1]:find("^spell/soulforge") then
local t = self:getTalentFromId(self.T_SOULBURN)
local energy = (game.energy_to_act * t.getTurn(self,t))/100
self.energy.value = self.energy.value + energy
end
end,
callbackOnActBase = function(self, eff)
self:removeEffect(self.EFF_SOULBURN)
end,
}