Files
vgstation13/code/ATMOSPHERICS/components/unary/vent.dm
ComicIronic 7c0f3e1266 Pipe unification and type switching
Tanks are now unaries, not pipes.
Portable connectors are now unaries, not their own type.
Valves are now binaries, T-Valves are now trinaries.
Pipes as much as possible now use the general attackby code.
Slight changes to pooling code.
Removed loads of duplicate code that existed for no real reason.
T-Valves now come in manual and digital and mirrored under those types, not the other way around.
Mirrored connecting sprites for T-Valves should show up properly now.

Never again.
2015-02-18 21:36:36 +00:00

79 lines
1.6 KiB
Plaintext

/obj/machinery/atmospherics/unary/vent
icon = 'icons/obj/atmospherics/pipe_vent.dmi'
icon_state = "intact"
name = "Vent"
desc = "A large air vent"
level = 1
var/volume = 250
dir = SOUTH
initialize_directions = SOUTH
var/build_killswitch = 1
/obj/machinery/atmospherics/unary/vent/high_volume
name = "Larger vent"
volume = 1000
/obj/machinery/atmospherics/unary/vent/New()
..()
air_contents.volume=volume
/obj/machinery/atmospherics/unary/vent/process()
..()
CHECK_DISABLED(vents)
if (!node)
return // Turning off the vent is a PITA. - N3X
// New GC does this sometimes
if(!loc) return
//air_contents.mingle_with_turf(loc)
var/datum/gas_mixture/removed = air_contents.remove(volume)
loc.assume_air(removed)
/obj/machinery/atmospherics/unary/vent/update_icon()
if(node)
icon_state = "intact"
//dir = get_dir(src, node)
else
icon_state = "exposed"
/obj/machinery/atmospherics/unary/vent/initialize()
..()
update_icon()
/obj/machinery/atmospherics/unary/vent/disconnect(obj/machinery/atmospherics/reference)
..()
update_icon()
/obj/machinery/atmospherics/unary/vent/hide(var/i)
if(node)
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
dir = get_dir(src, node)
else
icon_state = "exposed"
/obj/machinery/atmospherics/unary/vent/buildFrom(var/mob/usr,var/obj/item/pipe/pipe)
if(pipe)
dir = pipe.dir
initialize_directions = pipe.get_pipe_dir()
if (pipe.pipename)
name = pipe.pipename
else
initialize_directions = dir
var/turf/T = loc
level = T.intact ? 2 : 1
initialize()
build_network()
if (node)
node.initialize()
node.build_network()
return 1