mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 20:20:33 +01:00
[MIRROR] Security Level subsystem (#4809)
* Security Level subsystem * aaa Co-authored-by: Arkatos1 <43862960+Arkatos1@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Arkatos1
Gandalf
parent
48f9f10597
commit
187119d985
@@ -1,4 +1,3 @@
|
||||
GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
|
||||
//SEC_LEVEL_GREEN = code green
|
||||
//SEC_LEVEL_BLUE = code blue
|
||||
//SEC_LEVEL_RED = code red
|
||||
@@ -20,21 +19,17 @@ GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
|
||||
level = SEC_LEVEL_DELTA
|
||||
|
||||
//Will not be announced if you try to set to the same level as it already is
|
||||
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level)
|
||||
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != SSsecurity_level.current_level)
|
||||
switch(level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
minor_announce(CONFIG_GET(string/alert_green), "Attention! Security level lowered to green:")
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
if(GLOB.security_level >= SEC_LEVEL_RED)
|
||||
if(SSsecurity_level.current_level >= SEC_LEVEL_RED)
|
||||
SSshuttle.emergency.modTimer(4)
|
||||
else
|
||||
SSshuttle.emergency.modTimer(2)
|
||||
GLOB.security_level = SEC_LEVEL_GREEN
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(is_station_level(FA.z))
|
||||
FA.update_appearance()
|
||||
if(SEC_LEVEL_BLUE)
|
||||
if(GLOB.security_level < SEC_LEVEL_BLUE)
|
||||
if(SSsecurity_level.current_level < SEC_LEVEL_BLUE)
|
||||
minor_announce(CONFIG_GET(string/alert_blue_upto), "Attention! Security level elevated to blue:",1)
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
SSshuttle.emergency.modTimer(0.5)
|
||||
@@ -42,52 +37,28 @@ GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
|
||||
minor_announce(CONFIG_GET(string/alert_blue_downto), "Attention! Security level lowered to blue:")
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
SSshuttle.emergency.modTimer(2)
|
||||
GLOB.security_level = SEC_LEVEL_BLUE
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(is_station_level(FA.z))
|
||||
FA.update_appearance()
|
||||
if(SEC_LEVEL_RED)
|
||||
if(GLOB.security_level < SEC_LEVEL_RED)
|
||||
if(SSsecurity_level.current_level < SEC_LEVEL_RED)
|
||||
minor_announce(CONFIG_GET(string/alert_red_upto), "Attention! Code red!",1)
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
if(GLOB.security_level == SEC_LEVEL_GREEN)
|
||||
if(SSsecurity_level.current_level == SEC_LEVEL_GREEN)
|
||||
SSshuttle.emergency.modTimer(0.25)
|
||||
else
|
||||
SSshuttle.emergency.modTimer(0.5)
|
||||
else
|
||||
minor_announce(CONFIG_GET(string/alert_red_downto), "Attention! Code red!")
|
||||
GLOB.security_level = SEC_LEVEL_RED
|
||||
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(is_station_level(FA.z))
|
||||
FA.update_appearance()
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
|
||||
pod.locked = FALSE
|
||||
if(SEC_LEVEL_DELTA)
|
||||
minor_announce(CONFIG_GET(string/alert_delta), "Attention! Delta security level reached!",1)
|
||||
if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL)
|
||||
if(GLOB.security_level == SEC_LEVEL_GREEN)
|
||||
if(SSsecurity_level.current_level == SEC_LEVEL_GREEN)
|
||||
SSshuttle.emergency.modTimer(0.25)
|
||||
else if(GLOB.security_level == SEC_LEVEL_BLUE)
|
||||
else if(SSsecurity_level.current_level == SEC_LEVEL_BLUE)
|
||||
SSshuttle.emergency.modTimer(0.5)
|
||||
GLOB.security_level = SEC_LEVEL_DELTA
|
||||
for(var/obj/machinery/firealarm/FA in GLOB.machines)
|
||||
if(is_station_level(FA.z))
|
||||
FA.update_appearance()
|
||||
for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines)
|
||||
pod.locked = FALSE
|
||||
if(level >= SEC_LEVEL_RED)
|
||||
for(var/obj/machinery/door/D in GLOB.machines)
|
||||
if(D.red_alert_access)
|
||||
D.visible_message("<span class='notice'>[D] whirrs as it automatically lifts access requirements!</span>")
|
||||
playsound(D, 'sound/machines/boltsup.ogg', 50, TRUE)
|
||||
SSblackbox.record_feedback("tally", "security_level_changes", 1, get_security_level())
|
||||
SSnightshift.check_nightshift()
|
||||
else
|
||||
return
|
||||
|
||||
SSsecurity_level.set_level(level)
|
||||
|
||||
/proc/get_security_level()
|
||||
switch(GLOB.security_level)
|
||||
switch(SSsecurity_level.current_level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
return "green"
|
||||
if(SEC_LEVEL_BLUE)
|
||||
|
||||
Reference in New Issue
Block a user