mNo edit summary Tag: sourceedit |
mNo edit summary Tag: sourceedit |
||
(48 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | --<pre> |
||
local p = {} |
local p = {} |
||
− | |||
⚫ | |||
− | local rarity,item,qty,item_page |
||
− | local args = frame:getParent().args |
||
− | |||
− | rarity = args[1] |
||
− | item = args[2] |
||
− | qty = args[3] or 'no' |
||
− | -- item_page= args[4] or item |
||
− | |||
− | |||
− | |||
− | local ret = mw.html.create('div') |
||
− | :css({ width = '66px', |
||
− | height = '90px', |
||
− | position = 'relative' }) |
||
+ | local pref = { 'Anne','Aika','Justine','Jan','Charlotte','Ching','Maladetta','Riscisa','Kalista','Ariana','Red-Handed Jill','Grace','Margaret','Mary','Morgan','Rachel','The Bewitching','The Vile','Oathbreaker','Jillian','Ravenna','Himiko','Silver','Nanako', } |
||
− | -- Gem container |
||
− | :tag('div') |
||
− | :css({ width = '66px', |
||
− | height = '90px', |
||
− | position = 'absolute', |
||
− | top = '0px', |
||
− | left = '0px', |
||
− | ['z-index'] = '1' }) |
||
− | :wikitext(string.format('[[File:Treasure Hunter Gem - %s.png]]',rarity)) |
||
+ | local suff = { 'Teach','Bligh','Bonny','Drake','Rackham','Shih','Ng-Tsai','ad Din','Tristar','Piwar','Thorn','Silver','the Cruel','Hook','Song','Sharktooth','Wytche','Skulltaker','Kidd','Morgan','Bonny','Read','Fang','the Ghost', } |
||
− | -- Item container |
||
− | :tag('div') |
||
− | :css({ width = '35px', |
||
− | height = '35px', |
||
− | position = 'absolute', |
||
− | bottom = '27px', |
||
− | left = '15px', |
||
− | ['z-index'] = '2' }) |
||
− | :wikitext(string.format('[[File:%s.png|35px]]',item)) |
||
− | |||
− | if qty ~= 'no' then |
||
− | ret:tag('div') |
||
− | :css({ position = 'absolute', |
||
− | bottom = '48px', |
||
− | left = '11px', |
||
− | ['z-index'] = '3', |
||
− | ['font-size'] = '12px', |
||
− | color = 'yellow', |
||
− | ['text-shadow'] = '2px 2px 4px black' }) |
||
− | :wikitext(qty) |
||
⚫ | |||
⚫ | |||
− | return tostring(ret) |
||
+ | local ret = {''} |
||
+ | for _, v in ipairs(pref) do |
||
+ | for _, w in ipairs(suff) do |
||
+ | table.insert(ret,string.format('[[%s %s]]',v,w)) |
||
⚫ | |||
+ | end |
||
+ | return table.concat(ret,'\n# ') |
||
end |
end |
||
Latest revision as of 17:20, 9 May 2016
Documentation for this module may be created at Module:Sandbox/doc
--<pre>
local p = {}
local pref = { 'Anne','Aika','Justine','Jan','Charlotte','Ching','Maladetta','Riscisa','Kalista','Ariana','Red-Handed Jill','Grace','Margaret','Mary','Morgan','Rachel','The Bewitching','The Vile','Oathbreaker','Jillian','Ravenna','Himiko','Silver','Nanako', }
local suff = { 'Teach','Bligh','Bonny','Drake','Rackham','Shih','Ng-Tsai','ad Din','Tristar','Piwar','Thorn','Silver','the Cruel','Hook','Song','Sharktooth','Wytche','Skulltaker','Kidd','Morgan','Bonny','Read','Fang','the Ghost', }
function p.main()
local ret = {''}
for _, v in ipairs(pref) do
for _, w in ipairs(suff) do
table.insert(ret,string.format('[[%s %s]]',v,w))
end
end
return table.concat(ret,'\n# ')
end
return p