Crossout Вики
Advertisement
Crossout Вики
3642
страницы

Для документации этого модуля может быть создана страница Модуль:GetStat/doc

local p = {}
 
function p.getStat(f)
 
    Item=tostring(f.args[1])
    param=tostring(f.args[2])
    -- Item="Партизан"
    -- param="Тип"
    StatValue=""
    
    local cabins    = mw.loadData( 'Module:Stats/cabins' )
    local cores     = mw.loadData( 'Module:Stats/cores' )
    local decorum   = mw.loadData( 'Module:Stats/decorum' )
    local melee     = mw.loadData( 'Module:Stats/melee' )
    local structure = mw.loadData( 'Module:Stats/structure' )
    local summons   = mw.loadData( 'Module:Stats/summons' )
    local weapons   = mw.loadData( 'Module:Stats/weapons' )
    local wheels    = mw.loadData( 'Module:Stats/wheels' )

    if cabins[Item] ~= nil then
        if cabins[Item][param] ~= nil then
            StatValue=cabins[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end 
    elseif cores[Item] ~= nil then
        if cores[Item][param] ~= nil then
            StatValue=cores[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end    
    elseif decorum[Item] ~= nil then
        if decorum[Item][param] ~= nil then
            StatValue=decorum[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end    
    elseif melee[Item] ~= nil then
        if melee[Item][param] ~= nil then
            StatValue=melee[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end    
    elseif structure[Item] ~= nil then
        if structure[Item][param] ~= nil then
            StatValue=structure[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end    
    elseif summons[Item] ~= nil then
        if summons[Item][param] ~= nil then
            StatValue=summons[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end    
    elseif weapons[Item] ~= nil then
        if weapons[Item][param] ~= nil then
            StatValue=weapons[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end    
    elseif wheels[Item] ~= nil then
        if wheels[Item][param] ~= nil then
            StatValue=wheels[Item][param] 
        else
            StatValue="Не найдет такой параметр"  
        end    
    else
        StatValue="Не найдет предмет с таким названием"  
    end 

    return StatValue

end

function p.getParam(f)
    for i = 1, f.args, 1 do
        scope = scope + 1
    end
    
    return scope
end

return p
Advertisement