「于世界交点之处,逢似曾相识之人」

本wiki目前不支持自由编辑,如果有兴趣参与wiki内容编辑,请加入WIKI建设群904200987(游戏交流勿加会被踢)
使用wiki的数据、图片、音频资源,或者搬运页面内容时,请注明出处。具体参照CC BY-NC-SA 4.0协议
感谢Hyacinth对本wiki提供的数据支持
编辑帮助BWIKI反馈

bugfix1001.2
全站通知:

模块:用途查询

来自白荆回廊Wiki
跳到导航 跳到搜索

此模块的文档可以在模块:用途查询/doc创建

local __split = require('模块:Utils').split

local p = {}

-- 查询物品的兑换用途
function p.use_shop(key)
    --查询商店兑换
    local dataList = require('Module:商店兑换数据库').store_exchange_data
    local outputData = {}
    for _i, v in ipairs(dataList) do
        if v['material_name'] == key and v['store_type'] ~= '活动商店' then
            table.insert(outputData, v)
        end
    end

    if #outputData == 0 then
        return nil
    end

    -- 拼接展示页面
    local html = mw.html.create()
    
    html = html:tag('table'):addClass('wikitable'):cssText('width:100%;margin:0;text-align:center;')

    --生成表头
    html = html:tag('tr')
		            :tag('th'):wikitext('兑换商店'):done()
		            :tag('th'):wikitext('兑换物品'):done()
		            :tag('th'):wikitext('兑换数量'):done()
		            :tag('th'):wikitext('消耗数量'):done()
		            :tag('th'):wikitext('可兑换次数'):done()
		            :tag('th'):wikitext('兑换次数更新周期'):done()
		        :done()

    -- 生成表格
    for _i, v in ipairs(outputData) do
        html = html:tag('tr')
		                :tag('td'):wikitext(v['store_name']):done()
		                :tag('td'):wikitext(v['object_name']):done()
		                :tag('td'):wikitext(v['object_number']):done()
		                :tag('td'):wikitext(v['material_number']):done()
		                :tag('td'):wikitext(v['exchange_times']):done()
		                :tag('td'):wikitext(v['exchange_cycle']):done()
		            :done()
    end

    html = html:done()

    return html
end

-- 查询物品的抽卡用途
function p.use_draw(key)
  local html = mw.html.create()
  if key == '同调线索' or key == '同调线索组' then
    html = html:wikitext('精神深潜-常态共鸣/定向共鸣(同调者卡池)')
  end
  if key == '拾友·专属协议' then
    html = html:wikitext('精神深潜-限域巡回(同调者卡池)')
  end
  if key == '一刹闪回' or key == '多重闪回' then
    html = html:wikitext('精神深潜-寻迹潜航/定向潜航(烙痕卡池)')
  end
  if key == '同游券' then
    html = html:wikitext('精神深潜-海域同游(烙痕卡池)')
  end
  return html
end

-- 查询物品的白荆穹顶用途
function p.use_home(key)
  local html = mw.html.create()

  if key == '穹顶密钥' then
    html = html:wikitext('白荆穹顶-中央控制室:提升中央控制室等级。')
  end
  if key == '实战BOXER·Ω型' or key == '多维拉练器' or key == '神经活性剂' or key == '重组蛋白' then
    html = html:wikitext('白荆穹顶-体能训练室:提升同调者体能训练等级。')
  end

  return html
end

