From de0953e9c36fe6ffdc0421c92cfbc159e372b453 Mon Sep 17 00:00:00 2001 From: Bunny <glisa825@gmail.com> Date: Sun, 22 Dec 2019 13:06:48 -0500 Subject: [PATCH] Update to new conventions --- game/modules/tome/data/timed_effects/magical.lua | 7 +++---- game/modules/tome/data/timed_effects/mental.lua | 3 +-- game/modules/tome/data/timed_effects/physical.lua | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/game/modules/tome/data/timed_effects/magical.lua b/game/modules/tome/data/timed_effects/magical.lua index 5a3a5d0461..310112adeb 100644 --- a/game/modules/tome/data/timed_effects/magical.lua +++ b/game/modules/tome/data/timed_effects/magical.lua @@ -343,15 +343,14 @@ newEffect{ parameters = {threshold = 1, blocks = 1,}, on_gain = function(self, err) return "#Target# summons a storm to protect them!", "+Stormshield" end, on_lose = function(self, err) return "#Target#'s storm dissipates.", "-Stormshield" end, - activate = function(self, eff) return + activate = function(self, eff) if core.shader.active(4) then - eff.particle = self:addParticles(Particles.new("shader_ring_rotating", 1, {rotation=0, radius=1.0, img="lightningshield"}, {type="lightningshield"})) + self:effectParticles(eff, {type="shader_ring_rotating", args={rotation=0, radius=1.0, img="lightningshield"}, shader={type="lightningshield"}}) else - eff.particle = self:addParticles(Particles.new("stormshield", 1)) + self:effectParticles(eff, {type = "stormshield"}) end end, deactivate = function(self, eff) - self:removeParticles(eff.particle) end, callbackOnTakeDamage = function(self, eff, src, x, y, type, dam, state) if dam < eff.threshold then return end diff --git a/game/modules/tome/data/timed_effects/mental.lua b/game/modules/tome/data/timed_effects/mental.lua index 06c5cf5fca..a597b0a691 100644 --- a/game/modules/tome/data/timed_effects/mental.lua +++ b/game/modules/tome/data/timed_effects/mental.lua @@ -108,7 +108,7 @@ newEffect{ end) end, activate = function(self, eff) - eff.tmpid = self:addTemporaryValue("inc_nature_summon", eff.power) + self:effectTemporaryValue(eff, "inc_nature_summon", eff.power) self:project({type="ball", range=0, friendlyfire=false, radius=eff.range}, self.x, self.y, function(px, py) local target = game.level.map(px, py, Map.ACTOR) @@ -119,7 +119,6 @@ newEffect{ end) end, deactivate = function(self, eff) - self:removeTemporaryValue("inc_nature_summon", eff.tmpid) end, } diff --git a/game/modules/tome/data/timed_effects/physical.lua b/game/modules/tome/data/timed_effects/physical.lua index 6fcc9e3df6..fe826510a9 100644 --- a/game/modules/tome/data/timed_effects/physical.lua +++ b/game/modules/tome/data/timed_effects/physical.lua @@ -2379,12 +2379,11 @@ newEffect{ activate = function(self, eff) eff.tmpid = self:addTemporaryValue("block", eff.power) if eff.properties.sp then eff.spell = self:addTemporaryValue("combat_spellresist", eff.power) end - eff.particle = self:addParticles(Particles.new("block", 1)) + self:effectParticles(eff, {type="block"}) end, deactivate = function(self, eff) self:removeTemporaryValue("block", eff.tmpid) if eff.properties.sp then self:removeTemporaryValue("combat_spellresist", eff.spell) end - self:removeParticles(eff.particle) end, } -- GitLab