Skip to content

Commit

Permalink
refactor: clean up class rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainrider committed Jul 24, 2024
1 parent 7f00f86 commit 6df14ba
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 1,394 deletions.
120 changes: 2 additions & 118 deletions rules/Deathknight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,125 +24,9 @@ local _, addon = ...
if not addon.isClass('DEATHKNIGHT') then return end

AdiButtonAuras:RegisterRules(function()
Debug('Adding deathknight rules')
Debug('Rules', 'Adding deathknight rules')

return {
ImportPlayerSpells {
-- import all spells for
'DEATHKNIGHT',
-- except for
194879, -- Icy Talons
207203, -- Frost Shield (Frost talent)
273977, -- Grip of the Dead (Blood talent)
281209, -- Cold Heart (Frost talent)
287254, -- Dead of Winter (Frost honor talent)
},

ShowStacks {
219809, -- Tombstone (Blood talent)
195181, -- Bone Shield (Blood)
5,
},

ShowStacks {
{
55090, -- Scourge Strike (Unholy)
207311, -- Clawing Shadows (Unholy talent)
223829, -- Necrotic Strike (Unholy honor talent)
275699, -- Apocalypse (Unholy)
},
194310,
6,
'enemy',
},

ShowStacks {
45524, -- Chains of Ice
281209, -- Cold Heart (Frost talent)
20,
'player',
1,
'hint',
281208, -- Cold Heart (Frost talent)
},

Configure {
'IcyTalons',
BuildDesc('HELPFUL PLAYER', 'good', 'player', 194879), -- Icy Talons
49143, -- Frost Strike (Frost)
'player',
'UNIT_AURA',
function(_, model)
local found, count, expiration = GetPlayerBuff('player', 194879) -- Icy Talons
if found then
model.highlight = 'good'
model.expiration = expiration
if count and count > 1 then
model.count = count
end
end
end,
194878, -- Icy Talons (Frost talent)
},

Configure {
'RaiseDeadUnholy',
format(L["%s when you don't have a summoned ghoul."], DescribeHighlight('hint')),
46584, -- Rank 2 Unholy
'player',
'UNIT_PET',
function(_, model)
if HasPetSpells() then
model.highlight = 'good'
else
model.hint = true
end
end,
},

Configure {
'RaiseDead',
L['Show the remaining duration of @NAME.'],
46585, -- Rank 1 Blood/Frost
'player',
'PLAYER_TOTEM_UPDATE',
function(_, model)
local found, _, startTime, duration = GetTotemInfo(1) -- Risen Ghoul is always the first totem
if found then
model.highlight = 'good'
model.expiration = startTime + duration
end
end,
},

Configure {
'SummonGargoyle',
L['Show the remaining duration of @NAME.'],
49206, -- Summon Gargoyle (Unholy talent)
'player',
'PLAYER_TOTEM_UPDATE',
function(_, model)
local found, _, startTime, duration = GetTotemInfo(3) -- Gargoyle is always the third totem
if found then
model.highlight = 'good'
model.expiration = startTime + duration
end
end,
},

Configure {
'RaiseAbomination',
L['Show the remaining duration of @NAME.'],
288853, -- Summon Gargoyle (Unholy talent)
'player',
'PLAYER_TOTEM_UPDATE',
function(_, model)
local found, _, startTime, duration = GetTotemInfo(1) -- Raise Abomination is always the first totem
if found then
model.highlight = 'good'
model.expiration = startTime + duration
end
end,
},
ImportPlayerSpells { 'DEATHKNIGHT' },
}
end)
15 changes: 3 additions & 12 deletions rules/Demonhunter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,9 @@ local _, addon = ...
if not addon.isClass('DEMONHUNTER') then return end