-- 查询物品的烙痕养成用途
function p.use_memory_up(key)
    local html = mw.html.create()
    
	if key == '海隅点数' then
        html = html:wikitext('提升烙痕等级、突破烙痕等级上限')
    end
        	
    --处理烙痕获取道具
    if string.find(key, '记忆烙痕·') then
        local memory_name = string.gsub(string.gsub(key, 'SR', ''), '记忆烙痕·', '')
        if memory_name ~= '「CAT vs. DOG」' and memory_name ~= '「家」' then
            memory_name = string.gsub(string.gsub(memory_name, '「', ''), '」', '')
        end
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得烙痕'):done()
                        :done()
                        :tag('tr')
                            :tag('td'):wikitext('[[文件:记忆烙痕 ' .. memory_name .. ' 缩略图2.png|150px|link=记忆烙痕/' .. memory_name .. ']]'):done()
                        :done()
                    :done()
    end 
    if key == '自选记忆闪回·SSR' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):attr('colspan',2):wikitext('获得烙痕(自选SSR)'):done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('体质'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 同行 缩略图2.png|150px|link=记忆烙痕/同行]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 天陷 缩略图2.png|150px|link=记忆烙痕/天陷]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 偷偷「摩摩」 缩略图2.png|150px|link=记忆烙痕/偷偷「摩摩」]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 残照 缩略图2.png|150px|link=记忆烙痕/残照]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('防御'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 噩梦 缩略图2.png|150px|link=记忆烙痕/噩梦]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 朗朗乾坤 缩略图2.png|150px|link=记忆烙痕/朗朗乾坤]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 双重引力 缩略图2.png|150px|link=记忆烙痕/双重引力]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 逐光者 缩略图2.png|150px|link=记忆烙痕/逐光者]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('攻击'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 夕阳挽歌 缩略图2.png|150px|link=记忆烙痕/夕阳挽歌]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 血露薇·绝密 缩略图2.png|150px|link=记忆烙痕/血露薇·绝密]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 旧友无多 缩略图2.png|150px|link=记忆烙痕/旧友无多]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 「空」 缩略图2.png|150px|link=记忆烙痕/「空」]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('专精'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 暗巷漆影 缩略图2.png|150px|link=记忆烙痕/暗巷漆影]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 参商形影 缩略图2.png|150px|link=记忆烙痕/参商形影]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 藏锋 缩略图2.png|150px|link=记忆烙痕/藏锋]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 恶土之花 缩略图2.png|150px|link=记忆烙痕/恶土之花]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('终端'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 一线之隔 缩略图2.png|150px|link=记忆烙痕/一线之隔]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 雪轻日暖 缩略图2.png|150px|link=记忆烙痕/雪轻日暖]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 成长 缩略图2.png|150px|link=记忆烙痕/成长]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 最强召唤师 缩略图2.png|150px|link=记忆烙痕/最强召唤师]]'):done()
                            :done()
                        :done()
                    :done()
    end
    if key == '自选记忆闪回·SR' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):attr('colspan',2):wikitext('获得烙痕(自选SR)'):done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('体质'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 「玄」学 缩略图2.png|150px|link=记忆烙痕/「玄」学]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 海临人的好奇心 缩略图2.png|150px|link=记忆烙痕/海临人的好奇心]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 精准控分 缩略图2.png|150px|link=记忆烙痕/精准控分]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 一枕酣甜 缩略图2.png|150px|link=记忆烙痕/一枕酣甜]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('防御'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 你好,维瑟尔 缩略图2.png|150px|link=记忆烙痕/你好,维瑟尔]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 秩序囚笼 缩略图2.png|150px|link=记忆烙痕/秩序囚笼]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 拂晓 缩略图2.png|150px|link=记忆烙痕/拂晓]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 繁花蜃影 缩略图2.png|150px|link=记忆烙痕/繁花蜃影]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 流星坠处 缩略图2.png|150px|link=记忆烙痕/流星坠处]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('攻击'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 化为千鹤 缩略图2.png|150px|link=记忆烙痕/化为千鹤]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 增肌训练 缩略图2.png|150px|link=记忆烙痕/增肌训练]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 代号「百草」 缩略图2.png|150px|link=记忆烙痕/代号「百草」]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 截稿日 缩略图2.png|150px|link=记忆烙痕/截稿日]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('专精'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 繁星记忆 缩略图2.png|150px|link=记忆烙痕/繁星记忆]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 不期而遇 缩略图2.png|150px|link=记忆烙痕/不期而遇]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 「家」 缩略图2.png|150px|link=记忆烙痕/「家」]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 流光竞夜 缩略图2.png|150px|link=记忆烙痕/流光竞夜]]'):done()
                            :done()
                        :done()
                        :tag('tr')
                            :tag('th'):wikitext('终端'):done()
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 世事难料 缩略图2.png|150px|link=记忆烙痕/世事难料]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 白夜 缩略图2.png|150px|link=记忆烙痕/白夜]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 雨中愿 缩略图2.png|150px|link=记忆烙痕/雨中愿]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 打成一片 缩略图2.png|150px|link=记忆烙痕/打成一片]]'):done()
                            :done()
                        :done()
                    :done()
    end
    if key == '庆典专属闪回Ⅰ·SSR' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得烙痕(随机SSR)'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 幻想彼境 缩略图2.png|150px|link=记忆烙痕/幻想彼境]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 潮湿前路 缩略图2.png|150px|link=记忆烙痕/潮湿前路]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 雪轻日暖 缩略图2.png|150px|link=记忆烙痕/雪轻日暖]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 光阴间隙 缩略图2.png|150px|link=记忆烙痕/光阴间隙]]'):done()
                            :done()
                        :done()
                    :done()
    end
    if key == '庆典专属闪回Ⅱ·SSR' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得烙痕(随机SSR)'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 同行 缩略图2.png|150px|link=记忆烙痕/同行]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 朗朗乾坤 缩略图2.png|150px|link=记忆烙痕/朗朗乾坤]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 「空」 缩略图2.png|150px|link=记忆烙痕/「空」]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 底线大作战 缩略图2.png|150px|link=记忆烙痕/底线大作战]]'):done()
                            :done()
                        :done()
                    :done()
    end  
    if key == '相伴专属闪回Ⅰ·SSR' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得烙痕(随机SSR)'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 潮湿前路 缩略图2.png|150px|link=记忆烙痕/潮湿前路]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 如在镜中 缩略图2.png|150px|link=记忆烙痕/如在镜中]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 「空」 缩略图2.png|150px|link=记忆烙痕/「空」]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 暗巷漆影 缩略图2.png|150px|link=记忆烙痕/暗巷漆影]]'):done()
                            :done()
                        :done()
                    :done()
    end
    if key == '相伴专属闪回Ⅱ·SSR' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得烙痕(随机SSR)'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 幻想彼境 缩略图2.png|150px|link=记忆烙痕/幻想彼境]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 参商形影 缩略图2.png|150px|link=记忆烙痕/参商形影]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 双重引力 缩略图2.png|150px|link=记忆烙痕/双重引力]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;'):wikitext('[[文件:记忆烙痕 天狼 缩略图2.png|150px|link=记忆烙痕/天狼]]'):done()
                            :done()
                        :done()
                    :done()
    end  
    --处理烙痕升花道具
    if string.find(key, '契文·') then
        local memory_name = string.gsub(key, '契文·', '')
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('提升特质等级'):done()
                        :done()
                        :tag('tr')
                            :tag('td'):wikitext('[[文件:记忆烙痕 ' .. memory_name .. ' 缩略图2.png|150px|link=记忆烙痕/' .. memory_name .. ']]'):done()
                        :done()
                    :done()
    end
    if key == '记忆之契·SSR' then
        html = html:wikitext('提升可从【深潜系统】卡池中获取的SSR烙痕的特质等级')
    end
    if key == '记忆之契·SR' then
        html = html:wikitext('提升可从【深潜系统】卡池中获取的SR烙痕的特质等级')
    end
    --处理经验材料
    if string.find(key, '烙痕直升·80级') then
        html = html:wikitext('自选一张已拥有的SSR或SR记忆烙痕直升到80级')
    end
    if string.find(key, '拓片') then
        if key == '错金拓片' then
            html = html:wikitext('提升SR或SSR品质烙痕等级')
        else
            html = html:wikitext('提升烙痕等级')
        end
    end
    --处理突破材料
    if key == '梭行器' or key == '沉钨原液' or key == '热力管' or key == '波导凝晶' or key == '光束律'then
        html = html:wikitext('突破烙痕等级上限')
    end

    return html
