code/global.dm => code/_global_vars/ (#17244)

* 1

* Full conversion

* .

* .

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2025-04-21 11:55:25 +02:00
committed by GitHub
parent 5d21a53dfa
commit 28e969778c
448 changed files with 1339 additions and 1346 deletions
+4 -4
View File
@@ -12,24 +12,24 @@
to_chat(usr, "Checking for disconnected pipes...")
//all plumbing - yes, some things might get stated twice, doesn't matter.
for (var/obj/machinery/atmospherics/plumbing in machines)
for (var/obj/machinery/atmospherics/plumbing in GLOB.machines)
if (plumbing.nodealert)
to_chat(usr, span_filter_adminlog(span_warning("Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")))
//Manifolds
for (var/obj/machinery/atmospherics/pipe/manifold/pipe in machines)
for (var/obj/machinery/atmospherics/pipe/manifold/pipe in GLOB.machines)
if (!pipe.node1 || !pipe.node2 || !pipe.node3)
to_chat(usr, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")))
//Pipes
for (var/obj/machinery/atmospherics/pipe/simple/pipe in machines)
for (var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines)
if (!pipe.node1 || !pipe.node2)
to_chat(usr, span_filter_adminlog(span_warning("Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")))
to_chat(usr, "Checking for overlapping pipes...")
next_turf:
for(var/turf/T in world)
for(var/dir in cardinal)
for(var/dir in GLOB.cardinal)
var/list/connect_types = list(1 = 0, 2 = 0, 3 = 0)
for(var/obj/machinery/atmospherics/pipe in T)
if(dir & pipe.initialize_directions)
+4 -4
View File
@@ -607,7 +607,7 @@ GLOBAL_LIST_EMPTY(active_buildmode_holders)
AI.give_target(A)
i++
to_chat(user, span_notice("Commanded [i] mob\s to attack \the [A]."))
var/image/orderimage = image(buildmode_hud,A,"ai_targetorder")
var/image/orderimage = image(GLOB.buildmode_hud,A,"ai_targetorder")
orderimage.plane = PLANE_BUILDMODE
flick_overlay(orderimage, list(user.client), 8, TRUE)
return
@@ -634,7 +634,7 @@ GLOBAL_LIST_EMPTY(active_buildmode_holders)
if(j)
message += "[j] mob\s to follow \the [L]."
to_chat(user, span_notice(message))
var/image/orderimage = image(buildmode_hud,L,"ai_targetorder")
var/image/orderimage = image(GLOB.buildmode_hud,L,"ai_targetorder")
orderimage.plane = PLANE_BUILDMODE
flick_overlay(orderimage, list(user.client), 8, TRUE)
return
@@ -653,7 +653,7 @@ GLOBAL_LIST_EMPTY(active_buildmode_holders)
AI.give_destination(T, 1, pa.Find("shift")) // If shift is held, the mobs will not stop moving to attack a visible enemy.
told++
to_chat(user, span_notice("Commanded [told] mob\s to move to \the [T], and manually placed [forced] of them."))
var/image/orderimage = image(buildmode_hud,T,"ai_turforder")
var/image/orderimage = image(GLOB.buildmode_hud,T,"ai_turforder")
orderimage.plane = PLANE_BUILDMODE
flick_overlay(orderimage, list(user.client), 8, TRUE)
return
@@ -830,7 +830,7 @@ GLOBAL_LIST_EMPTY(active_buildmode_holders)
while(pending.len)
var/turf/T = pending[1]
pending -= T
for (var/dir in cardinal)
for (var/dir in GLOB.cardinal)
var/turf/NT = get_step(T,dir)
if (!isturf(NT) || (NT in found) || (NT in pending))
continue
+7 -7
View File
@@ -7,9 +7,9 @@
to_chat(src, "Only administrators may use this command.")
return
var/input = sanitize(tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE, prevent_enter = TRUE), MAX_PAPER_MESSAGE_LEN, extra = 0)
var/input = sanitize(tgui_input_text(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", GLOB.custom_event_msg, MAX_PAPER_MESSAGE_LEN, TRUE, prevent_enter = TRUE), MAX_PAPER_MESSAGE_LEN, extra = 0)
if(!input || input == "")
custom_event_msg = null
GLOB.custom_event_msg = null
log_admin("[usr.key] has cleared the custom event text.")
message_admins("[key_name_admin(usr)] has cleared the custom event text.")
return
@@ -17,17 +17,17 @@
log_admin("[usr.key] has changed the custom event text.")
message_admins("[key_name_admin(usr)] has changed the custom event text.")
custom_event_msg = input
GLOB.custom_event_msg = input
to_world(span_filter_system("<h1>[span_alert("Custom Event")]</h1>"))
to_world(span_filter_system("<h2>[span_alert("A custom event is starting. OOC Info:")]</h2>"))
to_world(span_filter_system(span_alert("[custom_event_msg]")))
to_world(span_filter_system(span_alert("[GLOB.custom_event_msg]")))
to_world(span_filter_system("<br>"))
SSwebhooks.send(
WEBHOOK_CUSTOM_EVENT,
list(
"text" = custom_event_msg,
"text" = GLOB.custom_event_msg,
)
)
@@ -36,11 +36,11 @@
set category = "OOC.Game"
set name = "Custom Event Info"
if(!custom_event_msg || custom_event_msg == "")
if(!GLOB.custom_event_msg || GLOB.custom_event_msg == "")
to_chat(src, span_filter_notice("There currently is no known custom event taking place."))
to_chat(src, span_filter_notice("Keep in mind: it is possible that an admin has not properly set this."))
return
to_chat(src, "<h1>[span_filter_notice(span_alert("Custom Event"))]</h1>")
to_chat(src, "<h2>[span_filter_notice(span_alert("A custom event is taking place. OOC Info:"))]</h2>")
to_chat(src, span_filter_notice(span_alert("[custom_event_msg]<br>")))
to_chat(src, span_filter_notice(span_alert("[GLOB.custom_event_msg]<br>")))
+17 -17
View File
@@ -3,12 +3,12 @@
set name = "Debug-Game"
if(!check_rights(R_DEBUG)) return
if(Debug2)
Debug2 = 0
if(GLOB.Debug2)
GLOB.Debug2 = FALSE
message_admins("[key_name(src)] toggled debugging off.")
log_admin("[key_name(src)] toggled debugging off.")
else
Debug2 = 1
GLOB.Debug2 = TRUE
message_admins("[key_name(src)] toggled debugging on.")
log_admin("[key_name(src)] toggled debugging on.")
@@ -356,32 +356,32 @@
if(A && !(A.type in areas_with_APC))
areas_with_APC.Add(A.type)
for(var/obj/machinery/alarm/alarm in machines)
for(var/obj/machinery/alarm/alarm in GLOB.machines)
var/area/A = get_area(alarm)
if(A && !(A.type in areas_with_air_alarm))
areas_with_air_alarm.Add(A.type)
for(var/obj/machinery/requests_console/RC in machines)
for(var/obj/machinery/requests_console/RC in GLOB.machines)
var/area/A = get_area(RC)
if(A && !(A.type in areas_with_RC))
areas_with_RC.Add(A.type)
for(var/obj/machinery/light/L in machines)
for(var/obj/machinery/light/L in GLOB.machines)
var/area/A = get_area(L)
if(A && !(A.type in areas_with_light))
areas_with_light.Add(A.type)
for(var/obj/machinery/light_switch/LS in machines)
for(var/obj/machinery/light_switch/LS in GLOB.machines)
var/area/A = get_area(LS)
if(A && !(A.type in areas_with_LS))
areas_with_LS.Add(A.type)
for(var/obj/item/radio/intercom/I in machines)
for(var/obj/item/radio/intercom/I in GLOB.machines)
var/area/A = get_area(I)
if(A && !(A.type in areas_with_intercom))
areas_with_intercom.Add(A.type)
for(var/obj/machinery/camera/C in machines)
for(var/obj/machinery/camera/C in GLOB.machines)
var/area/A = get_area(C)
if(A && !(A.type in areas_with_camera))
areas_with_camera.Add(A.type)
@@ -462,31 +462,31 @@
if(tgui_alert(usr, "Are you sure? This will start up the engine. Should only be used during debug!","Start Singularity",list("Yes","No")) != "Yes")
return
for(var/obj/machinery/power/emitter/E in machines)
for(var/obj/machinery/power/emitter/E in GLOB.machines)
if(istype(get_area(E), /area/space))
E.anchored = TRUE
E.state = 2
E.connect_to_network()
E.active = TRUE
for(var/obj/machinery/field_generator/F in machines)
for(var/obj/machinery/field_generator/F in GLOB.machines)
if(istype(get_area(F), /area/space))
F.Varedit_start = 1
for(var/obj/machinery/power/grounding_rod/GR in machines)
for(var/obj/machinery/power/grounding_rod/GR in GLOB.machines)
GR.anchored = TRUE
GR.update_icon()
for(var/obj/machinery/power/tesla_coil/TC in machines)
for(var/obj/machinery/power/tesla_coil/TC in GLOB.machines)
TC.anchored = TRUE
TC.update_icon()
for(var/obj/structure/particle_accelerator/PA in machines)
for(var/obj/structure/particle_accelerator/PA in GLOB.machines)
PA.anchored = TRUE
PA.construction_state = 3
PA.update_icon()
for(var/obj/machinery/particle_accelerator/PA in machines)
for(var/obj/machinery/particle_accelerator/PA in GLOB.machines)
PA.anchored = TRUE
PA.construction_state = 3
PA.update_icon()
for(var/obj/machinery/power/rad_collector/Rad in machines)
for(var/obj/machinery/power/rad_collector/Rad in GLOB.machines)
if(Rad.anchored)
if(!Rad.P)
var/obj/item/tank/phoron/Phoron = new/obj/item/tank/phoron(Rad)
@@ -513,7 +513,7 @@
var/found_the_pump = 0
var/obj/machinery/power/supermatter/SM
for(var/obj/machinery/M in machines)
for(var/obj/machinery/M in GLOB.machines)
if(!M)
continue
if(!M.loc)
+1 -1
View File
@@ -15,7 +15,7 @@
var/current_time = world.timeofday
// Depower the supermatter, as it would quickly blow up once we remove all gases from the pipes.
for(var/obj/machinery/power/supermatter/S in machines)
for(var/obj/machinery/power/supermatter/S in GLOB.machines)
S.power = 0
to_chat(usr, "\[1/5\] - Supermatter depowered")
+1 -1
View File
@@ -118,7 +118,7 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging)
qdel(M)
if(intercom_range_display_status)
for(var/obj/item/radio/intercom/I in machines)
for(var/obj/item/radio/intercom/I in GLOB.machines)
for(var/turf/T in orange(7,I))
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
if (!(F in view(7,I.loc)))
+8 -8
View File
@@ -33,7 +33,7 @@
//teleport person to cell
M.Paralyse(5)
sleep(5) //so they black out before warping
M.loc = pick(prisonwarp)
M.loc = pick(GLOB.prisonwarp)
if(ishuman(M))
var/mob/living/carbon/human/prisoner = M
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/prison(prisoner), slot_w_uniform)
@@ -485,10 +485,10 @@ Traitors and the like can also be revived with the previous role mostly intact.
return
if("Arrivals") //Spawn them at a latejoin spawnpoint
if(LAZYLEN(latejoin))
spawnloc = get_turf(pick(latejoin))
else if(LAZYLEN(latejoin_tram))
spawnloc = pick(latejoin_tram)
if(LAZYLEN(GLOB.latejoin))
spawnloc = get_turf(pick(GLOB.latejoin))
else if(LAZYLEN(GLOB.latejoin_tram))
spawnloc = pick(GLOB.latejoin_tram)
else
to_chat(src, "This map has no latejoin spawnpoint.")
return
@@ -553,7 +553,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
//If desired, add records.
if(records)
data_core.manifest_inject(new_character)
GLOB.data_core.manifest_inject(new_character)
//A redraw for good measure
new_character.regenerate_icons()
@@ -1063,7 +1063,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/list/human_cryopods = list()
var/list/robot_cryopods = list()
for(var/obj/machinery/cryopod/CP in machines)
for(var/obj/machinery/cryopod/CP in GLOB.machines)
if(!CP.control_computer)
continue //Broken pod w/o computer, move on.
@@ -1090,7 +1090,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(isAI(M))
var/mob/living/silicon/ai/ai = M
GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(ai.loc)
global_announcer.autosay("[ai] has been moved to intelligence storage.", "Artificial Intelligence Oversight")
GLOB.global_announcer.autosay("[ai] has been moved to intelligence storage.", "Artificial Intelligence Oversight")
ai.clear_client()
return
else
+1 -1
View File
@@ -52,7 +52,7 @@
var/turf/Ts //Turf for shadekin
//Try to find nondense turf
for(var/direction in cardinal)
for(var/direction in GLOB.cardinal)
var/turf/T = get_step(target,direction)
if(T && !T.density)
Ts = T //Found shadekin spawn turf