模块:装备图鉴:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
| (未显示3个用户的19个中间版本) | |||
| 第16行: | 第16行: | ||
curFrame = frame | curFrame = frame | ||
local type = tonumber(frame.args[1]) | local type = tonumber(frame.args[1]) | ||
local ret = '{| class="wikitable | local tempret = {"", "", "", "", "", ""} | ||
local ret = '{| class="wikitable sortable" style="text-align:center; "\n|- style="position:sticky; top:0" class="citizen-overflow-sticky-header"\n!图标!!装备名称!!火力!!装甲!!命中!!回避!!对空!!对潜!!鱼雷!!轰炸!!索敌!!幸运!!射程!!备注' | |||
for j,v in pairs(equipts) do | |||
if v.type == type and tonumber(v.index) ~= 0 and tonumber(v.rarity) ~= 0 then | |||
tempret[tonumber(v.rarity)] = tempret[tonumber(v.rarity)] .. '\n|-\n' .. expand(tonumber(v.index)) | |||
end | end | ||
end | |||
for i = 1, 6 do | |||
ret = ret .. tempret[i] | |||
end | end | ||
return ret .. '\n|}' | return ret .. '\n|}' | ||
2025年3月10日 (一) 11:44的最新版本
此模块的文档可以在模块:装备图鉴/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 tempret = {"", "", "", "", "", ""}
local ret = '{| class="wikitable sortable" style="text-align:center; "\n|- style="position:sticky; top:0" class="citizen-overflow-sticky-header"\n!图标!!装备名称!!火力!!装甲!!命中!!回避!!对空!!对潜!!鱼雷!!轰炸!!索敌!!幸运!!射程!!备注'
for j,v in pairs(equipts) do
if v.type == type and tonumber(v.index) ~= 0 and tonumber(v.rarity) ~= 0 then
tempret[tonumber(v.rarity)] = tempret[tonumber(v.rarity)] .. '\n|-\n' .. expand(tonumber(v.index))
end
end
for i = 1, 6 do
ret = ret .. tempret[i]
end
return ret .. '\n|}'
end
return p