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:
Selis
2025-04-17 14:16:53 -04:00
committed by GitHub
co-authored by Kashargul
parent 6a47a779d5
commit 21dcf0555b
229 changed files with 1227 additions and 1220 deletions
@@ -78,7 +78,7 @@
adjustBruteLoss(-MED.heal_brute)
visible_message(span_infoplain(span_bold("\The [user]") + " applies the [MED] on [src]."))
else
var/datum/gender/T = gender_datums[src.get_visible_gender()]
var/datum/gender/T = GLOB.gender_datums[src.get_visible_gender()]
to_chat(user, span_notice("\The [src] is dead, medical items won't bring [T.him] back to life.")) // the gender lookup is somewhat overkill, but it functions identically to the obsolete gender macros and future-proofs this code
if(can_butcher(user, O)) //if the animal can be butchered, do so and return. It's likely to be gibbed.
harvest(user, O)
@@ -555,7 +555,7 @@ GLOBAL_VAR_INIT(teppi_count, 0) // How mant teppi DO we have?
if(!client && lets_eat(user) && prob(1))
visible_message(span_danger("\The [src] scromfs \the [user] along with the food!"))
to_chat(user, span_notice("\The [src] leans in close, spreading its jaws in front of you. A hot, humid gust of breath blows over you as the weight of \the [src]'s presses you over, knocking you off of your feet as the warm gooey tough of jaws scromf over your figure, rapidly guzzling you away with the [O], leaving you to tumble down into the depths of its body..."))
playsound(src, pick(bodyfall_sound), 75, 1)
playsound(src, pick(GLOB.bodyfall_sound), 75, 1)
teppi_pounce(user)
if(yum && nutrition >= 500)
to_chat(user, span_notice("\The [src] seems satisfied."))
@@ -641,7 +641,7 @@ GLOBAL_VAR_INIT(teppi_count, 0) // How mant teppi DO we have?
else if(lets_eat(M) && prob(50))
to_chat(M, span_notice("\The [src] grumbles a bit... and then bowls you over, pressing their weight into yours to knock you off of your feet! In a rush of chaotic presses and schlorps, the gooey touch of Teppi flesh grinds over you as you're guzzled away! Casually swallowed down in retaliation for all of the pettings. Pumped down deep into the grumbling depths of \the [src]."))
visible_message(span_danger("\The [src] scromfs \the [M], before chuffing and settling down again."))
playsound(src, pick(bodyfall_sound), 75, 1)
playsound(src, pick(GLOB.bodyfall_sound), 75, 1)
teppi_pounce(M)
wantpet = 100
else
@@ -731,7 +731,7 @@ GLOBAL_VAR_INIT(teppi_count, 0) // How mant teppi DO we have?
return
if(resting)
return
playsound(src, pick(teppi_sound), 75, 1)
playsound(src, pick(GLOB.teppi_sound), 75, 1)
/mob/living/simple_mob/vore/alienanimals/teppi/proc/teppi_shear(var/mob/user as mob, tool)
var/sheartime = 3 SECONDS
@@ -212,7 +212,7 @@ Field studies suggest analytical abilities on par with some species of cepholapo
var/list/original_armor
var/global/list/wounds_being_tended_by_drakes = list()
GLOBAL_LIST_EMPTY(wounds_being_tended_by_drakes)
/mob/living/simple_mob/animal/sif/grafadreka/proc/can_tend_wounds(var/mob/living/friend)
// We can't heal robots.
@@ -220,7 +220,7 @@ var/global/list/wounds_being_tended_by_drakes = list()
return FALSE
// Check if someone else is looking after them already.
if(global.wounds_being_tended_by_drakes["\ref[friend]"] > world.time)
if(GLOB.wounds_being_tended_by_drakes["\ref[friend]"] > world.time)
return FALSE
// Humans need to have a bleeding external organ to qualify.
@@ -157,7 +157,7 @@
/mob/living/simple_mob/vore/squirrel/Initialize(mapload)
. = ..()
if(do_seasons)
switch(world_time_season)
switch(GLOB.world_time_season)
if("spring")
if(prob(1))
winterize()
@@ -63,7 +63,7 @@
else
switch(M.a_intent)
if(I_HELP)
var/datum/gender/T = gender_datums[src.get_visible_gender()]
var/datum/gender/T = GLOB.gender_datums[src.get_visible_gender()]
M.visible_message(
span_notice("\The [M] hugs [src] to make [T.him] feel better!"), \
span_notice("You hug [src] to make [T.him] feel better!")
@@ -68,7 +68,7 @@ List of things solar grubs should be able to do:
/mob/living/simple_mob/vore/solargrub/Initialize(mapload)
. = ..()
existing_solargrubs += src
GLOB.existing_solargrubs += src
/mob/living/simple_mob/vore/solargrub/Life()
. = ..()
@@ -160,7 +160,7 @@ List of things solar grubs should be able to do:
..()
/mob/living/simple_mob/vore/solargrub/Destroy()
existing_solargrubs -= src
GLOB.existing_solargrubs -= src
. = ..()
/mob/living/simple_mob/vore/solargrub/handle_light()
@@ -1,4 +1,4 @@
var/global/list/grub_machine_overlays = list()
GLOBAL_LIST_EMPTY(grub_machine_overlays)
/mob/living/simple_mob/animal/solargrub_larva
name = "solargrub larva"
@@ -55,7 +55,7 @@ var/global/list/grub_machine_overlays = list()
/mob/living/simple_mob/animal/solargrub_larva/Initialize(mapload)
. = ..()
existing_solargrubs += src
GLOB.existing_solargrubs += src
powermachine = new(src)
sparks = new(src)
sparks.set_up()
@@ -68,7 +68,7 @@ var/global/list/grub_machine_overlays = list()
return ..()
/mob/living/simple_mob/animal/solargrub_larva/Destroy()
existing_solargrubs -= src
GLOB.existing_solargrubs -= src
QDEL_NULL(powermachine)
QDEL_NULL(sparks)
QDEL_NULL(machine_effect)
@@ -123,9 +123,9 @@ var/global/list/grub_machine_overlays = list()
forceMove(M)
powermachine.draining = 2
visible_message(span_warning("\The [src] finds an opening and crawls inside \the [M]."))
if(!(M.type in grub_machine_overlays))
if(!(M.type in GLOB.grub_machine_overlays))
generate_machine_effect(M)
machine_effect = image(grub_machine_overlays[M.type], M) //Can't do this the reasonable way with an overlay,
machine_effect = image(GLOB.grub_machine_overlays[M.type], M) //Can't do this the reasonable way with an overlay,
for(var/mob/L in player_list) //because nearly every machine updates its icon by removing all overlays first
L << machine_effect
@@ -133,7 +133,7 @@ var/global/list/grub_machine_overlays = list()
var/icon/I = new /icon(M.icon, M.icon_state)
I.Blend(new /icon('icons/effects/blood.dmi', rgb(255,255,255)),ICON_ADD)
I.Blend(new /icon('icons/effects/alert.dmi', "_red"),ICON_MULTIPLY)
grub_machine_overlays[M.type] = I
GLOB.grub_machine_overlays[M.type] = I
/mob/living/simple_mob/animal/solargrub_larva/proc/eject_from_machine(var/obj/machinery/M)
if(!M)