mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 11:35:19 +01:00
Conversion many Globals to Managed Globals (Part 1) (#17121)
* Conversion of some Globals to Managed Globals * Fix * for later --------- Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
@@ -17,10 +17,10 @@
|
||||
|
||||
/obj/effect/landmark/late_antag/Initialize(mapload)
|
||||
. = ..()
|
||||
var/datum/antagonist/A = all_antag_types[antag_id]
|
||||
var/datum/antagonist/A = GLOB.all_antag_types[antag_id]
|
||||
if(istype(A))
|
||||
A.starting_locations |= get_turf(src)
|
||||
var/list/allpoints = all_antag_spawnpoints[A.landmark_id]
|
||||
var/list/allpoints = GLOB.all_antag_spawnpoints[A.landmark_id]
|
||||
allpoints |= get_turf(src)
|
||||
|
||||
/obj/effect/landmark/late_antag/ert
|
||||
|
||||
@@ -96,8 +96,8 @@
|
||||
if(Debug2) to_world_log("## DEBUG: Explosion([x0],[y0],[z0])(d[devastation_range],h[heavy_impact_range],l[light_impact_range]): Took [took] seconds.")
|
||||
|
||||
//Machines which report explosions.
|
||||
for(var/i,i<=doppler_arrays.len,i++)
|
||||
var/obj/machinery/doppler_array/Array = doppler_arrays[i]
|
||||
for(var/i, i <= GLOB.doppler_arrays.len, i++)
|
||||
var/obj/machinery/doppler_array/Array = GLOB.doppler_arrays[i]
|
||||
if(Array)
|
||||
Array.sense_explosion(x0,y0,z0,devastation_range,heavy_impact_range,light_impact_range,took)
|
||||
sleep(8)
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/item/antag_spawner/technomancer_apprentice/equip_antag(mob/technomancer_mob)
|
||||
var/datum/antagonist/technomancer/antag_datum = all_antag_types[MODE_TECHNOMANCER]
|
||||
var/datum/antagonist/technomancer/antag_datum = GLOB.all_antag_types[MODE_TECHNOMANCER]
|
||||
antag_datum.equip_apprentice(technomancer_mob)
|
||||
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
// Update manifest'
|
||||
if(data_core)
|
||||
data_core.get_manifest_list()
|
||||
data["manifest"] = PDA_Manifest
|
||||
data["manifest"] = GLOB.PDA_Manifest
|
||||
data["mapRef"] = map_name
|
||||
return data
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// Allows ghosts to roleplay with crewmembers without having to commit to joining the round, and also allows communications between two communicators.
|
||||
|
||||
var/global/list/obj/item/communicator/all_communicators = list()
|
||||
GLOBAL_LIST_EMPTY_TYPED(all_communicators, /obj/item/communicator)
|
||||
|
||||
// List of core tabs the communicator can switch to
|
||||
#define HOMETAB 1
|
||||
@@ -97,8 +97,8 @@ var/global/list/obj/item/communicator/all_communicators = list()
|
||||
// assign the device to the holder's name automatically in a spectacularly shitty way.
|
||||
/obj/item/communicator/Initialize(mapload)
|
||||
. = ..()
|
||||
all_communicators += src
|
||||
all_communicators = sortAtom(all_communicators)
|
||||
GLOB.all_communicators += src
|
||||
GLOB.all_communicators = sortAtom(GLOB.all_communicators)
|
||||
node = get_exonet_node()
|
||||
START_PROCESSING(SSobj, src)
|
||||
camera = new(src)
|
||||
@@ -187,7 +187,7 @@ var/global/list/obj/item/communicator/all_communicators = list()
|
||||
src.known_devices.Cut()
|
||||
if(!get_connection_to_tcomms()) //If the network's down, we can't see anything.
|
||||
return
|
||||
for(var/obj/item/communicator/comm in all_communicators)
|
||||
for(var/obj/item/communicator/comm in GLOB.all_communicators)
|
||||
if(!comm || !comm.exonet || !comm.exonet.address || comm.exonet.address == src.exonet.address) //Don't add addressless devices, and don't add ourselves.
|
||||
continue
|
||||
src.known_devices |= comm
|
||||
@@ -314,7 +314,7 @@ var/global/list/obj/item/communicator/all_communicators = list()
|
||||
node = null
|
||||
|
||||
//Clean up references that might point at us
|
||||
all_communicators -= src
|
||||
GLOB.all_communicators -= src
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
listening_objects.Remove(src)
|
||||
QDEL_NULL(camera)
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
return
|
||||
|
||||
var/list/choices = list()
|
||||
for(var/obj/item/communicator/comm in all_communicators)
|
||||
for(var/obj/item/communicator/comm in GLOB.all_communicators)
|
||||
if(!comm.network_visibility || !comm.exonet || !comm.exonet.address)
|
||||
continue
|
||||
choices.Add(comm)
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
return
|
||||
|
||||
var/list/choices = list()
|
||||
for(var/obj/item/communicator/comm in all_communicators)
|
||||
for(var/obj/item/communicator/comm in GLOB.all_communicators)
|
||||
if(!comm.network_visibility || !comm.exonet || !comm.exonet.address)
|
||||
continue
|
||||
choices.Add(comm)
|
||||
|
||||
@@ -194,7 +194,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
|
||||
|
||||
//The actual options
|
||||
if(href_list["mindscan"])
|
||||
if(!target.mind || (target.mind.name in prevent_respawns))
|
||||
if(!target.mind || (target.mind.name in GLOB.prevent_respawns))
|
||||
to_chat(usr,span_warning("Target seems totally braindead."))
|
||||
return
|
||||
|
||||
@@ -231,7 +231,7 @@ var/global/mob/living/carbon/human/dummy/mannequin/sleevemate_mob
|
||||
return
|
||||
|
||||
if(href_list["mindsteal"])
|
||||
if(!target.mind || (target.mind.name in prevent_respawns))
|
||||
if(!target.mind || (target.mind.name in GLOB.prevent_respawns))
|
||||
to_chat(usr,span_warning("Target seems totally braindead."))
|
||||
return
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
p.name = "Security Citation: [ticket_name]"
|
||||
playsound(user, 'sound/items/ticket_printer.ogg', 75, 1)
|
||||
|
||||
security_printer_tickets |= details
|
||||
GLOB.security_printer_tickets |= details
|
||||
log_and_message_admins("has issued '[ticket_name]' a security citation: \"[details]\"", user)
|
||||
last_print = world.time
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ var/datum/uplink_random_selection/all_uplink_selection = new/datum/uplink_random
|
||||
|
||||
#ifdef DEBUG
|
||||
/proc/debug_uplink_purchage_log()
|
||||
for(var/antag_type in all_antag_types)
|
||||
var/datum/antagonist/A = all_antag_types[antag_type]
|
||||
for(var/antag_type in GLOB.all_antag_types)
|
||||
var/datum/antagonist/A = GLOB.all_antag_types[antag_type]
|
||||
A.print_player_summary()
|
||||
|
||||
/proc/debug_uplink_item_assoc_list()
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
return
|
||||
|
||||
//extend the offer of battle to the other mech
|
||||
var/datum/gender/T = gender_datums[user.get_visible_gender()]
|
||||
var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()]
|
||||
to_chat(user, span_notice("You offer battle to [target.name]!"))
|
||||
to_chat(target, span_notice(span_bold("[user.name] wants to battle with [T.His] [name]!") + " " + span_italics("Attack them with a toy mech to initiate combat.")))
|
||||
wants_to_battle = TRUE
|
||||
@@ -393,7 +393,7 @@
|
||||
/obj/item/toy/mecha/proc/check_battle_start(mob/living/carbon/user, obj/item/toy/mecha/attacker, mob/living/carbon/target)
|
||||
var/datum/gender/T
|
||||
if(target)
|
||||
T = gender_datums[target.get_visible_gender()] // Doing this because Polaris Code has shitty gender datums and it's clunkier than FUCK.
|
||||
T = GLOB.gender_datums[target.get_visible_gender()] // Doing this because Polaris Code has shitty gender datums and it's clunkier than FUCK.
|
||||
if(attacker && attacker.in_combat)
|
||||
to_chat(user, span_notice("[target ? T.His : "Your" ] [attacker.name] is in combat."))
|
||||
if(target)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
temp_blade.attack_self()
|
||||
|
||||
/obj/item/cane/concealed/attack_self(var/mob/user)
|
||||
var/datum/gender/T = gender_datums[user.get_visible_gender()]
|
||||
var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()]
|
||||
if(concealed_blade)
|
||||
user.visible_message(span_warning("[user] has unsheathed \a [concealed_blade] from [T.his] [src]!"), "You unsheathe \the [concealed_blade] from \the [src].")
|
||||
// Calling drop/put in hands to properly call item drop/pickup procs
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/obj/item/cane/concealed/attackby(var/obj/item/material/sword/katana/caneblade/W, var/mob/user)
|
||||
if(!src.concealed_blade && istype(W))
|
||||
var/datum/gender/T = gender_datums[user.get_visible_gender()]
|
||||
var/datum/gender/T = GLOB.gender_datums[user.get_visible_gender()]
|
||||
user.visible_message(span_warning("[user] has sheathed \a [W] into [T.his] [src]!"), "You sheathe \the [W] into \the [src].")
|
||||
playsound(src, 'sound/weapons/holster/sheathin.ogg', 50, 1)
|
||||
user.drop_from_inventory(W)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
/obj/item/circuitboard/security/engineering/Initialize(mapload)
|
||||
. = ..()
|
||||
network = engineering_networks
|
||||
network = GLOB.engineering_networks
|
||||
|
||||
/obj/item/circuitboard/security/mining
|
||||
name = T_BOARD("mining camera monitor")
|
||||
|
||||
@@ -127,7 +127,7 @@ var/last_chew = 0
|
||||
var/obj/item/organ/external/O = H.organs_by_name[(H.hand ? BP_L_HAND : BP_R_HAND)]
|
||||
if (!O) return
|
||||
|
||||
var/datum/gender/T = gender_datums[H.get_visible_gender()]
|
||||
var/datum/gender/T = GLOB.gender_datums[H.get_visible_gender()]
|
||||
|
||||
var/s = span_warning("[H.name] chews on [T.his] [O.name]!")
|
||||
H.visible_message(s, span_warning("You chew on your [O.name]!"))
|
||||
|
||||
@@ -542,7 +542,7 @@ the implant may become unstable and either pre-maturely inject the subject or si
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
if ("emp")
|
||||
var/obj/item/radio/headset/a = new /obj/item/radio/headset/heads/captain(null)
|
||||
var/name = prob(50) ? t.name : pick(teleportlocs)
|
||||
var/name = prob(50) ? t.name : pick(GLOB.teleportlocs)
|
||||
a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm")
|
||||
// a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm", "Security")
|
||||
// a.autosay("[mobname] has died in [name]!", "[mobname]'s Death Alarm", "Medical")
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
to_chat(user, span_notice("\The [src] does not seem to have power."))
|
||||
return
|
||||
|
||||
var/datum/gender/TU = gender_datums[user.get_visible_gender()]
|
||||
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
|
||||
if (active)
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
user.visible_message(span_danger("\The [user] accidentally cuts [TU.himself] with \the [src]."),\
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
return
|
||||
|
||||
/obj/item/teleportation_scroll/proc/teleportscroll(var/mob/user)
|
||||
var/A = tgui_input_list(user, "Area to jump to:", "Teleportation Scroll", teleportlocs)
|
||||
var/A = tgui_input_list(user, "Area to jump to:", "Teleportation Scroll", GLOB.teleportlocs)
|
||||
if(!A)
|
||||
return
|
||||
var/area/thearea = teleportlocs[A]
|
||||
var/area/thearea = GLOB.teleportlocs[A]
|
||||
|
||||
if (user.stat || user.restrained())
|
||||
return
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var/global/list/micro_tunnels = list()
|
||||
GLOBAL_LIST_EMPTY(micro_tunnels)
|
||||
|
||||
/obj/structure/micro_tunnel
|
||||
name = "mouse hole"
|
||||
@@ -22,7 +22,7 @@ var/global/list/micro_tunnels = list()
|
||||
|
||||
/obj/structure/micro_tunnel/Initialize(mapload)
|
||||
. = ..()
|
||||
micro_tunnels.Add(src)
|
||||
GLOB.micro_tunnels.Add(src)
|
||||
if(name == initial(name))
|
||||
var/area/our_area = get_area(src)
|
||||
name = "[our_area.name] [name]"
|
||||
@@ -37,7 +37,7 @@ var/global/list/micro_tunnels = list()
|
||||
thing.forceMove(get_turf(src.loc))
|
||||
thing.cancel_camera()
|
||||
|
||||
micro_tunnels.Remove(src)
|
||||
GLOB.micro_tunnels.Remove(src)
|
||||
|
||||
return ..()
|
||||
|
||||
@@ -67,7 +67,7 @@ var/global/list/micro_tunnels = list()
|
||||
for(var/datum/planet/P in SSplanets.planets)
|
||||
if(myturf.z in P.expected_z_levels)
|
||||
planet = P
|
||||
for(var/obj/structure/micro_tunnel/t in micro_tunnels)
|
||||
for(var/obj/structure/micro_tunnel/t in GLOB.micro_tunnels)
|
||||
if(t == src)
|
||||
continue
|
||||
if(magic || t.magic)
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
H.forceMove(T)
|
||||
|
||||
if(make_antag)
|
||||
var/datum/antagonist/antag = all_antag_types[make_antag]
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[make_antag]
|
||||
if(antag)
|
||||
if(antag.add_antagonist(H.mind, 1, 1, 0, 1, 1))
|
||||
log_admin("\The [src] made [key_name(src)] into a [antag.role_text].")
|
||||
@@ -233,7 +233,7 @@
|
||||
H.forceMove(T)
|
||||
|
||||
if(make_antag)
|
||||
var/datum/antagonist/antag = all_antag_types[make_antag]
|
||||
var/datum/antagonist/antag = GLOB.all_antag_types[make_antag]
|
||||
if(antag)
|
||||
if(antag.add_antagonist(H.mind, 1, 1, 0, 1, 1))
|
||||
log_admin("\The [src] made [key_name(src)] into a [antag.role_text].")
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
H.forceMove(T)
|
||||
|
||||
if(special_role)
|
||||
var/datum/antagonist/role = all_antag_types[special_role] //Explicitly NOT an antagonist.
|
||||
var/datum/antagonist/role = GLOB.all_antag_types[special_role] //Explicitly NOT an antagonist.
|
||||
if(role)
|
||||
if(role.add_antagonist(H.mind, 1, 1, 0, 1, 1))
|
||||
log_admin("\The [src] made [key_name(src)] into a [role.role_text].")
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
to_chat(user, span_danger("The spike already has something on it, finish collecting its meat first!"))
|
||||
else
|
||||
if(spike(G.affecting))
|
||||
var/datum/gender/T = gender_datums[G.affecting.get_visible_gender()]
|
||||
var/datum/gender/T = GLOB.gender_datums[G.affecting.get_visible_gender()]
|
||||
visible_message(span_danger("[user] has forced [G.affecting] onto the spike, killing [T.him] instantly!"))
|
||||
var/mob/M = G.affecting
|
||||
M.forceMove(src)
|
||||
|
||||
@@ -591,7 +591,7 @@
|
||||
R.cell.charge -= 20
|
||||
else
|
||||
B.deductcharge(B.hitcost)
|
||||
var/datum/gender/TU = gender_datums[user.get_visible_gender()]
|
||||
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
|
||||
user.visible_message( \
|
||||
span_danger("[user] was stunned by [TU.his] wet [O]!"), \
|
||||
span_userdanger("[user] was stunned by [TU.his] wet [O]!"))
|
||||
|
||||
Reference in New Issue
Block a user