置顶公告:【置顶】关于临时开启评论区所有功能的公告(2022.10.22) | 【置顶】关于本站Widget恢复使用的公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:Sandbox/唯爱绫华/侧边栏底图

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳到导航 跳到搜索
Template-info.svg 模块文档  [创建] [刷新]
local p = {}
 
local function notempty(s)
    return (s and s ~= "")
end

local titleset = mw.loadData("模块:kiraraf角色信息")
local getArgs = require("Module:Arguments").getArgs
 
local function wikitext(text1)
	return mw.getCurrentFrame():preprocess(text1)
end

local items = {
	{"10012000","宫子","日之剑士"},
	{"10022010","寻","情人节的日之牧师"},
	{"10032000","沙英","白色情人节的日之剑士"},
	{"12222000","成年若狭悠里","日之炼金术师"},
	{"13002020","透","土之牧师"},
	{"14042010","猪熊阳子","泳装的日之法师"},
	{"16022010","村上椎奈","月之骑士"},
	{"16052000","百武照","水之法师"},
	{"16062000","饭野水叶","月之炼金术师"},
	{"17002030","千矢","复活节的土之剑士"},
	{"17012010","巽绀","泳装的风之法师"},
	{"19002021","高山春香","婚礼服的水之炼金术师"},
	{"21022021","十仓荣依子","情人节的火之剑士"},
	{"28002020","花小泉杏","婚礼服的火之法师"},
	{"30032000","千夜","风之牧师"},
	{"30082000","青山Blue Mountain","正月的水之牧师"},
	{"31022001","猿渡宇希","火之剑士"},
	{"31022011","猿渡宇希","七夕的火之炼金术师"},
	{"32022021","克蕾尔","婚礼服的水之骑士"},
	{"32042031","柯尔克","七夕的火之牧师"},
	{"32152010","薄荷","第2部的月之剑士"},
	{"32162001","梅蒂娅","第2部的月之法师"},
	{"33042010","园部篠","复活节的风之剑士"},
	{"35012011","千代田桃","月之剑士"},
	{"37012011","森野麒麟","火之剑士"},
	{"39022001","川口芳乃","风之炼金术师"},
	{"43042001","小野坂纱织","七夕的月之法师"}
}

function p.main(frame)	
	math.randomseed(tostring(os.time()))
    local rand = math.random(#items)
    
    r = '*左侧边栏底图是《[[闪耀幻想曲]]》中'
    if (titleset[items[rand][2]][2]=='闪耀幻想曲') then
    	r = r .. '原创'
    else
    	r = r.. '《[[' .. titleset[items[rand][2]][2] .. ']]》'
    end
    r = r .. "角色'''[[" .. titleset[items[rand][2]][1] ..'|' .. items[rand][2] .."]]'''的[[闪耀幻想曲:" .. items[rand][2] ..'(' ..items[rand][3] .. ')|卡片]]。'
    r = r .. "[{{fullurl:{{FULLPAGENAME}}|action=purge}} 换一个?] ([[User:唯爱绫华/侧边栏底图|图库]])"
    r = r .. "{{替换侧边栏底图|url=https://asset.kirafan.cn/texture/charauiresource/charaillustchara/charaillust_chara_" .. items[rand][1] .. ".png|width=180px}}"
    
    r = wikitext(r)
    return r
end

function p.check()
	t=""
	for i = 1,#items
	do
		s = '<div style="display:inline-block; text-align:center; width:150px; margin:0 5px;">{{图片外链|https://asset.kirafan.cn/texture/charauiresource/charaillustchara/charaillust_chara_'
		s = s ..items[i][1].. '.png|120}}'
		s = s .. '<br>[[' .. titleset[items[i][2]][1] ..'|' .. items[i][2] ..']]<br><small>[[闪耀幻想曲:' .. items[i][2] ..'(' ..items[i][3] .. ')|(' ..items[i][3] .. ')]]</small></div>' 
		t = t .. wikitext(s) .. "\n"
	end
	
	return t
end

return p