ФЭНДОМ


local monsterInfobox = {}
 
function monsterInfobox.Grow(val)
    local form = ""
    local data = mw.text.split(val.args[1], "[,%s]+")
    for k, v in ipairs(data) do
        local ldata = mw.text.split(v, "-")
        local ltype = string.gsub(ldata[1], "%d+", "")
        local lvl = string.gsub(ldata[1], "[^%d]+", "")
        local less = {}
        local lstats = {}
 
        if lvl == '1' then
            lstats[1] = 'Low'
            lstats[2] = 'Малая'
        elseif lvl == '2' then
            lstats[1] = 'Mid'
            lstats[2] = 'Средняя'
        elseif lvl == '3' then
            lstats[1] = 'High'
            lstats[2] = 'Высокая'
        else
            lstats[1] = '??'
            lstats[2] = '??'
        end
 
        if ltype == 'Ветер' or ltype == 'ветер' then
            less[1] = 'Ветра'
            less[2] = 'Wind'
        elseif ltype == 'Вода' or ltype == 'вода' then
            less[1] = 'Воды'
            less[2] = 'Water'
        elseif ltype == 'Огонь' or ltype == 'огонь' then
            less[1] = 'Огня'
            less[2] = 'Fire'
        elseif ltype == 'Свет' or ltype == 'свет' then
            less[1] = 'Света'
            less[2] = 'Light'
        elseif ltype == 'Тьма' or ltype == 'тьма' then
            less[1] = 'Тьмы'
            less[2] = 'Dark'
        elseif ltype == 'Магия' or ltype == 'магия' then
            less[1] = 'Магии'
            less[2] = 'Magic'
        else
            less[1] = '??'
            less[2] = '??'
        end
 
        form = form..
            '<div style="display:inline-block; border-radius:5px; position:relative; margin-left:5px;" title="'..lstats[2]..' эссенция '..less[1]..'">'..
                '<div style="overflow:hidden; width:35px; height:35px;">'..
                    '\[\[File:Essence of '..less[2]..' ('..lstats[1]..').png|35px|center|link=\]\]'..
                '</div>'..
                '<span style="position:absolute; right:0px; bottom:0px; font-size:14px; line-height:14px; font-weight:bold; color:white; padding: 0 5px; border-radius:5px 0 0 0; background-color:rgba(0,0,0,0.5);">'..
                    ldata[2]..
                '</span>'..
            '</div>'
    end
 
    return form
end
 
return monsterInfobox