Модуль:Prototypes/Хранилище/Предмет: различия между версиями

мНет описания правки
мНет описания правки
Строка 206: Строка 206:


     local result = {}
     local result = {}
    local classesRolls, classesProb


     if wrapped then
     if wrapped then
         if nestedSelector.rolls and nestedSelector.rolls.range then
         if nestedSelector.rolls and nestedSelector.rolls.range then
             local classesRolls = processRolls(nestedSelector.rolls)
             classesRolls = processRolls(nestedSelector.rolls)
         end
         end
         if nestedSelector.prob then
         if nestedSelector.prob then
             local classesProb = string.format(" <div>%s%%</div>", content.prob * 100 >= 1 and math.floor(content.prob * 100) or content.prob * 100)
             classesProb = string.format(" <div>%s%%</div>", nestedSelector.prob * 100 >= 1 and math.floor(nestedSelector.prob * 100) or nestedSelector.prob * 100)
         end
         end
     end
     end


     if wrapped and classesRolls and classesProb > 0 then
     if wrapped and classesRolls and classesProb then
         result[#result + 1] = string.format('{{LinkСard/Сollapsible|name=Группа %s%s|content=', classesRolls, classesProb)
         result[#result + 1] = string.format('{{LinkСard/Сollapsible|name=Группа %s%s|content=', classesRolls, classesProb)
     end
     end
Строка 222: Строка 224:
     result[#result + 1] = getTableOutput(nestedSelector.tableId)
     result[#result + 1] = getTableOutput(nestedSelector.tableId)


     if wrapped and classesRolls and classesProb > 0 then
     if wrapped and classesRolls and classesProb then
         result[#result + 1] = "}}"
         result[#result + 1] = "}}"
     end
     end