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

New lightning breath particle effect

git-svn-id: http://svn.net-core.org/repos/t-engine4@4659 51575b47-30f0-44d4-a5cc-537603b46e54
parent 43f11104
No related branches found
No related tags found
No related merge requests found
......@@ -194,7 +194,18 @@ newTalent{
if not x or not y then return nil end
local dam = t.getDamage(self, t)
self:project(tg, x, y, DamageType.LIGHTNING_DAZE, rng.avg(dam / 3, dam, 3))
game.level.map:particleEmitter(self.x, self.y, tg.radius, "breath_lightning", {radius=tg.radius, tx=x-self.x, ty=y-self.y})
local sradius = (tg.radius + 0.5) * (engine.Map.tile_w + engine.Map.tile_h) / 2
local nb_forks = 24
local angle_diff = 55 / nb_forks
local base_a = math.deg(math.atan2(y-self.y, x-self.x)) - 27.5
for i = 0, nb_forks - 1 do
local a = math.rad(rng.range(base_a+i*angle_diff,base_a+angle_diff+i*angle_diff))
local tx = x + math.floor(math.cos(a) * tg.radius)
local ty = y + math.floor(math.sin(a) * tg.radius)
game.level.map:particleEmitter(self.x, self.y, tg.radius, "lightning", {radius=tg.radius, grids=grids, tx=tx-x, ty=ty-y, nb_particles=25, life=12})
end
game:playSoundNear(self, "talents/breath")
return true
end,
......
File added
No preview for this file type
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