mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-30 03:22:41 +00:00
This removes code/__DEFINES/misc.dm and moves all the defines to either: another existing define file new define file local .dm file if the define was only used in one file I also deleted defines that were not being used and added documentation to all of the ones that were moved out of misc.dm Why was this needed? People were basically using the misc.dm file as a dumpster to toss all their defines into that was creating one giant mess. The defines have been organized into their proper groups and files now.
83 lines
2.8 KiB
Plaintext
83 lines
2.8 KiB
Plaintext
/proc/set_security_level(level)
|
|
switch(level)
|
|
if("green")
|
|
level = SEC_LEVEL_GREEN
|
|
if("blue")
|
|
level = SEC_LEVEL_BLUE
|
|
if("red")
|
|
level = SEC_LEVEL_RED
|
|
if("delta")
|
|
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 != 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(SSsecurity_level.current_level >= SEC_LEVEL_RED)
|
|
SSshuttle.emergency.modTimer(4)
|
|
else
|
|
SSshuttle.emergency.modTimer(2)
|
|
if(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)
|
|
else
|
|
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)
|
|
if(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(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!")
|
|
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(SSsecurity_level.current_level == SEC_LEVEL_GREEN)
|
|
SSshuttle.emergency.modTimer(0.25)
|
|
else if(SSsecurity_level.current_level == SEC_LEVEL_BLUE)
|
|
SSshuttle.emergency.modTimer(0.5)
|
|
|
|
SSsecurity_level.set_level(level)
|
|
|
|
/proc/get_security_level()
|
|
switch(SSsecurity_level.current_level)
|
|
if(SEC_LEVEL_GREEN)
|
|
return "green"
|
|
if(SEC_LEVEL_BLUE)
|
|
return "blue"
|
|
if(SEC_LEVEL_RED)
|
|
return "red"
|
|
if(SEC_LEVEL_DELTA)
|
|
return "delta"
|
|
|
|
/proc/num2seclevel(num)
|
|
switch(num)
|
|
if(SEC_LEVEL_GREEN)
|
|
return "green"
|
|
if(SEC_LEVEL_BLUE)
|
|
return "blue"
|
|
if(SEC_LEVEL_RED)
|
|
return "red"
|
|
if(SEC_LEVEL_DELTA)
|
|
return "delta"
|
|
|
|
/proc/seclevel2num(seclevel)
|
|
switch( lowertext(seclevel) )
|
|
if("green")
|
|
return SEC_LEVEL_GREEN
|
|
if("blue")
|
|
return SEC_LEVEL_BLUE
|
|
if("red")
|
|
return SEC_LEVEL_RED
|
|
if("delta")
|
|
return SEC_LEVEL_DELTA
|