Module:Enemy List: Difference between revisions

m
edit buttons
mNo edit summary
m (edit buttons)
Line 5:
local lang = mw.language.getContentLanguage()
local purge = require('Module:Purge')._purge
local editbutton = require('Module:Edit button')
 
local function formatNum(n)
Line 58 ⟶ 59:
 
for _, monster in ipairs(data) do
local edit = editbutton("'''?''' (edit)", monster['Name'])
local row = out:tag('tr')
:tag('td'):wikitext(monster.Image):done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:tag('td'):wikitext(monster['Unlock level'] or edit):done()
:tag('td'):wikitext(monster['Profession Level A'] or edit):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['Immune to'])):done()
Line 74 ⟶ 76:
row
:tag('td'):wikitext(table.concat(location_text, ', ')):done()
:tag('td'):wikitext((monster.Experience and formatNum(monster.Experience)) or edit):done()
:tag('td'):wikitext((monster['Album XP'] and formatNum(monster['Album XP']) or editbutton("'''?''' (edit)", 'Module:Experience/data'))):done()
end
 
Line 101 ⟶ 103:
 
for _, monster in ipairs(data) do
local edit = editbutton("'''?''' (edit)", monster['Name'])
local row = out:tag('tr')
:tag('td'):wikitext(monster.Image):done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:tag('td'):wikitext(monster['Unlock level'] or edit):done()
:tag('td'):wikitext((monster['Unlock level'] and monster['Unlock level'] + 20) or edit):done()
:tag('td'):wikitext(monster.Knowledge or edit):done()
 
local location_text = {}
Line 115 ⟶ 118:
row
:tag('td'):wikitext(table.concat(location_text, ', ')):done()
:tag('td'):wikitext((monster.Experience and formatNum(monster.Experience)) or edit):done()
:tag('td'):wikitext((monster['Album XP'] and formatNum(monster['Album XP']) or editbutton("'''?''' (edit)", 'Module:Experience/data'))):done()
end
 
7,248

edits