匿名
未登录
登录
乐园数据管理室
搜索
查看“︁模块:Tbox”︁的源代码
来自乐园数据管理室
命名空间
模块
讨论
更多
更多
页面操作
阅读
查看源代码
历史
刷新
←
模块:Tbox
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您没有权限编辑
模块
命名空间内的页面。
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local p = {} local getArgs = require("Module:Arguments").getArgs local loadJson = require("Module:JSON").loadJson local fsidMap = loadJson("FSID") function itemList(args) local items = {} for i = 1, 6 do if args["itm" .. i .. "ID"] then -- filter nil local itemName = args["itm" .. i .. "ID"] local itemTitle = getItemTitle(itemName) local itemPage = "[[" .. tostring(itemTitle) .. "|" .. itemName .. "]]" table.insert( items, { itemPage, args["itm" .. i .. "Num"] } ) local numString = "" if args["itm" .. i .. "Num"] ~= "1" then numString = " ×" .. args["itm" .. i .. "Num"] end mw.smw.set { tboxPop = {tostring(itemTitle)}, tboxPopDisplay = {itemName .. numString}, tboxPopLinkDisplay = {"[[" .. itemTitle.fullText .. "|" .. itemTitle.text .. "]]" .. numString}, [tostring(itemTitle) .. "PopNum"] = {args["itm" .. i .. "Num"]} } end end return items end function fsRow(fsid) local output = "" if fsid then local fs = fsidMap[tonumber(fsid)] local firstSkill = fs.FieldSkillID1 .. "Lv" .. fs.FieldSkillLevel1 local secondSkill if fs.FieldSkillLevel2 == 0 then secondSkill = "-" else secondSkill = fs.FieldSkillID2 .. "Lv" .. fs.FieldSkillLevel2 end output = mw.ustring.format( [[|- | rowspan="2" | %s | %s |- | %s ]], fs.Name, firstSkill, secondSkill ) if secondSkill == "-" then secondSkill = "" else secondSkill = " + " .. secondSkill end mw.smw.set { FieldSkill = {firstSkill .. secondSkill} } end return output end function getItemTitle(itemName) local itemTitle if mw.title.new(itemName, "物品").exists then itemTitle = mw.title.new(itemName, "物品") elseif mw.title.new(itemName, "黄金之国物品").exists then itemTitle = mw.title.new(itemName, "黄金之国物品") else itemTitle = mw.title.new(itemName, "物品") end return itemTitle end function p.popTable(frame) local args = getArgs(frame) local gmk_tbox = loadJson("Gmk/tbox") for i, v in ipairs(gmk_tbox) do if args.name == v.Name then local areas = {} for _, v in ipairs(v.areas) do table.insert(areas, mw.ustring.lower(v)) end local mapinfo = loadJson("Mapinfo/" .. areas[1]) mw.smw.set { PosX = v.PosX, PosY = v.PosY, PosZ = v.PosZ, Areas = areas, ["地域"] = mapinfo.mapName, zoneDisplay = mapinfo.mapName .. "・" .. mapinfo.menuGroup } end end local goldRow if args.goldMin == "0" then goldRow = "" elseif args.goldMin == args.goldMax then goldRow = mw.ustring.format([[ |- ! 金币 | %s G ]], args.goldMin) mw.smw.set { gold = {args.goldMin} } else goldRow = mw.ustring.format([[ |- ! 金币 | %s G ]], args.goldMin .. " ~ " .. args.goldMax) mw.smw.set { gold = {args.goldMin .. " ~ " .. args.goldMax} } end local itemRow = "" local itemPopList = itemList(args) if #itemPopList > 0 then local items = {} for i, v in ipairs(itemPopList) do table.insert(items, v[2] == "1" and v[1] or v[1] .. " ×" .. v[2]) end itemRow = mw.ustring.format([[|- ! 物品 | %s ]], table.concat(items, "<br>")) end return [[{| class="wikitable" ! colspan="2" |宝箱内容 ]] .. goldRow .. itemRow .. [[|}]] end function p.fsInfo(frame) local args = getArgs(frame) local output = "" output = output .. fsRow(args.FSID2) output = output .. fsRow(args.FSID) return #output > 0 and [[{| class="wikitable" ! colspan="2" |所需场景技能 ]] .. output .. "|}" or "" end function p.appearCondition(frame) local args = getArgs(frame) local output = "" if args["出现条件"] then output = mw.ustring.format([[{| class="wikitable" ! 出现条件 |- | %s |} ]], args["出现条件"]) end return output end return p
该页面使用的模板:
模块:Tbox/doc
(
查看源代码
)
返回
模块:Tbox
。
导航
导航
首页
最近更改
随机页面
翻译查询
异度神剑
异度神剑3
异度神剑X
wiki工具
wiki工具
特殊页面
页面工具
页面工具
用户页面工具
更多
链入页面
相关更改
页面信息
页面日志