-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bluespace pipe caps #36581
Bluespace pipe caps #36581
Changes from 16 commits
61ddecf
7f3fbb7
720bdba
d37532c
75520ad
05d4314
d36190c
3b66cec
79531ed
90e32ee
7994893
83e4536
e0f13f1
6ff4dfb
e2d47ec
4f6bf19
5fb74b3
94f6bcc
f31fd04
24500aa
a76215b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,3 +125,105 @@ | |
return // Coloring pipes. | ||
|
||
return ..() | ||
|
||
/obj/machinery/atmospherics/unary/cap/bluespace | ||
name = "bluespace pipe endcap" | ||
desc = "A bluespace endcap for pipes." | ||
icon = 'icons/obj/pipes.dmi' | ||
icon_state = "bscap" | ||
level = LEVEL_ABOVE_FLOOR | ||
can_be_coloured = 0 | ||
color = "#FFFFFF" | ||
var/network_color = "#b4b4b4" // default grey color that all pipes have | ||
|
||
var/color_r = 180 | ||
var/color_g = 180 | ||
var/color_b = 180 | ||
|
||
var/image/color_overlay | ||
|
||
var/global/list/pipe_colors = list( | ||
"custom", \ | ||
"grey" = rgb(180,180,180), \ | ||
"blue" = rgb(0,0,183), \ | ||
"cyan" = rgb(0,184,184), \ | ||
"green" = rgb(0,185,0), \ | ||
"pink" = rgb(255,102,204), \ | ||
"purple" = rgb(128,0,128), \ | ||
"red" = rgb(183,0,0), \ | ||
"orange" = rgb(183,121,0), \ | ||
"white" = rgb(255,255,255), \ | ||
) | ||
|
||
/obj/machinery/atmospherics/unary/cap/bluespace/update_icon() | ||
overlays = 0 | ||
alpha = invisibility ? 128 : 255 | ||
icon_state = "bscap" | ||
update_moody_light('icons/lighting/moody_lights.dmi', "overlay_bscap") | ||
color_overlay = image('icons/obj/pipes.dmi', icon_state = "bscap-overlay") | ||
color_overlay.color = rgb(color_r,color_g,color_b) | ||
overlays += color_overlay | ||
|
||
|
||
var/global/list/obj/machinery/atmospherics/unary/cap/bluespace/bspipe_list = list() | ||
var/global/list/obj/machinery/atmospherics/unary/cap/bluespace/bspipe_item_list = list() | ||
|
||
/obj/machinery/atmospherics/unary/cap/bluespace/New() | ||
..() | ||
bspipe_list.Add(src) | ||
|
||
/obj/machinery/atmospherics/unary/cap/bluespace/Destroy() | ||
bspipe_list.Remove(src) | ||
..() | ||
|
||
|
||
/obj/machinery/atmospherics/unary/cap/bluespace/proc/merge_all() | ||
var/datum/pipe_network/main_network | ||
for(var/obj/machinery/atmospherics/unary/cap/bluespace/bscap in bspipe_list) | ||
if(!bscap.network) | ||
continue | ||
if(src.network_color != bscap.network_color) | ||
continue | ||
if(src.z != bscap.z) | ||
continue | ||
if(!main_network) | ||
main_network = bscap.network | ||
continue | ||
else | ||
main_network.merge(bscap.network) | ||
|
||
/obj/machinery/atmospherics/unary/cap/bluespace/build_network() | ||
if(!network && node1) | ||
network = new /datum/pipe_network | ||
network.normal_members += src | ||
network.build_network(node1, src) | ||
merge_all() | ||
|
||
|
||
/obj/machinery/atmospherics/unary/cap/bluespace/attackby(var/obj/item/O as obj, var/mob/user as mob) | ||
if(istype(O,/obj/item/device/multitool)) | ||
var/list/choice_list = pipe_colors | ||
|
||
var/choice = input(user,"Select a colour to set [src] to.","[src]") in choice_list | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
color (not just nitpicking, it's for consistency) |
||
if(!Adjacent(user)) | ||
return | ||
|
||
var/new_color | ||
if(choice == "custom") | ||
new_color = input("Please select a color for the tile.", "[src]",rgb(color_r,color_g,color_b)) as color | ||
if(new_color) | ||
color_r = hex2num(copytext(new_color, 2, 4)) | ||
color_g = hex2num(copytext(new_color, 4, 6)) | ||
color_b = hex2num(copytext(new_color, 6, 8)) | ||
else | ||
new_color = choice_list[choice] | ||
color_r = hex2num(copytext(new_color, 2, 4)) | ||
color_g = hex2num(copytext(new_color, 4, 6)) | ||
color_b = hex2num(copytext(new_color, 6, 8)) | ||
|
||
update_icon() | ||
|
||
network_color = new_color | ||
qdel(network) | ||
merge_all() | ||
return ..() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,7 @@ Buildable meters | |
#define PIPE_Z_DOWN 36 | ||
#define PIPE_MPVALVE 37 | ||
#define PIPE_DPVALVE 38 | ||
#define PIPE_BSCAP 39 | ||
|
||
//Disposal piping numbers - do NOT hardcode these, use the defines | ||
#define DISP_PIPE_STRAIGHT 0 | ||
|
@@ -177,6 +178,8 @@ var/list/bent_dirs = list(NORTH|SOUTH, WEST|EAST) | |
src.pipe_type = PIPE_INSUL_MANIFOLD4W | ||
else | ||
src.pipe_type = PIPE_MANIFOLD4W | ||
else if(istype(make_from, /obj/machinery/atmospherics/unary/cap/bluespace)) | ||
src.pipe_type = PIPE_BSCAP | ||
else if(istype(make_from, /obj/machinery/atmospherics/unary/cap/heat)) | ||
src.pipe_type = PIPE_HE_CAP | ||
else if(istype(make_from, /obj/machinery/atmospherics/unary/cap)) | ||
|
@@ -202,11 +205,18 @@ var/list/bent_dirs = list(NORTH|SOUTH, WEST|EAST) | |
else | ||
src.pipe_type = pipe_type | ||
src.dir = dir | ||
if(src.pipe_type == PIPE_BSCAP) | ||
src.w_class = W_CLASS_LARGE | ||
bspipe_item_list.Add(src) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably unnecessary since you already add it in New() There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there are 2 lists: bspipe_list and bspipe_item_list, one tracks the caps in item form and the other in machinery form |
||
//src.pipe_dir = get_pipe_dir() | ||
update() | ||
// src.pixel_x = rand(-5, 5) | ||
// src.pixel_y = rand(-5, 5) | ||
|
||
/obj/item/pipe/Destroy() | ||
bspipe_item_list.Remove(src) | ||
..() | ||
|
||
/obj/item/pipe/proc/setPipingLayer(new_layer = PIPING_LAYER_DEFAULT) | ||
piping_layer = new_layer | ||
if(pipe_type != PIPE_LAYER_MANIFOLD && pipe_type != PIPE_LAYER_ADAPTER) | ||
|
@@ -255,7 +265,8 @@ var/global/list/pipeID2State = list( | |
"z_up", | ||
"z_down", | ||
"mpvalve", | ||
"dpvalve" | ||
"dpvalve", | ||
"bscap" | ||
) | ||
var/global/list/nlist = list( \ | ||
"pipe", \ | ||
|
@@ -297,6 +308,7 @@ var/global/list/nlist = list( \ | |
"down pipe", \ | ||
"manual conditional valve", \ | ||
"digital conditional valve", \ | ||
"bluespace pipe cap", \ | ||
) | ||
/obj/item/pipe/proc/update() | ||
|
||
|
@@ -383,7 +395,7 @@ var/list/manifold_pipes = list(PIPE_MANIFOLD4W, PIPE_INSUL_MANIFOLD4W, PIPE_HE_M | |
return flip|cw|acw | ||
if(PIPE_GAS_FILTER, PIPE_GAS_MIXER,PIPE_MTVALVE,PIPE_DTVALVE,PIPE_MPVALVE,PIPE_DPVALVE) | ||
return dir|flip|cw | ||
if(PIPE_CAP, PIPE_HE_CAP, PIPE_Z_UP, PIPE_Z_DOWN) | ||
if(PIPE_CAP, PIPE_HE_CAP, PIPE_BSCAP, PIPE_Z_UP, PIPE_Z_DOWN) | ||
return dir | ||
return 0 | ||
|
||
|
@@ -509,6 +521,9 @@ var/list/manifold_pipes = list(PIPE_MANIFOLD4W, PIPE_INSUL_MANIFOLD4W, PIPE_HE_M | |
|
||
if(PIPE_HE_CAP) | ||
P=new /obj/machinery/atmospherics/unary/cap/heat(src.loc) | ||
|
||
if(PIPE_BSCAP) | ||
P=new /obj/machinery/atmospherics/unary/cap/bluespace(src.loc) | ||
|
||
if(PIPE_PASSIVE_GATE) //passive gate | ||
P=new /obj/machinery/atmospherics/binary/passive_gate(src.loc) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description doesn't say a lot for the function of the device, especially since it's not really obvious at first glance.