Skip to content
Snippets Groups Projects
Commit 7f1b6813 authored by dg's avatar dg
Browse files

commited

git-svn-id: http://svn.net-core.org/repos/t-engine4@5473 51575b47-30f0-44d4-a5cc-537603b46e54
parent 9f3e191c
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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.",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment