模块:装备图鉴
此模块的文档可以在模块:装备图鉴/doc创建
local data = mw.loadData("模块:数据库/装备")
local equipts = data.equipts
local byIndexE = data.byIndexE
local p = { }
local curFrame = nil
local function expand(idx)
local name = byIndexE[idx]
local args = { name }
return curFrame:expandTemplate{ title = '装备属性', args = args }
end
p['按类型'] = function(frame)
curFrame = frame
local type = tonumber(frame.args[1])
local ret = '{| class="wikitable" style="text-align:center; "\n|-\n!立绘!!名称!!火力!!装甲!!命中!!回避!!对空!!对潜!!鱼雷!!轰炸!!索敌!!幸运!!射程!!对空补正!!特效'
for j,v in pairs(equipts) do
if v.type == type then
ret = ret .. '\n|-\n' .. expand(tonumber(v.index))
end
end
return ret .. '\n|}'
end
return p