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
@@ -78,7 +78,7 @@ SUBSYSTEM_DEF(atc)
/datum/controller/subsystem/atc/proc/msg(var/message,var/sender)
ASSERT(message)
global_announcer.autosay("[message]", sender ? sender : "[using_map.dock_name] Control")
GLOB.global_announcer.autosay("[message]", sender ? sender : "[using_map.dock_name] Control")
/datum/controller/subsystem/atc/proc/is_squelched()
return squelched
@@ -93,7 +93,7 @@ SUBSYSTEM_DEF(appreciation)
/datum/controller/subsystem/appreciation/proc/msg(var/message,var/sender)
ASSERT(message)
global_announcer.autosay("[message]", sender ? sender : "Cultural Awareness")
GLOB.global_announcer.autosay("[message]", sender ? sender : "Cultural Awareness")
/datum/controller/subsystem/appreciation/proc/is_squelched()
return squelched
+1 -1
View File
@@ -126,7 +126,7 @@ SUBSYSTEM_DEF(atoms)
/datum/controller/subsystem/atoms/Shutdown()
var/initlog = InitLog()
if(initlog)
text2file(initlog, "[log_path]-initialize.log")
text2file(initlog, "[GLOB.log_directory]-initialize.log")
#undef BAD_INIT_QDEL_BEFORE
#undef BAD_INIT_DIDNT_INIT
+6 -6
View File
@@ -42,7 +42,7 @@ SUBSYSTEM_DEF(game_master)
adjust_staleness(1)
adjust_danger(-1)
var/global_afk = metric.assess_all_living_mobs()
var/global_afk = GLOB.metric.assess_all_living_mobs()
global_afk = abs(global_afk - 100)
global_afk = round(global_afk / 100, 0.1)
adjust_staleness(global_afk) // Staleness increases faster if more people are less active.
@@ -212,22 +212,22 @@ SUBSYSTEM_DEF(game_master)
dat += "<tr>"
dat += "<td>All Living Mobs</td>"
dat += "<td>[metric.assess_all_living_mobs()]%</td>"
dat += "<td>[GLOB.metric.assess_all_living_mobs()]%</td>"
dat += "</tr>"
dat += "<tr>"
dat += "<td>All Ghosts</td>"
dat += "<td>[metric.assess_all_dead_mobs()]%</td>"
dat += "<td>[GLOB.metric.assess_all_dead_mobs()]%</td>"
dat += "</tr>"
dat += "<tr>"
dat += "<th colspan='2'>Departments</td>"
dat += "</tr>"
for(var/D in metric.departments)
for(var/D in GLOB.metric.departments)
dat += "<tr>"
dat += "<td>[D]</td>"
dat += "<td>[metric.assess_department(D)]%</td>"
dat += "<td>[GLOB.metric.assess_department(D)]%</td>"
dat += "</tr>"
dat += "<tr>"
@@ -237,7 +237,7 @@ SUBSYSTEM_DEF(game_master)
for(var/mob/M as anything in player_list)
dat += "<tr>"
dat += "<td>[M] ([M.ckey])</td>"
dat += "<td>[metric.assess_player_activity(M)]%</td>"
dat += "<td>[GLOB.metric.assess_player_activity(M)]%</td>"
dat += "</tr>"
dat += "</table>"
+1 -1
View File
@@ -19,6 +19,6 @@ SUBSYSTEM_DEF(holomaps)
return SS_INIT_SUCCESS
/datum/controller/subsystem/holomaps/stat_entry(msg)
if (!Debug2)
if (!GLOB.Debug2)
return // Only show up in stat panel if debugging is enabled.
. = ..()
+1 -1
View File
@@ -41,7 +41,7 @@ SUBSYSTEM_DEF(inactivity)
if(isAI(C.mob))
var/mob/living/silicon/ai/A = C.mob
GLOB.empty_playable_ai_cores += new /obj/structure/AIcore/deactivated(A.loc)
global_announcer.autosay("[A] has been moved to intelligence storage.", "Artificial Intelligence Oversight")
GLOB.global_announcer.autosay("[A] has been moved to intelligence storage.", "Artificial Intelligence Oversight")
A.clear_client()
information = " while an AI."
+1 -1
View File
@@ -213,7 +213,7 @@ SUBSYSTEM_DEF(mapping)
// VOREStation Edit End: Re-enable this
/datum/controller/subsystem/mapping/stat_entry(msg)
if (!Debug2)
if (!GLOB.Debug2)
return // Only show up in stat panel if debugging is enabled.
. = ..()
@@ -65,7 +65,7 @@ SUBSYSTEM_DEF(motiontracker)
if(!prob(hear_chance))
return
if(hear_chance <= 40)
T = get_step(T,pick(cardinal))
T = get_step(T,pick(GLOB.cardinal))
if(!T) // incase...
return
// Echo time, we have a turf
+1 -1
View File
@@ -64,7 +64,7 @@ SUBSYSTEM_DEF(skybox)
speedspace_cache["EW_[i]"] = MA
//Over-the-edge images
for (var/dir in alldirs)
for (var/dir in GLOB.alldirs)
var/mutable_appearance/MA = new(normal_space)
var/matrix/M = matrix()
var/horizontal = (dir & (WEST|EAST))
+9 -9
View File
@@ -13,7 +13,7 @@ SUBSYSTEM_DEF(ticker)
var/current_state = GAME_STATE_INIT // We aren't even at pregame yet // TODO replace with CURRENT_GAME_STATE
/* Relies upon the following globals (TODO move those in here) */
// var/master_mode = "extended" //The underlying game mode (so "secret" or the voted mode).
// var/GLOB.master_mode = "extended" //The underlying game mode (so "secret" or the voted mode).
// Set by SSvote when VOTE_GAMEMODE finishes.
// var/round_progressing = 1 //Whether the lobby clock is ticking down.
@@ -84,7 +84,7 @@ var/global/datum/controller/subsystem/ticker/ticker
// Called during GAME_STATE_PREGAME (RUNLEVEL_LOBBY)
/datum/controller/subsystem/ticker/proc/pregame_tick()
if(round_progressing && last_fire)
if(GLOB.round_progressing && last_fire)
pregame_timeleft -= (world.time - last_fire) / (1 SECOND)
if(start_immediately)
@@ -122,23 +122,23 @@ var/global/datum/controller/subsystem/ticker/ticker
// Returns 0 if failed to pick a mode, otherwise 1
/datum/controller/subsystem/ticker/proc/setup_choose_gamemode()
//Create and announce mode
if(master_mode == "secret")
if(GLOB.master_mode == "secret")
src.hide_mode = TRUE
var/list/runnable_modes = config.get_runnable_modes()
if((master_mode == "random") || (master_mode == "secret"))
if((GLOB.master_mode == "random") || (GLOB.master_mode == "secret"))
if(!runnable_modes.len)
to_world(span_filter_system(span_bold("Unable to choose playable game mode.") + " Reverting to pregame lobby."))
return 0
if(secret_force_mode != "secret")
src.mode = config.pick_mode(secret_force_mode)
if(GLOB.secret_force_mode != "secret")
src.mode = config.pick_mode(GLOB.secret_force_mode)
if(!src.mode)
var/list/weighted_modes = list()
for(var/datum/game_mode/GM in runnable_modes)
weighted_modes[GM.config_tag] = CONFIG_GET(keyed_list/probabilities)[GM.config_tag]
src.mode = config.gamemode_cache[pickweight(weighted_modes)]
else
src.mode = config.pick_mode(master_mode)
src.mode = config.pick_mode(GLOB.master_mode)
if(!src.mode)
to_world(span_boldannounce("Serious error in mode setup! Reverting to pregame lobby.")) //Uses setup instead of set up due to computational context.
@@ -427,7 +427,7 @@ var/global/datum/controller/subsystem/ticker/ticker
// If they're a carbon, they can get manifested
if(J?.mob_type & JOB_CARBON)
data_core.manifest_inject(new_char)
GLOB.data_core.manifest_inject(new_char)
/datum/controller/subsystem/ticker/proc/collect_minds()
for(var/mob/living/player in player_list)
@@ -555,7 +555,7 @@ var/global/datum/controller/subsystem/ticker/ticker
if(GAME_STATE_INIT)
..()
if(GAME_STATE_PREGAME) // RUNLEVEL_LOBBY
msg = "START [round_progressing ? "[round(pregame_timeleft)]s" : "(PAUSED)"]"
msg = "START [GLOB.round_progressing ? "[round(pregame_timeleft)]s" : "(PAUSED)"]"
if(GAME_STATE_SETTING_UP) // RUNLEVEL_SETUP
msg = "SETUP"
if(GAME_STATE_PLAYING) // RUNLEVEL_GAME
+4 -4
View File
@@ -256,9 +256,9 @@ SUBSYSTEM_DEF(transcore)
var/datum/transcore_db/db = SStranscore.db_by_mind_name(MR.mindname)
var/datum/transhuman/body_record/BR = db.body_scans[MR.mindname]
if(!BR)
global_announcer.autosay("[MR.mindname] is past-due for a mind backup, but lacks a corresponding body record.", "TransCore Oversight", "Medical")
GLOB.global_announcer.autosay("[MR.mindname] is past-due for a mind backup, but lacks a corresponding body record.", "TransCore Oversight", "Medical")
return
global_announcer.autosay("[MR.mindname] is past-due for a mind backup.", "TransCore Oversight", BR.synthetic ? "Science" : "Medical")
GLOB.global_announcer.autosay("[MR.mindname] is past-due for a mind backup.", "TransCore Oversight", BR.synthetic ? "Science" : "Medical")
// Called from mind_record to add itself to the transcore.
/datum/transcore_db/proc/add_backup(var/datum/transhuman/mind_record/MR)
@@ -293,8 +293,8 @@ SUBSYSTEM_DEF(transcore)
// Moves all mind records from the databaes into the disk and shuts down all backup canary processing.
/datum/transcore_db/proc/core_dump(var/obj/item/disk/transcore/disk)
ASSERT(disk)
global_announcer.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Command")
global_announcer.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Medical")
GLOB.global_announcer.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Command")
GLOB.global_announcer.autosay("An emergency core dump has been initiated!", "TransCore Oversight", "Medical")
disk.stored += backed_up
backed_up.Cut()
+6 -6
View File
@@ -87,10 +87,10 @@ SUBSYSTEM_DEF(vote)
if(choices["Continue Playing"] >= greatest_votes)
greatest_votes = choices["Continue Playing"]
else if(mode == VOTE_GAMEMODE)
if(master_mode in choices)
choices[master_mode] += non_voters
if(choices[master_mode] >= greatest_votes)
greatest_votes = choices[master_mode]
if(GLOB.master_mode in choices)
choices[GLOB.master_mode] += non_voters
if(choices[GLOB.master_mode] >= greatest_votes)
greatest_votes = choices[GLOB.master_mode]
else if(mode == VOTE_CREW_TRANSFER)
var/factor = 0.5
switch(world.time / (10 * 60)) // minutes
@@ -149,12 +149,12 @@ SUBSYSTEM_DEF(vote)
if(. == "Restart Round")
restart = 1
if(VOTE_GAMEMODE)
if(master_mode != .)
if(GLOB.master_mode != .)
world.save_mode(.)
if(ticker && ticker.mode)
restart = 1
else
master_mode = .
GLOB.master_mode = .
if(VOTE_CREW_TRANSFER)
if(. == "Initiate Crew Transfer")
init_shift_change(null, 1)
+1 -1
View File
@@ -30,7 +30,7 @@ SUBSYSTEM_DEF(xenoarch)
digsite_spawning_turfs = SSxenoarch.digsite_spawning_turfs
/datum/controller/subsystem/xenoarch/stat_entry(msg)
if (!Debug2)
if (!GLOB.Debug2)
return // Only show up in stat panel if debugging is enabled.
return ..()