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

Bow & Sling specific talents only work with bows or slings

git-svn-id: http://svn.net-core.org/repos/t-engine4@2063 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7d8f1088
No related branches found
No related tags found
No related merge requests found
......@@ -210,7 +210,7 @@ function _M:archeryShoot(targets, talent, tg, params)
end
--- Check if the actor has a bow or sling and corresponding ammo
function _M:hasArcheryWeapon()
function _M:hasArcheryWeapon(type)
if self:attr("disarmed") then
return nil, "disarmed"
end
......@@ -230,5 +230,6 @@ function _M:hasArcheryWeapon()
return nil, "bad ammo"
end
end
if type and weapon.archery ~= type then return nil, "bad type" end
return weapon, ammo
end
......@@ -39,6 +39,8 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:hasArcheryWeapon("bow") then game.logPlayer(self, "You must wield a bow!") return nil end
local targets = self:archeryAcquireTargets({type="beam"}, {one_shot=true})
if not targets then return end
self:archeryShoot(targets, t, {type="beam"}, {mult=self:combatTalentWeaponDamage(t, 1, 1.5), apr=1000})
......@@ -60,6 +62,8 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:hasArcheryWeapon("bow") then game.logPlayer(self, "You must wield a bow!") return nil end
local tg = {type="ball", radius=1}
local targets = self:archeryAcquireTargets(tg, {limit_shots=2})
if not targets then return end
......@@ -83,6 +87,8 @@ newTalent{
direct_hit = true,
requires_target = true,
action = function(self, t)
if not self:hasArcheryWeapon("bow") then game.logPlayer(self, "You must wield a bow!") return nil end
local tg = {type="ball", radius=2 + self:getTalentLevel(t)/3, friendlyfire=false}
local targets = self:archeryAcquireTargets(tg)
if not targets then return end
......
......@@ -46,6 +46,8 @@ newTalent{
end
end,
action = function(self, t)
if not self:hasArcheryWeapon("sling") then game.logPlayer(self, "You must wield a sling!") return nil end
local targets = self:archeryAcquireTargets()
if not targets then return end
self:archeryShoot(targets, t, nil, {mult=self:combatTalentWeaponDamage(t, 1, 1.5)})
......@@ -75,6 +77,8 @@ newTalent{
end
end,
action = function(self, t)
if not self:hasArcheryWeapon("sling") then game.logPlayer(self, "You must wield a sling!") return nil end
local targets = self:archeryAcquireTargets()
if not targets then return end
self:archeryShoot(targets, t, nil, {mult=self:combatTalentWeaponDamage(t, 1, 1.5)})
......@@ -96,6 +100,8 @@ newTalent{
range = 20,
requires_target = true,
action = function(self, t)
if not self:hasArcheryWeapon("sling") then game.logPlayer(self, "You must wield a sling!") return nil end
local targets = self:archeryAcquireTargets(nil, {multishots=2+self:getTalentLevelRaw(t)/2})
if not targets then return end
self:archeryShoot(targets, t, nil, {mult=self:combatTalentWeaponDamage(t, 0.3, 0.7)})
......
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