“模块:Jobs”的版本间的差异
来自小鱼君和他的朋友们
([InPageEdit] 没有编辑摘要) |
|||
第12行: | 第12行: | ||
local jobDetail = { | local jobDetail = { | ||
− | + | ['unknown'] = { | |
− | [''] = { | + | ['name'] = ' 未知职业', --中文名 |
− | ['name'] = '', --中文名 | + | ['en'] = 'Unknown', --英文名 |
− | [' | + | ['short'] = 'null', --简称 |
− | ['color'] = '', --red/green/blue/yellow/purple | + | ['color'] = 'unknown', --red/green/blue/yellow/purple |
['prop'] = '', --输出职业类型 | ['prop'] = '', --输出职业类型 | ||
− | ['level'] = '' --nor/adv/spe | + | ['level'] = 'nor' --nor/adv/spe |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
}, | }, | ||
['archer'] = { | ['archer'] = { | ||
['name'] = '弓箭手', | ['name'] = '弓箭手', | ||
− | [' | + | ['en'] = 'Archer', |
+ | ['short'] = 'arc', | ||
['color'] = 'red', | ['color'] = 'red', | ||
['prop'] = '远程物理', | ['prop'] = '远程物理', | ||
第37行: | 第30行: | ||
['bard'] = { | ['bard'] = { | ||
['name'] = '游吟诗人', | ['name'] = '游吟诗人', | ||
− | [' | + | ['en'] = 'Bard', |
+ | ['short'] = 'brd', | ||
['color'] = 'red', | ['color'] = 'red', | ||
['prop'] = '远程物理', | ['prop'] = '远程物理', |
2020年4月2日 (四) 12:30的版本
弓箭手red 弓箭手red
游吟诗人red 游吟诗人red
未知职业unknown 未知职业unknown
未知职业unknown
Module:Jobs/alias (编辑) • Module:Jobs/colorInfo (编辑) • Module:Jobs/details (编辑) • Module:Jobs/levels (编辑)
local p = {} local getArgs = require('Module:Arguments').getArgs local alias = { ['弓箭手'] = 'archer', ['archer'] = 'archer', ['arc'] = 'archer', ['游吟诗人'] = 'bard', ['诗人'] = 'bard', ['bard'] = 'bard' } local jobDetail = { ['unknown'] = { ['name'] = '未知职业', --中文名 ['en'] = 'Unknown', --英文名 ['short'] = 'null', --简称 ['color'] = 'unknown', --red/green/blue/yellow/purple ['prop'] = '', --输出职业类型 ['level'] = 'nor' --nor/adv/spe }, ['archer'] = { ['name'] = '弓箭手', ['en'] = 'Archer', ['short'] = 'arc', ['color'] = 'red', ['prop'] = '远程物理', ['level'] = 'nor' }, ['bard'] = { ['name'] = '游吟诗人', ['en'] = 'Bard', ['short'] = 'brd', ['color'] = 'red', ['prop'] = '远程物理', ['level'] = 'adv' } } function jobCode(frame) local args = getArgs(frame) local job = args['job'] or args[1] or 'unknown' job = mw.ustring.lower(job) return alias[job] or 'unknown' end function p.jobColor(frame) local job = jobCode(frame) return jobDetail[job]['color'] end function p.main(frame) local job = jobCode(frame) return jobDetail[job]['name'] .. p.jobColor(frame) end return p