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

Module:无畏契约英雄契约

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳到导航 跳到搜索
  1. local getArgs = require('Module:Arguments').getArgs
  2. local p = {}
  3. function p.main(frame)
  4. local args = getArgs(frame)
  5. return p._main(frame, args)
  6. end
  7. function p._main(frame, args)
  8. if not frame then
  9. frame = mw.getCurrentFrame()
  10. end
  11. local agent = args["agent"]
  12. local img = ""
  13. local credits =
  14. {"2000", "2500", "3000", "3500", "4000", "4500", "5500", "6500", "7500", "8000"}
  15. local titles = {
  16. ["t"] = "称号",
  17. ["c"] = "卡面",
  18. ["k"] = "王国币",
  19. ["s"] = "-{zh-cn:喷漆;zh-tw:塗鴉;}-",
  20. ["b"] = "-{zh-cn:挂饰;zh-tw:吊飾;}-",
  21. ["0"] = "皮肤"
  22. }
  23. local nopicflag = false
  24. local container = mw.html.create():tag("div"):addClass("val-contracts")
  25. local function createContract(n, img, info)
  26. container
  27. :tag("div"):addClass("val-contract")
  28. :tag("div"):addClass("val-contract-level")
  29. :wikitext(n):done()
  30. :tag("div"):addClass("val-contract-img")
  31. :wikitext(img):done()
  32. :tag("div"):addClass("val-contract-title")
  33. :wikitext(args[n .. "-title"]):done()
  34. :tag("div"):addClass("val-contract-info")
  35. :wikitext(info):done()
  36. :allDone()
  37. end
  38. for i = 1, 10 do
  39. local t = args[i .. "-type"] or "0"
  40. local ext = args[i .. "-format"] or "png"
  41. local nopic = args[i .. "-nopic"] or "0"
  42. local imgContent = {
  43. ["t"] = "[[File:VALORANT_Contract_Title.png|link=]]",
  44. ["c"] = "[[File:VALORANT_Contract_" .. agent .. "_" .. i .. ".png|x180px|link=]]",
  45. ["k"] = "[[File:VALORANT_Contract_Kingdom_Credit.png|60px|link=]]"
  46. }
  47. if nopic == "1" then
  48. img = "暂无图片"
  49. nopicflag = true
  50. else
  51. img = imgContent[t] or ("[[File:VALORANT_Contract_" .. agent .. "_" .. i .. "." .. ext .. "|link=]]")
  52. end
  53. if t == "k" then
  54. createContract(i, img, "王国币")
  55. else
  56. createContract(i, img, titles[t] .. "<br/>" .. credits[i] .. "王国币")
  57. end
  58. end
  59. if nopicflag then
  60. container:wikitext("[[Category:无畏契约英雄契约图片存在缺失的条目]]")
  61. end
  62. return container
  63. end
  64. return p