“模块:Jobs”的版本间的差异
来自小鱼君和他的朋友们
([InPageEdit] 没有编辑摘要) |
([InPageEdit] 没有编辑摘要) |
||
第14行: | 第14行: | ||
local jobDetail = require('Module:Jobs/details') | local jobDetail = require('Module:Jobs/details') | ||
− | -- | + | -- 色谱 具体参数 |
− | + | local colorInfo = require('Module:Jobs/colorInfo') | |
− | |||
− | |||
− | |||
− | -- 返回 | + | -- 战斗职业类型 |
+ | local atkJobType = { | ||
+ | ['nor'] = { | ||
+ | ['name'] = '基础职业', | ||
+ | ['icon'] = '✧', | ||
+ | ['color'] = '#0a0' | ||
+ | }, | ||
+ | ['adv'] = { | ||
+ | ['name'] = '进阶职业', | ||
+ | ['icon'] = '✦', | ||
+ | ['color'] = '#49f' | ||
+ | }, | ||
+ | ['spe'] = { | ||
+ | ['name'] = '特殊职业', | ||
+ | ['icon'] = '★', | ||
+ | ['color'] = '#a7f' | ||
+ | }, | ||
+ | ['lmt'] = { | ||
+ | ['name'] = '受限职业', | ||
+ | ['icon'] = '', | ||
+ | ['color'] = '' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | -- 最后, 返回完整的 内容 | ||
function p.main(frame) | function p.main(frame) | ||
local code = jobCode(frame) | local code = jobCode(frame) |
2020年4月3日 (五) 03:17的版本
Lua错误 在第46行:attempt to call field 'jobColor' (a nil value) Lua错误 在第46行:attempt to call field 'jobColor' (a nil value)
Lua错误 在第46行:attempt to call field 'jobColor' (a nil value) Lua错误 在第46行:attempt to call field 'jobColor' (a nil value)
Lua错误 在第46行:attempt to call field 'jobColor' (a nil value) Lua错误 在第46行:attempt to call field 'jobColor' (a nil value)
Lua错误 在第46行:attempt to call field 'jobColor' (a nil value)
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') -- 色谱具体参数 local colorInfo = require('Module:Jobs/colorInfo') -- 战斗职业类型 local atkJobType = { ['nor'] = { ['name'] = '基础职业', ['icon'] = '✧', ['color'] = '#0a0' }, ['adv'] = { ['name'] = '进阶职业', ['icon'] = '✦', ['color'] = '#49f' }, ['spe'] = { ['name'] = '特殊职业', ['icon'] = '★', ['color'] = '#a7f' }, ['lmt'] = { ['name'] = '受限职业', ['icon'] = '', ['color'] = '' } } -- 最后,返回完整的内容 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