From 6ae984971cfdbc9d72d4c520efe381193babfecd Mon Sep 17 00:00:00 2001 From: Putnam Date: Tue, 30 Mar 2021 23:25:36 -0700 Subject: [PATCH 1/3] Ported bluespace pipes from yogs --- code/game/machinery/pipe/construction.dm | 19 ++++ .../atmospherics/machinery/pipes/bluespace.dm | 86 ++++++++++++++++++ .../research/designs/bluespace_designs.dm | 10 ++ .../research/techweb/nodes/bluespace_nodes.dm | 2 +- icons/obj/atmospherics/pipes/bluespace.dmi | Bin 0 -> 677 bytes 5 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 code/modules/atmospherics/machinery/pipes/bluespace.dm create mode 100644 icons/obj/atmospherics/pipes/bluespace.dmi diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 141afa53e7..d825cb5a23 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -236,3 +236,22 @@ Buildable meters /obj/item/pipe_meter/proc/setAttachLayer(new_layer = PIPING_LAYER_DEFAULT) piping_layer = new_layer PIPING_LAYER_DOUBLE_SHIFT(src, piping_layer) + +/obj/item/pipe/bluespace + pipe_type = /obj/machinery/atmospherics/pipe/bluespace + var/bluespace_network_name = "default" + icon_state = "bluespace" + disposable = FALSE + +/obj/item/pipe/bluespace/attack_self(mob/user) + var/new_name = input(user, "Enter identifier for bluespace pipe network", "bluespace pipe", bluespace_network_name) as text|null + if(!isnull(new_name)) + bluespace_network_name = new_name + +/obj/item/pipe/bluespace/make_from_existing(obj/machinery/atmospherics/pipe/bluespace/make_from) + bluespace_network_name = make_from.bluespace_network_name + return ..() + +/obj/item/pipe/bluespace/build_pipe(obj/machinery/atmospherics/pipe/bluespace/A) + A.bluespace_network_name = bluespace_network_name + return ..() diff --git a/code/modules/atmospherics/machinery/pipes/bluespace.dm b/code/modules/atmospherics/machinery/pipes/bluespace.dm new file mode 100644 index 0000000000..2735a38106 --- /dev/null +++ b/code/modules/atmospherics/machinery/pipes/bluespace.dm @@ -0,0 +1,86 @@ +GLOBAL_LIST_EMPTY(bluespace_pipe_networks) +/obj/machinery/atmospherics/pipe/bluespace + name = "bluespace pipe" + desc = "Transmits gas across large distances of space. Developed using bluespace technology." + icon = 'icons/obj/atmospherics/pipes/bluespace.dmi' + icon_state = "map" + pipe_state = "bluespace" + dir = SOUTH + initialize_directions = SOUTH + device_type = UNARY + can_buckle = FALSE + construction_type = /obj/item/pipe/bluespace + var/bluespace_network_name + +/obj/machinery/atmospherics/pipe/bluespace/New() + icon_state = "pipe" + if(bluespace_network_name) // in case someone maps one in for some reason + if(!GLOB.bluespace_pipe_networks[bluespace_network_name]) + GLOB.bluespace_pipe_networks[bluespace_network_name] = list() + GLOB.bluespace_pipe_networks[bluespace_network_name] |= src + ..() + +/obj/machinery/atmospherics/pipe/bluespace/on_construction() + . = ..() + if(bluespace_network_name) + if(!GLOB.bluespace_pipe_networks[bluespace_network_name]) + GLOB.bluespace_pipe_networks[bluespace_network_name] = list() + GLOB.bluespace_pipe_networks[bluespace_network_name] |= src + +/obj/machinery/atmospherics/pipe/bluespace/Destroy() + if(GLOB.bluespace_pipe_networks[bluespace_network_name]) + GLOB.bluespace_pipe_networks[bluespace_network_name] -= src + for(var/p in GLOB.bluespace_pipe_networks[bluespace_network_name]) + var/obj/machinery/atmospherics/pipe/bluespace/P = p + QDEL_NULL(P.parent) + P.build_network() + return ..() + +/obj/machinery/atmospherics/pipe/bluespace/examine(user) + . = ..() + . += "This one is connected to the \"[html_encode(bluespace_network_name)]\" network." + +/obj/machinery/atmospherics/pipe/bluespace/SetInitDirections() + initialize_directions = dir + +/obj/machinery/atmospherics/pipe/bluespace/pipeline_expansion() + return ..() + GLOB.bluespace_pipe_networks[bluespace_network_name] - src + +/obj/machinery/atmospherics/pipe/bluespace/hide() + update_icon() + +/obj/machinery/atmospherics/pipe/bluespace/update_icon(showpipe) + underlays.Cut() + + var/turf/T = loc + if(level == 2 || !T.intact) + showpipe = TRUE + plane = GAME_PLANE + else + showpipe = FALSE + plane = FLOOR_PLANE + + if(!showpipe) + return //no need to update the pipes if they aren't showing + + var/connected = 0 //Direction bitset + + for(var/i in 1 to device_type) //adds intact pieces + if(nodes[i]) + var/obj/machinery/atmospherics/node = nodes[i] + var/image/img = get_pipe_underlay("pipe_intact", get_dir(src, node), node.pipe_color) + underlays += img + connected |= img.dir + + for(var/direction in GLOB.cardinals) + if((initialize_directions & direction) && !(connected & direction)) + underlays += get_pipe_underlay("pipe_exposed", direction) + +/obj/machinery/atmospherics/pipe/bluespace/paint() + return FALSE + +/obj/machinery/atmospherics/pipe/bluespace/proc/get_pipe_underlay(state, dir, color = null) + if(color) + . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir, color) + else + . = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', state, dir) diff --git a/code/modules/research/designs/bluespace_designs.dm b/code/modules/research/designs/bluespace_designs.dm index a70449b035..cf6aff5918 100644 --- a/code/modules/research/designs/bluespace_designs.dm +++ b/code/modules/research/designs/bluespace_designs.dm @@ -105,3 +105,13 @@ materials = list(/datum/material/iron = 2000, /datum/material/bluespace = 500) category = list("Bluespace Designs") departmental_flags = DEPARTMENTAL_FLAG_SERVICE + +/datum/design/bluespace_pipe + name = "Bluespace Pipe" + desc = "A pipe that teleports gases." + id = "bluespace_pipe" + build_type = PROTOLATHE + materials = list(/datum/material/gold = 1000, /datum/material/diamond = 750, /datum/material/uranium = 250, /datum/material/bluespace = 2000) + build_path = /obj/item/pipe/bluespace + category = list("Bluespace Designs") + departmental_flags = DEPARTMENTAL_FLAG_SCIENCE | DEPARTMENTAL_FLAG_ENGINEERING diff --git a/code/modules/research/techweb/nodes/bluespace_nodes.dm b/code/modules/research/techweb/nodes/bluespace_nodes.dm index 6c782456a8..90b69eb28d 100644 --- a/code/modules/research/techweb/nodes/bluespace_nodes.dm +++ b/code/modules/research/techweb/nodes/bluespace_nodes.dm @@ -61,7 +61,7 @@ display_name = "Bluespace Travel" description = "Application of Bluespace for static teleportation technology." prereq_ids = list("adv_power", "adv_bluespace") - design_ids = list("tele_station", "tele_hub", "quantumpad", "quantum_keycard", "launchpad", "launchpad_console", "teleconsole", "roastingstick") + design_ids = list("tele_station", "tele_hub", "quantumpad", "quantum_keycard", "launchpad", "launchpad_console", "teleconsole", "roastingstick", "bluespace_pipe") research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) /datum/techweb_node/unregulated_bluespace diff --git a/icons/obj/atmospherics/pipes/bluespace.dmi b/icons/obj/atmospherics/pipes/bluespace.dmi new file mode 100644 index 0000000000000000000000000000000000000000..866e6f9b844f4f4a9c987755618f0d3ca5a9087f GIT binary patch literal 677 zcmV;W0$TlvP)V!Y0R8_htE;PQY;6CPVgJl#eSLkvz`zX+ z4PIVegM)*(xVRY^86O`X8X6k4wY41`9b#f)x3{;3hK3s(8(CRdw6wG%F=jRZ0004W zQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ> zRWQ*r;NmRLOex6#a*U0*I5Sc+(=$pSoZ^zil2jm5sUWi;Rf&r;C9|j)$Tj5ROe;#v zO$D*dfTF26iIpH>9g-lz^xVV(?1me1DJ!`8xqzJv05#Dr#k$KneEa!CT?#h!$R^WZnO?Z6-nypoZd+G38!XgQfoq6@ci9H62}G(+w9DyIQ0_?@P`l4G z5M2s_ra$GMmx8vH225?6X&^ew3KX5iA!PKlf-bF)x-PfEj?)4ZJrL6_qYv-Uv;L0# zoip4mXY(DrW^FiQc^8sh|G2gR3A4q>z=LcoJ z81j9J->l?+89!8=QvTQH15)RMw8Nn4vH*2HkP1EjhkLqq1~wnqd|()cVHl6W;R>dI zjQvQA5QjsYa}CI#pYwf>GMMr`%3#j-D1$lQ!*(#`d)yiP Date: Tue, 30 Mar 2021 23:35:47 -0700 Subject: [PATCH 2/3] why did this not update --- tgstation.dme | 1 + 1 file changed, 1 insertion(+) diff --git a/tgstation.dme b/tgstation.dme index db49b62864..d3ade0623e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1808,6 +1808,7 @@ #include "code\modules\atmospherics\machinery\components\unary_devices\vent_scrubber.dm" #include "code\modules\atmospherics\machinery\other\meter.dm" #include "code\modules\atmospherics\machinery\other\miner.dm" +#include "code\modules\atmospherics\machinery\pipes\bluespace.dm" #include "code\modules\atmospherics\machinery\pipes\layermanifold.dm" #include "code\modules\atmospherics\machinery\pipes\manifold.dm" #include "code\modules\atmospherics\machinery\pipes\manifold4w.dm" From 68ad5c2e5c6db6badfea8ecd22f50ee5b88bb436 Mon Sep 17 00:00:00 2001 From: Putnam Date: Tue, 30 Mar 2021 23:56:12 -0700 Subject: [PATCH 3/3] disposability --- code/game/machinery/pipe/construction.dm | 1 + code/game/objects/items/RPD.dm | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index d825cb5a23..5b30105409 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -21,6 +21,7 @@ Buildable meters level = 2 var/piping_layer = PIPING_LAYER_DEFAULT var/RPD_type + var/disposable = TRUE /obj/item/pipe/directional RPD_type = PIPE_UNARY diff --git a/code/game/objects/items/RPD.dm b/code/game/objects/items/RPD.dm index 70e4441c66..635ea97902 100644 --- a/code/game/objects/items/RPD.dm +++ b/code/game/objects/items/RPD.dm @@ -375,12 +375,14 @@ GLOBAL_LIST_INIT(fluid_duct_recipes, list( . = TRUE if((mode & DESTROY_MODE) && istype(A, /obj/item/pipe) || istype(A, /obj/structure/disposalconstruct) || istype(A, /obj/structure/c_transit_tube) || istype(A, /obj/structure/c_transit_tube_pod) || istype(A, /obj/item/pipe_meter)) - to_chat(user, "You start destroying a pipe...") - playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) - if(do_after(user, destroy_speed, target = A)) - activate() - qdel(A) - return + var/obj/item/pipe/P = A + if(!istype(P) || P.disposable) + to_chat(user, "You start destroying a pipe...") + playsound(get_turf(src), 'sound/machines/click.ogg', 50, 1) + if(do_after(user, destroy_speed, target = A)) + activate() + qdel(A) + return if((mode & PAINT_MODE)) if(istype(A, /obj/machinery/atmospherics/pipe) && !istype(A, /obj/machinery/atmospherics/pipe/layer_manifold))