Skip to content
Snippets Groups Projects
Commit a3ccb66c authored by Eric Wykoff's avatar Eric Wykoff
Browse files

fixed attack sometimes not swapping back to the bow

parent b0cfe9a8
No related branches found
No related tags found
No related merge requests found
......@@ -43,8 +43,9 @@ newTalent{
local swap, dam = doWardenWeaponSwap(self, t, t.getDamage(self, t), "blade")
local tg = self:getTalentTarget(t)
local x, y, target = self:getTarget(tg)
if not target or not self:canProject(tg, x, y) then
local _, x, y = self:canProject(tg, self:getTarget(tg))
local target = game.level.map(x, y, game.level.map.ACTOR)
if not target then
if swap then doWardenWeaponSwap(self, t, nil, "bow") end
return nil
end
......@@ -167,8 +168,9 @@ newTalent{
local swap, dam = doWardenWeaponSwap(self, t, t.getDamage(self, t), "blade")
local tg = self:getTalentTarget(t)
local x, y, target = self:getTarget(tg)
if not target or not self:canProject(tg, x, y) then
local _, x, y = self:canProject(tg, self:getTarget(tg))
local target = game.level.map(x, y, game.level.map.ACTOR)
if not target then
if swap then doWardenWeaponSwap(self, t, nil, "bow") end
return nil
end
......
......@@ -55,12 +55,12 @@ newTalent{
local swap = not self:attr("disarmed") and (self:attr("warden_swap") and doWardenWeaponSwap(self, t, nil, "blade"))
local tg = self:getTalentTarget(t)
local x, y = self:getTarget(tg)
if not x then return end
local _ _, x, y = self:canProject(tg, x, y)
if not x then return end
local target = game.level.map(x, y, engine.Map.ACTOR)
if not target then if swap then doWardenWeaponSwap(self, t, nil, "bow") end return end
local _, x, y = self:canProject(tg, self:getTarget(tg))
local target = game.level.map(x, y, game.level.map.ACTOR)
if not target then
if swap then doWardenWeaponSwap(self, t, nil, "bow") end
return nil
end
local did_alternate = false
for _, alt_t in ipairs(t.alternate_attacks) do
......
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