modules/atmospherics major cleanup (#61904)

major cleanup of modules/atmospherics folder and all related files, still many missing
-cleanup of procs name
-cleanup of vars name
-documentation of some of the procs
-minor changes to some for() logic (no in game changes just early continue or as anything checks)

No in game changes, only code and docs
This commit is contained in:
Ghilker
2021-10-14 10:13:57 +02:00
committed by GitHub
parent c4b60fda30
commit cb5fb1df2d
96 changed files with 3783 additions and 3726 deletions
+188 -189
View File
@@ -24221,30 +24221,6 @@
/mob/living/carbon/human/species/monkey,
/turf/open/floor/iron/dark,
/area/science/genetics)
"djC" = (
/obj/machinery/camera{
CanAtmosPass = "science camera";
c_tag = "Genetics Lab North";
name = "science camera";
network = list("ss13","rd")
},
/obj/structure/window/reinforced{
dir = 1
},
/obj/machinery/door/window/westleft{
dir = 2;
name = "'Monkey Pen";
req_access_txt = "9"
},
/obj/structure/window/reinforced{
dir = 4
},
/obj/effect/turf_decal/stripes/end{
dir = 4
},
/mob/living/carbon/human/species/monkey,
/turf/open/floor/iron/dark,
/area/science/genetics)
"djD" = (
/obj/machinery/dna_scannernew,
/obj/effect/turf_decal/tile/neutral{
@@ -28104,19 +28080,6 @@
/obj/effect/turf_decal/bot,
/turf/open/floor/iron,
/area/engineering/break_room)
"dDF" = (
/obj/structure/noticeboard/directional/east,
/obj/machinery/camera{
c_tag = "Science - Robotics Lab";
dir = 8;
name = "science camera";
network = list("ss13","rd")
},
/obj/effect/turf_decal/stripes/line{
dir = 4
},
/turf/open/floor/iron,
/area/science/robotics/lab)
"dDI" = (
/obj/structure/table,
/obj/item/storage/toolbox/mechanical,
@@ -28248,26 +28211,6 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/turf/open/floor/iron,
/area/security/checkpoint)
"dEa" = (
/obj/structure/cable,
/obj/effect/turf_decal/tile/neutral{
dir = 1
},
/obj/effect/turf_decal/tile/neutral,
/obj/effect/turf_decal/tile/neutral{
dir = 4
},
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/structure/disposalpipe/segment{
dir = 9
},
/mob/living/simple_animal/sloth/citrus,
/turf/open/floor/iron,
/area/cargo/qm)
"dEb" = (
/obj/machinery/door/poddoor/preopen{
id = "surgeryb";
@@ -38662,18 +38605,6 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/iron,
/area/maintenance/starboard/aft)
"fCC" = (
/obj/structure/bed/dogbed/runtime,
/obj/machinery/light/directional/west,
/obj/effect/turf_decal/tile/neutral,
/obj/effect/turf_decal/tile/neutral{
dir = 4
},
/obj/machinery/airalarm/directional/west,
/obj/structure/disposalpipe/segment,
/mob/living/simple_animal/pet/cat/runtime,
/turf/open/floor/iron,
/area/command/heads_quarters/cmo)
"fCE" = (
/obj/machinery/washing_machine,
/obj/structure/sign/warning/electricshock{
@@ -38685,20 +38616,18 @@
},
/turf/open/floor/iron,
/area/security/prison)
"fCQ" = (
/obj/structure/window/reinforced,
/obj/structure/window/reinforced{
"fCF" = (
/obj/structure/bed/dogbed/runtime,
/obj/machinery/light/directional/west,
/obj/effect/turf_decal/tile/neutral,
/obj/effect/turf_decal/tile/neutral{
dir = 4
},
/obj/structure/table/wood/fancy,
/obj/structure/sign/painting/library_secure{
pixel_y = 32
},
/obj/effect/spawner/random/decoration/statue{
spawn_loot_chance = 35
},
/turf/open/floor/carpet,
/area/service/library)
/obj/machinery/airalarm/directional/west,
/obj/structure/disposalpipe/segment,
/mob/living/simple_animal/pet/cat/runtime,
/turf/open/floor/iron,
/area/command/heads_quarters/cmo)
"fDa" = (
/obj/effect/spawner/structure/window/reinforced,
/obj/machinery/door/poddoor/preopen{
@@ -39418,6 +39347,26 @@
},
/turf/open/floor/iron,
/area/maintenance/starboard)
"fQi" = (
/obj/structure/cable,
/obj/effect/turf_decal/tile/neutral{
dir = 1
},
/obj/effect/turf_decal/tile/neutral,
/obj/effect/turf_decal/tile/neutral{
dir = 4
},
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/structure/disposalpipe/segment{
dir = 9
},
/mob/living/simple_animal/sloth/citrus,
/turf/open/floor/iron,
/area/cargo/qm)
"fQL" = (
/obj/structure/cable,
/obj/effect/turf_decal/tile/neutral{
@@ -46790,14 +46739,6 @@
/obj/effect/turf_decal/tile/purple,
/turf/open/floor/iron/white,
/area/command/heads_quarters/rd)
"hVW" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 4
},
/obj/structure/cable,
/obj/machinery/power/tesla_coil/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"hVZ" = (
/obj/effect/turf_decal/stripes/line{
dir = 8
@@ -49940,16 +49881,6 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/iron/grimy,
/area/service/library)
"iQX" = (
/obj/structure/cable,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/structure/disposalpipe/segment{
dir = 4
},
/mob/living/basic/cockroach,
/turf/open/floor/plating,
/area/maintenance/port/aft)
"iRw" = (
/obj/effect/decal/cleanable/dirt,
/obj/effect/landmark/blobstart,
@@ -52377,20 +52308,6 @@
/obj/machinery/newscaster/directional/west,
/turf/open/floor/iron,
/area/engineering/break_room)
"jGJ" = (
/obj/machinery/door/window{
name = "Secure Art Exhibition";
req_access_txt = "37"
},
/obj/structure/table/wood/fancy,
/obj/structure/sign/painting/library_secure{
pixel_y = 32
},
/obj/effect/spawner/random/decoration/statue{
spawn_loot_chance = 35
},
/turf/open/floor/carpet,
/area/service/library)
"jGK" = (
/obj/structure/table/wood,
/obj/item/clipboard,
@@ -64276,6 +64193,14 @@
/obj/effect/turf_decal/delivery,
/turf/open/floor/iron,
/area/service/kitchen)
"nbF" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 4
},
/obj/structure/cable,
/obj/machinery/power/grounding_rod/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"nbH" = (
/obj/effect/turf_decal/tile/neutral{
dir = 1
@@ -69562,6 +69487,14 @@
/obj/effect/turf_decal/tile/neutral,
/turf/open/floor/iron/dark,
/area/science/genetics)
"oyG" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 4
},
/obj/structure/cable,
/obj/machinery/power/tesla_coil/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"ozg" = (
/obj/machinery/atmospherics/components/unary/vent_pump/siphon/atmos/plasma_output{
dir = 4
@@ -73029,6 +72962,20 @@
/obj/machinery/atmospherics/pipe/smart/manifold/yellow/visible,
/turf/open/floor/plating,
/area/engineering/atmos)
"pEc" = (
/obj/structure/window/reinforced,
/obj/structure/window/reinforced{
dir = 4
},
/obj/structure/table/wood/fancy,
/obj/structure/sign/painting/library_secure{
pixel_y = 32
},
/obj/effect/spawner/random/decoration/statue{
spawn_loot_chance = 35
},
/turf/open/floor/carpet,
/area/service/library)
"pEj" = (
/obj/effect/turf_decal/tile/blue,
/turf/open/floor/iron,
@@ -73154,6 +73101,20 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/iron,
/area/ai_monitored/command/storage/eva)
"pFV" = (
/obj/machinery/door/window{
name = "Secure Art Exhibition";
req_access_txt = "37"
},
/obj/structure/table/wood/fancy,
/obj/structure/sign/painting/library_secure{
pixel_y = 32
},
/obj/effect/spawner/random/decoration/statue{
spawn_loot_chance = 35
},
/turf/open/floor/carpet,
/area/service/library)
"pFX" = (
/obj/machinery/light/directional/east,
/obj/effect/turf_decal/tile/neutral,
@@ -73178,22 +73139,6 @@
},
/turf/open/floor/iron/dark,
/area/engineering/gravity_generator)
"pGB" = (
/obj/structure/bed/dogbed/renault,
/obj/effect/turf_decal/tile/neutral{
dir = 1
},
/obj/effect/turf_decal/tile/neutral,
/obj/effect/turf_decal/tile/neutral{
dir = 4
},
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
/obj/machinery/newscaster/directional/south,
/mob/living/simple_animal/pet/fox/renault,
/turf/open/floor/iron/dark,
/area/command/heads_quarters/captain)
"pGD" = (
/obj/machinery/atmospherics/components/unary/vent_pump/on/layer4{
dir = 8
@@ -73461,14 +73406,6 @@
},
/turf/open/floor/iron,
/area/security/brig)
"pKk" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 1
},
/obj/structure/cable,
/obj/machinery/power/grounding_rod/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"pKR" = (
/obj/structure/cable,
/obj/effect/turf_decal/tile/purple{
@@ -77116,6 +77053,29 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/iron,
/area/commons/storage/tools)
"qJc" = (
/obj/machinery/camera{
c_tag = "Genetics Lab North";
name = "science camera";
network = list("ss13","rd")
},
/obj/structure/window/reinforced{
dir = 1
},
/obj/machinery/door/window/westleft{
dir = 2;
name = "'Monkey Pen";
req_access_txt = "9"
},
/obj/structure/window/reinforced{
dir = 4
},
/obj/effect/turf_decal/stripes/end{
dir = 4
},
/mob/living/carbon/human/species/monkey,
/turf/open/floor/iron/dark,
/area/science/genetics)
"qJk" = (
/obj/structure/chair/comfy/brown{
dir = 8
@@ -78748,20 +78708,6 @@
},
/turf/open/floor/iron,
/area/security/prison)
"rhJ" = (
/obj/structure/window/reinforced{
dir = 8
},
/obj/structure/window/reinforced,
/obj/structure/table/wood/fancy,
/obj/structure/sign/painting/library_secure{
pixel_y = 32
},
/obj/effect/spawner/random/decoration/statue{
spawn_loot_chance = 35
},
/turf/open/floor/carpet,
/area/service/library)
"rhZ" = (
/obj/item/kirbyplants/random,
/turf/open/floor/wood,
@@ -80456,6 +80402,12 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/plating,
/area/maintenance/port)
"rKZ" = (
/obj/structure/sign/picture_frame/portrait/bar{
pixel_x = -32
},
/turf/open/floor/iron/dark,
/area/service/bar)
"rLD" = (
/obj/machinery/camera{
c_tag = "Medbay - Surgery B";
@@ -81137,6 +81089,19 @@
/obj/item/radio/intercom/directional/east,
/turf/open/floor/iron,
/area/hallway/primary/central/fore)
"rVH" = (
/obj/structure/noticeboard/directional/east,
/obj/machinery/camera{
c_tag = "Science - Robotics Lab";
dir = 8;
name = "science camera";
network = list("ss13","rd")
},
/obj/effect/turf_decal/stripes/line{
dir = 4
},
/turf/open/floor/iron,
/area/science/robotics/lab)
"rVJ" = (
/obj/machinery/camera{
c_tag = "Security - Gear Room"
@@ -82395,14 +82360,6 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/iron,
/area/hallway/primary/central/aft)
"spy" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 4
},
/obj/structure/cable,
/obj/machinery/power/grounding_rod/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"spz" = (
/obj/structure/cable,
/obj/effect/turf_decal/tile/neutral{
@@ -84202,6 +84159,14 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/iron,
/area/maintenance/starboard)
"sNX" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 1
},
/obj/structure/cable,
/obj/machinery/power/tesla_coil/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"sOa" = (
/obj/structure/cable,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
@@ -85133,6 +85098,22 @@
/obj/effect/turf_decal/tile/purple,
/turf/open/floor/iron/white,
/area/command/heads_quarters/rd)
"tfw" = (
/obj/structure/bed/dogbed/renault,
/obj/effect/turf_decal/tile/neutral{
dir = 1
},
/obj/effect/turf_decal/tile/neutral,
/obj/effect/turf_decal/tile/neutral{
dir = 4
},
/obj/effect/turf_decal/tile/neutral{
dir = 8
},
/obj/machinery/newscaster/directional/south,
/mob/living/simple_animal/pet/fox/renault,
/turf/open/floor/iron/dark,
/area/command/heads_quarters/captain)
"tfD" = (
/turf/open/floor/iron{
heat_capacity = 1e+006
@@ -86474,6 +86455,14 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/turf/open/floor/iron,
/area/maintenance/starboard/fore)
"tBC" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 1
},
/obj/structure/cable,
/obj/machinery/power/grounding_rod/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"tBF" = (
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
@@ -86987,12 +86976,6 @@
},
/turf/open/floor/iron,
/area/cargo/miningoffice)
"tIm" = (
/obj/structure/sign/picture_frame/portrait/bar{
pixel_x = -32
},
/turf/open/floor/iron/dark,
/area/service/bar)
"tIE" = (
/obj/structure/reagent_dispensers/fueltank,
/obj/effect/decal/cleanable/dirt,
@@ -87265,14 +87248,6 @@
/obj/effect/turf_decal/delivery,
/turf/open/floor/iron,
/area/cargo/storage)
"tLP" = (
/obj/structure/window/reinforced/plasma/spawner/west{
dir = 1
},
/obj/structure/cable,
/obj/machinery/power/tesla_coil/anchored,
/turf/open/floor/engine,
/area/engineering/supermatter)
"tLT" = (
/obj/effect/spawner/structure/window/reinforced,
/obj/structure/sign/nanotrasen{
@@ -100248,6 +100223,20 @@
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/turf/open/floor/mech_bay_recharge_floor,
/area/science/research/abandoned)
"xCK" = (
/obj/structure/window/reinforced{
dir = 8
},
/obj/structure/window/reinforced,
/obj/structure/table/wood/fancy,
/obj/structure/sign/painting/library_secure{
pixel_y = 32
},
/obj/effect/spawner/random/decoration/statue{
spawn_loot_chance = 35
},
/turf/open/floor/carpet,
/area/service/library)
"xDc" = (
/obj/effect/turf_decal/stripes/line,
/obj/machinery/atmospherics/pipe/smart/simple/scrubbers/visible,
@@ -102442,6 +102431,16 @@
/obj/machinery/light_switch/directional/east,
/turf/open/floor/wood,
/area/commons/vacant_room/office)
"ylK" = (
/obj/structure/cable,
/obj/machinery/atmospherics/pipe/smart/manifold4w/supply/hidden/layer4,
/obj/machinery/atmospherics/pipe/smart/manifold4w/scrubbers/hidden/layer2,
/obj/structure/disposalpipe/segment{
dir = 4
},
/mob/living/basic/cockroach,
/turf/open/floor/plating,
/area/maintenance/port/aft)
"ylN" = (
/obj/effect/decal/cleanable/dirt,
/obj/structure/cable,
@@ -123197,9 +123196,9 @@ aTe
cnP
kuB
qzf
hVW
spy
hVW
oyG
nbF
oyG
qzf
qzf
qzf
@@ -123457,7 +123456,7 @@ qzf
rgQ
tii
wrL
tLP
sNX
lBd
lZd
hfD
@@ -123714,7 +123713,7 @@ hWu
rgQ
uqa
wrL
pKk
tBC
vyP
eZx
hfD
@@ -123971,7 +123970,7 @@ qzf
rgQ
tii
wrL
tLP
sNX
lYR
tKt
nYt
@@ -131449,7 +131448,7 @@ cNd
cON
eAA
cMY
djC
qJc
dlp
dmC
sUX
@@ -135266,7 +135265,7 @@ eXA
bWD
aaI
nJo
rhJ
xCK
mFG
mfh
lxk
@@ -135523,7 +135522,7 @@ eXA
cNT
bYO
nJo
jGJ
pFV
ttd
mFG
tqz
@@ -135780,7 +135779,7 @@ eXA
bWD
bYO
nJo
fCQ
pEc
ybZ
ybZ
lxk
@@ -137129,7 +137128,7 @@ dfm
dfm
dfm
dOM
iQX
ylK
dSF
dOM
wfC
@@ -139078,7 +139077,7 @@ iXT
alf
hFM
gMU
tIm
rKZ
guN
stu
pqt
@@ -140457,7 +140456,7 @@ dyd
dzK
dAO
dCv
dDF
rVH
dEN
dGd
dHA
@@ -142970,7 +142969,7 @@ glH
glH
jLq
qqj
pGB
tfw
glH
sfH
bXb
@@ -146879,7 +146878,7 @@ ivY
loW
nSm
txo
fCC
fCF
stU
pxA
qfr
@@ -148082,7 +148081,7 @@ suJ
viJ
pxq
kKx
dEa
fQi
lhS
qIO
oBs
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -182,7 +182,7 @@
//CANATMOSPASS
#define ATMOS_PASS_YES 1
#define ATMOS_PASS_NO 0
/// ask CanAtmosPass()
/// ask can_atmos_pass()
#define ATMOS_PASS_PROC -1
/// just check density
#define ATMOS_PASS_DENSITY -2
+2 -2
View File
@@ -1,8 +1,8 @@
//DO NOT USE THESE FOR ACCESSING ATMOS DATA, THEY MUTATE THINGS WHEN CALLED. I WILL BEAT YOU WITH A STICK. See the actual proc for more details
///Check if the turfs allows gas passage based on density, do not use.
#define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) )
#define CANATMOSPASS(A, O) ( A.can_atmos_pass == ATMOS_PASS_PROC ? A.can_atmos_pass(O) : ( A.can_atmos_pass == ATMOS_PASS_DENSITY ? !A.density : A.can_atmos_pass ) )
///Check if the turfs allows gas passage on a z level, do not use.
#define CANVERTICALATMOSPASS(A, O) ( A.CanAtmosPassVertical == ATMOS_PASS_PROC ? A.CanAtmosPass(O, TRUE) : ( A.CanAtmosPassVertical == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPassVertical ) )
#define CANVERTICALATMOSPASS(A, O) ( A.can_atmos_pass_vertical == ATMOS_PASS_PROC ? A.can_atmos_pass(O, TRUE) : ( A.can_atmos_pass_vertical == ATMOS_PASS_DENSITY ? !A.density : A.can_atmos_pass_vertical ) )
//Helpers
///Moves the icon of the device based on the piping layer and on the direction
+1 -1
View File
@@ -28,7 +28,7 @@ SUBSYSTEM_DEF(adjacent_air)
var/goal = queue[currT]
queue.Cut(1,2)
currT.ImmediateCalculateAdjacentTurfs()
currT.immediate_calculate_adjacent_turfs()
if(goal == MAKE_ACTIVE)
SSair.add_to_active(currT)
else if(goal == KILL_EXCITED)
+5 -5
View File
@@ -386,8 +386,8 @@ SUBSYSTEM_DEF(air)
continue
for(var/obj/machinery/atmospherics/considered_device in result)
if(!istype(considered_device, /obj/machinery/atmospherics/pipe))
considered_device.setPipenet(net, borderline)
net.addMachineryMember(considered_device)
considered_device.set_pipenet(net, borderline)
net.add_machinery_member(considered_device)
continue
var/obj/machinery/atmospherics/pipe/item = considered_device
if(net.members.Find(item))
@@ -555,7 +555,7 @@ SUBSYSTEM_DEF(air)
/datum/controller/subsystem/air/proc/setup_atmos_machinery()
for (var/obj/machinery/atmospherics/AM in atmos_machinery)
AM.atmosinit()
AM.atmos_init()
CHECK_TICK
//this can't be done with setup_atmos_machinery() because
@@ -583,7 +583,7 @@ GLOBAL_LIST_EMPTY(colored_images)
var/obj/machinery/atmospherics/AM
for(var/A in 1 to atmos_machines.len)
AM = atmos_machines[A]
AM.atmosinit()
AM.atmos_init()
CHECK_TICK
for(var/A in 1 to atmos_machines.len)
@@ -604,7 +604,7 @@ GLOBAL_LIST_EMPTY(colored_images)
if(!pipe_init_dirs_cache[type]["[init_dir]"]["[dir]"])
var/obj/machinery/atmospherics/temp = new type(null, FALSE, dir, init_dir)
pipe_init_dirs_cache[type]["[init_dir]"]["[dir]"] = temp.GetInitDirections()
pipe_init_dirs_cache[type]["[init_dir]"]["[dir]"] = temp.get_init_directions()
qdel(temp)
return pipe_init_dirs_cache[type]["[init_dir]"]["[dir]"]
+2 -2
View File
@@ -117,8 +117,8 @@
if(loc)
//Restore air flow if we were blocking it (movables with ATMOS_PASS_PROC will need to do this manually if necessary)
if(((CanAtmosPass == ATMOS_PASS_DENSITY && density) || CanAtmosPass == ATMOS_PASS_NO) && isturf(loc))
CanAtmosPass = ATMOS_PASS_YES
if(((can_atmos_pass == ATMOS_PASS_DENSITY && density) || can_atmos_pass == ATMOS_PASS_NO) && isturf(loc))
can_atmos_pass = ATMOS_PASS_YES
air_update_turf(TRUE, FALSE)
loc.handle_atom_del(src)
@@ -517,7 +517,7 @@
continue // No parent vent
// Stops Aliens getting stuck in small networks.
// See: Security, Virology
if(temp_vent_parent.other_atmosmch.len > 20)
if(temp_vent_parent.other_atmos_machines.len > 20)
vents += temp_vent
if(!vents.len)
return FALSE
+1 -1
View File
@@ -236,7 +236,7 @@
DA.update_name()
qdel(src)
/obj/machinery/door/airlock/plasma/BlockSuperconductivity() //we don't stop the heat~
/obj/machinery/door/airlock/plasma/block_superconductivity() //we don't stop the heat~
return 0
/obj/machinery/door/airlock/plasma/attackby(obj/item/C, mob/user, params)
+3 -3
View File
@@ -13,7 +13,7 @@
pass_flags_self = PASSDOORS
max_integrity = 350
armor = list(MELEE = 30, BULLET = 30, LASER = 20, ENERGY = 20, BOMB = 10, BIO = 100, RAD = 100, FIRE = 80, ACID = 70)
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
flags_1 = PREVENT_CLICK_UNDER_1
receive_ricochet_chance_mod = 0.8
damage_deflection = 10
@@ -265,7 +265,7 @@
try_to_weld_secondary(weapon, user)
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
if (weapon.tool_behaviour == TOOL_CROWBAR)
var/forced_open = FALSE
if(istype(weapon, /obj/item/crowbar))
@@ -433,7 +433,7 @@
if(!glass && GLOB.cameranet)
GLOB.cameranet.updateVisibility(src, 0)
/obj/machinery/door/BlockSuperconductivity() // All non-glass airlocks block heat, this is intended.
/obj/machinery/door/block_superconductivity() // All non-glass airlocks block heat, this is intended.
if(opacity || heat_proof)
return 1
return 0
+2 -2
View File
@@ -255,7 +255,7 @@
icon = 'icons/obj/doors/edge_Doorfire.dmi'
can_crush = FALSE
flags_1 = ON_BORDER_1
CanAtmosPass = ATMOS_PASS_PROC
can_atmos_pass = ATMOS_PASS_PROC
glass = FALSE
/obj/machinery/door/firedoor/border_only/closed
@@ -288,7 +288,7 @@
leaving.Bump(src)
return COMPONENT_ATOM_BLOCK_EXIT
/obj/machinery/door/firedoor/border_only/CanAtmosPass(turf/T)
/obj/machinery/door/firedoor/border_only/can_atmos_pass(turf/T)
if(get_dir(loc, T) == dir)
return !density
else
+2 -2
View File
@@ -14,7 +14,7 @@
flags_1 = ON_BORDER_1
opacity = FALSE
pass_flags_self = PASSGLASS
CanAtmosPass = ATMOS_PASS_PROC
can_atmos_pass = ATMOS_PASS_PROC
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN
network_id = NETWORK_DOOR_AIRLOCKS
set_dir_on_move = FALSE
@@ -128,7 +128,7 @@
return TRUE
/obj/machinery/door/window/CanAtmosPass(turf/T)
/obj/machinery/door/window/can_atmos_pass(turf/T)
if(get_dir(loc, T) == dir)
return !density
else
+12 -12
View File
@@ -77,10 +77,10 @@ Buildable meters
/obj/item/pipe/dropped()
if(loc)
setPipingLayer(piping_layer)
set_piping_layer(piping_layer)
return ..()
/obj/item/pipe/proc/setPipingLayer(new_layer = PIPING_LAYER_DEFAULT)
/obj/item/pipe/proc/set_piping_layer(new_layer = PIPING_LAYER_DEFAULT)
var/obj/machinery/atmospherics/fakeA = pipe_type
if(initial(fakeA.pipe_flags) & PIPING_ALL_LAYER)
@@ -173,7 +173,7 @@ Buildable meters
for(var/obj/machinery/atmospherics/machine as anything in potentially_conflicting_machines)
// if the pipes have any directions in common, we can't place it that way.
var/our_init_dirs = SSair.get_init_dirs(pipe_type, fixed_dir(), p_init_dir)
if(machine.GetInitDirections() & our_init_dirs)
if(machine.get_init_directions() & our_init_dirs)
// We have a conflict!
if (length(potentially_conflicting_machines) != 1 || !try_smart_reconfiguration(machine, our_init_dirs, user))
// No solutions found
@@ -216,7 +216,7 @@ Buildable meters
if (ISNOTSTUB(opposing_dir))
// We only get here if both smart pipes have two directions.
p_init_dir = opposing_dir
other_smart_pipe.SetInitDirections(other_smart_pipe.connections)
other_smart_pipe.set_init_directions(other_smart_pipe.connections)
other_smart_pipe.update_pipe_icon()
return TRUE
// We're left with one or no available directions if we look at the complement of the other smart pipe's live connections.
@@ -229,27 +229,27 @@ Buildable meters
if ((NORTH|SOUTH) & ~p_init_dir)
// Not allowed to connect this way
return FALSE
if (~other_smart_pipe.GetInitDirections() & (EAST|WEST))
if (~other_smart_pipe.get_init_directions() & (EAST|WEST))
// Not allowed to reconfigure the other pipe this way
return FALSE
p_init_dir = NORTH|SOUTH
other_smart_pipe.SetInitDirections(EAST|WEST)
other_smart_pipe.set_init_directions(EAST|WEST)
other_smart_pipe.update_pipe_icon()
return TRUE
if (NSCOMPONENT(other_smart_pipe.dir))
if ((EAST|WEST) & ~p_init_dir)
// Not allowed to connect this way
return FALSE
if (~other_smart_pipe.GetInitDirections() & (NORTH|SOUTH))
if (~other_smart_pipe.get_init_directions() & (NORTH|SOUTH))
// Not allowed to reconfigure the other pipe this way
return FALSE
p_init_dir = EAST|WEST
other_smart_pipe.SetInitDirections(NORTH|SOUTH)
other_smart_pipe.set_init_directions(NORTH|SOUTH)
other_smart_pipe.update_pipe_icon()
return TRUE
return FALSE
// We're not dealing with another smart pipe. See if we can become the complement of the conflicting machine.
var/opposing_dir = our_init_dirs & ~machine.GetInitDirections()
var/opposing_dir = our_init_dirs & ~machine.get_init_directions()
if (ISNOTSTUB(opposing_dir))
// We have at least two permitted directions in the complement. Use them.
p_init_dir = opposing_dir
@@ -261,10 +261,10 @@ Buildable meters
if (our_init_dirs & other_smart_pipe.connections)
// We needed to go where a smart pipe already had connections, nothing further we can do
return FALSE
var/opposing_dir = other_smart_pipe.GetInitDirections() & ~our_init_dirs
var/opposing_dir = other_smart_pipe.get_init_directions() & ~our_init_dirs
if (ISNOTSTUB(opposing_dir))
// At least two directions remain for that smart pipe, reconfigure it
other_smart_pipe.SetInitDirections(opposing_dir)
other_smart_pipe.set_init_directions(opposing_dir)
other_smart_pipe.update_pipe_icon()
return TRUE
return FALSE
@@ -273,7 +273,7 @@ Buildable meters
/obj/item/pipe/proc/build_pipe(obj/machinery/atmospherics/A)
A.setDir(fixed_dir())
A.SetInitDirections(p_init_dir)
A.set_init_directions(p_init_dir)
if(pipename)
A.name = pipename
+1 -1
View File
@@ -47,7 +47,7 @@
return
var/p_dir = text2num(href_list["dir"])
var/obj/item/pipe/P = new (loc, p_type, p_dir)
P.setPipingLayer(piping_layer)
P.set_piping_layer(piping_layer)
P.add_fingerprint(usr)
wait = world.time + 10
if(href_list["makemeter"])
+2 -2
View File
@@ -9,7 +9,7 @@
anchored = TRUE
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
max_integrity = 200 //The shield can only take so much beating (prevents perma-prisons)
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
/obj/structure/emergency_shield/Initialize(mapload)
. = ..()
@@ -72,7 +72,7 @@
/obj/structure/emergency_shield/cult/barrier
density = FALSE //toggled on right away by the parent rune
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
///The rune that created the shield itself. Used to delete the rune when the shield is destroyed.
var/obj/effect/rune/parent_rune
@@ -274,7 +274,7 @@
desc = "A lightweight foamed metal wall."
gender = PLURAL
max_integrity = 20
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
/obj/structure/foamedmetal/Initialize(mapload)
. = ..()
@@ -76,7 +76,7 @@
if(!t_loc)
return
var/list/newsmokes = list()
for(var/turf/T in t_loc.GetAtmosAdjacentTurfs())
for(var/turf/T in t_loc.get_atmos_adjacent_turfs())
var/obj/effect/particle_effect/smoke/foundsmoke = locate() in T //Don't spread smoke where there's already smoke!
if(foundsmoke)
continue
+2 -2
View File
@@ -5,7 +5,7 @@
anchored = TRUE
opacity = FALSE
density = TRUE
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
var/timeleft = 300 //Set to 0 for permanent forcefields (ugh)
/obj/effect/forcefield/Initialize(mapload)
@@ -21,7 +21,7 @@
name = "glowing wall"
icon = 'icons/effects/cult_effects.dmi'
icon_state = "cultshield"
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
timeleft = 200
/// A form of the cult forcefield that lasts permanently.
+2 -2
View File
@@ -131,12 +131,12 @@
if(istype(atmos_source))
if(istype(atmos_destination))
LAZYREMOVE(atmos_source.atmos_adjacent_turfs, atmos_destination)
atmos_source.ImmediateCalculateAdjacentTurfs() //Just in case they were next to each other
atmos_source.immediate_calculate_adjacent_turfs() //Just in case they were next to each other
atmos_source = null
if(istype(atmos_destination))
if(istype(atmos_source))
LAZYREMOVE(atmos_destination.atmos_adjacent_turfs, atmos_source)
atmos_destination.ImmediateCalculateAdjacentTurfs()
atmos_destination.immediate_calculate_adjacent_turfs()
atmos_destination = null
/obj/effect/portal/Destroy()
+2 -2
View File
@@ -77,7 +77,7 @@
desc = "A solid thick wall of web, airtight enough to block air flow."
icon_state = "sealedweb"
sealed = TRUE
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
/obj/structure/spider/stickyweb/genetic //for the spider genes in genetics
genetic = TRUE
@@ -354,7 +354,7 @@
if(get_dist(src, entry_vent) <= 1)
var/list/vents = list()
var/datum/pipeline/entry_vent_parent = entry_vent.parents[1]
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in entry_vent_parent.other_atmosmch)
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in entry_vent_parent.other_atmos_machines)
vents.Add(temp_vent)
if(!vents.len)
entry_vent = null
+7 -7
View File
@@ -469,7 +469,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if (S.dir == ALL_CARDINALS)
to_chat(user, span_warning("\The [S] has no unconnected directions!"))
return
var/old_init_dir = S.GetInitDirections()
var/old_init_dir = S.get_init_directions()
if (old_init_dir == p_init_dir)
to_chat(user, span_warning("\The [S] is already in this configuration!"))
return
@@ -492,7 +492,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
to_chat(user, span_warning("\The [src]'s screen flashes a warning: Can't configure a pipe in a currently connected direction."))
return
// Grab the current initializable directions, which may differ from old_init_dir if someone else was working on the same pipe at the same time
var/current_init_dir = S.GetInitDirections()
var/current_init_dir = S.get_init_directions()
// Access p_init_dir directly. The RPD can change target layer and initializable directions (though not pipe type or dir) while working to dispense and connect a component,
// and have it reflected in the final result. Reprogramming should be similarly consistent.
var/new_init_dir = (current_init_dir & ~target_differences) | (p_init_dir & target_differences)
@@ -500,7 +500,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
if (ISSTUB(new_init_dir))
to_chat(user, span_warning("\The [src]'s screen flashes a warning: Can't configure a pipe to only connect in one direction."))
return
S.SetInitDirections(new_init_dir)
S.set_init_directions(new_init_dir)
// We're now reconfigured.
// We can never disconnect from existing connections, but we can connect to previously unconnected directions, and should immediately do so
var/newly_permitted_connections = new_init_dir & ~current_init_dir
@@ -516,11 +516,11 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
node.disconnect(S)
S.nodes[i] = null
// Get our new connections
S.atmosinit()
S.atmos_init()
// Connect to our new connections
for (var/obj/machinery/atmospherics/O in S.nodes)
O.atmosinit()
O.addMember(src)
O.atmos_init()
O.add_member(src)
SSair.add_to_rebuild_queue(S)
// Finally, update our internal state - update_pipe_icon also updates dir and connections
S.update_pipe_icon()
@@ -573,7 +573,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
pipe_type.update()
pipe_type.add_fingerprint(usr)
pipe_type.setPipingLayer(piping_layer)
pipe_type.set_piping_layer(piping_layer)
if(ispath(queued_p_type, /obj/machinery/atmospherics) && !ispath(queued_p_type, /obj/machinery/atmospherics/pipe/color_adapter))
pipe_type.add_atom_colour(GLOB.pipe_paint_colors[paint_color], FIXED_COLOUR_PRIORITY)
if(mode & WRENCH_MODE)
@@ -56,7 +56,7 @@
force_proj_busy = FALSE
return
force_proj_busy = FALSE
playsound(src,'sound/weapons/resonator_fire.ogg',50,TRUE)
user.visible_message(span_warning("[user] projects a forcefield!"),span_notice("You project a forcefield."))
var/obj/structure/projected_forcefield/F = new(T, src)
@@ -102,7 +102,7 @@
density = TRUE
mouse_opacity = MOUSE_OPACITY_OPAQUE
resistance_flags = INDESTRUCTIBLE
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
armor = list(MELEE = 0, BULLET = 25, LASER = 50, ENERGY = 50, BOMB = 25, BIO = 100, RAD = 100, FIRE = 100, ACID = 100)
var/obj/item/forcefield_projector/generator
+1 -1
View File
@@ -197,7 +197,7 @@
for(var/turf/T in turflist)
if(T == previousturf)
continue //so we don't burn the tile we be standin on
var/list/turfs_sharing_with_prev = previousturf.GetAtmosAdjacentTurfs(alldir=1)
var/list/turfs_sharing_with_prev = previousturf.get_atmos_adjacent_turfs(alldir=1)
if(!(T in turfs_sharing_with_prev))
break
if(igniter)
+3 -3
View File
@@ -63,7 +63,7 @@
canSmoothWith = list(SMOOTH_GROUP_ALIEN_RESIN)
max_integrity = 200
var/resintype = null
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
/obj/structure/alien/resin/Initialize(mapload)
@@ -89,7 +89,7 @@
smoothing_groups = list(SMOOTH_GROUP_ALIEN_RESIN, SMOOTH_GROUP_ALIEN_WALLS)
canSmoothWith = list(SMOOTH_GROUP_ALIEN_WALLS)
/obj/structure/alien/resin/wall/BlockSuperconductivity()
/obj/structure/alien/resin/wall/block_superconductivity()
return 1
/// meant for one lavaland ruin or anywhere that has simplemobs who can push aside structures
@@ -190,7 +190,7 @@
qdel(src)
return FALSE
for(var/turf/T in U.GetAtmosAdjacentTurfs())
for(var/turf/T in U.get_atmos_adjacent_turfs())
if(locate(/obj/structure/alien/weeds) in T)
continue
+1 -1
View File
@@ -16,7 +16,7 @@
smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS)
canSmoothWith = list(SMOOTH_GROUP_WALLS)
can_be_unanchored = FALSE
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
flags_1 = RAD_PROTECT_CONTENTS_1 | RAD_NO_CONTAMINATE_1
rad_insulation = RAD_MEDIUM_INSULATION
var/mineral = /obj/item/stack/sheet/iron
+2 -2
View File
@@ -95,7 +95,7 @@
icon_state = "holo_firelock"
density = FALSE
anchored = TRUE
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
alpha = 150
flags_1 = RAD_PROTECT_CONTENTS_1 | RAD_NO_CONTAMINATE_1
rad_insulation = RAD_LIGHT_INSULATION
@@ -110,7 +110,7 @@
ADD_TRAIT(local, TRAIT_FIREDOOR_STOP, TRAIT_GENERIC)
air_update_turf(TRUE, TRUE)
/obj/structure/holosign/barrier/atmos/BlockSuperconductivity() //Didn't used to do this, but it's "normal", and will help ease heat flow transitions with the players.
/obj/structure/holosign/barrier/atmos/block_superconductivity() //Didn't used to do this, but it's "normal", and will help ease heat flow transitions with the players.
return TRUE
/obj/structure/holosign/barrier/atmos/Destroy()
@@ -12,7 +12,7 @@
icon_state = "metal"
max_integrity = 200
armor = list(MELEE = 10, BULLET = 0, LASER = 0, ENERGY = 100, BOMB = 10, BIO = 100, RAD = 100, FIRE = 50, ACID = 50)
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
flags_1 = RAD_PROTECT_CONTENTS_1 | RAD_NO_CONTAMINATE_1
rad_insulation = RAD_MEDIUM_INSULATION
+2 -2
View File
@@ -7,7 +7,7 @@
armor = list(MELEE = 100, BULLET = 80, LASER = 80, ENERGY = 100, BOMB = 50, BIO = 100, RAD = 100, FIRE = 50, ACID = 50)
density = FALSE
anchored = TRUE
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
/obj/structure/plasticflaps/opaque
opacity = TRUE
@@ -41,7 +41,7 @@
///Update the flaps behaviour to gases, if not anchored will let air pass through
/obj/structure/plasticflaps/proc/update_atmos_behaviour()
CanAtmosPass = anchored ? ATMOS_PASS_YES : ATMOS_PASS_NO
can_atmos_pass = anchored ? ATMOS_PASS_YES : ATMOS_PASS_NO
/obj/structure/plasticflaps/wirecutter_act(mob/living/user, obj/item/W)
. = ..()
@@ -27,7 +27,7 @@
var/facing = "l" //Does the windoor open to the left or right?
var/secure = FALSE //Whether or not this creates a secure windoor
var/state = "01" //How far the door assembly has progressed
CanAtmosPass = ATMOS_PASS_PROC
can_atmos_pass = ATMOS_PASS_PROC
/obj/structure/windoor_assembly/Initialize(mapload, loc, set_dir)
. = ..()
@@ -68,7 +68,7 @@
if(istype(mover, /obj/structure/windoor_assembly) || istype(mover, /obj/machinery/door/window))
return valid_window_location(loc, mover.dir, is_fulltile = FALSE)
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
/obj/structure/windoor_assembly/can_atmos_pass(turf/T)
if(get_dir(loc, T) == dir)
return !density
else
+4 -4
View File
@@ -11,7 +11,7 @@
can_be_unanchored = TRUE
resistance_flags = ACID_PROOF
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 100)
CanAtmosPass = ATMOS_PASS_PROC
can_atmos_pass = ATMOS_PASS_PROC
rad_insulation = RAD_VERY_LIGHT_INSULATION
pass_flags_self = PASSGLASS
set_dir_on_move = FALSE
@@ -327,7 +327,7 @@
if(anchored)
move_update_air(T)
/obj/structure/window/CanAtmosPass(turf/T)
/obj/structure/window/can_atmos_pass(turf/T)
if(!anchored || !density)
return TRUE
return !(fulltile || dir == get_dir(loc, T))
@@ -548,7 +548,7 @@
explosion_block = 2
glass_type = /obj/item/stack/sheet/plasmarglass
/obj/structure/window/reinforced/plasma/BlockSuperconductivity()
/obj/structure/window/reinforced/plasma/block_superconductivity()
return TRUE
/obj/structure/window/reinforced/plasma/spawner/east
@@ -730,7 +730,7 @@
glass_type = /obj/item/stack/sheet/paperframes
heat_resistance = 233
decon_speed = 10
CanAtmosPass = ATMOS_PASS_YES
can_atmos_pass = ATMOS_PASS_YES
resistance_flags = FLAMMABLE
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 0, ACID = 0)
knocksound = "pageturn"
+1 -1
View File
@@ -10,7 +10,7 @@
smoothing_groups = list(SMOOTH_GROUP_SHUTTLE_PARTS)
max_integrity = 500
armor = list(MELEE = 100, BULLET = 10, LASER = 10, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 70) //default + ignores melee
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
/obj/structure/shuttle/engine
name = "engine"
+1 -1
View File
@@ -297,7 +297,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
/turf/proc/AfterChange(flags, oldType) //called after a turf has been replaced in ChangeTurf()
levelupdate()
if(flags & CHANGETURF_RECALC_ADJACENT)
ImmediateCalculateAdjacentTurfs()
immediate_calculate_adjacent_turfs()
if(ispath(oldType, /turf/closed) && istype(src, /turf/open))
SSair.add_to_active(src)
else //In effect, I want closed turfs to make their tile active when sheered, but we need to queue it since they have no adjacent turfs
+2 -2
View File
@@ -141,7 +141,7 @@
/turf/open/indestructible/binary
name = "tear in the fabric of reality"
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
baseturfs = /turf/open/indestructible/binary
icon_state = "binary"
footstep = null
@@ -159,7 +159,7 @@
update_visuals()
current_cycle = times_fired
ImmediateCalculateAdjacentTurfs()
immediate_calculate_adjacent_turfs()
for(var/i in atmos_adjacent_turfs)
var/turf/open/enemy_tile = i
var/datum/gas_mixture/enemy_air = enemy_tile.return_air()
+1 -1
View File
@@ -16,7 +16,7 @@ GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdr
desc = "Watch your step!"
icon_state = "invisible"
baseturfs = /turf/open/openspace
CanAtmosPassVertical = ATMOS_PASS_YES
can_atmos_pass_vertical = ATMOS_PASS_YES
baseturfs = /turf/open/openspace
intact = FALSE //this means wires go on top
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
@@ -9,7 +9,7 @@
anchored = TRUE
layer = BELOW_MOB_LAYER
pass_flags_self = PASSBLOB
CanAtmosPass = ATMOS_PASS_PROC
can_atmos_pass = ATMOS_PASS_PROC
obj_flags = CAN_BE_HIT|BLOCK_Z_OUT_DOWN // stops blob mobs from falling on multiz.
/// How many points the blob gets back when it removes a blob of that type. If less than 0, blob cannot be removed.
var/point_return = 0
@@ -81,10 +81,10 @@
result++
. -= result - 1
/obj/structure/blob/BlockSuperconductivity()
/obj/structure/blob/block_superconductivity()
return atmosblock
/obj/structure/blob/CanAtmosPass(turf/T)
/obj/structure/blob/can_atmos_pass(turf/T)
return !atmosblock
/obj/structure/blob/update_icon() //Updates color based on overmind color if we have an overmind.
+1 -1
View File
@@ -6,7 +6,7 @@
density = TRUE
anchored = FALSE
max_integrity = 100
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
material_modifier = 0.5
material_flags = MATERIAL_EFFECTS | MATERIAL_AFFECT_STATISTICS
blocks_emissive = EMISSIVE_BLOCK_UNIQUE
+1 -1
View File
@@ -239,7 +239,7 @@ So then, what does superconduction do, and what do all these damn vars mean.
As I mentioned above, superconduction shares heat where heat can't normally travel. It does this by heating up the turf the heat is in, not the gasmix, the turf itself. This temperature is then shared with adjacent turfs, based on `thermal_conductivity`, a value between 0 and 1 that slows the heat share. Turfs also have a `heat_capacity`, which is how hard it is to heat, along with providing a threshold for the lowest temperature that can melt the turf.
There's one more, and it's a doozy. `atmos_superconductivity` is a set of directions that we cannot share with. I know. It's set in CanAtmosPass(), a rather heady set of procs that build `atmos_adjacent_turfs`, and also modify `atmos_superconductivity`.
There's one more, and it's a doozy. `atmos_superconductivity` is a set of directions that we cannot share with. I know. It's set in can_atmos_pass(), a rather heady set of procs that build `atmos_adjacent_turfs`, and also modify `atmos_superconductivity`.
So then, a review.
@@ -1,74 +1,81 @@
/atom/var/CanAtmosPass = ATMOS_PASS_YES
/atom/var/CanAtmosPassVertical = ATMOS_PASS_YES
/atom
///Check if atmos can pass in this atom (ATMOS_PASS_YES, ATMOS_PASS_NO, ATMOS_PASS_DENSITY, ATMOS_PASS_PROC)
var/can_atmos_pass = ATMOS_PASS_YES
///Zlevel check for can_atmos_pass
var/can_atmos_pass_vertical = ATMOS_PASS_YES
/atom/proc/CanAtmosPass(turf/T)
switch (CanAtmosPass)
/atom/proc/can_atmos_pass(turf/target_turf)
switch (can_atmos_pass)
if (ATMOS_PASS_PROC)
return ATMOS_PASS_YES
if (ATMOS_PASS_DENSITY)
return !density
else
return CanAtmosPass
return can_atmos_pass
/turf/CanAtmosPass = ATMOS_PASS_NO
/turf/CanAtmosPassVertical = ATMOS_PASS_NO
/turf
can_atmos_pass = ATMOS_PASS_NO
can_atmos_pass_vertical = ATMOS_PASS_NO
/turf/open/CanAtmosPass = ATMOS_PASS_PROC
/turf/open/CanAtmosPassVertical = ATMOS_PASS_PROC
/turf/open
can_atmos_pass = ATMOS_PASS_PROC
can_atmos_pass_vertical = ATMOS_PASS_PROC
//Do NOT use this to see if 2 turfs are connected, it mutates state, and we cache that info anyhow. Use TURFS_CAN_SHARE or TURF_SHARES depending on your usecase
/turf/open/CanAtmosPass(turf/T, vertical = FALSE)
var/dir = vertical? get_dir_multiz(src, T) : get_dir(src, T)
var/opp = REVERSE_DIR(dir)
var/R = FALSE
if(vertical && !(zAirOut(dir, T) && T.zAirIn(dir, src)))
R = TRUE
if(blocks_air || T.blocks_air)
R = TRUE
if (T == src)
return !R
for(var/obj/O in contents+T.contents)
var/turf/other = (O.loc == src ? T : src)
if(!(vertical? (CANVERTICALATMOSPASS(O, other)) : (CANATMOSPASS(O, other))))
R = TRUE
if(O.BlockSuperconductivity()) //the direction and open/closed are already checked on CanAtmosPass() so there are no arguments
atmos_supeconductivity |= dir
T.atmos_supeconductivity |= opp
/turf/open/can_atmos_pass(turf/target_turf, vertical = FALSE)
var/direction = vertical ? get_dir_multiz(src, target_turf) : get_dir(src, target_turf)
var/opposite_direction = REVERSE_DIR(direction)
var/can_pass = FALSE
if(vertical && !(zAirOut(direction, target_turf) && target_turf.zAirIn(direction, src)))
can_pass = TRUE
if(blocks_air || target_turf.blocks_air)
can_pass = TRUE
if (target_turf == src)
return !can_pass
for(var/obj/checked_object in contents + target_turf.contents)
var/turf/other = (checked_object.loc == src ? target_turf : src)
if(!(vertical? (CANVERTICALATMOSPASS(checked_object, other)) : (CANATMOSPASS(checked_object, other))))
can_pass = TRUE
if(checked_object.block_superconductivity()) //the direction and open/closed are already checked on can_atmos_pass() so there are no arguments
atmos_supeconductivity |= direction
target_turf.atmos_supeconductivity |= opposite_direction
return FALSE //no need to keep going, we got all we asked
atmos_supeconductivity &= ~dir
T.atmos_supeconductivity &= ~opp
atmos_supeconductivity &= ~direction
target_turf.atmos_supeconductivity &= ~opposite_direction
return !R
return !can_pass
/atom/movable/proc/BlockSuperconductivity() // objects that block air and don't let superconductivity act
/atom/movable/proc/block_superconductivity() // objects that block air and don't let superconductivity act
return FALSE
/turf/proc/ImmediateCalculateAdjacentTurfs()
/turf/proc/immediate_calculate_adjacent_turfs()
var/canpass = CANATMOSPASS(src, src)
var/canvpass = CANVERTICALATMOSPASS(src, src)
for(var/direction in GLOB.cardinals_multiz)
var/turf/T = get_step_multiz(src, direction)
if(!isopenturf(T))
var/turf/current_turf = get_step_multiz(src, direction)
if(!isopenturf(current_turf))
continue
if(!(blocks_air || T.blocks_air) && ((direction & (UP|DOWN))? (canvpass && CANVERTICALATMOSPASS(T, src)) : (canpass && CANATMOSPASS(T, src))) )
if(!(blocks_air || current_turf.blocks_air) && ((direction & (UP|DOWN)) ? (canvpass && CANVERTICALATMOSPASS(current_turf, src)) : (canpass && CANATMOSPASS(current_turf, src))) )
LAZYINITLIST(atmos_adjacent_turfs)
LAZYINITLIST(T.atmos_adjacent_turfs)
atmos_adjacent_turfs[T] = TRUE
T.atmos_adjacent_turfs[src] = TRUE
LAZYINITLIST(current_turf.atmos_adjacent_turfs)
atmos_adjacent_turfs[current_turf] = TRUE
current_turf.atmos_adjacent_turfs[src] = TRUE
else
if (atmos_adjacent_turfs)
atmos_adjacent_turfs -= T
if (T.atmos_adjacent_turfs)
T.atmos_adjacent_turfs -= src
UNSETEMPTY(T.atmos_adjacent_turfs)
atmos_adjacent_turfs -= current_turf
if (current_turf.atmos_adjacent_turfs)
current_turf.atmos_adjacent_turfs -= src
UNSETEMPTY(current_turf.atmos_adjacent_turfs)
UNSETEMPTY(atmos_adjacent_turfs)
src.atmos_adjacent_turfs = atmos_adjacent_turfs
//returns a list of adjacent turfs that can share air with this one.
//alldir includes adjacent diagonal tiles that can share
// air with both of the related adjacent cardinal tiles
/turf/proc/GetAtmosAdjacentTurfs(alldir = 0)
/**
* returns a list of adjacent turfs that can share air with this one.
* alldir includes adjacent diagonal tiles that can share
* air with both of the related adjacent cardinal tiles
**/
/turf/proc/get_atmos_adjacent_turfs(alldir = 0)
var/adjacent_turfs
if (atmos_adjacent_turfs)
adjacent_turfs = atmos_adjacent_turfs.Copy()
@@ -78,33 +85,33 @@
if (!alldir)
return adjacent_turfs
var/turf/curloc = src
var/turf/current_location = src
for (var/direction in GLOB.diagonals_multiz)
var/matchingDirections = 0
var/turf/S = get_step_multiz(curloc, direction)
if(!S)
var/matching_directions = 0
var/turf/checked_turf = get_step_multiz(current_location, direction)
if(!checked_turf)
continue
for (var/checkDirection in GLOB.cardinals_multiz)
var/turf/checkTurf = get_step(S, checkDirection)
if(!S.atmos_adjacent_turfs || !S.atmos_adjacent_turfs[checkTurf])
for (var/check_direction in GLOB.cardinals_multiz)
var/turf/secondary_turf = get_step(checked_turf, check_direction)
if(!checked_turf.atmos_adjacent_turfs || !checked_turf.atmos_adjacent_turfs[secondary_turf])
continue
if (adjacent_turfs[checkTurf])
matchingDirections++
if (adjacent_turfs[secondary_turf])
matching_directions++
if (matchingDirections >= 2)
adjacent_turfs += S
if (matching_directions >= 2)
adjacent_turfs += checked_turf
break
return adjacent_turfs
/atom/proc/air_update_turf(update = FALSE, remove = FALSE)
var/turf/T = get_turf(loc)
if(!T)
var/turf/local_turf = get_turf(loc)
if(!local_turf)
return
T.air_update_turf(update, remove)
local_turf.air_update_turf(update, remove)
/**
* A helper proc for dealing with atmos changes
@@ -117,30 +124,30 @@
*/
/turf/air_update_turf(update = FALSE, remove = FALSE)
if(update)
ImmediateCalculateAdjacentTurfs()
immediate_calculate_adjacent_turfs()
if(remove)
SSair.remove_from_active(src)
else
SSair.add_to_active(src)
/atom/movable/proc/move_update_air(turf/T)
if(isturf(T))
T.air_update_turf(TRUE, FALSE) //You're empty now
/atom/movable/proc/move_update_air(turf/target_turf)
if(isturf(target_turf))
target_turf.air_update_turf(TRUE, FALSE) //You're empty now
air_update_turf(TRUE, TRUE) //You aren't
/atom/proc/atmos_spawn_air(text) //because a lot of people loves to copy paste awful code lets just make an easy proc to spawn your plasma fires
var/turf/open/T = get_turf(src)
if(!istype(T))
var/turf/open/local_turf = get_turf(src)
if(!istype(local_turf))
return
T.atmos_spawn_air(text)
local_turf.atmos_spawn_air(text)
/turf/open/atmos_spawn_air(text)
if(!text || !air)
return
var/datum/gas_mixture/G = new
G.parse_gas_string(text)
var/datum/gas_mixture/turf_mixture = new
turf_mixture.parse_gas_string(text)
air.merge(G)
air.merge(turf_mixture)
archive()
SSair.add_to_active(src)
@@ -1,7 +1,9 @@
/turf
//used for temperature calculations
///used for temperature calculations in superconduction
var/thermal_conductivity = 0.05
///Amount of heat necessary to activate some atmos processes (there is a weird usage of this var because is compared directly to the temperature instead of heat energy)
var/heat_capacity = INFINITY //This should be opt in rather then opt out
///Archived version of the temperature on a turf
var/temperature_archived
///list of turfs adjacent to us that air can flow onto
@@ -9,29 +11,39 @@
///bitfield of dirs in which we are superconducitng
var/atmos_supeconductivity = NONE
//used to determine whether we should archive
///used to determine whether we should archive
var/archived_cycle = 0
var/current_cycle = 0
//used for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...)
//string parsed by /datum/gas/proc/copy_from_turf
/**
* used for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...)
* string parsed by /datum/gas/proc/copy_from_turf
* approximation of MOLES_O2STANDARD and MOLES_N2STANDARD pending byond allowing constant expressions to be embedded in constant strings
* If someone will place 0 of some gas there, SHIT WILL BREAK. Do not do that.
**/
var/initial_gas_mix = OPENTURF_DEFAULT_ATMOS
//approximation of MOLES_O2STANDARD and MOLES_N2STANDARD pending byond allowing constant expressions to be embedded in constant strings
// If someone will place 0 of some gas there, SHIT WILL BREAK. Do not do that.
/turf/open
//used for spacewind
///Pressure difference between two turfs
var/pressure_difference = 0
///Where the difference come from (from higher pressure to lower pressure)
var/pressure_direction = 0
///Excited group we are part of
var/datum/excited_group/excited_group
///Are we active?
var/excited = FALSE
///Our gas mix
var/datum/gas_mixture/turf/air
///If there is an active hotspot on us store a reference to it here
var/obj/effect/hotspot/active_hotspot
///Whether or not we are a planetary turf
var/planetary_atmos = FALSE //air will revert to initial_gas_mix
var/list/atmos_overlay_types //gas IDs of current active gas overlays
///gas IDs of current active gas overlays
var/list/atmos_overlay_types
var/significant_share_ticker = 0
#ifdef TRACK_MAX_SHARE
var/max_share = 0
@@ -52,8 +64,8 @@
if(active_hotspot)
QDEL_NULL(active_hotspot)
// Adds the adjacent turfs to the current atmos processing
for(var/T in atmos_adjacent_turfs)
SSair.add_to_active(T)
for(var/near_turf in atmos_adjacent_turfs)
SSair.add_to_active(near_turf)
return ..()
/////////////////GAS MIXTURE PROCS///////////////////
@@ -73,9 +85,9 @@
air_update_turf(FALSE, FALSE)
return removed
/turf/open/proc/copy_air_with_tile(turf/open/T)
if(istype(T))
air.copy_from(T.air)
/turf/open/proc/copy_air_with_tile(turf/open/target_turf)
if(istype(target_turf))
air.copy_from(target_turf.air)
/turf/open/proc/copy_air(datum/gas_mixture/copy)
if(copy)
@@ -83,9 +95,9 @@
/turf/return_air()
RETURN_TYPE(/datum/gas_mixture)
var/datum/gas_mixture/GM = new
GM.copy_from_turf(src)
return GM
var/datum/gas_mixture/copied_mixture = new
copied_mixture.copy_from_turf(src)
return copied_mixture
/turf/open/return_air()
RETURN_TYPE(/datum/gas_mixture)
@@ -274,11 +286,11 @@
should_share_air = TRUE
else if(our_air.compare(enemy_air)) //Lets see if you're up for it
SSair.add_to_active(enemy_tile) //Add yourself young man
var/datum/excited_group/EG = our_excited_group || enemy_excited_group || new
var/datum/excited_group/existing_group = our_excited_group || enemy_excited_group || new
if(!our_excited_group)
EG.add_turf(src)
existing_group.add_turf(src)
if(!enemy_excited_group)
EG.add_turf(enemy_tile)
existing_group.add_turf(enemy_tile)
our_excited_group = excited_group
should_share_air = TRUE
@@ -297,19 +309,19 @@
/******************* GROUP HANDLING FINISH *********************************************************************/
if (planetary_atmos) //share our air with the "atmosphere" "above" the turf
var/datum/gas_mixture/G = SSair.planetary[initial_gas_mix]
var/datum/gas_mixture/planetary_mix = SSair.planetary[initial_gas_mix]
// archive ourself again so we don't accidentally share more gas than we currently have
archive()
if(our_air.compare(G))
if(our_air.compare(planetary_mix))
if(!our_excited_group)
var/datum/excited_group/EG = new
EG.add_turf(src)
var/datum/excited_group/new_group = new
new_group.add_turf(src)
our_excited_group = excited_group
// shares 4/5 of our difference in moles with the atmosphere
our_air.share(G, 0.25)
our_air.share(planetary_mix, 0.25)
// temperature share with the atmosphere with an inflated heat capacity to simulate faster sharing with a large atmosphere
our_air.temperature_share(G, OPEN_HEAT_TRANSFER_COEFFICIENT, G.temperature_archived, G.heat_capacity() * 5)
G.garbage_collect()
our_air.temperature_share(planetary_mix, OPEN_HEAT_TRANSFER_COEFFICIENT, planetary_mix.temperature_archived, planetary_mix.heat_capacity() * 5)
planetary_mix.garbage_collect()
PLANET_SHARE_CHECK
our_air.react(src)
@@ -326,30 +338,32 @@
//////////////////////////SPACEWIND/////////////////////////////
/turf/open/proc/consider_pressure_difference(turf/T, difference)
/turf/open/proc/consider_pressure_difference(turf/target_turf, difference)
SSair.high_pressure_delta |= src
if(difference > pressure_difference)
pressure_direction = get_dir(src, T)
pressure_direction = get_dir(src, target_turf)
pressure_difference = difference
/turf/open/proc/high_pressure_movements()
var/atom/movable/M
var/atom/movable/moving_atom
for(var/thing in src)
M = thing
if (!M.anchored && !M.pulledby && M.last_high_pressure_movement_air_cycle < SSair.times_fired)
M.experience_pressure_difference(pressure_difference, pressure_direction)
moving_atom = thing
if (!moving_atom.anchored && !moving_atom.pulledby && moving_atom.last_high_pressure_movement_air_cycle < SSair.times_fired)
moving_atom.experience_pressure_difference(pressure_difference, pressure_direction)
/atom/movable/var/pressure_resistance = 10
/atom/movable/var/last_high_pressure_movement_air_cycle = 0
/atom/movable
///How much delta pressure is needed for us to move
var/pressure_resistance = 10
var/last_high_pressure_movement_air_cycle = 0
/atom/movable/proc/experience_pressure_difference(pressure_difference, direction, pressure_resistance_prob_delta = 0)
var/const/PROBABILITY_OFFSET = 25
var/const/PROBABILITY_BASE_PRECENT = 75
var/max_force = sqrt(pressure_difference)*(MOVE_FORCE_DEFAULT / 5)
var/max_force = sqrt(pressure_difference) * (MOVE_FORCE_DEFAULT / 5)
set waitfor = FALSE
var/move_prob = 100
if (pressure_resistance > 0)
move_prob = (pressure_difference/pressure_resistance*PROBABILITY_BASE_PRECENT)-PROBABILITY_OFFSET
move_prob = (pressure_difference / pressure_resistance * PROBABILITY_BASE_PRECENT) - PROBABILITY_OFFSET
move_prob += pressure_resistance_prob_delta
if (move_prob > PROBABILITY_OFFSET && prob(move_prob) && (move_resist != INFINITY) && (!anchored && (max_force >= (move_resist * MOVE_FORCE_PUSH_RATIO))) || (anchored && (max_force >= (move_resist * MOVE_FORCE_FORCEPUSH_RATIO))))
step(src, direction)
@@ -367,72 +381,75 @@
We solve this with excited group cleanup. See the documentation for more details.
*/
/datum/excited_group
///Stores a reference to the turfs we are controlling
var/list/turf_list = list()
///If this is over EXCITED_GROUP_BREAKDOWN_CYCLES we call self_breakdown()
var/breakdown_cooldown = 0
///If this is over EXCITED_GROUP_DISMANTLE_CYCLES we call dismantle()
var/dismantle_cooldown = 0
///Used for debug to show the excited groups active and their turfs
var/should_display = FALSE
///Id of the index color of the displayed group
var/display_id = 0
///Wrapping loop of the index colors
var/static/wrapping_id = 0
/datum/excited_group/New()
SSair.excited_groups += src
/datum/excited_group/proc/add_turf(turf/open/T)
turf_list += T
T.excited_group = src
/datum/excited_group/proc/add_turf(turf/open/target_turf)
turf_list += target_turf
target_turf.excited_group = src
dismantle_cooldown = 0
if(should_display || SSair.display_all_groups)
display_turf(T)
display_turf(target_turf)
/datum/excited_group/proc/merge_groups(datum/excited_group/E)
if(turf_list.len > E.turf_list.len)
SSair.excited_groups -= E
for(var/t in E.turf_list)
var/turf/open/T = t
T.excited_group = src
turf_list += T
should_display = E.should_display | should_display
/datum/excited_group/proc/merge_groups(datum/excited_group/target_group)
if(turf_list.len > target_group.turf_list.len)
SSair.excited_groups -= target_group
for(var/turf/open/group_member as anything in target_group.turf_list)
group_member.excited_group = src
turf_list += group_member
should_display = target_group.should_display | should_display
if(should_display || SSair.display_all_groups)
E.hide_turfs()
target_group.hide_turfs()
display_turfs()
breakdown_cooldown = min(breakdown_cooldown, E.breakdown_cooldown) //Take the smaller of the two options
breakdown_cooldown = min(breakdown_cooldown, target_group.breakdown_cooldown) //Take the smaller of the two options
dismantle_cooldown = 0
else
SSair.excited_groups -= src
for(var/t in turf_list)
var/turf/open/T = t
T.excited_group = E
E.turf_list += T
E.should_display = E.should_display | should_display
if(E.should_display || SSair.display_all_groups)
for(var/turf/open/group_member as anything in turf_list)
group_member.excited_group = target_group
target_group.turf_list += group_member
target_group.should_display = target_group.should_display | should_display
if(target_group.should_display || SSair.display_all_groups)
hide_turfs()
E.display_turfs()
E.breakdown_cooldown = min(breakdown_cooldown, E.breakdown_cooldown)
E.dismantle_cooldown = 0
target_group.display_turfs()
target_group.breakdown_cooldown = min(breakdown_cooldown, target_group.breakdown_cooldown)
target_group.dismantle_cooldown = 0
/datum/excited_group/proc/reset_cooldowns()
breakdown_cooldown = 0
dismantle_cooldown = 0
/datum/excited_group/proc/self_breakdown(roundstart = FALSE, poke_turfs = FALSE)
var/datum/gas_mixture/A = new
var/datum/gas_mixture/shared_mix = new
//make local for sanic speed
var/list/A_gases = A.gases
var/list/shared_gases = shared_mix.gases
var/list/turf_list = src.turf_list
var/turflen = turf_list.len
var/imumutable_in_group = FALSE
var/energy = 0
var/heat_cap = 0
for(var/t in turf_list)
var/turf/open/T = t
for(var/turf/open/group_member as anything in turf_list)
//Cache?
var/datum/gas_mixture/turf/mix = T.air
if (roundstart && istype(T.air, /datum/gas_mixture/immutable))
var/datum/gas_mixture/turf/mix = group_member.air
if (roundstart && istype(group_member.air, /datum/gas_mixture/immutable))
imumutable_in_group = TRUE
A.copy_from(T.air) //This had better be immutable young man
A_gases = A.gases //update the cache
shared_mix.copy_from(group_member.air) //This had better be immutable young man
shared_gases = shared_mix.gases //update the cache
break
//"borrowing" this code from merge(), I need to play with the temp portion. Lets expand it out
//temperature = (giver.temperature * giver_heat_capacity + temperature * self_heat_capacity) / combined_heat_capacity
@@ -442,37 +459,35 @@
var/list/giver_gases = mix.gases
for(var/giver_id in giver_gases)
ASSERT_GAS(giver_id, A)
A_gases[giver_id][MOLES] += giver_gases[giver_id][MOLES]
ASSERT_GAS(giver_id, shared_mix)
shared_gases[giver_id][MOLES] += giver_gases[giver_id][MOLES]
if(!imumutable_in_group)
A.temperature = energy / heat_cap
for(var/id in A_gases)
A_gases[id][MOLES] /= turflen
A.garbage_collect()
shared_mix.temperature = energy / heat_cap
for(var/id in shared_gases)
shared_gases[id][MOLES] /= turflen
shared_mix.garbage_collect()
for(var/t in turf_list)
var/turf/open/T = t
if(T.planetary_atmos) //We do this as a hack to try and minimize unneeded excited group spread over planetary turfs
T.air.copy_from(SSair.planetary[T.initial_gas_mix]) //Comes with a cost of "slower" drains, but it's worth it
for(var/turf/open/group_member as anything in turf_list)
if(group_member.planetary_atmos) //We do this as a hack to try and minimize unneeded excited group spread over planetary turfs
group_member.air.copy_from(SSair.planetary[group_member.initial_gas_mix]) //Comes with a cost of "slower" drains, but it's worth it
else
T.air.copy_from(A) //Otherwise just set the mix to a copy of our equalized mix
T.update_visuals()
group_member.air.copy_from(shared_mix) //Otherwise just set the mix to a copy of our equalized mix
group_member.update_visuals()
if(poke_turfs) //Because we only activate all these once every breakdown, in event of lag due to this code and slow space + vent things, increase the wait time for breakdowns
SSair.add_to_active(T)
T.significant_share_ticker = EXCITED_GROUP_DISMANTLE_CYCLES //Max out the ticker, if they don't share next tick, nuke em
SSair.add_to_active(group_member)
group_member.significant_share_ticker = EXCITED_GROUP_DISMANTLE_CYCLES //Max out the ticker, if they don't share next tick, nuke em
breakdown_cooldown = 0
///Dismantles the excited group, puts allll the turfs to sleep
/datum/excited_group/proc/dismantle()
for(var/t in turf_list)
var/turf/open/T = t
T.excited = FALSE
T.significant_share_ticker = 0
SSair.active_turfs -= T
for(var/turf/open/current_turf as anything in turf_list)
current_turf.excited = FALSE
current_turf.significant_share_ticker = 0
SSair.active_turfs -= current_turf
#ifdef VISUALIZE_ACTIVE_TURFS //Use this when you want details about how the turfs are moving, display_all_groups should work for normal operation
T.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, COLOR_VIBRANT_LIME)
current_turf.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, COLOR_VIBRANT_LIME)
#endif
garbage_collect()
@@ -480,9 +495,8 @@
/datum/excited_group/proc/garbage_collect()
if(display_id) //If we ever did make those changes
hide_turfs()
for(var/t in turf_list)
var/turf/open/T = t
T.excited_group = null
for(var/turf/open/current_turf as anything in turf_list)
current_turf.excited_group = null
turf_list.Cut()
SSair.excited_groups -= src
if(SSair.currentpart == SSAIR_EXCITEDGROUPS)
@@ -535,8 +549,8 @@ Then we space some of our heat, and think about if we should stop conducting.
if(blocks_air)
return ..()
for(var/direction in GLOB.cardinals)
var/turf/T = get_step(src, direction)
if(!(T in atmos_adjacent_turfs) && !(atmos_supeconductivity & direction))
var/turf/checked_turf = get_step(src, direction)
if(!(checked_turf in atmos_adjacent_turfs) && !(atmos_supeconductivity & direction))
. |= direction
///These two procs are a bit of a web, I belive in you
@@ -549,12 +563,11 @@ Then we space some of our heat, and think about if we should stop conducting.
/turf/open/neighbor_conduct_with_src(turf/other)
if(blocks_air)
..()
return
return ..()
if(!other.blocks_air) //Both tiles are open
var/turf/open/T = other
T.air.temperature_share(air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
var/turf/open/open_other = other
open_other.air.temperature_share(air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
else //Open but neighbor is solid
temperature_share_open_to_solid(other)
SSair.add_to_active(src)
@@ -565,18 +578,19 @@ Then we space some of our heat, and think about if we should stop conducting.
if(conductivity_directions)
//Conduct with tiles around me
for(var/direction in GLOB.cardinals)
if(conductivity_directions & direction)
var/turf/neighbor = get_step(src,direction)
if(!(conductivity_directions & direction))
continue
var/turf/neighbor = get_step(src, direction)
if(!neighbor.thermal_conductivity)
continue
if(!neighbor.thermal_conductivity)
continue
if(neighbor.archived_cycle < SSair.times_fired)
neighbor.archive()
if(neighbor.archived_cycle < SSair.times_fired)
neighbor.archive()
neighbor.neighbor_conduct_with_src(src)
neighbor.neighbor_conduct_with_src(src)
neighbor.consider_superconductivity()
neighbor.consider_superconductivity()
radiate_to_spess()
@@ -615,13 +629,14 @@ Then we space some of our heat, and think about if we should stop conducting.
return ..()
/turf/proc/radiate_to_spess() //Radiate excess tile heat to space
if(temperature > T0C) //Considering 0 degC as te break even point for radiation in and out
var/delta_temperature = (temperature_archived - TCMB) //hardcoded space temperature
if((heat_capacity > 0) && (abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER))
var/heat = thermal_conductivity*delta_temperature* \
(heat_capacity*HEAT_CAPACITY_VACUUM/(heat_capacity+HEAT_CAPACITY_VACUUM))
temperature -= heat/heat_capacity
if(temperature <= T0C) //Considering 0 degC as te break even point for radiation in and out
return
var/delta_temperature = (temperature_archived - TCMB) //hardcoded space temperature
if(heat_capacity <= 0 || abs(delta_temperature) <= MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER)
return
var/heat = thermal_conductivity * delta_temperature * \
(heat_capacity * HEAT_CAPACITY_VACUUM / (heat_capacity + HEAT_CAPACITY_VACUUM))
temperature -= heat/heat_capacity
/turf/open/proc/temperature_share_open_to_solid(turf/sharer)
sharer.temperature = air.temperature_share(null, sharer.thermal_conductivity, sharer.temperature, sharer.heat_capacity)
@@ -629,9 +644,7 @@ Then we space some of our heat, and think about if we should stop conducting.
/turf/proc/share_temperature_mutual_solid(turf/sharer, conduction_coefficient) //This is all just heat sharing, don't get freaked out
var/delta_temperature = (temperature_archived - sharer.temperature_archived)
if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER && heat_capacity && sharer.heat_capacity)
var/heat = conduction_coefficient*delta_temperature* \
(heat_capacity*sharer.heat_capacity/(heat_capacity+sharer.heat_capacity)) //The larger the combined capacity the less is shared
temperature -= heat/heat_capacity //The higher your own heat cap the less heat you get from this arrangement
sharer.temperature += heat/sharer.heat_capacity
var/heat = conduction_coefficient * delta_temperature * \
(heat_capacity * sharer.heat_capacity / (heat_capacity + sharer.heat_capacity)) //The larger the combined capacity the less is shared
temperature -= heat / heat_capacity //The higher your own heat cap the less heat you get from this arrangement
sharer.temperature += heat / sharer.heat_capacity
@@ -81,11 +81,11 @@
..()
if(process)
SSair.start_processing_machine(src)
SetInitDirections(init_dir)
set_init_directions(init_dir)
/obj/machinery/atmospherics/Destroy()
for(var/i in 1 to device_type)
nullifyNode(i)
nullify_node(i)
SSair.stop_processing_machine(src)
SSair.rebuild_queue -= src
@@ -121,22 +121,23 @@
* Arguments:
* * i - is the current iteration of the node, based on the device_type (from 1 to 4)
*/
/obj/machinery/atmospherics/proc/nullifyNode(i)
if(nodes[i])
var/obj/machinery/atmospherics/N = nodes[i]
N.disconnect(src)
nodes[i] = null
/obj/machinery/atmospherics/proc/nullify_node(i)
if(!nodes[i])
return
var/obj/machinery/atmospherics/node_machine = nodes[i]
node_machine.disconnect(src)
nodes[i] = null
/**
* Getter for node_connects
*
* Return a list of the nodes that can connect to other machines, get called by atmosinit()
* Return a list of the nodes that can connect to other machines, get called by atmos_init()
*/
/obj/machinery/atmospherics/proc/getNodeConnects()
/obj/machinery/atmospherics/proc/get_node_connects()
var/list/node_connects = list()
node_connects.len = device_type
var/init_directions = GetInitDirections()
var/init_directions = get_init_directions()
for(var/i in 1 to device_type)
for(var/direction in GLOB.cardinals)
if(!(direction & init_directions))
@@ -167,9 +168,9 @@
* Arguments:
* * list/node_connects - a list of the nodes on the device that can make a connection to other machines
*/
/obj/machinery/atmospherics/proc/atmosinit(list/node_connects)
/obj/machinery/atmospherics/proc/atmos_init(list/node_connects)
if(!node_connects) //for pipes where order of nodes doesn't matter
node_connects = getNodeConnects()
node_connects = get_node_connects()
for(var/i in 1 to device_type)
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[i]))
@@ -185,7 +186,7 @@
* Arguments:
* * new_layer - the layer at which we want the piping_layer to be (1 to 5)
*/
/obj/machinery/atmospherics/proc/setPipingLayer(new_layer)
/obj/machinery/atmospherics/proc/set_piping_layer(new_layer)
piping_layer = (pipe_flags & PIPING_DEFAULT_LAYER_ONLY) ? PIPING_LAYER_DEFAULT : new_layer
update_appearance()
@@ -195,7 +196,7 @@
/**
* Check if a node can actually exists by connecting to another machine
* called on atmosinit()
* called on atmos_init()
* Arguments:
* * obj/machinery/atmospherics/target - the machine we are connecting to
* * iteration - the current node we are checking (from 1 to 4)
@@ -210,7 +211,7 @@
* * direction - the direction we are checking against
* * prompted_layer - the piping_layer we are inside
*/
/obj/machinery/atmospherics/proc/findConnecting(direction, prompted_layer)
/obj/machinery/atmospherics/proc/find_connecting(direction, prompted_layer)
for(var/obj/machinery/atmospherics/target in get_step_multiz(src, direction))
if(!(target.initialize_directions & get_dir(target,src)) && !istype(target, /obj/machinery/atmospherics/pipe/multiz))
continue
@@ -221,13 +222,13 @@
* Check the connection between two nodes
*
* Check if our machine and the target machine are connectable by both calling isConnectable and by checking that the directions and piping_layer are compatible
* called by can_be_node() (for building a network) and findConnecting() (for ventcrawling)
* called by can_be_node() (for building a network) and find_connecting() (for ventcrawling)
* Arguments:
* * obj/machinery/atmospherics/target - the machinery we want to connect to
* * given_layer - the piping_layer we are checking
*/
/obj/machinery/atmospherics/proc/connection_check(obj/machinery/atmospherics/target, given_layer)
if(isConnectable(target, given_layer) && target.isConnectable(src, given_layer) && check_init_directions(target))
if(is_connectable(target, given_layer) && target.is_connectable(src, given_layer) && check_init_directions(target))
return TRUE
return FALSE
@@ -249,7 +250,7 @@
* * obj/machinery/atmospherics/target - the machinery we want to connect to
* * given_layer - the piping_layer we are connecting to
*/
/obj/machinery/atmospherics/proc/isConnectable(obj/machinery/atmospherics/target, given_layer)
/obj/machinery/atmospherics/proc/is_connectable(obj/machinery/atmospherics/target, given_layer)
if(isnull(given_layer))
given_layer = piping_layer
if(check_connectable_layer(target, given_layer) && target.loc != loc && check_connectable_color(target))
@@ -259,7 +260,7 @@
/**
* check if the piping layer are the same on both sides or one of them has the PIPING_ALL_LAYER flag
* returns TRUE if one of the parameters is TRUE
* called by isConnectable()
* called by is_connectable()
* Arguments:
* * obj/machinery/atmospherics/target - the machinery we want to connect to
* * given_layer - the piping_layer we are connecting to
@@ -289,43 +290,43 @@
/**
* Set the initial directions of the device (NORTH || SOUTH || EAST || WEST), called on New()
*/
/obj/machinery/atmospherics/proc/SetInitDirections(init_dir)
/obj/machinery/atmospherics/proc/set_init_directions(init_dir)
return
/**
* Getter of initial directions
*/
/obj/machinery/atmospherics/proc/GetInitDirections()
/obj/machinery/atmospherics/proc/get_init_directions()
return initialize_directions
/**
* Called by addMember() in datum_pipeline.dm, returns the parent network the device is connected to
* Called by add_member() in datum_pipeline.dm, returns the parent network the device is connected to
*/
/obj/machinery/atmospherics/proc/returnPipenet()
/obj/machinery/atmospherics/proc/return_pipenet()
return
/**
* Called by addMachineryMember() in datum_pipeline.dm, returns a list of gas_mixtures and assigns them into other_airs (by addMachineryMember) to allow pressure redistribution for the machineries.
* Called by add_machinery_member() in datum_pipeline.dm, returns a list of gas_mixtures and assigns them into other_airs (by addMachineryMember) to allow pressure redistribution for the machineries.
*/
/obj/machinery/atmospherics/proc/returnPipenetAirs()
/obj/machinery/atmospherics/proc/return_pipenet_airs()
return
/**
* Called by build_pipeline() and addMember() in datum_pipeline.dm, set the network the device is connected to, to the datum pipeline it has reference
* Called by build_pipeline() and add_member() in datum_pipeline.dm, set the network the device is connected to, to the datum pipeline it has reference
*/
/obj/machinery/atmospherics/proc/setPipenet()
/obj/machinery/atmospherics/proc/set_pipenet()
return
/**
* Similar to setPipenet() but instead of setting a network to a pipeline, it replaces the old pipeline with a new one, called by Merge() in datum_pipeline.dm
* Similar to set_pipenet() but instead of setting a network to a pipeline, it replaces the old pipeline with a new one, called by Merge() in datum_pipeline.dm
*/
/obj/machinery/atmospherics/proc/replacePipenet()
/obj/machinery/atmospherics/proc/replace_pipenet()
return
/**
* Disconnects the nodes
*
* Called by nullifyNode(), it disconnects two nodes by removing the reference id from the node itself that called this proc
* Called by nullify_node(), it disconnects two nodes by removing the reference id from the node itself that called this proc
* Arguments:
* * obj/machinery/atmospherics/reference - the machinery we are removing from the node connection
*/
@@ -340,7 +341,7 @@
if(istype(W, /obj/item/pipe)) //lets you autodrop
var/obj/item/pipe/pipe = W
if(user.dropItemToGround(pipe))
pipe.setPipingLayer(piping_layer) //align it with us
pipe.set_piping_layer(piping_layer) //align it with us
return TRUE
else
return ..()
@@ -419,7 +420,7 @@
if(!(flags_1 & NODECONSTRUCT_1))
if(can_unwrench)
var/obj/item/pipe/stored = new construction_type(loc, null, dir, src, pipe_color)
stored.setPipingLayer(piping_layer)
stored.set_piping_layer(piping_layer)
if(!disassembled)
stored.take_damage(stored.max_integrity * 0.5, sound_effect=FALSE)
transfer_fingerprints_to(stored)
@@ -438,7 +439,7 @@
* * piping_layer - the piping_layer the device is in, used inside PIPING_LAYER_SHIFT
* * trinary - if TRUE we also use PIPING_FORWARD_SHIFT on layer 1 and 5 for trinary devices (filters and mixers)
*/
/obj/machinery/atmospherics/proc/getpipeimage(iconfile, iconstate, direction, color = COLOR_VERY_LIGHT_GRAY, piping_layer = 3, trinary = FALSE)
/obj/machinery/atmospherics/proc/get_pipe_image(iconfile, iconstate, direction, color = COLOR_VERY_LIGHT_GRAY, piping_layer = 3, trinary = FALSE)
var/image/pipe_overlay = image(iconfile, iconstate, dir = direction)
pipe_overlay.color = color
PIPING_LAYER_SHIFT(pipe_overlay, piping_layer)
@@ -451,12 +452,12 @@
add_atom_colour(obj_color, FIXED_COLOUR_PRIORITY)
pipe_color = obj_color
update_name()
setPipingLayer(set_layer)
atmosinit()
set_piping_layer(set_layer)
atmos_init()
var/list/nodes = pipeline_expansion()
for(var/obj/machinery/atmospherics/A in nodes)
A.atmosinit()
A.addMember(src)
A.atmos_init()
A.add_member(src)
SSair.add_to_rebuild_queue(src)
/obj/machinery/atmospherics/update_name()
@@ -483,14 +484,14 @@
return
if(user in buckled_mobs)// fixes buckle ventcrawl edgecase fuck bug
return
var/obj/machinery/atmospherics/target_move = findConnecting(direction, user.ventcrawl_layer)
var/obj/machinery/atmospherics/target_move = find_connecting(direction, user.ventcrawl_layer)
if(!target_move)
return
if(target_move.vent_movement & VENTCRAWL_ALLOWED)
user.forceMove(target_move)
user.client.eye = target_move //Byond only updates the eye every tick, This smooths out the movement
var/list/pipenetdiff = returnPipenets() ^ target_move.returnPipenets()
var/list/pipenetdiff = return_pipenets() ^ target_move.return_pipenets()
if(pipenetdiff.len)
user.update_pipe_vision()
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
@@ -513,7 +514,7 @@
*
* called in relaymove() to create the image for vent crawling
*/
/obj/machinery/atmospherics/proc/returnPipenets()
/obj/machinery/atmospherics/proc/return_pipenets()
return list()
/obj/machinery/atmospherics/update_remote_sight(mob/user)
@@ -7,14 +7,14 @@
layer = GAS_PUMP_LAYER
pipe_flags = PIPING_BRIDGE
/obj/machinery/atmospherics/components/binary/SetInitDirections()
/obj/machinery/atmospherics/components/binary/set_init_directions()
switch(dir)
if(NORTH, SOUTH)
initialize_directions = NORTH|SOUTH
if(EAST, WEST)
initialize_directions = EAST|WEST
/obj/machinery/atmospherics/components/binary/getNodeConnects()
/obj/machinery/atmospherics/components/binary/get_node_connects()
return list(turn(dir, 180), dir)
/**
@@ -100,37 +100,37 @@
node1.disconnect(src)
nodes[1] = null
if(parents[1])
nullifyPipenet(parents[1])
nullify_pipenet(parents[1])
if(node2)
node2.disconnect(src)
nodes[2] = null
if(parents[2])
nullifyPipenet(parents[2])
nullify_pipenet(parents[2])
if(anchored)
SetInitDirections()
atmosinit()
set_init_directions()
atmos_init()
node1 = nodes[1]
if(node1)
node1.atmosinit()
node1.addMember(src)
node1.atmos_init()
node1.add_member(src)
node2 = nodes[2]
if(node2)
node2.atmosinit()
node2.addMember(src)
node2.atmos_init()
node2.add_member(src)
SSair.add_to_rebuild_queue(src)
return TRUE
/obj/machinery/atmospherics/components/binary/circulator/SetInitDirections()
/obj/machinery/atmospherics/components/binary/circulator/set_init_directions()
switch(dir)
if(NORTH, SOUTH)
initialize_directions = EAST|WEST
if(EAST, WEST)
initialize_directions = NORTH|SOUTH
/obj/machinery/atmospherics/components/binary/circulator/getNodeConnects()
/obj/machinery/atmospherics/components/binary/circulator/get_node_connects()
if(flipped)
return list(turn(dir, 270), turn(dir, 90))
return list(turn(dir, 90), turn(dir, 270))
@@ -171,7 +171,7 @@
generator.update_appearance()
generator = null
/obj/machinery/atmospherics/components/binary/circulator/setPipingLayer(new_layer)
/obj/machinery/atmospherics/components/binary/circulator/set_piping_layer(new_layer)
..()
pixel_x = 0
pixel_y = 0
@@ -40,7 +40,7 @@
/obj/machinery/atmospherics/components/binary/dp_vent_pump/update_icon_nopipes()
cut_overlays()
if(showpipe)
var/image/cap = getpipeimage(icon, "dpvent_cap", dir, pipe_color, piping_layer = piping_layer)
var/image/cap = get_pipe_image(icon, "dpvent_cap", dir, pipe_color, piping_layer = piping_layer)
add_overlay(cap)
if(!on || !is_operational)
@@ -113,7 +113,7 @@
//Radio remote control
/**
* Called in atmosinit(), used to change or remove the radio frequency from the component
* Called in atmos_init(), used to change or remove the radio frequency from the component
* Arguments:
* * -new_frequency: the frequency that should be used for the radio to attach to the component, use 0 to remove the radio
*/
@@ -124,7 +124,7 @@
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
/**
* Called in atmosinit(), send the component status to the radio device connected
* Called in atmos_init(), send the component status to the radio device connected
*/
/obj/machinery/atmospherics/components/binary/dp_vent_pump/proc/broadcast_status()
if(!radio_connection)
@@ -143,7 +143,7 @@
))
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
/obj/machinery/atmospherics/components/binary/dp_vent_pump/atmosinit()
/obj/machinery/atmospherics/components/binary/dp_vent_pump/atmos_init()
..()
if(frequency)
set_frequency(frequency)
@@ -48,7 +48,7 @@ Passive gate is similar to the regular pump except:
cut_overlays()
icon_state = "passgate_off-[set_overlay_offset(piping_layer)]"
if(on)
add_overlay(getpipeimage(icon, "passgate_on-[set_overlay_offset(piping_layer)]"))
add_overlay(get_pipe_image(icon, "passgate_on-[set_overlay_offset(piping_layer)]"))
/obj/machinery/atmospherics/components/binary/passive_gate/process_atmos()
if(!on)
@@ -62,7 +62,7 @@ Passive gate is similar to the regular pump except:
//Radio remote control
/**
* Called in atmosinit(), used to change or remove the radio frequency from the component
* Called in atmos_init(), used to change or remove the radio frequency from the component
* Arguments:
* * -new_frequency: the frequency that should be used for the radio to attach to the component, use 0 to remove the radio
*/
@@ -73,7 +73,7 @@ Passive gate is similar to the regular pump except:
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
/**
* Called in atmosinit(), send the component status to the radio device connected
* Called in atmos_init(), send the component status to the radio device connected
*/
/obj/machinery/atmospherics/components/binary/passive_gate/proc/broadcast_status()
if(!radio_connection)
@@ -128,7 +128,7 @@ Passive gate is similar to the regular pump except:
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_appearance()
/obj/machinery/atmospherics/components/binary/passive_gate/atmosinit()
/obj/machinery/atmospherics/components/binary/passive_gate/atmos_init()
..()
if(frequency)
set_frequency(frequency)
@@ -65,7 +65,7 @@
//Radio remote control
/**
* Called in atmosinit(), used to change or remove the radio frequency from the component
* Called in atmos_init(), used to change or remove the radio frequency from the component
* Arguments:
* * -new_frequency: the frequency that should be used for the radio to attach to the component, use 0 to remove the radio
*/
@@ -76,7 +76,7 @@
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
/**
* Called in atmosinit(), send the component status to the radio device connected
* Called in atmos_init(), send the component status to the radio device connected
*/
/obj/machinery/atmospherics/components/binary/pressure_valve/proc/broadcast_status()
if(!radio_connection)
@@ -131,7 +131,7 @@
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_appearance()
/obj/machinery/atmospherics/components/binary/pressure_valve/atmosinit()
/obj/machinery/atmospherics/components/binary/pressure_valve/atmos_init()
. = ..()
if(frequency)
set_frequency(frequency)
@@ -73,7 +73,7 @@
SEND_SIGNAL(src, COMSIG_PUMP_SET_ON, on)
/**
* Called in atmosinit(), used to change or remove the radio frequency from the component
* Called in atmos_init(), used to change or remove the radio frequency from the component
* Arguments:
* * -new_frequency: the frequency that should be used for the radio to attach to the component, use 0 to remove the radio
*/
@@ -84,7 +84,7 @@
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
/**
* Called in atmosinit(), send the component status to the radio device connected
* Called in atmos_init(), send the component status to the radio device connected
*/
/obj/machinery/atmospherics/components/binary/pump/proc/broadcast_status()
if(!radio_connection)
@@ -134,7 +134,7 @@
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
update_appearance()
/obj/machinery/atmospherics/components/binary/pump/atmosinit()
/obj/machinery/atmospherics/components/binary/pump/atmos_init()
..()
if(frequency)
set_frequency(frequency)
@@ -49,12 +49,12 @@
RefreshParts()
update_appearance()
/obj/machinery/atmospherics/components/binary/thermomachine/isConnectable()
/obj/machinery/atmospherics/components/binary/thermomachine/is_connectable()
if(!anchored || panel_open)
return FALSE
. = ..()
/obj/machinery/atmospherics/components/binary/thermomachine/getNodeConnects()
/obj/machinery/atmospherics/components/binary/thermomachine/get_node_connects()
return list(dir, turn(dir, 180))
/obj/machinery/atmospherics/components/binary/thermomachine/on_construction(obj_color, set_layer)
@@ -118,8 +118,8 @@
if(!initial(icon))
return
var/mutable_appearance/thermo_overlay = new(initial(icon))
. += getpipeimage(thermo_overlay, "pipe", dir, COLOR_LIME, piping_layer)
. += getpipeimage(thermo_overlay, "pipe", turn(dir, 180), COLOR_MOSTLY_PURE_RED, piping_layer)
. += get_pipe_image(thermo_overlay, "pipe", dir, COLOR_LIME, piping_layer)
. += get_pipe_image(thermo_overlay, "pipe", turn(dir, 180), COLOR_MOSTLY_PURE_RED, piping_layer)
/obj/machinery/atmospherics/components/binary/thermomachine/examine(mob/user)
. = ..()
@@ -287,7 +287,7 @@
/obj/machinery/atmospherics/components/binary/thermomachine/default_change_direction_wrench(mob/user, obj/item/I)
if(!..())
return FALSE
SetInitDirections()
set_init_directions()
update_appearance()
return TRUE
@@ -300,15 +300,15 @@
/obj/machinery/atmospherics/components/binary/thermomachine/proc/connect_pipes()
var/obj/machinery/atmospherics/node1 = nodes[1]
var/obj/machinery/atmospherics/node2 = nodes[2]
atmosinit()
atmos_init()
node1 = nodes[1]
if(node1)
node1.atmosinit()
node1.addMember(src)
node1.atmos_init()
node1.add_member(src)
node2 = nodes[2]
if(node2)
node2.atmosinit()
node2.addMember(src)
node2.atmos_init()
node2.add_member(src)
SSair.add_to_rebuild_queue(src)
/obj/machinery/atmospherics/components/binary/thermomachine/proc/disconnect_pipes()
@@ -323,9 +323,9 @@
node2.disconnect(src)
nodes[2] = null
if(parents[1])
nullifyPipenet(parents[1])
nullify_pipenet(parents[1])
if(parents[2])
nullifyPipenet(parents[2])
nullify_pipenet(parents[2])
/obj/machinery/atmospherics/components/binary/thermomachine/attackby_secondary(obj/item/item, mob/user, params)
. = ..()
@@ -50,7 +50,7 @@ It's like a regular ol' straight pipe, but you can turn it on and off.
// This is what handles the actual functionality of combining 2 pipenets when the valve is open
// Basically when a pipenet updates it will consider both sides to be the same for the purpose of the gas update
/obj/machinery/atmospherics/components/binary/valve/returnPipenetsForReconcilation(datum/pipeline/requester)
/obj/machinery/atmospherics/components/binary/valve/return_pipenets_for_reconcilation(datum/pipeline/requester)
. = ..()
if(!on)
return
@@ -94,7 +94,7 @@
. += "Its warning light is on[on ? " and it's spewing gas!" : "."]"
/**
* Called in atmosinit(), used to change or remove the radio frequency from the component
* Called in atmos_init(), used to change or remove the radio frequency from the component
* Arguments:
* * -new_frequency: the frequency that should be used for the radio to attach to the component, use 0 to remove the radio
*/
@@ -105,7 +105,7 @@
radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA)
/**
* Called in atmosinit(), send the component status to the radio device connected
* Called in atmos_init(), send the component status to the radio device connected
*/
/obj/machinery/atmospherics/components/binary/volume_pump/proc/broadcast_status()
if(!radio_connection)
@@ -133,7 +133,7 @@
data["max_rate"] = round(MAX_TRANSFER_RATE)
return data
/obj/machinery/atmospherics/components/binary/volume_pump/atmosinit()
/obj/machinery/atmospherics/components/binary/volume_pump/atmos_init()
. = ..()
set_frequency(frequency)
@@ -27,9 +27,9 @@
for(var/i in 1 to device_type)
if(airs[i])
continue
var/datum/gas_mixture/A = new
A.volume = 200
airs[i] = A
var/datum/gas_mixture/component_mixture = new
component_mixture.volume = 200
airs[i] = component_mixture
/obj/machinery/atmospherics/components/Initialize(mapload)
. = ..()
@@ -90,9 +90,9 @@
// Pipenet stuff; housekeeping
/obj/machinery/atmospherics/components/nullifyNode(i)
/obj/machinery/atmospherics/components/nullify_node(i)
if(parents[i])
nullifyPipenet(parents[i])
nullify_pipenet(parents[i])
airs[i] = null
return ..()
@@ -115,20 +115,20 @@
return to_return
/**
* Called by nullifyNode(), used to remove the pipeline the component is attached to
* Called by nullify_node(), used to remove the pipeline the component is attached to
* Arguments:
* * -reference: the pipeline the component is attached to
*/
/obj/machinery/atmospherics/components/proc/nullifyPipenet(datum/pipeline/reference)
/obj/machinery/atmospherics/components/proc/nullify_pipenet(datum/pipeline/reference)
if(!reference)
CRASH("nullifyPipenet(null) called by [type] on [COORD(src)]")
CRASH("nullify_pipenet(null) called by [type] on [COORD(src)]")
for (var/i in 1 to parents.len)
if (parents[i] == reference)
reference.other_airs -= airs[i] // Disconnects from the pipeline side
parents[i] = null // Disconnects from the machinery side.
reference.other_atmosmch -= src
reference.other_atmos_machines -= src
/**
* We explicitly qdel pipeline when this particular pipeline
@@ -138,12 +138,12 @@
* again every time they are qdeleted.
*/
if(!length(reference.other_atmosmch) && !length(reference.members))
if(!length(reference.other_atmos_machines) && !length(reference.members))
if(QDESTROYING(reference))
CRASH("nullifyPipenet() called on qdeleting [reference]")
CRASH("nullify_pipenet() called on qdeleting [reference]")
qdel(reference)
/obj/machinery/atmospherics/components/returnPipenetAirs(datum/pipeline/reference)
/obj/machinery/atmospherics/components/return_pipenet_airs(datum/pipeline/reference)
var/list/returned_air = list()
for (var/i in 1 to parents.len)
@@ -156,23 +156,23 @@
return list(nodes[parents.Find(reference)])
return ..()
/obj/machinery/atmospherics/components/setPipenet(datum/pipeline/reference, obj/machinery/atmospherics/A)
parents[nodes.Find(A)] = reference
/obj/machinery/atmospherics/components/set_pipenet(datum/pipeline/reference, obj/machinery/atmospherics/target_component)
parents[nodes.Find(target_component)] = reference
/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = nodes[1]) //returns parents[1] if called without argument
return parents[nodes.Find(A)]
/obj/machinery/atmospherics/components/return_pipenet(obj/machinery/atmospherics/target_component = nodes[1]) //returns parents[1] if called without argument
return parents[nodes.Find(target_component)]
/obj/machinery/atmospherics/components/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
/obj/machinery/atmospherics/components/replace_pipenet(datum/pipeline/Old, datum/pipeline/New)
parents[parents.Find(Old)] = New
/obj/machinery/atmospherics/components/unsafe_pressure_release(mob/user, pressures)
. = ..()
var/turf/T = get_turf(src)
if(!T)
var/turf/current_turf = get_turf(src)
if(!current_turf)
return
//Remove the gas from airs and assume it
var/datum/gas_mixture/environment = T.return_air()
var/datum/gas_mixture/environment = current_turf.return_air()
var/lost = null
var/times_lost = 0
for(var/i in 1 to device_type)
@@ -188,7 +188,7 @@
to_release = air.remove(shared_loss)
continue
to_release.merge(air.remove(shared_loss))
T.assume_air(to_release)
current_turf.assume_air(to_release)
// Helpers
@@ -210,19 +210,19 @@
else
parent.update = TRUE
/obj/machinery/atmospherics/components/returnPipenets()
/obj/machinery/atmospherics/components/return_pipenets()
. = list()
for(var/i in 1 to device_type)
. += returnPipenet(nodes[i])
. += return_pipenet(nodes[i])
/// When this machine is in a pipenet that is reconciling airs, this proc can add pipelines to the calculation.
/// Can be either a list of pipenets or a single pipenet.
/obj/machinery/atmospherics/components/proc/returnPipenetsForReconcilation(datum/pipeline/requester)
/obj/machinery/atmospherics/components/proc/return_pipenets_for_reconcilation(datum/pipeline/requester)
return list()
/// When this machine is in a pipenet that is reconciling airs, this proc can add airs to the calculation.
/// Can be either a list of airs or a single air mix.
/obj/machinery/atmospherics/components/proc/returnAirsForReconcilation(datum/pipeline/requester)
/obj/machinery/atmospherics/components/proc/return_airs_for_reconcilation(datum/pipeline/requester)
return list()
// UI Stuff
@@ -57,18 +57,18 @@
/obj/machinery/atmospherics/components/unary/hypertorus/default_change_direction_wrench(mob/user, obj/item/I)
. = ..()
if(.)
SetInitDirections()
set_init_directions()
var/obj/machinery/atmospherics/node = nodes[1]
if(node)
node.disconnect(src)
nodes[1] = null
if(parents[1])
nullifyPipenet(parents[1])
atmosinit()
nullify_pipenet(parents[1])
atmos_init()
node = nodes[1]
if(node)
node.atmosinit()
node.addMember(src)
node.atmos_init()
node.add_member(src)
SSair.add_to_rebuild_queue(src)
/obj/machinery/atmospherics/components/unary/hypertorus/update_icon_state()
@@ -49,7 +49,7 @@
. = ..()
if(!.)
return FALSE
SetInitDirections()
set_init_directions()
var/obj/machinery/atmospherics/node1 = nodes[1]
var/obj/machinery/atmospherics/node2 = nodes[2]
if(node1)
@@ -62,19 +62,19 @@
nodes[2] = null
if(parents[1])
nullifyPipenet(parents[1])
nullify_pipenet(parents[1])
if(parents[2])
nullifyPipenet(parents[2])
nullify_pipenet(parents[2])
atmosinit()
atmos_init()
node1 = nodes[1]
if(node1)
node1.atmosinit()
node1.addMember(src)
node1.atmos_init()
node1.add_member(src)
node2 = nodes[2]
if(node2)
node2.atmosinit()
node2.addMember(src)
node2.atmos_init()
node2.add_member(src)
SSair.add_to_rebuild_queue(src)
return TRUE
@@ -10,7 +10,7 @@
density = TRUE
layer = ABOVE_WINDOW_LAYER
custom_materials = list(/datum/material/iron=20000) // plasteel is not a material to prevent two bugs: one where the default pressure is 1.5 times higher as plasteel's material modifier is added, and a second one where the tank names could be "plasteel plasteel" tanks
custom_materials = list(/datum/material/iron = 20000) // plasteel is not a material to prevent two bugs: one where the default pressure is 1.5 times higher as plasteel's material modifier is added, and a second one where the tank names could be "plasteel plasteel" tanks
material_flags = MATERIAL_EFFECTS | MATERIAL_GREYSCALE | MATERIAL_ADD_PREFIX | MATERIAL_AFFECT_STATISTICS
pipe_flags = PIPING_ONE_PER_TURF
@@ -26,6 +26,7 @@
greyscale_config = /datum/greyscale_config/stationary_canister
greyscale_colors = "#ffffff"
///The image showing the gases inside of the tank
var/image/window
/// The volume of the gas mixture
@@ -35,6 +36,7 @@
/// The typepath of the gas this tank should be filled with.
var/gas_type = null
///Reference to the gas mix inside the tank
var/datum/gas_mixture/air_contents
/// The sounds that play when the tank is breaking from overpressure
@@ -63,7 +65,7 @@
if(!knob_overlays)
knob_overlays = list()
for(var/dir in GLOB.cardinals)
knob_overlays["[dir]"] = image('icons/obj/atmospherics/stationary_canisters.dmi', icon_state="knob", dir=dir, layer=FLOAT_LAYER)
knob_overlays["[dir]"] = image('icons/obj/atmospherics/stationary_canisters.dmi', icon_state = "knob", dir = dir, layer = FLOAT_LAYER)
if(!crack_states)
crack_states = list()
@@ -73,21 +75,21 @@
if(!merger_typecache)
merger_typecache = typecacheof(/obj/machinery/atmospherics/components/tank)
AddComponent(/datum/component/gas_leaker, leak_rate=0.05)
AddComponent(/datum/component/gas_leaker, leak_rate = 0.05)
AddElement(/datum/element/volatile_gas_storage)
AddElement(/datum/element/crackable, 'icons/obj/atmospherics/stationary_canisters.dmi', crack_states)
RegisterSignal(src, COMSIG_MERGER_ADDING, .proc/MergerAdding)
RegisterSignal(src, COMSIG_MERGER_REMOVING, .proc/MergerRemoving)
RegisterSignal(src, COMSIG_ATOM_SMOOTHED_ICON, .proc/Smoothed)
RegisterSignal(src, COMSIG_MERGER_ADDING, .proc/merger_adding)
RegisterSignal(src, COMSIG_MERGER_REMOVING, .proc/merger_removing)
RegisterSignal(src, COMSIG_ATOM_SMOOTHED_ICON, .proc/smoothed)
air_contents = new
air_contents.temperature = T20C
air_contents.volume = volume
RefreshPressureLimit()
refresh_pressure_limit()
if(gas_type)
FillToPressure(gas_type)
fill_to_pressure(gas_type)
QUEUE_SMOOTH(src)
QUEUE_SMOOTH_NEIGHBORS(src)
@@ -112,23 +114,23 @@
. = ..()
var/wrench_hint = EXAMINE_HINT("wrench")
if(!initialize_directions)
. += "<span class='notice'>A pipe port can be opened with a [wrench_hint].</span>"
. += span_notice("A pipe port can be opened with a [wrench_hint].")
else
. += "<span class='notice'>The pipe port can be moved or closed with a [wrench_hint].</span>"
. += "<span class='notice'>A holographic sticker on it says that its maximum safe pressure is: [siunit_pressure(max_pressure, 0)].</span>"
. += span_notice("The pipe port can be moved or closed with a [wrench_hint].")
. += span_notice("A holographic sticker on it says that its maximum safe pressure is: [siunit_pressure(max_pressure, 0)].")
/obj/machinery/atmospherics/components/tank/set_custom_materials(list/materials, multiplier)
. = ..()
RefreshPressureLimit()
refresh_pressure_limit()
/// Recalculates pressure based on the current max integrity compared to original
/obj/machinery/atmospherics/components/tank/proc/RefreshPressureLimit()
/obj/machinery/atmospherics/components/tank/proc/refresh_pressure_limit()
var/max_pressure_multiplier = max_integrity / initial(max_integrity)
max_pressure = max_pressure_multiplier * initial(max_pressure)
/// Fills the tank to the maximum safe pressure.
/// Safety margin is a multiplier for the cap for the purpose of this proc so it doesn't have to be filled completely.
/obj/machinery/atmospherics/components/tank/proc/FillToPressure(gastype, safety_margin=0.5)
/obj/machinery/atmospherics/components/tank/proc/fill_to_pressure(gastype, safety_margin = 0.5)
var/pressure_limit = max_pressure * safety_margin
var/moles_to_add = (pressure_limit * air_contents.volume) / (R_IDEAL_GAS_EQUATION * air_contents.temperature)
@@ -141,11 +143,11 @@
update_parents()
if(air_contents.return_pressure() > max_pressure)
take_damage(0.1, BRUTE, sound_effect=FALSE)
take_damage(0.1, BRUTE, sound_effect = FALSE)
if(prob(40))
playsound(src, pick(breaking_sounds), 30, vary=TRUE)
playsound(src, pick(breaking_sounds), 30, vary = TRUE)
RefreshWindow()
refresh_window()
///////////////////////////////////////////////////////////////////
// Pipenet stuff
@@ -153,19 +155,19 @@
/obj/machinery/atmospherics/components/tank/return_analyzable_air()
return air_contents
/obj/machinery/atmospherics/components/tank/returnAirsForReconcilation(datum/pipeline/requester)
/obj/machinery/atmospherics/components/tank/return_airs_for_reconcilation(datum/pipeline/requester)
. = ..()
if(!air_contents)
return
. += air_contents
/obj/machinery/atmospherics/components/tank/returnPipenetsForReconcilation(datum/pipeline/requester)
/obj/machinery/atmospherics/components/tank/return_pipenets_for_reconcilation(datum/pipeline/requester)
. = ..()
var/datum/merger/merge_group = GetMergeGroup(merger_id, merger_typecache)
for(var/obj/machinery/atmospherics/components/tank/tank as anything in merge_group.members)
. += tank.parents
/obj/machinery/atmospherics/components/tank/proc/ToggleSidePort(new_dir)
/obj/machinery/atmospherics/components/tank/proc/toggle_side_port(new_dir)
if(initialize_directions & new_dir)
initialize_directions &= ~new_dir
else
@@ -179,15 +181,15 @@
node.disconnect(src)
nodes[i] = null
if(parents[i])
nullifyPipenet(parents[i])
nullify_pipenet(parents[i])
atmosinit()
atmos_init()
for(var/obj/machinery/atmospherics/components/node as anything in nodes)
if(!node)
continue
node.atmosinit()
node.addMember(src)
node.atmos_init()
node.add_member(src)
SSair.add_to_rebuild_queue(src)
update_parents()
@@ -195,26 +197,26 @@
///////////////////////////////////////////////////////////////////
// Merger handling
/obj/machinery/atmospherics/components/tank/proc/MergerAdding(obj/machinery/atmospherics/components/tank/us, datum/merger/new_merger)
/obj/machinery/atmospherics/components/tank/proc/merger_adding(obj/machinery/atmospherics/components/tank/us, datum/merger/new_merger)
SIGNAL_HANDLER
if(new_merger.id != merger_id)
return
RegisterSignal(new_merger, COMSIG_MERGER_REFRESH_COMPLETE, .proc/MergerRefreshComplete)
RegisterSignal(new_merger, COMSIG_MERGER_REFRESH_COMPLETE, .proc/merger_refresh_complete)
/obj/machinery/atmospherics/components/tank/proc/MergerRemoving(obj/machinery/atmospherics/components/tank/us, datum/merger/old_merger)
/obj/machinery/atmospherics/components/tank/proc/merger_removing(obj/machinery/atmospherics/components/tank/us, datum/merger/old_merger)
SIGNAL_HANDLER
if(old_merger.id != merger_id)
return
UnregisterSignal(old_merger, COMSIG_MERGER_REFRESH_COMPLETE)
/// Handles the combined gas tank for the entire merger group, only the origin tank actualy runs this.
/obj/machinery/atmospherics/components/tank/proc/MergerRefreshComplete(datum/merger/merger, list/leaving_members, list/joining_members)
/obj/machinery/atmospherics/components/tank/proc/merger_refresh_complete(datum/merger/merger, list/leaving_members, list/joining_members)
SIGNAL_HANDLER
if(merger.origin != src)
return
var/shares = length(merger.members) + length(leaving_members) - length(joining_members)
for(var/obj/machinery/atmospherics/components/tank/leaver as anything in leaving_members)
var/datum/gas_mixture/gas_share = air_contents.remove_ratio(1/shares--)
var/datum/gas_mixture/gas_share = air_contents.remove_ratio(1 / shares--)
air_contents.volume -= leaver.volume
leaver.air_contents = gas_share
leaver.update_appearance()
@@ -231,18 +233,18 @@
for(var/dir in GLOB.cardinals)
if(dir & initialize_directions & merger.members[src])
ToggleSidePort(dir)
toggle_side_port(dir)
///////////////////////////////////////////////////////////////////
// Appearance stuff
/obj/machinery/atmospherics/components/tank/proc/Smoothed()
/obj/machinery/atmospherics/components/tank/proc/smoothed()
SIGNAL_HANDLER
RefreshWindow()
refresh_window()
/obj/machinery/atmospherics/components/tank/update_appearance()
. = ..()
RefreshWindow()
refresh_window()
/obj/machinery/atmospherics/components/tank/update_overlays()
. = ..()
@@ -254,24 +256,24 @@
/obj/machinery/atmospherics/components/tank/update_greyscale()
. = ..()
RefreshWindow()
refresh_window()
/obj/machinery/atmospherics/components/tank/proc/RefreshWindow()
/obj/machinery/atmospherics/components/tank/proc/refresh_window()
cut_overlay(window)
if(!air_contents)
window = null
return
window = image(icon, icon_state="window-bg", layer=FLOAT_LAYER)
window = image(icon, icon_state = "window-bg", layer = FLOAT_LAYER)
var/list/new_underlays = list()
for(var/obj/effect/overlay/gas/gas as anything in air_contents.return_visuals())
var/image/new_underlay = image(gas.icon, icon_state=gas.icon_state, layer=FLOAT_LAYER)
new_underlay.filters = alpha_mask_filter(icon=icon(icon, icon_state="window-bg"))
var/image/new_underlay = image(gas.icon, icon_state = gas.icon_state, layer = FLOAT_LAYER)
new_underlay.filters = alpha_mask_filter(icon = icon(icon, icon_state = "window-bg"))
new_underlays += new_underlay
var/image/foreground = image(icon, icon_state="window-fg", layer=FLOAT_LAYER)
var/image/foreground = image(icon, icon_state = "window-fg", layer = FLOAT_LAYER)
foreground.underlays = new_underlays
window.overlays = list(foreground)
@@ -291,7 +293,7 @@
if(!item.use_tool(src, user, 3 SECONDS))
return
ToggleSidePort(new_dir)
toggle_side_port(new_dir)
item.play_tool_sound(src, 50)
@@ -300,20 +302,20 @@
. = TRUE
if(atom_integrity >= max_integrity)
return
if(!tool.tool_start_check(user, amount=0))
if(!tool.tool_start_check(user, amount = 0))
return
to_chat(user, "<span class='notice'>You begin to repair the cracks in the gas tank...</span>")
to_chat(user, span_notice("You begin to repair the cracks in the gas tank..."))
var/repair_amount = max_integrity / 10
do
if(!tool.use_tool(src, user, 2.5 SECONDS, volume=40))
if(!tool.use_tool(src, user, 2.5 SECONDS, volume = 40))
return
while(repair_damage(repair_amount))
to_chat(user, "<span class='notice'>The gas tank has been fully repaired and all cracks sealed.</span>")
to_chat(user, span_notice("The gas tank has been fully repaired and all cracks sealed."))
/obj/machinery/atmospherics/components/tank/welder_act_secondary(mob/living/user, obj/item/tool)
. = ..()
. = TRUE
to_chat(user, "<span class='notice'>You begin cutting open the gas tank...</span>")
to_chat(user, span_notice("You begin cutting open the gas tank..."))
var/turf/current_location = get_turf(src)
var/datum/gas_mixture/airmix = current_location.return_air()
@@ -321,13 +323,13 @@
if(air_contents.return_pressure() > airmix.return_pressure())
time_taken *= 2
to_chat(user, "<span class='warning'>The tank seems to be pressurized, are you sure this is a good idea?</span>")
to_chat(user, span_warning("The tank seems to be pressurized, are you sure this is a good idea?"))
if(!tool.use_tool(src, user, time_taken, volume=60))
if(!tool.use_tool(src, user, time_taken, volume = 60))
return
deconstruct(disassembled=TRUE)
to_chat(user, "<span class='notice'>You finish cutting open the sealed gas tank, revealing the innards.</span>")
to_chat(user, span_notice("You finish cutting open the sealed gas tank, revealing the innards."))
/obj/machinery/atmospherics/components/tank/deconstruct(disassembled)
var/turf/location = drop_location()
@@ -347,8 +349,8 @@
/obj/machinery/atmospherics/components/tank/air/Initialize(mapload)
. = ..()
FillToPressure(/datum/gas/oxygen, safety_margin=(O2STANDARD * 0.5))
FillToPressure(/datum/gas/nitrogen, safety_margin=(N2STANDARD * 0.5))
fill_to_pressure(/datum/gas/oxygen, safety_margin = (O2STANDARD * 0.5))
fill_to_pressure(/datum/gas/nitrogen, safety_margin = (N2STANDARD * 0.5))
/obj/machinery/atmospherics/components/tank/carbon_dioxide
gas_type = /datum/gas/carbon_dioxide
@@ -421,7 +423,7 @@
icon_state = "frame"
anchored = FALSE
density = TRUE
custom_materials = list(/datum/material/alloy/plasteel=4000)
custom_materials = list(/datum/material/alloy/plasteel = 4000)
var/construction_state = TANK_FRAME
var/datum/material/material_end_product
@@ -430,19 +432,19 @@
var/wrenched_hint = EXAMINE_HINT("wrenched")
if(!anchored)
. += "<span class='notice'>[src] has not been [wrenched_hint] to the floor yet.</span>"
. += span_notice("[src] has not been [wrenched_hint] to the floor yet.")
else
. += "<span class='notice'>[src] is [wrenched_hint] to the floor.</span>"
. += span_notice("[src] is [wrenched_hint] to the floor.")
switch(construction_state)
if(TANK_FRAME)
var/screwed_hint = EXAMINE_HINT("screwed")
var/plating_hint = EXAMINE_HINT("metal plating")
. += "<span class='notice'>[src] is [screwed_hint] together and now just needs some [plating_hint].</span>"
. += span_notice("[src] is [screwed_hint] together and now just needs some [plating_hint].")
if(TANK_PLATING_UNSECURED)
var/crowbar_hint = EXAMINE_HINT("crowbar")
var/welder_hint = EXAMINE_HINT("welder")
. += "<span class='notice'>The plating has been firmly attached and would need a [crowbar_hint] to detach, but still needs to be sealed by a [welder_hint].</span>"
. += span_notice("The plating has been firmly attached and would need a [crowbar_hint] to detach, but still needs to be sealed by a [welder_hint].")
/obj/structure/tank_frame/deconstruct(disassembled)
if(disassembled)
@@ -472,21 +474,21 @@
if(construction_state != TANK_FRAME)
return
. = TRUE
to_chat(user, "<span class='notice'>You begin taking apart [src].</span>")
to_chat(user, span_notice("You begin taking apart [src]."))
if(!tool.use_tool(src, user, 1 SECONDS))
return
deconstruct(TRUE)
to_chat(user, "<span class='notice'>[src] has been taken apart.</span>")
to_chat(user, span_notice("[src] has been taken apart."))
/obj/structure/tank_frame/proc/add_plating(mob/living/user, obj/item/stack/stack)
. = FALSE
var/datum/material/stack_mat = GET_MATERIAL_REF(stack.material_type)
if(!(MAT_CATEGORY_RIGID in stack_mat.categories))
to_chat(user, "<span class='notice'>This material doesn't seem rigid enough to hold the shape of a tank...</span>")
to_chat(user, span_notice("This material doesn't seem rigid enough to hold the shape of a tank..."))
return
. = TRUE
to_chat(user, "<span class='notice'>You begin adding [stack] to [src]...</span>")
to_chat(user, span_notice("You begin adding [stack] to [src]..."))
if(!stack.use_tool(src, user, 3 SECONDS))
return
if(!stack.use(20))
@@ -504,20 +506,20 @@
amount_more = "just a bit more"
else
amount_more = "an indeterminate amount more"
to_chat(user, "<span class='notice'>You don't have enough [stack] to add all the plating. Maybe [amount_more].</span>")
to_chat(user, span_notice("You don't have enough [stack] to add all the plating. Maybe [amount_more]."))
return
material_end_product = stack_mat
construction_state = TANK_PLATING_UNSECURED
update_appearance()
to_chat(user, "<span class='notice'>You finish attaching [stack] to [src].</span>")
to_chat(user, span_notice("You finish attaching [stack] to [src]."))
/obj/structure/tank_frame/crowbar_act_secondary(mob/living/user, obj/item/tool)
. = ..()
if(construction_state != TANK_PLATING_UNSECURED)
return
. = TRUE
to_chat(user, "<span class='notice'>You start prying off the outer plating...</span>")
to_chat(user, span_notice("You start prying off the outer plating..."))
if(!tool.use_tool(src, user, 2 SECONDS))
return
construction_state = TANK_FRAME
@@ -531,12 +533,12 @@
return
. = TRUE
if(!anchored)
to_chat(user, "<span class='notice'>You need to <b>wrench</b> [src] to the floor before finishing.</span>")
to_chat(user, span_notice("You need to <b>wrench</b> [src] to the floor before finishing."))
return
if(!tool.tool_start_check(user, amount=0))
if(!tool.tool_start_check(user, amount = 0))
return
to_chat(user, "<span class='notice'>You begin sealing the outer plating with the welder...</span>")
if(!tool.use_tool(src, user, 2 SECONDS, volume=60))
to_chat(user, span_notice("You begin sealing the outer plating with the welder..."))
if(!tool.use_tool(src, user, 2 SECONDS, volume = 60))
return
var/turf/build_location = drop_location()
@@ -547,5 +549,5 @@
new_custom_materials[material_end_product] = 20000
new_tank.set_custom_materials(new_custom_materials)
new_tank.on_construction(new_tank.pipe_color, new_tank.piping_layer)
to_chat(user, "<span class='notice'>[new_tank] has been sealed and is ready to accept gases.</span>")
to_chat(user, span_notice("[new_tank] has been sealed and is ready to accept gases."))
qdel(src)
@@ -6,14 +6,18 @@
desc = "Very useful for filtering gasses."
can_unwrench = TRUE
var/transfer_rate = MAX_TRANSFER_RATE
var/filter_type = null
var/frequency = 0
var/datum/radio_frequency/radio_connection
construction_type = /obj/item/pipe/trinary/flippable
pipe_state = "filter"
///Rate of transfer of the gases to the outputs
var/transfer_rate = MAX_TRANSFER_RATE
///What gas are we filtering
var/filter_type = null
///Frequency id for connecting to the NTNet
var/frequency = 0
///Reference to the radio datum
var/datum/radio_frequency/radio_connection
/obj/machinery/atmospherics/components/trinary/filter/CtrlClick(mob/user)
if(can_interact(user))
on = !on
@@ -45,7 +49,7 @@
if(!(direction & initialize_directions))
continue
. += getpipeimage(icon, "cap", direction, pipe_color, piping_layer, TRUE)
. += get_pipe_image(icon, "cap", direction, pipe_color, piping_layer, TRUE)
/obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes()
var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational
@@ -106,7 +110,7 @@
update_parents()
/obj/machinery/atmospherics/components/trinary/filter/atmosinit()
/obj/machinery/atmospherics/components/trinary/filter/atmos_init()
set_frequency(frequency)
return ..()
@@ -6,14 +6,15 @@
desc = "Very useful for mixing gasses."
can_unwrench = TRUE
var/target_pressure = ONE_ATMOSPHERE
var/node1_concentration = 0.5
var/node2_concentration = 0.5
construction_type = /obj/item/pipe/trinary/flippable
pipe_state = "mixer"
///Output pressure target
var/target_pressure = ONE_ATMOSPHERE
///Ratio between the node 1 and 2, determines the amount of gas transfered, sums up to 1
var/node1_concentration = 0.5
///Ratio between the node 1 and 2, determines the amount of gas transfered, sums up to 1
var/node2_concentration = 0.5
//node 3 is the outlet, nodes 1 & 2 are intakes
/obj/machinery/atmospherics/components/trinary/mixer/CtrlClick(mob/user)
@@ -37,7 +38,7 @@
if(!(direction & initialize_directions))
continue
. += getpipeimage(icon, "cap", direction, pipe_color, piping_layer, TRUE)
. += get_pipe_image(icon, "cap", direction, pipe_color, piping_layer, TRUE)
/obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes()
var/on_state = on && nodes[1] && nodes[2] && nodes[3] && is_operational
@@ -8,9 +8,10 @@
pipe_flags = PIPING_ONE_PER_TURF
vent_movement = NONE
///Flips the node connections so that the first and third ports are swapped
var/flipped = FALSE
/obj/machinery/atmospherics/components/trinary/SetInitDirections()
/obj/machinery/atmospherics/components/trinary/set_init_directions()
switch(dir)
if(NORTH)
initialize_directions = EAST|NORTH|SOUTH
@@ -25,7 +26,7 @@
Housekeeping and pipe network stuff
*/
/obj/machinery/atmospherics/components/trinary/getNodeConnects()
/obj/machinery/atmospherics/components/trinary/get_node_connects()
//Mixer:
//1 and 2 is input
@@ -54,9 +54,9 @@
/obj/machinery/atmospherics/components/unary/bluespace_sender/update_overlays()
. = ..()
. += getpipeimage(icon, "pipe", dir, , piping_layer)
. += get_pipe_image(icon, "pipe", dir, , piping_layer)
if(showpipe)
. += getpipeimage(icon, "pipe", initialize_directions)
. += get_pipe_image(icon, "pipe", initialize_directions)
/obj/machinery/atmospherics/components/unary/bluespace_sender/process_atmos()
if(!is_operational || !on || !nodes[1]) //if it has no power or its switched off, dont process atmos
@@ -86,20 +86,20 @@
/obj/machinery/atmospherics/components/unary/bluespace_sender/default_change_direction_wrench(mob/user, obj/item/item)
if(!..())
return FALSE
SetInitDirections()
set_init_directions()
var/obj/machinery/atmospherics/node = nodes[1]
if(node)
if(src in node.nodes) //Only if it's actually connected. On-pipe version would is one-sided.
node.disconnect(src)
nodes[1] = null
if(parents[1])
nullifyPipenet(parents[1])
nullify_pipenet(parents[1])
atmosinit()
atmos_init()
node = nodes[1]
if(node)
node.atmosinit()
node.addMember(src)
node.atmos_init()
node.add_member(src)
SSair.add_to_rebuild_queue(src)
return TRUE
@@ -523,19 +523,19 @@ GLOBAL_VAR_INIT(cryo_overlay_cover_off, mutable_appearance('icons/obj/cryogenics
/obj/machinery/atmospherics/components/unary/cryo_cell/default_change_direction_wrench(mob/user, obj/item/wrench/W)
. = ..()
if(.)
SetInitDirections()
set_init_directions()
var/obj/machinery/atmospherics/node = nodes[1]
if(node)
node.disconnect(src)
nodes[1] = null
if(parents[1])
nullifyPipenet(parents[1])
nullify_pipenet(parents[1])
atmosinit()
atmos_init()
node = nodes[1]
if(node)
node.atmosinit()
node.addMember(src)
node.atmos_init()
node.add_member(src)
SSair.add_to_rebuild_queue(src)
#undef MAX_TEMPERATURE
@@ -34,7 +34,7 @@
add_atom_colour(node.color, FIXED_COLOUR_PRIORITY)
PIPING_LAYER_SHIFT(src, piping_layer)
/obj/machinery/atmospherics/components/unary/heat_exchanger/atmosinit()
/obj/machinery/atmospherics/components/unary/heat_exchanger/atmos_init()
var/obj/machinery/atmospherics/components/unary/heat_exchanger/partner = partner_ref?.resolve()
if(!partner)
partner_ref = null
@@ -46,10 +46,9 @@
target.partner_ref = WEAKREF(src)
break
..()
. = ..()
/obj/machinery/atmospherics/components/unary/heat_exchanger/process_atmos()
..()
var/obj/machinery/atmospherics/components/unary/heat_exchanger/partner = partner_ref?.resolve()
if(!partner)
partner_ref = null
@@ -71,14 +70,14 @@
var/other_old_temperature = partnerair_contents.temperature
if(combined_heat_capacity > 0)
var/combined_energy = partnerair_contents.temperature*other_air_heat_capacity + air_heat_capacity*air_contents.temperature
var/combined_energy = partnerair_contents.temperature * other_air_heat_capacity + air_heat_capacity * air_contents.temperature
var/new_temperature = combined_energy/combined_heat_capacity
var/new_temperature = combined_energy / combined_heat_capacity
air_contents.temperature = new_temperature
partnerair_contents.temperature = new_temperature
if(abs(old_temperature-air_contents.temperature) > 1)
if(abs(old_temperature - air_contents.temperature) > 1)
update_parents()
if(abs(other_old_temperature-partnerair_contents.temperature) > 1)
if(abs(other_old_temperature - partnerair_contents.temperature) > 1)
partner.update_parents()
@@ -8,20 +8,21 @@
can_unwrench = TRUE
shift_underlay_only = FALSE
hide = TRUE
layer = GAS_SCRUBBER_LAYER
pipe_state = "injector"
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF //really helpful in building gas chambers for xenomorphs
var/injecting = 0
///Variable used for radio frequency injection
var/injecting = FALSE
///Rate of operation of the device
var/volume_rate = 50
///Frequency id for connecting to the NTNet
var/frequency = 0
var/id = null
///Reference to the radio datum
var/datum/radio_frequency/radio_connection
layer = GAS_SCRUBBER_LAYER
pipe_state = "injector"
///Id of the radio connection
var/id = null
/obj/machinery/atmospherics/components/unary/outlet_injector/CtrlClick(mob/user)
if(can_interact(user))
@@ -46,7 +47,7 @@
cut_overlays()
if(showpipe)
// everything is already shifted so don't shift the cap
add_overlay(getpipeimage(icon, "inje_cap", initialize_directions, pipe_color))
add_overlay(get_pipe_image(icon, "inje_cap", initialize_directions, pipe_color))
if(!nodes[1] || !on || !is_operational)
icon_state = "inje_off"
@@ -120,7 +121,7 @@
))
radio_connection.post_signal(src, signal)
/obj/machinery/atmospherics/components/unary/outlet_injector/atmosinit()
/obj/machinery/atmospherics/components/unary/outlet_injector/atmos_init()
set_frequency(frequency)
broadcast_status()
..()
@@ -15,7 +15,7 @@
/obj/machinery/atmospherics/components/unary/passive_vent/update_icon_nopipes()
cut_overlays()
if(showpipe)
var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions, pipe_color)
var/image/cap = get_pipe_image(icon, "vent_cap", initialize_directions, pipe_color)
add_overlay(cap)
icon_state = "passive_vent"
@@ -15,10 +15,11 @@
pipe_state = "connector"
custom_reconcilation = TRUE
///Reference to the connected device
var/obj/machinery/portable_atmospherics/connected_device
/obj/machinery/atmospherics/components/unary/portables_connector/New()
..()
. = ..()
var/datum/gas_mixture/air_contents = airs[1]
air_contents.volume = 0
@@ -31,7 +32,7 @@
icon_state = "connector"
if(showpipe)
cut_overlays()
var/image/cap = getpipeimage(icon, "connector_cap", initialize_directions, pipe_color)
var/image/cap = get_pipe_image(icon, "connector_cap", initialize_directions, pipe_color)
add_overlay(cap)
/obj/machinery/atmospherics/components/unary/portables_connector/process_atmos()
@@ -39,7 +40,7 @@
return
update_parents()
/obj/machinery/atmospherics/components/unary/portables_connector/returnAirsForReconcilation(datum/pipeline/requester)
/obj/machinery/atmospherics/components/unary/portables_connector/return_airs_for_reconcilation(datum/pipeline/requester)
. = ..()
if(!connected_device)
return
@@ -5,10 +5,12 @@
device_type = UNARY
pipe_flags = PIPING_ONE_PER_TURF
construction_type = /obj/item/pipe/directional
///Unique id of the device
var/uid
///Increases to prevent duplicated Ids
var/static/gl_uid = 1
/obj/machinery/atmospherics/components/unary/SetInitDirections()
/obj/machinery/atmospherics/components/unary/set_init_directions()
initialize_directions = dir
/obj/machinery/atmospherics/components/unary/on_construction()
@@ -17,24 +17,30 @@
layer = GAS_SCRUBBER_LAYER
hide = TRUE
shift_underlay_only = FALSE
pipe_state = "uvent"
vent_movement = VENTCRAWL_ALLOWED | VENTCRAWL_CAN_SEE | VENTCRAWL_ENTRANCE_ALLOWED
///Direction of pumping the gas (RELEASING or SIPHONING)
var/pump_direction = RELEASING
///Should we check internal pressure, external pressure, both or none? (EXT_BOUND, INT_BOUND, NO_BOUND)
var/pressure_checks = EXT_BOUND
///The external pressure threshold (default 101 kPa)
var/external_pressure_bound = ONE_ATMOSPHERE
///The internal pressure threshold (default 0 kPa)
var/internal_pressure_bound = 0
// EXT_BOUND: Do not pass external_pressure_bound
// INT_BOUND: Do not pass internal_pressure_bound
// NO_BOUND: Do not pass either
///Frequency id for connecting to the NTNet
var/frequency = FREQ_ATMOS_CONTROL
///Reference to the radio datum
var/datum/radio_frequency/radio_connection
///Radio connection to the air alarm
var/radio_filter_out
///Radio connection from the air alarm
var/radio_filter_in
pipe_state = "uvent"
vent_movement = VENTCRAWL_ALLOWED | VENTCRAWL_CAN_SEE | VENTCRAWL_ENTRANCE_ALLOWED
/obj/machinery/atmospherics/components/unary/vent_pump/New()
if(!id_tag)
id_tag = SSnetworks.assign_random_name()
@@ -53,7 +59,7 @@
/obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes()
cut_overlays()
if(showpipe)
var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions)
var/image/cap = get_pipe_image(icon, "vent_cap", initialize_directions)
add_overlay(cap)
else
PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT)
@@ -111,7 +117,7 @@
if(pressure_delta > 0)
if(air_contents.temperature > 0)
var/transfer_moles = (pressure_delta*environment.volume)/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/transfer_moles = (pressure_delta * environment.volume) / (air_contents.temperature * R_IDEAL_GAS_EQUATION)
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
if(!removed || !removed.total_moles())
@@ -180,7 +186,7 @@
name = "\proper [vent_area.name] [name] [id_tag]"
/obj/machinery/atmospherics/components/unary/vent_pump/atmosinit()
/obj/machinery/atmospherics/components/unary/vent_pump/atmos_init()
//some vents work his own spesial way
radio_filter_in = frequency==FREQ_ATMOS_CONTROL?(RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==FREQ_ATMOS_CONTROL?(RADIO_TO_AIRALARM):null
@@ -260,12 +266,12 @@
broadcast_status()
update_appearance()
/obj/machinery/atmospherics/components/unary/vent_pump/welder_act(mob/living/user, obj/item/I)
/obj/machinery/atmospherics/components/unary/vent_pump/welder_act(mob/living/user, obj/item/welder)
..()
if(!I.tool_start_check(user, amount=0))
if(!welder.tool_start_check(user, amount=0))
return TRUE
to_chat(user, span_notice("You begin welding the vent..."))
if(I.use_tool(src, user, 20, volume=50))
if(welder.use_tool(src, user, 20, volume=50))
if(!welded)
user.visible_message(span_notice("[user] welds the vent shut."), span_notice("You weld the vent shut."), span_hear("You hear welding."))
welded = TRUE
@@ -14,30 +14,37 @@
layer = GAS_SCRUBBER_LAYER
hide = TRUE
shift_underlay_only = FALSE
var/scrubbing = SCRUBBING //0 = siphoning, 1 = scrubbing
var/filter_types = list(/datum/gas/carbon_dioxide)
var/volume_rate = 200
var/widenet = FALSE //is this scrubber acting on the 3x3 area around it.
var/list/turf/adjacent_turfs = list()
var/frequency = FREQ_ATMOS_CONTROL
var/datum/radio_frequency/radio_connection
var/radio_filter_out
var/radio_filter_in
pipe_state = "scrubber"
vent_movement = VENTCRAWL_ALLOWED | VENTCRAWL_CAN_SEE | VENTCRAWL_ENTRANCE_ALLOWED
///The mode of the scrubber (SCRUBBING or SIPHONING)
var/scrubbing = SCRUBBING //0 = siphoning, 1 = scrubbing
///The list of gases we are filtering
var/filter_types = list(/datum/gas/carbon_dioxide)
///Rate of the scrubber to remove gases from the air
var/volume_rate = 200
///is this scrubber acting on the 3x3 area around it.
var/widenet = FALSE
///List of the turfs near the scrubber, used for widenet
var/list/turf/adjacent_turfs = list()
///Frequency id for connecting to the NTNet
var/frequency = FREQ_ATMOS_CONTROL
///Reference to the radio datum
var/datum/radio_frequency/radio_connection
///Radio connection to the air alarm
var/radio_filter_out
///Radio connection from the air alarm
var/radio_filter_in
/obj/machinery/atmospherics/components/unary/vent_scrubber/New()
if(!id_tag)
id_tag = SSnetworks.assign_random_name()
. = ..()
for(var/f in filter_types)
if(istext(f))
filter_types -= f
filter_types += gas_id2path(f)
for(var/to_filter in filter_types)
if(istext(to_filter))
filter_types -= to_filter
filter_types += gas_id2path(to_filter)
/obj/machinery/atmospherics/components/unary/vent_scrubber/Destroy()
var/area/scrub_area = get_area(src)
@@ -53,7 +60,7 @@
/obj/machinery/atmospherics/components/unary/vent_scrubber/update_icon_nopipes()
cut_overlays()
if(showpipe)
var/image/cap = getpipeimage(icon, "scrub_cap", initialize_directions)
var/image/cap = get_pipe_image(icon, "scrub_cap", initialize_directions)
add_overlay(cap)
else
PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT)
@@ -113,18 +120,18 @@
return TRUE
/obj/machinery/atmospherics/components/unary/vent_scrubber/update_name()
..()
. = ..()
var/area/scrub_area = get_area(src)
name = "\proper [scrub_area.name] [name] [id_tag]"
/obj/machinery/atmospherics/components/unary/vent_scrubber/atmosinit()
radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null
/obj/machinery/atmospherics/components/unary/vent_scrubber/atmos_init()
radio_filter_in = frequency == initial(frequency) ? RADIO_FROM_AIRALARM : null
radio_filter_out = frequency == initial(frequency) ? RADIO_TO_AIRALARM : null
if(frequency)
set_frequency(frequency)
broadcast_status()
check_turfs()
..()
. = ..()
/obj/machinery/atmospherics/components/unary/vent_scrubber/process_atmos()
if(welded || !is_operational)
@@ -202,8 +209,8 @@
/// diagonal turfs that can share atmos with *both* of the cardinal turfs
/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/check_turfs()
adjacent_turfs.Cut()
var/turf/T = get_turf(src)
adjacent_turfs = T.GetAtmosAdjacentTurfs(alldir = TRUE)
var/turf/local_turf = get_turf(src)
adjacent_turfs = local_turf.get_atmos_adjacent_turfs(alldir = TRUE)
/obj/machinery/atmospherics/components/unary/vent_scrubber/receive_signal(datum/signal/signal)
if(!is_operational || !signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
@@ -274,12 +281,12 @@
. = ..()
update_icon_nopipes()
/obj/machinery/atmospherics/components/unary/vent_scrubber/welder_act(mob/living/user, obj/item/I)
/obj/machinery/atmospherics/components/unary/vent_scrubber/welder_act(mob/living/user, obj/item/welder)
..()
if(!I.tool_start_check(user, amount=0))
if(!welder.tool_start_check(user, amount=0))
return TRUE
to_chat(user, span_notice("Now welding the scrubber."))
if(I.use_tool(src, user, 20, volume=50))
if(welder.use_tool(src, user, 20, volume=50))
if(!welded)
user.visible_message(span_notice("[user] welds the scrubber shut."),span_notice("You weld the scrubber shut."), span_hear("You hear welding."))
welded = TRUE
@@ -3,7 +3,7 @@
var/list/datum/gas_mixture/other_airs
var/list/obj/machinery/atmospherics/pipe/members
var/list/obj/machinery/atmospherics/components/other_atmosmch
var/list/obj/machinery/atmospherics/components/other_atmos_machines
///Should we equalize air amoung all our members?
var/update = TRUE
@@ -13,7 +13,7 @@
/datum/pipeline/New()
other_airs = list()
members = list()
other_atmosmch = list()
other_atmos_machines = list()
SSair.networks += src
/datum/pipeline/Destroy()
@@ -27,8 +27,8 @@
if(QDELETED(considered_pipe))
continue
SSair.add_to_rebuild_queue(considered_pipe)
for(var/obj/machinery/atmospherics/components/considered_component in other_atmosmch)
considered_component.nullifyPipenet(src)
for(var/obj/machinery/atmospherics/components/considered_component in other_atmos_machines)
considered_component.nullify_pipenet(src)
return ..()
/datum/pipeline/process()
@@ -50,7 +50,7 @@
air = considered_pipe.air_temporary
considered_pipe.air_temporary = null
else
addMachineryMember(base)
add_machinery_member(base)
if(!air)
air = new
@@ -69,7 +69,7 @@
air = considered_pipe.air_temporary
considered_pipe.air_temporary = null
else
addMachineryMember(base)
add_machinery_member(base)
if(!air)
air = new
@@ -82,8 +82,8 @@
continue
for(var/obj/machinery/atmospherics/considered_device in result)
if(!istype(considered_device, /obj/machinery/atmospherics/pipe))
considered_device.setPipenet(src, borderline)
addMachineryMember(considered_device)
considered_device.set_pipenet(src, borderline)
add_machinery_member(considered_device)
continue
var/obj/machinery/atmospherics/pipe/item = considered_device
if(members.Find(item))
@@ -119,18 +119,18 @@
* This parents list is populated when a machinery calls update_parents and is then added into the queue by the controller.
*/
/datum/pipeline/proc/addMachineryMember(obj/machinery/atmospherics/components/considered_component)
other_atmosmch |= considered_component
var/list/returned_airs = considered_component.returnPipenetAirs(src)
/datum/pipeline/proc/add_machinery_member(obj/machinery/atmospherics/components/considered_component)
other_atmos_machines |= considered_component
var/list/returned_airs = considered_component.return_pipenet_airs(src)
if (!length(returned_airs) || (null in returned_airs))
stack_trace("addMachineryMember: Nonexistent (empty list) or null machinery gasmix added to pipeline datum from [considered_component] \
which is of type [considered_component.type]. Nearby: ([considered_component.x], [considered_component.y], [considered_component.z])")
other_airs |= returned_airs
/datum/pipeline/proc/addMember(obj/machinery/atmospherics/reference_device, obj/machinery/atmospherics/device_to_add)
/datum/pipeline/proc/add_member(obj/machinery/atmospherics/reference_device, obj/machinery/atmospherics/device_to_add)
if(!istype(reference_device, /obj/machinery/atmospherics/pipe))
reference_device.setPipenet(src, device_to_add)
addMachineryMember(reference_device)
reference_device.set_pipenet(src, device_to_add)
add_machinery_member(reference_device)
else
var/obj/machinery/atmospherics/pipe/reference_pipe = reference_device
if(reference_pipe.parent)
@@ -154,26 +154,26 @@
for(var/obj/machinery/atmospherics/pipe/reference_pipe in parent_pipeline.members)
reference_pipe.parent = src
air.merge(parent_pipeline.air)
for(var/obj/machinery/atmospherics/components/reference_component in parent_pipeline.other_atmosmch)
reference_component.replacePipenet(parent_pipeline, src)
other_atmosmch |= parent_pipeline.other_atmosmch
for(var/obj/machinery/atmospherics/components/reference_component in parent_pipeline.other_atmos_machines)
reference_component.replace_pipenet(parent_pipeline, src)
other_atmos_machines |= parent_pipeline.other_atmos_machines
other_airs |= parent_pipeline.other_airs
parent_pipeline.members.Cut()
parent_pipeline.other_atmosmch.Cut()
parent_pipeline.other_atmos_machines.Cut()
update = TRUE
qdel(parent_pipeline)
/obj/machinery/atmospherics/proc/addMember(obj/machinery/atmospherics/considered_device)
/obj/machinery/atmospherics/proc/add_member(obj/machinery/atmospherics/considered_device)
return
/obj/machinery/atmospherics/pipe/addMember(obj/machinery/atmospherics/considered_device)
parent.addMember(considered_device, src)
/obj/machinery/atmospherics/pipe/add_member(obj/machinery/atmospherics/considered_device)
parent.add_member(considered_device, src)
/obj/machinery/atmospherics/components/addMember(obj/machinery/atmospherics/considered_device)
var/datum/pipeline/device_pipeline = returnPipenet(considered_device)
/obj/machinery/atmospherics/components/add_member(obj/machinery/atmospherics/considered_device)
var/datum/pipeline/device_pipeline = return_pipenet(considered_device)
if(!device_pipeline)
CRASH("null.addMember() called by [type] on [COORD(src)]")
device_pipeline.addMember(considered_device, src)
CRASH("null.add_member() called by [type] on [COORD(src)]")
device_pipeline.add_member(considered_device, src)
/datum/pipeline/proc/temporarily_store_air()
@@ -232,11 +232,11 @@
continue
gas_mixture_list += pipeline.other_airs
gas_mixture_list += pipeline.air
for(var/obj/machinery/atmospherics/components/atmosmch as anything in pipeline.other_atmosmch)
if(!atmosmch.custom_reconcilation)
for(var/obj/machinery/atmospherics/components/atmos_machine as anything in pipeline.other_atmos_machines)
if(!atmos_machine.custom_reconcilation)
continue
pipeline_list |= atmosmch.returnPipenetsForReconcilation(src)
gas_mixture_list |= atmosmch.returnAirsForReconcilation(src)
pipeline_list |= atmos_machine.return_pipenets_for_reconcilation(src)
gas_mixture_list |= atmos_machine.return_airs_for_reconcilation(src)
var/total_thermal_energy = 0
var/total_heat_capacity = 0
@@ -10,11 +10,14 @@
active_power_usage = 4
max_integrity = 150
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 40, ACID = 0)
var/frequency = 0
var/atom/target
var/target_layer = PIPING_LAYER_DEFAULT
greyscale_config = /datum/greyscale_config/meter
greyscale_colors = COLOR_GRAY
///To connect to the ntnet
var/frequency = 0
///The pipe we are attaching to
var/atom/target
///The piping layer of the target
var/target_layer = PIPING_LAYER_DEFAULT
/obj/machinery/meter/atmos
frequency = FREQ_ATMOS_STORAGE
@@ -76,16 +79,16 @@
return FALSE
var/env_pressure = environment.return_pressure()
if(env_pressure <= 0.15*ONE_ATMOSPHERE)
if(env_pressure <= 0.15 * ONE_ATMOSPHERE)
icon_state = "meter0"
else if(env_pressure <= 1.8*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*0.3) + 0.5)
else if(env_pressure <= 1.8 * ONE_ATMOSPHERE)
var/val = round(env_pressure / (ONE_ATMOSPHERE * 0.3) + 0.5)
icon_state = "meter1_[val]"
else if(env_pressure <= 30*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*5)-0.35) + 1
else if(env_pressure <= 30 * ONE_ATMOSPHERE)
var/val = round(env_pressure / (ONE_ATMOSPHERE * 5) - 0.35) + 1
icon_state = "meter2_[val]"
else if(env_pressure <= 59*ONE_ATMOSPHERE)
var/val = round(env_pressure/(ONE_ATMOSPHERE*5) - 6) + 1
else if(env_pressure <= 59 * ONE_ATMOSPHERE)
var/val = round(env_pressure / (ONE_ATMOSPHERE * 5) - 6) + 1
icon_state = "meter3_[val]"
else
icon_state = "meter4"
@@ -139,10 +142,10 @@
. = ..()
. += status()
/obj/machinery/meter/wrench_act(mob/user, obj/item/I)
/obj/machinery/meter/wrench_act(mob/user, obj/item/wrench)
..()
to_chat(user, span_notice("You begin to unfasten \the [src]..."))
if (I.use_tool(src, user, 40, volume=50))
if (wrench.use_tool(src, user, 40, volume=50))
user.visible_message(
"[user] unfastens \the [src].",
span_notice("You unfasten \the [src]."),
@@ -13,7 +13,7 @@
construction_type = /obj/item/pipe/binary
pipe_state = "bridge_center"
/obj/machinery/atmospherics/pipe/bridge_pipe/SetInitDirections()
/obj/machinery/atmospherics/pipe/bridge_pipe/set_init_directions()
switch(dir)
if(NORTH, SOUTH)
initialize_directions = SOUTH|NORTH
@@ -16,13 +16,14 @@
paintable = FALSE
hide = FALSE
///cache for the icons
var/static/list/mutable_appearance/center_cache = list()
/obj/machinery/atmospherics/pipe/color_adapter/Initialize(mapload)
icon_state = ""
. = ..()
/obj/machinery/atmospherics/pipe/color_adapter/SetInitDirections()
/obj/machinery/atmospherics/pipe/color_adapter/set_init_directions()
switch(dir)
if(NORTH, SOUTH)
initialize_directions = SOUTH|NORTH
@@ -44,7 +45,7 @@
for(var/i in 1 to device_type)
if(!nodes[i])
continue
var/image/pipe = getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "pipe-3", get_dir(src, nodes[i]), nodes[i].pipe_color)
var/image/pipe = get_pipe_image('icons/obj/atmospherics/pipes/manifold.dmi', "pipe-3", get_dir(src, nodes[i]), nodes[i].pipe_color)
PIPING_LAYER_DOUBLE_SHIFT(pipe, piping_layer)
pipe.layer = layer + 0.01
. += pipe
@@ -13,7 +13,7 @@
add_atom_colour("#404040", FIXED_COLOUR_PRIORITY)
/obj/machinery/atmospherics/pipe/heat_exchanging/isConnectable(obj/machinery/atmospherics/pipe/heat_exchanging/target, given_layer, HE_type_check = TRUE)
/obj/machinery/atmospherics/pipe/heat_exchanging/is_connectable(obj/machinery/atmospherics/pipe/heat_exchanging/target, given_layer, HE_type_check = TRUE)
if(istype(target, /obj/machinery/atmospherics/pipe/heat_exchanging) != HE_type_check)
return FALSE
. = ..()
@@ -22,19 +22,19 @@
var/environment_temperature = 0
var/datum/gas_mixture/pipe_air = return_air()
var/turf/T = loc
if(istype(T))
if(islava(T))
var/turf/local_turf = loc
if(istype(local_turf))
if(islava(local_turf))
environment_temperature = 5000 //Yuck
else if(T.blocks_air)
environment_temperature = T.temperature
else if(local_turf.blocks_air)
environment_temperature = local_turf.temperature
else
var/turf/open/OT = T
environment_temperature = OT.GetTemperature()
var/turf/open/open_local = local_turf
environment_temperature = open_local.GetTemperature()
else
environment_temperature = T.temperature
environment_temperature = local_turf.temperature
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
parent.temperature_interact(T, volume, thermal_conductivity)
parent.temperature_interact(local_turf, volume, thermal_conductivity)
//heatup/cooldown any mobs buckled to ourselves based on our temperature
@@ -43,9 +43,8 @@
var/mob/living/heat_source = buckled_mobs[1]
//Best guess-estimate of the total bodytemperature of all the mobs, since they share the same environment it's ~ok~ to guess like this
var/avg_temp = (pipe_air.temperature * hc + (heat_source.bodytemperature * buckled_mobs.len) * 3500) / (hc + (buckled_mobs ? buckled_mobs.len * 3500 : 0))
for(var/m in buckled_mobs)
var/mob/living/L = m
L.bodytemperature = avg_temp
for(var/mob/living/buckled_mob as anything in buckled_mobs)
buckled_mob.bodytemperature = avg_temp
pipe_air.temperature = avg_temp
/obj/machinery/atmospherics/pipe/heat_exchanging/process(delta_time)
@@ -72,12 +71,12 @@
animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING)
//burn any mobs buckled based on temperature
if(has_buckled_mobs())
var/heat_limit = 1000
if(pipe_air.temperature > heat_limit + 1)
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.apply_damage(delta_time * 2 * log(pipe_air.temperature - heat_limit), BURN, BODY_ZONE_CHEST)
if(!has_buckled_mobs())
return
var/heat_limit = 1000
if(pipe_air.temperature > heat_limit + 1)
for(var/mob/living/buckled_mob as anything in buckled_mobs)
buckled_mob.apply_damage(delta_time * 2 * log(pipe_air.temperature - heat_limit), BURN, BODY_ZONE_CHEST)
/obj/machinery/atmospherics/pipe/heat_exchanging/update_pipe_icon()
return
@@ -15,17 +15,17 @@
construction_type = /obj/item/pipe/directional
pipe_state = "junction"
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/SetInitDirections()
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/set_init_directions()
switch(dir)
if(NORTH, SOUTH)
initialize_directions = SOUTH|NORTH
if(EAST, WEST)
initialize_directions = WEST|EAST
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/getNodeConnects()
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/get_node_connects()
return list(turn(dir, 180), dir)
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/isConnectable(obj/machinery/atmospherics/target, given_layer, he_type_check)
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/is_connectable(obj/machinery/atmospherics/target, given_layer, he_type_check)
if(dir == get_dir(target, src))
return ..(target, given_layer, FALSE) //we want a normal pipe instead
return ..(target, given_layer, TRUE)
@@ -15,7 +15,7 @@
construction_type = /obj/item/pipe/trinary
pipe_state = "he_manifold"
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/SetInitDirections()
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/set_init_directions()
initialize_directions = ALL_CARDINALS
initialize_directions &= ~dir
@@ -27,7 +27,7 @@
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
. += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
. += get_pipe_image(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/layer2
piping_layer = 2
@@ -14,7 +14,7 @@
construction_type = /obj/item/pipe/quaternary
pipe_state = "he_manifold4w"
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/SetInitDirections()
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/set_init_directions()
initialize_directions = initial(initialize_directions)
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/update_overlays()
@@ -26,7 +26,7 @@
//Add non-broken pieces
for(var/i in 1 to device_type)
if(nodes[i])
. += getpipeimage(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
. += get_pipe_image(icon, "pipe-[piping_layer]", get_dir(src, nodes[i]))
update_layer()
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold4w/layer2
@@ -14,7 +14,7 @@
construction_type = /obj/item/pipe/binary/bendable
pipe_state = "he"
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/SetInitDirections()
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/set_init_directions()
if(ISDIAGONALDIR(dir))
initialize_directions = dir
return
@@ -13,7 +13,9 @@
pipe_state = "manifoldlayer"
paintable = TRUE
///Reference to all the nodes in the front
var/list/front_nodes
///Reference to all the nodes in the back
var/list/back_nodes
/obj/machinery/atmospherics/pipe/layer_manifold/Initialize(mapload)
@@ -23,16 +25,16 @@
return ..()
/obj/machinery/atmospherics/pipe/layer_manifold/Destroy()
nullifyAllNodes()
nullify_all_nodes()
return ..()
/obj/machinery/atmospherics/pipe/layer_manifold/update_pipe_icon()
return
/obj/machinery/atmospherics/pipe/layer_manifold/proc/nullifyAllNodes()
for(var/obj/machinery/atmospherics/A in nodes)
A.disconnect(src)
SSair.add_to_rebuild_queue(A)
/obj/machinery/atmospherics/pipe/layer_manifold/proc/nullify_all_nodes()
for(var/obj/machinery/atmospherics/node in nodes)
node.disconnect(src)
SSair.add_to_rebuild_queue(node)
front_nodes = null
back_nodes = null
nodes = list()
@@ -52,37 +54,37 @@
if(length(back_images))
. += back_images
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_attached_images(obj/machinery/atmospherics/A)
if(!A)
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_attached_images(obj/machinery/atmospherics/machine_check)
if(!machine_check)
return
. = list()
if(istype(A, /obj/machinery/atmospherics/pipe/layer_manifold))
if(istype(machine_check, /obj/machinery/atmospherics/pipe/layer_manifold))
for(var/i in PIPING_LAYER_MIN to PIPING_LAYER_MAX)
. += get_attached_image(get_dir(src, A), i, COLOR_VERY_LIGHT_GRAY)
. += get_attached_image(get_dir(src, machine_check), i, COLOR_VERY_LIGHT_GRAY)
return
. += get_attached_image(get_dir(src, A), A.piping_layer, A.pipe_color)
. += get_attached_image(get_dir(src, machine_check), machine_check.piping_layer, machine_check.pipe_color)
/obj/machinery/atmospherics/pipe/layer_manifold/proc/get_attached_image(p_dir, p_layer, p_color)
var/mutable_appearance/muta = mutable_appearance('icons/obj/atmospherics/pipes/layer_manifold_underlays.dmi', "intact_[p_dir]_[p_layer]", layer = layer - 0.01, appearance_flags = RESET_COLOR)
muta.color = p_color
return muta
/obj/machinery/atmospherics/pipe/layer_manifold/SetInitDirections()
/obj/machinery/atmospherics/pipe/layer_manifold/set_init_directions()
switch(dir)
if(NORTH, SOUTH)
initialize_directions = NORTH|SOUTH
if(EAST, WEST)
initialize_directions = EAST|WEST
/obj/machinery/atmospherics/pipe/layer_manifold/proc/findAllConnections()
/obj/machinery/atmospherics/pipe/layer_manifold/proc/find_all_connections()
front_nodes = list()
back_nodes = list()
nodes = list()
for(var/iter in PIPING_LAYER_MIN to PIPING_LAYER_MAX)
var/obj/machinery/atmospherics/foundfront = findConnecting(dir, iter)
var/obj/machinery/atmospherics/foundback = findConnecting(turn(dir, 180), iter)
var/obj/machinery/atmospherics/foundfront = find_connecting(dir, iter)
var/obj/machinery/atmospherics/foundback = find_connecting(turn(dir, 180), iter)
front_nodes += foundfront
back_nodes += foundback
if(foundfront && !QDELETED(foundfront))
@@ -92,11 +94,11 @@
update_appearance()
return nodes
/obj/machinery/atmospherics/pipe/layer_manifold/atmosinit()
/obj/machinery/atmospherics/pipe/layer_manifold/atmos_init()
normalize_cardinal_directions()
findAllConnections()
find_all_connections()
/obj/machinery/atmospherics/pipe/layer_manifold/setPipingLayer()
/obj/machinery/atmospherics/pipe/layer_manifold/set_piping_layer()
piping_layer = PIPING_LAYER_DEFAULT
/obj/machinery/atmospherics/pipe/layer_manifold/pipeline_expansion()
@@ -104,8 +106,8 @@
/obj/machinery/atmospherics/pipe/layer_manifold/disconnect(obj/machinery/atmospherics/reference)
if(istype(reference, /obj/machinery/atmospherics/pipe))
var/obj/machinery/atmospherics/pipe/P = reference
P.destroy_network()
var/obj/machinery/atmospherics/pipe/pipe_reference = reference
pipe_reference.destroy_network()
while(reference in nodes)
var/i = nodes.Find(reference)
nodes[i] = null
@@ -15,8 +15,11 @@
construction_type = /obj/item/pipe/directional
pipe_state = "multiz"
///Our central icon
var/mutable_appearance/center = null
///The pipe icon
var/mutable_appearance/pipe = null
///Reference to the node
var/obj/machinery/atmospherics/front_node = null
/* We use New() instead of Initialize() because these values are used in update_icon()
@@ -29,7 +32,7 @@
pipe = mutable_appearance(icon, "pipe-[piping_layer]")
return ..()
/obj/machinery/atmospherics/pipe/multiz/SetInitDirections()
/obj/machinery/atmospherics/pipe/multiz/set_init_directions()
initialize_directions = dir
/obj/machinery/atmospherics/pipe/multiz/update_layer()
@@ -45,12 +48,14 @@
///Attempts to locate a multiz pipe that's above us, if it finds one it merges us into its pipenet
/obj/machinery/atmospherics/pipe/multiz/pipeline_expansion()
var/turf/T = get_turf(src)
for(var/obj/machinery/atmospherics/pipe/multiz/above in SSmapping.get_turf_above(T))
if(isConnectable(above, piping_layer))
nodes += above
above.nodes += src //Two way travel :)
for(var/obj/machinery/atmospherics/pipe/multiz/below in SSmapping.get_turf_below(T))
if(isConnectable(below, piping_layer))
below.pipeline_expansion() //If we've got one below us, force it to add us on facebook
var/turf/local_turf = get_turf(src)
for(var/obj/machinery/atmospherics/pipe/multiz/above in SSmapping.get_turf_above(local_turf))
if(!is_connectable(above, piping_layer))
continue
nodes += above
above.nodes += src //Two way travel :)
for(var/obj/machinery/atmospherics/pipe/multiz/below in SSmapping.get_turf_below(local_turf))
if(!is_connectable(below, piping_layer))
continue
below.pipeline_expansion() //If we've got one below us, force it to add us on facebook
return ..()
@@ -20,7 +20,7 @@
/obj/machinery/atmospherics/pipe/New()
add_atom_colour(pipe_color, FIXED_COLOUR_PRIORITY)
volume = 35 * device_type
..()
. = ..()
///I have no idea why there's a new and at this point I'm too afraid to ask
/obj/machinery/atmospherics/pipe/Initialize(mapload)
@@ -29,11 +29,11 @@
if(hide)
AddElement(/datum/element/undertile, TRAIT_T_RAY_VISIBLE) //if changing this, change the subtypes RemoveElements too, because thats how bespoke works
/obj/machinery/atmospherics/pipe/nullifyNode(i)
var/obj/machinery/atmospherics/oldN = nodes[i]
..()
if(oldN)
SSair.add_to_rebuild_queue(oldN)
/obj/machinery/atmospherics/pipe/nullify_node(i)
var/obj/machinery/atmospherics/old_node = nodes[i]
. = ..()
if(old_node)
SSair.add_to_rebuild_queue(old_node)
/obj/machinery/atmospherics/pipe/destroy_network()
QDEL_NULL(parent)
@@ -64,32 +64,33 @@
return air_temporary.remove(amount)
return parent.air.remove(amount)
/obj/machinery/atmospherics/pipe/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pipe_meter))
var/obj/item/pipe_meter/meter = W
/obj/machinery/atmospherics/pipe/attackby(obj/item/item, mob/user, params)
if(istype(item, /obj/item/pipe_meter))
var/obj/item/pipe_meter/meter = item
user.dropItemToGround(meter)
meter.setAttachLayer(piping_layer)
else
return ..()
/obj/machinery/atmospherics/pipe/returnPipenet()
/obj/machinery/atmospherics/pipe/return_pipenet()
return parent
/obj/machinery/atmospherics/pipe/setPipenet(datum/pipeline/P)
parent = P
/obj/machinery/atmospherics/pipe/set_pipenet(datum/pipeline/pipenet_to_set)
parent = pipenet_to_set
/obj/machinery/atmospherics/pipe/Destroy()
QDEL_NULL(parent)
releaseAirToTurf()
var/turf/T = loc
for(var/obj/machinery/meter/meter in T)
if(meter.target == src)
var/obj/item/pipe_meter/PM = new (T)
meter.transfer_fingerprints_to(PM)
qdel(meter)
. = ..()
var/turf/local_turf = loc
for(var/obj/machinery/meter/meter in local_turf)
if(meter.target != src)
continue
var/obj/item/pipe_meter/meter_object = new (local_turf)
meter.transfer_fingerprints_to(meter_object)
qdel(meter)
return ..()
/obj/machinery/atmospherics/pipe/proc/update_pipe_icon()
icon = 'icons/obj/atmospherics/pipes/pipes_bitmask.dmi'
@@ -112,11 +113,12 @@
/obj/machinery/atmospherics/proc/update_node_icon()
for(var/i in 1 to device_type)
if(nodes[i])
var/obj/machinery/atmospherics/N = nodes[i]
N.update_icon()
if(!nodes[i])
continue
var/obj/machinery/atmospherics/current_node = nodes[i]
current_node.update_icon()
/obj/machinery/atmospherics/pipe/returnPipenets()
/obj/machinery/atmospherics/pipe/return_pipenets()
. = list(parent)
/obj/machinery/atmospherics/pipe/paint(paint_color)
@@ -10,6 +10,7 @@ GLOBAL_LIST_INIT(atmos_components, typecacheof(list(/obj/machinery/atmospherics)
device_type = QUATERNARY
construction_type = /obj/item/pipe/quaternary
pipe_state = "manifold4w"
///Current active connections
var/connections = NONE
/obj/machinery/atmospherics/pipe/smart/update_pipe_icon()
@@ -46,7 +47,7 @@ GLOBAL_LIST_INIT(atmos_components, typecacheof(list(/obj/machinery/atmospherics)
icon_state = "[bitfield]_[piping_layer]"
/obj/machinery/atmospherics/pipe/smart/SetInitDirections(init_dir)
/obj/machinery/atmospherics/pipe/smart/set_init_directions(init_dir)
if(init_dir)
initialize_directions = init_dir
else
@@ -37,8 +37,8 @@
if(severity == EXPLODE_DEVASTATE || target == src)
//This explosion will destroy the can, release its air.
var/turf/T = get_turf(src)
T.assume_air(air_contents)
var/turf/local_turf = get_turf(src)
local_turf.assume_air(air_contents)
return ..()
@@ -141,26 +141,26 @@
update_appearance()
return TRUE
/obj/machinery/portable_atmospherics/attackby(obj/item/W, mob/user, params)
if(!istype(W, /obj/item/tank))
/obj/machinery/portable_atmospherics/attackby(obj/item/item, mob/user, params)
if(!istype(item, /obj/item/tank))
return ..()
if(machine_stat & BROKEN)
return FALSE
var/obj/item/tank/T = W
if(!user.transferItemToLoc(T, src))
var/obj/item/tank/insert_tank = item
if(!user.transferItemToLoc(insert_tank, src))
return FALSE
to_chat(user, span_notice("[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [T]" : "You insert [T] into [src]"]."))
investigate_log("had its internal [holding] swapped with [T] by [key_name(user)].", INVESTIGATE_ATMOS)
replace_tank(user, FALSE, T)
to_chat(user, span_notice("[holding ? "In one smooth motion you pop [holding] out of [src]'s connector and replace it with [insert_tank]" : "You insert [insert_tank] into [src]"]."))
investigate_log("had its internal [holding] swapped with [insert_tank] by [key_name(user)].", INVESTIGATE_ATMOS)
replace_tank(user, FALSE, insert_tank)
update_appearance()
/obj/machinery/portable_atmospherics/wrench_act(mob/living/user, obj/item/W)
/obj/machinery/portable_atmospherics/wrench_act(mob/living/user, obj/item/wrench)
if(machine_stat & BROKEN)
return FALSE
if(connected_port)
investigate_log("was disconnected from [connected_port] by [key_name(user)].", INVESTIGATE_ATMOS)
disconnect()
W.play_tool_sound(src)
wrench.play_tool_sound(src)
user.visible_message( \
"[user] disconnects [src].", \
span_notice("You unfasten [src] from the port."), \
@@ -174,7 +174,7 @@
if(!connect(possible_port))
to_chat(user, span_notice("[name] failed to connect to the port."))
return FALSE
W.play_tool_sound(src)
wrench.play_tool_sound(src)
user.visible_message( \
"[user] connects [src].", \
span_notice("You fasten [src] to the port."), \
@@ -183,13 +183,13 @@
investigate_log("was connected to [possible_port] by [key_name(user)].", INVESTIGATE_ATMOS)
return TRUE
/obj/machinery/portable_atmospherics/attacked_by(obj/item/I, mob/user)
if(I.force < 10 && !(machine_stat & BROKEN))
/obj/machinery/portable_atmospherics/attacked_by(obj/item/item, mob/user)
if(item.force < 10 && !(machine_stat & BROKEN))
take_damage(0)
else
investigate_log("was smacked with \a [I] by [key_name(user)].", INVESTIGATE_ATMOS)
add_fingerprint(user)
..()
return
investigate_log("was smacked with \a [item] by [key_name(user)].", INVESTIGATE_ATMOS)
add_fingerprint(user)
return ..()
/obj/machinery/portable_atmospherics/rad_act(strength)
. = ..()
@@ -28,8 +28,8 @@
volume = 1000
/obj/machinery/portable_atmospherics/pump/Destroy()
var/turf/T = get_turf(src)
T.assume_air(air_contents)
var/turf/local_turf = get_turf(src)
local_turf.assume_air(air_contents)
return ..()
/obj/machinery/portable_atmospherics/pump/update_icon_state()
@@ -57,14 +57,14 @@
excited = TRUE
var/turf/T = get_turf(src)
var/turf/local_turf = get_turf(src)
var/datum/gas_mixture/sending
var/datum/gas_mixture/receiving
if(direction == PUMP_OUT) // Hook up the internal pump.
sending = (holding ? holding.return_air() : air_contents)
receiving = (holding ? air_contents : T.return_air())
receiving = (holding ? air_contents : local_turf.return_air())
else
sending = (holding ? air_contents : T.return_air())
sending = (holding ? air_contents : local_turf.return_air())
receiving = (holding ? holding.return_air() : air_contents)
if(sending.pump_gas_to(receiving, target_pressure) && !holding)
@@ -205,7 +205,7 @@
if(!holding)
var/turf/T = get_turf(src)
for(var/turf/AT in T.GetAtmosAdjacentTurfs(alldir = TRUE))
for(var/turf/AT in T.get_atmos_adjacent_turfs(alldir = TRUE))
scrub(AT.return_air())
return ..()
@@ -148,7 +148,7 @@
if(!connection_images[smart])
connection_images[smart] = list()
for(var/direction in GLOB.cardinals)
if(!(smart.GetInitDirections() & direction))
if(!(smart.get_init_directions() & direction))
continue
if(!connection_images[smart][dir2text(direction)])
var/image/arrow
+1 -1
View File
@@ -53,7 +53,7 @@
continue//no parent vent
//Stops Aliens getting stuck in small networks.
//See: Security, Virology
if(temp_vent_parent.other_atmosmch.len > 20)
if(temp_vent_parent.other_atmos_machines.len > 20)
vents += temp_vent
if(!vents.len)
@@ -229,7 +229,7 @@
density = TRUE
var/buildstacktype = /obj/item/stack/sheet/iron
var/buildstackamount = 5
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
/obj/structure/fans/deconstruct()
if(!(flags_1 & NODECONSTRUCT_1))
@@ -459,7 +459,7 @@ Pass the desired type path itself, declaring a temporary var beforehand is not r
var/turf/T = get_turf(src)
if(!T)
return
var/list/adjacent = T.GetAtmosAdjacentTurfs(1)
var/list/adjacent = T.get_atmos_adjacent_turfs(1)
if(shuffle) //If we were on the same tile as another bot, let's randomize our choices so we dont both go the same way
adjacent = shuffle(adjacent)
shuffle = FALSE
@@ -474,7 +474,7 @@
anchored = TRUE
opacity = FALSE
density = TRUE
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
duration = 82
color = COLOR_DARK_ORANGE
@@ -52,7 +52,7 @@
. = ..()
if(banana_time && banana_time < world.time)
var/turf/T = get_turf(src)
var/list/adjacent = T.GetAtmosAdjacentTurfs(1)
var/list/adjacent = T.get_atmos_adjacent_turfs(1)
new banana_type(pick(adjacent))
banana_time = world.time + rand(30,60)
+3 -3
View File
@@ -47,7 +47,7 @@
//Entrance here
else
var/datum/pipeline/vent_parent = ventcrawl_target.parents[1]
if(vent_parent && (vent_parent.members.len || vent_parent.other_atmosmch))
if(vent_parent && (vent_parent.members.len || vent_parent.other_atmos_machines))
visible_message(span_notice("[src] begins climbing into the ventilation system...") ,span_notice("You begin climbing into the ventilation system..."))
if(!do_after(src, 2.5 SECONDS, target = ventcrawl_target))
return
@@ -92,9 +92,9 @@
if(HAS_TRAIT(src, TRAIT_MOVE_VENTCRAWLING) && istype(loc, /obj/machinery/atmospherics) && movement_type & VENTCRAWLING)
var/list/total_members = list()
var/obj/machinery/atmospherics/current_location = loc
for(var/datum/pipeline/location_pipeline in current_location.returnPipenets())
for(var/datum/pipeline/location_pipeline in current_location.return_pipenets())
total_members += location_pipeline.members
total_members += location_pipeline.other_atmosmch
total_members += location_pipeline.other_atmos_machines
if(!total_members.len)
return
@@ -11,7 +11,7 @@
use_power = NO_POWER_USE
interaction_flags_atom = NONE
interaction_flags_machine = NONE
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
light_range = 4
layer = ABOVE_OBJ_LAYER
///First of the generators producing the containment field
@@ -35,7 +35,7 @@
if(field_gen_2)
field_gen_2.fields -= src
field_gen_2 = null
CanAtmosPass = ATMOS_PASS_YES
can_atmos_pass = ATMOS_PASS_YES
air_update_turf(TRUE, FALSE)
return ..()
@@ -32,7 +32,7 @@ no power level overlay is currently in the overlays list.
density = TRUE
use_power = NO_POWER_USE
max_integrity = 500
CanAtmosPass = ATMOS_PASS_YES
can_atmos_pass = ATMOS_PASS_YES
//100% immune to lasers and energy projectiles since it absorbs their energy.
armor = list(MELEE = 25, BULLET = 10, LASER = 100, ENERGY = 100, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 70)
///Amount of energy stored, used for visual overlays (over 9000?)
@@ -199,7 +199,7 @@ no power level overlay is currently in the overlays list.
/obj/machinery/field/generator/proc/turn_off()
active = FG_OFFLINE
CanAtmosPass = ATMOS_PASS_YES
can_atmos_pass = ATMOS_PASS_YES
air_update_turf(TRUE, FALSE)
INVOKE_ASYNC(src, .proc/cleanup)
addtimer(CALLBACK(src, .proc/cool_down), 5 SECONDS)
@@ -275,7 +275,7 @@ no power level overlay is currently in the overlays list.
turn_off()
return
move_resist = INFINITY
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
air_update_turf(TRUE, TRUE)
addtimer(CALLBACK(src, .proc/setup_field, 1), 1)
addtimer(CALLBACK(src, .proc/setup_field, 2), 2)
+2 -2
View File
@@ -29,7 +29,7 @@
icon_state = "compressor"
density = TRUE
resistance_flags = FIRE_PROOF
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
circuit = /obj/item/circuitboard/machine/power_compressor
var/obj/machinery/power/turbine/turbine
var/datum/gas_mixture/gas_contained
@@ -54,7 +54,7 @@
icon_state = "turbine"
density = TRUE
resistance_flags = FIRE_PROOF
CanAtmosPass = ATMOS_PASS_DENSITY
can_atmos_pass = ATMOS_PASS_DENSITY
circuit = /obj/item/circuitboard/machine/power_turbine
var/opened = 0
var/obj/machinery/power/compressor/compressor
+1 -1
View File
@@ -48,7 +48,7 @@
for(var/turf/T in turflist)
if(accessible[T])
continue
for(var/thing in T.GetAtmosAdjacentTurfs(alldir = TRUE))
for(var/thing in T.get_atmos_adjacent_turfs(alldir = TRUE))
var/turf/NT = thing
if(!(NT in accessible))
continue
@@ -132,7 +132,7 @@ Slimecrossing Items
desc = "A mass of solidified slime gel - completely impenetrable, but it's melting away!"
icon = 'icons/obj/slimecrossing.dmi'
icon_state = "slimebarrier_thick"
CanAtmosPass = ATMOS_PASS_NO
can_atmos_pass = ATMOS_PASS_NO
opacity = TRUE
timeleft = 100
+6 -6
View File
@@ -243,20 +243,20 @@ All ShuttleMove procs go here
break
if(!connected)
nullifyNode(i)
nullify_node(i)
if(!nodes[i])
missing_nodes = TRUE
if(missing_nodes)
atmosinit()
atmos_init()
for(var/obj/machinery/atmospherics/A in pipeline_expansion())
A.atmosinit()
if(A.returnPipenet())
A.addMember(src)
A.atmos_init()
if(A.return_pipenet())
A.add_member(src)
SSair.add_to_rebuild_queue(src)
else
// atmosinit() calls update_appearance(), so we don't need to call it
// atmos_init() calls update_appearance(), so we don't need to call it
update_appearance()
/obj/machinery/navbeacon/beforeShuttleMove(turf/newT, rotation, move_mode, obj/docking_port/mobile/moving_dock)
+3 -3
View File
@@ -80,13 +80,13 @@ If ever any of these procs are useful for non-shuttles, rename it to proc/rotate
/************************************Machine rotate procs************************************/
/obj/machinery/atmospherics/shuttleRotate(rotation, params)
var/list/real_node_connect = getNodeConnects()
var/list/real_node_connect = get_node_connects()
for(var/i in 1 to device_type)
real_node_connect[i] = angle2dir(rotation+dir2angle(real_node_connect[i]))
. = ..()
SetInitDirections()
var/list/supposed_node_connect = getNodeConnects()
set_init_directions()
var/list/supposed_node_connect = get_node_connects()
var/list/nodes_copy = nodes.Copy()
for(var/i in 1 to device_type)
@@ -67,7 +67,7 @@
var/obj/machinery/atmospherics/pipeyoudiein = M.loc
var/datum/pipeline/ourpipeline
var/pipenets = pipeyoudiein.returnPipenets()
var/pipenets = pipeyoudiein.return_pipenets()
if(islist(pipenets))
ourpipeline = pipenets[1]
else