Content added Content deleted
mNo edit summary |
m (test leo/need scorer) |
||
Line 45: | Line 45: | ||
effect = "Recover %d life; %d%% score boost for 5 seconds for PERFECTs only.", |
effect = "Recover %d life; %d%% score boost for 5 seconds for PERFECTs only.", |
||
category = '[[Category:Birthday scorer cards]]', |
category = '[[Category:Birthday scorer cards]]', |
||
['birthday'] = { { 700, 60 }, { 750, 65 }, { 800, 70 }, { 850, 80 } } |
['birthday'] = { { 700, 60 }, { 750, 65 }, { 800, 70 }, { 850, 80 } }, |
||
['Birthday'] = { { 700, 60 }, { 750, 65 }, { 800, 70 }, { 850, 80 } } |
|||
}, |
}, |
||
['Leo/need scorer'] = { |
|||
effect = "{{44;d}}秒間 スコアが{{44;v}}%UPする\n自身を除き「Leo/need」メンバーを1人編成する毎にスコアが{{44;e}}%UPし、全員一致で更に{{44;e}}%UPする(最大{{44;m}}%)", |
|||
category = '[[Category:Unit scorer cards]]', |
|||
['4'] = { { 80, 85, 90, 100 }, { 10 } } |
|||
} |
|||
} |
} |
||
Revision as of 07:39, 30 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 VariablesLua = mw.ext.VariablesLua
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 } }
},
['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 } }
},
['Perfect scorer'] = {
effect = "%d%% score boost for 5 seconds for PERFECTs only.",
category = '[[Category:Perfect scorer cards]]',
['4'] = { { 110 }, { 115 }, { 120 }, { 130 } }
},
['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 } }
},
['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 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 } },
['Birthday'] = { { 700, 60 }, { 750, 65 }, { 800, 70 }, { 850, 80 } }
},
['Leo/need scorer'] = {
effect = "{{44;d}}秒間 スコアが{{44;v}}%UPする\n自身を除き「Leo/need」メンバーを1人編成する毎にスコアが{{44;e}}%UPし、全員一致で更に{{44;e}}%UPする(最大{{44;m}}%)",
category = '[[Category:Unit scorer cards]]',
['4'] = { { 80, 85, 90, 100 }, { 10 } }
}
}
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 = args['skill type']
local rarity = args['rarity'] or VariablesLua.var( '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)
))
:done()
end
return tostring(root) .. autocategorize(skill_type)
end
return p