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

Eye of the Tiger is now configurable by addons

parent 6dc0f627
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -213,6 +213,23 @@ uberTalent{
end,
}
eye_of_the_tiger_data = {
physical = {
desc = "All physical criticals reduce the remaining cooldown of a random technique or cunning talent by 2.",
types = { "^technique/", "^cunning/" },
reduce = 2,
},
spell = {
desc = "All spell criticals reduce the remaining cooldown of a random spell talent by 1.",
types = { "^spell/", "^corruption/", "^celestial/", "^chronomancy/" },
reduce = 1,
},
mind = {
desc = "All mind criticals reduce the remaining cooldown of a random wild gift/psionic/afflicted talent by 2.",
types = { "^wild%-gift/", "^cursed/", "^psionic/" },
reduce = 2,
},
}
uberTalent{
name = "Eye of the Tiger",
mode = "passive",
......@@ -224,46 +241,30 @@ uberTalent{
for tid, _ in pairs(self.talents_cd) do
local t = self:getTalentFromId(tid)
if not t.fixed_cooldown then
if
(kind == "physical" and
(
t.type[1]:find("^technique/") or
t.type[1]:find("^cunning/")
)
) or
(kind == "spell" and
(
t.type[1]:find("^spell/") or
t.type[1]:find("^corruption/") or
t.type[1]:find("^celestial/") or
t.type[1]:find("^chronomancy/")
)
) or
(kind == "mind" and
(
t.type[1]:find("^wild%-gift/") or
t.type[1]:find("^cursed/") or
t.type[1]:find("^psionic/")
)
)
then
local ok = false
local d = eye_of_the_tiger_data[kind]
if d then for _, check in ipairs(d.types) do
if t.type[1]:find(check) then ok = true break end
end end
if ok then
tids[#tids+1] = tid
end
end
end
if #tids == 0 then return end
local tid = rng.table(tids)
self.talents_cd[tid] = self.talents_cd[tid] - (kind == "spell" and 1 or 2)
local d = eye_of_the_tiger_data[kind]
self.talents_cd[tid] = self.talents_cd[tid] - (d and d.reduce or 1)
if self.talents_cd[tid] <= 0 then self.talents_cd[tid] = nil end
self.changed = true
self.turn_procs.eye_tiger = true
end,
info = function(self, t)
return ([[All physical criticals reduce the remaining cooldown of a random technique or cunning talent by 2.
All spell criticals reduce the remaining cooldown of a random spell talent by 1.
All mind criticals reduce the remaining cooldown of a random wild gift/psionic/afflicted talent by 2.
local list = {}
for _, d in pairs(eye_of_the_tiger_data) do list[#list+1] = d.desc end
return ([[%s
This can only happen once per turn, and cannot affect the talent that triggers it.]])
:format()
:format(table.concat(list, "\n"))
end,
}
......
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