| 此模块使用Lua语言: |
警告!此模板仅限于 Template:常轨脱离Creative:Routes 使用!
因其数值(标题、选项)已被写死,不能作为通用模板使用。 有一部分原因是偷懒故意的
如有需要,您可以复制此模板然后自行编辑。
注:章节从 0 开始算起
{{常轨脱离Creative:GenerateRoute
| (option)
| (option)
| (option)
}}
{{常轨脱离Creative:GenerateRoute
| 0
}}
○ 充满希望的清晨
1 喜欢 2 也不至于
{{常轨脱离Creative_GenerateRoute
| 0
| 1
| 2
}}
○ 充满希望的清晨
1 喜欢 2 也不至于
○ 学生会从今日起!
1 拜托常磐 2 和锦出门
○ 我的就是你的?
1 优先说服常磐 2 优先挽留锦
local p = {}
local getArgs = require('Module:Arguments').getArgs
local chapterNames = {
"充满希望的清晨",
"学生会从今日起!",
"我的就是你的?",
"policemen",
"夏天!大海!女体盛!",
"*不毛地带",
"谁先想出来“呜呼”这个词的",
"谁叫是夏天呢"
}
local options = {
{ "喜欢", "也不至于" },
{ "拜托常磐", "和锦出门" },
{ "优先说服常磐", "优先挽留锦" },
{ "雅典式", "斯巴达式" },
{ "和常磐一起走", "诗樱前辈一起去 *" },
{ "去", "还是免了吧" },
{ "让她养我", "总有一天会自立的" },
{ "去买西瓜", "去钓鱼" }
}
local function color(c, t)
return string.format('<span style="color:%s">%s</span>', c, t)
end
function p.main(frame)
local args = getArgs(frame, { parentFirst = true })
local out = {}
local count = 0
for i = 1, #chapterNames do
local option = args[i]
if option ~= nil then
count = count + 1
option = tonumber(option)
local chapterName = chapterNames[i] or color("red", "未知章节")
local opt1 = options[i] and options[i][1] or color("red", "未知选项")
local opt2 = options[i] and options[i][2] or color("red", "未知选项")
if option == 1 then
opt1 = color("red", "1 " .. opt1)
opt2 = "2 " .. opt2
elseif option == 2 then
opt1 = "1 " .. opt1
opt2 = color("red", "2 " .. opt2)
else
opt1 = color("gray", "1 " .. opt1)
opt2 = color("gray", "2 " .. opt2)
end
table.insert(out, string.format(
'<div><p>%s○ %s</p><p>%s %s</p></div>',
(i > 1 and "<br>" or ""),
chapterName,
opt1,
opt2
))
end
end
return table.concat(out, "\n")
end
return p