mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] Conversion many Globals to Managed Globals (Part 1) (#10665)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
06f0821bcf
commit
f7219329ca
@@ -1,4 +1,4 @@
|
||||
/var/security_level = 0
|
||||
GLOBAL_VAR_INIT(security_level, 0)
|
||||
//0 = code green
|
||||
//1 = code yellow
|
||||
//2 = code violet
|
||||
@@ -29,44 +29,44 @@
|
||||
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 != security_level)
|
||||
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level)
|
||||
switch(level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
security_announcement_down.Announce("[CONFIG_GET(string/alert_desc_green)]", "Attention! Alert level lowered to code green.")
|
||||
security_level = SEC_LEVEL_GREEN
|
||||
GLOB.security_level = SEC_LEVEL_GREEN
|
||||
if(SEC_LEVEL_YELLOW)
|
||||
if(security_level < SEC_LEVEL_YELLOW)
|
||||
if(GLOB.security_level < SEC_LEVEL_YELLOW)
|
||||
security_announcement_up.Announce("[CONFIG_GET(string/alert_desc_yellow_upto)]", "Attention! Alert level elevated to yellow")
|
||||
else
|
||||
security_announcement_down.Announce("[CONFIG_GET(string/alert_desc_yellow_downto)]", "Attention! Alert level lowered to yellow")
|
||||
security_level = SEC_LEVEL_YELLOW
|
||||
GLOB.security_level = SEC_LEVEL_YELLOW
|
||||
if(SEC_LEVEL_VIOLET)
|
||||
if(security_level < SEC_LEVEL_VIOLET)
|
||||
if(GLOB.security_level < SEC_LEVEL_VIOLET)
|
||||
security_announcement_up.Announce("[CONFIG_GET(string/alert_desc_violet_upto)]", "Attention! Alert level elevated to violet")
|
||||
else
|
||||
security_announcement_down.Announce("[CONFIG_GET(string/alert_desc_violet_downto)]", "Attention! Alert level lowered to violet")
|
||||
security_level = SEC_LEVEL_VIOLET
|
||||
GLOB.security_level = SEC_LEVEL_VIOLET
|
||||
if(SEC_LEVEL_ORANGE)
|
||||
if(security_level < SEC_LEVEL_ORANGE)
|
||||
if(GLOB.security_level < SEC_LEVEL_ORANGE)
|
||||
security_announcement_up.Announce("[CONFIG_GET(string/alert_desc_orange_upto)]", "Attention! Alert level elevated to orange")
|
||||
else
|
||||
security_announcement_down.Announce("[CONFIG_GET(string/alert_desc_orange_downto)]", "Attention! Alert level lowered to orange")
|
||||
security_level = SEC_LEVEL_ORANGE
|
||||
GLOB.security_level = SEC_LEVEL_ORANGE
|
||||
if(SEC_LEVEL_BLUE)
|
||||
if(security_level < SEC_LEVEL_BLUE)
|
||||
if(GLOB.security_level < SEC_LEVEL_BLUE)
|
||||
security_announcement_up.Announce("[CONFIG_GET(string/alert_desc_blue_upto)]", "Attention! Alert level elevated to blue")
|
||||
else
|
||||
security_announcement_down.Announce("[CONFIG_GET(string/alert_desc_blue_downto)]", "Attention! Alert level lowered to blue")
|
||||
security_level = SEC_LEVEL_BLUE
|
||||
GLOB.security_level = SEC_LEVEL_BLUE
|
||||
if(SEC_LEVEL_RED)
|
||||
if(security_level < SEC_LEVEL_RED)
|
||||
if(GLOB.security_level < SEC_LEVEL_RED)
|
||||
security_announcement_up.Announce("[CONFIG_GET(string/alert_desc_red_upto)]", "Attention! Code red!", new_sound = sound('sound/effects/alert_levels/red_alert.ogg', volume = 75))
|
||||
else
|
||||
security_announcement_down.Announce("[CONFIG_GET(string/alert_desc_red_downto)]", "Attention! Code red!")
|
||||
security_level = SEC_LEVEL_RED
|
||||
GLOB.security_level = SEC_LEVEL_RED
|
||||
if(SEC_LEVEL_DELTA)
|
||||
security_announcement_up.Announce("[CONFIG_GET(string/alert_desc_delta)]", "Attention! Delta alert level reached!", new_sound = 'sound/effects/alert_levels/deltaklaxon.ogg')
|
||||
security_level = SEC_LEVEL_DELTA
|
||||
GLOB.security_level = SEC_LEVEL_DELTA
|
||||
|
||||
var/newlevel = get_security_level()
|
||||
for(var/obj/machinery/firealarm/FA in machines)
|
||||
@@ -91,7 +91,7 @@
|
||||
admin_chat_message(message = "Security level is now: [uppertext(get_security_level())]", color = "#CC2222") //VOREStation Add
|
||||
|
||||
/proc/get_security_level()
|
||||
switch(security_level)
|
||||
switch(GLOB.security_level)
|
||||
if(SEC_LEVEL_GREEN)
|
||||
return "green"
|
||||
if(SEC_LEVEL_YELLOW)
|
||||
|
||||
Reference in New Issue
Block a user