Skip to content

Commit

Permalink
Support ability.disabled for charges/charges_fractional/remains in co…
Browse files Browse the repository at this point in the history
…oldowns.
  • Loading branch information
Hekili committed Apr 24, 2020
1 parent 1b67475 commit c7d9b67
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions State.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2494,7 +2494,7 @@ local mt_default_cooldown = {
return t[k]

elseif k == 'charges' then
if not raw and state:IsDisabled( t.key ) then
if not raw and ( state:IsDisabled( t.key ) or ability.disabled ) then
return 0
end

Expand All @@ -2516,7 +2516,7 @@ local mt_default_cooldown = {

-- If the ability is toggled off in the profile, we may want to fake its CD.
-- Revisit this if I add base_cooldown to the ability tables.
if not raw and state:IsDisabled( t.key ) then
if not raw and ( state:IsDisabled( t.key ) or ability.disabled ) then
return ability.cooldown
end

Expand All @@ -2527,7 +2527,7 @@ local mt_default_cooldown = {

elseif k == 'charges_fractional' then
if not state:IsKnown( t.key ) then return 1 end
if not raw and state:IsDisabled( t.key ) then return 0 end
if not raw and ( state:IsDisabled( t.key ) or ability.disabled ) then return 0 end

if ability.charges then
if t.charge < ability.charges then
Expand Down Expand Up @@ -2631,6 +2631,7 @@ local mt_gcd = {
if ability and ability.gcdTime then return ability.gcdTime end

local gcd = ability and ability.gcd or "spell"

if gcd == "off" then return 0 end
if gcd == "totem" then return 1 end

Expand Down Expand Up @@ -5678,6 +5679,10 @@ do
end
end

if ability.disabled then
return false, "ability.disabled returned true"
end

if ability.form and not state.buff[ ability.form ].up then
return false, "required form (" .. ability.form .. ") not active"
end
Expand Down

0 comments on commit c7d9b67

Please sign in to comment.