Anonymous

Module:Prayer: Difference between revisions

From Melvor Idle
no edit summary
(getPrayerTable only returns regular prayers.)
No edit summary
Line 147: Line 147:


function p.getAbyssalPrayerTable(frame)
function p.getAbyssalPrayerTable(frame)
return p.getPrayerTableFiltered(frame, function(prayer) return prayer.isAbyssal end)
return p.getPrayerTableFiltered(frame, function(prayer) return prayer.isAbyssal end, 'Abyssal Realm')
end
end


Line 154: Line 154:
local skillID = 'Prayer'
local skillID = 'Prayer'
local realm = realm or 'Melvor Realm'
local realm = realm or 'Melvor Realm'
local result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|-class=headerRow-0'
local html = mw.html.create('table')
result = result..'\r\n!colspan="2"|Prayer!!Requirements'
:addClass('wikitable sortable stickyHeader')
result = result..'!!Effects!!Point Cost'
 
html:tag('tr'):addClass('headerRow-0')
:tag('th'):attr('colspan', 2)
  :wikitext('Prayer')
:tag('th'):wikitext('DLC')
:tag('th'):wikitext(Icons.Icon({'Prayer', type='skill', notext=true}) .. '<br>Level')
:tag('th'):wikitext('Effects')
:tag('th'):wikitext('Point Cost')


local prayerList = p.getPrayers(prayerPredicate)
local prayerList = p.getPrayers(prayerPredicate)
Line 165: Line 172:
local level = Skills.getRecipeLevel(skillID, prayer)
local level = Skills.getRecipeLevel(skillID, prayer)
local reqText = Skills.getRecipeRequirementText(skillID, prayer)
local reqText = Skills.getRecipeRequirementText(skillID, prayer)
result = result..'\r\n|-'
result = result..'\r\n|'..Icons.Icon({prayer.name, type='prayer', notext=true})
html:tag('tr')
result = result..'||' .. Icons.getExpansionIcon(prayer.id) .. Icons.Icon({prayer.name, type='prayer', noicon=true})
:tag('td'):wikitext(Icons.Icon({prayer.name, type='prayer', notext=true}))
result = result..'||style="text-align:right;" data-sort-value="' .. level .. '"| ' .. reqText
:tag('td'):wikitext('[[' .. prayer.name .. ']]')
result = result..'||'..p._getPrayerEffect(prayer)
:tag('td'):wikitext(Icons.getExpansionIcon(prayer.id))
result = result..'||'..p.getPrayerCost(prayer)
  :attr('data-sort-value', Icons.getExpansionID(prayer.id))
:tag('td'):wikitext(level)
:tag('td'):wikitext(p._getPrayerEffect(prayer))
:tag('td'):wikitext(p.getPrayerCost(prayer))
end
end


result = result..'\r\n|}'
return tostring(html)
return result
end
end


2,875

edits