diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index f98658a5c05ae4921729bae961f853a2527345c9..7e5b4824d3f967684bb8f04e3e422b24b6cf9e4d 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -404,6 +404,7 @@ function _M:act() if not engine.Actor.act(self) then return end self.changed = true + self.turn_procs = {} -- If resources are too low, disable sustains if self.mana < 1 or self.stamina < 1 or self.psi < 1 then @@ -2144,7 +2145,7 @@ function _M:onWear(o, bypass_set) self:learnItemTalent(o, tid, level) end end - + self:breakReloading() self:updateModdableTile() @@ -2204,7 +2205,7 @@ function _M:onTakeoff(o, bypass_set) self:attr("spellpower_reduction", -1) self:attr("spell_failure", -(o.material_level or 1) * 10) end - + if o.wielder and o.wielder.learn_talent then for tid, level in pairs(o.wielder.learn_talent) do self:unlearnItemTalent(o, tid, level) @@ -2313,11 +2314,11 @@ function _M:learnItemTalent(o, tid, level) if not self.item_talent_surplus_levels[tid] then self.item_talent_surplus_levels[tid] = 0 end --item_talent_levels[tid] = item_talent_levels[tid] + level for i = 1, level do - if self:getTalentLevelRaw(t) >= max then - self.item_talent_surplus_levels[tid] = self.item_talent_surplus_levels[tid] + 1 + if self:getTalentLevelRaw(t) >= max then + self.item_talent_surplus_levels[tid] = self.item_talent_surplus_levels[tid] + 1 else self:learnTalent(tid, true, 1) - end + end end end @@ -2328,11 +2329,11 @@ function _M:unlearnItemTalent(o, tid, level) --local item_talent_surplus_levels = self.item_talent_surplus_levels or {} if not self.item_talent_surplus_levels[tid] then self.item_talent_surplus_levels[tid] = 0 end for i = 1, level do - if self.item_talent_surplus_levels[tid] > 0 then - self.item_talent_surplus_levels[tid] = self.item_talent_surplus_levels[tid] - 1 + if self.item_talent_surplus_levels[tid] > 0 then + self.item_talent_surplus_levels[tid] = self.item_talent_surplus_levels[tid] - 1 else self:unlearnTalent(tid, true, 1) - end + end end end diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua index 2b83e98e99097285a3afc1556a9dd877663d4fea..4693724c27c3f50cc28e2b71feea18f0515fdddb 100644 --- a/game/modules/tome/class/interface/Archery.lua +++ b/game/modules/tome/class/interface/Archery.lua @@ -196,9 +196,10 @@ local function archery_projectile(tx, ty, tg, self, tmp) end end -- Talent on hit - if hitted and not target.dead and weapon and weapon.talent_on_hit and next(weapon.talent_on_hit) then + if hitted and not target.dead and weapon and weapon.talent_on_hit and next(weapon.talent_on_hit) and not self.turn_procs.ranged_talent then for tid, data in pairs(weapon.talent_on_hit) do if rng.percent(data.chance) then + self.turn_procs.ranged_talent = true self:forceUseTalent(tid, {ignore_cd=true, ignore_energy=true, force_target=target, force_level=data.level, ignore_ressources=true}) end end diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index 332a758ed61a099253840a76ebf34dd2327aee29..446e07cdd931175b68196311741a2a301b2e3da3 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -493,9 +493,10 @@ function _M:attackTargetWith(target, weapon, damtype, mult, force_dam) end -- On hit talent - if hitted and not target.dead and weapon and weapon.talent_on_hit and next(weapon.talent_on_hit) then + if hitted and not target.dead and weapon and weapon.talent_on_hit and next(weapon.talent_on_hit) and not self.turn_procs.melee_talent then for tid, data in pairs(weapon.talent_on_hit) do if rng.percent(data.chance) then + self.turn_procs.melee_talent = true self:forceUseTalent(tid, {ignore_cd=true, ignore_energy=true, force_target=target, force_level=data.level, ignore_ressources=true}) end end diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index 09c0a5b5400533fc17fbf8f75ef0d6f8c31a6c8c..b231182b3bf8463fe85553ea83359d06a4c362e2 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -44,7 +44,7 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr) local t = target:getTalentFromId(target.T_PREMONITION) t.on_damage(target, t, type) end - + -- Item-granted damage ward talent if target:hasEffect(target.EFF_WARD) then local e = target.tempeffect_def[target.EFF_WARD] @@ -294,11 +294,11 @@ setDefaultProjector(function(src, x, y, type, dam, tmp, no_martyr) target:crossTierEffect(target.EFF_SPELLSHOCKED, src:combatSpellpower()) end - if src.__projecting_for and not src.__projecting_for.talent_on_hit_done then - if src.talent_on_spell and next(src.talent_on_spell) and t.is_spell then + if src.__projecting_for then + if src.talent_on_spell and next(src.talent_on_spell) and t.is_spell and not src.turn_procs.spell_talent then for id, d in pairs(src.talent_on_spell) do if rng.percent(d.chance) and t.id ~= d.talent then - src.__projecting_for.talent_on_hit_done = true + src.turn_procs.spell_talent = true local old = src.__projecting_for src:forceUseTalent(d.talent, {ignore_cd=true, ignore_energy=true, force_target=target, force_level=d.level, ignore_ressources=true}) src.__projecting_for = old diff --git a/game/modules/tome/data/general/objects/boss-artifacts.lua b/game/modules/tome/data/general/objects/boss-artifacts.lua index 9e54a83d81161de0dd4a8d06e7cc2beda4786c3b..b1bdff7c117339135e79691a12f998e9a1486368 100644 --- a/game/modules/tome/data/general/objects/boss-artifacts.lua +++ b/game/modules/tome/data/general/objects/boss-artifacts.lua @@ -1108,7 +1108,7 @@ newEntity{ base = "BASE_BATTLEAXE", if who:attr("forbid_arcane") then local Stats = require "engine.interface.ActorStats" local DamageType = require "engine.DamageType" - + self:specialWearAdd({"wielder","inc_damage"}, {[DamageType.NATURE]=15}) self:specialWearAdd({"wielder","inc_stats"}, { [Stats.STAT_STR] = 6, [Stats.STAT_WIL] = 6, }) game.logPlayer(who, "#DARK_GREEN#You feel like Nature's Wrath incarnate!")