FANDOM


local p = {}
local skill_data = mw.loadData('Module:skill.data')

function cat_link(m)
    if m ~= nil then return '[[Category:' .. m .. ']]' else return '' end
end

function p.skill_1(frame)
    local sid = frame.args[1]
    local lv = frame.args[2] or 0
    local rnd = frame.args[3] or 0
    local list = frame.args[4] or 0
    local res = {}
    local res_list = {}
    local attr = {'2', '1', '3', '4'}
    local attr2 = {'光', '火', '水', '暗'}

    --if lv == nil then lv = 0 end
    --if rnd == nil then rnd = 0 end

    if rnd == 0 then
         if skill_data[sid][3] == -1 then
            res[#res+1] = '常駐/' .. cat_link('常駐型技能')
            res_list[#res_list+1] = '<td>常駐</td><td>-</td>'
        elseif skill_data[sid][3] == 1 then
            res[#res+1] = '開戰' .. skill_data[sid][11+lv] .. '%/' .. cat_link('開戰發動型技能')
            res_list[#res_list+1] = '<td>開戰</td><td>' .. skill_data[sid][12] .. '%</td>'
        elseif skill_data[sid][3] == 2 then
            if skill_data[sid][7] == 5 then
                res[#res+1] = '困境' .. skill_data[sid][11+lv] .. '%/' .. cat_link('困境發動型技能')
                res_list[#res_list+1] = '<td>困境</td><td>' .. skill_data[sid][12] .. '%</td>'
            else
                if skill_data[sid][11+lv] == 100 then
                    res[#res+1] = '回合結束時/' .. cat_link('強制發動型技能')
                    res_list[#res_list+1] = '<td>回合結束時</td><td>-</td>'
                else
                    res[#res+1] = '隨時' .. skill_data[sid][11+lv] .. '%/' .. cat_link('隨時發動型技能')
                    res_list[#res_list+1] = '<td>隨時</td><td>' .. skill_data[sid][12] .. '%</td>'
                end
            end
        elseif skill_data[sid][3] == 3 then
            res[#res+1] = '行動後' .. skill_data[sid][11+lv] .. '%/'
            res_list[#res_list+1] = '<td>行動後</td><td>' .. skill_data[sid][12] .. '%</td>'
            res[#res+1] = cat_link('強制發動型技能')
        else
            res[#res+1] = '?/'
            res_list[#res_list+1] = '<td>?</td><td></td>'
        end
     end

    res_list[#res_list+1] = '<td>'
    if skill_data[sid][23] == -1 then
        res_list[#res_list+1] = '-'
    elseif skill_data[sid][23] == 1 then
        if skill_data[sid][24] ~= 9 then
            if skill_data[sid][2] ~= 3 then res[#res+1] = '我' end
            if skill_data[sid][2] ~= 3 then res_list[#res_list+1] = '我' end
        end
    elseif skill_data[sid][23] == 2 then
        res[#res+1] = '敵'
        res_list[#res_list+1] = '敵'
    elseif skill_data[sid][23] == 3 then
        res[#res+1] = '雙方'
        res_list[#res_list+1] = '雙方'
    else
        res[#res+1] = '?/'
        res_list[#res_list+1] = '?'
    end

    if skill_data[sid][24] == 1 or skill_data[sid][24] == 12 or skill_data[sid][24] == 17 then
        res[#res+1] = '全/'
        res_list[#res_list+1] = '全'
    elseif skill_data[sid][24] == 2 then
        res[#res+1] = '單(HP%↓) /'
        res_list[#res_list+1] = '單(HP%↓)'
    elseif skill_data[sid][24] == 3 or skill_data[sid][24] == 8 or skill_data[sid][24] == 13 or skill_data[sid][24] == 16  or skill_data[sid][24] == 19 then
        res[#res+1] = '單/'
        res_list[#res_list+1] = '單'
    elseif skill_data[sid][24] == 9 then
        if skill_data[sid][2] == 3 then
            res[#res+1] = '敵全/'
            res_list[#res_list+1] = '敵全'
        else
            if skill_data[sid][15] == 36 then
                --if skill_data[sid][21] == -1 then
                --    res[#res+1] = '敵?/'
                --    res_list[#res_list+1] = '敵?'
                --elseif skill_data[sid][21] == 0 then
                    res[#res+1] = '??/'
                    res_list[#res_list+1] = '??'
                --end
            else
                res[#res+1] = '自身/'
                res_list[#res_list+1] = '自身'
            end
        end
    elseif skill_data[sid][24] == 10 then
        res[#res+1] = '[[file:attr_1_' .. attr[skill_data[sid][25]] .. '.png|18px|link=]]單/' .. cat_link('傷害/屬性限定') .. cat_link('傷害/'..attr2[skill_data[sid][25]]..'屬性限定')
        res_list[#res_list+1] = attr2[skill_data[sid][25]] .. '單'
    elseif skill_data[sid][24] == 14 then
        res[#res+1] = '[[file:attr_1_' .. attr[skill_data[sid][25]] .. '.png|18px|link=]]全/' .. cat_link('狀態/屬性限定') .. cat_link('狀態/'..attr2[skill_data[sid][25]]..'屬性限定')
        res_list[#res_list+1] = attr2[skill_data[sid][25]] .. '全'
    elseif skill_data[sid][24] == 20 then
        res[#res+1] = '隨/'
        res_list[#res_list+1] = '隨'
    end
    res_list[#res_list+1] = '</td>'

    if skill_data[sid][15] == 1 then
        if skill_data[sid][10] ~= 99 then res[#res+1] = '自身兵力' .. skill_data[sid][10] .. '%以下時,' end
        res[#res+1] = '兵力' .. skill_data[sid][21+lv] .. '%回復' .. cat_link('回復') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>回復</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 2 then
        res[#res+1] = skill_data[sid][21+lv] .. '%傷害' .. cat_link('傷害/無屬性') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '<td>傷害</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
        if skill_data[sid][21+lv] >= 1000 then res[#res+1] = cat_link('傷害/即死級') end
    elseif skill_data[sid][15] == 3 then
        res[#res+1] = '[[file:attr_1_' .. attr[skill_data[sid][16]] .. '.png|18px|link=]]' .. skill_data[sid][21+lv] .. '%傷害'
        res_list[#res_list+1] = '<td>傷害(' .. attr2[skill_data[sid][16]] .. ')</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
        if skill_data[sid][21+lv] >= 1000 then res[#res+1] = cat_link('傷害/即死級') end
    elseif skill_data[sid][15] == 4 then
        res[#res+1] = skill_data[sid][21+lv] .. '回合無法行動' .. cat_link('狀態/行動封鎖') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>行動封鎖</td><td>' .. skill_data[sid][22] .. '回</td><td></td><td></td>'
    elseif skill_data[sid][15] == 5 then
        res[#res+1] = '攻擊力' .. skill_data[sid][21+lv] .. '%上升' .. cat_link('狀態/攻擊力上升') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>攻擊力上升</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 6 then
        res[#res+1] = '攻擊力' .. skill_data[sid][21+lv] .. '%下降' .. cat_link('狀態/攻擊力下降') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>攻擊力下降</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 7 then
        res[#res+1] = '防禦力' .. skill_data[sid][21+lv] .. '%上升' .. cat_link('狀態/防禦力上升') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>防禦力上升</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 8 then
        res[#res+1] = '防禦力' .. skill_data[sid][21+lv] .. '%下降' .. cat_link('狀態/防禦力下降') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>防禦力下降</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 10 then
        res[#res+1] = '經驗值' .. skill_data[sid][21+lv] .. '%上升' .. cat_link('狀態/經驗值上升') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>經驗值上升</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 11 then
        res[#res+1] = '狀態消除' .. cat_link('狀態/狀態消除') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>狀態消除</td><td></td><td></td><td></td>'
    elseif skill_data[sid][15] == 12 then
        res[#res+1] = '完全復活' .. cat_link('復活') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>復活</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 13 then
        res[#res+1] = '[[file:attr_1_' .. attr[skill_data[sid][16]] .. '.png|18px|link=]]' .. skill_data[sid][21+lv] .. '%傷害/' .. skill_data[sid][17] .. '%吸收' .. cat_link('傷害/吸收')
        res_list[#res_list+1] = '<td>傷害(' .. attr2[skill_data[sid][16]] .. ')</td><td>' .. skill_data[sid][22] .. '%</td><td>吸收</td><td>' .. skill_data[sid][17] .. '%</td>'
        if skill_data[sid][21+lv] >= 1000 then res[#res+1] = cat_link('傷害/即死級') end
    elseif skill_data[sid][15] == 14 then
        res[#res+1] = skill_data[sid][21+lv] .. '%傷害/' .. skill_data[sid][17] .. '%吸收' .. cat_link('傷害/吸收') .. cat_link('傷害/無屬性') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '<td>傷害</td><td>' .. skill_data[sid][22] .. '%</td><td>吸收</td><td>' .. skill_data[sid][17] .. '%</td>'
        if skill_data[sid][21+lv] >= 1000 then res[#res+1] = cat_link('傷害/即死級') end
    elseif skill_data[sid][15] == 15 then
        res[#res+1] = skill_data[sid][21+lv] .. '%戰利品掉落' .. cat_link('戰利品掉落') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>戰利品掉落</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 16 then
        res[#res+1] = '技能發動' .. cat_link('狀態/技能發動') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>技能發動</td><td></td><td></td><td></td>'
    elseif skill_data[sid][15] == 17 then
        res[#res+1] = skill_data[sid][21+lv] .. '%傷害/' .. skill_data[sid][17] .. '%金幣轉換' .. cat_link('傷害/金幣轉換') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '<td>傷害</td><td>' .. skill_data[sid][22] .. '%</td><td>金幣轉換</td><td>' .. skill_data[sid][17] .. '%</td>'
    elseif skill_data[sid][15] == 20 then
        res[#res+1] = '討伐點數' .. skill_data[sid][21+lv] .. '%上升'
    elseif skill_data[sid][15] == 22 then
        res[#res+1] = '減少傷害' .. skill_data[sid][21+lv] .. '%/' .. skill_data[sid][18] .. '%反擊/' .. skill_data[sid][19] .. '次有效' .. cat_link('反擊') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '<td>減少傷害</td><td>' .. skill_data[sid][22] .. '%</td><td>反擊</td><td>' .. skill_data[sid][18] .. '%<br/>' .. skill_data[sid][19] .. '次有效</td>'
    elseif skill_data[sid][15] == 23 then
        if skill_data[sid][17] == 1 then
            res[#res+1] = '傷害性技能無效化' .. cat_link('技能無效化') .. cat_link('非傷害性技能')
            res_list[#res_list+1] = '<td>技能無效</td><td>傷害性</td><td></td><td></td>'
        elseif skill_data[sid][17] == 2 then
            res[#res+1] = '非傷害性技能無效化' .. cat_link('技能無效化') .. cat_link('非傷害性技能')
            res_list[#res_list+1] = '<td>技能無效</td><td>非傷害性</td><td></td><td></td>'
        elseif skill_data[sid][17] == 3 then
            res[#res+1] = '全技能無效化' .. cat_link('技能無效化') .. cat_link('非傷害性技能')
            res_list[#res_list+1] = '<td>技能無效</td><td>全技能</td><td></td><td></td>'
        end
    elseif skill_data[sid][15] == 24 then
        res[#res+1] = '攻擊力' .. skill_data[sid][21+lv] .. '%上升/防禦力' .. skill_data[sid][17] .. '%上升' .. cat_link('狀態/攻擊‧防禦上升') .. cat_link('狀態/攻擊力上升') .. cat_link('狀態/防禦力上升') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>攻擊力上升</td><td>' .. skill_data[sid][22] .. '%</td><td>防禦力上升</td><td>' .. skill_data[sid][17] .. '%</td>'
    elseif skill_data[sid][15] == 25 then
        res[#res+1] = '攻擊力' .. skill_data[sid][21+lv] .. '%下降/防禦力' .. skill_data[sid][17] .. '%下降' .. cat_link('狀態/攻擊‧防禦下降') .. cat_link('狀態/攻擊力下降') .. cat_link('狀態/防禦力下降') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>攻擊力下降</td><td>' .. skill_data[sid][22] .. '%</td><td>防禦力下降</td><td>' .. skill_data[sid][17] .. '%</td>'
    elseif skill_data[sid][15] == 26 then
        res[#res+1] = '完全復活/兵力完全回復' .. cat_link('復活') .. cat_link('回復') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>復活+回復</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 27 then
        res_list[#res_list+1] = '<td>傷害'
        if skill_data[sid][16] ~=-1 then
            res[#res+1] = '[[file:attr_1_' .. attr[skill_data[sid][16]] .. '.png|18px|link=]]'
            res_list[#res_list+1] = '(' .. attr2[skill_data[sid][16]] .. ')'
        end
        res[#res+1] = skill_data[sid][21+lv] .. '%傷害/' .. skill_data[sid][17] .. '回合無法行動' .. cat_link('傷害/行動封鎖') .. cat_link('狀態/行動封鎖') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '</td><td>' .. skill_data[sid][22] .. '%</td><td>行動封鎖</td><td>' .. skill_data[sid][17] .. '回</td>'
    elseif skill_data[sid][15] == 28 then
        res[#res+1] = skill_data[sid][21+lv] .. '%傷害/' .. skill_data[sid][17] .. '回合無法行動' .. cat_link('傷害/行動封鎖') .. cat_link('狀態/行動封鎖') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '<td>傷害</td><td>' .. skill_data[sid][22] .. '%</td><td>行動封鎖</td><td>' .. skill_data[sid][17] .. '回</td>'
    elseif skill_data[sid][15] == 30 then
        res[#res+1] = skill_data[sid][21+lv] .. '回合後無法戰鬥' .. cat_link('狀態/死亡宣告') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>死亡宣告</td><td>' .. skill_data[sid][22] .. '回</td><td></td><td></td>'
    elseif skill_data[sid][15] == 33 then
        res[#res+1] = '覺醒爆發' .. cat_link('狀態/覺醒爆發') .. cat_link('非傷害性技能')
        res_list[#res_list+1] = '<td>覺醒爆發</td><td></td><td></td><td></td>'
    elseif skill_data[sid][15] == 34 then
        res[#res+1] = skill_data[sid][21+lv] .. '%總攻擊' .. cat_link('合擊') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '<td>合擊</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 35 then
        res_list[#res_list+1] = '<td>合擊'
        if skill_data[sid][16] ~=-1 then
            res[#res+1] = '[[file:attr_1_' .. attr[skill_data[sid][16]] .. '.png|18px|link=]]'
            res_list[#res_list+1] = '(' .. attr2[skill_data[sid][16]] .. ')'
        end
        res[#res+1] = skill_data[sid][21+lv] .. '%總攻擊' .. cat_link('合擊') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    elseif skill_data[sid][15] == 36 then
        res[#res+1] = '隨機技能' .. cat_link('隨機技能')
        res_list[#res_list+1] = '<td>隨機技能</td><td></td><td></td><td></td>'
    elseif skill_data[sid][15] == 38 then
        res_list[#res_list+1] = '<td>連擊'
        if skill_data[sid][16] ~=-1 then
            res[#res+1] = '[[file:attr_1_' .. attr[skill_data[sid][16]] .. '.png|18px|link=]]'
            res_list[#res_list+1] = '(' .. attr2[skill_data[sid][16]] .. ')'
        end
        res[#res+1] = skill_data[sid][21+lv] .. '%傷害' .. skill_data[sid][17] .. '次' .. cat_link('連擊') .. cat_link('傷害性技能')
        res_list[#res_list+1] = '</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td>' .. skill_data[sid][17] .. '次</td>'
    elseif skill_data[sid][15] == 42 then
        res[#res+1] = '目標剩餘士兵數的' .. skill_data[sid][21+lv] .. '%傷害' .. cat_link('傷害性技能')
        res_list[#res_list+1] = '<td>傷害(殘)</td><td>' .. skill_data[sid][22] .. '%</td><td></td><td></td>'
    else
        res[#res+1] = '?'
        res_list[#res_list+1] = '<td>?</td><td>?</td><td>?</td><td>?</td>'
    end

    if skill_data[sid][3] == 3 then res[#res+1] = '/無視無效化' end

    if rnd == 0 then
        if skill_data[sid][3] == -1 then
            res[#res+1] = ''
            res_list[#res_list+1] = '<td>-</td>'
        elseif skill_data[sid][3] == 1 then
            res[#res+1] = '/一場1次'
            res_list[#res_list+1] = '<td>1</td>'
        else
            if skill_data[sid][4] == -1 then
                res[#res+1] = ''
                res_list[#res_list+1] = '<td>無限制</td>'
            else
                res[#res+1] = '/一場' .. skill_data[sid][4] .. '次'
                res_list[#res_list+1] = '<td>' .. skill_data[sid][4] .. '</td>'
            end
        end
    end

    if skill_data[sid][15] == 3 or skill_data[sid][15] == 13 or skill_data[sid][15] == 27 or skill_data[sid][15] == 35 or skill_data[sid][15] == 38 then
        if skill_data[sid][16] == 1 then
            res[#res+1] = cat_link('傷害/光屬性') .. cat_link('傷害性技能')
        elseif skill_data[sid][16] == 2 then
            res[#res+1] = cat_link('傷害/火屬性') .. cat_link('傷害性技能')
        elseif skill_data[sid][16] == 3 then
            res[#res+1] = cat_link('傷害/水屬性') .. cat_link('傷害性技能')
        elseif skill_data[sid][16] == 4 then
            res[#res+1] = cat_link('傷害/暗屬性') .. cat_link('傷害性技能')
        end
    end

    if list == 1 then
        return table.concat(res_list)
    else
        return table.concat(res)
    end
end

function p.skill_2(frame)
    local sid = frame.args[1]
    local res = {}
 
--    if sid == 202 or sid == 2076 then
    if skill_data[sid][8] == -1 and skill_data[sid][10] == 0 then
        res[#res+1] = '給予魔女' .. skill_data[sid][21] + 100 .. '%傷害' .. cat_link('魔女特攻卡')
    else
        if skill_data[sid][8] ~= -1 then
            res[#res+1] = '第' .. skill_data[sid][8] .. '期魔女戰<br/>'
            res[#res+1] = os.date("%Y/%m/%d", skill_data[sid][13]+28800) .. "~" .. os.date("%Y/%m/%d", skill_data[sid][14]+28800)
            if os.time() <= skill_data[sid][14] then
                res[#res+1] = cat_link('魔女特攻卡')
            else
                res[#res+1] = cat_link('魔女特攻卡(已過期)')
            end
        elseif skill_data[sid][15] == 39 or skill_data[sid][15] == 40 then
            res[#res+1] = '公會戰特攻卡<br/>'
            res[#res+1] = os.date("%Y/%m/%d", skill_data[sid][13]+28800) .. "~" .. os.date("%Y/%m/%d", skill_data[sid][14]+28800)
            if os.time() <= skill_data[sid][14] then
                res[#res+1] = cat_link('公會戰特攻卡')
            else
                res[#res+1] = cat_link('公會戰特攻卡(已過期)')
            end
        else
            res[#res+1] = p.skill_1{args={sid, 1, 0, 0}} .. cat_link('有附屬技能')
        end
    end
 
    return table.concat(res)
end

function p.skill_sp(frame)
    local sid = frame.args[1]
    local res = {}
 
    res[#res+1] = '隨時' .. skill_data[sid][11] .. '%/攻擊‧防禦‧兵力×' .. skill_data[sid][21] .. '%/<br/>持續' .. skill_data[sid][17] .. '回合'

    if skill_data[sid][4] ~= -1 then
        if skill_data[sid][3] == 1 then
            res[#res+1] = '/一場1次'
        else
            res[#res+1] = '/一場' .. skill_data[sid][4] .. '次'
        end
    end
 
    return table.concat(res)
end

function p.skill_rnd(frame)
    local sid = frame.args[1]
    local res = {}

    res[#res+1] = '隨機技能:' .. p.skill_1{args={skill_data[sid][16], 0, 1}}
    res[#res+1] = '<br/>     ' .. p.skill_1{args={skill_data[sid][17], 0, 1}}
    if p.skill_1{args={skill_data[sid][18], 0}} ~=-1 then res[#res+1] = '<br/>     ' .. p.skill_1{args={skill_data[sid][18], 0, 1}} end
    if p.skill_1{args={skill_data[sid][19], 0}} ~=-1 then res[#res+1] = '<br/>     ' .. p.skill_1{args={skill_data[sid][19], 0, 1}} end
    if p.skill_1{args={skill_data[sid][20], 0}} ~=-1 then res[#res+1] = '<br/>     ' .. p.skill_1{args={skill_data[sid][20], 0, 1}} end

    return table.concat(res)
end

return p

您使用了广告屏蔽软件!


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

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

查看其他FANDOM

随机维基