Skip to content

Commit

Permalink
its alive!!
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusLarsson421 committed Jul 23, 2024
1 parent fab5094 commit 66823bd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
12 changes: 12 additions & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
2 changes: 2 additions & 0 deletions code/game/machinery/doors/airlock_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

//////////////////////////////////
/*
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
. = ..()
Expand Down
16 changes: 4 additions & 12 deletions code/modules/security_levels/keycard_authentication.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down

0 comments on commit 66823bd

Please sign in to comment.