From d3f3956af7fdf76d742dac8d0a33fa8600af7cdd Mon Sep 17 00:00:00 2001 From: Brevven Date: Mon, 25 Jul 2022 00:21:50 -0700 Subject: [PATCH] k2 finite fluids --- changelog.txt | 5 +++++ info.json | 2 +- me.lua | 4 ++++ prototypes/gas-extractor.lua | 2 +- prototypes/gas.lua | 30 ++++++++++++++++++++++++------ 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/changelog.txt b/changelog.txt index 551981d..f305d7b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.0.8 +Date: 2022-07-25 + Features: + - K2: Respect finite fluids setting. +--------------------------------------------------------------------------------------------------- Version: 0.0.7 Date: 2022-07-25 Changes: diff --git a/info.json b/info.json index e50c13f..2060a6d 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "bzgas", - "version": "0.0.7", + "version": "0.0.8", "factorio_version": "1.1", "title": "Natural Gas", "author": "Brevven", diff --git a/me.lua b/me.lua index 9a47696..2c486d5 100644 --- a/me.lua +++ b/me.lua @@ -3,6 +3,10 @@ local me = {} me.name = "bzgas" me.list = {} +function me.finite() -- Krastorio 2 + return me.get_setting("kr-finite-oil") +end + function me.use_boiler() return me.get_setting("bzgas-boiler") end diff --git a/prototypes/gas-extractor.lua b/prototypes/gas-extractor.lua index a42ffe0..106b8cb 100644 --- a/prototypes/gas-extractor.lua +++ b/prototypes/gas-extractor.lua @@ -86,7 +86,7 @@ data:extend({ } }, energy_usage = "90kW", - mining_speed = 1, + mining_speed = util.me.finite() and 2 or 1, resource_searching_radius = 0.49, vector_to_place_result = {0, 0}, module_specification = diff --git a/prototypes/gas.lua b/prototypes/gas.lua index c7e6f79..af17162 100644 --- a/prototypes/gas.lua +++ b/prototypes/gas.lua @@ -51,9 +51,9 @@ data:extend({ -- walking_sound = sounds.oil, collision_box = {{-1.4, -1.4}, {1.4, 1.4}}, selection_box = {{-0.5, -0.5}, {0.5, 0.5}}, - map_color = {0.9, 0.7, 0.2}, + map_color = {0.9, 0.75, 0.2}, map_grid = false, - autoplace = resource_autoplace.resource_autoplace_settings + autoplace = resource_autoplace.resource_autoplace_settings( { name = "gas", order = "c-g", @@ -61,11 +61,11 @@ data:extend({ base_spots_per_km2 = 1.8, random_probability = 1/48, random_spot_size_minimum = 1, - random_spot_size_maximum = 1, -- don't randomize spot size - additional_richness = 220000, -- this increases the total everywhere, so base_density needs to be decreased to compensate + random_spot_size_maximum = 1, + additional_richness = 220000, has_starting_area_placement = true, - regular_rq_factor_multiplier = 1 - }, + regular_rq_factor_multiplier = 1, + }), stage_counts = {0}, stages = { @@ -140,3 +140,21 @@ data:extend({ order = "a[fluid]-f[gas]" }, }) +if util.me.finite() then + data.raw.resource["gas"].infinite = false + data.raw.resource["gas"].minimum = 20000 + data.raw.resource["gas"].normal = 80000 + data.raw.resource["crude-oil"].minable = { + mining_time = 1, + results = { + { + type = "fluid", + name = "gas", + amount_min = 20, + amount_max = 20, + probability = 1, + }, + }, + } + +end