mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
[READY] Atmos Refactor Part 7 (I think) - Kills signals + TGUIs stuff (#19867)
* I AM NOT A KING. I AM NOT A GOD. I AM LUNACY. * THE SCOPE CREEP * This was done in vi. No langserver. Send help. * Progress * Some issues fixed * The code builds, but the maps dont * CC builds, I doubt anything else does * Do this now * Safety * The map compiles * THE MAPPING HELL * Airlock controllers dont work * Fixed bombs * AND THATS FIXED * Phantom edit * Restores LL I think * The mapmerge hooks are actually retarded * Fixes spawners * Half working air control * Picky * Hyper efficient tank monitor * Sanity * Laying the framework * Improved alert console * Dont think this is actually done anywhere * Metering * ONE HUNDRED AND ~~EIGHTY~~ TWENTY SEVEN * WE ARE READY FOR BOX TO BUILD * One map done * Well that was easy * Another one * I think this is done * I should have removed this * I would make a russian joke but <current event> * Delta WIP * Makes delta work * Early review * TM safeguard * oops * METAAAAAAAAAAAAAAAAAAAAAAAAA * Fix #4213 * Trailing * oh for piss sake * Shutter fix * Roundstart ATs can go away * Review pass 1 * What could go wrong * BOOM BOOM BOOM * Not needed * Fix seed vault * Oops * Review changes
This commit is contained in:
+7768
-7947
File diff suppressed because it is too large
Load Diff
+2405
-2536
File diff suppressed because it is too large
Load Diff
@@ -7,8 +7,7 @@
|
||||
/area/lavaland/surface/outdoors)
|
||||
"c" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1385;
|
||||
id_tag = "seed_vault_inner";
|
||||
id_tag = "seedvault_door_int";
|
||||
locked = 1
|
||||
},
|
||||
/obj/structure/fans/tiny,
|
||||
@@ -74,12 +73,12 @@
|
||||
/turf/simulated/floor/plasteel/freezer,
|
||||
/area/ruin/powered/seedvault)
|
||||
"m" = (
|
||||
/obj/machinery/embedded_controller/radio/airlock/access_controller{
|
||||
frequency = 1385;
|
||||
id_tag = "seed_vault";
|
||||
pixel_y = 25;
|
||||
tag_exterior_door = "seed_vault_outer";
|
||||
tag_interior_door = "seed_vault_inner"
|
||||
/obj/machinery/airlock_controller/access_controller{
|
||||
ext_button_link_id = "seedvault_btn_ext";
|
||||
ext_door_link_id = "seedvault_door_ext";
|
||||
int_button_link_id = "seedvault_btn_int";
|
||||
int_door_link_id = "seedvault_door_int";
|
||||
pixel_y = 25
|
||||
},
|
||||
/turf/simulated/floor/plasteel/freezer,
|
||||
/area/ruin/powered/seedvault)
|
||||
@@ -169,19 +168,9 @@
|
||||
},
|
||||
/turf/simulated/floor/plasteel/freezer,
|
||||
/area/ruin/powered/seedvault)
|
||||
"z" = (
|
||||
/obj/structure/fans/tiny,
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1385;
|
||||
id_tag = "seed_vault_outer";
|
||||
locked = 1
|
||||
},
|
||||
/turf/simulated/floor/plasteel/freezer,
|
||||
/area/ruin/powered/seedvault)
|
||||
"A" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1385;
|
||||
id_tag = "seed_vault_outer";
|
||||
id_tag = "seedvault_door_ext";
|
||||
locked = 1
|
||||
},
|
||||
/obj/structure/fans/tiny,
|
||||
@@ -239,13 +228,10 @@
|
||||
/area/ruin/powered/seedvault)
|
||||
"L" = (
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_interior";
|
||||
frequency = 1385;
|
||||
master_tag = "seed_vault";
|
||||
name = "interior access button";
|
||||
autolink_id = "seedvault_btn_int";
|
||||
name = "exterior access button";
|
||||
pixel_x = 25;
|
||||
pixel_y = -25;
|
||||
req_access_txt = null
|
||||
pixel_y = -25
|
||||
},
|
||||
/turf/simulated/floor/plasteel/freezer,
|
||||
/area/ruin/powered/seedvault)
|
||||
@@ -293,13 +279,10 @@
|
||||
/area/ruin/powered/seedvault)
|
||||
"T" = (
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_exterior";
|
||||
frequency = 1385;
|
||||
master_tag = "seed_vault";
|
||||
autolink_id = "seedvault_btn_ext";
|
||||
name = "exterior access button";
|
||||
pixel_x = -25;
|
||||
pixel_y = -25;
|
||||
req_access_txt = null
|
||||
pixel_y = -25
|
||||
},
|
||||
/turf/simulated/floor/plating/asteroid/basalt/lava_land_surface,
|
||||
/area/lavaland/surface/outdoors)
|
||||
@@ -687,7 +670,7 @@ a
|
||||
a
|
||||
Q
|
||||
A
|
||||
z
|
||||
A
|
||||
Q
|
||||
b
|
||||
b
|
||||
|
||||
@@ -698,9 +698,7 @@
|
||||
dir = 6
|
||||
},
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_interior";
|
||||
frequency = 1479;
|
||||
master_tag = "dj_station_airlock";
|
||||
autolink_id = "djstation_btn_int";
|
||||
name = "interior access button";
|
||||
pixel_x = 25;
|
||||
pixel_y = -25
|
||||
@@ -770,9 +768,8 @@
|
||||
/area/ruin/space/djstation)
|
||||
"bU" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1479;
|
||||
icon_state = "door_locked";
|
||||
id_tag = "dj_station_inner";
|
||||
id_tag = "djstation_door_int";
|
||||
locked = 1;
|
||||
name = "DJ Station Interior Access"
|
||||
},
|
||||
@@ -782,23 +779,15 @@
|
||||
"bV" = (
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume{
|
||||
dir = 1;
|
||||
frequency = 1479;
|
||||
id_tag = "dj_station_pump"
|
||||
autolink_id = "djstation_vent"
|
||||
},
|
||||
/obj/machinery/airlock_sensor{
|
||||
frequency = 1479;
|
||||
id_tag = "dj_station_sensor";
|
||||
pixel_x = 25;
|
||||
pixel_y = -5
|
||||
},
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller{
|
||||
frequency = 1479;
|
||||
id_tag = "dj_station_airlock";
|
||||
/obj/machinery/airlock_controller/air_cycler{
|
||||
ext_button_link_id = "djstation_btn_ext";
|
||||
ext_door_link_id = "djstation_door_ext";
|
||||
int_button_link_id = "djstation_btn_int";
|
||||
int_door_link_id = "djstation_door_int";
|
||||
pixel_x = -25;
|
||||
tag_airpump = "dj_station_pump";
|
||||
tag_chamber_sensor = "dj_station_sensor";
|
||||
tag_exterior_door = "dj_station_outer";
|
||||
tag_interior_door = "dj_station_inner"
|
||||
vent_link_id = "djstation_vent"
|
||||
},
|
||||
/obj/machinery/light/small{
|
||||
dir = 4
|
||||
@@ -807,9 +796,8 @@
|
||||
/area/ruin/space/djstation)
|
||||
"bW" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1479;
|
||||
icon_state = "door_locked";
|
||||
id_tag = "dj_station_outer";
|
||||
id_tag = "djstation_door_ext";
|
||||
locked = 1;
|
||||
name = "DJ Station External Access"
|
||||
},
|
||||
@@ -820,9 +808,7 @@
|
||||
/area/ruin/space/djstation)
|
||||
"bY" = (
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_exterior";
|
||||
frequency = 1479;
|
||||
master_tag = "dj_station_airlock";
|
||||
autolink_id = "djstation_btn_ext";
|
||||
name = "exterior access button";
|
||||
pixel_x = 23;
|
||||
pixel_y = 35
|
||||
|
||||
@@ -892,9 +892,7 @@
|
||||
"bK" = (
|
||||
/obj/structure/alien/weeds,
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/on{
|
||||
dir = 8;
|
||||
frequency = 1441;
|
||||
id = "waste_in"
|
||||
dir = 8
|
||||
},
|
||||
/turf/simulated/floor/engine,
|
||||
/area/ruin/space/unpowered)
|
||||
|
||||
@@ -805,7 +805,9 @@
|
||||
/turf/template_noop,
|
||||
/area/template_noop)
|
||||
"id" = (
|
||||
/obj/machinery/atmospherics/unary/passive_vent,
|
||||
/obj/machinery/atmospherics/unary/vent_pump{
|
||||
autolink_id = "syndiebase_mix_out"
|
||||
},
|
||||
/turf/simulated/floor/engine/vacuum,
|
||||
/area/ruin/unpowered/syndicate_space_base/engineering)
|
||||
"ii" = (
|
||||
@@ -3780,7 +3782,9 @@
|
||||
},
|
||||
/area/ruin/unpowered/syndicate_space_base/chemistry)
|
||||
"NE" = (
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/on,
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/on{
|
||||
autolink_id = "syndiebase_mix_in"
|
||||
},
|
||||
/turf/simulated/floor/engine/vacuum,
|
||||
/area/ruin/unpowered/syndicate_space_base/engineering)
|
||||
"NN" = (
|
||||
@@ -4274,6 +4278,9 @@
|
||||
},
|
||||
/area/ruin/unpowered/syndicate_space_base/arrivals)
|
||||
"Tv" = (
|
||||
/obj/machinery/atmospherics/air_sensor{
|
||||
autolink_id = "syndiebase_mix_sensor"
|
||||
},
|
||||
/turf/simulated/floor/engine/vacuum,
|
||||
/area/ruin/unpowered/syndicate_space_base/engineering)
|
||||
"Tw" = (
|
||||
@@ -4724,12 +4731,12 @@
|
||||
},
|
||||
/area/ruin/unpowered/syndicate_space_base/bar)
|
||||
"Zo" = (
|
||||
/obj/machinery/computer/general_air_control{
|
||||
frequency = 1222;
|
||||
name = "Bomb Mix Monitor";
|
||||
sensors = list("burn_sensor"="Burn Mix")
|
||||
},
|
||||
/obj/effect/decal/warning_stripes/north,
|
||||
/obj/machinery/computer/general_air_control/large_tank_control{
|
||||
inlet_injector_autolink_id = "syndiebase_mix_in";
|
||||
outlet_vent_autolink_id = "syndiebase_mix_out";
|
||||
autolink_sensors = list("syndiebase_mix_sensor" = "Burn Mix")
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/ruin/unpowered/syndicate_space_base/engineering)
|
||||
"Zy" = (
|
||||
|
||||
@@ -4265,8 +4265,7 @@
|
||||
/area/ruin/space/derelict/crew_quarters)
|
||||
"jK" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1502;
|
||||
id_tag = "rus_inner_2";
|
||||
id_tag = "rus2_door_int";
|
||||
name = "External Airlock"
|
||||
},
|
||||
/obj/structure/cable{
|
||||
@@ -4287,9 +4286,8 @@
|
||||
},
|
||||
/obj/machinery/light/small,
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume{
|
||||
dir = 8;
|
||||
frequency = 1502;
|
||||
id_tag = "rus_pump_2"
|
||||
autolink_id = "rus2_vent";
|
||||
dir = 8
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/ruin/space/derelict/crew_quarters)
|
||||
@@ -4300,8 +4298,7 @@
|
||||
icon_state = "4-8"
|
||||
},
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1502;
|
||||
id_tag = "rus_outer_2";
|
||||
id_tag = "rus2_door_ext";
|
||||
locked = 1;
|
||||
name = "External Airlock"
|
||||
},
|
||||
@@ -4847,9 +4844,7 @@
|
||||
dir = 8
|
||||
},
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_exterior";
|
||||
frequency = 1502;
|
||||
master_tag = "rus_airlock_2";
|
||||
autolink_id = "rus2_btn_ext";
|
||||
name = "exterior access button";
|
||||
pixel_x = -25
|
||||
},
|
||||
@@ -5115,8 +5110,7 @@
|
||||
dir = 4
|
||||
},
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1502;
|
||||
id_tag = "rus_inner_2";
|
||||
id_tag = "rus2_door_int";
|
||||
name = "External Airlock"
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
@@ -5130,31 +5124,23 @@
|
||||
/obj/machinery/light/small{
|
||||
dir = 1
|
||||
},
|
||||
/obj/machinery/airlock_sensor{
|
||||
frequency = 1502;
|
||||
id_tag = "rus_sensor_2";
|
||||
pixel_y = 27
|
||||
},
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller{
|
||||
frequency = 1502;
|
||||
id_tag = "rus_airlock_2";
|
||||
/obj/machinery/airlock_controller/air_cycler{
|
||||
ext_door_link_id = "rus2_door_ext";
|
||||
ext_button_link_id = "rus2_btn_ext";
|
||||
int_door_link_id = "rus2_door_int";
|
||||
int_button_link_id = "rus2_btn_int";
|
||||
pixel_y = -25;
|
||||
tag_airpump = "rus_pump_2";
|
||||
tag_chamber_sensor = "rus_sensor_2";
|
||||
tag_exterior_door = "rus_outer_2";
|
||||
tag_interior_door = "rus_inner_2"
|
||||
vent_link_id = "rus2_vent"
|
||||
},
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume{
|
||||
dir = 8;
|
||||
frequency = 1502;
|
||||
id_tag = "rus_pump_2"
|
||||
autolink_id = "rus2_vent"
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/ruin/space/derelict/crew_quarters)
|
||||
"lq" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1502;
|
||||
id_tag = "rus_outer_2";
|
||||
id_tag = "rus2_door_ext";
|
||||
locked = 1;
|
||||
name = "External Airlock"
|
||||
},
|
||||
@@ -5316,9 +5302,7 @@
|
||||
dir = 4
|
||||
},
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_interior";
|
||||
frequency = 1502;
|
||||
master_tag = "rus_airlock_2";
|
||||
autolink_id = "rus2_btn_int";
|
||||
name = "interior access button";
|
||||
pixel_x = 25
|
||||
},
|
||||
@@ -7958,9 +7942,7 @@
|
||||
dir = 4
|
||||
},
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_interior";
|
||||
frequency = 1501;
|
||||
master_tag = "rus_airlock_1";
|
||||
autolink_id = "rus1_btn_int";
|
||||
name = "interior access button";
|
||||
pixel_y = -25
|
||||
},
|
||||
@@ -8051,8 +8033,7 @@
|
||||
/area/ruin/space/derelict/arrival)
|
||||
"sa" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1501;
|
||||
id_tag = "rus_inner_1";
|
||||
id_tag = "rus1_door_int";
|
||||
name = "External Airlock"
|
||||
},
|
||||
/obj/structure/cable{
|
||||
@@ -8071,8 +8052,7 @@
|
||||
},
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden,
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1501;
|
||||
id_tag = "rus_inner_1";
|
||||
id_tag = "rus1_door_int";
|
||||
name = "External Airlock"
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
@@ -8088,23 +8068,15 @@
|
||||
},
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume{
|
||||
dir = 1;
|
||||
frequency = 1501;
|
||||
id_tag = "rus_pump_1"
|
||||
autolink_id = "rus1_vent"
|
||||
},
|
||||
/obj/machinery/airlock_sensor{
|
||||
frequency = 1501;
|
||||
id_tag = "rus_sensor_1";
|
||||
pixel_x = 25;
|
||||
pixel_y = -5
|
||||
},
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller{
|
||||
frequency = 1501;
|
||||
id_tag = "rus_airlock_1";
|
||||
/obj/machinery/airlock_controller/air_cycler{
|
||||
pixel_x = -25;
|
||||
tag_airpump = "rus_pump_1";
|
||||
tag_chamber_sensor = "rus_sensor_1";
|
||||
tag_exterior_door = "rus_outer_1";
|
||||
tag_interior_door = "rus_inner_1"
|
||||
ext_button_link_id = "rus1_btn_ext";
|
||||
ext_door_link_id = "rus1_door_ext";
|
||||
int_button_link_id = "rus1_btn_int";
|
||||
int_door_link_id = "rus1_door_int";
|
||||
vent_link_id = "rus1_vent"
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/ruin/space/derelict/arrival)
|
||||
@@ -8119,8 +8091,7 @@
|
||||
},
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume{
|
||||
dir = 1;
|
||||
frequency = 1501;
|
||||
id_tag = "rus_pump_1"
|
||||
autolink_id = "rus1_vent"
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/ruin/space/derelict/arrival)
|
||||
@@ -8131,8 +8102,7 @@
|
||||
icon_state = "1-2"
|
||||
},
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1501;
|
||||
id_tag = "rus_outer_1";
|
||||
id_tag = "rus1_door_ext";
|
||||
locked = 1;
|
||||
name = "External Airlock"
|
||||
},
|
||||
@@ -8140,8 +8110,7 @@
|
||||
/area/ruin/space/derelict/arrival)
|
||||
"sf" = (
|
||||
/obj/machinery/door/airlock/external{
|
||||
frequency = 1501;
|
||||
id_tag = "rus_outer_1";
|
||||
id_tag = "rus1_door_ext";
|
||||
locked = 1;
|
||||
name = "External Airlock"
|
||||
},
|
||||
@@ -8163,9 +8132,7 @@
|
||||
dir = 1
|
||||
},
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_exterior";
|
||||
frequency = 1501;
|
||||
master_tag = "rus_airlock_1";
|
||||
autolink_id = "rus1_btn_ext";
|
||||
name = "exterior access button";
|
||||
pixel_y = 25
|
||||
},
|
||||
|
||||
+2310
-2591
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -17,8 +17,7 @@
|
||||
/area/shuttle/administration)
|
||||
"ad" = (
|
||||
/obj/machinery/door/airlock/hatch{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_northwest_lock";
|
||||
id_tag = "voxwest_door_ext";
|
||||
locked = 1;
|
||||
req_access_txt = "152"
|
||||
},
|
||||
@@ -66,12 +65,6 @@
|
||||
/turf/simulated/floor/plating/nitrogen,
|
||||
/area/shuttle/administration)
|
||||
"aq" = (
|
||||
/obj/machinery/airlock_sensor{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_west_sensor";
|
||||
pixel_x = 25;
|
||||
req_access_txt = "152"
|
||||
},
|
||||
/obj/machinery/light{
|
||||
dir = 4
|
||||
},
|
||||
@@ -86,9 +79,7 @@
|
||||
/area/shuttle/administration)
|
||||
"av" = (
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_exterior";
|
||||
frequency = 1331;
|
||||
master_tag = "vox_west_control";
|
||||
autolink_id = "voxwest_btn_ext";
|
||||
req_one_access_txt = "152"
|
||||
},
|
||||
/turf/simulated/wall/mineral/plastitanium,
|
||||
@@ -97,27 +88,19 @@
|
||||
/turf/space,
|
||||
/area/shuttle/administration)
|
||||
"aB" = (
|
||||
/obj/machinery/airlock_sensor{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_east_sensor";
|
||||
pixel_x = -25;
|
||||
req_access_txt = "152"
|
||||
},
|
||||
/obj/machinery/light{
|
||||
dir = 8
|
||||
},
|
||||
/turf/simulated/floor/mineral/plastitanium/red/nitrogen,
|
||||
/area/shuttle/administration)
|
||||
"aG" = (
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_west_control";
|
||||
/obj/machinery/airlock_controller/access_controller{
|
||||
ext_button_link_id = "voxwest_btn_ext";
|
||||
ext_door_link_id = "voxwest_door_ext";
|
||||
int_button_link_id = "voxwest_btn_int";
|
||||
int_door_link_id = "voxwest_door_int";
|
||||
pixel_x = 24;
|
||||
req_access_txt = "152";
|
||||
tag_airpump = "vox_west_vent";
|
||||
tag_chamber_sensor = "vox_west_sensor";
|
||||
tag_exterior_door = "vox_northwest_lock";
|
||||
tag_interior_door = "vox_southwest_lock"
|
||||
req_access_txt = "152"
|
||||
},
|
||||
/turf/simulated/floor/mineral/plastitanium/red/nitrogen,
|
||||
/area/shuttle/administration)
|
||||
@@ -148,8 +131,7 @@
|
||||
/area/shuttle/administration)
|
||||
"aM" = (
|
||||
/obj/machinery/door/airlock/hatch{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_northeast_lock";
|
||||
id_tag = "voxeast_door_ext";
|
||||
locked = 1;
|
||||
req_access_txt = "152"
|
||||
},
|
||||
@@ -158,8 +140,7 @@
|
||||
/area/shuttle/administration)
|
||||
"aN" = (
|
||||
/obj/machinery/door/airlock/hatch{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_southwest_lock";
|
||||
id_tag = "voxwest_door_int";
|
||||
locked = 1;
|
||||
req_access_txt = "152"
|
||||
},
|
||||
@@ -253,9 +234,7 @@
|
||||
/area/shuttle/administration)
|
||||
"bO" = (
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_exterior";
|
||||
frequency = 1331;
|
||||
master_tag = "vox_east_control";
|
||||
autolink_id = "voxeast_btn_ext";
|
||||
req_access_txt = "152"
|
||||
},
|
||||
/turf/simulated/wall/mineral/plastitanium,
|
||||
@@ -301,23 +280,19 @@
|
||||
/turf/simulated/floor/mineral/plastitanium/red/nitrogen,
|
||||
/area/shuttle/administration)
|
||||
"cf" = (
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_east_control";
|
||||
/obj/machinery/airlock_controller/access_controller{
|
||||
ext_door_link_id = "voxeast_door_ext";
|
||||
int_door_link_id = "voxeast_door_int";
|
||||
pixel_x = -24;
|
||||
req_access_txt = "152";
|
||||
tag_airpump = "vox_east_vent";
|
||||
tag_chamber_sensor = "vox_east_sensor";
|
||||
tag_exterior_door = "vox_northeast_lock";
|
||||
tag_interior_door = "vox_southeast_lock"
|
||||
ext_button_link_id = "voxeast_btn_ext";
|
||||
int_button_link_id = "voxeast_btn_int"
|
||||
},
|
||||
/turf/simulated/floor/mineral/plastitanium/red/nitrogen,
|
||||
/area/shuttle/administration)
|
||||
"cg" = (
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_interior";
|
||||
frequency = 1331;
|
||||
master_tag = "vox_west_control";
|
||||
autolink_id = "voxwest_btn_int";
|
||||
req_one_access_txt = "152"
|
||||
},
|
||||
/turf/simulated/wall/mineral/plastitanium/nodiagonal,
|
||||
@@ -356,17 +331,14 @@
|
||||
/area/shuttle/administration)
|
||||
"cn" = (
|
||||
/obj/machinery/access_button{
|
||||
command = "cycle_interior";
|
||||
frequency = 1331;
|
||||
master_tag = "vox_east_control";
|
||||
autolink_id = "voxeast_btn_int";
|
||||
req_one_access_txt = "152"
|
||||
},
|
||||
/turf/simulated/wall/mineral/plastitanium/nodiagonal,
|
||||
/area/shuttle/administration)
|
||||
"co" = (
|
||||
/obj/machinery/door/airlock/hatch{
|
||||
frequency = 1331;
|
||||
id_tag = "vox_southeast_lock";
|
||||
id_tag = "voxeast_door_int";
|
||||
locked = 1;
|
||||
req_access_txt = "152"
|
||||
},
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
|
||||
#define ATMOS_FIRE_FREQ 1437 //air alarms
|
||||
#define ENGINE_FREQ 1438 //engine components
|
||||
#define ATMOS_VENTSCRUB 1439 //vents, scrubbers, atmos control
|
||||
#define ATMOS_DISTRO_FREQ 1443 //distro loop
|
||||
#define ATMOS_TANKS_FREQ 1441 //atmos supply tanks
|
||||
#define BOT_BEACON_FREQ 1445 //bot navigation beacons
|
||||
#define AIRLOCK_FREQ 1449 //airlock controls, electropack, magnets
|
||||
//#define ATMOS_FIRE_FREQ 1437 //air alarms
|
||||
//#define ENGINE_FREQ 1438 //engine components
|
||||
//#define ATMOS_DISTRO_FREQ 1443 //distro loop
|
||||
//#define ATMOS_TANKS_FREQ 1441 //atmos supply tanks
|
||||
//#define BOT_BEACON_FREQ 1445 //bot navigation beacons
|
||||
#define AIRLOCK_FREQ 1449 //airlock controls, electropack, magnets // THIS MUST DIE
|
||||
|
||||
#define RSD_FREQ 1457 //radio signal device - Not a real signal
|
||||
|
||||
#define RSD_FREQ 1457 //radio signal device
|
||||
#define IMPL_FREQ 1451 //tracking implant
|
||||
|
||||
#define RADIO_LOW_FREQ 1200 //minimum radio freq
|
||||
#define PUBLIC_LOW_FREQ 1441 //minimum radio chat freq
|
||||
|
||||
@@ -40,12 +40,3 @@
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
/obj/machinery/proc/getArea()
|
||||
var/area/A = loc.loc
|
||||
|
||||
if(A != myArea)
|
||||
myArea = A
|
||||
|
||||
. = myArea
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//Quick type checks for some tools
|
||||
|
||||
// Why are these not defines?
|
||||
/proc/iswrench(O)
|
||||
if(istype(O, /obj/item/wrench))
|
||||
return TRUE
|
||||
|
||||
@@ -1216,7 +1216,7 @@ GLOBAL_LIST_INIT(wall_items, typecacheof(list(/obj/machinery/power/apc, /obj/mac
|
||||
/obj/item/radio/intercom, /obj/structure/extinguisher_cabinet, /obj/structure/reagent_dispensers/peppertank,
|
||||
/obj/machinery/status_display, /obj/machinery/requests_console, /obj/machinery/light_switch, /obj/structure/sign,
|
||||
/obj/machinery/newscaster, /obj/machinery/firealarm, /obj/structure/noticeboard, /obj/machinery/door_control,
|
||||
/obj/machinery/computer/security/telescreen, /obj/machinery/embedded_controller/radio/airlock,
|
||||
/obj/machinery/computer/security/telescreen, /obj/machinery/airlock_controller,
|
||||
/obj/item/storage/secure/safe, /obj/machinery/door_timer, /obj/machinery/flasher, /obj/machinery/keycard_auth,
|
||||
/obj/structure/mirror, /obj/structure/closet/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment,
|
||||
/obj/structure/sign)))
|
||||
|
||||
@@ -48,7 +48,6 @@ GLOBAL_LIST_EMPTY(mirrors) //list of all mirrors and mirror shields.
|
||||
GLOBAL_LIST_INIT(active_diseases, list()) //List of Active disease in all mobs; purely for quick referencing.
|
||||
|
||||
GLOBAL_LIST_EMPTY(mob_spawners) // All mob_spawn objects
|
||||
GLOBAL_LIST_EMPTY(alert_consoles) // Station alert consoles, /obj/machinery/computer/station_alert
|
||||
GLOBAL_LIST_EMPTY(explosive_walls)
|
||||
|
||||
GLOBAL_LIST_EMPTY(engine_beacon_list)
|
||||
|
||||
@@ -346,12 +346,6 @@ SUBSYSTEM_DEF(air)
|
||||
for(var/obj/machinery/atmospherics/A in machines_to_init)
|
||||
A.atmos_init()
|
||||
count++
|
||||
if(istype(A, /obj/machinery/atmospherics/unary/vent_pump))
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/T = A
|
||||
T.broadcast_status()
|
||||
else if(istype(A, /obj/machinery/atmospherics/unary/vent_scrubber))
|
||||
var/obj/machinery/atmospherics/unary/vent_scrubber/T = A
|
||||
T.broadcast_status()
|
||||
return count
|
||||
|
||||
//this can't be done with setup_atmos_machinery() because
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// why is this an SS if it has no fire or init
|
||||
// this should be a global datum for piss sake
|
||||
// AND YES I KNOW AN SS IS A GLOBAL DATUM, THATS NOT THE POINT
|
||||
SUBSYSTEM_DEF(alarm)
|
||||
name = "Alarm"
|
||||
flags = SS_NO_INIT | SS_NO_FIRE
|
||||
|
||||
@@ -70,6 +70,7 @@ SUBSYSTEM_DEF(atoms)
|
||||
for(var/I in late_loaders)
|
||||
var/atom/A = I
|
||||
A.LateInitialize()
|
||||
CHECK_TICK
|
||||
if(noisy)
|
||||
log_startup_progress("Late initialized [length(late_loaders)] atoms in [stop_watch(watch)]s")
|
||||
else
|
||||
|
||||
@@ -88,9 +88,9 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/get_open_ui(mob/user, datum/src_object, ui_key)
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return null // No UIs open.
|
||||
else if(isnull(open_uis[src_object_key][ui_key]) || !istype(open_uis[src_object_key][ui_key], /list))
|
||||
else if(isnull(open_uis[src_object_key][ui_key]) || !islist(open_uis[src_object_key][ui_key]))
|
||||
return null // No UIs open for this object.
|
||||
|
||||
for(var/datum/tgui/ui in open_uis[src_object_key][ui_key]) // Find UIs for this object.
|
||||
@@ -110,7 +110,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/update_uis(datum/src_object, update_static_data = FALSE)
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return 0 // Couldn't find any UIs for this object.
|
||||
|
||||
var/update_count = 0
|
||||
@@ -135,7 +135,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
if(!src_object.unique_datum_id) // First check if the datum has an UID set
|
||||
return 0
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return 0 // Couldn't find any UIs for this object.
|
||||
|
||||
var/close_count = 0
|
||||
@@ -146,6 +146,29 @@ SUBSYSTEM_DEF(tgui)
|
||||
close_count++ // Count each UI we close.
|
||||
return close_count
|
||||
|
||||
/**
|
||||
*
|
||||
* Gets the amount of open UIs on an object
|
||||
* Returns the number of UIs open.
|
||||
*
|
||||
* * datum/src_object - The object/datum which owns the UIs.
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/get_open_ui_count(datum/src_object)
|
||||
if(!src_object.unique_datum_id) // First check if the datum has an UID set
|
||||
return 0
|
||||
var/src_object_key = "[src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return 0 // Couldn't find any UIs for this object.
|
||||
|
||||
var/open_count = 0
|
||||
for(var/ui_key in open_uis[src_object_key])
|
||||
for(var/datum/tgui/ui in open_uis[src_object_key][ui_key])
|
||||
if(ui && ui.src_object && ui.user && ui.src_object.ui_host(ui.user)) // Check the UI is valid.
|
||||
open_count++ // Count each UI thats open
|
||||
|
||||
return open_count
|
||||
|
||||
|
||||
/**
|
||||
* private
|
||||
*
|
||||
@@ -173,7 +196,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
* * ui_key - If provided, only update UIs with this UI key. (OPTIONAL)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/update_user_uis(mob/user, datum/src_object = null, ui_key = null)
|
||||
if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
|
||||
if(isnull(user.open_uis) || !islist(user.open_uis) || open_uis.len == 0)
|
||||
return 0 // Couldn't find any UIs for this user.
|
||||
|
||||
var/update_count = 0
|
||||
@@ -194,7 +217,7 @@ SUBSYSTEM_DEF(tgui)
|
||||
* * ui_key - If provided, only close UIs with this UI key. (OPTIONAL)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/close_user_uis(mob/user, datum/src_object = null, ui_key = null)
|
||||
if(isnull(user.open_uis) || !istype(user.open_uis, /list) || open_uis.len == 0)
|
||||
if(isnull(user.open_uis) || !islist(user.open_uis) || open_uis.len == 0)
|
||||
return 0 // Couldn't find any UIs for this user.
|
||||
|
||||
var/close_count = 0
|
||||
@@ -213,9 +236,9 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/on_open(datum/tgui/ui)
|
||||
var/src_object_key = "[ui.src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
open_uis[src_object_key] = list(ui.ui_key = list()) // Make a list for the ui_key and src_object.
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !istype(open_uis[src_object_key][ui.ui_key], /list))
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !islist(open_uis[src_object_key][ui.ui_key]))
|
||||
open_uis[src_object_key][ui.ui_key] = list() // Make a list for the ui_key.
|
||||
|
||||
// Append the UI to all the lists.
|
||||
@@ -234,9 +257,9 @@ SUBSYSTEM_DEF(tgui)
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/on_close(datum/tgui/ui)
|
||||
var/src_object_key = "[ui.src_object.UID()]"
|
||||
if(isnull(open_uis[src_object_key]) || !istype(open_uis[src_object_key], /list))
|
||||
if(isnull(open_uis[src_object_key]) || !islist(open_uis[src_object_key]))
|
||||
return FALSE // It wasn't open.
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !istype(open_uis[src_object_key][ui.ui_key], /list))
|
||||
else if(isnull(open_uis[src_object_key][ui.ui_key]) || !islist(open_uis[src_object_key][ui.ui_key]))
|
||||
return FALSE // It wasn't open.
|
||||
|
||||
processing_uis.Remove(ui) // Remove it from the list of processing UIs.
|
||||
@@ -274,10 +297,10 @@ SUBSYSTEM_DEF(tgui)
|
||||
* * mob/target - The client's new mob.
|
||||
*/
|
||||
/datum/controller/subsystem/tgui/proc/on_transfer(mob/source, mob/target)
|
||||
if(!source || isnull(source.open_uis) || !istype(source.open_uis, /list) || open_uis.len == 0)
|
||||
if(!source || isnull(source.open_uis) || !islist(source.open_uis) || open_uis.len == 0)
|
||||
return FALSE // The old mob had no open UIs.
|
||||
|
||||
if(isnull(target.open_uis) || !istype(target.open_uis, /list))
|
||||
if(isnull(target.open_uis) || !islist(target.open_uis))
|
||||
target.open_uis = list() // Create a list for the new mob if needed.
|
||||
|
||||
for(var/datum/tgui/ui in source.open_uis)
|
||||
|
||||
@@ -47,8 +47,7 @@
|
||||
A.apply_mode()
|
||||
|
||||
if(WIRE_AALARM)
|
||||
if(A.alarm_area.atmosalert(ATMOS_ALARM_DANGER, A))
|
||||
A.post_alert(ATMOS_ALARM_DANGER)
|
||||
A.alarm_area.atmosalert(ATMOS_ALARM_DANGER, A)
|
||||
A.update_icon()
|
||||
..()
|
||||
|
||||
@@ -79,7 +78,6 @@
|
||||
A.apply_mode()
|
||||
|
||||
if(WIRE_AALARM)
|
||||
if(A.alarm_area.atmosalert(ATMOS_ALARM_NONE, A))
|
||||
A.post_alert(ATMOS_ALARM_NONE)
|
||||
A.alarm_area.atmosalert(ATMOS_ALARM_NONE, A)
|
||||
A.update_icon()
|
||||
..()
|
||||
|
||||
@@ -258,6 +258,7 @@
|
||||
return null
|
||||
|
||||
/atom/proc/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// Controller control states
|
||||
#define CONTROL_STATE_IDLE 0
|
||||
#define CONTROL_STATE_PREPARE 1
|
||||
#define CONTROL_STATE_DEPRESSURIZE 2
|
||||
#define CONTROL_STATE_PRESSURIZE 3
|
||||
|
||||
// Controller target states
|
||||
#define TARGET_NONE 0
|
||||
#define TARGET_INOPEN -1
|
||||
#define TARGET_OUTOPEN -2
|
||||
|
||||
// Button modes
|
||||
#define MODE_INTERIOR "int"
|
||||
#define MODE_EXTERIOR "ext"
|
||||
@@ -0,0 +1,66 @@
|
||||
GLOBAL_LIST_EMPTY(all_airlock_access_buttons)
|
||||
|
||||
/obj/machinery/access_button
|
||||
icon = 'icons/obj/airlock_machines.dmi'
|
||||
icon_state = "access_button_standby"
|
||||
name = "airlock access button"
|
||||
desc = "Controls an airlock controller, requesting the doors open on this side."
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
anchored = TRUE
|
||||
power_channel = ENVIRON
|
||||
/// Id to be used by the controller to grab us on spawn
|
||||
var/autolink_id
|
||||
/// UID of the airlock controller that owns us
|
||||
var/tmp/controller_uid
|
||||
/// Command, whether this button cycles in or out. This is /tmp/ so mappers dont try and define it in a map. Its assigned at runtime.
|
||||
var/tmp/assigned_command
|
||||
|
||||
/obj/machinery/access_button/Initialize(mapload)
|
||||
. = ..()
|
||||
GLOB.all_airlock_access_buttons += src
|
||||
if(assigned_command)
|
||||
stack_trace("A mapper tried to set assigned_command to [assigned_command] on [type] at [x],[y],[z]. This should not be mapped in.")
|
||||
|
||||
/obj/machinery/access_button/Destroy()
|
||||
GLOB.all_airlock_access_buttons -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/access_button/update_icon_state()
|
||||
if(powered(power_channel))
|
||||
icon_state = "access_button_standby"
|
||||
else
|
||||
icon_state = "access_button_off"
|
||||
|
||||
/obj/machinery/access_button/attackby(obj/item/I, mob/user, params)
|
||||
//Swiping ID on the access button
|
||||
if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
|
||||
attack_hand(user)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/access_button/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/access_button/attack_hand(mob/user)
|
||||
add_fingerprint(user)
|
||||
|
||||
if(!powered(power_channel))
|
||||
return
|
||||
|
||||
if(!allowed(user) && !user.can_advanced_admin_interact())
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
return
|
||||
|
||||
var/obj/machinery/airlock_controller/C = locateUID(controller_uid)
|
||||
if(!C)
|
||||
to_chat(user, "<span class='warning'>Could not communicate with controller.</span>")
|
||||
return
|
||||
|
||||
C.handle_button(assigned_command)
|
||||
flick("access_button_cycle", src)
|
||||
|
||||
/obj/machinery/access_button/proc/setup(obj/machinery/airlock_controller/C, mode)
|
||||
controller_uid = C.UID()
|
||||
assigned_command = mode
|
||||
|
||||
@@ -0,0 +1,402 @@
|
||||
//base type for controllers of two-door systems
|
||||
/obj/machinery/airlock_controller
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
name = "airlock controller"
|
||||
icon = 'icons/obj/airlock_machines.dmi'
|
||||
icon_state = "airlock_control_standby"
|
||||
anchored = TRUE
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 10
|
||||
|
||||
// Setup vars
|
||||
|
||||
/// Airlock ID for all exterior doors to link to on LateInitialize()
|
||||
var/ext_door_link_id
|
||||
/// Airlock ID for all interior doors to link to on LateInitialize()
|
||||
var/int_door_link_id
|
||||
/// Button ID for all exterior buttons to link to on LateInitialize()
|
||||
var/ext_button_link_id
|
||||
/// Vutton ID for all exterior buttons to link to on LateInitialize()
|
||||
var/int_button_link_id
|
||||
|
||||
// Actual holding vars
|
||||
/// All exterior doors to control. Soft-refs only.
|
||||
var/list/exterior_doors = list()
|
||||
/// All interior doors to control. Soft-refs only.
|
||||
var/list/interior_doors = list()
|
||||
|
||||
/// Current state (IDLE, PREPARE, DEPRESSURIZE, PRESSURIZE)
|
||||
var/state = CONTROL_STATE_IDLE
|
||||
/// Target state (MONE, INOPEN, OUTOPEN)
|
||||
var/target_state = TARGET_NONE
|
||||
|
||||
/// Vent ID for all vents to link to on LateInitialize()
|
||||
var/vent_link_id
|
||||
/// All vents to control. Soft-refs only.
|
||||
var/list/vents = list()
|
||||
|
||||
// Program vars
|
||||
var/target_pressure
|
||||
|
||||
|
||||
/obj/machinery/airlock_controller/Initialize(mapload)
|
||||
..()
|
||||
// We do all the work in there
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
// Do setup of stuff here
|
||||
/obj/machinery/airlock_controller/LateInitialize()
|
||||
for(var/obj/machinery/door/airlock/A in GLOB.airlocks)
|
||||
if(A.id_tag == int_door_link_id)
|
||||
interior_doors += A.UID()
|
||||
if(A.id_tag == ext_door_link_id)
|
||||
exterior_doors += A.UID()
|
||||
|
||||
if(!length(interior_doors))
|
||||
stack_trace("[src] at [x],[y],[z] didnt setup any interior airlocks! Please double check the IDs!")
|
||||
if(!length(exterior_doors))
|
||||
stack_trace("[src] at [x],[y],[z] didnt setup any exterior airlocks! Please double check the IDs!")
|
||||
|
||||
// Track amount
|
||||
var/ib_setup = 0
|
||||
var/eb_setup = 0
|
||||
for(var/obj/machinery/access_button/B as anything in GLOB.all_airlock_access_buttons)
|
||||
if(B.autolink_id == int_button_link_id)
|
||||
B.setup(src, MODE_INTERIOR)
|
||||
ib_setup++
|
||||
if(B.autolink_id == ext_button_link_id)
|
||||
B.setup(src, MODE_EXTERIOR)
|
||||
eb_setup++
|
||||
|
||||
if(!ib_setup)
|
||||
stack_trace("[src] at [x],[y],[z] didnt setup any interior buttons! Please double check the IDs!")
|
||||
if(!eb_setup)
|
||||
stack_trace("[src] at [x],[y],[z] didnt setup any exterior buttons! Please double check the IDs!")
|
||||
|
||||
|
||||
/obj/machinery/airlock_controller/attack_ghost(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/airlock_controller/attack_ai(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/airlock_controller/attack_hand(mob/user)
|
||||
if(!user.IsAdvancedToolUser())
|
||||
return FALSE
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/airlock_controller/update_icon_state()
|
||||
if(powered(power_channel))
|
||||
if(state != target_state)
|
||||
icon_state = "airlock_control_process"
|
||||
else
|
||||
icon_state = "airlock_control_standby"
|
||||
else
|
||||
icon_state = "airlock_control_off"
|
||||
|
||||
/obj/machinery/airlock_controller/proc/handle_button(button_mode)
|
||||
// dm please give me abstracts I beg
|
||||
CRASH("handle_button() not overriden for [type]")
|
||||
|
||||
/obj/machinery/airlock_controller/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(!allowed(usr))
|
||||
to_chat(usr, "<span class='warning'>Access denied</span>")
|
||||
return TRUE
|
||||
|
||||
switch(action)
|
||||
if("cycle_ext")
|
||||
begin_cycle_out()
|
||||
|
||||
if("cycle_int")
|
||||
begin_cycle_in()
|
||||
|
||||
if("cycle_ext_door")
|
||||
cycleDoors(TARGET_OUTOPEN)
|
||||
|
||||
if("cycle_int_door")
|
||||
cycleDoors(TARGET_INOPEN)
|
||||
|
||||
if("abort")
|
||||
stop_cycling()
|
||||
|
||||
if("force_ext")
|
||||
toggleDoors(exterior_doors, "toggle")
|
||||
|
||||
if("force_int")
|
||||
toggleDoors(interior_doors, "toggle")
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/airlock_controller/process()
|
||||
if(!state) //Idle
|
||||
if(target_state)
|
||||
switch(target_state)
|
||||
if(TARGET_INOPEN)
|
||||
target_pressure = ONE_ATMOSPHERE
|
||||
if(TARGET_OUTOPEN)
|
||||
target_pressure = 0
|
||||
|
||||
//lock down the airlock before activating pumps
|
||||
close_doors()
|
||||
|
||||
state = CONTROL_STATE_PREPARE
|
||||
else
|
||||
//make sure to return to a sane idle state
|
||||
signalPumps(FALSE)
|
||||
|
||||
if((state == CONTROL_STATE_PRESSURIZE || state == CONTROL_STATE_DEPRESSURIZE) && !check_doors_secured())
|
||||
//the airlock will not allow itself to continue to cycle when any of the doors are forced open.
|
||||
stop_cycling()
|
||||
|
||||
switch(state)
|
||||
if(CONTROL_STATE_PREPARE)
|
||||
if(check_doors_secured())
|
||||
var/chamber_pressure = return_air().return_pressure()
|
||||
|
||||
if(chamber_pressure <= target_pressure)
|
||||
state = CONTROL_STATE_PRESSURIZE
|
||||
signalPumps(TRUE, TRUE, target_pressure) //send a signal to start pressurizing
|
||||
|
||||
else if(chamber_pressure > target_pressure)
|
||||
state = CONTROL_STATE_DEPRESSURIZE
|
||||
signalPumps(TRUE, FALSE, target_pressure) //send a signal to start depressurizing
|
||||
|
||||
//Check for vacuum - this is set after the pumps so the pumps are aiming for 0
|
||||
if(!target_pressure)
|
||||
target_pressure = ONE_ATMOSPHERE * 0.05
|
||||
|
||||
if(CONTROL_STATE_PRESSURIZE)
|
||||
if(return_air().return_pressure() >= (target_pressure * 0.95))
|
||||
cycleDoors(target_state)
|
||||
|
||||
state = CONTROL_STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
signalPumps(FALSE) //send a signal to stop pumping
|
||||
|
||||
|
||||
if(CONTROL_STATE_DEPRESSURIZE)
|
||||
if(return_air().return_pressure() <= (target_pressure * 1.05))
|
||||
cycleDoors(target_state)
|
||||
|
||||
state = CONTROL_STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
//send a signal to stop pumping
|
||||
signalPumps(FALSE)
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/airlock_controller/proc/begin_cycle_in()
|
||||
state = CONTROL_STATE_IDLE
|
||||
target_state = TARGET_INOPEN
|
||||
|
||||
/obj/machinery/airlock_controller/proc/begin_cycle_out()
|
||||
state = CONTROL_STATE_IDLE
|
||||
target_state = TARGET_OUTOPEN
|
||||
|
||||
/obj/machinery/airlock_controller/proc/close_doors()
|
||||
toggleDoors(interior_doors, "close")
|
||||
toggleDoors(exterior_doors, "close")
|
||||
|
||||
/obj/machinery/airlock_controller/proc/stop_cycling()
|
||||
state = CONTROL_STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
/obj/machinery/airlock_controller/proc/done_cycling()
|
||||
return (state == CONTROL_STATE_IDLE && target_state == TARGET_NONE)
|
||||
|
||||
//are the doors closed and locked?
|
||||
/obj/machinery/airlock_controller/proc/check_doors_match_state_uid(list/door_uids, door_state)
|
||||
var/list/obj/machinery/door/airlock/temp_airlocks = list()
|
||||
for(var/airlock_uid in door_uids)
|
||||
var/obj/machinery/door/airlock/A = locateUID(airlock_uid)
|
||||
if(QDELETED(A))
|
||||
door_uids -= airlock_uid
|
||||
continue
|
||||
|
||||
temp_airlocks += A
|
||||
|
||||
return check_doors_match_state(temp_airlocks, door_state)
|
||||
|
||||
/obj/machinery/airlock_controller/proc/check_doors_match_state(list/doors, door_state)
|
||||
for(var/obj/machinery/door/airlock/A as anything in doors)
|
||||
switch(door_state)
|
||||
if("open")
|
||||
if(A.density)
|
||||
return FALSE // Fail if door is dense (closed) on open check
|
||||
if("closed")
|
||||
if(!A.density)
|
||||
return FALSE // Fail if door is not dense (open) on closed check
|
||||
if("locked")
|
||||
if(!A.locked)
|
||||
return FALSE // Fail if door is not locked on locked check
|
||||
if("unlocked")
|
||||
if(A.locked)
|
||||
return FALSE // Fail if door is locked on unlock check
|
||||
|
||||
// We passed!
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/airlock_controller/proc/check_doors_secured()
|
||||
var/ext_closed = (check_doors_match_state_uid(exterior_doors, "closed") && check_doors_match_state_uid(exterior_doors, "locked"))
|
||||
var/int_closed = (check_doors_match_state_uid(interior_doors, "closed") && check_doors_match_state_uid(interior_doors, "locked"))
|
||||
return (ext_closed && int_closed)
|
||||
|
||||
/obj/machinery/airlock_controller/proc/signalDoors(list/uids, command)
|
||||
for(var/airlock_uid in uids)
|
||||
var/obj/machinery/door/airlock/A = locateUID(airlock_uid)
|
||||
if(QDELETED(A))
|
||||
uids -= airlock_uid
|
||||
continue
|
||||
|
||||
A.airlock_cycle_callback(command)
|
||||
|
||||
/obj/machinery/airlock_controller/proc/signalPumps(power, direction, pressure)
|
||||
for(var/vent_uid in vents)
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/V = locateUID(vent_uid)
|
||||
if(QDELETED(V))
|
||||
vents -= vent_uid
|
||||
continue
|
||||
|
||||
V.on = power
|
||||
V.releasing = direction
|
||||
V.external_pressure_bound = pressure
|
||||
V.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
//this is called to set the appropriate door state at the end of a cycling process, or for the exterior buttons
|
||||
/obj/machinery/airlock_controller/proc/cycleDoors(target)
|
||||
switch(target)
|
||||
if(TARGET_OUTOPEN)
|
||||
toggleDoors(interior_doors, "close")
|
||||
toggleDoors(exterior_doors, "open")
|
||||
if(TARGET_INOPEN)
|
||||
toggleDoors(interior_doors, "open")
|
||||
toggleDoors(exterior_doors, "close")
|
||||
if(TARGET_NONE)
|
||||
signalDoors(interior_doors, "unlock")
|
||||
signalDoors(exterior_doors, "unlock")
|
||||
|
||||
/*----------------------------------------------------------
|
||||
toggleDoor()
|
||||
Sends a radio command to a door to either open or close. If
|
||||
the command is 'toggle' the door will be sent a command that
|
||||
reverses it's current state.
|
||||
Can also toggle whether the door bolts are locked or not,
|
||||
depending on the state of the 'secure' flag.
|
||||
Only sends a command if it is needed, i.e. if the door is
|
||||
already open, passing an open command to this proc will not
|
||||
send an additional command to open the door again.
|
||||
----------------------------------------------------------*/
|
||||
/obj/machinery/airlock_controller/proc/toggleDoors(list/doors, command)
|
||||
var/doorCommand = null
|
||||
|
||||
// Cache this. it will be expensive otherwise.
|
||||
var/list/obj/machinery/door/airlock/airlocks = list()
|
||||
for(var/airlock_uid in doors)
|
||||
var/obj/machinery/door/airlock/A = locateUID(airlock_uid)
|
||||
if(QDELETED(A))
|
||||
doors -= airlock_uid
|
||||
continue
|
||||
|
||||
airlocks += A
|
||||
|
||||
|
||||
if(command == "toggle")
|
||||
if(check_doors_match_state(airlocks, "open"))
|
||||
command = "close"
|
||||
else if(check_doors_match_state(airlocks, "closed"))
|
||||
command = "open"
|
||||
|
||||
switch(command)
|
||||
if("close")
|
||||
if(check_doors_match_state(airlocks, "open"))
|
||||
doorCommand = "secure_close"
|
||||
else if(check_doors_match_state(airlocks, "unlocked"))
|
||||
doorCommand = "lock"
|
||||
|
||||
if("open")
|
||||
if(check_doors_match_state(airlocks, "closed"))
|
||||
doorCommand = "secure_open"
|
||||
else if(check_doors_match_state(airlocks, "unlocked"))
|
||||
doorCommand = "lock"
|
||||
|
||||
if(doorCommand)
|
||||
signalDoors(doors, doorCommand)
|
||||
|
||||
|
||||
/* =============================== ACCESS CONTROLLER - No cycling required */
|
||||
/obj/machinery/airlock_controller/access_controller
|
||||
name = "airlock access controller"
|
||||
icon_state = "access_control_standby"
|
||||
|
||||
/obj/machinery/airlock_controller/access_controller/update_icon_state()
|
||||
if(powered(power_channel))
|
||||
if(state != target_state)
|
||||
icon_state = "access_control_process"
|
||||
else
|
||||
icon_state = "access_control_standby"
|
||||
else
|
||||
icon_state = "access_control_off"
|
||||
|
||||
/obj/machinery/airlock_controller/access_controller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "AirlockAccessController", name, 470, 290, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/airlock_controller/access_controller/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["exterior_status"] = (check_doors_match_state_uid(exterior_doors, "closed") ? "closed" : "open")
|
||||
data["interior_status"] = (check_doors_match_state_uid(interior_doors, "closed") ? "closed" : "open")
|
||||
data["processing"] = (state != target_state)
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/airlock_controller/access_controller/handle_button(button_mode)
|
||||
switch(button_mode)
|
||||
if(MODE_INTERIOR)
|
||||
cycleDoors(TARGET_INOPEN)
|
||||
if(MODE_EXTERIOR)
|
||||
cycleDoors(TARGET_OUTOPEN)
|
||||
|
||||
/* =============================== AIR CYCLER - Ensures internal pressure matches (just about) the void or the normal atmosphere */
|
||||
/obj/machinery/airlock_controller/air_cycler/LateInitialize()
|
||||
..()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/V as anything in GLOB.all_vent_pumps)
|
||||
if(V.autolink_id == vent_link_id)
|
||||
vents += V.UID()
|
||||
|
||||
if(!length(vents))
|
||||
stack_trace("[src] at [x],[y],[z] didnt setup any vents! Please double check the IDs!")
|
||||
|
||||
|
||||
/obj/machinery/airlock_controller/air_cycler/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ExternalAirlockController", name, 470, 290, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/airlock_controller/air_cycler/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["chamber_pressure"] = round(return_air().return_pressure())
|
||||
data["exterior_status"] = (check_doors_match_state_uid(exterior_doors, "closed") ? "closed" : "open")
|
||||
data["interior_status"] = (check_doors_match_state_uid(interior_doors, "closed") ? "closed" : "open")
|
||||
data["processing"] = (state != target_state)
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/airlock_controller/air_cycler/handle_button(button_mode)
|
||||
switch(button_mode)
|
||||
if(MODE_INTERIOR)
|
||||
begin_cycle_in()
|
||||
if(MODE_EXTERIOR)
|
||||
begin_cycle_out()
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
#undef CONTROL_STATE_IDLE
|
||||
#undef CONTROL_STATE_PREPARE
|
||||
#undef CONTROL_STATE_DEPRESSURIZE
|
||||
#undef CONTROL_STATE_PRESSURIZE
|
||||
#undef TARGET_NONE
|
||||
#undef TARGET_INOPEN
|
||||
#undef TARGET_OUTOPEN
|
||||
#undef MODE_INTERIOR
|
||||
#undef MODE_EXTERIOR
|
||||
@@ -45,7 +45,7 @@
|
||||
GLOB.cameranet.cameras += src
|
||||
GLOB.cameranet.addCamera(src)
|
||||
if(isturf(loc))
|
||||
LAZYADD(myArea.cameras, UID())
|
||||
LAZYADD(get_area(src).cameras, UID())
|
||||
if(is_station_level(z) && prob(3) && !start_active)
|
||||
toggle_cam(null, FALSE)
|
||||
wires.cut_all()
|
||||
@@ -60,8 +60,8 @@
|
||||
QDEL_NULL(wires)
|
||||
GLOB.cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that
|
||||
GLOB.cameranet.cameras -= src
|
||||
if(isarea(myArea))
|
||||
LAZYREMOVE(myArea.cameras, UID())
|
||||
if(isarea(get_area(src)))
|
||||
LAZYREMOVE(get_area(src).cameras, UID())
|
||||
var/area/ai_monitored/A = get_area(src)
|
||||
if(istype(A))
|
||||
A.motioncameras -= src
|
||||
@@ -266,15 +266,12 @@
|
||||
if(can_use())
|
||||
GLOB.cameranet.addCamera(src)
|
||||
if(isturf(loc))
|
||||
myArea = get_area(src)
|
||||
LAZYADD(myArea.cameras, UID())
|
||||
else
|
||||
myArea = null
|
||||
LAZYADD(get_area(src).cameras, UID())
|
||||
else
|
||||
set_light(0)
|
||||
GLOB.cameranet.removeCamera(src)
|
||||
if(isarea(myArea))
|
||||
LAZYREMOVE(myArea.cameras, UID())
|
||||
if(isarea(get_area(src)))
|
||||
LAZYREMOVE(get_area(src).cameras, UID())
|
||||
GLOB.cameranet.updateChunk(x, y, z)
|
||||
var/change_msg = "deactivates"
|
||||
if(status)
|
||||
|
||||
@@ -196,6 +196,7 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\
|
||||
. += "Current clone cycle is [round(get_completion())]% complete."
|
||||
|
||||
/obj/machinery/clonepod/return_air() //non-reactive air
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
var/datum/gas_mixture/GM = new
|
||||
GM.nitrogen = MOLES_O2STANDARD + MOLES_N2STANDARD
|
||||
GM.temperature = T20C
|
||||
|
||||
@@ -7,17 +7,37 @@
|
||||
icon_keyboard = "atmos_key"
|
||||
icon_screen = "alert:0"
|
||||
light_color = LIGHT_COLOR_CYAN
|
||||
var/list/priority_alarms = list()
|
||||
var/list/minor_alarms = list()
|
||||
var/receive_frequency = ATMOS_FIRE_FREQ
|
||||
// List of alarms and their state in areas. This is sent to TGUI
|
||||
var/list/alarm_cache
|
||||
|
||||
/obj/machinery/computer/atmos_alert/Initialize(mapload)
|
||||
. = ..()
|
||||
set_frequency(receive_frequency)
|
||||
alarm_cache = list()
|
||||
alarm_cache["minor"] = list()
|
||||
alarm_cache["priority"] = list()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/Destroy()
|
||||
SSradio.remove_object(src, receive_frequency)
|
||||
return ..()
|
||||
/obj/machinery/computer/atmos_alert/process()
|
||||
// This is relatively cheap because the areas list is pretty small
|
||||
for(var/area/A as anything in GLOB.all_areas)
|
||||
if(!A.master_air_alarm)
|
||||
continue // No alarm
|
||||
if(A.master_air_alarm.z != z)
|
||||
continue // Not on our z-level
|
||||
if(!A.master_air_alarm.report_danger_level)
|
||||
continue
|
||||
|
||||
switch(A.atmosalm)
|
||||
if(ATMOS_ALARM_DANGER)
|
||||
alarm_cache["priority"] |= A.name
|
||||
alarm_cache["minor"] -= A.name
|
||||
if(ATMOS_ALARM_WARNING)
|
||||
alarm_cache["priority"] -= A.name
|
||||
alarm_cache["minor"] |= A.name
|
||||
else
|
||||
alarm_cache["priority"] -= A.name
|
||||
alarm_cache["minor"] -= A.name
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/attack_hand(mob/user)
|
||||
ui_interact(user)
|
||||
@@ -29,60 +49,17 @@
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["priority"] = list()
|
||||
for(var/zone in priority_alarms)
|
||||
data["priority"] |= zone
|
||||
data["minor"] = list()
|
||||
for(var/zone in minor_alarms)
|
||||
data["minor"] |= zone
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/atmos_alert/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("clear")
|
||||
var/zone = params["zone"]
|
||||
if(zone in priority_alarms)
|
||||
to_chat(usr, "<span class='notice'>Priority alarm for [zone] cleared.</span>")
|
||||
priority_alarms -= zone
|
||||
. = TRUE
|
||||
if(zone in minor_alarms)
|
||||
to_chat(usr, "<span class='notice'>Minor alarm for [zone] cleared.</span>")
|
||||
minor_alarms -= zone
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/computer/atmos_alert/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, receive_frequency)
|
||||
receive_frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, receive_frequency, RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal)
|
||||
if(!signal)
|
||||
return
|
||||
|
||||
var/zone = signal.data["zone"]
|
||||
var/severity = signal.data["alert"]
|
||||
|
||||
if(!zone || !severity)
|
||||
return
|
||||
|
||||
minor_alarms -= zone
|
||||
priority_alarms -= zone
|
||||
if(severity == "severe")
|
||||
priority_alarms += zone
|
||||
else if(severity == "minor")
|
||||
minor_alarms += zone
|
||||
update_icon()
|
||||
return alarm_cache
|
||||
|
||||
/obj/machinery/computer/atmos_alert/update_icon_state()
|
||||
if(length(priority_alarms))
|
||||
if(!length(alarm_cache)) // This happens if were mid init
|
||||
icon_screen = "alert:0"
|
||||
return ..()
|
||||
|
||||
|
||||
if(length(alarm_cache["priority"]))
|
||||
icon_screen = "alert:2"
|
||||
else if(length(minor_alarms))
|
||||
else if(length(alarm_cache["minor"]))
|
||||
icon_screen = "alert:1"
|
||||
else
|
||||
icon_screen = "alert:0"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -425,7 +425,7 @@
|
||||
/obj/machinery/computer/syndicate_depot/teleporter/proc/findbeacon()
|
||||
if(mybeacon)
|
||||
return TRUE
|
||||
for(var/obj/machinery/bluespace_beacon/syndicate/B in myArea)
|
||||
for(var/obj/machinery/bluespace_beacon/syndicate/B in get_area(src))
|
||||
mybeacon = B
|
||||
B.mycomputer = src
|
||||
return TRUE
|
||||
|
||||
@@ -12,13 +12,9 @@
|
||||
|
||||
/obj/machinery/computer/station_alert/Initialize(mapload)
|
||||
. = ..()
|
||||
GLOB.alert_consoles += src
|
||||
RegisterSignal(SSalarm, COMSIG_TRIGGERED_ALARM, PROC_REF(alarm_triggered))
|
||||
RegisterSignal(SSalarm, COMSIG_CANCELLED_ALARM, PROC_REF(alarm_cancelled))
|
||||
|
||||
/obj/machinery/computer/station_alert/Destroy()
|
||||
GLOB.alert_consoles -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/station_alert/attack_ai(mob/user)
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -99,6 +99,15 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
|
||||
var/boltUp = 'sound/machines/boltsup.ogg'
|
||||
var/boltDown = 'sound/machines/boltsdown.ogg'
|
||||
var/is_special = FALSE
|
||||
/// Our ID tag for map-based linking shenanigans
|
||||
var/id_tag
|
||||
/// List of people who have shocked this door for logging purposes
|
||||
var/shockedby = list()
|
||||
/// Command currently being executed
|
||||
var/cur_command
|
||||
/// Is a command actually running
|
||||
var/command_running = FALSE
|
||||
|
||||
|
||||
/obj/machinery/door/airlock/welded
|
||||
welded = TRUE
|
||||
@@ -168,9 +177,6 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
|
||||
if(electrified_timer)
|
||||
deltimer(electrified_timer)
|
||||
electrified_timer = null
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
|
||||
diag_hud.remove_from_hud(src)
|
||||
return ..()
|
||||
@@ -1548,6 +1554,85 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
|
||||
else if(aiControlDisabled == AICONTROLDISABLED_BYPASS)
|
||||
aiControlDisabled = AICONTROLDISABLED_PERMA
|
||||
|
||||
/obj/machinery/door/airlock/proc/airlock_cycle_callback(cmd)
|
||||
cur_command = cmd
|
||||
INVOKE_ASYNC(src, PROC_REF(execute_current_command))
|
||||
|
||||
/obj/machinery/door/airlock/proc/execute_current_command()
|
||||
if(operating || emagged)
|
||||
return //emagged or busy doing something else
|
||||
|
||||
if(!cur_command)
|
||||
return
|
||||
|
||||
do_command(cur_command)
|
||||
if(command_completed(cur_command))
|
||||
cur_command = null
|
||||
else
|
||||
START_PROCESSING(SSmachines, src)
|
||||
|
||||
/obj/machinery/door/airlock/proc/do_command(command)
|
||||
if(command_running)
|
||||
return
|
||||
|
||||
command_running = TRUE
|
||||
switch(command)
|
||||
if("open")
|
||||
open()
|
||||
|
||||
if("close")
|
||||
close()
|
||||
|
||||
if("unlock")
|
||||
unlock()
|
||||
|
||||
if("lock")
|
||||
lock()
|
||||
|
||||
if("secure_open")
|
||||
unlock()
|
||||
|
||||
sleep(2)
|
||||
open()
|
||||
|
||||
lock()
|
||||
|
||||
if("secure_close")
|
||||
unlock()
|
||||
close()
|
||||
|
||||
lock()
|
||||
sleep(2)
|
||||
command_running = FALSE
|
||||
|
||||
/obj/machinery/door/airlock/proc/command_completed(command)
|
||||
switch(command)
|
||||
if("open")
|
||||
return (!density)
|
||||
|
||||
if("close")
|
||||
return density
|
||||
|
||||
if("unlock")
|
||||
return !locked
|
||||
|
||||
if("lock")
|
||||
return locked
|
||||
|
||||
if("secure_open")
|
||||
return (locked && !density)
|
||||
|
||||
if("secure_close")
|
||||
return (locked && density)
|
||||
|
||||
return TRUE //Unknown command. Just assume it's completed.
|
||||
|
||||
/obj/machinery/door/airlock/process()
|
||||
if(arePowerSystemsOn() && cur_command)
|
||||
execute_current_command()
|
||||
else
|
||||
return PROCESS_KILL
|
||||
|
||||
#undef AIRLOCK_CLOSED
|
||||
#undef AIRLOCK_CLOSING
|
||||
#undef AIRLOCK_OPEN
|
||||
|
||||
@@ -1,282 +0,0 @@
|
||||
#define AIRLOCK_CONTROL_RANGE 22
|
||||
|
||||
// This code allows for airlocks to be controlled externally by setting an id_tag and comm frequency (disables ID access)
|
||||
/obj/machinery/door/airlock
|
||||
var/id_tag
|
||||
var/shockedby = list()
|
||||
var/cur_command = null //the command the door is currently attempting to complete
|
||||
|
||||
/obj/machinery/door/airlock/process()
|
||||
if(arePowerSystemsOn() && cur_command)
|
||||
execute_current_command()
|
||||
else
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/machinery/door/airlock/receive_signal(datum/signal/signal)
|
||||
if(!arePowerSystemsOn())
|
||||
return //no power
|
||||
|
||||
if(!signal || signal.encryption)
|
||||
return
|
||||
|
||||
if(id_tag != signal.data["tag"] || !signal.data["command"])
|
||||
return
|
||||
|
||||
cur_command = signal.data["command"]
|
||||
spawn()
|
||||
execute_current_command()
|
||||
|
||||
/obj/machinery/door/airlock/proc/execute_current_command()
|
||||
if(operating || emagged)
|
||||
return //emagged or busy doing something else
|
||||
|
||||
if(!cur_command)
|
||||
return
|
||||
|
||||
do_command(cur_command)
|
||||
if(command_completed(cur_command))
|
||||
cur_command = null
|
||||
else
|
||||
START_PROCESSING(SSmachines, src)
|
||||
|
||||
/obj/machinery/door/airlock/proc/do_command(command)
|
||||
switch(command)
|
||||
if("open")
|
||||
open()
|
||||
|
||||
if("close")
|
||||
close()
|
||||
|
||||
if("unlock")
|
||||
unlock()
|
||||
|
||||
if("lock")
|
||||
lock()
|
||||
|
||||
if("secure_open")
|
||||
unlock()
|
||||
|
||||
sleep(2)
|
||||
open()
|
||||
|
||||
lock()
|
||||
|
||||
if("secure_close")
|
||||
unlock()
|
||||
close()
|
||||
|
||||
lock()
|
||||
sleep(2)
|
||||
|
||||
send_status()
|
||||
|
||||
/obj/machinery/door/airlock/proc/command_completed(command)
|
||||
switch(command)
|
||||
if("open")
|
||||
return (!density)
|
||||
|
||||
if("close")
|
||||
return density
|
||||
|
||||
if("unlock")
|
||||
return !locked
|
||||
|
||||
if("lock")
|
||||
return locked
|
||||
|
||||
if("secure_open")
|
||||
return (locked && !density)
|
||||
|
||||
if("secure_close")
|
||||
return (locked && density)
|
||||
|
||||
return 1 //Unknown command. Just assume it's completed.
|
||||
|
||||
/obj/machinery/door/airlock/proc/send_status(bumped = 0)
|
||||
if(radio_connection)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["timestamp"] = world.time
|
||||
|
||||
signal.data["door_status"] = density?("closed"):("open")
|
||||
signal.data["lock_status"] = locked?("locked"):("unlocked")
|
||||
|
||||
if(bumped)
|
||||
signal.data["bumped_with_access"] = 1
|
||||
|
||||
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)
|
||||
|
||||
/obj/machinery/door/airlock/open(surpress_send)
|
||||
. = ..()
|
||||
if(!surpress_send) send_status()
|
||||
|
||||
/obj/machinery/door/airlock/close(surpress_send)
|
||||
. = ..()
|
||||
if(!surpress_send) send_status()
|
||||
|
||||
/obj/machinery/door/airlock/Bumped(atom/AM)
|
||||
..(AM)
|
||||
if(ismecha(AM))
|
||||
var/obj/mecha/mecha = AM
|
||||
if(density && radio_connection && mecha.occupant && (allowed(mecha.occupant) || check_access_list(mecha.operation_req_access)))
|
||||
send_status(1)
|
||||
return
|
||||
|
||||
/obj/machinery/door/airlock/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
if(new_frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK)
|
||||
|
||||
// this is an override, in addition to the one in airlock_control.dm
|
||||
/obj/machinery/door/airlock/Initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/airlock_sensor
|
||||
icon = 'icons/obj/airlock_machines.dmi'
|
||||
icon_state = "airlock_sensor_off"
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
name = "airlock sensor"
|
||||
anchored = TRUE
|
||||
resistance_flags = FIRE_PROOF
|
||||
power_channel = ENVIRON
|
||||
|
||||
var/id_tag
|
||||
var/master_tag
|
||||
frequency = 1379
|
||||
var/command = "cycle"
|
||||
|
||||
var/on = TRUE
|
||||
var/alert = 0
|
||||
var/previousPressure
|
||||
|
||||
/obj/machinery/airlock_sensor/update_icon_state()
|
||||
if(on)
|
||||
if(alert)
|
||||
icon_state = "airlock_sensor_alert"
|
||||
else
|
||||
icon_state = "airlock_sensor_standby"
|
||||
else
|
||||
icon_state = "airlock_sensor_off"
|
||||
|
||||
/obj/machinery/airlock_sensor/attack_hand(mob/user)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = master_tag
|
||||
signal.data["command"] = command
|
||||
|
||||
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)
|
||||
flick("airlock_sensor_cycle", src)
|
||||
|
||||
/obj/machinery/airlock_sensor/process()
|
||||
if(on)
|
||||
var/datum/gas_mixture/air_sample = return_air()
|
||||
var/pressure = round(air_sample.return_pressure(),0.1)
|
||||
|
||||
if(abs(pressure - previousPressure) > 0.001 || previousPressure == null)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = id_tag
|
||||
signal.data["timestamp"] = world.time
|
||||
signal.data["pressure"] = num2text(pressure)
|
||||
|
||||
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)
|
||||
|
||||
previousPressure = pressure
|
||||
|
||||
alert = (pressure < ONE_ATMOSPHERE*0.8)
|
||||
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/airlock_sensor/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK)
|
||||
|
||||
/obj/machinery/airlock_sensor/Initialize(mapload)
|
||||
. = ..()
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/airlock_sensor/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/airlock_sensor/airlock_interior
|
||||
command = "cycle_interior"
|
||||
|
||||
/obj/machinery/airlock_sensor/airlock_exterior
|
||||
command = "cycle_exterior"
|
||||
|
||||
/obj/machinery/access_button
|
||||
icon = 'icons/obj/airlock_machines.dmi'
|
||||
icon_state = "access_button_standby"
|
||||
name = "access button"
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
anchored = TRUE
|
||||
power_channel = ENVIRON
|
||||
var/master_tag
|
||||
frequency = AIRLOCK_FREQ
|
||||
var/command = "cycle"
|
||||
var/on = TRUE
|
||||
|
||||
/obj/machinery/access_button/update_icon_state()
|
||||
if(on)
|
||||
icon_state = "access_button_standby"
|
||||
else
|
||||
icon_state = "access_button_off"
|
||||
|
||||
/obj/machinery/access_button/attackby(obj/item/I, mob/user, params)
|
||||
//Swiping ID on the access button
|
||||
if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda))
|
||||
attack_hand(user)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/access_button/attack_ghost(mob/user)
|
||||
if(user.can_advanced_admin_interact())
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/access_button/attack_hand(mob/user)
|
||||
add_fingerprint(usr)
|
||||
|
||||
if(!allowed(user) && !user.can_advanced_admin_interact())
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
|
||||
else if(radio_connection)
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.data["tag"] = master_tag
|
||||
signal.data["command"] = command
|
||||
|
||||
radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK)
|
||||
flick("access_button_cycle", src)
|
||||
|
||||
/obj/machinery/access_button/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK)
|
||||
|
||||
/obj/machinery/access_button/Initialize(mapload)
|
||||
. = ..()
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/access_button/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/access_button/airlock_interior
|
||||
frequency = 1379
|
||||
command = "cycle_interior"
|
||||
|
||||
/obj/machinery/access_button/airlock_exterior
|
||||
frequency = 1379
|
||||
command = "cycle_exterior"
|
||||
@@ -1,41 +0,0 @@
|
||||
/obj/machinery/door/airlock/alarmlock
|
||||
name = "glass alarm airlock"
|
||||
icon = 'icons/obj/doors/airlocks/station2/glass.dmi'
|
||||
overlays_file = 'icons/obj/doors/airlocks/station2/overlays.dmi'
|
||||
opacity = FALSE
|
||||
glass = TRUE
|
||||
autoclose = FALSE
|
||||
var/datum/radio_frequency/air_connection
|
||||
var/air_frequency = ATMOS_FIRE_FREQ
|
||||
|
||||
/obj/machinery/door/airlock/alarmlock/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src,air_frequency)
|
||||
air_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/airlock/alarmlock/Initialize()
|
||||
. = ..()
|
||||
air_connection = new
|
||||
SSradio.remove_object(src, air_frequency)
|
||||
air_connection = SSradio.add_object(src, air_frequency, RADIO_TO_AIRALARM)
|
||||
open()
|
||||
|
||||
/obj/machinery/door/airlock/alarmlock/receive_signal(datum/signal/signal)
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
var/alarm_area = signal.data["zone"]
|
||||
var/alert = signal.data["alert"]
|
||||
|
||||
var/area/our_area = get_area(src)
|
||||
|
||||
if(alarm_area == our_area.name)
|
||||
switch(alert)
|
||||
if("severe")
|
||||
autoclose = TRUE
|
||||
close()
|
||||
if("minor", "clear")
|
||||
autoclose = FALSE
|
||||
open()
|
||||
@@ -45,17 +45,16 @@
|
||||
var/polarized_glass = FALSE
|
||||
var/polarized_on
|
||||
|
||||
/obj/machinery/door/New()
|
||||
..()
|
||||
GLOB.airlocks += src
|
||||
update_freelook_sight()
|
||||
|
||||
/obj/machinery/door/Initialize(mapload)
|
||||
. = ..()
|
||||
set_init_door_layer()
|
||||
update_dir()
|
||||
update_freelook_sight()
|
||||
spark_system = new /datum/effect_system/spark_spread
|
||||
spark_system.set_up(2, 1, src)
|
||||
// Yes I know this isnt an airlock but its required because of the dumb reason of
|
||||
// pod doors and shutters similar using this list as well
|
||||
GLOB.airlocks += src
|
||||
|
||||
//doors only block while dense though so we have to use the proc
|
||||
real_explosion_block = explosion_block
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
//base type for controllers of two-door systems
|
||||
/obj/machinery/embedded_controller/radio/airlock
|
||||
layer = ABOVE_WINDOW_LAYER
|
||||
// Setup parameters only
|
||||
radio_filter = RADIO_AIRLOCK
|
||||
var/tag_exterior_door
|
||||
var/tag_interior_door
|
||||
var/tag_airpump
|
||||
var/tag_chamber_sensor
|
||||
var/tag_exterior_sensor
|
||||
var/tag_interior_sensor
|
||||
var/tag_airlock_mech_sensor
|
||||
var/tag_shuttle_mech_sensor
|
||||
var/tag_secure = 0
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/Initialize(mapload)
|
||||
. = ..()
|
||||
program = new/datum/computer/file/embedded_program/airlock(src)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/Destroy()
|
||||
QDEL_NULL(program)
|
||||
return ..()
|
||||
|
||||
//Airlock controller for airlock control - most airlocks on the station use this
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller
|
||||
name = "Airlock Controller"
|
||||
tag_secure = 1
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller/Initialize(mapload, given_id_tag, given_frequency, given_tag_exterior_door, given_tag_interior_door, given_tag_airpump, given_tag_chamber_sensor)
|
||||
if(given_id_tag)
|
||||
id_tag = given_id_tag
|
||||
if(given_frequency)
|
||||
set_frequency(given_frequency)
|
||||
if(given_tag_exterior_door)
|
||||
tag_exterior_door = given_tag_exterior_door
|
||||
if(given_tag_interior_door)
|
||||
tag_interior_door = given_tag_interior_door
|
||||
if(given_tag_airpump)
|
||||
tag_airpump = given_tag_airpump
|
||||
if(given_tag_chamber_sensor)
|
||||
tag_chamber_sensor = given_tag_chamber_sensor
|
||||
..()
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "ExternalAirlockController", name, 470, 290, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["chamber_pressure"] = round(program.memory["chamber_sensor_pressure"])
|
||||
data["exterior_status"] = program.memory["exterior_status"]
|
||||
data["interior_status"] = program.memory["interior_status"]
|
||||
data["processing"] = program.memory["processing"]
|
||||
|
||||
return data
|
||||
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/airlock_controller/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
var/list/allowed_actions = list("cycle_ext", "cycle_int", "force_ext", "force_int", "abort")
|
||||
if(action in allowed_actions) //anti-HTML-hacking checks
|
||||
program.receive_user_command(action)
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
//Access controller for door control - used in virology and the like
|
||||
/obj/machinery/embedded_controller/radio/airlock/access_controller
|
||||
icon = 'icons/obj/airlock_machines.dmi'
|
||||
icon_state = "access_control_standby"
|
||||
|
||||
name = "Access Controller"
|
||||
tag_secure = 1
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/access_controller/update_icon_state()
|
||||
if(on && program)
|
||||
if(program.memory["processing"])
|
||||
icon_state = "access_control_process"
|
||||
else
|
||||
icon_state = "access_control_standby"
|
||||
else
|
||||
icon_state = "access_control_off"
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/access_controller/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "AirlockAccessController", name, 470, 290, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/access_controller/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["exterior_status"] = program.memory["exterior_status"]
|
||||
data["interior_status"] = program.memory["interior_status"]
|
||||
data["processing"] = program.memory["processing"]
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/embedded_controller/radio/airlock/access_controller/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
add_fingerprint(usr)
|
||||
|
||||
var/clean = FALSE
|
||||
|
||||
// Repeat the frontend check to make sure only allowed command are sent. You are only allowed to lock or cycle exterior if exterior is open
|
||||
// Vice versa for internal
|
||||
|
||||
switch(action)
|
||||
if("cycle_ext_door")
|
||||
clean = TRUE
|
||||
if("cycle_int_door")
|
||||
clean = TRUE
|
||||
if("force_ext") // Cannot force exterior if interior open
|
||||
if(program.memory["interior_status"]["state"] == "closed" && program.memory["exterior_status"]["state"] == "open")
|
||||
clean = TRUE
|
||||
if("force_int") // Cannot force interior if exterior open
|
||||
if(program.memory["exterior_status"]["state"] == "closed" && program.memory["interior_status"]["state"] == "open")
|
||||
clean = TRUE
|
||||
|
||||
if(clean)
|
||||
program.receive_user_command(action)
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -1,382 +0,0 @@
|
||||
//Handles the control of airlocks
|
||||
|
||||
#define STATE_IDLE 0
|
||||
#define STATE_PREPARE 1
|
||||
#define STATE_DEPRESSURIZE 2
|
||||
#define STATE_PRESSURIZE 3
|
||||
|
||||
#define TARGET_NONE 0
|
||||
#define TARGET_INOPEN -1
|
||||
#define TARGET_OUTOPEN -2
|
||||
|
||||
|
||||
/datum/computer/file/embedded_program/airlock
|
||||
var/tag_exterior_door
|
||||
var/tag_interior_door
|
||||
var/tag_airpump
|
||||
var/tag_chamber_sensor
|
||||
var/tag_exterior_sensor
|
||||
var/tag_interior_sensor
|
||||
var/tag_airlock_mech_sensor
|
||||
var/tag_shuttle_mech_sensor
|
||||
|
||||
var/state = STATE_IDLE
|
||||
var/target_state = TARGET_NONE
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/New(obj/machinery/embedded_controller/M)
|
||||
..(M)
|
||||
|
||||
memory["chamber_sensor_pressure"] = ONE_ATMOSPHERE
|
||||
memory["external_sensor_pressure"] = 0 //assume vacuum for simple airlock controller
|
||||
memory["internal_sensor_pressure"] = ONE_ATMOSPHERE
|
||||
memory["exterior_status"] = list(state = "closed", lock = "locked") //assume closed and locked in case the doors dont report in
|
||||
memory["interior_status"] = list(state = "closed", lock = "locked")
|
||||
memory["pump_status"] = "unknown"
|
||||
memory["target_pressure"] = ONE_ATMOSPHERE
|
||||
memory["purge"] = 0
|
||||
memory["secure"] = 0
|
||||
|
||||
if(istype(M, /obj/machinery/embedded_controller/radio/airlock)) //if our controller is an airlock controller than we can auto-init our tags
|
||||
var/obj/machinery/embedded_controller/radio/airlock/controller = M
|
||||
tag_exterior_door = controller.tag_exterior_door? controller.tag_exterior_door : "[id_tag]_outer"
|
||||
tag_interior_door = controller.tag_interior_door? controller.tag_interior_door : "[id_tag]_inner"
|
||||
tag_airpump = controller.tag_airpump? controller.tag_airpump : "[id_tag]_pump"
|
||||
tag_chamber_sensor = controller.tag_chamber_sensor? controller.tag_chamber_sensor : "[id_tag]_sensor"
|
||||
tag_exterior_sensor = controller.tag_exterior_sensor
|
||||
tag_interior_sensor = controller.tag_interior_sensor
|
||||
tag_airlock_mech_sensor = controller.tag_airlock_mech_sensor? controller.tag_airlock_mech_sensor : "[id_tag]_airlock_mech"
|
||||
tag_shuttle_mech_sensor = controller.tag_shuttle_mech_sensor? controller.tag_shuttle_mech_sensor : "[id_tag]_shuttle_mech"
|
||||
memory["secure"] = controller.tag_secure
|
||||
|
||||
spawn(10)
|
||||
signalDoor(tag_exterior_door, "update") //signals connected doors to update their status
|
||||
signalDoor(tag_interior_door, "update")
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
var/receive_tag = signal.data["tag"]
|
||||
if(!receive_tag) return
|
||||
|
||||
if(receive_tag==tag_chamber_sensor)
|
||||
if(signal.data["pressure"])
|
||||
memory["chamber_sensor_pressure"] = text2num(signal.data["pressure"])
|
||||
|
||||
else if(receive_tag==tag_exterior_sensor)
|
||||
memory["external_sensor_pressure"] = text2num(signal.data["pressure"])
|
||||
|
||||
else if(receive_tag==tag_interior_sensor)
|
||||
memory["internal_sensor_pressure"] = text2num(signal.data["pressure"])
|
||||
|
||||
else if(receive_tag==tag_exterior_door)
|
||||
memory["exterior_status"]["state"] = signal.data["door_status"]
|
||||
memory["exterior_status"]["lock"] = signal.data["lock_status"]
|
||||
|
||||
else if(receive_tag==tag_interior_door)
|
||||
memory["interior_status"]["state"] = signal.data["door_status"]
|
||||
memory["interior_status"]["lock"] = signal.data["lock_status"]
|
||||
|
||||
else if(receive_tag==tag_airpump)
|
||||
if(signal.data["power"])
|
||||
memory["pump_status"] = signal.data["direction"]
|
||||
else
|
||||
memory["pump_status"] = "off"
|
||||
|
||||
else if(receive_tag==id_tag)
|
||||
if(istype(master, /obj/machinery/embedded_controller/radio/airlock/access_controller))
|
||||
switch(signal.data["command"])
|
||||
if("cycle_exterior")
|
||||
receive_user_command("cycle_ext_door")
|
||||
if("cycle_interior")
|
||||
receive_user_command("cycle_int_door")
|
||||
if("cycle")
|
||||
if(memory["interior_status"]["state"] == "open") //handle backwards compatibility
|
||||
receive_user_command("cycle_ext")
|
||||
else
|
||||
receive_user_command("cycle_int")
|
||||
else
|
||||
switch(signal.data["command"])
|
||||
if("cycle_exterior")
|
||||
receive_user_command("cycle_ext")
|
||||
if("cycle_interior")
|
||||
receive_user_command("cycle_int")
|
||||
if("cycle")
|
||||
if(memory["interior_status"]["state"] == "open") //handle backwards compatibility
|
||||
receive_user_command("cycle_ext")
|
||||
else
|
||||
receive_user_command("cycle_int")
|
||||
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/receive_user_command(command)
|
||||
var/shutdown_pump = 0
|
||||
switch(command)
|
||||
if("cycle_ext")
|
||||
begin_cycle_out()
|
||||
|
||||
if("cycle_int")
|
||||
begin_cycle_in()
|
||||
|
||||
if("cycle_ext_door")
|
||||
cycleDoors(TARGET_OUTOPEN)
|
||||
|
||||
if("cycle_int_door")
|
||||
cycleDoors(TARGET_INOPEN)
|
||||
|
||||
if("abort")
|
||||
stop_cycling()
|
||||
/*
|
||||
//dont do this. If the airlock can't get enough air to pressurize the person inside is stuck
|
||||
state = STATE_PRESSURIZE
|
||||
target_state = TARGET_NONE
|
||||
memory["target_pressure"] = ONE_ATMOSPHERE
|
||||
signalPump(tag_airpump, 1, 1, memory["target_pressure"])
|
||||
process()
|
||||
*/
|
||||
|
||||
if("force_ext")
|
||||
toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "toggle")
|
||||
|
||||
if("force_int")
|
||||
toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "toggle")
|
||||
|
||||
if("purge")
|
||||
memory["purge"] = !memory["purge"]
|
||||
if(memory["purge"])
|
||||
toggleDoor(memory["exterior_status"], tag_exterior_door, 1, "close")
|
||||
toggleDoor(memory["interior_status"], tag_interior_door, 1, "close")
|
||||
state = STATE_DEPRESSURIZE
|
||||
target_state = TARGET_NONE
|
||||
signalPump(tag_airpump, 1, 0, 0)
|
||||
|
||||
if("secure")
|
||||
memory["secure"] = !memory["secure"]
|
||||
if(memory["secure"])
|
||||
signalDoor(tag_interior_door, "lock")
|
||||
signalDoor(tag_exterior_door, "lock")
|
||||
else
|
||||
signalDoor(tag_interior_door, "unlock")
|
||||
signalDoor(tag_exterior_door, "unlock")
|
||||
|
||||
if(shutdown_pump)
|
||||
signalPump(tag_airpump, 0) //send a signal to stop pressurizing
|
||||
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/process()
|
||||
if(!state) //Idle
|
||||
if(target_state)
|
||||
switch(target_state)
|
||||
if(TARGET_INOPEN)
|
||||
memory["target_pressure"] = memory["internal_sensor_pressure"]
|
||||
if(TARGET_OUTOPEN)
|
||||
memory["target_pressure"] = memory["external_sensor_pressure"]
|
||||
|
||||
//lock down the airlock before activating pumps
|
||||
close_doors()
|
||||
|
||||
state = STATE_PREPARE
|
||||
else
|
||||
//make sure to return to a sane idle state
|
||||
if(memory["pump_status"] != "off") //send a signal to stop pumping
|
||||
signalPump(tag_airpump, 0)
|
||||
|
||||
if((state == STATE_PRESSURIZE || state == STATE_DEPRESSURIZE) && !check_doors_secured())
|
||||
//the airlock will not allow itself to continue to cycle when any of the doors are forced open.
|
||||
stop_cycling()
|
||||
|
||||
switch(state)
|
||||
if(STATE_PREPARE)
|
||||
if(check_doors_secured())
|
||||
var/chamber_pressure = memory["chamber_sensor_pressure"]
|
||||
var/target_pressure = memory["target_pressure"]
|
||||
|
||||
if(memory["purge"])
|
||||
target_pressure = 0
|
||||
|
||||
if(memory["purge"])
|
||||
target_pressure = 0
|
||||
|
||||
if(chamber_pressure <= target_pressure)
|
||||
state = STATE_PRESSURIZE
|
||||
signalPump(tag_airpump, 1, 1, target_pressure) //send a signal to start pressurizing
|
||||
|
||||
else if(chamber_pressure > target_pressure)
|
||||
state = STATE_DEPRESSURIZE
|
||||
signalPump(tag_airpump, 1, 0, target_pressure) //send a signal to start depressurizing
|
||||
|
||||
//Check for vacuum - this is set after the pumps so the pumps are aiming for 0
|
||||
if(!memory["target_pressure"])
|
||||
memory["target_pressure"] = ONE_ATMOSPHERE * 0.05
|
||||
|
||||
if(STATE_PRESSURIZE)
|
||||
if(memory["chamber_sensor_pressure"] >= memory["target_pressure"] * 0.95)
|
||||
cycleDoors(target_state)
|
||||
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
if(memory["pump_status"] != "off")
|
||||
signalPump(tag_airpump, 0) //send a signal to stop pumping
|
||||
|
||||
|
||||
if(STATE_DEPRESSURIZE)
|
||||
if(memory["purge"])
|
||||
if(memory["chamber_sensor_pressure"] <= ONE_ATMOSPHERE * 0.05)
|
||||
state = STATE_PRESSURIZE
|
||||
signalPump(tag_airpump, 1, 1, memory["target_pressure"])
|
||||
|
||||
|
||||
else if(memory["chamber_sensor_pressure"] <= memory["target_pressure"] * 1.05)
|
||||
cycleDoors(target_state)
|
||||
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
//send a signal to stop pumping
|
||||
if(memory["pump_status"] != "off")
|
||||
signalPump(tag_airpump, 0)
|
||||
|
||||
|
||||
memory["processing"] = state != target_state
|
||||
|
||||
return 1
|
||||
|
||||
//these are here so that other types don't have to make so many assuptions about our implementation
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/begin_cycle_in()
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_INOPEN
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/begin_cycle_out()
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_OUTOPEN
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/close_doors()
|
||||
toggleDoor(memory["interior_status"], tag_interior_door, 1, "close")
|
||||
toggleDoor(memory["exterior_status"], tag_exterior_door, 1, "close")
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/stop_cycling()
|
||||
state = STATE_IDLE
|
||||
target_state = TARGET_NONE
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/done_cycling()
|
||||
return (state == STATE_IDLE && target_state == TARGET_NONE)
|
||||
|
||||
//are the doors closed and locked?
|
||||
/datum/computer/file/embedded_program/airlock/proc/check_exterior_door_secured()
|
||||
return (memory["exterior_status"]["state"] == "closed" && memory["exterior_status"]["lock"] == "locked")
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/check_interior_door_secured()
|
||||
return (memory["interior_status"]["state"] == "closed" && memory["interior_status"]["lock"] == "locked")
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/check_doors_secured()
|
||||
var/ext_closed = check_exterior_door_secured()
|
||||
var/int_closed = check_interior_door_secured()
|
||||
return (ext_closed && int_closed)
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/signalDoor(tag, command)
|
||||
var/datum/signal/signal = new
|
||||
signal.data["tag"] = tag
|
||||
signal.data["command"] = command
|
||||
post_signal(signal, RADIO_AIRLOCK)
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/signalPump(tag, power, direction, pressure)
|
||||
var/datum/signal/signal = new
|
||||
signal.data = list(
|
||||
"tag" = tag,
|
||||
"sigtype" = "command",
|
||||
"power" = power,
|
||||
"direction" = direction,
|
||||
"set_external_pressure" = pressure
|
||||
)
|
||||
post_signal(signal)
|
||||
|
||||
//this is called to set the appropriate door state at the end of a cycling process, or for the exterior buttons
|
||||
/datum/computer/file/embedded_program/airlock/proc/cycleDoors(target)
|
||||
switch(target)
|
||||
if(TARGET_OUTOPEN)
|
||||
toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "close")
|
||||
toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "open")
|
||||
|
||||
if(TARGET_INOPEN)
|
||||
toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "close")
|
||||
toggleDoor(memory["interior_status"], tag_interior_door, memory["secure"], "open")
|
||||
if(TARGET_NONE)
|
||||
var/command = "unlock"
|
||||
if(memory["secure"])
|
||||
command = "lock"
|
||||
signalDoor(tag_exterior_door, command)
|
||||
signalDoor(tag_interior_door, command)
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/signal_mech_sensor(command, sensor)
|
||||
var/datum/signal/signal = new
|
||||
signal.data["tag"] = sensor
|
||||
signal.data["command"] = command
|
||||
post_signal(signal)
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/enable_mech_regulation()
|
||||
signal_mech_sensor("enable", tag_shuttle_mech_sensor)
|
||||
signal_mech_sensor("enable", tag_airlock_mech_sensor)
|
||||
|
||||
/datum/computer/file/embedded_program/airlock/proc/disable_mech_regulation()
|
||||
signal_mech_sensor("disable", tag_shuttle_mech_sensor)
|
||||
signal_mech_sensor("disable", tag_airlock_mech_sensor)
|
||||
|
||||
/*----------------------------------------------------------
|
||||
toggleDoor()
|
||||
|
||||
Sends a radio command to a door to either open or close. If
|
||||
the command is 'toggle' the door will be sent a command that
|
||||
reverses it's current state.
|
||||
Can also toggle whether the door bolts are locked or not,
|
||||
depending on the state of the 'secure' flag.
|
||||
Only sends a command if it is needed, i.e. if the door is
|
||||
already open, passing an open command to this proc will not
|
||||
send an additional command to open the door again.
|
||||
----------------------------------------------------------*/
|
||||
/datum/computer/file/embedded_program/airlock/proc/toggleDoor(list/doorStatus, doorTag, secure, command)
|
||||
var/doorCommand = null
|
||||
|
||||
if(command == "toggle")
|
||||
if(doorStatus["state"] == "open")
|
||||
command = "close"
|
||||
else if(doorStatus["state"] == "closed")
|
||||
command = "open"
|
||||
|
||||
switch(command)
|
||||
if("close")
|
||||
if(secure)
|
||||
if(doorStatus["state"] == "open")
|
||||
doorCommand = "secure_close"
|
||||
else if(doorStatus["lock"] == "unlocked")
|
||||
doorCommand = "lock"
|
||||
else
|
||||
if(doorStatus["state"] == "open")
|
||||
if(doorStatus["lock"] == "locked")
|
||||
signalDoor(doorTag, "unlock")
|
||||
doorCommand = "close"
|
||||
else if(doorStatus["lock"] == "locked")
|
||||
doorCommand = "unlock"
|
||||
|
||||
if("open")
|
||||
if(secure)
|
||||
if(doorStatus["state"] == "closed")
|
||||
doorCommand = "secure_open"
|
||||
else if(doorStatus["lock"] == "unlocked")
|
||||
doorCommand = "lock"
|
||||
else
|
||||
if(doorStatus["state"] == "closed")
|
||||
if(doorStatus["lock"] == "locked")
|
||||
signalDoor(doorTag,"unlock")
|
||||
doorCommand = "open"
|
||||
else if(doorStatus["lock"] == "locked")
|
||||
doorCommand = "unlock"
|
||||
|
||||
if(doorCommand)
|
||||
signalDoor(doorTag, doorCommand)
|
||||
|
||||
|
||||
#undef STATE_IDLE
|
||||
#undef STATE_DEPRESSURIZE
|
||||
#undef STATE_PRESSURIZE
|
||||
|
||||
#undef TARGET_NONE
|
||||
#undef TARGET_INOPEN
|
||||
#undef TARGET_OUTOPEN
|
||||
@@ -1,87 +0,0 @@
|
||||
/obj/machinery/embedded_controller
|
||||
var/datum/computer/file/embedded_program/program //the currently executing program
|
||||
|
||||
name = "Embedded Controller"
|
||||
anchored = TRUE
|
||||
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 10
|
||||
|
||||
var/on = TRUE
|
||||
|
||||
/obj/machinery/embedded_controller/Destroy()
|
||||
program = null // we probably should qdel it here, but that would break shared programs. Not that we should have those..
|
||||
return ..()
|
||||
|
||||
/obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line)
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/embedded_controller/receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
if(!signal || signal.encryption) return
|
||||
|
||||
if(program)
|
||||
program.receive_signal(signal, receive_method, receive_param)
|
||||
//spawn(5) program.process() //no, program.process sends some signals and machines respond and we here again and we lag -rastaf0
|
||||
|
||||
/obj/machinery/embedded_controller/process()
|
||||
if(program)
|
||||
program.process()
|
||||
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/embedded_controller/attack_ghost(mob/user as mob)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/embedded_controller/attack_ai(mob/user as mob)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/embedded_controller/attack_hand(mob/user as mob)
|
||||
if(!user.IsAdvancedToolUser())
|
||||
return FALSE
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/embedded_controller/radio
|
||||
icon = 'icons/obj/airlock_machines.dmi'
|
||||
icon_state = "airlock_control_standby"
|
||||
power_channel = ENVIRON
|
||||
density = FALSE
|
||||
|
||||
var/id_tag
|
||||
//var/radio_power_use = 50 //power used to xmit signals
|
||||
|
||||
frequency = 1379
|
||||
var/radio_filter = null
|
||||
resistance_flags = FIRE_PROOF | ACID_PROOF
|
||||
|
||||
/obj/machinery/embedded_controller/radio/Initialize(mapload)
|
||||
. = ..()
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/embedded_controller/radio/update_icon_state()
|
||||
if(on && program)
|
||||
if(program.memory["processing"])
|
||||
icon_state = "airlock_control_process"
|
||||
else
|
||||
icon_state = "airlock_control_standby"
|
||||
else
|
||||
icon_state = "airlock_control_off"
|
||||
|
||||
/obj/machinery/embedded_controller/radio/post_signal(datum/signal/signal, filter = null)
|
||||
signal.transmission_method = TRANSMISSION_RADIO
|
||||
if(radio_connection)
|
||||
//use_power(radio_power_use) //neat idea, but causes way too much lag.
|
||||
return radio_connection.post_signal(src, signal, filter)
|
||||
else
|
||||
qdel(signal)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, radio_filter)
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
/datum/computer/file/embedded_program
|
||||
var/list/memory = list()
|
||||
var/obj/machinery/embedded_controller/master
|
||||
|
||||
var/id_tag
|
||||
|
||||
/datum/computer/file/embedded_program/New(obj/machinery/embedded_controller/M)
|
||||
master = M
|
||||
if(istype(M, /obj/machinery/embedded_controller/radio))
|
||||
var/obj/machinery/embedded_controller/radio/R = M
|
||||
id_tag = R.id_tag
|
||||
|
||||
/datum/computer/file/embedded_program/Destroy()
|
||||
master = null
|
||||
memory.Cut()
|
||||
return ..()
|
||||
|
||||
/datum/computer/file/embedded_program/proc/receive_user_command(command)
|
||||
return
|
||||
|
||||
/datum/computer/file/embedded_program/proc/receive_signal(datum/signal/signal, receive_method, receive_param)
|
||||
return
|
||||
|
||||
/datum/computer/file/embedded_program/process()
|
||||
return FALSE
|
||||
|
||||
/datum/computer/file/embedded_program/proc/post_signal(datum/signal/signal, comm_line)
|
||||
if(master)
|
||||
master.post_signal(signal, comm_line)
|
||||
else
|
||||
qdel(signal)
|
||||
@@ -210,7 +210,7 @@ FIRE ALARM
|
||||
/obj/machinery/firealarm/obj_break(damage_flag)
|
||||
if(!(stat & BROKEN) && !(flags & NODECONSTRUCT) && buildstage != 0) //can't break the electronics if there isn't any inside.
|
||||
stat |= BROKEN
|
||||
LAZYREMOVE(myArea.firealarms, src)
|
||||
LAZYREMOVE(get_area(src).firealarms, src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/firealarm/deconstruct(disassembled = TRUE)
|
||||
@@ -305,8 +305,7 @@ FIRE ALARM
|
||||
setDir(direction)
|
||||
set_pixel_offsets_from_dir(26, -26, 26, -26)
|
||||
|
||||
myArea = get_area(src)
|
||||
LAZYADD(myArea.firealarms, src)
|
||||
LAZYADD(get_area(src).firealarms, src)
|
||||
|
||||
/obj/machinery/firealarm/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -316,7 +315,7 @@ FIRE ALARM
|
||||
|
||||
/obj/machinery/firealarm/Destroy()
|
||||
LAZYREMOVE(GLOB.firealarm_soundloop.output_atoms, src)
|
||||
LAZYREMOVE(myArea.firealarms, src)
|
||||
LAZYREMOVE(get_area(src).firealarms, src)
|
||||
return ..()
|
||||
|
||||
/*
|
||||
|
||||
@@ -46,9 +46,16 @@
|
||||
var/duration = 5
|
||||
var/print_cooldown = 0
|
||||
|
||||
var/static/global_terminal_id = 0
|
||||
var/my_terminal_id
|
||||
|
||||
var/list/internal_log = list()
|
||||
var/mode = FALSE // FALSE - making pass, TRUE - viewing logs
|
||||
|
||||
/obj/machinery/computer/guestpass/Initialize(mapload)
|
||||
. = ..()
|
||||
my_terminal_id = ++global_terminal_id
|
||||
|
||||
/obj/machinery/computer/guestpass/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/card/id))
|
||||
if(!scan)
|
||||
@@ -153,7 +160,7 @@
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>Invalid duration.</span>")
|
||||
if("print")
|
||||
var/dat = "<h3>Activity log of guest pass terminal #[uid]</h3><br>"
|
||||
var/dat = "<h3>Activity log of guest pass terminal #[global_terminal_id]</h3><br>"
|
||||
for(var/entry in internal_log)
|
||||
dat += "[entry]<br><hr>"
|
||||
var/obj/item/paper/P = new /obj/item/paper(loc)
|
||||
|
||||
@@ -81,14 +81,6 @@
|
||||
power_change()
|
||||
..(severity)
|
||||
|
||||
/obj/machinery/light_switch/multitool_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
|
||||
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
|
||||
return
|
||||
|
||||
update_multitool_menu(user)
|
||||
|
||||
/obj/machinery/light_switch/wrench_act(mob/user, obj/item/I)
|
||||
. = TRUE
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
pressure_resistance = 15
|
||||
max_integrity = 200
|
||||
layer = BELOW_OBJ_LAYER
|
||||
armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
|
||||
atom_say_verb = "beeps"
|
||||
var/stat = 0
|
||||
var/use_power = IDLE_POWER_USE
|
||||
//0 = dont run the auto
|
||||
@@ -15,21 +17,11 @@
|
||||
var/active_power_usage = 0
|
||||
var/power_channel = EQUIP //EQUIP,ENVIRON or LIGHT
|
||||
var/list/component_parts = null //list of all the parts used to build it, if made from certain kinds of frames.
|
||||
var/uid
|
||||
var/global/gl_uid = 1
|
||||
var/panel_open = FALSE
|
||||
var/area/myArea
|
||||
var/interact_offline = FALSE // Can the machine be interacted with while de-powered.
|
||||
var/list/settagwhitelist // (Init this list if needed) WHITELIST OF VARIABLES THAT THE set_tag HREF CAN MODIFY, DON'T PUT SHIT YOU DON'T NEED ON HERE, AND IF YOU'RE GONNA USE set_tag (format_tag() proc), ADD TO THIS LIST.
|
||||
atom_say_verb = "beeps"
|
||||
var/siemens_strength = 0.7 // how badly will it shock you?
|
||||
/// The frequency on which the machine can communicate. Used with `/datum/radio_frequency`.
|
||||
var/frequency = NONE // AA TODO - KILL THIS WRETCHED HAG
|
||||
/// A reference to a `datum/radio_frequency`. Gives the machine the ability to interact with things using radio signals.
|
||||
var/datum/radio_frequency/radio_connection
|
||||
/// This is if the machinery is being repaired
|
||||
var/being_repaired = FALSE
|
||||
armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70)
|
||||
|
||||
/*
|
||||
* reimp, attempts to flicker this machinery if the behavior is supported.
|
||||
@@ -49,9 +41,6 @@
|
||||
|
||||
GLOB.machines += src
|
||||
|
||||
if(use_power)
|
||||
myArea = get_area(src)
|
||||
|
||||
if(!speed_process)
|
||||
START_PROCESSING(SSmachines, src)
|
||||
else
|
||||
@@ -76,8 +65,6 @@
|
||||
START_PROCESSING(SSmachines, src)
|
||||
|
||||
/obj/machinery/Destroy()
|
||||
if(myArea)
|
||||
myArea = null
|
||||
GLOB.machines.Remove(src)
|
||||
if(!speed_process)
|
||||
STOP_PROCESSING(SSmachines, src)
|
||||
@@ -85,12 +72,10 @@
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
return ..()
|
||||
|
||||
// This needs to die
|
||||
/obj/machinery/proc/locate_machinery()
|
||||
return
|
||||
|
||||
/obj/machinery/proc/set_frequency()
|
||||
return
|
||||
|
||||
/obj/machinery/process() // If you dont use process or power why are you here
|
||||
return PROCESS_KILL
|
||||
|
||||
@@ -120,107 +105,12 @@
|
||||
flicker()
|
||||
return 1
|
||||
|
||||
/obj/machinery/proc/multitool_topic(mob/user, list/href_list, obj/O)
|
||||
if("set_id" in href_list)
|
||||
if(!("id_tag" in vars))
|
||||
warning("set_id: [type] has no id_tag var.")
|
||||
var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID tag for this machine", src, src:id_tag) as null|text),1,MAX_MESSAGE_LEN)
|
||||
if(newid)
|
||||
src:id_tag = newid
|
||||
return TRUE
|
||||
if("set_freq" in href_list)
|
||||
if(!("frequency" in vars))
|
||||
warning("set_freq: [type] has no frequency var.")
|
||||
return FALSE
|
||||
var/newfreq=src:frequency
|
||||
if(href_list["set_freq"]!="-1")
|
||||
newfreq=text2num(href_list["set_freq"])
|
||||
else
|
||||
newfreq = input(usr, "Specify a new frequency (GHz). Decimals assigned automatically.", src, src:frequency) as null|num
|
||||
if(newfreq)
|
||||
if(findtext(num2text(newfreq), "."))
|
||||
newfreq *= 10 // shift the decimal one place
|
||||
set_frequency(sanitize_frequency(newfreq, RADIO_LOW_FREQ, RADIO_HIGH_FREQ))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/proc/handle_multitool_topic(href, list/href_list, mob/user)
|
||||
if(!allowed(user))//no, not even HREF exploits
|
||||
return FALSE
|
||||
var/obj/item/multitool/P = get_multitool(usr)
|
||||
if(P && istype(P))
|
||||
var/update_mt_menu = FALSE
|
||||
if("set_tag" in href_list && settagwhitelist)
|
||||
if(!(href_list["set_tag"] in settagwhitelist))//I see you're trying Href exploits, I see you're failing, I SEE ADMIN WARNING. (seriously though, this is a powerfull HREF, I originally found this loophole, I'm not leaving it in on my PR)
|
||||
message_admins("set_tag HREF (var attempted to edit: [href_list["set_tag"]]) exploit attempted by [key_name_admin(user)] on [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
|
||||
return FALSE
|
||||
if(!(href_list["set_tag"] in vars))
|
||||
to_chat(usr, "<span class='warning'>Something went wrong: Unable to find [href_list["set_tag"]] in vars!</span>")
|
||||
return FALSE
|
||||
var/current_tag = vars[href_list["set_tag"]]
|
||||
var/newid = copytext(reject_bad_text(input(usr, "Specify the new value", src, current_tag) as null|text),1,MAX_MESSAGE_LEN)
|
||||
if(newid)
|
||||
vars[href_list["set_tag"]] = newid
|
||||
update_mt_menu = TRUE
|
||||
|
||||
if("unlink" in href_list)
|
||||
var/idx = text2num(href_list["unlink"])
|
||||
if(!idx)
|
||||
return FALSE
|
||||
|
||||
var/obj/O = getLink(idx)
|
||||
if(!O)
|
||||
return FALSE
|
||||
if(!canLink(O))
|
||||
to_chat(usr, "<span class='warning'>You can't link with that device.</span>")
|
||||
return FALSE
|
||||
|
||||
if(unlinkFrom(usr, O))
|
||||
to_chat(usr, "<span class='notice'>A green light flashes on \the [P], confirming the link was removed.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>A red light flashes on \the [P]. It appears something went wrong when unlinking the two devices.</span>")
|
||||
update_mt_menu = TRUE
|
||||
|
||||
if("link" in href_list)
|
||||
var/obj/O = P.buffer
|
||||
if(!O)
|
||||
return FALSE
|
||||
if(!canLink(O,href_list))
|
||||
to_chat(usr, "<span class='warning'>You can't link with that device.</span>")
|
||||
return FALSE
|
||||
if(isLinkedWith(O))
|
||||
to_chat(usr, "<span class='warning'>A red light flashes on \the [P]. The two devices are already linked.</span>")
|
||||
return FALSE
|
||||
|
||||
if(linkWith(usr, O, href_list))
|
||||
to_chat(usr, "<span class='notice'>A green light flashes on \the [P], confirming the link was added.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>A red light flashes on \the [P]. It appears something went wrong when linking the two devices.</span>")
|
||||
update_mt_menu = TRUE
|
||||
|
||||
if("buffer" in href_list)
|
||||
P.buffer = src
|
||||
to_chat(usr, "<span class='notice'>A green light flashes, and the device appears in the multitool buffer.</span>")
|
||||
update_mt_menu = TRUE
|
||||
|
||||
if("flush" in href_list)
|
||||
to_chat(usr, "<span class='notice'>A green light flashes, and the device disappears from the multitool buffer.</span>")
|
||||
P.buffer = null
|
||||
update_mt_menu = TRUE
|
||||
|
||||
var/ret = multitool_topic(usr,href_list,P.buffer)
|
||||
if(ret)
|
||||
update_mt_menu = TRUE
|
||||
|
||||
if(update_mt_menu)
|
||||
update_multitool_menu(usr)
|
||||
return TRUE
|
||||
|
||||
// This proc is only staying because of the fingerprint adding
|
||||
// IT NEEDS TO DIE
|
||||
/obj/machinery/Topic(href, href_list, nowindow = 0, datum/ui_state/state = GLOB.default_state)
|
||||
if(..(href, href_list, nowindow, state))
|
||||
return 1
|
||||
|
||||
handle_multitool_topic(href,href_list,usr)
|
||||
add_fingerprint(usr)
|
||||
return 0
|
||||
|
||||
@@ -302,10 +192,6 @@
|
||||
/obj/machinery/proc/RefreshParts() //Placeholder proc for machines that are built using frames.
|
||||
return
|
||||
|
||||
/obj/machinery/proc/assign_uid()
|
||||
uid = gl_uid
|
||||
gl_uid++
|
||||
|
||||
/obj/machinery/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
on_deconstruction()
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
icon_state = "floor_magnet[on ? "" : "0"][invisibility ? "-f" : ""]" // if invisible, set icon to faded version
|
||||
// in case of being revealed by T-scanner
|
||||
|
||||
// This is the LAST thing allowed to use this
|
||||
/obj/machinery/magnetic_module/receive_signal(datum/signal/signal)
|
||||
var/command = signal.data["command"]
|
||||
var/modifier = signal.data["modifier"]
|
||||
@@ -61,8 +62,6 @@
|
||||
if(command && (signal_code == code))
|
||||
Cmd(command, modifier)
|
||||
|
||||
|
||||
|
||||
/obj/machinery/magnetic_module/proc/Cmd(command, modifier)
|
||||
if(command)
|
||||
switch(command)
|
||||
@@ -175,7 +174,9 @@
|
||||
anchored = TRUE
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 45
|
||||
frequency = AIRLOCK_FREQ
|
||||
// this is a temp measure
|
||||
var/frequency = AIRLOCK_FREQ
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/code = 0
|
||||
var/list/magnets = list()
|
||||
var/title = "Magnetic Control Console"
|
||||
|
||||
@@ -575,8 +575,8 @@
|
||||
item_state = "buildpipe"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
|
||||
/obj/item/pipe_meter/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(!istype(W, /obj/item/wrench))
|
||||
/obj/item/pipe_meter/attackby(obj/item/W, mob/user, params)
|
||||
if(!iswrench(W))
|
||||
return ..()
|
||||
|
||||
if(!locate(/obj/machinery/atmospherics/pipe, loc))
|
||||
@@ -603,11 +603,12 @@
|
||||
item_state = "buildpipe"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
|
||||
/obj/item/pipe_gsensor/attackby(obj/item/W as obj, mob/user as mob)
|
||||
/obj/item/pipe_gsensor/attackby(obj/item/W, mob/user)
|
||||
if(!istype(W, /obj/item/wrench))
|
||||
return ..()
|
||||
|
||||
new /obj/machinery/atmospherics/air_sensor(loc)
|
||||
var/obj/machinery/atmospherics/air_sensor/AS = new /obj/machinery/atmospherics/air_sensor(loc)
|
||||
AS.bolts = FALSE
|
||||
playsound(get_turf(src), W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You have fastened the gas sensor.</span>")
|
||||
qdel(src)
|
||||
|
||||
@@ -1013,6 +1013,7 @@
|
||||
return T.remove_air(amount)
|
||||
|
||||
/obj/mecha/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
if(use_internal_tank)
|
||||
return cabin_air
|
||||
return get_turf_air()
|
||||
|
||||
@@ -11,10 +11,11 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
#define DOOR_NORMAL_PLACEMENT 1
|
||||
#define DOOR_FLIPPED_PLACEMENT 2
|
||||
|
||||
#define AIRPUMP_TAG "[id_to_link]_pump"
|
||||
#define SENSOR_TAG "[id_to_link]_sensor"
|
||||
#define OUTER_DOOR_TAG "[id_to_link]_outer"
|
||||
#define INNER_DOOR_TAG "[id_to_link]_inner"
|
||||
#define VENT_ID "[id_to_link]_vent"
|
||||
#define EXT_DOOR_ID "[id_to_link]_door_ext"
|
||||
#define INT_DOOR_ID "[id_to_link]_door_int"
|
||||
#define EXT_BTN_ID "[id_to_link]_btn_ext"
|
||||
#define INT_BTN_ID "[id_to_link]_btn_int"
|
||||
|
||||
/obj/effect/spawner/airlock
|
||||
name = "1 by 1 airlock spawner (interior north, exterior south)"
|
||||
@@ -32,7 +33,6 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
var/tiles_in_x_direction = 1
|
||||
var/tiles_in_y_direction = 1
|
||||
var/id_to_link
|
||||
var/radio_frequency = 1379
|
||||
req_access_txt = ACCESS_EXTERNAL_AIRLOCKS //If req_one_access_txt is set, this is ignored
|
||||
var/door_name = "external access"
|
||||
var/door_type = /obj/machinery/door/airlock/external/glass
|
||||
@@ -52,11 +52,13 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
id_to_link = "[UID()]" //We want unique IDs, this will give us a unique ID
|
||||
var/turf/turf_interior = get_airlock_location(interior_direction)
|
||||
var/turf/turf_exterior = get_airlock_location(exterior_direction)
|
||||
|
||||
handle_door_creation(turf_interior, TRUE, one_door_interior)
|
||||
handle_door_creation(turf_exterior, FALSE, one_door_exterior)
|
||||
handle_pipes_creation(turf_interior)
|
||||
handle_control_placement()
|
||||
qdel(src)
|
||||
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
/obj/effect/spawner/airlock/proc/get_airlock_location(desired_direction) //Finds a turf to place an airlock and returns it, this turf will be in the middle of the relevant wall
|
||||
var/turf/T
|
||||
@@ -76,7 +78,7 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
if(one_door_only != DOOR_FLIPPED_PLACEMENT)
|
||||
A = new door_type(T)
|
||||
handle_door_stuff(A, is_this_an_interior_airlock)
|
||||
var/obj/machinery/access_button/the_button = spawn_button(T, is_this_an_interior_airlock ? interior_direction : exterior_direction)
|
||||
var/obj/machinery/access_button/the_button = spawn_button(T, is_this_an_interior_airlock ? interior_direction : exterior_direction, is_this_an_interior_airlock)
|
||||
if(one_door_only == DOOR_NORMAL_PLACEMENT) //We only need one door, we are done
|
||||
return
|
||||
if(!(tiles_in_x_direction % 2) && (is_this_an_interior_airlock && north_or_south_interior || !is_this_an_interior_airlock && north_or_south_exterior)) //Handle extra airlock for aesthetics
|
||||
@@ -89,20 +91,20 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
handle_door_stuff(A, is_this_an_interior_airlock)
|
||||
if(one_door_only == DOOR_FLIPPED_PLACEMENT)
|
||||
the_button.forceMove(get_step(the_button, NORTH))
|
||||
if(!one_door_only)
|
||||
the_button.command = "[is_this_an_interior_airlock ? "cycle_interior" : "cycle_exterior"]"
|
||||
|
||||
/obj/effect/spawner/airlock/proc/handle_door_stuff(obj/machinery/door/airlock/A, is_this_an_interior_airlock) //This sets up the door vars correctly and then locks it before first use
|
||||
A.set_frequency(radio_frequency)
|
||||
A.id_tag = is_this_an_interior_airlock ? INNER_DOOR_TAG : OUTER_DOOR_TAG
|
||||
A.id_tag = is_this_an_interior_airlock ? INT_DOOR_ID : EXT_DOOR_ID
|
||||
set_access_helper(A)
|
||||
A.name = door_name
|
||||
A.lock()
|
||||
|
||||
/obj/effect/spawner/airlock/proc/spawn_button(turf/T, some_direction)
|
||||
/obj/effect/spawner/airlock/proc/spawn_button(turf/T, some_direction, interior)
|
||||
var/obj/machinery/access_button/the_button = new(T)
|
||||
the_button.master_tag = id_to_link
|
||||
the_button.set_frequency(radio_frequency)
|
||||
if(interior)
|
||||
the_button.autolink_id = INT_BTN_ID
|
||||
else
|
||||
the_button.autolink_id = EXT_BTN_ID
|
||||
|
||||
switch(some_direction)
|
||||
if(NORTH)
|
||||
the_button.pixel_x -= 25
|
||||
@@ -119,31 +121,26 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
set_access_helper(the_button)
|
||||
return the_button
|
||||
|
||||
/obj/effect/spawner/airlock/proc/handle_control_placement() //Stick the sensor and controller on the same bit of wall, this will ONLY be unsuitable if airlocks are on both the south and west turfs
|
||||
/obj/effect/spawner/airlock/proc/handle_control_placement() //Stick the controller on the wall, this will ONLY be unsuitable if airlocks are on both the south and west turfs
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/machinery/airlock_sensor/AS = new(T)
|
||||
var/obj/machinery/embedded_controller/radio/airlock/airlock_controller/AC = new(T, id_to_link, radio_frequency, OUTER_DOOR_TAG, INNER_DOOR_TAG, AIRPUMP_TAG, SENSOR_TAG)
|
||||
var/obj/machinery/airlock_controller/air_cycler/AC = new(T)
|
||||
set_access_helper(AC)
|
||||
AS.id_tag = SENSOR_TAG
|
||||
AS.set_frequency(radio_frequency)
|
||||
if(interior_direction != WEST && exterior_direction != WEST) //If west wall is free, place stuff there
|
||||
AC.vent_link_id = VENT_ID
|
||||
AC.int_door_link_id = INT_DOOR_ID
|
||||
AC.ext_door_link_id = EXT_DOOR_ID
|
||||
AC.int_button_link_id = INT_BTN_ID
|
||||
AC.ext_button_link_id = EXT_BTN_ID
|
||||
if(interior_direction != WEST && exterior_direction != WEST) //If west wall is free, place it there
|
||||
AC.pixel_x -= 25
|
||||
AC.pixel_y += 9
|
||||
AS.pixel_x -= 25
|
||||
AS.pixel_y -= 9
|
||||
else if(interior_direction != SOUTH && exterior_direction != SOUTH) //If south wall is free, place stuff there
|
||||
else if(interior_direction != SOUTH && exterior_direction != SOUTH) //If south wall is free, place it there
|
||||
AC.pixel_x += 9
|
||||
AC.pixel_y -= 25
|
||||
AS.pixel_x -= 9
|
||||
AS.pixel_y -= 25
|
||||
else //Send them over to the other side of the chamber
|
||||
else //Send it over to the other side of the chamber
|
||||
T = locate(x + tiles_in_x_direction - 1, y + tiles_in_y_direction - 1, z)
|
||||
AC.forceMove(T)
|
||||
AS.forceMove(T)
|
||||
AC.pixel_x += 25
|
||||
AC.pixel_y += 9
|
||||
AS.pixel_x += 25
|
||||
AS.pixel_y -= 9
|
||||
|
||||
/obj/effect/spawner/airlock/proc/handle_pipes_creation(turf/T) //This places all required piping down, then properly initializes it. T is the turf that the interior airlock occupies
|
||||
var/turf/below_T = get_step(T, opposite_interior_direction)
|
||||
@@ -198,8 +195,7 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
A.on_construction(A.dir, initialization_directions ? initialization_directions : A.dir)
|
||||
if(istype(A, /obj/machinery/atmospherics/unary/vent_pump/high_volume))
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/high_volume/created_pump = A
|
||||
created_pump.id_tag = AIRPUMP_TAG
|
||||
created_pump.set_frequency(radio_frequency)
|
||||
created_pump.autolink_id = VENT_ID
|
||||
|
||||
/obj/effect/spawner/airlock/proc/set_access_helper(obj/I)
|
||||
if(req_one_access_txt == "0")
|
||||
@@ -346,7 +342,8 @@ This spawner places pipe leading up to the interior door, you will need to finis
|
||||
#undef CHAMBER_BIGGER
|
||||
#undef DOOR_NORMAL_PLACEMENT
|
||||
#undef DOOR_FLIPPED_PLACEMENT
|
||||
#undef AIRPUMP_TAG
|
||||
#undef SENSOR_TAG
|
||||
#undef OUTER_DOOR_TAG
|
||||
#undef INNER_DOOR_TAG
|
||||
#undef VENT_ID
|
||||
#undef EXT_DOOR_ID
|
||||
#undef INT_DOOR_ID
|
||||
#undef EXT_BTN_ID
|
||||
#undef INT_BTN_ID
|
||||
|
||||
@@ -84,7 +84,6 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
|
||||
/obj/item/radio/New()
|
||||
..()
|
||||
wires = new(src)
|
||||
|
||||
@@ -25,12 +25,10 @@
|
||||
toolspeed = 1
|
||||
tool_behaviour = TOOL_MULTITOOL
|
||||
hitsound = 'sound/weapons/tap.ogg'
|
||||
var/obj/machinery/buffer // simple machine buffer for device linkage
|
||||
|
||||
/obj/item/multitool/proc/IsBufferA(typepath)
|
||||
if(!buffer)
|
||||
return 0
|
||||
return istype(buffer,typepath)
|
||||
/// Reference to whatever machine is held in the buffer
|
||||
var/obj/machinery/buffer // TODO - Make this a soft ref to tie into whats below
|
||||
/// Soft-ref for linked stuff. This should be used over the above var.
|
||||
var/buffer_uid
|
||||
|
||||
/obj/item/multitool/multitool_check_buffer(user, silent = FALSE)
|
||||
return TRUE
|
||||
@@ -56,8 +54,8 @@
|
||||
var/rangewarning = 20 //Glows yellow when inside
|
||||
origin_tech = "magnets=1;engineering=2;syndicate=1"
|
||||
|
||||
/obj/item/multitool/ai_detect/New()
|
||||
..()
|
||||
/obj/item/multitool/ai_detect/Initialize(mapload)
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/multitool/ai_detect/Destroy()
|
||||
|
||||
@@ -243,6 +243,7 @@
|
||||
return 0
|
||||
|
||||
/obj/structure/chrono_field/return_air() //we always have nominal air and temperature
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
var/datum/gas_mixture/GM = new
|
||||
GM.oxygen = MOLES_O2STANDARD
|
||||
GM.nitrogen = MOLES_N2STANDARD
|
||||
|
||||
@@ -44,10 +44,6 @@
|
||||
return
|
||||
..()
|
||||
|
||||
//assembly stuff
|
||||
/obj/item/grenade/plastic/receive_signal()
|
||||
prime()
|
||||
|
||||
/obj/item/grenade/plastic/Crossed(atom/movable/AM, oldloc)
|
||||
if(nadeassembly)
|
||||
nadeassembly.Crossed(AM, oldloc)
|
||||
|
||||
@@ -229,10 +229,6 @@
|
||||
to_chat(user, "<span class='notice'>You need to add an activation mechanism.</span>")
|
||||
return TRUE
|
||||
|
||||
//assembly stuff
|
||||
/obj/item/grenade/chem_grenade/receive_signal()
|
||||
prime()
|
||||
|
||||
/obj/item/grenade/chem_grenade/HasProximity(atom/movable/AM)
|
||||
if(nadeassembly)
|
||||
nadeassembly.HasProximity(AM)
|
||||
|
||||
@@ -209,6 +209,7 @@
|
||||
return air_contents.remove(amount)
|
||||
|
||||
/obj/item/tank/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
return air_contents
|
||||
|
||||
/obj/item/tank/assume_air(datum/gas_mixture/giver)
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
|
||||
var/can_be_hit = TRUE //can this be bludgeoned by items?
|
||||
|
||||
var/Mtoollink = FALSE // variable to decide if an object should show the multitool menu linking menu, not all objects use it
|
||||
|
||||
var/being_shocked = FALSE
|
||||
var/speed_process = FALSE
|
||||
|
||||
@@ -112,6 +110,7 @@
|
||||
return null
|
||||
|
||||
/obj/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
if(loc)
|
||||
return loc.return_air()
|
||||
else
|
||||
@@ -201,87 +200,7 @@
|
||||
return
|
||||
|
||||
/obj/proc/hear_message(mob/M, text)
|
||||
|
||||
/obj/proc/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return "<b>NO MULTITOOL_MENU!</b>"
|
||||
|
||||
/obj/proc/linkWith(mob/user, obj/buffer, context)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/unlinkFrom(mob/user, obj/buffer)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/canLink(obj/O, list/context)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/isLinkedWith(obj/O)
|
||||
return FALSE
|
||||
|
||||
/obj/proc/getLink(idx)
|
||||
return null
|
||||
|
||||
/obj/proc/linkMenu(obj/O)
|
||||
var/dat = ""
|
||||
if(canLink(O, list()))
|
||||
dat += " <a href='?src=[UID()];link=1'>\[Link\]</a> "
|
||||
return dat
|
||||
|
||||
/obj/proc/format_tag(label, varname, act = "set_tag")
|
||||
var/value = vars[varname]
|
||||
if(!value || value == "")
|
||||
value = "-----"
|
||||
return "<b>[label]:</b> <a href=\"?src=[UID()];[act]=[varname]\">[value]</a>"
|
||||
|
||||
|
||||
/obj/proc/update_multitool_menu(mob/user)
|
||||
var/obj/item/multitool/P = get_multitool(user)
|
||||
|
||||
if(!istype(P))
|
||||
return FALSE
|
||||
|
||||
var/dat = {"<html>
|
||||
<head>
|
||||
<title>[name] Configuration</title>
|
||||
<style type="text/css">
|
||||
html,body {
|
||||
font-family:courier;
|
||||
background:#999999;
|
||||
color:#333333;
|
||||
}
|
||||
|
||||
a {
|
||||
color:#000000;
|
||||
text-decoration:none;
|
||||
border-bottom:1px solid black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3>[name]</h3>
|
||||
"}
|
||||
if(allowed(user))//no, assistants, you're not ruining all vents on the station with just a multitool
|
||||
dat += multitool_menu(user, P)
|
||||
if(Mtoollink)
|
||||
if(P)
|
||||
if(P.buffer)
|
||||
var/id = null
|
||||
if("id_tag" in P.buffer.vars)
|
||||
id = P.buffer:id_tag
|
||||
dat += "<p><b>MULTITOOL BUFFER:</b> [P.buffer] [id ? "([id])" : ""]"
|
||||
|
||||
dat += linkMenu(P.buffer)
|
||||
|
||||
if(P.buffer)
|
||||
dat += "<a href='?src=[UID()];flush=1'>\[Flush\]</a>"
|
||||
dat += "</p>"
|
||||
else
|
||||
dat += "<p><b>MULTITOOL BUFFER:</b> <a href='?src=[UID()];buffer=1'>\[Add Machine\]</a></p>"
|
||||
else
|
||||
dat += "<b>ACCESS DENIED</a>"
|
||||
dat += "</body></html>"
|
||||
user << browse(dat, "window=mtcomputer")
|
||||
user.set_machine(src)
|
||||
onclose(user, "mtcomputer")
|
||||
return
|
||||
|
||||
/obj/proc/default_welder_repair(mob/user, obj/item/I) //Returns TRUE if the object was successfully repaired. Fully repairs an object (setting BROKEN to FALSE), default repair time = 40
|
||||
if(obj_integrity >= max_integrity)
|
||||
|
||||
@@ -346,6 +346,7 @@
|
||||
var/cooling_power = 40
|
||||
|
||||
/obj/structure/closet/crate/freezer/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
var/datum/gas_mixture/gas = (..())
|
||||
if(!gas) return null
|
||||
var/datum/gas_mixture/newgas = new/datum/gas_mixture()
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
to_chat(user, "<span class='notice'>You put [T] in [src].</span>")
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
|
||||
/obj/structure/dispenser/deconstruct(disassembled = TRUE)
|
||||
if(!(flags & NODECONSTRUCT))
|
||||
for(var/X in src)
|
||||
var/obj/item/I = X
|
||||
|
||||
@@ -91,6 +91,7 @@
|
||||
// Should I return a copy here? If the caller edits or qdel()s the returned
|
||||
// datum, there might be problems if I don't...
|
||||
/obj/structure/transit_tube_pod/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
var/datum/gas_mixture/GM = new()
|
||||
GM.copy_from(air_contents)
|
||||
return GM
|
||||
|
||||
@@ -70,16 +70,6 @@
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/onetankbomb/receive_signal() //This is mainly called by the sensor through sense() to the holder, and from the holder to here.
|
||||
visible_message("[bicon(src)] *beep* *beep*", "*beep* *beep*")
|
||||
sleep(10)
|
||||
if(!src)
|
||||
return
|
||||
if(status)
|
||||
bombtank.detonate() //if its not a dud, boom (or not boom if you made shitty mix) the ignite proc is below, in this file
|
||||
else
|
||||
bombtank.release()
|
||||
|
||||
/obj/item/onetankbomb/HasProximity(atom/movable/AM)
|
||||
if(bombassembly)
|
||||
bombassembly.HasProximity(AM)
|
||||
@@ -102,7 +92,7 @@
|
||||
|
||||
// ---------- Procs below are for tanks that are used exclusively in 1-tank bombs ----------
|
||||
|
||||
/obj/item/tank/proc/bomb_assemble(W,user) //Bomb assembly proc. This turns assembly+tank into a bomb
|
||||
/obj/item/tank/proc/bomb_assemble(W, user) //Bomb assembly proc. This turns assembly+tank into a bomb
|
||||
var/obj/item/assembly_holder/S = W
|
||||
var/mob/M = user
|
||||
if(!S.secured) //Check if the assembly is secured
|
||||
@@ -127,7 +117,7 @@
|
||||
return
|
||||
|
||||
/obj/item/tank/proc/detonate() //This happens when a bomb is told to explode
|
||||
var/fuel_moles = air_contents.toxins + air_contents.oxygen/6
|
||||
var/fuel_moles = air_contents.toxins + air_contents.oxygen / 6
|
||||
var/strength = 1
|
||||
|
||||
var/turf/ground_zero = get_turf(loc)
|
||||
|
||||
@@ -199,6 +199,5 @@
|
||||
a_right.pulsed(0)
|
||||
if(a_left && a_left != D) // the right pools might have sent us boom, so `a_left` can be null here
|
||||
a_left.pulsed(0)
|
||||
if(master)
|
||||
master.receive_signal()
|
||||
|
||||
return TRUE
|
||||
|
||||
@@ -38,11 +38,20 @@
|
||||
if(tank)
|
||||
tank.boom(TRUE) // this qdel's `src`
|
||||
|
||||
if(istype(locloc, /obj/item/onetankbomb))
|
||||
var/obj/item/onetankbomb/bomb = locloc
|
||||
if(bomb?.bombtank)
|
||||
bomb.bombtank.detonate()
|
||||
|
||||
else if(istype(locloc, /obj/item/reagent_containers/glass/beaker))
|
||||
var/obj/item/reagent_containers/glass/beaker/beakerbomb = locloc
|
||||
if(beakerbomb)
|
||||
beakerbomb.heat_beaker()
|
||||
|
||||
else if(istype(locloc, /obj/item/grenade/chem_grenade))
|
||||
var/obj/item/grenade/chem_grenade/CG = locloc
|
||||
CG.prime()
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
return 0
|
||||
|
||||
/turf/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
//Create gas mixture to hold data for passing
|
||||
var/datum/gas_mixture/GM = new
|
||||
|
||||
@@ -99,6 +100,7 @@
|
||||
air.copy_from(copy)
|
||||
|
||||
/turf/simulated/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
if(air)
|
||||
return air
|
||||
|
||||
|
||||
@@ -64,10 +64,8 @@
|
||||
//all air alarms in area are connected via magic
|
||||
/area
|
||||
var/obj/machinery/alarm/master_air_alarm
|
||||
var/list/air_vent_names = list()
|
||||
var/list/air_scrub_names = list()
|
||||
var/list/air_vent_info = list()
|
||||
var/list/air_scrub_info = list()
|
||||
var/list/obj/machinery/atmospherics/unary/vent_pump/vents = list()
|
||||
var/list/obj/machinery/atmospherics/unary/vent_scrubber/scrubbers = list()
|
||||
|
||||
/obj/machinery/alarm
|
||||
name = "air alarm"
|
||||
@@ -85,11 +83,9 @@
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 90, ACID = 30)
|
||||
resistance_flags = FIRE_PROOF
|
||||
siemens_strength = 1
|
||||
frequency = ATMOS_VENTSCRUB
|
||||
var/custom_name
|
||||
var/alarm_id = null
|
||||
//var/skipprocess = 0 //Experimenting
|
||||
var/alarm_frequency = ATMOS_FIRE_FREQ
|
||||
var/remote_control = TRUE
|
||||
var/rcon_setting = RCON_AUTO
|
||||
var/rcon_time = 0
|
||||
@@ -100,13 +96,8 @@
|
||||
var/AAlarmwires = 31
|
||||
var/shorted = FALSE
|
||||
|
||||
// Waiting on a device to respond.
|
||||
// Specifies an id_tag. NULL means we aren't waiting.
|
||||
var/waiting_on_device = null
|
||||
|
||||
var/mode = AALARM_MODE_SCRUBBING
|
||||
var/preset = AALARM_PRESET_HUMAN
|
||||
var/area_uid
|
||||
var/area/alarm_area
|
||||
var/danger_level = ATMOS_ALARM_NONE
|
||||
var/alarmActivated = 0 // Manually activated (independent from danger level)
|
||||
@@ -215,19 +206,16 @@
|
||||
mode = AALARM_MODE_REPLACEMENT
|
||||
apply_mode()
|
||||
|
||||
/obj/machinery/alarm/New(loc, direction, building = 0)
|
||||
/obj/machinery/alarm/Initialize(mapload, direction, building = 0)
|
||||
. = ..()
|
||||
if(building) // Do this first since the Init uses this later on. TODO refactor to just use an Init
|
||||
if(loc)
|
||||
src.loc = loc
|
||||
|
||||
if(dir)
|
||||
if(direction)
|
||||
setDir(direction)
|
||||
|
||||
buildstage = 0
|
||||
wiresexposed = TRUE
|
||||
set_pixel_offsets_from_dir(-24, 24, -24, 24)
|
||||
|
||||
. = ..()
|
||||
GLOB.air_alarms += src
|
||||
GLOB.air_alarms = sortAtom(GLOB.air_alarms)
|
||||
|
||||
@@ -239,9 +227,6 @@
|
||||
/obj/machinery/alarm/Destroy()
|
||||
SStgui.close_uis(wires)
|
||||
GLOB.air_alarms -= src
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
GLOB.air_alarm_repository.update_cache(src)
|
||||
QDEL_NULL(wires)
|
||||
if(alarm_area && alarm_area.master_air_alarm == src)
|
||||
@@ -252,15 +237,13 @@
|
||||
|
||||
/obj/machinery/alarm/proc/first_run()
|
||||
alarm_area = get_area(src)
|
||||
area_uid = alarm_area.uid
|
||||
if(!custom_name)
|
||||
name = "[alarm_area.name] Air Alarm"
|
||||
apply_preset(1) // Don't cycle.
|
||||
apply_preset(AALARM_PRESET_HUMAN) // Don't cycle.
|
||||
GLOB.air_alarm_repository.update_cache(src)
|
||||
|
||||
/obj/machinery/alarm/Initialize(mapload)
|
||||
. = ..()
|
||||
set_frequency(frequency)
|
||||
if(!master_is_operating())
|
||||
elect_master()
|
||||
|
||||
@@ -391,7 +374,10 @@
|
||||
icon_state = "alarmp"
|
||||
return
|
||||
|
||||
switch(max(danger_level, alarm_area.atmosalm-1))
|
||||
if(!alarm_area) // We wont have our alarm_area if we aint initialised
|
||||
return
|
||||
|
||||
switch(max(danger_level, alarm_area.atmosalm - 1))
|
||||
if(ATMOS_ALARM_NONE)
|
||||
icon_state = "alarm0"
|
||||
if(ATMOS_ALARM_WARNING)
|
||||
@@ -408,200 +394,161 @@
|
||||
|
||||
underlays += emissive_appearance(icon, "alarm_lightmask")
|
||||
|
||||
/obj/machinery/alarm/proc/register_env_machine(m_id, device_type)
|
||||
var/new_name
|
||||
if(device_type=="AVP")
|
||||
new_name = "[alarm_area.name] Vent Pump #[alarm_area.air_vent_names.len+1]"
|
||||
alarm_area.air_vent_names[m_id] = new_name
|
||||
else if(device_type=="AScr")
|
||||
new_name = "[alarm_area.name] Air Scrubber #[alarm_area.air_scrub_names.len+1]"
|
||||
alarm_area.air_scrub_names[m_id] = new_name
|
||||
else
|
||||
return
|
||||
spawn (10)
|
||||
send_signal(m_id, list("init" = new_name) )
|
||||
|
||||
/obj/machinery/alarm/proc/refresh_all()
|
||||
for(var/id_tag in alarm_area.air_vent_names)
|
||||
var/list/I = alarm_area.air_vent_info[id_tag]
|
||||
if(I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time)
|
||||
continue
|
||||
send_signal(id_tag, list("status") )
|
||||
for(var/id_tag in alarm_area.air_scrub_names)
|
||||
var/list/I = alarm_area.air_scrub_info[id_tag]
|
||||
if(I && I["timestamp"]+AALARM_REPORT_TIMEOUT/2 > world.time)
|
||||
continue
|
||||
send_signal(id_tag, list("status") )
|
||||
|
||||
/obj/machinery/alarm/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_TO_AIRALARM)
|
||||
|
||||
/obj/machinery/alarm/proc/send_signal(target, list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = command
|
||||
signal.data["tag"] = target
|
||||
signal.data["sigtype"] = "command"
|
||||
|
||||
radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/alarm/proc/apply_mode()
|
||||
switch(mode)
|
||||
if(AALARM_MODE_SCRUBBING)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"o2_scrub" = (preset == AALARM_PRESET_VOX),
|
||||
"n2_scrub" = FALSE,
|
||||
"co2_scrub" = TRUE,
|
||||
"tox_scrub" = FALSE,
|
||||
"n2o_scrub" = FALSE,
|
||||
"scrubbing" = TRUE,
|
||||
"widenet" = FALSE,
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"checks" = TRUE,
|
||||
"set_external_pressure" = ONE_ATMOSPHERE
|
||||
))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = TRUE
|
||||
S.scrub_O2 = (preset == AALARM_PRESET_VOX)
|
||||
S.scrub_N2 = FALSE
|
||||
S.scrub_CO2 = TRUE
|
||||
S.scrub_Toxins = FALSE
|
||||
S.scrub_N2O = FALSE
|
||||
S.scrubbing = TRUE
|
||||
S.widenet = TRUE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = TRUE
|
||||
P.pressure_checks = TRUE
|
||||
P.internal_pressure_bound = ONE_ATMOSPHERE
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
if(AALARM_MODE_CONTAMINATED)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"co2_scrub" = TRUE,
|
||||
"tox_scrub" = TRUE,
|
||||
"n2o_scrub" = TRUE,
|
||||
"scrubbing" = TRUE,
|
||||
"widenet" = TRUE,
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"checks" = TRUE,
|
||||
"set_external_pressure" = ONE_ATMOSPHERE
|
||||
))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = TRUE
|
||||
S.scrub_CO2 = TRUE
|
||||
S.scrub_Toxins = TRUE
|
||||
S.scrub_N2O = TRUE
|
||||
S.scrubbing = TRUE
|
||||
S.widenet = TRUE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = TRUE
|
||||
P.pressure_checks = TRUE
|
||||
P.external_pressure_bound = ONE_ATMOSPHERE
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
if(AALARM_MODE_VENTING)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"widenet" = FALSE,
|
||||
"scrubbing" = FALSE
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"checks" = TRUE,
|
||||
"set_external_pressure" = ONE_ATMOSPHERE * 2
|
||||
))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = TRUE
|
||||
S.widenet = FALSE
|
||||
S.scrubbing = FALSE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = TRUE
|
||||
P.pressure_checks = TRUE
|
||||
P.external_pressure_bound = ONE_ATMOSPHERE * 2
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
if(AALARM_MODE_REFILL)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"co2_scrub" = TRUE,
|
||||
"tox_scrub" = FALSE,
|
||||
"n2o_scrub" = FALSE,
|
||||
"scrubbing" = TRUE,
|
||||
"widenet" = FALSE,
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"checks" = TRUE,
|
||||
"set_external_pressure" = ONE_ATMOSPHERE * 3
|
||||
))
|
||||
if(AALARM_MODE_PANIC,
|
||||
AALARM_MODE_REPLACEMENT)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"widenet" = TRUE,
|
||||
"scrubbing" = FALSE
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = FALSE
|
||||
))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = TRUE
|
||||
S.scrub_CO2 = TRUE
|
||||
S.scrub_Toxins = FALSE
|
||||
S.scrub_N2O = FALSE
|
||||
S.scrubbing = TRUE
|
||||
S.widenet = FALSE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = TRUE
|
||||
P.pressure_checks = TRUE
|
||||
P.external_pressure_bound = ONE_ATMOSPHERE * 3
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
if(AALARM_MODE_PANIC, AALARM_MODE_REPLACEMENT)
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = TRUE
|
||||
S.widenet = TRUE
|
||||
S.scrubbing = FALSE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = FALSE
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
if(AALARM_MODE_SIPHON)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"widenet" = FALSE,
|
||||
"scrubbing" = FALSE
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = FALSE
|
||||
))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = TRUE
|
||||
S.widenet = FALSE
|
||||
S.scrubbing = FALSE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = FALSE
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
if(AALARM_MODE_OFF)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = FALSE
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = FALSE
|
||||
))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = FALSE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = FALSE
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
if(AALARM_MODE_FLOOD)
|
||||
for(var/device_id in alarm_area.air_scrub_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = FALSE
|
||||
))
|
||||
for(var/device_id in alarm_area.air_vent_names)
|
||||
send_signal(device_id, list(
|
||||
"power" = TRUE,
|
||||
"checks" = 2,
|
||||
"set_internal_pressure" = FALSE
|
||||
))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
S.on = FALSE
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
if(P.stat & (NOPOWER|BROKEN))
|
||||
continue
|
||||
P.on = TRUE
|
||||
P.pressure_checks = 2
|
||||
P.internal_pressure_bound = 0
|
||||
P.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/alarm/proc/apply_danger_level()
|
||||
var/new_area_danger_level = ATMOS_ALARM_NONE
|
||||
for(var/obj/machinery/alarm/AA in alarm_area)
|
||||
if(!(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted)
|
||||
new_area_danger_level = max(new_area_danger_level, AA.danger_level)
|
||||
if(alarm_area.atmosalert(new_area_danger_level, src)) //if area was in normal state or if area was in alert state
|
||||
post_alert(new_area_danger_level)
|
||||
alarm_area.atmosalert(new_area_danger_level, src)
|
||||
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
/obj/machinery/alarm/proc/post_alert(alert_level)
|
||||
if(!report_danger_level)
|
||||
// Don't report the level to computers, but do toggle firedoors
|
||||
var/area/A = get_area(src)
|
||||
if(alert_level == ATMOS_ALARM_NONE)
|
||||
A.air_doors_open()
|
||||
else if(alert_level != ATMOS_ALARM_NONE)
|
||||
A.air_doors_close()
|
||||
return
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(alarm_frequency)
|
||||
|
||||
if(!frequency)
|
||||
return
|
||||
|
||||
var/datum/signal/alert_signal = new
|
||||
alert_signal.source = src
|
||||
alert_signal.transmission_method = 1
|
||||
alert_signal.data["zone"] = get_area_name(src, TRUE)
|
||||
alert_signal.data["type"] = "Atmospheric"
|
||||
|
||||
if(alert_level == ATMOS_ALARM_DANGER)
|
||||
alert_signal.data["alert"] = "severe"
|
||||
else if(alert_level == ATMOS_ALARM_WARNING)
|
||||
alert_signal.data["alert"] = "minor"
|
||||
else if(alert_level == ATMOS_ALARM_NONE)
|
||||
alert_signal.data["alert"] = "clear"
|
||||
|
||||
frequency.post_signal(src, alert_signal)
|
||||
|
||||
///////////////
|
||||
//END HACKING//
|
||||
///////////////
|
||||
@@ -741,29 +688,33 @@
|
||||
data["preset"] = preset
|
||||
|
||||
var/list/vents = list()
|
||||
if(alarm_area.air_vent_names.len)
|
||||
for(var/id_tag in alarm_area.air_vent_names)
|
||||
if(length(alarm_area.vents))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/P as anything in alarm_area.vents)
|
||||
var/list/vent_info = list()
|
||||
var/long_name = alarm_area.air_vent_names[id_tag]
|
||||
var/list/vent_data = alarm_area.air_vent_info[id_tag]
|
||||
if(!vent_data)
|
||||
continue
|
||||
vent_info["id_tag"] = id_tag
|
||||
vent_info["name"] = sanitize(long_name)
|
||||
vent_info += vent_data
|
||||
vent_info["id_tag"] = P.UID()
|
||||
vent_info["name"] = sanitize(P.name)
|
||||
vent_info["power"] = P.on
|
||||
vent_info["direction"] = P.releasing ? "release" : "siphon"
|
||||
vent_info["checks"] = P.pressure_checks
|
||||
vent_info["external"] = P.external_pressure_bound
|
||||
vents += list(vent_info)
|
||||
data["vents"] = vents
|
||||
|
||||
var/list/scrubbers = list()
|
||||
if(alarm_area.air_scrub_names.len)
|
||||
for(var/id_tag in alarm_area.air_scrub_names)
|
||||
var/long_name = alarm_area.air_scrub_names[id_tag]
|
||||
var/list/scrubber_data = alarm_area.air_scrub_info[id_tag]
|
||||
if(!scrubber_data)
|
||||
continue
|
||||
scrubber_data["id_tag"] = id_tag
|
||||
scrubber_data["name"] = sanitize(long_name)
|
||||
scrubbers += list(scrubber_data)
|
||||
if(length(alarm_area.scrubbers))
|
||||
for(var/obj/machinery/atmospherics/unary/vent_scrubber/S as anything in alarm_area.scrubbers)
|
||||
var/list/scrubber_info = list()
|
||||
scrubber_info["id_tag"] = S.UID()
|
||||
scrubber_info["name"] = sanitize(S.name)
|
||||
scrubber_info["power"] = S.on
|
||||
scrubber_info["scrubbing"] = S.scrubbing
|
||||
scrubber_info["widenet"] = S.widenet
|
||||
scrubber_info["filter_o2"] = S.scrub_O2
|
||||
scrubber_info["filter_n2"] = S.scrub_N2
|
||||
scrubber_info["filter_co2"] = S.scrub_CO2
|
||||
scrubber_info["filter_toxins"] = S.scrub_Toxins
|
||||
scrubber_info["filter_n2o"] = S.scrub_N2O
|
||||
scrubbers += list(scrubber_info)
|
||||
data["scrubbers"] = scrubbers
|
||||
return data
|
||||
|
||||
@@ -873,7 +824,8 @@
|
||||
return
|
||||
|
||||
var/device_id = params["id_tag"]
|
||||
switch(params["cmd"])
|
||||
var/cmd = params["cmd"]
|
||||
switch(cmd)
|
||||
if ("power",
|
||||
"adjust_external_pressure",
|
||||
"set_external_pressure",
|
||||
@@ -888,7 +840,7 @@
|
||||
"direction")
|
||||
var/val
|
||||
if(params["val"])
|
||||
val=text2num(params["val"])
|
||||
val = text2num(params["val"])
|
||||
else
|
||||
var/newval = input("Enter new value") as num|null
|
||||
if(isnull(newval))
|
||||
@@ -900,13 +852,70 @@
|
||||
newval = 0
|
||||
val = newval
|
||||
|
||||
// For those who read this: This radio BS is what makes air alarms take 10 years to update in the UI
|
||||
send_signal(device_id, list(params["cmd"] = val))
|
||||
waiting_on_device = device_id
|
||||
// Figure out what it is
|
||||
var/obj/machinery/atmospherics/unary/U = locateUID(device_id)
|
||||
if(!U)
|
||||
return
|
||||
|
||||
if(!((U in alarm_area.vents) || (U in alarm_area.scrubbers)))
|
||||
message_admins("<span class='boldannounce'>[key_name_admin(usr)] attempted to href-exploit an air alarm to control another object!!!</span>")
|
||||
return
|
||||
|
||||
// Its a vent. Handle
|
||||
if(istype(U, /obj/machinery/atmospherics/unary/vent_pump))
|
||||
var/obj/machinery/atmospherics/unary/vent_pump/V = U
|
||||
|
||||
if(V.stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
switch(cmd)
|
||||
if("power")
|
||||
V.on = val
|
||||
if("adjust_external_pressure")
|
||||
V.external_pressure_bound = clamp(V.external_pressure_bound + val, 0, ONE_ATMOSPHERE * 50)
|
||||
if("set_external_pressure")
|
||||
V.external_pressure_bound = clamp(val, 0, ONE_ATMOSPHERE * 50)
|
||||
if("checks")
|
||||
V.pressure_checks = val
|
||||
if("direction")
|
||||
V.releasing = val
|
||||
|
||||
V.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
// Its a scrubber. Do the same but ever so slightly similar.
|
||||
else if(istype(U, /obj/machinery/atmospherics/unary/vent_scrubber))
|
||||
var/obj/machinery/atmospherics/unary/vent_scrubber/S = U
|
||||
|
||||
if(S.stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
switch(cmd)
|
||||
if("power")
|
||||
S.on = val
|
||||
if("co2_scrub")
|
||||
S.scrub_CO2 = val
|
||||
if("tox_scrub")
|
||||
S.scrub_Toxins = val
|
||||
if("n2o_scrub")
|
||||
S.scrub_N2O = val
|
||||
if("n2_scrub")
|
||||
S.scrub_N2 = val
|
||||
if("o2_scrub")
|
||||
S.scrub_O2 = val
|
||||
if("widenet")
|
||||
S.widenet = val
|
||||
if("scrubbing")
|
||||
S.scrubbing = val
|
||||
|
||||
S.update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
if("set_threshold")
|
||||
var/env = params["env"]
|
||||
var/varname = params["var"]
|
||||
if(!(varname in list("min1", "min2", "max1", "max2"))) // uh oh
|
||||
message_admins("[key_name_admin(usr)] attempted to href edit vars on [src]!!!")
|
||||
return
|
||||
|
||||
var/datum/tlv/tlv = TLV[env]
|
||||
var/newval = input("Enter [varname] for [env]", "Alarm triggers", tlv.vars[varname]) as num|null
|
||||
|
||||
@@ -925,14 +934,12 @@
|
||||
tlv.vars[varname] = newval
|
||||
|
||||
if("atmos_alarm")
|
||||
if(alarm_area.atmosalert(ATMOS_ALARM_DANGER, src))
|
||||
post_alert(ATMOS_ALARM_DANGER)
|
||||
alarm_area.atmosalert(ATMOS_ALARM_DANGER, src)
|
||||
alarmActivated = TRUE
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
if("atmos_reset")
|
||||
if(alarm_area.atmosalert(ATMOS_ALARM_NONE, src, TRUE))
|
||||
post_alert(ATMOS_ALARM_NONE)
|
||||
alarm_area.atmosalert(ATMOS_ALARM_NONE, src, TRUE)
|
||||
alarmActivated = FALSE
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
|
||||
|
||||
@@ -44,6 +44,9 @@ Pipelines + Other Objects -> Pipe network
|
||||
/// Pipe image, not used for all subtypes
|
||||
var/image/pipe_image
|
||||
|
||||
/// ID for automatic linkage of stuff. This is used to assist in connections at mapload. Dont try use it for other stuff
|
||||
var/autolink_id = null
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -74,12 +77,6 @@ Pipelines + Other Objects -> Pipe network
|
||||
QDEL_NULL(pipe_image) //we have to qdel it, or it might keep a ref somewhere else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
// Icons/overlays/underlays
|
||||
/obj/machinery/atmospherics/update_icon()
|
||||
if(check_icon_cache())
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
//node2 is output port
|
||||
//node1 is input port
|
||||
|
||||
req_one_access_txt = "24;10"
|
||||
|
||||
name = "dual-port air vent"
|
||||
desc = "Has a valve and pump attached to it. There are two ports."
|
||||
|
||||
@@ -22,34 +20,11 @@
|
||||
var/input_pressure_min = 0
|
||||
var/output_pressure_max = 0
|
||||
|
||||
frequency = ATMOS_VENTSCRUB
|
||||
var/id_tag = null
|
||||
|
||||
settagwhitelist = list("id_tag")
|
||||
|
||||
var/pressure_checks = 1
|
||||
//1: Do not pass external_pressure_bound
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/New()
|
||||
..()
|
||||
if(!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
icon = null
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/atmos_init()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
|
||||
name = "large dual port air vent"
|
||||
|
||||
@@ -152,91 +127,3 @@
|
||||
air_update_turf()
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id_tag,
|
||||
"device" = "ADVP",
|
||||
"power" = on,
|
||||
"direction" = releasing?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"input" = input_pressure_min,
|
||||
"output" = output_pressure_max,
|
||||
"external" = external_pressure_bound,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
|
||||
if(signal.data["direction"] != null)
|
||||
releasing = text2num(signal.data["direction"])
|
||||
|
||||
if(signal.data["checks"] != null)
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
|
||||
if(signal.data["purge"])
|
||||
pressure_checks &= ~1
|
||||
releasing = FALSE
|
||||
|
||||
if(signal.data["stabilize"])//the fact that this was "stabalize" shows how many fucks people give about these wonders, none
|
||||
pressure_checks |= 1
|
||||
releasing = TRUE
|
||||
|
||||
if(signal.data["set_input_pressure"] != null)
|
||||
input_pressure_min = clamp(
|
||||
text2num(signal.data["set_input_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(signal.data["set_output_pressure"] != null)
|
||||
output_pressure_max = clamp(
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(signal.data["set_external_pressure"] != null)
|
||||
external_pressure_bound = clamp(
|
||||
text2num(signal.data["set_external_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(signal.data["status"])
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=[UID()];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=[UID()];set_freq=[ATMOS_VENTSCRUB]">Reset</a>)</li>
|
||||
<li><b>ID Tag:</b> <a href="?src=[UID()];set_id=1">[id_tag]</a></li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
@@ -16,17 +16,6 @@
|
||||
/obj/machinery/atmospherics/binary/passive_gate/detailed_examine()
|
||||
return "This is a one-way regulator, allowing gas to flow only at a specific pressure and flow rate. If the light is green, it is flowing."
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/atmos_init()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/update_icon_state()
|
||||
icon_state = "[on ? "on" : "off"]"
|
||||
|
||||
@@ -68,56 +57,6 @@
|
||||
parent2.update = 1
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
var/old_on = on //for logging
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
|
||||
if("set_output_pressure" in signal.data)
|
||||
target_pressure = clamp(
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(on != old_on)
|
||||
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
|
||||
|
||||
if("status" in signal.data)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -47,12 +47,6 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/binary/pump/AIAltClick(mob/living/silicon/user)
|
||||
set_max(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/on
|
||||
icon_state = "map_on"
|
||||
on = TRUE
|
||||
@@ -97,60 +91,6 @@ Thus, the two variables affect pump operation are set in New():
|
||||
parent2.update = 1
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "AGP",
|
||||
"power" = on,
|
||||
"target_output" = target_pressure,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/atmos_init()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
var/old_on = on //for logging
|
||||
|
||||
if(signal.data["power"])
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
on = !on
|
||||
|
||||
if(signal.data["set_output_pressure"])
|
||||
target_pressure = clamp(
|
||||
text2num(signal.data["set_output_pressure"]),
|
||||
0,
|
||||
ONE_ATMOSPHERE*50
|
||||
)
|
||||
|
||||
if(on != old_on)
|
||||
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
|
||||
|
||||
if(signal.data["status"])
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -77,16 +77,6 @@
|
||||
desc = "A digitally controlled valve."
|
||||
icon = 'icons/atmos/digital_valve.dmi'
|
||||
|
||||
frequency = ATMOS_VENTSCRUB
|
||||
var/id_tag = null
|
||||
settagwhitelist = list("id_tag")
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attack_ai(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
@@ -113,48 +103,3 @@
|
||||
icon_state = "valve[open]nopower"
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/atmos_init()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!open)
|
||||
open()
|
||||
|
||||
if("valve_close")
|
||||
if(open)
|
||||
close()
|
||||
|
||||
if("valve_toggle")
|
||||
if(open)
|
||||
close()
|
||||
else
|
||||
open()
|
||||
if("valve_set")
|
||||
if(signal.data["valve_set"] == 1)
|
||||
if(!open)
|
||||
open()
|
||||
else
|
||||
if(open)
|
||||
close()
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/attackby(obj/item/W as obj, mob/user)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/valve/digital/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=[UID()];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=[UID()];set_freq=[ATMOS_VENTSCRUB]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag","set_id")]</a></li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
@@ -44,20 +44,10 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/binary/volume_pump/AIAltClick(mob/living/silicon/user)
|
||||
set_max(user)
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/on
|
||||
on = TRUE
|
||||
icon_state = "map_on"
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/atmos_init()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/update_icon_state()
|
||||
if(!powered())
|
||||
icon_state = "off"
|
||||
@@ -97,54 +87,6 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id,
|
||||
"device" = "APV",
|
||||
"power" = on,
|
||||
"transfer_rate" = transfer_rate,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
var/old_on = on //for logging
|
||||
|
||||
if(signal.data["power"])
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"])
|
||||
on = !on
|
||||
|
||||
if(signal.data["set_transfer_rate"])
|
||||
transfer_rate = clamp(
|
||||
text2num(signal.data["set_transfer_rate"]),
|
||||
0,
|
||||
air1.volume
|
||||
)
|
||||
|
||||
if(on != old_on)
|
||||
investigate_log("was turned [on ? "on" : "off"] by a remote signal", "atmos")
|
||||
|
||||
if(signal.data["status"])
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/binary/volume_pump/attack_hand(mob/user)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -50,12 +50,6 @@
|
||||
/obj/machinery/atmospherics/trinary/filter/AIAltClick(mob/living/silicon/user)
|
||||
set_max(user)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/flipped
|
||||
icon_state = "mmap"
|
||||
flipped = TRUE
|
||||
@@ -163,10 +157,6 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/atmos_init()
|
||||
set_frequency(frequency)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/filter/attack_ghost(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
|
||||
@@ -110,12 +110,6 @@
|
||||
|
||||
var/id = null
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/bypass
|
||||
icon_state = "map_tvalve1"
|
||||
state = TVALVE_STATE_SIDE
|
||||
@@ -150,24 +144,5 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/atmos_init()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/tvalve/digital/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
go_to_side()
|
||||
|
||||
if("valve_close")
|
||||
go_straight()
|
||||
|
||||
if("valve_toggle")
|
||||
switch_side()
|
||||
|
||||
#undef TVALVE_STATE_STRAIGHT
|
||||
#undef TVALVE_STATE_SIDE
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_EMPTY(air_injectors)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector
|
||||
icon = 'icons/atmos/injector.dmi'
|
||||
icon_state = "map_injector"
|
||||
@@ -11,34 +13,25 @@
|
||||
name = "air injector"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
|
||||
req_one_access_txt = "24;10"
|
||||
|
||||
var/injecting = FALSE
|
||||
|
||||
var/volume_rate = 50
|
||||
|
||||
var/id
|
||||
Mtoollink = TRUE
|
||||
settagwhitelist = list("id_tag")
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/Initialize(mapload)
|
||||
. = ..()
|
||||
GLOB.air_injectors += src
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/Destroy()
|
||||
GLOB.air_injectors -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/on
|
||||
on = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/New()
|
||||
..()
|
||||
if(id && !id_tag)//I'm not dealing with any more merge conflicts
|
||||
id_tag = id
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/detailed_examine()
|
||||
return "Outputs the pipe's gas into the atmosphere, similar to an air vent. It can be controlled by a nearby atmospherics computer. \
|
||||
A green light on it means it is on."
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/update_icon_state()
|
||||
if(!powered())
|
||||
icon_state = "off"
|
||||
@@ -75,109 +68,21 @@
|
||||
loc.assume_air(removed)
|
||||
air_update_turf()
|
||||
|
||||
parent.update = 1
|
||||
parent.update = TRUE
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/inject()
|
||||
if(on || injecting)
|
||||
return 0
|
||||
|
||||
injecting = TRUE
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
|
||||
|
||||
loc.assume_air(removed)
|
||||
|
||||
parent.update = 1
|
||||
|
||||
flick("inject", src)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"tag" = id_tag,
|
||||
"device" = "AO",
|
||||
"power" = on,
|
||||
"volume_rate" = volume_rate,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
|
||||
radio_connection.post_signal(src, signal, RADIO_ATMOSIA)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/atmos_init()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"] != "command"))
|
||||
return 0
|
||||
|
||||
if(signal.data["power"] != null)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if(signal.data["power_toggle"] != null)
|
||||
on = !on
|
||||
|
||||
if(signal.data["inject"] != null)
|
||||
spawn inject()
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!ismultitool(I))
|
||||
return
|
||||
|
||||
if(signal.data["set_volume_rate"] != null)
|
||||
var/number = text2num(signal.data["set_volume_rate"])
|
||||
volume_rate = clamp(number, 0, air_contents.volume)
|
||||
|
||||
if(signal.data["status"])
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
//log_admin("DEBUG \[[world.timeofday]\]: outlet_injector/receive_signal: unknown command \"[signal.data["command"]]\"\n[signal.debug_print()]")
|
||||
//return
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/*hide(var/i) //to make the little pipe section invisible, the icon changes.
|
||||
if(node)
|
||||
if(on)
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]on"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]off"
|
||||
else
|
||||
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]exposed"
|
||||
on = FALSE
|
||||
return*/
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=[UID()];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=[UID()];set_freq=[ATMOS_VENTSCRUB]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag","set_id")]</a></li>
|
||||
</ul>
|
||||
"}
|
||||
var/obj/item/multitool/M = I
|
||||
M.buffer_uid = UID()
|
||||
to_chat(user, "<span class='notice'>You save [src] into [M]'s buffer</span>")
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
interact(user)
|
||||
return 1
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(iswrench(W))
|
||||
if(!(stat & NOPOWER) && on)
|
||||
to_chat(user, "<span class='danger'>You cannot unwrench this [src], turn if off first.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/interact(mob/user as mob)
|
||||
update_multitool_menu(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/hide(i)
|
||||
update_underlays()
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
name = "large passive vent"
|
||||
volume = 1000
|
||||
|
||||
/obj/machinery/atmospherics/unary/passive_vent/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/passive_vent/Initialize(mapload)
|
||||
. = ..()
|
||||
air_contents.volume = volume
|
||||
|
||||
/obj/machinery/atmospherics/unary/passive_vent/process_atmos()
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
name = "Pressure Tank (Air)"
|
||||
icon_state = "air_map"
|
||||
|
||||
/obj/machinery/atmospherics/unary/tank/air/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/tank/air/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "air"
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
@@ -42,8 +42,8 @@
|
||||
name = "Pressure Tank (Oxygen)"
|
||||
icon_state = "o2_map"
|
||||
|
||||
/obj/machinery/atmospherics/unary/tank/oxygen/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/tank/oxygen/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "o2"
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
@@ -53,8 +53,8 @@
|
||||
name = "Pressure Tank (Nitrogen)"
|
||||
icon_state = "n2_map"
|
||||
|
||||
/obj/machinery/atmospherics/unary/tank/nitrogen/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/tank/nitrogen/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "n2"
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
@@ -64,8 +64,8 @@
|
||||
name = "Pressure Tank (Carbon Dioxide)"
|
||||
icon_state = "co2_map"
|
||||
|
||||
/obj/machinery/atmospherics/unary/tank/carbon_dioxide/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/tank/carbon_dioxide/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "co2"
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
@@ -75,8 +75,8 @@
|
||||
name = "Pressure Tank (Toxins)"
|
||||
icon_state = "toxins_map"
|
||||
|
||||
/obj/machinery/atmospherics/unary/tank/toxins/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/tank/toxins/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "toxins"
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
@@ -86,8 +86,8 @@
|
||||
name = "Pressure Tank (Nitrous Oxide)"
|
||||
icon_state = "n2o_map"
|
||||
|
||||
/obj/machinery/atmospherics/unary/tank/nitrous_oxide/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/tank/nitrous_oxide/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "n2o"
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
@@ -99,8 +99,8 @@
|
||||
desc = "A large vessel containing an unknown pressurized gas."
|
||||
icon_state = "agent_b_map"
|
||||
|
||||
/obj/machinery/atmospherics/unary/tank/oxygen_agent_b/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/tank/oxygen_agent_b/Initialize(mapload)
|
||||
. = ..()
|
||||
icon_state = "agent_b"
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
layer = TURF_LAYER+0.1
|
||||
var/id_tag
|
||||
/// The current air contents of this device
|
||||
var/datum/gas_mixture/air_contents
|
||||
|
||||
/// Our one pipe node (we're unary)
|
||||
var/obj/machinery/atmospherics/node
|
||||
|
||||
/// The pipenet we are plugged into
|
||||
var/datum/pipeline/parent
|
||||
|
||||
/obj/machinery/atmospherics/unary/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/Initialize(mapload)
|
||||
. = ..()
|
||||
initialize_directions = dir
|
||||
air_contents = new
|
||||
air_contents.volume = 200
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
var/open = FALSE
|
||||
|
||||
var/area/initial_loc
|
||||
var/area_uid
|
||||
|
||||
req_one_access_txt = "24;10"
|
||||
|
||||
var/releasing = TRUE //FALSE = siphoning, TRUE = releasing
|
||||
|
||||
@@ -38,12 +35,6 @@
|
||||
var/welded = FALSE // Added for aliens -- TLE
|
||||
var/weld_burst_pressure = 50 * ONE_ATMOSPHERE //the (internal) pressure at which welded covers will burst off
|
||||
|
||||
frequency = ATMOS_VENTSCRUB
|
||||
Mtoollink = TRUE
|
||||
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
connect_types = list(CONNECT_TYPE_NORMAL, CONNECT_TYPE_SUPPLY) //connects to regular and supply pipes
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/detailed_examine()
|
||||
@@ -60,22 +51,21 @@
|
||||
on = TRUE
|
||||
icon_state = "map_vent_in"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/vent_pump/Initialize(mapload)
|
||||
. = ..()
|
||||
GLOB.all_vent_pumps += src
|
||||
icon = null
|
||||
initial_loc = get_area(loc)
|
||||
area_uid = initial_loc.uid
|
||||
if(!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
if(!autolink_id) // Autolink vents are externally managed, and should not show up on the air alarm
|
||||
initial_loc.vents += src
|
||||
name = "[initial_loc.name] Vent Pump #[length(initial_loc.vents)]"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume
|
||||
name = "large air vent"
|
||||
power_channel = EQUIP
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume/Initialize(mapload)
|
||||
. = ..()
|
||||
air_contents.volume = 1000
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/update_overlays()
|
||||
@@ -174,118 +164,6 @@
|
||||
|
||||
return TRUE
|
||||
|
||||
//Radio remote control
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = SSradio.add_object(src, frequency,radio_filter_in)
|
||||
if(frequency != ATMOS_VENTSCRUB)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
name = "vent pump"
|
||||
else
|
||||
broadcast_status()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
|
||||
signal.data = list(
|
||||
"area" = src.area_uid,
|
||||
"tag" = src.id_tag,
|
||||
"device" = "AVP",
|
||||
"power" = on,
|
||||
"direction" = releasing?("release"):("siphon"),
|
||||
"checks" = pressure_checks,
|
||||
"internal" = internal_pressure_bound,
|
||||
"external" = external_pressure_bound,
|
||||
"timestamp" = world.time,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
if(frequency == ATMOS_VENTSCRUB)
|
||||
if(!initial_loc.air_vent_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Vent Pump #[initial_loc.air_vent_names.len+1]"
|
||||
initial_loc.air_vent_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_vent_info[id_tag] = signal.data
|
||||
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/atmos_init()
|
||||
..()
|
||||
|
||||
//some vents work his own special way
|
||||
radio_filter_in = frequency==ATMOS_VENTSCRUB?(RADIO_FROM_AIRALARM):null
|
||||
radio_filter_out = frequency==ATMOS_VENTSCRUB?(RADIO_TO_AIRALARM):null
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
broadcast_status()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"]!="command"))
|
||||
return FALSE
|
||||
|
||||
if("purge" in signal.data)
|
||||
pressure_checks &= ~1
|
||||
releasing = FALSE
|
||||
|
||||
if("stabalize" in signal.data)
|
||||
pressure_checks |= 1
|
||||
releasing = TRUE
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
|
||||
if("checks" in signal.data)
|
||||
pressure_checks = text2num(signal.data["checks"])
|
||||
|
||||
if("checks_toggle" in signal.data)
|
||||
pressure_checks = (pressure_checks ? 0 : 3)
|
||||
|
||||
if("direction" in signal.data)
|
||||
releasing = text2num(signal.data["direction"])
|
||||
|
||||
if("set_internal_pressure" in signal.data)
|
||||
internal_pressure_bound = clamp(text2num(signal.data["set_internal_pressure"]), 0, ONE_ATMOSPHERE * 50)
|
||||
|
||||
if("set_external_pressure" in signal.data)
|
||||
external_pressure_bound = clamp(text2num(signal.data["set_external_pressure"]), 0, ONE_ATMOSPHERE * 50)
|
||||
|
||||
if("reset_external_pressure" in signal.data)
|
||||
external_pressure_bound = ONE_ATMOSPHERE
|
||||
|
||||
if("adjust_internal_pressure" in signal.data)
|
||||
internal_pressure_bound = clamp(internal_pressure_bound + text2num(signal.data["adjust_internal_pressure"]), 0, ONE_ATMOSPHERE * 50)
|
||||
|
||||
if("adjust_external_pressure" in signal.data)
|
||||
external_pressure_bound = clamp(external_pressure_bound + text2num(signal.data["adjust_external_pressure"]), 0, ONE_ATMOSPHERE * 50)
|
||||
|
||||
if("init" in signal.data)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if("status" in signal.data)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/can_crawl_through()
|
||||
return !welded
|
||||
|
||||
@@ -309,17 +187,23 @@
|
||||
to_chat(user, "You can't shove that down there when it is closed")
|
||||
else
|
||||
to_chat(user, "The vent is welded.")
|
||||
return 1
|
||||
if(istype(W, /obj/item/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
if(istype(W, /obj/item/wrench))
|
||||
return TRUE
|
||||
|
||||
if(iswrench(W))
|
||||
if(!(stat & NOPOWER) && on)
|
||||
to_chat(user, "<span class='danger'>You cannot unwrench this [src], turn it off first.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!ismultitool(I))
|
||||
return
|
||||
|
||||
var/obj/item/multitool/M = I
|
||||
M.buffer_uid = UID()
|
||||
to_chat(user, "<span class='notice'>You save [src] into [M]'s buffer</span>")
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/screwdriver_act(mob/living/user, obj/item/I)
|
||||
if(welded)
|
||||
return
|
||||
@@ -355,7 +239,6 @@
|
||||
continue
|
||||
W.forceMove(get_turf(src))
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
|
||||
. = ..()
|
||||
if(welded)
|
||||
@@ -367,40 +250,8 @@
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/interact(mob/user as mob)
|
||||
update_multitool_menu(user)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=[UID()];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=[UID()];set_freq=[ATMOS_VENTSCRUB]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag","set_id")]</li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/multitool_topic(mob/user, list/href_list, obj/O)
|
||||
if("set_id" in href_list)
|
||||
var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID tag for this machine", src, src.id_tag) as null|text), 1, MAX_MESSAGE_LEN)
|
||||
if(!newid)
|
||||
return
|
||||
if(frequency == ATMOS_VENTSCRUB)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
|
||||
id_tag = newid
|
||||
broadcast_status()
|
||||
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/Destroy()
|
||||
GLOB.all_vent_pumps -= src
|
||||
if(initial_loc)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
initial_loc.vents -= src
|
||||
return ..()
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
icon = 'icons/atmos/vent_scrubber.dmi'
|
||||
icon_state = "map_scrubber_off"
|
||||
|
||||
req_one_access_txt = "24;10"
|
||||
|
||||
name = "air scrubber"
|
||||
desc = "Has a valve and pump attached to it"
|
||||
layer = GAS_SCRUBBER_LAYER
|
||||
@@ -16,8 +14,6 @@
|
||||
|
||||
var/area/initial_loc
|
||||
|
||||
frequency = ATMOS_VENTSCRUB
|
||||
|
||||
var/list/turf/simulated/adjacent_turfs = list()
|
||||
|
||||
var/scrubbing = TRUE //FALSE = siphoning, TRUE = scrubbing
|
||||
@@ -32,36 +28,27 @@
|
||||
|
||||
var/welded = FALSE
|
||||
|
||||
var/area_uid
|
||||
var/radio_filter_out
|
||||
var/radio_filter_in
|
||||
|
||||
connect_types = list(CONNECT_TYPE_NORMAL, CONNECT_TYPE_SCRUBBER) //connects to regular and scrubber pipes
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/on
|
||||
on = TRUE
|
||||
icon_state = "map_scrubber"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Initialize(mapload)
|
||||
. = ..()
|
||||
icon = null
|
||||
initial_loc = get_area(loc)
|
||||
area_uid = initial_loc.uid
|
||||
if(!id_tag)
|
||||
assign_uid()
|
||||
id_tag = num2text(uid)
|
||||
initial_loc.scrubbers += src
|
||||
name = "[initial_loc.name] Air Scrubber #[length(initial_loc.scrubbers)]"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/detailed_examine()
|
||||
return "This filters the atmosphere of harmful gas. Filtered gas goes to the pipes connected to it, typically a scrubber pipe. \
|
||||
It can be controlled from an Air Alarm. It can be configured to drain all air rapidly with a 'panic syphon' from an air alarm."
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Destroy()
|
||||
if(initial_loc && frequency == ATMOS_VENTSCRUB)
|
||||
initial_loc.air_scrub_info -= id_tag
|
||||
initial_loc.air_scrub_names -= id_tag
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
if(initial_loc)
|
||||
initial_loc.scrubbers -= src
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
|
||||
@@ -92,7 +79,7 @@
|
||||
amount = active_power_usage
|
||||
|
||||
if(widenet)
|
||||
amount += amount*(adjacent_turfs.len*(adjacent_turfs.len/2))
|
||||
amount += amount * (length(adjacent_turfs) * (length(adjacent_turfs) / 2))
|
||||
use_power(amount, power_channel)
|
||||
return 1
|
||||
|
||||
@@ -135,56 +122,8 @@
|
||||
underlays += frame
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, radio_filter_in)
|
||||
if(frequency != ATMOS_VENTSCRUB)
|
||||
initial_loc.air_scrub_info -= id_tag
|
||||
initial_loc.air_scrub_names -= id_tag
|
||||
name = "air Scrubber"
|
||||
else
|
||||
broadcast_status()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/proc/broadcast_status()
|
||||
if(!radio_connection)
|
||||
return 0
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.transmission_method = 1 //radio signal
|
||||
signal.source = src
|
||||
signal.data = list(
|
||||
"area" = area_uid,
|
||||
"tag" = id_tag,
|
||||
"device" = "AScr",
|
||||
"timestamp" = world.time,
|
||||
"power" = on,
|
||||
"scrubbing" = scrubbing,
|
||||
"widenet" = widenet,
|
||||
"filter_o2" = scrub_O2,
|
||||
"filter_n2" = scrub_N2,
|
||||
"filter_co2" = scrub_CO2,
|
||||
"filter_toxins" = scrub_Toxins,
|
||||
"filter_n2o" = scrub_N2O,
|
||||
"sigtype" = "status"
|
||||
)
|
||||
if(frequency == ATMOS_VENTSCRUB)
|
||||
if(!initial_loc.air_scrub_names[id_tag])
|
||||
var/new_name = "[initial_loc.name] Air Scrubber #[initial_loc.air_scrub_names.len+1]"
|
||||
initial_loc.air_scrub_names[id_tag] = new_name
|
||||
src.name = new_name
|
||||
initial_loc.air_scrub_info[id_tag] = signal.data
|
||||
radio_connection.post_signal(src, signal, radio_filter_out)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/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)
|
||||
src.broadcast_status()
|
||||
check_turfs()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/process_atmos()
|
||||
@@ -268,10 +207,10 @@
|
||||
tile.air_update_turf()
|
||||
|
||||
else //Just siphoning all air
|
||||
if(air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
if(air_contents.return_pressure() >= (50 * ONE_ATMOSPHERE))
|
||||
return
|
||||
|
||||
var/transfer_moles = environment.total_moles()*(volume_rate/environment.volume)
|
||||
var/transfer_moles = environment.total_moles() * (volume_rate/environment.volume)
|
||||
|
||||
var/datum/gas_mixture/removed = tile.remove_air(transfer_moles)
|
||||
|
||||
@@ -285,94 +224,12 @@
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/hide(i) //to make the little pipe section invisible, the icon changes.
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/receive_signal(datum/signal/signal)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id_tag) || (signal.data["sigtype"] != "command"))
|
||||
return FALSE
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
if("power_toggle" in signal.data)
|
||||
on = !on
|
||||
|
||||
if("widenet" in signal.data)
|
||||
widenet = text2num(signal.data["widenet"])
|
||||
if("toggle_widenet" in signal.data)
|
||||
widenet = !widenet
|
||||
|
||||
if("scrubbing" in signal.data)
|
||||
scrubbing = text2num(signal.data["scrubbing"])
|
||||
if("toggle_scrubbing" in signal.data)
|
||||
scrubbing = !scrubbing
|
||||
|
||||
if("o2_scrub" in signal.data)
|
||||
scrub_O2 = text2num(signal.data["o2_scrub"])
|
||||
if("toggle_o2_scrub" in signal.data)
|
||||
scrub_O2 = !scrub_O2
|
||||
|
||||
if("n2_scrub" in signal.data)
|
||||
scrub_N2 = text2num(signal.data["n2_scrub"])
|
||||
if("toggle_n2_scrub" in signal.data)
|
||||
scrub_N2 = !scrub_N2
|
||||
|
||||
if("co2_scrub" in signal.data)
|
||||
scrub_CO2 = text2num(signal.data["co2_scrub"])
|
||||
if("toggle_co2_scrub" in signal.data)
|
||||
scrub_CO2 = !scrub_CO2
|
||||
|
||||
if("tox_scrub" in signal.data)
|
||||
scrub_Toxins = text2num(signal.data["tox_scrub"])
|
||||
if("toggle_tox_scrub" in signal.data)
|
||||
scrub_Toxins = !scrub_Toxins
|
||||
|
||||
if("n2o_scrub" in signal.data)
|
||||
scrub_N2O = text2num(signal.data["n2o_scrub"])
|
||||
if("toggle_n2o_scrub" in signal.data)
|
||||
scrub_N2O = !scrub_N2O
|
||||
|
||||
if("init" in signal.data)
|
||||
name = signal.data["init"]
|
||||
return
|
||||
|
||||
if("status" in signal.data)
|
||||
broadcast_status()
|
||||
return //do not update_icon
|
||||
|
||||
broadcast_status()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/power_change()
|
||||
var/old_stat = stat
|
||||
..()
|
||||
if(old_stat != stat)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return {"
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=[UID()];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=[UID()];set_freq=[ATMOS_VENTSCRUB]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag", "set_id")]</li>
|
||||
</ul>
|
||||
"}
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/multitool_topic(mob/user, list/href_list, obj/O)
|
||||
if("set_id" in href_list)
|
||||
var/newid = copytext(reject_bad_text(input(usr, "Specify the new ID tag for this machine", src, src:id_tag) as null|text),1,MAX_MESSAGE_LEN)
|
||||
if(!newid)
|
||||
return
|
||||
|
||||
if(frequency == ATMOS_VENTSCRUB)
|
||||
initial_loc.air_scrub_info -= id_tag
|
||||
initial_loc.air_scrub_names -= id_tag
|
||||
|
||||
id_tag = newid
|
||||
broadcast_status()
|
||||
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/can_crawl_through()
|
||||
return !welded
|
||||
|
||||
@@ -386,14 +243,11 @@
|
||||
pipe_image.plane = ABOVE_HUD_PLANE
|
||||
playsound(loc, 'sound/weapons/bladeslice.ogg', 100, TRUE)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/wrench))
|
||||
if(!(stat & NOPOWER) && on)
|
||||
to_chat(user, "<span class='danger'>You cannot unwrench this [src], turn it off first.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -1,31 +1,29 @@
|
||||
GLOBAL_LIST_EMPTY(gas_meters)
|
||||
|
||||
/obj/machinery/atmospherics/meter
|
||||
name = "gas flow meter"
|
||||
desc = "It measures something."
|
||||
desc = "A gas flow meter"
|
||||
icon = 'icons/obj/meter.dmi'
|
||||
icon_state = "meterX"
|
||||
|
||||
layer = GAS_PUMP_LAYER
|
||||
|
||||
var/obj/machinery/atmospherics/pipe/target = null
|
||||
anchored = TRUE
|
||||
max_integrity = 150
|
||||
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 40, ACID = 0)
|
||||
power_channel = ENVIRON
|
||||
frequency = ATMOS_DISTRO_FREQ
|
||||
var/id_tag
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 2
|
||||
active_power_usage = 5
|
||||
req_one_access_txt = "24;10"
|
||||
Mtoollink = TRUE
|
||||
settagwhitelist = list("id_tag")
|
||||
|
||||
var/obj/machinery/atmospherics/pipe/target = null
|
||||
|
||||
/obj/machinery/atmospherics/meter/Initialize(mapload)
|
||||
. = ..()
|
||||
GLOB.gas_meters += src
|
||||
target = locate(/obj/machinery/atmospherics/pipe) in loc
|
||||
|
||||
/obj/machinery/atmospherics/meter/Destroy()
|
||||
target = null
|
||||
GLOB.gas_meters -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/meter/detailed_examine()
|
||||
@@ -42,23 +40,6 @@
|
||||
return
|
||||
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
var/env_pressure = environment.return_pressure()
|
||||
if(frequency)
|
||||
var/datum/radio_frequency/radio_connection = SSradio.return_frequency(frequency)
|
||||
|
||||
if(!radio_connection) return
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.transmission_method = 1
|
||||
signal.data = list(
|
||||
"tag" = id_tag,
|
||||
"device" = "AM",
|
||||
"pressure" = round(env_pressure),
|
||||
"sigtype" = "status"
|
||||
)
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/meter/update_icon_state()
|
||||
if(!target)
|
||||
@@ -89,51 +70,32 @@
|
||||
else
|
||||
icon_state = "meter4"
|
||||
|
||||
/obj/machinery/atmospherics/meter/proc/status()
|
||||
var/t = ""
|
||||
if(target)
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(environment)
|
||||
t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]°K ([round(environment.temperature-T0C,0.01)]°C)"
|
||||
else
|
||||
t += "The sensor error light is blinking."
|
||||
else
|
||||
t += "The connect error light is blinking."
|
||||
return t
|
||||
|
||||
/obj/machinery/atmospherics/meter/examine(mob/user)
|
||||
var/t = "A gas flow meter. "
|
||||
|
||||
. = ..()
|
||||
if(get_dist(user, src) > 3 && !(isAI(user) || istype(user, /mob/dead)))
|
||||
t += "<span class='boldnotice'>You are too far away to read it.</span>"
|
||||
. += "<span class='boldnotice'>You are too far away to read it.</span>"
|
||||
|
||||
else if(stat & (NOPOWER|BROKEN))
|
||||
t += "<span class='danger'>The display is off.</span>"
|
||||
. += "<span class='danger'>The display is off.</span>"
|
||||
|
||||
else if(target)
|
||||
var/datum/gas_mixture/environment = target.return_air()
|
||||
if(environment)
|
||||
t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]K ([round(environment.temperature-T0C,0.01)]°C)"
|
||||
. += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]K ([round(environment.temperature-T0C,0.01)]°C)"
|
||||
else
|
||||
t += "The sensor error light is blinking."
|
||||
. += "The sensor error light is blinking."
|
||||
else
|
||||
t += "The connect error light is blinking."
|
||||
|
||||
. = list(t)
|
||||
. += "The connect error light is blinking."
|
||||
|
||||
/obj/machinery/atmospherics/meter/Click()
|
||||
if(isAI(usr)) // ghosts can call ..() for examine
|
||||
usr.examinate(src)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/meter/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
update_multitool_menu(user)
|
||||
return 1
|
||||
|
||||
if(!istype(W, /obj/item/wrench))
|
||||
if(!iswrench(W))
|
||||
return ..()
|
||||
playsound(loc, W.usesound, 50, 1)
|
||||
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
|
||||
@@ -154,10 +116,11 @@
|
||||
if(current_size >= STAGE_FIVE)
|
||||
deconstruct()
|
||||
|
||||
/obj/machinery/atmospherics/meter/multitool_menu(mob/user, obj/item/multitool/P)
|
||||
return {"
|
||||
<b>Main</b>
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=[UID()];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=[UID()];set_freq=[initial(frequency)]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag")]</li>
|
||||
</ul>"}
|
||||
|
||||
/obj/machinery/atmospherics/meter/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!ismultitool(I))
|
||||
return
|
||||
|
||||
var/obj/item/multitool/M = I
|
||||
M.buffer_uid = UID()
|
||||
to_chat(user, "<span class='notice'>You save [src] into [M]'s buffer</span>")
|
||||
|
||||
@@ -31,13 +31,14 @@
|
||||
var/obj/item/pipe_meter/PM = new (T)
|
||||
meter.transfer_fingerprints_to(PM)
|
||||
qdel(meter)
|
||||
. = ..()
|
||||
|
||||
// if we're somehow by ourself
|
||||
if(parent && !QDELETED(parent) && parent.members.len == 1 && parent.members[1] == src)
|
||||
qdel(parent)
|
||||
parent = null
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/returnPipenet(obj/machinery/atmospherics/A)
|
||||
return parent
|
||||
|
||||
@@ -69,6 +70,7 @@
|
||||
air_update_turf()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
if(!parent)
|
||||
return 0
|
||||
return parent.air
|
||||
|
||||
@@ -270,6 +270,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
|
||||
can_label = FALSE
|
||||
|
||||
/obj/machinery/atmospherics/portable/canister/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/atmospherics/portable/canister/proc/return_temperature()
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/portable/pump/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/atmospherics/portable/pump/replace_tank(mob/living/user, close_valve)
|
||||
|
||||
@@ -97,6 +97,7 @@
|
||||
tile.air_update_turf()
|
||||
|
||||
/obj/machinery/atmospherics/portable/scrubber/return_air()
|
||||
RETURN_TYPE(/datum/gas_mixture)
|
||||
return air_contents
|
||||
|
||||
/obj/machinery/atmospherics/portable/scrubber/attack_ai(mob/user)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
// This file exists so that this PR cannot be testmerged at the same time as 19951
|
||||
// If it were to be TM'd at the same time, a lot of things would break
|
||||
// Remove this file before full merge
|
||||
@@ -73,5 +73,5 @@
|
||||
// simply don't be moved
|
||||
return FALSE
|
||||
disconnect()
|
||||
LateInitialize()
|
||||
LateInitialize() // who the fuck did this
|
||||
return ..()
|
||||
|
||||
+5
-6
@@ -733,6 +733,10 @@
|
||||
#include "code\game\machinery\turret_control.dm"
|
||||
#include "code\game\machinery\washing_machine.dm"
|
||||
#include "code\game\machinery\wishgranter.dm"
|
||||
#include "code\game\machinery\airlock_control\_airlock_control_defines.dm"
|
||||
#include "code\game\machinery\airlock_control\airlock_button.dm"
|
||||
#include "code\game\machinery\airlock_control\airlock_controllers.dm"
|
||||
#include "code\game\machinery\airlock_control\z_airlock_undef.dm"
|
||||
#include "code\game\machinery\camera\camera.dm"
|
||||
#include "code\game\machinery\camera\camera_assembly.dm"
|
||||
#include "code\game\machinery\camera\motion.dm"
|
||||
@@ -765,10 +769,8 @@
|
||||
#include "code\game\machinery\computer\sm_monitor.dm"
|
||||
#include "code\game\machinery\computer\station_alert.dm"
|
||||
#include "code\game\machinery\doors\airlock.dm"
|
||||
#include "code\game\machinery\doors\airlock_control.dm"
|
||||
#include "code\game\machinery\doors\airlock_electronics.dm"
|
||||
#include "code\game\machinery\doors\airlock_types.dm"
|
||||
#include "code\game\machinery\doors\alarmlock.dm"
|
||||
#include "code\game\machinery\doors\brigdoors.dm"
|
||||
#include "code\game\machinery\doors\checkForMultipleDoors.dm"
|
||||
#include "code\game\machinery\doors\door.dm"
|
||||
@@ -777,10 +779,6 @@
|
||||
#include "code\game\machinery\doors\shutters.dm"
|
||||
#include "code\game\machinery\doors\unpowered.dm"
|
||||
#include "code\game\machinery\doors\windowdoor.dm"
|
||||
#include "code\game\machinery\embedded_controller\airlock_controllers.dm"
|
||||
#include "code\game\machinery\embedded_controller\airlock_program.dm"
|
||||
#include "code\game\machinery\embedded_controller\embedded_controller_base.dm"
|
||||
#include "code\game\machinery\embedded_controller\embedded_program_base.dm"
|
||||
#include "code\game\machinery\pipe\construction.dm"
|
||||
#include "code\game\machinery\tcomms\_base.dm"
|
||||
#include "code\game\machinery\tcomms\core.dm"
|
||||
@@ -1796,6 +1794,7 @@
|
||||
#include "code\modules\lighting\lighting_turf.dm"
|
||||
#include "code\modules\mapping\access_helpers.dm"
|
||||
#include "code\modules\mapping\base_map_datum.dm"
|
||||
#include "code\modules\mapping\cerestation.dm"
|
||||
#include "code\modules\mapping\cyberiad.dm"
|
||||
#include "code\modules\mapping\delta.dm"
|
||||
#include "code\modules\mapping\mapping_helpers.dm"
|
||||
|
||||
@@ -9,7 +9,7 @@ export const AirlockAccessController = (props, context) => {
|
||||
let interiorbutton;
|
||||
// If exterior is open, then it can be locked, if closed, it can be cycled to. Vice versa for interior
|
||||
|
||||
if (data.exterior_status.state === 'open') {
|
||||
if (exterior_status === 'open') {
|
||||
exteriorbutton = (
|
||||
<Button
|
||||
content={'Lock Exterior Door'}
|
||||
@@ -28,7 +28,7 @@ export const AirlockAccessController = (props, context) => {
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (data.interior_status.state === 'open') {
|
||||
if (interior_status === 'open') {
|
||||
interiorbutton = (
|
||||
<Button
|
||||
content={'Lock Interior Door'}
|
||||
@@ -56,10 +56,10 @@ export const AirlockAccessController = (props, context) => {
|
||||
<Section title="Information">
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="External Door Status">
|
||||
{exterior_status.state === 'closed' ? 'Locked' : 'Open'}
|
||||
{exterior_status === 'closed' ? 'Locked' : 'Open'}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Internal Door Status">
|
||||
{interior_status.state === 'closed' ? 'Locked' : 'Open'}
|
||||
{interior_status === 'closed' ? 'Locked' : 'Open'}
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
|
||||
@@ -15,26 +15,16 @@ export const AtmosAlertConsole = (props, context) => {
|
||||
<li className="color-good">No Priority Alerts</li>
|
||||
)}
|
||||
{priorityAlerts.map((alert) => (
|
||||
<li key={alert}>
|
||||
<Button
|
||||
icon="times"
|
||||
content={alert}
|
||||
color="bad"
|
||||
onClick={() => act('clear', { zone: alert })}
|
||||
/>
|
||||
<li key={alert} className="color-bad">
|
||||
{alert}
|
||||
</li>
|
||||
))}
|
||||
{minorAlerts.length === 0 && (
|
||||
<li className="color-good">No Minor Alerts</li>
|
||||
)}
|
||||
{minorAlerts.map((alert) => (
|
||||
<li key={alert}>
|
||||
<Button
|
||||
icon="times"
|
||||
content={alert}
|
||||
color="average"
|
||||
onClick={() => act('clear', { zone: alert })}
|
||||
/>
|
||||
<li key={alert} className="color-average">
|
||||
{alert}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Section, NumberInput, LabeledList, ProgressBar } from '../components';
|
||||
import { toFixed } from 'common/math';
|
||||
import { getGasColor, getGasLabel } from '../constants';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const AtmosTankControl = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
|
||||
let sensors_list = data.sensors || {};
|
||||
|
||||
return (
|
||||
<Window resizable>
|
||||
<Window.Content scrollable>
|
||||
{Object.keys(sensors_list).map(s => (
|
||||
<Section key={s} title={s}>
|
||||
<LabeledList>
|
||||
{(Object.keys(sensors_list[s]).indexOf("pressure") > -1) ? (
|
||||
<LabeledList.Item label="Pressure">
|
||||
{sensors_list[s]['pressure']} kpa
|
||||
</LabeledList.Item>
|
||||
) : ""}
|
||||
{(Object.keys(sensors_list[s]).indexOf("temperature") > -1) ? (
|
||||
<LabeledList.Item label="Temperature">
|
||||
{sensors_list[s]['temperature']} kpa
|
||||
</LabeledList.Item>
|
||||
) : ""}
|
||||
|
||||
{["o2", "n2", "plasma", "co2", "n2o"].map(g => (
|
||||
(Object.keys(sensors_list[s]).indexOf(g) > -1) ? (
|
||||
<LabeledList.Item label={getGasLabel(g)}>
|
||||
<ProgressBar
|
||||
color={getGasColor(g)}
|
||||
value={sensors_list[s][g]}
|
||||
minValue={0}
|
||||
maxValue={100}
|
||||
>
|
||||
{toFixed(sensors_list[s][g], 2) + '%'}
|
||||
</ProgressBar>
|
||||
</LabeledList.Item>
|
||||
) : ""
|
||||
))}
|
||||
</LabeledList>
|
||||
</Section>
|
||||
))}
|
||||
{(data.inlet && Object.keys(data.inlet).length > 0) ? (
|
||||
<Section title="Inlet Control">
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Power">
|
||||
<Button
|
||||
icon={data.inlet.on ? 'power-off' : 'power-off'}
|
||||
content={data.inlet.on ? 'On' : 'Off'}
|
||||
color={data.inlet.on ? null : 'red'}
|
||||
selected={data.inlet.on}
|
||||
onClick={() => act('toggle_active', { dev: 'inlet' })}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Rate">
|
||||
<NumberInput
|
||||
animated
|
||||
unit={"L/s"}
|
||||
width={6.1}
|
||||
lineHeight={1.5}
|
||||
step={1}
|
||||
minValue={0}
|
||||
maxValue={50}
|
||||
value={data.inlet.rate}
|
||||
onDrag={(e, value) =>
|
||||
act('set_pressure', {
|
||||
dev: 'inlet',
|
||||
val: value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
) : ""}
|
||||
{(data.outlet && Object.keys(data.outlet).length > 0) ? (
|
||||
<Section title="Outlet Control">
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Power">
|
||||
<Button
|
||||
icon={data.outlet.on ? 'power-off' : 'power-off'}
|
||||
content={data.outlet.on ? 'On' : 'Off'}
|
||||
color={data.outlet.on ? null : 'red'}
|
||||
selected={data.outlet.on}
|
||||
onClick={() => act('toggle_active', { dev: 'outlet' })}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Rate">
|
||||
<NumberInput
|
||||
animated
|
||||
unit={"kPa"}
|
||||
width={6.1}
|
||||
lineHeight={1.5}
|
||||
step={10}
|
||||
minValue={0}
|
||||
maxValue={5066}
|
||||
value={data.outlet.rate}
|
||||
onDrag={(e, value) =>
|
||||
act('set_pressure', {
|
||||
dev: 'outlet',
|
||||
val: value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
) : ""}
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user