local getArgs = require('Module:Arguments').getArgs local p = {} local function toWikitext(text1) return mw.getCurrentFrame():preprocess(text1) end function p.main(frame) local args = getArgs(frame) return p._main (frame, args) end function p._main(frame, args) if (not frame) then frame = mw.getCurrentFrame() end -- 初始化 args['name'] = string.gsub(args['name'], " ", "_") if string.gmatch(args['name'], "_") then if frame:callParserFunction('filepath', 'BA_Arm_'..args['name']..'.png') == '' then local tmp = mw.text.split(args['name'], "_") for i, v in ipairs(tmp) do fileName = v break end else fileName = args['name'] end else fileName = args['name'] end -- 表格 t = "{| class=\"wikitable ba-table ba-center\"\n|-\n! class=\"ba-header ba-blue\" | 固有武器\n! colspan=\"3\" class=\"ba-header ba-blue\" | 羁绊加成\n|-\n|" t = t.."[[File:BA_Arm_" .. fileName .. ".png|450px|"..args['武器名称'].."]]\n----\n{{color|#375375|'''"..args['武器名称'].."'''}}<br/>"..args['武器描述'].."\n| colspan=\"3\" |" t = t.."{{切换显示按钮|@forceNoCancel=1|@default="..args['name'].."KizunaLv10|@radio=0" for i = 1, 5 do t = t .. "|"..args['name'].."KizunaLv"..i.."0=RANK "..i.."0" end t = t .. "}}<div class = \"baTabContent\">"..args['羁绊描述'].."</div>\n|-\n| rowspan=\"2\" |" t = t .. "{{切换显示按钮|@forceNoCancel=1|@default="..args['name'].."WeaponLv30|@radio=0" for i = 3, 7 do t = t .. "|"..args['name'].."WeaponLv"..i.."0=Lv."..i.."0" end t = t .. "}}<div class = \"baTabContent\">"..args['武器等级描述'].."{{切换显示|"..args['name'].."WeaponLv40|<br/>强化技能提升}}{{切换显示|"..args['name'].."WeaponLv50|<br/>"..args['ter'].."战斗力提升至'''"..args['terLv'].."'''}}</div>\n! colspan=\"3\" class=\"ba-header ba-blue\" | 武器技能加成\n|-\n| colspan=\"3\" |" t = t .. "{{切换显示按钮|@forceNoCancel=1|@default="..args['name'].."WeaponSkillLv1|@radio=0" for i = 1, 10 do t = t .. "|"..args['name'].."WeaponSkillLv" .. i .. "=Lv." .. i end t = t .. "}}<div class = \"baTabContent\">"..args['武器技能描述'].."</div>\n|}" return toWikitext(t) end function p.KizunaSwitcher(frame) if (not frame) then frame = mw.getCurrentFrame() end local args = getArgs(frame) for i = 1, 5 do if not args[i] then args[i] = "[无数据]" end end t = "" for i = 1, 5 do t = t .. "{{切换显示|"..args['name'].."KizunaLv"..i.."0|"..args[i].."}}" end return toWikitext(t) end function p.WLvSwitcher(frame) if (not frame) then frame = mw.getCurrentFrame() end local args = getArgs(frame) t = "" for i = 1, 5 do if not args[i] then args[i] = "[无数据]" end end for i = 3, 7 do t = t .. "{{切换显示|"..args['name'].."WeaponLv"..i.."0|"..args[i-2].."}}" end return toWikitext(t) end return p