some more globals (#19098)

* some more globals

* .
This commit is contained in:
Kashargul
2026-01-29 09:21:58 -08:00
committed by GitHub
parent 24e68536bc
commit fdfb49012b
50 changed files with 164 additions and 176 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
set category = "Abilities.Antag"
if(!M.mind)
return
convert_to_faction(M.mind, revs)
convert_to_faction(M.mind, GLOB.revs)
/mob/living/proc/convert_to_faction(var/datum/mind/player, var/datum/antagonist/faction)
@@ -44,7 +44,7 @@ GLOBAL_DATUM(technomancers, /datum/antagonist/technomancer)
technomancer_mob.equip_to_slot_or_del(new /obj/item/radio/headset(technomancer_mob), slot_l_ear)
var/obj/item/technomancer_core/core = new /obj/item/technomancer_core(technomancer_mob)
technomancer_mob.equip_to_slot_or_del(core, slot_back)
technomancer_belongings.Add(core) // So it can be Tracked.
GLOB.technomancer_belongings.Add(core) // So it can be Tracked.
technomancer_mob.equip_to_slot_or_del(new /obj/item/flashlight(technomancer_mob), slot_belt)
technomancer_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(technomancer_mob), slot_shoes)
technomancer_mob.equip_to_slot_or_del(new /obj/item/clothing/head/technomancer/master(technomancer_mob), slot_head)
@@ -63,7 +63,7 @@ GLOBAL_DATUM(technomancers, /datum/antagonist/technomancer)
technomancer_mob.equip_to_slot_or_del(new /obj/item/radio/headset(technomancer_mob), slot_l_ear)
var/obj/item/technomancer_core/core = new /obj/item/technomancer_core(technomancer_mob)
technomancer_mob.equip_to_slot_or_del(core, slot_back)
technomancer_belongings.Add(core) // So it can be Tracked.
GLOB.technomancer_belongings.Add(core) // So it can be Tracked.
technomancer_mob.equip_to_slot_or_del(new /obj/item/flashlight(technomancer_mob), slot_belt)
technomancer_mob.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(technomancer_mob), slot_shoes)
technomancer_mob.equip_to_slot_or_del(new /obj/item/clothing/head/technomancer/apprentice(technomancer_mob), slot_head)
@@ -82,7 +82,7 @@ GLOBAL_DATUM(technomancers, /datum/antagonist/technomancer)
/datum/antagonist/technomancer/print_player_summary()
..()
for(var/obj/item/technomancer_core/core in technomancer_belongings)
for(var/obj/item/technomancer_core/core in GLOB.technomancer_belongings)
if(core.wearer)
continue // Only want abandoned cores.
if(!core.spells.len)
@@ -1,4 +1,4 @@
var/datum/antagonist/revolutionary/revs
GLOBAL_DATUM(revs, /datum/antagonist/revolutionary)
/datum/antagonist/revolutionary
id = MODE_REVOLUTIONARY
@@ -35,7 +35,7 @@ var/datum/antagonist/revolutionary/revs
/datum/antagonist/revolutionary/New()
..()
revs = src
GLOB.revs = src
/datum/antagonist/revolutionary/create_global_objectives()
if(!..())
+4 -4
View File
@@ -2609,7 +2609,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
*/
// CENTCOM
var/list/centcom_areas = list (
GLOBAL_LIST_INIT(centcom_areas, list(
/area/centcom,
/area/shuttle/escape/centcom,
/area/shuttle/escape_pod1/centcom,
@@ -2619,10 +2619,10 @@ var/list/centcom_areas = list (
/area/shuttle/transport1/centcom,
/area/shuttle/administration/centcom,
/area/shuttle/specops/centcom,
)
))
//SPACE STATION 13
var/list/the_station_areas = list (
GLOBAL_LIST_INIT(the_station_areas, list(
/area/shuttle/arrival,
/area/shuttle/escape/station,
/area/shuttle/escape_pod1/station,
@@ -2662,7 +2662,7 @@ var/list/the_station_areas = list (
/area/ai_upload,
/area/ai_upload_foyer,
/area/ai
)
))
+1 -1
View File
@@ -38,7 +38,7 @@ GLOBAL_LIST_EMPTY(nuke_disks)
var/disk_rescued = 1
for(var/obj/item/disk/nuclear/D in GLOB.nuke_disks)
var/disk_area = get_area(D)
if(!is_type_in_list(disk_area, centcom_areas))
if(!is_type_in_list(disk_area, GLOB.centcom_areas))
disk_rescued = 0
break
var/crew_evacuated = (emergency_shuttle.returned())
+2 -2
View File
@@ -808,7 +808,7 @@ GLOBAL_LIST_EMPTY(all_objectives)
for(var/datum/mind/cult_mind in cult.current_antagonists)
if (cult_mind.current && cult_mind.current.stat!=2)
var/area/A = get_area(cult_mind.current )
if ( is_type_in_list(A, centcom_areas))
if ( is_type_in_list(A, GLOB.centcom_areas))
acolytes_survived++
if(acolytes_survived >= target_amount)
return 0
@@ -863,7 +863,7 @@ GLOBAL_LIST_EMPTY(all_objectives)
if(H.stat == DEAD || H.restrained())
return 1
// Check if they're converted
if(target in revs.current_antagonists)
if(target in GLOB.revs.current_antagonists)
return 1
var/turf/T = get_turf(H)
if(T && isNotStationLevel(T.z)) //If they leave the station they count as dead for this
+9 -9
View File
@@ -1,9 +1,9 @@
#define ALL_SPELLS "All"
var/list/all_technomancer_spells = subtypesof(/datum/technomancer/spell)
var/list/all_technomancer_equipment = subtypesof(/datum/technomancer/equipment)
var/list/all_technomancer_consumables = subtypesof(/datum/technomancer/consumable)
var/list/all_technomancer_assistance = subtypesof(/datum/technomancer/assistance)
GLOBAL_LIST_INIT(all_technomancer_spells, subtypesof(/datum/technomancer/spell))
GLOBAL_LIST_INIT(all_technomancer_equipment, subtypesof(/datum/technomancer/equipment))
GLOBAL_LIST_INIT(all_technomancer_consumables, subtypesof(/datum/technomancer/consumable))
GLOBAL_LIST_INIT(all_technomancer_assistance, subtypesof(/datum/technomancer/assistance))
/datum/technomancer
var/name = "technomancer thing"
@@ -78,16 +78,16 @@ var/list/all_technomancer_assistance = subtypesof(/datum/technomancer/assistance
// Description: Instantiates all the catalog datums for everything that can be bought.
/obj/item/technomancer_catalog/proc/set_up()
if(!spell_instances.len)
for(var/S in all_technomancer_spells)
for(var/S in GLOB.all_technomancer_spells)
spell_instances += new S()
if(!equipment_instances.len)
for(var/E in all_technomancer_equipment)
for(var/E in GLOB.all_technomancer_equipment)
equipment_instances += new E()
if(!consumable_instances.len)
for(var/C in all_technomancer_consumables)
for(var/C in GLOB.all_technomancer_consumables)
consumable_instances += new C()
if(!assistance_instances.len)
for(var/A in all_technomancer_assistance)
for(var/A in GLOB.all_technomancer_assistance)
assistance_instances += new A()
/obj/item/technomancer_catalog/apprentice/set_up()
@@ -333,7 +333,7 @@ var/list/all_technomancer_assistance = subtypesof(/datum/technomancer/assistance
budget -= desired_object.cost
to_chat(H, span_notice("You have just bought \a [desired_object.name]."))
var/obj/O = new desired_object.obj_path(get_turf(H))
technomancer_belongings.Add(O) // Used for the Track spell.
GLOB.technomancer_belongings.Add(O) // Used for the Track spell.
else //Can't afford.
to_chat(H, span_danger("You can't afford that!"))
@@ -10,7 +10,7 @@
// This stores a ref to all important items that belong to a Technomancer, in case of theft. Used by the spell below.
// I feel dirty for adding yet another global list used by one thing, but the only alternative is to loop through world, and yeahhh.
var/list/technomancer_belongings = list()
GLOBAL_LIST_EMPTY(technomancer_belongings)
/obj/item/spell/track
name = "track"
@@ -34,7 +34,7 @@ var/list/technomancer_belongings = list()
return
var/can_track_non_allies = 0
var/list/object_choices = technomancer_belongings.Copy()
var/list/object_choices = GLOB.technomancer_belongings.Copy()
if(check_for_scepter())
can_track_non_allies = 1
var/list/mob_choices = list()
+5 -5
View File
@@ -6,7 +6,7 @@
overlay = over
ckey = key
var/list/ai_status_emotions = list(
GLOBAL_LIST_INIT(ai_status_emotions, list(
"Very Happy" = new /datum/ai_emotion("ai_veryhappy"),
"Happy" = new /datum/ai_emotion("ai_happy"),
"Neutral" = new /datum/ai_emotion("ai_neutral"),
@@ -28,12 +28,12 @@ var/list/ai_status_emotions = list(
"Heart" = new /datum/ai_emotion("ai_heart"),
"Tribunal" = new /datum/ai_emotion("ai_tribunal", "serithi"),
"Tribunal Malfunctioning" = new /datum/ai_emotion("ai_tribunal_malf", "serithi")
)
))
/proc/get_ai_emotions(var/ckey)
var/list/emotions = list()
for(var/emotion_name in ai_status_emotions)
var/datum/ai_emotion/emotion = ai_status_emotions[emotion_name]
for(var/emotion_name in GLOB.ai_status_emotions)
var/datum/ai_emotion/emotion = GLOB.ai_status_emotions[emotion_name]
if(!emotion.ckey || emotion.ckey == ckey)
emotions += emotion_name
@@ -98,7 +98,7 @@ var/list/ai_status_emotions = list(
return
if(mode==1) // AI emoticon
var/datum/ai_emotion/ai_emotion = ai_status_emotions[emotion]
var/datum/ai_emotion/ai_emotion = GLOB.ai_status_emotions[emotion]
set_picture(ai_emotion.overlay)
return
+4 -5
View File
@@ -55,14 +55,13 @@ GLOBAL_LIST(word_to_uristrune_table)
return get_uristrune(bits, animated)
var/list/uristrune_cache = list()
GLOBAL_LIST_EMPTY(uristrune_cache)
/proc/get_uristrune(symbol_bits, animated = 0)
var/lookup = "[symbol_bits]-[animated]"
if(lookup in uristrune_cache)
return uristrune_cache[lookup]
if(lookup in GLOB.uristrune_cache)
return GLOB.uristrune_cache[lookup]
var/icon/I = icon('icons/effects/uristrunes.dmi', "blank")
@@ -125,6 +124,6 @@ var/list/uristrune_cache = list()
result.Insert(I3, "", frame = 7, delay = 2)
result.Insert(I2, "", frame = 8, delay = 2)
uristrune_cache[lookup] = result
GLOB.uristrune_cache[lookup] = result
return result
+2 -2
View File
@@ -4,7 +4,7 @@
#define BOOK_VERSION_MAX 2
#define BOOK_PATH "data/books/"
var/global/datum/book_manager/book_mgr = new()
GLOBAL_DATUM_INIT(book_mgr, /datum/book_manager, new)
/datum/book_manager/proc/path(id)
if(isnum(id)) // kill any path exploits
@@ -131,7 +131,7 @@ var/global/datum/book_manager/book_mgr = new()
/datum/archived_book/proc/save()
var/savefile/F = new(book_mgr.path(id))
var/savefile/F = new(GLOB.book_mgr.path(id))
F["version"] << BOOK_VERSION_MAX
F["author"] << author
+6 -6
View File
@@ -50,12 +50,12 @@ would spawn and follow the beaker, even if it is carried or thrown.
// to something, like a smoking beaker, so then you can just call start() and the steam
// will always spawn at the items location, even if it's moved.
/* Example:
var/datum/effect/system/steam_spread/steam = new /datum/effect/system/steam_spread() -- creates new system
steam.set_up(5, 0, mob.loc) -- sets up variables
OPTIONAL: steam.attach(mob)
steam.start() -- spawns the effect
*/
/** Example:
* var/datum/effect/system/steam_spread/steam = new /datum/effect/system/steam_spread() -- creates new system
* steam.set_up(5, 0, mob.loc) -- sets up variables
* OPTIONAL: steam.attach(mob)
* steam.start() -- spawns the effect
**/
/////////////////////////////////////////////
/obj/effect/effect/steam
name = "steam"
@@ -1,18 +1,18 @@
/*****************Marker Beacons**************************/
var/list/marker_beacon_colors = list(
"Burgundy" = LIGHT_COLOR_FLARE,
"Bronze" = LIGHT_COLOR_ORANGE,
"Yellow" = LIGHT_COLOR_YELLOW,
"Lime" = LIGHT_COLOR_SLIME_LAMP,
"Olive" = LIGHT_COLOR_GREEN,
"Jade" = LIGHT_COLOR_BLUEGREEN,
"Teal" = LIGHT_COLOR_LIGHT_CYAN,
"Cerulean" = LIGHT_COLOR_BLUE,
"Indigo" = LIGHT_COLOR_DARK_BLUE,
"Purple" = LIGHT_COLOR_PURPLE,
"Violet" = LIGHT_COLOR_LAVENDER,
"Fuchsia" = LIGHT_COLOR_PINK
)
GLOBAL_LIST_INIT(marker_beacon_colors, list(
"Burgundy" = LIGHT_COLOR_FLARE,
"Bronze" = LIGHT_COLOR_ORANGE,
"Yellow" = LIGHT_COLOR_YELLOW,
"Lime" = LIGHT_COLOR_SLIME_LAMP,
"Olive" = LIGHT_COLOR_GREEN,
"Jade" = LIGHT_COLOR_BLUEGREEN,
"Teal" = LIGHT_COLOR_LIGHT_CYAN,
"Cerulean" = LIGHT_COLOR_BLUE,
"Indigo" = LIGHT_COLOR_DARK_BLUE,
"Purple" = LIGHT_COLOR_PURPLE,
"Violet" = LIGHT_COLOR_LAVENDER,
"Fuchsia" = LIGHT_COLOR_PINK
))
/obj/item/stack/marker_beacon
name = "marker beacons"
@@ -73,7 +73,7 @@ var/list/marker_beacon_colors = list(
if(!in_range(src, user))
return
var/options = marker_beacon_colors.Copy()
var/options = GLOB.marker_beacon_colors.Copy()
options += list("Random" = FALSE) //not a true color, will pick a random color
var/input_color = tgui_input_list(user, "Choose a color.", "Beacon Color", options)
if(user.incapacitated() || !istype(user) || !in_range(src, user))
@@ -111,10 +111,10 @@ var/list/marker_beacon_colors = list(
. += span_notice("Alt-click to select a color. Current color is [picked_color].")
/obj/structure/marker_beacon/update_icon()
if(!picked_color || !marker_beacon_colors[picked_color])
picked_color = pick(marker_beacon_colors)
if(!picked_color || !GLOB.marker_beacon_colors[picked_color])
picked_color = pick(GLOB.marker_beacon_colors)
icon_state = "[icon_base][lowertext(picked_color)]-on"
set_light(light_range, light_power, marker_beacon_colors[picked_color])
set_light(light_range, light_power, GLOB.marker_beacon_colors[picked_color])
/obj/structure/marker_beacon/attack_hand(mob/living/user)
if(perma)
@@ -152,7 +152,7 @@ var/list/marker_beacon_colors = list(
if(!in_range(src, user))
return
var/options = marker_beacon_colors.Copy()
var/options = GLOB.marker_beacon_colors.Copy()
options += list("Random" = FALSE) //not a true color, will pick a random color
var/input_color = tgui_input_list(user, "Choose a color.", "Beacon Color", options)
if(user.incapacitated() || !istype(user) || !in_range(src, user))
@@ -117,7 +117,6 @@
user.drop_l_hand()
user.stop_pulling()
var/last_chew = 0
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
if (A != src) return ..()
if (last_chew + 26 > world.time) return
+13 -14
View File
@@ -26,8 +26,13 @@
return INITIALIZE_HINT_QDEL
var/list/image/hazard_overlays
var/list/tape_roll_applications = list()
GLOBAL_LIST_INIT_TYPED(hazard_overlays, /image, list(
"[NORTH]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "N"),
"[EAST]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "E"),
"[SOUTH]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "S"),
"[WEST]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "W")
))
GLOBAL_LIST_EMPTY(tape_roll_applications)
/obj/item/tape
name = "tape"
@@ -55,12 +60,6 @@ var/list/tape_roll_applications = list()
/obj/item/tape/Initialize(mapload)
. = ..()
if(!hazard_overlays)
hazard_overlays = list()
hazard_overlays["[NORTH]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "N")
hazard_overlays["[EAST]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "E")
hazard_overlays["[SOUTH]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "S")
hazard_overlays["[WEST]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "W")
update_icon()
/obj/item/taperoll/medical
@@ -301,18 +300,18 @@ var/list/tape_roll_applications = list()
if (istype(A, /turf/simulated/floor) ||istype(A, /turf/unsimulated/floor))
var/turf/F = A
var/direction = user.loc == F ? user.dir : turn(user.dir, 180)
var/icon/hazard_overlay = hazard_overlays["[direction]"]
if(tape_roll_applications[F] == null)
tape_roll_applications[F] = 0
var/icon/hazard_overlay = GLOB.hazard_overlays["[direction]"]
if(GLOB.tape_roll_applications[F] == null)
GLOB.tape_roll_applications[F] = 0
if(tape_roll_applications[F] & direction) // hazard_overlay in F.overlays wouldn't work.
if(GLOB.tape_roll_applications[F] & direction) // hazard_overlay in F.overlays wouldn't work.
user.visible_message("\The [user] uses the adhesive of \the [src] to remove area markings from \the [F].", "You use the adhesive of \the [src] to remove area markings from \the [F].")
F.cut_overlay(hazard_overlay)
tape_roll_applications[F] &= ~direction
GLOB.tape_roll_applications[F] &= ~direction
else
user.visible_message("\The [user] applied \the [src] on \the [F] to create area markings.", "You apply \the [src] on \the [F] to create area markings.")
F.add_overlay(hazard_overlay)
tape_roll_applications[F] |= direction
GLOB.tape_roll_applications[F] |= direction
return
/obj/item/tape/proc/crumple()
+6 -8
View File
@@ -99,7 +99,7 @@
// Multi Point Spawn
// Selects one spawn point out of a group of points with the same ID and asks it to generate its items
*/
var/list/multi_point_spawns
GLOBAL_LIST_EMPTY(multi_point_spawns)
/obj/random_multi
name = "random object spawn point"
@@ -114,19 +114,17 @@ var/list/multi_point_spawns
. = ..()
weight = max(1, round(weight))
if(!multi_point_spawns)
multi_point_spawns = list()
var/list/spawnpoints = multi_point_spawns[id]
var/list/spawnpoints = GLOB.multi_point_spawns[id]
if(!spawnpoints)
spawnpoints = list()
multi_point_spawns[id] = spawnpoints
GLOB.multi_point_spawns[id] = spawnpoints
spawnpoints[src] = weight
/obj/random_multi/Destroy()
var/list/spawnpoints = multi_point_spawns[id]
var/list/spawnpoints = GLOB.multi_point_spawns[id]
spawnpoints -= src
if(!spawnpoints.len)
multi_point_spawns -= id
if(!length(spawnpoints))
GLOB.multi_point_spawns -= id
. = ..()
/obj/random_multi/proc/generate_items()
+3 -3
View File
@@ -1,7 +1,7 @@
// These are objects that destroy themselves and add themselves to the
// decal list of the floor under them. Use them rather than distinct icon_states
// when mapping in interesting floor designs.
var/list/floor_decals = list()
GLOBAL_LIST_EMPTY(floor_decals)
/obj/effect/floor_decal
name = "floor decal"
@@ -25,10 +25,10 @@ var/list/floor_decals = list()
var/turf/T = get_turf(src)
if(istype(T, /turf/simulated/floor) || istype(T, /turf/unsimulated/floor) || istype(T, /turf/simulated/shuttle/floor))
var/cache_key = get_cache_key(T)
var/image/I = floor_decals[cache_key]
var/image/I = GLOB.floor_decals[cache_key]
if(!I)
I = make_decal_image()
floor_decals[cache_key] = I
GLOB.floor_decals[cache_key] = I
LAZYADD(T.decals, I) // Add to its decals list (so it remembers to re-apply after it cuts overlays)
T.add_overlay(I) // Add to its current overlays too.
return T
+4 -4
View File
@@ -39,7 +39,7 @@
. = ..()
update_icon(1)
var/list/flesh_overlay_cache = list()
GLOBAL_LIST_EMPTY(flesh_overlay_cache)
/turf/simulated/flesh/update_icon(var/update_neighbors)
cut_overlays()
@@ -51,9 +51,9 @@ var/list/flesh_overlay_cache = list()
var/turf/T = get_step(src,direction)
if(istype(T) && !T.density)
var/place_dir = turn(direction, 180)
if(!flesh_overlay_cache["flesh_side_[place_dir]"])
flesh_overlay_cache["flesh_side_[place_dir]"] = image('icons/turf/stomach_vr.dmi', "flesh_side", dir = place_dir)
add_overlay(flesh_overlay_cache["flesh_side_[place_dir]"])
if(!GLOB.flesh_overlay_cache["flesh_side_[place_dir]"])
GLOB.flesh_overlay_cache["flesh_side_[place_dir]"] = image('icons/turf/stomach_vr.dmi', "flesh_side", dir = place_dir)
add_overlay(GLOB.flesh_overlay_cache["flesh_side_[place_dir]"])
if(update_neighbors)
for(var/direction in GLOB.alldirs)