Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Combustion/data

From Stationeers Community Wiki

Documentation for this module may be created at Module:Combustion/data/doc

-- Load with mw.loadData.

local GasData = mw.loadData("Module:Gas/data")

local CombustionData={}

CombustionData.Hydrazine={
    FuelAmount=1,
    Outputs={{GasData.Pollutant, Amount = 4}}
    }
CombustionData.LiquidHydrazine = CombustionData.Hydrazine

CombustionData.Methane={
    Oxygen = {
        FuelAmount = 2,
        OxidizerAmount = 1,
        Outputs = {
            {GasData.Pollutant, Amount = 3},
            {GasData.CarbonDioxide, Amount = 6}
        }
    },

    NitrousOxide={
        FuelAmount=1,
        OxidizerAmount=1,
        Outputs={
            {GasData.CarbonDioxide, Amount = 2},
            {GasData.Nitrogen, Amount = 2}
        }
    },

    Ozone={
        FuelAmount=3,
        OxidizerAmount=2,
        Outputs={
             {GasData.Pollutant, Amount = 3},
             {GasData.CarbonDioxide, Amount = 6},
             {GasData.Steam, Amount = 1}
        }
    }
}
CombustionData.Methane.LiquidOxygen = CombustionData.Methane.Oxygen
CombustionData.Methane.LiquidNitrousOxide = CombustionData.Methane.NitrousOxide
CombustionData.Methane.LiquidOzone = CombustionData.Methane.Ozone
CombustionData.LiquidMethane = CombustionData.Methane


CombustionData.Hydrogen={
    Oxygen={
        FuelAmount=2,
        OxidizerAmount=1,
        Outputs={{GasData.Steam, Amount = 3}}
    },

    NitrousOxide={
        FuelAmount=1,
        OxidizerAmount=1,
        Outputs={
             {GasData.Steam, Amount = 1},
             {GasData.Nitrogen, Amount = 2}
        }
    },

    Ozone={
        FuelAmount=3,
        OxidizerAmount=1,
        Outputs={{GasData.Steam, Amount = 4}}
    },
}

CombustionData.Hydrogen.LiquidOxygen = CombustionData.Hydrogen.Oxygen
CombustionData.Hydrogen.LiquidNitrousOxide = CombustionData.Hydrogen.NitrousOxide
CombustionData.Hydrogen.LiquidOzone = CombustionData.Methane.Ozone
CombustionData.LiquidHydrogen = CombustionData.Hydrogen

CombustionData.LiquidAlcohol={
    Oxygen={
        FuelAmount = 1,
        OxidizerAmount = 3,
        Outputs = {
            {GasData.CarbonDioxide, Amount = 4},
            {GasData.Steam, Amount = 2}
        }
    },

    NitrousOxide={
        FuelAmount = 1,
        OxidizerAmount = 2,
        Outputs = {
            {GasData.Nitrogen, Amount = 4},
            {GasData.Steam, Amount = 2}
        }
    },

    Ozone={
        FuelAmount = 1,
        OxidizerAmount = 2,
        Outputs = {
            {GasData.CarbonDioxide, Amount = 1},
            {GasData.Steam, Amount = 3}
        }
    }
}
CombustionData.LiquidAlcohol.LiquidOxygen = CombustionData.LiquidAlcohol.Oxygen
CombustionData.LiquidAlcohol.LiquidNitrousOxide = CombustionData.LiquidAlcohol.NitrousOxide
CombustionData.LiquidAlcohol.LiquidOzone = CombustionData.LiquidAlcohol.Ozone

-- references to GasData include a metatable failing mw.loadData, so we're doing a deep copy of the table to strip them

local function DeepCopy(OriginalTable, seen)
    seen = seen or {} -- Table to track visited tables for circular references
    if type(OriginalTable) ~= 'table' then
        return OriginalTable
    end
    if seen[OriginalTable] then
        return seen[OriginalTable]
    end

    local NewTable = {}
    seen[OriginalTable] = NewTable

    for k, v in pairs(OriginalTable) do
        NewTable[k] = DeepCopy(v, seen) -- Recursively copy nested tables
    end

    return NewTable
end

CombustionData = DeepCopy(CombustionData)

return CombustionData