diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index a4b4a69ab19bf831008182a9167bb893f0f753fc..3b310b77d52b393902fab50b989319ad8f69bc0c 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -2176,7 +2176,7 @@ function _M:onTakeHit(value, src, death_note) value = value * (util.bound(self.global_speed * self.movement_speed, 0.3, 1)) end - -- Reduce damage and trigger for Trained Reactions + -- General percent damage reduction if self:attr("incoming_reduce") then value = value * (100-self:attr("incoming_reduce")) / 100 print("[onTakeHit] After Trained Reactions effect reduction ", value) @@ -4937,7 +4937,7 @@ function _M:preUseTalent(ab, silent, fake) if self:attr("scoundrel_failure") and (ab.mode ~= "sustained" or not self:isTalentActive(ab.id)) and util.getval(ab.no_energy, self, ab) ~= true and not fake and not self:attr("force_talent_ignore_ressources") then local eff = self:hasEffect(self.EFF_FUMBLE) if rng.percent(self:attr("scoundrel_failure")) then - if not silent then game.logSeen(self, "%s fumbles and fails to use %s, injuring themselves!", self.name:capitalize(), ab.name) end + if not silent then game.logSeen(self, "%s fumbles and fails to use %s, injuring %s!", self.name:capitalize(), ab.name, self:his_her_self()) end self:useEnergy() self:fireTalentCheck("callbackOnTalentDisturbed", ab) return false @@ -5375,23 +5375,26 @@ function _M:postUseTalent(ab, ret, silent) DamageType:get(DamageType.FIRE).projector(p.src, self.x, self.y, DamageType.FIRE, p.dam) end - -- Cancel stealth! - if not util.getval(ab.no_break_stealth, self, ab) and util.getval(ab.no_energy, self, ab) ~= true then self:breakStealth() end - - if ab.id ~= self.T_LIGHTNING_SPEED then self:breakLightningSpeed() end - if ab.id ~= self.T_GATHER_THE_THREADS and ab.is_spell then self:breakChronoSpells() end - if not ab.no_reload_break then self:breakReloading() end - self:breakStepUp() - self:breakSpacetimeTuning() - --if not (util.getval(ab.no_energy, self, ab) or ab.no_break_channel) and not (ab.mode == "sustained" and self:isTalentActive(ab.id)) then self:breakPsionicChannel(ab.id) end + -- break stealth, channels, etc... + if not self.turn_procs.resetting_talents then + -- Cancel stealth! + if not util.getval(ab.no_break_stealth, self, ab) and util.getval(ab.no_energy, self, ab) ~= true then self:breakStealth() end + + if ab.id ~= self.T_LIGHTNING_SPEED then self:breakLightningSpeed() end + if ab.id ~= self.T_GATHER_THE_THREADS and ab.is_spell then self:breakChronoSpells() end + if not ab.no_reload_break then self:breakReloading() end + self:breakStepUp() + self:breakSpacetimeTuning() + --if not (util.getval(ab.no_energy, self, ab) 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 - -- Break things at the end, only if they are still on - game:onTickEnd(function() - if self.sustain_talents[t.id] then self:callTalent(tid, "callbackBreakOnTalent", ab) end - end) + for tid, _ in pairs(self.sustain_talents) do + local t = self:getTalentFromId(tid) + if t and t.callbackBreakOnTalent then + -- Break things at the end, only if they are still on + game:onTickEnd(function() + if self.sustain_talents[t.id] then self:callTalent(tid, "callbackBreakOnTalent", ab) end + end) + end end end diff --git a/game/modules/tome/dialogs/LevelupDialog.lua b/game/modules/tome/dialogs/LevelupDialog.lua index c8652fb47ebe31e84ab93760ec9567384c884bd7..e576f5fe375c5302488bb02968217f853abcdb58 100644 --- a/game/modules/tome/dialogs/LevelupDialog.lua +++ b/game/modules/tome/dialogs/LevelupDialog.lua @@ -190,11 +190,12 @@ function _M:finish() if talents ~= "" then game.logPlayer(self.actor, txt:format(talents)) end + self.actor.turn_procs.resetting_talents = true for i, tid in ipairs(reset) do self.actor:forceUseTalent(tid, {ignore_energy=true, ignore_cd=true, no_talent_fail=true}) if self.actor:knowTalent(tid) then self.actor:forceUseTalent(tid, {ignore_energy=true, ignore_cd=true, no_talent_fail=true, talent_reuse=true}) end end - + self.actor.turn_procs.resetting_talents = nil -- Prodigies if self.on_finish_prodigies then for tid, ok in pairs(self.on_finish_prodigies) do if ok then self.actor:learnTalent(tid, true, nil, {no_unlearn=true}) end end