mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 03:51:49 +01:00
* Replace SSingulo with SScalamity; processing cleanup
- SScalamity now handles blobs as well as singularity-types.
- Processing subtypes have been simplified to not require a stop_processing definition.
* this is probably important
* Remove cascade disabling SSgarbage
* Fixed a bug where dust() did not qdel the target mob
* Misc fixes
* Fix decals surviving break-to-plating
* Subsystem flag tweaks
* Apparently subsystems are new'd before config is.
* Fix paper icons
* Speculative fix for insane lag
* Better machinery stat
* Make organs not use SSoverlay
* Misc bugfixes & tweaks
* Nightmode fixes
* Changelog for SMC
* Port /tg/'s improved MC crash handling
* Add some more SS Recover() procs
* supply_controller -> SScargo
* More New() -> Initialize()
* pAI and robot construction overlays
* Fix cargo unit tests
* Merge the DMM Suite's atom/New() into atoms_init
* Lighting pre-baking
* Lighting initialization logging
* Fix some bad SS init orders
* Fix SSlighting logging; rename Processes to MC
* Speculative fix for insane GC lag
* Prebaked openturf/icon_smooth & fix lighting prebake
* SS init status; SSatoms LATEQDEL
* Fix bug with MC init stat panel
* Fix parallax
* Misc
* Ignore SS_NO_DISPLAY during init
* apparently this is important
* REEEEEE
* Image GC fixes; broadcaster radio-new sanity
* RCON Cleanup
* Move pAI recruiter into subsystem
* Move global solars list into sun subsystem
* Make chickens not use a global
* Demote SSdisposals to SS_BACKGROUND; garbage-debug cleanup
* Speed up space init a little
* Fix bad timer flags on floor drying
* Subsystem panic-restart verb for mins
* Explosion speedup
* Minor subsystem & MC logging tweaks
* SSopenturf improvements
* Make pipenet actually initialize (whoops)
* Minor tweaks
* Implement lighting rounding
* comments are hard okay
* Minor lattice tweaks
* Fix some timer issues & better closet init
* Timer sanity
* Request console tweaks + Storage init sanity
* Minor SSmachiner RCON improvements
* Further reduce world-start timer count
* Standardize subsystem logging
* Garbage hard delete profiling from /tg/
* Timer hang detection & recovery
* Log machines that sleep in process() and fuck up SSmachinery
* Fix an issue with external airlocks sleeping in process()
* Failsafe logging
* Minor tweaks
* Revert "Request console tweaks + Storage init sanity"
This reverts commit 98d3579e35.
* Re-implement RC changes
* Fix SQL FT saving
* Fix SSmachinery sleep in disposals
* Minor SS tweaks
* Paper fixes
* Blood drying fixes
* Merge gameticker and SSticker
* Minor global list init cleanup
* Lagcheck biogenerator & bags
* Tweak SScargo init order; RIG Initialize()
* Caching tweaks
* Remove rogue comma
* Initialize fixes
* Lighting destroy cleanup
* Fix emagging airlocks
* Initial SSicon implementation
* Tweaks & Fixes
* Fire + Air alarm queued icon updates
* Overlays + Queued icon cleanup
* Runtime & background fixes
* Kill some meaningless set statements
* Kill some image qdels
* Bump up lighting rounding val
* Fix adv. scanner destroy runtimes
* Remove unneeded icon update limiting
* Move icon smoothing into helpers
* Show a warning if DM 510 compiles without memory leak hack enabled
* Re-organize subsystems & MC defines a little
* Airlock SFX
* Log of Changes
* Make SSicon_update disable itself when not doing anything
* Fix respawn verb runtime when used early in server-init
* Add more information to MC's stat_entry()
* Replace direct refernces to gcDestroyed with QDEL* macros
* plant_controller -> SSplants
* More plant tweaks
* Add more humor to changelog
* Move parallax globals into SSparallax
* Lighting responsiveness tweaks
* Fix parallax init order & better MC init panel stat
* Make mobs GC
* More overlays + Remove intercom spawn()
* SSfast_process; make pinpointers not use spawn-recursion to process
Also made the SM Cascade beach process with SSprocessing instead of a spawn loop.
* Update changelog
* Mob GC tweaks
* Del() cleanup
* Fix insomniac ZAS connection edges
* Minor pAI cleanup
* Convert more things to SSoverlay; fix duplicated overlay in field gens
* SM Bluespace turf tweaks
* Update SSgarbage debug globals list
* Human-type qdel tweaks
* Subsystem suspension; stat_entry improvements
* SQL Statistics cleanup
* Fix runtimes with ambrosia
* More disable() -> suspend(); fix nightmode again
* Human qdel fix; minor tweaks
* Update turbolift to work with StonedMC
* Make lifts use timers instead of a subsystem
* Make SSassets start earlier
* Convert the radio controller into a subsystem
* Fix some missing CHECK_TICKs in asteroid generation
* MC stat tweaks; make shouldnt_see a typecache
* Kill some redundant debug-controller entries
* radio_controller -> SSradio
* Better SSgarbage hard-del logging from /tg/ upstream
* Logging tweaks + GELF
* Misc client caching improvements
* Slime SSoverlay
* Oven icon fixes
* Implant fixes
- Death implants will no longer spam Common on death of user.
- Death implants should handle a deleted user better.
* Holder tweaks + Welding tool Initialize()
* Fix some bad subsystem logging
* Fix suit cooling units spawning without cells
* Starlight tweaks
* Gibber infinite gib fix
* More SSoverlay stuff
* Make crates use CUT_OVERLAY_IN
* Make SSarrivals suspend instead of disable
* Make openturf use split/phased tick checks
* Speculative fix for unwet timer runtimes
* Blood overlay tweaks/fixes
* Update crusher to play nice with SMC + SSoverlay
* Openturf improvements and fixes
* Minor turbolift tweaks
* Lighting performance improvements + ChangeTurf tweaks
* this is probably important
* Fix wall weld noises on changeturf
* More ChangeTurf tweaks
* Explosion tweaks
* Pre-game lobby tweaks
* Openturf tweaks
* Prevent admins from starting the game before init finishes
* Fix Travis
* Kill an unused var
* Fix ChangeTurf runtimes on openturfs
* Fixes
* Browser datum fixes, asset caching
* Update changelog
* Changelog
* Lobby tweaks
* Ticker tweaks; kill ticker var
* Further lobby tweaks
* Cascade tweaks
* air_master -> SSair
* Reduce overhead from radio autosay
* alarm_manager -> SSalarm
* bomb_processor -> SSexplosives
* corp_regs -> SSlaw
* ZAS overlay fixes
* Small wall icon optimization
* Fix effects master
* Assembly tweaks
* Megavend fixes
* Shuttle fixes
* Camera alert performance improvements
* Fix some world.log spam from lighting overlays
* Fix some Initialize() procs
* Openspace responsiveness tweaks
* Make HE pipes animate through openturfs
* Kill a spawn
1405 lines
39 KiB
Plaintext
1405 lines
39 KiB
Plaintext
/obj/machinery/atmospherics/pipe
|
|
|
|
var/datum/gas_mixture/air_temporary // used when reconstructing a pipeline that broke
|
|
var/datum/pipeline/parent
|
|
var/volume = 0
|
|
force = 20
|
|
|
|
layer = 2.4 //under wires with their 2.44
|
|
use_power = 0
|
|
|
|
var/alert_pressure = 80*ONE_ATMOSPHERE
|
|
//minimum pressure before check_pressure(...) should be called
|
|
|
|
can_buckle = 1
|
|
buckle_require_restraints = 1
|
|
buckle_lying = -1
|
|
|
|
/obj/machinery/atmospherics/pipe/drain_power()
|
|
return -1
|
|
|
|
/obj/machinery/atmospherics/pipe/New()
|
|
if(istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall))
|
|
level = 1
|
|
..()
|
|
|
|
/obj/machinery/atmospherics/pipe/hides_under_flooring()
|
|
return level != 2
|
|
|
|
/obj/machinery/atmospherics/pipe/proc/pipeline_expansion()
|
|
return null
|
|
|
|
/obj/machinery/atmospherics/pipe/proc/check_pressure(pressure)
|
|
//Return 1 if parent should continue checking other pipes
|
|
//Return null if parent should stop checking other pipes. Recall: qdel(src) will by default return null
|
|
|
|
return 1
|
|
|
|
/obj/machinery/atmospherics/pipe/return_air()
|
|
if(!parent)
|
|
parent = new /datum/pipeline()
|
|
parent.build_pipeline(src)
|
|
|
|
return parent.air
|
|
|
|
/obj/machinery/atmospherics/pipe/build_network()
|
|
if(!parent)
|
|
parent = new /datum/pipeline()
|
|
parent.build_pipeline(src)
|
|
|
|
return parent.return_network()
|
|
|
|
/obj/machinery/atmospherics/pipe/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
|
|
if(!parent)
|
|
parent = new /datum/pipeline()
|
|
parent.build_pipeline(src)
|
|
|
|
return parent.network_expand(new_network, reference)
|
|
|
|
/obj/machinery/atmospherics/pipe/return_network(obj/machinery/atmospherics/reference)
|
|
if(!parent)
|
|
parent = new /datum/pipeline()
|
|
parent.build_pipeline(src)
|
|
|
|
return parent.return_network(reference)
|
|
|
|
/obj/machinery/atmospherics/pipe/Destroy()
|
|
QDEL_NULL(parent)
|
|
if(air_temporary)
|
|
loc.assume_air(air_temporary)
|
|
QDEL_NULL(air_temporary)
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
|
|
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
|
|
return ..()
|
|
if (istype(src, /obj/machinery/atmospherics/pipe/vent))
|
|
return ..()
|
|
|
|
if(istype(W,/obj/item/device/pipe_painter))
|
|
return 0
|
|
|
|
if (!istype(W, /obj/item/weapon/wrench))
|
|
return ..()
|
|
var/turf/T = src.loc
|
|
if (level==1 && isturf(T) && !T.is_plating())
|
|
user << "<span class='warning'>You must remove the plating first.</span>"
|
|
return 1
|
|
var/datum/gas_mixture/int_air = return_air()
|
|
var/datum/gas_mixture/env_air = loc.return_air()
|
|
if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE)
|
|
user << "<span class='warning'>You cannot unwrench \the [src], it is too exerted due to internal pressure.</span>"
|
|
add_fingerprint(user)
|
|
return 1
|
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
|
user << "<span class='notice'>You begin to unfasten \the [src]...</span>"
|
|
if (do_after(user, 40, act_target = src))
|
|
user.visible_message( \
|
|
"<span class='notice'>\The [user] unfastens \the [src].</span>", \
|
|
"<span class='notice'>You have unfastened \the [src].</span>", \
|
|
"You hear a ratchet.")
|
|
new /obj/item/pipe(loc, make_from=src)
|
|
for (var/obj/machinery/meter/meter in T)
|
|
if (meter.target == src)
|
|
new /obj/item/pipe_meter(T)
|
|
qdel(meter)
|
|
qdel(src)
|
|
|
|
/obj/machinery/atmospherics/proc/change_color(var/new_color)
|
|
//only pass valid pipe colors please ~otherwise your pipe will turn invisible
|
|
if(!pipe_color_check(new_color))
|
|
return
|
|
|
|
pipe_color = new_color
|
|
update_icon()
|
|
|
|
/*
|
|
/obj/machinery/atmospherics/pipe/add_underlay(var/obj/machinery/atmospherics/node, var/direction)
|
|
if(istype(src, /obj/machinery/atmospherics/pipe/tank)) //todo: move tanks to unary devices
|
|
return ..()
|
|
|
|
if(node)
|
|
var/temp_dir = get_dir(src, node)
|
|
underlays += icon_manager.get_atmos_icon("pipe_underlay_intact", temp_dir, color_cache_name(node))
|
|
return temp_dir
|
|
else if(direction)
|
|
underlays += icon_manager.get_atmos_icon("pipe_underlay_exposed", direction, pipe_color)
|
|
else
|
|
return null
|
|
*/
|
|
|
|
/obj/machinery/atmospherics/pipe/color_cache_name(var/obj/machinery/atmospherics/node)
|
|
if(istype(src, /obj/machinery/atmospherics/pipe/tank))
|
|
return ..()
|
|
|
|
if(istype(node, /obj/machinery/atmospherics/pipe/manifold) || istype(node, /obj/machinery/atmospherics/pipe/manifold4w))
|
|
if(pipe_color == node.pipe_color)
|
|
return node.pipe_color
|
|
else
|
|
return null
|
|
else if(istype(node, /obj/machinery/atmospherics/pipe/simple))
|
|
return node.pipe_color
|
|
else
|
|
return pipe_color
|
|
|
|
/obj/machinery/atmospherics/pipe/simple
|
|
icon = 'icons/atmos/pipes.dmi'
|
|
icon_state = ""
|
|
var/pipe_icon = "" //what kind of pipe it is and from which dmi is the icon manager getting its icons, "" for simple pipes, "hepipe" for HE pipes, "hejunction" for HE junctions
|
|
name = "pipe"
|
|
desc = "A one meter section of regular pipe"
|
|
|
|
volume = ATMOS_DEFAULT_VOLUME_PIPE
|
|
|
|
dir = SOUTH
|
|
initialize_directions = SOUTH|NORTH
|
|
|
|
var/minimum_temperature_difference = 300
|
|
var/thermal_conductivity = 0 //WALL_HEAT_TRANSFER_COEFFICIENT No
|
|
|
|
var/maximum_pressure = 70*ONE_ATMOSPHERE
|
|
var/fatigue_pressure = 55*ONE_ATMOSPHERE
|
|
alert_pressure = 55*ONE_ATMOSPHERE
|
|
|
|
level = 1
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/New()
|
|
..()
|
|
|
|
// Pipe colors and icon states are handled by an image cache - so color and icon should
|
|
// be null. For mapping purposes color is defined in the object definitions.
|
|
icon = null
|
|
alpha = 255
|
|
|
|
switch(dir)
|
|
if(SOUTH || NORTH)
|
|
initialize_directions = SOUTH|NORTH
|
|
if(EAST || WEST)
|
|
initialize_directions = EAST|WEST
|
|
if(NORTHEAST)
|
|
initialize_directions = NORTH|EAST
|
|
if(NORTHWEST)
|
|
initialize_directions = NORTH|WEST
|
|
if(SOUTHEAST)
|
|
initialize_directions = SOUTH|EAST
|
|
if(SOUTHWEST)
|
|
initialize_directions = SOUTH|WEST
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hide(var/i)
|
|
if(istype(loc, /turf/simulated))
|
|
invisibility = i ? 101 : 0
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/process()
|
|
if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle
|
|
..()
|
|
else
|
|
. = PROCESS_KILL
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/check_pressure(pressure)
|
|
var/datum/gas_mixture/environment = loc.return_air()
|
|
|
|
var/pressure_difference = pressure - environment.return_pressure()
|
|
|
|
if(pressure_difference > maximum_pressure)
|
|
burst()
|
|
|
|
else if(pressure_difference > fatigue_pressure)
|
|
//TODO: leak to turf, doing pfshhhhh
|
|
if(prob(5))
|
|
burst()
|
|
|
|
else return 1
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/proc/burst()
|
|
src.visible_message("<span class='danger'>\The [src] bursts!</span>");
|
|
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
|
|
var/datum/effect/effect/system/smoke_spread/smoke = new
|
|
smoke.set_up(1,0, src.loc, 0)
|
|
smoke.start()
|
|
qdel(src)
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
|
|
if(dir==3)
|
|
set_dir(1)
|
|
else if(dir==12)
|
|
set_dir(4)
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/Destroy()
|
|
if(node1)
|
|
node1.disconnect(src)
|
|
if(node2)
|
|
node2.disconnect(src)
|
|
|
|
node1 = null
|
|
node2 = null
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/pipeline_expansion()
|
|
return list(node1, node2)
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/change_color(var/new_color)
|
|
..()
|
|
//for updating connected atmos device pipes (i.e. vents, manifolds, etc)
|
|
if(node1)
|
|
node1.update_underlays()
|
|
if(node2)
|
|
node2.update_underlays()
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/update_icon(var/safety = 0)
|
|
if(!check_icon_cache())
|
|
return
|
|
|
|
alpha = 255
|
|
|
|
cut_overlays()
|
|
|
|
if(!node1 && !node2)
|
|
var/turf/T = get_turf(src)
|
|
new /obj/item/pipe(loc, make_from=src)
|
|
for (var/obj/machinery/meter/meter in T)
|
|
if (meter.target == src)
|
|
new /obj/item/pipe_meter(T)
|
|
qdel(meter)
|
|
qdel(src)
|
|
else if(node1 && node2)
|
|
add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]intact[icon_connect_type]"))
|
|
else
|
|
add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "[pipe_icon]exposed[node1?1:0][node2?1:0][icon_connect_type]"))
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/update_underlays()
|
|
return
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/initialize()
|
|
normalize_dir()
|
|
var/node1_dir
|
|
var/node2_dir
|
|
|
|
for(var/direction in cardinal)
|
|
if(direction&initialize_directions)
|
|
if (!node1_dir)
|
|
node1_dir = direction
|
|
else if (!node2_dir)
|
|
node2_dir = direction
|
|
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node1 = target
|
|
break
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node2 = target
|
|
break
|
|
|
|
if(!node1 && !node2)
|
|
qdel(src)
|
|
return
|
|
|
|
var/turf/T = loc
|
|
if(level == 1 && !T.is_plating()) hide(1)
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference)
|
|
if(reference == node1)
|
|
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node1 = null
|
|
|
|
if(reference == node2)
|
|
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node2 = null
|
|
|
|
update_icon()
|
|
|
|
return null
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible
|
|
icon_state = "intact"
|
|
level = 2
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/scrubbers
|
|
name = "Scrubbers pipe"
|
|
desc = "A one meter section of scrubbers pipe"
|
|
icon_state = "intact-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/supply
|
|
name = "Air supply pipe"
|
|
desc = "A one meter section of supply pipe"
|
|
icon_state = "intact-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/yellow
|
|
color = PIPE_COLOR_YELLOW
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/cyan
|
|
color = PIPE_COLOR_CYAN
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/green
|
|
color = PIPE_COLOR_GREEN
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/black
|
|
color = PIPE_COLOR_BLACK
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/red
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/blue
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden
|
|
icon_state = "intact"
|
|
level = 1
|
|
alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers
|
|
name = "Scrubbers pipe"
|
|
desc = "A one meter section of scrubbers pipe"
|
|
icon_state = "intact-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/supply
|
|
name = "Air supply pipe"
|
|
desc = "A one meter section of supply pipe"
|
|
icon_state = "intact-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/yellow
|
|
color = PIPE_COLOR_YELLOW
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/cyan
|
|
color = PIPE_COLOR_CYAN
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/green
|
|
color = PIPE_COLOR_GREEN
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/black
|
|
color = PIPE_COLOR_BLACK
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/red
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/blue
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/insulated
|
|
icon = 'icons/obj/atmospherics/red_pipe.dmi'
|
|
icon_state = "intact"
|
|
|
|
minimum_temperature_difference = 10000
|
|
thermal_conductivity = 0
|
|
maximum_pressure = 1000*ONE_ATMOSPHERE
|
|
fatigue_pressure = 900*ONE_ATMOSPHERE
|
|
alert_pressure = 900*ONE_ATMOSPHERE
|
|
|
|
level = 2
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold
|
|
icon = 'icons/atmos/manifold.dmi'
|
|
icon_state = ""
|
|
name = "pipe manifold"
|
|
desc = "A manifold composed of regular pipes"
|
|
|
|
volume = ATMOS_DEFAULT_VOLUME_PIPE * 1.5
|
|
|
|
dir = SOUTH
|
|
initialize_directions = EAST|NORTH|WEST
|
|
|
|
var/obj/machinery/atmospherics/node3
|
|
|
|
level = 1
|
|
layer = 2.4 //under wires with their 2.44
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/New()
|
|
..()
|
|
alpha = 255
|
|
icon = null
|
|
|
|
switch(dir)
|
|
if(NORTH)
|
|
initialize_directions = EAST|SOUTH|WEST
|
|
if(SOUTH)
|
|
initialize_directions = WEST|NORTH|EAST
|
|
if(EAST)
|
|
initialize_directions = SOUTH|WEST|NORTH
|
|
if(WEST)
|
|
initialize_directions = NORTH|EAST|SOUTH
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hide(var/i)
|
|
if(istype(loc, /turf/simulated))
|
|
invisibility = i ? 101 : 0
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/pipeline_expansion()
|
|
return list(node1, node2, node3)
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/process()
|
|
if(!parent)
|
|
..()
|
|
else
|
|
. = PROCESS_KILL
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/Destroy()
|
|
if(node1)
|
|
node1.disconnect(src)
|
|
if(node2)
|
|
node2.disconnect(src)
|
|
if(node3)
|
|
node3.disconnect(src)
|
|
|
|
node1 = null
|
|
node2 = null
|
|
node3 = null
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference)
|
|
if(reference == node1)
|
|
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node1 = null
|
|
|
|
if(reference == node2)
|
|
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node2 = null
|
|
|
|
if(reference == node3)
|
|
if(istype(node3, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node3 = null
|
|
|
|
update_icon()
|
|
|
|
..()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/change_color(var/new_color)
|
|
..()
|
|
//for updating connected atmos device pipes (i.e. vents, manifolds, etc)
|
|
if(node1)
|
|
node1.update_underlays()
|
|
if(node2)
|
|
node2.update_underlays()
|
|
if(node3)
|
|
node3.update_underlays()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/update_icon(var/safety = 0)
|
|
if(!check_icon_cache())
|
|
return
|
|
|
|
alpha = 255
|
|
|
|
if(!node1 && !node2 && !node3)
|
|
var/turf/T = get_turf(src)
|
|
new /obj/item/pipe(loc, make_from=src)
|
|
for (var/obj/machinery/meter/meter in T)
|
|
if (meter.target == src)
|
|
new /obj/item/pipe_meter(T)
|
|
qdel(meter)
|
|
qdel(src)
|
|
else
|
|
cut_overlays()
|
|
add_overlay(icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type))
|
|
add_overlay(icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type))
|
|
|
|
// Can't handle underlays with SSoverlay.
|
|
underlays.Cut()
|
|
|
|
var/turf/T = get_turf(src)
|
|
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
|
|
var/node1_direction = get_dir(src, node1)
|
|
var/node2_direction = get_dir(src, node2)
|
|
var/node3_direction = get_dir(src, node3)
|
|
|
|
directions -= dir
|
|
|
|
directions -= add_underlay(T,node1,node1_direction,icon_connect_type)
|
|
directions -= add_underlay(T,node2,node2_direction,icon_connect_type)
|
|
directions -= add_underlay(T,node3,node3_direction,icon_connect_type)
|
|
|
|
for(var/D in directions)
|
|
add_underlay(T,,D,icon_connect_type)
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/update_underlays()
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/initialize()
|
|
var/connect_directions = (NORTH|SOUTH|EAST|WEST)&(~dir)
|
|
|
|
for(var/direction in cardinal)
|
|
if(direction&connect_directions)
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node1 = target
|
|
connect_directions &= ~direction
|
|
break
|
|
if (node1)
|
|
break
|
|
|
|
|
|
for(var/direction in cardinal)
|
|
if(direction&connect_directions)
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node2 = target
|
|
connect_directions &= ~direction
|
|
break
|
|
if (node2)
|
|
break
|
|
|
|
|
|
for(var/direction in cardinal)
|
|
if(direction&connect_directions)
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node3 = target
|
|
connect_directions &= ~direction
|
|
break
|
|
if (node3)
|
|
break
|
|
|
|
if(!node1 && !node2 && !node3)
|
|
qdel(src)
|
|
return
|
|
|
|
var/turf/T = get_turf(src)
|
|
if(level == 1 && !T.is_plating()) hide(1)
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible
|
|
icon_state = "map"
|
|
level = 2
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/scrubbers
|
|
name="Scrubbers pipe manifold"
|
|
desc = "A manifold composed of scrubbers pipes"
|
|
icon_state = "map-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/supply
|
|
name="Air supply pipe manifold"
|
|
desc = "A manifold composed of supply pipes"
|
|
icon_state = "map-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/yellow
|
|
color = PIPE_COLOR_YELLOW
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/cyan
|
|
color = PIPE_COLOR_CYAN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/green
|
|
color = PIPE_COLOR_GREEN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/black
|
|
color = PIPE_COLOR_BLACK
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/red
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/visible/blue
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden
|
|
icon_state = "map"
|
|
level = 1
|
|
alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers
|
|
name="Scrubbers pipe manifold"
|
|
desc = "A manifold composed of scrubbers pipes"
|
|
icon_state = "map-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/supply
|
|
name="Air supply pipe manifold"
|
|
desc = "A manifold composed of supply pipes"
|
|
icon_state = "map-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/yellow
|
|
color = PIPE_COLOR_YELLOW
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/cyan
|
|
color = PIPE_COLOR_CYAN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/green
|
|
color = PIPE_COLOR_GREEN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/black
|
|
color = PIPE_COLOR_BLACK
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/red
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold/hidden/blue
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w
|
|
icon = 'icons/atmos/manifold.dmi'
|
|
icon_state = ""
|
|
name = "4-way pipe manifold"
|
|
desc = "A manifold composed of regular pipes"
|
|
|
|
volume = ATMOS_DEFAULT_VOLUME_PIPE * 2
|
|
|
|
dir = SOUTH
|
|
initialize_directions = NORTH|SOUTH|EAST|WEST
|
|
|
|
var/obj/machinery/atmospherics/node3
|
|
var/obj/machinery/atmospherics/node4
|
|
|
|
level = 1
|
|
layer = 2.4 //under wires with their 2.44
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/New()
|
|
..()
|
|
alpha = 255
|
|
icon = null
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion()
|
|
return list(node1, node2, node3, node4)
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/process()
|
|
if(!parent)
|
|
..()
|
|
else
|
|
. = PROCESS_KILL
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/Destroy()
|
|
if(node1)
|
|
node1.disconnect(src)
|
|
if(node2)
|
|
node2.disconnect(src)
|
|
if(node3)
|
|
node3.disconnect(src)
|
|
if(node4)
|
|
node4.disconnect(src)
|
|
|
|
node1 = null
|
|
node2 = null
|
|
node3 = null
|
|
node4 = null
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference)
|
|
if(reference == node1)
|
|
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node1 = null
|
|
|
|
if(reference == node2)
|
|
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node2 = null
|
|
|
|
if(reference == node3)
|
|
if(istype(node3, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node3 = null
|
|
|
|
if(reference == node4)
|
|
if(istype(node4, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node4 = null
|
|
|
|
update_icon()
|
|
|
|
..()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/change_color(var/new_color)
|
|
..()
|
|
//for updating connected atmos device pipes (i.e. vents, manifolds, etc)
|
|
if(node1)
|
|
node1.update_underlays()
|
|
if(node2)
|
|
node2.update_underlays()
|
|
if(node3)
|
|
node3.update_underlays()
|
|
if(node4)
|
|
node4.update_underlays()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/update_icon(var/safety = 0)
|
|
if(!check_icon_cache())
|
|
return
|
|
|
|
alpha = 255
|
|
|
|
if(!node1 && !node2 && !node3 && !node4)
|
|
var/turf/T = get_turf(src)
|
|
new /obj/item/pipe(loc, make_from=src)
|
|
for (var/obj/machinery/meter/meter in T)
|
|
if (meter.target == src)
|
|
new /obj/item/pipe_meter(T)
|
|
qdel(meter)
|
|
qdel(src)
|
|
else
|
|
cut_overlays()
|
|
add_overlay(icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type))
|
|
add_overlay(icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type))
|
|
|
|
underlays.Cut()
|
|
|
|
/*
|
|
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
|
|
|
|
|
|
directions -= add_underlay(node1)
|
|
directions -= add_underlay(node2)
|
|
directions -= add_underlay(node3)
|
|
directions -= add_underlay(node4)
|
|
|
|
for(var/D in directions)
|
|
add_underlay(,D)
|
|
*/
|
|
|
|
var/turf/T = get_turf(src)
|
|
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
|
|
var/node1_direction = get_dir(src, node1)
|
|
var/node2_direction = get_dir(src, node2)
|
|
var/node3_direction = get_dir(src, node3)
|
|
var/node4_direction = get_dir(src, node4)
|
|
|
|
directions -= dir
|
|
|
|
directions -= add_underlay(T,node1,node1_direction,icon_connect_type)
|
|
directions -= add_underlay(T,node2,node2_direction,icon_connect_type)
|
|
directions -= add_underlay(T,node3,node3_direction,icon_connect_type)
|
|
directions -= add_underlay(T,node4,node4_direction,icon_connect_type)
|
|
|
|
for(var/D in directions)
|
|
add_underlay(T,,D,icon_connect_type)
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/update_underlays()
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hide(var/i)
|
|
if(istype(loc, /turf/simulated))
|
|
invisibility = i ? 101 : 0
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/initialize()
|
|
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,1))
|
|
if(target.initialize_directions & 2)
|
|
if (check_connect_types(target,src))
|
|
node1 = target
|
|
break
|
|
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,2))
|
|
if(target.initialize_directions & 1)
|
|
if (check_connect_types(target,src))
|
|
node2 = target
|
|
break
|
|
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,4))
|
|
if(target.initialize_directions & 8)
|
|
if (check_connect_types(target,src))
|
|
node3 = target
|
|
break
|
|
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,8))
|
|
if(target.initialize_directions & 4)
|
|
if (check_connect_types(target,src))
|
|
node4 = target
|
|
break
|
|
|
|
if(!node1 && !node2 && !node3 && !node4)
|
|
qdel(src)
|
|
return
|
|
|
|
var/turf/T = get_turf(src)
|
|
if(level == 1 && !T.is_plating()) hide(1)
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible
|
|
icon_state = "map_4way"
|
|
level = 2
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/scrubbers
|
|
name="4-way scrubbers pipe manifold"
|
|
desc = "A manifold composed of scrubbers pipes"
|
|
icon_state = "map_4way-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/supply
|
|
name="4-way air supply pipe manifold"
|
|
desc = "A manifold composed of supply pipes"
|
|
icon_state = "map_4way-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/yellow
|
|
color = PIPE_COLOR_YELLOW
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/cyan
|
|
color = PIPE_COLOR_CYAN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/green
|
|
color = PIPE_COLOR_GREEN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/black
|
|
color = PIPE_COLOR_BLACK
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/red
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/visible/blue
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden
|
|
icon_state = "map_4way"
|
|
level = 1
|
|
alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers
|
|
name="4-way scrubbers pipe manifold"
|
|
desc = "A manifold composed of scrubbers pipes"
|
|
icon_state = "map_4way-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply
|
|
name="4-way air supply pipe manifold"
|
|
desc = "A manifold composed of supply pipes"
|
|
icon_state = "map_4way-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/yellow
|
|
color = PIPE_COLOR_YELLOW
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/cyan
|
|
color = PIPE_COLOR_CYAN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/green
|
|
color = PIPE_COLOR_GREEN
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/black
|
|
color = PIPE_COLOR_BLACK
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/red
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/manifold4w/hidden/blue
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/cap
|
|
name = "pipe endcap"
|
|
desc = "An endcap for pipes"
|
|
icon = 'icons/atmos/pipes.dmi'
|
|
icon_state = ""
|
|
level = 2
|
|
layer = 2.4 //under wires with their 2.44
|
|
|
|
volume = 35
|
|
|
|
dir = SOUTH
|
|
initialize_directions = SOUTH
|
|
|
|
var/obj/machinery/atmospherics/node
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/New()
|
|
..()
|
|
initialize_directions = dir
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/hide(var/i)
|
|
if(istype(loc, /turf/simulated))
|
|
invisibility = i ? 101 : 0
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/pipeline_expansion()
|
|
return list(node)
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/process()
|
|
if(!parent)
|
|
..()
|
|
else
|
|
. = PROCESS_KILL
|
|
/obj/machinery/atmospherics/pipe/cap/Destroy()
|
|
if(node)
|
|
node.disconnect(src)
|
|
|
|
node = null
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/disconnect(obj/machinery/atmospherics/reference)
|
|
if(reference == node)
|
|
if(istype(node, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node = null
|
|
|
|
update_icon()
|
|
|
|
..()
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/change_color(var/new_color)
|
|
..()
|
|
//for updating connected atmos device pipes (i.e. vents, manifolds, etc)
|
|
if(node)
|
|
node.update_underlays()
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/update_icon(var/safety = 0)
|
|
if(!check_icon_cache())
|
|
return
|
|
|
|
alpha = 255
|
|
|
|
cut_overlays()
|
|
add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "cap"))
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/initialize()
|
|
for(var/obj/machinery/atmospherics/target in get_step(src, dir))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node = target
|
|
break
|
|
|
|
var/turf/T = src.loc // hide if turf is not intact
|
|
if(level == 1 && !T.is_plating()) hide(1)
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/visible
|
|
level = 2
|
|
icon_state = "cap"
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/visible/scrubbers
|
|
name = "scrubbers pipe endcap"
|
|
desc = "An endcap for scrubbers pipes"
|
|
icon_state = "cap-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/visible/supply
|
|
name = "supply pipe endcap"
|
|
desc = "An endcap for supply pipes"
|
|
icon_state = "cap-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/hidden
|
|
level = 1
|
|
icon_state = "cap"
|
|
alpha = 128
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/hidden/scrubbers
|
|
name = "scrubbers pipe endcap"
|
|
desc = "An endcap for scrubbers pipes"
|
|
icon_state = "cap-f-scrubbers"
|
|
connect_types = CONNECT_TYPE_SCRUBBER
|
|
layer = 2.38
|
|
icon_connect_type = "-scrubbers"
|
|
color = PIPE_COLOR_RED
|
|
|
|
/obj/machinery/atmospherics/pipe/cap/hidden/supply
|
|
name = "supply pipe endcap"
|
|
desc = "An endcap for supply pipes"
|
|
icon_state = "cap-f-supply"
|
|
connect_types = CONNECT_TYPE_SUPPLY
|
|
layer = 2.39
|
|
icon_connect_type = "-supply"
|
|
color = PIPE_COLOR_BLUE
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/tank
|
|
icon = 'icons/atmos/tank.dmi'
|
|
icon_state = "air_map"
|
|
|
|
name = "Pressure Tank"
|
|
desc = "A large vessel containing pressurized gas."
|
|
|
|
volume = 10000 //in liters, 1 meters by 1 meters by 2 meters ~tweaked it a little to simulate a pressure tank without needing to recode them yet
|
|
var/start_pressure = 25*ONE_ATMOSPHERE
|
|
|
|
level = 1
|
|
dir = SOUTH
|
|
initialize_directions = SOUTH
|
|
density = 1
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/New()
|
|
icon_state = "air"
|
|
initialize_directions = dir
|
|
..()
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/process()
|
|
if(!parent)
|
|
..()
|
|
else
|
|
. = PROCESS_KILL
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/Destroy()
|
|
if(node1)
|
|
node1.disconnect(src)
|
|
|
|
node1 = null
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/pipeline_expansion()
|
|
return list(node1)
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/update_underlays()
|
|
if(..())
|
|
underlays.Cut()
|
|
var/turf/T = get_turf(src)
|
|
if(!istype(T))
|
|
return
|
|
add_underlay(T, node1, dir)
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/hide()
|
|
update_underlays()
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/initialize()
|
|
var/connect_direction = dir
|
|
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node1 = target
|
|
break
|
|
|
|
update_underlays()
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/disconnect(obj/machinery/atmospherics/reference)
|
|
if(reference == node1)
|
|
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node1 = null
|
|
|
|
update_underlays()
|
|
|
|
return null
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob)
|
|
if(istype(W, /obj/item/device/pipe_painter))
|
|
return
|
|
|
|
if(istype(W, /obj/item/device/analyzer) && in_range(user, src))
|
|
var/obj/item/device/analyzer/A = W
|
|
A.analyze_gases(src, user)
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/air
|
|
name = "Pressure Tank (Air)"
|
|
icon_state = "air_map"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/air/New()
|
|
air_temporary = new
|
|
air_temporary.volume = volume
|
|
air_temporary.temperature = T20C
|
|
|
|
air_temporary.adjust_multi("oxygen", (start_pressure*O2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature), \
|
|
"nitrogen",(start_pressure*N2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
|
|
|
|
|
..()
|
|
icon_state = "air"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/oxygen
|
|
name = "Pressure Tank (Oxygen)"
|
|
icon_state = "o2_map"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/oxygen/New()
|
|
air_temporary = new
|
|
air_temporary.volume = volume
|
|
air_temporary.temperature = T20C
|
|
|
|
air_temporary.adjust_gas("oxygen", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
|
|
|
..()
|
|
icon_state = "o2"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/nitrogen
|
|
name = "Pressure Tank (Nitrogen)"
|
|
icon_state = "n2_map"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/nitrogen/New()
|
|
air_temporary = new
|
|
air_temporary.volume = volume
|
|
air_temporary.temperature = T20C
|
|
|
|
air_temporary.adjust_gas("nitrogen", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
|
|
|
..()
|
|
icon_state = "n2"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/carbon_dioxide
|
|
name = "Pressure Tank (Carbon Dioxide)"
|
|
icon_state = "co2_map"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/carbon_dioxide/New()
|
|
air_temporary = new
|
|
air_temporary.volume = volume
|
|
air_temporary.temperature = T20C
|
|
|
|
air_temporary.adjust_gas("carbon_dioxide", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
|
|
|
..()
|
|
icon_state = "co2"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/phoron
|
|
name = "Pressure Tank (Phoron)"
|
|
icon_state = "phoron_map"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/phoron/New()
|
|
air_temporary = new
|
|
air_temporary.volume = volume
|
|
air_temporary.temperature = T20C
|
|
|
|
air_temporary.adjust_gas("phoron", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
|
|
|
..()
|
|
icon_state = "phoron"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/nitrous_oxide
|
|
name = "Pressure Tank (Nitrous Oxide)"
|
|
icon_state = "n2o_map"
|
|
|
|
/obj/machinery/atmospherics/pipe/tank/nitrous_oxide/New()
|
|
air_temporary = new
|
|
air_temporary.volume = volume
|
|
air_temporary.temperature = T0C
|
|
|
|
air_temporary.adjust_gas("sleeping_agent", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
|
|
|
..()
|
|
icon_state = "n2o"
|
|
|
|
/obj/machinery/atmospherics/pipe/vent
|
|
icon = 'icons/obj/atmospherics/pipe_vent.dmi'
|
|
icon_state = "intact"
|
|
|
|
name = "Vent"
|
|
desc = "A large air vent"
|
|
|
|
level = 1
|
|
|
|
volume = 250
|
|
|
|
dir = SOUTH
|
|
initialize_directions = SOUTH
|
|
|
|
var/build_killswitch = 1
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/New()
|
|
initialize_directions = dir
|
|
..()
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/high_volume
|
|
name = "Larger vent"
|
|
volume = 1000
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/process()
|
|
if(!parent)
|
|
if(build_killswitch <= 0)
|
|
. = PROCESS_KILL
|
|
else
|
|
build_killswitch--
|
|
..()
|
|
return
|
|
else
|
|
parent.mingle_with_turf(loc, volume)
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/Destroy()
|
|
if(node1)
|
|
node1.disconnect(src)
|
|
|
|
node1 = null
|
|
|
|
return ..()
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/pipeline_expansion()
|
|
return list(node1)
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/update_icon()
|
|
if(node1)
|
|
icon_state = "intact"
|
|
|
|
set_dir(get_dir(src, node1))
|
|
|
|
else
|
|
icon_state = "exposed"
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/initialize()
|
|
var/connect_direction = dir
|
|
|
|
for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction))
|
|
if(target.initialize_directions & get_dir(target,src))
|
|
if (check_connect_types(target,src))
|
|
node1 = target
|
|
break
|
|
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/disconnect(obj/machinery/atmospherics/reference)
|
|
if(reference == node1)
|
|
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
|
QDEL_NULL(parent)
|
|
node1 = null
|
|
|
|
update_icon()
|
|
|
|
return null
|
|
|
|
/obj/machinery/atmospherics/pipe/vent/hide(var/i) //to make the little pipe section invisible, the icon changes.
|
|
if(node1)
|
|
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
|
|
set_dir(get_dir(src, node1))
|
|
else
|
|
icon_state = "exposed"
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/universal
|
|
name="Universal pipe adapter"
|
|
desc = "An adapter for regular, supply and scrubbers pipes"
|
|
connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_SUPPLY|CONNECT_TYPE_SCRUBBER
|
|
icon_state = "map_universal"
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_icon(var/safety = 0)
|
|
if(!check_icon_cache())
|
|
return
|
|
|
|
alpha = 255
|
|
|
|
cut_overlays()
|
|
add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "universal"))
|
|
underlays.Cut()
|
|
|
|
if (node1)
|
|
universal_underlays(node1)
|
|
if(node2)
|
|
universal_underlays(node2)
|
|
else
|
|
var/node1_dir = get_dir(node1,src)
|
|
universal_underlays(,node1_dir)
|
|
else if (node2)
|
|
universal_underlays(node2)
|
|
else
|
|
universal_underlays(,dir)
|
|
universal_underlays(,turn(dir, -180))
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/visible/universal/update_underlays()
|
|
..()
|
|
update_icon()
|
|
|
|
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/universal
|
|
name="Universal pipe adapter"
|
|
desc = "An adapter for regular, supply and scrubbers pipes"
|
|
connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_SUPPLY|CONNECT_TYPE_SCRUBBER
|
|
icon_state = "map_universal"
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_icon(var/safety = 0)
|
|
if(!check_icon_cache())
|
|
return
|
|
|
|
alpha = 255
|
|
|
|
cut_overlays()
|
|
add_overlay(icon_manager.get_atmos_icon("pipe", , pipe_color, "universal"))
|
|
|
|
underlays.Cut()
|
|
|
|
if (node1)
|
|
universal_underlays(node1)
|
|
if(node2)
|
|
universal_underlays(node2)
|
|
else
|
|
var/node2_dir = turn(get_dir(src,node1),-180)
|
|
universal_underlays(,node2_dir)
|
|
else if (node2)
|
|
universal_underlays(node2)
|
|
var/node1_dir = turn(get_dir(src,node2),-180)
|
|
universal_underlays(,node1_dir)
|
|
else
|
|
universal_underlays(,dir)
|
|
universal_underlays(,turn(dir, -180))
|
|
|
|
/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_underlays()
|
|
..()
|
|
update_icon()
|
|
|
|
/obj/machinery/atmospherics/proc/universal_underlays(var/obj/machinery/atmospherics/node, var/direction)
|
|
var/turf/T = loc
|
|
if(node)
|
|
var/node_dir = get_dir(src,node)
|
|
if(node.icon_connect_type == "-supply")
|
|
add_underlay_adapter(T, , node_dir, "")
|
|
add_underlay_adapter(T, node, node_dir, "-supply")
|
|
add_underlay_adapter(T, , node_dir, "-scrubbers")
|
|
else if (node.icon_connect_type == "-scrubbers")
|
|
add_underlay_adapter(T, , node_dir, "")
|
|
add_underlay_adapter(T, , node_dir, "-supply")
|
|
add_underlay_adapter(T, node, node_dir, "-scrubbers")
|
|
else
|
|
add_underlay_adapter(T, node, node_dir, "")
|
|
add_underlay_adapter(T, , node_dir, "-supply")
|
|
add_underlay_adapter(T, , node_dir, "-scrubbers")
|
|
else
|
|
add_underlay_adapter(T, , direction, "-supply")
|
|
add_underlay_adapter(T, , direction, "-scrubbers")
|
|
add_underlay_adapter(T, , direction, "")
|
|
|
|
/obj/machinery/atmospherics/proc/add_underlay_adapter(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) //modified from add_underlay, does not make exposed underlays
|
|
if(node)
|
|
if(!T.is_plating() && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
|
|
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
|
|
else
|
|
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
|
|
else
|
|
underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type)
|