Skip to content
Snippets Groups Projects
Commit e7e5dbb1 authored by DarkGod's avatar DarkGod
Browse files

moarr

parent d3806af4
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ require "engine.class"
module(..., package.seeall, class.make)
local __particles_gl = {}
setmetatable(__particles_gl, {__mode="v"})
--- Make a particle emitter
function _M:init(def, radius, args, shader)
......@@ -39,6 +40,7 @@ end
function _M:save()
return class.save(self, {
ps = true,
gl_texture = true,
})
end
......@@ -95,6 +97,7 @@ function _M:loaded()
end
self.ps = core.particles.newEmitter("/data/gfx/particles/"..self.def..".lua", args, self.zoom, config.settings.particles_density or 100, gl, sha, islast)
self.gl_texture = gl
if sub_particle then
self:setSub(sub_particle, 1, sub_particle_args)
......
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2014 Nicolas Casalini
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
base_size = 64
local first = true
local a = math.atan2(ty, tx)
local length = math.sqrt(ty*ty + tx*tx) * base_size
local life = 8
return {
system_rotation = 225 + math.deg(a), system_rotationv = 0, generator = function()
return {
trail = 0,
life = life,
size = 64, sizev = 0, sizea = 0,
x = 0, xv = 0, xa = 0,
y = 0, yv = 0, ya = 0,
dir = math.rad(135), dirv = 0, dira = 0,
dir = 0, dirv = 0, dira = 0,
vel = length / life, velv = 0, vela = 0,
r = 1, rv = 0, ra = 0,
g = 1, gv = 0, ga = 0,
b = 1, bv = 0, ba = 0,
a = 1, av = 0, aa = 0,
}
end
}, function(self)
if first then self.ps:emit(1) first = false end
end, 1, "particles_images/bone_spear"
......@@ -90,4 +90,4 @@ function(self)
nb = nb + 1
end
end
end, 1, "particles_images/"..img, true
end, 1, "particles_images/"..img
game/modules/tome/data/gfx/particles_images/bone_spear.png

6.51 KiB

game/modules/tome/data/gfx/particles_images/curse_gfx_02.png

25.9 KiB

game/modules/tome/data/gfx/particles_images/curse_gfx_03.png

24.9 KiB

game/modules/tome/data/gfx/particles_images/curse_gfx_04.png

27.3 KiB

......@@ -36,7 +36,9 @@ newTalent{
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:project(tg, x, y, DamageType.PHYSICAL, self:spellCrit(self:combatTalentSpellDamage(t, 20, 200)), {type="bones"})
self:project(tg, x, y, DamageType.PHYSICAL, self:spellCrit(self:combatTalentSpellDamage(t, 20, 200)))
local _ _, _, _, x, y = self:canProject(tg, x, y)
game.level.map:particleEmitter(self.x, self.y, tg.range, "bone_spear", {tx=x - self.x, ty=y - self.y})
game:playSoundNear(self, "talents/arcane")
return true
end,
......
......@@ -67,7 +67,7 @@ newTalent{
local target = game.level.map(tx, ty, Map.ACTOR)
if not target then return end
target:setEffect(target.EFF_CURSE_IMPOTENCE, 10, {power=t.imppower(self,t), apply_power=self:combatSpellpower()})
game.level.map:particleEmitter(tx, ty, 1, "circle", {base_rot=0, oversize=0.7, a=130, limit_life=8, appear=8, speed=0, img="curse_gfx", radius=0})
game.level.map:particleEmitter(tx, ty, 1, "circle", {base_rot=0, oversize=0.7, a=130, limit_life=8, appear=8, speed=0, img="curse_gfx_02", radius=0})
end)
game:playSoundNear(self, "talents/slime")
return true
......@@ -97,7 +97,7 @@ newTalent{
local target = game.level.map(tx, ty, Map.ACTOR)
if not target then return end
target:setEffect(target.EFF_CURSE_DEATH, 10, {src=self, dam=self:combatTalentSpellDamage(t, 10, 70), apply_power=self:combatSpellpower()})
game.level.map:particleEmitter(tx, ty, 1, "circle", {base_rot=0, oversize=0.7, a=130, limit_life=8, appear=8, speed=0, img="curse_gfx", radius=0})
game.level.map:particleEmitter(tx, ty, 1, "circle", {base_rot=0, oversize=0.7, a=130, limit_life=8, appear=8, speed=0, img="curse_gfx_03", radius=0})
end)
game:playSoundNear(self, "talents/slime")
return true
......@@ -127,7 +127,7 @@ newTalent{
local target = game.level.map(tx, ty, Map.ACTOR)
if not target then return end
target:setEffect(target.EFF_CURSE_VULNERABILITY, 7, {power=self:combatTalentSpellDamage(t, 10, 40), apply_power=self:combatSpellpower()})
game.level.map:particleEmitter(tx, ty, 1, "circle", {base_rot=0, oversize=0.7, a=130, limit_life=8, appear=8, speed=0, img="curse_gfx", radius=0})
game.level.map:particleEmitter(tx, ty, 1, "circle", {base_rot=0, oversize=0.7, a=130, limit_life=8, appear=8, speed=0, img="curse_gfx_04", radius=0})
end)
game:playSoundNear(self, "talents/slime")
return true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment