From dcc5ca8c4f771617243ad2f6761ba08b239ff9bb Mon Sep 17 00:00:00 2001 From: Adamo Date: Sun, 15 Nov 2020 23:31:44 -0500 Subject: [PATCH] Finalized pipe norm algorithm. --- changelog.txt | 2 +- data-final-fixes.lua | 34 +++++++++++++--------------------- info.json | 2 +- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/changelog.txt b/changelog.txt index 0521162..ff3861e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ --------------------------------------------------------------------------------------------------- Version: 0.2.0 -Date: 2020-06-26 +Date: 2020-11-15 Changes: - Updated to version 1.0 diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 484a4ed..5ad1fd0 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -101,25 +101,19 @@ local set_burner_colors = function(entity) ) end --- Assumes pipe had height 1 before being changed by this mod. -local pipe_rise = data.raw.pipe.pipe.fluid_box.height - 1 +local pipe_norm = gen_eff for _,boiler in pairs(data.raw.boiler) do boiler.target_temperature = chem_temp_max - local input_rise = boiler.fluid_box.height or 1 - local output_rise = boiler.output_fluid_box.height or 1 - boiler.fluid_box.height = input_rise/gen_eff - boiler.output_fluid_box.height = output_rise/gen_eff - input_rise = (boiler.fluid_box.height or 1) - input_rise - output_rise = (boiler.output_fluid_box.height or 1) - output_rise - local input_drop = input_rise - pipe_rise - local output_drop = output_rise - pipe_rise + boiler.fluid_box.height = + (boiler.fluid_box.height or 1) + /pipe_norm + boiler.output_fluid_box.height = + (boiler.output_fluid_box.height or 1) + /pipe_norm boiler.fluid_box.base_level = - (boiler.fluid_box.base_level or 0) - - input_drop - boiler.output_fluid_box.base_level = - (boiler.output_fluid_box.base_level or 0) - - output_drop + boiler.fluid_box.base_level + /pipe_norm boiler.energy_consumption = energy_div( boiler.energy_consumption,gen_eff ) @@ -149,14 +143,12 @@ for _,generator in pairs(data.raw.generator) do (generator.effectivity or 1) *gen_eff if generator.fluid_box then - local input_rise = generator.fluid_box.height or 1 generator.fluid_box.height = - (generator.fluid_box.height or 1)/gen_eff - input_rise = (generator.fluid_box.height or 1) - input_rise - local input_drop = input_rise - pipe_rise + (generator.fluid_box.height or 1) + /pipe_norm generator.fluid_box.base_level = - (generator.fluid_box.base_level or 0) - - input_drop + generator.fluid_box.base_level + /pipe_norm end if generator.name:find "steam" then if generator.name:find "turbine" then diff --git a/info.json b/info.json index 96c78ba..ff0fa06 100644 --- a/info.json +++ b/info.json @@ -7,5 +7,5 @@ "base" ], "description": "All power is not created equal.", - "factorio_version": "0.18" + "factorio_version": "1.0" } \ No newline at end of file