Skip to content

Commit

Permalink
Interrupts with GCD's
Browse files Browse the repository at this point in the history
Are now properly supported
  • Loading branch information
Xeltor committed Oct 2, 2024
1 parent db7a954 commit 1179f88
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions State.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1210,11 +1210,12 @@ state.interrupt = interrupt


-- Use this for readyTime in an interrupt action; will interrupt casts at end of cast and channels ASAP.
local function timeToInterrupt()
local function timeToInterrupt( offset )
offset = offset or 0
local casting = state.debuff.casting
if casting.down or casting.v2 == 1 then return 3600 end
if casting.v3 == 1 then return 0 end
return max( 0, casting.remains - 0.25 )
return max( 0, casting.remains - 0.25 - offset )
end
state.timeToInterrupt = timeToInterrupt

Expand Down
2 changes: 1 addition & 1 deletion TheWarWithin/DeathKnightBlood.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ spec:RegisterAbilities( {
toggle = "interrupts",

debuff = "casting",
readyTime = state.timeToInterrupt,
readyTime = state.timeToInterrupt( gcd.max ),

handler = function ()
interrupt()
Expand Down
2 changes: 1 addition & 1 deletion TheWarWithin/DeathKnightFrost.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ spec:RegisterAbilities( {
toggle = "interrupts",

debuff = "casting",
readyTime = state.timeToInterrupt,
readyTime = state.timeToInterrupt( gcd.max ),

handler = function ()
applyDebuff( "target", "asphyxiate" )
Expand Down
2 changes: 1 addition & 1 deletion TheWarWithin/DeathKnightUnholy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ me:RegisterAbilities( {
toggle = "interrupts",

debuff = "casting",
readyTime = state.timeToInterrupt,
readyTime = state.timeToInterrupt( gcd.max ),

handler = function ()
applyDebuff( "target", "asphyxiate" )
Expand Down
2 changes: 1 addition & 1 deletion TheWarWithin/HunterBeastMastery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ spec:RegisterAbilities( {
toggle = "interrupts",

debuff = "casting",
readyTime = state.timeToInterrupt,
readyTime = state.timeToInterrupt( gcd.max ),

usable = function () return not boss end,
handler = function ()
Expand Down
2 changes: 1 addition & 1 deletion TheWarWithin/PaladinRetribution.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ spec:RegisterAbilities( {
toggle = "interrupts",

debuff = "casting",
readyTime = state.timeToInterrupt,
readyTime = state.timeToInterrupt( gcd.max ),

handler = function ()
interrupt()
Expand Down
4 changes: 2 additions & 2 deletions TheWarWithin/WarlockDemonology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ spec:RegisterAbilities( {
interrupt = true,

debuff = "casting",
readyTime = state.timeToInterrupt,
readyTime = state.timeToInterrupt( gcd.max ),

usable = function () return pet.exists, "requires felguard" end,
handler = function ()
Expand Down Expand Up @@ -1721,7 +1721,7 @@ spec:RegisterAbilities( {
interrupt = true,

debuff = "casting",
readyTime = state.timeToInterrupt,
readyTime = state.timeToInterrupt( gcd.max ),

handler = function ()
interrupt()
Expand Down
2 changes: 1 addition & 1 deletion TheWarWithin/WarriorArms.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ spec:RegisterAbilities( {

toggle = "interrupts",
debuff = function () return settings.shockwave_interrupt and "casting" or nil end,
readyTime = function () return settings.shockwave_interrupt and timeToInterrupt() or nil end,
readyTime = function () return settings.shockwave_interrupt and state.timeToInterrupt( gcd.max ) or nil end,

usable = function () return not target.is_boss end,

Expand Down
2 changes: 1 addition & 1 deletion TheWarWithin/WarriorFury.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ spec:RegisterAbilities( {

toggle = "interrupts",
debuff = function () return settings.shockwave_interrupt and "casting" or nil end,
readyTime = function () return settings.shockwave_interrupt and timeToInterrupt() or nil end,
readyTime = function () return settings.shockwave_interrupt and state.timeToInterrupt( gcd.max ) or nil end,

usable = function () return not target.is_boss end,

Expand Down
6 changes: 3 additions & 3 deletions TheWarWithin/WarriorProtection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ spec:RegisterAbilities( {

toggle = "interrupts",
debuff = function () return "casting" end,
readyTime = function () return timeToInterrupt() end,
readyTime = function () return state.timeToInterrupt( gcd.max ) end,

usable = function () return not target.is_boss and target.maxR < 8 end,
handler = function ()
Expand Down Expand Up @@ -1660,7 +1660,7 @@ spec:RegisterAbilities( {

toggle = "interrupts",
debuff = function () return settings.shockwave_interrupt and "casting" or nil end,
readyTime = function () return settings.shockwave_interrupt and timeToInterrupt() or nil end,
readyTime = function () return settings.shockwave_interrupt and state.timeToInterrupt( gcd.max ) or nil end,

usable = function () return not target.is_boss and target.maxR < 10 end,

Expand Down Expand Up @@ -1733,7 +1733,7 @@ spec:RegisterAbilities( {

toggle = "interrupts",
debuff = function () return "casting" end,
readyTime = function () return timeToInterrupt() end,
readyTime = function () return state.timeToInterrupt( gcd.max ) end,

handler = function ()
applyDebuff( "target", "storm_bolt" )
Expand Down

0 comments on commit 1179f88

Please sign in to comment.