Skip to content

Commit

Permalink
Merge pull request #4221 from syrifgit/syrif-deathknight
Browse files Browse the repository at this point in the history
Unholy DK Rework
  • Loading branch information
Hekili authored Dec 6, 2024
2 parents 20bba46 + 2f35ecc commit a81d924
Show file tree
Hide file tree
Showing 3 changed files with 407 additions and 269 deletions.
69 changes: 62 additions & 7 deletions Classes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,6 @@ local HekiliSpecMixin = {
end
end,



RegisterPotion = function( self, potion, data )
self.potions[ potion ] = data

Expand Down Expand Up @@ -1017,31 +1015,88 @@ local HekiliSpecMixin = {

RegisterPet = function( self, token, id, spell, duration, ... )
CommitKey( token )


-- Register the main pet.
self.pets[ token ] = {
id = type( id ) == "function" and setfenv( id, state ) or id,
token = token,
spell = spell,
duration = type( duration ) == "function" and setfenv( duration, state ) or duration
}


-- Process copies.
local n = select( "#", ... )

if n and n > 0 then
for i = 1, n do
local copy = select( i, ... )
self.pets[ copy ] = self.pets[ token ]
end
end
end,


RegisterPets = function( self, pets )
for token, data in pairs( pets ) do
-- Extract fields from the pet definition.
local id = data.id
local spell = data.spell
local duration = data.duration
local copy = data.copy

-- Register the pet and handle the copy field if it exists.
if copy then
self:RegisterPet( token, id, spell, duration, copy )
else
self:RegisterPet( token, id, spell, duration )
end
end
end,

RegisterTotem = function( self, token, id )

RegisterTotem = function( self, token, id, ... )
-- Register the primary totem.
self.totems[ token ] = id
self.totems[ id ] = token


-- Handle copies if provided.
local n = select( "#", ... )
if n and n > 0 then
for i = 1, n do
local copy = select( i, ... )
self.totems[ copy ] = id
self.totems[ id ] = copy
end
end

-- Commit the primary token.
CommitKey( token )
end,

RegisterTotems = function( self, totems )
for token, data in pairs( totems ) do
local id = data.id
local copy = data.copy

-- Register the primary totem.
self.totems[ token ] = id
self.totems[ id ] = token

-- Register any copies (aliases).
if copy then
if type( copy ) == "string" then
self.totems[ copy ] = id
self.totems[ id ] = copy
elseif type( copy ) == "table" then
for _, alias in ipairs( copy ) do
self.totems[ alias ] = id
self.totems[ id ] = alias
end
end
end

CommitKey( token )
end
end,

GetSetting = function( self, info )
local setting = info[ #info ]
Expand Down
9 changes: 6 additions & 3 deletions State.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1175,18 +1175,21 @@ state.removeDebuff = removeDebuff

local function removeDebuffStack( unit, aura, stacks )
stacks = stacks or 1

local d = state.debuff[ aura ]
if not d then return 0 end

if not d then return end
local removed = min( stacks, d.count )

if d.count > stacks then
d.lastCount = d.count
d.count = max( 1, d.count - stacks )
d.count = max( 0, d.count - stacks )
else
removeDebuff( unit, aura )
end

return removed
end

state.removeDebuffStack = removeDebuffStack


Expand Down
Loading

0 comments on commit a81d924

Please sign in to comment.