Editing Module:Enemy List

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
require('strict')
require('strict')
require('Module:Mw.html extension')
local yesno = require('Module:Yesno')
local yesno = require('Module:Yesno')
local album_xp_data = mw.loadData('Module:Experience/data').album
local album_xp_data = mw.loadData('Module:Experience/data').album
Line 6: 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 43: Line 41:
:wikitext('This list is updated dynamically. '..purge())
:wikitext('This list is updated dynamically. '..purge())
:done()
:done()
:tr()
:tag('tr')
:tag('th')
:th{ 'Enemy', attr = { colspan = '2' } }:done()
:attr{ colspan = '2' }
:th('Unlock<br>Level'):done()
:th('Combat<br>Level'):done()
:wikitext('Enemy')
:th('HP'):done()
:done()
:th('Attack Style'):done()
:tag('th'):wikitext('Unlock<br>Level'):done()
:th('Immune To'):done()
:tag('th'):wikitext('Combat<br>Level'):done()
:th('Vulnerable'):done()
:tag('th'):wikitext('HP'):done()
:th('Found At'):done()
:tag('th'):wikitext('Attack Style'):done()
:th('XP'):done()
:tag('th'):wikitext('Immune To'):done()
:th('Album XP'):done()
:tag('th'):wikitext('Vulnerable'):done()
:tag('th'):wikitext('Found At'):done()
:tag('th'):wikitext('XP'):done()
:tag('th'):wikitext('Album XP'):done()
:done()
:done()


for _, monster in ipairs(data) do
for _, monster in ipairs(data) do
local edit = editbutton("'''?''' (edit)", monster[1])
local row = out:tag('tr')
:tag('td'):wikitext(monster.Image):done()
local row = out:tr()
:td{ monster.Image, addClass = 'plinkt-image no-border' }:done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:td{ ('[[%s|%s]]'):format(monster[1], monster['Name']), addClass = 'plinkt-link no-border'}:done()
:tag('td'):wikitext(monster['Unlock level']):done()
:td(monster['Unlock level'] or edit):done()
:tag('td'):wikitext(monster['Profession Level A']):done()
:tag('td'):wikitext(formatNum(monster.Health)):done()
:td(monster['Profession Level A'] or edit):done()
:td((monster.Health and formatNum(monster.Health)) or edit):done()
:tag('td'):wikitext(format_attack_style(monster['Attack style'])):done()
:td(format_attack_style(monster['Attack style'])):done()
:tag('td'):wikitext(format_attack_style(monster['Immune to'])):done()
:td(format_attack_style(monster['Immune to'])):done()
:tag('td'):wikitext(format_attack_style(monster['Vulnerable to'])):done()
:td(format_attack_style(monster['Vulnerable to'])):done()


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


Line 84: Line 84:
local out = mw.html.create('table')
local out = mw.html.create('table')
:addClass('wikitable sortable align-center-3 align-center-4 align-center-5')
:addClass('wikitable sortable align-center-3 align-center-4 align-center-5')
:tag('caption')
:tag('tr')
:tag('th')
:wikitext('This list is updated dynamically. '..purge())
:attr{ colspan = '2' }
:done()
:tr()
:wikitext('Enemy')
:done()
:th{ 'Enemy', attr = { colspan = '2' } }:done()
:th('Level'):done()
:tag('th'):wikitext('Level'):done()
:th('Weapon<br>Strength'):done()
:tag('th'):wikitext('Weapon<br>Strength'):done()
:th('[[File:Knowledge icon.png|16px|link=Knowledge]] KP'):done()
:tag('th'):wikitext('[[File:Knowledge icon.png|16px|link=Knowledge]] KP'):done()
:th('Location'):done()
:tag('th'):wikitext('Location'):done()
:th('XP'):done()
:tag('th'):wikitext('XP'):done()
:th('Album XP'):done()
:tag('th'):wikitext('Album XP'):done()
:done()
:done()


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')
:td{ monster.Image, addClass = 'plinkt-image no-border' }:done()
:tag('td'):wikitext(monster.Image):done()
:td{ ('[[%s|%s]]'):format(monster[1], monster['Name']), addClass = 'plinkt-link no-border'}:done()
:tag('td'):wikitext(('[[%s]]'):format(monster['Name'])):done()
:td(monster['Unlock level'] or edit):done()
:tag('td'):wikitext(monster['Unlock level']):done()
:td((monster['Unlock level'] and monster['Unlock level'] + 20) or edit):done()
:tag('td'):wikitext(monster['Unlock level'] and monster['Unlock level'] + 20):done()
:td(monster.Knowledge or edit):done()
:tag('td'):wikitext(monster.Knowledge):done()


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


Line 134: Line 133:
'?Location JSON',
'?Location JSON',
'?Experience',
'?Experience',
'?Quest',
'?Name',
'?Name',
'?Knowledge',
'?Knowledge',
Line 139: Line 139:
'?Version anchor',
'?Version anchor',
'?Version default',
'?Version default',
'?#-',
'sort=Profession Level A',
'sort=Profession Level A',
'order=asc',
'order=asc',
Line 146: Line 145:


data = Array.filter(data, function(monster)
data = Array.filter(data, function(monster)
return monster['Version default'] or not(monster['Version anchor'] or false)
return monster.Quest == nil and monster[1] ~= '[[:Training Dummy|Training Dummy]]' and ( monster['Version default'] or not(monster['Version anchor'] or false) )
end)
end)


Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see Brighter Shores:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

This page is a member of a hidden category: