mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 13:10:02 +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
@@ -27,7 +27,7 @@ SUBSYSTEM_DEF(nightshift)
|
||||
priority_announce(message, sound='sound/misc/notice2.ogg', sender_override="Automated Lighting System Announcement")
|
||||
|
||||
/datum/controller/subsystem/nightshift/proc/check_nightshift()
|
||||
var/emergency = GLOB.security_level >= SEC_LEVEL_RED
|
||||
var/emergency = SSsecurity_level.current_level >= SEC_LEVEL_RED
|
||||
var/announcing = TRUE
|
||||
var/time = station_time()
|
||||
var/night_time = (time < nightshift_end_time) || (time > nightshift_start_time)
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
SUBSYSTEM_DEF(security_level)
|
||||
name = "Security Level"
|
||||
flags = SS_NO_FIRE
|
||||
/// Currently set security level
|
||||
var/current_level = SEC_LEVEL_GREEN
|
||||
|
||||
/**
|
||||
* Sets a new security level as our current level
|
||||
*
|
||||
* Arguments:
|
||||
* * new_level The new security level that will become our current level
|
||||
*/
|
||||
/datum/controller/subsystem/security_level/proc/set_level(new_level)
|
||||
SSsecurity_level.current_level = new_level
|
||||
SEND_SIGNAL(src, COMSIG_SECURITY_LEVEL_CHANGED, new_level)
|
||||
SSnightshift.check_nightshift()
|
||||
SSblackbox.record_feedback("tally", "security_level_changes", 1, get_security_level())
|
||||
Reference in New Issue
Block a user