mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-01-09 17:02:56 +00:00
[MIRROR] Conversion many Globals to Managed Globals (Part 1) (#10665)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
06f0821bcf
commit
f7219329ca
@@ -440,13 +440,13 @@
|
||||
if(istext(belly_data["contamination_flavor"]))
|
||||
var/new_contamination_flavor = sanitize(belly_data["contamination_flavor"],MAX_MESSAGE_LEN,0,0,0)
|
||||
if(new_contamination_flavor)
|
||||
if(new_contamination_flavor in contamination_flavors)
|
||||
if(new_contamination_flavor in GLOB.contamination_flavors)
|
||||
new_belly.contamination_flavor = new_contamination_flavor
|
||||
|
||||
if(istext(belly_data["contamination_color"]))
|
||||
var/new_contamination_color = sanitize(belly_data["contamination_color"],MAX_MESSAGE_LEN,0,0,0)
|
||||
if(new_contamination_color)
|
||||
if(new_contamination_color in contamination_colors)
|
||||
if(new_contamination_color in GLOB.contamination_colors)
|
||||
new_belly.contamination_color = new_contamination_color
|
||||
|
||||
if(isnum(belly_data["nutrition_percent"]))
|
||||
@@ -535,7 +535,7 @@
|
||||
if(istext(belly_data["egg_type"]))
|
||||
var/new_egg_type = sanitize(belly_data["egg_type"],MAX_MESSAGE_LEN,0,0,0)
|
||||
if(new_egg_type)
|
||||
if(new_egg_type in global_vore_egg_types)
|
||||
if(new_egg_type in GLOB.global_vore_egg_types)
|
||||
new_belly.egg_type = new_egg_type
|
||||
|
||||
if(istext(belly_data["egg_name"]))
|
||||
@@ -622,30 +622,30 @@
|
||||
new_belly.fancy_vore = TRUE
|
||||
|
||||
if(new_belly.fancy_vore)
|
||||
if(!(new_belly.vore_sound in fancy_vore_sounds))
|
||||
if(!(new_belly.vore_sound in GLOB.fancy_vore_sounds))
|
||||
new_belly.vore_sound = "Gulp"
|
||||
if(!(new_belly.release_sound in fancy_vore_sounds))
|
||||
if(!(new_belly.release_sound in GLOB.fancy_vore_sounds))
|
||||
new_belly.release_sound = "Splatter"
|
||||
else
|
||||
if(!(new_belly.vore_sound in classic_vore_sounds))
|
||||
if(!(new_belly.vore_sound in GLOB.classic_vore_sounds))
|
||||
new_belly.vore_sound = "Gulp"
|
||||
if(!(new_belly.release_sound in classic_vore_sounds))
|
||||
if(!(new_belly.release_sound in GLOB.classic_vore_sounds))
|
||||
new_belly.release_sound = "Splatter"
|
||||
|
||||
if(istext(belly_data["vore_sound"]))
|
||||
var/new_vore_sound = sanitize(belly_data["vore_sound"],MAX_MESSAGE_LEN,0,0,0)
|
||||
if(new_vore_sound)
|
||||
if (new_belly.fancy_vore && (new_vore_sound in fancy_vore_sounds))
|
||||
if (new_belly.fancy_vore && (new_vore_sound in GLOB.fancy_vore_sounds))
|
||||
new_belly.vore_sound = new_vore_sound
|
||||
if (!new_belly.fancy_vore && (new_vore_sound in classic_vore_sounds))
|
||||
if (!new_belly.fancy_vore && (new_vore_sound in GLOB.classic_vore_sounds))
|
||||
new_belly.vore_sound = new_vore_sound
|
||||
|
||||
if(istext(belly_data["release_sound"]))
|
||||
var/new_release_sound = sanitize(belly_data["release_sound"],MAX_MESSAGE_LEN,0,0,0)
|
||||
if(new_release_sound)
|
||||
if (new_belly.fancy_vore && (new_release_sound in fancy_release_sounds))
|
||||
if (new_belly.fancy_vore && (new_release_sound in GLOB.fancy_release_sounds))
|
||||
new_belly.release_sound = new_release_sound
|
||||
if (!new_belly.fancy_vore && (new_release_sound in classic_release_sounds))
|
||||
if (!new_belly.fancy_vore && (new_release_sound in GLOB.classic_release_sounds))
|
||||
new_belly.release_sound = new_release_sound
|
||||
|
||||
if(isnum(belly_data["sound_volume"]))
|
||||
|
||||
@@ -526,9 +526,9 @@
|
||||
if(vore_sound && !recent_sound && !istype(thing, /mob/observer))
|
||||
var/soundfile
|
||||
if(!fancy_vore)
|
||||
soundfile = classic_vore_sounds[vore_sound]
|
||||
soundfile = GLOB.classic_vore_sounds[vore_sound]
|
||||
else
|
||||
soundfile = fancy_vore_sounds[vore_sound]
|
||||
soundfile = GLOB.fancy_vore_sounds[vore_sound]
|
||||
if(special_entrance_sound) // Custom sound set by mob's init_vore or ingame varedits.
|
||||
soundfile = special_entrance_sound
|
||||
if(soundfile)
|
||||
@@ -839,9 +839,9 @@
|
||||
owner.visible_message(span_vnotice(span_green(span_bold("[owner] [release_verb] everything from their [lowertext(name)]!"))), range = privacy_range)
|
||||
var/soundfile
|
||||
if(!fancy_vore)
|
||||
soundfile = classic_release_sounds[release_sound]
|
||||
soundfile = GLOB.classic_release_sounds[release_sound]
|
||||
else
|
||||
soundfile = fancy_release_sounds[release_sound]
|
||||
soundfile = GLOB.fancy_release_sounds[release_sound]
|
||||
if(soundfile)
|
||||
playsound(src, soundfile, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF, frequency = noise_freq, preference = /datum/preference/toggle/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
|
||||
|
||||
@@ -924,9 +924,9 @@
|
||||
owner.visible_message(span_vnotice(span_green(span_bold("[owner] [release_verb] [M] from their [lowertext(name)]!"))),range = privacy_range)
|
||||
var/soundfile
|
||||
if(!fancy_vore)
|
||||
soundfile = classic_release_sounds[release_sound]
|
||||
soundfile = GLOB.classic_release_sounds[release_sound]
|
||||
else
|
||||
soundfile = fancy_release_sounds[release_sound]
|
||||
soundfile = GLOB.fancy_release_sounds[release_sound]
|
||||
if(soundfile)
|
||||
playsound(src, soundfile, vol = sound_volume, vary = 1, falloff = VORE_SOUND_FALLOFF, frequency = noise_freq, preference = /datum/preference/toggle/eating_noises, volume_channel = VOLUME_CHANNEL_VORE)
|
||||
//Should fix your view not following you out of mobs sometimes!
|
||||
|
||||
@@ -35,7 +35,7 @@ var/list/gurgled_overlays = list(
|
||||
gurgled_color = contamination_color
|
||||
if(!isbelly(src.loc)) //Moved non-worn overlay stuff to belly_obj_vr.dm Exited proc. No need to add overlays to things that won't make it out.
|
||||
add_overlay(gurgled_overlays[gurgled_color])
|
||||
var/list/pickfrom = contamination_flavors[contamination_flavor]
|
||||
var/list/pickfrom = GLOB.contamination_flavors[contamination_flavor]
|
||||
var/gurgleflavor = pick(pickfrom)
|
||||
cleanname = src.name
|
||||
cleandesc = src.desc
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
if((H.species.name in remainless_species)) //Don't leave anything if there is nothing to leave
|
||||
if((H.species.name in GLOB.remainless_species)) //Don't leave anything if there is nothing to leave
|
||||
return
|
||||
|
||||
if(prob(20) && !H.isSynthetic()) //ribcage surviving whole is some luck //Edit: no robor
|
||||
|
||||
@@ -1586,9 +1586,9 @@
|
||||
|
||||
var/soundfile
|
||||
if(!RTB.fancy_vore)
|
||||
soundfile = classic_release_sounds[RTB.release_sound]
|
||||
soundfile = GLOB.classic_release_sounds[RTB.release_sound]
|
||||
else
|
||||
soundfile = fancy_release_sounds[RTB.release_sound]
|
||||
soundfile = GLOB.fancy_release_sounds[RTB.release_sound]
|
||||
if(soundfile)
|
||||
playsound(src, soundfile, vol = 100, vary = 1, falloff = VORE_SOUND_FALLOFF, preference = /datum/preference/toggle/eating_noises)
|
||||
|
||||
|
||||
@@ -1444,7 +1444,7 @@
|
||||
|
||||
if(isobserver(target))
|
||||
var/mob/observer/T = target
|
||||
if(!ismob(T.body_backup) || prevent_respawns.Find(T.mind.name) || ispAI(T.body_backup))
|
||||
if(!ismob(T.body_backup) || GLOB.prevent_respawns.Find(T.mind.name) || ispAI(T.body_backup))
|
||||
to_chat(user,span_warning("They don't seem to be reformable!"))
|
||||
return TRUE
|
||||
|
||||
@@ -1514,7 +1514,7 @@
|
||||
announce_ghost_joinleave(T.mind, 0, "They now occupy their body again.")
|
||||
else if(istype(target,/obj/item/mmi)) // A good bit of repeated code, sure, but... cleanest way to do this.
|
||||
var/obj/item/mmi/MMI = target
|
||||
if(!ismob(MMI.body_backup) || !MMI.brainmob.mind || prevent_respawns.Find(MMI.brainmob.mind.name))
|
||||
if(!ismob(MMI.body_backup) || !MMI.brainmob.mind || GLOB.prevent_respawns.Find(MMI.brainmob.mind.name))
|
||||
to_chat(user,span_warning("They don't seem to be reformable!"))
|
||||
return TRUE
|
||||
var/accepted = tgui_alert(MMI.brainmob, "[host] is trying to reform your body! Would you like to get reformed inside [host]'s [lowertext(host.vore_selected.name)]?", "Reforming Attempt", list("Yes", "No"))
|
||||
@@ -1775,14 +1775,14 @@
|
||||
host.vore_selected.contaminates = !host.vore_selected.contaminates
|
||||
. = TRUE
|
||||
if("b_contamination_flavor")
|
||||
var/list/menu_list = contamination_flavors.Copy()
|
||||
var/list/menu_list = GLOB.contamination_flavors.Copy()
|
||||
var/new_flavor = tgui_input_list(user, "Choose Contamination Flavor Text Type (currently [host.vore_selected.contamination_flavor])", "Flavor Choice", menu_list)
|
||||
if(!new_flavor)
|
||||
return FALSE
|
||||
host.vore_selected.contamination_flavor = new_flavor
|
||||
. = TRUE
|
||||
if("b_contamination_color")
|
||||
var/list/menu_list = contamination_colors.Copy()
|
||||
var/list/menu_list = GLOB.contamination_colors.Copy()
|
||||
var/new_color = tgui_input_list(user, "Choose Contamination Color (currently [host.vore_selected.contamination_color])", "Color Choice", menu_list)
|
||||
if(!new_color)
|
||||
return FALSE
|
||||
@@ -1790,7 +1790,7 @@
|
||||
host.vore_selected.items_preserved.Cut() //To re-contaminate for new color
|
||||
. = TRUE
|
||||
if("b_egg_type")
|
||||
var/list/menu_list = global_vore_egg_types.Copy()
|
||||
var/list/menu_list = GLOB.global_vore_egg_types.Copy()
|
||||
var/new_egg_type = tgui_input_list(user, "Choose Egg Type (currently [host.vore_selected.egg_type])", "Egg Choice", menu_list)
|
||||
if(!new_egg_type)
|
||||
return FALSE
|
||||
@@ -2252,9 +2252,9 @@
|
||||
if("b_release")
|
||||
var/choice
|
||||
if(host.vore_selected.fancy_vore)
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.release_sound]","Select Sound", fancy_release_sounds)
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.release_sound]","Select Sound", GLOB.fancy_release_sounds)
|
||||
else
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.release_sound]","Select Sound", classic_release_sounds)
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.release_sound]","Select Sound", GLOB.classic_release_sounds)
|
||||
|
||||
if(!choice)
|
||||
return FALSE
|
||||
@@ -2264,9 +2264,9 @@
|
||||
if("b_releasesoundtest")
|
||||
var/sound/releasetest
|
||||
if(host.vore_selected.fancy_vore)
|
||||
releasetest = fancy_release_sounds[host.vore_selected.release_sound]
|
||||
releasetest = GLOB.fancy_release_sounds[host.vore_selected.release_sound]
|
||||
else
|
||||
releasetest = classic_release_sounds[host.vore_selected.release_sound]
|
||||
releasetest = GLOB.classic_release_sounds[host.vore_selected.release_sound]
|
||||
|
||||
if(releasetest)
|
||||
releasetest = sound(releasetest)
|
||||
@@ -2277,9 +2277,9 @@
|
||||
if("b_sound")
|
||||
var/choice
|
||||
if(host.vore_selected.fancy_vore)
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.vore_sound]","Select Sound", fancy_vore_sounds)
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.vore_sound]","Select Sound", GLOB.fancy_vore_sounds)
|
||||
else
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.vore_sound]","Select Sound", classic_vore_sounds)
|
||||
choice = tgui_input_list(user,"Currently set to [host.vore_selected.vore_sound]","Select Sound", GLOB.classic_vore_sounds)
|
||||
|
||||
if(!choice)
|
||||
return FALSE
|
||||
@@ -2289,9 +2289,9 @@
|
||||
if("b_soundtest")
|
||||
var/sound/voretest
|
||||
if(host.vore_selected.fancy_vore)
|
||||
voretest = fancy_vore_sounds[host.vore_selected.vore_sound]
|
||||
voretest = GLOB.fancy_vore_sounds[host.vore_selected.vore_sound]
|
||||
else
|
||||
voretest = classic_vore_sounds[host.vore_selected.vore_sound]
|
||||
voretest = GLOB.classic_vore_sounds[host.vore_selected.vore_sound]
|
||||
if(voretest)
|
||||
voretest = sound(voretest)
|
||||
voretest.volume = host.vore_selected.sound_volume
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
// The reverse lookup of player_sizes_list, number to name.
|
||||
/proc/player_size_name(var/size_multiplier)
|
||||
// (This assumes list is sorted big->small)
|
||||
for(var/N in player_sizes_list)
|
||||
for(var/N in GLOB.player_sizes_list)
|
||||
. = N // So we return the smallest if we get to the end
|
||||
if(size_multiplier >= player_sizes_list[N])
|
||||
if(size_multiplier >= GLOB.player_sizes_list[N])
|
||||
return N
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user