From 508eb04e9459bf471cef522134c68f5537f1248a Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Thu, 24 Feb 2022 13:16:18 -0800 Subject: [PATCH] Tweak energy bridge values ENERGY_INCREMENT now set dynamically by whatever the ap-energy-bridge buffer capacity ends up being. --- worlds/factorio/data/mod_template/control.lua | 6 +++++- worlds/factorio/data/mod_template/data.lua | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/worlds/factorio/data/mod_template/control.lua b/worlds/factorio/data/mod_template/control.lua index d793bdc0..c95dc52a 100644 --- a/worlds/factorio/data/mod_template/control.lua +++ b/worlds/factorio/data/mod_template/control.lua @@ -11,7 +11,7 @@ TRAP_EVO_FACTOR = {{ evolution_trap_increase }} / 100 MAX_SCIENCE_PACK = {{ max_science_pack }} GOAL = {{ goal }} ARCHIPELAGO_DEATH_LINK_SETTING = "archipelago-death-link-{{ slot_player }}-{{ seed_name }}" -ENERGY_INCREMENT = 1000000 +ENERGY_INCREMENT = 0 if settings.global[ARCHIPELAGO_DEATH_LINK_SETTING].value then DEATH_LINK = 1 @@ -24,6 +24,9 @@ CURRENTLY_DEATH_LOCK = 0 function on_check_energy_link(event) --- assuming 1 MJ increment and 5MJ battery: --- first 2 MJ request fill, last 2 MJ push energy, middle 1 MJ does nothing + if event.tick == 0 then + ENERGY_INCREMENT = game.entity_prototypes["ap-energy-bridge"].electric_energy_source_prototype.buffer_capacity / 5 + end if event.tick % 60 == 30 then local surface = game.get_surface(1) local force = "player" @@ -554,6 +557,7 @@ end) commands.add_command("ap-rcon-info", "Used by the Archipelago client to get information", function(call) + ENERGY_INCREMENT = game.entity_prototypes["ap-energy-bridge"].electric_energy_source_prototype.buffer_capacity / 5 rcon.print(game.table_to_json({ ["slot_name"] = SLOT_NAME, ["seed_name"] = SEED_NAME, diff --git a/worlds/factorio/data/mod_template/data.lua b/worlds/factorio/data/mod_template/data.lua index 95874a06..b8d66ad6 100644 --- a/worlds/factorio/data/mod_template/data.lua +++ b/worlds/factorio/data/mod_template/data.lua @@ -3,6 +3,9 @@ local energy_bridge = table.deepcopy(data.raw["accumulator"]["accumulator"]) energy_bridge.name = "ap-energy-bridge" energy_bridge.minable.result = "ap-energy-bridge" energy_bridge.localised_name = "Archipelago EnergyLink Bridge" +energy_bridge.energy_source.buffer_capacity = "10MJ" +energy_bridge.energy_source.input_flow_limit = "1MW" +energy_bridge.energy_source.output_flow_limit = "1MW" data.raw["accumulator"]["ap-energy-bridge"] = energy_bridge local energy_bridge_item = table.deepcopy(data.raw["item"]["accumulator"])