diff --git a/game/engines/default/engine/interface/ActorTalents.lua b/game/engines/default/engine/interface/ActorTalents.lua index d866fe7038ede1dfe5ad8d7055ee34726bd88063..e3cc26ee250cf25304f491f4b2293f2cb360be46 100644 --- a/game/engines/default/engine/interface/ActorTalents.lua +++ b/game/engines/default/engine/interface/ActorTalents.lua @@ -159,7 +159,13 @@ function _M:useTalent(id, who, force_level, ignore_cd, force_target, silent) else local old_level if force_level then old_level = who.talents[id]; who.talents[id] = force_level end - local ret = ab.deactivate(who, ab, self.sustain_talents[id]) + local p = self.sustain_talents[id] + if p.__tmpvals then + for i = 1, #p.__tmpvals do + self:removeTemporaryValue(p.__tmpvals[i][1], p.__tmpvals[i][2]) + end + end + local ret = ab.deactivate(who, ab, p) if force_level then who.talents[id] = old_level end if not self:postUseTalent(ab, ret) then return end @@ -291,7 +297,7 @@ function _M:learnTalent(t_id, force, nb) end end - for i = 1, (nb or 1) do + for i = 1, (nb or 1) do self.talents[t_id] = (self.talents[t_id] or 0) + 1 if t.on_learn then t.on_learn(self, t) end end @@ -645,3 +651,9 @@ function _M:useTalents(add_cols) local d = require("engine.dialogs.UseTalents").new(self, add_cols) game:registerDialog(d) end + +--- Helper function to add temporary values and not have to remove them manualy +function _M:talentTemporaryValue(p, k, v) + if not p.__tmpvals then p.__tmpvals = {} end + p.__tmpvals[#eff.__tmpvals+1] = {k, self:addTemporaryValue(k, v)} +end diff --git a/game/modules/tome/data/timed_effects/floor.lua b/game/modules/tome/data/timed_effects/floor.lua index 9f7d1b6e65183b68aff62c42995fdebf305f4ae9..bbb7740198d05c38d26956a2b485c44df59c8242 100644 --- a/game/modules/tome/data/timed_effects/floor.lua +++ b/game/modules/tome/data/timed_effects/floor.lua @@ -75,20 +75,6 @@ floorEffect{ end, } -floorEffect{ - desc = "Spellblaze Scar", image = "talents/blood_boil.png", - long_desc = "The target is near a spellblaze scar, granting +25% spell critical chance, +10% fire and blight damage but critical spells will drain arcane forces.", - activate = function(self, eff) - self:effectTemporaryValue(eff, "combat_spellcrit", 25) - self:effectTemporaryValue(eff, "inc_damage", {[DamageType.FIRE]=10,[DamageType.BLIGHT]=10}) - self:effectTemporaryValue(eff, "mana_on_crit", -15) - self:effectTemporaryValue(eff, "vim_on_crit", -10) - self:effectTemporaryValue(eff, "paradox_on_crit", 20) - self:effectTemporaryValue(eff, "positive_on_crit", -10) - self:effectTemporaryValue(eff, "negative_on_crit", -10) - end, -} - floorEffect{ desc = "Blighted Soil", image = "talents/blightzone.png", long_desc = "The target is walking on blighted soil, reducing diseases resistance by 30% and giving a chance to be infected with a random disease.",