Module:Prayer: Difference between revisions

Add "For Each Unholy Mark stack on the enemy:" to unholy prayers
(Overload p.getPrayerTable to allow for passing in a predicate)
(Add "For Each Unholy Mark stack on the enemy:" to unholy prayers)
 
(3 intermediate revisions by the same user not shown)
Line 52: Line 52:
local chr = asList and '* ' or ''
local chr = asList and '* ' or ''
local bonusLines = {}
local bonusLines = {}
 
if prayer.isUnholy then
table.insert(bonusLines, "For each Unholy Mark stack on the enemy:")
end
if type(prayer.modifiers) == 'table' then
if type(prayer.modifiers) == 'table' then
for bonusKey, bonusVal in Shared.skpairs(prayer.modifiers) do
for bonusKey, bonusVal in Shared.skpairs(prayer.modifiers) do
Line 131: Line 135:


function p.getPrayerTable(frame)
function p.getPrayerTable(frame)
return p.getPrayerTable(frame, function(prayer) return true end)
return p.getPrayerTableFiltered(frame, function(prayer) return true end)
end
 
function p.getUnholyPrayerTable(frame)
return p.getPrayerTableFiltered(frame, function(prayer) return prayer.isUnholy end)
end
end


function p.getPrayerTable(frame, prayerPredicate)
function p.getPrayerTableFiltered(frame, prayerPredicate)
local result = '{| class="wikitable sortable stickyHeader"'
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|-class=headerRow-0'
result = result..'\r\n|-class=headerRow-0'
48

edits