Skip to content
Snippets Groups Projects
Commit 61a81b6d authored by dg's avatar dg
Browse files

New particle effects for Warshout, Battle Cry, Shattering Shout, Aura of...

New particle effects for Warshout, Battle Cry, Shattering Shout, Aura of Silence, Bellowing Roar and Mind Sear


git-svn-id: http://svn.net-core.org/repos/t-engine4@6520 51575b47-30f0-44d4-a5cc-537603b46e54
parent e296bae0
No related branches found
No related tags found
No related merge requests found
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009, 2010, 2011, 2012, 2013 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
rm, rM = rm or 0.8, rM or 1
gm, gM = gm or 0.8, gM or 1
bm, bM = bm or 0, bM or 0
am, aM = am or 1, aM or 1
local dir = math.deg(math.atan2(ty, tx)) - 90
local spread = spread or 75/2
dir = dir - spread
local distortion_factor = 1 + (distortion_factor or 0.1)
local life = life or 30
local fullradius = (radius or 5) * engine.Map.tile_w
local basespeed = fullradius / life
local points = {}
local nbone
for fork_i = 1, nb_circles or 7 do
local size = size or 2
local r = 10
local a = math.rad(dir)
local firstspeed = rng.float(basespeed, basespeed * distortion_factor)
points[#points+1] = {size=size, dir = a + math.rad(90), vel = firstspeed, x=math.cos(a) * r, y=math.sin(a) * r, prev=-1}
for i = 1, spread * 2, 5 do
local a = math.rad(dir + i)
points[#points+1] = {
size=size,
dir = a + math.rad(90),
vel = rng.float(basespeed, basespeed * distortion_factor),
x=math.cos(a) * r,
y=math.sin(a) * r,
prev=#points-1
}
end
if not nbone then nbone = #points end
end
local nbp = #points
-- Populate the lightning based on the forks
return { engine=core.particles.ENGINE_LINES, generator = function()
local p = table.remove(points, 1)
return {
life = life, trail=p.prev,
size = p.size, sizev = 0, sizea = 0,
x = p.x, xv = 0, xa = 0,
y = p.y, yv = 0, ya = 0,
dir = p.dir, dirv = 0, dira = 0,
vel = p.vel, velv = 0, vela = 0,
r = rng.float(rm, rM), rv = 0, ra = 0,
g = rng.float(gm, gM), gv = 0, ga = 0,
b = rng.float(bm, bM), bv = 0, ba = 0,
a = rng.float(am, aM), av = 0, aa = -0.001,
}
end, },
function(self)
if nbp > 0 then
self.ps:emit(nbone)
nbp = nbp - nbone
end
end,
nbp, "particles_images/beam"
......@@ -26,7 +26,7 @@ local points = {}
for fork_i = 1, nb_circles or 5 do
local size = 2
local r = 10
local r = baseradius
local a = 0
local firstspeed = rng.float(basespeed, basespeed * distortion_factor)
points[#points+1] = {size=size, dir = a + math.rad(90), vel = firstspeed, x=math.cos(a) * r, y=math.sin(a) * r, prev=-1}
......
......@@ -17,6 +17,11 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
rm, rM = rm or 0.8, rM or 1
gm, gM = gm or 0.8, gM or 1
bm, bM = bm or 0, bM or 0
am, aM = am or 1, aM or 1
-- Make the 2 main forks
local distortion_factor = 1 + (distortion_factor or 0.1)
local life = life or 30
......@@ -25,7 +30,7 @@ local basespeed = fullradius / life
local points = {}
for fork_i = 1, nb_circles or 5 do
local size = 2
local size = size or 2
local r = 10
local a = 0
local firstspeed = rng.float(basespeed, basespeed * distortion_factor)
......@@ -48,7 +53,10 @@ end
local nbp = #points
-- Populate the lightning based on the forks
return { engine=core.particles.ENGINE_LINES, generator = function()
return {
blend_mode=additive and core.particles.BLEND_ADDITIVE or nil,
engine=core.particles.ENGINE_LINES,
generator = function()
local p = table.remove(points, 1)
return {
......@@ -60,10 +68,10 @@ return { engine=core.particles.ENGINE_LINES, generator = function()
dir = p.dir, dirv = 0, dira = 0,
vel = p.vel, velv = 0, vela = 0,
r = rng.float(0.8, 1), rv = 0, ra = 0,
g = rng.float(0.8, 1), gv = 0, ga = 0,
b = 0, bv = 0, ba = 0,
a = 1, av = 0, aa = -0.001,
r = rng.float(rm, rM), rv = 0, ra = 0,
g = rng.float(gm, gM), gv = 0, ga = 0,
b = rng.float(bm, bM), bv = 0, ba = 0,
a = rng.float(am, aM), av = 0, aa = -0.001,
}
end, },
function(self)
......
......@@ -61,6 +61,7 @@ newTalent{
action = function(self, t)
local tg = self:getTalentTarget(t)
self:project(tg, self.x, self.y, DamageType.SILENCE, {dur=3 + math.floor(self:getTalentLevel(t) / 2), power_check=self:combatMindpower()})
game.level.map:particleEmitter(self.x, self.y, 1, "shout", {size=4, distorion_factor=0.3, radius=self:getTalentRadius(t), life=30, nb_circles=8, rm=0.8, rM=1, gm=0, gM=0, bm=0.5, bM=0.8, am=0.6, aM=0.8})
return true
end,
info = function(self, t)
......
......@@ -36,7 +36,14 @@ 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.MIND, self:mindCrit(t.getDamage(self, t)), {type="mindsear"})
local dam = self:mindCrit(t.getDamage(self, t))
local baseradius = math.ceil(core.fov.distance(self.x, self.y, x, y) * 2.5)
self:project(tg, x, y, function(px, py)
DamageType:get(DamageType.MIND).projector(self, px, py, DamageType.MIND, dam)
game.level.map:particleEmitter(px, py, 1, "mindsear", {baseradius=baseradius * 0.66})
baseradius = baseradius - 10
end)
game:playSoundNear(self, "talents/spell_generic")
return true
end,
......
......@@ -138,7 +138,8 @@ newTalent{
dam=50+self:getTalentLevelRaw(t)*10,
power_check=function() return self:combatPhysicalpower() end,
resist_check=self.combatPhysicalResist,
}, {type="flame"})
})
game.level.map:particleEmitter(self.x, self.y, self:getTalentRadius(t), "directional_shout", {life=8, size=3, tx=x-self.x, ty=y-self.y, distorion_factor=0.1, radius=self:getTalentRadius(t), nb_circles=8, rm=0.8, rM=1, gm=0.4, gM=0.6, bm=0.1, bM=0.2, am=1, aM=1})
return true
end,
info = function(self, t)
......
......@@ -39,7 +39,8 @@ 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, (50 + self:getTalentLevel(t) * self:getStr()) / 2.3, {type="flame"})
self:project(tg, x, y, DamageType.PHYSICAL, (50 + self:getTalentLevel(t) * self:getStr()) / 2.3)
game.level.map:particleEmitter(self.x, self.y, self:getTalentRadius(t), "directional_shout", {life=8, size=2, tx=x-self.x, ty=y-self.y, distorion_factor=0.1, radius=self:getTalentRadius(t), nb_circles=8, rm=0.8, rM=1, gm=0.8, gM=1, bm=0.1, bM=0.2, am=0.6, aM=0.8})
return true
end,
info = function(self, t)
......@@ -109,7 +110,8 @@ newTalent{
local target = game.level.map(px, py, Map.ACTOR)
if not target then return end
target:setEffect(target.EFF_BATTLE_CRY, 7, {power=7 * self:getTalentLevel(t), apply_power=self:combatPhysicalpower()})
end, {type="flame"})
end)
game.level.map:particleEmitter(self.x, self.y, self:getTalentRadius(t), "directional_shout", {life=12, size=5, tx=x-self.x, ty=y-self.y, distorion_factor=0.1, radius=self:getTalentRadius(t), nb_circles=8, rm=0.8, rM=1, gm=0.8, gM=1, bm=0.1, bM=0.2, am=0.6, aM=0.8})
return true
end,
info = function(self, t)
......
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