Anonymous

Module:Prayer: Difference between revisions

From Melvor Idle
Added p.getPrayerTable
(Updated how prayer effects are written to match the new system)
(Added p.getPrayerTable)
Line 100: Line 100:
   end
   end


   return table.concat(bonusLines, '\r\n')
   return table.concat(bonusLines, '<br/>')
end
end


Line 152: Line 152:


   return p._getPrayerCategories(prayer)
   return p._getPrayerCategories(prayer)
end
function p.getPrayerTable(frame)
  local result = '{| class="wikitable sortable stickyHeader"'
  result = result..'\r\n|-class=headerRow-0'
  result = result..'\r\n!colspan="2"|Prayer!!'..Icons.Icon({"Prayer", type="skill", notext=true})
  result = result..'!!Effects!!Point Cost'
  for i, prayer in Shared.skpairs(SkillData.Prayer) do
    result = result..'\r\n|-'
    result = result..'\r\n|'..Icons.Icon({prayer.name, type='prayer', notext=true, size='50'})
    result = result..'||[['..prayer.name..']]||'..prayer.prayerLevel
    result = result..'||'..p._getPrayerEffect(prayer)
    result = result..'||'..p.getPrayerCost(prayer)
  end
  result = result..'\r\n|}'
  return result
end
end


return p
return p