From 7f1b6813fd87390c009c3c3202c02818571ad090 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Wed, 15 Aug 2012 22:04:36 +0000 Subject: [PATCH] commited git-svn-id: http://svn.net-core.org/repos/t-engine4@5473 51575b47-30f0-44d4-a5cc-537603b46e54 --- .../default/engine/interface/ActorTalents.lua | 16 ++++++++++++++-- game/modules/tome/data/timed_effects/floor.lua | 14 -------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/game/engines/default/engine/interface/ActorTalents.lua b/game/engines/default/engine/interface/ActorTalents.lua index d866fe7038..e3cc26ee25 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 9f7d1b6e65..bbb7740198 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.", -- GitLab