模块:Jobs
来自小鱼君和他的朋友们
[red]<nor>弓箭手 Archer (物理远程) [red]<nor>弓箭手 Archer (物理远程)
[red]<adv>游吟诗人 Bard (物理远程) [red]<adv>游吟诗人 Bard (物理远程)
[green]<adv>白魔法师 White Mage (魔法辅助) [green]<adv>白魔法师 White Mage (魔法辅助)
[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 = require('Module:Jobs/alias') 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 -- 职业具体参数 local jobDetail = require('Module:Jobs/details') -- 职业色谱 function p.jobColor(frame) local code = jobCode(frame) return jobDetail[code]['color'] end -- 返回最完整的格式 function p.main(frame) local code = jobCode(frame) local icon = p.jobColor(frame) local level = jobDetail[code]['level'] or '' local name = jobDetail[code]['name'] local en = jobDetail[code]['en'] or '' local prop = jobDetail[code]['prop'] or '' local des = jobDetail[code]['des'] or '' return '[' .. icon .. ']' .. '<' .. level .. '>' .. name .. ' ' .. en .. ' (' .. prop .. ')' end return p