模块:装备获得

Hcmzn留言 | 贡献2017年5月7日 (日) 13:17的版本

可在模块:装备获得/doc创建此模块的帮助文档

-- 本模块为个人测试用
local data = mw.loadData("模块:特殊数据/装备")
local data2 = mw.loadData("模块:特殊数据/舰娘")
local equipts = data.equipts
local ships = data2.ships
local byIndex = data2.byIndex
local p = {}

p['自带'] = function(frame)
	local equiptName = frame.args[1]
	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

return p