Merge pull request #6661 from Menshin/bend_pipes_atmos_fixes

Atmos pipes fixes and tweaks
This commit is contained in:
tkdrg
2014-12-31 20:18:53 -03:00
12 changed files with 71 additions and 40 deletions
+12 -1
View File
@@ -26,9 +26,14 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/New()
..()
SetInitDirections()
if(can_unwrench)
stored = new(src, make_from=src)
/obj/machinery/atmospherics/proc/SetInitDirections()
return
/obj/machinery/atmospherics/proc/safe_input(var/title, var/text, var/default_set)
var/new_value = input(usr,"Enter new output pressure (0-4500kPa)","Pressure control",default_set) as num
if(usr.canUseTopic(src))
@@ -124,9 +129,15 @@ Pipelines + Other Objects -> Pipe network
return img
/obj/machinery/atmospherics/construction(D, P)
/obj/machinery/atmospherics/construction(D, P, var/pipe_type, var/obj_color)
dir = D
initialize_directions = P
if(can_unwrench)
color = obj_color
pipe_color = obj_color
stored.dir = D //need to define them here, because the obj directions...
stored.pipe_type = pipe_type //... were not set at the time the stored pipe was created
stored.color = obj_color
var/turf/T = loc
level = T.intact ? 2 : 1
initialize()
@@ -17,6 +17,14 @@
/obj/machinery/atmospherics/binary/New()
..()
air1 = new
air2 = new
air1.volume = 200
air2.volume = 200
/obj/machinery/atmospherics/binary/SetInitDirections()
switch(dir)
if(NORTH)
initialize_directions = NORTH|SOUTH
@@ -26,11 +34,6 @@
initialize_directions = EAST|WEST
if(WEST)
initialize_directions = EAST|WEST
air1 = new
air2 = new
air1.volume = 200
air2.volume = 200
//Separate this because we don't need to update pipe icons if we just are going to change the state
/obj/machinery/atmospherics/binary/proc/update_icon_nopipes()
@@ -44,7 +44,7 @@ Thus, the two variables affect pump operation are set in New():
/obj/machinery/atmospherics/binary/pump/process()
// ..()
if(stat & (NOPOWER|BROKEN))
return
return 0
if(!on)
return 0
@@ -70,8 +70,7 @@ Thus, the two variables affect pump operation are set in New():
return 1
//Radio remote control
//Radio remote control
/obj/machinery/atmospherics/binary/pump/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
@@ -20,6 +20,16 @@
/obj/machinery/atmospherics/trinary/New()
..()
air1 = new
air2 = new
air3 = new
air1.volume = 200
air2.volume = 200
air3.volume = 200
/obj/machinery/atmospherics/trinary/SetInitDirections()
switch(dir)
if(NORTH)
initialize_directions = EAST|NORTH|SOUTH
@@ -29,14 +39,6 @@
initialize_directions = EAST|WEST|SOUTH
if(WEST)
initialize_directions = WEST|NORTH|EAST
air1 = new
air2 = new
air3 = new
air1.volume = 200
air2.volume = 200
air3.volume = 200
/*
Iconnery
*/
@@ -10,10 +10,12 @@
/obj/machinery/atmospherics/unary/New()
..()
initialize_directions = dir
air_contents = new
air_contents.volume = 200
/obj/machinery/atmospherics/unary/SetInitDirections()
initialize_directions = dir
/*
Iconnery
*/
+1 -1
View File
@@ -69,7 +69,7 @@
desc = "A digitally controlled valve."
icon_state = "dvalve_map"
/obj/machinery/atmospherics/valve/digital/attack_ai(mob/user)
/obj/machinery/atmospherics/binary/valve/digital/attack_ai(mob/user)
return src.attack_hand(user)
/obj/machinery/atmospherics/binary/valve/digital/update_icon_nopipes(animation)
+2
View File
@@ -50,6 +50,8 @@
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/New()
..()
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/SetInitDirections()
switch(dir)
if(SOUTH)
initialize_directions = NORTH
+1
View File
@@ -27,6 +27,7 @@
..()
/obj/machinery/atmospherics/pipe/manifold/SetInitDirections()
switch(dir)
if(NORTH)
initialize_directions = EAST|SOUTH|WEST
+3
View File
@@ -25,6 +25,9 @@
color = pipe_color
..()
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
return
/obj/machinery/atmospherics/pipe/manifold4w/initialize()
for(var/D in cardinal)
for(var/obj/machinery/atmospherics/target in get_step(src, D))
+8 -2
View File
@@ -33,10 +33,16 @@ The regular pipe you see everywhere, including bent ones.
..()
/obj/machinery/atmospherics/pipe/simple/SetInitDirections()
switch(dir)
if(SOUTH || NORTH)
if(NORTH)
initialize_directions = SOUTH|NORTH
if(EAST || WEST)
if(SOUTH)
initialize_directions = SOUTH|NORTH
if(EAST)
initialize_directions = EAST|WEST
if(WEST)
initialize_directions = EAST|WEST
if(NORTHEAST)
initialize_directions = NORTH|EAST
+21 -19
View File
@@ -51,6 +51,7 @@ Buildable meters
if (make_from)
src.dir = make_from.dir
src.pipename = make_from.name
src.color = make_from.color
var/is_bent
if (make_from.initialize_directions in list(NORTH|SOUTH, WEST|EAST))
is_bent = 0
@@ -70,7 +71,7 @@ Buildable meters
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/digital))
else if(istype(make_from, /obj/machinery/atmospherics/binary/valve/digital))
src.pipe_type = PIPE_DVALVE
else if(istype(make_from, /obj/machinery/atmospherics/binary/valve))
src.pipe_type = PIPE_MVALVE
@@ -294,7 +295,7 @@ var/global/list/pipeID2State = list(
return rotate()
/obj/item/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..()
//*
if (!istype(W, /obj/item/weapon/wrench))
return ..()
@@ -314,51 +315,51 @@ var/global/list/pipeID2State = list(
switch(pipe_type)
if(PIPE_SIMPLE_STRAIGHT, PIPE_SIMPLE_BENT)
var/obj/machinery/atmospherics/pipe/simple/P = new( src.loc )
P.construction(dir, pipe_dir)
P.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_HE_STRAIGHT, PIPE_HE_BENT)
var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new ( src.loc )
P.initialize_directions_he = pipe_dir
P.construction(dir, pipe_dir)
P.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_CONNECTOR)
var/obj/machinery/atmospherics/unary/portables_connector/C = new( src.loc )
if (pipename)
C.name = pipename
C.construction(dir, pipe_dir)
C.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_MANIFOLD)
var/obj/machinery/atmospherics/pipe/manifold/M = new(loc)
M.construction(dir, pipe_dir)
M.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_4WAYMANIFOLD)
var/obj/machinery/atmospherics/pipe/manifold4w/M = new( src.loc )
M.construction(dir, pipe_dir)
M.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_JUNCTION)
var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/P = new ( src.loc )
P.initialize_directions_he = src.get_hdir()
P.construction(dir, get_pdir())
P.construction(dir, get_pdir(), pipe_type, color)
if(PIPE_UVENT)
var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc )
V.construction(dir, pipe_dir)
V.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_MVALVE)
var/obj/machinery/atmospherics/binary/valve/V = new(src.loc)
if (pipename)
V.name = pipename
V.construction(dir, get_pdir())
V.construction(dir, get_pdir(), pipe_type, color)
if(PIPE_DVALVE)
var/obj/machinery/atmospherics/valve/digital/V = new(src.loc)
var/obj/machinery/atmospherics/binary/valve/digital/V = new(src.loc)
if (pipename)
V.name = pipename
V.construction(dir, get_pdir())
V.construction(dir, get_pdir(), pipe_type, color)
if(PIPE_PUMP)
var/obj/machinery/atmospherics/binary/pump/P = new(src.loc)
P.construction(dir, pipe_dir)
P.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_GAS_FILTER, PIPE_GAS_MIXER)
var/obj/machinery/atmospherics/trinary/P
@@ -369,41 +370,42 @@ var/global/list/pipeID2State = list(
P.flipped = flipped
if (pipename)
P.name = pipename
P.construction(unflip(dir), pipe_dir)
P.construction(unflip(dir), pipe_dir, pipe_type, color)
if(PIPE_SCRUBBER)
var/obj/machinery/atmospherics/unary/vent_scrubber/S = new(src.loc)
if (pipename)
S.name = pipename
S.construction(dir, pipe_dir)
S.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_INSULATED_STRAIGHT, PIPE_INSULATED_BENT)
var/obj/machinery/atmospherics/pipe/simple/insulated/P = new( src.loc )
P.construction(dir, pipe_dir)
P.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_PASSIVE_GATE)
var/obj/machinery/atmospherics/binary/passive_gate/P = new(src.loc)
if (pipename)
P.name = pipename
P.construction(dir, pipe_dir)
P.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_VOLUME_PUMP)
var/obj/machinery/atmospherics/binary/volume_pump/P = new(src.loc)
if (pipename)
P.name = pipename
P.construction(dir, pipe_dir)
P.construction(dir, pipe_dir, pipe_type, color)
if(PIPE_HEAT_EXCHANGE)
var/obj/machinery/atmospherics/unary/heat_exchanger/C = new( src.loc )
if (pipename)
C.name = pipename
C.construction(dir, pipe_dir)
C.construction(dir, pipe_dir, pipe_type, color)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] fastens \the [src].", \
"<span class='notice'>You have fastened \the [src].</span>", \
"You hear ratchet.")
qdel(src) // remove the pipe item
return