欢迎来到猴子VS气球的史诗级冒险!
除特殊说明外,本站内容采用CC BY-NC-SA 4.0协议。
本站编辑权限开放,欢迎各位直接动手或者到留言板留言。
欢迎有合作意向者加入QQ群:950568164
欢迎来到气球塔防6 BWIKI!
除特殊说明外,本站内容采用CC BY-NC-SA 4.0协议。
欢迎各位到留言板留言或者加入QQ群:950568164
模块:TowerUtility
此模块的文档可以在模块:TowerUtility/doc创建
local p = {}
p.upgrade = function(frame)
local prices = mw.text.jsonDecode(mw.title.new("Prices.json"):getContent())
local tower = frame.args[1]
local path = tonumber(frame.args[2])
local tier = tonumber(frame.args[3])
return prices[tower][path][tier]
end
p.base = function(frame)
local prices = mw.text.jsonDecode(mw.title.new("Prices.json"):getContent())
local tower = frame.args[1]
return prices[tower]["base"]
end
p.paragon = function(frame)
local prices = mw.text.jsonDecode(mw.title.new("Prices.json"):getContent())
local tower = frame.args[1]
return prices[tower]["paragon"]
end
p.cleanCrossPath = function(frame)
local xPaths = mw.text.split(frame.args[1], ';')
local result = {}
for k, v in ipairs(xPaths) do
local xPathStats = mw.text.trim(v)
if xPathStats ~= '' then
local lines = mw.text.split(xPathStats, '\n')
if #lines <= 1 then
error("details not provided")
end
local resultLine = string.format("'''%s''':%s", lines[1], lines[2])
table.insert(result, resultLine)
end
end
return table.concat(result, '<br>')
end
return p