Security Level subsystem (#58248)

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
Arkatos1
2021-04-10 15:10:40 -07:00
committed by GitHub
co-authored by Mothblocks
parent babca6c322
commit c19b7c0787
12 changed files with 97 additions and 55 deletions
+20 -2
View File
@@ -568,7 +568,7 @@
var/obj/machinery/computer/shuttle/C = getControlConsole()
if(!istype(C, /obj/machinery/computer/shuttle/pod))
return ..()
if(GLOB.security_level >= SEC_LEVEL_RED || (C && (C.obj_flags & EMAGGED)))
if(SSsecurity_level.current_level >= SEC_LEVEL_RED || (C && (C.obj_flags & EMAGGED)))
if(launch_status == UNLAUNCHED)
launch_status = EARLY_LAUNCHED
return ..()
@@ -588,6 +588,10 @@
light_color = LIGHT_COLOR_BLUE
density = FALSE
/obj/machinery/computer/shuttle/pod/Initialize(mapload)
. = ..()
RegisterSignal(SSsecurity_level, COMSIG_SECURITY_LEVEL_CHANGED, .proc/check_lock)
/obj/machinery/computer/shuttle/pod/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_blocker)
@@ -603,6 +607,20 @@
. = ..()
possible_destinations += ";[port.id]_lavaland"
/**
* Signal handler for checking if we should lock or unlock escape pods accordingly to a newly set security level
*
* Arguments:
* * source The datum source of the signal
* * new_level The new security level that is in effect
*/
/obj/machinery/computer/shuttle/pod/proc/check_lock(datum/source, new_level)
SIGNAL_HANDLER
if(obj_flags & EMAGGED)
return
locked = new_level < SEC_LEVEL_RED
/obj/docking_port/stationary/random
name = "escape pod"
id = "pod"
@@ -698,7 +716,7 @@
/obj/item/storage/pod/can_interact(mob/user)
if(!..())
return FALSE
if(GLOB.security_level >= SEC_LEVEL_RED || unlocked)
if(SSsecurity_level.current_level >= SEC_LEVEL_RED || unlocked)
return TRUE
to_chat(user, "The storage unit will only unlock during a Red or Delta security alert.")