Minecraft Wiki
Advertisement
[создать | история | обновить]Документация
У этого модуля нет документации. Если вы знаете, как использовать этот модуль, пожалуйста, добавьте соответствующую информацию.
local p = {}

function p.calcenergy()
    local energy = args["Энергия"] or ""
    verste = args["Версия"] or ""
    if energy == "" then
        unitlnk = ""
        unit = ""
    elseif verste >= "3" or verste == "" then
        unitlnk = "[[Redstone Flux|RF]]"
        unit = "RF"
    else
        unitlnk = "[[Minecraft Joules|MJ]]"
        unit = "MJ"
    end
    energyText = "<span title=\"Требуемая энергия, " .. energy .. " " .. unit .. ".\" " ..
                     "style=\"font-family: Minecraft-ru; cursor: help\">" .. energy .. " " .. unitlnk .. "</span>"
    if verste == "" then
        descText = "[[Thermal Expansion/" .. machine .. "|" .. machine .. "]]"
    else
        descText = "[[Thermal Expansion " .. verste .. "/" .. machine .. "|" .. machine .. "]]"
    end

    return verste, energyText, descText
end

function p.fluidTransposer(f)
    machine = "Распределитель жидкости"
    args = require("Модуль:ProcessArgs").norm()
    p.calcenergy()
    local mod = args["Мод"] or ""
    local mode = args["Режим"] or "1"
    local containerin = args["Вход"]
    local containerout = args["Выход"]
    local liquid = args["Жидкость"]
    local volume = args["Объём"] or ""

    if mode == "1" then
        progressImage = "[[Файл:Процесс наполнения (Thermal Expansion 5).gif|link=]]"
        modeImage = "[[Файл:Режим наполнения (Thermal Expansion 5).png|link=]]"
    else
        progressImage = "[[Файл:Процесс плавления (Thermal Expansion 5).gif|link=]]"
        modeImage = "[[Файл:Режим опустошения (Thermal Expansion 5).png|link=]]"
    end

    local descStyle = "font-family: Minecraft-ru; text-align: center; width:280px; font-size: 15px; color: black"
    local volumeText = "<span title=\"Объём жидкости, " .. volume .. " В.\" " ..
                           "style=\"font-family: Minecraft-ru; cursor: help\">" .. volume .. " В</span>"

    local cg = require("Модуль:Cg")
    local cgSlot = cg.slot
    local cgText = cg.text
    local cgliquidSlot = cg.liquidSlot

    local output = {}

    -- указание размеров подложки
    table.insert(output, cg.begin({280, 168}))
    table.insert(output, cg.backgroundImage(
        {"Элементы интерфейса распределителя жидкости (Thermal Expansion 3).png"}))

    if verste <= "3" then
        table.insert(output, cgSlot({
            containerin,
            86,
            50,
            mod = mod
        }))
    else
        table.insert(output, cgSlot({
            containerin,
            14,
            50,
            mod = mod
        }))
    end

    table.insert(output, cgSlot({
        containerout,
        86,
        110,
        class2 = "invslot-plain",
        mod = mod
    }))
    table.insert(output, cgliquidSlot({
        liquid,
        230,
        40,
        volume = volume
    }))
    table.insert(output, cg.image({progressImage, 152, 52}))
    table.insert(output, cg.image({modeImage, 160, 112}))
    table.insert(output, cgText({
        descText,
        0,
        8,
        style = descStyle
    }))
    table.insert(output, cgText({
        volumeText,
        130,
        28,
        style = "width: 100px; text-align: center; color: black"
    }))
    table.insert(output, cgText({
        energyText,
        130,
        84,
        style = "width: 100px; text-align: center; color: black"
    }))
    table.insert(output, cg.footer())

    return table.concat(output)
end

