diff --git a/changelog.txt b/changelog.txt index db81c13..7596730 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,10 @@ --------------------------------------------------------------------------------------------------- +Version: 0.0.6 +Date: 2022-01-03 + Changes: + - Tungsten sets basic rocket-engine-nozzle recipe, this mod updates it with graphite + - More minor compatibility +--------------------------------------------------------------------------------------------------- Version: 0.0.5 Date: 2022-01-02 Fixes: @@ -11,7 +17,6 @@ Date: 2022-01-01 - SE: More facility recipes, Nutrient gel, LDS diamonds, alt lube, unlocks - K2 green circuit fix - AAI green circuit fix - --------------------------------------------------------------------------------------------------- Version: 0.0.3 Date: 2021-12-31 diff --git a/data-util.lua b/data-util.lua index e618ff2..b840c3d 100644 --- a/data-util.lua +++ b/data-util.lua @@ -343,7 +343,7 @@ function util.remove_raw(t, name) end -- Multiply energy required -function util.multiply_time(recipe, factor) +function util.multiply_time(recipe_name, factor) if me.bypass[recipe_name] then return end if data.raw.recipe[recipe_name] then multiply_time(data.raw.recipe[recipe_name], factor) @@ -360,19 +360,40 @@ function multiply_time(recipe, factor) end end +-- Add to energy required +function util.add_time(recipe_name, amount) + log("Doing ".. recipe_name) + log(amount) + if me.bypass[recipe_name] then return end + log(1) + if data.raw.recipe[recipe_name] then + add_time(data.raw.recipe[recipe_name], amount) + add_time(data.raw.recipe[recipe_name].normal, amount) + add_time(data.raw.recipe[recipe_name].expensive, amount) + end +end + +function add_time(recipe, amount) + if recipe then + if recipe.energy_required then + recipe.energy_required = recipe.energy_required + amount + end + end +end + -- Set recipe category -function util.set_category(recipe, category) +function util.set_category(recipe_name, category) if me.bypass[recipe_name] then return end - if data.raw.recipe[recipe] then - data.raw.recipe[recipe].category = category + if data.raw.recipe[recipe_name] then + data.raw.recipe[recipe_name].category = category end end -- Set recipe subgroup -function util.set_subgroup(recipe, subgroup) +function util.set_subgroup(recipe_name, subgroup) if me.bypass[recipe_name] then return end - if data.raw.recipe[recipe] then - data.raw.recipe[recipe].subgroup = subgroup + if data.raw.recipe[recipe_name] then + data.raw.recipe[recipe_name].subgroup = subgroup end end diff --git a/info.json b/info.json index 55b585b..269c424 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzcarbon", - "version": "0.0.5", + "version": "0.0.6", "factorio_version": "1.1", "title": "Graphite & Diamonds", "author": "Brevven", @@ -14,6 +14,6 @@ "? deadlock-beltboxes-loaders", "? DeadlockCrating" ], - "description": "Adds elemental carbon items to the game, including graphite, diamonds, graphene, and optionally fullerenes, nanotubes, etc.\n\nCompatible with Krastorio 2, Space Exploration, and more. Part of BZ Mods" + "description": "Adds elemental carbon items to the game, including graphite, diamonds, graphene, and optionally fullerenes, nanotubes, etc.\n\nCompatible with Krastorio 2, Space Exploration, and more. A standalone piece of BZ Mods" }