diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 800b94656ea1f..5a2bde87325d2 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -93,6 +93,7 @@ var/list/part_overlays var/panel_attachment = "right" var/note_attachment = "left" + var/maintenance = FALSE //whether or not the door should be affected by emergency maintenance mode var/cyclelinkeddir = 0 var/obj/machinery/door/airlock/cyclelinkedairlock @@ -1665,3 +1666,14 @@ /obj/machinery/door/airlock/proc/set_wires(wire_security_level) return new /datum/wires/airlock(src, wire_security_level) +/obj/machinery/door/airlock/proc/set_door_to_all_access() + if(maintenance) + emergency = TRUE + update_icon() + wires.ui_update() + +/obj/machinery/door/airlock/proc/remove_door_from_all_access() + if(maintenance) + emergency = FALSE + update_icon() + wires.ui_update() diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm index 99ac38fcee550..acc0a16e14af6 100644 --- a/code/game/machinery/doors/airlock_types.dm +++ b/code/game/machinery/doors/airlock_types.dm @@ -144,11 +144,13 @@ /obj/machinery/door/airlock/maintenance/glass opacity = FALSE glass = TRUE + maintenance = TRUE /obj/machinery/door/airlock/maintenance/external/glass opacity = FALSE glass = TRUE normal_integrity = 200 + maintenance = TRUE ////////////////////////////////// /* diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 6476928f9d556..624edd84c1168 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -41,7 +41,6 @@ var/red_alert_access = FALSE //if TRUE, this door will always open on red alert var/unres_sides = 0 //Unrestricted sides. A bitflag for which direction (if any) can open the door with no access var/open_speed = 5 - var/maintenance = FALSE //whether or not the door should be affected by emergency maintenance mode /obj/machinery/door/examine(mob/user) . = ..() diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index a0627309447f7..5c836cebbbb77 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -142,23 +142,15 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/keycard_auth, 26) GLOBAL_VAR_INIT(emergency_access, FALSE) /proc/make_maint_all_access() - for(var/area/maintenance/M as anything in get_areas(/area/maintenance, SSmapping.levels_by_trait(ZTRAIT_STATION)[1])) - for(var/turf/in_area as anything in M.get_contained_turfs()) - for(var/obj/machinery/door/airlock/A in in_area) - A.emergency = TRUE - A.update_icon() - A.wires.ui_update() + for(var/obj/machinery/door/airlock/A) + A.set_door_to_all_access() minor_announce("Access restrictions on maintenance and external airlocks have been lifted.", "Attention! Station-wide emergency declared!",1) GLOB.emergency_access = TRUE SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "enabled")) /proc/revoke_maint_all_access() - for(var/area/maintenance/M as anything in get_areas(/area/maintenance, SSmapping.levels_by_trait(ZTRAIT_STATION)[1])) - for(var/turf/in_area as anything in M.get_contained_turfs()) - for(var/obj/machinery/door/airlock/A in in_area) - A.emergency = FALSE - A.update_icon() - A.wires.ui_update() + for(var/obj/machinery/door/airlock/A) + A.remove_door_from_all_access() minor_announce("Access restrictions in maintenance areas have been restored.", "Attention! Station-wide emergency rescinded:") GLOB.emergency_access = FALSE SSblackbox.record_feedback("nested tally", "keycard_auths", 1, list("emergency maintenance access", "disabled"))