From 7dde159f280e426e44dfbe8534e411606bfc3986 Mon Sep 17 00:00:00 2001 From: Brevven Date: Sun, 29 May 2022 18:10:43 -0700 Subject: [PATCH] minor compat aai, k2 --- carbon-recipe-updates.lua | 4 +++- changelog.txt | 7 +++++++ data-final-fixes.lua | 11 ++++++++--- data-util.lua | 13 +++++++++++++ info.json | 2 +- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/carbon-recipe-updates.lua b/carbon-recipe-updates.lua index 3da084c..38db4ec 100644 --- a/carbon-recipe-updates.lua +++ b/carbon-recipe-updates.lua @@ -35,7 +35,9 @@ if util.me.use_fullerenes() then util.add_prerequisite("graphene", "fullerenes") util.add_prerequisite("military-3", "fullerenes") util.replace_some_ingredient("poison-capsule", "coal", 9, "fullerenes", 90) - util.replace_some_ingredient("slowdown-capsule", "coal", 4, "fullerenes", 40) + if not mods.Krastorio2 then + util.replace_some_ingredient("slowdown-capsule", "coal", 4, "fullerenes", 40) + end -- K2 util.add_ingredient("kr-biter-virus", "fullerenes", 100) diff --git a/changelog.txt b/changelog.txt index cb31153..a3073ce 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,11 @@ --------------------------------------------------------------------------------------------------- +Version: 0.1.8 +Date: 2022-05-30 + Changes: + - AAI: Improve AAI tech tree when Graphite enabled: steam power after basic fluid handling. + - K2: Do not unlock electric mining drill with automation core. + - K2: Fullerenes no longer required for slowdown capsules, due to earlier unlock in K2. +--------------------------------------------------------------------------------------------------- Version: 0.1.7 Date: 2022-04-25 Fixes: diff --git a/data-final-fixes.lua b/data-final-fixes.lua index f238421..3508152 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -95,13 +95,18 @@ if not mods.Krastorio2 and not mods["aai-industry"] and not mods.bzaluminum then end if not mods["aai-industry"] then - if mods.Krastorio2 then - util.add_effect("kr-automation-core", { type = "unlock-recipe", recipe = "electric-mining-drill" }) - else + if not mods.Krastorio2 then util.set_enabled("electric-mining-drill", true) end end +if mods["aai-industry"] then + -- AAI Industry now unlocks steam much later. Move it to an earlier sensible location in the tech tree. + util.set_prerequisite("steam-power", {"basic-fluid-handling"}) + util.set_tech_recipe("steam-power", {{"automation-science-pack", 1}}) +end + + -- Must be last util.create_list() diff --git a/data-util.lua b/data-util.lua index d700645..6ce0745 100644 --- a/data-util.lua +++ b/data-util.lua @@ -54,6 +54,19 @@ function util.contains(table, sought) return false end +-- Set/override a technology's prerequisites +function util.set_prerequisite(technology_name, prerequisites) + local technology = data.raw.technology[technology_name] + if technology then + technology.prerequisites = {} + for i, prerequisite in pairs(prerequisites) do + if data.raw.technology[prerequisite] then + table.insert(technology.prerequisites, prerequisite) + end + end + end +end + -- Add a prerequisite to a given technology function util.add_prerequisite(technology_name, prerequisite) local technology = data.raw.technology[technology_name] diff --git a/info.json b/info.json index 3005b40..cc0b521 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzcarbon", - "version": "0.1.7", + "version": "0.1.8", "factorio_version": "1.1", "title": "Graphite & Diamonds", "author": "Brevven",