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

bone explosion, yummy

parent d733fc1a
No related branches found
No related tags found
No related merge requests found
-- ToME - Tales of Maj'Eyal
-- Copyright (C) 2009 - 2019 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
--------------------------------------------------------------------------------------
-- Advanced shaders
--------------------------------------------------------------------------------------
if core.shader.active(4) then
use_shader = {type="fireflash"}
base_size = 64
local nb = 0
local dir = 0
if proj_x and src_x then
dir = math.deg(math.atan2(proj_y-src_y, proj_x-src_x))
end
return {
system_rotation = dir, system_rotationv = 0,
generator = function()
return {
life = 42,
--size = 30, sizev = 2.1*64*radius/16, sizea = 0,
size = 3.5*64*radius, sizev = 0, sizea = 0,
x = 0, xv = 0, xa = 0,
y = 0, yv = 0, ya = 0,
dir = 0, dirv = dirv, dira = 0,
vel = 0, 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 nb < 1 then
self.ps:emit(1)
end
nb = nb + 1
end,
1, "particles_images/bones_explosion_fireflash"
--------------------------------------------------------------------------------------
-- Default
--------------------------------------------------------------------------------------
else
local nb = 0
return { generator = function()
local radius = radius
local sradius = (radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local ad = rng.float(0, 360)
local a = math.rad(ad)
local r = rng.float(sradius - 5, sradius)
local x = r * math.cos(a)
local y = r * math.sin(a)
local bx = math.floor(x / engine.Map.tile_w)
local by = math.floor(y / engine.Map.tile_h)
local static = rng.percent(40)
return {
trail = 1,
life = 24,
size = 3, sizev = static and 0.05 or 0.15, sizea = 0,
x = x, xv = 0, xa = 0,
y = y, yv = 0, ya = 0,
dir = static and a + math.rad(90 - rng.range(10, 20)) or a, dirv = 0, dira = 0,
vel = static and -2 or 0.5 * (-1-nb) * radius / 2.7, velv = 0, vela = static and -0.01 or rng.float(-0.3, -0.2) * 0.3,
r = rng.range(0, 10)/255, rv = 0, ra = 0,
g = rng.range(200, 255)/255, gv = 0, ga = 0,
b = rng.range(120, 170)/255, bv = 0, ba = 0,
a = rng.range(25, 220)/255, av = static and -0.034 or 0, aa = 0.005,
}
end, },
function(self)
if nb < 5 then
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
self.ps:emit(radius*266)
nb = nb + 1
end
end,
5*radius*266
end
game/modules/tome/data/gfx/particles_images/bones_explosion_fireflash.png

412 KiB

......@@ -262,7 +262,7 @@ newTalent{
getDamage = function(self, t) return self:combatTalentSpellDamage(t, 30, 200) end,
callbackOnSummonDeath = function(self, t, summon, killer, death_note)
if not summon.is_bone_giant and not summon.skeleton_minion then return end
if killer and killer.reactionToward and killer:reactionToward(summon) >= 0 then return end
-- if killer and killer.reactionToward and killer:reactionToward(summon) >= 0 then return end
summon:projectApply({type="ball", radius=self:getTalentRadius(t)}, summon.x, summon.y, Map.ACTOR, function(target)
if target.summoner == self and (target.is_bone_giant or target.skeleton_minion) then
target:setEffect(target.EFF_SHATTERED_REMAINS, 20, {health=t:_getHealth(self), armor=t:_getArmor(self), retaliation=t:_getRetaliation(self)})
......@@ -272,7 +272,7 @@ newTalent{
end)
game.logSeen(summon, "#GREY#%s shatters!", summon:getName():capitalize())
game.level.map:particleEmitter(summon.x, summon.y, self:getTalentRadius(t), "corpse_explosion", {radius=self:getTalentRadius(t)})
game.level.map:particleEmitter(summon.x, summon.y, self:getTalentRadius(t), "bone_explosion", {radius=self:getTalentRadius(t)})
game:playSoundNear(summon, "talents/skeleton")
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