跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
最近更改
随机页面
特殊页面
Minimalist Tower Defense Wiki
搜索
搜索
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模块:LevelInfo”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
外观
移至侧栏
隐藏
←
模块:LevelInfo
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} -- 数据定义 local levelData = { ["1-1"] = { name = "日光之塔", challenge = "0", gamemode = "经典模式", gametime = "1", startgold = "260", startcrystal = "0", sizex = "29", sizey = "13", goldore = "0", crystalore = "0" }, ["1-1A"] = { name = "(日光之塔)", challenge = "1", gamemode = "固定选卡模式", gametime = "1", startgold = "300", startcrystal = "15", sizex = "29", sizey = "13", goldore = "0", crystalore = "0" }, } -- wikitext function p.render(frame) -- 获取当前页面标题 local title = mw.title.getCurrentTitle() if not title then return "错误:无法获取当前页面标题。" end local pageKey = title.prefixedText local data = levelData[pageKey] if not data then return "该关卡暂无信息(" .. pageKey .. " 未配置)。" end -- 构建wikitext local lines = {} -- table.insert(lines, "== " .. pageKey .. " " .. data.name .. " ==") table.insert(lines, "游戏模式: " .. (data.gamemode or "未知")) table.insert(lines, "关卡时长: 共 " .. (data.gametime or "未知") .. "天") table.insert(lines, "初始资源: {{gc|" .. (data.startgold or "未知") .. "|" .. (data.startcrystal or "未知") .. "}}") table.insert(lines, "金矿矿地: {{c|g|" .. (data.goldore or "未知") .. "}}") table.insert(lines, "水晶矿矿地: {{c|c|" .. (data.crystalore or "未知") .. "}}") table.insert(lines, "关卡大小: " .. (data.sizex or "未知") .. " * " .. (data.sizey or "未知")) -- 可选字段 if data.hpmultiplier then table.insert(lines, "关内倍率: " .. data.hpmultiplier) end -- 用换行符连接 return frame:preprocess(table.concat(lines, "\n\n")) end return p
此页面嵌入的页面:
模块:LevelInfo/doc
(
查看源代码
)
返回
模块:LevelInfo
。
搜索
搜索
查看“︁模块:LevelInfo”︁的源代码
添加话题