end

-- 查询物品的同调者养成用途
function p.use_character(key, other_str,frame)
    local html = mw.html.create()

    --处理涂装道具
    if string.find(key, '涂装') then
        html = html:wikitext(other_str)
        return html
    end
    --处理同调者获取道具
    if key == '常态合作协议' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得同调者(随机6星)'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_莫红袖_头像.png|50px|link=同调者/莫红袖]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_云无月_头像.png|50px|link=同调者/云无月]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_昊苍_头像.png|50px|link=同调者/昊苍]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_耶芙娜_头像.png|50px|link=同调者/耶芙娜]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_卯绒绒_头像.png|50px|link=同调者/卯绒绒]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_瞳_头像.png|50px|link=同调者/瞳]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_崔远之_头像.png|50px|link=同调者/崔远之]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_北洛_头像.png|50px|link=同调者/北洛]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_龙晴_头像.png|50px|link=同调者/龙晴]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_紫都_头像.png|50px|link=同调者/紫都]]'):done()
                            :done()
                        :done()
                    :done()
    	return html
    end
    if key == '自选合作协议' then
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得同调者(自选6星)'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_莫红袖_头像.png|50px|link=同调者/莫红袖]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_云无月_头像.png|50px|link=同调者/云无月]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_昊苍_头像.png|50px|link=同调者/昊苍]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_耶芙娜_头像.png|50px|link=同调者/耶芙娜]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_卯绒绒_头像.png|50px|link=同调者/卯绒绒]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_瞳_头像.png|50px|link=同调者/瞳]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_崔远之_头像.png|50px|link=同调者/崔远之]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_北洛_头像.png|50px|link=同调者/北洛]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_龙晴_头像.png|50px|link=同调者/龙晴]]'):done()
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;'):wikitext('[[文件:角色_紫都_头像.png|50px|link=同调者/紫都]]'):done()
                            :done()
                        :done()
                    :done()
    	return html
    end
    if string.find(key, '合约') or string.find(key, '专属协议·') or string.find(key, 'PACK') or key == '蒙娜咪莎' or key == '机械甜心' or key == '好运天降' then
        local character_name = '';
        if string.find(key, '合约·') then
            character_name = string.gsub(key, '合约·', '')
        elseif string.find(key, '专属协议·') then
            character_name = string.gsub(key, '专属协议·', '')
        elseif string.find(key, 'PACK') then
            character_name = string.gsub(key, 'PACK1·传导反应·', '')
            character_name = string.gsub(character_name, 'PACK2·爆燃反应·', '')
            character_name = string.gsub(character_name, 'PACK3·传统铁三角·', '')
            character_name = string.gsub(character_name, '(方块)', '')
            character_name = string.gsub(character_name, '(三角)', '')
            character_name = string.gsub(character_name, '(菱形)', '')
        elseif key == '蒙娜咪莎' then
            character_name = "老板"
        elseif key == '机械甜心' then
            character_name = "Sweeper-EX"
        elseif key == '好运天降' then
            character_name = "豹富"
        end
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('获得同调者'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;margin-right:5px;color:#fff;')
                                    :wikitext('[[文件:角色_' .. character_name .. '_头像.png|50px|link=同调者/' .. character_name .. ']]')
                                :done()
                            :done()
                        :done()
                    :done()
    	return html
    end

    --处理同调者升花道具
    if string.find(key, '叙刻回声·') then
        local character_name = string.gsub(key, '叙刻回声·', '')
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('异核升级'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;width:50px;height:60px;margin-right:5px;position:relative;color:#fff;')
                                    :tag('div'):wikitext('[[文件:角色_' .. character_name .. '_头像.png|50px|link=同调者/' .. character_name .. ']]'):done()
                                    :tag('div'):cssText(
                                        'position:absolute;bottom:0;right:4px;font-size:1.5rem;text-shadow: 2px 1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000, -1px -1px 2px #000;')
                                    :wikitext(5):done()
                                :done()
                            :done()
                        :done()
                    :done()
    	return html
    end
	--处理同调者潜像道具
	if string.find(key, '显像剂') then
		local count = 2
		if key == "墨色显像剂" then
			count = 1
		end
		html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('潜像'):done()
                        :done()
                        :tag('tr')
                            :tag('td')                  
    							:tag('div'):cssText('display:inline-block;width:50px;height:60px;margin-right:5px;position:relative;color:#fff;')
                                    :tag('div'):cssText('display:flex;width:100%;height:100%;background: #BBB;justify-content: center;align-items: center;')
                                    	:tag('span'):cssText('font-size: 1.5em;'):wikitext('?'):done()
                                    :done()
                                    :tag('div'):cssText(
                                        'position:absolute;bottom:0;right:4px;font-size:1.5rem;text-shadow: 2px 1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000, -1px -1px 2px #000;')
                                    :wikitext(count):done()
                                :done()
		        			:done()
                        :done()
                    :done()
    	return html
	end
	
    --处理同调者位阶/技能/潜能/特性强化道具
    if string.find(key, '美好愿景·') then
        local character_name = string.gsub(key, '美好愿景·', '')
        html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable mw-collapsible')
                        :tag('tr')
                            :tag('th'):wikitext('特性强化'):done()
                        :done()
                        :tag('tr')
                            :tag('td')
                                :tag('div'):cssText('display:inline-block;width:50px;height:60px;margin-right:5px;position:relative;color:#fff;')
                                    :tag('div'):wikitext('[[文件:角色_' .. character_name .. '_头像.png|50px|link=同调者/' .. character_name .. ']]'):done()
                                    :tag('div'):cssText(
                                        'position:absolute;bottom:0;right:4px;font-size:1.5rem;text-shadow: 2px 1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000, -1px -1px 2px #000;')
                                    :wikitext(1):done()
                                :done()
                            :done()
                        :done()
                    :done()
    	return html
    end
    local upCostData = mw.text.jsonDecode(mw.title.new('MediaWiki:UpCost.json'):getContent())
    local dataList = {}
    for char_name, char_data in pairs(upCostData) do
    	for type, type_data in pairs(char_data) do
    		for level, level_data in pairs(type_data) do
	        	if level_data[key] ~= nil then
	        		local temp = {
	        			['object_type'] = "同调者",
	        			['character_name'] = char_name,
	        			['direction'] = type,
	        			['stage'] = level, 
	        			['material_name'] = key,
	        			['material_number'] = level_data[key],
	        			['material_order_id'] = "1"
	        		}
	            	table.insert(dataList, temp)
	        	end
	        end
	    end
    end

    if #dataList == 0 then
        return nil
    end

    --清洗同调者养成材料数据
    local temp1 = {}
    local temp2 = {}
    local temp3 = {}
    for _i, v in ipairs(dataList) do
        local data = {
            ['objectName'] = v['character_name'],
            ['count'] = v['material_number']
        }
        if v['direction'] == '升阶' then
            local count = 0
            for _j, w in ipairs(temp1) do
                if w['objectName'] == v['character_name'] then
                    w['count'] = w['count'] + v['material_number']
                    count = 1
                    break
                end
            end
            if count == 0 then
                table.insert(temp1, data)
            end
        elseif v['direction'] == '技能1升级' or v['direction'] == '技能2升级' then
            local count = 0
            for _j, w in ipairs(temp2) do
                if w['objectName'] == v['character_name'] then
                    w['count'] = w['count'] + v['material_number']
                    count = 1
                    break
                end
            end
            if count == 0 then
                table.insert(temp2, data)
            end
        elseif v['direction'] == '潜能开发' then
            local count = 0
            for _j, w in ipairs(temp3) do
                if w['objectName'] == v['character_name'] then
                    w['count'] = w['count'] + v['material_number']
                    count = 1
                    break
                end
            end
            if count == 0 then
                table.insert(temp3, data)
            end
        end
    end

    --拼接展示表格
    html = html:tag('table'):cssText('margin:0;width:100%;'):addClass('wikitable')
    if #temp1 > 0 then
        html = html:tag('tr')
            :tag('th'):cssText('width:150px;'):wikitext('位阶突破'):done()
            :done()
            :tag('tr')
            :tag('td'):addClass('mw-collapsible')
        for _i, v in ipairs(temp1) do
            html = html:tag('div'):cssText(
                    'display:inline-block;width:50px;height:60px;margin:5px;position:relative;color:#fff;')
                :tag('div'):wikitext('[[文件:角色_' .. v['objectName'] .. '_头像.png|50px|link=同调者/' .. v['objectName'] .. ']]')
                :done()
                :tag('div'):cssText(
                    'position:absolute;bottom:0;right:4px;font-size:1.5rem;text-shadow: 2px 1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000, -1px -1px 2px #000;')
                :wikitext(v['count']):done()
                :done()
        end
        html = html:done():done()
    end
    if #temp2 > 0 then
        html = html:tag('tr')
            :tag('th'):cssText('width:150px;'):wikitext('常规技能升级'):done()
            :done()
            :tag('tr')
            :tag('td'):addClass('mw-collapsible')
        for _i, v in ipairs(temp2) do
            html = html:tag('div'):cssText(
                    'display:inline-block;width:50px;height:60px;margin:5px;position:relative;color:#fff;')
                :tag('div'):wikitext('[[文件:角色_' .. v['objectName'] .. '_头像.png|50px|link=同调者/' .. v['objectName'] .. ']]')
                :done()
                :tag('div'):cssText(
                    'position:absolute;bottom:0;right:4px;font-size:1.5rem;text-shadow: 2px 1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000, -1px -1px 2px #000;')
                :wikitext(v['count']):done()
                :done()
        end
        html = html:done():done()
    end
    if #temp3 > 0 then
        html = html:tag('tr')
            :tag('th'):cssText('width:150px;'):wikitext('潜能开发'):done()
            :done()
            :tag('tr')
            :tag('td'):addClass('mw-collapsible')
        for _i, v in ipairs(temp3) do
            html = html:tag('div'):cssText(
                    'display:inline-block;width:50px;height:60px;margin:5px;position:relative;color:#fff;')
                :tag('div'):wikitext('[[文件:角色_' .. v['objectName'] .. '_头像.png|50px|link=同调者/' .. v['objectName'] .. ']]')
                :done()
                :tag('div'):cssText(
                    'position:absolute;bottom:0;right:4px;font-size:1.5rem;text-shadow: 2px 1px 2px #000, 1px -1px 2px #000, -1px 1px 2px #000, -1px -1px 2px #000;')
                :wikitext(v['count']):done()
                :done()
        end
        html = html:done():done():done()
    end
    return html
end


-- 查询物品的活动用途
function p.use_activity(key, other_str)
    --查询商店兑换
    local dataList = require('Module:商店兑换数据库').store_exchange_data
    local outputData = {}
    for _i, v in ipairs(dataList) do
        if v['material_name'] == key and v['store_type'] == '活动商店' then
            table.insert(outputData, v)
        end
    end
    -- 拼接展示页面
    local html = mw.html.create()
    
    if #outputData == 0 then
        html = html:wikitext(other_str)
        return html
    end

    html = html:tag('table'):addClass('wikitable mw-collapsible'):cssText('width:100%;margin:0;text-align:center;')

    --生成表头
    html = html:tag('tr')
		            :tag('th'):wikitext('兑换商店'):done()
		            :tag('th'):wikitext('兑换物品'):done()
		            :tag('th'):wikitext('兑换数量'):done()
		            :tag('th'):wikitext('消耗数量'):done()
		            :tag('th'):wikitext('可兑换次数'):done()
		        :done()

    -- 生成表格
    for _i, v in ipairs(outputData) do
        html = html:tag('tr')
		                :tag('td'):wikitext(v['store_name']):done()
		                :tag('td'):wikitext(v['object_name']):done()
		                :tag('td'):wikitext(v['object_number']):done()
		                :tag('td'):wikitext(v['material_number']):done()
		                :tag('td'):wikitext(v['exchange_times']):done()
		            :done()
    end

    html = html:done()

    return html
end

return p