Модуль:Песочница/Pok: различия между версиями

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


local function buildCharacteristicsList(stationEvent)
local function buildCharacteristicsList(stationEvent)
     return stationEvent:expandTemplate{
     local lines = {}
         title = "Prototypes/Механика/Случайный события",
    local characteristics = {
         args = {
         {"Вес", "Вес события в системе случайных событий (чем выше, тем чаще случается)", stationEvent.weight},
            weight = stationEvent.weight or "",
         {"Мин. игроков", "Минимальное количество игроков для начала события", stationEvent.minimumPlayers},
            minimumPlayers = stationEvent.minimumPlayers or "",
        {"Время старта", "Время с которого событие может начаться", stationEvent.earliestStart and (stationEvent.earliestStart .. " сек.")},
            earliestStart = stationEvent.earliestStart and (stationEvent.earliestStart) or "",
        {"Длительность", "Длительность события в секундах", stationEvent.duration and (stationEvent.duration .. " сек.")}
            duration = stationEvent.duration and (stationEvent.duration) or ""
        }
     }
     }
    for _, char in ipairs(characteristics) do
        local value = char[3] or "нет"
        local tooltip = "{{AltTooltip|" .. char[1] .. "|" .. char[2] .. "}}"
        table.insert(lines, "- " .. tooltip .. ": " .. value)
    end
    return table.concat(lines, "<br>")
end
end