diff --git a/game/engines/default/engine/interface/ActorTemporaryEffects.lua b/game/engines/default/engine/interface/ActorTemporaryEffects.lua index d6d39441d55df65d2ea6dccd3d36a5a113904cc4..ecdf82115041682309c9fcab6e8bb89d61e17aac 100644 --- a/game/engines/default/engine/interface/ActorTemporaryEffects.lua +++ b/game/engines/default/engine/interface/ActorTemporaryEffects.lua @@ -97,6 +97,7 @@ function _M:setEffect(eff_id, dur, p, silent) end p.dur = dur self:check("on_set_temporary_effect", eff_id, _M.tempeffect_def[eff_id], p) + if p.dur <= 0 then return self:removeEffect(eff_id) end -- If we already have it, we check if it knows how to "merge", or else we remove it and re-add it if self:hasEffect(eff_id) then diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 0485e0de0c1da91c9412153599ab9665fa2f30cb..65a41bb5cfca9188aa3db7bc6bcf9cdc4331727c 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -1098,8 +1098,8 @@ function _M:onTakeHit(value, src) -- Frozen: absorb some damage into the iceblock if self:attr("encased_in_ice") then local eff = self:hasEffect(self.EFF_FROZEN) - eff.hp = eff.hp - value * 0.25 - value = value * 0.75 + eff.hp = eff.hp - value * 0.4 + value = value * 0.6 if eff.hp < 0 then self:removeEffect(self.EFF_FROZEN) end end @@ -2497,6 +2497,9 @@ function _M:on_set_temporary_effect(eff_id, e, p) if e.status == "detrimental" and self:knowTalent(self.T_RESILIENT_BONES) then p.dur = math.ceil(p.dur * (1 - (self:getTalentLevel(self.T_RESILIENT_BONES) / 12))) end + if e.status == "detrimental" and self:attr("negative_status_effect_immune") then + p.dur = 0 + end end --- Called when we are projected upon diff --git a/game/modules/tome/data/timed_effects.lua b/game/modules/tome/data/timed_effects.lua index cded0c8c2dbb47796bbb51d993a37130b0098623..19ea614da40975360a7fc13fbae7c9fa4036fafa 100644 --- a/game/modules/tome/data/timed_effects.lua +++ b/game/modules/tome/data/timed_effects.lua @@ -349,7 +349,7 @@ newEffect{ newEffect{ name = "FROZEN", desc = "Frozen", - long_desc = function(self, eff) return ("The target is encased in ice. All damage done to you will be split, 25%% absorbed by the ice and 75%% by yourself. Your defense is nullified while in the ice and you may only attack the ice. %d HP on the iceblock remaining."):format(eff.hp) end, + long_desc = function(self, eff) return ("The target is encased in ice. All damage done to you will be split, 40%% absorbed by the ice and 60%% by yourself. Your defense is nullified while in the ice and you may only attack the ice but you are also immune to any new detrimental status effects. %d HP on the iceblock remaining."):format(eff.hp) end, type = "magical", status = "detrimental", parameters = {}, @@ -376,6 +376,7 @@ newEffect{ eff.frozid = self:addTemporaryValue("frozen", 1) eff.defid = self:addTemporaryValue("combat_def", -1000) eff.rdefid = self:addTemporaryValue("combat_def_ranged", -1000) + eff.sefid = self:addTemporaryValue("negative_status_effect_immune", 1) eff.dur = self:updateEffectDuration(eff.dur, "freeze") self:setTarget(self) @@ -389,6 +390,7 @@ newEffect{ self:removeTemporaryValue("frozen", eff.frozid) self:removeTemporaryValue("combat_def", eff.defid) self:removeTemporaryValue("combat_def_ranged", eff.rdefid) + self:removeTemporaryValue("negative_status_effect_immune", eff.sefid) self.color_r = eff.old_r self.color_g = eff.old_g self.color_b = eff.old_b