diff --git a/bzgas2/data-final-fixes.lua b/bzgas2/data-final-fixes.lua index ad08a6f..70ec7e8 100644 --- a/bzgas2/data-final-fixes.lua +++ b/bzgas2/data-final-fixes.lua @@ -2,7 +2,7 @@ require("stacking") require("modules") require("compatibility/ir2") -local util = require("data-util"); +local util = require("__bzgas2__/data-util") -- core mining balancing util.set_product_amount("se-core-fragment-omni", "gas", 24) @@ -30,13 +30,22 @@ if not mods.Krastorio2 and not mods["aai-industry"] and not mods.bzaluminum2 and util.add_ingredient("repair-pack", "copper-cable", 6) util.set_ingredient("repair-pack", "iron-gear-wheel", 3) - util.add_unlock_force("electronics", "electronic-circuit") - util.add_effect("electronics", { type = "unlock-recipe", recipe = "inserter" }) + -- New for 2.0 (Evilpla) + util.remove_prerequisite("automation", "automation-science-pack") + util.set_tech_trigger("automation", { type = "mine-entity", entity = "coal" }) + util.set_tech_trigger("gas-extraction", { type = "craft-item", item = "copper-plate" }) + util.set_tech_trigger("basic-chemistry", { type = "mine-entity", entity = "gas" }) + util.set_tech_trigger("bakelite", { type = "craft-fluid", fluid = "formaldehyde" }) + util.set_tech_trigger("electronics", { type = "craft-item", item = "bakelite" }) util.add_effect("electronics", { type = "unlock-recipe", recipe = "long-handed-inserter" }) util.remove_recipe_effect("automation", "long-handed-inserter") - util.set_enabled("electronic-circuit", false) - util.set_enabled("inserter", false) - util.add_prerequisite("logistic-science-pack", "electronics") + + -- TODO: cleanup + -- util.add_unlock_force("electronics", "electronic-circuit") + -- util.add_effect("electronics", { type = "unlock-recipe", recipe = "inserter" }) + -- util.set_enabled("electronic-circuit", false) + -- util.set_enabled("inserter", false) + -- util.add_prerequisite("logistic-science-pack", "electronics") end if not mods.bzaluminum2 and not mods["bzcarbon2"] then util.replace_ingredients_prior_to("electronics", "electronic-circuit", "copper-cable", 2) diff --git a/bzgas2/data-util.lua b/bzgas2/data-util.lua index ff75c36..5dbd855 100644 --- a/bzgas2/data-util.lua +++ b/bzgas2/data-util.lua @@ -1267,4 +1267,13 @@ function util.set_vtk_dcm_ingredients() end end +-- Set technology trigger +function util.set_tech_trigger(technology_name, trigger) + local technology = data.raw.technology[technology_name] + if technology then + technology.unit = nil + technology.research_trigger = trigger + end +end + return util diff --git a/bzgas2/data.lua b/bzgas2/data.lua index 26625fe..6c2e79d 100644 --- a/bzgas2/data.lua +++ b/bzgas2/data.lua @@ -1,7 +1,7 @@ require("prototypes/gas") require("prototypes/gas-extractor") -require("prototypes/phenol") require("prototypes/formaldehyde") +require("prototypes/phenol") require("prototypes/bakelite") require("prototypes/basic-chemical-plant") require("prototypes/k2-recipe") diff --git a/bzgas2/prototypes/bakelite.lua b/bzgas2/prototypes/bakelite.lua index 83a7a9d..1b15bd2 100644 --- a/bzgas2/prototypes/bakelite.lua +++ b/bzgas2/prototypes/bakelite.lua @@ -15,6 +15,7 @@ data:extend({ name = "bakelite", category = "chemistry", main_product = "bakelite", + allow_productivity = true, enabled = false, ingredients = { {type = "item", name = util.me.use_phenol() and "phenol" or "coal", amount = 1}, diff --git a/bzgas2/prototypes/gas-extractor.lua b/bzgas2/prototypes/gas-extractor.lua index 156b547..d749ae7 100644 --- a/bzgas2/prototypes/gas-extractor.lua +++ b/bzgas2/prototypes/gas-extractor.lua @@ -1,4 +1,4 @@ -local util = require("data-util"); +local util = require("data-util") local futil = require("util") local ge_ingredients = { @@ -14,9 +14,6 @@ if mods.Krastorio2 then elseif mods["aai-industry"] then table.insert(ge_ingredients, {type="item", name="sand", amount=10}) ge_prereq = {"sand-processing"} -elseif data.raw.item["silica"] and data.raw.technology["silica-processing"] then - table.insert(ge_ingredients, {type="item", name="silica", amount=20}) - ge_prereq = {"silica-processing"} end drilling_rig_circuit_connector_definitions = circuit_connector_definitions.create_vector @@ -46,7 +43,7 @@ data:extend({ type = "recipe", name = "gas-extractor", results = {{ type = "item", name = "gas-extractor", amount = 1}}, - enabled = false, -- TODO change + enabled = false, ingredients = ge_ingredients, }, { @@ -54,7 +51,7 @@ data:extend({ name = "gas-extraction", icon = "__bzgas2__/graphics/technology/gas-processing.png", icon_size = 256, - --prerequisites = ge_prereq, + prerequisites = ge_prereq, effects = { {type = "unlock-recipe", recipe = "gas-extractor"}, }, @@ -87,11 +84,12 @@ data:extend({ }, output_fluid_box = { - volume = 1000, + volume = 100, pipe_covers = pipecoverspictures(), pipe_connections = { { + flow_direction = "output", direction = defines.direction.north, positions = { {0, -1}, {1, 0}, {0, 1}, {-1, 0} } } diff --git a/bzgas2/prototypes/phenol.lua b/bzgas2/prototypes/phenol.lua index 538bada..ad83ed6 100644 --- a/bzgas2/prototypes/phenol.lua +++ b/bzgas2/prototypes/phenol.lua @@ -1,4 +1,4 @@ -local util = require("data-util"); +local util = require("data-util") if util.me.use_phenol() then @@ -66,13 +66,8 @@ if data.raw.item[mods["Krastorio2"] and "kr-coke" or "coke"] then } }) end - if mods.Krastorio2 then - util.add_effect("steel-processing", {type="unlock-recipe", recipe="phenol"}) - elseif data.raw.item["foundry"] then - util.add_effect("foundry", {type="unlock-recipe", recipe="phenol"}) - else - util.add_effect("basic-chemistry", {type="unlock-recipe", recipe="phenol"}) - end + + util.add_effect("basic-chemistry", {type="unlock-recipe", recipe="phenol"}) if mods.Krastorio2 then light_oil_icon = { icon = "__Krastorio2Assets__/icons/fluids/light-oil.png", icon_size = 64, icon_mipmaps = 4, scale=0.25, shift={-8,-8}}