diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index e552196cb102bced88d27b979db5bd759ec80ee9..44266b5b00bdb7b8c5e304367d5c3172f9517bab 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -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 diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 330de9cd5dc12e0c67eca9bb2558476cc93827d7..6acb6663f159c035abe5e364cbb37d8e457d56d1 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -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