diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index abf71c4ea0d..953988cf929 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -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() diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index 8e81d0469f5..88ae07300b8 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -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() diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 6fdd2c66f21..77508a31c7d 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -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 diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 94c92c5ff18..d687da775df 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -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 */ diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index e33065ff618..b0574071ee8 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -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 */ diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 8ccf44a4d2a..9685f0ba257 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -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) diff --git a/code/ATMOSPHERICS/he_pipes.dm b/code/ATMOSPHERICS/he_pipes.dm index 182696fe101..e37c7ba74bc 100644 --- a/code/ATMOSPHERICS/he_pipes.dm +++ b/code/ATMOSPHERICS/he_pipes.dm @@ -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 diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index 434a4b3c9e7..2952dbc7674 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -27,6 +27,7 @@ ..() +/obj/machinery/atmospherics/pipe/manifold/SetInitDirections() switch(dir) if(NORTH) initialize_directions = EAST|SOUTH|WEST diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index 17b6528e039..6fc3ba86629 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -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)) diff --git a/code/ATMOSPHERICS/pipes/simple.dm b/code/ATMOSPHERICS/pipes/simple.dm index eabf5a2badb..7bc3347ce06 100644 --- a/code/ATMOSPHERICS/pipes/simple.dm +++ b/code/ATMOSPHERICS/pipes/simple.dm @@ -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 diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 711eca2679a..de4b1fe11ac 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -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].", \ "You have fastened \the [src].", \ "You hear ratchet.") + qdel(src) // remove the pipe item return diff --git a/icons/obj/pipes.dmi b/icons/obj/pipes.dmi index e5ad7ebb004..79e6661e386 100644 Binary files a/icons/obj/pipes.dmi and b/icons/obj/pipes.dmi differ