[MIRROR] code/global.dm => code/_global_vars/ (#10689)

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:
CHOMPStation2StaffMirrorBot
2025-04-21 10:16:48 -07:00
committed by GitHub
parent a7718c6177
commit f04f992cfe
474 changed files with 1401 additions and 1421 deletions

View File

@@ -6,7 +6,7 @@
/datum/event/blob/start()
var/turf/T = pick(blobstart)
var/turf/T = pick(GLOB.blobstart)
if(!T)
kill()
return

View File

@@ -23,7 +23,7 @@
/datum/event/brand_intelligence/start()
for(var/obj/machinery/vending/V in machines)
for(var/obj/machinery/vending/V in GLOB.machines)
if(isNotStationLevel(V.z)) continue
vendingMachines.Add(V)

View File

@@ -6,7 +6,7 @@
/datum/event/canister_leak/start()
// List of all non-destroyed canisters on station levels
var/list/all_canisters = list()
for(var/obj/machinery/portable_atmospherics/canister/C in machines)
for(var/obj/machinery/portable_atmospherics/canister/C in GLOB.machines)
if(!C.destroyed && (C.z in using_map.station_levels) && C.air_contents.total_moles >= MOLES_CELLSTANDARD && !C.dont_burst) //CHOMPEdit
all_canisters += C

View File

@@ -18,5 +18,5 @@
/datum/event/communications_blackout/start()
for(var/obj/machinery/telecomms/T in telecomms_list)
T.emp_act(1)
for(var/obj/machinery/exonet_node/N in machines)
for(var/obj/machinery/exonet_node/N in GLOB.machines)
N.emp_act(1)

View File

@@ -73,7 +73,7 @@ GLOBAL_LIST_EMPTY(current_pending_diseases)
popleft(A.symptoms) //We have a full symptom list but are still not transmittable. Try removing one of the "payloads"
A.AssignProperties(A.GenerateProperties())
A.name = pick(alphabet_uppercase) + num2text(rand(1,9)) + pick(alphabet_uppercase) + num2text(rand(1,9)) + pick("v", "V", "-" + num2text(game_year), "")
A.name = pick(GLOB.alphabet_upper) + num2text(rand(1,9)) + pick(GLOB.alphabet_upper) + num2text(rand(1,9)) + pick("v", "V", "-" + num2text(GLOB.game_year), "")
A.Refresh()
return A

View File

@@ -37,7 +37,7 @@
..()
// See if shields can stop it first
var/list/shields = list()
for(var/obj/machinery/power/shield_generator/G in global.machines)
for(var/obj/machinery/power/shield_generator/G in GLOB.machines)
if((G.z in affecting_z) && G.running && G.check_flag(MODEFLAG_EM))
shields += G
if(shields.len)

View File

@@ -32,7 +32,7 @@
/datum/event/escaped_slimes/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.machines)
if(temp_vent.network && temp_vent.loc.z in using_map.station_levels && !is_area_occupied(temp_vent.loc.loc)) //borrowed from spiders event, but it works. Distribute the slimes only in rooms with vents
vents += temp_vent

View File

@@ -9,7 +9,7 @@
for(var/datum/planet/P in SSplanets.planets)
zLevels -= P.expected_z_levels
for(var/obj/machinery/gravity_generator/main/GG in machines)
for(var/obj/machinery/gravity_generator/main/GG in GLOB.machines)
if((GG.z in zLevels) && GG.on)
generators += GG
@@ -27,7 +27,7 @@
reinitializes. Please stand by while the gravity system reinitializes.", "Gravity Failure")
/datum/event/gravity/start()
gravity_is_on = 0
GLOB.gravity_is_on = FALSE
if(generators.len)
for(var/obj/machinery/gravity_generator/main/GG in generators)
if((GG.z in zLevels) && GG.on)
@@ -37,11 +37,11 @@
else
for(var/area/A in world)
if(A.z in zLevels)
A.gravitychange(gravity_is_on)
A.gravitychange(GLOB.gravity_is_on)
/datum/event/gravity/end()
if(!gravity_is_on)
gravity_is_on = 1
if(!GLOB.gravity_is_on)
GLOB.gravity_is_on = TRUE
var/did_anything = FALSE
@@ -55,7 +55,7 @@
else
for(var/area/A in world)
if(A.z in zLevels)
A.gravitychange(gravity_is_on)
A.gravitychange(GLOB.gravity_is_on)
did_anything = TRUE
if(did_anything)

View File

@@ -14,9 +14,9 @@
command_announcement.Announce("Feedback surge detected in mass-distributions systems. Artificial gravity has been disabled. Please wait for the system to reinitialize, or contact your engineering department.", "Gravity Failure")
/datum/event/gravity/start()
gravity_is_on = 0
GLOB.gravity_is_on = FALSE
for(var/obj/machinery/gravity_generator/main/GG in machines)
for(var/obj/machinery/gravity_generator/main/GG in GLOB.machines)
if((GG.z in zLevels) && GG.on)
generators += GG
GG.breaker = FALSE
@@ -24,7 +24,7 @@
GG.charge_count = 10
/datum/event/gravity/end()
gravity_is_on = 1
GLOB.gravity_is_on = TRUE
var/did_anything = FALSE
for(var/obj/machinery/gravity_generator/main/GG in generators)

View File

@@ -3,7 +3,7 @@
/datum/event/grid_check/start()
// This sets off a chain of events that lead to the actual grid check (or perhaps worse).
// First, the Supermatter engine makes a power spike.
for(var/obj/machinery/power/generator/engine in machines)
for(var/obj/machinery/power/generator/engine in GLOB.machines)
engine.power_spike(80)
break // Just one engine, please.
// After that, the engine checks if a grid checker exists on the same powernet, and if so, it triggers a blackout.

