FANDOM


local p = {}
 
local base  = require("Module:Base")
local icon  = require("Module:Icon")
local hero  = require("Module:Hero")
 
local skill_data    = mw.loadData('Module:Skill.data')
local spskill_data  = mw.loadData('Module:Spskill.data')
 
 
function p.test()
    mw.log(hero.is_hero('光明剑士里昂'))
end
 
-- 技能图鉴(区分是什么技能然后调用对应函数处理)
function p.info(frame)
    local name = frame.args[1] or ''
    if skill_data[name] then
        return skillinfo(name)
    elseif spskill_data[name] then
        return spskillinfo(name)
    else
        return '技能名错误'
    end
end
 
-- 方块技能图鉴
function skillinfo(name)
    comment_name, comment = base.load_comment(name)
 
    local output_text = {}
    output_text[#output_text+1] = '<table class="skill_table">'
    output_text[#output_text+1] = '<tr><td class="image" rowspan="2">[[File:'..name..'.png|51px]]</td>'
    output_text[#output_text+1] = '<td class="name">'..name..'</td></tr>'
    output_text[#output_text+1] = '<tr><td class="type"><span style="font-weight:bold">所属职业:</span>'..icon.class({args={skill_data[name]['c'], 'l', true}})
    output_text[#output_text+1] = '  <span style="font-weight:bold">技能类型:</span>'..skill_data[name]['t']..'</td></tr>'
    output_text[#output_text+1] = '<tr><td class="item">描述</td><td class="content">'..skill_data[name]['e']..'</td></tr>'
    output_text[#output_text+1] = '<tr><td class="item">说明</td><td class="content">'..base.get_comment(comment, '技能说明', true, comment_name)..'</td></tr>'
    output_text[#output_text+1] = '</table>'
 
    output_text[#output_text+1] = base.cate('技能', skill_data[name]['c'])
    output_text[#output_text+1] = base.cate(skill_data[name]['c']..'技能', skill_data[name]['t'])
    output_text[#output_text+1] = base.cate('技能:'..skill_data[name]['t'], skill_data[name]['c'])
 
    return table.concat(output_text)
end
 
-- SP技能图鉴
function spskillinfo(name)
    comment_name, comment = base.load_comment(name)
 
    local output_text = {}
 
    output_text[#output_text+1] = '<table class="skill_table" style="width:100%">'
    output_text[#output_text+1] = '<tr><td class="image" rowspan="2">[[File:'..name..'.png|51px]]</td>'
    output_text[#output_text+1] = '<td class="name" colspan="2">'..name..'</td></tr>'
    output_text[#output_text+1] = '<tr><td class="type" colspan="2"><span style="font-weight:bold">所属职业:</span>'..icon.class({args={spskill_data[name]['c'], 'l', true}})
    output_text[#output_text+1] = '  <span style="font-weight:bold">技能类型:</span>'..spskill_data[name]['t']..'</td></tr>'
    local max_level = 5
    if spskill_data[name]['lv4'] == '' then
        max_level = 3
    end
    for i = 1,max_level do
        local level = i
        if i == max_level then
            level = 'MAX'
        end
        output_text[#output_text+1] = '<tr><td class="item">Lv '..level..'</td>'
        output_text[#output_text+1] = '<td class="content">'..spskill_data[name]['lv'..i]..'</td>'
 
        output_text[#output_text+1] = '<td class="content requires">'
        req = spskill_data[name]['lv'..i..'r']
        if hero.is_hero(req) then
            output_text[#output_text+1] = '获得 '..hero.icon{args={req, 'm', 'name'}}
        else
            output_text[#output_text+1] = spskill_data[name]['lv'..i..'r']
        end
        output_text[#output_text+1] = '</td></tr>'
    end
    output_text[#output_text+1] = '<tr><td class="item">说明</td><td class="content" colspan="2">'..base.get_comment(comment, '技能说明', true, comment_name)..'</td></tr>'
    output_text[#output_text+1] = '</table>'
 
    output_text[#output_text+1] = base.cate('特殊技能', spskill_data[name]['c'])
    output_text[#output_text+1] = base.cate(spskill_data[name]['c']..'特殊技能', spskill_data[name]['t'])
    output_text[#output_text+1] = base.cate('特殊技能:'..spskill_data[name]['t'], spskill_data[name]['c'])
 
    return table.concat(output_text)
end
 
return p

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

查看其他FANDOM

随机维基