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

Flameshock when using Burning Wake will leave a trail of fire of the correct shape

git-svn-id: http://svn.net-core.org/repos/t-engine4@3414 51575b47-30f0-44d4-a5cc-537603b46e54
parent 227595e5
No related branches found
No related tags found
No related merge requests found
......@@ -783,8 +783,11 @@ function _M:addEffect(src, x, y, duration, damtype, dam, radius, dir, angle, ove
local grids
-- Handle any angle
if type(dir) == "table" then
grids = core.fov.beam_any_angle_grids(x, y, radius, dir.angle, angle, true)
-- Handle balls
if dir == 5 then
elseif dir == 5 then
grids = core.fov.circle_grids(x, y, radius, true)
-- Handle beams
else
......@@ -859,7 +862,8 @@ function _M:processEffects()
table.insert(todel, i)
elseif e.update_fct then
if e:update_fct() then
if e.dir == 5 then e.grids = core.fov.circle_grids(e.x, e.y, e.radius, true)
if type(dir) == "table" then e.grids = core.fov.beam_any_angle_gridse(e.x, e.y, e.radius, e.dir.angle, e.angle, true)
elseif e.dir == 5 then e.grids = core.fov.circle_grids(e.x, e.y, e.radius, true)
else e.grids = core.fov.beam_grids(e.x, e.y, e.radius, e.dir, e.angle, true) end
if e.particles then
if e.particles_only_one then
......
......@@ -906,6 +906,25 @@ function core.fov.beam_grids(x, y, radius, dir, angle, block)
return grids
end
function core.fov.beam_any_angle_grids(x, y, radius, dir_angle, angle, block)
if not x or not y then return {} end
if radius == 0 then return {[x]={[y]=true}} end
local grids = {}
core.fov.calc_beam_any_angle(x, y, game.level.map.w, game.level.map.h, radius, dir_angle, angle, function(_, lx, ly)
if block and game.level.map:checkEntity(lx, ly, engine.Map.TERRAIN, "block_move") then return true end
end,
function(_, lx, ly)
if not grids[lx] then grids[lx] = {} end
grids[lx][ly] = true
end, nil)
-- point of origin
if not grids[x] then grids[x] = {} end
grids[x][y] = true
return grids
end
--- Finds free grids around coords in a radius.
-- This will return a random grid, the closest possible to the epicenter
-- @param sx the epicenter coordinates
......
......@@ -108,7 +108,7 @@ newTalent{
self.x, self.y, 4,
DamageType.INFERNO, self:attr("burning_wake"),
tg.radius,
dir, 55,
{angle=math.deg(math.atan2(y - self.y, x - self.x))}, 55,
{type="inferno"},
nil, self:spellFriendlyFire()
)
......
......@@ -132,8 +132,8 @@ newTalent{
local damage = t.getDamage(self, t)
local duration = t.getDuration(self, t)
return ([[A wall of water rushes out from the caster doing %0.2f cold damage and %0.2f physical damage as well as knocking back targets each turn for %d turns.
The damage and duration will increase with the Magic stat]]):
format(damDesc(self, DamageType.COLD, damage/2), damDesc(self, DamageType.PHYSICAL, damage/2), duration)
The damage and duration will increase with the Magic stat]]):
format(damDesc(self, DamageType.COLD, damage/2), damDesc(self, DamageType.PHYSICAL, damage/2), duration)
end,
}
......@@ -161,7 +161,6 @@ newTalent{
3,
5, nil,
{type="icestorm", only_one=true},
-- engine.Entity.new{alpha=100, display='', color_br=30, color_bg=60, color_bb=200},
function(e)
e.x = e.src.x
e.y = e.src.y
......
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