Smart Pipes(reborn) (#58038)

How these new pipes work.
-Smart pipes autoconnect to nearby smart pipes
-They are now color coded, so they only connect to the same colored pipe, the GREY pipe is the wildcard and can connect to every other color, so be aware of this
-ALL components spawned by the RPD can be colored (from pumps to connectors, from pipes to manifolds), if you leave them GREY they can connect to every other color. Color adapters can be colored, but they'll still connect two pipes with different colors. BUILDABLE machines are GREY (thermomachines, cryo, HFR) so be aware of this
-Trying to go across another smart pipe will now build a bridge pipe automatically already colored of the color you choose, so you don't have to place it yourself anymore (is still available in the RPD tho)
-ALL binary components, layer manifolds, color adapters and bridge pipe can be put ONTOP of a smart pipe, but not on another of these. Smart pipes can't be placed on top of these pipes, so you have to build them first.
-Lcrossings can't be made anymore (sorry y'all i tryed, if someone have a way of doing them ping me on discord)
-REMEMBER you still have 5 layers to go, these rules apply to the same layer pipes, so if you do a crossing on different layers you won't see a bridge pipe appear.
This commit is contained in:
Ghilker
2021-04-05 20:55:41 -04:00
committed by GitHub
parent db09fae62e
commit 3e8407c471
81 changed files with 89268 additions and 91107 deletions
-71
View File
@@ -391,77 +391,6 @@ INITIALIZE_IMMEDIATE(/obj/effect/mapping_helpers/no_lava)
log_mapping("[src] at [x],[y] could not find an airlock on current turf, cannot place paper note.")
qdel(src)
/obj/effect/mapping_helpers/simple_pipes
name = "Simple Pipes"
late = TRUE
icon_state = "pipe-3"
var/piping_layer = 3
var/pipe_color = ""
var/connection_num = 0
var/hide = FALSE
/obj/effect/mapping_helpers/simple_pipes/LateInitialize()
var/list/connections = list( dir2text(NORTH) = FALSE, dir2text(SOUTH) = FALSE , dir2text(EAST) = FALSE , dir2text(WEST) = FALSE)
var/list/valid_connectors = typecacheof(/obj/machinery/atmospherics)
for(var/direction in connections)
var/turf/T = get_step(src, text2dir(direction))
for(var/machine_type_owo in T.contents)
if(istype(machine_type_owo,type))
var/obj/effect/mapping_helpers/simple_pipes/found = machine_type_owo
if(found.piping_layer != piping_layer)
continue
connections[direction] = TRUE
connection_num++
break
if(!is_type_in_typecache(machine_type_owo,valid_connectors))
continue
var/obj/machinery/atmospherics/machine = machine_type_owo
if(machine.piping_layer != piping_layer)
continue
if(angle2dir(dir2angle(text2dir(direction))+180) & machine.initialize_directions)
connections[direction] = TRUE
connection_num++
break
switch(connection_num)
if(1)
for(var/direction in connections)
if(connections[direction] != TRUE)
continue
spawn_pipe(direction,/obj/machinery/atmospherics/pipe/simple)
if(2)
for(var/direction in connections)
if(connections[direction] != TRUE)
continue
//Detects straight pipes connected from east to west , north to south etc.
if(connections[dir2text(angle2dir(dir2angle(text2dir(direction))+180))] == TRUE)
spawn_pipe(direction,/obj/machinery/atmospherics/pipe/simple)
break
for(var/direction2 in connections - direction)
if(connections[direction2] != TRUE)
continue
spawn_pipe(dir2text(text2dir(direction)+text2dir(direction2)),/obj/machinery/atmospherics/pipe/simple)
if(3)
for(var/direction in connections)
if(connections[direction] == FALSE)
spawn_pipe(direction,/obj/machinery/atmospherics/pipe/manifold)
if(4)
spawn_pipe(dir2text(NORTH),/obj/machinery/atmospherics/pipe/manifold4w)
qdel(src)
//spawn pipe
/obj/effect/mapping_helpers/simple_pipes/proc/spawn_pipe(direction,type )
var/obj/machinery/atmospherics/pipe/pipe = new type(get_turf(src),TRUE,text2dir(direction))
pipe.hide = hide
pipe.piping_layer = piping_layer
pipe.update_layer()
pipe.paint(pipe_color)
//This helper applies traits to things on the map directly.
/obj/effect/mapping_helpers/trait_injector
name = "Trait Injector"