function p.magmaCrucible(f)
    machine = "Магмовый тигель"
    args = require("Модуль:ProcessArgs").norm()
    p.calcenergy()
    local mod = args["Мод"] or ""
    local cellIn1 = args["Вход"]
    local cellOut1 = args["Выход"]
    local volume = args["Объём"] or ""
    local progressImage = "[[Файл:Процесс плавления (Thermal Expansion 5).gif|link=]]"

    local descStyle = "font-family: Minecraft-ru; text-align: center; width:256px; color: black"
    local volumeText = "<span title=\"Полученный объём жидкости, " .. volume .. " В.\" " ..
                           "style=\"font-family: Minecraft-ru; cursor: help\">" .. volume .. " В</span>"

    local cg = require("Модуль:Cg")
    local cgSlot = cg.slot
    local cgText = cg.text
    local cgliquidSlot = cg.liquidSlot

    local output = {}

    -- указание размеров подложки
    table.insert(output, cg.begin({256, 168}))
    table.insert(output, cg.backgroundImage(
        {"Элементы интерфейса магмового тигля (Thermal Expansion).png"}))
    table.insert(output, cgSlot({
        cellIn1,
        14,
        64,
        mod = mod
    }))
    table.insert(output, cgliquidSlot({
        cellOut1,
        206,
        40,
        volume = volume
    }))
    table.insert(output, cg.image({progressImage, 110, 82}))
    table.insert(output, cgText({
        descText,
        0,
        8,
        style = descStyle
    }))
    table.insert(output, cgText({
        volumeText,
        74,
        54,
        style = "width: 120px; text-align: center; color: black"
    }))
    table.insert(output, cgText({
        energyText,
        74,
        116,
        style = "width: 120px; text-align: center; color: black"
    }))
    table.insert(output, cg.footer())

    return table.concat(output)
end

function p.inductionSmelter(f)
    machine = "Индукционная плавильня"
    args = require("Модуль:ProcessArgs").norm()
    p.calcenergy()
    local mod = args["Мод"] or ""
    local cellIn1 = args["Вход"]
    local cellIn2 = args["Вход2"]
    local cellOut1 = args["Выход"]
    local cellOut2 = args["Выход2"]
    local chance = args["Шанс"] or ""
    local progressImage = "[[Файл:layout Furnace Progress.gif|link=]]"

    if verste <= "3" then
        backgroundImageVar = "Элементы индукционной плавильни 1 (Thermal Expansion).png"
    elseif verste == "4" then
        backgroundImageVar = "Элементы индукционной плавильни 2 (Thermal Expansion).png"
    else
        backgroundImageVar = "Элементы индукционной плавильни 3 (Thermal Expansion).png"
    end

    local descStyle = "font-family: Minecraft-ru; text-align: center; width:276px; color: black"
    local chanceText = "<span title=\"Шанс получения побочного продукта, " .. chance ..
                           ".\" " .. "style=\"font-family: Minecraft-ru; cursor: help\">" .. chance .. "</span>"

    local cg = require("Модуль:Cg")
    local cgSlot = cg.slot
    local cgText = cg.text

    local output = {}

    -- указание размеров подложки
    table.insert(output, cg.begin({276, 154}))
    table.insert(output, cg.backgroundImage({backgroundImageVar}))
    table.insert(output, cgSlot({
        cellIn1,
        14,
        50,
        mod = mod
    }))
    table.insert(output, cgSlot({
        cellIn2,
        62,
        50,
        mod = mod
    }))
    table.insert(output, cgSlot({
        cellOut1,
        182,
        50,
        class2 = "invslot-plain",
        mod = mod
    }))
    table.insert(output, cgSlot({
        cellOut2,
        182,
        104,
        mod = mod
    }))
    table.insert(output, cg.image({progressImage, 112, 68}))
    table.insert(output, cgText({
        descText,
        0,
        8,
        style = descStyle
    }))
    table.insert(output, cgText({
        chanceText,
        218,
        108,
        style = "width: 52px; text-align: center; color: black"
    }))
    table.insert(output, cgText({
        energyText,
        6,
        118,
        style = "width: 106px; text-align: center; color: black"
    }))
    table.insert(output, cg.footer())

    return table.concat(output)
end

