Module:MonsterVariantsTable: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
m (cleanup)
m (separate unlock profession)
Line 1: Line 1:
require('Module:Mw.html extension')
local editbutton = require('Module:Edit button')
local editbutton = require('Module:Edit button')
local p = {}
local p = {}
Line 22: Line 23:
'?Name = name',
'?Name = name',
'?= page',
'?= page',
'?Unlock_level = unlock',
'?Unlock_level = unlock_lvl',
'?Unlock profession # = unlock_profession',
'?Profession_Level_A = combat',
'?Profession_Level_A = combat',
'?Profession A # = profession',
'?Profession A # = profession',
Line 61: Line 63:
table.sort(data, function(a, b)
table.sort(data, function(a, b)
-- Determine combat values
-- Determine combat values
local combatA = a.combat or a.unlock or math.huge
local combatA = a.combat or a.unlock_lvl or math.huge
local combatB = b.combat or b.unlock or math.huge
local combatB = b.combat or b.unlock_lvl or math.huge
-- Sort in ascending order
-- Sort in ascending order
return combatA < combatB
return combatA < combatB
Line 79: Line 81:
:done()
:done()
:tag('td')
:tag('td')
:IF(entry.unlock_lvl == 'N/A')
:wikitext(entry.unlock and p.formatProfessionLevel(entry.profession, entry.unlock) or edit)
:addClass('table-na')
:wikitext('N/A')
:ELSE()
:wikitext(entry.unlock_lvl and p.formatProfessionLevel(entry.unlock_profession, entry.unlock_lvl) or edit)
:END()
:done()
:done()
:tag('td')
:tag('td')