此处为全站公告,通常对读者进行申明或对该WIKI某些规则进行公告,请在确认后修改本通告。
本WIKI编辑权限开放,欢迎收藏起来防止迷路,也希望有爱的小伙伴和我们一起编辑哟~
编辑全站公告 • 编辑帮助:目录 • BWIKI反馈留言板
全站通知:
模块:Char
刷
历
编
跳到导航
跳到搜索
此模块的文档可以在模块:Char/doc创建
local p = {}
function p.main(frame)
local args = frame.args
local char = args[1]
local atype = args[2]
local IdTitle = mw.title.new('Mediawiki:Char.json')
local itemcontent = IdTitle and IdTitle:getContent() or nil
local IdData = mw.text.jsonDecode(itemcontent)
local rawId = IdData[char]
if not rawId then
return "角色不存在"
end
local id = tostring(rawId)
local title = mw.title.new('Mediawiki:char/' .. id .. '.json')
local content = title and title:getContent() or nil
local data = mw.text.jsonDecode(content or '{}')
if atype == '立绘' then
local en = data.EnName or char
local GalleryTitle = mw.title.new('Mediawiki:Gallery.json')
local gallerycontent = GalleryTitle and GalleryTitle:getContent() or nil
local galleryData = mw.text.jsonDecode(gallerycontent or '{}')
local galleryEntry = galleryData[id] or galleryData[tonumber(id)] or {}
local parts = {}
table.insert(parts, '<div class="sora_sora_artwork_content" data-type="normal">[[文件:旅人_立绘_' .. (char) .. '.png|link=]]</div>')
table.insert(parts, '<div class="sora_sora_artwork_content" data-type="awakened" style="display:none;">[[文件:' .. en .. '_awakened_02.png|link=]]</div>')
table.insert(parts, '<div class="sora_sora_artwork_content" data-type="CG" style="display:none;">[[文件:' .. id .. '01_CG.png|link=]]</div>')
for k, _ in pairs(galleryEntry) do
if string.match(k, '^skin%d+') then
table.insert(parts, '<div class="sora_sora_artwork_content" data-type="' .. k .. '" style="display:none;">[[文件:' .. en .. '_' .. k .. '_02.png|link=]]</div>')
end
end
return table.concat(parts)
end
if atype == '定位' then
return data.tag.job or "无定位信息"
end
if atype == '普通攻击' then
return data.skills.Skill01.Skill01_name or "无普通攻击信息"
end
if atype == '主控技能' then
return data.skills.Skill02.Skill02_name or "无主控技能信息"
end
if atype == '主控技能冷却' then
return data.skills.Skill02.Skill02_CD/10000 or "无主控技能冷却信息"
end
if atype == '援助技能' then
return data.skills.Skill03.Skill03_name or "无援助技能信息"
end
if atype == '援助技能冷却' then
return data.skills.Skill03.Skill03_CD/10000 or "无援助技能冷却信息"
end
if atype == '绝招' then
return data.skills.Skill04.Skill04_name or "无绝招信息"
end
if atype == '绝招冷却' then
return data.skills.Skill04.Skill04_CD/10000 or "无绝招冷却信息"
end
if atype == '绝招能耗' then
return data.skills.Skill04.UltraEnergy/10000 or "无绝招能耗信息"
end
end
return p

沪公网安备 31011002002714 号