跳到内容
折叠侧栏
搜索
创建账号
个人工具
创建账号
登录
导航
首页
最近更改
随机页面
编者用页面
方针
指引
讨论版
格式手册
挂起清单
维护清单
玩法条目
游戏玩法
界面
机制
搭档
潜力值
Link Play
世界模式
故事模式
段位挑战
解歌系统
成就系统
版本更新日志
列表条目
定数表
曲目列表
曲包列表
曲师列表
谱师列表
画师列表
背景列表
友情链接
Rotaeno中文维基
工具
链入页面
相关更改
特殊页面
页面信息
查看“Module:DesignerSong”的源代码
模块
讨论
English
阅读
查看源代码
查看历史
更多
阅读
查看源代码
查看历史
←
Module:DesignerSong
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
p={} local DL = mw.loadJsonData 'User:Economy666/DesignersList.json' local multiId = mw.loadJsonData 'Template:Transition.json'.multiId local trans = mw.loadJsonData 'Template:Transition.json' local mad = require 'Module:AnotherData' local data = require "Module:Arcaea Data" local CL = require 'Module:沙盒/Economy666/CL' local CDL = DL.complex local SDL = DL.simple local specialSong = DL.special local queryMO = data.allSongInformation("id", "mobile") local queryNS = data.allSongInformation("id", "ns") local diffList = {'PST', 'PRS', 'FTR', 'BYD', 'ETR'} local songDiffDesigner={} local specialDesigner ={} local LinkedDesignerList={} local function readList() local function linkDesigner(designer, songid) if LinkedDesignerList[designer] then return LinkedDesignerList[designer] end local Linked = CL.designerLink(designer, songid) LinkedDesignerList[designer] = Linked return Linked end local pickList = {} local mobileList = {} for _, song in ipairs(mad.listOf('songs', 'mobile')) do songDiffDesigner[song.id]={} local lastDesigner=nil local sameCount = 0 local num = 0 for _,level in ipairs(song.difficulties) do local designer = level.chartDesigner local diff = level.ratingClass if lastDesigner ~= designer then sameCount = 0 if not pickList[designer] then pickList[designer] = {} end if not pickList[designer][song.id] then pickList[designer][song.id] = {} end pickList[designer][song.id][diffList[diff+1]]=true mobileList[song.id]=true table.insert(songDiffDesigner[song.id], {diffList[diff+1], linkDesigner(designer, song.id)}) if specialSong[song.id] then specialDesigner[designer]=true end lastDesigner=designer else sameCount=sameCount+1 table.insert(songDiffDesigner[song.id], {diffList[diff+1], nil}) songDiffDesigner[song.id][num-sameCount+1][3]=sameCount+1 end num=num+1 end end -- for _, song in ipairs(mad.listOf('songs', 'ns')) do -- if not mobileList[song.id] and not multiId[song.id] then -- for _,level in ipairs(song.difficulties) do -- local designer = level.chartDesigner -- local diff = level.ratingClass -- if lastDesigner ~= designer then -- sameCount = 0 -- if not pickList[designer] then -- pickList[designer] = {} -- end -- if not pickList[designer][song.id] then -- pickList[designer][song.id] = {} -- end -- pickList[designer][song.id][diffList[diff+1]]=true -- table.insert(songDiffDesigner[song.id], {diffList[diff+1], linkDesigner(designer, song.id)}) -- if specialSong[song.id] then -- specialDesigner[designer]=true -- end -- lastDesigner=designer -- else -- sameCount=sameCount+1 -- table.insert(songDiffDesigner[song.id], {diffList[diff+1], nil}) -- songDiffDesigner[song.id][num-sameCount+1][3]=sameCount+1 -- end -- num=num+1 -- end -- end -- end return pickList end local function genList(pickList) local function cate(singleList, cArtist, artist) local artist = artist or cArtist if not singleList[artist] then singleList[artist] = {} end for id,diff in pairs(pickList[cArtist]) do singleList[artist][id]=diff end return singleList end local singleList = {} for cDesigner,songids in pairs(pickList) do local designerList={} if CDL[cDesigner] then if CDL[cDesigner].__FullData__ then for _,text in pairs(CDL[cDesigner].__FullData__) do if text.link then local designer = text['link'] if not designerList[designer] then singleList = cate(singleList, cDesigner, designer) designerList[designer]=true end end end else for link in pairs(CDL[cDesigner]) do local designer = link if not designerList[designer] then singleList = cate(singleList, cDesigner, designer) designerList[designer]=true end end end else local temp_text = cDesigner local count = 0 for _,data in ipairs(SDL) do local designer = data.link local dis = data.display if string.find(temp_text, dis) then singleList = cate(singleList, cDesigner, designer) designerList[designer]=true temp_text = string.gsub(temp_text, dis, '') count = count + 1 end end if count == 0 then if specialDesigner[cDesigner] then singleList = cate(singleList, cDesigner, '与主线剧情相关的特殊名义') else singleList = cate(singleList, cDesigner, '其他未确认谱师名义') end end end end return singleList end -- Function to convert table to string local function tableToString(tbl, indent) indent = indent or 0 local toPrint = string.rep(" ", indent) .. "{\n" for k, v in pairs(tbl) do local keyString = tostring(k) local valueString if type(v) == "table" then valueString = tableToString(v, indent + 2) else valueString = tostring(v) end toPrint = toPrint .. string.rep(" ", indent + 2) .. "[" .. keyString .. "] = " .. valueString .. ",\n" end toPrint = toPrint .. string.rep(" ", indent) .. "}" return toPrint end local head = '{| class="wikitable" border="1" cellspacing="1" cellpadding="5" style="text-align:center" width="100%"\n' head = head .. '! width="20%" style="position:-webkit-sticky;position:sticky;top:0px;" |曲名 \n' head = head .. '! width="20%" style="position:-webkit-sticky;position:sticky;top:0px;" |所属曲包 \n' head = head .. '! colspan="2" width="40%" style="position:-webkit-sticky;position:sticky;top:0px;" |谱师名义 \n' head = head .. '! width="20%" style="position:-webkit-sticky;position:sticky;top:0px;" |备注 \n' local function songUnit(songid,text) local data = songDiffDesigner[songid] local pack = '' local wikiText = '' local rowspan = '|rowspan='.. #data ..'|' wikiText = wikiText .. '|-\n'..rowspan ..songid ..'\n' wikiText = wikiText .. rowspan ..pack ..'\n' for num, i in ipairs(data) do local diffFormat = '| '..(i[1] or '') local designerFormat = i[3] and '||rowspan='.. i[3] ..'|' ..i[2] or (i[2] and '||'..i[2] or '') wikiText = wikiText .. diffFormat ..designerFormat..'\n' if num == 1 then wikiText = wikiText..rowspan .. (text or '')..'\n' end wikiText = wikiText .. '|-\n' end return wikiText end function p.main() pickList = readList() singleList = genList(pickList) local wikiText ='' for designer,songs in pairs(singleList) do wikiText = wikiText .."'''".. designer.."'''\n" wikiText = wikiText .. head for songid,diff in pairs(songs) do wikiText = wikiText .. songUnit(songid) end wikiText = wikiText .. '|}' end -- for i,ii in pairs(songDiffDesigner) do -- text = text .. songUnit(i) -- end -- return tableToString(songDiffDesigner) -- return list1 return wikiText end return p
本页使用的模板:
Module:DesignerSong/doc
(
查看源代码
)
返回
Module:DesignerSong
。