AdiButtonAuras:RegisterRules(function()
Debug('Adding demonhunter rules')
Debug('Rules', 'Adding demonhunter rules')

return {
ImportPlayerSpells {
-- import all spells for
'DEMONHUNTER'
},

ShowDispellable {
258920, -- Immolation Aura (Vengeance)
'player',
'Magic',
205625, -- Cleansed by Flame (Vengeance honor talent)
},
ImportPlayerSpells { 'DEMONHUNTER' },
}
end)
155 changes: 1 addition & 154 deletions rules/Druid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,159 +27,6 @@ AdiButtonAuras:RegisterRules(function()
Debug('Rules', 'Adding druid rules')

return {
ImportPlayerSpells {
-- import all spells for
'DRUID',
-- except for
114108, -- Soul of the Forest (Restoration talent)
135700, -- Clearcasting (Feral)
145152, -- Bloodtalons (Feral talent)
155777, -- Germination (Restoration talent)
203059, -- King of the Jungle (Feral honor talent)
203407, -- Reactive Resin (Restoration honor talent)
203554, -- Focused Growth (Restoration honor talent)
207386, -- Spring Blossoms (Restoration talent)
207640, -- Abundance (Restoration talent)
209746, -- Moonkin Aura (Balance honor talent)
236187, -- Master Shapeshifter (Guardian honor talent)
279709, -- Starfond (Balance talent)
285646, -- Scent of Blood (Feral talent)
},

-- show combo points on spenders
ShowPower {
{
1079, -- Rip
22568, -- Ferocious Bite
22570, -- Maim (Feral)
52610, -- Savage Roar (Feral talent)
236026, -- Enraged Maim (Feral honor talent)
285381, -- Primal Wrath (Feral talent)
},
'ComboPoints'
},

-- don't show Clearcasting (Feral) on Thrash
SelfBuffAliases {
{
5221, -- Shred
106785, -- Swipe
202028, -- Brutal Slash (Feral talent)
},
135700, -- Clearcasting (Feral)
},

-- show Soul of the Forest on Swiftmend
PassiveModifier {
158478, -- Soul of the Forest (Restoration talent)
18562, -- Swiftmend
114108, -- Soul of the Forest
},

-- show the stacks of Focused Growth on Lifebloom
ShowStacks {
33763, -- Lifebloom
203554, -- Focused Growth
nil,
'player',
nil,
nil,
203553, -- Focused Growth (Restoration honor talent)
},

-- show the stacks of Nature's Grasp on Ironbark
ShowStacks {
102342, -- Ironbark
247563, -- Nature's Grasp
nil,
'player',
nil,
nil,
247543, -- Entangling Bark (Restoration honor talent)
},

-- show the stacks of Abundance on Regrowth
ShowStacks {
8936, -- Regrowth
207640, -- Abundance
nil,
'player',
nil,
nil,
207383, -- Abundance (Restoration talent)
},

-- show the stacks of Reactive Resin on Rejuvenation
ShowStacks {
774, -- Rejuvenation
203407, -- Reactive Resin
nil,
'ally',
nil,
nil,
203399, -- Abundance (Restoration talent)
},

-- show the stacks of Bloodtalons on Rip, Primal Wrath and Ferocious Bite
ShowStacks {
{
1079, -- Rip
22568, -- Ferocious Bite
285381, -- Primal Wrath
},
145152, -- Bloodtalons
nil,
'player',
nil,
nil,
319439, -- Bloodtalons (Feral talent)
},

Configure {
'Rejuvenation',
L['Show stacks of @NAME, Germination, Renewing Bloom and Reactive Resin.'],
774,
'player',
'UNIT_AURA',
function(units, model)
local hasRejuvenation = BuildAuraHandler_Single("HELPFUL", "good", "ally", 774) -- Rejuvenation
local hasGermination = BuildAuraHandler_Single("HELPFUL", "good", "ally", 155777) -- Germination
local count = (hasRejuvenation(units, model) and 1 or 0) + (hasGermination(units, model) and 1 or 0)
model.count = model.count + count
end,
155675, -- Germination (Restoration talent)
},

Configure {
'Efflorescence',
L['Show the duration of @NAME.'],
145205,
'player',
'PLAYER_TOTEM_UPDATE',
function(_, model)
local present, _, startTime, duration = GetTotemInfo(1)
if present then
model.highlight = 'good'
model.expiration = startTime + duration
end
end,
},

-- show Scent of Blood on Swipe
Configure {
'ScentOfBlood',
BuildDesc(),
106785, -- Swipe
'player',
'UNIT_AURA',
function(_, model)
local found, _, expiration = GetPlayerBuff('player', 285646) -- Scent of Blood (Feral talent)
if found then
model.highlight = 'good'
model.expiration = expiration
end
end,
285564, -- Scent of Blood (Feral talent)
},
ImportPlayerSpells { 'DRUID' },
}
end)
19 changes: 2 additions & 17 deletions rules/Evoker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,12 @@ along with AdiButtonAuras. If not, see <http://www.gnu.org/licenses/>.

local _, addon = ...

if not addon.isClass('EVOKER') then
return
end
if not addon.isClass('EVOKER') then return end

AdiButtonAuras:RegisterRules(function()
Debug('Rules', 'Adding evoker rules')

return {
ImportPlayerSpells {
-- import all spells for
'EVOKER',
-- except for
},

-- show essence on spenders
ShowPower {
{
356995, -- Disintegrate
357211, -- Pyre
},
'Essence',
},
ImportPlayerSpells { 'EVOKER' },
}
end)
9 changes: 1 addition & 8 deletions rules/Hunter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,9 @@ local _, addon = ...
if not addon.isClass('HUNTER') then return end

AdiButtonAuras:RegisterRules(function()
Debug('Adding hunter rules')
Debug('Rules', 'Adding hunter rules')

return {
ImportPlayerSpells { 'HUNTER' },

ShowDispellable {
5384, -- Feign Death
'player',
'Magic',
202746, -- Survival Tactics (honor talent)
},
}
end)
Loading

0 comments on commit 6df14ba

Please sign in to comment.