diff --git a/game/engines/default/engine/interface/ActorTemporaryEffects.lua b/game/engines/default/engine/interface/ActorTemporaryEffects.lua index e945eb6f2af967a27d3254df7d3bbff3f1f1920e..142804d46113310392349de0d6f79eadc99afb82 100644 --- a/game/engines/default/engine/interface/ActorTemporaryEffects.lua +++ b/game/engines/default/engine/interface/ActorTemporaryEffects.lua @@ -61,22 +61,24 @@ function _M:init(t) end --- Counts down timed effects, call from your actors "act" method --- -function _M:timedEffects() +-- @param filter if not nil a function that gets passed the effect and its parameters, must return true to handle the effect +function _M:timedEffects(filter) local todel = {} local def for eff, p in pairs(self.tmp) do def = _M.tempeffect_def[eff] - if p.dur <= 0 then - todel[#todel+1] = eff - else - if def.on_timeout then - if def.on_timeout(self, p) then - todel[#todel+1] = eff + if not filter or filter(def, p) then + if p.dur <= 0 then + todel[#todel+1] = eff + else + if def.on_timeout then + if def.on_timeout(self, p) then + todel[#todel+1] = eff + end end end + p.dur = p.dur - def.decrease end - p.dur = p.dur - def.decrease end while #todel > 0 do diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index b743012c2d671d733934c4619e353f4eef1062d3..515a84f7bab9a7aac895f71e2197405df3a31193 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -284,7 +284,11 @@ end function _M:actBase() self.energyBase = self.energyBase - game.energy_to_act - if self:attr("no_timeflow") then return end + if self:attr("no_timeflow") then + -- Compute timed effects that can happen even in timeless mode + self:timedEffects(function(e, p) if e.tick_on_timeless then return true end end) + return + end if self:isTalentActive (self.T_DARKEST_LIGHT) and self.positive > self.negative then self:forceUseTalent(self.T_DARKEST_LIGHT, {ignore_energy=true}) diff --git a/game/modules/tome/data/talents/spells/temporal.lua b/game/modules/tome/data/talents/spells/temporal.lua index a91a5322f24a36db4f8a36b42ccd6c5b01b91063..da02dd1091ba4ba0aa6541c5d60465ab425a4346 100644 --- a/game/modules/tome/data/talents/spells/temporal.lua +++ b/game/modules/tome/data/talents/spells/temporal.lua @@ -98,6 +98,7 @@ newTalent{ info = function(self, t) local duration = t.getDuration(self, t) return ([[Removes the target from the flow of time for %d turns. In this state the target can neither act nor be harmed. + Time does not pass at all for the target, no talents will cooldown, no resources will regen, ... The duration will increase with your Spellpower.]]): format(duration) end, diff --git a/game/modules/tome/data/timed_effects/other.lua b/game/modules/tome/data/timed_effects/other.lua index f3ff2d6f021b1ce0cc4d1eb0a39b54e8865d8148..4b38512b59c23438e5a9ed1446226a8f3dcd859a 100644 --- a/game/modules/tome/data/timed_effects/other.lua +++ b/game/modules/tome/data/timed_effects/other.lua @@ -75,22 +75,25 @@ newEffect{ newEffect{ name = "TIME_PRISON", image = "talents/time_prison.png", desc = "Time Prison", - long_desc = function(self, eff) return "The target is removed from the normal time stream, unable to act but unable to take any damage." end, + long_desc = function(self, eff) return "The target is removed from the normal time stream, unable to act but unable to take any damage. Time does not pass for this creature." end, type = "other", subtype = { time=true }, status = "detrimental", + tick_on_timeless = true, parameters = {}, on_gain = function(self, err) return "#Target# is removed from time!", "+Out of Time" end, on_lose = function(self, err) return "#Target# is returned to normal time.", "-Out of Time" end, activate = function(self, eff) eff.iid = self:addTemporaryValue("invulnerable", 1) eff.sid = self:addTemporaryValue("time_prison", 1) + eff.tid = self:addTemporaryValue("no_timeflow", 1) eff.particle = self:addParticles(Particles.new("time_prison", 1)) self.energy.value = 0 end, deactivate = function(self, eff) self:removeTemporaryValue("invulnerable", eff.iid) self:removeTemporaryValue("time_prison", eff.sid) + self:removeTemporaryValue("no_timeflow", eff.tid) self:removeParticles(eff.particle) end, }