Skip to content
Snippets Groups Projects
Commit 3fcae94e authored by dg's avatar dg
Browse files

Drain does not restore vim from your own summons

git-svn-id: http://svn.net-core.org/repos/t-engine4@6384 51575b47-30f0-44d4-a5cc-537603b46e54
parent c7093111
No related branches found
No related tags found
No related merge requests found
......@@ -1066,6 +1066,12 @@ function _M:move(x, y, force)
end
end
if self.talents_on_move and next(self.talents_on_move) then
for tid, _ in pairs(self.talents_on_move) do
self:callTalent(tid, "callbackOnMove", moved, force, ox, oy)
end
end
self:triggerHook{"Actor:move", moved=moved, force=force, ox=ox, oy=oy}
return moved
......@@ -3733,6 +3739,10 @@ function _M:postUseTalent(ab, ret, silent)
self.talents_on_act = self.talents_on_act or {}
self.talents_on_act[ab.id] = true
end
if ab.callbackOnMove then
self.talents_on_move = self.talents_on_move or {}
self.talents_on_move[ab.id] = true
end
else
if ab.sustain_mana then
self:incMaxMana(ab.sustain_mana)
......@@ -3768,6 +3778,10 @@ function _M:postUseTalent(ab, ret, silent)
self.talents_on_act[ab.id] = nil
if not next(self.talents_on_act) then self.talents_on_act = nil end
end
if ab.callbackOnMove then
self.talents_on_move[ab.id] = nil
if not next(self.talents_on_move) then self.talents_on_move = nil end
end
end
elseif not self:attr("force_talent_ignore_ressources") then
if ab.mana and not self:attr("zero_resource_cost") then
......@@ -3826,6 +3840,13 @@ function _M:postUseTalent(ab, ret, silent)
self:breakStepUp()
if not (ab.no_energy or ab.no_break_channel) and not (ab.mode == "sustained" and self:isTalentActive(ab.id)) then self:breakPsionicChannel(ab.id) end
for tid, _ in pairs(self.sustain_talents) do
local t = self:getTalentFromId(tid)
if t and t.callbackBreakOnTalent then
self:callTalent(tid, "callbackBreakOnTalent", ab)
end
end
if ab.id ~= self.T_REDUX and self:hasEffect(self.EFF_REDUX) and ab.type[1]:find("^chronomancy/") and ab.mode == "activated" and self:getTalentLevel(self.T_REDUX) >= self:getTalentLevel(ab.id) then
self:removeEffect(self.EFF_REDUX)
-- this still consumes energy but works as the talent suggests it does
......
......@@ -1555,7 +1555,7 @@ newDamageType{
if _G.type(dam) == "number" then dam = {dam=dam, vim=0.2} end
local target = game.level.map(x, y, Map.ACTOR)
local realdam = DamageType:get(DamageType.BLIGHT).projector(src, x, y, DamageType.BLIGHT, dam.dam)
if target and target ~= src and realdam > 0 then
if target and target ~= src and target.summoner ~= src and realdam > 0 then
src:incVim(realdam * dam.vim * target:getRankVimAdjust())
end
return realdam
......
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