Updated vote subsystem (#18563)

* sadf

* toworld_count

* fix voting for normal users

* jhkjhb

* gdsfgds

* sdaf
This commit is contained in:
Fluffy
2024-03-06 07:10:41 +00:00
committed by GitHub
parent d1180840ff
commit 2e5b9a9a42
25 changed files with 1262 additions and 442 deletions
@@ -217,7 +217,7 @@ var/global/maint_all_access = 0
if(!I)
return ..(M)
var/list/A = I.GetAccess()
var/maint_sec_access = ((security_level > SEC_LEVEL_GREEN) && has_access(ACCESS_SECURITY, accesses = A))
var/maint_sec_access = ((GLOB.security_level > SEC_LEVEL_GREEN) && has_access(ACCESS_SECURITY, accesses = A))
var/exceptional_circumstances = maint_all_access || maint_sec_access
if(exceptional_circumstances && src.check_access_list(list(ACCESS_MAINT_TUNNELS)))
return 1
+10 -22
View File
@@ -1,4 +1,4 @@
/var/security_level = 0
GLOBAL_VAR_INIT(security_level, SEC_LEVEL_GREEN)
//0 = code green
//1 = code yellow
//2 = code blue
@@ -23,34 +23,34 @@
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.Announce("[GLOB.config.alert_desc_green]", "Attention! Security level lowered to green.")
security_level = SEC_LEVEL_GREEN
GLOB.security_level = SEC_LEVEL_GREEN
SSnightlight.end_temp_disable()
if(SEC_LEVEL_BLUE)
if(security_level < SEC_LEVEL_BLUE)
if(GLOB.security_level < SEC_LEVEL_BLUE)
security_announcement_sound.Announce("[GLOB.config.alert_desc_blue_upto]", "Attention! Security level elevated to blue.")
else
security_announcement.Announce("[GLOB.config.alert_desc_blue_downto]", "Attention! Security level lowered to blue.")
security_level = SEC_LEVEL_BLUE
GLOB.security_level = SEC_LEVEL_BLUE
SSnightlight.end_temp_disable()
if(SEC_LEVEL_YELLOW)
security_announcement_sound.Announce("[GLOB.config.alert_desc_yellow_to]", "Attention! Biohazard alert declared!")
security_level = SEC_LEVEL_YELLOW
GLOB.security_level = SEC_LEVEL_YELLOW
SSnightlight.end_temp_disable()
if(SEC_LEVEL_RED)
if(security_level < SEC_LEVEL_RED)
if(GLOB.security_level < SEC_LEVEL_RED)
security_announcement_sound.Announce("[GLOB.config.alert_desc_red_upto]", "Attention! Security level elevated to red!", new_sound = 'sound/effects/high_alert.ogg')
SSnightlight.temp_disable()
else
security_announcement.Announce("[GLOB.config.alert_desc_red_downto]", "Attention! Code red!")
security_level = SEC_LEVEL_RED
GLOB.security_level = SEC_LEVEL_RED
post_display_status("alert", "redalert")
if(SEC_LEVEL_DELTA)
security_announcement_sound.Announce("[GLOB.config.alert_desc_delta]", "Attention! Delta security level reached!", new_sound = 'sound/effects/siren.ogg')
security_level = SEC_LEVEL_DELTA
GLOB.security_level = SEC_LEVEL_DELTA
SSnightlight.temp_disable()
var/newlevel = get_security_level()
@@ -59,7 +59,7 @@
powercontrol.manage_emergency(newlevel)
/proc/get_security_level()
switch(security_level)
switch(GLOB.security_level)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)
@@ -96,15 +96,3 @@
return SEC_LEVEL_RED
if("delta")
return SEC_LEVEL_DELTA
/*DEBUG
/mob/verb/set_thing0()
set_security_level(0)
/mob/verb/set_thing1()
set_security_level(1)
/mob/verb/set_thing2()
set_security_level(2)
/mob/verb/set_thing3()
set_security_level(3)
*/