Skip to content
Snippets Groups Projects
Commit 07d5f16d authored by dg's avatar dg
Browse files

Progressive teleporation resistance affects NPCs being teleported against their will

git-svn-id: http://svn.net-core.org/repos/t-engine4@1124 51575b47-30f0-44d4-a5cc-537603b46e54
parent e989985b
No related branches found
No related tags found
No related merge requests found
......@@ -40,11 +40,15 @@ newTalent{
end
end
end
if target ~= self and (not target:canBe("teleport") or not self:checkHit(self:combatSpellpower(), target:combatSpellResist())) then
game.logSeen(target, "The spell fizzles!")
return true
if target ~= self and target:canBe("teleport") then
local hit = self:checkHit(self:combatSpellpower(), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0))
if not hit then
game.logSeen(target, "The spell fizzles!")
return true
end
target:setEffect(target.EFF_CONTINUUM_DESTABILIZATION, 100 , {power=20 - self:getTalentLevel(t)})
end
-- Annoy them!
if target ~= self and target:reactionToward(self) < 0 then target:setTarget(self) end
......@@ -100,10 +104,15 @@ newTalent{
end
end
if target ~= self and (not target:canBe("teleport") or not self:checkHit(self:combatSpellpower(), target:combatSpellResist())) then
game.logSeen(target, "The spell fizzles!")
return true
if target ~= self and target:canBe("teleport") then
local hit = self:checkHit(self:combatSpellpower(), target:combatSpellResist() + (target:attr("continuum_destabilization") or 0))
if not hit then
game.logSeen(target, "The spell fizzles!")
return true
end
target:setEffect(target.EFF_CONTINUUM_DESTABILIZATION, 100 , {power=20 - self:getTalentLevel(t)})
end
-- Annoy them!
if target ~= self and target:reactionToward(self) < 0 then target:setTarget(self) end
......
......@@ -1013,3 +1013,31 @@ newEffect{
self:removeTemporaryValue("resists", eff.tmpid)
end,
}
newEffect{
name = "CONTINUUM_DESTABILIZATION",
desc = "Continuum Destabilization",
type = "other", -- Type "other" so that nothing can dispel it
status = "beneficial",
parameters = { power=10 },
on_gain = function(self, err) return "#Target# looks a little pale around the edges.", "+Destabilized" end,
on_lose = function(self, err) return "#Target# is firmly planted in reality.", "-Destabilized" end,
on_merge = function(self, old_eff, new_eff)
-- Merge the continuum_destabilization
local olddam = old_eff.power * old_eff.dur
local newdam = new_eff.power * new_eff.dur
local dur = math.ceil((old_eff.dur + new_eff.dur) / 2)
old_eff.dur = dur
old_eff.power = (olddam + newdam) / dur
-- Need to remove and re-add the continuum_destabilization
self:removeTemporaryValue("continuum_destabilization", old_eff.effid)
old_eff.effid = self:addTemporaryValue("continuum_destabilization", old_eff.power)
return old_eff
end,
activate = function(self, eff)
eff.effid = self:addTemporaryValue("continuum_destabilization", eff.power)
end,
deactivate = function(self, eff)
self:removeTemporaryValue("continuum_destabilization", eff.effid)
end,
}
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