View File

@@ -10,7 +10,7 @@
spawncount = rand(2 * severity, 6 * severity)
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.machines)
var/area/A = get_area(temp_vent)
if(A.flag_check(AREA_FORBID_EVENTS))
continue

View File

@@ -24,7 +24,7 @@
/datum/event/ianstorm/proc/place_ian(var/turf/T)
// Try three times to place an Ian
for(var/i = 0, i < 3, i++)
var/turf/target = get_step(T, pick(alldirs))
var/turf/target = get_step(T, pick(GLOB.alldirs))
if(target && istype(target, /turf/simulated/floor))
var/mob/living/simple_mob/animal/passive/dog/corgi/Ian/doge = new(target)
doge.name = "Ian " + pick("Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi",

View File

@@ -243,7 +243,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
to_world("Finished processing SMES. Processed: [smesnum]")
spawn(0)
to_world("Started processing AIRLOCKS")
for (var/obj/machinery/door/airlock/D in machines)
for (var/obj/machinery/door/airlock/D in GLOB.machines)
if(D.z in station_levels)
//if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks
airlocknum++
@@ -252,7 +252,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is
to_world("Finished processing AIRLOCKS. Processed: [airlocknum]")
spawn(0)
to_world("Started processing FIREDOORS")
for (var/obj/machinery/door/firedoor/D in machines)
for (var/obj/machinery/door/firedoor/D in GLOB.machines)
if(D.z in station_levels)
firedoornum++;
spawn(0)

View File

@@ -17,13 +17,13 @@
/datum/event/meteor_wave/setup()
waves = (2 + rand(1, severity)) * severity
start_side = pick(cardinal)
start_side = pick(GLOB.cardinal)
endWhen = worst_case_end()
/datum/event/meteor_wave/start()
affecting_z -= global.using_map.sealed_levels // Space levels only please!
//CHOMPAdd Start, fills gaps
for(var/obj/machinery/shield_gen/gen in global.machines)
for(var/obj/machinery/shield_gen/gen in GLOB.machines)
gen.fill_diffused()
//CHOMPAdd End
..()
@@ -39,7 +39,7 @@
/datum/event/meteor_wave/tick()
// Begin sending the alarm signals to shield diffusers so the field is already regenerated (if it exists) by the time actual meteors start flying around.
if(activeFor >= alarmWhen)
for(var/obj/machinery/shield_diffuser/SD in global.machines)
for(var/obj/machinery/shield_diffuser/SD in GLOB.machines)
if(SD.z in affecting_z)
SD.meteor_alarm(10)
@@ -65,7 +65,7 @@
/datum/event/meteor_wave/end()
..()
//CHOMPAdd Start, fills gaps
for(var/obj/machinery/shield_gen/gen in global.machines)
for(var/obj/machinery/shield_gen/gen in GLOB.machines)
gen.fill_diffused()
//CHOMPAdd End
if(!victim)

View File

@@ -22,7 +22,7 @@ GLOBAL_VAR_INIT(account_hack_attempted, 0)
Notifications will be sent as updates occur.<br>"
var/my_department = "[station_name()] firewall subroutines"
for(var/obj/machinery/message_server/MS in machines)
for(var/obj/machinery/message_server/MS in GLOB.machines)
if(!MS.active) continue
MS.send_rc_message(JOB_HEAD_OF_PERSONNEL + "'s Desk", my_department, message, "", "", 2)
@@ -64,6 +64,6 @@ GLOBAL_VAR_INIT(account_hack_attempted, 0)
var/my_department = "[station_name()] firewall subroutines"
for(var/obj/machinery/message_server/MS in machines)
for(var/obj/machinery/message_server/MS in GLOB.machines)
if(!MS.active) continue
MS.send_rc_message(JOB_HEAD_OF_PERSONNEL + "'s Desk", my_department, message, "", "", 2)

View File

@@ -48,7 +48,7 @@
if(areas && areas.len > 0)
var/my_department = "[station_name()] firewall subroutines"
var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [stationtime2text()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.<br>"
for(var/obj/machinery/message_server/MS in machines)
for(var/obj/machinery/message_server/MS in GLOB.machines)
MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2)
for(var/mob/living/silicon/ai/A in player_list)
to_chat(A, span_danger("Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department]."))

View File

@@ -16,7 +16,7 @@
/datum/event/spider_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines)
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.machines)
//CHOMPEdit: Added a couple areas to the exclusion. Also made this actually work.
var/in_area = get_area(temp_vent)
if(istype(in_area, /area/crew_quarters/sleep) || istype(in_area, /area/hallway/secondary/entry))

View File

@@ -22,9 +22,9 @@
running_demand_events += src
// Decide what items are requried!
// We base this on what departmets are most active, excluding departments we don't have
var/list/notHaveDeptList = metric.departments.Copy()
var/list/notHaveDeptList = GLOB.metric.departments.Copy()
notHaveDeptList.Remove(list(DEPARTMENT_ENGINEERING, DEPARTMENT_MEDICAL, DEPARTMENT_RESEARCH, DEPARTMENT_CARGO, DEPARTMENT_CIVILIAN))
var/deptActivity = metric.assess_all_departments(severity * 2, notHaveDeptList)
var/deptActivity = GLOB.metric.assess_all_departments(severity * 2, notHaveDeptList)
for(var/dept in deptActivity)
switch(dept)
if(DEPARTMENT_ENGINEERING)