Module:Enemy List: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
mNo edit summary
m (edit buttons)
Line 5: Line 5:
local lang = mw.language.getContentLanguage()
local lang = mw.language.getContentLanguage()
local purge = require('Module:Purge')._purge
local purge = require('Module:Purge')._purge
local editbutton = require('Module:Edit button')


local function formatNum(n)
local function formatNum(n)
Line 58: Line 59:


for _, monster in ipairs(data) do
for _, monster in ipairs(data) do
local edit = editbutton("'''?''' (edit)", monster['Name'])
local row = out:tag('tr')
local row = out:tag('tr')
:tag('td'):wikitext(monster.Image):done()
:tag('td'):wikitext(monster.Image):done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:tag('td'):wikitext(monster['Unlock level']):done()
:tag('td'):wikitext(monster['Unlock level'] or edit):done()
:tag('td'):wikitext(monster['Profession Level A']):done()
:tag('td'):wikitext(monster['Profession Level A'] or edit):done()
:tag('td'):wikitext(formatNum(monster.Health)):done()
:tag('td'):wikitext((monster.Health and formatNum(monster.Health)) or edit):done()
:tag('td'):wikitext(format_attack_style(monster['Attack style'])):done()
:tag('td'):wikitext(format_attack_style(monster['Attack style'])):done()
:tag('td'):wikitext(format_attack_style(monster['Immune to'])):done()
:tag('td'):wikitext(format_attack_style(monster['Immune to'])):done()
Line 74: Line 76:
row
row
:tag('td'):wikitext(table.concat(location_text, ', ')):done()
:tag('td'):wikitext(table.concat(location_text, ', ')):done()
:tag('td'):wikitext(formatNum(monster.Experience)):done()
:tag('td'):wikitext((monster.Experience and formatNum(monster.Experience)) or edit):done()
:tag('td'):wikitext(formatNum(monster['Album XP'])):done()
:tag('td'):wikitext((monster['Album XP'] and formatNum(monster['Album XP']) or editbutton("'''?''' (edit)", 'Module:Experience/data'))):done()
end
end


Line 101: Line 103:


for _, monster in ipairs(data) do
for _, monster in ipairs(data) do
local edit = editbutton("'''?''' (edit)", monster['Name'])
local row = out:tag('tr')
local row = out:tag('tr')
:tag('td'):wikitext(monster.Image):done()
:tag('td'):wikitext(monster.Image):done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:tag('td'):wikitext(monster['Unlock level']):done()
:tag('td'):wikitext(monster['Unlock level'] or edit):done()
:tag('td'):wikitext(monster['Unlock level'] and monster['Unlock level'] + 20):done()
:tag('td'):wikitext((monster['Unlock level'] and monster['Unlock level'] + 20) or edit):done()
:tag('td'):wikitext(monster.Knowledge):done()
:tag('td'):wikitext(monster.Knowledge or edit):done()


local location_text = {}
local location_text = {}
Line 115: Line 118:
row
row
:tag('td'):wikitext(table.concat(location_text, ', ')):done()
:tag('td'):wikitext(table.concat(location_text, ', ')):done()
:tag('td'):wikitext(formatNum(monster.Experience)):done()
:tag('td'):wikitext((monster.Experience and formatNum(monster.Experience)) or edit):done()
:tag('td'):wikitext(formatNum(monster['Album XP'])):done()
:tag('td'):wikitext((monster['Album XP'] and formatNum(monster['Album XP']) or editbutton("'''?''' (edit)", 'Module:Experience/data'))):done()
end
end