diff --git a/lignumis/prototypes/content/noise.lua b/lignumis/prototypes/content/noise.lua index 4474df5..0505138 100644 --- a/lignumis/prototypes/content/noise.lua +++ b/lignumis/prototypes/content/noise.lua @@ -100,17 +100,17 @@ emit("lab", "biolab", 20) emit("locomotive", "locomotive", 200) emit_constant("locomotive", "locomotive", 10) ---emit_constant("transport-belt", "wood-transport-belt", 2) +emit_constant("transport-belt", "wood-transport-belt", 2) emit_constant("transport-belt", "transport-belt", 3) emit_constant("transport-belt", "fast-transport-belt", 4) emit_constant("transport-belt", "express-transport-belt", 6) emit_constant("transport-belt", "turbo-transport-belt", 8) ---emit_constant("underground-belt", "wood-underground-belt", 7.5) +emit_constant("underground-belt", "wood-underground-belt", 7.5) emit_constant("underground-belt", "underground-belt", 10) emit_constant("underground-belt", "fast-underground-belt", 20) emit_constant("underground-belt", "express-underground-belt", 30) emit_constant("underground-belt", "turbo-underground-belt", 40) ---emit_constant("splitter", "wood-splitter", 20) +emit_constant("splitter", "wood-splitter", 20) emit_constant("splitter", "splitter", 30) emit_constant("splitter", "fast-splitter", 40) emit_constant("splitter", "express-splitter", 50) diff --git a/lignumis/prototypes/content/wood-logistics.lua b/lignumis/prototypes/content/wood-logistics.lua index 36048d4..a2eef43 100644 --- a/lignumis/prototypes/content/wood-logistics.lua +++ b/lignumis/prototypes/content/wood-logistics.lua @@ -1,104 +1,151 @@ local BeltFactory = require(MF.logistics .. "Belts") local Belt = BeltFactory("wood", "brown", "slow") +local Recipe = require("__cf-lib__/data/Recipe") +local Item = require("__cf-lib__/data/Item") local basic_circuit_board = settings.startup["lignumis-basic-circuit-board"].value -Belt.EntityBuilder:new() - :itemsPerSecond(7.5) - :nextTier("") - :undergroundDistance(4) - :animationSpeedMultiplier(1.01) - :apply({ - transportBelt = { - emissions_per_second = { noise = 2 / 60 } - }, - undergroundBelt = { - emissions_per_second = { noise = 7.5 / 60 }, - factoriopedia_simulation = { - init = - [[ - game.simulation.camera_position = {0, 0.5} - game.simulation.camera_zoom = 1.8 - game.surfaces[1].create_entities_from_blueprint_string - { - string = "0eNqVUNsKgzAM/Zc81+FEBfsrYwwvQQKaltpuivjvS3Wwh8HGnkKSc0tWaIaA1hF70CtMXNvEm6R31MV+Bl0oWECfNwXUGp5AXwRGPddDBHA9Imh4GNMlgTt0vTNSkwYHD5EjsznSrwqQPXnCQ2JvlhuHsUEnAPVdSoE1k7ANv2KlpyOYVLHpyGF7bHMFfrFRidiGGOLDLPvXLP9tZoLf3eRO8jjK5P1YBXd0004oyqzKq6ooqzLNinLbnvlmf6E=", - position = {-0.5, 0} +if not mods["wood-logistics"] then + Belt.EntityBuilder:new() + :itemsPerSecond(7.5) + :nextTier("") + :undergroundDistance(4) + :animationSpeedMultiplier(1.01) + :apply({ + transportBelt = { + emissions_per_second = { noise = 2 / 60 } + }, + undergroundBelt = { + emissions_per_second = { noise = 7.5 / 60 }, + factoriopedia_simulation = { + init = + [[ + game.simulation.camera_position = {0, 0.5} + game.simulation.camera_zoom = 1.8 + game.surfaces[1].create_entities_from_blueprint_string + { + string = "0eNqVUNsKgzAM/Zc81+FEBfsrYwwvQQKaltpuivjvS3Wwh8HGnkKSc0tWaIaA1hF70CtMXNvEm6R31MV+Bl0oWECfNwXUGp5AXwRGPddDBHA9Imh4GNMlgTt0vTNSkwYHD5EjsznSrwqQPXnCQ2JvlhuHsUEnAPVdSoE1k7ANv2KlpyOYVLHpyGF7bHMFfrFRidiGGOLDLPvXLP9tZoLf3eRO8jjK5P1YBXd0004oyqzKq6ooqzLNinLbnvlmf6E=", + position = {-0.5, 0} + } + ]] } - ]] + }, + splitter = { + emissions_per_second = { noise = 20 / 60 } } - }, - splitter = { - emissions_per_second = { noise = 20 / 60 } - } - }) + }) -local splitter_item = Belt.ItemBuilder:new() - :itemsPerRocket("transportBelt", 200) - :itemsPerRocket("undergroundBelt", 100) - :itemsPerRocket("splitter", 100) - :order("0") - :apply() - .splitter + local splitter_item = Belt.ItemBuilder:new() + :itemsPerRocket("transportBelt", 200) + :itemsPerRocket("undergroundBelt", 100) + :itemsPerRocket("splitter", 100) + :order("0") + :apply() + .splitter -Belt.RecipeBuilder:new() - :beltAmount(2) - :ingredients("transportBelt", { - { type = "item", name = "lumber", amount = 1 }, - { type = "item", name = "wooden-gear-wheel", amount = 1 } - }) - :ingredients("undergroundBelt", { - { type = "item", name = "lumber", amount = 1 }, - { type = "item", name = "wood-transport-belt", amount = 4 }, - }) - :ingredients("splitter", { - { type = "item", name = "wood-transport-belt", amount = 2 }, - { type = "item", name = "lumber", amount = 2 }, - basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 5 } or - { type = "item", name = "gold-cable", amount = 10 } - }) - :apply({ - transportBelt = { + Belt.RecipeBuilder:new() + :beltAmount(2) + :ingredients("transportBelt", { + { type = "item", name = "lumber", amount = 1 }, + { type = "item", name = "wooden-gear-wheel", amount = 1 } + }) + :ingredients("undergroundBelt", { + { type = "item", name = "lumber", amount = 1 }, + { type = "item", name = "wood-transport-belt", amount = 4 }, + }) + :ingredients("splitter", { + { type = "item", name = "wood-transport-belt", amount = 2 }, + { type = "item", name = "lumber", amount = 2 }, + basic_circuit_board and { type = "item", name = "basic-circuit-board", amount = 5 } or + { type = "item", name = "gold-cable", amount = 10 } + }) + :apply({ + transportBelt = { + additional_categories = { "wood-processing" } + }, + undergroundBelt = { + additional_categories = { "wood-processing" } + }, + splitter = { + additional_categories = { "wood-processing" } + } + }) + + Belt.TechnologyBuilder:new() + :prerequisites({ "wood-science-pack" }) + :ingredients({ { "wood-science-pack", 1 } }) + :count(10) + :time(10) + :apply() + + if not basic_circuit_board then + data:extend({ + Belt.RecipeBuilder:new() + :ingredients("splitter", { + { type = "item", name = "wood-transport-belt", amount = 2 }, + { type = "item", name = "lumber", amount = 2 }, + { type = "item", name = "electronic-circuit", amount = 2 } + }) + :build({ + splitter = { + name = "wood-splitter-electronic-circuit", + localised_name = { "entity-name.wood-splitter" }, + icons = { + { icon = splitter_item.icon }, + { icon = "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } } + }, + additional_categories = { "wood-processing" } + } + }) + .splitter + }) + + table.insert(data.raw.technology["electronics"].effects, { + type = "unlock-recipe", + recipe = "wood-splitter-electronic-circuit" + }) + end + +else + Recipe:new("wood-transport-belt") + :replaceIngredient("copper-cable", "wooden-gear-wheel", 1) + :assign({ additional_categories = { "wood-processing" } - }, - undergroundBelt = { - additional_categories = { "wood-processing" } - }, - splitter = { - additional_categories = { "wood-processing" } - } - }) + }) -Belt.TechnologyBuilder:new() - :prerequisites({ "wood-science-pack" }) - :ingredients({ { "wood-science-pack", 1 } }) - :count(10) - :time(10) - :apply() + Recipe:new("wood-underground-belt") + :assign({ + additional_categories = { "wood-processing" } + }) -if not basic_circuit_board then - data:extend({ - Belt.RecipeBuilder:new() - :ingredients("splitter", { - { type = "item", name = "wood-transport-belt", amount = 2 }, - { type = "item", name = "lumber", amount = 2 }, - { type = "item", name = "electronic-circuit", amount = 2 } - }) - :build({ - splitter = { - name = "wood-splitter-electronic-circuit", - localised_name = { "entity-name.wood-splitter" }, - icons = { - { icon = splitter_item.icon }, - { icon = "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } } - }, - additional_categories = { "wood-processing" } + Recipe:new("wood-splitter") + :replaceIngredient("copper-cable", basic_circuit_board and "basic-circuit-board" or "gold-cable", basic_circuit_board and 5 or nil) + :assign({ + additional_categories = { "wood-processing" } + }) + + if not basic_circuit_board then + Recipe:new("wood-splitter") + :clone("wood-splitter-electronic-circuit") + :replaceIngredient(basic_circuit_board and "gold-cable" or "basic-circuit-board", "electronic-circuit", 2) + :assign({ + localised_name = { "entity-name.wood-splitter" }, + icons = { + { icon = data.raw.item["wood-splitter"].icon }, + { icon = "__base__/graphics/icons/electronic-circuit.png", scale = 0.25, shift = { 8, 8 } } } }) - .splitter - }) + :unlockedByTechnology("electronics") + :apply() + end - table.insert(data.raw.technology["electronics"].effects, { - type = "unlock-recipe", - recipe = "wood-splitter-electronic-circuit" - }) -end + Item:new("wood-transport-belt") + :itemsPerRocket(200) + :defaultImportLocation("lignumis") + Item:new("wood-underground-belt") + :itemsPerRocket(100) + :defaultImportLocation("lignumis") + Item:new("wood-splitter") + :itemsPerRocket(100) + :defaultImportLocation("lignumis") +end \ No newline at end of file