卡厄思
梦
境
菜单
首页
回到首页
WIKI工具
全站样式
全站JS
修改导航栏
测试
沙盒
可视化管理器
战斗员管理器
卡牌管理器
伙伴管理器
装备管理器
词典管理器
图鉴
战斗员
伙伴
装备
怪物卡牌
中立卡牌
词典
小工具
配队模拟器
节奏榜生成器
搜索
链入页面
相关更改
特殊页面
页面信息
最近更改
登录
模块
查看“︁装备”︁的源代码
←
模块:装备
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local equipment = {} local data = mw.loadData('Module:装备/data') -- 从数据模块加载 -- 主函数,接收参数:装备名, 星级(默认1) function equipment.show(frame) local args = frame.args local name = args[1] or args.name local star = tonumber(args[2] or args.star or 1) if not name then return '<span style="color:red">未指定装备名</span>' end local eq = data[name] if not eq then return '<span style="color:red">装备「' .. name .. '」不存在</span>' end local base = eq.base local level = eq[tostring(star)] or eq["1"] if not level then star = 1; level = eq["1"] end local art = base.art or "relic_placeholder.png" local rarity = base.rarity or "蓝" local type_icon = "icon_equip_" .. (base.type or "武器") .. "_" .. rarity .. ".png" local value_type = base.value_type or "属性" local value = level.value or 0 local desc = level.desc_global or "" -- 生成星级图标(1~5星) local star_img = "icon_star_rating_" .. star .. ".png" -- 主卡片HTML(点击触发弹窗) local html = [=[ <div class="equipment-card" data-equip-name="]=] .. mw.text.encode(name) .. [=[" data-star="]=] .. star .. [=["> <div style="position: relative; display: inline-block; width:150px; height: 230px;"> <div style="position: absolute; top: 0px; left: 0px;">[[File:bg_equipment_rarity_]=] .. rarity .. [=[.png|150px|link=]]</div> <div style="position: absolute; top: 43px; left: 13px;">[[File:]=] .. art .. [=[|124px|link=]]</div> <div style="position: absolute; bottom: 5px; left: 5px; width: 140px; height: 35px; background-color: rgba(0,0,0,0.5); border-radius: 0px 0px 8px 8px"></div> <div style="position: absolute; bottom: 10px; left: 20px;">[[File:]=] .. star_img .. [=[|link=]]</div> <div style="position: absolute; top: 0px; left: 0px;">[[File:equipment_顶层蒙版.png|150px|link=]]</div> </div> </div> ]=] return html end equipment.main = equipment.show -- 兼容 #invoke:装备 return equipment
该页面使用的模板:
模块:装备/doc
(
查看源代码
)
返回
模块:装备
。