|
|
第1行: |
第1行: |
| local equipts = mw.loadData("模块:特殊数据/装备").equipts | | local equipts = mw.loadData("模块:特殊数据/装备").equipts |
| local data = mw.loadData("模块:特殊数据/舰娘")
| |
| local ships = data.ships
| |
| local byIndex = data.byIndex
| |
|
| |
|
| local p = { } | | local p = { } |
|
| |
| local function fixEquiptName(name)
| |
| name = string.gsub(name, '(', '(')
| |
| name = string.gsub(name, ')', ')')
| |
| name = string.gsub(name, 'Ⅲ', 'III')
| |
| name = string.gsub(name, 'Ⅵ', 'VI')
| |
| name = string.gsub(name, '日本', 'J国')
| |
| name = string.gsub(name, '德国', 'G国')
| |
| name = string.gsub(name, '英国', 'E国')
| |
| name = string.gsub(name, '美国', 'U国')
| |
| name = string.gsub(name, '意大利', 'I国')
| |
| name = string.gsub(name, '法国', 'F国')
| |
| name = string.gsub(name, '德国', 'G国')
| |
| name = string.gsub(name, '苏联', 'S国')
| |
| name = string.gsub(name, '中国', 'C国')
| |
| if ret == nil then ret = name end
| |
| return ret
| |
| end
| |
|
| |
|
| p['属性'] = function(frame) | | p['属性'] = function(frame) |
第93行: |
第72行: |
| end | | end |
| return ret:sub(5) | | return ret:sub(5) |
| end
| |
|
| |
| p['自带'] = function(frame)
| |
| local equiptName = frame.args[1]
| |
| equiptName = fixEquiptName(equiptName)
| |
| local ret = ''
| |
| for i = 1,1300 do
| |
| local shipName = byIndex[i]
| |
| if shipName ~= nil then
| |
| local eq = {ships[shipName].eq1, ships[shipName].eq2, ships[shipName].eq3, ships[shipName].eq4}
| |
| for k = 1,4 do
| |
| if eq[k] == equiptName then
| |
| if string.sub(shipName, -5, -1) == '·改' then
| |
| ret = ret .. '[[' .. string.sub(shipName, 1, -6) .. '|' .. shipName .. ']]、'
| |
| else
| |
| ret = ret .. '[[' .. shipName .. ']]、'
| |
| end
| |
| end
| |
| end
| |
| end
| |
| end
| |
| ret = string.sub(ret, 1, -4)
| |
| return ret
| |
| end | | end |
|
| |
|
| return p | | return p |