Module:Enemy List: Difference between revisions

385 bytes removed ,  Friday at 15:18
Use plinkt styling with no-border; Use Module:Mw.html extension methods; Always link to the page in case it's different from Name
m (edit buttons)
(Use plinkt styling with no-border; Use Module:Mw.html extension methods; Always link to the page in case it's different from Name)
 
Line 1:
require('strict')
require('Module:Mw.html extension')
local yesno = require('Module:Yesno')
local album_xp_data = mw.loadData('Module:Experience/data').album
Line 42 ⟶ 43:
:wikitext('This list is updated dynamically. '..purge())
:done()
:tag('tr'()
:th{ 'Enemy', attr = { colspan = '2' } }:done()
:tag('th')
:th('Unlock<br>Level'):done()
:attr{ colspan = '2' }
:wikitextth('EnemyCombat<br>Level'):done()
:th('HP'):done()
:tag('th'):wikitext('Unlock<br>LevelAttack Style'):done()
:tag('th'):wikitext('Combat<br>LevelImmune To'):done()
:tag('th'):wikitext('HPVulnerable'):done()
:tag('th'):wikitext('AttackFound StyleAt'):done()
:tag('th'):wikitext('Immune ToXP'):done()
:tag('th'):wikitext('VulnerableAlbum XP'):done()
:tag('th'):wikitext('Found At'):done()
:tag('th'):wikitext('XP'):done()
:tag('th'):wikitext('Album XP'):done()
:done()
 
for _, monster in ipairs(data) do
local edit = editbutton("'''?''' (edit)", monster['Name'1])
local row = out:tag('tr'()
:tag('td'):wikitext({ monster.Image), addClass = 'plinkt-image no-border' }:done()
:tag('td'):wikitext({ ('[[%s|%s]]'):format(monster[1], monster['Name'])), addClass = 'plinkt-link no-border'}: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()
:tag('td'):wikitext(format_attack_style(monster['Vulnerable to'])):done()
 
local location_text = {}
Line 75 ⟶ 73:
end
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 89 ⟶ 87:
:wikitext('This list is updated dynamically. '..purge())
:done()
:tag('tr'()
:th{ 'Enemy', attr = { colspan = '2' } }:done()
:tag('th')
:tag('th'):wikitext('Found AtLevel'):done()
:attr{ colspan = '2' }
:th('Weapon<br>Strength'):done()
:wikitext('Enemy')
:th('[[File:Knowledge icon.png|16px|link=Knowledge]] KP'):done()
:done()
:tag('th'):wikitext('LevelLocation'):done()
:tag('th'):wikitext('Weapon<br>StrengthXP'):done()
:tag('th'):wikitext('[[File:Knowledge icon.png|16px|link=Knowledge]]Album KPXP'):done()
:tag('th'):wikitext('Location'):done()
:tag('th'):wikitext('XP'):done()
:tag('th'):wikitext('Album XP'):done()
:done()
 
Line 105 ⟶ 100:
local edit = editbutton("'''?''' (edit)", monster['Name'])
local row = out:tag('tr')
:tag('td'):wikitext({ monster.Image), addClass = 'plinkt-image no-border' }:done()
:tag('td'):wikitext({ ('[[%s|%s]]'):format(monster[1], monster['Name'])), addClass = 'plinkt-link no-border'}: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 117 ⟶ 112:
end
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 144 ⟶ 139:
'?Version anchor',
'?Version default',
'?#-',
'sort=Profession Level A',
'order=asc',
1,483

edits