Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

[MIRROR] Bluespace pipes #2550

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion code/__DEFINES/pipe_construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Construction breaks otherwise
#define PIPE_HE_MANIFOLD /obj/machinery/atmospherics/pipe/heat_exchanging/manifold
#define PIPE_HE_4WAYMANIFOLD /obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w
#define PIPE_JUNCTION /obj/machinery/atmospherics/pipe/heat_exchanging/junction
#define PIPE_BLUESPACE /obj/machinery/atmospherics/pipe/bluespace
//Unary
#define PIPE_CONNECTOR /obj/machinery/atmospherics/components/unary/portables_connector
#define PIPE_UVENT /obj/machinery/atmospherics/components/unary/vent_pump
Expand Down Expand Up @@ -56,4 +57,4 @@ Construction breaks otherwise
#define STATION_TUBE_OPEN 0
#define STATION_TUBE_OPENING 1
#define STATION_TUBE_CLOSED 2
#define STATION_TUBE_CLOSING 3
#define STATION_TUBE_CLOSING 3
3 changes: 3 additions & 0 deletions code/game/machinery/pipe/construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Buildable meters
PIPE_HE_MANIFOLD, \
PIPE_HE_4WAYMANIFOLD, \
PIPE_JUNCTION, \
PIPE_BLUESPACE, \
\
PIPE_CONNECTOR, \
PIPE_UVENT, \
Expand Down Expand Up @@ -90,6 +91,7 @@ GLOBAL_LIST_INIT(pipeID2State, list(
"[PIPE_HE_MANIFOLD]" = "he_manifold", \
"[PIPE_HE_4WAYMANIFOLD]" = "he_manifold4w", \
"[PIPE_JUNCTION]" = "junction", \
"[PIPE_BLUESPACE]" = "bluespace", \
\
"[PIPE_CONNECTOR]" = "connector", \
"[PIPE_UVENT]" = "uvent", \
Expand Down Expand Up @@ -118,6 +120,7 @@ GLOBAL_LIST_INIT(pipeID2State, list(
"[PIPE_HE_MANIFOLD]" = "h/e manifold", \
"[PIPE_HE_4WAYMANIFOLD]"= "h/e 4-way manifold", \
"[PIPE_JUNCTION]" = "junction", \
"[PIPE_BLUESPACE]" = "bluespace pipe", \
\
"[PIPE_CONNECTOR]" = "connector", \
"[PIPE_UVENT]" = "vent", \
Expand Down
3 changes: 2 additions & 1 deletion code/game/machinery/pipe/pipe_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
if(..())
return 1
var/dat = {"
<b>Regular pipes:</b><BR>
<b>Pipes:</b><BR>
<A href='?src=\ref[src];make=[PIPE_SIMPLE];dir=1'>Pipe</A><BR>
<A href='?src=\ref[src];make=[PIPE_SIMPLE];dir=5'>Bent Pipe</A><BR>
<A href='?src=\ref[src];make=[PIPE_MANIFOLD];dir=1'>Manifold</A><BR>
<A href='?src=\ref[src];make=[PIPE_4WAYMANIFOLD];dir=1'>4-Way Manifold</A><BR>
<A href='?src=\ref[src];make=[PIPE_MVALVE];dir=1'>Manual Valve</A><BR>
<A href='?src=\ref[src];make=[PIPE_DVALVE];dir=1'>Digital Valve</A><BR>
<A href='?src=\ref[src];make=[PIPE_BLUESPACE];dir=1'>Bluespace Pipe</A><BR>
<b>Devices:</b><BR>
<A href='?src=\ref[src];make=[PIPE_CONNECTOR];dir=1'>Connector</A><BR>
<A href='?src=\ref[src];make=[PIPE_UVENT];dir=1'>Vent</A><BR>
Expand Down
19 changes: 12 additions & 7 deletions code/game/objects/items/devices/pipe_painter.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
GLOBAL_LIST_INIT(pipe_paint_colors, list("grey"=rgb(255,255,255), "red"=rgb(255,0,0), "blue"=rgb(0,0,255), "cyan"=rgb(0,256,249), "green"=rgb(30,255,0), "yellow"=rgb(255,198,0), "purple"=rgb(130,43,255)))

/obj/item/device/pipe_painter
name = "pipe painter"
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "labeler1"
item_state = "flight"
<<<<<<< HEAD
flags = NOBLUDGEON
var/list/modes = list(
"grey" = rgb(255,255,255),
Expand All @@ -15,6 +17,10 @@
"purple" = rgb(130,43,255)
)
var/mode = "grey"
=======
flags_1 = NOBLUDGEON_1
var/paint_color = "grey"
>>>>>>> eb0a747... Merge pull request #30863 from pubby/bluepipe

materials = list(MAT_METAL=5000, MAT_GLASS=2000)

Expand All @@ -27,14 +33,13 @@
return

var/obj/machinery/atmospherics/pipe/P = A
P.add_atom_colour(modes[mode], FIXED_COLOUR_PRIORITY)
P.pipe_color = modes[mode]
user.visible_message("<span class='notice'>[user] paints \the [P] [mode].</span>","<span class='notice'>You paint \the [P] [mode].</span>")
P.update_node_icon() //updates the neighbors
if(P.paint(GLOB.pipe_paint_colors[paint_color]))
playsound(src, 'sound/machines/click.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] paints \the [P] [paint_color].</span>","<span class='notice'>You paint \the [P] [paint_color].</span>")

/obj/item/device/pipe_painter/attack_self(mob/user)
mode = input("Which colour do you want to use?","Pipe painter") in modes
paint_color = input("Which colour do you want to use?","Pipe painter") in GLOB.pipe_paint_colors

/obj/item/device/pipe_painter/examine()
/obj/item/device/pipe_painter/examine(mob/user)
..()
to_chat(usr, "It is set to [mode].")
to_chat(user, "<span class='notice'>It is set to [paint_color].</span>")
3 changes: 2 additions & 1 deletion code/game/objects/items/weapons/RPD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ GLOBAL_LIST_INIT(disposalpipeID2State, list(

//find these defines in code\game\machinery\pipe\consruction.dm
GLOBAL_LIST_INIT(RPD_recipes, list(
"Regular Pipes" = list(
"Pipes" = list(
"Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 1, PIPE_BENDABLE),
//"Bent Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 5, PIPE_BENT),
"Manifold" = new /datum/pipe_info(PIPE_MANIFOLD, 1, PIPE_TRINARY),
"Manual Valve" = new /datum/pipe_info(PIPE_MVALVE, 1, PIPE_BINARY),
"Digital Valve" = new /datum/pipe_info(PIPE_DVALVE, 1, PIPE_BINARY),
"4-Way Manifold" = new /datum/pipe_info(PIPE_4WAYMANIFOLD, 1, PIPE_QUAD),
"Bluespace Pipe" = new /datum/pipe_info(PIPE_BLUESPACE, 1, PIPE_UNARY),
),
"Devices"=list(
"Connector" = new /datum/pipe_info(PIPE_CONNECTOR, 1, PIPE_UNARY),
Expand Down
20 changes: 18 additions & 2 deletions code/modules/atmospherics/machinery/atmosmachinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Pipelines + Other Objects -> Pipe network

/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target)
if(target.initialize_directions & get_dir(target,src))
return 1
return TRUE

/obj/machinery/atmospherics/proc/pipeline_expansion()
return nodes
Expand Down Expand Up @@ -208,6 +208,17 @@ Pipelines + Other Objects -> Pipe network
pipe_overlay = . = pipeimages[identifier] = image(iconset, iconstate, dir = direction)
pipe_overlay.color = col

/obj/machinery/atmospherics/proc/icon_addintact(var/obj/machinery/atmospherics/node)
var/image/img = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_intact", get_dir(src,node), node.pipe_color)
underlays += img
return img.dir

/obj/machinery/atmospherics/proc/icon_addbroken(var/connected = FALSE)
var/unconnected = (~connected) & initialize_directions
for(var/direction in GLOB.cardinals)
if(unconnected & direction)
underlays += getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_exposed", direction)

/obj/machinery/atmospherics/on_construction(pipe_type, obj_color)
if(can_unwrench)
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
Expand Down Expand Up @@ -274,7 +285,7 @@ Pipelines + Other Objects -> Pipe network


/obj/machinery/atmospherics/proc/can_crawl_through()
return 1
return TRUE

/obj/machinery/atmospherics/proc/returnPipenets()
return list()
Expand All @@ -284,4 +295,9 @@ Pipelines + Other Objects -> Pipe network

//Used for certain children of obj/machinery/atmospherics to not show pipe vision when mob is inside it.
/obj/machinery/atmospherics/proc/can_see_pipes()
<<<<<<< HEAD
return 1
=======
return TRUE

>>>>>>> eb0a747... Merge pull request #30863 from pubby/bluepipe
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ On top of that, now people can add component-speciic procs/vars if they want!
Iconnery
*/

/obj/machinery/atmospherics/components/proc/icon_addintact(var/obj/machinery/atmospherics/node)
var/image/img = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_intact", get_dir(src,node), node.pipe_color)
underlays += img

return img.dir

/obj/machinery/atmospherics/components/proc/icon_addbroken(var/connected = FALSE)
var/unconnected = (~connected) & initialize_directions
for(var/direction in GLOB.cardinals)
if(unconnected & direction)
underlays += getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_exposed", direction)

/obj/machinery/atmospherics/components/proc/update_icon_nopipes()
return

Expand All @@ -52,7 +40,7 @@ Iconnery
if(!showpipe)
return //no need to update the pipes if they aren't showing

var/connected = FALSE
var/connected = 0 //Direction bitset

for(DEVICE_TYPE_LOOP) //adds intact pieces
if(NODE_I)
Expand Down
47 changes: 47 additions & 0 deletions code/modules/atmospherics/machinery/pipes/bluespace_pipe.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
GLOBAL_LIST_EMPTY(bluespace_pipes)

/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"
dir = SOUTH
initialize_directions = SOUTH
device_type = UNARY
can_buckle = FALSE

/obj/machinery/atmospherics/pipe/bluespace/New()
icon_state = "pipe"
GLOB.bluespace_pipes += src
..()

/obj/machinery/atmospherics/pipe/bluespace/Destroy()
GLOB.bluespace_pipes -= src
for(var/p in GLOB.bluespace_pipes)
var/obj/machinery/atmospherics/pipe/bluespace/P = p
QDEL_NULL(P.parent)
P.build_network()
return ..()

/obj/machinery/atmospherics/pipe/bluespace/SetInitDirections()
initialize_directions = dir

/obj/machinery/atmospherics/pipe/bluespace/pipeline_expansion()
return ..() + GLOB.bluespace_pipes - src

/obj/machinery/atmospherics/components/pipe/bluespace/hide()
update_icon()

/obj/machinery/atmospherics/pipe/bluespace/update_icon(showpipe)
underlays.Cut()
var/turf/T = loc
if(level != 2 && T.intact)
return //no need to update the pipes if they aren't showing
var/connected = 0 //Direction bitset
for(DEVICE_TYPE_LOOP) //adds intact pieces
if(NODE_I)
connected |= icon_addintact(NODE_I)
icon_addbroken(connected) //adds broken pieces

/obj/machinery/atmospherics/pipe/bluespace/paint()
return FALSE
7 changes: 7 additions & 0 deletions code/modules/atmospherics/machinery/pipes/pipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,10 @@
if(damage_flag == "melee" && damage_amount < 12)
return 0
. = ..()

/obj/machinery/atmospherics/pipe/proc/paint(paint_color)
add_atom_colour(paint_color, FIXED_COLOUR_PRIORITY)
pipe_color = paint_color
update_node_icon()
return TRUE

Binary file added icons/obj/atmospherics/pipes/bluespace.dmi
Binary file not shown.
Binary file modified icons/obj/atmospherics/pipes/pipe_item.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@
#include "code\modules\atmospherics\machinery\other\meter.dm"
#include "code\modules\atmospherics\machinery\other\miner.dm"
#include "code\modules\atmospherics\machinery\other\zvent.dm"
#include "code\modules\atmospherics\machinery\pipes\bluespace_pipe.dm"
#include "code\modules\atmospherics\machinery\pipes\manifold.dm"
#include "code\modules\atmospherics\machinery\pipes\manifold4w.dm"
#include "code\modules\atmospherics\machinery\pipes\pipes.dm"
Expand Down