Makes all global variables handled by the GLOB controller (#13152)

* Handlers converted, now to fix 3532 compile errors

* 3532 compile fixes later, got runtimes on startup

* Well the server loads now atleast

* Take 2

* Oops
This commit is contained in:
AffectedArc07
2020-03-21 03:56:37 +00:00
committed by GitHub
parent c8dbd0190e
commit 210f8badf4
667 changed files with 4243 additions and 4240 deletions
@@ -78,7 +78,7 @@
ui = new(user, src, ui_key, "keycard_auth.tmpl", "Keycard Authentication Device UI", 540, 320)
ui.open()
/obj/machinery/keycard_auth/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
/obj/machinery/keycard_auth/ui_data(mob/user, ui_key = "main", datum/topic_state/state = GLOB.default_state)
var/data[0]
data["screen"] = screen
data["event"] = event
@@ -168,7 +168,7 @@
atom_say("All Emergency Response Teams are dispatched and can not be called at this time.")
return
atom_say("ERT request transmitted!")
command_announcer.autosay("ERT request transmitted. Reason: [ert_reason]", name)
GLOB.command_announcer.autosay("ERT request transmitted. Reason: [ert_reason]", name)
print_centcom_report(ert_reason, station_time_timestamp() + " ERT Request")
var/fullmin_count = 0
@@ -176,12 +176,12 @@
if(check_rights(R_EVENT, 0, C.mob))
fullmin_count++
if(fullmin_count)
ert_request_answered = TRUE
GLOB.ert_request_answered = TRUE
ERT_Announce(ert_reason , event_triggered_by, 0)
ert_reason = "Reason for ERT"
feedback_inc("alert_keycard_auth_ert",1)
spawn(3000)
if(!ert_request_answered)
if(!GLOB.ert_request_answered)
ERT_Announce(ert_reason , event_triggered_by, 1)
else
trigger_armed_response_team(new /datum/response_team/amber) // No admins? No problem. Automatically send a code amber ERT.
@@ -189,37 +189,37 @@
/obj/machinery/keycard_auth/proc/is_ert_blocked()
return SSticker.mode && SSticker.mode.ert_disabled
var/global/maint_all_access = 0
var/global/station_all_access = 0
GLOBAL_VAR_INIT(maint_all_access, 0)
GLOBAL_VAR_INIT(station_all_access, 0)
/proc/make_maint_all_access()
for(var/area/maintenance/A in world)
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 1
D.update_icon(0)
minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.")
maint_all_access = 1
GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been removed.")
GLOB.maint_all_access = 1
/proc/revoke_maint_all_access()
for(var/area/maintenance/A in world)
for(var/obj/machinery/door/airlock/D in A)
D.emergency = 0
D.update_icon(0)
minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.")
maint_all_access = 0
GLOB.minor_announcement.Announce("Access restrictions on maintenance and external airlocks have been re-added.")
GLOB.maint_all_access = 0
/proc/make_station_all_access()
for(var/obj/machinery/door/airlock/D in GLOB.airlocks)
if(is_station_level(D.z))
D.emergency = 1
D.update_icon(0)
minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.")
station_all_access = 1
GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been removed due to an ongoing crisis. Trespassing laws still apply unless ordered otherwise by Command staff.")
GLOB.station_all_access = 1
/proc/revoke_station_all_access()
for(var/obj/machinery/door/airlock/D in GLOB.airlocks)
if(is_station_level(D.z))
D.emergency = 0
D.update_icon(0)
minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.")
station_all_access = 0
GLOB.minor_announcement.Announce("Access restrictions on all station airlocks have been re-added. Seek station AI or a colleague's assistance if you are stuck.")
GLOB.station_all_access = 0
+25 -25
View File
@@ -1,4 +1,4 @@
/var/security_level = 0
GLOBAL_VAR_INIT(security_level, 0)
//0 = code green
//1 = code blue
//2 = code red
@@ -7,8 +7,8 @@
//5 = code delta
//config.alert_desc_blue_downto
/var/datum/announcement/priority/security/security_announcement_up = new(do_log = 0, do_newscast = 0, new_sound = sound('sound/misc/notice1.ogg'))
/var/datum/announcement/priority/security/security_announcement_down = new(do_log = 0, do_newscast = 0)
GLOBAL_DATUM_INIT(security_announcement_up, /datum/announcement/priority/security, new(do_log = 0, do_newscast = 0, new_sound = sound('sound/misc/notice1.ogg')))
GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/security, new(do_log = 0, do_newscast = 0))
/proc/set_security_level(var/level)
switch(level)
@@ -26,8 +26,8 @@
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_RED && security_level < SEC_LEVEL_RED)
if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level)
if(level >= SEC_LEVEL_RED && GLOB.security_level < SEC_LEVEL_RED)
// Mark down this time to prevent shuttle cheese
SSshuttle.emergency_sec_level_time = world.time
@@ -42,8 +42,8 @@
switch(level)
if(SEC_LEVEL_GREEN)
security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.")
security_level = SEC_LEVEL_GREEN
GLOB.security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.")
GLOB.security_level = SEC_LEVEL_GREEN
post_status("alert", "outline")
@@ -53,11 +53,11 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_green")
if(SEC_LEVEL_BLUE)
if(security_level < SEC_LEVEL_BLUE)
security_announcement_up.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.")
if(GLOB.security_level < SEC_LEVEL_BLUE)
GLOB.security_announcement_up.Announce("The station has received reliable information about possible hostile activity on the station. Security staff may have weapons visible and random searches are permitted.","Attention! Security level elevated to blue.")
else
security_announcement_down.Announce("The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.","Attention! Security level lowered to blue.")
security_level = SEC_LEVEL_BLUE
GLOB.security_announcement_down.Announce("The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.","Attention! Security level lowered to blue.")
GLOB.security_level = SEC_LEVEL_BLUE
post_status("alert", "outline")
@@ -67,11 +67,11 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_blue")
if(SEC_LEVEL_RED)
if(security_level < SEC_LEVEL_RED)
security_announcement_up.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
if(GLOB.security_level < SEC_LEVEL_RED)
GLOB.security_announcement_up.Announce("There is an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
else
security_announcement_down.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
security_level = SEC_LEVEL_RED
GLOB.security_announcement_down.Announce("The station's self-destruct mechanism has been deactivated, but there is still an immediate and serious threat to the station. Security may have weapons unholstered at all times. Random searches are allowed and advised.","Attention! Code Red!")
GLOB.security_level = SEC_LEVEL_RED
var/obj/machinery/door/airlock/highsecurity/red/R = locate(/obj/machinery/door/airlock/highsecurity/red) in GLOB.airlocks
if(R && is_station_level(R.z))
@@ -86,12 +86,12 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_red")
if(SEC_LEVEL_GAMMA)
security_announcement_up.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location. The station's Gamma armory has been unlocked and is ready for use.","Attention! Gamma security level activated!", new_sound = sound('sound/effects/new_siren.ogg'))
security_level = SEC_LEVEL_GAMMA
GLOB.security_announcement_up.Announce("Central Command has ordered the Gamma security level on the station. Security is to have weapons equipped at all times, and all civilians are to immediately seek their nearest head for transportation to a secure location. The station's Gamma armory has been unlocked and is ready for use.","Attention! Gamma security level activated!", new_sound = sound('sound/effects/new_siren.ogg'))
GLOB.security_level = SEC_LEVEL_GAMMA
move_gamma_ship()
if(security_level < SEC_LEVEL_RED)
if(GLOB.security_level < SEC_LEVEL_RED)
for(var/obj/machinery/door/airlock/highsecurity/red/R in GLOB.airlocks)
if(is_station_level(R.z))
R.locked = 0
@@ -111,8 +111,8 @@
FA.update_icon()
if(SEC_LEVEL_EPSILON)
security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.","Attention! Epsilon security level activated!", new_sound = sound('sound/effects/purge_siren.ogg'))
security_level = SEC_LEVEL_EPSILON
GLOB.security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.","Attention! Epsilon security level activated!", new_sound = sound('sound/effects/purge_siren.ogg'))
GLOB.security_level = SEC_LEVEL_EPSILON
post_status("alert", "epsilonalert")
@@ -122,8 +122,8 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_epsilon")
if(SEC_LEVEL_DELTA)
security_announcement_up.Announce("The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.","Attention! Delta security level reached!", new_sound = sound('sound/effects/deltaalarm.ogg'))
security_level = SEC_LEVEL_DELTA
GLOB.security_announcement_up.Announce("The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.","Attention! Delta security level reached!", new_sound = sound('sound/effects/deltaalarm.ogg'))
GLOB.security_level = SEC_LEVEL_DELTA
post_status("alert", "deltaalert")
@@ -133,16 +133,16 @@
FA.overlays += image('icons/obj/monitors.dmi', "overlay_delta")
if(level >= SEC_LEVEL_RED)
atc.reroute_traffic(yes = TRUE) // Tell them fuck off we're busy.
GLOB.atc.reroute_traffic(yes = TRUE) // Tell them fuck off we're busy.
else
atc.reroute_traffic(yes = FALSE)
GLOB.atc.reroute_traffic(yes = FALSE)
SSnightshift.check_nightshift(TRUE)
else
return
/proc/get_security_level()
switch(security_level)
switch(GLOB.security_level)
if(SEC_LEVEL_GREEN)
return "green"
if(SEC_LEVEL_BLUE)