Skip to content
Snippets Groups Projects
Commit 104db977 authored by DarkGod's avatar DarkGod
Browse files

fixed venomous strike / throwing knives learning/unlearning interaction

parent 7e6e6b9a
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -198,16 +198,8 @@ newTalent{
stamina = 14,
require = cuns_req4,
requires_target = true,
on_learn = function(self, t)
if self:knowTalent(self.T_THROWING_KNIVES) and not self:knowTalent(self.T_VENOMOUS_THROW) then
self:learnTalent(self.T_VENOMOUS_THROW, true, nil, {no_unlearn=true})
end
end,
on_unlearn = function(self, t)
if self:knowTalent(self.T_VENOMOUS_THROW) then
self:unlearnTalent(self.T_VENOMOUS_THROW)
end
end,
on_learn = venomous_throw_check,
on_unlearn = venomous_throw_check,
getDamage = function (self, t) return self:combatTalentWeaponDamage(t, 1.2, 2.1) end,
getSecondaryDamage = function (self, t) return self:combatTalentStatDamage(t, "cun", 50, 550) end,
getNb = function(self, t) return math.floor(self:combatTalentScale(t, 1, 4, "log")) end,
......
......@@ -299,14 +299,26 @@ end
-- Use the appropriate amount of stamina. Return false if we don't have enough.
use_stamina = function(self, cost)
cost = cost * (1 + self:combatFatigue() * 0.01)
local available = self:getStamina()
if self:hasEffect("EFF_ADRENALINE_SURGE") then
available = available + self.life
end
if cost > available then return end
self:incStamina(-cost)
return true
cost = cost * (1 + self:combatFatigue() * 0.01)
local available = self:getStamina()
if self:hasEffect("EFF_ADRENALINE_SURGE") then
available = available + self.life
end
if cost > available then return end
self:incStamina(-cost)
return true
end
venomous_throw_check = function(self)
if not self:knowTalent(self.T_VENOMOUS_THROW) then
if self:knowTalent(self.T_VENOMOUS_STRIKE) and self:knowTalent(self.T_THROWING_KNIVES) then
self:learnTalent(self.T_VENOMOUS_THROW, true, nil, {no_unlearn=true})
end
else
if not self:knowTalent(self.T_VENOMOUS_STRIKE) or not self:knowTalent(self.T_THROWING_KNIVES) then
self:unlearnTalent(self.T_VENOMOUS_THROW)
end
end
end
load("/data/talents/techniques/2hweapon.lua")
......
......@@ -104,16 +104,12 @@ newTalent{
level = function(level) return 0 + (level-1) * 8 end,
},
on_learn = function(self, t)
if self:knowTalent(self.T_VENOMOUS_STRIKE) and not self:knowTalent(self.T_VENOMOUS_THROW) then
self:learnTalent(self.T_VENOMOUS_THROW, true, nil, {no_unlearn=true})
end
venomous_throw_check(self)
local max = self:callTalent(self.T_THROWING_KNIVES, "getNb")
self:setEffect(self.EFF_THROWING_KNIVES, 1, {stacks=max, max_stacks=max })
end,
on_unlearn = function(self, t)
if self:knowTalent(self.T_VENOMOUS_THROW) then
self:unlearnTalent(self.T_VENOMOUS_THROW)
end
venomous_throw_check(self)
self:removeEffect(self.EFF_THROWING_KNIVES)
end,
speed = "throwing",
......
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