Skip to content

Commit

Permalink
Choose layers for circulator and engine heater (#2977)
Browse files Browse the repository at this point in the history
## About The Pull Request

Lets you choose pipe layer for circulator and engine heater by using
multitool on circuitboard. I literally just copy-pasted freezers code.

Unfortunately, sprites aren't compatible with these changes, so this
problem needs to be solved by brave spriters.

## Why It's Good For The Game

Makes engine heaters and circulators more flexible and easier to place
for both mappers and players.

## Changelog

:cl:
add: Layer changing to engine heaters and freezers
  • Loading branch information
Chituka authored May 27, 2024
1 parent 9c7b138 commit dd87d96
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
9 changes: 8 additions & 1 deletion code/game/machinery/shuttle/shuttle_heater.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down
23 changes: 23 additions & 0 deletions code/game/objects/items/circuitboards/machine_circuitboards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='notice'>You change the circuitboard to layer [pipe_layer].</span>")
return

/obj/item/circuitboard/machine/circulator/examine()
. = ..()
. += "<span class='notice'>It is set to layer [pipe_layer].</span>"

/obj/item/circuitboard/machine/emitter
name = "Emitter (Machine Board)"
icon_state = "engineering"
Expand Down Expand Up @@ -1470,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, "<span class='notice'>You change the circuitboard to layer [pipe_layer].</span>")
return

/obj/item/circuitboard/machine/shuttle/heater/examine()
. = ..()
. += "<span class='notice'>It is set to layer [pipe_layer].</span>"

/obj/item/circuitboard/machine/shuttle/smes
name = "Electric Engine Precharger (Machine Board)"
build_path = /obj/machinery/power/smes/shuttle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dd87d96

Please sign in to comment.