function p.pulverizer(f)
    machine = "Измельчитель"
    args = require("Модуль:ProcessArgs").norm()
    p.calcenergy()
    local mod = args["Мод"] or ""
    local cellIn1 = args["Вход"]
    local cellOut1 = args["Выход"]
    local cellOut2 = args["Выход2"]
    local chance = args["Шанс"] or ""
    local progressImage = "[[Файл:layout Furnace Progress.gif|link=]]"

    if verste == "5" or verste == "" then
        backgroundImageVar = "Элементы интерфейса измельчителя 2 (Thermal Expansion).png"
    else
        backgroundImageVar = "Элементы интерфейса измельчителя 1 (Thermal Expansion).png"
    end

    local descStyle = "font-family: Minecraft-ru; text-align: center; width:228px; color: black"
    local chanceText = "<span title=\"Шанс получения побочного продукта, " .. chance ..
                           ".\" " .. "style=\"font-family: Minecraft-ru; cursor: help\">" .. chance .. "</span>"

    local cg = require("Модуль:Cg")
    local cgSlot = cg.slot
    local cgText = cg.text

    local output = {}

    -- указание размеров подложки
    table.insert(output, cg.begin({228, 154}))
    table.insert(output, cg.backgroundImage({backgroundImageVar}))
    table.insert(output, cgSlot({
        cellIn1,
        14,
        50,
        mod = mod
    }))
    table.insert(output, cgSlot({
        cellOut1,
        134,
        50,
        class2 = "invslot-plain",
        mod = mod
    }))
    table.insert(output, cgSlot({
        cellOut2,
        134,
        104,
        mod = mod
    }))
    table.insert(output, cg.image({progressImage, 64, 68}))
    table.insert(output, cgText({
        descText,
        0,
        8,
        style = descStyle
    }))
    table.insert(output, cgText({
        chanceText,
        168,
        108,
        style = "width: 52px; text-align: center; color: black"
    }))
    table.insert(output, cgText({
        energyText,
        44,
        108,
        style = "width: 90px; text-align: center; color: black"
    }))
    table.insert(output, cg.footer())

    return table.concat(output)
end

function p.sawmill(f)
    machine = "Лесопилка"
    args = require("Модуль:ProcessArgs").norm()
    p.calcenergy()
    local mod = args["Мод"] or ""
    local cellIn1 = args["Вход"]
    local cellOut1 = args["Выход"]
    local cellOut2 = args["Выход2"]
    local chance = args["Шанс"] or ""
    local progressImage = "[[Файл:layout Furnace Progress.gif|link=]]"

    local descStyle = "font-family: Minecraft-ru; text-align: center; width:228px; color: black"
    local chanceText = "<span title=\"Шанс получения побочного продукта, " .. chance ..
                           ".\" " .. "style=\"font-family: Minecraft-ru; cursor: help\">" .. chance .. "</span>"

    if verste == "5" or verste == "" then
        backgroundImageVar = "Элементы интерфейса лесопилки 2 (Thermal Expansion).png"
    else
        backgroundImageVar = "Элементы интерфейса лесопилки 1 (Thermal Expansion).png"
    end

    local cg = require("Модуль:Cg")
    local cgSlot = cg.slot
    local cgText = cg.text

    local output = {}

    -- указание размеров подложки
    table.insert(output, cg.begin({228, 154}))
    table.insert(output, cg.backgroundImage({backgroundImageVar}))
    table.insert(output, cgSlot({
        cellIn1,
        14,
        50,
        mod = mod
    }))
    table.insert(output, cgSlot({
        cellOut1,
        134,
        50,
        class2 = "invslot-plain",
        mod = mod
    }))
    table.insert(output, cgSlot({
        cellOut2,
        134,
        104,
        mod = mod
    }))
    table.insert(output, cg.image({progressImage, 64, 68}))
    table.insert(output, cgText({
        descText,
        0,
        8,
        style = descStyle
    }))
    table.insert(output, cgText({
        chanceText,
        168,
        108,
        style = "width: 52px; text-align: center; color: black"
    }))
    table.insert(output, cgText({
        energyText,
        44,
        108,
        style = "width: 90px; text-align: center; color: black"
    }))
    table.insert(output, cg.footer())
    return table.concat(output)
end

return p
Advertisement