diff --git a/game/engines/default/engine/Entity.lua b/game/engines/default/engine/Entity.lua index f6898da2dc4f08f1983880dd77b0943c6c1d67f3..f7116e0ac194a9a650f4578d00d97d0d85e02a60 100644 --- a/game/engines/default/engine/Entity.lua +++ b/game/engines/default/engine/Entity.lua @@ -204,7 +204,7 @@ end function _M:getParticlesList(back) local ps = {} for e, _ in pairs(self.__particles) do - if (not back and not e.toback) or (back and e.toback) then + if (not back and not e.toback) or (back and e.toback) or (back == "all") then e:checkDisplay() ps[#ps+1] = e end diff --git a/game/engines/default/engine/Particles.lua b/game/engines/default/engine/Particles.lua index a5525198a241943ed8f9d43943713ca026782ce6..7b38fbef751a565c00adfb9df299093373c13950 100644 --- a/game/engines/default/engine/Particles.lua +++ b/game/engines/default/engine/Particles.lua @@ -62,6 +62,7 @@ function _M:loaded() if t.use_shader then self.shader = t.use_shader end if t.alterscreen then islast = true end + if t.toback then self.toback = true end if t.sub_particle then sub_particle = t.sub_particle end else error("unsupported particle type: "..type(self.def)) end diff --git a/game/modules/tome/data/birth/classes/corrupted.lua b/game/modules/tome/data/birth/classes/corrupted.lua index 03747069c5b3a0180fe5027e9ec8418700d3f7c8..3d8958fab5faf5fb3438bad4eada493ac41e6ea5 100644 --- a/game/modules/tome/data/birth/classes/corrupted.lua +++ b/game/modules/tome/data/birth/classes/corrupted.lua @@ -105,7 +105,9 @@ newBirthDescriptor{ power_source = {arcane=true}, stats = { mag=4, wil=3, con=2, }, birth_example_particles = { - function(actor) actor:addParticles(Particles.new("shadowfire", 1)) end, + function(actor) if core.shader.active(4) then actor:addParticles(Particles.new("shadowfire", 1)) end end, + function(actor) if core.shader.active(4) then actor:addParticles(Particles.new("shader_wings", 1, {infinite=1, img="bloodwings", flap=28, a=0.6})) end + end, }, talents_types = { ["cunning/survival"]={false, 0}, diff --git a/game/modules/tome/data/birth/classes/mage.lua b/game/modules/tome/data/birth/classes/mage.lua index 8aee0cccec8d30ce711bc59c2f665802c9a48106..786ff5dc959f46597dc6a3b99060dc770e09221c 100644 --- a/game/modules/tome/data/birth/classes/mage.lua +++ b/game/modules/tome/data/birth/classes/mage.lua @@ -127,7 +127,7 @@ newBirthDescriptor{ stats = { mag=5, wil=3, cun=1, }, birth_example_particles = { function(actor) - if core.shader.active(4) then actor:addParticles(Particles.new("shader_ring_rotating", 1, {radius=1.1}, {type="flames", hide_center=0, xy={0, 0}})) + if core.shader.active(4) then actor:addParticles(Particles.new("shader_wings", 1, {infinite=1})) else actor:addParticles(Particles.new("wildfire", 1)) end end, @@ -236,6 +236,10 @@ newBirthDescriptor{ }, birth_example_particles = { "necrotic-aura", + function(actor) + if core.shader.active(4) then actor:addParticles(Particles.new("shader_wings", 1, {infinite=1, img="darkwings"})) + end + end, function(actor) actor:addParticles(Particles.new("ultrashield", 1, {rm=0, rM=0, gm=0, gM=0, bm=10, bM=100, am=70, aM=180, radius=0.4, density=60, life=14, instop=20})) end, diff --git a/game/modules/tome/data/gfx/particles/shader_wings.lua b/game/modules/tome/data/gfx/particles/shader_wings.lua index 70cb3b9cbca055d4872cd3f7868a76326d16e135..bf804789c419f833c82b5687b18420cca43db819 100644 --- a/game/modules/tome/data/gfx/particles/shader_wings.lua +++ b/game/modules/tome/data/gfx/particles/shader_wings.lua @@ -17,7 +17,7 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org -use_shader = {type="flamewings", deploy_factor=deploy_speed, flap=flap} +use_shader = {type="flamewings", deploy_factor=deploy_speed, flap=flap} toback=true base_size = 32 local r = 1 diff --git a/game/modules/tome/data/talents/corruptions/shadowflame.lua b/game/modules/tome/data/talents/corruptions/shadowflame.lua index 2b3e95f6e7ce12fde4ec6aa5daec5bac0c105f7b..8de6bea6c3871af652ce0ec7f098a8a2e4b1bdad 100644 --- a/game/modules/tome/data/talents/corruptions/shadowflame.lua +++ b/game/modules/tome/data/talents/corruptions/shadowflame.lua @@ -225,9 +225,7 @@ newTalent{ local particle if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {infinite=1, img="bloodwings", flap=28, a=0.6}) - p.toback = true - particle = self:addParticles(p) + particle = self:addParticles(Particles.new("shader_wings", 1, {infinite=1, img="bloodwings", flap=28, a=0.6})) end local ret = { vim = self:addTemporaryValue("vim_regen", -5), diff --git a/game/modules/tome/data/talents/gifts/cold-drake.lua b/game/modules/tome/data/talents/gifts/cold-drake.lua index 63030005d2b13e2196aab40391175a61c7cf50af..a19682a7cb52d35dde4b51385845dc247976e9ae 100644 --- a/game/modules/tome/data/talents/gifts/cold-drake.lua +++ b/game/modules/tome/data/talents/gifts/cold-drake.lua @@ -174,9 +174,7 @@ newTalent{ game:playSoundNear(self, "talents/breath") if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14}) - p.toback = true - self:addParticles(p) + self:addParticles(Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})) end return true end, diff --git a/game/modules/tome/data/talents/gifts/fire-drake.lua b/game/modules/tome/data/talents/gifts/fire-drake.lua index f3a7a835f225dcdaca38e09db6bc7b15f3c5ecc0..4b2a4348ec31f8b56c00f44024338aa5557b01c2 100644 --- a/game/modules/tome/data/talents/gifts/fire-drake.lua +++ b/game/modules/tome/data/talents/gifts/fire-drake.lua @@ -81,9 +81,7 @@ newTalent{ game:playSoundNear(self, "talents/breath") if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14}) - p.toback = true - self:addParticles(p) + self:addParticles(Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})) end return true end, diff --git a/game/modules/tome/data/talents/gifts/higher-draconic.lua b/game/modules/tome/data/talents/gifts/higher-draconic.lua index f502dfccad2f0430f2654a07ba5975ef588cca22..87387637ea4448fceb695d3a10f95368655e7fdc 100644 --- a/game/modules/tome/data/talents/gifts/higher-draconic.lua +++ b/game/modules/tome/data/talents/gifts/higher-draconic.lua @@ -123,9 +123,7 @@ newTalent{ game:playSoundNear(self, "talents/breath") if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14}) - p.toback = true - self:addParticles(p) + self:addParticles(Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})) end return true end, diff --git a/game/modules/tome/data/talents/gifts/sand-drake.lua b/game/modules/tome/data/talents/gifts/sand-drake.lua index 33e1743659e5e43b87dbd3e03f87bd771a7f4f0b..932d4309c22db4e9a866eded7e48e8771f64f4dd 100644 --- a/game/modules/tome/data/talents/gifts/sand-drake.lua +++ b/game/modules/tome/data/talents/gifts/sand-drake.lua @@ -159,9 +159,7 @@ newTalent{ game:playSoundNear(self, "talents/breath") if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14}) - p.toback = true - self:addParticles(p) + self:addParticles(Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})) end return true end, diff --git a/game/modules/tome/data/talents/gifts/storm-drake.lua b/game/modules/tome/data/talents/gifts/storm-drake.lua index 36a1ce269bea243b4ae40ea7a67fc050c4f42824..498d1d1aeb68c60fd74aa911400221348acfe5d6 100644 --- a/game/modules/tome/data/talents/gifts/storm-drake.lua +++ b/game/modules/tome/data/talents/gifts/storm-drake.lua @@ -212,9 +212,7 @@ newTalent{ if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {img="lightningwings",infinite=1, life=18, fade=0*-0.003, deploy_speed=14}) - p.toback = true - self:addParticles(p) + self:addParticles(Particles.new("shader_wings", 1, {img="lightningwings", life=18, fade=-0.003, deploy_speed=14})) end game:playSoundNear(self, "talents/breath") return true diff --git a/game/modules/tome/data/talents/gifts/venom-drake.lua b/game/modules/tome/data/talents/gifts/venom-drake.lua index 64e2c9dd8e0e83056bba2fb82a1e03e76df9d013..9958a78d1e8cffbac6d18e4cb1ec62b0072974dc 100644 --- a/game/modules/tome/data/talents/gifts/venom-drake.lua +++ b/game/modules/tome/data/talents/gifts/venom-drake.lua @@ -184,9 +184,7 @@ newTalent{ game:playSoundNear(self, "talents/breath") if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14}) - p.toback = true - self:addParticles(p) + self:addParticles(Particles.new("shader_wings", 1, {life=18, fade=-0.003, deploy_speed=14})) end return true end, diff --git a/game/modules/tome/data/talents/spells/grave.lua b/game/modules/tome/data/talents/spells/grave.lua index 87ebb50ddae4ea0e701eece762a4809bafd5d8b2..7f46a493341d52f7be774dbb69a84d9056582cf5 100644 --- a/game/modules/tome/data/talents/spells/grave.lua +++ b/game/modules/tome/data/talents/spells/grave.lua @@ -331,9 +331,7 @@ newTalent{ game:playSoundNear(self, "talents/spell_generic2") local particle if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {infinite=1, img="darkwings"}) - p.toback = true - particle = self:addParticles(p) + particle = self:addParticles(Particles.new("shader_wings", 1, {infinite=1, img="darkwings"})) end local ret = { chance = self:addTemporaryValue("life_leech_chance", chance), diff --git a/game/modules/tome/data/talents/spells/wildfire.lua b/game/modules/tome/data/talents/spells/wildfire.lua index 7ff2a020025badaf1a89b760e988a8da73353f8d..a3d00bc64e80607e230d22f85d97f2eb13ff9ed5 100644 --- a/game/modules/tome/data/talents/spells/wildfire.lua +++ b/game/modules/tome/data/talents/spells/wildfire.lua @@ -124,9 +124,7 @@ newTalent{ local particle if core.shader.active(4) then - local p = Particles.new("shader_wings", 1, {infinite=1}) - p.toback = true - particle = self:addParticles(p) + particle = self:addParticles(Particles.new("shader_wings", 1, {infinite=1})) else particle = self:addParticles(Particles.new("wildfire", 1)) end diff --git a/game/modules/tome/dialogs/Birther.lua b/game/modules/tome/dialogs/Birther.lua index 505a4eba3fc1696507040fc8be459925b295652b..50a439022a058b8aea3f3ff6694b72491ef62572 100644 --- a/game/modules/tome/dialogs/Birther.lua +++ b/game/modules/tome/dialogs/Birther.lua @@ -1066,7 +1066,7 @@ function _M:setTile(f, w, h, last) self:fakeEquip(false) -- Add an example particles if any - local ps = self.actor:getParticlesList() + local ps = self.actor:getParticlesList("all") for i, p in ipairs(ps) do self.actor:removeParticles(p) end if self.descriptors_by_type.subclass then local d = self.birth_descriptor_def.subclass[self.descriptors_by_type.subclass]