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

Scatter Shot has a tile

git-svn-id: http://svn.net-core.org/repos/t-engine4@6252 51575b47-30f0-44d4-a5cc-537603b46e54
parent 634af5f1
No related branches found
No related tags found
No related merge requests found
......@@ -430,7 +430,7 @@ function _M:archeryShoot(targets, talent, tg, params)
tg.talent = tg.talent or talent
if not tg.range then tg.range=weapon.range or 6 end
tg.display = tg.display or {display=' ', particle="arrow", particle_args={tile="shockbolt/"..(ammo.proj_image or realweapon.proj_image):gsub("%.png$", "")}}
tg.display = tg.display or self:archeryDefaultProjectileVisual(realweapon, ammo)
tg.speed = (tg.speed or 10) + (ammo.combat.travel_speed or 0) + (weapon.travel_speed or 0) + (self.travel_speed or 0)
tg.archery = params or {}
tg.archery.weapon = weapon
......@@ -441,6 +441,10 @@ function _M:archeryShoot(targets, talent, tg, params)
end
end
function _M:archeryDefaultProjectileVisual(weapon, ammo)
return {display=' ', particle="arrow", particle_args={tile="shockbolt/"..(ammo.proj_image or realweapon.proj_image):gsub("%.png$", "")}}
end
--- Check if the actor has a bow or sling and corresponding ammo
function _M:hasArcheryWeapon(type)
if self:attr("disarmed") then
......
......@@ -352,7 +352,8 @@ newTalent{
tactical = { ATTACKAREA = { weapon = 2 }, DISABLE = { stun = 3 } },
requires_target = true,
target = function(self, t)
return {type="ball", radius=self:getTalentRadius(t), range=self:getTalentRange(t)}
local weapon, ammo = self:hasArcheryWeapon()
return {type="ball", radius=self:getTalentRadius(t), range=self:getTalentRange(t), display=self:archeryDefaultProjectileVisual(weapon, ammo)}
end,
on_pre_use = function(self, t, silent) if not self:hasArcheryWeapon() then if not silent then game.logPlayer(self, "You require a bow or sling for this talent.") end return false end return true end,
archery_onhit = function(self, t, target, x, 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