From 6b7801c4af182520d4381a373df1402c63bc46e2 Mon Sep 17 00:00:00 2001
From: "rastaf.zero@gmail.com"
+ Desirable output pressure:
+ -
+ -
+ -
+ -
+ [round(target_pressure,0.1)]kPa
+ +
+ +
+ +
+ +
+ "}
+
+ user << browse("
- Desirable output pressure:
- -
- -
- -
- [round(target_pressure,0.1)]kPa
- +
- +
- +
- "}
-
- user << browse("
Nothing
Desirable output pressure:
+ -
-
-
-
@@ -354,6 +355,7 @@ obj/machinery/atmospherics/filter/attack_hand(user as mob) // -- TLE
+
+
+
+ +
"}
/*
user << browse("
(Swipe ID card to unlock interface)"
+ return "
(Swipe ID card to unlock interface)"
else
- return "
[return_controls()]"
+ return "
[return_controls()]"
return_status()
var/turf/location = src.loc
@@ -182,7 +203,7 @@
"}
output += "TOGGLE PANIC SYPHON IN AREA"
- output += "
Reinitialize atmospheric machinery in area"
+ //output += "
Reinitialize atmospheric machinery in area"
else
var/sensor_data
if(src.device == "Scrubbers")
@@ -200,6 +221,8 @@
sensor_part += "Dea":"red'>A")]ctivate panic syphon
"
if(data["panic"])
sensor_part += "PANIC SYPHON ACTIVATED"
+ if (data["timestamp"]+3 < air_master.current_cycle)
+ sensor_part += "[long_name] not responding.
"
sensor_part += "
"
else
sensor_part = "[long_name] can not be found!
"
@@ -217,14 +240,16 @@
if(data)
sensor_part += {"Operating: [data["power"]]
- Pressure checks: [data["checks"]?"on":"off"]
-
"}
+ Pressure checks: [data["checks"]?"on":"off"]
"}
+ if (data["timestamp"]+3 < air_master.current_cycle)
+ sensor_part += "[long_name] not responding.
"
+ sensor_part += "
"
else
sensor_part = "[long_name] can not be found!
"
sensor_data += sensor_part
else
- sensor_data = "No scrubbers connected.
"
+ sensor_data = "No vents connected.
"
output = {"[sensor_data]Main menu
"}
@@ -293,9 +318,9 @@
for(var/P in vents)
send_signal(P, "power_off")
panic = !panic
- if(href_list["reinit_atmos_machinery"])
+/* if(href_list["reinit_atmos_machinery"])
var/A = get_area(loc)
- connect_area_atmos_machinery(A)
+ connect_area_atmos_machinery(A)*/
spawn(5)
@@ -306,13 +331,12 @@
/obj/machinery/alarm/New()
..()
-
- if(!alarm_zone)
- var/area/A = get_area(loc)
- if(A.name)
- alarm_zone = A.name
- else
- alarm_zone = "Unregistered"
+ var/area/A = get_area(loc)
+ if (A.master)
+ A = A.master
+ area_uid = A.uid
+ if (name == "alarm")
+ name = "[A.name] Air Alarm"
/obj/machinery/alarm/process()
if (src.skipprocess)
@@ -404,16 +428,19 @@
if(!frequency) return
+ var/area/A = get_area(loc)
var/datum/signal/alert_signal = new
alert_signal.source = src
alert_signal.transmission_method = 1
- alert_signal.data["zone"] = alarm_zone
+ alert_signal.data["zone"] = A.name
alert_signal.data["type"] = "Atmospheric"
if(alert_level==0)
alert_signal.data["alert"] = "severe"
- else
+ else if (alert_level==1)
alert_signal.data["alert"] = "minor"
+ else if (alert_level==0)
+ alert_signal.data["alert"] = "clear"
frequency.post_signal(src, alert_signal)
@@ -432,6 +459,7 @@
if(src.allowed(usr))
locked = !locked
user << "You [ locked ? "lock" : "unlock"] the Air Alarm interface."
+ src.updateUsrDialog()
else
user << "\red Access denied."
return
diff --git a/code/game/machinery/atmo_control.dm b/code/game/machinery/atmo_control.dm
index 6692f2b8fdc..50a16090a02 100644
--- a/code/game/machinery/atmo_control.dm
+++ b/code/game/machinery/atmo_control.dm
@@ -491,12 +491,14 @@ Rate: [volume_rate] L/sec
"}
if(!zone || !severity) return
+ minor_alarms -= zone
+ priority_alarms -= zone
if(severity=="severe")
- priority_alarms -= zone
priority_alarms += zone
- else
- minor_alarms -= zone
+ else if (severity=="minor")
minor_alarms += zone
+ else /*"clear"*/
+ //do nothing
proc
set_frequency(new_frequency)
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index f18d2f26d4f..f2a73a52e0f 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -178,7 +178,7 @@ Release Pressure: - Close
"}
- user << browse(output_text, "window=canister;size=600x300")
+ user << browse("
Name: [src.occupant]
Health: [health_text]
Oxygen deprivation: [round(src.occupant.oxyloss,0.1)]
Brute damage: [round(src.occupant.bruteloss,0.1)]
Fire damage: [round(src.occupant.fireloss,0.1)]
Toxin damage: [round(src.occupant.toxloss,0.1)]
Body temperature: [src.occupant.bodytemperature]" : "None"]
"}
-
+ user.machine = src
user << browse(dat, "window=cryo")
onclose(user, "cryo")
Topic(href, href_list)
- if (( usr.machine==src && ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
+ if ((get_dist(src, usr) <= 1) || istype(usr, /mob/living/silicon/ai))
if(href_list["start"])
src.on = !src.on
build_icon()
@@ -113,33 +113,19 @@
attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
if(istype(G, /obj/item/weapon/reagent_containers/glass))
if(src.beaker)
- user << "A beaker is already loaded into the machine."
+ user << "\red A beaker is already loaded into the machine."
return
src.beaker = G
user.drop_item()
G.loc = src
- user.visible_message("[user] adds a beaker to \the [src]!", "You add a beaker to the [src]!")
+ user.visible_message("[user] adds \a [G] to \the [src]!", "You add \a [G] to \the [src]!")
else if(istype(G, /obj/item/weapon/grab))
if(!ismob(G:affecting))
return
- if (src.occupant)
- user << "\blue The cryo cell is already occupied!"
- return
- if (G:affecting.abiotic())
- user << "Subject may not have abiotic items on."
- return
var/mob/M = G:affecting
- if (M.client)
- M.client.perspective = EYE_PERSPECTIVE
- M.client.eye = src
- M.loc = src
- src.occupant = M
- for(var/obj/O in src)
- O.loc = src.loc
- src.add_fingerprint(user)
- build_icon()
- del(G)
+ if(put_mob(M))
+ del(G)
src.updateUsrDialog()
return
@@ -224,6 +210,26 @@
src.occupant = null
build_icon()
return
+ put_mob(mob/M as mob)
+ if (src.occupant)
+ usr << "\red The cryo cell is already occupied!"
+ return
+ if (M.abiotic())
+ usr << "\red Subject may not have abiotic items on."
+ return
+ if(!src.node)
+ usr << "\red The cell is not corrrectly connected to its pipe network!"
+ return
+ if (M.client)
+ M.client.perspective = EYE_PERSPECTIVE
+ M.client.eye = src
+ M.pulling = null
+ M.loc = src
+ src.occupant = M
+ M.metabslow = 1
+ src.add_fingerprint(usr)
+ build_icon()
+ return 1
verb
move_eject()
@@ -240,25 +246,7 @@
set src in oview(1)
if (usr.stat != 0 || stat & (NOPOWER|BROKEN))
return
- if (src.occupant)
- usr << "\blue The cell is already occupied!"
- return
- if (usr.abiotic())
- usr << "Subject may not have abiotic items on."
- return
- if(!src.node)
- usr << "The cell is not corrrectly connected to its pipe network!"
- return
- usr.pulling = null
- usr.client.perspective = EYE_PERSPECTIVE
- usr.client.eye = src
- usr.loc = src
- usr.metabslow = 1
- src.occupant = usr
- /*for(var/obj/O in src)
- O.loc = src.loc*/
- src.add_fingerprint(usr)
- build_icon()
+ put_mob(usr)
return
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 60dd958b329..2cbfd8cefa9 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -2,38 +2,111 @@
Buildable pipes
Buildable meters
*/
+#define PIPE_SIMPLE_STRAIGHT 0
+#define PIPE_SIMPLE_BENT 1
+#define PIPE_HE_STRAIGHT 2
+#define PIPE_HE_BENT 3
+#define PIPE_CONNECTOR 4
+#define PIPE_MANIFOLD 5
+#define PIPE_JUNCTION 6
+#define PIPE_UVENT 7
+#define PIPE_MVALVE 8
+#define PIPE_PUMP 9
+#define PIPE_SCRUBBER 10
+#define PIPE_INSULATED_STRAIGHT 11
+#define PIPE_INSULATED_BENT 12
/obj/item/weapon/pipe
name = "pipe"
desc = "A pipe"
var/pipe_type = 0
- var/pipe_dir = 0
+ //var/pipe_dir = 0
+ var/pipename
icon = 'pipe-item.dmi'
- icon_state = "straight"
+ icon_state = "simple"
item_state = "buildpipe"
flags = TABLEPASS|FPRINT
w_class = 4
level = 2
-
-/obj/item/weapon/pipe/New()
+ //TODO: список номер_типа -> тип
+/obj/item/weapon/pipe/New(var/loc, var/pipe_type as num, var/dir as num, var/obj/machinery/atmospherics/make_from = null)
..()
+ if (make_from)
+ src.dir = make_from.dir
+ src.pipename = make_from.name
+ var/is_bent
+ if (make_from.initialize_directions in list(NORTH|SOUTH, WEST|EAST))
+ is_bent = 0
+ else
+ is_bent = 1
+ if (istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction))
+ src.pipe_type = PIPE_JUNCTION
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/heat_exchanging))
+ src.pipe_type = PIPE_HE_STRAIGHT + is_bent
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple))
+ src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent
+ else if(istype(make_from, /obj/machinery/atmospherics/portables_connector))
+ src.pipe_type = PIPE_CONNECTOR
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold))
+ src.pipe_type = PIPE_MANIFOLD
+ else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_pump))
+ src.pipe_type = PIPE_UVENT
+ else if(istype(make_from, /obj/machinery/atmospherics/valve))
+ src.pipe_type = PIPE_MVALVE
+ else if(istype(make_from, /obj/machinery/atmospherics/binary/pump))
+ src.pipe_type = PIPE_PUMP
+ else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_scrubber))
+ src.pipe_type = PIPE_SCRUBBER
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/insulated))
+ src.pipe_type = PIPE_INSULATED_STRAIGHT + is_bent
+ if (is_bent)
+ src.dir = make_from.initialize_directions //workaround. Bent pipes with one node==null have cardinal direction. - rastaf0
+ else
+ src.pipe_type = pipe_type
+ src.dir = dir
+ //src.pipe_dir = get_pipe_dir()
update()
//update the name and icon of the pipe item depending on the type
/obj/item/weapon/pipe/proc/update()
- var/list/nlist = list("pipe", "bent pipe", "h/e pipe", "bent h/e pipe", "connector", "manifold", "junction", "uvent", "mvalve", "pump", "scrubber")
+ var/list/nlist = list( \
+ "pipe", \
+ "bent pipe", \
+ "h/e pipe", \
+ "bent h/e pipe", \
+ "connector", \
+ "manifold", \
+ "junction", \
+ "uvent", \
+ "mvalve", \
+ "pump", \
+ "scrubber", \
+ "insulated pipe", \
+ "bent insulated pipe", \
+ )
name = nlist[pipe_type+1] + " fitting"
+ var/list/islist = list( \
+ "simple", \
+ "simple", \
+ "he", \
+ "he", \
+ "connector", \
+ "manifold", \
+ "junction", \
+ "uvent", \
+ "mvalve", \
+ "pump", \
+ "scrubber", \
+ "insulated", \
+ "insulated", \
+ )
+ icon_state = islist[pipe_type + 1]
updateicon()
//update the icon of the item
/obj/item/weapon/pipe/proc/updateicon()
-
- var/list/islist = list("straight", "bend", "he-straight", "he-bend", "connector", "manifold", "junction", "uvent", "mvalve", "pump", "scrubber")
-
- icon_state = islist[pipe_type + 1]
-
if(invisibility) // true if placed under floor
icon -= rgb(0,0,0,128) // fade the icon
else
@@ -60,318 +133,274 @@ Buildable meters
if ( usr.stat || usr.restrained() )
return
- switch(pipe_type)
- if(0)
- if(icon_state == "straight")
- pipe_dir = 12
- icon_state = "straight12"
- else if (icon_state == "straight12")
- pipe_dir = 3
- icon_state = "straight"
- if(1)
- if(icon_state == "bend9")
- icon_state = "bend"
- pipe_dir = 10
- else if(icon_state == "bend")
- icon_state = "bend6"
- pipe_dir = 6
- else if(icon_state == "bend6")
- icon_state = "bend5"
- pipe_dir = 5
- else if(icon_state == "bend5")
- icon_state = "bend9"
- pipe_dir = 9
-
- if(2)
- if(icon_state == "he-straight")
- icon_state = "he-straight12"
- pipe_dir = 12
- else if(icon_state == "he-straight12")
- icon_state = "he-straight"
- pipe_dir = 3
-
- if(3)
- if(icon_state == "he-bend")
- icon_state = "he-bend9"
- pipe_dir = 9
- else if(icon_state == "he-bend6")
- icon_state = "he-bend"
- pipe_dir = 10
- else if(icon_state == "he-bend5")
- icon_state = "he-bend6"
- pipe_dir = 6
- else if(icon_state == "he-bend9")
- icon_state = "he-bend5"
- pipe_dir = 5
-
- if(4,7,5,6,7,8,9,10)
- src.dir = turn(src.dir, -90)
+ src.dir = turn(src.dir, -90)
+ //src.pipe_dir = get_pipe_dir()
return
-// returns the p_dir from the pipe item type and dir
+/obj/item/weapon/pipe/Move()
+ var/dir = src.dir
+ ..()
+ src.dir = dir
+ return
-/obj/item/weapon/pipe/proc/get_pdir()
+// returns all pipe's endpoints
+/obj/item/weapon/pipe/proc/get_pipe_dir()
+ if (!dir)
+ return 0
var/flip = turn(dir, 180)
var/cw = turn(dir, -90)
var/acw = turn(dir, 90)
switch(pipe_type)
- if(0)
- if(pipe_dir == 0)
- pipe_dir = 3
- return pipe_dir
- if(1)
- if(pipe_dir == 0)
- pipe_dir = 10
- return pipe_dir
- if(2,3)
- return 0
- if(4,7,10)
+ if( PIPE_SIMPLE_STRAIGHT, \
+ PIPE_INSULATED_STRAIGHT, \
+ PIPE_HE_STRAIGHT, \
+ PIPE_JUNCTION ,\
+ PIPE_PUMP ,\
+ PIPE_MVALVE \
+ )
+ return dir|flip
+ if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT)
+ return dir //dir|acw
+ if(PIPE_CONNECTOR,PIPE_UVENT,PIPE_SCRUBBER)
return dir
- if(5)
- return dir|cw|acw
- if(6)
+ if(PIPE_MANIFOLD)
+ return flip|cw|acw
+ return 0
+
+/obj/item/weapon/pipe/proc/get_pdir() //endpoints for regular pipes
+
+ var/flip = turn(dir, 180)
+// var/cw = turn(dir, -90)
+// var/acw = turn(dir, 90)
+
+ if (!(pipe_type in list(PIPE_HE_STRAIGHT, PIPE_HE_BENT, PIPE_JUNCTION)))
+ return get_pipe_dir()
+ switch(pipe_type)
+ if(PIPE_HE_STRAIGHT,PIPE_HE_BENT)
+ return 0
+ if(PIPE_JUNCTION)
return flip
return 0
// return the h_dir (heat-exchange pipes) from the type and the dir
-/obj/item/weapon/pipe/proc/get_hdir()
+/obj/item/weapon/pipe/proc/get_hdir() //endpoints for h/e pipes
// var/flip = turn(dir, 180)
// var/cw = turn(dir, -90)
switch(pipe_type)
- if(0,1,4,5,7,10)
- return 0
- if(2)
- if(pipe_dir == 0)
- pipe_dir = 3
- return pipe_dir
- if(3)
- if(pipe_dir == 0)
- pipe_dir = 10
- return pipe_dir
- if(6)
+ if(PIPE_HE_STRAIGHT)
+ return get_pipe_dir()
+ if(PIPE_HE_BENT)
+ return get_pipe_dir()
+ if(PIPE_JUNCTION)
return dir
+ else
+ return 0
- return 0
+/obj/item/weapon/pipe/attack_self(mob/user as mob)
+ return rotate()
/obj/item/weapon/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
//*
- if (istype(W, /obj/item/weapon/wrench))
+ if (!istype(W, /obj/item/weapon/wrench))
+ return ..()
+ if (!isturf(src.loc))
+ return 1
+ var/pipe_dir = get_pipe_dir()
- var/pipedir = src.get_pdir()|src.get_hdir() // all possible pipe dirs including h/e#
+ for(var/obj/machinery/atmospherics/M in src.loc)
+ if(M.initialize_directions & pipe_dir) // matches at least one direction on either type of pipe
+ user << "\red There is already a pipe at that location."
+ return 1
+ // no conflicts found
- for(var/obj/machinery/atmospherics/M in src.loc)
- if( (M.initialize_directions & pipedir) || (M.initialize_directions & pipedir) ) // matches at least one direction on either type of pipe
- user << "There is already a pipe at that location."
- return
- playsound(src.loc, 'Ratchet.ogg', 50, 1)
+ var/pipefailtext = "\red There's nothing to connect this pipe section to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
- // no conflicts found
+ switch(pipe_type)
+ if(PIPE_SIMPLE_STRAIGHT, PIPE_SIMPLE_BENT)
+ var/obj/machinery/atmospherics/pipe/simple/P = new( src.loc )
+ P.dir = src.dir
+ P.initialize_directions = pipe_dir
+ var/turf/T = P.loc
+ P.level = T.intact ? 2 : 1
+ P.initialize()
+ if (!P)
+ usr << pipefailtext
+ return 1
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
- // 0 1 2 3 4 5 6 7 8 9 10
- //"pipe", "bent pipe", "h/e pipe", "bent h/e pipe", "connector", "manifold", "junction", "vent", "valve", "pump", "filter inlet"
+ if(PIPE_HE_STRAIGHT, PIPE_HE_BENT)
+ var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new ( src.loc )
+ P.dir = src.dir
+ P.initialize_directions = 0
+ P.initialize_directions_he = pipe_dir
+ //var/turf/T = P.loc
+ //P.level = T.intact ? 2 : 1
+ P.initialize()
+ if (!P)
+ usr << pipefailtext
+ return 1
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
+
+ if(PIPE_CONNECTOR) // connector
+ var/obj/machinery/atmospherics/portables_connector/C = new( src.loc )
+ C.dir = dir
+ C.initialize_directions = pipe_dir
+ if (pipename)
+ C.name = pipename
+ C.initialize()
+ C.build_network()
+ if (C.node)
+ C.node.initialize()
+ C.node.build_network()
+ if(PIPE_MANIFOLD) //manifold
+ var/obj/machinery/atmospherics/pipe/manifold/M = new( src.loc )
+ M.dir = dir
+ M.initialize_directions = pipe_dir
+ //M.New()
+ var/turf/T = M.loc
+ M.level = T.intact ? 2 : 1
+ M.initialize()
+ if (!M)
+ usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
+ return 1
+ M.build_network()
+ if (M.node1)
+ M.node1.initialize()
+ M.node1.build_network()
+ if (M.node2)
+ M.node2.initialize()
+ M.node2.build_network()
+ if (M.node3)
+ M.node3.initialize()
+ M.node3.build_network()
- switch(pipe_type)
- if(0) // straight pipe
- var/obj/machinery/atmospherics/pipe/simple/P = new /obj/machinery/atmospherics/pipe/simple( src.loc )
- switch (icon_state)
- if("straight")
- P.dir = NORTH
- P.initialize_directions = NORTH|SOUTH
- if("straight12")
- P.dir = EAST
- P.initialize_directions = EAST|WEST
- var/turf/T = P.loc
- switch (T.intact)
- if(1) P.level = 2
- if(0) P.level = 1
- P.initialize()
- if (P)
- P.build_network()
- if (P.node1)
- P.node1.initialize()
- P.node1.build_network()
- if (P.node2)
- P.node2:initialize()
- P.node2.build_network()
- else
- usr << "There's nothing to connect this pipe section to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
- return
-
- if(1) // bent pipe
- var/obj/machinery/atmospherics/pipe/simple/P = new /obj/machinery/atmospherics/pipe/simple( src.loc )
- switch (icon_state)
- if("bend")
- P.dir = SOUTHWEST
- P.initialize_directions = SOUTH|WEST
- if("bend6")
- P.dir = SOUTHEAST
- P.initialize_directions = SOUTH|EAST
- if("bend5")
- P.dir = NORTHEAST
- P.initialize_directions = NORTH|EAST
- if("bend9")
- P.dir = NORTHWEST
- P.initialize_directions = NORTH|WEST
- var/turf/T = P.loc
- switch (T.intact)
- if(1) P.level = 2
- if(0) P.level = 1
- P.initialize()
- if (P)
- P.build_network()
- if (P.node1)
- P.node1.initialize()
- P.node1.build_network()
- if (P.node2)
- P.node2:initialize()
- P.node2.build_network()
- else
- usr << "There's nothing to connect this pipe section to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
- return
-
+ if(PIPE_JUNCTION)
+ var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/P = new ( src.loc )
+ P.dir = src.dir
+ P.initialize_directions = src.get_pdir()
+ P.initialize_directions_he = src.get_hdir()
+ //var/turf/T = P.loc
+ //P.level = T.intact ? 2 : 1
+ P.initialize()
+ if (!P)
+ usr << "There's nothing to connect this junction to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
+ return 1
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
/*
- if(2,3) // straight or bent h/e pipe
- P = new/obj/machinery/pipes/heat_exch( src.loc )
- P.h_dir = get_hdir()
- P.icon_state = get_hdir()
- P.level = 2
- P.update()
-
- var/list/dirs = P.get_dirs()
+ if(6) //junctions
+ var/obj/machinery/junction/J = new( src.loc )
+ J.dir = dir
+ J.p_dir = src.get_pdir()
+ J.h_dir = src.get_hdir()
+ J.level = 2
*/
-
- if(4) // connector
- var/obj/machinery/atmospherics/portables_connector/C = new( src.loc )
- C.dir = dir
- C.initialize_directions = dir
-/* var/turf/T = C.loc
- switch (T.intact)
- if(1) V.level = 2
- if(0) V.level = 1*/
- C.initialize()
- C.build_network()
- if (C.node)
- C.node.initialize()
- C.node.build_network()
+ if(PIPE_UVENT) //unary vent
+ var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc )
+ V.dir = dir
+ V.initialize_directions = pipe_dir
+ if (pipename)
+ V.name = pipename
+ V.initialize()
+ V.build_network()
+ if (V.node)
+ V.node.initialize()
+ V.node.build_network()
- if(5) //manifold
- var/obj/machinery/atmospherics/pipe/manifold/M = new( src.loc )
- M.dir = dir
- M.New()
- var/turf/T = M.loc
- switch (T.intact)
- if(1) M.level = 2
- if(0) M.level = 1
- M.initialize()
- if (M)
- M.build_network()
- if (M.node1)
- M.node1.initialize()
- M.node1.build_network()
- if (M.node2)
- M.node2.initialize()
- M.node2.build_network()
- if (M.node3)
- M.node3.initialize()
- M.node3.build_network()
- else
- usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
- return
-/*
- if(6) //junctions
- var/obj/machinery/junction/J = new( src.loc )
- J.dir = dir
- J.p_dir = src.get_pdir()
- J.h_dir = src.get_hdir()
- J.level = 2
-*/
- if(7) //unary vent
- var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc )
- V.dir = dir
- V.initialize_directions = dir
-/* var/turf/T = V.loc
- switch (T.intact)
- if(1) V.level = 2
- if(0) V.level = 1*/
- V.initialize()
- V.build_network()
- if (V.node)
- V.node.initialize()
- V.node.build_network()
-
-
- if(8) //manual valve
- var/obj/machinery/atmospherics/valve/V = new( src.loc)
- V.dir = dir
- switch(dir)
- if(NORTH)
- V.initialize_directions = NORTH|SOUTH
- if(SOUTH)
- V.initialize_directions = NORTH|SOUTH
- if(EAST)
- V.initialize_directions = EAST|WEST
- if(WEST)
- V.initialize_directions = EAST|WEST
-/* var/turf/T = V.loc
- switch (T.intact)
- if(1) V.level = 2
- if(0) V.level = 1*/
- V.initialize()
- V.build_network()
- if (V.node1)
+ if(PIPE_MVALVE) //manual valve
+ var/obj/machinery/atmospherics/valve/V = new( src.loc)
+ V.dir = dir
+ V.initialize_directions = pipe_dir
+ if (pipename)
+ V.name = pipename
+ V.initialize()
+ V.build_network()
+ if (V.node1)
// world << "[V.node1.name] is connected to valve, forcing it to update its nodes."
- V.node1.initialize()
- V.node1.build_network()
- if (V.node2)
+ V.node1.initialize()
+ V.node1.build_network()
+ if (V.node2)
// world << "[V.node2.name] is connected to valve, forcing it to update its nodes."
- V.node2.initialize()
- V.node2.build_network()
+ V.node2.initialize()
+ V.node2.build_network()
- if(9) //gas pump
- var/obj/machinery/atmospherics/binary/pump/P = new(src.loc)
- P.dir = dir
- P.New()
-/* var/turf/T = P.loc
- switch (T.intact)
- if(1) P.level = 2
- if(0) P.level = 1*/
- P.initialize()
- P.build_network()
- if (P.node1)
- P.node1.initialize()
- P.node1.build_network()
- if (P.node2)
- P.node2.initialize()
- P.node2.build_network()
+ if(PIPE_PUMP) //gas pump
+ var/obj/machinery/atmospherics/binary/pump/P = new(src.loc)
+ P.dir = dir
+ P.initialize_directions = pipe_dir
+ if (pipename)
+ P.name = pipename
+ P.initialize()
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
- if(10) //scrubber
- var/obj/machinery/atmospherics/unary/vent_scrubber/S = new(src.loc)
- S.dir = dir
- S.initialize_directions = dir
-/* var/turf/T = S.loc
- switch (T.intact)
- if(1) V.level = 2
- if(0) V.level = 1*/
- S.initialize()
- S.build_network()
- if (S.node)
- S.node.initialize()
- S.node.build_network()
+ if(PIPE_SCRUBBER) //scrubber
+ var/obj/machinery/atmospherics/unary/vent_scrubber/S = new(src.loc)
+ S.dir = dir
+ S.initialize_directions = pipe_dir
+ if (pipename)
+ S.name = pipename
+ S.initialize()
+ S.build_network()
+ if (S.node)
+ S.node.initialize()
+ S.node.build_network()
+ if(PIPE_INSULATED_STRAIGHT, PIPE_INSULATED_BENT)
+ var/obj/machinery/atmospherics/pipe/simple/insulated/P = new( src.loc )
+ P.dir = src.dir
+ P.initialize_directions = pipe_dir
+ var/turf/T = P.loc
+ P.level = T.intact ? 2 : 1
+ P.initialize()
+ if (!P)
+ usr << pipefailtext
+ return 1
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
-
-
- user << "You have fastened the pipe"
- del(src) // remove the pipe item
+ playsound(src.loc, 'Ratchet.ogg', 50, 1)
+ user.visible_message( \
+ "[user] fastens the pipe.", \
+ "\blue You have fastened the pipe.", \
+ "You hear ratchet.")
+ del(src) // remove the pipe item
return
//TODO: DEFERRED
@@ -391,13 +420,26 @@ Buildable meters
/obj/item/weapon/pipe_meter/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
- if (istype(W, /obj/item/weapon/wrench))
- if(locate(/obj/machinery/atmospherics/pipe, src.loc))
- new/obj/machinery/meter( src.loc )
- playsound(src.loc, 'Ratchet.ogg', 50, 1)
- user << "You have fastened the meter to the pipe"
- del(src)
- else
- user << "You need to fasten it to a pipe"
- return
+ if (!istype(W, /obj/item/weapon/wrench))
+ return ..()
+ if(!locate(/obj/machinery/atmospherics/pipe, src.loc))
+ user << "\red You need to fasten it to a pipe"
+ return 1
+ new/obj/machinery/meter( src.loc )
+ playsound(src.loc, 'Ratchet.ogg', 50, 1)
+ user << "\blue You have fastened the meter to the pipe"
+ del(src)
+#undef PIPE_SIMPLE_STRAIGHT
+#undef PIPE_SIMPLE_BENT
+#undef PIPE_HE_STRAIGHT
+#undef PIPE_HE_BENT
+#undef PIPE_CONNECTOR
+#undef PIPE_MANIFOLD
+#undef PIPE_JUNCTION
+#undef PIPE_UVENT
+#undef PIPE_MVALVE
+#undef PIPE_PUMP
+#undef PIPE_SCRUBBER
+#undef PIPE_INSULATED_STRAIGHT
+#undef PIPE_INSULATED_BENT
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 564d4c7820f..4ce7cb87d68 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -11,19 +11,28 @@
/obj/machinery/pipedispenser/attack_hand(user as mob)
if(..())
return
-
var/dat = {"
-Pipe
-Bent Pipe
-Connector
-Manifold
-Unary Vent
-Manual Valve
-Gas Pump
-Scrubber
"}
+Regular pipes:
+Pipe
+Bent Pipe
+Connector
+Manifold
+Unary Vent
+Manual Valve
+Gas Pump
+Scrubber
+Meter
+Heat exchange:
+Pipe
+Bent Pipe
+Junction
+Insulated pipes:
+Pipe
+Bent Pipe
+"}
- user << browse("
"}
- user << browse("
1fg8#&Uk_Wcn9
z_Nsx)C22RA-trNI_FrD8FO$^i=EY#cqsW-|qOnZjB8ZsMS95q$TnUC#sMRUSlT1EF
z-Ma&$5K+7j09wU>7HvU5`yK#D9Q=>Vlvj${!|8=}5Vnpg`BIUpa3l9^qQc*Z>R%Kk
znF$+D!SWmS&)k3TP~_q-GsUm{>2q=46R6}UOH=h_Xn)Q^k$wE-XUhn>IcS+QH*4=M
z>$GrGRjjXH1QtqQ9<}`x+;<8%J*0hEV)QiK+@m}~pv({OulGuqZ=9ABwLZNPU5(!(
z=$-I_&?C`EbA@h?3r=#86G$)Z&l9$$CHZA{PFAK5s6#M{57+hx8OI+W21Ia<#~jZReQ}_b!c!#YgJe-in-ttxjysxH4PUztw4_9ao^A_a&Dh`
zUZo6lp02Ny`V=itilcBV2v+TNHo9{H>Eh7O(|Q(_PiMI#_l7LpEC*3O1%*W2Uv-Z%HJ8&x-Tm)KKN919zEe#|~Krd_U-<{q*F
zOz1;lE|fnweTDU##si`hQ$|NhUBxOt3
&-oV@vW9lFjHm)L5JM)b<)lwWX-N_YXip?MsAOGc{ajrF!H%&13DG
z#cvJ{_?^Xb(A83XjkjFh6^+<2gD@xG=L4%MmO<67qzA=iDAALZAn`lJ?e>MIMe^;f
z_4GaC!hVjIH?gsVk^)kf{XMKGv6D`QN)aae5^udKK#}#avmNe(URt6i#)tkKAz!t%
zABv45USZ9KfAl^0h4JyCGakfz9gQLP#Z~*_AWNMCAnO%tm!o){?)-{p*Q0g2M~TPm
zF|-4%P&oa2?`4h`Vj7V>NuAujn27(HC>^K_WRD*G(z9y{+S}W+2-macOJ0H7;SXed
zJUN{Kg