lumber mill
This commit is contained in:
parent
df9b72e4fa
commit
08327e5269
1 changed files with 105 additions and 35 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
local Recipe = require("__cf-lib__/data/Recipe")
|
||||||
local Technology = require("__cf-lib__/data/Technology")
|
local Technology = require("__cf-lib__/data/Technology")
|
||||||
local LumberMillFactory = require(MF.buildings .. "LumberMill")
|
local LumberMillFactory = require(MF.buildings .. "LumberMill")
|
||||||
local LumberMill = LumberMillFactory()
|
local LumberMill = LumberMillFactory()
|
||||||
|
|
@ -13,68 +14,137 @@ data:extend({
|
||||||
|
|
||||||
local has_oxygen = data.raw["surface-property"]["oxygen"] ~= nil
|
local has_oxygen = data.raw["surface-property"]["oxygen"] ~= nil
|
||||||
|
|
||||||
LumberMill.EntityBuilder:new()
|
if not mods["wood-logistics"] then
|
||||||
:burnerEnergySource({ emissions_per_minute = { noise = 100 } })
|
LumberMill.EntityBuilder:new()
|
||||||
:baseProductivity(0.5)
|
:burnerEnergySource({ emissions_per_minute = { noise = 100 } })
|
||||||
:apply({
|
:baseProductivity(0.5)
|
||||||
crafting_categories = { "wood-processing" },
|
:apply({
|
||||||
|
crafting_categories = { "wood-processing" },
|
||||||
crafting_speed = 2,
|
crafting_speed = 2,
|
||||||
energy_usage = "1000kW",
|
energy_usage = "1000kW",
|
||||||
surface_conditions = {
|
surface_conditions = {
|
||||||
{
|
{
|
||||||
property = has_oxygen and "oxygen" or "pressure",
|
property = has_oxygen and "oxygen" or "pressure",
|
||||||
min = 3
|
min = 3
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property = "gravity",
|
property = "gravity",
|
||||||
min = 1
|
min = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
local lumber_mill_item = LumberMill.ItemBuilder:new()
|
local lumber_mill_item = LumberMill.ItemBuilder:new()
|
||||||
:apply({
|
:apply({
|
||||||
default_import_location = "lignumis",
|
default_import_location = "lignumis",
|
||||||
order = "2[lumber-mill]"
|
order = "2[lumber-mill]"
|
||||||
})
|
})
|
||||||
|
|
||||||
LumberMill.RecipeBuilder:new()
|
LumberMill.RecipeBuilder:new()
|
||||||
:ingredients(table.trim({
|
:ingredients(table.trim({
|
||||||
{ type = "item", name = "stone-brick", amount = 40 },
|
{ type = "item", name = "stone-brick", amount = 40 },
|
||||||
{ type = "item", name = "lumber", amount = 50 },
|
{ type = "item", name = "lumber", amount = 50 },
|
||||||
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
||||||
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 20 or 40 },
|
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 20 or 40 },
|
||||||
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 20 } or nil,
|
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 20 } or nil,
|
||||||
{ type = "item", name = "burner-assembling-machine", amount = 2 }
|
{ type = "item", name = "burner-assembling-machine", amount = 2 }
|
||||||
}))
|
}))
|
||||||
:apply({
|
:apply({
|
||||||
additional_categories = { "wood-processing" }
|
additional_categories = { "wood-processing" }
|
||||||
})
|
})
|
||||||
|
|
||||||
LumberMill.TechnologyBuilder:new()
|
LumberMill.TechnologyBuilder:new()
|
||||||
:prerequisites({ "steam-science-pack" })
|
:prerequisites({ "steam-science-pack" })
|
||||||
:count(250)
|
:count(250)
|
||||||
:time(15)
|
:time(15)
|
||||||
:ingredients({ { "wood-science-pack", 1 }, { "steam-science-pack", 1 } })
|
:ingredients({ { "wood-science-pack", 1 }, { "steam-science-pack", 1 } })
|
||||||
:apply()
|
:apply()
|
||||||
|
|
||||||
LumberMill.RecipeBuilder:new()
|
LumberMill.RecipeBuilder:new()
|
||||||
:ingredients({
|
:ingredients({
|
||||||
{ type = "item", name = "stone-brick", amount = 40 },
|
{ type = "item", name = "stone-brick", amount = 40 },
|
||||||
{ type = "item", name = "lumber", amount = 50 },
|
{ type = "item", name = "lumber", amount = 50 },
|
||||||
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
||||||
{ type = "item", name = "copper-plate", amount = basic_circuit_board and 20 or 40 },
|
{ type = "item", name = "copper-plate", amount = basic_circuit_board and 20 or 40 },
|
||||||
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 20 },
|
{ type = "item", name = basic_circuit_board and "basic-circuit-board" or "electronic-circuit", amount = 20 },
|
||||||
{ type = "item", name = "assembling-machine-1", amount = 2 }
|
{ type = "item", name = "assembling-machine-1", amount = 2 }
|
||||||
})
|
})
|
||||||
:apply({
|
:apply({
|
||||||
name = "lumber-mill-copper",
|
name = "lumber-mill-copper",
|
||||||
localised_name = { "entity-name.lumber-mill" },
|
localised_name = { "entity-name.lumber-mill" },
|
||||||
additional_categories = { "wood-processing" },
|
additional_categories = { "wood-processing" },
|
||||||
icons = {
|
icons = {
|
||||||
{ icon = lumber_mill_item.icon },
|
{ icon = lumber_mill_item.icon },
|
||||||
{ icon = basic_circuit_board and "__base__/graphics/icons/copper-plate.png" or "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } }
|
{ icon = basic_circuit_board and "__base__/graphics/icons/copper-plate.png" or "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } }
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
Technology:new(basic_circuit_board and "copper-processing" or "electronics"):addRecipe("lumber-mill-copper")
|
Technology:new(basic_circuit_board and "copper-processing" or "electronics"):addRecipe("lumber-mill-copper")
|
||||||
|
else
|
||||||
|
table.assign(data.raw["assembling-machine"]["lumber-mill"], {
|
||||||
|
energy_source = {
|
||||||
|
type = "burner",
|
||||||
|
fuel_categories = { "chemical" },
|
||||||
|
effectivity = 1,
|
||||||
|
fuel_inventory_size = 3,
|
||||||
|
emissions_per_minute = { pollution = 10, noise = 100 },
|
||||||
|
},
|
||||||
|
crafting_categories = { "wood-processing" },
|
||||||
|
energy_usage = "1000kW",
|
||||||
|
module_slots = 4,
|
||||||
|
max_health = 500,
|
||||||
|
surface_conditions = {
|
||||||
|
{
|
||||||
|
property = has_oxygen and "oxygen" or "pressure",
|
||||||
|
min = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
property = "gravity",
|
||||||
|
min = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
data.raw.item["lumber-mill"].default_import_location = "lignumis"
|
||||||
|
|
||||||
|
table.assign(data.raw.recipe["lumber-mill"], {
|
||||||
|
additional_categories = { "wood-processing" },
|
||||||
|
ingredients = table.trim({
|
||||||
|
{ type = "item", name = "stone-brick", amount = 40 },
|
||||||
|
{ type = "item", name = "lumber", amount = 50 },
|
||||||
|
{ type = "item", name = "wooden-gear-wheel", amount = 50 },
|
||||||
|
{ type = "item", name = "gold-plate", amount = basic_circuit_board and 20 or 40 },
|
||||||
|
basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 20 } or nil,
|
||||||
|
{ type = "item", name = "burner-assembling-machine", amount = 2 }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
table.assign(data.raw.technology["advanced-carpentry"], {
|
||||||
|
prerequisites = { "steam-science-pack" },
|
||||||
|
unit = {
|
||||||
|
count = 250,
|
||||||
|
time = 15,
|
||||||
|
ingredients = {
|
||||||
|
{ "wood-science-pack", 1 },
|
||||||
|
{ "steam-science-pack", 1 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
Recipe:new("lumber-mill")
|
||||||
|
:clone("lumber-mill-copper")
|
||||||
|
:assign({
|
||||||
|
localised_name = { "entity-name.lumber-mill" },
|
||||||
|
icons = {
|
||||||
|
{ icon = data.raw.item["lumber-mill"].icon },
|
||||||
|
{ icon = basic_circuit_board and "__base__/graphics/icons/copper-plate.png" or "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
:replaceIngredient("gold-plate", "copper-plate")
|
||||||
|
:apply()
|
||||||
|
|
||||||
|
Technology:new(basic_circuit_board and "copper-processing" or "electronics"):addRecipe("lumber-mill-copper")
|
||||||
|
end
|
||||||
|
|
||||||
|
Recipe:new("wooden-chest"):addCategory("wood-processing")
|
||||||
|
Recipe:new("small-electric-pole"):addCategory("wood-processing")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue