全站通知:

模块:Shops

来自星露谷物语维基
跳到导航 跳到搜索
[ 创建 | 刷新 ]文档页面
当前模块文档缺失,需要扩充。
local utils = require("Module:Utils")
local ShopsData = mw.loadData('Module:Shops/data')

local p = {}

local AdventureShop = ShopsData['AdventureShop']

-- =p.weaponPrice{args={'(W)0'}}
function p.weaponPrice(frame)
    local id = frame.args[1] -- '(W)0'
    for _, item in ipairs(AdventureShop.Items) do
        if item.ItemId == id then
            local price = item.Price
            if price == -1 then return '不可购买' end
            return utils.expandTemplate("模板:Price", {price})
        end
    end
    return '不可购买'
end

return p