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

spellbinding talents cannot overlap

parent f7b297f3
No related branches found
No related tags found
1 merge request!107Chrono talent balance
......@@ -47,6 +47,7 @@ newTalent{
local power = t.getPower(self, t) * 100
local talent = self:isTalentActive(t.id) and self:getTalentFromId(self:isTalentActive(t.id).talent).name or "None"
return ([[Empowers the selected chronomancy spell, increasing spellpower when casting it by %d%%.
Each spell can only be spellbound in one way at a time.
Current Empowered Spell: %s]]):
format(power, talent)
......@@ -81,6 +82,7 @@ newTalent{
local power = t.getPower(self, t) * 100
local talent = self:isTalentActive(t.id) and self:getTalentFromId(self:isTalentActive(t.id).talent).name or "None"
return ([[Extends the duration of the selected chronomancy spell by %d%%.
Each spell can only be spellbound in one way at a time.
Current Extended Spell: %s]]):
format(power, talent)
......@@ -115,6 +117,7 @@ newTalent{
local power = t.getPower(self, t) * 100
local talent = self:isTalentActive(t.id) and self:getTalentFromId(self:isTalentActive(t.id).talent).name or "None"
return ([[Reduces the cooldown of the selected chronomancy spell by %d%%.
Each spell can only be spellbound in one way at a time.
Current Matrix Spell: %s]]):
format(power, talent)
......@@ -149,6 +152,7 @@ newTalent{
local power = t.getPower(self, t) * 100
local talent = self:isTalentActive(t.id) and self:getTalentFromId(self:isTalentActive(t.id).talent).name or "None"
return ([[Reduces the casting speed of the selected chronomancy spell by %d%%.
Each spell can only be spellbound in one way at a time.
Current Quickened Spell: %s]]):
format(power, talent)
......
......@@ -37,6 +37,20 @@ local function TalentStatus(who,t)
return tostring(status)
end
-- check if the talent is already bound to another sustain
local function spellbound(who, t)
for tid, active in pairs(who.sustain_talents) do
if active then
local tt = who:getTalentFromId(tid)
if tt.type[1]:find("^chronomancy/spellbinding") then
if who:isTalentActive(tid).talent == t then
return true
end
end
end
end
end
function _M:init(actor)
self.actor = actor
actor.hotkey = actor.hotkey or {}
......@@ -105,7 +119,7 @@ function _M:generateList()
-- Generate lists of all talents by category
for j, t in pairs(self.actor.talents_def) do
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and t.mode ~= "passive" then
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and t.mode ~= "passive" and not spellbound(self.actor, t.id) then
local nodes = talents
local status = tstring{{"color", "LIGHT_GREEN"}, "Talents"}
......
......@@ -37,6 +37,20 @@ local function TalentStatus(who,t)
return tostring(status)
end
-- check if the talent is already bound to another sustain
local function spellbound(who, t)
for tid, active in pairs(who.sustain_talents) do
if active then
local tt = who:getTalentFromId(tid)
if tt.type[1]:find("^chronomancy/spellbinding") then
if who:isTalentActive(tid).talent == t then
return true
end
end
end
end
end
function _M:init(actor)
self.actor = actor
actor.hotkey = actor.hotkey or {}
......@@ -105,7 +119,7 @@ function _M:generateList()
-- Generate lists of all talents by category
for j, t in pairs(self.actor.talents_def) do
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and t.getDuration and t.mode ~= "passive" then
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and t.getDuration and t.mode ~= "passive" and not spellbound(self.actor, t.id) then
local nodes = talents
local status = tstring{{"color", "LIGHT_GREEN"}, "Talents"}
......
......@@ -37,6 +37,20 @@ local function TalentStatus(who,t)
return tostring(status)
end
-- check if the talent is already bound to another sustain
local function spellbound(who, t)
for tid, active in pairs(who.sustain_talents) do
if active then
local tt = who:getTalentFromId(tid)
if tt.type[1]:find("^chronomancy/spellbinding") then
if who:isTalentActive(tid).talent == t then
return true
end
end
end
end
end
function _M:init(actor)
self.actor = actor
actor.hotkey = actor.hotkey or {}
......@@ -105,7 +119,7 @@ function _M:generateList()
-- Generate lists of all talents by category
for j, t in pairs(self.actor.talents_def) do
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and t.cooldown and t.mode ~= "passive" and not t.fixed_cooldown then
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and t.cooldown and t.mode ~= "passive" and not t.fixed_cooldownand and not spellbound(self.actor, t.id) then
local nodes = talents
local status = tstring{{"color", "LIGHT_GREEN"}, "Talents"}
......
......@@ -37,6 +37,20 @@ local function TalentStatus(who,t)
return tostring(status)
end
-- check if the talent is already bound to another sustain
local function spellbound(who, t)
for tid, active in pairs(who.sustain_talents) do
if active then
local tt = who:getTalentFromId(tid)
if tt.type[1]:find("^chronomancy/spellbinding") then
if who:isTalentActive(tid).talent == t then
return true
end
end
end
end
end
function _M:init(actor)
self.actor = actor
actor.hotkey = actor.hotkey or {}
......@@ -105,7 +119,7 @@ function _M:generateList()
-- Generate lists of all talents by category
for j, t in pairs(self.actor.talents_def) do
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and not t.no_energy and t.mode ~= "passive" then
if self.actor:knowTalent(t.id) and t.type[1]:find("^chronomancy/") and not t.type[1]:find("^chronomancy/spellbinding") and not t.hide and not t.no_energy and t.mode ~= "passive" and not spellbound(self.actor, t.id) then
local nodes = talents
local status = tstring{{"color", "LIGHT_GREEN"}, "Talents"}
......
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