From 36248341c3ffae7e2150b045570211012a14e389 Mon Sep 17 00:00:00 2001 From: Chituka Date: Fri, 10 May 2024 22:04:43 +0300 Subject: [PATCH 1/2] Choose layers for circulator and engine heater Lets you choose pipe layer for circulator and engine heater by using multitool. --- code/game/machinery/shuttle/shuttle_heater.dm | 9 ++++++++- .../items/circuitboards/machine_circuitboards.dm | 11 +++++++++++ .../machinery/components/binary_devices/circulator.dm | 9 ++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/shuttle/shuttle_heater.dm b/code/game/machinery/shuttle/shuttle_heater.dm index 94735ba4ab25..70ecd5752a89 100644 --- a/code/game/machinery/shuttle/shuttle_heater.dm +++ b/code/game/machinery/shuttle/shuttle_heater.dm @@ -25,7 +25,7 @@ layer = OBJ_LAYER showpipe = TRUE - pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY + pipe_flags = PIPING_ONE_PER_TURF var/efficiency_multiplier = 1 var/gas_capacity = 0 @@ -34,6 +34,13 @@ ///The internals tank to draw from var/obj/item/tank/fuel_tank +/obj/machinery/atmospherics/components/unary/shuttle/heater/on_construction(obj_color, set_layer) + var/obj/item/circuitboard/machine/shuttle/heater/board = circuit + if(board) + piping_layer = board.pipe_layer + set_layer = piping_layer + ..() + /obj/machinery/atmospherics/components/unary/shuttle/heater/New() . = ..() SetInitDirections() diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index 6a5fa6e70a12..ca4b655885d7 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -201,8 +201,19 @@ name = "Circulator/Heat Exchanger (Machine Board)" icon_state = "engineering" build_path = /obj/machinery/atmospherics/components/binary/circulator + var/pipe_layer = PIPING_LAYER_DEFAULT req_components = list() +/obj/item/circuitboard/machine/circulator/attackby(obj/item/I, mob/user, params) + if(I.tool_behaviour == TOOL_MULTITOOL) + pipe_layer = (pipe_layer >= PIPING_LAYER_MAX) ? PIPING_LAYER_MIN : (pipe_layer + 1) + to_chat(user, "You change the circuitboard to layer [pipe_layer].") + return + +/obj/item/circuitboard/machine/circulator/examine() + . = ..() + . += "It is set to layer [pipe_layer]." + /obj/item/circuitboard/machine/emitter name = "Emitter (Machine Board)" icon_state = "engineering" diff --git a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm index 9f2d582be256..30703b2f4a02 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/circulator.dm @@ -15,12 +15,19 @@ var/active = FALSE var/last_pressure_delta = 0 - pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY + pipe_flags = PIPING_ONE_PER_TURF var/flipped = 0 var/mode = CIRCULATOR_HOT var/obj/machinery/power/generator/generator +/obj/machinery/atmospherics/components/unary/shuttle/heater/on_construction(obj_color, set_layer) + var/obj/item/circuitboard/machine/circulator/board = circuit + if(board) + piping_layer = board.pipe_layer + set_layer = piping_layer + ..() + //for mappers /obj/machinery/atmospherics/components/binary/circulator/cold mode = CIRCULATOR_COLD From 3be8910fee7117508d46902275d2f301ea8b0d7e Mon Sep 17 00:00:00 2001 From: Chituka Date: Fri, 10 May 2024 22:34:05 +0300 Subject: [PATCH 2/2] I forgor about heater Whoopsies, I haven't included engine heaters in my previous commit! --- .../items/circuitboards/machine_circuitboards.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/game/objects/items/circuitboards/machine_circuitboards.dm b/code/game/objects/items/circuitboards/machine_circuitboards.dm index ca4b655885d7..1b8ffef10cd5 100644 --- a/code/game/objects/items/circuitboards/machine_circuitboards.dm +++ b/code/game/objects/items/circuitboards/machine_circuitboards.dm @@ -1481,10 +1481,22 @@ /obj/item/circuitboard/machine/shuttle/heater name = "Fueled Engine Heater (Machine Board)" + desc = "You can use mulitool to switch pipe layers" build_path = /obj/machinery/atmospherics/components/unary/shuttle/heater + var/pipe_layer = PIPING_LAYER_DEFAULT req_components = list(/obj/item/stock_parts/micro_laser = 2, /obj/item/stock_parts/matter_bin = 1) +/obj/item/circuitboard/machine/shuttle/heater/attackby(obj/item/I, mob/user, params) + if(I.tool_behaviour == TOOL_MULTITOOL) + pipe_layer = (pipe_layer >= PIPING_LAYER_MAX) ? PIPING_LAYER_MIN : (pipe_layer + 1) + to_chat(user, "You change the circuitboard to layer [pipe_layer].") + return + +/obj/item/circuitboard/machine/shuttle/heater/examine() + . = ..() + . += "It is set to layer [pipe_layer]." + /obj/item/circuitboard/machine/shuttle/smes name = "Electric Engine Precharger (Machine Board)" build_path = /obj/machinery/power/smes/shuttle