跳转到内容
主菜单
主菜单
移至侧栏
隐藏
首页|Wiki首页
Wymbot新手引导|新手入门
WymboTrip|旅行模块
指令一览|指令目录
旅行地点|旅行地点
物品来源速查|物品资料
Wums|wum图鉴
合成配方|合成配方
科研|科研
共创指南|参与编写
https://wum.hetonger.cn/|共创站首页
https://wum.hetonger.cn/game/|网页端
https://wum.hetonger.cn/command/|指令检索
搜索
搜索
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模块:物品通用”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
外观
移至侧栏
隐藏
←
模块:物品通用
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} function p.trim(value) return mw.text.trim(tostring(value or '')) end function p.literal(value) local text = mw.text.nowiki(tostring(value or '')) return (text:gsub('\r\n', '\n'):gsub('\r', '\n'):gsub('\n', '<br>')) end function p.probability(entry) if entry.probabilityStatus == 'known' then return string.format('%.6g', entry.probability * 100) .. '%' end return '未知' end function p.context(frame) local parent = frame:getParent() local parentArgs = parent and parent.args or {} local args = frame.args or {} local context = {} function context.raw(key) if args[key] ~= nil then return args[key] end return parentArgs[key] end function context.text(key, fallback) local value = context.raw(key) if p.trim(value) == '' then return fallback end -- Preserve editor-supplied markup and line boundaries. return value end function context.option(key, fallback) local value = p.trim(context.raw(key)) if value == '' then return fallback end return value end function context.flag(key, fallback) local value = context.option(key, '') if value == '' then return fallback end local lowered = string.lower(value) return not (value == '否' or value == '无' or lowered == 'no' or lowered == 'false' or value == '0') end context.title = mw.title.getCurrentTitle() context.name = context.option('物品名', context.title.text) context.kind = context.option('类型', '物品') context.enabled = context.flag('显示', true) context.categorize = context.title.namespace == 0 and context.flag('分类', true) return context end function p.heading(context, title, defaultLevel) if not context.flag('显示标题', true) then return '' end local level = tonumber(context.option('标题级别', tostring(defaultLevel or 2))) if not level or level % 1 ~= 0 or level < 2 or level > 6 then error('标题级别必须为 2 至 6 的整数。') end local marks = string.rep('=', level) return '\n' .. marks .. ' ' .. title .. ' ' .. marks .. '\n' end function p.categories(context, categories) if not context.categorize then return '' end local result, seen = {}, {} local names = { '物品' } if context.kind == '种子' or context.kind == '装备' then names[#names + 1] = context.kind end for _, name in ipairs(categories or {}) do names[#names + 1] = name end for _, name in ipairs(names) do if not seen[name] then result[#result + 1] = '[[分类:' .. name .. ']]' seen[name] = true end end return table.concat(result) end function p.finish(context, class, body, categories) if not context.enabled or not body or body == '' then return '' end return '<div class="wum-item-block wum-item-' .. class .. '">\n' .. body .. '\n</div>' .. p.categories(context, categories) .. '\n' end function p.diagnostic(result) local details = result.page and ('(' .. p.literal(result.page) .. ')') or '' return '<strong class="error">物品数据异常:' .. p.literal(result.code or 'unknown') .. details .. '</strong>' end function p.link(name, label, fragment) local pageTitles = require('模块:物品配置').pageTitles or {} local title = mw.title.new(pageTitles[name] or name) if not title or title.interwiki ~= '' then return p.literal(label or name) end local target = title.prefixedText if fragment ~= nil and p.trim(fragment) ~= '' then target = target .. '#' .. mw.uri.anchorEncode(fragment) end return '[[:' .. target .. '|' .. p.literal(label or name) .. ']]' end return p
此页面嵌入的页面:
模块:物品通用/doc
(
查看源代码
)
返回
模块:物品通用
。
搜索
搜索
查看“︁模块:物品通用”︁的源代码
添加话题