Editing Module:Enemy List
Jump to navigation
Jump to search
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() |
||
: |
:tag('tr') |
||
:tag('th') |
|||
: |
:attr{ colspan = '2' } |
||
:th('Unlock<br>Level'):done() |
|||
: |
:wikitext('Enemy') |
||
:done() |
|||
:th(' |
:tag('th'):wikitext('Unlock<br>Level'):done() |
||
:th(' |
:tag('th'):wikitext('Combat<br>Level'):done() |
||
:th(' |
:tag('th'):wikitext('HP'):done() |
||
:th(' |
:tag('th'):wikitext('Attack Style'):done() |
||
:th(' |
:tag('th'):wikitext('Immune To'):done() |
||
:th(' |
: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 |
local row = out:tag('tr') |
||
:tag('td'):wikitext(monster.Image):done() |
|||
local row = out:tr() |
|||
:tag('td'):wikitext(monster[1]):done() |
|||
:td{ monster.Image, addClass = 'plinkt-image no-border' }:done() |
|||
: |
:tag('td'):wikitext(monster['Unlock level']):done() |
||
:td(monster[' |
: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 |
:tag('td'):wikitext(format_attack_style(monster['Attack style'])):done() |
||
:td(format_attack_style(monster[' |
:tag('td'):wikitext(format_attack_style(monster['Immune to'])):done() |
||
:td(format_attack_style(monster[' |
: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( |
:tag('td'):wikitext(formatNum(monster.Experience)):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(' |
:tag('tr') |
||
:tag('th') |
|||
:wikitext('This list is updated dynamically. '..purge()) |
|||
⚫ | |||
⚫ | |||
: |
:wikitext('Enemy') |
||
⚫ | |||
⚫ | |||
: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 |
:tag('td'):wikitext(monster.Image):done() |
||
: |
:tag('td'):wikitext(monster[1]):done() |
||
:td(monster['Unlock level'] |
:tag('td'):wikitext(monster['Unlock level']):done() |
||
: |
:tag('td'):wikitext(monster['Unlock level'] and monster['Unlock level'] + 20):done() |
||
:td(monster.Knowledge |
: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( |
:tag('td'):wikitext(formatNum(monster.Experience)):done() |
||
: |
:tag('td'):wikitext(formatNum(monster['Album XP'])):done() |
||
end |
end |
||
Line 122: | Line 121: | ||
function p._main(profession, passive) |
function p._main(profession, passive) |
||
local data = mw.smw.ask{ |
local data = mw.smw.ask{ |
||
'[[ |
'[[Category:Monsters]]', |
||
('[[ |
('[[Profession A::%s]]'):format(profession), |
||
('[[Passive::%s]]'):format(passive and 'true' or 'false'), |
('[[Passive::%s]]'):format(passive and 'true' or 'false'), |
||
'?Image#70px;x70px', |
'?Image#70px;x70px', |
||
Line 134: | Line 133: | ||
'?Location JSON', |
'?Location JSON', |
||
'?Experience', |
'?Experience', |
||
'? |
'?Quest', |
||
'?Knowledge', |
'?Knowledge', |
||
'?Variant of#-', |
'?Variant of#-', |
||
'?Version anchor', |
|||
'?Version default', |
|||
'?#-', |
|||
'sort=Profession Level A', |
'sort=Profession Level A', |
||
'order=asc', |
'order=asc', |
||
Line 146: | Line 142: | ||
data = Array.filter(data, function(monster) |
data = Array.filter(data, function(monster) |
||
return monster |
return monster.Quest == nil and monster[1] ~= '[[:Training Dummy|Training Dummy]]' |
||
end) |
end) |
||