舰R百科是靠无数自愿编辑者持续地建设更新完善的。编辑非常简单,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

模块:装备获得:修订间差异

来自舰R百科
跳转到导航 跳转到搜索
(修正笔误)
(优化)
第15行: 第15行:
if eq[k] == equiptName then
if eq[k] == equiptName then
if 1000 < ships[shipName].index and ships[shipName].index < 2000 then
if 1000 < ships[shipName].index and ships[shipName].index < 2000 then
if string.sub(shipName, 1, -6) == byIndex[i - 1000] then
local shipBaseName = byIndex[i - 1000]
ret = ret .. '[[' .. string.sub(shipName, 1, -6) .. '|' .. shipName .. ']]、'
ret = ret .. '[[' .. shipBaseName .. '|' .. shipName .. ']]、'
else
ret = ret .. '[[' .. byIndex[i - 1000] .. '|' .. shipName .. ']]、'
end
else
else
ret = ret .. '[[' .. shipName .. ']]、'
ret = ret .. '[[' .. shipName .. ']]、'

2017年5月8日 (一) 14:09的版本

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

local data = mw.loadData("模块:特殊数据/舰娘")
local ships = data.ships
local byIndex = data.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 1000 < ships[shipName].index and ships[shipName].index < 2000 then
						local shipBaseName = byIndex[i - 1000]
						ret = ret .. '[[' .. shipBaseName .. '|' .. shipName .. ']]、'
					else
						ret = ret .. '[[' .. shipName .. ']]、'
					end
				end
			end
		end
	end
	ret = string.sub(ret, 1, -4)
	if ret == '' then
		ret = ''
	else
		ret = ret .. '自带'
	end
	return ret
end

return p