diff --git a/code/_helpers/events.dm b/code/_helpers/events.dm index d2c3715e0a..c073306f60 100644 --- a/code/_helpers/events.dm +++ b/code/_helpers/events.dm @@ -2,7 +2,7 @@ var/list/area/grand_list_of_areas = list() // Assemble areas that all exists (See DM reference if you are confused about loop labels) looping_station_areas: - for(var/parentpath in global.the_station_areas) + for(var/parentpath in GLOB.the_station_areas) // Check its not excluded for(var/excluded_path in excluded_areas) if(ispath(parentpath, excluded_path)) diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index cb0c008eff..8af232ee44 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -221,11 +221,10 @@ SUBSYSTEM_DEF(ticker) SSwebhooks.send(WEBHOOK_ROUNDSTART, list("url" = get_world_url())) // Spawn randomized items - for(var/id in multi_point_spawns) - var/list/spawn_points = multi_point_spawns[id] - var/obj/random_multi/rm = pickweight(spawn_points) + for(var/id, value in GLOB.multi_point_spawns) + var/obj/random_multi/rm = pickweight(value) rm.generate_items() - for(var/entry in spawn_points) + for(var/entry in value) qdel(entry) // Place empty AI cores once we know who is playing AI diff --git a/code/game/antagonist/antagonist_factions.dm b/code/game/antagonist/antagonist_factions.dm index d106e7cd8b..d145764782 100644 --- a/code/game/antagonist/antagonist_factions.dm +++ b/code/game/antagonist/antagonist_factions.dm @@ -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) diff --git a/code/game/antagonist/outsider/technomancer.dm b/code/game/antagonist/outsider/technomancer.dm index 87c72b83b6..232ef3b0b7 100644 --- a/code/game/antagonist/outsider/technomancer.dm +++ b/code/game/antagonist/outsider/technomancer.dm @@ -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) diff --git a/code/game/antagonist/station/revolutionary.dm b/code/game/antagonist/station/revolutionary.dm index dd73c5ad2f..1836b0bf46 100644 --- a/code/game/antagonist/station/revolutionary.dm +++ b/code/game/antagonist/station/revolutionary.dm @@ -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(!..()) diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 1fa44d159b..60fed62437 100755 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -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 -) +)) diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 52ddba0123..db33e2ed95 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -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()) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index dd3dc10da9..4071af1c4d 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -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 diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index da07fa16e1..c5e69d3ab9 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -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!")) diff --git a/code/game/gamemodes/technomancer/spells/track.dm b/code/game/gamemodes/technomancer/spells/track.dm index bac6b2d17d..6920e841d2 100644 --- a/code/game/gamemodes/technomancer/spells/track.dm +++ b/code/game/gamemodes/technomancer/spells/track.dm @@ -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() diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index c6fdd555dd..8987a99ca2 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -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 diff --git a/code/game/magic/Uristrunes.dm b/code/game/magic/Uristrunes.dm index 7e38121aeb..9c96bf56f1 100644 --- a/code/game/magic/Uristrunes.dm +++ b/code/game/magic/Uristrunes.dm @@ -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 diff --git a/code/game/magic/archived_book.dm b/code/game/magic/archived_book.dm index 38bf310c0f..ad0e3322b0 100644 --- a/code/game/magic/archived_book.dm +++ b/code/game/magic/archived_book.dm @@ -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 diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 46a8b93932..9228ead42d 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -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" diff --git a/code/game/objects/items/stacks/marker_beacons.dm b/code/game/objects/items/stacks/marker_beacons.dm index e97f48ccd5..1a52568531 100644 --- a/code/game/objects/items/stacks/marker_beacons.dm +++ b/code/game/objects/items/stacks/marker_beacons.dm @@ -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)) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 6832f2f667..ae3a0fbae6 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -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 diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm index 507bb38dee..85fcd39aa5 100644 --- a/code/game/objects/items/weapons/policetape.dm +++ b/code/game/objects/items/weapons/policetape.dm @@ -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() diff --git a/code/game/objects/random/_random.dm b/code/game/objects/random/_random.dm index a2a18a07bf..65190b035c 100644 --- a/code/game/objects/random/_random.dm +++ b/code/game/objects/random/_random.dm @@ -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() diff --git a/code/game/turfs/flooring/flooring_decals.dm b/code/game/turfs/flooring/flooring_decals.dm index 9f37fbca2b..cb2a96476d 100644 --- a/code/game/turfs/flooring/flooring_decals.dm +++ b/code/game/turfs/flooring/flooring_decals.dm @@ -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 diff --git a/code/game/turfs/simulated/wall_types_vr.dm b/code/game/turfs/simulated/wall_types_vr.dm index 96369116b7..e1e6bb3a4c 100644 --- a/code/game/turfs/simulated/wall_types_vr.dm +++ b/code/game/turfs/simulated/wall_types_vr.dm @@ -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) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 5aa911f97f..6c3dfb1045 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -246,7 +246,7 @@ ADMIN_VERB(stealth, R_STEALTH, "Stealth Mode", "Toggle stealth.", "Admin.Game") var/datum/preferences/D var/client/C = GLOB.directory[warned_ckey] if(C) D = C.prefs - else D = preferences_datums[warned_ckey] + else D = GLOB.preferences_datums[warned_ckey] if(!D) to_chat(src, span_warning("Error: warn(): No such ckey found.")) diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index c0ba7f2214..5051128c85 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -19,8 +19,8 @@ //- Identify how hard it is to break into the area and where the weak points are //- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels. -var/camera_range_display_status = 0 -var/intercom_range_display_status = 0 +GLOBAL_VAR_INIT(camera_range_display_status, FALSE) +GLOBAL_VAR_INIT(intercom_range_display_status, FALSE) GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) @@ -48,17 +48,17 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) set category = "Mapping" set name = "Camera Range Display" - if(camera_range_display_status) - camera_range_display_status = 0 + if(GLOB.camera_range_display_status) + GLOB.camera_range_display_status = FALSE else - camera_range_display_status = 1 + GLOB.camera_range_display_status = TRUE for(var/obj/effect/debugging/camera_range/C in GLOB.all_debugging_effects) qdel(C) - if(camera_range_display_status) + if(GLOB.camera_range_display_status) for(var/obj/machinery/camera/C in cameranet.cameras) new/obj/effect/debugging/camera_range(C.loc) feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -112,15 +112,15 @@ GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) set category = "Mapping" set name = "Intercom Range Display" - if(intercom_range_display_status) - intercom_range_display_status = 0 + if(GLOB.intercom_range_display_status) + GLOB.intercom_range_display_status = FALSE else - intercom_range_display_status = 1 + GLOB.intercom_range_display_status = TRUE for(var/obj/effect/debugging/marker/M in GLOB.all_debugging_effects) qdel(M) - if(intercom_range_display_status) + if(GLOB.intercom_range_display_status) for(var/obj/item/radio/intercom/I in GLOB.machines) for(var/turf/T in orange(7,I)) var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T) diff --git a/code/modules/asset_cache/assets/preferences.dm b/code/modules/asset_cache/assets/preferences.dm index 61b0ebcdee..dc99902ed7 100644 --- a/code/modules/asset_cache/assets/preferences.dm +++ b/code/modules/asset_cache/assets/preferences.dm @@ -1,4 +1,5 @@ /datum/asset/simple/preferences + var/preview_icons = 'icons/mob/human_races/preview.dmi' assets = list( "preview_protean_animation.gif" = 'icons/mob/human_races/preview_protean_animation.gif', "preview_custom_animation.gif" = 'icons/mob/human_races/preview_custom_animation.gif', diff --git a/code/modules/blob2/blobs/core.dm b/code/modules/blob2/blobs/core.dm index 11f1b2def3..c22e8ed7fb 100644 --- a/code/modules/blob2/blobs/core.dm +++ b/code/modules/blob2/blobs/core.dm @@ -1,4 +1,4 @@ -var/list/blob_cores = list() +GLOBAL_LIST_EMPTY(blob_cores) /obj/structure/blob/core name = "blob core" @@ -99,7 +99,7 @@ var/list/blob_cores = list() /obj/structure/blob/core/Initialize(mapload, client/new_overmind = null, new_rate = 2, placed = 0) . = ..() - blob_cores += src + GLOB.blob_cores += src START_PROCESSING(SSobj, src) update_icon() //so it atleast appears point_rate = new_rate @@ -117,7 +117,7 @@ var/list/blob_cores = list() var/turf/T = get_turf(src) new /obj/item/blobcore_chunk(T, overmind.blob_type) - blob_cores -= src + GLOB.blob_cores -= src if(overmind) overmind.blob_core = null qdel(overmind) diff --git a/code/modules/blob2/blobs/node.dm b/code/modules/blob2/blobs/node.dm index da984be9b5..71a65d4d55 100644 --- a/code/modules/blob2/blobs/node.dm +++ b/code/modules/blob2/blobs/node.dm @@ -1,4 +1,4 @@ -var/list/blob_nodes = list() +GLOBAL_LIST_EMPTY(blob_nodes) /obj/structure/blob/node name = "blob node" @@ -11,12 +11,12 @@ var/list/blob_nodes = list() /obj/structure/blob/node/Initialize(mapload, new_overmind) . = ..() - blob_nodes += src + GLOB.blob_nodes += src START_PROCESSING(SSobj, src) update_icon() /obj/structure/blob/node/Destroy() - blob_nodes -= src + GLOB.blob_nodes -= src STOP_PROCESSING(SSobj, src) return ..() diff --git a/code/modules/blob2/overmind/overmind.dm b/code/modules/blob2/overmind/overmind.dm index 930c99a439..0cc67b3161 100644 --- a/code/modules/blob2/overmind/overmind.dm +++ b/code/modules/blob2/overmind/overmind.dm @@ -1,4 +1,4 @@ -var/list/overminds = list() +GLOBAL_LIST_EMPTY(overminds) /mob/observer/blob name = "Blob Overmind" @@ -36,7 +36,7 @@ var/list/overminds = list() if(pre_placed) //we already have a core! placed = 1 - overminds += src + GLOB.overminds += src var/new_name = "[initial(name)] ([rand(1, 999)])" name = new_name real_name = new_name @@ -67,7 +67,7 @@ var/list/overminds = list() BM.overmind = null BM.update_icons() - overminds -= src + GLOB.overminds -= src return ..() /mob/observer/blob/get_status_tab_items() diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 6166480895..b294dac5b3 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -282,14 +282,14 @@ GLOBAL_LIST_INIT(blacklisted_builds, list( GLOB.tickets.ClientLogin(src) //preferences datum - also holds some persistant data for the client (because we may as well keep these datums to a minimum) - prefs = preferences_datums[ckey] + prefs = GLOB.preferences_datums[ckey] if(prefs) prefs.client = src prefs.load_savefile() // just to make sure we have the latest data prefs.apply_all_client_preferences() else prefs = new /datum/preferences(src) - preferences_datums[ckey] = prefs + GLOB.preferences_datums[ckey] = prefs prefs.last_ip = address //these are gonna be used for banning prefs.last_id = computer_id //these are gonna be used for banning diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 87e197dc1d..fbacb03ff9 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -1,6 +1,3 @@ -// Not actually used; just forces this into the RSC for TGUI. -var/const/preview_icons = 'icons/mob/human_races/preview.dmi' - /datum/preferences var/equip_preview_mob = EQUIP_PREVIEW_ALL var/animations_toggle = FALSE diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 4e682a3017..cddffabe03 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1,4 +1,4 @@ -var/list/preferences_datums = list() +GLOBAL_LIST_EMPTY(preferences_datums) /datum/preferences /// The path to the general savefile for this datum diff --git a/code/modules/economy/Events.dm b/code/modules/economy/Events.dm index 1b14f0b78c..0486df2215 100644 --- a/code/modules/economy/Events.dm +++ b/code/modules/economy/Events.dm @@ -8,7 +8,7 @@ var/datum/trade_destination/affected_dest /datum/event/economic_event/start() - affected_dest = pickweight(weighted_randomevent_locations) + affected_dest = pickweight(GLOB.weighted_randomevent_locations) if(affected_dest.viable_random_events.len) endWhen = rand(60,300) event_type = pick(affected_dest.viable_random_events) diff --git a/code/modules/economy/Events_Mundane.dm b/code/modules/economy/Events_Mundane.dm index a399742127..39c06c3a90 100644 --- a/code/modules/economy/Events_Mundane.dm +++ b/code/modules/economy/Events_Mundane.dm @@ -6,7 +6,7 @@ var/author = "Editor Mike Hammers" var/channel = "The Gibson Gazette" - var/datum/trade_destination/affected_dest = pick(weighted_mundaneevent_locations) + var/datum/trade_destination/affected_dest = pick(GLOB.weighted_mundaneevent_locations) var/body = pick( "Tree stuck in tajaran; firefighters baffled.",\ "Armadillos want aardvarks removed from dictionary claims 'here first'.",\ diff --git a/code/modules/economy/TradeDestinations.dm b/code/modules/economy/TradeDestinations.dm index 8225e34efc..fcb822073e 100644 --- a/code/modules/economy/TradeDestinations.dm +++ b/code/modules/economy/TradeDestinations.dm @@ -1,6 +1,6 @@ -var/list/weighted_randomevent_locations = list() -var/list/weighted_mundaneevent_locations = list() +GLOBAL_LIST_EMPTY(weighted_randomevent_locations) +GLOBAL_LIST_EMPTY(weighted_mundaneevent_locations) /datum/trade_destination var/name = "" diff --git a/code/modules/economy/economy_misc.dm b/code/modules/economy/economy_misc.dm index cc507fdfb7..5ae68ee9e5 100644 --- a/code/modules/economy/economy_misc.dm +++ b/code/modules/economy/economy_misc.dm @@ -36,8 +36,8 @@ GLOBAL_VAR_INIT(economy_init, 0) for(var/loc_type in subtypesof(/datum/trade_destination)) var/datum/trade_destination/D = new loc_type - weighted_randomevent_locations[D] = D.viable_random_events.len - weighted_mundaneevent_locations[D] = D.mundane_probability + GLOB.weighted_randomevent_locations[D] = D.viable_random_events.len + GLOB.weighted_mundaneevent_locations[D] = D.mundane_probability create_station_account() diff --git a/code/modules/emotes/definitions/_mob.dm b/code/modules/emotes/definitions/_mob.dm index 8651c933b1..a87a47ac98 100644 --- a/code/modules/emotes/definitions/_mob.dm +++ b/code/modules/emotes/definitions/_mob.dm @@ -1,4 +1,4 @@ -var/list/_default_mob_emotes = list( +GLOBAL_LIST_INIT(default_mob_emotes, list( /decl/emote/visible, /decl/emote/visible/scratch, /decl/emote/visible/drool, @@ -23,4 +23,4 @@ var/list/_default_mob_emotes = list( /decl/emote/audible/choke, /decl/emote/audible/moan, /decl/emote/audible/gnarl, -) +)) diff --git a/code/modules/emotes/emote_mob.dm b/code/modules/emotes/emote_mob.dm index 97c983fe3a..e40d68e5a6 100644 --- a/code/modules/emotes/emote_mob.dm +++ b/code/modules/emotes/emote_mob.dm @@ -4,7 +4,7 @@ var/last_emote_summary /mob/proc/get_available_emotes() - return global._default_mob_emotes.Copy() + return GLOB.default_mob_emotes.Copy() /mob/proc/can_emote(var/emote_type) return (stat == CONSCIOUS) diff --git a/code/modules/events/event_dynamic.dm b/code/modules/events/event_dynamic.dm index ca129224cd..56a8cb83b0 100644 --- a/code/modules/events/event_dynamic.dm +++ b/code/modules/events/event_dynamic.dm @@ -68,7 +68,7 @@ GLOBAL_LIST_EMPTY(event_last_fired) possibleEvents[/datum/event/electrical_storm] = 15 * active_with_role[JOB_JANITOR] + 5 * active_with_role[DEPARTMENT_ENGINEERING] possibleEvents[/datum/event/wallrot] = 30 * active_with_role[DEPARTMENT_ENGINEERING] + 50 * active_with_role[JOB_ALT_GARDENER] - if(!spacevines_spawned) + if(!GLOB.spacevines_spawned) possibleEvents[/datum/event/spacevine] = 10 + 5 * active_with_role[DEPARTMENT_ENGINEERING] if(minutes_passed >= 30) // Give engineers time to set up engine possibleEvents[/datum/event/meteor_wave] = 10 * active_with_role[DEPARTMENT_ENGINEERING] @@ -80,7 +80,7 @@ GLOBAL_LIST_EMPTY(event_last_fired) possibleEvents[/datum/event/prison_break] = active_with_role[DEPARTMENT_SECURITY] * 50 if(active_with_role[DEPARTMENT_SECURITY] > 0) - if(!sent_spiders_to_station) + if(!GLOB.sent_spiders_to_station) possibleEvents[/datum/event/spider_infestation] = max(active_with_role[DEPARTMENT_SECURITY], 5) + 5 possibleEvents[/datum/event/random_antag] = max(active_with_role[DEPARTMENT_SECURITY], 5) + 2.5 diff --git a/code/modules/events/meteors.dm b/code/modules/events/meteors.dm index b6979932a1..a5765228c0 100644 --- a/code/modules/events/meteors.dm +++ b/code/modules/events/meteors.dm @@ -70,13 +70,13 @@ /datum/event/meteor_wave/proc/get_meteors() switch(severity) if(EVENT_LEVEL_MAJOR) - return meteors_major + return GLOB.meteors_major if(EVENT_LEVEL_MODERATE) - return meteors_moderate + return GLOB.meteors_moderate else - return meteors_minor + return GLOB.meteors_minor -/var/list/meteors_minor = list( +GLOBAL_LIST_INIT(meteors_minor, list( /obj/effect/meteor/medium = 80, /obj/effect/meteor/dust = 30, /obj/effect/meteor/irradiated = 30, @@ -84,9 +84,9 @@ /obj/effect/meteor/flaming = 10, ///obj/effect/meteor/golden = 10, ///obj/effect/meteor/silver = 10, -) +)) -/var/list/meteors_moderate = list( +GLOBAL_LIST_INIT(meteors_moderate, list( /obj/effect/meteor/medium = 80, /obj/effect/meteor/big = 30, /obj/effect/meteor/dust = 30, @@ -95,9 +95,9 @@ ///obj/effect/meteor/golden = 10, ///obj/effect/meteor/silver = 10, /obj/effect/meteor/emp = 10, -) +)) -/var/list/meteors_major = list( +GLOBAL_LIST_INIT(meteors_major, list( /obj/effect/meteor/medium = 80, /obj/effect/meteor/big = 30, /obj/effect/meteor/dust = 30, @@ -107,7 +107,7 @@ ///obj/effect/meteor/golden = 10, ///obj/effect/meteor/silver = 10, /obj/effect/meteor/tunguska = 1, -) +)) // Overmap version /datum/event/meteor_wave/overmap diff --git a/code/modules/events/money_hacker.dm b/code/modules/events/money_hacker.dm index 0cdc2b452d..bd33859e18 100644 --- a/code/modules/events/money_hacker.dm +++ b/code/modules/events/money_hacker.dm @@ -1,5 +1,3 @@ -//var/global/account_hack_attempted = 0 - GLOBAL_VAR_INIT(account_hack_attempted, 0) /datum/event/money_hacker diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 48c9b91c22..de8e4d825e 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -1,11 +1,11 @@ -/var/global/spacevines_spawned = 0 +GLOBAL_VAR_INIT(spacevines_spawned, 0) /datum/event/spacevine announceWhen = 60 /datum/event/spacevine/start() spacevine_infestation() - spacevines_spawned = 1 + GLOB.spacevines_spawned = 1 /datum/event/spacevine/announce() level_seven_announcement() diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index d553ba499b..0bf3eedf86 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -1,4 +1,4 @@ -/var/global/sent_spiders_to_station = 0 +GLOBAL_VAR_INIT(sent_spiders_to_station, 0) /datum/event/spider_infestation announceWhen = 90 @@ -8,7 +8,7 @@ /datum/event/spider_infestation/setup() announceWhen = rand(announceWhen, announceWhen + 60) spawncount = rand(4 * severity, 6 * severity) //spiderlings only have a 50% chance to grow big and strong - sent_spiders_to_station = 0 + GLOB.sent_spiders_to_station = 0 /datum/event/spider_infestation/announce() command_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg') diff --git a/code/modules/food/food/snacks/meat.dm b/code/modules/food/food/snacks/meat.dm index 231d48f3b4..920a12a92e 100644 --- a/code/modules/food/food/snacks/meat.dm +++ b/code/modules/food/food/snacks/meat.dm @@ -166,7 +166,7 @@ reagents.add_reagent(REAGENT_ID_SHOCKCHEM, 6) bitesize = 6 -var/static/list/worm_meat_spawns = list ( +GLOBAL_LIST_INIT(worm_meat_spawns, list ( /obj/random/junk = 30, /obj/random/trash = 30, /obj/random/maintenance/clean = 15, @@ -180,7 +180,7 @@ var/static/list/worm_meat_spawns = list ( /obj/random/handgun = 1, /obj/random/toolbox = 4, /obj/random/drinkbottle = 5 -) +)) /obj/item/reagent_containers/food/snacks/meat/worm name = "weird meat" @@ -200,7 +200,7 @@ var/static/list/worm_meat_spawns = list ( /obj/item/reagent_containers/food/snacks/meat/worm/attackby(obj/item/W as obj, mob/user as mob) if(istype(W,/obj/item/material/knife)) - var/to_spawn = pickweight(worm_meat_spawns) + var/to_spawn = pickweight(GLOB.worm_meat_spawns) new to_spawn(get_turf(src)) diff --git a/code/modules/gamemaster/event2/event.dm b/code/modules/gamemaster/event2/event.dm index bc99179f17..c65a05ccd4 100644 --- a/code/modules/gamemaster/event2/event.dm +++ b/code/modules/gamemaster/event2/event.dm @@ -102,7 +102,7 @@ This allows for events that have their announcement happen after the end itself. /datum/event2/event/proc/find_random_areas(list/specific_areas = list(), ignore_occupancy = FALSE) if(!LAZYLEN(specific_areas)) - specific_areas = global.the_station_areas.Copy() + specific_areas = GLOB.the_station_areas.Copy() var/list/area/grand_list_of_areas = get_all_existing_areas_of_types(specific_areas) . = list() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 77f1adb596..01bcab47b6 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -32,6 +32,7 @@ var/rest_dir = 0 //To lay down in a specific direction var/list/datum/genetics/side_effect/genetic_side_effects = list() //For any genetic side effects we currently have. + var/last_chew = 0 /mob/living/carbon/human/Initialize(mapload, var/new_species = null) if(!dna) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index ff92d847fc..7219cc94ca 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1,7 +1,7 @@ #define AI_CHECK_WIRELESS 1 #define AI_CHECK_RADIO 2 -var/list/ai_verbs_default = list( +GLOBAL_LIST_INIT(ai_verbs_default, list( // /mob/living/silicon/ai/proc/ai_recall_shuttle, /mob/living/silicon/ai/proc/ai_emergency_message, /mob/living/silicon/ai/proc/ai_goto_location, @@ -27,7 +27,7 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/proc/delete_images, /mob/living/silicon/ai/proc/toggle_multicam_verb, /mob/living/silicon/ai/proc/add_multicam_verb -) +)) //Not sure why this is necessary... /proc/AutoUpdateAI(obj/subject) @@ -99,11 +99,11 @@ var/list/ai_verbs_default = list( can_be_antagged = TRUE /mob/living/silicon/ai/proc/add_ai_verbs() - add_verb(src, ai_verbs_default) + add_verb(src, GLOB.ai_verbs_default) add_verb(src, silicon_subsystems) /mob/living/silicon/ai/proc/remove_ai_verbs() - remove_verb(src, ai_verbs_default) + remove_verb(src, GLOB.ai_verbs_default) remove_verb(src, silicon_subsystems) /mob/living/silicon/ai/Initialize(mapload, is_decoy, datum/ai_laws/L, obj/item/mmi/B, safety = FALSE) @@ -286,7 +286,7 @@ var/list/ai_verbs_default = list( custom_sprite = 1 selected_sprite = new/datum/ai_icon("Custom", "[src.ckey]-ai", "4", "[ckey]-ai-crash", "#FFFFFF", "#FFFFFF", "#FFFFFF") else - selected_sprite = default_ai_icon + selected_sprite = GLOB.default_ai_icon update_icon() /mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view()) @@ -362,7 +362,7 @@ var/list/ai_verbs_default = list( return if (!custom_sprite) - var/new_sprite = tgui_input_list(src, "Select an icon!", "AI", ai_icons) + var/new_sprite = tgui_input_list(src, "Select an icon!", "AI", GLOB.ai_icons) if(new_sprite) selected_sprite = new_sprite update_icon() @@ -903,7 +903,7 @@ var/list/ai_verbs_default = list( ..() /mob/living/silicon/ai/update_icon() - if(!selected_sprite) selected_sprite = default_ai_icon + if(!selected_sprite) selected_sprite = GLOB.default_ai_icon if(stat == DEAD) icon_state = selected_sprite.dead_icon diff --git a/code/modules/mob/living/silicon/ai/icons.dm b/code/modules/mob/living/silicon/ai/icons.dm index 57d02f8a56..f1d5ab27f0 100644 --- a/code/modules/mob/living/silicon/ai/icons.dm +++ b/code/modules/mob/living/silicon/ai/icons.dm @@ -1,5 +1,5 @@ -var/datum/ai_icon/default_ai_icon = new/datum/ai_icon/blue() -var/list/datum/ai_icon/ai_icons +GLOBAL_DATUM_INIT(default_ai_icon, /datum/ai_icon, new/datum/ai_icon/blue()) +GLOBAL_LIST_INIT_TYPED(ai_icons, /datum/ai_icon, init_subtypes(/datum/ai_icon, ai_icons)) /datum/ai_icon var/name @@ -19,9 +19,6 @@ var/list/datum/ai_icon/ai_icons src.alive_light = alive_light src.nopower_light = nopower_light src.dead_light = dead_light - if(!ai_icons) - ai_icons = list() - init_subtypes(/datum/ai_icon, ai_icons) ..() /datum/ai_icon/red diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm index d42f1e147a..98dbf6120f 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/pets/cat.dm @@ -1,4 +1,4 @@ -var/list/_cat_default_emotes = list( +GLOBAL_LIST_INIT(cat_default_emotes, list( /decl/emote/visible, /decl/emote/visible/scratch, /decl/emote/visible/drool, @@ -25,7 +25,7 @@ var/list/_cat_default_emotes = list( /decl/emote/audible/gnarl, /decl/emote/audible/purr, /decl/emote/audible/purrlong -) +)) /mob/living/simple_mob/animal/passive/cat name = "cat" @@ -60,7 +60,7 @@ var/list/_cat_default_emotes = list( return ..() /mob/living/simple_mob/animal/passive/cat/get_available_emotes() - return global._cat_default_emotes.Copy() + return GLOB.cat_default_emotes.Copy() /mob/living/simple_mob/animal/passive/cat/handle_special() if(!stat && prob(2)) // spooky diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka.dm index e12e9a9bd5..6233754c23 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka.dm @@ -89,7 +89,7 @@ Field studies suggest analytical abilities on par with some species of cepholapo to_chat(target, span_notice("You hear an eerie howl from somewhere to the [dir2text(direction)].")) /mob/living/simple_mob/animal/sif/grafadreka/get_available_emotes() - . = global._default_mob_emotes.Copy() + . = GLOB.default_mob_emotes.Copy() if(!is_baby) . |= /decl/emote/audible/drake_howl return diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index bfefaf587f..ab1dee10bf 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -218,8 +218,8 @@ GLOBAL_LIST_EMPTY(limb_icon_cache) // damage amount to represent the pain of the injuries involved. // Global scope, used in code below. -var/list/flesh_hud_colours = list("#02BA08","#9ECF19","#DEDE10","#FFAA00","#FF0000","#AA0000","#660000") -var/list/robot_hud_colours = list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F4F","#2F2F2F","#000000") +GLOBAL_LIST_INIT(flesh_hud_colours, list("#02BA08","#9ECF19","#DEDE10","#FFAA00","#FF0000","#AA0000","#660000")) +GLOBAL_LIST_INIT(robot_hud_colours, list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F4F","#2F2F2F","#000000")) /obj/item/organ/external/proc/get_damage_hud_image(var/min_dam_state) @@ -254,6 +254,6 @@ var/list/robot_hud_colours = list("#CFCFCF","#AFAFAF","#8F8F8F","#6F6F6F","#4F4F if(!isnull(min_dam_state) && dam_state < min_dam_state) dam_state = min_dam_state // Apply colour and return product. - var/list/hud_colours = (robotic < ORGAN_ROBOT) ? flesh_hud_colours : robot_hud_colours + var/list/hud_colours = (robotic < ORGAN_ROBOT) ? GLOB.flesh_hud_colours : GLOB.robot_hud_colours hud_damage_image.color = hud_colours[max(1,min(CEILING(dam_state*hud_colours.len, 1),hud_colours.len))] return hud_damage_image diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index 821c6386d6..9104fbfedd 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -189,19 +189,19 @@ if(CONFIG_GET(flag/ert_admin_call_only)) return 1 return SSticker.mode && SSticker.mode.ert_disabled -var/global/maint_all_access = 0 +GLOBAL_VAR_INIT(maint_all_access, FALSE) /proc/make_maint_all_access() - maint_all_access = 1 + GLOB.maint_all_access = TRUE to_chat(world, span_alert(span_red(span_huge("Attention!")))) to_chat(world, span_alert(span_red("The maintenance access requirement has been revoked on all airlocks."))) /proc/revoke_maint_all_access() - maint_all_access = 0 + GLOB.maint_all_access = FALSE to_chat(world, span_alert(span_red(span_huge("Attention!")))) to_chat(world, span_alert(span_red("The maintenance access requirement has been readded on all maintenance airlocks."))) /obj/machinery/door/airlock/allowed(mob/M) - if(maint_all_access && src.check_access_list(list(ACCESS_MAINT_TUNNELS))) + if(GLOB.maint_all_access && src.check_access_list(list(ACCESS_MAINT_TUNNELS))) return 1 return ..(M) diff --git a/code/modules/vore/persist/persist_vr.dm b/code/modules/vore/persist/persist_vr.dm index b8b654bf54..7e821fbde5 100644 --- a/code/modules/vore/persist/persist_vr.dm +++ b/code/modules/vore/persist/persist_vr.dm @@ -49,7 +49,7 @@ // Find out of this mob is a proper mob! if (persister.mind && persister.mind.loaded_from_ckey) // Okay this mob has a real loaded-from-savefile mind in it! - var/datum/preferences/prefs = preferences_datums[persister.mind.loaded_from_ckey] + var/datum/preferences/prefs = GLOB.preferences_datums[persister.mind.loaded_from_ckey] if(!prefs) WARNING("Persist (P4P): [persister.mind] was loaded from ckey [persister.mind.loaded_from_ckey] but no prefs datum found.") return