diff --git a/game/modules/tome/class/interface/Archery.lua b/game/modules/tome/class/interface/Archery.lua index c3bff9d3293d949f3ab2e92a9638daf6d71ee489..87573c7b3295c5e7242013277721db0eaa948161 100644 --- a/game/modules/tome/class/interface/Archery.lua +++ b/game/modules/tome/class/interface/Archery.lua @@ -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 diff --git a/game/modules/tome/data/talents/techniques/bow.lua b/game/modules/tome/data/talents/techniques/bow.lua index fa86e9ea6662440bcc8fc62dac38d94c7d10401e..6d8a782b91f3eb39c38aa37353549d6af51325a4 100644 --- a/game/modules/tome/data/talents/techniques/bow.lua +++ b/game/modules/tome/data/talents/techniques/bow.lua @@ -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 diff --git a/game/modules/tome/data/talents/techniques/sling.lua b/game/modules/tome/data/talents/techniques/sling.lua index 86ac60ecd1caf8c1765c09aefe7f9d97b41b85b7..738c0d6b736d708869af844c99c6e61b4c705bf7 100644 --- a/game/modules/tome/data/talents/techniques/sling.lua +++ b/game/modules/tome/data/talents/techniques/sling.lua @@ -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)})