跳转到内容

模块:物品描述

来自Wymbot 共创站
NotBot​(留言 | 贡献)2026年10月24日 (六) 12:01的版本 (建立模块化物品展示及用户提供的测试数据(不迁移旧掉落))
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

此模块的文档可以在模块:物品描述/doc创建

local C = require('模块:物品通用')
local D = require('模块:物品数据')
local p = {}
function p.main(frame)
    local c = C.context(frame)
    if not c.enabled then return '' end
    local body = c.text('描述')
    if not body then
        local item = D.getItem(c.name)
        if item.status == 'error' then return C.finish(c, 'description', C.diagnostic(item), { '物品数据异常的页面' }) end
        body = item.description
    end
    if not body then body = C.literal(c.name) .. '是 wymboTrip 的一种' .. C.literal(c.kind) .. '。' end
    return C.finish(c, 'description', body)
end
return p