From 76e83db072994731c5010b3f0717b025d003a7d0 Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Wed, 12 Jan 2022 20:50:18 +0100 Subject: [PATCH] Add TA5 heat exchanger for the FR --- fusion_reactor/controller.lua | 4 + fusion_reactor/generator.lua | 145 ++++++++++++++++------ fusion_reactor/heatexchanger2.lua | 59 +++++---- fusion_reactor/magnet.lua | 35 +++++- fusion_reactor/ta5_pump.lua | 191 +++++++++++++++++++++++++++++ fusion_reactor/turbine.lua | 11 +- init.lua | 3 +- items/registered_nodes.lua | 1 + ta3_power/tiny_generator.lua | 4 +- textures/techage_appl_plasma4.png | Bin 706 -> 617 bytes textures/techage_gas_inv.png | Bin 664 -> 514 bytes textures/techage_isobutane_inv.png | Bin 574 -> 430 bytes textures/techage_reactor_shell.png | Bin 342 -> 273 bytes 13 files changed, 381 insertions(+), 72 deletions(-) create mode 100644 fusion_reactor/ta5_pump.lua diff --git a/fusion_reactor/controller.lua b/fusion_reactor/controller.lua index 0c9b0e2..651b952 100644 --- a/fusion_reactor/controller.lua +++ b/fusion_reactor/controller.lua @@ -75,6 +75,10 @@ local Commands = { local resp = control.send(pos, Cable, outdir, "con", "off") return "off " .. resp end, + function(pos, outdir) + local resp = control.request(pos, Cable, outdir, "con", "no_gas") + return "no_gas: " .. concentrate(resp) + end, } local function after_place_node(pos, placer, itemstack) diff --git a/fusion_reactor/generator.lua b/fusion_reactor/generator.lua index 4621661..4059465 100644 --- a/fusion_reactor/generator.lua +++ b/fusion_reactor/generator.lua @@ -3,14 +3,12 @@ TechAge ======= - Copyright (C) 2019-2021 Joachim Stolberg + Copyright (C) 2019-2022 Joachim Stolberg AGPL v3 See LICENSE.txt for more information - TA4 TES Generator (dummy) - - can be started and stopped - - provides netID of cable network + TA5 Fusion Reactor Generator ]]-- -- for lazy programmers @@ -20,6 +18,11 @@ local S = techage.S local Cable = techage.ElectricCable local power = networks.power +local CYCLE_TIME = 2 +local STANDBY_TICKS = 1 +local COUNTDOWN_TICKS = 2 +local PWR_PERF = 800 + local function swap_node(pos, name) local node = techage.get_node_lvm(pos) if node.name == name then @@ -29,16 +32,78 @@ local function swap_node(pos, name) minetest.swap_node(pos, node) end -minetest.register_node("techage:ta4_generator", { - description = S("TA4 Generator"), +local function start_node(pos, nvm) + local meta = M(pos) + nvm.provided = 0 + nvm.alive_cnt = 5 + techage.evaluate_charge_termination(nvm, meta) + local outdir = meta:get_int("outdir") + power.start_storage_calc(pos, Cable, outdir) + swap_node(pos, "techage:ta5_generator_on") + minetest.get_node_timer(pos):start(CYCLE_TIME) + --play_sound(pos) +end + +local function stop_node(pos, nvm) + nvm.provided = 0 + local outdir = M(pos):get_int("outdir") + --stop_sound(pos) + power.start_storage_calc(pos, Cable, outdir) + swap_node(pos, "techage:ta5_generator") +end + +local function on_receive_fields(pos, formname, fields, player) + if minetest.is_protected(pos, player:get_player_name()) then + return + end + local nvm = techage.get_nvm(pos) + State:state_button_event(pos, nvm, fields) +end + +local function on_rightclick(pos, node, clicker) + local nvm = techage.get_nvm(pos) + --techage.set_activeformspec(pos, clicker) + --M(pos):set_string("formspec", formspec(State, pos, nvm)) +end + +local function get_generator_data(pos, outdir, tlib2) + local nvm = techage.get_nvm(pos) + --if nvm.running and techage.is_running(nvm) then + return {level = (nvm.load or 0) / PWR_PERF, perf = PWR_PERF, capa = PWR_PERF * 2} + --end +end + +local function node_timer(pos, elapsed) + local nvm = techage.get_nvm(pos) + nvm.alive_cnt = (nvm.alive_cnt or 0) - 1 + print("node_timer", nvm.alive_cnt) + if nvm.alive_cnt > 0 then + local meta = M(pos) + local outdir = meta:get_int("outdir") + local tp1 = tonumber(meta:get_string("termpoint1")) + local tp2 = tonumber(meta:get_string("termpoint2")) + nvm.provided = power.provide_power(pos, Cable, outdir, PWR_PERF, tp1, tp2) + print("nvm.provided", nvm.provided) + local val = power.get_storage_load(pos, Cable, outdir, PWR_PERF) + if val > 0 then + nvm.load = val + end + else + swap_node(pos, "techage:ta5_generator") + end + return true +end + +minetest.register_node("techage:ta5_generator", { + description = S("TA5 Generator"), tiles = { -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_generator.png", - "techage_filling_ta4.png^techage_frame_ta4.png^techage_appl_generator.png^[transformFX]", + "techage_filling_ta4.png^techage_frame_ta5_top.png", + "techage_filling_ta4.png^techage_frame_ta4_bottom.png", + "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta5.png", + "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta5.png", + "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_generator.png", + "techage_filling_ta4.png^techage_frame_ta5.png^techage_appl_generator.png^[transformFX]", }, after_place_node = function(pos) @@ -50,6 +115,10 @@ minetest.register_node("techage:ta4_generator", { techage.del_mem(pos) end, + get_generator_data = get_generator_data, + ta3_formspec = techage.generator_settings("ta3", PWR_PERF), + --on_receive_fields = on_receive_fields, + --on_rightclick = on_rightclick, paramtype2 = "facedir", groups = {cracky=2, crumbly=2, choppy=2}, on_rotate = screwdriver.disallow, @@ -57,16 +126,16 @@ minetest.register_node("techage:ta4_generator", { sounds = default.node_sound_wood_defaults(), }) -minetest.register_node("techage:ta4_generator_on", { - description = S("TA4 Generator"), +minetest.register_node("techage:ta5_generator_on", { + description = S("TA5 Generator"), tiles = { -- up, down, right, left, back, front - "techage_filling_ta4.png^techage_frame_ta4_top.png", - "techage_filling_ta4.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta4.png", - "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta4.png", + "techage_filling_ta4.png^techage_frame_ta5_top.png", + "techage_filling_ta4.png^techage_frame_ta4_bottom.png", + "techage_filling_ta4.png^techage_appl_hole_electric.png^techage_frame_ta5.png", + "techage_filling_ta4.png^techage_appl_open.png^techage_frame_ta5.png", { - image = "techage_filling4_ta4.png^techage_appl_generator4.png^techage_frame4_ta4.png", + image = "techage_filling4_ta4.png^techage_appl_generator4.png^techage_frame4_ta5.png", backface_culling = false, animation = { type = "vertical_frames", @@ -76,7 +145,7 @@ minetest.register_node("techage:ta4_generator_on", { }, }, { - image = "techage_filling4_ta4.png^techage_appl_generator4.png^[transformFX]^techage_frame4_ta4.png", + image = "techage_filling4_ta4.png^techage_appl_generator4.png^[transformFX]^techage_frame4_ta5.png", backface_culling = false, animation = { type = "vertical_frames", @@ -87,6 +156,11 @@ minetest.register_node("techage:ta4_generator_on", { }, }, + get_generator_data = get_generator_data, + ta3_formspec = techage.generator_settings("ta3", PWR_PERF), + --on_receive_fields = on_receive_fields, + --on_rightclick = on_rightclick, + on_timer = node_timer, paramtype2 = "facedir", drop = "", groups = {not_in_creative_inventory=1}, @@ -96,19 +170,18 @@ minetest.register_node("techage:ta4_generator_on", { sounds = default.node_sound_wood_defaults(), }) --- The generator is a dummy, it only has to network connection to check the netID -power.register_nodes({"techage:ta4_generator", "techage:ta4_generator_on"}, Cable, "con", {"R"}) +power.register_nodes({"techage:ta5_generator", "techage:ta5_generator_on"}, Cable, "gen", {"R"}) -- controlled by the turbine -techage.register_node({"techage:ta4_generator", "techage:ta4_generator_on"}, { +techage.register_node({"techage:ta5_generator", "techage:ta5_generator_on"}, { on_transfer = function(pos, in_dir, topic, payload) - if topic == "netID" then - local outdir = M(pos):get_int("outdir") - return networks.determine_netID(pos, Cable, outdir) + local nvm = techage.get_nvm(pos) + if topic == "trigger" then + nvm.alive_cnt = 5 elseif topic == "start" then - swap_node(pos, "techage:ta4_generator_on") + start_node(pos, nvm) elseif topic == "stop" then - swap_node(pos, "techage:ta4_generator") + stop_node(pos, nvm) end end, on_recv_message = function(pos, src, topic, payload) @@ -120,11 +193,11 @@ techage.register_node({"techage:ta4_generator", "techage:ta4_generator_on"}, { end, }) -minetest.register_craft({ - output = "techage:ta4_generator", - recipe = { - {"", "dye:blue", ""}, - {"", "techage:generator", ""}, - {"", "techage:ta4_wlanchip", ""}, - }, -}) +--minetest.register_craft({ +-- output = "techage:ta5_generator", +-- recipe = { +-- {"", "dye:blue", ""}, +-- {"", "techage:generator", ""}, +-- {"", "techage:ta4_wlanchip", ""}, +-- }, +--}) diff --git a/fusion_reactor/heatexchanger2.lua b/fusion_reactor/heatexchanger2.lua index 390738b..976f0f7 100644 --- a/fusion_reactor/heatexchanger2.lua +++ b/fusion_reactor/heatexchanger2.lua @@ -41,15 +41,6 @@ local function heatexchanger3_cmnd(pos, topic, payload) {"techage:ta5_heatexchanger3"}) end -local function swap_node(pos, name) - local node = techage.get_node_lvm(pos) - if node.name == name then - return - end - node.name = name - minetest.swap_node(pos, node) -end - local function play_sound(pos) local mem = techage.get_mem(pos) if not mem.handle or mem.handle == -1 then @@ -72,7 +63,7 @@ local function stop_sound(pos) end end -local function concentrate(t) +local function count_trues(t) local cnt = 0 for _,v in ipairs(t) do if v then @@ -91,7 +82,7 @@ local CheckCommands = { end, function(pos) local resp = heatexchanger1_cmnd(pos, "test_gas_blue") - local cnt = concentrate(resp) + local cnt = count_trues(resp) if cnt ~= EXPECT_BLUE then return S("Blue pipe error (@1/@2)", cnt, EXPECT_BLUE) end @@ -99,7 +90,7 @@ local CheckCommands = { end, function(pos) local resp = heatexchanger3_cmnd(pos, "test_gas_green") - local cnt = concentrate(resp) + local cnt = count_trues(resp) if cnt ~= EXPECT_GREEN then return S("Green pipe error (@1/@2)", cnt, EXPECT_GREEN) end @@ -130,30 +121,39 @@ end local function start_node(pos, nvm) play_sound(pos) nvm.ticks = 0 + nvm.temperature = 20 heatexchanger1_cmnd(pos, "start") end local function stop_node(pos, nvm) stop_sound(pos) + nvm.temperature = 20 heatexchanger1_cmnd(pos, "stop") end +local function temp_indicator (nvm, x, y) + local temp = nvm.temperature or 20 + return "image[" .. x .. "," .. y .. ";1,2;techage_form_temp_bg.png^[lowpart:" .. + temp .. ":techage_form_temp_fg.png]" .. + "tooltip[" .. x .. "," .. y .. ";1,2;" .. S("water temperature") .. ";#0C3D32;#FFFFFF]" +end + local function formspec(self, pos, nvm) - return "size[4,2]".. - "box[0,-0.1;3.8,0.5;#c6e8ff]" .. + return "size[5,3]".. + "box[0,-0.1;4.8,0.5;#c6e8ff]" .. "label[0.2,-0.1;" .. minetest.colorize( "#000000", DESCRIPTION) .. "]" .. - "image_button[1.5,1;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. - "tooltip[1.5,1;1,1;"..self:get_state_tooltip(nvm).."]" + temp_indicator (nvm, 1, 1) .. + "image_button[3.2,1.5;1,1;".. self:get_state_button_image(nvm) ..";state_button;]".. + "tooltip[3.2,1.5;1,1;"..self:get_state_tooltip(nvm).."]" end local function check_integrity(pos, nvm) -- Check every 30 sec nvm.ticks = ((nvm.ticks or 0) % 15) + 1 if CheckCommands[nvm.ticks] then - local res = CheckCommands[nvm.ticks](pos) - if res ~= true then return res end + nvm.result = CheckCommands[nvm.ticks](pos) end - return true + return nvm.result end local State = techage.NodeStates:new({ @@ -182,15 +182,23 @@ local function consume_power(pos, nvm) end end +local function steam_management(pos, nvm) + nvm.temperature = nvm.temperature or 20 + nvm.temperature = math.min(nvm.temperature + 1, 100) + if nvm.temperature > 80 then + heatexchanger1_cmnd(pos, "trigger") + end +end + local function node_timer(pos, elapsed) - print("node_timer") local nvm = techage.get_nvm(pos) + nvm.temperature = nvm.temperature or 20 consume_power(pos, nvm) - local res = check_integrity(pos, nvm) - if res ~= true then - State:fault(pos, nvm, res) - stop_sound(pos) - heatexchanger1_cmnd(pos, "stop") + if check_integrity(pos, nvm) == true then + steam_management(pos, nvm) + else + State:fault(pos, nvm, nvm.result) + stop_node(pos, nvm) end return State:is_active(nvm) end @@ -262,7 +270,6 @@ minetest.register_node("techage:ta5_heatexchanger2", { after_place_node = after_place_node, can_dig = can_dig, after_dig_node = after_dig_node, - get_storage_data = get_storage_data, paramtype2 = "facedir", groups = {crumbly = 2, cracky = 2, snappy = 2}, diff --git a/fusion_reactor/magnet.lua b/fusion_reactor/magnet.lua index 83c1bb7..851b594 100644 --- a/fusion_reactor/magnet.lua +++ b/fusion_reactor/magnet.lua @@ -24,6 +24,7 @@ local power = networks.power local liquid = networks.liquid local control = networks.control +local CAPACITY = 6 local SHELLBLOCKS = {"techage:ta5_fr_shell", "techage:ta5_fr_nucleus", "techage:ta5_magnet1", "techage:ta5_magnet2"} minetest.register_node("techage:ta5_magnet1", { @@ -95,7 +96,25 @@ minetest.register_node("techage:ta5_magnet2", { }) power.register_nodes({"techage:ta5_magnet1"}, Cable, "con", {"B"}) -liquid.register_nodes({"techage:ta5_magnet1", "techage:ta5_magnet2"}, Pipe, "tank", {"U", "D"}, {}) +liquid.register_nodes({"techage:ta5_magnet1", "techage:ta5_magnet2"}, Pipe, "tank", {"U", "D"}, { + capa = CAPACITY, + peek = function(pos, indir) + local nvm = techage.get_nvm(pos) + return liquid.srv_peek(nvm) + end, + put = function(pos, indir, name, amount) + local nvm = techage.get_nvm(pos) + return liquid.srv_put(nvm, name, amount, CAPACITY) + end, + take = function(pos, indir, name, amount) + local nvm = techage.get_nvm(pos) + return liquid.srv_take(nvm, name, amount) + end, + untake = function(pos, indir, name, amount) + local nvm = techage.get_nvm(pos) + liquid.srv_put(nvm, name, amount, CAPACITY) + end, +}) local function check_plasma(pos, param2) local pos1 = networks.get_relpos(pos, "F", param2) @@ -141,14 +160,24 @@ end local function on_request(pos, tlib2, topic) --print("on_request", topic) local nvm = techage.get_nvm(pos) + nvm.liquid = nvm.liquid or {} + nvm.liquid.amount = nvm.liquid.amount or 0 if topic == "test_power" and tlib2 == Cable then + nvm.has_power = true return true elseif topic == "test_gas_blue" and tlib2 == Pipe then + -- Test if gas is available nvm.gas_cnt = 1 - return true + return nvm.liquid.amount == CAPACITY elseif topic == "test_gas_green" and tlib2 == Pipe then + -- Test if gas is heated nvm.gas_cnt = (nvm.gas_cnt or 0) - 1 - return nvm.gas_cnt == 0 + local res = nvm.gas_cnt == 0 and nvm.has_power + nvm.has_power = false + return res + elseif topic == "no_gas" then + nvm.liquid.amount = 0 + return true elseif topic == "test_plasma" then local node = minetest.get_node(pos) or {} return check_plasma(pos, node.param2) diff --git a/fusion_reactor/ta5_pump.lua b/fusion_reactor/ta5_pump.lua new file mode 100644 index 0000000..a9a9ee1 --- /dev/null +++ b/fusion_reactor/ta5_pump.lua @@ -0,0 +1,191 @@ +--[[ + + TechAge + ======= + + Copyright (C) 2019-2022 Joachim Stolberg + + AGPL v3 + See LICENSE.txt for more information + + TA5 Pump + +]]-- + +local S2P = minetest.string_to_pos +local P2S = minetest.pos_to_string +local M = minetest.get_meta +local S = techage.S +local Pipe2 = techage.LiquidPipe +local Pipe3 = techage.GasPipe +local liquid = networks.liquid +local Flip = networks.Flip + +local STANDBY_TICKS = 16 +local COUNTDOWN_TICKS = 4 +local CYCLE_TIME = 2 +local CAPA = 4 + +local WRENCH_MENU = {{ + type = "output", + name = "flowrate", + label = S("Total flow rate"), + tooltip = S("Total flow rate in liquid units"), +}} + +local State = techage.NodeStates:new({ + node_name_passive = "techage:t5_pump", + node_name_active = "techage:t5_pump_on", + infotext_name = S("TA45 Pump"), + cycle_time = CYCLE_TIME, + standby_ticks = STANDBY_TICKS, +}) + +local function pumping(pos, nvm) + local outdir = M(pos):get_int("outdir") + local taken, name = liquid.take(pos, Pipe2, Flip[outdir], nil, CAPA) + if taken > 0 then + local leftover = liquid.put(pos, Pipe3, outdir, name, taken) + if leftover and leftover > 0 then + liquid.untake(pos, Pipe2, Flip[outdir], name, leftover) + if leftover == taken then + State:blocked(pos, nvm) + return 0 + end + State:keep_running(pos, nvm, COUNTDOWN_TICKS) + return taken - leftover + end + State:keep_running(pos, nvm, COUNTDOWN_TICKS) + return taken + end + State:idle(pos, nvm) + return 0 +end + +local function after_place_node(pos, placer) + local nvm = techage.get_nvm(pos) + local number = techage.add_node(pos, "techage:t5_pump") + State:node_init(pos, nvm, number) + M(pos):set_int("outdir", networks.side_to_outdir(pos, "R")) + Pipe2:after_place_node(pos) + Pipe3:after_place_node(pos) +end + +local function node_timer(pos, elapsed) + local nvm = techage.get_nvm(pos) + nvm.flowrate = (nvm.flowrate or 0) + pumping(pos, nvm) + return State:is_active(nvm) +end + +local function on_rightclick(pos, node, clicker) + if minetest.is_protected(pos, clicker:get_player_name()) then + return + end + + local nvm = techage.get_nvm(pos) + if node.name == "techage:t5_pump" then + State:start(pos, nvm) + elseif node.name == "techage:t5_pump_on" then + State:stop(pos, nvm) + end +end + +local function after_dig_node(pos, oldnode, oldmetadata, digger) + Pipe2:after_dig_node(pos) + Pipe3:after_dig_node(pos) + techage.del_mem(pos) +end + +local tiles_pas = { + -- up, down, right, left, back, front + "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_arrow.png", + "techage_filling_ta4.png^techage_frame_ta4_bottom.png", + "techage_filling_ta4.png^techage_appl_hole_ta5_pipe2.png^techage_frame_ta5.png", + "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta5.png", + "techage_filling_ta4.png^techage_appl_pump.png^techage_frame_ta5.png^[transformFX", + "techage_filling_ta4.png^techage_appl_pump.png^techage_frame_ta5.png", +} + +local tiles_act = { + -- up, down, right, left, back, front + "techage_filling_ta4.png^techage_frame_ta5_top.png^techage_appl_arrow.png", + "techage_filling_ta4.png^techage_frame_ta4_bottom.png", + "techage_filling_ta4.png^techage_appl_hole_ta5_pipe2.png^techage_frame_ta5.png", + "techage_filling_ta4.png^techage_appl_hole_pipe.png^techage_frame_ta5.png", + { + image = "techage_filling8_ta4.png^techage_appl_pump8.png^techage_frame8_ta5.png^[transformFX", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 32, + aspect_h = 32, + length = 2.0, + }, + }, + { + image = "techage_filling8_ta4.png^techage_appl_pump8.png^techage_frame8_ta5.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 32, + aspect_h = 32, + length = 2.0, + }, + }, +} + +minetest.register_node("techage:t5_pump", { + description = S("TA5 Pump"), + tiles = tiles_pas, + after_place_node = after_place_node, + on_rightclick = on_rightclick, + on_timer = node_timer, + after_dig_node = after_dig_node, + on_rotate = screwdriver.disallow, + paramtype2 = "facedir", + on_rotate = screwdriver.disallow, + groups = {cracky=2}, + is_ground_content = false, + sounds = default.node_sound_metal_defaults(), + ta4_formspec = WRENCH_MENU, +}) + +minetest.register_node("techage:t5_pump_on", { + description = S("TA5 Pump"), + tiles = tiles_act, + --after_place_node = after_place_node4, + on_rightclick = on_rightclick, + on_timer = node_timer, + after_dig_node = after_dig_node, + on_rotate = screwdriver.disallow, + paramtype2 = "facedir", + on_rotate = screwdriver.disallow, + diggable = false, + groups = {not_in_creative_inventory=1}, + is_ground_content = false, + sounds = default.node_sound_metal_defaults(), +}) + +techage.register_node({"techage:t5_pump", "techage:t5_pump_on"}, { + on_recv_message = function(pos, src, topic, payload) + return State:on_receive_message(pos, topic, payload) + end, +}) + +-- Pumps have to provide one output and one input side +liquid.register_nodes({ + "techage:t5_pump", "techage:t5_pump_on", +}, Pipe2, "pump", {"L"}, {}) + +liquid.register_nodes({ + "techage:t5_pump", "techage:t5_pump_on", +}, Pipe3, "pump", {"R"}, {}) + +--minetest.register_craft({ +-- output = "techage:t5_pump", +-- recipe = { +-- {"default:tin_ingot", "dye:red", "default:steel_ingot"}, +-- {"", "techage:t4_pump", ""}, +-- {"", "", ""}, +-- }, +--}) diff --git a/fusion_reactor/turbine.lua b/fusion_reactor/turbine.lua index 26afdec..c1ff988 100644 --- a/fusion_reactor/turbine.lua +++ b/fusion_reactor/turbine.lua @@ -134,19 +134,22 @@ Pipe:set_valid_sides("techage:ta5_turbine", {"L", "U"}) Pipe:set_valid_sides("techage:ta5_turbine_on", {"L", "U"}) techage.register_node({"techage:ta5_turbine", "techage:ta5_turbine_on"}, { + -- used by heatexchanger1 on_transfer = function(pos, in_dir, topic, payload) local nvm = techage.get_nvm(pos) - if topic == "start" then -- used by heatexchanger1 + if topic == "trigger" then + return generator_cmnd(pos, topic, payload) + elseif topic == "start" then swap_node(pos, "techage:ta5_turbine_on") play_sound(pos) return generator_cmnd(pos, topic, payload) - elseif topic == "stop" then -- used by heatexchanger1 + elseif topic == "stop" then swap_node(pos, "techage:ta5_turbine") stop_sound(pos) return generator_cmnd(pos, topic, payload) - elseif topic == "turbine" then -- used by heatexchanger1 + elseif topic == "turbine" then return true - else -- used by heatexchanger1 + else return generator_cmnd(pos, topic, payload) end end, diff --git a/init.lua b/init.lua index e4068b1..8e8accd 100644 --- a/init.lua +++ b/init.lua @@ -408,8 +408,9 @@ dofile(MP.."/fusion_reactor/controller.lua") dofile(MP.."/fusion_reactor/heatexchanger3.lua") dofile(MP.."/fusion_reactor/heatexchanger2.lua") dofile(MP.."/fusion_reactor/heatexchanger1.lua") ---dofile(MP.."/fusion_reactor/generator.lua") +dofile(MP.."/fusion_reactor/generator.lua") dofile(MP.."/fusion_reactor/turbine.lua") +dofile(MP.."/fusion_reactor/ta5_pump.lua") -- Prevent other mods from using IE techage.IE = nil diff --git a/items/registered_nodes.lua b/items/registered_nodes.lua index 1fdbe79..a6a6bae 100644 --- a/items/registered_nodes.lua +++ b/items/registered_nodes.lua @@ -64,3 +64,4 @@ techage.register_mobs_mods("wildlife") techage.register_mobs_mods("mobs_skeletons") techage.register_mobs_mods("mobs_dwarves") techage.register_mobs_mods("mobf_trader") +techage.register_mobs_mods("ts_vehicles") diff --git a/ta3_power/tiny_generator.lua b/ta3_power/tiny_generator.lua index 3b172bd..4ee931b 100644 --- a/ta3_power/tiny_generator.lua +++ b/ta3_power/tiny_generator.lua @@ -127,10 +127,10 @@ local function node_timer(pos, elapsed) local fuel = has_fuel(pos, nvm) if running and not fuel then State:standby(pos, nvm, S("no fuel")) - stop_node(pos, nvm, State) + stop_node(pos, nvm, State) elseif not running and fuel then State:start(pos, nvm) - -- start_node() is called implicit + -- start_node() is called implicit elseif running then local meta = M(pos) local outdir = meta:get_int("outdir") diff --git a/textures/techage_appl_plasma4.png b/textures/techage_appl_plasma4.png index 99134e11869886b7b8ab2c898242ce2a04a840bd..eb3cd7098bd475ac59a9acd4ba5e42ac10373434 100644 GIT binary patch delta 592 zcmX@a`jTaWO1*u6Plzi65JbeWPMs%y?F?f{ErXLg>$!XG1wJ5gAkfz5%kgDju!Qx_ zYu3Y;Sa+P@i`C_CFJrJY7df)OW8Lo43B|cUWt=5Je!<%R!GOU(|MAHX1_s6po-U3d z6}R5b?w!=6AmZk&d)u`BQtkirSOFK8xA(Tyue^EFc7EE@0+A<1pG4a~dCCF}+Q7IY zMvvW5?c{p487%TmK0*xt89r!wu*_lUY~k?9JE8UR#Q(GC4h)D&x#%a=YQBk%%jYtNrokWeKi=w@P(?S>=>W zosoO5{&<1-=IiDvm!rhBCLLSDwXDv%ud4dN#DaInkLG@P=rf<=fxgY74@TxpXM#P;`R0)`1kas6~6ChxvW*^|8FU8 z`Y#uTAM9Z37#RLBp7&t*#xPewFd#IvJpU>~Q{Kh0NgO*kFY($ej$hk;#7Thh@S2)y zdxBX{Jlzopr0CJ7^xc~qF delta 682 zcmaFKa)@<;N_|>@Pl&5~fe-89OAK}{tfy`+8Rx~iUc`_DMvFU+GFY1Pr8)Aqmx&zNFL~z@gRUX#gZB*D`uv4q44QiUCDEPBwsfr7 z*}iEXgNAPV_Cs6_F)ctdIZJ~4f*JmUfp)#Wq`8JO0|OJ2r;B4q#jUrqyMvky1Y8#` zjqn!y#jx?mf&c$K&0B0XzB8J8&Z4S6cq#+CP?_W=uSpCH?+%phu1#3rTer2rtRiKB zufh-Zro5e4g|Xg}$FnAh`s~)!S`>U=YwMC(o=3S}Ot^e5_Ns42@3s$3UvJ6XT~xOI zOC-mx34ONa%P;yK7b{=b<9@L(QA_&BpWCl9)+g!lEV(O_sSvn@?aktZY3h@wdz;Pd zYf1@v>C-8#viaPLxM}Bhs5^ZSmn#H?>lOY0`-TU0P4&vm+8PpK*Z99}j-0-wuAuau z`n-y^ugtf#*2wR;xqjZyY0Ih{w>{A}{~Tl&3~37`JD?Gctg^1S6&?ADc~N{%TX zzCUM8z0R_oK!oGt6|(CBRaP9Y zy}j!yi&$8~wmjumCzVCEy!&x6^TaNJ`K{MGS(_uI10VM$D*rQ|WO?XxMX^GxU!unR z>1{VgQu8<%U$HYZsQhHQbo7pD`Wnk{ko!Dc L{an^LB{Ts5jH@ca diff --git a/textures/techage_gas_inv.png b/textures/techage_gas_inv.png index 75651789899c46a88f4004352fce46bbd60d89ed..ea6868d840576ff1e719006d8be226e22abb706c 100644 GIT binary patch delta 488 zcmVSB!3l9OjJcja7-U&m=|G{+me#B5)#gBZE>HzQBbs@00003bW%=J z047Z_#d_BO00EgvL_t(Y$F-GBj>8}fg_|k|NTeJfBlQN5eKI&F2))7F{|r-N@DDic zW`+fg$|v5lG3Ivr^D&NJZM7s_4^U>E`9WGwM=hgF4^-SxDs*%}#P9L8DV&=Ec edN#}{_ zzBuu|3$*H(Gf?aCHvnK<3p}5&LN8{@%7Y7Z+ z3gXriVmO%!!hetoE`d(i$Rj#ttbD~D;W#mMNU3JZomiw)$BD>TZV|d{83OlQacQ+t zwui^zU8h#3L{QY^HTEZA8y??^bl*%*FbxB?-Cp+n?&_~9I zwU0UrG+8*comNh!n39B%4ui;~lLQUH6QfvK`b=iBCcN9lkXf@q?sRe{`!A(NuKL-S zKS&hfyP#i%IfsnfZK@dK)rd?EJj1$?2N>o}WyIGxj9z`0Xir5)K z)#TtwT6o6T2cw~)W5FEFrpX8(Nda(yh@QQMgUidn_`3+D^@8q@KylVWz Z`T;^_#|r~8?dt#l002ovPDHLkV1iiBEIR-I diff --git a/textures/techage_isobutane_inv.png b/textures/techage_isobutane_inv.png index 2189b67b1fc7f52c1579d97fb4ae3aefaa2d462b..432c96df7ed679342ba8e9812a4f1aeede434dab 100644 GIT binary patch delta 416 zcmV;R0bl;U1g-;+7=Ho-0000u#qx6i000b7OjJcja7+z_4Ue>sRH;-)7;A_C0004W zQchCHweuEddxbfq306OR7Zxmw!cuUcQ+0degny#xGOc zR*^*swI}H{@k*$RBq*Wy=z^*!5j=^BkBFyq`#-TlhGIozFJ{Rc(bvRjBIZfwB$&xf z2ni#+le-WjRso)xybw2dNYO^DcKFdGS_L=?iNZF(qRGmq=nIKfPLmgRG2CZGa6j?w*zAf{3swmAZ35#=W&tHCNejuTn}e zgoun9qR(X@w!s>i*idSp$wVS6OGH+I$}2QcJ>6VbK>4Dp>4lu3;(U;@48 z#KViMu|-_JM#Khz139){hLj+Y9UgFFUG?L^jQxkJI zVaSwNd65;CM7oxbh}MZn3L!b-K^F}(KPvLEZmMZyPPwx0R86x2em_Qf;D-!UWCl>|@g006*A zL_t&-(=CrX4#F@H1t(4{Q6i-D5f#TU-#UPo^B4h_p`oWC4VU2vG~qd6tI_Uw_nAlk zef53+A>m_ynV`0S-whB$b)w5q)ib)v%qX(6HA!pEQ*XAXqIp+g^XeAv$Y}q$dg`K#^(O z_={%fc*8k|YLu@~ttOKkm10S{C_HFmDVZWJlH;y=z8?1G!wAOB#{=9l`=#UrrUb4r0tYMOU}buFK`ZY zr){OQ9H>Ro86gMg{Gff_ghqP{U^7C+zDn;8+NM}*tWrBnZAL)89*CA-J7p0O7& z0J2OemLveAB|yel080nCh3VNr2BH^;6~e6O)I1VUe2TUJazx$u=e6&#!m;XuUt%0% Z`~xGfIW3u^PtyPZ002ovPDHLkV1glul1Bgl