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 05:55:25 -04:00
committed by GitHub
co-authored by Kashargul
parent 5d21a53dfa
commit 28e969778c
448 changed files with 1339 additions and 1346 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
if (get_dist(on_wall, user)>1)
return
var/ndir = get_dir(user, on_wall)
if (!(ndir in cardinal))
if (!(ndir in GLOB.cardinal))
return
var/turf/loc = get_turf(user)
var/area/A = loc.loc
+1 -1
View File
@@ -246,7 +246,7 @@
return ROOM_ERR_TOOLARGE
var/turf/T = pending[1] //why byond havent list::pop()?
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
+4 -4
View File
@@ -535,7 +535,7 @@
var/list/zLevels = using_map.station_levels.Copy()
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.update_areas()
return TRUE
@@ -678,7 +678,7 @@
return ROOM_ERR_TOOLARGE
var/turf/T = pending[1] //why byond havent list::pop()?
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
@@ -835,7 +835,7 @@
return 1 //TOOLARGE
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
@@ -936,7 +936,7 @@
var/list/zLevels = using_map.station_levels.Copy()
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.update_areas()
return
@@ -305,8 +305,8 @@
/obj/item/communicator/tgui_static_data(mob/user, datum/tgui/ui, datum/tgui_state/state)
var/list/data = ..()
// Update manifest'
if(data_core)
data_core.get_manifest_list()
if(GLOB.data_core)
GLOB.data_core.get_manifest_list()
data["manifest"] = GLOB.PDA_Manifest
data["mapRef"] = map_name
return data
@@ -26,15 +26,15 @@
/obj/item/holowarrant/attack_self(mob/living/user as mob)
active = null
var/list/warrants = list()
if(!isnull(data_core.general))
for(var/datum/data/record/warrant/W in data_core.warrants)
if(!isnull(GLOB.data_core.general))
for(var/datum/data/record/warrant/W in GLOB.data_core.warrants)
warrants += W.fields["namewarrant"]
if(warrants.len == 0)
to_chat(user,span_notice("There are no warrants available"))
return
var/temp
temp = tgui_input_list(user, "Which warrant would you like to load?", "Warrant Selection", warrants)
for(var/datum/data/record/warrant/W in data_core.warrants)
for(var/datum/data/record/warrant/W in GLOB.data_core.warrants)
if(W.fields["namewarrant"] == temp)
active = W
update_icon()
@@ -48,7 +48,7 @@
A.holder = src
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
bombers += "[key_name(user)] attached a [item] to a transfer valve."
GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve."
message_admins("[key_name_admin(user)] attached a [item] to a transfer valve. [ADMIN_JMP(location)]")
log_game("[key_name_admin(user)] attached a [item] to a transfer valve.")
attacher = user
@@ -208,7 +208,7 @@
last_touch_info = ADMIN_QUE(mob)
log_str += " Last touched by: [src.fingerprintslast][last_touch_info]"
bombers += log_str
GLOB.bombers += log_str
message_admins(log_str, 0, 1)
log_game(log_str)
merge_gases()
+2 -2
View File
@@ -130,7 +130,7 @@
data["locked_records"] = null
if(exploit_id)
for(var/datum/data/record/L in data_core.locked)
for(var/datum/data/record/L in GLOB.data_core.locked)
if(L.fields["id"] == exploit_id)
data["exploit"] = list() // Setting this to equal L.fields passes it's variables that are lists as reference instead of value.
// We trade off being able to automatically add shit for more control over what gets passed to json
@@ -155,7 +155,7 @@
break
else
var/list/permanentData = list()
for(var/datum/data/record/L in sortRecord(data_core.locked))
for(var/datum/data/record/L in sortRecord(GLOB.data_core.locked))
permanentData.Add(list(list(
"name" = L.fields["name"],
"id" = L.fields["id"]
+6 -6
View File
@@ -849,15 +849,15 @@
to_chat(user, span_warning("A snake popped out of [src]!"))
if(real == 0)
var/obj/item/toy/C = new /obj/item/toy/plushie/snakeplushie(get_turf(loc))
C.throw_at(get_step(src, pick(alldirs)), 9, 1, src)
C.throw_at(get_step(src, pick(GLOB.alldirs)), 9, 1, src)
if(real == 1)
var/mob/living/simple_mob/C = new /mob/living/simple_mob/animal/passive/snake(get_turf(loc))
C.throw_at(get_step(src, pick(alldirs)), 9, 1, src)
C.throw_at(get_step(src, pick(GLOB.alldirs)), 9, 1, src)
if(real == 2)
var/mob/living/simple_mob/C = new /mob/living/simple_mob/vore/aggressive/giant_snake(get_turf(loc))
C.throw_at(get_step(src, pick(alldirs)), 9, 1, src)
C.throw_at(get_step(src, pick(GLOB.alldirs)), 9, 1, src)
playsound(src, 'sound/items/confetti.ogg', 50, 0)
icon_state = "tastybread_popped"
@@ -882,15 +882,15 @@
to_chat(user, span_warning("A snake popped out of [src]!"))
if(real == 0)
var/obj/item/toy/C = new /obj/item/toy/plushie/snakeplushie(get_turf(loc))
C.throw_at(get_step(src, pick(alldirs)), 9, 1, src)
C.throw_at(get_step(src, pick(GLOB.alldirs)), 9, 1, src)
if(real == 1)
var/mob/living/simple_mob/C = new /mob/living/simple_mob/animal/passive/snake(get_turf(loc))
C.throw_at(get_step(src, pick(alldirs)), 9, 1, src)
C.throw_at(get_step(src, pick(GLOB.alldirs)), 9, 1, src)
if(real == 2)
var/mob/living/simple_mob/C = new /mob/living/simple_mob/vore/aggressive/giant_snake(get_turf(loc))
C.throw_at(get_step(src, pick(alldirs)), 9, 1, src)
C.throw_at(get_step(src, pick(GLOB.alldirs)), 9, 1, src)
playsound(src, 'sound/items/confetti.ogg', 50, 0)
icon_state = "tastybread_popped"
@@ -128,7 +128,7 @@ AI MODULES
/obj/item/aiModule/proc/log_law_changes(var/mob/living/silicon/ai/target, var/mob/sender)
var/time = time2text(world.realtime,"hh:mm:ss")
lawchanges.Add("[time] <B>:</B> [sender.name]([sender.key]) used [src.name] on [target.name]([target.key])")
GLOB.lawchanges.Add("[time] <B>:</B> [sender.name]([sender.key]) used [src.name] on [target.name]([target.key])")
log_and_message_admins("used [src.name] on [target.name]([target.key])")
/obj/item/aiModule/proc/addAdditionalLaws(var/mob/living/silicon/ai/target, var/mob/sender)
@@ -159,7 +159,7 @@ AI MODULES
/obj/item/aiModule/safeguard/addAdditionalLaws(var/mob/living/silicon/ai/target, var/mob/sender)
var/law = text("Safeguard []. Anyone threatening or attempting to harm [] is no longer to be considered a crew member, and is a threat which must be neutralized.", targetName, targetName)
target.add_supplied_law(9, law)
lawchanges.Add("The law specified [targetName]")
GLOB.lawchanges.Add("The law specified [targetName]")
/******************** OneMember ********************/
@@ -266,7 +266,7 @@ AI MODULES
if(!lawpos || lawpos < MIN_SUPPLIED_LAW_NUMBER)
lawpos = MIN_SUPPLIED_LAW_NUMBER
target.add_supplied_law(lawpos, law)
lawchanges.Add("The law was '[newFreeFormLaw]'")
GLOB.lawchanges.Add("The law was '[newFreeFormLaw]'")
/obj/item/aiModule/freeform/install(var/obj/machinery/computer/C, var/mob/living/user)
if(!newFreeFormLaw)
@@ -382,7 +382,7 @@ AI MODULES
/obj/item/aiModule/freeformcore/addAdditionalLaws(var/mob/living/silicon/ai/target, var/mob/sender)
var/law = "[newFreeFormLaw]"
target.add_inherent_law(law)
lawchanges.Add("The law is '[newFreeFormLaw]'")
GLOB.lawchanges.Add("The law is '[newFreeFormLaw]'")
/obj/item/aiModule/freeformcore/install(var/obj/machinery/computer/C, var/mob/living/user)
if(!newFreeFormLaw)
@@ -407,7 +407,7 @@ AI MODULES
// ..() //We don't want this module reporting to the AI who dun it. --NEO
log_law_changes(target, sender)
lawchanges.Add("The law is '[newFreeFormLaw]'")
GLOB.lawchanges.Add("The law is '[newFreeFormLaw]'")
to_chat(target, span_danger("BZZZZT"))
var/law = "[newFreeFormLaw]"
target.add_ion_law(law)
@@ -49,7 +49,7 @@
qdel(src)
/obj/structure/picnic_blanket_deployed/proc/unfold()
var/dirs = alldirs
var/dirs = GLOB.alldirs
var/isTableTop //Controls whether to spawn things across tables, or on ground
var/doWeHaveTable //Helper var set to true if ANY obj is a table
var/anti_spam = FALSE //Helper var to avoid spamming people if they are mired in trash.
@@ -155,13 +155,13 @@ var/list/tape_roll_applications = list()
// spread tape in all directions, provided there is a wall/window
var/turf/T
var/possible_dirs = 0
for(var/dir in cardinal)
for(var/dir in GLOB.cardinal)
T = get_step(start, dir)
if(T && T.density)
possible_dirs |= dir
else
for(var/obj/structure/window/W in T)
if(W.is_fulltile() || W.dir == reverse_dir[dir])
if(W.is_fulltile() || W.dir == GLOB.reverse_dir[dir])
possible_dirs |= dir
for(var/obj/structure/window/window in start)
if(istype(window) && !window.is_fulltile())
@@ -215,12 +215,12 @@ var/list/tape_roll_applications = list()
else
continue
else if(cur == end)
if(window.dir == reverse_dir[orientation])
if(window.dir == GLOB.reverse_dir[orientation])
can_place = 0
break
else
continue
else if (window.dir == reverse_dir[orientation] || window.dir == orientation)
else if (window.dir == GLOB.reverse_dir[orientation] || window.dir == orientation)
can_place = 0
break
else
@@ -244,21 +244,21 @@ var/list/tape_roll_applications = list()
tapetest = 0
tape_dir = dir
if(cur == start)
var/turf/T = get_step(start, reverse_dir[orientation])
var/turf/T = get_step(start, GLOB.reverse_dir[orientation])
if(T && !T.density)
tape_dir = orientation
for(var/obj/structure/window/W in T)
if(W.is_fulltile() || W.dir == orientation)
tape_dir = dir
for(var/obj/structure/window/window in cur)
if(istype(window) && !window.is_fulltile() && window.dir == reverse_dir[orientation])
if(istype(window) && !window.is_fulltile() && window.dir == GLOB.reverse_dir[orientation])
tape_dir = dir
else if(cur == end)
var/turf/T = get_step(end, orientation)
if(T && !T.density)
tape_dir = reverse_dir[orientation]
tape_dir = GLOB.reverse_dir[orientation]
for(var/obj/structure/window/W in T)
if(W.is_fulltile() || W.dir == reverse_dir[orientation])
if(W.is_fulltile() || W.dir == GLOB.reverse_dir[orientation])
tape_dir = dir
for(var/obj/structure/window/window in cur)
if(istype(window) && !window.is_fulltile() && window.dir == orientation)
+1 -1
View File
@@ -210,7 +210,7 @@
if(ishuman(target))
var/mob/living/carbon/human/H = target
H.forcesay(hit_appends)
H.forcesay(GLOB.hit_appends)
powercheck()
/obj/item/melee/baton/emp_act(severity)
+1 -1
View File
@@ -57,7 +57,7 @@
/obj/item/syndie/c4explosive/proc/do_detonate()
SHOULD_NOT_OVERRIDE(TRUE)
PRIVATE_PROC(TRUE)
for(var/dirn in cardinal) //This is to guarantee that C4 at least breaks down all immediately adjacent walls and doors.
for(var/dirn in GLOB.cardinal) //This is to guarantee that C4 at least breaks down all immediately adjacent walls and doors.
var/turf/simulated/wall/T = get_step(src,dirn)
if(locate(/obj/machinery/door/airlock) in T)
var/obj/machinery/door/airlock/D = locate() in T
@@ -176,7 +176,7 @@ var/list/global/tank_gauge_cache = list()
to_chat(user, span_notice("You begin attaching the assembly to \the [src]."))
if(do_after(user, 50, src))
to_chat(user, span_notice("You finish attaching the assembly to \the [src]."))
bombers += "[key_name(user)] attached an assembly to a wired [src]. Temp: [src.air_contents.temperature-T0C]"
GLOB.bombers += "[key_name(user)] attached an assembly to a wired [src]. Temp: [src.air_contents.temperature-T0C]"
message_admins("[key_name_admin(user)] attached an assembly to a wired [src]. Temp: [src.air_contents.temperature-T0C]")
assemble_bomb(W,user)
else
@@ -195,7 +195,7 @@ var/list/global/tank_gauge_cache = list()
src.valve_welded = 1
src.leaking = 0
else
bombers += "[key_name(user)] attempted to weld a [src]. [src.air_contents.temperature-T0C]"
GLOB.bombers += "[key_name(user)] attempted to weld a [src]. [src.air_contents.temperature-T0C]"
message_admins("[key_name_admin(user)] attempted to weld a [src]. [src.air_contents.temperature-T0C]")
if(WT.welding)
to_chat(user, span_danger("You accidentally rake \the [W] across \the [src]!"))
+2 -2
View File
@@ -171,8 +171,8 @@
var/dir_offset = 0
if(target_turf != source_turf)
dir_offset = get_dir(source_turf, target_turf)
if(!(dir_offset in cardinal))
to_chat(user, "You cannot reach that from here.") // can only place stuck papers in cardinal directions, to
if(!(dir_offset in GLOB.cardinal))
to_chat(user, "You cannot reach that from here.") // can only place stuck papers in GLOB.cardinal directions, to
return // reduce papers around corners issue.
user.drop_from_inventory(src)
@@ -138,13 +138,13 @@ Frequency:
to_chat(user, span_notice("\The [src] is malfunctioning."))
return
var/list/L = list( )
for(var/obj/machinery/teleport/hub/R in machines)
for(var/obj/machinery/teleport/hub/R in GLOB.machines)
var/obj/machinery/computer/teleporter/com
var/obj/machinery/teleport/station/station
for(var/direction in cardinal)
for(var/direction in GLOB.cardinal)
station = locate(/obj/machinery/teleport/station, get_step(R, direction))
if(station)
for(direction in cardinal)
for(direction in GLOB.cardinal)
com = locate(/obj/machinery/computer/teleporter, get_step(station, direction))
if(com)
break