Module:Sandbox/BearBin/Filter
< Module:Sandbox | BearBin
跳到导航
跳到搜索
local data = mw.loadData("Module:碧蓝航线Ships/Data") local p = {} local color = { [0] = "999", [1] = "999", [2] = "33f", [3] = "c3c", [4] = "c90", [5] = "f39", [6] = "963", [7] = "d79", [13] = "410881", [14] = "800000", } local map_type = { [1] = "驱逐", [2] = "轻巡", [3] = "重巡", [4] = "战巡", [5] = "战列", [6] = "轻航", [7] = "航母", [8] = "潜艇", [9] = "航巡", [10] = "航战", [11] = "雷巡", [12] = "维修", [13] = "重炮", [17] = "潜母", [18] = "超巡", [19] = "运输", [20] = "导驱-先锋", [21] = "导驱-主力" ,[22] = "风帆" } local map_nation = { [1] = '白鹰联邦', [2] = '皇家海军', [3] = '重樱群岛', [4] = '铁血公国', [5] = '东煌', [6] = '撒丁帝国', [7] = '北方联合', [8] = '自由鸢尾', [9] = '维希教廷', [96] = '飓风', [97] = 'META', [98] = '无阵营', [99] = '塞壬', [101] = '海王星', [102] = '哔哩哔哩', [103] = '传颂之物', [104] = 'KizunaAI', [105] = 'Hololive', [106] = '维纳斯假期', [107] = '偶像大师', [108] = 'SSSS', [109] = 'Atelier Ryza' } local map_armor = { [1] = "轻型", [2] = "中型", [3] = "重型" } function p.main(frame) local FilterTable = {} table.insert(FilterTable, '{| class="wikitable AnnTools-MWFilter-result AnnTools-MWFilter-result-text-align-center sortable" style="width:100%"\n|- style="position:sticky;top:0"\n') table.insert(FilterTable, '! style="width:10%" class="AnnTools-MWFilter-skip" | 舰船 !! 舰种 !! 阵营 !! 装甲类型 !! 炮击 !! 雷击 !! 航空 !! 机动 !! 防空 !! 耐久\n|-') for k, v in pairs(data) do link = '[[碧蓝航线:' .. k .. '|' .. '<span style="color:#' .. color[v.rarity] .. '>' .. k .. '</span>]]' local tableRow = '|' .. link .. '\n|-\n' table.insert(FilterTable, tableRow) end table.insert(FilterTable, '|}') return table.concat(FilterTable) end return p