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

Added distortion effect to meteor crashes

parent a1ff0a53
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@ game.zone.on_turn = function()
game.level.map:particleEmitter(game.level.data.meteor_x, game.level.data.meteor_y, 10, "meteor").on_remove = function()
local x, y = game.level.data.meteor_x, game.level.data.meteor_y
game.level.map:particleEmitter(x, y, 10, "ball_fire", {radius=5})
if core.shader.allow("distort") then game.level.map:particleEmitter(x, y, 5, "shockwave", {radius=5}) end
game:playSoundNear(game.player, "talents/fireflash")
local terrains = mod.class.Grid:loadList("/data/general/grids/lava.lua")
......
......@@ -75,6 +75,7 @@ game.zone.on_turn = function()
game.level.map:particleEmitter(game.level.data.meteor_x, game.level.data.meteor_y, 10, "meteor").on_remove = function()
local x, y = game.level.data.meteor_x, game.level.data.meteor_y
game.level.map:particleEmitter(x, y, 10, "ball_fire", {radius=5})
if core.shader.allow("distort") then game.level.map:particleEmitter(x, y, 5, "shockwave", {radius=5}) end
game:playSoundNear(game.player, "talents/fireflash")
for i = x-2, x+2 do for j = y-2, y+2 do
......
......@@ -27,7 +27,7 @@ dir = math.deg(math.atan2(ty, tx))
--------------------------------------------------------------------------------------
-- Advanced shaders
--------------------------------------------------------------------------------------
if core.shader.active(4) then
if core.shader.allow("distort") then
use_shader = {type="distort", power=0.06, power_time=1000000, blacken=30} alterscreen = true
base_size = 64
local nb = 0
......
......@@ -20,7 +20,7 @@
--------------------------------------------------------------------------------------
-- Advanced shaders
--------------------------------------------------------------------------------------
if core.shader.active(4) then
if core.shader.allow("distort") then
use_shader = {type="distort"} alterscreen = true
base_size = 64
local nb = 0
......
......@@ -17,7 +17,7 @@
-- Nicolas Casalini "DarkGod"
-- darkgod@te4.org
if core.shader.active(4) then
if core.shader.allow("distort") then
sub_particle = "gravity_well2"
end
......
-- 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
--------------------------------------------------------------------------------------
-- Advanced shaders
--------------------------------------------------------------------------------------
if core.shader.allow("distort") then
use_shader = {type="distort"} alterscreen = true
base_size = 64
local nb = 0
local size=10
local sizev=radius*14
local life=10
local rotation=22
return {
system_rotation = 0, system_rotationv = rotation or 0,
generator = function()
return {
life = life or 32,
size = size or 64, sizev = sizev or 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) nb = nb + 1 end
end,
1, "particles_images/distort_wave2"
--------------------------------------------------------------------------------------
-- Default
--------------------------------------------------------------------------------------
else
-- This is just an empty one
return {
generator = function()
return {
life = 1,
size = 1, 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) end,
1
end
......@@ -174,8 +174,7 @@ newTalent{
DamageType.GRAVITYPIN, dam,
radius,
5, nil,
-- {type="gravity_well"}, -- Put this back when "gravity_well" is available
{type="quake"},
{type="gravity_well"},
nil, self:spellFriendlyFire()
)
game:playSoundNear(self, "talents/earth")
......
......@@ -1772,6 +1772,7 @@ newTalent{
src:project({type="ball", radius=2, selffire=false}, x, y, engine.DamageType.FIRE, dam/2)
src:project({type="ball", radius=2, selffire=false}, x, y, engine.DamageType.PHYSICAL, dam/2)
if core.shader.allow("distort") then game.level.map:particleEmitter(x, y, 2, "shockwave", {radius=2}) end
game:getPlayer(true):attr("meteoric_crash", 1)
end
end
......
......@@ -100,6 +100,7 @@ uberTalent{
end
end
end)
if core.shader.allow("distort") then game.level.map:particleEmitter(x, y, 2, "shockwave", {radius=2}) end
game:getPlayer(true):attr("meteoric_crash", 1)
end
end
......
......@@ -933,6 +933,7 @@ int thread_particles(void *data)
pt->L = L;
lua_newtable(L);
lua_setglobal(L, "__fcts");
luaL_dostring(L, "function core.shader.allow() return true end");
// Override "print" if requested
if (no_debug)
......
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