Content added Content deleted
(add skill aliases) |
mNo edit summary |
||
Line 113: | Line 113: | ||
"'''Level %d:''' %s", |
"'''Level %d:''' %s", |
||
i, |
i, |
||
skill_value(skill_type, rarity, i) |
skill_value(skill_type, rarity, i) or '?' |
||
)) |
)) |
||
:done() |
:done() |
Revision as of 20:47, 27 March 2022
This module depends on the following other modules: |
To generate {{Card skill}}, invoke using the main function.
local getArgs = require('Module:Arguments').getArgs
local p = {}
local skill_types = {
['scorer'] = {
effect = "%d%% score boost for 5 seconds.",
category = '[[Category:Scorer cards]]',
['1'] = { { 20 }, { 25 }, { 30 }, { 40 } },
['2'] = { { 30 }, { 35 }, { 40 }, { 50 } },
['3'] = { { 60 }, { 65 }, { 70 }, { 80 } },
['4'] = { { 100 }, { 105 }, { 110 }, { 120 } }
},
['plocker'] = {
effect = "All %ss and higher will become PERFECTs for %.1f seconds; %d%% score boost for 5 seconds.",
category = '[[Category:Perfect locker cards]]',
['2'] = { { 'GREAT', 4.5, 10 }, { 'GREAT', 5, 15 }, { 'GREAT', 5.5, 20 }, { 'GREAT', 6, 30 } },
['3'] = { { 'GOOD', 5, 40 }, { 'GOOD', 5.5, 45 }, { 'GOOD', 6, 50 }, { 'GOOD', 6.5, 60 } },
['4'] = { { 'BAD', 5.5, 80 }, { 'BAD', 6, 85 }, { 'BAD', 6.5, 90 }, { 'BAD', 7, 100 } }
},
['perfect locker'] = {
effect = "All %ss and higher will become PERFECTs for %.1f seconds; %d%% score boost for 5 seconds.",
category = '[[Category:Perfect locker cards]]',
['2'] = { { 'GREAT', 4.5, 10 }, { 'GREAT', 5, 15 }, { 'GREAT', 5.5, 20 }, { 'GREAT', 6, 30 } },
['3'] = { { 'GOOD', 5, 40 }, { 'GOOD', 5.5, 45 }, { 'GOOD', 6, 50 }, { 'GOOD', 6.5, 60 } },
['4'] = { { 'BAD', 5.5, 80 }, { 'BAD', 6, 85 }, { 'BAD', 6.5, 90 }, { 'BAD', 7, 100 } }
},
['healer'] = {
effect = "Recover %d life; %d%% score boost for 5 seconds.",
category = '[[Category:Healer cards]]',
['2'] = { { 150, 10 }, { 200, 15 }, { 250, 20 }, { 300, 30 } },
['3'] = { { 250, 40 }, { 300, 45 }, { 350, 50 }, { 400, 60 } },
['4'] = { { 350, 80 }, { 400, 85 }, { 450, 90 }, { 500, 100 } }
},
['pscorer'] = {
effect = "%d%% score boost for 5 seconds for PERFECTs only.",
category = '[[Category:Perfect scorer cards]]',
['4'] = { { 110 }, { 115 }, { 120 }, { 130 } }
},
['perfect scorer'] = {
effect = "%d%% score boost for 5 seconds for PERFECTs only.",
category = '[[Category:Perfect scorer cards]]',
['4'] = { { 110 }, { 115 }, { 120 }, { 130 } }
},
['fes scorer'] = {
effect = "For 5 seconds, %d%% score boost if life is less than 800 or %d%% score boost if life is 800. For every +10 life above 800, score boost increased by +1%% (up to %d%%).",
category = '[[Category:Life scorer cards]]',
['4'] = { { 70, 100, 120 }, { 75, 105, 125 }, { 80, 110, 130 }, { 90, 120, 140 } }
},
['life scorer'] = {
effect = "For 5 seconds, %d%% score boost if life is less than 800 or %d%% score boost if life is 800. For every +10 life above 800, score boost increased by +1%% (up to %d%%).",
category = '[[Category:Life scorer cards]]',
['4'] = { { 70, 100, 120 }, { 75, 105, 125 }, { 80, 110, 130 }, { 90, 120, 140 } }
},
['fes pscorer'] = {
effect = "%d%% score boost for 5 seconds. If you hit GREAT or lower, score boost will be reduced to %d%%.",
category = '[[Category:Accuracy scorer cards]]',
['4'] = { { 120, 70 }, { 125, 75 }, { 130, 80 }, { 140, 90 } }
},
['accuracy scorer'] = {
effect = "%d%% score boost for 5 seconds. If you hit GREAT or lower, score boost will be reduced to %d%%.",
category = '[[Category:Accuracy scorer cards]]',
['4'] = { { 120, 70 }, { 125, 75 }, { 130, 80 }, { 140, 90 } }
},
['birthday'] = {
effect = "Recover %d life; %d%% score boost for 5 seconds for PERFECTs only.",
category = '[[Category:Birthday scorer cards]]',
['birthday'] = { { 700, 60 }, { 750, 65 }, { 800, 70 }, { 850, 80 } }
},
['birthday scorer'] = {
effect = "Recover %d life; %d%% score boost for 5 seconds for PERFECTs only.",
category = '[[Category:Birthday scorer cards]]',
['birthday'] = { { 700, 60 }, { 750, 65 }, { 800, 70 }, { 850, 80 } }
},
}
local function skill_value(skill_type, rarity, skill_level)
if skill_type and
rarity and
skill_types[skill_type] and
skill_types[skill_type][rarity] then
return string.format(
skill_types[skill_type]['effect'],
unpack(skill_types[skill_type][rarity][skill_level])
)
end
return string.format("<span class=\"plainlinks\">[%s?action=edit ? (edit)]</span>",
tostring(mw.uri.fullUrl(mw.title.getCurrentTitle().text))
)
end
local function autocategorize(skill_type)
if skill_type then
return skill_types[skill_type]['category']
end
return ''
end
function p.main(frame)
local args = getArgs(frame)
local skill_type = string.lower(args['skill type'])
local rarity = args['rarity']
local root = mw.html.create('ul')
for i=1,4,1 do
root:tag('li')
:wikitext(string.format(
"'''Level %d:''' %s",
i,
skill_value(skill_type, rarity, i) or '?'
))
:done()
end
return tostring(root) .. autocategorize(skill_type)
end
return p