Skip to content
Snippets Groups Projects
Commit 68b2d551 authored by Recaiden's avatar Recaiden
Browse files

New particle effect for Crimson templar

 - thin lines from you to the victim of Shared Agony
 - thick lines going from you to each creature affected by Rosebloom, then back in.
parent ba858492
No related branches found
No related tags found
1 merge request!659Fallen graphics
-- 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
-- Make the 2 main forks
local sizeratio = 64 / engine.Map.tile_w
local dir = dir
local dist = (range or 1) * engine.Map.tile_w
local life = 32
local points = {}
points[#points+1] = {size=4, x=0, y=0, prev=-1, angle=0, vel=0}
for i = 1, 16 do
local x = rng.range(-2, 2) / sizeratio
local y = -dist / 16 * i
-- local si = math.sqrt(i) * 0.8
local size
if i <= 4 then size = 16 - i * 3
else size = points[#points].size * 0.92
end
points[#points+1] = {angle=-math.pi/2, vel=y/life/sizeratio * ((grab and 1) or -1), size=(i==16) and 1 or size, x=x, y=y, prev=#points-1}
end
local nbp = #points
return { engine=core.particles.ENGINE_LINES, system_rotation=dir, generator = function()
local p = table.remove(points, 1)
if not p then return nil end
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.angle, dirv = 0, dira = 0,
vel = p.vel, velv = 0, vela = 0,
r = 1, rv = 0, ra = 0,
g = 1, gv = 0, ga = 0,
b = 1, bv = 0, ba = 0,
a = 0.5, av = 0, aa = -1/(life^2)*2,
}
end, },
function(self)
if nbp > 0 then
nbp = nbp - self.ps:emit(nbp)
end
end,
nbp, "particles_images/"..img
game/modules/tome/data/gfx/particles_images/blood_trail_segment.png

4.1 KiB

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

4.11 KiB

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

3.95 KiB

......@@ -66,6 +66,10 @@ newTalent{
state.no_reflect = nil
game:delayedLogDamage(src, self, 0, ("%s(%d shared agony)#LAST#"):tformat(DamageType:get(type).text_color or "#aaaaaa#", displace), false)
local hx, hy = self:attachementSpot("back", true)
local ps = Particles.new("blood_trail", 1, {range=core.fov.distance(self.x, self.y, a.x, a.y), dir=math.deg(math.atan2(a.y-self.y, a.x-self.x)+math.pi/2), img="blood_trail_segment_thin", dx=hx, dy=hy, grab=false})
self:addParticles(ps)
end
end
......@@ -236,6 +240,9 @@ newTalent{
end
if bleeding and target:canBe("sleep") then
local hx, hy = self:attachementSpot("back", true)
local ps = Particles.new("blood_trail", 1, {range=core.fov.distance(self.x, self.y, target.x, target.y), dir=math.deg(math.atan2(target.y-self.y, target.x-self.x)+math.pi/2), img="blood_trail_segment_thick", grab=true, dx=hx, dy=hy})
self:addParticles(ps)
target:setEffect(target.EFF_SLEEP, dur+t.getExtension(self, t), {src=self, power = math.ceil(sleepPower * sleepMultiplier * 1.5), contagious=0, waking=is_waking, insomnia=t.getInsomniaPower(self, t), no_ct_effect=true, apply_power=self:combatSpellpower()})
else
game.logSeen(self, "%s resists the sleep!", target.name:capitalize())
......
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