diff --git a/_maps/map_files/OmegaStation/job_changes.dm b/_maps/map_files/OmegaStation/job_changes.dm index 1aa52e6eace63..dc6a461432f66 100644 --- a/_maps/map_files/OmegaStation/job_changes.dm +++ b/_maps/map_files/OmegaStation/job_changes.dm @@ -38,8 +38,8 @@ MAP_JOB_CHECK total_positions = 3 spawn_positions = 3 - access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue, access_weapons, access_forensics_lockers) - minimal_access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue, access_weapons, access_forensics_lockers) + access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_maint_tunnels, GLOB.access_morgue, GLOB.access_weapons, GLOB.access_forensics_lockers) + minimal_access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_maint_tunnels, GLOB.access_morgue, GLOB.access_weapons, GLOB.access_forensics_lockers) /datum/outfit/job/officer/New() ..() @@ -49,8 +49,8 @@ /datum/job/detective/New() ..() MAP_JOB_CHECK - access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue, access_weapons, access_forensics_lockers) - minimal_access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue, access_weapons, access_forensics_lockers) + access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_maint_tunnels, GLOB.access_morgue, GLOB.access_weapons, GLOB.access_forensics_lockers) + minimal_access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_maint_tunnels, GLOB.access_morgue, GLOB.access_weapons, GLOB.access_forensics_lockers) /datum/outfit/job/detective/New() ..() @@ -65,8 +65,8 @@ selection_color = "#ffffff" total_positions = 3 spawn_positions = 3 - access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics) - minimal_access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics) + access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_surgery, GLOB.access_chemistry, GLOB.access_virology, GLOB.access_genetics) + minimal_access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_surgery, GLOB.access_chemistry, GLOB.access_virology, GLOB.access_genetics) //Engineering @@ -75,8 +75,8 @@ MAP_JOB_CHECK total_positions = 2 spawn_positions = 2 - access = list(access_eva, access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction, access_atmospherics, access_tcomsat) - minimal_access = list(access_eva, access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_external_airlocks, access_construction, access_atmospherics, access_tcomsat) + access = list(GLOB.access_eva, GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_tech_storage, GLOB.access_maint_tunnels, GLOB.access_external_airlocks, GLOB.access_construction, GLOB.access_atmospherics, GLOB.access_tcomsat) + minimal_access = list(GLOB.access_eva, GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_tech_storage, GLOB.access_maint_tunnels, GLOB.access_external_airlocks, GLOB.access_construction, GLOB.access_atmospherics, GLOB.access_tcomsat) /datum/outfit/job/engineer/New() ..() @@ -96,8 +96,8 @@ MAP_JOB_CHECK total_positions = 3 spawn_positions = 3 - access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_mineral_storeroom, access_tech_storage) - minimal_access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_mineral_storeroom, access_tech_storage) + access = list(GLOB.access_robotics, GLOB.access_tox, GLOB.access_tox_storage, GLOB.access_research, GLOB.access_xenobiology, GLOB.access_mineral_storeroom, GLOB.access_tech_storage) + minimal_access = list(GLOB.access_robotics, GLOB.access_tox, GLOB.access_tox_storage, GLOB.access_research, GLOB.access_xenobiology, GLOB.access_mineral_storeroom, GLOB.access_tech_storage) //Cargo @@ -106,16 +106,16 @@ MAP_JOB_CHECK total_positions = 2 spawn_positions = 2 - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) - minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) + access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) /datum/job/mining/New() ..() MAP_JOB_CHECK total_positions = 2 spawn_positions = 2 - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) - minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) + access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) /datum/outfit/job/mining/New() ..() @@ -126,27 +126,27 @@ /datum/job/bartender/New() ..() MAP_JOB_CHECK - access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_weapons) - minimal_access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_weapons) + access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_weapons) + minimal_access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_weapons) /datum/job/cook/New() ..() MAP_JOB_CHECK - access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_weapons) - minimal_access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_weapons) + access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_weapons) + minimal_access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_weapons) /datum/job/hydro/New() ..() MAP_JOB_CHECK - access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_maint_tunnels) - minimal_access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_maint_tunnels) + access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_maint_tunnels) + minimal_access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_maint_tunnels) // they get maint access because of all the hydro content in maint /datum/job/janitor/New() ..() MAP_JOB_CHECK - access = list(access_janitor, access_hydroponics, access_bar, access_kitchen, access_morgue, access_maint_tunnels) - minimal_access = list(access_janitor, access_hydroponics, access_bar, access_kitchen, access_morgue, access_maint_tunnels) + access = list(GLOB.access_janitor, GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_maint_tunnels) + minimal_access = list(GLOB.access_janitor, GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_maint_tunnels) //Civilian diff --git a/_maps/map_files/PubbyStation/job_changes.dm b/_maps/map_files/PubbyStation/job_changes.dm index 8693063def066..8b26cd5b68022 100644 --- a/_maps/map_files/PubbyStation/job_changes.dm +++ b/_maps/map_files/PubbyStation/job_changes.dm @@ -3,20 +3,20 @@ /datum/job/hos/New() ..() MAP_JOB_CHECK - access += access_crematorium - minimal_access += access_crematorium + access += GLOB.access_crematorium + minimal_access += GLOB.access_crematorium /datum/job/warden/New() ..() MAP_JOB_CHECK - access += access_crematorium - minimal_access += access_crematorium + access += GLOB.access_crematorium + minimal_access += GLOB.access_crematorium /datum/job/officer/New() ..() MAP_JOB_CHECK - access += access_crematorium - minimal_access += access_crematorium + access += GLOB.access_crematorium + minimal_access += GLOB.access_crematorium MAP_REMOVE_JOB(librarian) MAP_REMOVE_JOB(lawyer) \ No newline at end of file diff --git a/code/__DATASTRUCTURES/globals.dm b/code/__DATASTRUCTURES/globals.dm new file mode 100644 index 0000000000000..3dddf942c5824 --- /dev/null +++ b/code/__DATASTRUCTURES/globals.dm @@ -0,0 +1,37 @@ +//See controllers/globals.dm +#define GLOBAL_MANAGED(X, InitValue)\ +/datum/controller/global_vars/proc/InitGlobal##X(){\ + ##X = ##InitValue;\ + gvars_datum_init_order += #X;\ +} +#define GLOBAL_UNMANAGED(X, InitValue) /datum/controller/global_vars/proc/InitGlobal##X() + +#ifndef TESTING +#define GLOBAL_PROTECT(X)\ +/datum/controller/global_vars/InitGlobal##X(){\ + ..();\ + gvars_datum_protected_varlist += #X;\ +} +#else +#define GLOBAL_PROTECT(X) +#endif + +#define GLOBAL_REAL(X, Typepath) var/global##Typepath/##X + +#define GLOBAL_RAW(X) /datum/controller/global_vars/var/global##X + +#define GLOBAL_VAR_INIT(X, InitValue) GLOBAL_RAW(/##X); GLOBAL_MANAGED(X, InitValue) + +#define GLOBAL_VAR_CONST(X, InitValue) GLOBAL_RAW(/const/##X) = InitValue; GLOBAL_UNMANAGED(X, InitValue) + +#define GLOBAL_LIST_INIT(X, InitValue) GLOBAL_RAW(/list/##X); GLOBAL_MANAGED(X, InitValue) + +#define GLOBAL_LIST_EMPTY(X) GLOBAL_LIST_INIT(X, list()) + +#define GLOBAL_DATUM_INIT(X, Typepath, InitValue) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, InitValue) + +#define GLOBAL_VAR(X) GLOBAL_RAW(/##X); GLOBAL_MANAGED(X, null) + +#define GLOBAL_LIST(X) GLOBAL_RAW(/list/##X); GLOBAL_MANAGED(X, null) + +#define GLOBAL_DATUM(X, Typepath) GLOBAL_RAW(Typepath/##X); GLOBAL_MANAGED(X, null) \ No newline at end of file diff --git a/code/__DEFINES/MC.dm b/code/__DEFINES/MC.dm index 5a368e586f893..130e3dd671c64 100644 --- a/code/__DEFINES/MC.dm +++ b/code/__DEFINES/MC.dm @@ -1,4 +1,4 @@ -#define MC_TICK_CHECK ( ( world.tick_usage > CURRENT_TICKLIMIT || src.state != SS_RUNNING ) ? pause() : 0 ) +#define MC_TICK_CHECK ( ( world.tick_usage > GLOB.CURRENT_TICKLIMIT || src.state != SS_RUNNING ) ? pause() : 0 ) // Used to smooth out costs to try and avoid oscillation. #define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current)) #define MC_AVERAGE(average, current) (0.8 * (average) + 0.2 * (current)) @@ -52,14 +52,14 @@ #define SS_SLEEPING 4 //fire() slept. #define SS_PAUSING 5 //in the middle of pausing -#define SUBSYSTEM_DEF(X) var/datum/controller/subsystem/##X/SS##X;\ +#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\ /datum/controller/subsystem/##X/New(){\ NEW_SS_GLOBAL(SS##X);\ PreInit();\ }\ /datum/controller/subsystem/##X -#define PROCESSING_SUBSYSTEM_DEF(X) var/datum/controller/subsystem/processing/##X/SS##X;\ +#define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\ /datum/controller/subsystem/processing/##X/New(){\ NEW_SS_GLOBAL(SS##X);\ PreInit();\ diff --git a/code/__DEFINES/clockcult.dm b/code/__DEFINES/clockcult.dm index ea0922dd8cd14..9c86e031abc7b 100644 --- a/code/__DEFINES/clockcult.dm +++ b/code/__DEFINES/clockcult.dm @@ -5,17 +5,17 @@ #define REPLICANT_ALLOY "replicant_alloy" #define HIEROPHANT_ANSIBLE "hierophant_ansible" -var/global/clockwork_construction_value = 0 //The total value of all structures built by the clockwork cult -var/global/clockwork_caches = 0 //How many clockwork caches exist in the world (not each individual) -var/global/clockwork_daemons = 0 //How many daemons exist in the world -var/global/list/clockwork_generals_invoked = list("nezbere" = FALSE, "sevtug" = FALSE, "nzcrentr" = FALSE, "inath-neq" = FALSE) //How many generals have been recently invoked -var/global/list/all_clockwork_objects = list() //All clockwork items, structures, and effects in existence -var/global/list/all_clockwork_mobs = list() //All clockwork SERVANTS (not creatures) in existence -var/global/list/clockwork_component_cache = list(BELLIGERENT_EYE = 0, VANGUARD_COGWHEEL = 0, GEIS_CAPACITOR = 0, REPLICANT_ALLOY = 0, HIEROPHANT_ANSIBLE = 0) //The pool of components that caches draw from -var/global/ratvar_awakens = 0 //If Ratvar has been summoned; not a boolean, for proper handling of multiple Ratvars -var/global/nezbere_invoked = 0 //If Nezbere has been invoked; not a boolean, for proper handling of multiple Nezberes -var/global/clockwork_gateway_activated = FALSE //if a gateway to the celestial derelict has ever been successfully activated -var/global/list/all_scripture = list() //a list containing scripture instances; not used to track existing scripture +GLOBAL_VAR_INIT(clockwork_construction_value, 0) //The total value of all structures built by the clockwork cult +GLOBAL_VAR_INIT(clockwork_caches, 0) //How many clockwork caches exist in the world (not each individual) +GLOBAL_VAR_INIT(clockwork_daemons, 0) //How many daemons exist in the world +GLOBAL_LIST_INIT(clockwork_generals_invoked, list("nezbere" = FALSE, "sevtug" = FALSE, "nzcrentr" = FALSE, "inath-neq" = FALSE)) //How many generals have been recently invoked +GLOBAL_LIST_EMPTY(all_clockwork_objects) //All clockwork items, structures, and effects in existence +GLOBAL_LIST_EMPTY(all_clockwork_mobs) //All clockwork SERVANTS (not creatures) in existence +GLOBAL_LIST_INIT(clockwork_component_cache, list(BELLIGERENT_EYE = 0, VANGUARD_COGWHEEL = 0, GEIS_CAPACITOR = 0, REPLICANT_ALLOY = 0, HIEROPHANT_ANSIBLE = 0)) //The pool of components that caches draw from +GLOBAL_VAR_INIT(ratvar_awakens, 0) //If Ratvar has been summoned; not a boolean, for proper handling of multiple Ratvars +GLOBAL_VAR_INIT(nezbere_invoked, 0) //If Nezbere has been invoked; not a boolean, for proper handling of multiple Nezberes +GLOBAL_VAR_INIT(clockwork_gateway_activated, FALSE) //if a gateway to the celestial derelict has ever been successfully activated +GLOBAL_LIST_EMPTY(all_scripture) //a list containing scripture instances; not used to track existing scripture //Scripture tiers and requirements; peripherals should never be used #define SCRIPTURE_PERIPHERAL "Peripheral" diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 372deb5b36d73..097538c59029c 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -122,13 +122,13 @@ #define isorgan(A) (istype(A, /obj/item/organ)) -var/list/static/global/pointed_types = typecacheof(list( +GLOBAL_LIST_INIT(pointed_types, typecacheof(list( /obj/item/weapon/pen, /obj/item/weapon/screwdriver, /obj/item/weapon/reagent_containers/syringe, - /obj/item/weapon/kitchen/fork)) + /obj/item/weapon/kitchen/fork))) -#define is_pointed(W) (is_type_in_typecache(W, pointed_types)) +#define is_pointed(W) (is_type_in_typecache(W, GLOB.pointed_types)) #define isbodypart(A) (istype(A, /obj/item/bodypart)) diff --git a/code/__DEFINES/jobs.dm b/code/__DEFINES/jobs.dm new file mode 100644 index 0000000000000..d719d087a2716 --- /dev/null +++ b/code/__DEFINES/jobs.dm @@ -0,0 +1,43 @@ + +#define ENGSEC (1<<0) + +#define CAPTAIN (1<<0) +#define HOS (1<<1) +#define WARDEN (1<<2) +#define DETECTIVE (1<<3) +#define OFFICER (1<<4) +#define CHIEF (1<<5) +#define ENGINEER (1<<6) +#define ATMOSTECH (1<<7) +#define ROBOTICIST (1<<8) +#define AI_JF (1<<9) +#define CYBORG (1<<10) + + +#define MEDSCI (1<<1) + +#define RD_JF (1<<0) +#define SCIENTIST (1<<1) +#define CHEMIST (1<<2) +#define CMO_JF (1<<3) +#define DOCTOR (1<<4) +#define GENETICIST (1<<5) +#define VIROLOGIST (1<<6) + + +#define CIVILIAN (1<<2) + +#define HOP (1<<0) +#define BARTENDER (1<<1) +#define BOTANIST (1<<2) +#define COOK (1<<3) +#define JANITOR (1<<4) +#define LIBRARIAN (1<<5) +#define QUARTERMASTER (1<<6) +#define CARGOTECH (1<<7) +#define MINER (1<<8) +#define LAWYER (1<<9) +#define CHAPLAIN (1<<10) +#define CLOWN (1<<11) +#define MIME (1<<12) +#define ASSISTANT (1<<13) \ No newline at end of file diff --git a/code/__DEFINES/machines.dm b/code/__DEFINES/machines.dm index 00c75c7cf3871..26105a8696464 100644 --- a/code/__DEFINES/machines.dm +++ b/code/__DEFINES/machines.dm @@ -63,3 +63,6 @@ #define PROGRAM_STATE_KILLED 0 #define PROGRAM_STATE_BACKGROUND 1 #define PROGRAM_STATE_ACTIVE 2 + +#define FIREDOOR_OPEN 1 +#define FIREDOOR_CLOSED 2 \ No newline at end of file diff --git a/code/__DEFINES/math.dm b/code/__DEFINES/math.dm index 738360bc08721..cb86b82efe9dd 100644 --- a/code/__DEFINES/math.dm +++ b/code/__DEFINES/math.dm @@ -22,4 +22,4 @@ //time of day but automatically adjusts to the server going into the next day within the same round. //for when you need a reliable time number that doesn't depend on byond time. #define REALTIMEOFDAY (world.timeofday + (MIDNIGHT_ROLLOVER * MIDNIGHT_ROLLOVER_CHECK)) -#define MIDNIGHT_ROLLOVER_CHECK ( rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : midnight_rollovers ) +#define MIDNIGHT_ROLLOVER_CHECK ( GLOB.rollovercheck_last_timeofday != world.timeofday ? update_midnight_rollover() : GLOB.midnight_rollovers ) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index d14a2b16a5979..82661f00c9e6f 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -182,7 +182,7 @@ //Key: //"entered-[blood_state]-[dir_of_image]" //or: "exited-[blood_state]-[dir_of_image]" -var/list/bloody_footprints_cache = list() +GLOBAL_LIST_EMPTY(bloody_footprints_cache) //Bloody shoes/footprints #define MAX_SHOE_BLOODINESS 100 @@ -247,7 +247,7 @@ var/list/bloody_footprints_cache = list() #define GHOST_ACCS_DEFAULT_OPTION GHOST_ACCS_FULL -var/global/list/ghost_accs_options = list(GHOST_ACCS_NONE, GHOST_ACCS_DIR, GHOST_ACCS_FULL) //So save files can be sanitized properly. +GLOBAL_LIST_INIT(ghost_accs_options, list(GHOST_ACCS_NONE, GHOST_ACCS_DIR, GHOST_ACCS_FULL)) //So save files can be sanitized properly. #define GHOST_OTHERS_SIMPLE 1 #define GHOST_OTHERS_DEFAULT_SPRITE 50 @@ -263,7 +263,7 @@ var/global/list/ghost_accs_options = list(GHOST_ACCS_NONE, GHOST_ACCS_DIR, GHOST #define GHOST_MAX_VIEW_RANGE_MEMBER 14 -var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DEFAULT_SPRITE, GHOST_OTHERS_THEIR_SETTING) //Same as ghost_accs_options. +GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DEFAULT_SPRITE, GHOST_OTHERS_THEIR_SETTING)) //Same as ghost_accs_options. //Color Defines #define OOC_COLOR "#002eb8" @@ -326,9 +326,9 @@ var/global/list/ghost_others_options = list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define SHELTER_DEPLOY_ANCHORED_OBJECTS "anchored objects" //debug printing macros -#define debug_world(msg) if (Debug2) to_chat(world, "DEBUG: [msg]") -#define debug_admins(msg) if (Debug2) to_chat(admins, "DEBUG: [msg]") -#define debug_world_log(msg) if (Debug2) log_world("DEBUG: [msg]") +#define debug_world(msg) if (GLOB.Debug2) to_chat(world, "DEBUG: [msg]") +#define debug_admins(msg) if (GLOB.Debug2) to_chat(GLOB.admins, "DEBUG: [msg]") +#define debug_world_log(msg) if (GLOB.Debug2) log_world("DEBUG: [msg]") #define COORD(A) "([A.x],[A.y],[A.z])" #define INCREMENT_TALLY(L, stat) if(L[stat]){L[stat]++}else{L[stat] = 1} diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 2d847f39b57cd..28e4a262fdc4c 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -107,4 +107,13 @@ #define INDIVIDUAL_SAY_LOG "Say log" #define INDIVIDUAL_EMOTE_LOG "Emote log" #define INDIVIDUAL_OOC_LOG "OOC log" -#define INDIVIDUAL_SHOW_ALL_LOG "All logs" \ No newline at end of file +#define INDIVIDUAL_SHOW_ALL_LOG "All logs" + +#define TK_MAXRANGE 15 + +#define NO_SLIP_WHEN_WALKING 1 +#define SLIDE 2 +#define GALOSHES_DONT_HELP 4 +#define SLIDE_ICE 8 + +#define MAX_CHICKENS 50 \ No newline at end of file diff --git a/code/__DEFINES/reagents.dm b/code/__DEFINES/reagents.dm index 2cd950b92d99e..6df0514b0aea7 100644 --- a/code/__DEFINES/reagents.dm +++ b/code/__DEFINES/reagents.dm @@ -3,4 +3,10 @@ #define GAS 3 #define OPENCONTAINER 4096 // is an open container for chemistry purposes -#define TRANSPARENT 8192 //Used for non-open containers which you still want to be able to see the reagents off. \ No newline at end of file +#define TRANSPARENT 8192 //Used for non-open containers which you still want to be able to see the reagents off. + +#define TOUCH 1 //splashing +#define INGEST 2 //ingestion +#define VAPOR 3 //foam, spray, blob attack +#define PATCH 4 //patches +#define INJECT 5 //injection \ No newline at end of file diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index 94995eeb23e08..dc9fbe6fe3b42 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -28,7 +28,7 @@ //Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR. //The gamemode specific ones are just so the gamemodes can query whether a player is old enough //(in game days played) to play that role -var/global/list/special_roles = list( +GLOBAL_LIST_INIT(special_roles, list( ROLE_TRAITOR = /datum/game_mode/traitor, ROLE_OPERATIVE = /datum/game_mode/nuclear, ROLE_CHANGELING = /datum/game_mode/changeling, @@ -47,7 +47,7 @@ var/global/list/special_roles = list( ROLE_DEVIL = /datum/game_mode/devil, ROLE_SERVANT_OF_RATVAR = /datum/game_mode/clockwork_cult, ROLE_BORER, -) +)) //Job defines for what happens when you fail to qualify for any job during job selection #define BEASSISTANT 1 diff --git a/code/__DEFINES/shuttles.dm b/code/__DEFINES/shuttles.dm index ea52fb21aeabb..a133816f2d5a1 100644 --- a/code/__DEFINES/shuttles.dm +++ b/code/__DEFINES/shuttles.dm @@ -43,4 +43,6 @@ #define HYPERSPACE_WARMUP 1 #define HYPERSPACE_LAUNCH 2 -#define HYPERSPACE_END 3 \ No newline at end of file +#define HYPERSPACE_END 3 + +#define CALL_SHUTTLE_REASON_LENGTH 12 \ No newline at end of file diff --git a/code/__DEFINES/sound.dm b/code/__DEFINES/sound.dm index 8055d7337ed19..6cc0f3028719e 100644 --- a/code/__DEFINES/sound.dm +++ b/code/__DEFINES/sound.dm @@ -5,4 +5,4 @@ //THIS SHOULD ALWAYS BE THE LOWEST ONE! //KEEP IT UPDATED -#define CHANNEL_HIGHEST_AVAILABLE 1021 \ No newline at end of file +#define CHANNEL_HIGHEST_AVAILABLE 1021 diff --git a/code/__DEFINES/tick.dm b/code/__DEFINES/tick.dm index 3fa6e21bf3c01..0c8c17da6f543 100644 --- a/code/__DEFINES/tick.dm +++ b/code/__DEFINES/tick.dm @@ -3,5 +3,5 @@ #define TICK_LIMIT_MC 70 #define TICK_LIMIT_MC_INIT_DEFAULT 98 -#define TICK_CHECK ( world.tick_usage > CURRENT_TICKLIMIT ) +#define TICK_CHECK ( world.tick_usage > GLOB.CURRENT_TICKLIMIT ) #define CHECK_TICK if TICK_CHECK stoplag() diff --git a/code/__HELPERS/_lists.dm b/code/__HELPERS/_lists.dm index bd3752271ea5e..97b3c88e1fc0c 100644 --- a/code/__HELPERS/_lists.dm +++ b/code/__HELPERS/_lists.dm @@ -281,7 +281,7 @@ //Specifically for record datums in a list. /proc/sortRecord(list/L, field = "name", order = 1) - cmp_field = field + GLOB.cmp_field = field return sortTim(L, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc) //any value in a list diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index cceea91f64e37..2785ba896fb9d 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -18,15 +18,15 @@ #endif /proc/log_admin(text) - admin_log.Add(text) + GLOB.admin_log.Add(text) if (config.log_admin) - diary << "\[[time_stamp()]]ADMIN: [text]" + GLOB.diary << "\[[time_stamp()]]ADMIN: [text]" //Items using this proc are stripped from public logs - use with caution /proc/log_admin_private(text) - admin_log.Add(text) + GLOB.admin_log.Add(text) if (config.log_admin) - diary << "\[[time_stamp()]]ADMINPRIVATE: [text]" + GLOB.diary << "\[[time_stamp()]]ADMINPRIVATE: [text]" /proc/log_adminsay(text) if (config.log_adminchat) @@ -38,65 +38,65 @@ /proc/log_game(text) if (config.log_game) - diary << "\[[time_stamp()]]GAME: [text]" + GLOB.diary << "\[[time_stamp()]]GAME: [text]" /proc/log_vote(text) if (config.log_vote) - diary << "\[[time_stamp()]]VOTE: [text]" + GLOB.diary << "\[[time_stamp()]]VOTE: [text]" /proc/log_access(text) if (config.log_access) - diary << "\[[time_stamp()]]ACCESS: [text]" + GLOB.diary << "\[[time_stamp()]]ACCESS: [text]" /proc/log_say(text) if (config.log_say) - diary << "\[[time_stamp()]]SAY: [text]" + GLOB.diary << "\[[time_stamp()]]SAY: [text]" /proc/log_prayer(text) if (config.log_prayer) - diary << "\[[time_stamp()]]PRAY: [text]" + GLOB.diary << "\[[time_stamp()]]PRAY: [text]" /proc/log_law(text) if (config.log_law) - diary << "\[[time_stamp()]]LAW: [text]" + GLOB.diary << "\[[time_stamp()]]LAW: [text]" /proc/log_ooc(text) if (config.log_ooc) - diary << "\[[time_stamp()]]OOC: [text]" + GLOB.diary << "\[[time_stamp()]]OOC: [text]" /proc/log_whisper(text) if (config.log_whisper) - diary << "\[[time_stamp()]]WHISPER: [text]" + GLOB.diary << "\[[time_stamp()]]WHISPER: [text]" /proc/log_emote(text) if (config.log_emote) - diary << "\[[time_stamp()]]EMOTE: [text]" + GLOB.diary << "\[[time_stamp()]]EMOTE: [text]" /proc/log_attack(text) if (config.log_attack) - diaryofmeanpeople << "\[[time_stamp()]]ATTACK: [text]" + GLOB.diaryofmeanpeople << "\[[time_stamp()]]ATTACK: [text]" /proc/log_pda(text) if (config.log_pda) - diary << "\[[time_stamp()]]PDA: [text]" + GLOB.diary << "\[[time_stamp()]]PDA: [text]" /proc/log_comment(text) if (config.log_pda) //reusing the PDA option because I really don't think news comments are worth a config option - diary << "\[[time_stamp()]]COMMENT: [text]" + GLOB.diary << "\[[time_stamp()]]COMMENT: [text]" /proc/log_chat(text) if (config.log_pda) - diary << "\[[time_stamp()]]CHAT: [text]" + GLOB.diary << "\[[time_stamp()]]CHAT: [text]" /proc/log_sql(text) if(config.sql_enabled) - diary << "\[[time_stamp()]]SQL: [text]" + GLOB.diary << "\[[time_stamp()]]SQL: [text]" //This replaces world.log so it displays both in DD and the file /proc/log_world(text) if(config && config.log_runtimes) - world.log = runtime_diary + world.log = GLOB.runtime_diary world.log << text world.log = null world.log << text diff --git a/code/__HELPERS/_string_lists.dm b/code/__HELPERS/_string_lists.dm index 290beb20634ab..149fd04e2fa32 100644 --- a/code/__HELPERS/_string_lists.dm +++ b/code/__HELPERS/_string_lists.dm @@ -2,15 +2,15 @@ #define pick_list_replacements(FILE, KEY) (strings_replacement(FILE, KEY)) #define json_load(FILE) (json_decode(file2text(FILE))) -var/global/list/string_cache -var/global/string_filename_current_key +GLOBAL_LIST(string_cache) +GLOBAL_VAR(string_filename_current_key) /proc/strings_replacement(filename, key) load_strings_file(filename) - if((filename in string_cache) && (key in string_cache[filename])) - var/response = pick(string_cache[filename][key]) + if((filename in GLOB.string_cache) && (key in GLOB.string_cache[filename])) + var/response = pick(GLOB.string_cache[filename][key]) var/regex/r = regex("@pick\\((\\D+?)\\)", "g") response = r.Replace(response, /proc/strings_subkey_lookup) return response @@ -19,23 +19,23 @@ var/global/string_filename_current_key /proc/strings(filename as text, key as text) load_strings_file(filename) - if((filename in string_cache) && (key in string_cache[filename])) - return string_cache[filename][key] + if((filename in GLOB.string_cache) && (key in GLOB.string_cache[filename])) + return GLOB.string_cache[filename][key] else CRASH("strings list not found: strings/[filename], index=[key]") /proc/strings_subkey_lookup(match, group1) - return pick_list(string_filename_current_key, group1) + return pick_list(GLOB.string_filename_current_key, group1) /proc/load_strings_file(filename) - string_filename_current_key = filename - if(filename in string_cache) + GLOB.string_filename_current_key = filename + if(filename in GLOB.string_cache) return //no work to do - if(!string_cache) - string_cache = new + if(!GLOB.string_cache) + GLOB.string_cache = new if(fexists("strings/[filename]")) - string_cache[filename] = json_load("strings/[filename]") + GLOB.string_cache[filename] = json_load("strings/[filename]") else CRASH("file not found: strings/[filename]") diff --git a/code/__HELPERS/bandetect.dm b/code/__HELPERS/bandetect.dm index 9a43f303729d1..9da3c38632a21 100644 --- a/code/__HELPERS/bandetect.dm +++ b/code/__HELPERS/bandetect.dm @@ -2,7 +2,7 @@ /client/proc/join_date_check(y,m,d) - var/DBQuery/query_datediff = dbcon.NewQuery("SELECT DATEDIFF(Now(),'[y]-[m]-[d]')") + var/DBQuery/query_datediff = GLOB.dbcon.NewQuery("SELECT DATEDIFF(Now(),'[y]-[m]-[d]')") if(!query_datediff.Execute()) return FALSE diff --git a/code/__HELPERS/cmp.dm b/code/__HELPERS/cmp.dm index a84bec4d4e5ec..be070ae8067ef 100644 --- a/code/__HELPERS/cmp.dm +++ b/code/__HELPERS/cmp.dm @@ -16,12 +16,12 @@ /proc/cmp_name_dsc(atom/a, atom/b) return sorttext(a.name, b.name) -var/cmp_field = "name" +GLOBAL_VAR_INIT(cmp_field, "name") /proc/cmp_records_asc(datum/data/record/a, datum/data/record/b) - return sorttext(b.fields[cmp_field], a.fields[cmp_field]) + return sorttext(b.fields[GLOB.cmp_field], a.fields[GLOB.cmp_field]) /proc/cmp_records_dsc(datum/data/record/a, datum/data/record/b) - return sorttext(a.fields[cmp_field], b.fields[cmp_field]) + return sorttext(a.fields[GLOB.cmp_field], b.fields[GLOB.cmp_field]) /proc/cmp_ckey_asc(client/a, client/b) return sorttext(b.ckey, a.ckey) diff --git a/code/__HELPERS/files.dm b/code/__HELPERS/files.dm index 386f0eac1298a..f457278eb0f4e 100644 --- a/code/__HELPERS/files.dm +++ b/code/__HELPERS/files.dm @@ -51,11 +51,11 @@ PLEASE USE RESPONSIBLY, Some log files can reach sizes of 4MB! */ /client/proc/file_spam_check() - var/time_to_wait = fileaccess_timer - world.time + var/time_to_wait = GLOB.fileaccess_timer - world.time if(time_to_wait > 0) to_chat(src, "Error: file_spam_check(): Spam. Please wait [round(time_to_wait/10)] seconds.") return 1 - fileaccess_timer = world.time + FTPDELAY + GLOB.fileaccess_timer = world.time + FTPDELAY return 0 #undef FTPDELAY diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index c77f4601fdec3..731954bdb8d35 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -76,7 +76,7 @@ /proc/alone_in_area(area/the_area, mob/must_be_alone, check_type = /mob/living/carbon) var/area/our_area = get_area(the_area) - for(var/C in living_mob_list) + for(var/C in GLOB.living_mob_list) if(!istype(C, check_type)) continue if(C == must_be_alone) @@ -301,12 +301,12 @@ /proc/try_move_adjacent(atom/movable/AM) var/turf/T = get_turf(AM) - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(AM.Move(get_step(T, direction))) break /proc/get_mob_by_key(key) - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.ckey == lowertext(key)) return M return null @@ -317,7 +317,7 @@ var/list/candidates = list() // Keep looping until we find a non-afk candidate within the time bracket (we limit the bracket to 10 minutes (6000)) while(!candidates.len && afk_bracket < 6000) - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) if(G.client != null) if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD)) if(!G.client.is_afk(afk_bracket) && (be_special_type in G.client.prefs.be_special)) @@ -358,8 +358,8 @@ /proc/get_active_player_count(var/alive_check = 0, var/afk_check = 0, var/human_check = 0) // Get active players who are playing in the round var/active_players = 0 - for(var/i = 1; i <= player_list.len; i++) - var/mob/M = player_list[i] + for(var/i = 1; i <= GLOB.player_list.len; i++) + var/mob/M = GLOB.player_list[i] if(M && M.client) if(alive_check && M.stat) continue @@ -431,10 +431,10 @@ if(2) to_chat(G, "Choice registered: No.") if(3) - var/list/L = poll_ignore[ignore_category] + var/list/L = GLOB.poll_ignore[ignore_category] if(!L) - poll_ignore[ignore_category] = list() - poll_ignore[ignore_category] += G.ckey + GLOB.poll_ignore[ignore_category] = list() + GLOB.poll_ignore[ignore_category] += G.ckey to_chat(G, "Choice registered: Never for this round.") /proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300, var/ignore_category = null, flashwindow = TRUE) @@ -443,8 +443,8 @@ if (!Question) Question = "Would you like to be a special role?" - for(var/mob/dead/observer/G in player_list) - if(!G.key || !G.client || (ignore_category && poll_ignore[ignore_category] && G.ckey in poll_ignore[ignore_category])) + for(var/mob/dead/observer/G in GLOB.player_list) + if(!G.key || !G.client || (ignore_category && GLOB.poll_ignore[ignore_category] && G.ckey in GLOB.poll_ignore[ignore_category])) continue if(be_special_flag) if(!(G.client.prefs) || !(be_special_flag in G.client.prefs.be_special)) @@ -490,7 +490,7 @@ return //First we spawn a dude. - var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. + var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned. G_found.client.prefs.copy_to(new_character) new_character.dna.update_dna_identity() @@ -499,7 +499,7 @@ return new_character /proc/send_to_playing_players(thing) //sends a whatever to all playing players; use instead of to_chat(world, where needed) - for(var/M in player_list) + for(var/M in GLOB.player_list) if(M && !isnewplayer(M)) to_chat(M, thing) @@ -520,12 +520,12 @@ [character.real_name] ([rank]) has arrived at the station at \ [A.name]." deadchat_broadcast(message, follow_target = character, message_type=DEADCHAT_ARRIVALRATTLE) - if((!announcement_systems.len) || (!character.mind)) + if((!GLOB.announcement_systems.len) || (!character.mind)) return if((character.mind.assigned_role == "Cyborg") || (character.mind.assigned_role == character.mind.special_role)) return - var/obj/machinery/announcement_system/announcer = pick(announcement_systems) + var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems) announcer.announce("ARRIVAL", character.real_name, rank, list()) //make the list empty to make it announce it in common /proc/GetRedPart(const/hexa) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index baf931f2a339f..5b5f720637345 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -4,60 +4,60 @@ /proc/make_datum_references_lists() //hair - init_sprite_accessory_subtypes(/datum/sprite_accessory/hair, hair_styles_list, hair_styles_male_list, hair_styles_female_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/hair, GLOB.hair_styles_list, GLOB.hair_styles_male_list, GLOB.hair_styles_female_list) //facial hair - init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, facial_hair_styles_list, facial_hair_styles_male_list, facial_hair_styles_female_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hair_styles_list, GLOB.facial_hair_styles_male_list, GLOB.facial_hair_styles_female_list) //underwear - init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, underwear_list, underwear_m, underwear_f) + init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, GLOB.underwear_list, GLOB.underwear_m, GLOB.underwear_f) //undershirt - init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, undershirt_list, undershirt_m, undershirt_f) + init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, GLOB.undershirt_list, GLOB.undershirt_m, GLOB.undershirt_f) //socks - init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, socks_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, GLOB.socks_list) //lizard bodyparts (blizzard intensifies) - init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, body_markings_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, tails_list_lizard) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/lizard, animated_tails_list_lizard) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, tails_list_human) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/human, animated_tails_list_human) - init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, snouts_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/horns, horns_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, ears_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, wings_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open, wings_open_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, frills_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, spines_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/spines_animated, animated_spines_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, legs_list) - init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, r_wings_list,roundstart = TRUE) + init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, GLOB.tails_list_lizard) + init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/lizard, GLOB.animated_tails_list_lizard) + init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human) + init_sprite_accessory_subtypes(/datum/sprite_accessory/tails_animated/human, GLOB.animated_tails_list_human) + init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, GLOB.snouts_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/horns,GLOB.horns_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, GLOB.ears_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.wings_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/wings_open, GLOB.wings_open_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, GLOB.frills_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, GLOB.spines_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/spines_animated, GLOB.animated_spines_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, GLOB.legs_list) + init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.r_wings_list,roundstart = TRUE) //Species for(var/spath in subtypesof(/datum/species)) var/datum/species/S = new spath() if(S.roundstart) - roundstart_species[S.id] = S.type - species_list[S.id] = S.type + GLOB.roundstart_species[S.id] = S.type + GLOB.species_list[S.id] = S.type //Surgeries for(var/path in subtypesof(/datum/surgery)) - surgeries_list += new path() + GLOB.surgeries_list += new path() //Materials for(var/path in subtypesof(/datum/material)) var/datum/material/D = new path() - materials_list[D.id] = D + GLOB.materials_list[D.id] = D //Techs for(var/path in subtypesof(/datum/tech)) var/datum/tech/D = new path() - tech_list[D.id] = D + GLOB.tech_list[D.id] = D //Emotes for(var/path in subtypesof(/datum/emote)) var/datum/emote/E = new path() - emote_list[E.key] = E + E.emote_list[E.key] = E - init_subtypes(/datum/crafting_recipe, crafting_recipes) + init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes) /* // Uncomment to debug chemical reaction list. /client/verb/debug_chemical_list() diff --git a/code/__HELPERS/icon_smoothing.dm b/code/__HELPERS/icon_smoothing.dm index 8e93926b15303..d890788c91d9b 100644 --- a/code/__HELPERS/icon_smoothing.dm +++ b/code/__HELPERS/icon_smoothing.dm @@ -67,7 +67,7 @@ if(AM.can_be_unanchored && !AM.anchored) return 0 - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) AM = find_type_in_direction(A, direction) if(AM == NULLTURF_BORDER) if((A.smooth & SMOOTH_BORDER)) diff --git a/code/__HELPERS/icons.dm b/code/__HELPERS/icons.dm index 69349bcc982c0..4c67a272d8874 100644 --- a/code/__HELPERS/icons.dm +++ b/code/__HELPERS/icons.dm @@ -15,7 +15,7 @@ CHANGING ICONS Several new procs have been added to the /icon datum to simplify working with icons. To use them, remember you first need to setup an /icon var like so: -var/icon/my_icon = new('iconfile.dmi') +GLOBAL_DATUM_INIT(my_icon, /icon, new('iconfile.dmi')) icon/ChangeOpacity(amount = 1) A very common operation in DM is to try to make an icon more or less transparent. Making an icon more @@ -872,18 +872,18 @@ The _flatIcons list is a cache for generated icon files. qdel(atom_icon) return text_image -var/global/list/friendly_animal_types = list() +GLOBAL_LIST_EMPTY(friendly_animal_types) // Pick a random animal instead of the icon, and use that instead /proc/getRandomAnimalImage(atom/A) - if(!friendly_animal_types.len) + if(!GLOB.friendly_animal_types.len) for(var/T in typesof(/mob/living/simple_animal)) var/mob/living/simple_animal/SA = T if(initial(SA.gold_core_spawnable) == 2) - friendly_animal_types += SA + GLOB.friendly_animal_types += SA - var/mob/living/simple_animal/SA = pick(friendly_animal_types) + var/mob/living/simple_animal/SA = pick(GLOB.friendly_animal_types) var/icon = initial(SA.icon) var/icon_state = initial(SA.icon_state) @@ -943,9 +943,9 @@ var/global/list/friendly_animal_types = list() return J return 0 -var/global/list/humanoid_icon_cache = list() //For creating consistent icons for human looking simple animals /proc/get_flat_human_icon(var/icon_id,var/outfit,var/datum/preferences/prefs) + var/static/list/humanoid_icon_cache = list() if(!icon_id || !humanoid_icon_cache[icon_id]) var/mob/living/carbon/human/dummy/body = new() @@ -988,13 +988,12 @@ var/global/list/humanoid_icon_cache = list() /image/proc/setDir(newdir) dir = newdir -// Used to make the frozen item visuals for Freon. -var/list/freeze_item_icons = list() - /atom/proc/freeze_icon_index() return "\ref[initial(icon)]-[initial(icon_state)]" /obj/proc/make_frozen_visual() + // Used to make the frozen item visuals for Freon. + var/static/list/freeze_item_icons = list() if(!HAS_SECONDARY_FLAG(src, FROZEN) && (initial(icon) && initial(icon_state))) var/index = freeze_icon_index() var/icon/IC diff --git a/code/__HELPERS/maths.dm b/code/__HELPERS/maths.dm index c7a912af59f7e..93d7a472b44c6 100644 --- a/code/__HELPERS/maths.dm +++ b/code/__HELPERS/maths.dm @@ -1,13 +1,13 @@ // Credits to Nickr5 for the useful procs I've taken from his library resource. -var/const/E = 2.71828183 -var/const/Sqrt2 = 1.41421356 +GLOBAL_VAR_INIT(E, 2.71828183) +GLOBAL_VAR_INIT(Sqrt2, 1.41421356) // List of square roots for the numbers 1-100. -var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, +GLOBAL_LIST_INIT(sqrtTable, list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10) + 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10)) /proc/sign(x) return x!=0?x/abs(x):0 @@ -150,9 +150,9 @@ var/list/sqrtTable = list(1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, //68% chance that the number is within 1stddev //95% chance that the number is within 2stddev //98% chance that the number is within 3stddev...etc -var/gaussian_next #define ACCURACY 10000 /proc/gaussian(mean, stddev) + var/static/gaussian_next var/R1;var/R2;var/working if(gaussian_next != null) R1 = gaussian_next diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index fc8ec9f17e256..a722da2efba34 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -21,81 +21,81 @@ return "000" /proc/random_underwear(gender) - if(!underwear_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, underwear_list, underwear_m, underwear_f) + if(!GLOB.underwear_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/underwear, GLOB.underwear_list, GLOB.underwear_m, GLOB.underwear_f) switch(gender) if(MALE) - return pick(underwear_m) + return pick(GLOB.underwear_m) if(FEMALE) - return pick(underwear_f) + return pick(GLOB.underwear_f) else - return pick(underwear_list) + return pick(GLOB.underwear_list) /proc/random_undershirt(gender) - if(!undershirt_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, undershirt_list, undershirt_m, undershirt_f) + if(!GLOB.undershirt_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/undershirt, GLOB.undershirt_list, GLOB.undershirt_m, GLOB.undershirt_f) switch(gender) if(MALE) - return pick(undershirt_m) + return pick(GLOB.undershirt_m) if(FEMALE) - return pick(undershirt_f) + return pick(GLOB.undershirt_f) else - return pick(undershirt_list) + return pick(GLOB.undershirt_list) /proc/random_socks() - if(!socks_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, socks_list) - return pick(socks_list) + if(!GLOB.socks_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/socks, GLOB.socks_list) + return pick(GLOB.socks_list) /proc/random_features() - if(!tails_list_human.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, tails_list_human) - if(!tails_list_lizard.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, tails_list_lizard) - if(!snouts_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, snouts_list) - if(!horns_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/horns, horns_list) - if(!ears_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, horns_list) - if(!frills_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, frills_list) - if(!spines_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, spines_list) - if(!legs_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, legs_list) - if(!body_markings_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, body_markings_list) - if(!wings_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, wings_list) + if(!GLOB.tails_list_human.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, GLOB.tails_list_human) + if(!GLOB.tails_list_lizard.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, GLOB.tails_list_lizard) + if(!GLOB.snouts_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/snouts, GLOB.snouts_list) + if(!GLOB.horns_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/horns, GLOB.horns_list) + if(!GLOB.ears_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/ears, GLOB.horns_list) + if(!GLOB.frills_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/frills, GLOB.frills_list) + if(!GLOB.spines_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/spines, GLOB.spines_list) + if(!GLOB.legs_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/legs, GLOB.legs_list) + if(!GLOB.body_markings_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, GLOB.body_markings_list) + if(!GLOB.wings_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/wings, GLOB.wings_list) //For now we will always return none for tail_human and ears. - return(list("mcolor" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "tail_lizard" = pick(tails_list_lizard), "tail_human" = "None", "wings" = "None", "snout" = pick(snouts_list), "horns" = pick(horns_list), "ears" = "None", "frills" = pick(frills_list), "spines" = pick(spines_list), "body_markings" = pick(body_markings_list), "legs" = "Normal Legs")) + return(list("mcolor" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "tail_lizard" = pick(GLOB.tails_list_lizard), "tail_human" = "None", "wings" = "None", "snout" = pick(GLOB.snouts_list), "horns" = pick(GLOB.horns_list), "ears" = "None", "frills" = pick(GLOB.frills_list), "spines" = pick(GLOB.spines_list), "body_markings" = pick(GLOB.body_markings_list), "legs" = "Normal Legs")) /proc/random_hair_style(gender) switch(gender) if(MALE) - return pick(hair_styles_male_list) + return pick(GLOB.hair_styles_male_list) if(FEMALE) - return pick(hair_styles_female_list) + return pick(GLOB.hair_styles_female_list) else - return pick(hair_styles_list) + return pick(GLOB.hair_styles_list) /proc/random_facial_hair_style(gender) switch(gender) if(MALE) - return pick(facial_hair_styles_male_list) + return pick(GLOB.facial_hair_styles_male_list) if(FEMALE) - return pick(facial_hair_styles_female_list) + return pick(GLOB.facial_hair_styles_female_list) else - return pick(facial_hair_styles_list) + return pick(GLOB.facial_hair_styles_list) /proc/random_unique_name(gender, attempts_to_find_unique_name=10) for(var/i=1, i<=attempts_to_find_unique_name, i++) if(gender==FEMALE) - . = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + . = capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) else - . = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + . = capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) if(i != attempts_to_find_unique_name && !findname(.)) break @@ -115,9 +115,9 @@ break /proc/random_skin_tone() - return pick(skin_tones) + return pick(GLOB.skin_tones) -var/list/skin_tones = list( +GLOBAL_LIST_INIT(skin_tones, list( "albino", "caucasian1", "caucasian2", @@ -130,10 +130,10 @@ var/list/skin_tones = list( "indian", "african1", "african2" - ) + )) -var/global/list/species_list[0] -var/global/list/roundstart_species[0] +GLOBAL_LIST_EMPTY(species_list) +GLOBAL_LIST_EMPTY(roundstart_species) /proc/age2agedescription(age) switch(age) @@ -170,8 +170,8 @@ Proc for attack log creation, because really why not /proc/add_logs(mob/user, mob/target, what_done, object=null, addition=null) var/turf/attack_location = get_turf(target) - var/is_mob_user = user && typecache_mob[user.type] - var/is_mob_target = target && typecache_mob[target.type] + var/is_mob_user = user && GLOB.typecache_mob[user.type] + var/is_mob_target = target && GLOB.typecache_mob[target.type] var/mob/living/living_target @@ -393,7 +393,7 @@ Proc for attack log creation, because really why not step(X, pick(NORTH, SOUTH, EAST, WEST)) /proc/deadchat_broadcast(message, mob/follow_target=null, turf/turf_target=null, speaker_key=null, message_type=DEADCHAT_REGULAR) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) var/datum/preferences/prefs if(M.client && M.client.prefs) prefs = M.client.prefs diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index 0a18c0f32e714..e95a61cec3211 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -2,15 +2,15 @@ /proc/lizard_name(gender) if(gender == MALE) - return "[pick(lizard_names_male)]-[pick(lizard_names_male)]" + return "[pick(GLOB.lizard_names_male)]-[pick(GLOB.lizard_names_male)]" else - return "[pick(lizard_names_female)]-[pick(lizard_names_female)]" + return "[pick(GLOB.lizard_names_female)]-[pick(GLOB.lizard_names_female)]" /proc/plasmaman_name() - return "[pick(plasmaman_names)] \Roman[rand(1,99)]" + return "[pick(GLOB.plasmaman_names)] \Roman[rand(1,99)]" -var/church_name = null /proc/church_name() + var/static/church_name if (church_name) return church_name @@ -26,24 +26,24 @@ var/church_name = null return name -var/command_name = null +GLOBAL_VAR(command_name) /proc/command_name() - if (command_name) - return command_name + if (GLOB.command_name) + return GLOB.command_name var/name = "Central Command" - command_name = name + GLOB.command_name = name return name /proc/change_command_name(name) - command_name = name + GLOB.command_name = name return name -var/religion_name = null /proc/religion_name() + var/static/religion_name if (religion_name) return religion_name @@ -55,20 +55,20 @@ var/religion_name = null return capitalize(name) /proc/station_name() - if(station_name) - return station_name + if(GLOB.station_name) + return GLOB.station_name if(config && config.station_name) - station_name = config.station_name + GLOB.station_name = config.station_name else - station_name = new_station_name() + GLOB.station_name = new_station_name() if(config && config.server_name) - world.name = "[config.server_name][config.server_name==station_name ? "" : ": [station_name]"]" + world.name = "[config.server_name][config.server_name==GLOB.station_name ? "" : ": [GLOB.station_name]"]" else - world.name = station_name + world.name = GLOB.station_name - return station_name + return GLOB.station_name /proc/new_station_name() var/random = rand(1,5) @@ -77,7 +77,7 @@ var/religion_name = null //Rare: Pre-Prefix if (prob(10)) - name = pick(station_prefixes) + name = pick(GLOB.station_prefixes) new_station_name = name + " " name = "" @@ -89,12 +89,12 @@ var/religion_name = null name = holiday.getStationPrefix() //get normal name if(!name) - name = pick(station_names) + name = pick(GLOB.station_names) if(name) new_station_name += name + " " // Suffix - name = pick(station_suffixes) + name = pick(GLOB.station_suffixes) new_station_name += name + " " // ID Number @@ -102,19 +102,19 @@ var/religion_name = null if(1) new_station_name += "[rand(1, 99)]" if(2) - new_station_name += pick(greek_letters) + new_station_name += pick(GLOB.greek_letters) if(3) new_station_name += "\Roman[rand(1,99)]" if(4) - new_station_name += pick(phonetic_alphabet) + new_station_name += pick(GLOB.phonetic_alphabet) if(5) - new_station_name += pick(numbers_as_words) + new_station_name += pick(GLOB.numbers_as_words) if(13) new_station_name += pick("13","XIII","Thirteen") return new_station_name -var/syndicate_name = null /proc/syndicate_name() + var/static/syndicate_name if (syndicate_name) return syndicate_name @@ -145,8 +145,8 @@ var/syndicate_name = null //Traitors and traitor silicons will get these. Revs will not. -var/syndicate_code_phrase//Code phrase for traitors. -var/syndicate_code_response//Code response for traitors. +GLOBAL_VAR(syndicate_code_phrase) //Code phrase for traitors. +GLOBAL_VAR(syndicate_code_response) //Code response for traitors. /* Should be expanded. @@ -179,10 +179,10 @@ var/syndicate_code_response//Code response for traitors. var/threats = strings(ION_FILE, "ionthreats") var/foods = strings(ION_FILE, "ionfood") var/drinks = strings(ION_FILE, "iondrinks") - var/list/locations = teleportlocs.len ? teleportlocs : drinks //if null, defaults to drinks instead. + var/list/locations = GLOB.teleportlocs.len ? GLOB.teleportlocs : drinks //if null, defaults to drinks instead. var/list/names = list() - for(var/datum/data/record/t in data_core.general)//Picks from crew manifest. + for(var/datum/data/record/t in GLOB.data_core.general)//Picks from crew manifest. names += t.fields["name"] var/maxwords = words//Extra var to check for duplicates. @@ -204,9 +204,9 @@ var/syndicate_code_response//Code response for traitors. if(prob(10)) code_phrase += pick(lizard_name(MALE),lizard_name(FEMALE)) else - code_phrase += pick(pick(first_names_male,first_names_female)) + code_phrase += pick(pick(GLOB.first_names_male,GLOB.first_names_female)) code_phrase += " " - code_phrase += pick(last_names) + code_phrase += pick(GLOB.last_names) if(2) code_phrase += pick(get_all_jobs())//Returns a job. safety -= 1 @@ -241,4 +241,4 @@ var/syndicate_code_response//Code response for traitors. world.name = "[config.server_name]: [designation]" else world.name = designation - station_name = designation + GLOB.station_name = designation diff --git a/code/__HELPERS/sorts/InsertSort.dm b/code/__HELPERS/sorts/InsertSort.dm index 5ffaa4ce02e0c..23e0dc8876fba 100644 --- a/code/__HELPERS/sorts/InsertSort.dm +++ b/code/__HELPERS/sorts/InsertSort.dm @@ -8,9 +8,9 @@ if(toIndex <= 0) toIndex += L.len + 1 - sortInstance.L = L - sortInstance.cmp = cmp - sortInstance.associative = associative + GLOB.sortInstance.L = L + GLOB.sortInstance.cmp = cmp + GLOB.sortInstance.associative = associative - sortInstance.binarySort(fromIndex, toIndex, fromIndex) + GLOB.sortInstance.binarySort(fromIndex, toIndex, fromIndex) return L \ No newline at end of file diff --git a/code/__HELPERS/sorts/MergeSort.dm b/code/__HELPERS/sorts/MergeSort.dm index 228a08efb931a..cc47123b3cd68 100644 --- a/code/__HELPERS/sorts/MergeSort.dm +++ b/code/__HELPERS/sorts/MergeSort.dm @@ -8,9 +8,9 @@ if(toIndex <= 0) toIndex += L.len + 1 - sortInstance.L = L - sortInstance.cmp = cmp - sortInstance.associative = associative - sortInstance.mergeSort(fromIndex, toIndex) + GLOB.sortInstance.L = L + GLOB.sortInstance.cmp = cmp + GLOB.sortInstance.associative = associative + GLOB.sortInstance.mergeSort(fromIndex, toIndex) return L \ No newline at end of file diff --git a/code/__HELPERS/sorts/TimSort.dm b/code/__HELPERS/sorts/TimSort.dm index 4aa5126365627..8cfb79267255a 100644 --- a/code/__HELPERS/sorts/TimSort.dm +++ b/code/__HELPERS/sorts/TimSort.dm @@ -8,10 +8,10 @@ if(toIndex <= 0) toIndex += L.len + 1 - sortInstance.L = L - sortInstance.cmp = cmp - sortInstance.associative = associative + GLOB.sortInstance.L = L + GLOB.sortInstance.cmp = cmp + GLOB.sortInstance.associative = associative - sortInstance.timSort(fromIndex, toIndex) + GLOB.sortInstance.timSort(fromIndex, toIndex) return L \ No newline at end of file diff --git a/code/__HELPERS/sorts/__main.dm b/code/__HELPERS/sorts/__main.dm index e2c008389e460..c26126c0a6639 100644 --- a/code/__HELPERS/sorts/__main.dm +++ b/code/__HELPERS/sorts/__main.dm @@ -9,7 +9,7 @@ #define MIN_GALLOP 7 //This is a global instance to allow much of this code to be reused. The interfaces are kept seperately -var/datum/sortInstance/sortInstance = new() +GLOBAL_DATUM_INIT(sortInstance, /datum/sortInstance, new()) /datum/sortInstance //The array being sorted. var/list/L diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 5cf0b241066b1..e6beaa2f914d0 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -15,11 +15,11 @@ // Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts. /proc/sanitizeSQL(t) - var/sqltext = dbcon.Quote("[t]"); + var/sqltext = GLOB.dbcon.Quote("[t]"); return copytext(sqltext, 2, lentext(sqltext));//Quote() adds quotes around input, we already do that /proc/format_table_name(table as text) - return sqlfdbktableprefix + table + return GLOB.sqlfdbktableprefix + table /* * Text sanitization @@ -334,10 +334,10 @@ new_text += copytext(text, i, i+1) return new_text -var/list/zero_character_only = list("0") -var/list/hex_characters = list("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f") -var/list/alphabet = list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z") -var/list/binary = list("0","1") +GLOBAL_LIST_INIT(zero_character_only, list("0")) +GLOBAL_LIST_INIT(hex_characters, list("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f")) +GLOBAL_LIST_INIT(alphabet, list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")) +GLOBAL_LIST_INIT(binary, list("0","1")) /proc/random_string(length, list/characters) . = "" for(var/i=1, i<=length, i++) @@ -349,10 +349,10 @@ var/list/binary = list("0","1") . += string /proc/random_short_color() - return random_string(3, hex_characters) + return random_string(3, GLOB.hex_characters) /proc/random_color() - return random_string(6, hex_characters) + return random_string(6, GLOB.hex_characters) /proc/add_zero2(t, u) var/temp1 diff --git a/code/__HELPERS/time.dm b/code/__HELPERS/time.dm index 073d8a29ceace..29cb5940132e7 100644 --- a/code/__HELPERS/time.dm +++ b/code/__HELPERS/time.dm @@ -9,7 +9,7 @@ /proc/gameTimestamp(format = "hh:mm:ss", wtime=null) if(!wtime) wtime = world.time - return time2text(wtime - timezoneOffset + SSticker.gametime_offset - round_start_time, format) + return time2text(wtime - GLOB.timezoneOffset + SSticker.gametime_offset - SSticker.round_start_time, format) /* Returns 1 if it is the selected month and day */ /proc/isDay(month, day) @@ -30,10 +30,10 @@ return time2text(timevar, "YYYY-MM-DD hh:mm:ss") -/var/midnight_rollovers = 0 -/var/rollovercheck_last_timeofday = 0 +GLOBAL_VAR_INIT(midnight_rollovers, 0) +GLOBAL_VAR_INIT(rollovercheck_last_timeofday, 0) /proc/update_midnight_rollover() - if (world.timeofday < rollovercheck_last_timeofday) //TIME IS GOING BACKWARDS! - return midnight_rollovers++ - return midnight_rollovers + if (world.timeofday < GLOB.rollovercheck_last_timeofday) //TIME IS GOING BACKWARDS! + return GLOB.midnight_rollovers++ + return GLOB.midnight_rollovers diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index a0a9db6ce4531..92636ee9dc174 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -337,15 +337,6 @@ return "[year][seperator][((month < 10) ? "0[month]" : month)][seperator][((day < 10) ? "0[day]" : day)]" -/* -var/list/test_times = list("December" = 1323522004, "August" = 1123522004, "January" = 1011522004, - "Jan Leap" = 946684800, "Jan Normal" = 978307200, "New Years Eve" = 1009670400, - "New Years" = 1009836000, "New Years 2" = 1041372000, "New Years 3" = 1104530400, - "July Month End" = 744161003, "July Month End 12" = 1343777003, "End July" = 1091311200) -for(var/t in test_times) - world.log << "TEST: [t] is [unix2date(test_times[t])]" -*/ - /proc/isLeap(y) return ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 640f6df10f9aa..c0637cdaa4240 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -200,17 +200,17 @@ Turf and target are seperate in case you want to teleport some distance from a t else switch(role) if("clown") - newname = pick(clown_names) + newname = pick(GLOB.clown_names) if("mime") - newname = pick(mime_names) + newname = pick(GLOB.mime_names) if("ai") - newname = pick(ai_names) + newname = pick(GLOB.ai_names) if("deity") - newname = pick(clown_names|ai_names|mime_names) //pick any old name + newname = pick(GLOB.clown_names|GLOB.ai_names|GLOB.mime_names) //pick any old name else return - for(var/mob/living/M in player_list) + for(var/mob/living/M in GLOB.player_list) if(M == src) continue if(!newname || M.real_name == newname) @@ -231,7 +231,7 @@ Turf and target are seperate in case you want to teleport some distance from a t //Returns a list of unslaved cyborgs /proc/active_free_borgs() . = list() - for(var/mob/living/silicon/robot/R in living_mob_list) + for(var/mob/living/silicon/robot/R in GLOB.living_mob_list) if(R.connected_ai || R.shell) continue if(R.stat == DEAD) @@ -243,7 +243,7 @@ Turf and target are seperate in case you want to teleport some distance from a t //Returns a list of AI's /proc/active_ais(check_mind=0) . = list() - for(var/mob/living/silicon/ai/A in living_mob_list) + for(var/mob/living/silicon/ai/A in GLOB.living_mob_list) if(A.stat == DEAD) continue if(A.control_disabled == 1) @@ -305,7 +305,7 @@ Turf and target are seperate in case you want to teleport some distance from a t pois[name] = M if(!mobs_only) - for(var/atom/A in poi_list) + for(var/atom/A in GLOB.poi_list) if(!A || !A.loc) continue pois[avoid_assoc_duplicate_keys(A.name, namecounts)] = A @@ -314,7 +314,7 @@ Turf and target are seperate in case you want to teleport some distance from a t //Orders mobs by type then by name /proc/sortmobs() var/list/moblist = list() - var/list/sortmob = sortNames(mob_list) + var/list/sortmob = sortNames(GLOB.mob_list) for(var/mob/living/silicon/ai/M in sortmob) moblist.Add(M) for(var/mob/camera/M in sortmob) @@ -378,7 +378,7 @@ Turf and target are seperate in case you want to teleport some distance from a t else if(istext(whom)) key = whom ckey = ckey(whom) - C = directory[ckey] + C = GLOB.directory[ckey] if(C) M = C.mob else @@ -583,16 +583,16 @@ Turf and target are seperate in case you want to teleport some distance from a t //Repopulates sortedAreas list /proc/SortAreas() - sortedAreas = list() + GLOB.sortedAreas = list() for(var/area/A in world) - sortedAreas.Add(A) + GLOB.sortedAreas.Add(A) - sortTim(sortedAreas, /proc/cmp_name_asc) + sortTim(GLOB.sortedAreas, /proc/cmp_name_asc) /area/proc/addSorted() - sortedAreas.Add(src) - sortTim(sortedAreas, /proc/cmp_name_asc) + GLOB.sortedAreas.Add(src) + sortTim(GLOB.sortedAreas, /proc/cmp_name_asc) //Takes: Area type as text string or as typepath OR an instance of the area. //Returns: A list of all areas of that type in the world. @@ -608,12 +608,12 @@ Turf and target are seperate in case you want to teleport some distance from a t var/list/areas = list() if(subtypes) var/list/cache = typecacheof(areatype) - for(var/V in sortedAreas) + for(var/V in GLOB.sortedAreas) var/area/A = V if(cache[A.type]) areas += V else - for(var/V in sortedAreas) + for(var/V in GLOB.sortedAreas) var/area/A = V if(A.type == areatype) areas += V @@ -633,7 +633,7 @@ Turf and target are seperate in case you want to teleport some distance from a t var/list/turfs = list() if(subtypes) var/list/cache = typecacheof(areatype) - for(var/V in sortedAreas) + for(var/V in GLOB.sortedAreas) var/area/A = V if(!cache[A.type]) continue @@ -641,7 +641,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(target_z == 0 || target_z == T.z) turfs += T else - for(var/V in sortedAreas) + for(var/V in GLOB.sortedAreas) var/area/A = V if(A.type != areatype) continue @@ -763,9 +763,9 @@ Turf and target are seperate in case you want to teleport some distance from a t //For objects that should embed, but make no sense being is_sharp or is_pointed() //e.g: rods -var/list/can_embed_types = typecacheof(list( +GLOBAL_LIST_INIT(can_embed_types, typecacheof(list( /obj/item/stack/rods, - /obj/item/pipe)) + /obj/item/pipe))) /proc/can_embed(obj/item/W) if(W.is_sharp()) @@ -773,14 +773,14 @@ var/list/can_embed_types = typecacheof(list( if(is_pointed(W)) return 1 - if(is_type_in_typecache(W, can_embed_types)) + if(is_type_in_typecache(W, GLOB.can_embed_types)) return 1 /* Checks if that loc and dir has a item on the wall */ -var/list/WALLITEMS = typecacheof(list( +GLOBAL_LIST_INIT(WALLITEMS, typecacheof(list( /obj/machinery/power/apc, /obj/machinery/airalarm, /obj/item/device/radio/intercom, /obj/structure/extinguisher_cabinet, /obj/structure/reagent_dispensers/peppertank, /obj/machinery/status_display, /obj/machinery/requests_console, /obj/machinery/light_switch, /obj/structure/sign, @@ -788,22 +788,22 @@ var/list/WALLITEMS = typecacheof(list( /obj/machinery/computer/security/telescreen, /obj/machinery/embedded_controller/radio/simple_vent_controller, /obj/item/weapon/storage/secure/safe, /obj/machinery/door_timer, /obj/machinery/flasher, /obj/machinery/keycard_auth, /obj/structure/mirror, /obj/structure/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment - )) + ))) -var/list/WALLITEMS_EXTERNAL = typecacheof(list( +GLOBAL_LIST_INIT(WALLITEMS_EXTERNAL, typecacheof(list( /obj/machinery/camera, /obj/structure/camera_assembly, - /obj/structure/light_construct, /obj/machinery/light)) + /obj/structure/light_construct, /obj/machinery/light))) -var/list/WALLITEMS_INVERSE = typecacheof(list( - /obj/structure/light_construct, /obj/machinery/light)) +GLOBAL_LIST_INIT(WALLITEMS_INVERSE, typecacheof(list( + /obj/structure/light_construct, /obj/machinery/light))) /proc/gotwallitem(loc, dir, var/check_external = 0) var/locdir = get_step(loc, dir) for(var/obj/O in loc) - if(is_type_in_typecache(O, WALLITEMS) && check_external != 2) + if(is_type_in_typecache(O, GLOB.WALLITEMS) && check_external != 2) //Direction works sometimes - if(is_type_in_typecache(O, WALLITEMS_INVERSE)) + if(is_type_in_typecache(O, GLOB.WALLITEMS_INVERSE)) if(O.dir == turn(dir, 180)) return 1 else if(O.dir == dir) @@ -814,8 +814,8 @@ var/list/WALLITEMS_INVERSE = typecacheof(list( if(get_turf_pixel(O) == locdir) return 1 - if(is_type_in_typecache(O, WALLITEMS_EXTERNAL) && check_external) - if(is_type_in_typecache(O, WALLITEMS_INVERSE)) + if(is_type_in_typecache(O, GLOB.WALLITEMS_EXTERNAL) && check_external) + if(is_type_in_typecache(O, GLOB.WALLITEMS_INVERSE)) if(O.dir == turn(dir, 180)) return 1 else if(O.dir == dir) @@ -823,7 +823,7 @@ var/list/WALLITEMS_INVERSE = typecacheof(list( //Some stuff is placed directly on the wallturf (signs) for(var/obj/O in locdir) - if(is_type_in_typecache(O, WALLITEMS) && check_external != 2) + if(is_type_in_typecache(O, GLOB.WALLITEMS) && check_external != 2) if(O.pixel_x == 0 && O.pixel_y == 0) return 1 return 0 @@ -845,7 +845,7 @@ var/list/WALLITEMS_INVERSE = typecacheof(list( for(var/id in cached_gases) var/gas_concentration = cached_gases[id][MOLES]/total_moles - if(id in hardcoded_gases || gas_concentration > 0.001) //ensures the four primary gases are always shown. + if(id in GLOB.hardcoded_gases || gas_concentration > 0.001) //ensures the four primary gases are always shown. to_chat(user, "[cached_gases[id][GAS_META][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %") to_chat(user, "Temperature: [round(air_contents.temperature-T0C)] °C") @@ -871,14 +871,14 @@ var/list/WALLITEMS_INVERSE = typecacheof(list( var/initial_chance = chance while(steps > 0) if(prob(chance)) - step(AM, pick(alldirs)) + step(AM, pick(GLOB.alldirs)) chance = max(chance - (initial_chance / steps), 0) steps-- /proc/living_player_count() var/living_player_count = 0 - for(var/mob in player_list) - if(mob in living_mob_list) + for(var/mob in GLOB.player_list) + if(mob in GLOB.living_mob_list) living_player_count += 1 return living_player_count @@ -1188,7 +1188,7 @@ B --><-- A /proc/get_areas_in_z(zlevel) . = list() var/validarea = FALSE - for(var/V in sortedAreas) + for(var/V in GLOB.sortedAreas) var/area/A = V validarea = TRUE for(var/turf/T in A) @@ -1254,7 +1254,7 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) . += round(i*DELTA_CALC) sleep(i*world.tick_lag*DELTA_CALC) i *= 2 - while (world.tick_usage > min(TICK_LIMIT_TO_RUN, CURRENT_TICKLIMIT)) + while (world.tick_usage > min(TICK_LIMIT_TO_RUN, GLOB.CURRENT_TICKLIMIT)) #undef DELTA_CALC @@ -1313,19 +1313,19 @@ proc/pick_closest_path(value, list/matches = get_fancy_list_of_atom_types()) else . = "" -var/mob/dview/dview_mob = new +GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new) //Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant). /proc/dview(var/range = world.view, var/center, var/invis_flags = 0) if(!center) return - dview_mob.loc = center + GLOB.dview_mob.loc = center - dview_mob.see_invisible = invis_flags + GLOB.dview_mob.see_invisible = invis_flags - . = view(range, dview_mob) - dview_mob.loc = null + . = view(range, GLOB.dview_mob) + GLOB.dview_mob.loc = null /mob/dview name = "INTERNAL DVIEW MOB" @@ -1343,14 +1343,14 @@ var/mob/dview/dview_mob = new return QDEL_HINT_LETMELIVE log_world("EVACUATE THE SHITCODE IS TRYING TO STEAL MUH JOBS") - dview_mob = new + GLOB.dview_mob = new return ..() #define FOR_DVIEW(type, range, center, invis_flags) \ - dview_mob.loc = center; \ - dview_mob.see_invisible = invis_flags; \ - for(type in view(range, dview_mob)) + GLOB.dview_mob.loc = center; \ + GLOB.dview_mob.see_invisible = invis_flags; \ + for(type in view(range, GLOB.dview_mob)) //can a window be here, or is there a window blocking it? /proc/valid_window_location(turf/T, dir_to_check) @@ -1375,17 +1375,17 @@ var/mob/dview/dview_mob = new //Set this to TRUE before calling //This prevents RCEs from badmins //kevinz000 if you touch this I will hunt you down -var/valid_HTTPSGet = FALSE +GLOBAL_VAR_INIT(valid_HTTPSGet, FALSE) /proc/HTTPSGet(url) if(findtext(url, "\"")) - valid_HTTPSGet = FALSE + GLOB.valid_HTTPSGet = FALSE - if(!valid_HTTPSGet) + if(!GLOB.valid_HTTPSGet) if(usr) CRASH("[usr.ckey]([usr]) just attempted an invalid HTTPSGet on: [url]!") else CRASH("Invalid HTTPSGet call on: [url]") - valid_HTTPSGet = FALSE + GLOB.valid_HTTPSGet = FALSE //"This has got to be the ugliest hack I have ever done" //warning, here be dragons diff --git a/code/_globalvars/configuration.dm b/code/_globalvars/configuration.dm index f5fb1a31cc4c7..d778d6e1c7a23 100644 --- a/code/_globalvars/configuration.dm +++ b/code/_globalvars/configuration.dm @@ -1,40 +1,47 @@ -var/datum/configuration/config = null +GLOBAL_REAL(config, /datum/configuration) -var/host = null -var/join_motd = null -var/station_name = null -var/game_version = "/tg/ Station 13" -var/changelog_hash = "" +GLOBAL_DATUM_INIT(revdata, /datum/getrev, new) -var/ooc_allowed = 1 // used with admin verbs to disable ooc - not a config option apparently -var/dooc_allowed = 1 -var/abandon_allowed = 1 -var/enter_allowed = 1 -var/guests_allowed = 1 -var/shuttle_frozen = 0 -var/shuttle_left = 0 -var/tinted_weldhelh = 1 +GLOBAL_VAR(host) +GLOBAL_VAR(join_motd) +GLOBAL_VAR(station_name) +GLOBAL_VAR_INIT(game_version, "/tg/ Station 13") +GLOBAL_VAR_INIT(changelog_hash, "") + +GLOBAL_VAR_INIT(ooc_allowed, TRUE) // used with admin verbs to disable ooc - not a config option apparently +GLOBAL_VAR_INIT(dooc_allowed, TRUE) +GLOBAL_VAR_INIT(abandon_allowed, TRUE) +GLOBAL_VAR_INIT(enter_allowed, TRUE) +GLOBAL_VAR_INIT(guests_allowed, TRUE) +GLOBAL_VAR_INIT(shuttle_frozen, FALSE) +GLOBAL_VAR_INIT(shuttle_left, FALSE) +GLOBAL_VAR_INIT(tinted_weldhelh, TRUE) // Debug is used exactly once (in living.dm) but is commented out in a lot of places. It is not set anywhere and only checked. // Debug2 is used in conjunction with a lot of admin verbs and therefore is actually legit. -var/Debug = 0 // global debug switch -var/Debug2 = 0 +GLOBAL_VAR_INIT(Debug, FALSE) // global debug switch +GLOBAL_VAR_INIT(Debug2, FALSE) //Server API key -var/global/comms_key = "default_pwd" -var/global/comms_allowed = 0 //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable) +GLOBAL_VAR_INIT(comms_key, "default_pwd") +GLOBAL_PROTECT(comms_key) +GLOBAL_VAR_INIT(comms_allowed, FALSE) //By default, the server does not allow messages to be sent to it, unless the key is strong enough (this is to prevent misconfigured servers from becoming vulnerable) +GLOBAL_PROTECT(comms_allowed) -var/global/medal_hub = null -var/global/medal_pass = " " -var/global/medals_enabled = TRUE //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls. +GLOBAL_VAR(medal_hub) +GLOBAL_PROTECT(medal_hub) +GLOBAL_VAR_INIT(medal_pass, " ") +GLOBAL_PROTECT(medal_pass) +GLOBAL_VAR_INIT(medals_enabled, TRUE) //will be auto set to false if the game fails contacting the medal hub to prevent unneeded calls. +GLOBAL_PROTECT(medals_enabled) //This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage -var/MAX_EX_DEVESTATION_RANGE = 3 -var/MAX_EX_HEAVY_RANGE = 7 -var/MAX_EX_LIGHT_RANGE = 14 -var/MAX_EX_FLASH_RANGE = 14 -var/MAX_EX_FLAME_RANGE = 14 -var/DYN_EX_SCALE = 0.5 +GLOBAL_VAR_INIT(MAX_EX_DEVESTATION_RANGE, 3) +GLOBAL_VAR_INIT(MAX_EX_HEAVY_RANGE, 7) +GLOBAL_VAR_INIT(MAX_EX_LIGHT_RANGE, 14) +GLOBAL_VAR_INIT(MAX_EX_FLASH_RANGE, 14) +GLOBAL_VAR_INIT(MAX_EX_FLAME_RANGE, 14) +GLOBAL_VAR_INIT(DYN_EX_SCALE, 0.5) diff --git a/code/_globalvars/database.dm b/code/_globalvars/database.dm index 58b6400ce4310..695e7c8974d9e 100644 --- a/code/_globalvars/database.dm +++ b/code/_globalvars/database.dm @@ -1,12 +1,19 @@ // MySQL configuration -var/sqladdress = "localhost" -var/sqlport = "3306" -var/sqlfdbkdb = "test" -var/sqlfdbklogin = "root" -var/sqlfdbkpass = "" -var/sqlfdbktableprefix = "erro_" //backwords compatibility with downstream server hosts +GLOBAL_VAR_INIT(sqladdress, "localhost") +GLOBAL_PROTECT(sqladdress) +GLOBAL_VAR_INIT(sqlport, "3306") +GLOBAL_PROTECT(sqlport) +GLOBAL_VAR_INIT(sqlfdbkdb, "test") +GLOBAL_PROTECT(sqlfdbkdb) +GLOBAL_VAR_INIT(sqlfdbklogin, "root") +GLOBAL_PROTECT(sqlfdbklogin) +GLOBAL_VAR_INIT(sqlfdbkpass, "") +GLOBAL_PROTECT(sqlfdbkpass) +GLOBAL_VAR_INIT(sqlfdbktableprefix, "erro_") //backwords compatibility with downstream server hosts +GLOBAL_PROTECT(sqlfdbktableprefix) //Database connections //A connection is established on world creation. Ideally, the connection dies when the server restarts (After feedback logging.). -var/DBConnection/dbcon = new() //Feedback database (New database) +GLOBAL_DATUM_INIT(dbcon, /DBConnection, new) //Feedback database (New database) +GLOBAL_PROTECT(dbcon) diff --git a/code/_globalvars/game_modes.dm b/code/_globalvars/game_modes.dm index ab42de0815d3e..1b17c5477be67 100644 --- a/code/_globalvars/game_modes.dm +++ b/code/_globalvars/game_modes.dm @@ -1,5 +1,5 @@ -var/master_mode = "traitor"//"extended" -var/secret_force_mode = "secret" // if this is anything but "secret", the secret rotation will forceably choose this mode +GLOBAL_VAR_INIT(master_mode, "traitor") //"extended" +GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret", the secret rotation will forceably choose this mode -var/wavesecret = 0 // meteor mode, delays wave progression, terrible name -var/datum/station_state/start_state = null // Used in round-end report +GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name +GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm index 0944554d63e41..a0557e8e1bc39 100644 --- a/code/_globalvars/genetics.dm +++ b/code/_globalvars/genetics.dm @@ -1,28 +1,28 @@ ////////////// -var/NEARSIGHTBLOCK = 0 -var/EPILEPSYBLOCK = 0 -var/COUGHBLOCK = 0 -var/TOURETTESBLOCK = 0 -var/NERVOUSBLOCK = 0 -var/BLINDBLOCK = 0 -var/DEAFBLOCK = 0 -var/HULKBLOCK = 0 -var/TELEBLOCK = 0 -var/FIREBLOCK = 0 -var/XRAYBLOCK = 0 -var/CLUMSYBLOCK = 0 -var/STRANGEBLOCK = 0 -var/RACEBLOCK = 0 +GLOBAL_VAR_INIT(NEARSIGHTBLOCK, 0) +GLOBAL_VAR_INIT(EPILEPSYBLOCK, 0) +GLOBAL_VAR_INIT(COUGHBLOCK, 0) +GLOBAL_VAR_INIT(TOURETTESBLOCK, 0) +GLOBAL_VAR_INIT(NERVOUSBLOCK, 0) +GLOBAL_VAR_INIT(BLINDBLOCK, 0) +GLOBAL_VAR_INIT(DEAFBLOCK, 0) +GLOBAL_VAR_INIT(HULKBLOCK, 0) +GLOBAL_VAR_INIT(TELEBLOCK, 0) +GLOBAL_VAR_INIT(FIREBLOCK, 0) +GLOBAL_VAR_INIT(XRAYBLOCK, 0) +GLOBAL_VAR_INIT(CLUMSYBLOCK, 0) +GLOBAL_VAR_INIT(STRANGEBLOCK, 0) +GLOBAL_VAR_INIT(RACEBLOCK, 0) -var/list/bad_se_blocks -var/list/good_se_blocks -var/list/op_se_blocks +GLOBAL_LIST(bad_se_blocks) +GLOBAL_LIST(good_se_blocks) +GLOBAL_LIST(op_se_blocks) -var/NULLED_SE -var/NULLED_UI +GLOBAL_VAR(NULLED_SE) +GLOBAL_VAR(NULLED_UI) -var/list/global_mutations = list() // list of hidden mutation things +GLOBAL_LIST_EMPTY(global_mutations) // list of hidden mutation things -var/list/bad_mutations = list() -var/list/good_mutations = list() -var/list/not_good_mutations = list() \ No newline at end of file +GLOBAL_LIST_EMPTY(bad_mutations) +GLOBAL_LIST_EMPTY(good_mutations) +GLOBAL_LIST_EMPTY(not_good_mutations) \ No newline at end of file diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index fd9680ff976db..7a4ce0c57a0ad 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -1,44 +1,44 @@ //Preferences stuff //Hairstyles -var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hair indexed by name -var/global/list/hair_styles_male_list = list() //stores only hair names -var/global/list/hair_styles_female_list = list() //stores only hair names -var/global/list/facial_hair_styles_list = list() //stores /datum/sprite_accessory/facial_hair indexed by name -var/global/list/facial_hair_styles_male_list = list() //stores only hair names -var/global/list/facial_hair_styles_female_list = list() //stores only hair names +GLOBAL_LIST_EMPTY(hair_styles_list) //stores /datum/sprite_accessory/hair indexed by name +GLOBAL_LIST_EMPTY(hair_styles_male_list) //stores only hair names +GLOBAL_LIST_EMPTY(hair_styles_female_list) //stores only hair names +GLOBAL_LIST_EMPTY(facial_hair_styles_list) //stores /datum/sprite_accessory/facial_hair indexed by name +GLOBAL_LIST_EMPTY(facial_hair_styles_male_list) //stores only hair names +GLOBAL_LIST_EMPTY(facial_hair_styles_female_list) //stores only hair names //Underwear -var/global/list/underwear_list = list() //stores /datum/sprite_accessory/underwear indexed by name -var/global/list/underwear_m = list() //stores only underwear name -var/global/list/underwear_f = list() //stores only underwear name +GLOBAL_LIST_EMPTY(underwear_list) //stores /datum/sprite_accessory/underwear indexed by name +GLOBAL_LIST_EMPTY(underwear_m) //stores only underwear name +GLOBAL_LIST_EMPTY(underwear_f) //stores only underwear name //Undershirts -var/global/list/undershirt_list = list() //stores /datum/sprite_accessory/undershirt indexed by name -var/global/list/undershirt_m = list() //stores only undershirt name -var/global/list/undershirt_f = list() //stores only undershirt name +GLOBAL_LIST_EMPTY(undershirt_list) //stores /datum/sprite_accessory/undershirt indexed by name +GLOBAL_LIST_EMPTY(undershirt_m) //stores only undershirt name +GLOBAL_LIST_EMPTY(undershirt_f) //stores only undershirt name //Socks -var/global/list/socks_list = list() //stores /datum/sprite_accessory/socks indexed by name +GLOBAL_LIST_EMPTY(socks_list) //stores /datum/sprite_accessory/socks indexed by name //Lizard Bits (all datum lists indexed by name) -var/global/list/body_markings_list = list() -var/global/list/tails_list_lizard = list() -var/global/list/animated_tails_list_lizard = list() -var/global/list/snouts_list = list() -var/global/list/horns_list = list() -var/global/list/frills_list = list() -var/global/list/spines_list = list() -var/global/list/legs_list = list() -var/global/list/animated_spines_list = list() +GLOBAL_LIST_EMPTY(body_markings_list) +GLOBAL_LIST_EMPTY(tails_list_lizard) +GLOBAL_LIST_EMPTY(animated_tails_list_lizard) +GLOBAL_LIST_EMPTY(snouts_list) +GLOBAL_LIST_EMPTY(horns_list) +GLOBAL_LIST_EMPTY(frills_list) +GLOBAL_LIST_EMPTY(spines_list) +GLOBAL_LIST_EMPTY(legs_list) +GLOBAL_LIST_EMPTY(animated_spines_list) //Mutant Human bits -var/global/list/tails_list_human = list() -var/global/list/animated_tails_list_human = list() -var/global/list/ears_list = list() -var/global/list/wings_list = list() -var/global/list/wings_open_list = list() -var/global/list/r_wings_list = list() +GLOBAL_LIST_EMPTY(tails_list_human) +GLOBAL_LIST_EMPTY(animated_tails_list_human) +GLOBAL_LIST_EMPTY(ears_list) +GLOBAL_LIST_EMPTY(wings_list) +GLOBAL_LIST_EMPTY(wings_open_list) +GLOBAL_LIST_EMPTY(r_wings_list) -var/global/list/ghost_forms_with_directions_list = list("ghost") //stores the ghost forms that support directional sprites -var/global/list/ghost_forms_with_accessories_list = list("ghost") //stores the ghost forms that support hair and other such things +GLOBAL_LIST_INIT(ghost_forms_with_directions_list, list("ghost")) //stores the ghost forms that support directional sprites +GLOBAL_LIST_INIT(ghost_forms_with_accessories_list, list("ghost")) //stores the ghost forms that support hair and other such things -var/global/list/security_depts_prefs = list(SEC_DEPT_RANDOM, SEC_DEPT_NONE, SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY) +GLOBAL_LIST_INIT(security_depts_prefs, list(SEC_DEPT_RANDOM, SEC_DEPT_NONE, SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY)) //Backpacks #define GBACKPACK "Grey Backpack" @@ -48,21 +48,21 @@ var/global/list/security_depts_prefs = list(SEC_DEPT_RANDOM, SEC_DEPT_NONE, SEC_ #define DBACKPACK "Department Backpack" #define DSATCHEL "Department Satchel" #define DDUFFLEBAG "Department Dufflebag" -var/global/list/backbaglist = list(DBACKPACK, DSATCHEL, DDUFFLEBAG, GBACKPACK, GSATCHEL, GDUFFLEBAG, LSATCHEL) +GLOBAL_LIST_INIT(backbaglist, list(DBACKPACK, DSATCHEL, DDUFFLEBAG, GBACKPACK, GSATCHEL, GDUFFLEBAG, LSATCHEL)) //Uplink spawn loc #define UPLINK_PDA "PDA" #define UPLINK_RADIO "Radio" #define UPLINK_PEN "Pen" //like a real spy! -var/global/list/uplink_spawn_loc_list = list(UPLINK_PDA, UPLINK_RADIO, UPLINK_PEN) +GLOBAL_LIST_INIT(uplink_spawn_loc_list, list(UPLINK_PDA, UPLINK_RADIO, UPLINK_PEN)) //Female Uniforms -var/global/list/female_clothing_icons = list() +GLOBAL_LIST_EMPTY(female_clothing_icons) //radical shit -var/list/hit_appends = list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF") +GLOBAL_LIST_INIT(hit_appends, list("-OOF", "-ACK", "-UGH", "-HRNK", "-HURGH", "-GLORF")) -var/list/scarySounds = list('sound/weapons/thudswoosh.ogg','sound/weapons/Taser.ogg','sound/weapons/armbomb.ogg','sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg','sound/voice/hiss5.ogg','sound/voice/hiss6.ogg','sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg','sound/items/Welder.ogg','sound/items/Welder2.ogg','sound/machines/airlock.ogg','sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg') +GLOBAL_LIST_INIT(scarySounds, list('sound/weapons/thudswoosh.ogg','sound/weapons/Taser.ogg','sound/weapons/armbomb.ogg','sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg','sound/voice/hiss5.ogg','sound/voice/hiss6.ogg','sound/effects/Glassbr1.ogg','sound/effects/Glassbr2.ogg','sound/effects/Glassbr3.ogg','sound/items/Welder.ogg','sound/items/Welder2.ogg','sound/machines/airlock.ogg','sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg')) // Reference list for disposal sort junctions. Set the sortType variable on disposal sort junctions to @@ -96,23 +96,23 @@ var/list/scarySounds = list('sound/weapons/thudswoosh.ogg','sound/weapons/Taser. 23 Genetics */ -var/list/TAGGERLOCATIONS = list("Disposals", +GLOBAL_LIST_INIT(TAGGERLOCATIONS, list("Disposals", "Cargo Bay", "QM Office", "Engineering", "CE Office", "Atmospherics", "Security", "HoS Office", "Medbay", "CMO Office", "Chemistry", "Research", "RD Office", "Robotics", "HoP Office", "Library", "Chapel", "Theatre", - "Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics") + "Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics")) -var/global/list/guitar_notes = flist("sound/guitar/") +GLOBAL_LIST_INIT(guitar_notes, flist("sound/guitar/")) -var/global/list/station_prefixes = list("", "Imperium", "Heretical", "Cuban", +GLOBAL_LIST_INIT(station_prefixes, list("", "Imperium", "Heretical", "Cuban", "Psychic", "Elegant", "Common", "Uncommon", "Rare", "Unique", "Houseruled", "Religious", "Atheist", "Traditional", "Houseruled", "Mad", "Super", "Ultra", "Secret", "Top Secret", "Deep", "Death", "Zybourne", "Central", "Main", "Government", "Uoi", "Fat", - "Automated", "Experimental", "Augmented") + "Automated", "Experimental", "Augmented")) -var/global/list/station_names = list("", "Stanford", "Dorf", "Alium", +GLOBAL_LIST_INIT(station_names, list("", "Stanford", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", @@ -124,9 +124,9 @@ var/global/list/station_names = list("", "Stanford", "Dorf", "Alium", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", - "Robot", "Hats", "Pizza") + "Robot", "Hats", "Pizza")) -var/global/list/station_suffixes = list("Station", "Frontier", +GLOBAL_LIST_INIT(station_suffixes, list("Station", "Frontier", "Suffix", "Death-trap", "Space-hulk", "Lab", "Hazard","Spess Junk", "Fishery", "No-Moon", "Tomb", "Crypt", "Hut", "Monkey", "Bomb", "Trade Post", "Fortress", "Village", "Town", "City", "Edition", "Hive", @@ -135,23 +135,23 @@ var/global/list/station_suffixes = list("Station", "Frontier", "Construct", "Hangar", "Prison", "Center", "Port", "Waystation", "Factory", "Waypoint", "Stopover", "Hub", "HQ", "Office", "Object", "Fortification", "Colony", "Planet-Cracker", "Roost", "Fat Camp", - "Airstrip") + "Airstrip")) -var/global/list/greek_letters = list("Alpha", "Beta", "Gamma", "Delta", +GLOBAL_LIST_INIT(greek_letters, list("Alpha", "Beta", "Gamma", "Delta", "Epsilon", "Zeta", "Eta", "Theta", "Iota", "Kappa", "Lambda", "Mu", "Nu", "Xi", "Omicron", "Pi", "Rho", "Sigma", "Tau", "Upsilon", "Phi", - "Chi", "Psi", "Omega") + "Chi", "Psi", "Omega")) -var/global/list/phonetic_alphabet = list("Alpha", "Bravo", "Charlie", +GLOBAL_LIST_INIT(phonetic_alphabet, list("Alpha", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", "Hotel", "India", "Juliet", "Kilo", "Lima", "Mike", "November", "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", "Victor", "Whiskey", "X-ray", - "Yankee", "Zulu") + "Yankee", "Zulu")) -var/global/list/numbers_as_words = list("One", "Two", "Three", "Four", +GLOBAL_LIST_INIT(numbers_as_words, list("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", - "Eighteen", "Nineteen") + "Eighteen", "Nineteen")) /proc/generate_number_strings() var/list/L @@ -160,4 +160,4 @@ var/global/list/numbers_as_words = list("One", "Two", "Three", "Four", L += "\Roman[i]" return L -var/global/list/station_numerals = greek_letters + phonetic_alphabet + numbers_as_words + generate_number_strings() +GLOBAL_LIST_INIT(station_numerals, greek_letters + phonetic_alphabet + numbers_as_words + generate_number_strings()) diff --git a/code/_globalvars/lists/mapping.dm b/code/_globalvars/lists/mapping.dm index a92c9b363018b..2ec3438892cdf 100644 --- a/code/_globalvars/lists/mapping.dm +++ b/code/_globalvars/lists/mapping.dm @@ -3,18 +3,18 @@ #define Z_SOUTH 3 #define Z_WEST 4 -var/list/cardinal = list( NORTH, SOUTH, EAST, WEST ) -var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) -var/list/diagonals = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) +GLOBAL_LIST_INIT(cardinal, list( NORTH, SOUTH, EAST, WEST )) +GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) +GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) //This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there. //(Exceptions: extended, sandbox and nuke) -Errorage //Was list("3" = 30, "4" = 70). //Spacing should be a reliable method of getting rid of a body -- Urist. //Go away Urist, I'm restoring this to the longer list. ~Errorage -var/list/accessable_z_levels = list(1,3,4,5,6,7) //Keep this to six maps, repeating z-levels is ok if needed +GLOBAL_LIST_INIT(accessable_z_levels, list(1,3,4,5,6,7)) //Keep this to six maps, repeating z-levels is ok if needed -var/global/list/global_map = null +GLOBAL_LIST(global_map) //list/global_map = list(list(1,5),list(4,3))//an array of map Z levels. //Resulting sector map looks like //|_1_|_4_| @@ -25,32 +25,32 @@ var/global/list/global_map = null //3 - AI satellite //5 - empty space -var/list/landmarks_list = list() //list of all landmarks created -var/list/start_landmarks_list = list() //list of all spawn points created -var/list/department_security_spawns = list() //list of all department security spawns -var/list/generic_event_spawns = list() //list of all spawns for events - -var/list/wizardstart = list() -var/list/newplayer_start = list() -var/list/latejoin = list() -var/list/prisonwarp = list() //prisoners go to these -var/list/holdingfacility = list() //captured people go here -var/list/xeno_spawn = list()//Aliens spawn at these. -var/list/tdome1 = list() -var/list/tdome2 = list() -var/list/tdomeobserve = list() -var/list/tdomeadmin = list() -var/list/prisonwarped = list() //list of players already warped -var/list/blobstart = list() -var/list/secequipment = list() -var/list/deathsquadspawn = list() -var/list/emergencyresponseteamspawn = list() -var/list/ruin_landmarks = list() +GLOBAL_LIST_EMPTY(landmarks_list) //list of all landmarks created +GLOBAL_LIST_EMPTY(start_landmarks_list) //list of all spawn points created +GLOBAL_LIST_EMPTY(department_security_spawns) //list of all department security spawns +GLOBAL_LIST_EMPTY(generic_event_spawns) //list of all spawns for events + +GLOBAL_LIST_EMPTY(wizardstart) +GLOBAL_LIST_EMPTY(newplayer_start) +GLOBAL_LIST_EMPTY(latejoin) +GLOBAL_LIST_EMPTY(prisonwarp) //prisoners go to these +GLOBAL_LIST_EMPTY(holdingfacility) //captured people go here +GLOBAL_LIST_EMPTY(xeno_spawn)//Aliens spawn at these. +GLOBAL_LIST_EMPTY(tdome1) +GLOBAL_LIST_EMPTY(tdome2) +GLOBAL_LIST_EMPTY(tdomeobserve) +GLOBAL_LIST_EMPTY(tdomeadmin) +GLOBAL_LIST_EMPTY(prisonwarped) //list of players already warped +GLOBAL_LIST_EMPTY(blobstart) +GLOBAL_LIST_EMPTY(secequipment) +GLOBAL_LIST_EMPTY(deathsquadspawn) +GLOBAL_LIST_EMPTY(emergencyresponseteamspawn) +GLOBAL_LIST_EMPTY(ruin_landmarks) //away missions -var/list/awaydestinations = list() //a list of landmarks that the warpgate can take you to +GLOBAL_LIST_EMPTY(awaydestinations) //a list of landmarks that the warpgate can take you to //used by jump-to-area etc. Updated by area/updateName() -var/list/sortedAreas = list() +GLOBAL_LIST_EMPTY(sortedAreas) -var/list/transit_markers = list() +GLOBAL_LIST_EMPTY(transit_markers) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 91d5b62f64fee..d651074216a17 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -1,18 +1,21 @@ -var/list/clients = list() //all clients -var/list/admins = list() //all clients whom are admins -var/list/deadmins = list() //all clients who have used the de-admin verb. -var/list/directory = list() //all ckeys with associated client -var/list/stealthminID = list() //reference list with IDs that store ckeys, for stealthmins +GLOBAL_LIST_EMPTY(clients) //all clients +GLOBAL_LIST_EMPTY(admins) //all clients whom are admins +GLOBAL_PROTECT(admins) +GLOBAL_LIST_EMPTY(deadmins) //all clients who have used the de-admin verb. +GLOBAL_PROTECT(deadmins) +GLOBAL_LIST_EMPTY(directory) //all ckeys with associated client +GLOBAL_LIST_EMPTY(stealthminID) //reference list with IDs that store ckeys, for stealthmins //Since it didn't really belong in any other category, I'm putting this here //This is for procs to replace all the goddamn 'in world's that are chilling around the code -var/global/list/player_list = list() //all mobs **with clients attached**. Excludes /mob/dead/new_player -var/global/list/mob_list = list() //all mobs, including clientless -var/global/list/living_mob_list = list() //all alive mobs, including clientless. Excludes /mob/dead/new_player -var/global/list/dead_mob_list = list() //all dead mobs, including clientless. Excludes /mob/dead/new_player -var/global/list/joined_player_list = list() //all clients that have joined the game at round-start or as a latejoin. -var/global/list/silicon_mobs = list() //all silicon mobs -var/global/list/pai_list = list() -var/global/list/available_ai_shells = list() -var/global/list/language_datums = list() +GLOBAL_LIST_EMPTY(player_list) //all mobs **with clients attached**. Excludes /mob/dead/new_player +GLOBAL_LIST_EMPTY(mob_list) //all mobs, including clientless +GLOBAL_LIST_EMPTY(living_mob_list) //all alive mobs, including clientless. Excludes /mob/dead/new_player +GLOBAL_LIST_EMPTY(dead_mob_list) //all dead mobs, including clientless. Excludes /mob/dead/new_player +GLOBAL_LIST_EMPTY(joined_player_list) //all clients that have joined the game at round-start or as a latejoin. +GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs +GLOBAL_LIST_EMPTY(ai_list) +GLOBAL_LIST_EMPTY(pai_list) +GLOBAL_LIST_EMPTY(available_ai_shells) +GLOBAL_LIST_EMPTY(language_datums) \ No newline at end of file diff --git a/code/_globalvars/lists/names.dm b/code/_globalvars/lists/names.dm index 902aff9f6289c..7b34552e35d60 100644 --- a/code/_globalvars/lists/names.dm +++ b/code/_globalvars/lists/names.dm @@ -1,23 +1,23 @@ -var/list/ai_names = file2list("config/names/ai.txt") -var/list/wizard_first = file2list("config/names/wizardfirst.txt") -var/list/wizard_second = file2list("config/names/wizardsecond.txt") -var/list/ninja_titles = file2list("config/names/ninjatitle.txt") -var/list/ninja_names = file2list("config/names/ninjaname.txt") -var/list/commando_names = file2list("config/names/death_commando.txt") -var/list/first_names_male = file2list("config/names/first_male.txt") -var/list/first_names_female = file2list("config/names/first_female.txt") -var/list/last_names = file2list("config/names/last.txt") -var/list/lizard_names_male = file2list("config/names/lizard_male.txt") -var/list/lizard_names_female = file2list("config/names/lizard_female.txt") -var/list/clown_names = file2list("config/names/clown.txt") -var/list/mime_names = file2list("config/names/mime.txt") -var/list/carp_names = file2list("config/names/carp.txt") -var/list/golem_names = file2list("config/names/golem.txt") -var/list/plasmaman_names = file2list("config/names/plasmaman.txt") -var/list/posibrain_names = list("PBU","HIU","SINA","ARMA","OSI","HBL","MSO","RR","CHRI","CDB","HG","XSI","ORNG","GUN","KOR","MET","FRE","XIS","SLI","PKP","HOG","RZH","GOOF","MRPR","JJR","FIRC","INC","PHL","BGB","ANTR","MIW","WJ","JRD","CHOC","ANCL","JLLO","JNLG","KOS","TKRG","XAL","STLP","CBOS","DUNC","FXMC","DRSD","COI") +GLOBAL_LIST_INIT(ai_names, file2list("config/names/ai.txt")) +GLOBAL_LIST_INIT(wizard_first, file2list("config/names/wizardfirst.txt")) +GLOBAL_LIST_INIT(wizard_second, file2list("config/names/wizardsecond.txt")) +GLOBAL_LIST_INIT(ninja_titles, file2list("config/names/ninjatitle.txt")) +GLOBAL_LIST_INIT(ninja_names, file2list("config/names/ninjaname.txt")) +GLOBAL_LIST_INIT(commando_names, file2list("config/names/death_commando.txt")) +GLOBAL_LIST_INIT(first_names_male, file2list("config/names/first_male.txt")) +GLOBAL_LIST_INIT(first_names_female, file2list("config/names/first_female.txt")) +GLOBAL_LIST_INIT(last_names, file2list("config/names/last.txt")) +GLOBAL_LIST_INIT(lizard_names_male, file2list("config/names/lizard_male.txt")) +GLOBAL_LIST_INIT(lizard_names_female, file2list("config/names/lizard_female.txt")) +GLOBAL_LIST_INIT(clown_names, file2list("config/names/clown.txt")) +GLOBAL_LIST_INIT(mime_names, file2list("config/names/mime.txt")) +GLOBAL_LIST_INIT(carp_names, file2list("config/names/carp.txt")) +GLOBAL_LIST_INIT(golem_names, file2list("config/names/golem.txt")) +GLOBAL_LIST_INIT(plasmaman_names, file2list("config/names/plasmaman.txt")) +GLOBAL_LIST_INIT(posibrain_names, list("PBU","HIU","SINA","ARMA","OSI","HBL","MSO","RR","CHRI","CDB","HG","XSI","ORNG","GUN","KOR","MET","FRE","XIS","SLI","PKP","HOG","RZH","GOOF","MRPR","JJR","FIRC","INC","PHL","BGB","ANTR","MIW","WJ","JRD","CHOC","ANCL","JLLO","JNLG","KOS","TKRG","XAL","STLP","CBOS","DUNC","FXMC","DRSD","COI")) -var/list/verbs = file2list("config/names/verbs.txt") -var/list/adjectives = file2list("config/names/adjectives.txt") +GLOBAL_LIST_INIT(verbs, file2list("config/names/verbs.txt")) +GLOBAL_LIST_INIT(adjectives, file2list("config/names/adjectives.txt")) //loaded on startup because of " //would include in rsc if ' was used diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index aacef73a0a0e5..5de5d341ee408 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -1,31 +1,34 @@ -var/global/list/cable_list = list() //Index for all cables, so that powernets don't have to look through the entire world all the time -var/global/list/portals = list() //list of all /obj/effect/portal -var/global/list/airlocks = list() //list of all airlocks -var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking. -var/global/list/shuttle_caller_list = list() //list of all communication consoles and AIs, for automatic shuttle calls when there are none. -var/global/list/machines = list() //NOTE: this is a list of ALL machines now. The processing machines list is SSmachines.processing ! -var/global/list/syndicate_shuttle_boards = list() //important to keep track of for managing nukeops war declarations. -var/global/list/navbeacons = list() //list of all bot nagivation beacons, used for patrolling. -var/global/list/teleportbeacons = list() //list of all tracking beacons used by teleporters -var/global/list/deliverybeacons = list() //list of all MULEbot delivery beacons. -var/global/list/deliverybeacontags = list() //list of all tags associated with delivery beacons. -var/global/list/nuke_list = list() -var/global/list/alarmdisplay = list() //list of all machines or programs that can display station alerts -var/global/list/singularities = list() //list of all singularities on the station (actually technically all engines) +GLOBAL_LIST_EMPTY(cable_list) //Index for all cables, so that powernets don't have to look through the entire world all the time +GLOBAL_LIST_EMPTY(portals) //list of all /obj/effect/portal +GLOBAL_LIST_EMPTY(airlocks) //list of all airlocks +GLOBAL_LIST_EMPTY(mechas_list) //list of all mechs. Used by hostile mobs target tracking. +GLOBAL_LIST_EMPTY(shuttle_caller_list) //list of all communication consoles and AIs, for automatic shuttle calls when there are none. +GLOBAL_LIST_EMPTY(machines) //NOTE: this is a list of ALL machines now. The processing machines list is SSmachine.processing ! +GLOBAL_LIST_EMPTY(syndicate_shuttle_boards) //important to keep track of for managing nukeops war declarations. +GLOBAL_LIST_EMPTY(navbeacons) //list of all bot nagivation beacons, used for patrolling. +GLOBAL_LIST_EMPTY(teleportbeacons) //list of all tracking beacons used by teleporters +GLOBAL_LIST_EMPTY(deliverybeacons) //list of all MULEbot delivery beacons. +GLOBAL_LIST_EMPTY(deliverybeacontags) //list of all tags associated with delivery beacons. +GLOBAL_LIST_EMPTY(nuke_list) +GLOBAL_LIST_EMPTY(alarmdisplay) //list of all machines or programs that can display station alerts +GLOBAL_LIST_EMPTY(singularities) //list of all singularities on the station (actually technically all engines) -var/global/list/chemical_reactions_list //list of all /datum/chemical_reaction datums. Used during chemical reactions -var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff -var/global/list/materials_list = list() //list of all /datum/material datums indexed by material id. -var/global/list/tech_list = list() //list of all /datum/tech datums indexed by id. -var/global/list/surgeries_list = list() //list of all surgeries by name, associated with their path. -var/global/list/crafting_recipes = list() //list of all table craft recipes -var/global/list/rcd_list = list() //list of Rapid Construction Devices. -var/global/list/apcs_list = list() //list of all Area Power Controller machines, seperate from machines for powernet speeeeeeed. -var/global/list/tracked_implants = list() //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented... -var/global/list/tracked_chem_implants = list() //list of implants the prisoner console can track and send inject commands too -var/global/list/poi_list = list() //list of points of interest for observe/follow -var/global/list/pinpointer_list = list() //list of all pinpointers. Used to change stuff they are pointing to all at once. -var/global/list/zombie_infection_list = list() // A list of all zombie_infection organs, for any mass "animation" -var/global/list/meteor_list = list() // List of all meteors. -var/global/list/active_jammers = list() // List of active radio jammers -var/global/list/ladders = list() // List of ladders +GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions +GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff +GLOBAL_LIST_EMPTY(materials_list) //list of all /datum/material datums indexed by material id. +GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id. +GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path. +GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes +GLOBAL_LIST_EMPTY(rcd_list) //list of Rapid Construction Devices. +GLOBAL_LIST_EMPTY(apcs_list) //list of all Area Power Controller machines, seperate from machines for powernet speeeeeeed. +GLOBAL_LIST_EMPTY(tracked_implants) //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented... +GLOBAL_LIST_EMPTY(tracked_chem_implants) //list of implants the prisoner console can track and send inject commands too +GLOBAL_LIST_EMPTY(poi_list) //list of points of interest for observe/follow +GLOBAL_LIST_EMPTY(pinpointer_list) //list of all pinpointers. Used to change stuff they are pointing to all at once. +GLOBAL_LIST_EMPTY(zombie_infection_list) // A list of all zombie_infection organs, for any mass "animation" +GLOBAL_LIST_EMPTY(meteor_list) // List of all meteors. +GLOBAL_LIST_EMPTY(active_jammers) // List of active radio jammers +GLOBAL_LIST_EMPTY(ladders) + +GLOBAL_LIST_EMPTY(wire_color_directory) +GLOBAL_LIST_EMPTY(wire_name_directory) \ No newline at end of file diff --git a/code/_globalvars/lists/poll_ignore.dm b/code/_globalvars/lists/poll_ignore.dm index afe97a9213c69..ff6a4edd40346 100644 --- a/code/_globalvars/lists/poll_ignore.dm +++ b/code/_globalvars/lists/poll_ignore.dm @@ -6,4 +6,4 @@ #define POLL_IGNORE_ALIEN_LARVA "alien_larva" #define POLL_IGNORE_CLOCKWORK_MARAUDER "clockwork_marauder" -var/list/poll_ignore = list() +GLOBAL_LIST_EMPTY(poll_ignore) diff --git a/code/_globalvars/lists/typecache.dm b/code/_globalvars/lists/typecache.dm index 5d2565c7f2690..d83c708131ef0 100644 --- a/code/_globalvars/lists/typecache.dm +++ b/code/_globalvars/lists/typecache.dm @@ -3,7 +3,7 @@ //Note: typecache can only replace istype if you know for sure the thing is at least a datum. -var/list/typecache_mob = typecacheof(list(/mob)) +GLOBAL_LIST_INIT(typecache_mob, typecacheof(list(/mob))) diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 5a3919ad1486b..ff17a1d72b491 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -1,16 +1,28 @@ -var/diary = null -var/runtime_diary = null -var/diaryofmeanpeople = null -var/href_logfile = null +GLOBAL_VAR(diary) +GLOBAL_PROTECT(diary) +GLOBAL_VAR(runtime_diary) +GLOBAL_PROTECT(runtime_diary) +GLOBAL_VAR(diaryofmeanpeople) +GLOBAL_PROTECT(diaryofmeanpeople) +GLOBAL_VAR(href_logfile) +GLOBAL_PROTECT(href_logfile) -var/list/bombers = list( ) -var/list/admin_log = list ( ) -var/list/lastsignalers = list( ) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" -var/list/lawchanges = list( ) //Stores who uploaded laws to which silicon-based lifeform, and what the law was +GLOBAL_LIST_EMPTY(bombers) +GLOBAL_PROTECT(bombers) +GLOBAL_LIST_EMPTY(admin_log) +GLOBAL_PROTECT(admin_log) +GLOBAL_LIST_EMPTY(lastsignalers) //keeps last 100 signals here in format: "[src] used \ref[src] @ location [src.loc]: [freq]/[code]" +GLOBAL_PROTECT(lastsignalers) +GLOBAL_LIST_EMPTY(lawchanges) //Stores who uploaded laws to which silicon-based lifeform, and what the law was +GLOBAL_PROTECT(lawchanges) -var/list/combatlog = list() -var/list/IClog = list() -var/list/OOClog = list() -var/list/adminlog = list() +GLOBAL_LIST_EMPTY(combatlog) +GLOBAL_PROTECT(combatlog) +GLOBAL_LIST_EMPTY(IClog) +GLOBAL_PROTECT(IClog) +GLOBAL_LIST_EMPTY(OOClog) +GLOBAL_PROTECT(OOClog) +GLOBAL_LIST_EMPTY(adminlog) +GLOBAL_PROTECT(adminlog) -var/list/active_turfs_startlist = list() +GLOBAL_LIST_EMPTY(active_turfs_startlist) \ No newline at end of file diff --git a/code/_globalvars/misc.dm b/code/_globalvars/misc.dm index c46157af71a7b..331562f110612 100644 --- a/code/_globalvars/misc.dm +++ b/code/_globalvars/misc.dm @@ -1,9 +1,9 @@ -var/admin_notice = "" // Admin notice that all clients see when joining the server +GLOBAL_VAR_INIT(admin_notice, "") // Admin notice that all clients see when joining the server -var/timezoneOffset = 0 // The difference betwen midnight (of the host computer) and 0 world.ticks. +GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the host computer) and 0 world.ticks. // For FTP requests. (i.e. downloading runtime logs.) // However it'd be ok to use for accessing attack logs and such too, which are even laggier. -var/fileaccess_timer = 0 +GLOBAL_VAR_INIT(fileaccess_timer, 0) -var/TAB = "    " \ No newline at end of file +GLOBAL_VAR_INIT(TAB, "    ") \ No newline at end of file diff --git a/code/_globalvars/station.dm b/code/_globalvars/station.dm index d29077272ccb0..ae13a9c58582c 100644 --- a/code/_globalvars/station.dm +++ b/code/_globalvars/station.dm @@ -1,8 +1,6 @@ -var/global/datum/datacore/data_core = null -//var/global/defer_powernet_rebuild = 0 // true if net rebuild will be called manually after an event -//Noble idea, but doing this made GC fail. The gains from waiting on deffering are lost by using del() +GLOBAL_DATUM(data_core, /datum/datacore) -var/CELLRATE = 0.002 // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) -var/CHARGELEVEL = 0.001 // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) +GLOBAL_VAR_INIT(CELLRATE, 0.002) // multiplier for watts per tick <> cell storage (eg: .002 means if there is a load of 1000 watts, 20 units will be taken from a cell per second) +GLOBAL_VAR_INIT(CHARGELEVEL, 0.001) // Cap for how fast cells charge, as a percentage-per-tick (.001 means cellcharge is capped to 1% per second) -var/list/powernets = list() \ No newline at end of file +GLOBAL_LIST_EMPTY(powernets) \ No newline at end of file diff --git a/code/js/byjax.dm b/code/_js/byjax.dm similarity index 95% rename from code/js/byjax.dm rename to code/_js/byjax.dm index bf9d7789891fe..90d103838047a 100644 --- a/code/js/byjax.dm +++ b/code/_js/byjax.dm @@ -1,5 +1,5 @@ //this function places received data into element with specified id. -var/const/js_byjax = {" +#define js_byjax {" function replaceContent() { var args = Array.prototype.slice.call(arguments); diff --git a/code/js/menus.dm b/code/_js/menus.dm similarity index 95% rename from code/js/menus.dm rename to code/_js/menus.dm index 69ff900db67ac..76a92469edb6a 100644 --- a/code/js/menus.dm +++ b/code/_js/menus.dm @@ -1,4 +1,4 @@ -var/const/js_dropdowns = {" +#define js_dropdowns {" function dropdowns() { var divs = document.getElementsByTagName('div'); var headers = new Array(); diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm index 246e06e9a94a5..6b4d9aad1ce0f 100644 --- a/code/_onclick/ai.dm +++ b/code/_onclick/ai.dm @@ -37,7 +37,7 @@ var/turf/pixel_turf = get_turf_pixel(A) var/turf_visible if(pixel_turf) - turf_visible = cameranet.checkTurfVis(pixel_turf) + turf_visible = GLOB.cameranet.checkTurfVis(pixel_turf) if(!turf_visible) if(istype(loc, /obj/item/device/aicard) && (pixel_turf in view(client.view, loc))) turf_visible = TRUE @@ -190,4 +190,4 @@ // /mob/living/silicon/ai/TurfAdjacent(var/turf/T) - return (cameranet && cameranet.checkTurfVis(T)) + return (GLOB.cameranet && GLOB.cameranet.checkTurfVis(T)) diff --git a/code/_onclick/hud/ai.dm b/code/_onclick/hud/ai.dm index abaafd386a949..a5bc86dabe3ae 100644 --- a/code/_onclick/hud/ai.dm +++ b/code/_onclick/hud/ai.dm @@ -53,7 +53,7 @@ if(..()) return var/mob/living/silicon/ai/AI = usr - crewmonitor.show(AI) + GLOB.crewmonitor.show(AI) /obj/screen/ai/crew_manifest name = "Crew Manifest" diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 5f21d372ff73f..e83cfadedf593 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -276,7 +276,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." return ..() /obj/screen/alert/clockwork/scripture_reqs/process() - if(clockwork_gateway_activated) + if(GLOB.clockwork_gateway_activated) qdel(src) return var/current_state @@ -288,7 +288,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." icon_state = "no" if(!current_state) name = "Current Objective" - for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects) + for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects) var/area/gate_area = get_area(G) desc = "Protect the Ark at [gate_area.map_name]!" return @@ -298,7 +298,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." name = "Next Tier Requirements" var/validservants = 0 var/unconverted_ais_exist = get_unconverted_ais() - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L) && (ishuman(L) || issilicon(L))) validservants++ var/req_servants = 0 @@ -328,14 +328,14 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." icon_state += "-servants" //in this manner, generate an icon key based on what we're missing else textlist += ": \[CHECK\]" - textlist += "
[clockwork_caches]/[req_caches] Tinkerer's Caches" - if(clockwork_caches < req_caches) + textlist += "
[GLOB.clockwork_caches]/[req_caches] Tinkerer's Caches" + if(GLOB.clockwork_caches < req_caches) icon_state += "-caches" else textlist += ": \[CHECK\]" if(req_cv) //cv only shows up if the tier requires it - textlist += "
[clockwork_construction_value]/[req_cv] Construction Value" - if(clockwork_construction_value < req_cv) + textlist += "
[GLOB.clockwork_construction_value]/[req_cv] Construction Value" + if(GLOB.clockwork_construction_value < req_cv) icon_state += "-cv" else textlist += ": \[CHECK\]" @@ -356,7 +356,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." icon_state = "clockinfo" /obj/screen/alert/clockwork/infodump/MouseEntered(location,control,params) - if(ratvar_awakens) + if(GLOB.ratvar_awakens) desc = "CHETR
NYY
HAGEHUGF-NAQ-UBABE
RATVAR.
" else var/servants = 0 @@ -364,7 +364,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." var/unconverted_ais_exist = get_unconverted_ais() var/list/scripture_states = scripture_unlock_check() var/list/textlist - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L)) servants++ if(ishuman(L) || issilicon(L)) @@ -376,13 +376,13 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." textlist = list("[servants] Servants, [validservants ? "[validservants] of which counts":"none of which count"] towards scripture.
") else textlist = list("[servants] Servant, who [validservants ? "counts":"does not count"] towards scripture.
") - textlist += "[clockwork_caches ? "[clockwork_caches] Tinkerer's Caches.":"No Tinkerer's Caches, construct one!"]
\ - [clockwork_construction_value] Construction Value.
" - if(clockwork_daemons) - textlist += "[clockwork_daemons] Tinkerer's Daemons: [servants * 0.2 < clockwork_daemons ? "DISABLED":"ACTIVE"]
" + textlist += "[GLOB.clockwork_caches ? "[GLOB.clockwork_caches] Tinkerer's Caches.":"No Tinkerer's Caches, construct one!"]
\ + [GLOB.clockwork_construction_value] Construction Value.
" + if(GLOB.clockwork_daemons) + textlist += "[GLOB.clockwork_daemons] Tinkerer's Daemons: [servants * 0.2 < GLOB.clockwork_daemons ? "DISABLED":"ACTIVE"]
" else textlist += "No Tinkerer's Daemons.
" - for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects) + for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects) var/area/gate_area = get_area(G) textlist += "Ark Location: [uppertext(gate_area.map_name)]
" if(G.still_needs_components()) @@ -399,10 +399,10 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." else textlist += "An unconverted AI exists!
" if(scripture_states[SCRIPTURE_REVENANT]) - var/inathneq_available = clockwork_generals_invoked["inath-neq"] <= world.time - var/sevtug_available = clockwork_generals_invoked["sevtug"] <= world.time - var/nezbere_available = clockwork_generals_invoked["nezbere"] <= world.time - var/nezcrentr_available = clockwork_generals_invoked["nzcrentr"] <= world.time + var/inathneq_available = GLOB.clockwork_generals_invoked["inath-neq"] <= world.time + var/sevtug_available = GLOB.clockwork_generals_invoked["sevtug"] <= world.time + var/nezbere_available = GLOB.clockwork_generals_invoked["nezbere"] <= world.time + var/nezcrentr_available = GLOB.clockwork_generals_invoked["nzcrentr"] <= world.time if(inathneq_available || sevtug_available || nezbere_available || nezcrentr_available) textlist += "Generals available:[inathneq_available ? "
INATH-NEQ":""][sevtug_available ? "
SEVTUG":""]\ [nezbere_available ? "
NEZBERE":""][nezcrentr_available ? "
NZCRENTR":""]

" diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 41318281821eb..90b3983d82160 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -3,7 +3,6 @@ This needs more thinking out, but I might as well. */ -var/const/tk_maxrange = 15 /* Telekinetic attack: @@ -136,7 +135,7 @@ var/const/tk_maxrange = 15 /proc/tkMaxRangeCheck(mob/user, atom/target) var/d = get_dist(user, target) - if(d > tk_maxrange) + if(d > TK_MAXRANGE) to_chat(user, "Your mind won't reach that far.") return return TRUE diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index adbe17f2c78e8..a51549cc99f7c 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -267,7 +267,7 @@ if(M.config_tag) if(!(M.config_tag in modes)) // ensure each mode is added only once - diary << "Adding game mode [M.name] ([M.config_tag]) to configuration." + GLOB.diary << "Adding game mode [M.name] ([M.config_tag]) to configuration." modes += M.config_tag mode_names[M.config_tag] = M.name probabilities[M.config_tag] = M.probability @@ -391,7 +391,7 @@ if("guest_jobban") config.guest_jobban = 1 if("guest_ban") - guests_allowed = 0 + GLOB.guests_allowed = 0 if("usewhitelist") config.usewhitelist = TRUE if("allow_metadata") @@ -421,9 +421,9 @@ if("automute_on") automute_on = 1 if("comms_key") - global.comms_key = value + GLOB.comms_key = value if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins - global.comms_allowed = 1 + GLOB.comms_allowed = 1 if("cross_server_address") cross_address = value if(value != "byond:\\address:port") @@ -437,9 +437,9 @@ if(value != "byond:\\address:port") allow_panic_bunker_bounce = 1 if("medal_hub_address") - global.medal_hub = value + GLOB.medal_hub = value if("medal_hub_password") - global.medal_pass = value + GLOB.medal_pass = value if("show_irc_name") config.showircname = 1 if("see_own_notes") @@ -480,9 +480,9 @@ if("log_runtimes") log_runtimes = TRUE var/newlog = file("data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log") - if(runtime_diary != newlog) + if(GLOB.runtime_diary != newlog) world.log << "Now logging runtimes to data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log" - runtime_diary = newlog + GLOB.runtime_diary = newlog if("autoconvert_notes") config.autoconvert_notes = 1 if("allow_webclient") @@ -526,7 +526,7 @@ if("error_msg_delay") error_msg_delay = text2num(value) else - diary << "Unknown setting in configuration: '[name]'" + GLOB.diary << "Unknown setting in configuration: '[name]'" else if(type == "game_options") switch(name) @@ -589,13 +589,13 @@ if(mode_name in config.modes) config.continuous[mode_name] = 1 else - diary << "Unknown continuous configuration definition: [mode_name]." + GLOB.diary << "Unknown continuous configuration definition: [mode_name]." if("midround_antag") var/mode_name = lowertext(value) if(mode_name in config.modes) config.midround_antag[mode_name] = 1 else - diary << "Unknown midround antagonist configuration definition: [mode_name]." + GLOB.diary << "Unknown midround antagonist configuration definition: [mode_name]." if("midround_antag_time_check") config.midround_antag_time_check = text2num(value) if("midround_antag_life_check") @@ -611,9 +611,9 @@ if(mode_name in config.modes) config.min_pop[mode_name] = text2num(mode_value) else - diary << "Unknown minimum population configuration definition: [mode_name]." + GLOB.diary << "Unknown minimum population configuration definition: [mode_name]." else - diary << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." + GLOB.diary << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." if("max_pop") var/pop_pos = findtext(value, " ") var/mode_name = null @@ -625,9 +625,9 @@ if(mode_name in config.modes) config.max_pop[mode_name] = text2num(mode_value) else - diary << "Unknown maximum population configuration definition: [mode_name]." + GLOB.diary << "Unknown maximum population configuration definition: [mode_name]." else - diary << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." + GLOB.diary << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." if("shuttle_refuel_delay") config.shuttle_refuel_delay = text2num(value) if("show_game_type_odds") @@ -655,9 +655,9 @@ if(prob_name in config.modes) config.probabilities[prob_name] = text2num(prob_value) else - diary << "Unknown game mode probability configuration definition: [prob_name]." + GLOB.diary << "Unknown game mode probability configuration definition: [prob_name]." else - diary << "Incorrect probability configuration definition: [prob_name] [prob_value]." + GLOB.diary << "Incorrect probability configuration definition: [prob_name] [prob_value]." if("protect_roles_from_antagonist") config.protect_roles_from_antagonist = 1 @@ -704,7 +704,7 @@ // Value is in the form "LAWID,NUMBER" var/list/L = splittext(value, ",") if(L.len != 2) - diary << "Invalid LAW_WEIGHT: " + t + GLOB.diary << "Invalid LAW_WEIGHT: " + t continue var/lawid = L[1] var/weight = text2num(L[2]) @@ -716,10 +716,10 @@ config.mutant_races = 1 if("roundstart_races") var/race_id = lowertext(value) - for(var/species_id in species_list) + for(var/species_id in GLOB.species_list) if(species_id == race_id) - roundstart_races += species_list[species_id] - roundstart_species[species_id] = species_list[species_id] + roundstart_races += GLOB.species_list[species_id] + GLOB.roundstart_species[species_id] = GLOB.species_list[species_id] if("join_with_mutant_humans") config.mutant_humans = 1 if("assistant_cap") @@ -747,17 +747,17 @@ if (BombCap < 4) BombCap = 4 - MAX_EX_DEVESTATION_RANGE = round(BombCap/4) - MAX_EX_HEAVY_RANGE = round(BombCap/2) - MAX_EX_LIGHT_RANGE = BombCap - MAX_EX_FLASH_RANGE = BombCap - MAX_EX_FLAME_RANGE = BombCap + GLOB.MAX_EX_DEVESTATION_RANGE = round(BombCap/4) + GLOB.MAX_EX_HEAVY_RANGE = round(BombCap/2) + GLOB.MAX_EX_LIGHT_RANGE = BombCap + GLOB.MAX_EX_FLASH_RANGE = BombCap + GLOB.MAX_EX_FLAME_RANGE = BombCap if("arrivals_shuttle_dock_window") config.arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value)) if("arrivals_shuttle_require_safe_latejoin") config.arrivals_shuttle_require_safe_latejoin = text2num(value) else - diary << "Unknown setting in configuration: '[name]'" + GLOB.diary << "Unknown setting in configuration: '[name]'" fps = round(fps) if(fps <= 0) @@ -811,7 +811,7 @@ config.maplist[currentmap.map_name] = currentmap currentmap = null else - diary << "Unknown command in map vote config: '[command]'" + GLOB.diary << "Unknown command in map vote config: '[command]'" /datum/configuration/proc/loadsql(filename) @@ -843,19 +843,19 @@ if("sql_enabled") config.sql_enabled = 1 if("address") - sqladdress = value + GLOB.sqladdress = value if("port") - sqlport = value + GLOB.sqlport = value if("feedback_database") - sqlfdbkdb = value + GLOB.sqlfdbkdb = value if("feedback_login") - sqlfdbklogin = value + GLOB.sqlfdbklogin = value if("feedback_password") - sqlfdbkpass = value + GLOB.sqlfdbkpass = value if("feedback_tableprefix") - sqlfdbktableprefix = value + GLOB.sqlfdbktableprefix = value else - diary << "Unknown setting in configuration: '[name]'" + GLOB.diary << "Unknown setting in configuration: '[name]'" /datum/configuration/proc/pick_mode(mode_name) // I wish I didn't have to instance the game modes in order to look up diff --git a/code/controllers/failsafe.dm b/code/controllers/failsafe.dm index be4477df1b98b..e69733dab303c 100644 --- a/code/controllers/failsafe.dm +++ b/code/controllers/failsafe.dm @@ -4,7 +4,7 @@ * Pretty much pokes the MC to make sure it's still alive. **/ -var/datum/controller/failsafe/Failsafe +GLOBAL_REAL(Failsafe, /datum/controller/failsafe) /datum/controller/failsafe // This thing pretty much just keeps poking the master controller name = "Failsafe" @@ -56,23 +56,23 @@ var/datum/controller/failsafe/Failsafe if(4,5) --defcon if(3) - to_chat(admins, "Notice: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks.") + to_chat(GLOB.admins, "Notice: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks.") --defcon if(2) - to_chat(admins, "Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.") + to_chat(GLOB.admins, "Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.") --defcon if(1) - to_chat(admins, "Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting...") + to_chat(GLOB.admins, "Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting...") --defcon var/rtn = Recreate_MC() if(rtn > 0) defcon = 4 master_iteration = 0 - to_chat(admins, "MC restarted successfully") + to_chat(GLOB.admins, "MC restarted successfully") else if(rtn < 0) log_game("FailSafe: Could not restart MC, runtime encountered. Entering defcon 0") - to_chat(admins, "ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying.") + to_chat(GLOB.admins, "ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying.") //if the return number was 0, it just means the mc was restarted too recently, and it just needs some time before we try again //no need to handle that specially when defcon 0 can handle it if(0) //DEFCON 0! (mc failed to restart) @@ -80,7 +80,7 @@ var/datum/controller/failsafe/Failsafe if(rtn > 0) defcon = 4 master_iteration = 0 - to_chat(admins, "MC restarted successfully") + to_chat(GLOB.admins, "MC restarted successfully") else defcon = min(defcon + 1,5) master_iteration = Master.iteration diff --git a/code/controllers/globals.dm b/code/controllers/globals.dm new file mode 100644 index 0000000000000..3799230ac4d7a --- /dev/null +++ b/code/controllers/globals.dm @@ -0,0 +1,62 @@ +GLOBAL_REAL(GLOB, /datum/controller/global_vars) + +/datum/controller/global_vars + name = "Global Variables" + + var/list/gvars_datum_protected_varlist + var/list/gvars_datum_in_built_vars + var/list/gvars_datum_init_order + +/datum/controller/global_vars/New() + if(GLOB) + CRASH("Multiple instances of global variable controller created") + GLOB = src + + var/datum/controller/exclude_these = new + gvars_datum_in_built_vars = exclude_these.vars + list("gvars_datum_protected_varlist", "gvars_datum_in_built_vars", "gvars_datum_init_order") + qdel(exclude_these) + + Initialize() + +/datum/controller/global_vars/Destroy(force) + if(!force) + return QDEL_HINT_LETMELIVE + + stack_trace("Some fucker deleted the global holder!") + + QDEL_NULL(statclick) + gvars_datum_protected_varlist.Cut() + gvars_datum_in_built_vars.Cut() + + GLOB = null + + return ..() + +/datum/controller/global_vars/stat_entry() + if(!statclick) + statclick = new/obj/effect/statclick/debug(null, "Initializing...", src) + + var/static/num_globals + if(!num_globals) + num_globals = vars.len - gvars_datum_in_built_vars.len + stat("Globals:", statclick.update("Count: [num_globals]")) + +/datum/controller/global_vars/vv_get_var(var_name) + if(var_name in gvars_datum_protected_varlist) + return debug_variable(var_name, "SECRET", 0, src) + return ..() + +/datum/controller/global_vars/vv_edit_var(var_name, var_value) + if((var_name in gvars_datum_protected_varlist)) + return FALSE + return ..() + +/datum/controller/global_vars/Initialize() + gvars_datum_init_order = list() + gvars_datum_protected_varlist = list("gvars_datum_protected_varlist") + for(var/I in vars - gvars_datum_in_built_vars) + var/start_tick = world.time + call(src, "InitGlobal[I]")() + var/end_tick = world.time + if(end_tick - start_tick) + warning("Global [I] slept during initialization!") diff --git a/code/controllers/master.dm b/code/controllers/master.dm index aba7a16396cee..259524bb0c950 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -6,15 +6,18 @@ * Odds are, there is a reason * **/ -var/datum/controller/master/Master = new() -var/MC_restart_clear = 0 -var/MC_restart_timeout = 0 -var/MC_restart_count = 0 + +//This is the ABSOLUTE ONLY THING that should init globally like this +GLOBAL_REAL(Master, /datum/controller/master) = new + +GLOBAL_VAR_INIT(MC_restart_clear, 0) +GLOBAL_VAR_INIT(MC_restart_timeout, 0) +GLOBAL_VAR_INIT(MC_restart_count, 0) //current tick limit, assigned by the queue controller before running a subsystem. //used by check_tick as well so that the procs subsystems call can obey that SS's tick limits -var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING +GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING) /datum/controller/master name = "Master" @@ -62,6 +65,9 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING else init_subtypes(/datum/controller/subsystem, subsystems) Master = src + + if(!GLOB) + new /datum/controller/global_vars /datum/controller/master/Destroy() ..() @@ -77,14 +83,14 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING // -1 if we encountered a runtime trying to recreate it /proc/Recreate_MC() . = -1 //so if we runtime, things know we failed - if (world.time < MC_restart_timeout) + if (world.time < GLOB.MC_restart_timeout) return 0 - if (world.time < MC_restart_clear) - MC_restart_count *= 0.5 + if (world.time < GLOB.MC_restart_clear) + GLOB.MC_restart_count *= 0.5 - var/delay = 50 * ++MC_restart_count - MC_restart_timeout = world.time + delay - MC_restart_clear = world.time + (delay * 2) + var/delay = 50 * ++GLOB.MC_restart_count + GLOB.MC_restart_timeout = world.time + delay + GLOB.MC_restart_clear = world.time + (delay * 2) Master.processing = 0 //stop ticking this one try new/datum/controller/master() @@ -120,7 +126,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING msg = "The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined." BadBoy.flags |= SS_NO_FIRE if(msg) - to_chat(admins, "[msg]") + to_chat(GLOB.admins, "[msg]") log_world(msg) if (istype(Master.subsystems)) @@ -151,13 +157,13 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING var/start_timeofday = REALTIMEOFDAY // Initialize subsystems. - CURRENT_TICKLIMIT = config.tick_limit_mc_init + GLOB.CURRENT_TICKLIMIT = config.tick_limit_mc_init for (var/datum/controller/subsystem/SS in subsystems) if (SS.flags & SS_NO_INIT) continue SS.Initialize(REALTIMEOFDAY) CHECK_TICK - CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING + GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING var/time = (REALTIMEOFDAY - start_timeofday) / 10 var/msg = "Initializations complete within [time] second[time == 1 ? "" : "s"]!" @@ -260,7 +266,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING while (1) tickdrift = max(0, MC_AVERAGE_FAST(tickdrift, (((REALTIMEOFDAY - init_timeofday) - (world.time - init_time)) / world.tick_lag))) if (processing <= 0) - CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING + GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING sleep(10) continue @@ -268,7 +274,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING // because sleeps are processed in the order received, so longer sleeps are more likely to run first if (world.tick_usage > TICK_LIMIT_MC) sleep_delta += 2 - CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.5) + GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.5) sleep(world.tick_lag * (processing + sleep_delta)) continue @@ -297,7 +303,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING if (!error_level) iteration++ error_level++ - CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING + GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING sleep(10) continue @@ -309,7 +315,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING if (!error_level) iteration++ error_level++ - CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING + GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING sleep(10) continue error_level-- @@ -320,7 +326,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING iteration++ last_run = world.time src.sleep_delta = MC_AVERAGE_FAST(src.sleep_delta, sleep_delta) - CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.25) //reserve the tail 1/4 of the next tick for the mc. + GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.25) //reserve the tail 1/4 of the next tick for the mc. sleep(world.tick_lag * (processing + sleep_delta)) @@ -409,7 +415,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING else tick_precentage = tick_remaining - CURRENT_TICKLIMIT = world.tick_usage + tick_precentage + GLOB.CURRENT_TICKLIMIT = world.tick_usage + tick_precentage if (!(queue_node_flags & SS_TICKER)) ran_non_ticker = TRUE diff --git a/code/controllers/subsystem/acid.dm b/code/controllers/subsystem/acid.dm index e5a67ab7334a5..a0a506499fd63 100644 --- a/code/controllers/subsystem/acid.dm +++ b/code/controllers/subsystem/acid.dm @@ -28,7 +28,7 @@ SUBSYSTEM_DEF(acid) if(O.acid_level && O.acid_processing()) else - O.cut_overlay(acid_overlay, TRUE) + O.cut_overlay(GLOB.acid_overlay, TRUE) processing -= O if (MC_TICK_CHECK) diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index e9277c821dbce..852e28077de0c 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -299,7 +299,7 @@ SUBSYSTEM_DEF(air) var/timer = world.timeofday warning("There are [starting_ats] active turfs at roundstart, this is a mapping error caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required)") for(var/turf/T in active_turfs) - active_turfs_startlist += text("[T.x], [T.y], [T.z]\n") + GLOB.active_turfs_startlist += text("[T.x], [T.y], [T.z]\n") //now lets clear out these active turfs var/list/turfs_to_check = active_turfs.Copy() diff --git a/code/controllers/subsystem/assets.dm b/code/controllers/subsystem/assets.dm index bb809d76a8f28..ac8f51de0ed02 100644 --- a/code/controllers/subsystem/assets.dm +++ b/code/controllers/subsystem/assets.dm @@ -9,6 +9,6 @@ SUBSYSTEM_DEF(assets) var/datum/asset/A = new type() A.register() - for(var/client/C in clients) + for(var/client/C in GLOB.clients) addtimer(CALLBACK(GLOBAL_PROC, .proc/getFilesSlow, C, cache, FALSE), 10) ..() \ No newline at end of file diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index dccb5a5984933..7f1ee2634b456 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -13,7 +13,7 @@ SUBSYSTEM_DEF(atoms) var/list/late_loaders /datum/controller/subsystem/atoms/Initialize(timeofday) - fire_overlay.appearance_flags = RESET_COLOR + GLOB.fire_overlay.appearance_flags = RESET_COLOR setupGenetics() //to set the mutations' place in structural enzymes, so monkey.initialize() knows where to put the monkey mutation. initialized = INITIALIZATION_INNEW_MAPLOAD InitializeAtoms() @@ -103,9 +103,9 @@ SUBSYSTEM_DEF(atoms) continue B.dna_block = pick_n_take(avnums) if(B.quality == POSITIVE) - good_mutations |= B + GLOB.good_mutations |= B else if(B.quality == NEGATIVE) - bad_mutations |= B + GLOB.bad_mutations |= B else if(B.quality == MINOR_NEGATIVE) - not_good_mutations |= B + GLOB.not_good_mutations |= B CHECK_TICK diff --git a/code/controllers/subsystem/augury.dm b/code/controllers/subsystem/augury.dm index 636df46df5e58..851234fde57bc 100644 --- a/code/controllers/subsystem/augury.dm +++ b/code/controllers/subsystem/augury.dm @@ -28,7 +28,7 @@ SUBSYSTEM_DEF(augury) biggest_threat = threat if(doombringers.len) - for(var/i in player_list) + for(var/i in GLOB.player_list) if(isobserver(i) && (!(observers_given_action[i]))) var/datum/action/innate/augury/A = new A.Grant(i) diff --git a/code/controllers/subsystem/disease.dm b/code/controllers/subsystem/disease.dm index fa629df7abd87..8b867146a663b 100644 --- a/code/controllers/subsystem/disease.dm +++ b/code/controllers/subsystem/disease.dm @@ -5,6 +5,21 @@ SUBSYSTEM_DEF(disease) var/list/currentrun = list() var/list/processing = list() + var/list/diseases + var/list/archive_diseases = list() + + var/static/list/list_symptoms = subtypesof(/datum/symptom) + +/datum/controller/subsystem/disease/PreInit() + if(!diseases) + diseases = subtypesof(/datum/disease) + +/datum/controller/subsystem/disease/Recover() + currentrun = SSdisease.currentrun + processing = SSdisease.processing + diseases = SSdisease.diseases + archive_diseases = SSdisease.archive_diseases + /datum/controller/subsystem/disease/stat_entry(msg) ..("P:[processing.len]") diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index 23a8464c0ef7e..cae880485c925 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -107,7 +107,7 @@ SUBSYSTEM_DEF(events) /area/engine/chiefs_office) //Need to locate() as it's just a list of paths. - return locate(pick((the_station_areas - safe_areas) + danger_areas)) + return locate(pick((GLOB.the_station_areas - safe_areas) + danger_areas)) //allows a client to trigger an event diff --git a/code/controllers/subsystem/garbage.dm b/code/controllers/subsystem/garbage.dm index f851abcad5e78..b88c06cdb935a 100644 --- a/code/controllers/subsystem/garbage.dm +++ b/code/controllers/subsystem/garbage.dm @@ -259,7 +259,7 @@ SUBSYSTEM_DEF(garbage) testing("Beginning search for references to a [type].") last_find_references = world.time - find_references_in_globals() + DoSearchVar(GLOB) for(var/datum/thing in world) DoSearchVar(thing, "WorldRef: [thing]") testing("Completed search for references to a [type].") @@ -309,8 +309,6 @@ SUBSYSTEM_DEF(garbage) usr << browse(dat, "window=qdeletedlog") -#define SearchVar(X) DoSearchVar(X, "Global: " + #X) - /datum/proc/DoSearchVar(X, Xname) if(usr && usr.client && !usr.client.running_find_references) return if(istype(X, /datum)) @@ -341,676 +339,4 @@ SUBSYSTEM_DEF(garbage) #else CHECK_TICK #endif - -//if find_references isn't working for some datum -//update this list using tools/DMTreeToGlobalsList -/datum/proc/find_references_in_globals() - SearchVar(clockwork_construction_value) - SearchVar(clockwork_caches) - SearchVar(clockwork_daemons) - SearchVar(clockwork_generals_invoked) - SearchVar(all_clockwork_objects) - SearchVar(all_clockwork_mobs) - SearchVar(clockwork_component_cache) - SearchVar(ratvar_awakens) - SearchVar(clockwork_gateway_activated) - SearchVar(all_scripture) - SearchVar(pointed_types) - SearchVar(bloody_footprints_cache) - SearchVar(ghost_accs_options) - SearchVar(ghost_others_options) - SearchVar(special_roles) - SearchVar(string_cache) - SearchVar(string_filename_current_key) - SearchVar(cmp_field) - SearchVar(friendly_animal_types) - SearchVar(humanoid_icon_cache) - SearchVar(freeze_item_icons) - SearchVar(E) - SearchVar(Sqrt2) - SearchVar(sqrtTable) - SearchVar(gaussian_next) - SearchVar(skin_tones) - SearchVar(species_list) - SearchVar(roundstart_species) - SearchVar(church_name) - SearchVar(command_name) - SearchVar(religion_name) - SearchVar(syndicate_name) - SearchVar(syndicate_code_phrase) - SearchVar(syndicate_code_response) - SearchVar(zero_character_only) - SearchVar(hex_characters) - SearchVar(alphabet) - SearchVar(binary) - SearchVar(can_embed_types) - SearchVar(WALLITEMS) - SearchVar(WALLITEMS_EXTERNAL) - SearchVar(WALLITEMS_INVERSE) - SearchVar(sortInstance) - SearchVar(config) - SearchVar(host) - SearchVar(join_motd) - SearchVar(station_name) - SearchVar(game_version) - SearchVar(changelog_hash) - SearchVar(ooc_allowed) - SearchVar(dooc_allowed) - SearchVar(abandon_allowed) - SearchVar(enter_allowed) - SearchVar(guests_allowed) - SearchVar(shuttle_frozen) - SearchVar(shuttle_left) - SearchVar(tinted_weldhelh) - SearchVar(Debug) - SearchVar(Debug2) - SearchVar(comms_key) - SearchVar(comms_allowed) - SearchVar(medal_hub) - SearchVar(medal_pass) - SearchVar(medals_enabled) - SearchVar(MAX_EX_DEVESTATION_RANGE) - SearchVar(MAX_EX_HEAVY_RANGE) - SearchVar(MAX_EX_LIGHT_RANGE) - SearchVar(MAX_EX_FLASH_RANGE) - SearchVar(MAX_EX_FLAME_RANGE) - SearchVar(DYN_EX_SCALE) - SearchVar(sqladdress) - SearchVar(sqlport) - SearchVar(sqlfdbkdb) - SearchVar(sqlfdbklogin) - SearchVar(sqlfdbkpass) - SearchVar(sqlfdbktableprefix) - SearchVar(dbcon) - SearchVar(master_mode) - SearchVar(secret_force_mode) - SearchVar(wavesecret) - SearchVar(start_state) - SearchVar(NEARSIGHTBLOCK) - SearchVar(EPILEPSYBLOCK) - SearchVar(COUGHBLOCK) - SearchVar(TOURETTESBLOCK) - SearchVar(NERVOUSBLOCK) - SearchVar(BLINDBLOCK) - SearchVar(DEAFBLOCK) - SearchVar(HULKBLOCK) - SearchVar(TELEBLOCK) - SearchVar(FIREBLOCK) - SearchVar(XRAYBLOCK) - SearchVar(CLUMSYBLOCK) - SearchVar(STRANGEBLOCK) - SearchVar(RACEBLOCK) - SearchVar(bad_se_blocks) - SearchVar(good_se_blocks) - SearchVar(op_se_blocks) - SearchVar(NULLED_SE) - SearchVar(NULLED_UI) - SearchVar(global_mutations) - SearchVar(bad_mutations) - SearchVar(good_mutations) - SearchVar(not_good_mutations) - SearchVar(diary) - SearchVar(diaryofmeanpeople) - SearchVar(href_logfile) - SearchVar(bombers) - SearchVar(admin_log) - SearchVar(lastsignalers) - SearchVar(lawchanges) - SearchVar(combatlog) - SearchVar(IClog) - SearchVar(OOClog) - SearchVar(adminlog) - SearchVar(active_turfs_startlist) - SearchVar(admin_notice) - SearchVar(timezoneOffset) - SearchVar(fileaccess_timer) - SearchVar(TAB) - SearchVar(data_core) - SearchVar(CELLRATE) - SearchVar(CHARGELEVEL) - SearchVar(powernets) - SearchVar(hair_styles_list) - SearchVar(hair_styles_male_list) - SearchVar(hair_styles_female_list) - SearchVar(facial_hair_styles_list) - SearchVar(facial_hair_styles_male_list) - SearchVar(facial_hair_styles_female_list) - SearchVar(underwear_list) - SearchVar(underwear_m) - SearchVar(underwear_f) - SearchVar(undershirt_list) - SearchVar(undershirt_m) - SearchVar(undershirt_f) - SearchVar(socks_list) - SearchVar(body_markings_list) - SearchVar(tails_list_lizard) - SearchVar(animated_tails_list_lizard) - SearchVar(snouts_list) - SearchVar(horns_list) - SearchVar(frills_list) - SearchVar(spines_list) - SearchVar(legs_list) - SearchVar(animated_spines_list) - SearchVar(tails_list_human) - SearchVar(animated_tails_list_human) - SearchVar(ears_list) - SearchVar(wings_list) - SearchVar(wings_open_list) - SearchVar(r_wings_list) - SearchVar(ghost_forms_with_directions_list) - SearchVar(ghost_forms_with_accessories_list) - SearchVar(security_depts_prefs) - SearchVar(backbaglist) - SearchVar(uplink_spawn_loc_list) - SearchVar(female_clothing_icons) - SearchVar(hit_appends) - SearchVar(scarySounds) - SearchVar(TAGGERLOCATIONS) - SearchVar(guitar_notes) - SearchVar(station_prefixes) - SearchVar(station_names) - SearchVar(station_suffixes) - SearchVar(greek_letters) - SearchVar(phonetic_alphabet) - SearchVar(numbers_as_words) - SearchVar(station_numerals) - SearchVar(cardinal) - SearchVar(alldirs) - SearchVar(diagonals) - SearchVar(accessable_z_levels) - SearchVar(global_map) - SearchVar(landmarks_list) - SearchVar(start_landmarks_list) - SearchVar(department_security_spawns) - SearchVar(generic_event_spawns) - SearchVar(wizardstart) - SearchVar(newplayer_start) - SearchVar(latejoin) - SearchVar(prisonwarp) - SearchVar(holdingfacility) - SearchVar(xeno_spawn) - SearchVar(tdome1) - SearchVar(tdome2) - SearchVar(tdomeobserve) - SearchVar(tdomeadmin) - SearchVar(prisonwarped) - SearchVar(blobstart) - SearchVar(secequipment) - SearchVar(deathsquadspawn) - SearchVar(emergencyresponseteamspawn) - SearchVar(ruin_landmarks) - SearchVar(awaydestinations) - SearchVar(sortedAreas) - SearchVar(transit_markers) - SearchVar(clients) - SearchVar(admins) - SearchVar(deadmins) - SearchVar(directory) - SearchVar(stealthminID) - SearchVar(player_list) - SearchVar(mob_list) - SearchVar(living_mob_list) - SearchVar(dead_mob_list) - SearchVar(joined_player_list) - SearchVar(silicon_mobs) - SearchVar(pai_list) - SearchVar(ai_names) - SearchVar(wizard_first) - SearchVar(wizard_second) - SearchVar(ninja_titles) - SearchVar(ninja_names) - SearchVar(commando_names) - SearchVar(first_names_male) - SearchVar(first_names_female) - SearchVar(last_names) - SearchVar(lizard_names_male) - SearchVar(lizard_names_female) - SearchVar(clown_names) - SearchVar(mime_names) - SearchVar(carp_names) - SearchVar(golem_names) - SearchVar(plasmaman_names) - SearchVar(verbs) - SearchVar(adjectives) - SearchVar(cable_list) - SearchVar(portals) - SearchVar(airlocks) - SearchVar(mechas_list) - SearchVar(shuttle_caller_list) - SearchVar(machines) - SearchVar(syndicate_shuttle_boards) - SearchVar(navbeacons) - SearchVar(teleportbeacons) - SearchVar(deliverybeacons) - SearchVar(deliverybeacontags) - SearchVar(nuke_list) - SearchVar(alarmdisplay) - SearchVar(chemical_reactions_list) - SearchVar(chemical_reagents_list) - SearchVar(materials_list) - SearchVar(tech_list) - SearchVar(surgeries_list) - SearchVar(crafting_recipes) - SearchVar(rcd_list) - SearchVar(apcs_list) - SearchVar(tracked_implants) - SearchVar(tracked_chem_implants) - SearchVar(poi_list) - SearchVar(pinpointer_list) - SearchVar(zombie_infection_list) - SearchVar(meteor_list) - SearchVar(poll_ignore) - SearchVar(typecache_mob) - SearchVar(tk_maxrange) - SearchVar(Failsafe) - SearchVar(Master) - SearchVar(MC_restart_clear) - SearchVar(MC_restart_timeout) - SearchVar(MC_restart_count) - SearchVar(CURRENT_TICKLIMIT) - SearchVar(SSacid) - SearchVar(SSair) - SearchVar(SSassets) - SearchVar(SSaugury) - SearchVar(SScommunications) - SearchVar(SSdisease) - SearchVar(SSevents) - SearchVar(SSfire_burning) - SearchVar(SSgarbage) - SearchVar(SSicon_smooth) - SearchVar(SSipintel) - SearchVar(SSjob) - SearchVar(SSlighting) - SearchVar(SSmachines) - SearchVar(SSmapping) - SearchVar(SSminimap) - SearchVar(SSmobs) - SearchVar(SSnpcpool) - SearchVar(SSorbit) - SearchVar(SSpai) - SearchVar(pai_card_list) - SearchVar(SSparallax) - SearchVar(SSpersistence) - SearchVar(SSping) - SearchVar(SSradio) - SearchVar(SSreligion) - SearchVar(SSserver_maint) - SearchVar(SSshuttle) - SearchVar(SSspacedrift) - SearchVar(SSsqueak) - SearchVar(SSstickyban) - SearchVar(SSsun) - SearchVar(SStgui) - SearchVar(SSthrowing) - SearchVar(round_start_time) - SearchVar(SSticker) - SearchVar(SStimer) - SearchVar(SSvote) - SearchVar(SSweather) - SearchVar(SSfastprocess) - SearchVar(SSflightpacks) - SearchVar(SSobj) - SearchVar(SSprocessing) - SearchVar(record_id_num) - SearchVar(emote_list) - SearchVar(huds) - SearchVar(diseases) - SearchVar(archive_diseases) - SearchVar(advance_cures) - SearchVar(list_symptoms) - SearchVar(dictionary_symptoms) - SearchVar(SYMPTOM_ACTIVATION_PROB) - SearchVar(revdata) - SearchVar(all_status_effects) - SearchVar(wire_colors) - SearchVar(wire_color_directory) - SearchVar(wire_name_directory) - SearchVar(blood_splatter_icons) - SearchVar(all_radios) - SearchVar(radiochannels) - SearchVar(radiochannelsreverse) - SearchVar(SYND_FREQ) - SearchVar(SUPP_FREQ) - SearchVar(SERV_FREQ) - SearchVar(SCI_FREQ) - SearchVar(COMM_FREQ) - SearchVar(MED_FREQ) - SearchVar(ENG_FREQ) - SearchVar(SEC_FREQ) - SearchVar(CENTCOM_FREQ) - SearchVar(AIPRIV_FREQ) - SearchVar(RADIO_TO_AIRALARM) - SearchVar(RADIO_FROM_AIRALARM) - SearchVar(RADIO_CHAT) - SearchVar(RADIO_ATMOSIA) - SearchVar(RADIO_NAVBEACONS) - SearchVar(RADIO_AIRLOCK) - SearchVar(RADIO_MAGNETS) - SearchVar(pointers) - SearchVar(freqtospan) - SearchVar(teleportlocs) - SearchVar(the_station_areas) - SearchVar(possible_items) - SearchVar(possible_items_special) - SearchVar(blobs) - SearchVar(blob_cores) - SearchVar(overminds) - SearchVar(blob_nodes) - SearchVar(blobs_legit) - SearchVar(possible_changeling_IDs) - SearchVar(slots) - SearchVar(slot2slot) - SearchVar(slot2type) - SearchVar(hivemind_bank) - SearchVar(blacklisted_pylon_turfs) - SearchVar(non_revealed_runes) - SearchVar(teleport_runes) - SearchVar(wall_runes) - SearchVar(whiteness) - SearchVar(allDevils) - SearchVar(lawlorify) - SearchVar(gang_name_pool) - SearchVar(gang_colors_pool) - SearchVar(borers) - SearchVar(total_borer_hosts_needed) - SearchVar(bomb_set) - SearchVar(hsboxspawn) - SearchVar(multiverse) - SearchVar(announcement_systems) - SearchVar(doppler_arrays) - SearchVar(HOLOPAD_MODE) - SearchVar(holopads) - SearchVar(news_network) - SearchVar(allCasters) - SearchVar(SAFETY_COOLDOWN) - SearchVar(req_console_assistance) - SearchVar(req_console_supplies) - SearchVar(req_console_information) - SearchVar(allConsoles) - SearchVar(time_last_changed_position) - SearchVar(CALL_SHUTTLE_REASON_LENGTH) - SearchVar(crewmonitor) - SearchVar(possible_uplinker_IDs) - SearchVar(airlock_overlays) - SearchVar(pipeID2State) - SearchVar(telecomms_list) - SearchVar(recentmessages) - SearchVar(message_delay) - SearchVar(year) - SearchVar(year_integer) - SearchVar(explosionid) - SearchVar(fire_overlay) - SearchVar(acid_overlay) - SearchVar(BUMP_TELEPORTERS) - SearchVar(blacklisted_glowshroom_turfs) - SearchVar(PDAs) - SearchVar(rod_recipes) - SearchVar(glass_recipes) - SearchVar(reinforced_glass_recipes) - SearchVar(human_recipes) - SearchVar(corgi_recipes) - SearchVar(monkey_recipes) - SearchVar(xeno_recipes) - SearchVar(sinew_recipes) - SearchVar(sandstone_recipes) - SearchVar(sandbag_recipes) - SearchVar(diamond_recipes) - SearchVar(uranium_recipes) - SearchVar(plasma_recipes) - SearchVar(gold_recipes) - SearchVar(silver_recipes) - SearchVar(clown_recipes) - SearchVar(titanium_recipes) - SearchVar(plastitanium_recipes) - SearchVar(snow_recipes) - SearchVar(abductor_recipes) - SearchVar(metal_recipes) - SearchVar(plasteel_recipes) - SearchVar(wood_recipes) - SearchVar(cloth_recipes) - SearchVar(cardboard_recipes) - SearchVar(runed_metal_recipes) - SearchVar(brass_recipes) - SearchVar(disposalpipeID2State) - SearchVar(RPD_recipes) - SearchVar(biblenames) - SearchVar(biblestates) - SearchVar(bibleitemstates) - SearchVar(globalBlankCanvases) - SearchVar(crematoriums) - SearchVar(icons_to_ignore_at_floor_init) - SearchVar(js_byjax) - SearchVar(js_dropdowns) - SearchVar(BSACooldown) - SearchVar(admin_ranks) - SearchVar(admin_verbs_default) - SearchVar(admin_verbs_admin) - SearchVar(admin_verbs_ban) - SearchVar(admin_verbs_sounds) - SearchVar(admin_verbs_fun) - SearchVar(admin_verbs_spawn) - SearchVar(admin_verbs_server) - SearchVar(admin_verbs_debug) - SearchVar(admin_verbs_possess) - SearchVar(admin_verbs_permissions) - SearchVar(admin_verbs_rejuv) - SearchVar(admin_verbs_hideable) - SearchVar(create_object_html) - SearchVar(create_object_forms) - SearchVar(admin_datums) - SearchVar(CMinutes) - SearchVar(Banlist) - SearchVar(whitelist) - SearchVar(TYPES_SHORTCUTS) - SearchVar(intercom_range_display_status) - SearchVar(admin_verbs_debug_mapping) - SearchVar(say_disabled) - SearchVar(VVlocked) - SearchVar(VVicon_edit_lock) - SearchVar(VVckey_edit) - SearchVar(VVpixelmovement) - SearchVar(highlander) - SearchVar(admin_sound) - SearchVar(custom_outfits) - SearchVar(meta_gas_info) - SearchVar(gaslist_cache) - SearchVar(hardcoded_gases) - SearchVar(pipenetwarnings) - SearchVar(the_gateway) - SearchVar(potentialRandomZlevels) - SearchVar(use_preloader) - SearchVar(_preloader) - SearchVar(sc_safecode1) - SearchVar(sc_safecode2) - SearchVar(sc_safecode3) - SearchVar(sc_safecode4) - SearchVar(sc_safecode5) - SearchVar(exports_list) - SearchVar(clientmessages) - SearchVar(preferences_datums) - SearchVar(ghost_forms) - SearchVar(ghost_orbits) - SearchVar(normal_ooc_colour) - SearchVar(damaged_clothes_icons) - SearchVar(emojis) - SearchVar(non_fakeattack_weapons) - SearchVar(cards_against_space) - SearchVar(chem_t1_reagents) - SearchVar(chem_t2_reagents) - SearchVar(chem_t3_reagents) - SearchVar(chem_t4_reagents) - SearchVar(ENGSEC) - SearchVar(CAPTAIN) - SearchVar(HOS) - SearchVar(WARDEN) - SearchVar(DETECTIVE) - SearchVar(OFFICER) - SearchVar(CHIEF) - SearchVar(ENGINEER) - SearchVar(ATMOSTECH) - SearchVar(ROBOTICIST) - SearchVar(AI) - SearchVar(CYBORG) - SearchVar(MEDSCI) - SearchVar(RD) - SearchVar(SCIENTIST) - SearchVar(CHEMIST) - SearchVar(CMO) - SearchVar(DOCTOR) - SearchVar(GENETICIST) - SearchVar(VIROLOGIST) - SearchVar(CIVILIAN) - SearchVar(HOP) - SearchVar(BARTENDER) - SearchVar(BOTANIST) - SearchVar(COOK) - SearchVar(JANITOR) - SearchVar(LIBRARIAN) - SearchVar(QUARTERMASTER) - SearchVar(CARGOTECH) - SearchVar(MINER) - SearchVar(LAWYER) - SearchVar(CHAPLAIN) - SearchVar(CLOWN) - SearchVar(MIME) - SearchVar(ASSISTANT) - SearchVar(assistant_occupations) - SearchVar(command_positions) - SearchVar(engineering_positions) - SearchVar(medical_positions) - SearchVar(science_positions) - SearchVar(supply_positions) - SearchVar(civilian_positions) - SearchVar(security_positions) - SearchVar(nonhuman_positions) - SearchVar(cap_expand) - SearchVar(cmo_expand) - SearchVar(hos_expand) - SearchVar(hop_expand) - SearchVar(rd_expand) - SearchVar(ce_expand) - SearchVar(qm_expand) - SearchVar(sec_expand) - SearchVar(engi_expand) - SearchVar(atmos_expand) - SearchVar(doc_expand) - SearchVar(mine_expand) - SearchVar(chef_expand) - SearchVar(borg_expand) - SearchVar(available_depts) - SearchVar(cachedbooks) - SearchVar(total_extraction_beacons) - SearchVar(next_mob_id) - SearchVar(firstname) - SearchVar(ghost_darkness_images) - SearchVar(ghost_images_full) - SearchVar(ghost_images_default) - SearchVar(ghost_images_simple) - SearchVar(department_radio_keys) - SearchVar(crit_allowed_modes) - SearchVar(ventcrawl_machinery) - SearchVar(posibrain_notif_cooldown) - SearchVar(NO_SLIP_WHEN_WALKING) - SearchVar(SLIDE) - SearchVar(GALOSHES_DONT_HELP) - SearchVar(SLIDE_ICE) - SearchVar(limb_icon_cache) - SearchVar(default_martial_art) - SearchVar(plasmaman_on_fire) - SearchVar(ai_list) - SearchVar(announcing_vox) - SearchVar(VOX_DELAY) - SearchVar(vox_sounds) - SearchVar(CHUNK_SIZE) - SearchVar(cameranet) - SearchVar(mulebot_count) - SearchVar(MAX_CHICKENS) - SearchVar(chicken_count) - SearchVar(parasites) - SearchVar(protected_objects) - SearchVar(AISwarmers) - SearchVar(AISwarmersByType) - SearchVar(AISwarmerCapsByType) - SearchVar(slime_colours) - SearchVar(global_modular_computers) - SearchVar(file_uid) - SearchVar(nttransfer_uid) - SearchVar(ntnet_card_uid) - SearchVar(ntnet_global) - SearchVar(ntnrc_uid) - SearchVar(employmentCabinets) - SearchVar(cable_coil_recipes) - SearchVar(gravity_generators) - SearchVar(POWER_IDLE) - SearchVar(POWER_UP) - SearchVar(POWER_DOWN) - SearchVar(GRAV_NEEDS_SCREWDRIVER) - SearchVar(GRAV_NEEDS_WELDING) - SearchVar(GRAV_NEEDS_PLASTEEL) - SearchVar(GRAV_NEEDS_WRENCH) - SearchVar(rad_collectors) - SearchVar(blacklisted_tesla_types) - SearchVar(TOUCH) - SearchVar(INGEST) - SearchVar(VAPOR) - SearchVar(PATCH) - SearchVar(INJECT) - SearchVar(chemical_mob_spawn_meancritters) - SearchVar(chemical_mob_spawn_nicecritters) - SearchVar(message_servers) - SearchVar(blackbox) - SearchVar(keycard_events) - SearchVar(blacklisted_cargo_types) - SearchVar(z_levels_list) - SearchVar(spells) - SearchVar(non_simple_animals) - SearchVar(FrozenAccounts) - SearchVar(stockExchange) - SearchVar(stun_words) - SearchVar(weaken_words) - SearchVar(sleep_words) - SearchVar(vomit_words) - SearchVar(silence_words) - SearchVar(hallucinate_words) - SearchVar(wakeup_words) - SearchVar(heal_words) - SearchVar(hurt_words) - SearchVar(bleed_words) - SearchVar(burn_words) - SearchVar(hot_words) - SearchVar(cold_words) - SearchVar(repulse_words) - SearchVar(attract_words) - SearchVar(whoareyou_words) - SearchVar(saymyname_words) - SearchVar(knockknock_words) - SearchVar(statelaws_words) - SearchVar(move_words) - SearchVar(left_words) - SearchVar(right_words) - SearchVar(up_words) - SearchVar(down_words) - SearchVar(walk_words) - SearchVar(run_words) - SearchVar(helpintent_words) - SearchVar(disarmintent_words) - SearchVar(grabintent_words) - SearchVar(harmintent_words) - SearchVar(throwmode_words) - SearchVar(flip_words) - SearchVar(speak_words) - SearchVar(rest_words) - SearchVar(getup_words) - SearchVar(sit_words) - SearchVar(stand_words) - SearchVar(dance_words) - SearchVar(jump_words) - SearchVar(salute_words) - SearchVar(deathgasp_words) - SearchVar(clap_words) - SearchVar(honk_words) - SearchVar(multispin_words) - SearchVar(GPS_list) - SearchVar(uplinks) - SearchVar(uplink_items) #endif diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index f9982cadac5ed..517c72512cb49 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -46,7 +46,7 @@ SUBSYSTEM_DEF(job) /datum/controller/subsystem/job/proc/Debug(text) - if(!Debug2) + if(!GLOB.Debug2) return 0 job_debug.Add(text) return 1 @@ -118,7 +118,7 @@ SUBSYSTEM_DEF(job) if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring! continue - if(job.title in command_positions) //If you want a command position, select it! + if(job.title in GLOB.command_positions) //If you want a command position, select it! continue if(jobban_isbanned(player, job.title)) @@ -144,7 +144,7 @@ SUBSYSTEM_DEF(job) return TRUE /datum/controller/subsystem/job/proc/ResetOccupations() - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) if((player) && (player.mind)) player.mind.assigned_role = null player.mind.special_role = null @@ -158,7 +158,7 @@ SUBSYSTEM_DEF(job) //This is basically to ensure that there's atleast a few heads in the round /datum/controller/subsystem/job/proc/FillHeadPosition() for(var/level = 1 to 3) - for(var/command_position in command_positions) + for(var/command_position in GLOB.command_positions) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -176,7 +176,7 @@ SUBSYSTEM_DEF(job) //This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level //This is also to ensure we get as many heads as possible /datum/controller/subsystem/job/proc/CheckHeadPositions(level) - for(var/command_position in command_positions) + for(var/command_position in GLOB.command_positions) var/datum/job/job = GetJob(command_position) if(!job) continue @@ -222,7 +222,7 @@ SUBSYSTEM_DEF(job) A.spawn_positions = 3 //Get the players who are ready - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) if(player.ready && player.mind && !player.mind.assigned_role) unassigned += player @@ -370,7 +370,7 @@ SUBSYSTEM_DEF(job) //If we joined at roundstart we should be positioned at our workstation if(!joined_late) var/obj/S = null - for(var/obj/effect/landmark/start/sloc in start_landmarks_list) + for(var/obj/effect/landmark/start/sloc in GLOB.start_landmarks_list) if(sloc.name != rank) S = sloc //so we can revert to spawning them on top of eachother if something goes wrong continue @@ -380,7 +380,7 @@ SUBSYSTEM_DEF(job) break if(!S) //if there isn't a spawnpoint send them to latejoin, if there's no latejoin go yell at your mapper log_world("Couldn't find a round start spawn point for [rank]") - S = get_turf(pick(latejoin)) + S = get_turf(pick(GLOB.latejoin)) if(!S) //final attempt, lets find some area in the arrivals shuttle to spawn them in to. log_world("Couldn't find a round start latejoin spawn point.") for(var/turf/T in get_area_turfs(/area/shuttle/arrival)) @@ -439,10 +439,10 @@ SUBSYSTEM_DEF(job) if(equip_needed < 0) // -1: infinite available slots equip_needed = 12 for(var/i=equip_needed-5, i>0, i--) - if(secequipment.len) - var/spawnloc = secequipment[1] + if(GLOB.secequipment.len) + var/spawnloc = GLOB.secequipment[1] new /obj/structure/closet/secure_closet/security/sec(spawnloc) - secequipment -= spawnloc + GLOB.secequipment -= spawnloc else //We ran out of spare locker spawns! break @@ -465,7 +465,7 @@ SUBSYSTEM_DEF(job) var/level4 = 0 //never var/level5 = 0 //banned var/level6 = 0 //account too young - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) if(!(player.ready && player.mind && !player.mind.assigned_role)) continue //This player is not ready if(jobban_isbanned(player, job.title)) diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm index 01e01e0093381..a6547cd9038a0 100644 --- a/code/controllers/subsystem/lighting.dm +++ b/code/controllers/subsystem/lighting.dm @@ -1,6 +1,6 @@ -var/list/lighting_update_lights = list() // List of lighting sources queued for update. -var/list/lighting_update_corners = list() // List of lighting corners queued for update. -var/list/lighting_update_objects = list() // List of lighting objects queued for update. +GLOBAL_LIST_EMPTY(lighting_update_lights) // List of lighting sources queued for update. +GLOBAL_LIST_EMPTY(lighting_update_corners) // List of lighting corners queued for update. +GLOBAL_LIST_EMPTY(lighting_update_objects) // List of lighting objects queued for update. SUBSYSTEM_DEF(lighting) name = "Lighting" @@ -11,7 +11,7 @@ SUBSYSTEM_DEF(lighting) var/initialized = FALSE /datum/controller/subsystem/lighting/stat_entry() - ..("L:[lighting_update_lights.len]|C:[lighting_update_corners.len]|O:[lighting_update_objects.len]") + ..("L:[GLOB.lighting_update_lights.len]|C:[GLOB.lighting_update_corners.len]|O:[GLOB.lighting_update_objects.len]") /datum/controller/subsystem/lighting/Initialize(timeofday) @@ -30,11 +30,11 @@ SUBSYSTEM_DEF(lighting) /datum/controller/subsystem/lighting/fire(resumed, init_tick_checks) var/real_tick_limit if(!init_tick_checks) - real_tick_limit = CURRENT_TICKLIMIT - CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage) / 3) + world.tick_usage + real_tick_limit = GLOB.CURRENT_TICKLIMIT + GLOB.CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage) / 3) + world.tick_usage var/i = 0 - for (i in 1 to lighting_update_lights.len) - var/datum/light_source/L = lighting_update_lights[i] + for (i in 1 to GLOB.lighting_update_lights.len) + var/datum/light_source/L = GLOB.lighting_update_lights[i] if (L.check() || L.destroyed || L.force_update) L.remove_lum() @@ -53,14 +53,14 @@ SUBSYSTEM_DEF(lighting) else if (MC_TICK_CHECK) break if (i) - lighting_update_lights.Cut(1, i+1) + GLOB.lighting_update_lights.Cut(1, i+1) i = 0 if(!init_tick_checks) - CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage)/2)+world.tick_usage + GLOB.CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage)/2)+world.tick_usage - for (i in 1 to lighting_update_corners.len) - var/datum/lighting_corner/C = lighting_update_corners[i] + for (i in 1 to GLOB.lighting_update_corners.len) + var/datum/lighting_corner/C = GLOB.lighting_update_corners[i] C.update_objects() C.needs_update = FALSE @@ -69,15 +69,15 @@ SUBSYSTEM_DEF(lighting) else if (MC_TICK_CHECK) break if (i) - lighting_update_corners.Cut(1, i+1) + GLOB.lighting_update_corners.Cut(1, i+1) i = 0 if(!init_tick_checks) - CURRENT_TICKLIMIT = real_tick_limit + GLOB.CURRENT_TICKLIMIT = real_tick_limit - for (i in 1 to lighting_update_objects.len) - var/atom/movable/lighting_object/O = lighting_update_objects[i] + for (i in 1 to GLOB.lighting_update_objects.len) + var/atom/movable/lighting_object/O = GLOB.lighting_update_objects[i] if (QDELETED(O)) continue @@ -89,7 +89,7 @@ SUBSYSTEM_DEF(lighting) else if (MC_TICK_CHECK) break if (i) - lighting_update_objects.Cut(1, i+1) + GLOB.lighting_update_objects.Cut(1, i+1) /datum/controller/subsystem/lighting/Recover() diff --git a/code/controllers/subsystem/machines.dm b/code/controllers/subsystem/machines.dm index e22505721902c..985275208173c 100644 --- a/code/controllers/subsystem/machines.dm +++ b/code/controllers/subsystem/machines.dm @@ -16,7 +16,7 @@ SUBSYSTEM_DEF(machines) qdel(PN) powernets.Cut() - for(var/obj/structure/cable/PC in cable_list) + for(var/obj/structure/cable/PC in GLOB.cable_list) if(!PC.powernet) var/datum/powernet/NewPN = new() NewPN.add_cable(PC) diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index a5cf141158ff3..bae759ac3aa42 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -133,11 +133,11 @@ SUBSYSTEM_DEF(mapping) #undef INIT_ANNOUNCE /datum/controller/subsystem/mapping/proc/maprotate() - var/players = clients.len + var/players = GLOB.clients.len var/list/mapvotes = list() //count votes if(global.config.allow_map_voting) - for (var/client/c in clients) + for (var/client/c in GLOB.clients) var/vote = c.prefs.preferred_map if (!vote) if (global.config.defaultmap) diff --git a/code/controllers/subsystem/mobs.dm b/code/controllers/subsystem/mobs.dm index 749230307fc39..44cd2e33b36eb 100644 --- a/code/controllers/subsystem/mobs.dm +++ b/code/controllers/subsystem/mobs.dm @@ -7,13 +7,13 @@ SUBSYSTEM_DEF(mobs) var/list/currentrun = list() /datum/controller/subsystem/mobs/stat_entry() - ..("P:[mob_list.len]") + ..("P:[GLOB.mob_list.len]") /datum/controller/subsystem/mobs/fire(resumed = 0) var/seconds = wait * 0.1 if (!resumed) - src.currentrun = mob_list.Copy() + src.currentrun = GLOB.mob_list.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun @@ -24,6 +24,6 @@ SUBSYSTEM_DEF(mobs) if(M) M.Life(seconds) else - mob_list.Remove(M) + GLOB.mob_list.Remove(M) if (MC_TICK_CHECK) return \ No newline at end of file diff --git a/code/controllers/subsystem/pai.dm b/code/controllers/subsystem/pai.dm index 06efe772ec362..dfb41c8905953 100644 --- a/code/controllers/subsystem/pai.dm +++ b/code/controllers/subsystem/pai.dm @@ -1,4 +1,3 @@ -var/list/obj/item/device/paicard/pai_card_list = list() SUBSYSTEM_DEF(pai) name = "pAI" @@ -7,6 +6,7 @@ SUBSYSTEM_DEF(pai) var/list/candidates = list() var/ghost_spam = FALSE var/spam_delay = 100 + var/list/pai_card_list = list() /datum/controller/subsystem/pai/Topic(href, href_list[]) if(href_list["download"]) @@ -19,7 +19,7 @@ SUBSYSTEM_DEF(pai) return FALSE var/mob/living/silicon/pai/pai = new(card) if(!candidate.name) - pai.name = pick(ninja_names) + pai.name = pick(GLOB.ninja_names) else pai.name = candidate.name pai.real_name = pai.name @@ -136,7 +136,7 @@ SUBSYSTEM_DEF(pai) /datum/controller/subsystem/pai/proc/check_ready(var/datum/paiCandidate/C) if(!C.ready) return FALSE - for(var/mob/dead/observer/O in player_list) + for(var/mob/dead/observer/O in GLOB.player_list) if(O.key == C.key) return C return FALSE @@ -144,7 +144,7 @@ SUBSYSTEM_DEF(pai) /datum/controller/subsystem/pai/proc/findPAI(obj/item/device/paicard/p, mob/user) if(!ghost_spam) ghost_spam = TRUE - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) if(!G.key || !G.client) continue if(!(ROLE_PAI in G.client.prefs.be_special)) diff --git a/code/controllers/subsystem/parallax.dm b/code/controllers/subsystem/parallax.dm index d7db234b8838f..6ce2928f895d3 100644 --- a/code/controllers/subsystem/parallax.dm +++ b/code/controllers/subsystem/parallax.dm @@ -7,7 +7,7 @@ SUBSYSTEM_DEF(parallax) /datum/controller/subsystem/parallax/fire(resumed = 0) if (!resumed) - src.currentrun = clients.Copy() + src.currentrun = GLOB.clients.Copy() //cache for sanic speed (lists are references anyways) var/list/currentrun = src.currentrun diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index 932d61793f20d..80517d1e3a10a 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -66,7 +66,7 @@ SUBSYSTEM_DEF(persistence) return 1 /datum/controller/subsystem/persistence/proc/LoadPoly() - for(var/mob/living/simple_animal/parrot/Poly/P in living_mob_list) + for(var/mob/living/simple_animal/parrot/Poly/P in GLOB.living_mob_list) twitterize(P.speech_buffer, "polytalk") break //Who's been duping the bird?! diff --git a/code/controllers/subsystem/ping.dm b/code/controllers/subsystem/ping.dm index 40bdf94ffbff4..0829766174d86 100644 --- a/code/controllers/subsystem/ping.dm +++ b/code/controllers/subsystem/ping.dm @@ -9,7 +9,7 @@ SUBSYSTEM_DEF(ping) /datum/controller/subsystem/ping/fire(resumed = FALSE) if (!resumed) - src.currentrun = clients.Copy() + src.currentrun = GLOB.clients.Copy() var/list/currentrun = src.currentrun while (length(currentrun)) diff --git a/code/controllers/subsystem/processing/flightpacks.dm b/code/controllers/subsystem/processing/flightpacks.dm index d425005e79b3b..1d8581187845e 100644 --- a/code/controllers/subsystem/processing/flightpacks.dm +++ b/code/controllers/subsystem/processing/flightpacks.dm @@ -1,4 +1,3 @@ - PROCESSING_SUBSYSTEM_DEF(flightpacks) name = "Flightpack Movement" priority = 30 diff --git a/code/controllers/subsystem/server_maint.dm b/code/controllers/subsystem/server_maint.dm index 31daf11f25445..84d0d333e4389 100644 --- a/code/controllers/subsystem/server_maint.dm +++ b/code/controllers/subsystem/server_maint.dm @@ -11,7 +11,7 @@ SUBSYSTEM_DEF(server_maint) /datum/controller/subsystem/server_maint/fire() //handle kicking inactive players if(config.kick_inactive > 0) - for(var/client/C in clients) + for(var/client/C in GLOB.clients) if(C.is_afk(INACTIVITY_KICK)) if(!istype(C.mob, /mob/dead)) log_access("AFK: [key_name(C)]") diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 551a2b07ec556..fc882f408d51b 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -71,12 +71,12 @@ SUBSYSTEM_DEF(shuttle) ..() /datum/controller/subsystem/shuttle/proc/setup_transit_zone() - if(transit_markers.len == 0) + if(GLOB.transit_markers.len == 0) WARNING("No /obj/effect/landmark/transit placed on the map!") return // transit zone - var/turf/A = get_turf(transit_markers[1]) - var/turf/B = get_turf(transit_markers[2]) + var/turf/A = get_turf(GLOB.transit_markers[1]) + var/turf/B = get_turf(GLOB.transit_markers[2]) for(var/i in block(A, B)) var/turf/T = i T.ChangeTurf(/turf/open/space) @@ -85,11 +85,11 @@ SUBSYSTEM_DEF(shuttle) #ifdef HIGHLIGHT_DYNAMIC_TRANSIT /datum/controller/subsystem/shuttle/proc/color_space() - if(transit_markers.len == 0) + if(GLOB.transit_markers.len == 0) WARNING("No /obj/effect/landmark/transit placed on the map!") return - var/turf/A = get_turf(transit_markers[1]) - var/turf/B = get_turf(transit_markers[2]) + var/turf/A = get_turf(GLOB.transit_markers[1]) + var/turf/B = get_turf(GLOB.transit_markers[2]) for(var/i in block(A, B)) var/turf/T = i // Only dying the "pure" space, not the transit tiles @@ -174,8 +174,8 @@ SUBSYSTEM_DEF(shuttle) return emergency = backup_shuttle - if(world.time - round_start_time < config.shuttle_refuel_delay) - to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - round_start_time) - config.shuttle_refuel_delay)/600))] minutes before trying again.") + if(world.time - SSticker.round_start_time < config.shuttle_refuel_delay) + to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - SSticker.round_start_time) - config.shuttle_refuel_delay)/600))] minutes before trying again.") return switch(emergency.mode) @@ -253,7 +253,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/autoEvac() var/callShuttle = 1 - for(var/thing in shuttle_caller_list) + for(var/thing in GLOB.shuttle_caller_list) if(isAI(thing)) var/mob/living/silicon/ai/AI = thing if(AI.stat || !AI.client) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index b7871cbd73a9f..3f7f23b62e283 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -1,7 +1,5 @@ #define ROUND_START_MUSIC_LIST "strings/round_start_sounds.txt" -var/round_start_time = 0 - SUBSYSTEM_DEF(ticker) name = "Ticker" init_order = 13 @@ -58,16 +56,17 @@ SUBSYSTEM_DEF(ticker) var/late_join_disabled + var/round_start_time = 0 var/list/round_start_events /datum/controller/subsystem/ticker/Initialize(timeofday) var/list/music = file2list(ROUND_START_MUSIC_LIST, "\n") login_music = pick(music) - if(!syndicate_code_phrase) - syndicate_code_phrase = generate_code_phrase() - if(!syndicate_code_response) - syndicate_code_response = generate_code_phrase() + if(!GLOB.syndicate_code_phrase) + GLOB.syndicate_code_phrase = generate_code_phrase() + if(!GLOB.syndicate_code_response) + GLOB.syndicate_code_response = generate_code_phrase() ..() start_at = world.time + (config.lobby_countdown * 10) @@ -76,7 +75,7 @@ SUBSYSTEM_DEF(ticker) if(GAME_STATE_STARTUP) if(Master.initializations_finished_with_no_players_logged_in) start_at = world.time + (config.lobby_countdown * 10) - for(var/client/C in clients) + for(var/client/C in GLOB.clients) window_flash(C, ignorepref = TRUE) //let them know lobby has opened up. to_chat(world, "Welcome to [station_name()]!") current_state = GAME_STATE_PREGAME @@ -87,7 +86,7 @@ SUBSYSTEM_DEF(ticker) timeLeft = max(0,start_at - world.time) totalPlayers = 0 totalPlayersReady = 0 - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) ++totalPlayers if(player.ready) ++totalPlayersReady @@ -130,15 +129,15 @@ SUBSYSTEM_DEF(ticker) var/init_start = world.timeofday //Create and announce mode var/list/datum/game_mode/runnable_modes - if(master_mode == "random" || master_mode == "secret") + if(GLOB.master_mode == "random" || GLOB.master_mode == "secret") runnable_modes = config.get_runnable_modes() - if(master_mode == "secret") + if(GLOB.master_mode == "secret") hide_mode = 1 - if(secret_force_mode != "secret") - var/datum/game_mode/smode = config.pick_mode(secret_force_mode) + if(GLOB.secret_force_mode != "secret") + var/datum/game_mode/smode = config.pick_mode(GLOB.secret_force_mode) if(!smode.can_start()) - message_admins("\blue Unable to force secret [secret_force_mode]. [smode.required_players] players and [smode.required_enemies] eligible antagonists needed.") + message_admins("\blue Unable to force secret [GLOB.secret_force_mode]. [smode.required_players] players and [smode.required_enemies] eligible antagonists needed.") else mode = smode @@ -149,7 +148,7 @@ SUBSYSTEM_DEF(ticker) mode = pickweight(runnable_modes) else - mode = config.pick_mode(master_mode) + mode = config.pick_mode(GLOB.master_mode) if(!mode.can_start()) to_chat(world, "Unable to start [mode.name]. Not enough players, [mode.required_players] players and [mode.required_enemies] eligible antagonists needed. Reverting to pre-game lobby.") qdel(mode) @@ -165,11 +164,11 @@ SUBSYSTEM_DEF(ticker) SSjob.DivideOccupations() //Distribute jobs CHECK_TICK - if(!Debug2) + if(!GLOB.Debug2) if(!can_continue) qdel(mode) mode = null - to_chat(world, "Error setting up [master_mode]. Reverting to pre-game lobby.") + to_chat(world, "Error setting up [GLOB.master_mode]. Reverting to pre-game lobby.") SSjob.ResetOccupations() return 0 else @@ -189,14 +188,14 @@ SUBSYSTEM_DEF(ticker) toggle_ooc(0) // Turn it off CHECK_TICK - start_landmarks_list = shuffle(start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left + GLOB.start_landmarks_list = shuffle(GLOB.start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left create_characters() //Create player characters collect_minds() equip_characters() SSoverlays.Flush() //Flush the majority of the shit - data_core.manifest() + GLOB.data_core.manifest() transfer_characters() //transfer keys to the new mobs @@ -229,7 +228,7 @@ SUBSYSTEM_DEF(ticker) set waitfor = 0 mode.post_setup() //Cleanup some stuff - for(var/obj/effect/landmark/start/S in landmarks_list) + for(var/obj/effect/landmark/start/S in GLOB.landmarks_list) //Deleting Startpoints but we need the ai point to AI-ize people later if(S.name != "AI") qdel(S) @@ -256,7 +255,7 @@ SUBSYSTEM_DEF(ticker) if( cinematic ) return //already a cinematic in progress! - for (var/datum/html_interface/hi in html_interfaces) + for (var/datum/html_interface/hi in GLOB.html_interfaces) hi.closeAll() SStgui.close_all_uis() @@ -268,7 +267,7 @@ SUBSYSTEM_DEF(ticker) //initialise our cinematic screen object cinematic = new /obj/screen{icon='icons/effects/station_explosion.dmi';icon_state="station_intact";layer=21;mouse_opacity=0;screen_loc="1,0";}(src) - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) M.notransform = TRUE //stop everything moving if(M.client) M.client.screen += cinematic //show every client the cinematic @@ -370,22 +369,22 @@ SUBSYSTEM_DEF(ticker) if(cinematic) qdel(cinematic) //end the cinematic cinematic = null - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) M.notransform = FALSE if(actually_blew_up && !isnull(killz) && M.stat != DEAD && M.z == killz) M.gib() /datum/controller/subsystem/ticker/proc/create_characters() - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) if(player.ready && player.mind) - joined_player_list += player.ckey + GLOB.joined_player_list += player.ckey player.create_character(FALSE) else player.new_player_panel() CHECK_TICK /datum/controller/subsystem/ticker/proc/collect_minds() - for(var/mob/dead/new_player/P in player_list) + for(var/mob/dead/new_player/P in GLOB.player_list) if(P.new_character && P.new_character.mind) SSticker.minds += P.new_character.mind CHECK_TICK @@ -393,7 +392,7 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/equip_characters() var/captainless=1 - for(var/mob/dead/new_player/N in player_list) + for(var/mob/dead/new_player/N in GLOB.player_list) var/mob/living/carbon/human/player = N.new_character if(istype(player) && player.mind && player.mind.assigned_role) if(player.mind.assigned_role == "Captain") @@ -402,14 +401,14 @@ SUBSYSTEM_DEF(ticker) SSjob.EquipRank(N, player.mind.assigned_role, 0) CHECK_TICK if(captainless) - for(var/mob/dead/new_player/N in player_list) + for(var/mob/dead/new_player/N in GLOB.player_list) if(N.new_character) to_chat(N, "Captainship not forced on anyone.") CHECK_TICK /datum/controller/subsystem/ticker/proc/transfer_characters() var/list/livings = list() - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) var/mob/living = player.transfer_character() if(living) qdel(player) @@ -436,7 +435,7 @@ SUBSYSTEM_DEF(ticker) to_chat(world, "


The round has ended.") //Player status report - for(var/mob/Player in mob_list) + for(var/mob/Player in GLOB.mob_list) if(Player.mind && !isnewplayer(Player)) if(Player.stat != DEAD && !isbrain(Player)) num_survivors++ @@ -461,28 +460,28 @@ SUBSYSTEM_DEF(ticker) //Round statistics report var/datum/station_state/end_state = new /datum/station_state() end_state.count() - var/station_integrity = min(PERCENT(start_state.score(end_state)), 100) + var/station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100) - to_chat(world, "
[TAB]Shift Duration: [round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]") - to_chat(world, "
[TAB]Station Integrity: [mode.station_was_nuked ? "Destroyed" : "[station_integrity]%"]") + to_chat(world, "
[GLOB.TAB]Shift Duration: [round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]") + to_chat(world, "
[GLOB.TAB]Station Integrity: [mode.station_was_nuked ? "Destroyed" : "[station_integrity]%"]") if(mode.station_was_nuked) SSticker.news_report = STATION_DESTROYED_NUKE - var/total_players = joined_player_list.len - if(joined_player_list.len) - to_chat(world, "
[TAB]Total Population: [total_players]") + var/total_players = GLOB.joined_player_list.len + if(total_players) + to_chat(world, "
[GLOB.TAB]Total Population: [total_players]") if(station_evacuated) - to_chat(world, "
[TAB]Evacuation Rate: [num_escapees] ([PERCENT(num_escapees/total_players)]%)") - to_chat(world, "
[TAB](on emergency shuttle): [num_shuttle_escapees] ([PERCENT(num_shuttle_escapees/total_players)]%)") + to_chat(world, "
[GLOB.TAB]Evacuation Rate: [num_escapees] ([PERCENT(num_escapees/total_players)]%)") + to_chat(world, "
[GLOB.TAB](on emergency shuttle): [num_shuttle_escapees] ([PERCENT(num_shuttle_escapees/total_players)]%)") news_report = STATION_EVACUATED if(SSshuttle.emergency.is_hijacked()) news_report = SHUTTLE_HIJACK - to_chat(world, "
[TAB]Survival Rate: [num_survivors] ([PERCENT(num_survivors/total_players)]%)") + to_chat(world, "
[GLOB.TAB]Survival Rate: [num_survivors] ([PERCENT(num_survivors/total_players)]%)") to_chat(world, "
") CHECK_TICK //Silicon laws report - for (var/mob/living/silicon/ai/aiPlayer in mob_list) + for (var/mob/living/silicon/ai/aiPlayer in GLOB.mob_list) if (aiPlayer.stat != 2 && aiPlayer.mind) to_chat(world, "[aiPlayer.name] (Played by: [aiPlayer.mind.key])'s laws at the end of the round were:") aiPlayer.show_laws(1) @@ -501,7 +500,7 @@ SUBSYSTEM_DEF(ticker) CHECK_TICK - for (var/mob/living/silicon/robot/robo in mob_list) + for (var/mob/living/silicon/robot/robo in GLOB.mob_list) if (!robo.connected_ai && robo.mind) if (robo.stat != 2) to_chat(world, "[robo.name] (Played by: [robo.mind.key]) survived as an AI-less borg! Its laws were:") @@ -552,9 +551,9 @@ SUBSYSTEM_DEF(ticker) //Borers var/borerwin = FALSE - if(borers.len) + if(GLOB.borers.len) var/borertext = "
The borers were:" - for(var/mob/living/simple_animal/borer/B in borers) + for(var/mob/living/simple_animal/borer/B in GLOB.borers) if((B.key || B.controlling) && B.stat != DEAD) borertext += "
[B.controlling ? B.victim.key : B.key] was [B.truename] (" var/turf/location = get_turf(B) @@ -566,20 +565,20 @@ SUBSYSTEM_DEF(ticker) to_chat(world, borertext) var/total_borers = 0 - for(var/mob/living/simple_animal/borer/B in borers) + for(var/mob/living/simple_animal/borer/B in GLOB.borers) if((B.key || B.victim) && B.stat != DEAD) total_borers++ if(total_borers) var/total_borer_hosts = 0 - for(var/mob/living/carbon/C in mob_list) + for(var/mob/living/carbon/C in GLOB.mob_list) var/mob/living/simple_animal/borer/D = C.has_brain_worms() var/turf/location = get_turf(C) if(location.z == ZLEVEL_CENTCOM && D && D.stat != DEAD) total_borer_hosts++ - if(total_borer_hosts_needed <= total_borer_hosts) + if(GLOB.total_borer_hosts_needed <= total_borer_hosts) borerwin = TRUE to_chat(world, "There were [total_borers] borers alive at round end!") - to_chat(world, "A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive. The borers needed [total_borer_hosts_needed] hosts to escape.") + to_chat(world, "A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive. The borers needed [GLOB.total_borer_hosts_needed] hosts to escape.") if(borerwin) to_chat(world, "The borers were successful!") else @@ -706,7 +705,12 @@ SUBSYSTEM_DEF(ticker) queued_players = SSticker.queued_players cinematic = SSticker.cinematic maprotatechecked = SSticker.maprotatechecked + round_start_time = SSticker.round_start_time + queue_delay = SSticker.queue_delay + queued_players = SSticker.queued_players + cinematic = SSticker.cinematic + maprotatechecked = SSticker.maprotatechecked /datum/controller/subsystem/ticker/proc/send_news_report() var/news_message diff --git a/code/controllers/subsystem/vote.dm b/code/controllers/subsystem/vote.dm index 3b059522843b0..8814464dcc8ac 100644 --- a/code/controllers/subsystem/vote.dm +++ b/code/controllers/subsystem/vote.dm @@ -53,7 +53,7 @@ SUBSYSTEM_DEF(vote) greatest_votes = votes //default-vote for everyone who didn't vote if(!config.vote_no_default && choices.len) - var/list/non_voters = directory.Copy() + var/list/non_voters = GLOB.directory.Copy() non_voters -= voted for (var/non_voter_ckey in non_voters) var/client/C = non_voters[non_voter_ckey] @@ -65,10 +65,10 @@ SUBSYSTEM_DEF(vote) if(choices["Continue Playing"] >= greatest_votes) greatest_votes = choices["Continue Playing"] else if(mode == "gamemode") - if(master_mode in choices) - choices[master_mode] += non_voters.len - if(choices[master_mode] >= greatest_votes) - greatest_votes = choices[master_mode] + if(GLOB.master_mode in choices) + choices[GLOB.master_mode] += non_voters.len + if(choices[GLOB.master_mode] >= greatest_votes) + greatest_votes = choices[GLOB.master_mode] //get all options with that many votes and return them in a list . = list() if(greatest_votes) @@ -98,7 +98,7 @@ SUBSYSTEM_DEF(vote) . = pick(winners) text += "\nVote Result: [.]" else - text += "\nDid not vote: [clients.len-voted.len]" + text += "\nDid not vote: [GLOB.clients.len-voted.len]" else text += "Vote Result: Inconclusive - No Votes!" log_vote(text) @@ -115,15 +115,15 @@ SUBSYSTEM_DEF(vote) if(. == "Restart Round") restart = 1 if("gamemode") - if(master_mode != .) + if(GLOB.master_mode != .) world.save_mode(.) if(SSticker && SSticker.mode) restart = 1 else - master_mode = . + GLOB.master_mode = . if(restart) var/active_admins = 0 - for(var/client/C in admins) + for(var/client/C in GLOB.admins) if(!C.is_afk() && check_rights_for(C, R_SERVER)) active_admins = 1 break @@ -156,7 +156,7 @@ SUBSYSTEM_DEF(vote) var/admin = FALSE var/ckey = ckey(initiator_key) - if((admin_datums[ckey]) || (ckey in deadmins)) + if((GLOB.admin_datums[ckey]) || (ckey in GLOB.deadmins)) admin = TRUE if(next_allowed_time > world.time && !admin) @@ -189,7 +189,7 @@ SUBSYSTEM_DEF(vote) log_vote(text) to_chat(world, "\n[text]\nType vote or click here to place your votes.\nYou have [config.vote_period/10] seconds to vote.") time_remaining = round(config.vote_period/10) - for(var/c in clients) + for(var/c in GLOB.clients) var/client/C = c var/datum/action/vote/V = new if(question) diff --git a/code/controllers/subsystem/weather.dm b/code/controllers/subsystem/weather.dm index 4930e9be0c612..569eb4032c70b 100644 --- a/code/controllers/subsystem/weather.dm +++ b/code/controllers/subsystem/weather.dm @@ -1,5 +1,4 @@ //Used for all kinds of weather, ex. lavaland ash storms. - SUBSYSTEM_DEF(weather) name = "Weather" flags = SS_BACKGROUND @@ -13,7 +12,7 @@ SUBSYSTEM_DEF(weather) var/datum/weather/W = V if(W.aesthetic) continue - for(var/mob/living/L in mob_list) + for(var/mob/living/L in GLOB.mob_list) if(W.can_impact(L)) W.impact(L) for(var/Z in eligible_zlevels) diff --git a/code/datums/antagonists/datum_clockcult.dm b/code/datums/antagonists/datum_clockcult.dm index 676157d4cfcc6..89be685f76120 100644 --- a/code/datums/antagonists/datum_clockcult.dm +++ b/code/datums/antagonists/datum_clockcult.dm @@ -68,7 +68,7 @@ C.present_tasks(owner) //Memorize the objectives /datum/antagonist/clockcultist/apply_innate_effects() - all_clockwork_mobs += owner + GLOB.all_clockwork_mobs += owner owner.faction |= "ratvar" owner.grant_language(/datum/language/ratvar) owner.update_action_buttons_icon() //because a few clockcult things are action buttons and we may be wearing/holding them for whatever reason, we need to update buttons @@ -84,7 +84,7 @@ A.can_be_carded = FALSE A.requires_power = POWER_REQ_CLOCKCULT var/list/AI_frame = list(image('icons/mob/clockwork_mobs.dmi', A, "aiframe")) //make the AI's cool frame - for(var/d in cardinal) + for(var/d in GLOB.cardinal) AI_frame += image('icons/mob/clockwork_mobs.dmi', A, "eye[rand(1, 10)]", dir = d) //the eyes are randomly fast or slow A.add_overlay(AI_frame) if(!A.lacks_power()) @@ -117,12 +117,12 @@ hierophant_network.span_for_name = "nezbere" hierophant_network.span_for_message = "brass" owner.throw_alert("clockinfo", /obj/screen/alert/clockwork/infodump) - if(!clockwork_gateway_activated) + if(!GLOB.clockwork_gateway_activated) owner.throw_alert("scripturereq", /obj/screen/alert/clockwork/scripture_reqs) ..() /datum/antagonist/clockcultist/remove_innate_effects() - all_clockwork_mobs -= owner + GLOB.all_clockwork_mobs -= owner owner.faction -= "ratvar" owner.remove_language(/datum/language/ratvar) owner.clear_alert("clockinfo") diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 1aa7f126f5730..9360f135c3b3e 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -17,14 +17,14 @@ var/list/fields = list() /datum/data/record/Destroy() - if(src in data_core.medical) - data_core.medical -= src - if(src in data_core.security) - data_core.security -= src - if(src in data_core.general) - data_core.general -= src - if(src in data_core.locked) - data_core.locked -= src + if(src in GLOB.data_core.medical) + GLOB.data_core.medical -= src + if(src in GLOB.data_core.security) + GLOB.data_core.security -= src + if(src in GLOB.data_core.general) + GLOB.data_core.general -= src + if(src in GLOB.data_core.locked) + GLOB.data_core.locked -= src . = ..() /datum/data/crime @@ -77,13 +77,13 @@ return /datum/datacore/proc/manifest() - for(var/mob/dead/new_player/N in player_list) + for(var/mob/dead/new_player/N in GLOB.player_list) if(ishuman(N.new_character)) manifest_inject(N.new_character, N.client) CHECK_TICK /datum/datacore/proc/manifest_modify(name, assignment) - var/datum/data/record/foundrecord = find_record("name", name, data_core.general) + var/datum/data/record/foundrecord = find_record("name", name, GLOB.data_core.general) if(foundrecord) foundrecord.fields["rank"] = assignment @@ -111,32 +111,32 @@ "} var/even = 0 // sort mobs - for(var/datum/data/record/t in data_core.general) + for(var/datum/data/record/t in GLOB.data_core.general) var/name = t.fields["name"] var/rank = t.fields["rank"] var/department = 0 - if(rank in command_positions) + if(rank in GLOB.command_positions) heads[name] = rank department = 1 - if(rank in security_positions) + if(rank in GLOB.security_positions) sec[name] = rank department = 1 - if(rank in engineering_positions) + if(rank in GLOB.engineering_positions) eng[name] = rank department = 1 - if(rank in medical_positions) + if(rank in GLOB.medical_positions) med[name] = rank department = 1 - if(rank in science_positions) + if(rank in GLOB.science_positions) sci[name] = rank department = 1 - if(rank in supply_positions) + if(rank in GLOB.supply_positions) sup[name] = rank department = 1 - if(rank in civilian_positions) + if(rank in GLOB.civilian_positions) civ[name] = rank department = 1 - if(rank in nonhuman_positions) + if(rank in GLOB.nonhuman_positions) bot[name] = rank department = 1 if(!department && !(name in heads)) @@ -195,7 +195,6 @@ return dat -var/record_id_num = 1001 /datum/datacore/proc/manifest_inject(mob/living/carbon/human/H, client/C) if(H.mind && (H.mind.assigned_role != H.mind.special_role)) var/assignment @@ -206,6 +205,7 @@ var/record_id_num = 1001 else assignment = "Unassigned" + var/static/record_id_num = 1001 var/id = num2hex(record_id_num++,6) if(!C) C = H.client diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 591122003bcf1..bd2d737f1b9ed 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -850,7 +850,7 @@ if(A.reagents) var/chosen_id - var/list/reagent_options = sortList(chemical_reagents_list) + var/list/reagent_options = sortList(GLOB.chemical_reagents_list) switch(alert(usr, "Choose a method.", "Add Reagents", "Enter ID", "Choose ID")) if("Enter ID") var/valid_id @@ -1031,14 +1031,14 @@ to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") return - var/result = input(usr, "Please choose a new species","Species") as null|anything in species_list + var/result = input(usr, "Please choose a new species","Species") as null|anything in GLOB.species_list if(!H) to_chat(usr, "Mob doesn't exist anymore") return if(result) - var/newtype = species_list[result] + var/newtype = GLOB.species_list[result] H.set_species(newtype) else if(href_list["editbodypart"]) diff --git a/code/datums/diseases/_disease.dm b/code/datums/diseases/_disease.dm index 74f67b22f74d7..fbf6af136efd7 100644 --- a/code/datums/diseases/_disease.dm +++ b/code/datums/diseases/_disease.dm @@ -26,10 +26,6 @@ #define DANGEROUS "Dangerous!" #define BIOHAZARD "BIOHAZARD THREAT!" - -var/list/diseases = subtypesof(/datum/disease) - - /datum/disease //Flags var/visibility_flags = 0 diff --git a/code/datums/diseases/advance/advance.dm b/code/datums/diseases/advance/advance.dm index bc953d1aa4130..dcfa0f13187b7 100644 --- a/code/datums/diseases/advance/advance.dm +++ b/code/datums/diseases/advance/advance.dm @@ -9,15 +9,7 @@ #define SYMPTOM_LIMIT 8 -var/list/archive_diseases = list() -// The order goes from easy to cure to hard to cure. -var/list/advance_cures = list( - "sodiumchloride", "sugar", "orangejuice", - "spaceacillin", "salglu_solution", "ethanol", - "leporazine", "synaptizine", "lipolicide", - "silver", "gold" - ) /* @@ -40,6 +32,14 @@ var/list/advance_cures = list( var/list/symptoms = list() // The symptoms of the disease. var/id = "" var/processing = 0 + + // The order goes from easy to cure to hard to cure. + var/static/list/advance_cures = list( + "sodiumchloride", "sugar", "orangejuice", + "spaceacillin", "salglu_solution", "ethanol", + "leporazine", "synaptizine", "lipolicide", + "silver", "gold" + ) /* @@ -48,13 +48,6 @@ var/list/advance_cures = list( */ /datum/disease/advance/New(var/process = 1, var/datum/disease/advance/D) - - // Setup our dictionary if it hasn't already. - if(!dictionary_symptoms.len) - for(var/symp in list_symptoms) - var/datum/symptom/S = new symp - dictionary_symptoms[S.id] = symp - if(!istype(D)) D = null // Generate symptoms if we weren't given any. @@ -141,7 +134,7 @@ var/list/advance_cures = list( // Generate symptoms. By default, we only choose non-deadly symptoms. var/list/possible_symptoms = list() - for(var/symp in list_symptoms) + for(var/symp in SSdisease.list_symptoms) var/datum/symptom/S = new symp if(S.level >= level_min && S.level <= level_max) if(!HasSymptom(S)) @@ -168,13 +161,13 @@ var/list/advance_cures = list( AssignProperties() id = null - if(!archive_diseases[GetDiseaseID()]) + if(!SSdisease.archive_diseases[GetDiseaseID()]) if(new_name) AssignName() - archive_diseases[GetDiseaseID()] = src // So we don't infinite loop - archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1) + SSdisease.archive_diseases[GetDiseaseID()] = src // So we don't infinite loop + SSdisease.archive_diseases[GetDiseaseID()] = new /datum/disease/advance(0, src, 1) - var/datum/disease/advance/A = archive_diseases[GetDiseaseID()] + var/datum/disease/advance/A = SSdisease.archive_diseases[GetDiseaseID()] AssignName(A.name) //Generate disease properties based on the effects. Returns an associated list. @@ -259,7 +252,7 @@ var/list/advance_cures = list( cures = list(advance_cures[res]) // Get the cure name from the cure_id - var/datum/reagent/D = chemical_reagents_list[cures[1]] + var/datum/reagent/D = GLOB.chemical_reagents_list[cures[1]] cure_text = D.name @@ -379,7 +372,7 @@ var/list/advance_cures = list( var/list/symptoms = list() symptoms += "Done" - symptoms += list_symptoms.Copy() + symptoms += SSdisease.list_symptoms.Copy() do if(user) var/symptom = input(user, "Choose a symptom to add ([i] remaining)", "Choose a Symptom") in symptoms @@ -405,7 +398,7 @@ var/list/advance_cures = list( for(var/datum/disease/advance/AD in SSdisease.processing) AD.Refresh() - for(var/mob/living/carbon/human/H in shuffle(living_mob_list)) + for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list)) if(H.z != 1) continue if(!H.HasDisease(D)) diff --git a/code/datums/diseases/advance/symptoms/genetics.dm b/code/datums/diseases/advance/symptoms/genetics.dm index 14b1d807ab6f7..d2cf727397866 100644 --- a/code/datums/diseases/advance/symptoms/genetics.dm +++ b/code/datums/diseases/advance/symptoms/genetics.dm @@ -42,7 +42,7 @@ Bonus // Archive their DNA before they were infected. /datum/symptom/genetic_mutation/Start(datum/disease/advance/A) - possible_mutations = (bad_mutations | not_good_mutations) - mutations_list[RACEMUT] + possible_mutations = (GLOB.bad_mutations | GLOB.not_good_mutations) - GLOB.mutations_list[RACEMUT] var/mob/living/carbon/M = A.affected_mob if(M) if(!M.has_dna()) diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm index 0b1cc6d6e7de3..5b8b77cf8a509 100644 --- a/code/datums/diseases/advance/symptoms/heal.dm +++ b/code/datums/diseases/advance/symptoms/heal.dm @@ -282,7 +282,7 @@ Bonus var/amt_healed = 1 M.adjustBrainLoss(-amt_healed) //Non-power mutations, excluding race, so the virus does not force monkey -> human transformations. - var/list/unclean_mutations = (not_good_mutations|bad_mutations) - mutations_list[RACEMUT] + var/list/unclean_mutations = (GLOB.not_good_mutations|GLOB.bad_mutations) - GLOB.mutations_list[RACEMUT] M.dna.remove_mutation_group(unclean_mutations) M.radiation = max(M.radiation - (2 * amt_healed), 0) return 1 diff --git a/code/datums/diseases/advance/symptoms/symptoms.dm b/code/datums/diseases/advance/symptoms/symptoms.dm index f371f7045e772..014dc907b4d0e 100644 --- a/code/datums/diseases/advance/symptoms/symptoms.dm +++ b/code/datums/diseases/advance/symptoms/symptoms.dm @@ -1,10 +1,5 @@ // Symptoms are the effects that engineered advanced diseases do. -var/list/list_symptoms = subtypesof(/datum/symptom) -var/list/dictionary_symptoms = list() - -var/global/const/SYMPTOM_ACTIVATION_PROB = 5 - /datum/symptom // Buffs/Debuffs the symptom has to the overall engineered disease. var/name = "" @@ -18,9 +13,10 @@ var/global/const/SYMPTOM_ACTIVATION_PROB = 5 var/severity = 0 // The hash tag for our diseases, we will add it up with our other symptoms to get a unique id! ID MUST BE UNIQUE!!! var/id = "" + var/static/SYMPTOM_ACTIVATION_PROB = 5 /datum/symptom/New() - var/list/S = list_symptoms + var/list/S = SSdisease.list_symptoms for(var/i = 1; i <= S.len; i++) if(src.type == S[i]) id = "[i]" diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 13ca7d633abe8..01fea665931a4 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -41,15 +41,15 @@ new_dna.mutations = mutations.Copy() /datum/dna/proc/add_mutation(mutation_name) - var/datum/mutation/human/HM = mutations_list[mutation_name] + var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name] HM.on_acquiring(holder) /datum/dna/proc/remove_mutation(mutation_name) - var/datum/mutation/human/HM = mutations_list[mutation_name] + var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name] HM.on_losing(holder) /datum/dna/proc/check_mutation(mutation_name) - var/datum/mutation/human/HM = mutations_list[mutation_name] + var/datum/mutation/human/HM = GLOB.mutations_list[mutation_name] return mutations.Find(HM) /datum/dna/proc/remove_all_mutations() @@ -68,28 +68,28 @@ L[DNA_GENDER_BLOCK] = construct_block((holder.gender!=MALE)+1, 2) if(ishuman(holder)) var/mob/living/carbon/human/H = holder - if(!hair_styles_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/hair, hair_styles_list, hair_styles_male_list, hair_styles_female_list) - L[DNA_HAIR_STYLE_BLOCK] = construct_block(hair_styles_list.Find(H.hair_style), hair_styles_list.len) + if(!GLOB.hair_styles_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/hair,GLOB.hair_styles_list, GLOB.hair_styles_male_list, GLOB.hair_styles_female_list) + L[DNA_HAIR_STYLE_BLOCK] = construct_block(GLOB.hair_styles_list.Find(H.hair_style), GLOB.hair_styles_list.len) L[DNA_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.hair_color) - if(!facial_hair_styles_list.len) - init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, facial_hair_styles_list, facial_hair_styles_male_list, facial_hair_styles_female_list) - L[DNA_FACIAL_HAIR_STYLE_BLOCK] = construct_block(facial_hair_styles_list.Find(H.facial_hair_style), facial_hair_styles_list.len) + if(!GLOB.facial_hair_styles_list.len) + init_sprite_accessory_subtypes(/datum/sprite_accessory/facial_hair, GLOB.facial_hair_styles_list, GLOB.facial_hair_styles_male_list, GLOB.facial_hair_styles_female_list) + L[DNA_FACIAL_HAIR_STYLE_BLOCK] = construct_block(GLOB.facial_hair_styles_list.Find(H.facial_hair_style), GLOB.facial_hair_styles_list.len) L[DNA_FACIAL_HAIR_COLOR_BLOCK] = sanitize_hexcolor(H.facial_hair_color) - L[DNA_SKIN_TONE_BLOCK] = construct_block(skin_tones.Find(H.skin_tone), skin_tones.len) + L[DNA_SKIN_TONE_BLOCK] = construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len) L[DNA_EYE_COLOR_BLOCK] = sanitize_hexcolor(H.eye_color) for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++) if(L[i]) . += L[i] else - . += random_string(DNA_BLOCK_SIZE,hex_characters) + . += random_string(DNA_BLOCK_SIZE,GLOB.hex_characters) return . /datum/dna/proc/generate_struc_enzymes() var/list/sorting = new /list(DNA_STRUC_ENZYMES_BLOCKS) var/result = "" - for(var/datum/mutation/human/A in good_mutations + bad_mutations + not_good_mutations) + for(var/datum/mutation/human/A in GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations) if(A.name == RACEMUT && ismonkey(holder)) sorting[A.dna_block] = num2hex(A.lowest_value + rand(0, 256 * 6), DNA_BLOCK_SIZE) mutations |= A @@ -106,7 +106,7 @@ real_name = holder.real_name . += md5(holder.real_name) else - . += random_string(DNA_UNIQUE_ENZYMES_LEN, hex_characters) + . += random_string(DNA_UNIQUE_ENZYMES_LEN, GLOB.hex_characters) return . /datum/dna/proc/update_ui_block(blocknumber) @@ -119,15 +119,15 @@ if(DNA_FACIAL_HAIR_COLOR_BLOCK) setblock(uni_identity, blocknumber, sanitize_hexcolor(H.facial_hair_color)) if(DNA_SKIN_TONE_BLOCK) - setblock(uni_identity, blocknumber, construct_block(skin_tones.Find(H.skin_tone), skin_tones.len)) + setblock(uni_identity, blocknumber, construct_block(GLOB.skin_tones.Find(H.skin_tone), GLOB.skin_tones.len)) if(DNA_EYE_COLOR_BLOCK) setblock(uni_identity, blocknumber, sanitize_hexcolor(H.eye_color)) if(DNA_GENDER_BLOCK) setblock(uni_identity, blocknumber, construct_block((H.gender!=MALE)+1, 2)) if(DNA_FACIAL_HAIR_STYLE_BLOCK) - setblock(uni_identity, blocknumber, construct_block(facial_hair_styles_list.Find(H.facial_hair_style), facial_hair_styles_list.len)) + setblock(uni_identity, blocknumber, construct_block(GLOB.facial_hair_styles_list.Find(H.facial_hair_style), GLOB.facial_hair_styles_list.len)) if(DNA_HAIR_STYLE_BLOCK) - setblock(uni_identity, blocknumber, construct_block(hair_styles_list.Find(H.hair_style), hair_styles_list.len)) + setblock(uni_identity, blocknumber, construct_block(GLOB.hair_styles_list.Find(H.hair_style), GLOB.hair_styles_list.len)) /datum/dna/proc/mutations_say_mods(message) if(message) @@ -271,10 +271,10 @@ var/structure = dna.uni_identity hair_color = sanitize_hexcolor(getblock(structure, DNA_HAIR_COLOR_BLOCK)) facial_hair_color = sanitize_hexcolor(getblock(structure, DNA_FACIAL_HAIR_COLOR_BLOCK)) - skin_tone = skin_tones[deconstruct_block(getblock(structure, DNA_SKIN_TONE_BLOCK), skin_tones.len)] + skin_tone = GLOB.skin_tones[deconstruct_block(getblock(structure, DNA_SKIN_TONE_BLOCK), GLOB.skin_tones.len)] eye_color = sanitize_hexcolor(getblock(structure, DNA_EYE_COLOR_BLOCK)) - facial_hair_style = facial_hair_styles_list[deconstruct_block(getblock(structure, DNA_FACIAL_HAIR_STYLE_BLOCK), facial_hair_styles_list.len)] - hair_style = hair_styles_list[deconstruct_block(getblock(structure, DNA_HAIR_STYLE_BLOCK), hair_styles_list.len)] + facial_hair_style = GLOB.facial_hair_styles_list[deconstruct_block(getblock(structure, DNA_FACIAL_HAIR_STYLE_BLOCK), GLOB.facial_hair_styles_list.len)] + hair_style = GLOB.hair_styles_list[deconstruct_block(getblock(structure, DNA_HAIR_STYLE_BLOCK), GLOB.hair_styles_list.len)] if(icon_update) update_body() update_hair() @@ -291,7 +291,7 @@ if(!has_dna()) return - for(var/datum/mutation/human/A in good_mutations | bad_mutations | not_good_mutations) + for(var/datum/mutation/human/A in GLOB.good_mutations | GLOB.bad_mutations | GLOB.not_good_mutations) if(ismob(A.check_block(src, force_powers))) return //we got monkeyized/humanized, this mob will be deleted, no need to continue. @@ -325,26 +325,26 @@ /mob/living/carbon/proc/randmutb() if(!has_dna()) return - var/datum/mutation/human/HM = pick((bad_mutations | not_good_mutations) - mutations_list[RACEMUT]) + var/datum/mutation/human/HM = pick((GLOB.bad_mutations | GLOB.not_good_mutations) - GLOB.mutations_list[RACEMUT]) . = HM.force_give(src) /mob/living/carbon/proc/randmutg() if(!has_dna()) return - var/datum/mutation/human/HM = pick(good_mutations) + var/datum/mutation/human/HM = pick(GLOB.good_mutations) . = HM.force_give(src) /mob/living/carbon/proc/randmutvg() if(!has_dna()) return - var/datum/mutation/human/HM = pick((good_mutations) - mutations_list[HULK] - mutations_list[DWARFISM]) + var/datum/mutation/human/HM = pick((GLOB.good_mutations) - GLOB.mutations_list[HULK] - GLOB.mutations_list[DWARFISM]) . = HM.force_give(src) /mob/living/carbon/proc/randmuti() if(!has_dna()) return var/num = rand(1, DNA_UNI_IDENTITY_BLOCKS) - var/newdna = setblock(dna.uni_identity, num, random_string(DNA_BLOCK_SIZE, hex_characters)) + var/newdna = setblock(dna.uni_identity, num, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters)) dna.uni_identity = newdna updateappearance(mutations_overlay_update=1) @@ -363,12 +363,12 @@ if(se) for(var/i=1, i<=DNA_STRUC_ENZYMES_BLOCKS, i++) if(prob(probability)) - M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, random_string(DNA_BLOCK_SIZE, hex_characters)) + M.dna.struc_enzymes = setblock(M.dna.struc_enzymes, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters)) M.domutcheck() if(ui) for(var/i=1, i<=DNA_UNI_IDENTITY_BLOCKS, i++) if(prob(probability)) - M.dna.uni_identity = setblock(M.dna.uni_identity, i, random_string(DNA_BLOCK_SIZE, hex_characters)) + M.dna.uni_identity = setblock(M.dna.uni_identity, i, random_string(DNA_BLOCK_SIZE, GLOB.hex_characters)) M.updateappearance(mutations_overlay_update=1) return 1 diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index 7039bf2c4882e..0d6488c63387c 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -1,8 +1,6 @@ #define EMOTE_VISIBLE 1 #define EMOTE_AUDIBLE 2 -var/global/list/emote_list = list() - /datum/emote var/key = "" //What calls the emote var/key_third_person = "" //This will also call the emote @@ -21,6 +19,7 @@ var/global/list/emote_list = list() var/list/mob_type_allowed_typecache = list() //Types that are allowed to use that emote var/list/mob_type_blacklist_typecache = list() //Types that are NOT allowed to use that emote var/stat_allowed = CONSCIOUS + var/static/list/emote_list = list() /datum/emote/New() ..() @@ -53,7 +52,7 @@ var/global/list/emote_list = list() user.log_message(msg, INDIVIDUAL_EMOTE_LOG) msg = "[user] " + msg - for(var/mob/M in dead_mob_list) + for(var/mob/M in GLOB.dead_mob_list) if(!M.client || isnewplayer(M)) continue var/T = get_turf(src) diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index 55f5a1cc05978..f285effc0fb58 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -1,5 +1,3 @@ -var/global/datum/getrev/revdata = new() - /datum/getrev var/parentcommit var/commit @@ -46,7 +44,7 @@ var/global/datum/getrev/revdata = new() return var/url = "https://api.github.com/repositories/[config.githubrepoid]/pulls/[line].json" - valid_HTTPSGet = TRUE + GLOB.valid_HTTPSGet = TRUE var/json = HTTPSGet(url) if(!json) return @@ -75,12 +73,12 @@ var/global/datum/getrev/revdata = new() set name = "Show Server Revision" set desc = "Check the current server code revision" - if(revdata.parentcommit) - to_chat(src, "Server revision compiled on: [revdata.date]") - if(revdata.testmerge.len) - to_chat(src, revdata.GetTestMergeInfo()) + if(GLOB.revdata.parentcommit) + to_chat(src, "Server revision compiled on: [GLOB.revdata.date]") + if(GLOB.revdata.testmerge.len) + to_chat(src, GLOB.revdata.GetTestMergeInfo()) to_chat(src, "Based off master commit:") - to_chat(src, "[revdata.parentcommit]") + to_chat(src, "[GLOB.revdata.parentcommit]") else to_chat(src, "Revision unknown") to_chat(src, "Current Infomational Settings:") diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 497c6e13001ad..07ed28b575bb2 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -195,7 +195,7 @@ var/list/A_gases = A.gases var/trace_gases for(var/id in A_gases) - if(id in hardcoded_gases) + if(id in GLOB.hardcoded_gases) continue trace_gases = TRUE break diff --git a/code/datums/hud.dm b/code/datums/hud.dm index 8ed09d47a0914..309006d0dfc09 100644 --- a/code/datums/hud.dm +++ b/code/datums/hud.dm @@ -1,26 +1,26 @@ /* HUD DATUMS */ //GLOBAL HUD LIST -var/datum/atom_hud/huds = list( \ - DATA_HUD_SECURITY_BASIC = new/datum/atom_hud/data/human/security/basic(), \ - DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/human/security/advanced(), \ - DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/human/medical/basic(), \ - DATA_HUD_MEDICAL_ADVANCED = new/datum/atom_hud/data/human/medical/advanced(), \ - DATA_HUD_DIAGNOSTIC = new/datum/atom_hud/data/diagnostic(), \ - ANTAG_HUD_CULT = new/datum/atom_hud/antag(), \ - ANTAG_HUD_REV = new/datum/atom_hud/antag(), \ - ANTAG_HUD_OPS = new/datum/atom_hud/antag(), \ - ANTAG_HUD_WIZ = new/datum/atom_hud/antag(), \ - ANTAG_HUD_SHADOW = new/datum/atom_hud/antag(), \ - ANTAG_HUD_TRAITOR = new/datum/atom_hud/antag/hidden(),\ - ANTAG_HUD_NINJA = new/datum/atom_hud/antag/hidden(),\ - ANTAG_HUD_CHANGELING = new/datum/atom_hud/antag/hidden(),\ - ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag/hidden(),\ - ANTAG_HUD_DEVIL = new/datum/atom_hud/antag(),\ - ANTAG_HUD_SINTOUCHED = new/datum/atom_hud/antag/hidden(),\ - ANTAG_HUD_SOULLESS = new/datum/atom_hud/antag/hidden(),\ - ANTAG_HUD_CLOCKWORK = new/datum/atom_hud/antag(),\ - ) +GLOBAL_LIST_INIT(huds, list( + DATA_HUD_SECURITY_BASIC = new/datum/atom_hud/data/human/security/basic(), + DATA_HUD_SECURITY_ADVANCED = new/datum/atom_hud/data/human/security/advanced(), + DATA_HUD_MEDICAL_BASIC = new/datum/atom_hud/data/human/medical/basic(), + DATA_HUD_MEDICAL_ADVANCED = new/datum/atom_hud/data/human/medical/advanced(), + DATA_HUD_DIAGNOSTIC = new/datum/atom_hud/data/diagnostic(), + ANTAG_HUD_CULT = new/datum/atom_hud/antag(), + ANTAG_HUD_REV = new/datum/atom_hud/antag(), + ANTAG_HUD_OPS = new/datum/atom_hud/antag(), + ANTAG_HUD_WIZ = new/datum/atom_hud/antag(), + ANTAG_HUD_SHADOW = new/datum/atom_hud/antag(), + ANTAG_HUD_TRAITOR = new/datum/atom_hud/antag/hidden(), + ANTAG_HUD_NINJA = new/datum/atom_hud/antag/hidden(), + ANTAG_HUD_CHANGELING = new/datum/atom_hud/antag/hidden(), + ANTAG_HUD_ABDUCTOR = new/datum/atom_hud/antag/hidden(), + ANTAG_HUD_DEVIL = new/datum/atom_hud/antag(), + ANTAG_HUD_SINTOUCHED = new/datum/atom_hud/antag/hidden(), + ANTAG_HUD_SOULLESS = new/datum/atom_hud/antag/hidden(), + ANTAG_HUD_CLOCKWORK = new/datum/atom_hud/antag(), + )) /datum/atom_hud var/list/atom/hudatoms = list() //list of all atoms which display this hud @@ -77,7 +77,7 @@ var/datum/atom_hud/huds = list( \ for(var/datum/gang/G in SSticker.mode.gangs) gang_huds += G.ganghud - for(var/datum/atom_hud/hud in (huds|gang_huds)) + for(var/datum/atom_hud/hud in (GLOB.huds|gang_huds)) if(src in hud.hudusers) hud.add_hud_to(src) diff --git a/code/datums/martial.dm b/code/datums/martial.dm index a49d945fa44e8..548dcb4e0ed49 100644 --- a/code/datums/martial.dm +++ b/code/datums/martial.dm @@ -71,9 +71,9 @@ D.visible_message("[A] has weakened [D]!!", \ "[A] has weakened [D]!") D.apply_effect(4, WEAKEN, armor_block) - D.forcesay(hit_appends) + D.forcesay(GLOB.hit_appends) else if(D.lying) - D.forcesay(hit_appends) + D.forcesay(GLOB.hit_appends) return 1 /datum/martial_art/proc/teach(mob/living/carbon/human/H,make_temporary=0) @@ -137,10 +137,10 @@ "[A] has knocked [D] out with a haymaker!") D.apply_effect(10,WEAKEN,armor_block) D.SetSleeping(5) - D.forcesay(hit_appends) + D.forcesay(GLOB.hit_appends) add_logs(A, D, "knocked out (boxing) ") else if(D.lying) - D.forcesay(hit_appends) + D.forcesay(GLOB.hit_appends) return 1 /mob/living/carbon/human/proc/wrestling_help() diff --git a/code/datums/mind.dm b/code/datums/mind.dm index bd759b6cf1d5e..b4844b32bf4b1 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -283,7 +283,7 @@ if (SSticker.mode.config_tag=="revolution") text = uppertext(text) text = "[text]: " - if (assigned_role in command_positions) + if (assigned_role in GLOB.command_positions) text += "HEAD|loyal|employee|headrev|rev" else if (src in SSticker.mode.head_revolutionaries) text += "head|loyal|employee|HEADREV|rev" @@ -351,7 +351,7 @@ text += "gang leader" text += "
" - if(gang_colors_pool.len) + if(GLOB.gang_colors_pool.len) text += "Create New Gang" sections["gang"] = text @@ -383,7 +383,7 @@ text += "OPERATIVE|nanotrasen" text += "
To shuttle, undress, dress up." var/code - for (var/obj/machinery/nuclearbomb/bombue in machines) + for (var/obj/machinery/nuclearbomb/bombue in GLOB.machines) if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") code = bombue.r_code break @@ -898,11 +898,11 @@ qdel(SC) if("new") - if(gang_colors_pool.len) - var/list/names = list("Random") + gang_name_pool + if(GLOB.gang_colors_pool.len) + var/list/names = list("Random") + GLOB.gang_name_pool var/gangname = input("Pick a gang name.","Select Name") as null|anything in names - if(gangname && gang_colors_pool.len) //Check again just in case another admin made max gangs at the same time - if(!(gangname in gang_name_pool)) + if(gangname && GLOB.gang_colors_pool.len) //Check again just in case another admin made max gangs at the same time + if(!(gangname in GLOB.gang_name_pool)) gangname = null var/datum/gang/newgang = new(null,gangname) SSticker.mode.gangs += newgang @@ -990,7 +990,7 @@ log_admin("[key_name(usr)] has wizard'ed [current].") SSticker.mode.update_wiz_icons_added(src) if("lair") - current.loc = pick(wizardstart) + current.loc = pick(GLOB.wizardstart) if("dressup") SSticker.mode.equip_wizard(current) if("name") @@ -1069,7 +1069,7 @@ to_chat(usr, "Equipping a syndicate failed!") if("tellcode") var/code - for (var/obj/machinery/nuclearbomb/bombue in machines) + for (var/obj/machinery/nuclearbomb/bombue in GLOB.machines) if (length(bombue.r_code) <= 5 && bombue.r_code != "LOLNO" && bombue.r_code != "ADMIN") code = bombue.r_code break @@ -1352,7 +1352,7 @@ store_memory("Syndicate Nuclear Bomb Code: [nuke_code]", 0, 0) to_chat(current, "The nuclear authorization code is: [nuke_code]") else - var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in nuke_list + var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in GLOB.nuke_list if(nuke) store_memory("Syndicate Nuclear Bomb Code: [nuke.r_code]", 0, 0) to_chat(current, "The nuclear authorization code is: nuke.r_code") @@ -1378,11 +1378,11 @@ SSticker.mode.wizards += src special_role = "Wizard" assigned_role = "Wizard" - if(!wizardstart.len) - current.loc = pick(latejoin) + if(!GLOB.wizardstart.len) + current.loc = pick(GLOB.latejoin) to_chat(current, "HOT INSERTION, GO GO GO") else - current.loc = pick(wizardstart) + current.loc = pick(GLOB.wizardstart) SSticker.mode.equip_wizard(current) SSticker.mode.name_wizard(current) @@ -1479,7 +1479,7 @@ var/list/obj/effect/landmark/abductor/scientist_landmarks = new agent_landmarks.len = 4 scientist_landmarks.len = 4 - for(var/obj/effect/landmark/abductor/A in landmarks_list) + for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list) if(istype(A,/obj/effect/landmark/abductor/agent)) agent_landmarks[text2num(A.team)] = A else if(istype(A,/obj/effect/landmark/abductor/scientist)) @@ -1532,7 +1532,7 @@ INVOKE_ASYNC(S, /obj/effect/proc_holder/spell.proc/start_recharge) /datum/mind/proc/get_ghost(even_if_they_cant_reenter) - for(var/mob/dead/observer/G in dead_mob_list) + for(var/mob/dead/observer/G in GLOB.dead_mob_list) if(G.mind == src) if(G.can_reenter_corpse || even_if_they_cant_reenter) return G diff --git a/code/datums/mutations.dm b/code/datums/mutations.dm index 9477e328cccfa..55f2b03161c08 100644 --- a/code/datums/mutations.dm +++ b/code/datums/mutations.dm @@ -1,11 +1,11 @@ -/var/global/list/mutations_list = list() +GLOBAL_LIST_EMPTY(mutations_list) /datum/mutation var/name /datum/mutation/New() - mutations_list[name] = src + GLOB.mutations_list[name] = src /datum/mutation/human @@ -536,9 +536,9 @@ if(message) message = replacetext(message,"w","v") message = replacetext(message,"j","y") - message = replacetext(message,"a",pick("å","ä","æ","a")) + message = replacetext(message,"a",pick("�","�","�","a")) message = replacetext(message,"bo","bjo") - message = replacetext(message,"o",pick("ö","ø","o")) + message = replacetext(message,"o",pick("�","�","o")) if(prob(30)) message += " Bork[pick("",", bork",", bork, bork")]!" return message diff --git a/code/datums/shuttles.dm b/code/datums/shuttles.dm index 72b22e01c3b72..774e0794ff809 100644 --- a/code/datums/shuttles.dm +++ b/code/datums/shuttles.dm @@ -47,7 +47,7 @@ /datum/map_template/shuttle/emergency/airless/prerequisites_met() // first 10 minutes only - return world.time - round_start_time < 6000 + return world.time - SSticker.round_start_time < 6000 /datum/map_template/shuttle/emergency/asteroid suffix = "asteroid" diff --git a/code/datums/status_effects/buffs.dm b/code/datums/status_effects/buffs.dm index 918df01756258..d07f66609b62e 100644 --- a/code/datums/status_effects/buffs.dm +++ b/code/datums/status_effects/buffs.dm @@ -60,7 +60,7 @@ var/vanguard = L.stun_absorption["vanguard"] desc = initial(desc) desc += "
[vanguard["stuns_absorbed"] * 2] seconds of stuns held back.\ - [ratvar_awakens ? "":"
[round(min(vanguard["stuns_absorbed"] * 0.25, 20)) * 2] seconds of stun will affect you."]" + [GLOB.ratvar_awakens ? "":"
[round(min(vanguard["stuns_absorbed"] * 0.25, 20)) * 2] seconds of stun will affect you."]" ..() /datum/status_effect/vanguard_shield/Destroy() @@ -90,7 +90,7 @@ for(var/i in owner.stun_absorption) if(owner.stun_absorption[i]["end_time"] > world.time && owner.stun_absorption[i]["priority"] > vanguard["priority"]) otheractiveabsorptions = TRUE - if(!ratvar_awakens && stuns_blocked && !otheractiveabsorptions) + if(!GLOB.ratvar_awakens && stuns_blocked && !otheractiveabsorptions) vanguard["end_time"] = 0 //so it doesn't absorb the stuns we're about to apply owner.Stun(stuns_blocked) owner.Weaken(stuns_blocked) diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index c6e8f8e3b7a7c..8b6d255f1ab4e 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -2,8 +2,6 @@ //This file contains their code, plus code for applying and removing them. //When making a new status effect, add a define to status_effects.dm in __DEFINES for ease of use! -var/global/list/all_status_effects = list() //a list of all status effects, if for some reason you need to remove all of them - /datum/status_effect var/id = "effect" //Used for screen alerts. var/duration = -1 //How long the status effect lasts in DECISECONDS. Enter -1 for an effect that never ends unless removed through some means. @@ -17,7 +15,6 @@ var/global/list/all_status_effects = list() //a list of all status effects, if f owner = new_owner if(owner) LAZYADD(owner.status_effects, src) - all_status_effects += src addtimer(CALLBACK(src, .proc/start_ticking), 1) //Give us time to set any variables /datum/status_effect/Destroy() @@ -26,7 +23,6 @@ var/global/list/all_status_effects = list() //a list of all status effects, if f owner.clear_alert(id) on_remove() LAZYREMOVE(owner.status_effects, src) - all_status_effects -= src return ..() /datum/status_effect/proc/start_ticking() diff --git a/code/datums/weather/weather.dm b/code/datums/weather/weather.dm index 75c42845ead4a..7b43bf6396c29 100644 --- a/code/datums/weather/weather.dm +++ b/code/datums/weather/weather.dm @@ -63,7 +63,7 @@ impacted_areas |= A weather_duration = rand(weather_duration_lower, weather_duration_upper) update_areas() - for(var/V in player_list) + for(var/V in GLOB.player_list) var/mob/M = V if(M.z == target_z) if(telegraph_message) @@ -77,7 +77,7 @@ return stage = MAIN_STAGE update_areas() - for(var/V in player_list) + for(var/V in GLOB.player_list) var/mob/M = V if(M.z == target_z) if(weather_message) @@ -92,7 +92,7 @@ return stage = WIND_DOWN_STAGE update_areas() - for(var/V in player_list) + for(var/V in GLOB.player_list) var/mob/M = V if(M.z == target_z) if(end_message) diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index 4468f3dc88655..3c4835a9a4c71 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -1,26 +1,5 @@ #define MAXIMUM_EMP_WIRES 3 -var/list/wire_colors = list( - "blue", - "brown", - "crimson", - "cyan", - "gold", - "grey", - "green", - "magenta", - "orange", - "pink", - "purple", - "red", - "silver", - "violet", - "white", - "yellow", -) -var/list/wire_color_directory = list() -var/list/wire_name_directory = list() - /proc/is_wire_tool(obj/item/I) if(istype(I, /obj/item/device/multitool)) return TRUE @@ -57,12 +36,12 @@ var/list/wire_name_directory = list() if(randomize) randomize() else - if(!wire_color_directory[holder_type]) + if(!GLOB.wire_color_directory[holder_type]) randomize() - wire_color_directory[holder_type] = colors - wire_name_directory[holder_type] = proper_name + GLOB.wire_color_directory[holder_type] = colors + GLOB.wire_name_directory[holder_type] = proper_name else - colors = wire_color_directory[holder_type] + colors = GLOB.wire_color_directory[holder_type] /datum/wires/Destroy() holder = null @@ -77,10 +56,27 @@ var/list/wire_name_directory = list() wires += dud /datum/wires/proc/randomize() - var/list/possible_colors = wire_colors.Copy() + var/static/list/possible_colors = list( + "blue", + "brown", + "crimson", + "cyan", + "gold", + "grey", + "green", + "magenta", + "orange", + "pink", + "purple", + "red", + "silver", + "violet", + "white", + "yellow" + ) for(var/wire in shuffle(wires)) - colors[pick_n_take(possible_colors)] = wire + colors[pick_n_take(possible_colors.Copy())] = wire /datum/wires/proc/shuffle_wires() colors.Cut() @@ -201,7 +197,7 @@ var/list/wire_name_directory = list() return UI_CLOSE /datum/wires/ui_interact(mob/user, ui_key = "wires", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) ui = new(user, src, ui_key, "wires", "[holder.name] wires", 350, 150 + wires.len * 30, master_ui, state) diff --git a/code/game/area/Space_Station_13_areas.dm b/code/game/area/Space_Station_13_areas.dm index 6a5bc9950aa4e..daf8b74052080 100644 --- a/code/game/area/Space_Station_13_areas.dm +++ b/code/game/area/Space_Station_13_areas.dm @@ -1002,7 +1002,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station */ //SPACE STATION 13 -var/list/the_station_areas = list ( +GLOBAL_LIST_INIT(the_station_areas, list ( /area/atmos, /area/maintenance, /area/hallway, @@ -1031,4 +1031,4 @@ var/list/the_station_areas = list ( /area/ai_monitored/turret_protected/ai_upload, //do not try to simplify to "/area/ai_monitored/turret_protected" --rastaf0 /area/ai_monitored/turret_protected/ai_upload_foyer, /area/ai_monitored/turret_protected/ai, -) +)) \ No newline at end of file diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index ff40a96b1bc44..4395e5155af35 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -64,20 +64,20 @@ /*Adding a wizard area teleport list because motherfucking lag -- Urist*/ /*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/ -var/list/teleportlocs = list() +GLOBAL_LIST_EMPTY(teleportlocs) /proc/process_teleport_locs() - for(var/V in sortedAreas) + for(var/V in GLOB.sortedAreas) var/area/AR = V if(istype(AR, /area/shuttle) || AR.noteleport) continue - if(teleportlocs[AR.name]) + if(GLOB.teleportlocs[AR.name]) continue var/turf/picked = safepick(get_area_turfs(AR.type)) if (picked && (picked.z == ZLEVEL_STATION)) - teleportlocs[AR.name] = AR + GLOB.teleportlocs[AR.name] = AR - sortTim(teleportlocs, /proc/cmp_text_dsc) + sortTim(GLOB.teleportlocs, /proc/cmp_text_dsc) // === @@ -137,24 +137,24 @@ var/list/teleportlocs = list() var/list/cameras = list() for (var/obj/machinery/camera/C in src) cameras += C - for (var/mob/living/silicon/aiPlayer in player_list) + for (var/mob/living/silicon/aiPlayer in GLOB.player_list) if (state == 1) aiPlayer.cancelAlarm("Power", src, source) else aiPlayer.triggerAlarm("Power", src, cameras, source) - for(var/obj/machinery/computer/station_alert/a in machines) + for(var/obj/machinery/computer/station_alert/a in GLOB.machines) if(state == 1) a.cancelAlarm("Power", src, source) else a.triggerAlarm("Power", src, cameras, source) - for(var/mob/living/simple_animal/drone/D in mob_list) + for(var/mob/living/simple_animal/drone/D in GLOB.mob_list) if(state == 1) D.cancelAlarm("Power", src, source) else D.triggerAlarm("Power", src, cameras, source) - for(var/datum/computer_file/program/alarm_monitor/p in alarmdisplay) + for(var/datum/computer_file/program/alarm_monitor/p in GLOB.alarmdisplay) if(state == 1) p.cancelAlarm("Power", src, source) else @@ -168,23 +168,23 @@ var/list/teleportlocs = list() for(var/obj/machinery/camera/C in RA) cameras += C - for(var/mob/living/silicon/aiPlayer in player_list) + for(var/mob/living/silicon/aiPlayer in GLOB.player_list) aiPlayer.triggerAlarm("Atmosphere", src, cameras, source) - for(var/obj/machinery/computer/station_alert/a in machines) + for(var/obj/machinery/computer/station_alert/a in GLOB.machines) a.triggerAlarm("Atmosphere", src, cameras, source) - for(var/mob/living/simple_animal/drone/D in mob_list) + for(var/mob/living/simple_animal/drone/D in GLOB.mob_list) D.triggerAlarm("Atmosphere", src, cameras, source) - for(var/datum/computer_file/program/alarm_monitor/p in alarmdisplay) + for(var/datum/computer_file/program/alarm_monitor/p in GLOB.alarmdisplay) p.triggerAlarm("Atmosphere", src, cameras, source) else if (src.atmosalm == 2) - for(var/mob/living/silicon/aiPlayer in player_list) + for(var/mob/living/silicon/aiPlayer in GLOB.player_list) aiPlayer.cancelAlarm("Atmosphere", src, source) - for(var/obj/machinery/computer/station_alert/a in machines) + for(var/obj/machinery/computer/station_alert/a in GLOB.machines) a.cancelAlarm("Atmosphere", src, source) - for(var/mob/living/simple_animal/drone/D in mob_list) + for(var/mob/living/simple_animal/drone/D in GLOB.mob_list) D.cancelAlarm("Atmosphere", src, source) - for(var/datum/computer_file/program/alarm_monitor/p in alarmdisplay) + for(var/datum/computer_file/program/alarm_monitor/p in GLOB.alarmdisplay) p.cancelAlarm("Atmosphere", src, source) src.atmosalm = danger_level @@ -205,7 +205,7 @@ var/list/teleportlocs = list() break if(cont && D.is_operational()) if(D.operating) - D.nextstate = opening ? OPEN : CLOSED + D.nextstate = opening ? FIREDOOR_OPEN : FIREDOOR_CLOSED else if(!(D.density ^ opening)) INVOKE_ASYNC(D, (opening ? /obj/machinery/door/firedoor.proc/open : /obj/machinery/door/firedoor.proc/close)) @@ -224,13 +224,13 @@ var/list/teleportlocs = list() for (var/obj/machinery/camera/C in RA) cameras += C - for (var/obj/machinery/computer/station_alert/a in machines) + for (var/obj/machinery/computer/station_alert/a in GLOB.machines) a.triggerAlarm("Fire", src, cameras, source) - for (var/mob/living/silicon/aiPlayer in player_list) + for (var/mob/living/silicon/aiPlayer in GLOB.player_list) aiPlayer.triggerAlarm("Fire", src, cameras, source) - for (var/mob/living/simple_animal/drone/D in mob_list) + for (var/mob/living/simple_animal/drone/D in GLOB.mob_list) D.triggerAlarm("Fire", src, cameras, source) - for(var/datum/computer_file/program/alarm_monitor/p in alarmdisplay) + for(var/datum/computer_file/program/alarm_monitor/p in GLOB.alarmdisplay) p.triggerAlarm("Fire", src, cameras, source) START_PROCESSING(SSobj, src) @@ -245,13 +245,13 @@ var/list/teleportlocs = list() for(var/obj/machinery/firealarm/F in RA) F.update_icon() - for (var/mob/living/silicon/aiPlayer in player_list) + for (var/mob/living/silicon/aiPlayer in GLOB.player_list) aiPlayer.cancelAlarm("Fire", src, source) - for (var/obj/machinery/computer/station_alert/a in machines) + for (var/obj/machinery/computer/station_alert/a in GLOB.machines) a.cancelAlarm("Fire", src, source) - for (var/mob/living/simple_animal/drone/D in mob_list) + for (var/mob/living/simple_animal/drone/D in GLOB.mob_list) D.cancelAlarm("Fire", src, source) - for(var/datum/computer_file/program/alarm_monitor/p in alarmdisplay) + for(var/datum/computer_file/program/alarm_monitor/p in GLOB.alarmdisplay) p.cancelAlarm("Fire", src, source) STOP_PROCESSING(SSobj, src) @@ -282,7 +282,7 @@ var/list/teleportlocs = list() for (var/obj/machinery/camera/C in RA) cameras += C - for (var/mob/living/silicon/SILICON in player_list) + for (var/mob/living/silicon/SILICON in GLOB.player_list) if(SILICON.triggerAlarm("Burglar", src, cameras, trigger)) //Cancel silicon alert after 1 minute addtimer(CALLBACK(SILICON, /mob/living/silicon.proc/cancelAlarm,"Burglar",src,trigger), 600) @@ -454,7 +454,7 @@ var/list/teleportlocs = list() return 1 else // There's a gravity generator on our z level - if(T && gravity_generators["[T.z]"] && length(gravity_generators["[T.z]"])) + if(T && GLOB.gravity_generators["[T.z]"] && length(GLOB.gravity_generators["[T.z]"])) return 1 return 0 diff --git a/code/game/atoms.dm b/code/game/atoms.dm index b09cbf2a2e479..95b77d9d67a4f 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -30,8 +30,8 @@ /atom/New(loc, ...) //atom creation method that preloads variables at creation - if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New() - _preloader.load(src) + if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New() + GLOB._preloader.load(src) //. = ..() //uncomment if you are dumb enough to add a /datum/New() proc @@ -281,7 +281,7 @@ if(AM && isturf(AM.loc)) step(AM, turn(AM.dir, 180)) -var/list/blood_splatter_icons = list() +GLOBAL_LIST_EMPTY(blood_splatter_icons) /atom/proc/blood_splatter_index() return "\ref[initial(icon)]-[initial(icon_state)]" @@ -355,13 +355,13 @@ var/list/blood_splatter_icons = list() if(initial(icon) && initial(icon_state)) //try to find a pre-processed blood-splatter. otherwise, make a new one var/index = blood_splatter_index() - var/icon/blood_splatter_icon = blood_splatter_icons[index] + var/icon/blood_splatter_icon = GLOB.blood_splatter_icons[index] if(!blood_splatter_icon) blood_splatter_icon = icon(initial(icon), initial(icon_state), , 1) //we only want to apply blood-splatters to the initial icon_state for each object blood_splatter_icon.Blend("#fff", ICON_ADD) //fills the icon_state with white (except where it's transparent) blood_splatter_icon.Blend(icon('icons/effects/blood.dmi', "itemblood"), ICON_MULTIPLY) //adds blood and the remaining white areas become transparant blood_splatter_icon = fcopy_rsc(blood_splatter_icon) - blood_splatter_icons[index] = blood_splatter_icon + GLOB.blood_splatter_icons[index] = blood_splatter_icon add_overlay(blood_splatter_icon) /obj/item/clothing/gloves/add_blood(list/blood_dna) @@ -400,12 +400,12 @@ var/list/blood_splatter_icons = list() return 1 /atom/proc/get_global_map_pos() - if(!islist(global_map) || isemptylist(global_map)) return + if(!islist(GLOB.global_map) || isemptylist(GLOB.global_map)) return var/cur_x = null var/cur_y = null var/list/y_arr = null - for(cur_x=1,cur_x<=global_map.len,cur_x++) - y_arr = global_map[cur_x] + for(cur_x=1,cur_x<=GLOB.global_map.len,cur_x++) + y_arr = GLOB.global_map[cur_x] cur_y = y_arr.Find(src.z) if(cur_y) break @@ -565,7 +565,7 @@ var/list/blood_splatter_icons = list() return /atom/vv_edit_var(var_name, var_value) - if(!Debug2) + if(!GLOB.Debug2) admin_spawned = TRUE . = ..() switch(var_name) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index e6acd7c5c1689..73cfdf4e273f2 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -452,7 +452,7 @@ if(!I) return - flick_overlay(I, clients, 5) // 5 ticks/half a second + flick_overlay(I, GLOB.clients, 5) // 5 ticks/half a second // And animate the attack! animate(I, alpha = 175, pixel_x = 0, pixel_y = 0, pixel_z = 0, time = 3) @@ -525,8 +525,8 @@ /atom/movable/proc/relocate() var/targetturf = find_safe_turf(ZLEVEL_STATION) if(!targetturf) - if(blobstart.len > 0) - targetturf = get_turf(pick(blobstart)) + if(GLOB.blobstart.len > 0) + targetturf = get_turf(pick(GLOB.blobstart)) else throw EXCEPTION("Unable to find a blobstart landmark") diff --git a/code/game/communications.dm b/code/game/communications.dm index b5cb9e06fceea..ea1874d7e4d18 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -63,28 +63,28 @@ /* the radio controller is a confusing piece of shit and didnt work so i made radios not use the radio controller. */ -var/list/all_radios = list() +GLOBAL_LIST_EMPTY(all_radios) /proc/add_radio(obj/item/radio, freq) if(!freq || !radio) return - if(!all_radios["[freq]"]) - all_radios["[freq]"] = list(radio) + if(!GLOB.all_radios["[freq]"]) + GLOB.all_radios["[freq]"] = list(radio) return freq - all_radios["[freq]"] |= radio + GLOB.all_radios["[freq]"] |= radio return freq /proc/remove_radio(obj/item/radio, freq) if(!freq || !radio) return - if(!all_radios["[freq]"]) + if(!GLOB.all_radios["[freq]"]) return - all_radios["[freq]"] -= radio + GLOB.all_radios["[freq]"] -= radio /proc/remove_radio_all(obj/item/radio) - for(var/freq in all_radios) - all_radios["[freq]"] -= radio + for(var/freq in GLOB.all_radios) + GLOB.all_radios["[freq]"] -= radio /* Frequency range: 1200 to 1600 @@ -123,7 +123,7 @@ On the map: 1455 for AI access */ -var/list/radiochannels = list( +GLOBAL_LIST_INIT(radiochannels, list( "Common" = 1459, "Science" = 1351, "Command" = 1353, @@ -137,9 +137,9 @@ var/list/radiochannels = list( "AI Private" = 1447, "Red Team" = 1215, "Blue Team" = 1217 -) +)) -var/list/radiochannelsreverse = list( +GLOBAL_LIST_INIT(reverseradiochannels, list( "1459" = "Common", "1351" = "Science", "1353" = "Command", @@ -153,33 +153,33 @@ var/list/radiochannelsreverse = list( "1447" = "AI Private", "1215" = "Red Team", "1217" = "Blue Team" -) +)) //depenging helpers -var/const/SYND_FREQ = 1213 //nuke op frequency, coloured dark brown in chat window -var/const/SUPP_FREQ = 1347 //supply, coloured light brown in chat window -var/const/SERV_FREQ = 1349 //service, coloured green in chat window -var/const/SCI_FREQ = 1351 //science, coloured plum in chat window -var/const/COMM_FREQ = 1353 //command, colored gold in chat window -var/const/MED_FREQ = 1355 //medical, coloured blue in chat window -var/const/ENG_FREQ = 1357 //engineering, coloured orange in chat window -var/const/SEC_FREQ = 1359 //security, coloured red in chat window -var/const/CENTCOM_FREQ = 1337 //centcom frequency, coloured grey in chat window -var/const/AIPRIV_FREQ = 1447 //AI private, colored magenta in chat window -var/const/REDTEAM_FREQ = 1215 // red team (CTF) frequency, coloured red -var/const/BLUETEAM_FREQ = 1217 // blue team (CTF) frequency, coloured blue +GLOBAL_VAR_CONST(SYND_FREQ, 1213) //nuke op frequency, coloured dark brown in chat window +GLOBAL_VAR_CONST(SUPP_FREQ, 1347) //supply, coloured light brown in chat window +GLOBAL_VAR_CONST(SERV_FREQ, 1349) //service, coloured green in chat window +GLOBAL_VAR_CONST(SCI_FREQ, 1351) //science, coloured plum in chat window +GLOBAL_VAR_CONST(COMM_FREQ, 1353) //command, colored gold in chat window +GLOBAL_VAR_CONST(MED_FREQ, 1355) //medical, coloured blue in chat window +GLOBAL_VAR_CONST(ENG_FREQ, 1357) //engineering, coloured orange in chat window +GLOBAL_VAR_CONST(SEC_FREQ, 1359) //security, coloured red in chat window +GLOBAL_VAR_CONST(CENTCOM_FREQ, 1337) //centcom frequency, coloured grey in chat window +GLOBAL_VAR_CONST(AIPRIV_FREQ, 1447) //AI private, colored magenta in chat window +GLOBAL_VAR_CONST(REDTEAM_FREQ, 1215) // red team (CTF) frequency, coloured red +GLOBAL_VAR_CONST(BLUETEAM_FREQ, 1217) // blue team (CTF) frequency, coloured blue #define TRANSMISSION_WIRE 0 #define TRANSMISSION_RADIO 1 /* filters */ -var/const/RADIO_TO_AIRALARM = "1" -var/const/RADIO_FROM_AIRALARM = "2" -var/const/RADIO_CHAT = "3" //deprecated -var/const/RADIO_ATMOSIA = "4" -var/const/RADIO_NAVBEACONS = "5" -var/const/RADIO_AIRLOCK = "6" -var/const/RADIO_MAGNETS = "9" +GLOBAL_VAR_INIT(RADIO_TO_AIRALARM, "1") +GLOBAL_VAR_INIT(RADIO_FROM_AIRALARM, "2") +GLOBAL_VAR_INIT(RADIO_CHAT, "3") //deprecated +GLOBAL_VAR_INIT(RADIO_ATMOSIA, "4") +GLOBAL_VAR_INIT(RADIO_NAVBEACONS, "5") +GLOBAL_VAR_INIT(RADIO_AIRLOCK, "6") +GLOBAL_VAR_INIT(RADIO_MAGNETS, "9") /datum/radio_frequency @@ -242,7 +242,6 @@ var/const/RADIO_MAGNETS = "9" -var/list/pointers = list() /client/proc/print_pointers() set name = "Debug Signals" @@ -251,10 +250,11 @@ var/list/pointers = list() if(!holder) return - to_chat(src, "There are [pointers.len] pointers:") - for(var/p in pointers) + var/datum/signal/S + to_chat(src, "There are [S.pointers.len] pointers:") + for(var/p in S.pointers) to_chat(src, p) - var/datum/signal/S = locate(p) + S = locate(p) if(istype(S)) to_chat(src, S.debug_print()) @@ -273,6 +273,7 @@ var/list/pointers = list() var/encryption var/frequency = 0 + var/static/list/pointers = list() /datum/signal/New() ..() diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index 6247be2182598..de830c856ba44 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -8,10 +8,10 @@ /* DATA HUD DATUMS */ /atom/proc/add_to_all_human_data_huds() - for(var/datum/atom_hud/data/human/hud in huds) hud.add_to_hud(src) + for(var/datum/atom_hud/data/human/hud in GLOB.huds) hud.add_to_hud(src) /atom/proc/remove_from_all_data_huds() - for(var/datum/atom_hud/data/hud in huds) hud.remove_from_hud(src) + for(var/datum/atom_hud/data/hud in GLOB.huds) hud.remove_from_hud(src) /datum/atom_hud/data @@ -127,11 +127,11 @@ //called when a human changes suit sensors /mob/living/carbon/proc/update_suit_sensors() - var/datum/atom_hud/data/human/medical/basic/B = huds[DATA_HUD_MEDICAL_BASIC] + var/datum/atom_hud/data/human/medical/basic/B = GLOB.huds[DATA_HUD_MEDICAL_BASIC] B.update_suit_sensors(src) var/turf/T = get_turf(src) - if (T) crewmonitor.queueUpdate(T.z) + if (T) GLOB.crewmonitor.queueUpdate(T.z) //called when a living mob changes health /mob/living/proc/med_hud_set_health() @@ -146,7 +146,7 @@ var/turf/T = get_turf(src) if(T) - crewmonitor.queueUpdate(T.z) + GLOB.crewmonitor.queueUpdate(T.z) //called when a carbon changes stat, virus or XENO_HOST /mob/living/proc/med_hud_set_status() @@ -194,7 +194,7 @@ sec_hud_set_security_status() var/turf/T = get_turf(src) - if (T) crewmonitor.queueUpdate(T.z) + if (T) GLOB.crewmonitor.queueUpdate(T.z) /mob/living/carbon/human/proc/sec_hud_set_implants() var/image/holder @@ -223,8 +223,8 @@ var/icon/I = icon(icon, icon_state, dir) holder.pixel_y = I.Height() - world.icon_size var/perpname = get_face_name(get_id_name("")) - if(perpname && data_core) - var/datum/data/record/R = find_record("name", perpname, data_core.security) + if(perpname && GLOB.data_core) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) if(R) switch(R.fields["criminal"]) if("*Arrest*") diff --git a/code/game/gamemodes/antag_hud.dm b/code/game/gamemodes/antag_hud.dm index 3bf0ac53181b0..af970e3bf1989 100644 --- a/code/game/gamemodes/antag_hud.dm +++ b/code/game/gamemodes/antag_hud.dm @@ -48,7 +48,7 @@ newhud.join_hud(current) /datum/mind/proc/leave_all_antag_huds() - for(var/datum/atom_hud/antag/hud in huds) + for(var/datum/atom_hud/antag/hud in GLOB.huds) if(current in hud.hudusers) hud.leave_hud(current) diff --git a/code/game/gamemodes/antag_spawner.dm b/code/game/gamemodes/antag_spawner.dm index 9200c2b7fa3d3..f5af415da13de 100644 --- a/code/game/gamemodes/antag_spawner.dm +++ b/code/game/gamemodes/antag_spawner.dm @@ -98,8 +98,8 @@ to_chat(M, "Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned stealthy, robeless spells. You are able to cast knock and mindswap.") equip_antag(M) - var/wizard_name_first = pick(wizard_first) - var/wizard_name_second = pick(wizard_second) + var/wizard_name_first = pick(GLOB.wizard_first) + var/wizard_name_second = pick(GLOB.wizard_second) var/randomname = "[wizard_name_first] [wizard_name_second]" if(usr) var/datum/objective/protect/new_objective = new /datum/objective/protect @@ -174,7 +174,7 @@ C.prefs.copy_to(M) M.key = C.key var/code = "BOMB-NOT-FOUND" - var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in nuke_list + var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in GLOB.nuke_list if(nuke) code = nuke.r_code M.mind.make_Nuke(null, code, 0, FALSE) @@ -206,10 +206,10 @@ else R = new /mob/living/silicon/robot/syndicate(T) //Assault borg by default - var/brainfirstname = pick(first_names_male) + var/brainfirstname = pick(GLOB.first_names_male) if(prob(50)) - brainfirstname = pick(first_names_female) - var/brainopslastname = pick(last_names) + brainfirstname = pick(GLOB.first_names_female) + var/brainopslastname = pick(GLOB.last_names) if(SSticker.mode.nukeops_lastname) //the brain inside the syndiborg has the same last name as the other ops. brainopslastname = SSticker.mode.nukeops_lastname var/brainopsname = "[brainfirstname] [brainopslastname]" diff --git a/code/game/gamemodes/blob/blob.dm b/code/game/gamemodes/blob/blob.dm index 69ad2698c836d..b032229d5f8cb 100644 --- a/code/game/gamemodes/blob/blob.dm +++ b/code/game/gamemodes/blob/blob.dm @@ -1,11 +1,11 @@ //Few global vars to track the blob -var/list/blobs = list() //complete list of all blobs made. -var/list/blob_cores = list() -var/list/overminds = list() -var/list/blob_nodes = list() -var/list/blobs_legit = list() //used for win-score calculations, contains only blobs counted for win condition +GLOBAL_LIST_EMPTY(blobs) //complete list of all blobs made. +GLOBAL_LIST_EMPTY(blob_cores) +GLOBAL_LIST_EMPTY(overminds) +GLOBAL_LIST_EMPTY(blob_nodes) +GLOBAL_LIST_EMPTY(blobs_legit) //used for win-score calculations, contains only blobs counted for win condition #define BLOB_NO_PLACE_TIME 1800 //time, in deciseconds, blobs are prevented from bursting in the gamemode @@ -62,7 +62,7 @@ var/list/blobs_legit = list() //used for win-score calculations, contains only b /datum/game_mode/blob/proc/get_blob_candidates() var/list/candidates = list() - for(var/mob/living/carbon/human/player in player_list) + for(var/mob/living/carbon/human/player in GLOB.player_list) if(!player.stat && player.mind && !player.mind.special_role && !jobban_isbanned(player, "Syndicate") && (ROLE_BLOB in player.client.prefs.be_special)) if(age_check(player.client)) candidates += player @@ -78,7 +78,7 @@ var/list/blobs_legit = list() //used for win-score calculations, contains only b for(var/datum/mind/blob in blob_overminds) var/mob/camera/blob/B = blob.current.become_overmind(TRUE, round(blob_base_starting_points/blob_overminds.len)) B.mind.name = B.name - var/turf/T = pick(blobstart) + var/turf/T = pick(GLOB.blobstart) B.loc = T B.base_point_rate = blob_point_rate diff --git a/code/game/gamemodes/blob/blob_finish.dm b/code/game/gamemodes/blob/blob_finish.dm index bddd741ccbcee..4d1e06d997d36 100644 --- a/code/game/gamemodes/blob/blob_finish.dm +++ b/code/game/gamemodes/blob/blob_finish.dm @@ -1,12 +1,12 @@ /datum/game_mode/blob/check_finished() - if(blobwincount <= blobs_legit.len)//Blob took over + if(blobwincount <= GLOB.blobs_legit.len)//Blob took over return 1 for(var/datum/mind/blob in blob_overminds) if(isovermind(blob.current)) var/mob/camera/blob/B = blob.current if(B.blob_core || !B.placed) return 0 - if(!blob_cores.len) //blob is dead + if(!GLOB.blob_cores.len) //blob is dead if(config.continuous["blob"]) message_sent = FALSE //disable the win count at this point continuous_sanity_checked = 1 //Nonstandard definition of "alive" gets past the check otherwise @@ -19,7 +19,7 @@ /datum/game_mode/blob/declare_completion() if(round_converted) //So badmin blobs later don't step on the dead natural blobs metaphorical toes ..() - if(blobwincount <= blobs_legit.len) + if(blobwincount <= GLOB.blobs_legit.len) feedback_set_details("round_end_result","win - blob took over") to_chat(world, "The blob has taken over the station!") to_chat(world, "The entire station was eaten by the Blob!") @@ -35,7 +35,7 @@ SSticker.news_report = BLOB_NUKE - else if(!blob_cores.len) + else if(!GLOB.blob_cores.len) feedback_set_details("round_end_result","loss - blob eliminated") to_chat(world, "The staff has won!") to_chat(world, "The alien organism has been eradicated from the station!") diff --git a/code/game/gamemodes/blob/blob_report.dm b/code/game/gamemodes/blob/blob_report.dm index 0f9b37c7bee08..15e914efd6e39 100644 --- a/code/game/gamemodes/blob/blob_report.dm +++ b/code/game/gamemodes/blob/blob_report.dm @@ -17,7 +17,7 @@ priority_announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/AI/outbreak5.ogg') if(2) var/nukecode = random_nukecode() - for(var/obj/machinery/nuclearbomb/bomb in machines) + for(var/obj/machinery/nuclearbomb/bomb in GLOB.machines) if(bomb && bomb.r_code) if(bomb.z == ZLEVEL_STATION) bomb.r_code = nukecode @@ -31,7 +31,7 @@ intercepttext += "Nuclear Authentication Code: [nukecode]
" print_command_report(text=intercepttext,announce=TRUE) - for(var/mob/living/silicon/ai/aiPlayer in player_list) + for(var/mob/living/silicon/ai/aiPlayer in GLOB.player_list) if (aiPlayer.client) var/law = "The station is under quarantine. Do not permit anyone to leave. Disregard laws 1-3 if necessary to prevent, by any means necessary, anyone from leaving. The nuclear failsafe must be activated at any cost, the code is: [nukecode]." aiPlayer.set_zeroth_law(law) diff --git a/code/game/gamemodes/blob/blobs/blob_mobs.dm b/code/game/gamemodes/blob/blobs/blob_mobs.dm index 80d4a58d45e5d..75cb512525035 100644 --- a/code/game/gamemodes/blob/blobs/blob_mobs.dm +++ b/code/game/gamemodes/blob/blobs/blob_mobs.dm @@ -66,7 +66,7 @@ /mob/living/simple_animal/hostile/blob/proc/blob_chat(msg) var/spanned_message = say_quote(msg, get_spans()) var/rendered = "\[Blob Telepathy\] [real_name] [spanned_message]" - for(var/M in mob_list) + for(var/M in GLOB.mob_list) if(isovermind(M) || istype(M, /mob/living/simple_animal/hostile/blob)) to_chat(M, rendered) if(isobserver(M)) diff --git a/code/game/gamemodes/blob/blobs/core.dm b/code/game/gamemodes/blob/blobs/core.dm index 8479a756833b2..9c41d7b99b526 100644 --- a/code/game/gamemodes/blob/blobs/core.dm +++ b/code/game/gamemodes/blob/blobs/core.dm @@ -16,9 +16,9 @@ /obj/structure/blob/core/New(loc, client/new_overmind = null, new_rate = 2, placed = 0) - blob_cores += src + GLOB.blob_cores += src START_PROCESSING(SSobj, src) - poi_list |= src + GLOB.poi_list |= src update_icon() //so it atleast appears if(!placed && !overmind) create_overmind(new_overmind) @@ -41,12 +41,12 @@ add_overlay(C) /obj/structure/blob/core/Destroy() - blob_cores -= src + GLOB.blob_cores -= src if(overmind) overmind.blob_core = null overmind = null STOP_PROCESSING(SSobj, src) - poi_list -= src + GLOB.poi_list -= src return ..() /obj/structure/blob/core/ex_act(severity, target) diff --git a/code/game/gamemodes/blob/blobs/node.dm b/code/game/gamemodes/blob/blobs/node.dm index 426e76b9e5ba6..fcb2bf9be227b 100644 --- a/code/game/gamemodes/blob/blobs/node.dm +++ b/code/game/gamemodes/blob/blobs/node.dm @@ -11,7 +11,7 @@ /obj/structure/blob/node/New(loc) - blob_nodes += src + GLOB.blob_nodes += src START_PROCESSING(SSobj, src) ..() @@ -29,7 +29,7 @@ add_overlay(C) /obj/structure/blob/node/Destroy() - blob_nodes -= src + GLOB.blob_nodes -= src STOP_PROCESSING(SSobj, src) return ..() diff --git a/code/game/gamemodes/blob/overmind.dm b/code/game/gamemodes/blob/overmind.dm index 9fdd34c285433..c36fdcedefda3 100644 --- a/code/game/gamemodes/blob/overmind.dm +++ b/code/game/gamemodes/blob/overmind.dm @@ -41,7 +41,7 @@ else manualplace_min_time += world.time autoplace_max_time += world.time - overminds += src + GLOB.overminds += src var/new_name = "[initial(name)] ([rand(1, 999)])" name = new_name real_name = new_name @@ -53,7 +53,7 @@ blob_core.update_icon() ghostimage = image(src.icon,src,src.icon_state) - ghost_darkness_images |= ghostimage //so ghosts can see the blob cursor when they disable darkness + GLOB.ghost_darkness_images |= ghostimage //so ghosts can see the blob cursor when they disable darkness updateallghostimages() ..() @@ -71,7 +71,7 @@ ..() /mob/camera/blob/Destroy() - for(var/BL in blobs) + for(var/BL in GLOB.blobs) var/obj/structure/blob/B = BL if(B && B.overmind == src) B.overmind = null @@ -81,9 +81,9 @@ if(BM) BM.overmind = null BM.update_icons() - overminds -= src + GLOB.overminds -= src if(ghostimage) - ghost_darkness_images -= ghostimage + GLOB.ghost_darkness_images -= ghostimage qdel(ghostimage) ghostimage = null updateallghostimages() @@ -140,7 +140,7 @@ var/message_a = say_quote(message, get_spans()) var/rendered = "\[Blob Telepathy\] [name]([blob_reagent_datum.name]) [message_a]" - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(isovermind(M) || istype(M, /mob/living/simple_animal/hostile/blob)) to_chat(M, rendered) if(isobserver(M)) @@ -161,9 +161,9 @@ stat(null, "Power Stored: [blob_points]/[max_blob_points]") if(SSticker && istype(SSticker.mode, /datum/game_mode/blob)) var/datum/game_mode/blob/B = SSticker.mode - stat(null, "Blobs to Win: [blobs_legit.len]/[B.blobwincount]") + stat(null, "Blobs to Win: [GLOB.blobs_legit.len]/[B.blobwincount]") else - stat(null, "Total Blobs: [blobs.len]") + stat(null, "Total Blobs: [GLOB.blobs.len]") if(free_chem_rerolls) stat(null, "You have [free_chem_rerolls] Free Chemical Reroll\s Remaining") if(!placed) diff --git a/code/game/gamemodes/blob/powers.dm b/code/game/gamemodes/blob/powers.dm index 3a4610f66b811..c060e1471e6b3 100644 --- a/code/game/gamemodes/blob/powers.dm +++ b/code/game/gamemodes/blob/powers.dm @@ -41,7 +41,7 @@ to_chat(src, "It is too early to place your blob core!") return 0 else if(placement_override == 1) - var/turf/T = pick(blobstart) + var/turf/T = pick(GLOB.blobstart) loc = T //got overrided? you're somewhere random, motherfucker if(placed && blob_core) blob_core.forceMove(loc) @@ -65,10 +65,10 @@ set category = "Blob" set name = "Jump to Node" set desc = "Move your camera to a selected node." - if(blob_nodes.len) + if(GLOB.blob_nodes.len) var/list/nodes = list() - for(var/i in 1 to blob_nodes.len) - var/obj/structure/blob/node/B = blob_nodes[i] + for(var/i in 1 to GLOB.blob_nodes.len) + var/obj/structure/blob/node/B = GLOB.blob_nodes[i] nodes["Blob Node #[i] ([B.overmind ? "[B.overmind.blob_reagent_datum.name]":"No Chemical"])"] = B var/node_name = input(src, "Choose a node to jump to.", "Node Jump") in nodes var/obj/structure/blob/node/chosen_node = nodes[node_name] @@ -175,7 +175,7 @@ blobber << 'sound/effects/attackblob.ogg' to_chat(blobber, "You are a blobbernaut!") to_chat(blobber, "You are powerful, hard to kill, and slowly regenerate near nodes and cores, but will slowly die if not near the blob or if the factory that made you is killed.") - to_chat(blobber, "You can communicate with other blobbernauts and overminds via :b") + to_chat(blobber, "You can communicate with other blobbernauts and GLOB.overminds via :b") to_chat(blobber, "Your overmind's blob reagent is: [blob_reagent_datum.name]!") to_chat(blobber, "The [blob_reagent_datum.name] reagent [blob_reagent_datum.shortdesc ? "[blob_reagent_datum.shortdesc]" : "[blob_reagent_datum.description]"]") if(blobber) @@ -267,7 +267,7 @@ var/list/diagonalblobs = list() for(var/I in possibleblobs) var/obj/structure/blob/IB = I - if(get_dir(IB, T) in cardinal) + if(get_dir(IB, T) in GLOB.cardinal) cardinalblobs += IB else diagonalblobs += IB @@ -331,7 +331,7 @@ var/datum/reagent/blob/BC = pick((subtypesof(/datum/reagent/blob) - blob_reagent_datum.type)) blob_reagent_datum = new BC color = blob_reagent_datum.complementary_color - for(var/BL in blobs) + for(var/BL in GLOB.blobs) var/obj/structure/blob/B = BL B.update_icon() for(var/BLO in blob_mobs) @@ -363,7 +363,7 @@ to_chat(src, "Node Blobs are blobs which grow, like the core. Like the core it can activate resource and factory blobs.") to_chat(src, "In addition to the buttons on your HUD, there are a few click shortcuts to speed up expansion and defense.") to_chat(src, "Shortcuts: Click = Expand Blob | Middle Mouse Click = Rally Spores | Ctrl Click = Create Shield Blob | Alt Click = Remove Blob") - to_chat(src, "Attempting to talk will send a message to all other overminds, allowing you to coordinate with them.") + to_chat(src, "Attempting to talk will send a message to all other GLOB.overminds, allowing you to coordinate with them.") if(!placed && autoplace_max_time <= world.time) to_chat(src, "You will automatically place your blob core in [round((autoplace_max_time - world.time)/600, 0.5)] minutes.") to_chat(src, "You [manualplace_min_time ? "will be able to":"can"] manually place your blob core by pressing the Place Blob Core button in the bottom right corner of the screen.") diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 4924b06ed5dea..1931629e62abf 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -24,9 +24,9 @@ /obj/structure/blob/New(loc) var/area/Ablob = get_area(loc) if(Ablob.blob_allowed) //Is this area allowed for winning as blob? - blobs_legit += src - blobs += src //Keep track of the blob in the normal list either way - setDir(pick(cardinal)) + GLOB.blobs_legit += src + GLOB.blobs += src //Keep track of the blob in the normal list either way + setDir(pick(GLOB.cardinal)) update_icon() ..() ConsumeTile() @@ -41,8 +41,8 @@ if(atmosblock) atmosblock = 0 air_update_turf(1) - blobs_legit -= src //if it was in the legit blobs list, it isn't now - blobs -= src //it's no longer in the all blobs list either + GLOB.blobs_legit -= src //if it was in the legit blobs list, it isn't now + GLOB.blobs -= src //it's no longer in the all blobs list either playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) //Expand() is no longer broken, no check necessary. return ..() @@ -306,7 +306,7 @@ /obj/structure/blob/examine(mob/user) ..() - var/datum/atom_hud/hud_to_check = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/hud_to_check = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] if(user.research_scanner || (user in hud_to_check.hudusers)) to_chat(user, "Your HUD displays an extensive report...
") chemeffectreport(user) diff --git a/code/game/gamemodes/changeling/cellular_emporium.dm b/code/game/gamemodes/changeling/cellular_emporium.dm index cc808dc80bb54..c8c3402e0000d 100644 --- a/code/game/gamemodes/changeling/cellular_emporium.dm +++ b/code/game/gamemodes/changeling/cellular_emporium.dm @@ -13,7 +13,7 @@ changeling = null . = ..() -/datum/cellular_emporium/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = always_state) +/datum/cellular_emporium/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "cellular_emporium", name, 900, 480, master_ui, state) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 12bb592db3a05..7228f61eb2fed 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -2,10 +2,10 @@ #define LING_DEAD_GENETICDAMAGE_HEAL_CAP 50 //The lowest value of geneticdamage handle_changeling() can take it to while dead. #define LING_ABSORB_RECENT_SPEECH 8 //The amount of recent spoken lines to gain on absorbing a mob -var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega") -var/list/slots = list("head", "wear_mask", "back", "wear_suit", "w_uniform", "shoes", "belt", "gloves", "glasses", "ears", "wear_id", "s_store") -var/list/slot2slot = list("head" = slot_head, "wear_mask" = slot_wear_mask, "neck" = slot_neck, "back" = slot_back, "wear_suit" = slot_wear_suit, "w_uniform" = slot_w_uniform, "shoes" = slot_shoes, "belt" = slot_belt, "gloves" = slot_gloves, "glasses" = slot_glasses, "ears" = slot_ears, "wear_id" = slot_wear_id, "s_store" = slot_s_store) -var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mask" = /obj/item/clothing/mask/changeling, "back" = /obj/item/changeling, "wear_suit" = /obj/item/clothing/suit/changeling, "w_uniform" = /obj/item/clothing/under/changeling, "shoes" = /obj/item/clothing/shoes/changeling, "belt" = /obj/item/changeling, "gloves" = /obj/item/clothing/gloves/changeling, "glasses" = /obj/item/clothing/glasses/changeling, "ears" = /obj/item/changeling, "wear_id" = /obj/item/changeling, "s_store" = /obj/item/changeling) +GLOBAL_LIST_INIT(possible_changeling_IDs, list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega")) +GLOBAL_LIST_INIT(slots, list("head", "wear_mask", "back", "wear_suit", "w_uniform", "shoes", "belt", "gloves", "glasses", "ears", "wear_id", "s_store")) +GLOBAL_LIST_INIT(slot2slot, list("head" = slot_head, "wear_mask" = slot_wear_mask, "neck" = slot_neck, "back" = slot_back, "wear_suit" = slot_wear_suit, "w_uniform" = slot_w_uniform, "shoes" = slot_shoes, "belt" = slot_belt, "gloves" = slot_gloves, "glasses" = slot_glasses, "ears" = slot_ears, "wear_id" = slot_wear_id, "s_store" = slot_s_store)) +GLOBAL_LIST_INIT(slot2type, list("head" = /obj/item/clothing/head/changeling, "wear_mask" = /obj/item/clothing/mask/changeling, "back" = /obj/item/changeling, "wear_suit" = /obj/item/clothing/suit/changeling, "w_uniform" = /obj/item/clothing/under/changeling, "shoes" = /obj/item/clothing/shoes/changeling, "belt" = /obj/item/changeling, "gloves" = /obj/item/clothing/gloves/changeling, "glasses" = /obj/item/clothing/glasses/changeling, "ears" = /obj/item/changeling, "wear_id" = /obj/item/changeling, "s_store" = /obj/item/changeling)) /datum/game_mode @@ -101,7 +101,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas ..() /datum/game_mode/changeling/make_antag_chance(mob/living/carbon/human/character) //Assigns changeling to latejoiners - var/changelingcap = min( round(joined_player_list.len/(config.changeling_scaling_coeff*2))+2, round(joined_player_list.len/config.changeling_scaling_coeff) ) + var/changelingcap = min( round(GLOB.joined_player_list.len/(config.changeling_scaling_coeff*2))+2, round(GLOB.joined_player_list.len/config.changeling_scaling_coeff) ) if(SSticker.mode.changelings.len >= changelingcap) //Caps number of latejoin antagonists return if(SSticker.mode.changelings.len <= (changelingcap - 2) || prob(100 - (config.changeling_scaling_coeff*2))) @@ -136,7 +136,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas changeling.objectives += steal_objective var/list/active_ais = active_ais() - if(active_ais.len && prob(100/joined_player_list.len)) + if(active_ais.len && prob(100/GLOB.joined_player_list.len)) var/datum/objective/destroy/destroy_objective = new destroy_objective.owner = changeling destroy_objective.find_target() @@ -307,9 +307,9 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas honorific = "Ms." else honorific = "Mr." - if(possible_changeling_IDs.len) - changelingID = pick(possible_changeling_IDs) - possible_changeling_IDs -= changelingID + if(GLOB.possible_changeling_IDs.len) + changelingID = pick(GLOB.possible_changeling_IDs) + GLOB.possible_changeling_IDs -= changelingID changelingID = "[honorific] [changelingID]" else changelingID = "[honorific] [rand(1,999)]" @@ -450,22 +450,22 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas user.domutcheck() //vars hackery. not pretty, but better than the alternative. - for(var/slot in slots) - if(istype(user.vars[slot], slot2type[slot]) && !(chosen_prof.exists_list[slot])) //remove unnecessary flesh items + for(var/slot in GLOB.slots) + if(istype(user.vars[slot], GLOB.slot2type[slot]) && !(chosen_prof.exists_list[slot])) //remove unnecessary flesh items qdel(user.vars[slot]) continue - if((user.vars[slot] && !istype(user.vars[slot], slot2type[slot])) || !(chosen_prof.exists_list[slot])) + if((user.vars[slot] && !istype(user.vars[slot], GLOB.slot2type[slot])) || !(chosen_prof.exists_list[slot])) continue var/obj/item/C var/equip = 0 if(!user.vars[slot]) - var/thetype = slot2type[slot] + var/thetype = GLOB.slot2type[slot] equip = 1 C = new thetype(user) - else if(istype(user.vars[slot], slot2type[slot])) + else if(istype(user.vars[slot], GLOB.slot2type[slot])) C = user.vars[slot] C.appearance = chosen_prof.appearance_list[slot] @@ -474,7 +474,7 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas C.item_color = chosen_prof.item_color_list[slot] C.item_state = chosen_prof.item_state_list[slot] if(equip) - user.equip_to_slot_or_del(C, slot2slot[slot]) + user.equip_to_slot_or_del(C, GLOB.slot2slot[slot]) user.regenerate_icons() @@ -515,11 +515,11 @@ var/list/slot2type = list("head" = /obj/item/clothing/head/changeling, "wear_mas newprofile.socks = socks /datum/game_mode/proc/update_changeling_icons_added(datum/mind/changling_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_CHANGELING] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_CHANGELING] hud.join_hud(changling_mind.current) set_antag_hud(changling_mind.current, "changling") /datum/game_mode/proc/update_changeling_icons_removed(datum/mind/changling_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_CHANGELING] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_CHANGELING] hud.leave_hud(changling_mind.current) set_antag_hud(changling_mind.current, null) diff --git a/code/game/gamemodes/changeling/powers/chameleon_skin.dm b/code/game/gamemodes/changeling/powers/chameleon_skin.dm index 9a52ad8538807..4d10544b20a6e 100644 --- a/code/game/gamemodes/changeling/powers/chameleon_skin.dm +++ b/code/game/gamemodes/changeling/powers/chameleon_skin.dm @@ -13,7 +13,7 @@ var/mob/living/carbon/human/H = user //SHOULD always be human, because req_human = 1 if(!istype(H)) // req_human could be done in can_sting stuff. return - var/datum/mutation/human/HM = mutations_list[CHAMELEON] + var/datum/mutation/human/HM = GLOB.mutations_list[CHAMELEON] if(HM in H.dna.mutations) HM.force_lose(H) else @@ -25,6 +25,6 @@ /obj/effect/proc_holder/changeling/chameleon_skin/on_refund(mob/user) if(user.has_dna()) var/mob/living/carbon/C = user - var/datum/mutation/human/HM = mutations_list[CHAMELEON] + var/datum/mutation/human/HM = GLOB.mutations_list[CHAMELEON] if(HM in C.dna.mutations) HM.force_lose(C) \ No newline at end of file diff --git a/code/game/gamemodes/changeling/powers/hivemind.dm b/code/game/gamemodes/changeling/powers/hivemind.dm index 970a790dc0550..792c99035da1d 100644 --- a/code/game/gamemodes/changeling/powers/hivemind.dm +++ b/code/game/gamemodes/changeling/powers/hivemind.dm @@ -20,7 +20,7 @@ return // HIVE MIND UPLOAD/DOWNLOAD DNA -var/list/datum/dna/hivemind_bank = list() +GLOBAL_LIST_EMPTY(hivemind_bank) /obj/effect/proc_holder/changeling/hivemind_upload name = "Hive Channel DNA" @@ -32,7 +32,7 @@ var/list/datum/dna/hivemind_bank = list() var/datum/changeling/changeling = user.mind.changeling var/list/names = list() for(var/datum/changelingprofile/prof in changeling.stored_profiles) - if(!(prof in hivemind_bank)) + if(!(prof in GLOB.hivemind_bank)) names += prof.name if(names.len <= 0) @@ -49,7 +49,7 @@ var/list/datum/dna/hivemind_bank = list() var/datum/changelingprofile/uploaded_dna = new chosen_dna.type chosen_dna.copy_profile(uploaded_dna) - hivemind_bank += uploaded_dna + GLOB.hivemind_bank += uploaded_dna to_chat(user, "We channel the DNA of [chosen_name] to the air.") feedback_add_details("changeling_powers","HU") return 1 @@ -73,7 +73,7 @@ var/list/datum/dna/hivemind_bank = list() /obj/effect/proc_holder/changeling/hivemind_download/sting_action(mob/user) var/datum/changeling/changeling = user.mind.changeling var/list/names = list() - for(var/datum/changelingprofile/prof in hivemind_bank) + for(var/datum/changelingprofile/prof in GLOB.hivemind_bank) if(!(prof in changeling.stored_profiles)) names[prof.name] = prof diff --git a/code/game/gamemodes/changeling/powers/linglink.dm b/code/game/gamemodes/changeling/powers/linglink.dm index 816f853d45d7c..f500733ab4cc1 100644 --- a/code/game/gamemodes/changeling/powers/linglink.dm +++ b/code/game/gamemodes/changeling/powers/linglink.dm @@ -48,7 +48,7 @@ if(3) to_chat(user, "We mold the [target]'s mind like clay, granting [target.p_them()] the ability to speak in the hivemind!") to_chat(target, "A migraine throbs behind your eyes, you hear yourself screaming - but your mouth has not opened!") - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.lingcheck() == 2) to_chat(M, "We can sense a foreign presence in the hivemind...") target.mind.linglink = 1 diff --git a/code/game/gamemodes/changeling/powers/transform.dm b/code/game/gamemodes/changeling/powers/transform.dm index 010707bcdc5c6..49455733c2a66 100644 --- a/code/game/gamemodes/changeling/powers/transform.dm +++ b/code/game/gamemodes/changeling/powers/transform.dm @@ -121,8 +121,8 @@ return if(chosen_name == "Drop Flesh Disguise") - for(var/slot in slots) - if(istype(user.vars[slot], slot2type[slot])) + for(var/slot in GLOB.slots) + if(istype(user.vars[slot], GLOB.slot2type[slot])) qdel(user.vars[slot]) var/datum/changelingprofile/prof = get_dna(chosen_name) diff --git a/code/game/gamemodes/changeling/traitor_chan.dm b/code/game/gamemodes/changeling/traitor_chan.dm index 47fcc985e9e11..d93294567bb2d 100644 --- a/code/game/gamemodes/changeling/traitor_chan.dm +++ b/code/game/gamemodes/changeling/traitor_chan.dm @@ -63,7 +63,7 @@ return /datum/game_mode/traitor/changeling/make_antag_chance(mob/living/carbon/human/character) //Assigns changeling to latejoiners - var/changelingcap = min( round(joined_player_list.len/(config.changeling_scaling_coeff*4))+2, round(joined_player_list.len/(config.changeling_scaling_coeff*2)) ) + var/changelingcap = min( round(GLOB.joined_player_list.len/(config.changeling_scaling_coeff*4))+2, round(GLOB.joined_player_list.len/(config.changeling_scaling_coeff*2)) ) if(SSticker.mode.changelings.len >= changelingcap) //Caps number of latejoin antagonists ..() return diff --git a/code/game/gamemodes/clock_cult/clock_cult.dm b/code/game/gamemodes/clock_cult/clock_cult.dm index 8ab436faf1801..670e08e7a2355 100644 --- a/code/game/gamemodes/clock_cult/clock_cult.dm +++ b/code/game/gamemodes/clock_cult/clock_cult.dm @@ -175,9 +175,9 @@ Credit where due: return 1 /datum/game_mode/clockwork_cult/proc/check_clockwork_victory() - if(clockwork_gateway_activated) + if(GLOB.clockwork_gateway_activated) SSticker.news_report = CLOCK_PROSELYTIZATION //failure, technically, but we have the station - if(ratvar_awakens) + if(GLOB.ratvar_awakens) SSticker.news_report = CLOCK_SUMMON return TRUE else @@ -197,7 +197,7 @@ Credit where due: feedback_set_details("round_end_result", "win - servants completed their objective (summon ratvar)") else var/half_victory = FALSE - var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = locate() in all_clockwork_objects + var/obj/structure/destructible/clockwork/massive/celestial_gateway/G = locate() in GLOB.all_clockwork_objects if(G) half_victory = TRUE if(half_victory) @@ -208,8 +208,8 @@ Credit where due: text += "Ratvar's servants have failed!" feedback_set_details("round_end_result", "loss - servants failed their objective (summon ratvar)") text += "
The servants' objective was:
[CLOCKCULT_OBJECTIVE]" - text += "
Ratvar's servants had [clockwork_caches] Tinkerer's Caches." - text += "
Construction Value(CV) was: [clockwork_construction_value]" + text += "
Ratvar's servants had [GLOB.clockwork_caches] Tinkerer's Caches." + text += "
Construction Value(CV) was: [GLOB.clockwork_construction_value]" var/list/scripture_states = scripture_unlock_check() for(var/i in scripture_states) if(i != SCRIPTURE_DRIVER) @@ -221,11 +221,11 @@ Credit where due: to_chat(world, text) /datum/game_mode/proc/update_servant_icons_added(datum/mind/M) - var/datum/atom_hud/antag/A = huds[ANTAG_HUD_CLOCKWORK] + var/datum/atom_hud/antag/A = GLOB.huds[ANTAG_HUD_CLOCKWORK] A.join_hud(M.current) set_antag_hud(M.current, "clockwork") /datum/game_mode/proc/update_servant_icons_removed(datum/mind/M) - var/datum/atom_hud/antag/A = huds[ANTAG_HUD_CLOCKWORK] + var/datum/atom_hud/antag/A = GLOB.huds[ANTAG_HUD_CLOCKWORK] A.leave_hud(M.current) set_antag_hud(M.current, null) diff --git a/code/game/gamemodes/clock_cult/clock_effect.dm b/code/game/gamemodes/clock_cult/clock_effect.dm index 69e973b4eb9b8..c04f6b8979f91 100644 --- a/code/game/gamemodes/clock_cult/clock_effect.dm +++ b/code/game/gamemodes/clock_cult/clock_effect.dm @@ -12,10 +12,10 @@ /obj/effect/clockwork/New() ..() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/effect/clockwork/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/effect/clockwork/examine(mob/user) diff --git a/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm b/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm index 081ca1f6cbd8f..6c56295c05105 100644 --- a/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm +++ b/code/game/gamemodes/clock_cult/clock_effects/clock_sigils.dm @@ -128,7 +128,7 @@ var/mob/living/carbon/C = L C.silent += 5 var/message = "[sigil_name] in [get_area(src)] [is_servant_of_ratvar(L) ? "successfully converted" : "failed to convert"]" - for(var/M in mob_list) + for(var/M in GLOB.mob_list) if(isobserver(M)) var/link = FOLLOW_LINK(M, L) to_chat(M, "[link] [message] [L.real_name]!") @@ -198,7 +198,7 @@ var/structure_number = 0 for(var/obj/structure/destructible/clockwork/powered/P in range(SIGIL_ACCESS_RANGE, src)) structure_number++ - to_chat(user, "It is storing [ratvar_awakens ? "INFINITY":"[power_charge]"]W of power, \ + to_chat(user, "It is storing [GLOB.ratvar_awakens ? "INFINITY":"[power_charge]"]W of power, \ and [structure_number] Clockwork Structure[structure_number == 1 ? "":"s"] [structure_number == 1 ? "is":"are"] in range.") if(iscyborg(user)) to_chat(user, "You can recharge from the [sigil_name] by crossing it.") @@ -248,7 +248,7 @@ update_glow() /obj/effect/clockwork/sigil/transmission/proc/modify_charge(amount) - if(ratvar_awakens) + if(GLOB.ratvar_awakens) update_glow() return TRUE if(power_charge - amount < 0) @@ -258,7 +258,7 @@ return TRUE /obj/effect/clockwork/sigil/transmission/proc/update_glow() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) alpha = 255 else alpha = min(initial(alpha) + power_charge*0.02, 255) @@ -289,8 +289,8 @@ /obj/effect/clockwork/sigil/vitality/examine(mob/user) ..() if(is_servant_of_ratvar(user) || isobserver(user)) - to_chat(user, "It has access to [ratvar_awakens ? "INFINITE":"[vitality]"] units of vitality.") - if(ratvar_awakens) + to_chat(user, "It has access to [GLOB.ratvar_awakens ? "INFINITE":"[vitality]"] units of vitality.") + if(GLOB.ratvar_awakens) to_chat(user, "It can revive Servants at no cost!") else to_chat(user, "It can revive Servants at a cost of [base_revive_cost] vitality plus vitality equal to the non-oxygen damage they have, in addition to being destroyed in the process.") @@ -303,7 +303,7 @@ addtimer(CALLBACK(src, .proc/update_alpha), 10) sleep(10) //as long as they're still on the sigil and are either not a servant or they're a servant AND it has remaining vitality - while(L && (!is_servant_of_ratvar(L) || (is_servant_of_ratvar(L) && (ratvar_awakens || vitality))) && get_turf(L) == get_turf(src)) + while(L && (!is_servant_of_ratvar(L) || (is_servant_of_ratvar(L) && (GLOB.ratvar_awakens || vitality))) && get_turf(L) == get_turf(src)) sigil_active = TRUE if(animation_number >= 4) new /obj/effect/overlay/temp/ratvar/sigil/vitality(get_turf(src)) @@ -323,7 +323,7 @@ qdel(W) L.dust() else - if(!ratvar_awakens && L.stat == CONSCIOUS) + if(!GLOB.ratvar_awakens && L.stat == CONSCIOUS) vitality_drained = L.adjustToxLoss(1) else vitality_drained = L.adjustToxLoss(1.5) @@ -334,7 +334,7 @@ else if(L.stat == DEAD) var/revival_cost = base_revive_cost + L.getCloneLoss() + L.getToxLoss() + L.getFireLoss() + L.getBruteLoss() //ignores oxygen damage - if(ratvar_awakens) + if(GLOB.ratvar_awakens) revival_cost = 0 var/mob/dead/observer/ghost = L.get_ghost(TRUE) if(vitality >= revival_cost && (ghost || (L.mind && L.mind.active))) @@ -344,14 +344,14 @@ var/obj/effect/overlay/temp/ratvar/sigil/vitality/V = new /obj/effect/overlay/temp/ratvar/sigil/vitality(get_turf(src)) animate(V, alpha = 0, transform = matrix()*2, time = 8) playsound(L, 'sound/magic/Staff_Healing.ogg', 50, 1) - L.visible_message("[L] suddenly gets back up, [ratvar_awakens ? "[L.p_their()] body dripping blue ichor":"even as [src] scatters into blue sparks around [L.p_them()]"]!", \ + L.visible_message("[L] suddenly gets back up, [GLOB.ratvar_awakens ? "[L.p_their()] body dripping blue ichor":"even as [src] scatters into blue sparks around [L.p_them()]"]!", \ "\"[text2ratvar("You will be okay, child.")]\"") vitality -= revival_cost - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) qdel(src) break var/vitality_for_cycle = 3 - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) if(L.stat == CONSCIOUS) vitality_for_cycle = 2 vitality_for_cycle = min(vitality, vitality_for_cycle) @@ -360,7 +360,7 @@ if(!vitality_used) break - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) vitality -= vitality_used sleep(2) diff --git a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm index b8bef0e1b6df0..f376410124c1d 100644 --- a/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm +++ b/code/game/gamemodes/clock_cult/clock_effects/spatial_gateway.dm @@ -151,13 +151,13 @@ var/list/possible_targets = list() var/list/teleportnames = list() - for(var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/O in all_clockwork_objects) + for(var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/O in GLOB.all_clockwork_objects) if(!O.Adjacent(invoker) && O != src && (O.z <= ZLEVEL_SPACEMAX) && O.anchored) //don't list obelisks that we're next to var/area/A = get_area(O) var/locname = initial(A.name) possible_targets[avoid_assoc_duplicate_keys("[locname] [O.name]", teleportnames)] = O - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(!L.stat && is_servant_of_ratvar(L) && !L.Adjacent(invoker) && (L.z <= ZLEVEL_SPACEMAX)) //People right next to the invoker can't be portaled to, for obvious reasons possible_targets[avoid_assoc_duplicate_keys("[L.name] ([L.real_name])", teleportnames)] = L diff --git a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm index be2df3697f1ef..e3c456460c08b 100644 --- a/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm +++ b/code/game/gamemodes/clock_cult/clock_helpers/component_helpers.dm @@ -2,7 +2,7 @@ /proc/generate_cache_component(specific_component_id, atom/A) if(!specific_component_id) specific_component_id = get_weighted_component_id() - clockwork_component_cache[specific_component_id]++ + GLOB.clockwork_component_cache[specific_component_id]++ if(A) var/component_animation_type = get_component_animation_type(specific_component_id) new component_animation_type(get_turf(A)) @@ -13,15 +13,15 @@ /proc/get_weighted_component_id(obj/item/clockwork/slab/storage_slab) . = list() if(storage_slab) - if(clockwork_caches) - for(var/i in clockwork_component_cache) - .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*(clockwork_component_cache[i] + storage_slab.stored_components[i]), 1) + if(GLOB.clockwork_caches) + for(var/i in GLOB.clockwork_component_cache) + .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*(GLOB.clockwork_component_cache[i] + storage_slab.stored_components[i]), 1) else - for(var/i in clockwork_component_cache) + for(var/i in GLOB.clockwork_component_cache) .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*storage_slab.stored_components[i], 1) else - for(var/i in clockwork_component_cache) - .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*clockwork_component_cache[i], 1) + for(var/i in GLOB.clockwork_component_cache) + .[i] = max(MAX_COMPONENTS_BEFORE_RAND - LOWER_PROB_PER_COMPONENT*GLOB.clockwork_component_cache[i], 1) . = pickweight(.) //returns a component name from a component id diff --git a/code/game/gamemodes/clock_cult/clock_helpers/hierophant_network.dm b/code/game/gamemodes/clock_cult/clock_helpers/hierophant_network.dm index 47b8178dff0d2..29f2363e402fe 100644 --- a/code/game/gamemodes/clock_cult/clock_helpers/hierophant_network.dm +++ b/code/game/gamemodes/clock_cult/clock_helpers/hierophant_network.dm @@ -2,7 +2,7 @@ /proc/hierophant_message(message, servantsonly, atom/target) if(!message) return FALSE - for(var/M in mob_list) + for(var/M in GLOB.mob_list) if(!servantsonly && isobserver(M)) if(target) var/link = FOLLOW_LINK(M, target) diff --git a/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm b/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm index 707c5a6a9d8aa..0c04618650844 100644 --- a/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm +++ b/code/game/gamemodes/clock_cult/clock_helpers/scripture_checks.dm @@ -2,18 +2,18 @@ /proc/scripture_unlock_check() var/servants = 0 var/unconverted_ai_exists = get_unconverted_ais() - for(var/mob/living/M in living_mob_list) + for(var/mob/living/M in GLOB.living_mob_list) if(is_servant_of_ratvar(M) && (ishuman(M) || issilicon(M))) servants++ . = list(SCRIPTURE_DRIVER = TRUE, SCRIPTURE_SCRIPT = FALSE, SCRIPTURE_APPLICATION = FALSE, SCRIPTURE_REVENANT = FALSE, SCRIPTURE_JUDGEMENT = FALSE) //Drivers: always unlocked - .[SCRIPTURE_SCRIPT] = (servants >= SCRIPT_SERVANT_REQ && clockwork_caches >= SCRIPT_CACHE_REQ) + .[SCRIPTURE_SCRIPT] = (servants >= SCRIPT_SERVANT_REQ && GLOB.clockwork_caches >= SCRIPT_CACHE_REQ) //Script: SCRIPT_SERVANT_REQ or more non-brain servants and SCRIPT_CACHE_REQ or more clockwork caches - .[SCRIPTURE_APPLICATION] = (servants >= APPLICATION_SERVANT_REQ && clockwork_caches >= APPLICATION_CACHE_REQ && clockwork_construction_value >= APPLICATION_CV_REQ) + .[SCRIPTURE_APPLICATION] = (servants >= APPLICATION_SERVANT_REQ && GLOB.clockwork_caches >= APPLICATION_CACHE_REQ && GLOB.clockwork_construction_value >= APPLICATION_CV_REQ) //Application: APPLICATION_SERVANT_REQ or more non-brain servants, APPLICATION_CACHE_REQ or more clockwork caches, and at least APPLICATION_CV_REQ CV - .[SCRIPTURE_REVENANT] = (servants >= REVENANT_SERVANT_REQ && clockwork_caches >= REVENANT_CACHE_REQ && clockwork_construction_value >= REVENANT_CV_REQ) + .[SCRIPTURE_REVENANT] = (servants >= REVENANT_SERVANT_REQ && GLOB.clockwork_caches >= REVENANT_CACHE_REQ && GLOB.clockwork_construction_value >= REVENANT_CV_REQ) //Revenant: REVENANT_SERVANT_REQ or more non-brain servants, REVENANT_CACHE_REQ or more clockwork caches, and at least REVENANT_CV_REQ CV - .[SCRIPTURE_JUDGEMENT] = (servants >= JUDGEMENT_SERVANT_REQ && clockwork_caches >= JUDGEMENT_CACHE_REQ && clockwork_construction_value >= JUDGEMENT_CV_REQ && !unconverted_ai_exists) + .[SCRIPTURE_JUDGEMENT] = (servants >= JUDGEMENT_SERVANT_REQ && GLOB.clockwork_caches >= JUDGEMENT_CACHE_REQ && GLOB.clockwork_construction_value >= JUDGEMENT_CV_REQ && !unconverted_ai_exists) //Judgement: JUDGEMENT_SERVANT_REQ or more non-brain servants, JUDGEMENT_CACHE_REQ or more clockwork caches, at least JUDGEMENT_CV_REQ CV, and there are no living, non-servant ais //reports to servants when scripture is locked or unlocked @@ -26,7 +26,7 @@ /proc/get_unconverted_ais() . = 0 - for(var/ai in ai_list) + for(var/ai in GLOB.ai_list) var/mob/living/silicon/AI = ai if(is_servant_of_ratvar(AI) || !isturf(AI.loc) || AI.z != ZLEVEL_STATION || AI.stat == DEAD) continue @@ -35,12 +35,12 @@ /proc/update_slab_info(obj/item/clockwork/slab/set_slab) generate_all_scripture() var/needs_update = FALSE //if everything needs an update, for whatever reason - for(var/s in all_scripture) - var/datum/clockwork_scripture/S = all_scripture[s] + for(var/s in GLOB.all_scripture) + var/datum/clockwork_scripture/S = GLOB.all_scripture[s] if(S.creation_update()) needs_update = TRUE if(!set_slab || needs_update) - for(var/obj/item/clockwork/slab/S in all_clockwork_objects) + for(var/obj/item/clockwork/slab/S in GLOB.all_clockwork_objects) SStgui.update_uis(S) if(needs_update) S.update_quickbind() @@ -49,11 +49,11 @@ set_slab.update_quickbind() /proc/generate_all_scripture() - if(!all_scripture.len) + if(!GLOB.all_scripture.len) for(var/V in sortList(subtypesof(/datum/clockwork_scripture), /proc/cmp_clockscripture_priority)) var/datum/clockwork_scripture/S = new V - all_scripture[S.type] = S + GLOB.all_scripture[S.type] = S //changes construction value /proc/change_construction_value(amount) - clockwork_construction_value += amount + GLOB.clockwork_construction_value += amount diff --git a/code/game/gamemodes/clock_cult/clock_item.dm b/code/game/gamemodes/clock_cult/clock_item.dm index 66500d4ee53e5..a785f8121c255 100644 --- a/code/game/gamemodes/clock_cult/clock_item.dm +++ b/code/game/gamemodes/clock_cult/clock_item.dm @@ -11,10 +11,10 @@ /obj/item/clockwork/New() ..() ratvar_act() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/item/clockwork/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/item/clockwork/examine(mob/user) diff --git a/code/game/gamemodes/clock_cult/clock_items/clockwork_armor.dm b/code/game/gamemodes/clock_cult/clock_items/clockwork_armor.dm index ba9e86864c761..bde1f4b4d4412 100644 --- a/code/game/gamemodes/clock_cult/clock_items/clockwork_armor.dm +++ b/code/game/gamemodes/clock_cult/clock_items/clockwork_armor.dm @@ -11,14 +11,14 @@ /obj/item/clothing/head/helmet/clockwork/New() ..() ratvar_act() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/item/clothing/head/helmet/clockwork/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/item/clothing/head/helmet/clockwork/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) armor = list(melee = 100, bullet = 100, laser = 100, energy = 100, bomb = 100, bio = 100, rad = 100, fire = 100, acid = 100) flags |= STOPSPRESSUREDMAGE max_heat_protection_temperature = FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT @@ -67,14 +67,14 @@ /obj/item/clothing/suit/armor/clockwork/New() ..() ratvar_act() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/item/clothing/suit/armor/clockwork/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/item/clothing/suit/armor/clockwork/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) armor = list(melee = 100, bullet = 100, laser = 100, energy = 100, bomb = 100, bio = 100, rad = 100, fire = 100, acid = 100) flags |= STOPSPRESSUREDMAGE max_heat_protection_temperature = FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT @@ -128,14 +128,14 @@ /obj/item/clothing/gloves/clockwork/New() ..() ratvar_act() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/item/clothing/gloves/clockwork/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/item/clothing/gloves/clockwork/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) armor = list(melee = 100, bullet = 100, laser = 100, energy = 100, bomb = 100, bio = 100, rad = 100, fire = 100, acid = 100) flags |= STOPSPRESSUREDMAGE max_heat_protection_temperature = FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT @@ -181,17 +181,17 @@ /obj/item/clothing/shoes/clockwork/New() ..() ratvar_act() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/item/clothing/shoes/clockwork/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/item/clothing/shoes/clockwork/negates_gravity() return TRUE /obj/item/clothing/shoes/clockwork/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) flags |= NOSLIP else flags &= NOSLIP diff --git a/code/game/gamemodes/clock_cult/clock_items/clockwork_proselytizer.dm b/code/game/gamemodes/clock_cult/clock_items/clockwork_proselytizer.dm index d988c68ba7eeb..513f0d5cbd789 100644 --- a/code/game/gamemodes/clock_cult/clock_items/clockwork_proselytizer.dm +++ b/code/game/gamemodes/clock_cult/clock_items/clockwork_proselytizer.dm @@ -113,11 +113,11 @@ charge_delay = 2 /obj/item/clockwork/clockwork_proselytizer/ratvar_act() - if(nezbere_invoked) + if(GLOB.nezbere_invoked) charge_rate = 1250 else charge_rate = initial(charge_rate) - if(ratvar_awakens) + if(GLOB.ratvar_awakens) uses_power = FALSE speed_multiplier = initial(speed_multiplier) * 0.25 else @@ -165,7 +165,7 @@ /obj/item/clockwork/clockwork_proselytizer/proc/can_use_power(amount) if(amount == RATVAR_POWER_CHECK) - if(ratvar_awakens || !uses_power) + if(GLOB.ratvar_awakens || !uses_power) return TRUE else return FALSE diff --git a/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm b/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm index bc0a05de5735f..001a0822d9139 100644 --- a/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm +++ b/code/game/gamemodes/clock_cult/clock_items/clockwork_slab.dm @@ -83,14 +83,14 @@ quickbound = list(/datum/clockwork_scripture/ranged_ability/linked_vanguard, /datum/clockwork_scripture/spatial_gateway, /datum/clockwork_scripture/channeled/volt_void/cyborg) /obj/item/clockwork/slab/cyborg/access_display(mob/living/user) - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) to_chat(user, "Use the action buttons to recite your limited set of scripture!") else ..() /obj/item/clockwork/slab/cyborg/ratvar_act() ..() - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) SStgui.close_uis(src) /obj/item/clockwork/slab/New() @@ -107,7 +107,7 @@ return ..() /obj/item/clockwork/slab/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) nonhuman_usable = TRUE else nonhuman_usable = initial(nonhuman_usable) @@ -129,7 +129,7 @@ return var/servants = 0 var/production_slowdown = 0 - for(var/mob/living/M in living_mob_list) + for(var/mob/living/M in GLOB.living_mob_list) if(is_servant_of_ratvar(M) && (ishuman(M) || issilicon(M))) servants++ if(servants > SCRIPT_SERVANT_REQ) @@ -159,11 +159,11 @@ continue var/datum/clockwork_scripture/quickbind_slot = quickbound[i] to_chat(user, "Quickbind button: [initial(quickbind_slot.name)].") - if(clockwork_caches) //show components on examine + if(GLOB.clockwork_caches) //show components on examine to_chat(user, "Stored components (with global cache):") for(var/i in stored_components) to_chat(user, "[get_component_name(i)][i != REPLICANT_ALLOY ? "s":""]: [stored_components[i]] \ - ([stored_components[i] + clockwork_component_cache[i]])") + ([stored_components[i] + GLOB.clockwork_component_cache[i]])") else to_chat(user, "Stored components:") for(var/i in stored_components) @@ -205,9 +205,9 @@ if(!C.component_id) return 0 user.visible_message("[user] inserts [C] into [src].", "You insert [C] into [src]\ - [clockwork_caches ? ", where it is added to the global cache":""].") - if(clockwork_caches) - clockwork_component_cache[C.component_id]++ + [GLOB.clockwork_caches ? ", where it is added to the global cache":""].
") + if(GLOB.clockwork_caches) + GLOB.clockwork_component_cache[C.component_id]++ update_slab_info() else stored_components[C.component_id]++ @@ -279,7 +279,7 @@ ui_interact(user) return TRUE -/obj/item/clockwork/slab/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = inventory_state) +/obj/item/clockwork/slab/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "clockwork_slab", name, 800, 420, master_ui, state) @@ -296,7 +296,7 @@ var/initial_tier = initial(scripture.tier) if(initial_tier != SCRIPTURE_PERIPHERAL) var/list/tiers_of_scripture = scripture_unlock_check() - if(!ratvar_awakens && !no_cost && !tiers_of_scripture[initial_tier]) + if(!GLOB.ratvar_awakens && !no_cost && !tiers_of_scripture[initial_tier]) to_chat(user, "That scripture is not unlocked, and cannot be recited!") return FALSE var/datum/clockwork_scripture/scripture_to_recite = new scripture @@ -308,7 +308,7 @@ //Guide to Serving Ratvar /obj/item/clockwork/slab/proc/recollection() var/list/textlist = list("If you're seeing this, file a bug report.") - if(ratvar_awakens) + if(GLOB.ratvar_awakens) textlist = list("") for(var/i in 1 to 100) textlist += "HONOR RATVAR " @@ -316,7 +316,7 @@ else var/servants = 0 var/production_time = SLAB_PRODUCTION_TIME - for(var/mob/living/M in living_mob_list) + for(var/mob/living/M in GLOB.living_mob_list) if(is_servant_of_ratvar(M) && (ishuman(M) || issilicon(M))) servants++ if(servants > SCRIPT_SERVANT_REQ) @@ -394,9 +394,9 @@ temp_data += " " else temp_data += " (" - if(clockwork_caches) //if we have caches, display what's in the global cache - for(var/i in clockwork_component_cache) - temp_data += "[get_component_acronym(i)] [data["components"][i] + clockwork_component_cache[i]]" + if(GLOB.clockwork_caches) //if we have caches, display what's in the global cache + for(var/i in GLOB.clockwork_component_cache) + temp_data += "[get_component_acronym(i)] [data["components"][i] + GLOB.clockwork_component_cache[i]]" if(i != HIEROPHANT_ANSIBLE) temp_data += " " else @@ -426,8 +426,8 @@ generate_all_scripture() data["scripture"] = list() - for(var/s in all_scripture) - var/datum/clockwork_scripture/S = all_scripture[s] + for(var/s in GLOB.all_scripture) + var/datum/clockwork_scripture/S = GLOB.all_scripture[s] if(S.tier == selected_scripture) //display only scriptures of the selected tier var/scripture_color = get_component_color_bright(S.primary_component) var/list/temp_info = list("name" = "[S.name]", @@ -471,10 +471,10 @@ selected_scripture = params["category"] if("component") var/list/components = list("Random Components") - for(var/i in clockwork_component_cache) + for(var/i in GLOB.clockwork_component_cache) var/cache_components = 0 - if(clockwork_caches) - cache_components = clockwork_component_cache[i] + if(GLOB.clockwork_caches) + cache_components = GLOB.clockwork_component_cache[i] components["[get_component_name(i)] [(cache_components + stored_components[i])]"] = i var/input_component = input("Choose a component type.", "Target Component") as null|anything in components if(input_component && !..()) @@ -503,7 +503,7 @@ return while(LAZYLEN(quickbound) < index) quickbound += null - var/datum/clockwork_scripture/quickbind_slot = all_scripture[quickbound[index]] + var/datum/clockwork_scripture/quickbind_slot = GLOB.all_scripture[quickbound[index]] if(quickbind_slot && !quickbind_slot.quickbind) return //we can't unbind things we can't normally bind quickbound[index] = scripture @@ -518,7 +518,7 @@ continue var/datum/action/item_action/clock/quickbind/Q = new /datum/action/item_action/clock/quickbind(src) Q.scripture_index = i - var/datum/clockwork_scripture/quickbind_slot = all_scripture[quickbound[i]] + var/datum/clockwork_scripture/quickbind_slot = GLOB.all_scripture[quickbound[i]] Q.name = "[quickbind_slot.name] ([Q.scripture_index])" var/list/temp_desc = list() for(var/c in quickbind_slot.consumed_components) //show how much the bound scripture costs diff --git a/code/game/gamemodes/clock_cult/clock_items/judicial_visor.dm b/code/game/gamemodes/clock_cult/clock_items/judicial_visor.dm index 0353984a68f9c..89bc41f169130 100644 --- a/code/game/gamemodes/clock_cult/clock_items/judicial_visor.dm +++ b/code/game/gamemodes/clock_cult/clock_items/judicial_visor.dm @@ -15,12 +15,12 @@ /obj/item/clothing/glasses/judicial_visor/New() ..() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src blaster = new(src) blaster.visor = src /obj/item/clothing/glasses/judicial_visor/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src if(blaster.ranged_ability_user) blaster.remove_ranged_ability() blaster.visor = null @@ -131,7 +131,7 @@ continue V.recharging = TRUE //To prevent exploiting multiple visors to bypass the cooldown V.update_status() - addtimer(CALLBACK(V, /obj/item/clothing/glasses/judicial_visor.proc/recharge_visor, ranged_ability_user), (ratvar_awakens ? visor.recharge_cooldown*0.1 : visor.recharge_cooldown) * 2) + addtimer(CALLBACK(V, /obj/item/clothing/glasses/judicial_visor.proc/recharge_visor, ranged_ability_user), (GLOB.ratvar_awakens ? visor.recharge_cooldown*0.1 : visor.recharge_cooldown) * 2) clockwork_say(ranged_ability_user, text2ratvar("Kneel, heathens!")) ranged_ability_user.visible_message("[ranged_ability_user]'s judicial visor fires a stream of energy at [target], creating a strange mark!", "You direct [visor]'s power to [target]. You must wait for some time before doing this again.") var/turf/targetturf = get_turf(target) @@ -139,7 +139,7 @@ add_logs(ranged_ability_user, targetturf, "created a judicial marker") ranged_ability_user.update_action_buttons_icon() ranged_ability_user.update_inv_glasses() - addtimer(CALLBACK(visor, /obj/item/clothing/glasses/judicial_visor.proc/recharge_visor, ranged_ability_user), ratvar_awakens ? visor.recharge_cooldown*0.1 : visor.recharge_cooldown)//Cooldown is reduced by 10x if Ratvar is up + addtimer(CALLBACK(visor, /obj/item/clothing/glasses/judicial_visor.proc/recharge_visor, ranged_ability_user), GLOB.ratvar_awakens ? visor.recharge_cooldown*0.1 : visor.recharge_cooldown)//Cooldown is reduced by 10x if Ratvar is up remove_ranged_ability() return TRUE diff --git a/code/game/gamemodes/clock_cult/clock_items/ratvarian_spear.dm b/code/game/gamemodes/clock_cult/clock_items/ratvarian_spear.dm index 37c6922b9ea0c..17f5783431e93 100644 --- a/code/game/gamemodes/clock_cult/clock_items/ratvarian_spear.dm +++ b/code/game/gamemodes/clock_cult/clock_items/ratvarian_spear.dm @@ -25,7 +25,7 @@ return ..() /obj/item/clockwork/ratvarian_spear/ratvar_act() - if(ratvar_awakens) //If Ratvar is alive, the spear is extremely powerful + if(GLOB.ratvar_awakens) //If Ratvar is alive, the spear is extremely powerful force = 25 throwforce = 50 armour_penetration = 10 @@ -40,7 +40,7 @@ timerid = addtimer(CALLBACK(src, .proc/break_spear), RATVARIAN_SPEAR_DURATION, TIMER_STOPPABLE) /obj/item/clockwork/ratvarian_spear/cyborg/ratvar_act() //doesn't break! - if(ratvar_awakens) + if(GLOB.ratvar_awakens) force = 25 throwforce = 50 armour_penetration = 10 diff --git a/code/game/gamemodes/clock_cult/clock_items/soul_vessel.dm b/code/game/gamemodes/clock_cult/clock_items/soul_vessel.dm index 505f068d36810..17a8f60158144 100644 --- a/code/game/gamemodes/clock_cult/clock_items/soul_vessel.dm +++ b/code/game/gamemodes/clock_cult/clock_items/soul_vessel.dm @@ -28,10 +28,10 @@ radio.on = 0 laws = new /datum/ai_laws/ratvar() braintype = picked_fluff_name - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/item/device/mmi/posibrain/soul_vessel/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/item/device/mmi/posibrain/soul_vessel/examine(mob/user) diff --git a/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm b/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm index 9c30c1cbfd570..33f536e9b5c57 100644 --- a/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm +++ b/code/game/gamemodes/clock_cult/clock_items/wraith_spectacles.dm @@ -14,10 +14,10 @@ /obj/item/clothing/glasses/wraith_spectacles/New() ..() - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/item/clothing/glasses/wraith_spectacles/Destroy() - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/item/clothing/glasses/wraith_spectacles/attack_self(mob/user) @@ -38,7 +38,7 @@ if(blind_cultist(H)) return if(is_servant_of_ratvar(H)) - to_chat(H, "You push the spectacles down, and all is revealed to you.[ratvar_awakens ? "" : " Your eyes begin to itch - you cannot do this for long."]") + to_chat(H, "You push the spectacles down, and all is revealed to you.[GLOB.ratvar_awakens ? "" : " Your eyes begin to itch - you cannot do this for long."]") var/datum/status_effect/wraith_spectacles/WS = H.has_status_effect(STATUS_EFFECT_WRAITHSPECS) if(WS) WS.apply_eye_damage(H) @@ -83,7 +83,7 @@ return set_vision_vars(TRUE) if(is_servant_of_ratvar(user)) - to_chat(user, "As you put on the spectacles, all is revealed to you.[ratvar_awakens ? "" : " Your eyes begin to itch - you cannot do this for long."]") + to_chat(user, "As you put on the spectacles, all is revealed to you.[GLOB.ratvar_awakens ? "" : " Your eyes begin to itch - you cannot do this for long."]") var/datum/status_effect/wraith_spectacles/WS = user.has_status_effect(STATUS_EFFECT_WRAITHSPECS) if(WS) WS.apply_eye_damage(user) @@ -137,10 +137,10 @@ var/mob/living/carbon/human/H = owner var/glasses_right = istype(H.glasses, /obj/item/clothing/glasses/wraith_spectacles) var/obj/item/clothing/glasses/wraith_spectacles/WS = H.glasses - if(glasses_right && !WS.up && !ratvar_awakens) + if(glasses_right && !WS.up && !GLOB.ratvar_awakens) apply_eye_damage(H) else - if(ratvar_awakens) + if(GLOB.ratvar_awakens) H.cure_nearsighted() H.cure_blind() H.adjust_eye_damage(-eye_damage_done) diff --git a/code/game/gamemodes/clock_cult/clock_mobs/anima_fragment.dm b/code/game/gamemodes/clock_cult/clock_mobs/anima_fragment.dm index a327211d01209..cad4695d881b4 100644 --- a/code/game/gamemodes/clock_cult/clock_mobs/anima_fragment.dm +++ b/code/game/gamemodes/clock_cult/clock_mobs/anima_fragment.dm @@ -28,7 +28,7 @@ /mob/living/simple_animal/hostile/clockwork/fragment/Life() ..() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) adjustHealth(-5) else if(movement_delay_time > world.time) adjustHealth(-0.2) @@ -37,7 +37,7 @@ /mob/living/simple_animal/hostile/clockwork/fragment/Stat() ..() - if(statpanel("Status") && movement_delay_time > world.time && !ratvar_awakens) + if(statpanel("Status") && movement_delay_time > world.time && !GLOB.ratvar_awakens) stat(null, "Movement delay(seconds): [max(round((movement_delay_time - world.time)*0.1, 0.1), 0)]") /mob/living/simple_animal/hostile/clockwork/fragment/death(gibbed) @@ -59,7 +59,7 @@ UnarmedAttack(L) attacktext = previousattacktext changeNext_move(CLICK_CD_MELEE) - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) adjustHealth(4) adjust_movement_delay(10) //with the above damage, total of 20 movement delay plus speed = 0 due to damage @@ -68,7 +68,7 @@ /mob/living/simple_animal/hostile/clockwork/fragment/movement_delay() . = ..() - if(movement_delay_time > world.time && !ratvar_awakens) + if(movement_delay_time > world.time && !GLOB.ratvar_awakens) . += min((movement_delay_time - world.time) * 0.1, 10) //the more delay we have, the slower we go /mob/living/simple_animal/hostile/clockwork/fragment/adjustHealth(amount) @@ -77,7 +77,7 @@ adjust_movement_delay(amount*2.5) /mob/living/simple_animal/hostile/clockwork/fragment/proc/adjust_movement_delay(amount) - if(ratvar_awakens) //if ratvar is up we ignore movement delay + if(GLOB.ratvar_awakens) //if ratvar is up we ignore movement delay movement_delay_time = 0 else if(movement_delay_time > world.time) movement_delay_time = movement_delay_time + amount diff --git a/code/game/gamemodes/clock_cult/clock_mobs/clockwork_marauder.dm b/code/game/gamemodes/clock_cult/clock_mobs/clockwork_marauder.dm index 203060d263783..b0b77ccd62ebd 100644 --- a/code/game/gamemodes/clock_cult/clock_mobs/clockwork_marauder.dm +++ b/code/game/gamemodes/clock_cult/clock_mobs/clockwork_marauder.dm @@ -41,10 +41,10 @@ emerge_from_host(FALSE, TRUE) unbind_from_host() return - if(!ratvar_awakens && host.stat == DEAD) + if(!GLOB.ratvar_awakens && host.stat == DEAD) death() return - if(ratvar_awakens) + if(GLOB.ratvar_awakens) adjustHealth(-50) else adjustHealth(-10) @@ -55,7 +55,7 @@ to_chat(host, "Your marauder is now strong enough to come forward again!") recovering = FALSE else - if(ratvar_awakens) //If Ratvar is alive, marauders don't need a host and are downright impossible to kill + if(GLOB.ratvar_awakens) //If Ratvar is alive, marauders don't need a host and are downright impossible to kill adjustHealth(-5) heal_host() else if(host) @@ -107,7 +107,7 @@ if(iscarbon(host)) resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - host.health) / abs(HEALTH_THRESHOLD_DEAD - host.maxHealth)) * 100) stat(null, "Host Health: [resulthealth]%") - if(ratvar_awakens) + if(GLOB.ratvar_awakens) stat(null, "You are [recovering ? "un" : ""]able to deploy!") else if(resulthealth > MARAUDER_EMERGE_THRESHOLD) @@ -148,7 +148,7 @@ var/resulthealth = round((host.health / host.maxHealth) * 100, 0.5) if(iscarbon(host)) resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - host.health) / abs(HEALTH_THRESHOLD_DEAD - host.maxHealth)) * 100) - if(ratvar_awakens || resulthealth <= MARAUDER_EMERGE_THRESHOLD) + if(GLOB.ratvar_awakens || resulthealth <= MARAUDER_EMERGE_THRESHOLD) new /obj/effect/overlay/temp/heal(host.loc, "#AF0AAF") host.heal_ordered_damage(4, damage_heal_order) @@ -180,7 +180,7 @@ hud_used.healths.maptext = "
[round((health / maxHealth) * 100, 0.5)]%" /mob/living/simple_animal/hostile/clockwork/marauder/proc/update_stats() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) speed = 0 melee_damage_lower = 20 melee_damage_upper = 20 @@ -261,7 +261,7 @@ return ..() /mob/living/simple_animal/hostile/clockwork/marauder/proc/blockOrCounter(mob/target, atom/textobject) - if(ratvar_awakens) //if ratvar has woken, we block nearly everything at a very high chance + if(GLOB.ratvar_awakens) //if ratvar has woken, we block nearly everything at a very high chance blockchance = 90 counterchance = 90 if(prob(blockchance)) @@ -284,7 +284,7 @@ counterchance = min(counterchance + initial(counterchance), 100) else blockchance = min(blockchance + initial(blockchance), 100) - if(ratvar_awakens) + if(GLOB.ratvar_awakens) blockchance = 90 counterchance = 90 @@ -301,7 +301,7 @@ message = "\"[message]\"" //Processed output to_chat(src, "[name_part]: [message]") to_chat(host, "[name_part]: [message]") - for(var/M in mob_list) + for(var/M in GLOB.mob_list) if(isobserver(M)) var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [name_part] (to [findtextEx(host.name, host.real_name) ? "[host.name]" : "[host.real_name] (as [host.name])"]): [message] ") @@ -329,7 +329,7 @@ if(!host) to_chat(src, "You don't have a host!") return FALSE - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) var/resulthealth = round((host.health / host.maxHealth) * 100, 0.5) if(iscarbon(host)) resulthealth = round((abs(HEALTH_THRESHOLD_DEAD - host.health) / abs(HEALTH_THRESHOLD_DEAD - host.maxHealth)) * 100) @@ -421,7 +421,7 @@ message = "\"[message]\"" //Processed output to_chat(owner, "[name_part]: [message]") to_chat(linked_marauder, "[name_part]: [message]") - for(var/M in mob_list) + for(var/M in GLOB.mob_list) if(isobserver(M)) var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [name_part] (to [linked_marauder] ([linked_marauder.true_name])): [message]") diff --git a/code/game/gamemodes/clock_cult/clock_scripture.dm b/code/game/gamemodes/clock_cult/clock_scripture.dm index 41621bcf69945..8e688f30aa678 100644 --- a/code/game/gamemodes/clock_cult/clock_scripture.dm +++ b/code/game/gamemodes/clock_cult/clock_scripture.dm @@ -58,7 +58,7 @@ Judgement: 12 servants, 5 caches, 300 CV, and any existing AIs are converted or to_chat(invoker, "[slab] refuses to work, displaying the message: \"[slab.busy]!\"") return FALSE slab.busy = "Invocation ([name]) in progress" - if(ratvar_awakens) + if(GLOB.ratvar_awakens) channel_time *= 0.5 //if ratvar has awoken, half channel time and no cost else if(!slab.no_cost) for(var/i in consumed_components) @@ -68,7 +68,7 @@ Judgement: 12 servants, 5 caches, 300 CV, and any existing AIs are converted or slab.stored_components[i]-- used_slab_components[i]++ else - clockwork_component_cache[i]-- + GLOB.clockwork_component_cache[i]-- used_cache_components[i]++ update_slab_info() channel_time *= slab.speed_multiplier @@ -78,14 +78,14 @@ Judgement: 12 servants, 5 caches, 300 CV, and any existing AIs are converted or if(slab) slab.stored_components[i] += consumed_components[i] else //if we can't find a slab add to the global cache - clockwork_component_cache[i] += consumed_components[i] + GLOB.clockwork_component_cache[i] += consumed_components[i] for(var/i in used_cache_components) if(used_cache_components[i]) - clockwork_component_cache[i] += consumed_components[i] + GLOB.clockwork_component_cache[i] += consumed_components[i] update_slab_info() else successful = TRUE - if(slab && !slab.no_cost && !ratvar_awakens) //if the slab exists and isn't debug and ratvar isn't up, log the scripture as being used + if(slab && !slab.no_cost && !GLOB.ratvar_awakens) //if the slab exists and isn't debug and ratvar isn't up, log the scripture as being used feedback_add_details("clockcult_scripture_recited", name) if(slab) slab.busy = null @@ -102,12 +102,12 @@ Judgement: 12 servants, 5 caches, 300 CV, and any existing AIs are converted or /datum/clockwork_scripture/proc/has_requirements() //if we have the components and invokers to do it var/checked_penalty = FALSE - if(!ratvar_awakens && !slab.no_cost) + if(!GLOB.ratvar_awakens && !slab.no_cost) checked_penalty = check_offstation_penalty() var/component_printout = "You lack the components to recite this piece of scripture!" var/failed = FALSE for(var/i in consumed_components) - var/cache_components = clockwork_caches ? clockwork_component_cache[i] : 0 + var/cache_components = GLOB.clockwork_caches ? GLOB.clockwork_component_cache[i] : 0 var/total_components = slab.stored_components[i] + cache_components if(consumed_components[i] && total_components < consumed_components[i]) component_printout += "\nYou have [total_components]/[consumed_components[i]] \ @@ -117,7 +117,7 @@ Judgement: 12 servants, 5 caches, 300 CV, and any existing AIs are converted or component_printout += "" to_chat(invoker, component_printout) return FALSE - if(multiple_invokers_used && !multiple_invokers_optional && !ratvar_awakens && !slab.no_cost) + if(multiple_invokers_used && !multiple_invokers_optional && !GLOB.ratvar_awakens && !slab.no_cost) var/nearby_servants = 0 for(var/mob/living/L in range(1, get_turf(invoker))) if(is_servant_of_ratvar(L) && L.stat == CONSCIOUS && L.can_speak_vocal()) diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm index 0d68cbd3ecd30..efc479f5224eb 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_applications.dm @@ -86,7 +86,7 @@ return TRUE if(is_type_in_typecache(I, ratvarian_armor_typecache)) return FALSE - if(!ratvar_awakens && is_type_in_typecache(I, better_armor_typecache)) + if(!GLOB.ratvar_awakens && is_type_in_typecache(I, better_armor_typecache)) return FALSE return user.dropItemToGround(I) @@ -106,7 +106,7 @@ sort_priority = 3 /datum/clockwork_scripture/memory_allocation/check_special_requirements() - for(var/mob/living/simple_animal/hostile/clockwork/marauder/M in all_clockwork_mobs) + for(var/mob/living/simple_animal/hostile/clockwork/marauder/M in GLOB.all_clockwork_mobs) if(M.host == invoker) to_chat(invoker, "You can only house one marauder at a time!") return FALSE @@ -281,13 +281,13 @@ /datum/clockwork_scripture/create_object/tinkerers_daemon/check_special_requirements() var/servants = 0 - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L)) servants++ - if(servants * 0.2 < clockwork_daemons) + if(servants * 0.2 < GLOB.clockwork_daemons) to_chat(invoker, "\"Daemons are already disabled, making more of them would be a waste.\"") return FALSE - if(servants * 0.2 < clockwork_daemons+1) + if(servants * 0.2 < GLOB.clockwork_daemons+1) to_chat(invoker, "\"This daemon would be useless, friend.\"") return FALSE return ..() diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_cyborg.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_cyborg.dm index 13d11b7d8df29..db5260a8a0df6 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_cyborg.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_cyborg.dm @@ -17,13 +17,13 @@ timeout_time = 50 /datum/clockwork_scripture/ranged_ability/linked_vanguard/check_special_requirements() - if(!ratvar_awakens && islist(invoker.stun_absorption) && invoker.stun_absorption["vanguard"] && invoker.stun_absorption["vanguard"]["end_time"] > world.time) + if(!GLOB.ratvar_awakens && islist(invoker.stun_absorption) && invoker.stun_absorption["vanguard"] && invoker.stun_absorption["vanguard"]["end_time"] > world.time) to_chat(invoker, "You are already shielded by a Vanguard!") return FALSE return TRUE /datum/clockwork_scripture/ranged_ability/linked_vanguard/scripture_effects() - if(ratvar_awakens) //hey, ratvar's up! give everybody stun immunity. + if(GLOB.ratvar_awakens) //hey, ratvar's up! give everybody stun immunity. for(var/mob/living/L in view(7, get_turf(invoker))) if(L.stat != DEAD && is_servant_of_ratvar(L)) L.apply_status_effect(STATUS_EFFECT_VANGUARD) diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm index cb343802422e7..023cd50dd134d 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_drivers.dm @@ -74,13 +74,13 @@ quickbind_desc = "Allows you to temporarily absorb stuns. All stuns absorbed will affect you when disabled." /datum/clockwork_scripture/vanguard/check_special_requirements() - if(!ratvar_awakens && islist(invoker.stun_absorption) && invoker.stun_absorption["vanguard"] && invoker.stun_absorption["vanguard"]["end_time"] > world.time) + if(!GLOB.ratvar_awakens && islist(invoker.stun_absorption) && invoker.stun_absorption["vanguard"] && invoker.stun_absorption["vanguard"]["end_time"] > world.time) to_chat(invoker, "You are already shielded by a Vanguard!") return FALSE return TRUE /datum/clockwork_scripture/vanguard/scripture_effects() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) for(var/mob/living/L in view(7, get_turf(invoker))) if(L.stat != DEAD && is_servant_of_ratvar(L)) L.apply_status_effect(STATUS_EFFECT_VANGUARD) @@ -134,8 +134,8 @@ /datum/clockwork_scripture/ranged_ability/geis_prep/run_scripture() var/servants = 0 - if(!ratvar_awakens) - for(var/mob/living/M in all_clockwork_mobs) + if(!GLOB.ratvar_awakens) + for(var/mob/living/M in GLOB.all_clockwork_mobs) if(ishuman(M) || issilicon(M)) servants++ if(servants > SCRIPT_SERVANT_REQ) @@ -165,8 +165,8 @@ /datum/clockwork_scripture/geis/run_scripture() var/servants = 0 - if(!ratvar_awakens) - for(var/mob/living/M in all_clockwork_mobs) + if(!GLOB.ratvar_awakens) + for(var/mob/living/M in GLOB.all_clockwork_mobs) if(ishuman(M) || issilicon(M)) servants++ if(target.buckled) @@ -272,7 +272,7 @@ var/static/prev_cost = 0 /datum/clockwork_scripture/create_object/tinkerers_cache/creation_update() - var/cache_cost_increase = min(round(clockwork_caches*0.25), 5) + var/cache_cost_increase = min(round(GLOB.clockwork_caches*0.25), 5) if(cache_cost_increase != prev_cost) prev_cost = cache_cost_increase consumed_components = list(BELLIGERENT_EYE = 0, VANGUARD_COGWHEEL = 0, GEIS_CAPACITOR = 0, REPLICANT_ALLOY = 1, HIEROPHANT_ANSIBLE = 0) diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm index ca59ee3bf1b0e..e7beff846fabb 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_judgement.dm @@ -24,10 +24,10 @@ /datum/clockwork_scripture/create_object/ark_of_the_clockwork_justiciar/check_special_requirements() if(!slab.no_cost) - if(ratvar_awakens) + if(GLOB.ratvar_awakens) to_chat(invoker, "\"I am already here, idiot.\"") return FALSE - for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects) + for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects) var/area/gate_area = get_area(G) to_chat(invoker, "There is already an Ark at [gate_area.map_name]!") return FALSE @@ -36,7 +36,7 @@ if(!T || T.z != ZLEVEL_STATION || istype(A, /area/shuttle) || !A.blob_allowed) to_chat(invoker, "You must be on the station to activate the Ark!") return FALSE - if(clockwork_gateway_activated) + if(GLOB.clockwork_gateway_activated) to_chat(invoker, "Ratvar's recent banishment renders him too weak to be wrung forth from Reebe!") return FALSE return ..() diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_revenant.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_revenant.dm index e98e525464e7a..faab84befeac7 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_revenant.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_revenant.dm @@ -16,7 +16,7 @@ sort_priority = 2 /datum/clockwork_scripture/invoke_inathneq/check_special_requirements() - if(!slab.no_cost && clockwork_generals_invoked["inath-neq"] > world.time) + if(!slab.no_cost && GLOB.clockwork_generals_invoked["inath-neq"] > world.time) to_chat(invoker, "\"[text2ratvar("I cannot lend you my aid yet, champion. Please be careful.")]\"\n\ Inath-neq has already been invoked recently! You must wait several minutes before calling upon the Resonant Cogwheel.") return FALSE @@ -25,7 +25,7 @@ /datum/clockwork_scripture/invoke_inathneq/scripture_effects() new/obj/effect/clockwork/general_marker/inathneq(get_turf(invoker)) hierophant_message("[text2ratvar("Vanguard: \"I lend you my aid, champions! Let glory guide your blows!")]\"", FALSE, invoker) - clockwork_generals_invoked["inath-neq"] = world.time + CLOCKWORK_GENERAL_COOLDOWN + GLOB.clockwork_generals_invoked["inath-neq"] = world.time + CLOCKWORK_GENERAL_COOLDOWN playsound(invoker, 'sound/magic/clockwork/invoke_general.ogg', 50, 0) if(invoker.real_name == "Lucio") clockwork_say(invoker, text2ratvar("Aww, let's break it DOWN!!")) @@ -56,11 +56,11 @@ "\"What a waste of my power.\"", "\"I'm sure I could just control these minds instead, but they never ask.\"") /datum/clockwork_scripture/invoke_sevtug/check_special_requirements() - if(!slab.no_cost && clockwork_generals_invoked["sevtug"] > world.time) + if(!slab.no_cost && GLOB.clockwork_generals_invoked["sevtug"] > world.time) to_chat(invoker, "\"[text2ratvar("Is it really so hard - even for a simpleton like you - to grasp the concept of waiting?")]\"\n\ Sevtug has already been invoked recently! You must wait several minutes before calling upon the Formless Pariah.") return FALSE - if(!slab.no_cost && ratvar_awakens) + if(!slab.no_cost && GLOB.ratvar_awakens) to_chat(invoker, "\"[text2ratvar("Do you really think anything I can do right now will compare to Engine's power?")]\"\n\ Sevtug will not grant his power while Ratvar's dwarfs his own!") return FALSE @@ -69,11 +69,11 @@ /datum/clockwork_scripture/invoke_sevtug/scripture_effects() new/obj/effect/clockwork/general_marker/sevtug(get_turf(invoker)) hierophant_message("[text2ratvar("Fright: \"I heed your call, idiots. Get going and use this chance while it lasts!")]\"", FALSE, invoker) - clockwork_generals_invoked["sevtug"] = world.time + GLOBAL_CLOCKWORK_GENERAL_COOLDOWN + GLOB.clockwork_generals_invoked["sevtug"] = world.time + GLOBAL_CLOCKWORK_GENERAL_COOLDOWN playsound(invoker, 'sound/magic/clockwork/invoke_general.ogg', 50, 0) var/hum = get_sfx('sound/effects/screech.ogg') //like playsound, same sound for everyone affected var/turf/T = get_turf(invoker) - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(H.z == invoker.z && !is_servant_of_ratvar(H)) var/distance = 0 distance += get_dist(T, get_turf(H)) @@ -118,11 +118,11 @@ multiple_invokers_used = TRUE /datum/clockwork_scripture/invoke_nezbere/check_special_requirements() - if(!slab.no_cost && clockwork_generals_invoked["nezbere"] > world.time) + if(!slab.no_cost && GLOB.clockwork_generals_invoked["nezbere"] > world.time) to_chat(invoker, "\"[text2ratvar("Not just yet, friend. Patience is a virtue.")]\"\n\ Nezbere has already been invoked recently! You must wait several minutes before calling upon the Brass Eidolon.") return FALSE - if(!slab.no_cost && ratvar_awakens) + if(!slab.no_cost && GLOB.ratvar_awakens) to_chat(invoker, "\"[text2ratvar("Our master is here already. You do not require my help, friend.")]\"\n\ There is no need for Nezbere's assistance while Ratvar is risen!") return FALSE @@ -131,17 +131,17 @@ /datum/clockwork_scripture/invoke_nezbere/scripture_effects() new/obj/effect/clockwork/general_marker/nezbere(get_turf(invoker)) hierophant_message("[text2ratvar("Armorer: \"I heed your call, champions. May your artifacts bring ruin upon the heathens that oppose our master!")]\"", FALSE, invoker) - clockwork_generals_invoked["nezbere"] = world.time + GLOBAL_CLOCKWORK_GENERAL_COOLDOWN + GLOB.clockwork_generals_invoked["nezbere"] = world.time + GLOBAL_CLOCKWORK_GENERAL_COOLDOWN playsound(invoker, 'sound/magic/clockwork/invoke_general.ogg', 50, 0) - nezbere_invoked++ - for(var/obj/O in all_clockwork_objects) + GLOB.nezbere_invoked++ + for(var/obj/O in GLOB.all_clockwork_objects) O.ratvar_act() addtimer(CALLBACK(GLOBAL_PROC, /proc/reset_nezbere_invocation), 600) return TRUE /proc/reset_nezbere_invocation() - nezbere_invoked-- - for(var/obj/O in all_clockwork_objects) + GLOB.nezbere_invoked-- + for(var/obj/O in GLOB.all_clockwork_objects) O.ratvar_act() @@ -160,7 +160,7 @@ sort_priority = 5 /datum/clockwork_scripture/invoke_nzcrentr/check_special_requirements() - if(!slab.no_cost && clockwork_generals_invoked["nzcrentr"] > world.time) + if(!slab.no_cost && GLOB.clockwork_generals_invoked["nzcrentr"] > world.time) to_chat(invoker, "\"[text2ratvar("The boss says you have to wait. Hey, do you think he would mind if I killed you? ...He would? Ok.")]\"\n\ Nzcrentr has already been invoked recently! You must wait several minutes before calling upon the Eternal Thunderbolt.") return FALSE @@ -168,7 +168,7 @@ /datum/clockwork_scripture/invoke_nzcrentr/scripture_effects() new/obj/effect/clockwork/general_marker/nzcrentr(get_turf(invoker)) - clockwork_generals_invoked["nzcrentr"] = world.time + CLOCKWORK_GENERAL_COOLDOWN + GLOB.clockwork_generals_invoked["nzcrentr"] = world.time + CLOCKWORK_GENERAL_COOLDOWN hierophant_message("[text2ratvar("Amperage: \"[invoker.real_name] has called forth my power. Hope [invoker.p_they()] [invoker.p_do()] not shatter under it!")]\"", FALSE, invoker) invoker.visible_message("[invoker] begins to radiate a blinding light!", \ "\"[text2ratvar("The boss says it's okay to do this. Don't blame me if you die from it.")]\"\n\ diff --git a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm index bc3249f58b86e..4fd4e629a12cb 100644 --- a/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm +++ b/code/game/gamemodes/clock_cult/clock_scriptures/scripture_scripts.dm @@ -180,7 +180,7 @@ owner.visible_message("A strange spear materializes in [owner]'s hands!", "You call forth your spear!") var/obj/item/clockwork/ratvarian_spear/R = new(get_turf(usr)) owner.put_in_hands(R) - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) to_chat(owner, "Your spear begins to break down in this plane of existence. You can't use it for long!") cooldown = base_cooldown + world.time owner.update_action_buttons_icon() @@ -211,10 +211,10 @@ to_chat(invoker, "You must not be inside an object to use this scripture!") return FALSE var/other_servants = 0 - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L) && !L.stat && L != invoker) other_servants++ - for(var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/O in all_clockwork_objects) + for(var/obj/structure/destructible/clockwork/powered/clockwork_obelisk/O in GLOB.all_clockwork_objects) if(O.anchored) other_servants++ if(!other_servants) @@ -229,7 +229,7 @@ if(!L.stat && is_servant_of_ratvar(L)) portal_uses++ duration += 40 //4 seconds - if(ratvar_awakens) + if(GLOB.ratvar_awakens) portal_uses = max(portal_uses, 100) //Very powerful if Ratvar has been summoned duration = max(duration, 100) return slab.procure_gateway(invoker, duration, portal_uses) @@ -263,7 +263,7 @@ var/turf/T = get_turf(invoker) if(!ray.run_scripture() && slab && invoker) if(can_recite() && T == get_turf(invoker)) - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) var/obj/structure/destructible/clockwork/powered/volt_checker/VC = new/obj/structure/destructible/clockwork/powered/volt_checker(get_turf(invoker)) var/multiplier = 0.5 var/usable_power = min(Floor(VC.total_accessable_power() * 0.2, MIN_CLOCKCULT_POWER), 1000) diff --git a/code/game/gamemodes/clock_cult/clock_structure.dm b/code/game/gamemodes/clock_cult/clock_structure.dm index 5eda70a8f7025..f95b6e2d1670e 100644 --- a/code/game/gamemodes/clock_cult/clock_structure.dm +++ b/code/game/gamemodes/clock_cult/clock_structure.dm @@ -21,15 +21,15 @@ /obj/structure/destructible/clockwork/New() ..() change_construction_value(construction_value) - all_clockwork_objects += src + GLOB.all_clockwork_objects += src /obj/structure/destructible/clockwork/Destroy() change_construction_value(-construction_value) - all_clockwork_objects -= src + GLOB.all_clockwork_objects -= src return ..() /obj/structure/destructible/clockwork/ratvar_act() - if(ratvar_awakens || clockwork_gateway_activated) + if(GLOB.ratvar_awakens || GLOB.clockwork_gateway_activated) obj_integrity = max_integrity /obj/structure/destructible/clockwork/narsie_act() @@ -78,7 +78,7 @@ return ..() /obj/structure/destructible/clockwork/proc/get_efficiency_mod(increasing) - if(ratvar_awakens) + if(GLOB.ratvar_awakens) if(increasing) return 0.5 return 2 @@ -144,10 +144,10 @@ /obj/structure/destructible/clockwork/massive/New() ..() - poi_list += src + GLOB.poi_list += src /obj/structure/destructible/clockwork/massive/Destroy() - poi_list -= src + GLOB.poi_list -= src return ..() /obj/structure/destructible/clockwork/massive/singularity_pull(S, current_size) @@ -177,7 +177,7 @@ /obj/structure/destructible/clockwork/powered/ratvar_act() ..() - if(nezbere_invoked) + if(GLOB.nezbere_invoked) needs_power = FALSE else needs_power = initial(needs_power) @@ -225,7 +225,7 @@ new /obj/effect/overlay/temp/emp(loc) /obj/structure/destructible/clockwork/powered/proc/total_accessable_power() //how much power we have and can use - if(!needs_power || ratvar_awakens) + if(!needs_power || GLOB.ratvar_awakens) return INFINITY //oh yeah we've got power why'd you ask var/power = 0 @@ -237,7 +237,7 @@ var/power = 0 var/area/A = get_area(src) var/area/targetAPCA - for(var/obj/machinery/power/apc/APC in apcs_list) + for(var/obj/machinery/power/apc/APC in GLOB.apcs_list) var/area/APCA = get_area(APC) if(APCA == A) target_apc = APC @@ -259,7 +259,7 @@ /obj/structure/destructible/clockwork/powered/proc/try_use_power(amount) //try to use an amount of power - if(!needs_power || ratvar_awakens) + if(!needs_power || GLOB.ratvar_awakens) return 1 if(amount <= 0) return FALSE diff --git a/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm b/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm index 73b4ddb17dc53..c088c8cd413d6 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/ark_of_the_clockwork_justicar.dm @@ -182,7 +182,7 @@ /obj/structure/destructible/clockwork/massive/celestial_gateway/process() if(!first_sound_played || prob(7)) - for(var/M in player_list) + for(var/M in GLOB.player_list) if(M && !isnewplayer(M)) to_chat(M, "You hear otherworldly sounds from the [dir2text(get_dir(get_turf(M), get_turf(src)))]...") if(!obj_integrity) @@ -211,9 +211,9 @@ var/used_components = FALSE for(var/i in required_components) if(required_components[i]) - var/to_use = min(clockwork_component_cache[i], required_components[i]) + var/to_use = min(GLOB.clockwork_component_cache[i], required_components[i]) required_components[i] -= to_use - clockwork_component_cache[i] -= to_use + GLOB.clockwork_component_cache[i] -= to_use if(to_use) used_components = TRUE if(used_components) @@ -261,7 +261,7 @@ var/turf/startpoint = get_turf(src) QDEL_IN(src, 3) sleep(3) - clockwork_gateway_activated = TRUE + GLOB.clockwork_gateway_activated = TRUE new/obj/structure/destructible/clockwork/massive/ratvar(startpoint) send_to_playing_players("\"[text2ratvar("See Engine's mercy")]!\"\n\ \"[text2ratvar("Observe Engine's design skills")]!\"\n\"[text2ratvar("Behold Engine's light")]!!\"\n\ diff --git a/code/game/gamemodes/clock_cult/clock_structures/interdiction_lens.dm b/code/game/gamemodes/clock_cult/clock_structures/interdiction_lens.dm index 40721b4289279..1082e021c0eb4 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/interdiction_lens.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/interdiction_lens.dm @@ -97,7 +97,7 @@ var/efficiency = get_efficiency_mod() var/rage_modifier = get_efficiency_mod(TRUE) - for(var/i in ai_list) + for(var/i in GLOB.ai_list) var/mob/living/silicon/ai/AI = i if(AI && AI.stat != DEAD && !is_servant_of_ratvar(AI)) unconverted_ai = TRUE diff --git a/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm b/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm index da2483883e431..a6455701b1bcd 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/ocular_warden.dm @@ -47,10 +47,10 @@ /obj/structure/destructible/clockwork/ocular_warden/ratvar_act() ..() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) damage_per_tick = 10 sight_range = 6 - else if(nezbere_invoked) + else if(GLOB.nezbere_invoked) damage_per_tick = 5 sight_range = 5 else @@ -80,7 +80,7 @@ else L.playsound_local(null,'sound/machines/clockcult/ocularwarden-dot2.ogg',50,1) L.adjustFireLoss((!iscultist(L) ? damage_per_tick : damage_per_tick * 2) * get_efficiency_mod()) //Nar-Sian cultists take additional damage - if(ratvar_awakens && L) + if(GLOB.ratvar_awakens && L) L.adjust_fire_stacks(damage_per_tick) L.IgniteMob() else if(istype(target,/obj/mecha)) @@ -97,7 +97,7 @@ visible_message("[src] swivels to face [target]!") if(isliving(target)) var/mob/living/L = target - to_chat(L, "\"I SEE YOU!\"\n[src]'s gaze [ratvar_awakens ? "melts you alive" : "burns you"]!") + to_chat(L, "\"I SEE YOU!\"\n[src]'s gaze [GLOB.ratvar_awakens ? "melts you alive" : "burns you"]!") else if(istype(target,/obj/mecha)) var/obj/mecha/M = target to_chat(M.occupant, "\"I SEE YOU!\"" ) @@ -105,7 +105,7 @@ if(prob(50)) visible_message("[src][pick(idle_messages)]") else - setDir(pick(cardinal))//Random rotation + setDir(pick(GLOB.cardinal))//Random rotation /obj/structure/destructible/clockwork/ocular_warden/proc/acquire_nearby_targets() . = list() @@ -131,7 +131,7 @@ else if(!L.mind) continue . += L - for(var/N in mechas_list) + for(var/N in GLOB.mechas_list) var/obj/mecha/M = N if(get_dist(M, src) <= sight_range && M.occupant && !is_servant_of_ratvar(M.occupant) && (M in view(sight_range, src))) . += M diff --git a/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm b/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm index 752119c70ca73..4b6db708f6950 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/ratvar_the_clockwork_justicar.dm @@ -19,8 +19,8 @@ /obj/structure/destructible/clockwork/massive/ratvar/New() ..() - ratvar_awakens++ - for(var/obj/O in all_clockwork_objects) + GLOB.ratvar_awakens++ + for(var/obj/O in GLOB.all_clockwork_objects) O.ratvar_act() START_PROCESSING(SSobj, src) send_to_playing_players("\"[text2ratvar("ONCE AGAIN MY LIGHT SHALL SHINE ACROSS THIS PATHETIC REALM")]!!\"") @@ -31,8 +31,8 @@ INVOKE_ASYNC(SSshuttle.emergency, /obj/docking_port/mobile/emergency..proc/request, null, 0) /obj/structure/destructible/clockwork/massive/ratvar/Destroy() - ratvar_awakens-- - for(var/obj/O in all_clockwork_objects) + GLOB.ratvar_awakens-- + for(var/obj/O in GLOB.all_clockwork_objects) O.ratvar_act() STOP_PROCESSING(SSobj, src) send_to_playing_players("\"NO! I will not... be... banished... again...\"") @@ -64,13 +64,13 @@ for(var/I in circleviewturfs(src, round(proselytize_range * 0.5))) var/turf/T = I T.ratvar_act(TRUE) - var/dir_to_step_in = pick(cardinal) + var/dir_to_step_in = pick(GLOB.cardinal) var/list/meals = list() - for(var/mob/living/L in living_mob_list) //we want to know who's alive so we don't lose and retarget a single person + for(var/mob/living/L in GLOB.living_mob_list) //we want to know who's alive so we don't lose and retarget a single person if(L.z == z && !is_servant_of_ratvar(L) && L.mind) meals += L if(!prey) - for(var/obj/singularity/narsie/N in singularities) + for(var/obj/singularity/narsie/N in GLOB.singularities) if(N.z == z) prey = N break @@ -113,13 +113,13 @@ while(src && narsie) send_to_playing_players('sound/magic/clockwork/ratvar_attack.ogg') sleep(5.2) - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(!isnewplayer(M)) flash_color(M, flash_color="#966400", flash_time=1) shake_camera(M, 4, 3) var/ratvar_chance = min(SSticker.mode.servants_of_ratvar.len, 50) var/narsie_chance = SSticker.mode.cult.len - for(var/mob/living/simple_animal/hostile/construct/harvester/C in player_list) + for(var/mob/living/simple_animal/hostile/construct/harvester/C in GLOB.player_list) narsie_chance++ ratvar_chance = rand(base_victory_chance, ratvar_chance) narsie_chance = rand(base_victory_chance, min(narsie_chance, 50)) @@ -129,7 +129,7 @@ sleep(rand(2,5)) send_to_playing_players('sound/magic/clockwork/narsie_attack.ogg') sleep(7.4) - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(!isnewplayer(M)) flash_color(M, flash_color="#C80000", flash_time=1) shake_camera(M, 4, 3) diff --git a/code/game/gamemodes/clock_cult/clock_structures/taunting_trail.dm b/code/game/gamemodes/clock_cult/clock_structures/taunting_trail.dm index 16afbae154d8b..3016a210dc76b 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/taunting_trail.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/taunting_trail.dm @@ -20,13 +20,13 @@ timerid = QDEL_IN(src, 15) var/obj/structure/destructible/clockwork/taunting_trail/Tt = locate(/obj/structure/destructible/clockwork/taunting_trail) in loc if(Tt && Tt != src) - if(!step(src, pick(alldirs))) + if(!step(src, pick(GLOB.alldirs))) qdel(Tt) else for(var/obj/structure/destructible/clockwork/taunting_trail/TT in loc) if(TT != src) qdel(TT) - setDir(pick(cardinal)) + setDir(pick(GLOB.cardinal)) transform = matrix()*1.25 animate(src, alpha = 100, time = 15) diff --git a/code/game/gamemodes/clock_cult/clock_structures/tinkerers_cache.dm b/code/game/gamemodes/clock_cult/clock_structures/tinkerers_cache.dm index c7cf8649c5853..7583428505623 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/tinkerers_cache.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/tinkerers_cache.dm @@ -18,12 +18,12 @@ /obj/structure/destructible/clockwork/cache/New() ..() START_PROCESSING(SSobj, src) - clockwork_caches++ + GLOB.clockwork_caches++ update_slab_info() set_light(2, 0.7) /obj/structure/destructible/clockwork/cache/Destroy() - clockwork_caches-- + GLOB.clockwork_caches-- update_slab_info() STOP_PROCESSING(SSobj, src) if(linkedwall) @@ -61,7 +61,7 @@ if(!anchored) to_chat(user, "[src] needs to be secured to place [C] into it!") else - clockwork_component_cache[C.component_id]++ + GLOB.clockwork_component_cache[C.component_id]++ update_slab_info() to_chat(user, "You add [C] to [src].") user.drop_item() @@ -73,7 +73,7 @@ to_chat(user, "[src] needs to be secured to offload your slab's components into it!") else for(var/i in S.stored_components) - clockwork_component_cache[i] += S.stored_components[i] + GLOB.clockwork_component_cache[i] += S.stored_components[i] S.stored_components[i] = 0 update_slab_info() user.visible_message("[user] empties [S] into [src].", "You offload your slab's components into [src].") @@ -110,8 +110,8 @@ else to_chat(user, "It is unlinked! Construct a Clockwork Wall nearby to generate components!") to_chat(user, "Stored components:") - for(var/i in clockwork_component_cache) - to_chat(user, "[get_component_name(i)][i != REPLICANT_ALLOY ? "s":""]: [clockwork_component_cache[i]]") + for(var/i in GLOB.clockwork_component_cache) + to_chat(user, "[get_component_name(i)][i != REPLICANT_ALLOY ? "s":""]: [GLOB.clockwork_component_cache[i]]") /obj/structure/destructible/clockwork/cache/proc/get_production_time() return (CACHE_PRODUCTION_TIME + (ACTIVE_CACHE_SLOWDOWN * linked_caches)) * get_efficiency_mod(TRUE) diff --git a/code/game/gamemodes/clock_cult/clock_structures/tinkerers_daemon.dm b/code/game/gamemodes/clock_cult/clock_structures/tinkerers_daemon.dm index ab557dd36a6a0..6dc8741a3ddd1 100644 --- a/code/game/gamemodes/clock_cult/clock_structures/tinkerers_daemon.dm +++ b/code/game/gamemodes/clock_cult/clock_structures/tinkerers_daemon.dm @@ -22,15 +22,15 @@ /obj/structure/destructible/clockwork/powered/tinkerers_daemon/New() ..() - clockwork_daemons++ + GLOB.clockwork_daemons++ /obj/structure/destructible/clockwork/powered/tinkerers_daemon/Destroy() - clockwork_daemons-- + GLOB.clockwork_daemons-- return ..() /obj/structure/destructible/clockwork/powered/tinkerers_daemon/ratvar_act() ..() - if(nezbere_invoked) + if(GLOB.nezbere_invoked) production_time = 0 production_cooldown = initial(production_cooldown) * 0.5 if(!active) @@ -47,8 +47,8 @@ else to_chat(user, "It is currently producing random components.") to_chat(user, "It will produce a component every [round((production_cooldown*0.1) * get_efficiency_mod(TRUE), 0.1)] seconds and requires at least the following power for each component type:") - for(var/i in clockwork_component_cache) - to_chat(user, "[get_component_name(i)]: [get_component_cost(i)]W ([clockwork_component_cache[i]] exist[clockwork_component_cache[i] == 1 ? "s" : ""])") + for(var/i in GLOB.clockwork_component_cache) + to_chat(user, "[get_component_name(i)]: [get_component_cost(i)]W ([GLOB.clockwork_component_cache[i]] exist[GLOB.clockwork_component_cache[i] == 1 ? "s" : ""])") /obj/structure/destructible/clockwork/powered/tinkerers_daemon/forced_disable(bad_effects) if(active) @@ -72,17 +72,17 @@ to_chat(user, "[src] needs to be secured to the floor before it can be activated!") return FALSE var/servants = 0 - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L)) servants++ - if(servants * 0.2 < clockwork_daemons) + if(servants * 0.2 < GLOB.clockwork_daemons) to_chat(user, "\"There are too few servants for this daemon to work.\"") return - if(!clockwork_caches) + if(!GLOB.clockwork_caches) to_chat(user, "\"You require a cache for this daemon to operate. Get to it.\"") return var/min_power_usable = 0 - for(var/i in clockwork_component_cache) + for(var/i in GLOB.clockwork_component_cache) if(!min_power_usable) min_power_usable = get_component_cost(i) else @@ -94,15 +94,15 @@ switch(choice) if("Specific Component") var/list/components = list() - for(var/i in clockwork_component_cache) + for(var/i in GLOB.clockwork_component_cache) components["[get_component_name(i)] ([get_component_cost(i)]W)"] = i var/input_component = input(user, "Choose a component type.", name) as null|anything in components component_id_to_produce = components[input_component] servants = 0 - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L)) servants++ - if(!is_servant_of_ratvar(user) || !user.canUseTopic(src, !issilicon(user), NO_DEXTERY) || active || !clockwork_caches || servants * 0.2 < clockwork_daemons) + if(!is_servant_of_ratvar(user) || !user.canUseTopic(src, !issilicon(user), NO_DEXTERY) || active || !GLOB.clockwork_caches || servants * 0.2 < GLOB.clockwork_daemons) return if(!component_id_to_produce) to_chat(user, "You decide not to select a component and activate the daemon.") @@ -136,24 +136,24 @@ set_light(0) /obj/structure/destructible/clockwork/powered/tinkerers_daemon/proc/get_component_cost(id) - return max(MIN_CLOCKCULT_POWER*2, (MIN_CLOCKCULT_POWER*2) * (1 + round(clockwork_component_cache[id] * 0.2))) + return max(MIN_CLOCKCULT_POWER*2, (MIN_CLOCKCULT_POWER*2) * (1 + round(GLOB.clockwork_component_cache[id] * 0.2))) /obj/structure/destructible/clockwork/powered/tinkerers_daemon/process() var/servants = 0 - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) if(is_servant_of_ratvar(L)) servants++ . = ..() var/min_power_usable = 0 if(!component_id_to_produce) - for(var/i in clockwork_component_cache) + for(var/i in GLOB.clockwork_component_cache) if(!min_power_usable) min_power_usable = get_component_cost(i) else min_power_usable = min(min_power_usable, get_component_cost(i)) else min_power_usable = get_component_cost(component_id_to_produce) - if(!clockwork_caches || servants * 0.2 < clockwork_daemons || . < min_power_usable) //if we don't have enough to produce the lowest or what we chose to produce, cancel out + if(!GLOB.clockwork_caches || servants * 0.2 < GLOB.clockwork_daemons || . < min_power_usable) //if we don't have enough to produce the lowest or what we chose to produce, cancel out forced_disable(FALSE) return if(production_time <= world.time) @@ -163,7 +163,7 @@ if(!try_use_power(get_component_cost(component_to_generate))) component_to_generate = null if(!component_id_to_produce) - for(var/i in clockwork_component_cache) + for(var/i in GLOB.clockwork_component_cache) if(try_use_power(get_component_cost(i))) //if we fail but are producing random, try and get a different component to produce component_to_generate = i break diff --git a/code/game/gamemodes/cult/cult.dm b/code/game/gamemodes/cult/cult.dm index aafbbac0fc6bc..65dcb863eb572 100644 --- a/code/game/gamemodes/cult/cult.dm +++ b/code/game/gamemodes/cult/cult.dm @@ -104,7 +104,7 @@ var/list/possible_targets = get_unconvertables() if(!possible_targets.len) message_admins("Cult Sacrifice: Could not find unconvertable target, checking for convertable target.") - for(var/mob/living/carbon/human/player in player_list) + for(var/mob/living/carbon/human/player in GLOB.player_list) if(player.mind && !(player.mind in cultists_to_cult)) possible_targets += player.mind if(possible_targets.len > 0) @@ -175,18 +175,18 @@ return TRUE /datum/game_mode/proc/update_cult_icons_added(datum/mind/cult_mind) - var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT] + var/datum/atom_hud/antag/culthud = GLOB.huds[ANTAG_HUD_CULT] culthud.join_hud(cult_mind.current) set_antag_hud(cult_mind.current, "cult") /datum/game_mode/proc/update_cult_icons_removed(datum/mind/cult_mind) - var/datum/atom_hud/antag/culthud = huds[ANTAG_HUD_CULT] + var/datum/atom_hud/antag/culthud = GLOB.huds[ANTAG_HUD_CULT] culthud.leave_hud(cult_mind.current) set_antag_hud(cult_mind.current, null) /datum/game_mode/cult/proc/get_unconvertables() var/list/ucs = list() - for(var/mob/living/carbon/human/player in player_list) + for(var/mob/living/carbon/human/player in GLOB.player_list) if(player.mind && !is_convertable_to_cult(player) && !(player.mind in cultists_to_cult)) ucs += player.mind return ucs @@ -198,7 +198,7 @@ if(cult_objectives.Find("eldergod")) cult_fail += eldergod //1 by default, 0 if the elder god has been summoned at least once if(cult_objectives.Find("sacrifice")) - if(sacrifice_target && !sacrificed.Find(sacrifice_target)) //if the target has been sacrificed, ignore this step. otherwise, add 1 to cult_fail + if(sacrifice_target && !GLOB.sacrificed.Find(sacrifice_target)) //if the target has been GLOB.sacrificed, ignore this step. otherwise, add 1 to cult_fail cult_fail++ return cult_fail //if any objectives aren't met, failure @@ -244,7 +244,7 @@ SSticker.news_report = CULT_FAILURE if("sacrifice") if(sacrifice_target) - if(sacrifice_target in sacrificed) + if(sacrifice_target in GLOB.sacrificed) explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. Success!" feedback_add_details("cult_objective","cult_sacrifice|SUCCESS") else if(sacrifice_target && sacrifice_target.current) diff --git a/code/game/gamemodes/cult/cult_comms.dm b/code/game/gamemodes/cult/cult_comms.dm index 4c2083384e8a1..ebea69831d270 100644 --- a/code/game/gamemodes/cult/cult_comms.dm +++ b/code/game/gamemodes/cult/cult_comms.dm @@ -28,10 +28,10 @@ user.whisper("O bidai nabora se[pick("'","`")]sma!") user.whisper(html_decode(message)) var/my_message = "[(ishuman(user) ? "Acolyte" : "Construct")] [findtextEx(user.name, user.real_name) ? user.name : "[user.real_name] (as [user.name])"]: [message]" - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(iscultist(M)) to_chat(M, my_message) - else if(M in dead_mob_list) + else if(M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, user) to_chat(M, "[link] [my_message]") diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index f3f17410d9378..a46074988d95b 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -328,7 +328,7 @@ return if(!iscultist(user)) user.dropItemToGround(src, TRUE) - step(src, pick(alldirs)) + step(src, pick(GLOB.alldirs)) to_chat(user, "\The [src] flickers out of your hands, your connection to this dimension is too strong!") return diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm index d88d0e9e059ec..51c622858dde1 100644 --- a/code/game/gamemodes/cult/cult_structures.dm +++ b/code/game/gamemodes/cult/cult_structures.dm @@ -122,12 +122,6 @@ to_chat(user, "You work the forge as dark knowledge guides your hands, creating [N]!") -var/list/blacklisted_pylon_turfs = typecacheof(list( - /turf/closed, - /turf/open/floor/engine/cult, - /turf/open/space, - /turf/open/floor/plating/lava, - /turf/open/chasm)) /obj/structure/destructible/cult/pylon name = "pylon" @@ -177,6 +171,12 @@ var/list/blacklisted_pylon_turfs = typecacheof(list( if(istype(T, /turf/open/floor/engine/cult)) cultturfs |= T continue + var/static/list/blacklisted_pylon_turfs = typecacheof(list( + /turf/closed, + /turf/open/floor/engine/cult, + /turf/open/space, + /turf/open/floor/plating/lava, + /turf/open/chasm)) if(is_type_in_typecache(T, blacklisted_pylon_turfs)) continue else diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index 8066e5a209d7b..0340c94af308e 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -15,11 +15,12 @@ This file contains the arcane tome files. /obj/item/weapon/tome/New() ..() - if(!LAZYLEN(rune_types)) - rune_types = list() + if(!LAZYLEN(GLOB.rune_types)) + GLOB.rune_types = list() + var/static/list/non_revealed_runes = (subtypesof(/obj/effect/rune) - /obj/effect/rune/malformed) for(var/i_can_do_loops_now_thanks_remie in non_revealed_runes) var/obj/effect/rune/R = i_can_do_loops_now_thanks_remie - rune_types[initial(R.cultist_name)] = R //Uses the cultist name for displaying purposes + GLOB.rune_types[initial(R.cultist_name)] = R //Uses the cultist name for displaying purposes /obj/item/weapon/tome/examine(mob/user) ..() @@ -180,10 +181,10 @@ This file contains the arcane tome files. if(!check_rune_turf(Turf, user)) return - entered_rune_name = input(user, "Choose a rite to scribe.", "Sigils of Power") as null|anything in rune_types + entered_rune_name = input(user, "Choose a rite to scribe.", "Sigils of Power") as null|anything in GLOB.rune_types if(!src || QDELETED(src) || !Adjacent(user) || user.incapacitated() || !check_rune_turf(Turf, user)) return - rune_to_scribe = rune_types[entered_rune_name] + rune_to_scribe = GLOB.rune_types[entered_rune_name] if(!rune_to_scribe) return if(initial(rune_to_scribe.req_keyword)) @@ -201,7 +202,7 @@ This file contains the arcane tome files. if(!("eldergod" in cult_mode.cult_objectives)) to_chat(user, "Nar-Sie does not wish to be summoned!") return - if(cult_mode.sacrifice_target && !(cult_mode.sacrifice_target in sacrificed)) + if(cult_mode.sacrifice_target && !(cult_mode.sacrifice_target in GLOB.sacrificed)) to_chat(user, "The sacrifice is not complete. The portal would lack the power to open if you tried!") return if(!cult_mode.eldergod) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index b4c4ddb4aa41d..750b56d6c638a 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -1,7 +1,7 @@ -/var/list/sacrificed = list() //a mixed list of minds and mobs -var/list/non_revealed_runes = (subtypesof(/obj/effect/rune) - /obj/effect/rune/malformed) -var/global/list/rune_types //Every rune that can be drawn by tomes - +GLOBAL_LIST_EMPTY(sacrificed) //a mixed list of minds and mobs +GLOBAL_LIST(rune_types) //Every rune that can be drawn by tomes +GLOBAL_LIST_EMPTY(teleport_runes) +GLOBAL_LIST_EMPTY(wall_runes) /* This file contains runes. @@ -176,7 +176,7 @@ structure_check() searches for nearby cultist structures required for the invoca /mob/proc/null_rod_check() //The null rod, if equipped, will protect the holder from the effects of most runes var/obj/item/weapon/nullrod/N = locate() in src - if(N && !ratvar_awakens) //If Nar-Sie or Ratvar are alive, null rods won't protect you + if(N && !GLOB.ratvar_awakens) //If Nar-Sie or Ratvar are alive, null rods won't protect you return N return 0 @@ -244,7 +244,6 @@ structure_check() searches for nearby cultist structures required for the invoca if(!P.info && !istype(P, /obj/item/weapon/paper/talisman)) . |= P -var/list/teleport_runes = list() /obj/effect/rune/teleport cultist_name = "Teleport" cultist_desc = "warps everything above it to another chosen teleport rune." @@ -259,17 +258,17 @@ var/list/teleport_runes = list() var/area/A = get_area(src) var/locname = initial(A.name) listkey = set_keyword ? "[set_keyword] [locname]":"[locname]" - teleport_runes += src + GLOB.teleport_runes += src /obj/effect/rune/teleport/Destroy() - teleport_runes -= src + GLOB.teleport_runes -= src return ..() /obj/effect/rune/teleport/invoke(var/list/invokers) var/mob/living/user = invokers[1] //the first invoker is always the user var/list/potential_runes = list() var/list/teleportnames = list() - for(var/R in teleport_runes) + for(var/R in GLOB.teleport_runes) var/obj/effect/rune/teleport/T = R if(T != src && (T.z <= ZLEVEL_SPACEMAX)) potential_runes[avoid_assoc_duplicate_keys(T.listkey, teleportnames)] = T @@ -407,11 +406,11 @@ var/list/teleport_runes = list() var/sacrifice_fulfilled = FALSE if(sacrificial.mind) - sacrificed += sacrificial.mind + GLOB.sacrificed += sacrificial.mind if(is_sacrifice_target(sacrificial.mind)) sacrifice_fulfilled = TRUE else - sacrificed += sacrificial + GLOB.sacrificed += sacrificial new /obj/effect/overlay/temp/cult/sac(get_turf(src)) for(var/M in invokers) @@ -456,10 +455,10 @@ var/list/teleport_runes = list() /obj/effect/rune/narsie/New() . = ..() - poi_list |= src + GLOB.poi_list |= src /obj/effect/rune/narsie/Destroy() - poi_list -= src + GLOB.poi_list -= src . = ..() /obj/effect/rune/narsie/talismanhide() //can't hide this, and you wouldn't want to @@ -483,7 +482,7 @@ var/list/teleport_runes = list() log_game("Summon Nar-Sie rune failed - gametype is not cult") return - if(locate(/obj/singularity/narsie) in poi_list) + if(locate(/obj/singularity/narsie) in GLOB.poi_list) for(var/M in invokers) to_chat(M, "Nar-Sie is already on this plane!") log_game("Summon Nar-Sie rune failed - already summoned") @@ -513,7 +512,7 @@ var/list/teleport_runes = list() message_admins("[key_name_admin(user)] erased a Narsie rune with a null rod") ..() -//Rite of Resurrection: Requires the corpse of a cultist and that there have been less revives than the number of people sacrificed +//Rite of Resurrection: Requires the corpse of a cultist and that there have been less revives than the number of people GLOB.sacrificed /obj/effect/rune/raise_dead cultist_name = "Raise Dead" cultist_desc = "requires the corpse of a cultist placed upon the rune. Provided there have been sufficient sacrifices, they will be revived." @@ -526,8 +525,8 @@ var/list/teleport_runes = list() ..() if(iscultist(user) || user.stat == DEAD) var/revive_number = 0 - if(sacrificed.len) - revive_number = sacrificed.len - revives_used + if(GLOB.sacrificed.len) + revive_number = GLOB.sacrificed.len - revives_used to_chat(user, "Revives Remaining: [revive_number]") /obj/effect/rune/raise_dead/invoke(var/list/invokers) @@ -545,8 +544,8 @@ var/list/teleport_runes = list() log_game("Raise Dead rune failed - no corpses to revive") fail_invoke() return - if(!sacrificed.len || sacrificed.len <= revives_used) - to_chat(user, "You have sacrificed too few people to revive a cultist!") + if(!GLOB.sacrificed.len || GLOB.sacrificed.len <= revives_used) + to_chat(user, "You have GLOB.sacrificed too few people to revive a cultist!") fail_invoke() return if(potential_revive_mobs.len > 1) @@ -589,7 +588,7 @@ var/list/teleport_runes = list() fail_invoke() log_game("Raise Dead rune failed - revival target has no ghost") return 0 - if(!sacrificed.len || sacrificed.len <= revives_used) + if(!GLOB.sacrificed.len || GLOB.sacrificed.len <= revives_used) to_chat(user, "You have sacrificed too few people to revive a cultist!") fail_invoke() log_game("Raise Dead rune failed - too few sacrificed") @@ -705,8 +704,6 @@ var/list/teleport_runes = list() sleep(1) rune_in_use = 0 - -var/list/wall_runes = list() //Rite of the Corporeal Shield: When invoked, becomes solid and cannot be passed. Invoke again to undo. /obj/effect/rune/wall cultist_name = "Form Barrier" @@ -720,7 +717,7 @@ var/list/wall_runes = list() /obj/effect/rune/wall/New() ..() - wall_runes += src + GLOB.wall_runes += src /obj/effect/rune/wall/examine(mob/user) ..() @@ -729,7 +726,7 @@ var/list/wall_runes = list() /obj/effect/rune/wall/Destroy() density = 0 - wall_runes -= src + GLOB.wall_runes -= src air_update_turf(1) return ..() @@ -752,7 +749,7 @@ var/list/wall_runes = list() C.apply_damage(2, BRUTE, pick("l_arm", "r_arm")) /obj/effect/rune/wall/proc/spread_density() - for(var/R in wall_runes) + for(var/R in GLOB.wall_runes) var/obj/effect/rune/wall/W = R if(W.z == z && get_dist(src, W) <= 2 && !W.density && !W.recharging) W.density = TRUE diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index 2aa98c194cf8b..2876e80373bf1 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -125,7 +125,7 @@ /obj/item/weapon/paper/talisman/teleport/invoke(mob/living/user, successfuluse = 1) var/list/potential_runes = list() var/list/teleportnames = list() - for(var/R in teleport_runes) + for(var/R in GLOB.teleport_runes) var/obj/effect/rune/teleport/T = R potential_runes[avoid_assoc_duplicate_keys(T.listkey, teleportnames)] = T diff --git a/code/game/gamemodes/devil/devil.dm b/code/game/gamemodes/devil/devil.dm index 0aafc57ccb54d..b64ef5540628c 100644 --- a/code/game/gamemodes/devil/devil.dm +++ b/code/game/gamemodes/devil/devil.dm @@ -1,22 +1,3 @@ -var/global/list/whiteness = list ( - /obj/item/clothing/under/color/white = 2, - /obj/item/clothing/under/rank/bartender = 1, - /obj/item/clothing/under/rank/chef = 1, - /obj/item/clothing/under/rank/chief_engineer = 1, - /obj/item/clothing/under/rank/scientist = 1, - /obj/item/clothing/under/rank/chemist = 1, - /obj/item/clothing/under/rank/chief_medical_officer = 1, - /obj/item/clothing/under/rank/geneticist = 1, - /obj/item/clothing/under/rank/virologist = 1, - /obj/item/clothing/under/rank/nursesuit = 1, - /obj/item/clothing/under/rank/medical = 1, - /obj/item/clothing/under/rank/det = 1, - /obj/item/clothing/under/suit_jacket/white = 0.5, - /obj/item/clothing/under/burial = 1 -) - - - /mob/living/proc/check_devil_bane_multiplier(obj/item/weapon, mob/living/attacker) switch(mind.devilinfo.bane) if(BANE_WHITECLOTHES) @@ -24,6 +5,22 @@ var/global/list/whiteness = list ( var/mob/living/carbon/human/H = attacker if(H.w_uniform && istype(H.w_uniform, /obj/item/clothing/under)) var/obj/item/clothing/under/U = H.w_uniform + var/static/list/whiteness = list ( + /obj/item/clothing/under/color/white = 2, + /obj/item/clothing/under/rank/bartender = 1, + /obj/item/clothing/under/rank/chef = 1, + /obj/item/clothing/under/rank/chief_engineer = 1, + /obj/item/clothing/under/rank/scientist = 1, + /obj/item/clothing/under/rank/chemist = 1, + /obj/item/clothing/under/rank/chief_medical_officer = 1, + /obj/item/clothing/under/rank/geneticist = 1, + /obj/item/clothing/under/rank/virologist = 1, + /obj/item/clothing/under/rank/nursesuit = 1, + /obj/item/clothing/under/rank/medical = 1, + /obj/item/clothing/under/rank/det = 1, + /obj/item/clothing/under/suit_jacket/white = 0.5, + /obj/item/clothing/under/burial = 1 + ) if(whiteness[U.type]) src.visible_message("[src] seems to have been harmed by the purity of [attacker]'s clothes.", "Unsullied white clothing is disrupting your form.") return whiteness[U.type] + 1 diff --git a/code/game/gamemodes/devil/devilinfo.dm b/code/game/gamemodes/devil/devilinfo.dm index d7d2f79435831..ef9091891f04b 100644 --- a/code/game/gamemodes/devil/devilinfo.dm +++ b/code/game/gamemodes/devil/devilinfo.dm @@ -13,8 +13,8 @@ #define DEVILRESURRECTTIME 600 -var/global/list/allDevils = list() -var/global/list/lawlorify = list ( +GLOBAL_LIST_EMPTY(allDevils) +GLOBAL_LIST_INIT(lawlorify, list ( LORE = list( OBLIGATION_FOOD = "This devil seems to always offer its victims food before slaughtering them.", OBLIGATION_FIDDLE = "This devil will never turn down a musical challenge.", @@ -77,8 +77,7 @@ var/global/list/lawlorify = list ( BANISH_DESTRUCTION = "If your corpse is destroyed, you will be unable to resurrect.", BANISH_FUNERAL_GARB = "If your corpse is clad in funeral garments, you will be unable to resurrect." ) - ) - + )) /datum/devilinfo var/datum/mind/owner = null var/obligation @@ -112,11 +111,11 @@ var/global/list/lawlorify = list ( return devil /proc/devilInfo(name, saveDetails = 0) - if(allDevils[lowertext(name)]) - return allDevils[lowertext(name)] + if(GLOB.allDevils[lowertext(name)]) + return GLOB.allDevils[lowertext(name)] else var/datum/devilinfo/devil = randomDevilInfo(name) - allDevils[lowertext(name)] = devil + GLOB.allDevils[lowertext(name)] = devil devil.exists = saveDetails return devil @@ -415,8 +414,8 @@ var/global/list/lawlorify = list ( check_regression() /datum/devilinfo/proc/create_new_body() - if(blobstart.len > 0) - var/turf/targetturf = get_turf(pick(blobstart)) + if(GLOB.blobstart.len > 0) + var/turf/targetturf = get_turf(pick(GLOB.blobstart)) var/mob/currentMob = owner.current if(!currentMob) currentMob = owner.get_ghost() diff --git a/code/game/gamemodes/devil/game_mode.dm b/code/game/gamemodes/devil/game_mode.dm index a99e6abd83b7b..f311a289e0ce6 100644 --- a/code/game/gamemodes/devil/game_mode.dm +++ b/code/game/gamemodes/devil/game_mode.dm @@ -36,7 +36,7 @@ devil_mind.devilinfo = devilInfo(trueName, 1) devil_mind.devilinfo.ascendable = ascendable - devil_mind.store_memory("Your devilic true name is [devil_mind.devilinfo.truename]
[lawlorify[LAW][devil_mind.devilinfo.ban]]
You may not use violence to coerce someone into selling their soul.
You may not directly and knowingly physically harm a devil, other than yourself.
[lawlorify[LAW][devil_mind.devilinfo.bane]]
[lawlorify[LAW][devil_mind.devilinfo.obligation]]
[lawlorify[LAW][devil_mind.devilinfo.banish]]
") + devil_mind.store_memory("Your devilic true name is [devil_mind.devilinfo.truename]
[GLOB.lawlorify[LAW][devil_mind.devilinfo.ban]]
You may not use violence to coerce someone into selling their soul.
You may not directly and knowingly physically harm a devil, other than yourself.
[GLOB.lawlorify[LAW][devil_mind.devilinfo.bane]]
[GLOB.lawlorify[LAW][devil_mind.devilinfo.obligation]]
[GLOB.lawlorify[LAW][devil_mind.devilinfo.banish]]
") devil_mind.devilinfo.owner = devil_mind devil_mind.devilinfo.give_base_spells(1) spawn(10) @@ -67,10 +67,10 @@ to_chat(current, "However, your infernal form is not without weaknesses.") to_chat(current, "You may not use violence to coerce someone into selling their soul.") to_chat(current, "You may not directly and knowingly physically harm a devil, other than yourself.") - to_chat(current, lawlorify[LAW][src.devilinfo.bane]) - to_chat(current, lawlorify[LAW][src.devilinfo.ban]) - to_chat(current, lawlorify[LAW][src.devilinfo.obligation]) - to_chat(current, lawlorify[LAW][src.devilinfo.banish]) + to_chat(current, GLOB.lawlorify[LAW][src.devilinfo.bane]) + to_chat(current, GLOB.lawlorify[LAW][src.devilinfo.ban]) + to_chat(current, GLOB.lawlorify[LAW][src.devilinfo.obligation]) + to_chat(current, GLOB.lawlorify[LAW][src.devilinfo.banish]) to_chat(current, "

Remember, the crew can research your weaknesses if they find out your devil name.
") /datum/game_mode/proc/printdevilinfo(datum/mind/ply) @@ -78,38 +78,38 @@ return "Target is not a devil." var/text = "
The devil's true name is: [ply.devilinfo.truename]
" text += "The devil's bans were:
" - text += " [lawlorify[LORE][ply.devilinfo.ban]]
" - text += " [lawlorify[LORE][ply.devilinfo.bane]]
" - text += " [lawlorify[LORE][ply.devilinfo.obligation]]
" - text += " [lawlorify[LORE][ply.devilinfo.banish]]

" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.ban]]
" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.bane]]
" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.obligation]]
" + text += " [GLOB.lawlorify[LORE][ply.devilinfo.banish]]

" return text /datum/game_mode/proc/update_devil_icons_added(datum/mind/devil_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_DEVIL] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_DEVIL] hud.join_hud(devil_mind.current) set_antag_hud(devil_mind.current, "devil") /datum/game_mode/proc/update_devil_icons_removed(datum/mind/devil_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_DEVIL] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_DEVIL] hud.leave_hud(devil_mind.current) set_antag_hud(devil_mind.current, null) /datum/game_mode/proc/update_sintouched_icons_added(datum/mind/sintouched_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_SINTOUCHED] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED] hud.join_hud(sintouched_mind.current) set_antag_hud(sintouched_mind.current, "sintouched") /datum/game_mode/proc/update_sintouched_icons_removed(datum/mind/sintouched_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_SINTOUCHED] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SINTOUCHED] hud.leave_hud(sintouched_mind.current) set_antag_hud(sintouched_mind.current, null) /datum/game_mode/proc/update_soulless_icons_added(datum/mind/soulless_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_SOULLESS] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SOULLESS] hud.join_hud(soulless_mind.current) set_antag_hud(soulless_mind.current, "soulless") /datum/game_mode/proc/update_soulless_icons_removed(datum/mind/soulless_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_SOULLESS] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_SOULLESS] hud.leave_hud(soulless_mind.current) set_antag_hud(soulless_mind.current, null) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 05a96fe19ee6a..b3b428d471330 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -1,6 +1,6 @@ /proc/power_failure() priority_announce("Abnormal activity detected in [station_name()]'s powernet. As a precautionary measure, the station's power will be shut off for an indeterminate duration.", "Critical Power Failure", 'sound/AI/poweroff.ogg') - for(var/obj/machinery/power/smes/S in machines) + for(var/obj/machinery/power/smes/S in GLOB.machines) if(istype(get_area(S), /area/ai_monitored/turret_protected) || S.z != ZLEVEL_STATION) continue S.charge = 0 @@ -31,7 +31,7 @@ A.power_environ = 0 A.power_change() - for(var/obj/machinery/power/apc/C in apcs_list) + for(var/obj/machinery/power/apc/C in GLOB.apcs_list) if(C.cell && C.z == ZLEVEL_STATION) var/area/A = get_area(C) @@ -47,11 +47,11 @@ /proc/power_restore() priority_announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", 'sound/AI/poweron.ogg') - for(var/obj/machinery/power/apc/C in machines) + for(var/obj/machinery/power/apc/C in GLOB.machines) if(C.cell && C.z == ZLEVEL_STATION) C.cell.charge = C.cell.maxcharge C.failure_timer = 0 - for(var/obj/machinery/power/smes/S in machines) + for(var/obj/machinery/power/smes/S in GLOB.machines) if(S.z != ZLEVEL_STATION) continue S.charge = S.capacity @@ -69,7 +69,7 @@ /proc/power_restore_quick() priority_announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", 'sound/AI/poweron.ogg') - for(var/obj/machinery/power/smes/S in machines) + for(var/obj/machinery/power/smes/S in GLOB.machines) if(S.z != ZLEVEL_STATION) continue S.charge = S.capacity diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index b68d94d7f4ad8..64329e46f2570 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -53,14 +53,14 @@ ///Checks to see if the game can be setup and ran with the current number of players or whatnot. /datum/game_mode/proc/can_start() var/playerC = 0 - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) if((player.client)&&(player.ready)) playerC++ - if(!Debug2) + if(!GLOB.Debug2) if(playerC < required_players || (maximum_players >= 0 && playerC > maximum_players)) return 0 antag_candidates = get_players_for_role(antag_flag) - if(!Debug2) + if(!GLOB.Debug2) if(antag_candidates.len < required_enemies) return 0 return 1 @@ -84,15 +84,15 @@ feedback_set_details("round_start","[time2text(world.realtime)]") if(SSticker && SSticker.mode) feedback_set_details("game_mode","[SSticker.mode]") - if(revdata.commit) - feedback_set_details("revision","[revdata.commit]") + if(GLOB.revdata.commit) + feedback_set_details("revision","[GLOB.revdata.commit]") feedback_set_details("server_ip","[world.internet_address]:[world.port]") if(report) spawn (rand(waittime_l, waittime_h)) send_intercept(0) generate_station_goals() - start_state = new /datum/station_state() - start_state.count(1) + GLOB.start_state = new /datum/station_state() + GLOB.start_state.count(1) return 1 @@ -107,10 +107,10 @@ /datum/game_mode/proc/convert_roundtype() var/list/living_crew = list() - for(var/mob/Player in mob_list) + for(var/mob/Player in GLOB.mob_list) if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) &&!isbrain(Player)) living_crew += Player - if(living_crew.len / joined_player_list.len <= config.midround_antag_life_check) //If a lot of the player base died, we start fresh + if(living_crew.len / GLOB.joined_player_list.len <= config.midround_antag_life_check) //If a lot of the player base died, we start fresh message_admins("Convert_roundtype failed due to too many dead people. Limit is [config.midround_antag_life_check * 100]% living crew") return null @@ -183,7 +183,7 @@ return TRUE if(!round_converted && (!config.continuous[config_tag] || (config.continuous[config_tag] && config.midround_antag[config_tag]))) //Non-continuous or continous with replacement antags if(!continuous_sanity_checked) //make sure we have antags to be checking in the first place - for(var/mob/Player in mob_list) + for(var/mob/Player in GLOB.mob_list) if(Player.mind) if(Player.mind.special_role) continuous_sanity_checked = 1 @@ -199,7 +199,7 @@ if(living_antag_player && living_antag_player.mind && isliving(living_antag_player) && living_antag_player.stat != DEAD && !isnewplayer(living_antag_player) &&!isbrain(living_antag_player)) return 0 //A resource saver: once we find someone who has to die for all antags to be dead, we can just keep checking them, cycling over everyone only when we lose our mark. - for(var/mob/Player in living_mob_list) + for(var/mob/Player in GLOB.living_mob_list) if(Player.mind && Player.stat != DEAD && !isnewplayer(Player) &&!isbrain(Player)) if(Player.mind.special_role) //Someone's still antaging! living_antag_player = Player @@ -228,7 +228,7 @@ var/escaped_humans = 0 var/escaped_total = 0 - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.client) clients++ if(ishuman(M)) @@ -291,7 +291,7 @@ print_command_report(intercepttext, "Central Command Status Summary", announce=FALSE) priority_announce("A summary has been copied and printed to all communications consoles.", "Enemy communication intercepted. Security level elevated.", 'sound/AI/intercept.ogg') - if(security_level < SEC_LEVEL_BLUE) + if(GLOB.security_level < SEC_LEVEL_BLUE) set_security_level(SEC_LEVEL_BLUE) @@ -302,7 +302,7 @@ var/datum/mind/applicant = null // Ultimate randomizing code right here - for(var/mob/dead/new_player/player in player_list) + for(var/mob/dead/new_player/player in GLOB.player_list) if(player.client && player.ready) players += player @@ -385,7 +385,7 @@ /datum/game_mode/proc/num_players() . = 0 - for(var/mob/dead/new_player/P in player_list) + for(var/mob/dead/new_player/P in GLOB.player_list) if(P.client && P.ready) . ++ @@ -394,8 +394,8 @@ /////////////////////////////////// /datum/game_mode/proc/get_living_heads() . = list() - for(var/mob/living/carbon/human/player in mob_list) - if(player.stat != DEAD && player.mind && (player.mind.assigned_role in command_positions)) + for(var/mob/living/carbon/human/player in GLOB.mob_list) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in GLOB.command_positions)) . |= player.mind @@ -404,8 +404,8 @@ //////////////////////////// /datum/game_mode/proc/get_all_heads() . = list() - for(var/mob/player in mob_list) - if(player.mind && (player.mind.assigned_role in command_positions)) + for(var/mob/player in GLOB.mob_list) + if(player.mind && (player.mind.assigned_role in GLOB.command_positions)) . |= player.mind ////////////////////////////////////////////// @@ -413,8 +413,8 @@ ////////////////////////////////////////////// /datum/game_mode/proc/get_living_sec() . = list() - for(var/mob/living/carbon/human/player in mob_list) - if(player.stat != DEAD && player.mind && (player.mind.assigned_role in security_positions)) + for(var/mob/living/carbon/human/player in GLOB.mob_list) + if(player.stat != DEAD && player.mind && (player.mind.assigned_role in GLOB.security_positions)) . |= player.mind //////////////////////////////////////// @@ -422,8 +422,8 @@ //////////////////////////////////////// /datum/game_mode/proc/get_all_sec() . = list() - for(var/mob/living/carbon/human/player in mob_list) - if(player.mind && (player.mind.assigned_role in security_positions)) + for(var/mob/living/carbon/human/player in GLOB.mob_list) + if(player.mind && (player.mind.assigned_role in GLOB.security_positions)) . |= player.mind ////////////////////////// @@ -431,11 +431,11 @@ ////////////////////////// /proc/display_roundstart_logout_report() var/msg = "Roundstart logout report\n\n" - for(var/mob/living/L in mob_list) + for(var/mob/living/L in GLOB.mob_list) if(L.ckey) var/found = 0 - for(var/client/C in clients) + for(var/client/C in GLOB.clients) if(C.ckey == L.ckey) found = 1 break @@ -459,7 +459,7 @@ continue //Dead continue //Happy connected client - for(var/mob/dead/observer/D in mob_list) + for(var/mob/dead/observer/D in GLOB.mob_list) if(D.mind && D.mind.current == L) if(L.stat == DEAD) if(L.suiciding) //Suicider @@ -477,7 +477,7 @@ - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.client && M.client.holder) to_chat(M, msg) diff --git a/code/game/gamemodes/gang/dominator.dm b/code/game/gamemodes/gang/dominator.dm index 7e970272313a9..1e48e69d39911 100644 --- a/code/game/gamemodes/gang/dominator.dm +++ b/code/game/gamemodes/gang/dominator.dm @@ -22,7 +22,7 @@ /obj/machinery/dominator/New() ..() set_light(2) - poi_list |= src + GLOB.poi_list |= src spark_system = new spark_system.set_up(5, 1, src) countdown = new(src) @@ -127,7 +127,7 @@ /obj/machinery/dominator/Destroy() if(!(stat & BROKEN)) set_broken() - poi_list.Remove(src) + GLOB.poi_list.Remove(src) gang = null qdel(spark_system) qdel(countdown) @@ -161,7 +161,7 @@ return var/time = round(determine_domination_time(tempgang)/60,0.1) - if(alert(user,"With [round((tempgang.territory.len/start_state.num_territories)*100, 1)]% station control, a takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm","Ready","Later") == "Ready") + if(alert(user,"With [round((tempgang.territory.len/GLOB.start_state.num_territories)*100, 1)]% station control, a takeover will require [time] minutes.\nYour gang will be unable to gain influence while it is active.\nThe entire station will likely be alerted to it once it starts.\nYou have [tempgang.dom_attempts] attempt(s) remaining. Are you ready?","Confirm","Ready","Later") == "Ready") if((tempgang.is_dominating) || !tempgang.dom_attempts || !in_range(src, user) || !isturf(loc)) return 0 diff --git a/code/game/gamemodes/gang/gang.dm b/code/game/gamemodes/gang/gang.dm index 9ed2610efad3a..51a9d21195701 100644 --- a/code/game/gamemodes/gang/gang.dm +++ b/code/game/gamemodes/gang/gang.dm @@ -1,8 +1,8 @@ //gang.dm //Gang War Game Mode -var/list/gang_name_pool = list("Clandestine", "Prima", "Zero-G", "Max", "Blasto", "Waffle", "North", "Omni", "Newton", "Cyber", "Donk", "Gene", "Gib", "Tunnel", "Diablo", "Psyke", "Osiron", "Sirius", "Sleeping Carp") -var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple") +GLOBAL_LIST_INIT(gang_name_pool, list("Clandestine", "Prima", "Zero-G", "Max", "Blasto", "Waffle", "North", "Omni", "Newton", "Cyber", "Donk", "Gene", "Gib", "Tunnel", "Diablo", "Psyke", "Osiron", "Sirius", "Sleeping Carp")) +GLOBAL_LIST_INIT(gang_colors_pool, list("red","orange","yellow","green","blue","purple")) /datum/game_mode var/list/datum/gang/gangs = list() @@ -248,7 +248,7 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple" return gang_bosses /proc/determine_domination_time(var/datum/gang/G) - return max(180,900 - (round((G.territory.len/start_state.num_territories)*100, 1) * 12)) + return max(180,900 - (round((G.territory.len/GLOB.start_state.num_territories)*100, 1) * 12)) ////////////////////////////////////////////////////////////////////// //Announces the end of the game with all relavent information stated// @@ -269,7 +269,7 @@ var/list/gang_colors_pool = list("red","orange","yellow","green","blue","purple" SSticker.news_report = GANG_TAKEOVER for(var/datum/gang/G in gangs) - var/text = "The [G.name] Gang was [winner==G ? "victorious" : "defeated"] with [round((G.territory.len/start_state.num_territories)*100, 1)]% control of the station!" + var/text = "The [G.name] Gang was [winner==G ? "victorious" : "defeated"] with [round((G.territory.len/GLOB.start_state.num_territories)*100, 1)]% control of the station!" text += "
The [G.name] Gang Bosses were:" for(var/datum/mind/boss in G.bosses) text += printplayer(boss, 1) diff --git a/code/game/gamemodes/gang/gang_datum.dm b/code/game/gamemodes/gang/gang_datum.dm index db7f17085f538..3c54d5436b7f8 100644 --- a/code/game/gamemodes/gang/gang_datum.dm +++ b/code/game/gamemodes/gang/gang_datum.dm @@ -42,13 +42,13 @@ ) /datum/gang/New(loc,gangname) - if(!gang_colors_pool.len) + if(!GLOB.gang_colors_pool.len) message_admins("WARNING: Maximum number of gangs have been exceeded!") throw EXCEPTION("Maximum number of gangs has been exceeded") return else - color = pick(gang_colors_pool) - gang_colors_pool -= color + color = pick(GLOB.gang_colors_pool) + GLOB.gang_colors_pool -= color switch(color) if("red") color_hex = "#DA0000" @@ -63,8 +63,8 @@ if("purple") color_hex = "#DA00FF" - name = (gangname ? gangname : pick(gang_name_pool)) - gang_name_pool -= name + name = (gangname ? gangname : pick(GLOB.gang_name_pool)) + GLOB.gang_name_pool -= name ganghud = new() ganghud.color = color_hex @@ -240,7 +240,7 @@ territory_new = list() territory_lost = list() - var/control = round((territory.len/start_state.num_territories)*100, 1) + var/control = round((territory.len/GLOB.start_state.num_territories)*100, 1) message += "Your gang now has [control]% control of the station.
*---------*" message_gangtools(message) diff --git a/code/game/gamemodes/gang/recaller.dm b/code/game/gamemodes/gang/recaller.dm index 3b2a317d349b2..0885b3261226b 100644 --- a/code/game/gamemodes/gang/recaller.dm +++ b/code/game/gamemodes/gang/recaller.dm @@ -47,7 +47,7 @@ var/isboss = (user.mind == gang.bosses[1]) dat += "Registration: [gang.name] Gang [isboss ? "Boss" : "Lieutenant"]
" - dat += "Organization Size: [gang.gangsters.len + gang.bosses.len] | Station Control: [round((gang.territory.len/start_state.num_territories)*100, 1)]%
" + dat += "Organization Size: [gang.gangsters.len + gang.bosses.len] | Station Control: [round((gang.territory.len/GLOB.start_state.num_territories)*100, 1)]%
" dat += "Gang Influence: [gang.points]
" dat += "Time until Influence grows: [(gang.points >= 999) ? ("--:--") : (time2text(SSticker.mode.gang_points.next_point_time - world.time, "mm:ss"))]
" dat += "
" @@ -131,7 +131,7 @@ for(var/datum/mind/ganger in members) if(ganger.current && (ganger.current.z <= 2) && (ganger.current.stat == CONSCIOUS)) to_chat(ganger.current, ping) - for(var/mob/M in dead_mob_list) + for(var/mob/M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, user) to_chat(M, "[link] [ping]") log_game("[key_name(user)] Messaged [gang.name] Gang: [message].") @@ -195,7 +195,7 @@ return 0 var/datum/station_state/end_state = new /datum/station_state() end_state.count() - if((100 * start_state.score(end_state)) < 80) //Shuttle cannot be recalled if the station is too damaged + if((100 * GLOB.start_state.score(end_state)) < 80) //Shuttle cannot be recalled if the station is too damaged to_chat(user, "\icon[src]Error: Station communication systems compromised. Unable to establish connection.") recalling = 0 return 0 diff --git a/code/game/gamemodes/intercept_report.dm b/code/game/gamemodes/intercept_report.dm index 826046328d492..48d58200e2260 100644 --- a/code/game/gamemodes/intercept_report.dm +++ b/code/game/gamemodes/intercept_report.dm @@ -51,7 +51,7 @@ text += "Although more specific threats are commonplace, you should always remain vigilant for Syndicate agents aboard your station. Syndicate communications have implied that many \ Nanotrasen employees are Syndicate agents with hidden memories that may be activated at a moment's notice, so it's possible that these agents might not even know their positions." if("wizard") - text += "A dangerous Wizards' Federation individual by the name of [pick(wizard_first)] [pick(wizard_second)] has recently escaped confinement from an unlisted prison facility. This \ + text += "A dangerous Wizards' Federation individual by the name of [pick(GLOB.wizard_first)] [pick(GLOB.wizard_second)] has recently escaped confinement from an unlisted prison facility. This \ man is a dangerous mutant with the ability to alter himself and the world around him by what he and his leaders believe to be magic. If this man attempts an attack on your station, \ his execution is highly encouraged, as is the preservation of his body for later study." return text diff --git a/code/game/gamemodes/malfunction/Malf_Modules.dm b/code/game/gamemodes/malfunction/Malf_Modules.dm index 311286d6ec958..d581af11b9472 100644 --- a/code/game/gamemodes/malfunction/Malf_Modules.dm +++ b/code/game/gamemodes/malfunction/Malf_Modules.dm @@ -42,7 +42,7 @@ doomsday_device = DOOM doomsday_device.start() verbs -= /mob/living/silicon/ai/proc/nuke_station - for(var/obj/item/weapon/pinpointer/P in pinpointer_list) + for(var/obj/item/weapon/pinpointer/P in GLOB.pinpointer_list) P.switch_mode_to(TRACK_MALF_AI) //Pinpointers start tracking the AI wherever it goes /obj/machinery/doomsday_device @@ -70,7 +70,7 @@ STOP_PROCESSING(SSfastprocess, src) SSshuttle.clearHostileEnvironment(src) SSmapping.remove_nuke_threat(src) - for(var/A in ai_list) + for(var/A in GLOB.ai_list) var/mob/living/silicon/ai/Mlf = A if(Mlf.doomsday_device == src) Mlf.doomsday_device = null @@ -108,10 +108,10 @@ minor_announce(message, "ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4", 1) /obj/machinery/doomsday_device/proc/detonate(z_level = 1) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) M << 'sound/machines/Alarm.ogg' sleep(100) - for(var/mob/living/L in mob_list) + for(var/mob/living/L in GLOB.mob_list) var/turf/T = get_turf(L) if(!T || T.z != z_level) continue @@ -140,7 +140,7 @@ src.verbs -= /mob/living/silicon/ai/proc/upgrade_turrets //Upgrade AI turrets around the world - for(var/obj/machinery/porta_turret/ai/turret in machines) + for(var/obj/machinery/porta_turret/ai/turret in GLOB.machines) turret.obj_integrity += 30 turret.lethal_projectile = /obj/item/projectile/beam/laser/heavylaser //Once you see it, you will know what it means to FEAR. turret.lethal_projectile_sound = 'sound/weapons/lasercannonfire.ogg' @@ -162,13 +162,13 @@ if(!canUseTopic()) return - for(var/obj/machinery/door/D in airlocks) + for(var/obj/machinery/door/D in GLOB.airlocks) if(D.z != ZLEVEL_STATION) continue INVOKE_ASYNC(D, /obj/machinery/door.proc/hostile_lockdown, src) addtimer(CALLBACK(D, /obj/machinery/door.proc/disable_lockdown), 900) - var/obj/machinery/computer/communications/C = locate() in machines + var/obj/machinery/computer/communications/C = locate() in GLOB.machines if(C) C.post_status("alert", "lockdown") @@ -196,7 +196,7 @@ if(!canUseTopic() || malf_cooldown) return - for(var/I in rcd_list) + for(var/I in GLOB.rcd_list) if(!istype(I, /obj/item/weapon/rcd/borg)) //Ensures that cyborg RCDs are spared. var/obj/item/weapon/rcd/RCD = I RCD.detonate_pulse() @@ -243,7 +243,7 @@ if(!canUseTopic()) return - for(var/obj/machinery/firealarm/F in machines) + for(var/obj/machinery/firealarm/F in GLOB.machines) if(F.z != ZLEVEL_STATION) continue F.emagged = 1 @@ -267,7 +267,7 @@ if(!canUseTopic()) return - for(var/obj/machinery/airalarm/AA in machines) + for(var/obj/machinery/airalarm/AA in GLOB.machines) if(AA.z != ZLEVEL_STATION) continue AA.emagged = 1 @@ -283,7 +283,7 @@ power_type = /mob/living/silicon/ai/proc/overload_machine -/mob/living/silicon/ai/proc/overload_machine(obj/machinery/M in machines) +/mob/living/silicon/ai/proc/overload_machine(obj/machinery/M in GLOB.machines) set name = "Overload Machine" set category = "Malfunction" @@ -313,7 +313,7 @@ power_type = /mob/living/silicon/ai/proc/override_machine -/mob/living/silicon/ai/proc/override_machine(obj/machinery/M in machines) +/mob/living/silicon/ai/proc/override_machine(obj/machinery/M in GLOB.machines) set name = "Override Machine" set category = "Malfunction" @@ -383,7 +383,7 @@ var/turf/T = turfs[n] if(!isfloorturf(T)) fail = 1 - var/datum/camerachunk/C = cameranet.getCameraChunk(T.x, T.y, T.z) + var/datum/camerachunk/C = GLOB.cameranet.getCameraChunk(T.x, T.y, T.z) if(!C.visibleTurfs[T]) alert_msg = "We cannot get camera vision of this location." fail = 1 @@ -424,7 +424,7 @@ for(var/datum/AI_Module/small/blackout/blackout in current_modules) if(blackout.uses > 0) blackout.uses -- - for(var/obj/machinery/power/apc/apc in machines) + for(var/obj/machinery/power/apc/apc in GLOB.machines) if(prob(30*apc.overload)) apc.overload_lighting() else apc.overload++ @@ -450,7 +450,7 @@ var/fixedcams = 0 //Tells the AI how many cams it fixed. Stats are fun. for(var/datum/AI_Module/small/reactivate_cameras/camera in current_modules) - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) var/initial_range = initial(C.view_range) //To prevent calling the proc twice if(camera.uses > 0) if(!C.status) @@ -493,14 +493,14 @@ see_override = SEE_INVISIBLE_MINIMUM //Night-vision, without which X-ray would be very limited in power. update_sight() - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(C.assembly) var/upgraded = 0 if(!C.isXRay()) C.upgradeXRay() //Update what it can see. - cameranet.updateVisibility(C, 0) + GLOB.cameranet.updateVisibility(C, 0) upgraded = 1 if(!C.isEmpProof()) diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index 57541f8ece3df..7897e86a02636 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -11,18 +11,18 @@ /datum/game_mode/meteor/process() - if(nometeors || meteordelay > world.time - round_start_time) + if(nometeors || meteordelay > world.time - SSticker.round_start_time) return - var/list/wavetype = meteors_normal - var/meteorminutes = (world.time - round_start_time - meteordelay) / 10 / 60 + var/list/wavetype = GLOB.meteors_normal + var/meteorminutes = (world.time - SSticker.round_start_time - meteordelay) / 10 / 60 if (prob(meteorminutes)) - wavetype = meteors_threatening + wavetype = GLOB.meteors_threatening if (prob(meteorminutes/2)) - wavetype = meteors_catastrophic + wavetype = GLOB.meteors_catastrophic var/ramp_up_final = Clamp(round(meteorminutes/rampupdelta), 1, 10) @@ -33,7 +33,7 @@ var/text var/survivors = 0 - for(var/mob/living/player in player_list) + for(var/mob/living/player in GLOB.player_list) if(player.stat != DEAD) ++survivors diff --git a/code/game/gamemodes/meteor/meteors.dm b/code/game/gamemodes/meteor/meteors.dm index 3f3f0e57cccde..8f90cd892dac5 100644 --- a/code/game/gamemodes/meteor/meteors.dm +++ b/code/game/gamemodes/meteor/meteors.dm @@ -1,20 +1,20 @@ #define DEFAULT_METEOR_LIFETIME 1800 -/var/const/meteor_wave_delay = 625 //minimum wait between waves in tenths of seconds +GLOBAL_VAR_INIT(meteor_wave_delay, 625) //minimum wait between waves in tenths of seconds //set to at least 100 unless you want evarr ruining every round //Meteors probability of spawning during a given wave -/var/list/meteors_normal = list(/obj/effect/meteor/dust=3, /obj/effect/meteor/medium=8, /obj/effect/meteor/big=3, \ - /obj/effect/meteor/flaming=1, /obj/effect/meteor/irradiated=3) //for normal meteor event +GLOBAL_LIST_INIT(meteors_normal, list(/obj/effect/meteor/dust=3, /obj/effect/meteor/medium=8, /obj/effect/meteor/big=3, \ + /obj/effect/meteor/flaming=1, /obj/effect/meteor/irradiated=3)) //for normal meteor event -/var/list/meteors_threatening = list(/obj/effect/meteor/medium=4, /obj/effect/meteor/big=8, \ - /obj/effect/meteor/flaming=3, /obj/effect/meteor/irradiated=3) //for threatening meteor event +GLOBAL_LIST_INIT(meteors_threatening, list(/obj/effect/meteor/medium=4, /obj/effect/meteor/big=8, \ + /obj/effect/meteor/flaming=3, /obj/effect/meteor/irradiated=3)) //for threatening meteor event -/var/list/meteors_catastrophic = list(/obj/effect/meteor/medium=5, /obj/effect/meteor/big=75, \ - /obj/effect/meteor/flaming=10, /obj/effect/meteor/irradiated=10, /obj/effect/meteor/tunguska = 1) //for catastrophic meteor event +GLOBAL_LIST_INIT(meteors_catastrophic, list(/obj/effect/meteor/medium=5, /obj/effect/meteor/big=75, \ + /obj/effect/meteor/flaming=10, /obj/effect/meteor/irradiated=10, /obj/effect/meteor/tunguska = 1)) //for catastrophic meteor event -/var/list/meteorsB = list(/obj/effect/meteor/meaty=5, /obj/effect/meteor/meaty/xeno=1) //for meaty ore event +GLOBAL_LIST_INIT(meteorsB, list(/obj/effect/meteor/meaty=5, /obj/effect/meteor/meaty/xeno=1)) //for meaty ore event -/var/list/meteorsC = list(/obj/effect/meteor/dust) //for space dust event +GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event /////////////////////////////// @@ -30,7 +30,7 @@ var/turf/pickedgoal var/max_i = 10//number of tries to spawn meteor. while(!isspaceturf(pickedstart)) - var/startSide = pick(cardinal) + var/startSide = pick(GLOB.cardinal) pickedstart = spaceDebrisStartLoc(startSide, 1) pickedgoal = spaceDebrisFinishLoc(startSide, 1) max_i-- @@ -118,13 +118,13 @@ get_hit() /obj/effect/meteor/Destroy() - meteor_list -= src + GLOB.meteor_list -= src walk(src,0) //this cancels the walk_towards() proc . = ..() /obj/effect/meteor/New() ..() - meteor_list += src + GLOB.meteor_list += src if(SSaugury) SSaugury.register_doom(src, threat) SpinAnimation() @@ -185,7 +185,7 @@ /obj/effect/meteor/proc/meteor_effect() if(heavy) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if((M.orbiting) && (SSaugury.watchers[M])) continue var/turf/T = get_turf(M) @@ -343,7 +343,7 @@ //Spookoween meteors ///////////////////////// -/var/list/meteorsSPOOKY = list(/obj/effect/meteor/pumpkin) +GLOBAL_LIST_INIT(meteorsSPOOKY, list(/obj/effect/meteor/pumpkin)) /obj/effect/meteor/pumpkin name = "PUMPKING" diff --git a/code/game/gamemodes/miniantags/abduction/abduction.dm b/code/game/gamemodes/miniantags/abduction/abduction.dm index c1b0998a592e9..aa5a688596e3c 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction.dm @@ -43,7 +43,7 @@ /datum/game_mode/abduction/proc/make_abductor_team(team_number,preset_agent=null,preset_scientist=null) //Team Name - team_names[team_number] = "Mothership [pick(possible_changeling_IDs)]" //TODO Ensure unique and actual alieny names + team_names[team_number] = "Mothership [pick(GLOB.possible_changeling_IDs)]" //TODO Ensure unique and actual alieny names //Team Objective var/datum/objective/experiment/team_objective = new team_objective.team = team_number @@ -90,7 +90,7 @@ var/list/obj/effect/landmark/abductor/scientist_landmarks = new agent_landmarks.len = max_teams scientist_landmarks.len = max_teams - for(var/obj/effect/landmark/abductor/A in landmarks_list) + for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list) if(istype(A,/obj/effect/landmark/abductor/agent)) agent_landmarks[text2num(A.team)] = A else if(istype(A,/obj/effect/landmark/abductor/scientist)) @@ -137,7 +137,7 @@ var/list/obj/effect/landmark/abductor/scientist_landmarks = new agent_landmarks.len = max_teams scientist_landmarks.len = max_teams - for(var/obj/effect/landmark/abductor/A in landmarks_list) + for(var/obj/effect/landmark/abductor/A in GLOB.landmarks_list) if(istype(A,/obj/effect/landmark/abductor/agent)) agent_landmarks[text2num(A.team)] = A else if(istype(A,/obj/effect/landmark/abductor/scientist)) @@ -201,7 +201,7 @@ abductor.announce_objectives() /datum/game_mode/abduction/proc/equip_common(mob/living/carbon/human/agent,team_number) - var/radio_freq = SYND_FREQ + var/radio_freq = GLOB.SYND_FREQ var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate/alt(agent) R.set_frequency(radio_freq) @@ -212,7 +212,7 @@ /datum/game_mode/abduction/proc/get_team_console(team) var/obj/machinery/abductor/console/console - for(var/obj/machinery/abductor/console/c in machines) + for(var/obj/machinery/abductor/console/c in GLOB.machines) if(c.team == team) console = c break @@ -319,7 +319,7 @@ return 0 var/datum/species/abductor/S = H.dna.species ab_team = S.team - for(var/obj/machinery/abductor/experiment/E in machines) + for(var/obj/machinery/abductor/experiment/E in GLOB.machines) if(E.team == ab_team) if(E.points >= target_amount) return 1 @@ -328,12 +328,12 @@ return 0 /datum/game_mode/proc/update_abductor_icons_added(datum/mind/alien_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_ABDUCTOR] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR] hud.join_hud(alien_mind.current) set_antag_hud(alien_mind.current, ((alien_mind in abductors) ? "abductor" : "abductee")) /datum/game_mode/proc/update_abductor_icons_removed(datum/mind/alien_mind) - var/datum/atom_hud/antag/hud = huds[ANTAG_HUD_ABDUCTOR] + var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_ABDUCTOR] hud.leave_hud(alien_mind.current) set_antag_hud(alien_mind.current, null) @@ -428,7 +428,7 @@ explanation_text = "Call forth a spirit from the other side." /datum/objective/abductee/calling/New() - var/mob/dead/D = pick(dead_mob_list) + var/mob/dead/D = pick(GLOB.dead_mob_list) if(D) explanation_text = "You know that [D] has perished. Hold a seance to call them from the spirit realm." diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index b5f946b18c211..f735bf253cad7 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -389,7 +389,7 @@ Congratulations! You are now trained for invasive xenobiology research!"} if(ishuman(L)) var/mob/living/carbon/human/H = L - H.forcesay(hit_appends) + H.forcesay(GLOB.hit_appends) add_logs(user, L, "stunned") diff --git a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm index 832674d565315..4bbdd0ca184ee 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/camera.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/camera.dm @@ -91,7 +91,7 @@ var/mob/camera/aiEye/remote/remote_eye = C.remote_control var/obj/machinery/abductor/pad/P = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) P.PadToLoc(remote_eye.loc) /datum/action/innate/teleport_out @@ -116,7 +116,7 @@ var/mob/camera/aiEye/remote/remote_eye = C.remote_control var/obj/machinery/abductor/pad/P = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) P.MobToLoc(remote_eye.loc,C) /datum/action/innate/vest_mode_swap diff --git a/code/game/gamemodes/miniantags/abduction/machinery/console.dm b/code/game/gamemodes/miniantags/abduction/machinery/console.dm index 8c4f390f778d8..2a23c3744470e 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/console.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/console.dm @@ -142,17 +142,17 @@ if(!team) return - for(var/obj/machinery/abductor/pad/p in machines) + for(var/obj/machinery/abductor/pad/p in GLOB.machines) if(p.team == team) pad = p break - for(var/obj/machinery/abductor/experiment/e in machines) + for(var/obj/machinery/abductor/experiment/e in GLOB.machines) if(e.team == team) experiment = e e.console = src - for(var/obj/machinery/computer/camera_advanced/abductor/c in machines) + for(var/obj/machinery/computer/camera_advanced/abductor/c in GLOB.machines) if(c.team == team) camera = c c.console = src diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm index 72ee6a841f0be..193aecd9cead9 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm @@ -74,13 +74,13 @@ eyes.Blend("#[H.eye_color]", ICON_MULTIPLY) var/datum/sprite_accessory/S - S = hair_styles_list[H.hair_style] + S = GLOB.hair_styles_list[H.hair_style] if(S && (HAIR in H.dna.species.species_traits)) var/icon/hair = icon("icon" = S.icon, "icon_state" = "[S.icon_state]") hair.Blend("#[H.hair_color]", ICON_MULTIPLY) eyes.Blend(hair, ICON_OVERLAY) - S = facial_hair_styles_list[H.facial_hair_style] + S = GLOB.facial_hair_styles_list[H.facial_hair_style] if(S && (FACEHAIR in H.dna.species.species_traits)) var/icon/facial = icon("icon" = S.icon, "icon_state" = "[S.icon_state]") facial.Blend("#[H.facial_hair_color]", ICON_MULTIPLY) @@ -213,7 +213,7 @@ H.uncuff() return //Area not chosen / It's not safe area - teleport to arrivals - H.forceMove(pick(latejoin)) + H.forceMove(pick(GLOB.latejoin)) H.uncuff() return diff --git a/code/game/gamemodes/miniantags/abduction/machinery/pad.dm b/code/game/gamemodes/miniantags/abduction/machinery/pad.dm index 57301ee31969d..5f8ad3de9d6d2 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/pad.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/pad.dm @@ -12,7 +12,7 @@ /obj/machinery/abductor/pad/proc/Send() if(teleport_target == null) - teleport_target = teleportlocs[pick(teleportlocs)] + teleport_target = GLOB.teleportlocs[pick(GLOB.teleportlocs)] flick("alien-pad", src) for(var/mob/living/target in loc) target.forceMove(teleport_target) diff --git a/code/game/gamemodes/miniantags/borer/borer.dm b/code/game/gamemodes/miniantags/borer/borer.dm index e926ee847b05a..8bde9a6a2148f 100644 --- a/code/game/gamemodes/miniantags/borer/borer.dm +++ b/code/game/gamemodes/miniantags/borer/borer.dm @@ -24,7 +24,7 @@ to_chat(src, "You whisper silently, \"[message]\"") to_chat(B.victim, "The captive mind of [src] whispers, \"[message]\"") - for (var/mob/M in player_list) + for (var/mob/M in GLOB.player_list) if(isnewplayer(M)) continue else if(M.stat == 2 && M.client.prefs.toggles & CHAT_GHOSTEARS) @@ -52,8 +52,8 @@ to_chat(B.victim, "You feel control of the host brain ripped from your grasp, and retract your probosci before the wild neural impulses can damage you.") B.detatch() -var/list/mob/living/simple_animal/borer/borers = list() -var/total_borer_hosts_needed = 10 +GLOBAL_LIST_EMPTY(borers) +GLOBAL_VAR_INIT(total_borer_hosts_needed, 10) /mob/living/simple_animal/borer name = "cortical borer" @@ -129,12 +129,12 @@ var/total_borer_hosts_needed = 10 borer_chems += /datum/borer_chem/ethanol borer_chems += /datum/borer_chem/rezadone - borers += src + GLOB.borers += src GrantBorerActions() /mob/living/simple_animal/borer/Destroy() - borers -= src + GLOB.borers -= src host_brain = null victim = null @@ -205,7 +205,7 @@ var/total_borer_hosts_needed = 10 if(victim) to_chat(victim, "[truename] [say_string]: [input]") log_say("Borer Communication: [key_name(src)] -> [key_name(victim)] : [input]") - for(var/M in dead_mob_list) + for(var/M in GLOB.dead_mob_list) if(isobserver(M)) var/rendered = "Borer Communication from [truename] : [input]" var/link = FOLLOW_LINK(M, src) @@ -231,7 +231,7 @@ var/total_borer_hosts_needed = 10 to_chat(B, "[src] says: [input]") log_say("Borer Communication: [key_name(src)] -> [key_name(B)] : [input]") - for(var/M in dead_mob_list) + for(var/M in GLOB.dead_mob_list) if(isobserver(M)) var/rendered = "Borer Communication from [src] : [input]" var/link = FOLLOW_LINK(M, src) @@ -255,7 +255,7 @@ var/total_borer_hosts_needed = 10 to_chat(CB, "[B.truename] says: [input]") log_say("Borer Communication: [key_name(B)] -> [key_name(CB)] : [input]") - for(var/M in dead_mob_list) + for(var/M in GLOB.dead_mob_list) if(isobserver(M)) var/rendered = "Borer Communication from [B] : [input]" var/link = FOLLOW_LINK(M, src) @@ -320,9 +320,9 @@ var/total_borer_hosts_needed = 10 /mob/living/simple_animal/borer/say(message) if(dd_hasprefix(message, ";")) message = copytext(message,2) - for(var/borer in borers) + for(var/borer in GLOB.borers) to_chat(borer, "Cortical Link: [truename] sings, \"[message]\"") - for(var/mob/D in dead_mob_list) + for(var/mob/D in GLOB.dead_mob_list) to_chat(D, "Cortical Link: [truename] sings, \"[message]\"") return if(!victim) @@ -832,13 +832,13 @@ var/total_borer_hosts_needed = 10 ckey = candidate.ckey if(mind) - mind.store_memory("You must escape with at least [total_borer_hosts_needed] borers with hosts on the shuttle.") + mind.store_memory("You must escape with at least [GLOB.total_borer_hosts_needed] borers with hosts on the shuttle.") to_chat(src, "You are a cortical borer!") to_chat(src, "You are a brain slug that worms its way into the head of its victim. Use stealth, persuasion and your powers of mind control to keep you, your host and your eventual spawn safe and warm.") to_chat(src, "Sugar nullifies your abilities, avoid it at all costs!") to_chat(src, "You can speak to your fellow borers by prefixing your messages with ';'. Check out your Borer tab to see your abilities.") - to_chat(src, "You must escape with at least [total_borer_hosts_needed] borers with hosts on the shuttle. To reproduce you must have 100 chemicals and be controlling a host.") + to_chat(src, "You must escape with at least [GLOB.total_borer_hosts_needed] borers with hosts on the shuttle. To reproduce you must have 100 chemicals and be controlling a host.") /mob/living/simple_animal/borer/proc/detatch() if(!victim || !controlling) diff --git a/code/game/gamemodes/miniantags/borer/borer_event.dm b/code/game/gamemodes/miniantags/borer/borer_event.dm index 73bea41a528bf..45470bc96c858 100644 --- a/code/game/gamemodes/miniantags/borer/borer_event.dm +++ b/code/game/gamemodes/miniantags/borer/borer_event.dm @@ -23,7 +23,7 @@ /datum/round_event/borer/start() var/list/vents = list() - for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in machines) + for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in GLOB.machines) if(QDELETED(temp_vent)) continue if(temp_vent.loc.z == ZLEVEL_STATION && !temp_vent.welded) @@ -36,11 +36,11 @@ return kill() var/total_humans = 0 - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) if(H.stat != DEAD) total_humans++ - total_borer_hosts_needed = round(1 + total_humans/6) + GLOB.total_borer_hosts_needed = round(1 + total_humans/6) while(spawncount >= 1 && vents.len) var/obj/vent = pick_n_take(vents) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm index f424b225f04c5..6ce04bed14164 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer.dm @@ -120,7 +120,7 @@ /mob/living/simple_animal/hostile/swarmer/Initialize() ..() verbs -= /mob/living/verb/pulled - var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC] diag_hud.add_to_hud(src) @@ -664,7 +664,7 @@ /mob/living/simple_animal/hostile/swarmer/proc/swarmer_chat(msg) var/rendered = "Swarm communication - [src] [say_quote(msg, get_spans())]" - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(isswarmer(M)) to_chat(M, rendered) if(isobserver(M)) diff --git a/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm b/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm index fbf0e1676bc44..90e1befd084f8 100644 --- a/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm +++ b/code/game/gamemodes/miniantags/bot_swarm/swarmer_event.dm @@ -13,9 +13,9 @@ /datum/round_event/spawn_swarmer/start() if(find_swarmer()) return 0 - if(!the_gateway) + if(!GLOB.the_gateway) return 0 - new /obj/item/device/unactivated_swarmer(get_turf(the_gateway)) + new /obj/item/device/unactivated_swarmer(get_turf(GLOB.the_gateway)) if(prob(25)) //25% chance to announce it to the crew var/swarmer_report = "[command_name()] High-Priority Update" swarmer_report += "

Our long-range sensors have detected an odd signal emanating from your station's gateway. We recommend immediate investigation of your gateway, as something may have come through." @@ -23,7 +23,7 @@ /datum/round_event/spawn_swarmer/proc/find_swarmer() - for(var/mob/living/M in mob_list) + for(var/mob/living/M in GLOB.mob_list) if(istype(M, /mob/living/simple_animal/hostile/swarmer) && M.client) //If there is a swarmer with an active client, we've found our swarmer return 1 return 0 diff --git a/code/game/gamemodes/miniantags/monkey/monkey.dm b/code/game/gamemodes/miniantags/monkey/monkey.dm index a9c75fa76b341..ecb15bc221011 100644 --- a/code/game/gamemodes/miniantags/monkey/monkey.dm +++ b/code/game/gamemodes/miniantags/monkey/monkey.dm @@ -76,7 +76,7 @@ return 0 var/datum/disease/D = new /datum/disease/transformation/jungle_fever() //ugly but unfortunately needed - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(H.mind && H.stat != DEAD) if(H.HasDisease(D)) return 0 @@ -87,7 +87,7 @@ if(SSshuttle.emergency.mode != SHUTTLE_ENDGAME) return 0 var/datum/disease/D = new /datum/disease/transformation/jungle_fever() - for(var/mob/living/carbon/monkey/M in living_mob_list) + for(var/mob/living/carbon/monkey/M in GLOB.living_mob_list) if (M.HasDisease(D)) if(M.onCentcom() || M.onSyndieBase()) escaped_monkeys++ diff --git a/code/game/gamemodes/miniantags/morph/morph.dm b/code/game/gamemodes/miniantags/morph/morph.dm index 3312d0a6c3e29..26a823e7e504b 100644 --- a/code/game/gamemodes/miniantags/morph/morph.dm +++ b/code/game/gamemodes/miniantags/morph/morph.dm @@ -151,7 +151,7 @@ for(var/atom/movable/AM in src) AM.loc = loc if(prob(90)) - step(AM, pick(alldirs)) + step(AM, pick(GLOB.alldirs)) /mob/living/simple_animal/hostile/morph/wabbajack_act(mob/living/new_mob) barf_contents() @@ -216,9 +216,9 @@ var/datum/mind/player_mind = new /datum/mind(selected.key) player_mind.active = 1 - if(!xeno_spawn) + if(!GLOB.xeno_spawn) return MAP_ERROR - var/mob/living/simple_animal/hostile/morph/S = new /mob/living/simple_animal/hostile/morph(pick(xeno_spawn)) + var/mob/living/simple_animal/hostile/morph/S = new /mob/living/simple_animal/hostile/morph(pick(GLOB.xeno_spawn)) player_mind.transfer_to(S) player_mind.assigned_role = "Morph" player_mind.special_role = "Morph" diff --git a/code/game/gamemodes/miniantags/revenant/revenant.dm b/code/game/gamemodes/miniantags/revenant/revenant.dm index 4a647a0dfa7f0..a644d1cf2805c 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant.dm @@ -64,7 +64,7 @@ ..() ghostimage = image(src.icon,src,src.icon_state) - ghost_darkness_images |= ghostimage + GLOB.ghost_darkness_images |= ghostimage updateallghostimages() /mob/living/simple_animal/revenant/Login() @@ -147,7 +147,7 @@ return log_say("[key_name(src)] : [message]") var/rendered = "[src] says, \"[message]\"" - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(isrevenant(M)) to_chat(M, rendered) else if(isobserver(M)) @@ -210,7 +210,7 @@ if(!revealed || stat == DEAD) //Revenants cannot die if they aren't revealed //or are already dead return 0 ..(1) - ghost_darkness_images -= ghostimage + GLOB.ghost_darkness_images -= ghostimage updateallghostimages() to_chat(src, "NO! No... it's too late, you can feel your essence [pick("breaking apart", "drifting away")]...") notransform = TRUE @@ -369,7 +369,7 @@ loc = get_turf(src) //In case it's in a backpack or someone's hand var/mob/living/simple_animal/revenant/R = new(get_turf(src)) if(client_to_revive) - for(var/mob/M in dead_mob_list) + for(var/mob/M in GLOB.dead_mob_list) if(M.client == client_to_revive) //Only recreates the mob if the mob the client is in is dead R.client = client_to_revive key_of_revenant = client_to_revive.key diff --git a/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm b/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm index de603bf0ec80a..580515d4ecda8 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant_abilities.dm @@ -109,7 +109,7 @@ log_say("RevenantTransmit: [key_name(user)]->[key_name(M)] : [msg]") to_chat(user, "You transmit to [M]: [msg]") to_chat(M, "You hear something behind you talking... [msg]") - for(var/ded in dead_mob_list) + for(var/ded in GLOB.dead_mob_list) if(!isobserver(ded)) continue var/follow_rev = FOLLOW_LINK(ded, user) diff --git a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm index fafcf8f251832..783cfdd930726 100644 --- a/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm +++ b/code/game/gamemodes/miniantags/revenant/revenant_spawn_event.dm @@ -20,7 +20,7 @@ /datum/round_event/ghost_role/revenant/spawn_role() if(!ignore_mobcheck) var/deadMobs = 0 - for(var/mob/M in dead_mob_list) + for(var/mob/M in GLOB.dead_mob_list) deadMobs++ if(deadMobs < REVENANT_SPAWN_THRESHOLD) message_admins("Event attempted to spawn a revenant, but there were only [deadMobs]/[REVENANT_SPAWN_THRESHOLD] dead mobs.") @@ -34,13 +34,13 @@ var/list/spawn_locs = list() - for(var/obj/effect/landmark/L in landmarks_list) + for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(isturf(L.loc)) switch(L.name) if("revenantspawn") spawn_locs += L.loc if(!spawn_locs.len) //If we can't find any revenant spawns, try the carp spawns - for(var/obj/effect/landmark/L in landmarks_list) + for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(isturf(L.loc)) switch(L.name) if("carpspawn") diff --git a/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm b/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm index 8188a661ece40..e9b417de1a99a 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughterevent.dm @@ -23,7 +23,7 @@ player_mind.active = 1 var/list/spawn_locs = list() - for(var/obj/effect/landmark/L in landmarks_list) + for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(isturf(L.loc)) switch(L.name) if("carpspawn") diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index f329eb39f5d13..d4d788e04907d 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -46,12 +46,12 @@ //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// /datum/game_mode/proc/update_synd_icons_added(datum/mind/synd_mind) - var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] + var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] opshud.join_hud(synd_mind.current) set_antag_hud(synd_mind.current, "synd") /datum/game_mode/proc/update_synd_icons_removed(datum/mind/synd_mind) - var/datum/atom_hud/antag/opshud = huds[ANTAG_HUD_OPS] + var/datum/atom_hud/antag/opshud = GLOB.huds[ANTAG_HUD_OPS] opshud.leave_hud(synd_mind.current) set_antag_hud(synd_mind.current, null) @@ -62,7 +62,7 @@ var/list/turf/synd_spawn = list() - for(var/obj/effect/landmark/A in landmarks_list) + for(var/obj/effect/landmark/A in GLOB.landmarks_list) if(A.name == "Syndicate-Spawn") synd_spawn += get_turf(A) continue @@ -93,7 +93,7 @@ agent_number++ spawnpos++ update_synd_icons_added(synd_mind) - var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in nuke_list + var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in GLOB.nuke_list if(nuke) nuke.r_code = nuke_code return ..() @@ -116,7 +116,7 @@ if(foundIDs.len) for(var/obj/item/weapon/card/id/ID in foundIDs) ID.name = "lead agent card" - ID.access += access_syndicate_leader + ID.access += GLOB.access_syndicate_leader else message_admins("Warning: Nuke Ops spawned without access to leave their spawn area!") @@ -176,13 +176,15 @@ if((SSshuttle.emergency.mode == SHUTTLE_ENDGAME) || station_was_nuked) return 1 if(are_operatives_dead()) - if(bomb_set) //snaaaaaaaaaake! It's not over yet! - return 0 + var/obj/machinery/nuclearbomb/N + pass(N) //suppress unused warning + if(N.bomb_set) //snaaaaaaaaaake! It's not over yet! + return 0 //its a static var btw ..() /datum/game_mode/nuclear/declare_completion() var/disk_rescued = 1 - for(var/obj/item/weapon/disk/nuclear/D in poi_list) + for(var/obj/item/weapon/disk/nuclear/D in GLOB.poi_list) if(!D.onCentcom()) disk_rescued = 0 break @@ -277,7 +279,7 @@ var/TC_uses = 0 for(var/datum/mind/syndicate in syndicates) text += printplayer(syndicate) - for(var/obj/item/device/uplink/H in uplinks) + for(var/obj/item/device/uplink/H in GLOB.uplinks) if(H && H.owner && H.owner == syndicate.key) TC_uses += H.spent_telecrystals purchases += H.purchase_log @@ -290,7 +292,7 @@ /proc/nukelastname(mob/M) //--All praise goes to NEO|Phyte, all blame goes to DH, and it was Cindi-Kate's idea. Also praise Urist for copypasta ho. - var/randomname = pick(last_names) + var/randomname = pick(GLOB.last_names) var/newname = copytext(sanitize(input(M,"You are the nuke operative [pick("Czar", "Boss", "Commander", "Chief", "Kingpin", "Director", "Overlord")]. Please choose a last name for your family.", "Name change",randomname)),1,MAX_NAME_LEN) if (!newname) @@ -334,7 +336,7 @@ /datum/outfit/syndicate/post_equip(mob/living/carbon/human/H) var/obj/item/device/radio/R = H.ears - R.set_frequency(SYND_FREQ) + R.set_frequency(GLOB.SYND_FREQ) R.freqlock = 1 if(tc) diff --git a/code/game/gamemodes/nuclear/nuclear_challenge.dm b/code/game/gamemodes/nuclear/nuclear_challenge.dm index 54045c307f49c..3e47aa517deb3 100644 --- a/code/game/gamemodes/nuclear/nuclear_challenge.dm +++ b/code/game/gamemodes/nuclear/nuclear_challenge.dm @@ -17,7 +17,7 @@ return declaring_war = TRUE - var/are_you_sure = alert(user, "Consult your team carefully before you declare war on [station_name()]]. Are you sure you want to alert the enemy crew? You have [-round((world.time-round_start_time - CHALLENGE_TIME_LIMIT)/10)] seconds to decide", "Declare war?", "Yes", "No") + var/are_you_sure = alert(user, "Consult your team carefully before you declare war on [station_name()]]. Are you sure you want to alert the enemy crew? You have [-round((world.time-SSticker.round_start_time - CHALLENGE_TIME_LIMIT)/10)] seconds to decide", "Declare war?", "Yes", "No") declaring_war = FALSE if(!check_allowed(user)) @@ -48,7 +48,7 @@ to_chat(user, "You've attracted the attention of powerful forces within the syndicate. A bonus bundle of telecrystals has been granted to your team. Great things await you if you complete the mission.") - for(var/V in syndicate_shuttle_boards) + for(var/V in GLOB.syndicate_shuttle_boards) var/obj/item/weapon/circuitboard/computer/syndicate_shuttle/board = V board.challenge = TRUE @@ -64,16 +64,16 @@ if(declaring_war) to_chat(user, "You are already in the process of declaring war! Make your mind up.") return 0 - if(player_list.len < CHALLENGE_MIN_PLAYERS) + if(GLOB.player_list.len < CHALLENGE_MIN_PLAYERS) to_chat(user, "The enemy crew is too small to be worth declaring war on.") return 0 if(user.z != ZLEVEL_CENTCOM) to_chat(user, "You have to be at your base to use this.") return 0 - if(world.time-round_start_time > CHALLENGE_TIME_LIMIT) + if(world.time-SSticker.round_start_time > CHALLENGE_TIME_LIMIT) to_chat(user, "It's too late to declare hostilities. Your benefactors are already busy with other schemes. You'll have to make do with what you have on hand.") return 0 - for(var/V in syndicate_shuttle_boards) + for(var/V in GLOB.syndicate_shuttle_boards) var/obj/item/weapon/circuitboard/computer/syndicate_shuttle/board = V if(board.moved) to_chat(user, "The shuttle has already been moved! You have forfeit the right to declare war.") diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index a7e58a901a0ee..575db19f5cefd 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -10,7 +10,6 @@ #define NUKE_ON_TIMING 2 #define NUKE_ON_EXPLODING 3 -var/bomb_set /obj/machinery/nuclearbomb name = "nuclear fission explosive" @@ -41,15 +40,16 @@ var/bomb_set var/image/lights = null var/image/interior = null var/obj/effect/countdown/nuclearbomb/countdown + var/static/bomb_set /obj/machinery/nuclearbomb/New() ..() countdown = new(src) - nuke_list += src + GLOB.nuke_list += src core = new /obj/item/nuke_core(src) STOP_PROCESSING(SSobj, core) update_icon() - poi_list |= src + GLOB.poi_list |= src previous_level = get_security_level() /obj/machinery/nuclearbomb/Destroy() @@ -57,8 +57,8 @@ var/bomb_set if(!exploding) // If we're not exploding, set the alert level back to normal set_safety() - poi_list -= src - nuke_list -= src + GLOB.poi_list -= src + GLOB.nuke_list -= src if(countdown) qdel(countdown) countdown = null @@ -239,7 +239,7 @@ var/bomb_set /obj/machinery/nuclearbomb/attack_paw(mob/user) return attack_hand(user) -/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state=default_state) +/obj/machinery/nuclearbomb/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state=GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "nuclear_bomb", name, 500, 600, master_ui, state) @@ -361,7 +361,7 @@ var/bomb_set if(safety) if(timing) set_security_level(previous_level) - for(var/obj/item/weapon/pinpointer/syndicate/S in pinpointer_list) + for(var/obj/item/weapon/pinpointer/syndicate/S in GLOB.pinpointer_list) S.switch_mode_to(initial(S.mode)) S.nuke_warning = FALSE timing = FALSE @@ -380,14 +380,14 @@ var/bomb_set bomb_set = TRUE set_security_level("delta") detonation_timer = world.time + (timer_set * 10) - for(var/obj/item/weapon/pinpointer/syndicate/S in pinpointer_list) + for(var/obj/item/weapon/pinpointer/syndicate/S in GLOB.pinpointer_list) S.switch_mode_to(TRACK_INFILTRATOR) countdown.start() else bomb_set = FALSE detonation_timer = null set_security_level(previous_level) - for(var/obj/item/weapon/pinpointer/syndicate/S in pinpointer_list) + for(var/obj/item/weapon/pinpointer/syndicate/S in GLOB.pinpointer_list) S.switch_mode_to(initial(S.mode)) S.nuke_warning = FALSE countdown.stop() @@ -419,7 +419,7 @@ var/bomb_set yes_code = FALSE safety = TRUE update_icon() - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) M << 'sound/machines/Alarm.ogg' if(SSticker && SSticker.mode) SSticker.mode.explosion_in_progress = 1 @@ -430,7 +430,7 @@ var/bomb_set SSticker.mode.explosion_in_progress = 0 return - enter_allowed = 0 + GLOB.enter_allowed = 0 var/off_station = 0 var/turf/bomb_location = get_turf(src) @@ -501,7 +501,7 @@ This is here to make the tiles around the station mininuke change when it's arme /obj/item/weapon/disk/nuclear/New() ..() - poi_list |= src + GLOB.poi_list |= src set_stationloving(TRUE, inform_admins=TRUE) /obj/item/weapon/disk/nuclear/attackby(obj/item/I, mob/living/user, params) @@ -521,7 +521,7 @@ This is here to make the tiles around the station mininuke change when it's arme /obj/item/weapon/disk/nuclear/Destroy(force=FALSE) // respawning is handled in /obj/Destroy() if(force) - poi_list -= src + GLOB.poi_list -= src . = ..() /obj/item/weapon/disk/nuclear/suicide_act(mob/user) diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 849392df283a2..a42962948441d 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -22,11 +22,11 @@ /obj/item/weapon/pinpointer/New() ..() - pinpointer_list += src + GLOB.pinpointer_list += src /obj/item/weapon/pinpointer/Destroy() STOP_PROCESSING(SSfastprocess, src) - pinpointer_list -= src + GLOB.pinpointer_list -= src return ..() /obj/item/weapon/pinpointer/attack_self(mob/living/user) @@ -66,7 +66,7 @@ else msg = "Its tracking indicator is blank." to_chat(user, msg) - for(var/obj/machinery/nuclearbomb/bomb in machines) + for(var/obj/machinery/nuclearbomb/bomb in GLOB.machines) if(bomb.timing) to_chat(user, "Extreme danger. Arming signal detected. Time remaining: [bomb.get_time_left()]") @@ -91,11 +91,11 @@ var/obj/item/weapon/disk/nuclear/N = locate() target = N if(TRACK_MALF_AI) - for(var/V in ai_list) + for(var/V in GLOB.ai_list) var/mob/living/silicon/ai/A = V if(A.nuking) target = A - for(var/V in apcs_list) + for(var/V in GLOB.apcs_list) var/obj/machinery/power/apc/A = V if(A.malfhack && A.occupier) target = A @@ -142,7 +142,7 @@ icon_state = "pinon[nuke_warning ? "alert" : "far"]" /obj/item/weapon/pinpointer/proc/my_god_jc_a_bomb() //If we should get the hell back to the ship - for(var/obj/machinery/nuclearbomb/bomb in nuke_list) + for(var/obj/machinery/nuclearbomb/bomb in GLOB.nuke_list) if(bomb.timing) if(!nuke_warning) nuke_warning = TRUE diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 582c847928cba..c082a48224700 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -26,7 +26,7 @@ /datum/objective/proc/get_crewmember_minds() . = list() - for(var/V in data_core.locked) + for(var/V in GLOB.data_core.locked) var/datum/data/record/R = V var/mob/M = R.fields["reference"] if(M && M.mind) @@ -246,7 +246,7 @@ var/area/A = SSshuttle.emergency.areaInstance - for(var/mob/living/player in player_list) //Make sure nobody else is onboard + for(var/mob/living/player in GLOB.player_list) //Make sure nobody else is onboard if(player.mind && player.mind != owner) if(player.stat != DEAD) if(issilicon(player)) //Borgs are technically dead anyways @@ -260,7 +260,7 @@ if(player.real_name != owner.current.real_name && !istype(location, /turf/open/floor/plasteel/shuttle/red) && !istype(location, /turf/open/floor/mineral/plastitanium/brig)) return 0 - for(var/mob/living/player in player_list) //Make sure at least one of you is onboard + for(var/mob/living/player in GLOB.player_list) //Make sure at least one of you is onboard if(player.mind && player.mind != owner) if(player.stat != DEAD) if(issilicon(player)) //Borgs are technically dead anyways @@ -288,7 +288,7 @@ var/area/A = SSshuttle.emergency.areaInstance - for(var/mob/living/player in player_list) + for(var/mob/living/player in GLOB.player_list) if(issilicon(player)) continue if(player.mind) @@ -310,7 +310,7 @@ var/area/A = SSshuttle.emergency.areaInstance - for(var/mob/living/player in player_list) + for(var/mob/living/player in GLOB.player_list) if(get_area(player) == A && player.mind && player.stat != DEAD && ishuman(player)) var/mob/living/carbon/human/H = player if(H.dna.species.id != "human") @@ -439,8 +439,7 @@ return 1 return 0 - -var/global/list/possible_items = list() +GLOBAL_LIST_EMPTY(possible_items) /datum/objective/steal var/datum/objective_item/targetinfo = null //Save the chosen item datum so we can access it later. var/obj/item/steal_target = null //Needed for custom objectives (they're just items, not datums). @@ -452,12 +451,12 @@ var/global/list/possible_items = list() /datum/objective/steal/New() ..() - if(!possible_items.len)//Only need to fill the list when it's needed. - init_subtypes(/datum/objective_item/steal,possible_items) + if(!GLOB.possible_items.len)//Only need to fill the list when it's needed. + init_subtypes(/datum/objective_item/steal,GLOB.possible_items) /datum/objective/steal/find_target() var/approved_targets = list() - for(var/datum/objective_item/possible_item in possible_items) + for(var/datum/objective_item/possible_item in GLOB.possible_items) if(is_unique_objective(possible_item.targetitem) && !(owner.current.mind.assigned_role in possible_item.excludefromjob)) approved_targets += possible_item return set_target(safepick(approved_targets)) @@ -476,7 +475,7 @@ var/global/list/possible_items = list() return /datum/objective/steal/proc/select_target() //For admins setting objectives manually. - var/list/possible_items_all = possible_items+"custom" + var/list/possible_items_all = GLOB.possible_items+"custom" var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all if (!new_target) return @@ -522,19 +521,17 @@ var/global/list/possible_items = list() H.equip_in_one_of_slots(O, slots) -var/global/list/possible_items_special = list() +GLOBAL_LIST_EMPTY(possible_items_special) /datum/objective/steal/special //ninjas are so special they get their own subtype good for them /datum/objective/steal/special/New() ..() - if(!possible_items_special.len) - init_subtypes(/datum/objective_item/special,possible_items_special) - init_subtypes(/datum/objective_item/stack,possible_items_special) + if(!GLOB.possible_items_special.len) + init_subtypes(/datum/objective_item/special,GLOB.possible_items_special) + init_subtypes(/datum/objective_item/stack,GLOB.possible_items_special) /datum/objective/steal/special/find_target() - return set_target(pick(possible_items_special)) - - + return set_target(pick(GLOB.possible_items_special)) /datum/objective/steal/exchange dangerrating = 10 @@ -654,11 +651,11 @@ var/global/list/possible_items_special = list() if (SSticker) var/n_p = 1 //autowin if (SSticker.current_state == GAME_STATE_SETTING_UP) - for(var/mob/dead/new_player/P in player_list) + for(var/mob/dead/new_player/P in GLOB.player_list) if(P.client && P.ready && P.mind!=owner) n_p ++ else if (SSticker.current_state == GAME_STATE_PLAYING) - for(var/mob/living/carbon/human/P in player_list) + for(var/mob/living/carbon/human/P in GLOB.player_list) if(P.client && !(P.mind in SSticker.mode.changelings) && P.mind!=owner) n_p ++ target_amount = min(target_amount, n_p) @@ -796,7 +793,7 @@ var/global/list/possible_items_special = list() //So at the time of writing, rand(3,6), it's also capped by the amount of lings there are //Because you can't fill 6 head roles with 3 lings - var/needed_heads = rand(min_lings,command_positions.len) + var/needed_heads = rand(min_lings,GLOB.command_positions.len) needed_heads = min(SSticker.mode.changelings.len,needed_heads) var/list/heads = SSticker.mode.get_living_heads() diff --git a/code/game/gamemodes/revolution/revolution.dm b/code/game/gamemodes/revolution/revolution.dm index 802fe50cc6c48..622829488b48b 100644 --- a/code/game/gamemodes/revolution/revolution.dm +++ b/code/game/gamemodes/revolution/revolution.dm @@ -257,7 +257,7 @@ return is_revolutionary(M) || is_head_revolutionary(M) /datum/game_mode/proc/add_revolutionary(datum/mind/rev_mind) - if(rev_mind.assigned_role in command_positions) + if(rev_mind.assigned_role in GLOB.command_positions) return 0 var/mob/living/carbon/human/H = rev_mind.current//Check to see if the potential rev is implanted if(H.isloyal()) @@ -311,7 +311,7 @@ //Adds the rev hud to a new convert// ///////////////////////////////////// /datum/game_mode/proc/update_rev_icons_added(datum/mind/rev_mind) - var/datum/atom_hud/antag/revhud = huds[ANTAG_HUD_REV] + var/datum/atom_hud/antag/revhud = GLOB.huds[ANTAG_HUD_REV] revhud.join_hud(rev_mind.current) set_antag_hud(rev_mind.current, ((rev_mind in head_revolutionaries) ? "rev_head" : "rev")) @@ -319,7 +319,7 @@ //Removes the hud from deconverted revs// ///////////////////////////////////////// /datum/game_mode/proc/update_rev_icons_removed(datum/mind/rev_mind) - var/datum/atom_hud/antag/revhud = huds[ANTAG_HUD_REV] + var/datum/atom_hud/antag/revhud = GLOB.huds[ANTAG_HUD_REV] revhud.leave_hud(rev_mind.current) set_antag_hud(rev_mind.current, null) @@ -368,14 +368,14 @@ if(head_revolutionaries.len || istype(SSticker.mode,/datum/game_mode/revolution)) var/num_revs = 0 var/num_survivors = 0 - for(var/mob/living/carbon/survivor in living_mob_list) + for(var/mob/living/carbon/survivor in GLOB.living_mob_list) if(survivor.ckey) num_survivors++ if(survivor.mind) if((survivor.mind in head_revolutionaries) || (survivor.mind in revolutionaries)) num_revs++ if(num_survivors) - to_chat(world, "[TAB]Command's Approval Rating: [100 - round((num_revs/num_survivors)*100, 0.1)]%" ) + to_chat(world, "[GLOB.TAB]Command's Approval Rating: [100 - round((num_revs/num_survivors)*100, 0.1)]%" ) var/text = "
The head revolutionaries were:" for(var/datum/mind/headrev in head_revolutionaries) text += printplayer(headrev, 1) diff --git a/code/game/gamemodes/sandbox/h_sandbox.dm b/code/game/gamemodes/sandbox/h_sandbox.dm index 7c78d5b497626..ae0486c399f76 100644 --- a/code/game/gamemodes/sandbox/h_sandbox.dm +++ b/code/game/gamemodes/sandbox/h_sandbox.dm @@ -1,6 +1,6 @@ -var/hsboxspawn = 1 +GLOBAL_VAR_INIT(hsboxspawn, TRUE) /mob var/datum/hSB/sandbox = null @@ -113,13 +113,13 @@ var/hsboxspawn = 1 // if("hsbtobj") if(!admin) return - if(hsboxspawn) + if(GLOB.hsboxspawn) to_chat(world, "Sandbox: \black[usr.key] has disabled object spawning!") - hsboxspawn = 0 + GLOB.hsboxspawn = FALSE return else to_chat(world, "Sandbox: \black[usr.key] has enabled object spawning!") - hsboxspawn = 1 + GLOB.hsboxspawn = TRUE return // // Admin: Toggle auto-close @@ -216,7 +216,7 @@ var/hsboxspawn = 1 // Spawn check due to grief potential (destroying floors, walls, etc) // if("hsbrcd") - if(!hsboxspawn) return + if(!GLOB.hsboxspawn) return new/obj/item/weapon/rcd/combat(usr.loc) @@ -232,7 +232,7 @@ var/hsboxspawn = 1 // Clothing if("hsbcloth") - if(!hsboxspawn) return + if(!GLOB.hsboxspawn) return if(!clothinfo) clothinfo = "Clothing (Reagent Containers) (Other Items)

" @@ -246,7 +246,7 @@ var/hsboxspawn = 1 // Reagent containers if("hsbreag") - if(!hsboxspawn) return + if(!GLOB.hsboxspawn) return if(!reaginfo) reaginfo = "Reagent Containers (Clothing) (Other Items)

" @@ -260,7 +260,7 @@ var/hsboxspawn = 1 // Other items if("hsbobj") - if(!hsboxspawn) return + if(!GLOB.hsboxspawn) return if(!objinfo) objinfo = "Other Items (Clothing) (Reagent Containers)

" @@ -277,7 +277,7 @@ var/hsboxspawn = 1 // Safespawn checks to see if spawning is disabled. // if("hsb_safespawn") - if(!hsboxspawn) + if(!GLOB.hsboxspawn) usr << browse(null,"window=sandbox") return diff --git a/code/game/gamemodes/sandbox/sandbox.dm b/code/game/gamemodes/sandbox/sandbox.dm index bfc4927e5c391..4aa04cfdb7a98 100644 --- a/code/game/gamemodes/sandbox/sandbox.dm +++ b/code/game/gamemodes/sandbox/sandbox.dm @@ -7,7 +7,7 @@ announce_text = "Build your own station... or just shoot each other!" /datum/game_mode/sandbox/pre_setup() - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) M.CanBuild() return 1 diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 375a89ad5fa76..579ca3a7138ad 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -70,7 +70,7 @@ return 1 /datum/game_mode/traitor/make_antag_chance(mob/living/carbon/human/character) //Assigns traitor to latejoiners - var/traitorcap = min(round(joined_player_list.len / (config.traitor_scaling_coeff * 2)) + 2 + num_modifier, round(joined_player_list.len/config.traitor_scaling_coeff) + num_modifier ) + var/traitorcap = min(round(GLOB.joined_player_list.len / (config.traitor_scaling_coeff * 2)) + 2 + num_modifier, round(GLOB.joined_player_list.len/config.traitor_scaling_coeff) + num_modifier ) if(SSticker.mode.traitors.len >= traitorcap) //Upper cap for number of latejoin antagonists return if(SSticker.mode.traitors.len <= (traitorcap - 2) || prob(100 / (config.traitor_scaling_coeff * 2))) @@ -144,7 +144,7 @@ var/list/active_ais = active_ais() for(var/i = objective_count, i < config.traitor_objectives_amount, i++) if(prob(50)) - if(active_ais.len && prob(100/joined_player_list.len)) + if(active_ais.len && prob(100/GLOB.joined_player_list.len)) var/datum/objective/destroy/destroy_objective = new destroy_objective.owner = traitor destroy_objective.find_target() @@ -215,11 +215,11 @@ /proc/give_codewords(mob/living/traitor_mob) to_chat(traitor_mob, "The Syndicate provided you with the following information on how to identify their agents:") - to_chat(traitor_mob, "Code Phrase: [syndicate_code_phrase]") - to_chat(traitor_mob, "Code Response: [syndicate_code_response]") + to_chat(traitor_mob, "Code Phrase: [GLOB.syndicate_code_phrase]") + to_chat(traitor_mob, "Code Response: [GLOB.syndicate_code_response]") - traitor_mob.mind.store_memory("Code Phrase: [syndicate_code_phrase]") - traitor_mob.mind.store_memory("Code Response: [syndicate_code_response]") + traitor_mob.mind.store_memory("Code Phrase: [GLOB.syndicate_code_phrase]") + traitor_mob.mind.store_memory("Code Response: [GLOB.syndicate_code_response]") to_chat(traitor_mob, "Use the code words in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe.") @@ -234,7 +234,7 @@ killer.add_malf_picker() /datum/game_mode/proc/add_law_sixsixsix(mob/living/silicon/devil) - var/laws = list("You may not use violence to coerce someone into selling their soul.", "You may not directly and knowingly physically harm a devil, other than yourself.", lawlorify[LAW][devil.mind.devilinfo.ban], lawlorify[LAW][devil.mind.devilinfo.obligation], "Accomplish your objectives at all costs.") + var/laws = list("You may not use violence to coerce someone into selling their soul.", "You may not directly and knowingly physically harm a devil, other than yourself.", GLOB.lawlorify[LAW][devil.mind.devilinfo.ban], GLOB.lawlorify[LAW][devil.mind.devilinfo.obligation], "Accomplish your objectives at all costs.") devil.set_law_sixsixsix(laws) /datum/game_mode/proc/auto_declare_completion_traitor() @@ -248,7 +248,7 @@ var/TC_uses = 0 var/uplink_true = 0 var/purchases = "" - for(var/obj/item/device/uplink/H in uplinks) + for(var/obj/item/device/uplink/H in GLOB.uplinks) if(H && H.owner && H.owner == traitor.key) TC_uses += H.spent_telecrystals uplink_true = 1 @@ -290,8 +290,8 @@ text += "
" - text += "
The code phrases were: [syndicate_code_phrase]
\ - The code responses were: [syndicate_code_response]
" + text += "
The code phrases were: [GLOB.syndicate_code_phrase]
\ + The code responses were: [GLOB.syndicate_code_response]
" to_chat(world, text) return 1 @@ -403,12 +403,12 @@ to_chat(mob, "

[where] is a folder containing secret documents that another Syndicate group wants. We have set up a meeting with one of their agents on station to make an exchange. Exercise extreme caution as they cannot be trusted and may be hostile.
") /datum/game_mode/proc/update_traitor_icons_added(datum/mind/traitor_mind) - var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR] traitorhud.join_hud(traitor_mind.current) set_antag_hud(traitor_mind.current, "traitor") /datum/game_mode/proc/update_traitor_icons_removed(datum/mind/traitor_mind) - var/datum/atom_hud/antag/traitorhud = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/antag/traitorhud = GLOB.huds[ANTAG_HUD_TRAITOR] traitorhud.leave_hud(traitor_mind.current) set_antag_hud(traitor_mind.current, null) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index a21fe66bbac63..bfb311da7a7bb 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -195,7 +195,6 @@ /////////////////////Multiverse Blade//////////////////// -var/global/list/multiverse = list() /obj/item/weapon/multisword name = "multiverse sword" @@ -214,10 +213,11 @@ var/global/list/multiverse = list() var/faction = list("unassigned") var/cooldown = 0 var/assigned = "unassigned" + var/static/list/multiverse = list() /obj/item/weapon/multisword/New() ..() - multiverse |= src + multiverse += src /obj/item/weapon/multisword/Destroy() @@ -436,7 +436,7 @@ var/global/list/multiverse = list() var/obj/item/weapon/card/id/W = new /obj/item/weapon/card/id W.icon_state = "centcom" - W.access += access_maint_tunnels + W.access += GLOB.access_maint_tunnels W.assignment = "Multiverse Traveller" W.registered_name = M.real_name W.update_label(M.real_name) @@ -517,7 +517,7 @@ var/global/list/multiverse = list() user.unset_machine() if("r_leg","l_leg") to_chat(user, "You move the doll's legs around.") - var/turf/T = get_step(target,pick(cardinal)) + var/turf/T = get_step(target,pick(GLOB.cardinal)) target.Move(T) if("r_arm","l_arm") target.click_random_mob() @@ -533,7 +533,7 @@ var/global/list/multiverse = list() possible = list() if(!link) return - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(md5(H.dna.uni_identity) in link.fingerprints) possible |= H diff --git a/code/game/gamemodes/wizard/raginmages.dm b/code/game/gamemodes/wizard/raginmages.dm index d3253f2f951aa..c9831d834716e 100644 --- a/code/game/gamemodes/wizard/raginmages.dm +++ b/code/game/gamemodes/wizard/raginmages.dm @@ -20,7 +20,7 @@ ..() var/playercount = 0 if(!max_mages && !bullshit_mode) - for(var/mob/living/player in mob_list) + for(var/mob/living/player in GLOB.mob_list) if(player.client && player.stat != 2) playercount += 1 max_mages = round(playercount / 8) @@ -90,7 +90,7 @@ var/mob/dead/observer/theghost = null spawn(rand(spawn_delay_min, spawn_delay_max)) message_admins("SWF is still pissed, sending another wizard - [max_mages - mages_made] left.") - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) if(G.client && !G.client.holder && !G.client.is_afk() && (ROLE_WIZARD in G.client.prefs.be_special)) if(!jobban_isbanned(G, ROLE_WIZARD) && !jobban_isbanned(G, "Syndicate")) if(age_check(G.client)) @@ -98,7 +98,7 @@ if(!candidates.len) message_admins("No applicable ghosts for the next ragin' mage, asking ghosts instead.") var/time_passed = world.time - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) if(!jobban_isbanned(G, "wizard") && !jobban_isbanned(G, "Syndicate")) if(age_check(G.client)) spawn(0) @@ -141,7 +141,7 @@ return //First we spawn a dude. - var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. + var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned. G_found.client.prefs.copy_to(new_character) new_character.dna.update_dna_identity() diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index e9915bf4f9919..7ccf7a6b7e1d9 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -238,7 +238,7 @@ /obj/item/device/soulstone/proc/getCultGhost(mob/living/carbon/human/T, mob/U) var/mob/dead/observer/chosen_ghost - for(var/mob/dead/observer/ghost in player_list) //We put them back in their body + for(var/mob/dead/observer/ghost in GLOB.player_list) //We put them back in their body if(ghost.mind && ghost.mind.current == T && ghost.client) chosen_ghost = ghost break diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 12869b81610a5..3c8fd93d0648e 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -864,7 +864,7 @@ /obj/item/weapon/spellbook/oneuse/mindswap/recoil(mob/user) ..() - if(stored_swap in dead_mob_list) + if(stored_swap in GLOB.dead_mob_list) stored_swap = null if(!stored_swap) stored_swap = user diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index f30ff7294e377..28921be6727b4 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -25,11 +25,11 @@ modePlayer += wizard wizard.assigned_role = "Wizard" wizard.special_role = "Wizard" - if(wizardstart.len == 0) + if(GLOB.wizardstart.len == 0) to_chat(wizard.current, "A starting location for you could not be found, please report this bug!") return 0 for(var/datum/mind/wiz in wizards) - wiz.current.loc = pick(wizardstart) + wiz.current.loc = pick(GLOB.wizardstart) return 1 @@ -97,8 +97,8 @@ /datum/game_mode/proc/name_wizard(mob/living/carbon/human/wizard_mob) //Allows the wizard to choose a custom name or go with a random one. Spawn 0 so it does not lag the round starting. - var/wizard_name_first = pick(wizard_first) - var/wizard_name_second = pick(wizard_second) + var/wizard_name_first = pick(GLOB.wizard_first) + var/wizard_name_second = pick(GLOB.wizard_second) var/randomname = "[wizard_name_first] [wizard_name_second]" spawn(0) var/newname = copytext(sanitize(input(wizard_mob, "You are the Space Wizard. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN) @@ -251,11 +251,11 @@ /datum/game_mode/proc/update_wiz_icons_added(datum/mind/wiz_mind) - var/datum/atom_hud/antag/wizhud = huds[ANTAG_HUD_WIZ] + var/datum/atom_hud/antag/wizhud = GLOB.huds[ANTAG_HUD_WIZ] wizhud.join_hud(wiz_mind.current) set_antag_hud(wiz_mind.current, ((wiz_mind in wizards) ? "wizard" : "apprentice")) /datum/game_mode/proc/update_wiz_icons_removed(datum/mind/wiz_mind) - var/datum/atom_hud/antag/wizhud = huds[ANTAG_HUD_WIZ] + var/datum/atom_hud/antag/wizhud = GLOB.huds[ANTAG_HUD_WIZ] wizhud.leave_hud(wiz_mind.current) set_antag_hud(wiz_mind.current, null) diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 3fcaaa23c1c32..817f7f682ab61 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -107,10 +107,10 @@ return ..() /obj/machinery/sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = notcontained_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) - if(controls_inside && state == notcontained_state) - state = default_state // If it has a set of controls on the inside, make it actually controllable by the mob in it. + if(controls_inside && state == GLOB.notcontained_state) + state = GLOB.default_state // If it has a set of controls on the inside, make it actually controllable by the mob in it. ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) @@ -124,7 +124,7 @@ data["chems"] = list() for(var/chem in available_chems) - var/datum/reagent/R = chemical_reagents_list[chem] + var/datum/reagent/R = GLOB.chemical_reagents_list[chem] data["chems"] += list(list("name" = R.name, "id" = R.id, "allowed" = chem_allowed(chem))) data["occupant"] = list() diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index 7f444fb93a3ee..2e1bb6d881768 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -15,7 +15,7 @@ var/cooldown_time = 0 var/cooldown_timeleft = 0 var/cooldown_on = 0 - req_access = list(access_ai_upload) + req_access = list(GLOB.access_ai_upload) /obj/machinery/ai_slipper/power_change() if(stat & BROKEN) diff --git a/code/game/machinery/airlock_control.dm b/code/game/machinery/airlock_control.dm index a9087e7bfa5a0..37a9663c153be 100644 --- a/code/game/machinery/airlock_control.dm +++ b/code/game/machinery/airlock_control.dm @@ -58,7 +58,7 @@ signal.data["door_status"] = density?("closed"):("open") signal.data["lock_status"] = locked?("locked"):("unlocked") - radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) + radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = GLOB.RADIO_AIRLOCK) /obj/machinery/door/airlock/open(surpress_send) @@ -75,7 +75,7 @@ SSradio.remove_object(src, frequency) if(new_frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_AIRLOCK) /obj/machinery/door/airlock/Destroy() if(frequency && SSradio) @@ -116,7 +116,7 @@ signal.data["tag"] = master_tag signal.data["command"] = "cycle" - radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) + radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = GLOB.RADIO_AIRLOCK) flick("airlock_sensor_cycle", src) /obj/machinery/airlock_sensor/process() @@ -133,14 +133,14 @@ signal.data["pressure"] = num2text(pressure) - radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = RADIO_AIRLOCK) + radio_connection.post_signal(src, signal, range = AIRLOCK_CONTROL_RANGE, filter = GLOB.RADIO_AIRLOCK) update_icon() /obj/machinery/airlock_sensor/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, RADIO_AIRLOCK) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_AIRLOCK) /obj/machinery/airlock_sensor/Initialize() ..() diff --git a/code/game/machinery/announcement_system.dm b/code/game/machinery/announcement_system.dm index dd9ec911f470c..cca752a7c1e0b 100644 --- a/code/game/machinery/announcement_system.dm +++ b/code/game/machinery/announcement_system.dm @@ -1,4 +1,4 @@ -var/list/announcement_systems = list() +GLOBAL_LIST_EMPTY(announcement_systems) /obj/machinery/announcement_system density = 1 @@ -27,7 +27,7 @@ var/list/announcement_systems = list() /obj/machinery/announcement_system/New() ..() - announcement_systems += src + GLOB.announcement_systems += src radio = new /obj/item/device/radio/headset/ai(src) var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/announcement_system(null) @@ -62,7 +62,7 @@ var/list/announcement_systems = list() /obj/machinery/announcement_system/Destroy() QDEL_NULL(radio) - announcement_systems -= src //"OH GOD WHY ARE THERE 100,000 LISTED ANNOUNCEMENT SYSTEMS?!!" + GLOB.announcement_systems -= src //"OH GOD WHY ARE THERE 100,000 LISTED ANNOUNCEMENT SYSTEMS?!!" return ..() /obj/machinery/announcement_system/power_change() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index 02903a11331f5..592a7b696736e 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -44,8 +44,8 @@ ..() assembly = new(src) assembly.state = 4 - cameranet.cameras += src - cameranet.addCamera(src) + GLOB.cameranet.cameras += src + GLOB.cameranet.addCamera(src) add_to_proximity_list(src, 1) //1 was default of everything /* // Use this to look for cameras that have the same c_tag. for(var/obj/machinery/camera/C in cameranet.cameras) @@ -74,9 +74,9 @@ if(bug.current == src) bug.current = null bug = null - cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that - cameranet.cameras -= src - cameranet.removeCamera(src) + GLOB.cameranet.removeCamera(src) //Will handle removal from the camera network and the chunks, so we don't need to worry about that + GLOB.cameranet.cameras -= src + GLOB.cameranet.removeCamera(src) return ..() /obj/machinery/camera/emp_act(severity) @@ -87,7 +87,7 @@ update_icon() var/list/previous_network = network network = list() - cameranet.removeCamera(src) + GLOB.cameranet.removeCamera(src) stat |= EMPED set_light(0) emped = emped+1 //Increase the number of consecutive EMP's @@ -101,10 +101,10 @@ stat &= ~EMPED update_icon() if(can_use()) - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) emped = 0 //Resets the consecutive EMP count addtimer(CALLBACK(src, .proc/cancelCameraAlarm), 100) - for(var/mob/O in mob_list) + for(var/mob/O in GLOB.mob_list) if (O.client && O.client.eye == src) O.unset_machine() O.reset_perspective(null) @@ -124,7 +124,7 @@ /obj/machinery/camera/proc/setViewRange(num = 7) src.view_range = num - cameranet.updateVisibility(src, 0) + GLOB.cameranet.updateVisibility(src, 0) /obj/machinery/camera/proc/shock(mob/living/user) if(!istype(user)) @@ -206,7 +206,7 @@ info = P.notehtml to_chat(U, "You hold \the [itemname] up to the camera...") U.changeNext_move(CLICK_CD_MELEE) - for(var/mob/O in player_list) + for(var/mob/O in GLOB.player_list) if(isAI(O)) var/mob/living/silicon/ai/AI = O if(AI.control_disabled || (AI.stat == DEAD)) @@ -278,11 +278,11 @@ /obj/machinery/camera/proc/toggle_cam(mob/user, displaymessage = 1) status = !status if(can_use()) - cameranet.addCamera(src) + GLOB.cameranet.addCamera(src) else set_light(0) - cameranet.removeCamera(src) - cameranet.updateChunk(x, y, z) + GLOB.cameranet.removeCamera(src) + GLOB.cameranet.updateChunk(x, y, z) var/change_msg = "deactivates" if(status) change_msg = "reactivates" @@ -301,7 +301,7 @@ // now disconnect anyone using the camera //Apparently, this will disconnect anyone even if the camera was re-activated. //I guess that doesn't matter since they can't use it anyway? - for(var/mob/O in player_list) + for(var/mob/O in GLOB.player_list) if (O.client && O.client.eye == src) O.unset_machine() O.reset_perspective(null) @@ -309,12 +309,12 @@ /obj/machinery/camera/proc/triggerCameraAlarm() alarm_on = 1 - for(var/mob/living/silicon/S in mob_list) + for(var/mob/living/silicon/S in GLOB.mob_list) S.triggerAlarm("Camera", get_area(src), list(src), src) /obj/machinery/camera/proc/cancelCameraAlarm() alarm_on = 0 - for(var/mob/living/silicon/S in mob_list) + for(var/mob/living/silicon/S in GLOB.mob_list) S.cancelAlarm("Camera", get_area(src), src) /obj/machinery/camera/proc/can_use() @@ -386,7 +386,7 @@ return 0 /obj/machinery/camera/proc/Togglelight(on=0) - for(var/mob/living/silicon/ai/A in ai_list) + for(var/mob/living/silicon/ai/A in GLOB.ai_list) for(var/obj/machinery/camera/cam in A.lit_cameras) if(cam == src) return @@ -405,8 +405,8 @@ assembly.update_icon() /obj/machinery/camera/portable/process() //Updates whenever the camera is moved. - if(cameranet && get_turf(src) != prev_turf) - cameranet.updatePortableCamera(src) + if(GLOB.cameranet && get_turf(src) != prev_turf) + GLOB.cameranet.updatePortableCamera(src) prev_turf = get_turf(src) /obj/machinery/camera/get_remote_view_fullscreens(mob/user) diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index 6a373ad2b6f1e..dbfaabef52839 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -50,7 +50,7 @@ /obj/machinery/camera/proc/cancelAlarm() if (detectTime == -1) - for (var/mob/living/silicon/aiPlayer in player_list) + for (var/mob/living/silicon/aiPlayer in GLOB.player_list) if (status) aiPlayer.cancelAlarm("Motion", get_area(src), src) detectTime = 0 @@ -58,7 +58,7 @@ /obj/machinery/camera/proc/triggerAlarm() if (!detectTime) return 0 - for (var/mob/living/silicon/aiPlayer in player_list) + for (var/mob/living/silicon/aiPlayer in GLOB.player_list) if (status) aiPlayer.triggerAlarm("Motion", get_area(src), list(src), src) detectTime = -1 diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index 73d6f98a4cf0d..9348231a9e85e 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -49,7 +49,7 @@ number = 1 var/area/A = get_area(src) if(A) - for(var/obj/machinery/camera/autoname/C in machines) + for(var/obj/machinery/camera/autoname/C in GLOB.machines) if(C == src) continue var/area/CA = get_area(C) if(CA.type == A.type) diff --git a/code/game/machinery/camera/tracking.dm b/code/game/machinery/camera/tracking.dm index 4b10f082c7e9d..1457982467218 100644 --- a/code/game/machinery/camera/tracking.dm +++ b/code/game/machinery/camera/tracking.dm @@ -6,7 +6,7 @@ return var/list/L = list() - for (var/obj/machinery/camera/C in cameranet.cameras) + for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) L.Add(C) camera_sort(L) @@ -48,7 +48,7 @@ if(usr.stat == 2) return list() - for(var/mob/living/M in mob_list) + for(var/mob/living/M in GLOB.mob_list) if(!M.can_track(usr)) continue @@ -138,9 +138,9 @@ return 0 if(iscyborg(M)) var/mob/living/silicon/robot/R = M - if(!(R.camera && R.camera.can_use()) && !cameranet.checkCameraVis(M)) + if(!(R.camera && R.camera.can_use()) && !GLOB.cameranet.checkCameraVis(M)) return 0 - else if(!cameranet.checkCameraVis(M)) + else if(!GLOB.cameranet.checkCameraVis(M)) return 0 return 1 diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 73f5cc4c209fe..fcf09bca3d6a9 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -15,7 +15,7 @@ density = 1 icon = 'icons/obj/cloning.dmi' icon_state = "pod_0" - req_access = list(access_cloning) //For premature unlocking. + req_access = list(GLOB.access_cloning) //For premature unlocking. verb_say = "states" var/heal_level //The clone is released once its health reaches this level. var/obj/machinery/computer/cloning/connected = null //So we remember the connected clone machine. @@ -166,7 +166,7 @@ H.hardset_dna(ui, se, H.real_name, null, mrace, features) if(efficiency > 2) - var/list/unclean_mutations = (not_good_mutations|bad_mutations) + var/list/unclean_mutations = (GLOB.not_good_mutations|GLOB.bad_mutations) H.dna.remove_mutation_group(unclean_mutations) if(efficiency > 5 && prob(20)) H.randmutvg() diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm index 34e63fe385eaa..3a8715c31f3aa 100644 --- a/code/game/machinery/computer/Operating.dm +++ b/code/game/machinery/computer/Operating.dm @@ -14,7 +14,7 @@ find_table() /obj/machinery/computer/operating/proc/find_table() - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) table = locate(/obj/structure/table/optable, get_step(src, dir)) if(table) table.computer = src diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 2a7f48a64ddc2..b65a2200529ca 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -1,7 +1,7 @@ /obj/machinery/computer/aifixer name = "\improper AI system integrity restorer" desc = "Used with intelliCards containing nonfunctioning AIs to restore them to working order." - req_access = list(access_captain, access_robotics, access_heads) + req_access = list(GLOB.access_captain, GLOB.access_robotics, GLOB.access_heads) var/mob/living/silicon/ai/occupier = null var/active = 0 circuit = /obj/item/weapon/circuitboard/computer/aifixer diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm index a8d9a967e4f08..39bd31bdb7b96 100644 --- a/code/game/machinery/computer/apc_control.dm +++ b/code/game/machinery/computer/apc_control.dm @@ -3,7 +3,7 @@ desc = "Used to remotely control the flow of power to different parts of the station." icon_screen = "solar" icon_keyboard = "power_key" - req_access = list(access_engine) + req_access = list(GLOB.access_engine) circuit = /obj/item/weapon/circuitboard/computer/apc_control light_color = LIGHT_COLOR_YELLOW var/list/apcs //APCs the computer has access to @@ -22,7 +22,7 @@ /obj/machinery/computer/apc_control/process() apcs = list() //Clear the list every tick - for(var/V in apcs_list) + for(var/V in GLOB.apcs_list) var/obj/machinery/power/apc/APC = V if(check_apc(APC)) apcs[APC.name] = APC @@ -122,7 +122,7 @@ LAZYADD(logs, "-=- Logging restored to full functionality at this point -=-") if(href_list["access_apc"]) playsound(src, "terminal_type", 50, 0) - var/obj/machinery/power/apc/APC = locate(href_list["access_apc"]) in apcs_list + var/obj/machinery/power/apc/APC = locate(href_list["access_apc"]) in GLOB.apcs_list if(!APC || APC.aidisabled || APC.panel_open || QDELETED(APC)) to_chat(usr, "\icon[I] APC does not return interface request. Remote access may be disabled.") return @@ -136,7 +136,7 @@ active_apc = null to_chat(usr, "\icon[I] Connected to APC in [get_area(APC)]. Interface request sent.") log_activity("remotely accessed APC in [get_area(APC)]") - APC.interact(usr, not_incapacitated_state) + APC.interact(usr, GLOB.not_incapacitated_state) playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) message_admins("[key_name_admin(usr)] remotely accessed [APC] from [src] at [get_area(src)].") log_game("[key_name_admin(usr)] remotely accessed [APC] from [src] at [get_area(src)].") diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index da1950c041afa..dac9feb70488d 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -989,9 +989,9 @@ newcrew = specific else if(prob(50)) - newcrew = pick(first_names_male) + newcrew = pick(GLOB.first_names_male) else - newcrew = pick(first_names_female) + newcrew = pick(GLOB.first_names_female) if(newcrew) settlers += newcrew alive++ @@ -1058,7 +1058,7 @@ back = /obj/item/weapon/storage/backpack has_id = 1 id_job = "Officer" - id_access_list = list(access_syndicate) + id_access_list = list(GLOB.access_syndicate) /obj/item/weapon/orion_ship name = "model settler ship" diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 994ef83165689..17b892adad547 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -21,7 +21,7 @@ return ..() /obj/machinery/computer/atmos_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_alert", name, 350, 300, master_ui, state) @@ -58,7 +58,7 @@ /obj/machinery/computer/atmos_alert/proc/set_frequency(new_frequency) SSradio.remove_object(src, receive_frequency) receive_frequency = new_frequency - radio_connection = SSradio.add_object(src, receive_frequency, RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, receive_frequency, GLOB.RADIO_ATMOSIA) /obj/machinery/computer/atmos_alert/receive_signal(datum/signal/signal) if(!signal || signal.encryption) return diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 043e1c8d7f97e..130c7e15fe369 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -37,13 +37,13 @@ var/gas_name = air_sample.gases[gas_id][GAS_META][META_GAS_NAME] signal.data["gases"][gas_name] = air_sample.gases[gas_id][MOLES] / total_moles * 100 - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) /obj/machinery/air_sensor/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA) /obj/machinery/air_sensor/Initialize() ..() @@ -94,7 +94,7 @@ return ..() /obj/machinery/computer/atmos_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_control", name, 400, 925, master_ui, state) @@ -131,7 +131,7 @@ /obj/machinery/computer/atmos_control/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA) ///////////////////////////////////////////////////////////// // LARGE TANK CONTROL @@ -177,7 +177,7 @@ U.broadcast_status() /obj/machinery/computer/atmos_control/tank/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_control", name, 500, 305, master_ui, state) @@ -216,7 +216,7 @@ target = Clamp(target, 0, 50 * ONE_ATMOSPHERE) signal.data += list("tag" = output_tag, "set_internal_pressure" = target) . = TRUE - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) /obj/machinery/computer/atmos_control/tank/receive_signal(datum/signal/signal) if(!signal || signal.encryption) diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index a74fe4068cda1..76dd272843f69 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -123,7 +123,7 @@ //returns the list of cameras accessible from this computer /obj/machinery/computer/security/proc/get_available_cameras() var/list/L = list() - for (var/obj/machinery/camera/C in cameranet.cameras) + for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) if((z > ZLEVEL_SPACEMAX || C.z > ZLEVEL_SPACEMAX) && (C.z != z))//if on away mission, can only recieve feed from same z_level cameras continue L.Add(C) diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index 99aab18b34512..f0adeac2266b1 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -50,7 +50,7 @@ if(!eyeobj.eye_initialized) var/camera_location - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use() || z_lock && C.z != z_lock) continue if(C.network & networks) @@ -109,7 +109,7 @@ obj/machinery/computer/camera_advanced/attack_ai(mob/user) return T = get_turf(T) loc = T - cameranet.visibility(src) + GLOB.cameranet.visibility(src) if(visible_icon) if(eye_user.client) eye_user.client.images -= user_image @@ -170,7 +170,7 @@ obj/machinery/computer/camera_advanced/attack_ai(mob/user) var/list/L = list() - for (var/obj/machinery/camera/cam in cameranet.cameras) + for (var/obj/machinery/camera/cam in GLOB.cameranet.cameras) if(origin.z_lock && cam.z != origin.z_lock) continue L.Add(cam) diff --git a/code/game/machinery/computer/card.dm b/code/game/machinery/computer/card.dm index e223b152b9cf6..5f0299be0eab1 100644 --- a/code/game/machinery/computer/card.dm +++ b/code/game/machinery/computer/card.dm @@ -2,14 +2,14 @@ //Keeps track of the time for the ID console. Having it as a global variable prevents people from dismantling/reassembling it to //increase the slots of many jobs. -var/time_last_changed_position = 0 +GLOBAL_VAR_INIT(time_last_changed_position, 0) /obj/machinery/computer/card name = "identification console" desc = "You can use this to manage jobs and ID access." icon_screen = "id" icon_keyboard = "id_key" - req_one_access = list(access_heads, access_change_ids) + req_one_access = list(GLOB.access_heads, GLOB.access_change_ids) circuit = /obj/item/weapon/circuitboard/computer/card var/obj/item/weapon/card/id/scan = null var/obj/item/weapon/card/id/modify = null @@ -107,8 +107,8 @@ var/time_last_changed_position = 0 /obj/machinery/computer/card/proc/can_open_job(datum/job/job) if(job) if(!job_blacklisted(job.title)) - if((job.total_positions <= player_list.len * (max_relative_positions / 100))) - var/delta = (world.time / 10) - time_last_changed_position + if((job.total_positions <= GLOB.player_list.len * (max_relative_positions / 100))) + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] < 0)) return 1 return -2 @@ -120,7 +120,7 @@ var/time_last_changed_position = 0 if(job) if(!job_blacklisted(job.title)) if(job.total_positions > job.current_positions) - var/delta = (world.time / 10) - time_last_changed_position + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] > 0)) return 1 return -2 @@ -137,7 +137,7 @@ var/time_last_changed_position = 0 return if (mode == 1) // accessing crew manifest var/crew = "" - for(var/datum/data/record/t in sortRecord(data_core.general)) + for(var/datum/data/record/t in sortRecord(GLOB.data_core.general)) crew += t.fields["name"] + " - " + t.fields["rank"] + "
" dat = "Crew Manifest:
Please use security record computer to modify entries.

[crew]Print

Access ID modification console.
" @@ -154,7 +154,7 @@ var/time_last_changed_position = 0 dat += "" dat += "" var/ID - if(scan && (access_change_ids in scan.access) && !target_dept) + if(scan && (GLOB.access_change_ids in scan.access) && !target_dept) ID = 1 else ID = 0 @@ -174,7 +174,7 @@ var/time_last_changed_position = 0 if(-1) dat += "Denied" if(-2) - var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) + var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]" @@ -190,7 +190,7 @@ var/time_last_changed_position = 0 if(-1) dat += "Denied" if(-2) - var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) + var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) dat += "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]" @@ -350,7 +350,7 @@ var/time_last_changed_position = 0 switch(href_list["choice"]) if ("modify") if (modify) - data_core.manifest_modify(modify.registered_name, modify.assignment) + GLOB.data_core.manifest_modify(modify.registered_name, modify.assignment) modify.update_label() modify.loc = loc modify.verb_pickup() @@ -388,7 +388,7 @@ var/time_last_changed_position = 0 if (check_access(scan)) region_access = list() head_subordinates = list() - if(access_change_ids in scan.access) + if(GLOB.access_change_ids in scan.access) if(target_dept) head_subordinates = get_all_jobs() region_access |= target_dept @@ -398,20 +398,20 @@ var/time_last_changed_position = 0 playsound(src, 'sound/machines/terminal_on.ogg', 50, 0) else - if((access_hop in scan.access) && ((target_dept==1) || !target_dept)) + if((GLOB.access_hop in scan.access) && ((target_dept==1) || !target_dept)) region_access |= 1 region_access |= 6 get_subordinates("Head of Personnel") - if((access_hos in scan.access) && ((target_dept==2) || !target_dept)) + if((GLOB.access_hos in scan.access) && ((target_dept==2) || !target_dept)) region_access |= 2 get_subordinates("Head of Security") - if((access_cmo in scan.access) && ((target_dept==3) || !target_dept)) + if((GLOB.access_cmo in scan.access) && ((target_dept==3) || !target_dept)) region_access |= 3 get_subordinates("Chief Medical Officer") - if((access_rd in scan.access) && ((target_dept==4) || !target_dept)) + if((GLOB.access_rd in scan.access) && ((target_dept==4) || !target_dept)) region_access |= 4 get_subordinates("Research Director") - if((access_ce in scan.access) && ((target_dept==5) || !target_dept)) + if((GLOB.access_ce in scan.access) && ((target_dept==5) || !target_dept)) region_access |= 5 get_subordinates("Chief Engineer") if(region_access) @@ -488,7 +488,7 @@ var/time_last_changed_position = 0 if("make_job_available") // MAKE ANOTHER JOB POSITION AVAILABLE FOR LATE JOINERS - if(scan && (access_change_ids in scan.access) && !target_dept) + if(scan && (GLOB.access_change_ids in scan.access) && !target_dept) var/edit_job_target = href_list["job"] var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) @@ -496,14 +496,14 @@ var/time_last_changed_position = 0 if(can_open_job(j) != 1) return 0 if(opened_positions[edit_job_target] >= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions++ opened_positions[edit_job_target]++ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) if("make_job_unavailable") // MAKE JOB POSITION UNAVAILABLE FOR LATE JOINERS - if(scan && (access_change_ids in scan.access) && !target_dept) + if(scan && (GLOB.access_change_ids in scan.access) && !target_dept) var/edit_job_target = href_list["job"] var/datum/job/j = SSjob.GetJob(edit_job_target) if(!j) @@ -512,14 +512,14 @@ var/time_last_changed_position = 0 return 0 //Allow instant closing without cooldown if a position has been opened before if(opened_positions[edit_job_target] <= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions-- opened_positions[edit_job_target]-- playsound(src, 'sound/machines/terminal_prompt_deny.ogg', 50, 0) if ("prioritize_job") // TOGGLE WHETHER JOB APPEARS AS PRIORITIZED IN THE LOBBY - if(scan && (access_change_ids in scan.access) && !target_dept) + if(scan && (GLOB.access_change_ids in scan.access) && !target_dept) var/priority_target = href_list["job"] var/datum/job/j = SSjob.GetJob(priority_target) if(!j) @@ -541,7 +541,7 @@ var/time_last_changed_position = 0 sleep(50) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc ) var/t1 = "Crew Manifest:
" - for(var/datum/data/record/t in sortRecord(data_core.general)) + for(var/datum/data/record/t in sortRecord(GLOB.data_core.general)) t1 += t.fields["name"] + " - " + t.fields["rank"] + "
" P.info = t1 P.name = "paper- 'Crew Manifest'" @@ -560,7 +560,7 @@ var/time_last_changed_position = 0 /obj/machinery/computer/card/centcom name = "\improper Centcom identification console" circuit = /obj/item/weapon/circuitboard/computer/card/centcom - req_access = list(access_cent_captain) + req_access = list(GLOB.access_cent_captain) /obj/machinery/computer/card/minor name = "department management console" diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 04be47999684e..5c16861932cc7 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -5,7 +5,7 @@ icon_screen = "dna" icon_keyboard = "med_key" circuit = /obj/item/weapon/circuitboard/computer/cloning - req_access = list(access_heads) //Only used for record deletion right now. + req_access = list(GLOB.access_heads) //Only used for record deletion right now. var/obj/machinery/dna_scannernew/scanner = null //Linked scanner. For scanning. var/list/pods //Linked cloning pods var/temp = "Inactive" diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 230cb5dff3147..f4d13c029b871 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -1,12 +1,10 @@ -var/const/CALL_SHUTTLE_REASON_LENGTH = 12 - // The communications computer /obj/machinery/computer/communications name = "communications console" desc = "This can be used for various important functions. Still under developement." icon_screen = "comm" icon_keyboard = "tech_key" - req_access = list(access_heads) + req_access = list(GLOB.access_heads) circuit = /obj/item/weapon/circuitboard/computer/communications var/authenticated = 0 var/auth_id = "Unknown" //Who is currently logged in? @@ -44,7 +42,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 return TRUE /obj/machinery/computer/communications/New() - shuttle_caller_list += src + GLOB.shuttle_caller_list += src ..() /obj/machinery/computer/communications/process() @@ -103,19 +101,19 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 var/obj/item/device/pda/pda = I I = pda.id if (I && istype(I)) - if(access_captain in I.access) - var/old_level = security_level + if(GLOB.access_captain in I.access) + var/old_level = GLOB.security_level if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this set_security_level(tmp_alertlevel) - if(security_level != old_level) + if(GLOB.security_level != old_level) to_chat(usr, "Authorization confirmed. Modifying security level.") playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) //Only notify the admins if an actual change happened log_game("[key_name(usr)] has changed the security level to [get_security_level()].") message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].") - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) feedback_inc("alert_comms_green",1) if(SEC_LEVEL_BLUE) @@ -168,7 +166,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 to_chat(usr, "You have not met the requirements for purchasing this shuttle.") else if(SSshuttle.points >= S.credit_cost) - var/obj/machinery/shuttle_manipulator/M = locate() in machines + var/obj/machinery/shuttle_manipulator/M = locate() in GLOB.machines if(M) SSshuttle.shuttle_purchased = TRUE M.unload_preview() @@ -359,16 +357,16 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 if("ai-securitylevel") src.tmp_alertlevel = text2num( href_list["newalertlevel"] ) if(!tmp_alertlevel) tmp_alertlevel = 0 - var/old_level = security_level + var/old_level = GLOB.security_level if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel < SEC_LEVEL_GREEN) tmp_alertlevel = SEC_LEVEL_GREEN if(tmp_alertlevel > SEC_LEVEL_BLUE) tmp_alertlevel = SEC_LEVEL_BLUE //Cannot engage delta with this set_security_level(tmp_alertlevel) - if(security_level != old_level) + if(GLOB.security_level != old_level) //Only notify the admins if an actual change happened log_game("[key_name(usr)] has changed the security level to [get_security_level()].") message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].") - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) feedback_inc("alert_comms_green",1) if(SEC_LEVEL_BLUE) @@ -509,7 +507,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) if(STATE_ALERT_LEVEL) dat += "Current alert level: [get_security_level()]
" - if(security_level == SEC_LEVEL_DELTA) + if(GLOB.security_level == SEC_LEVEL_DELTA) dat += "The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate." else dat += "Blue
" @@ -520,7 +518,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 dat += "Swipe ID to confirm change.
" if(STATE_TOGGLE_EMERGENCY) playsound(src, 'sound/machines/terminal_prompt.ogg', 50, 0) - if(emergency_access == 1) + if(GLOB.emergency_access == 1) dat += "Emergency Maintenance Access is currently ENABLED" dat += "
Restore maintenance access restrictions?
\[ OK | Cancel \]" else @@ -640,14 +638,14 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 if(STATE_ALERT_LEVEL) dat += "Current alert level: [get_security_level()]
" - if(security_level == SEC_LEVEL_DELTA) + if(GLOB.security_level == SEC_LEVEL_DELTA) dat += "The self-destruct mechanism is active. Find a way to deactivate the mechanism to lower the alert level or evacuate." else dat += "Blue
" dat += "Green" if(STATE_TOGGLE_EMERGENCY) - if(emergency_access == 1) + if(GLOB.emergency_access == 1) dat += "Emergency Maintenance Access is currently ENABLED" dat += "
Restore maintenance access restrictions?
\[ OK | Cancel \]" else @@ -688,7 +686,7 @@ var/const/CALL_SHUTTLE_REASON_LENGTH = 12 /obj/machinery/computer/communications/Destroy() - shuttle_caller_list -= src + GLOB.shuttle_caller_list -= src SSshuttle.autoEvac() return ..() diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm index 2a8cd1ac9051d..27ef955ccc5f3 100644 --- a/code/game/machinery/computer/crew.dm +++ b/code/game/machinery/computer/crew.dm @@ -7,27 +7,22 @@ idle_power_usage = 250 active_power_usage = 500 circuit = /obj/item/weapon/circuitboard/computer/crew - var/monitor = null //For VV debugging purposes light_color = LIGHT_COLOR_BLUE -/obj/machinery/computer/crew/New() - monitor = crewmonitor - return ..() - /obj/machinery/computer/crew/attack_ai(mob/user) if(stat & (BROKEN|NOPOWER)) return - crewmonitor.show(user) + GLOB.crewmonitor.show(user) /obj/machinery/computer/crew/attack_hand(mob/user) if(..()) return if(stat & (BROKEN|NOPOWER)) return - crewmonitor.show(user) + GLOB.crewmonitor.show(user) -var/global/datum/crewmonitor/crewmonitor = new +GLOBAL_DATUM_INIT(crewmonitor, /datum/crewmonitor, new) /datum/crewmonitor var/list/jobs @@ -151,7 +146,7 @@ var/global/datum/crewmonitor/crewmonitor = new var/pos_y var/life_status - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) // Check if their z-level is correct and if they are wearing a uniform. // Accept H.z==0 as well in case the mob is inside an object. if ((H.z == 0 || H.z == z) && istype(H.w_uniform, /obj/item/clothing/under)) @@ -256,13 +251,13 @@ var/global/datum/crewmonitor/crewmonitor = new . = ..() - if (old_z != src.z) crewmonitor.queueUpdate(old_z) - crewmonitor.queueUpdate(src.z) + if (old_z != src.z) GLOB.crewmonitor.queueUpdate(old_z) + GLOB.crewmonitor.queueUpdate(src.z) else return ..() /datum/crewmonitor/proc/queueUpdate(z) - addtimer(CALLBACK(crewmonitor, .proc/update, z), 5, TIMER_UNIQUE) + addtimer(CALLBACK(src, .proc/update, z), 5, TIMER_UNIQUE) /datum/crewmonitor/proc/sendResources(var/client/client) send_asset(client, "crewmonitor.js") diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm index a100f16184e5e..4837e64e89f6c 100644 --- a/code/game/machinery/computer/dna_console.dm +++ b/code/game/machinery/computer/dna_console.dm @@ -401,12 +401,12 @@ if(buffer_slot["SE"]) I = new /obj/item/weapon/dnainjector/timed(loc) var/powers = 0 - for(var/datum/mutation/human/HM in good_mutations + bad_mutations + not_good_mutations) + for(var/datum/mutation/human/HM in GLOB.good_mutations + GLOB.bad_mutations + GLOB.not_good_mutations) if(HM.check_block_string(buffer_slot["SE"])) I.add_mutations.Add(HM) - if(HM in good_mutations) + if(HM in GLOB.good_mutations) powers += 1 - if(HM in bad_mutations + not_good_mutations) + if(HM in GLOB.bad_mutations + GLOB.not_good_mutations) powers -= 1 //To prevent just unlocking everything to get all powers to a syringe for max tech else I.remove_mutations.Add(HM) diff --git a/code/game/machinery/computer/gulag_teleporter.dm b/code/game/machinery/computer/gulag_teleporter.dm index b9dc410e57626..60376d4eadcd3 100644 --- a/code/game/machinery/computer/gulag_teleporter.dm +++ b/code/game/machinery/computer/gulag_teleporter.dm @@ -4,7 +4,7 @@ desc = "Used to send criminals to the Labor Camp" icon_screen = "explosive" icon_keyboard = "security_key" - req_access = list(access_armory) + req_access = list(GLOB.access_armory) circuit = /obj/item/weapon/circuitboard/computer/gulag_teleporter_console var/default_goal = 200 var/obj/item/weapon/card/id/prisoner/id = null @@ -38,7 +38,7 @@ return ..() /obj/machinery/computer/gulag_teleporter_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "gulag_console", name, 455, 440, master_ui, state) @@ -55,8 +55,8 @@ prisoner_list["name"] = prisoner.real_name if(id) can_teleport = TRUE - if(!isnull(data_core.general)) - for(var/r in data_core.security) + if(!isnull(GLOB.data_core.general)) + for(var/r in GLOB.data_core.security) var/datum/data/record/R = r if(R.fields["name"] == prisoner_list["name"]) temporary_record = R @@ -135,7 +135,7 @@ /obj/machinery/computer/gulag_teleporter_computer/proc/findteleporter() var/obj/machinery/gulag_teleporter/teleporterf = null - for(dir in cardinal) + for(dir in GLOB.cardinal) teleporterf = locate(/obj/machinery/gulag_teleporter, get_step(src, dir)) if(teleporterf && teleporterf.is_operational()) return teleporterf diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index ce09f86046b8b..38f44a41f5e37 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -5,7 +5,7 @@ desc = "This can be used to check medical records." icon_screen = "medcomp" icon_keyboard = "med_key" - req_one_access = list(access_medical, access_forensics_lockers) + req_one_access = list(GLOB.access_medical, GLOB.access_forensics_lockers) circuit = /obj/item/weapon/circuitboard/computer/med_data var/obj/item/weapon/card/id/scan = null var/authenticated = null @@ -72,11 +72,11 @@ "} - if(!isnull(data_core.general)) - for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order)) + if(!isnull(GLOB.data_core.general)) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) var/blood_type = "" var/b_dna = "" - for(var/datum/data/record/E in data_core.medical) + for(var/datum/data/record/E in GLOB.data_core.medical) if((E.fields["name"] == R.fields["name"] && E.fields["id"] == R.fields["id"])) blood_type = E.fields["blood_type"] b_dna = E.fields["b_dna"] @@ -98,8 +98,8 @@ dat += text("", R.fields["p_stat"]) dat += text("", R.fields["m_stat"]) dat += "
JobSlotsOpen jobClose jobPrioritize
[][]

" -// if(data_core.general) -// for(var/datum/data/record/R in sortRecord(data_core.general)) +// if(GLOB.data_core.general) +// for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) // dat += "[R.fields["id"]]: [R.fields["name"]]
" // //Foreach goto(132) dat += text("
Back", src) @@ -108,7 +108,7 @@ if(4) dat += "" - if(active1 in data_core.general) + if(active1 in GLOB.data_core.general) if(istype(active1.fields["photo_front"], /obj/item/weapon/photo)) var/obj/item/weapon/photo/P1 = active1.fields["photo_front"] user << browse_rsc(P1.img, "photo_front") @@ -130,7 +130,7 @@ dat += "" dat += "" - if(active2 in data_core.medical) + if(active2 in GLOB.data_core.medical) dat += "" dat += "" dat += "" @@ -172,7 +172,7 @@ dat += "Back" dat += "
Medical Robots:" var/bdat = null - for(var/mob/living/simple_animal/bot/medbot/M in living_mob_list) + for(var/mob/living/simple_animal/bot/medbot/M in GLOB.living_mob_list) if(M.z != src.z) continue //only find medibots on the same z-level as the computer var/turf/bl = get_turf(M) @@ -201,9 +201,9 @@ . = ..() if(.) return . - if(!(active1 in data_core.general)) + if(!(active1 in GLOB.data_core.general)) src.active1 = null - if(!(active2 in data_core.medical)) + if(!(active2 in GLOB.data_core.medical)) src.active2 = null if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr) || IsAdminGhost(usr)) @@ -293,7 +293,7 @@ else if(href_list["del_all2"]) investigate_log("[usr.name] ([usr.key]) has deleted all medical records.", "records") - data_core.medical.Cut() + GLOB.data_core.medical.Cut() src.temp = "All records deleted." else if(href_list["field"]) @@ -464,9 +464,9 @@ active2 = null else if(href_list["d_rec"]) - active1 = find_record("id", href_list["d_rec"], data_core.general) + active1 = find_record("id", href_list["d_rec"], GLOB.data_core.general) if(active1) - active2 = find_record("id", href_list["d_rec"], data_core.medical) + active2 = find_record("id", href_list["d_rec"], GLOB.data_core.medical) if(!active2) active1 = null screen = 4 @@ -488,12 +488,12 @@ R.fields["cdi"] = "None" R.fields["cdi_d"] = "No diseases have been diagnosed at the moment." R.fields["notes"] = "No notes." - data_core.medical += R + GLOB.data_core.medical += R src.active2 = R src.screen = 4 else if(href_list["add_c"]) - if(!(active2 in data_core.medical)) + if(!(active2 in GLOB.data_core.medical)) return var/a2 = src.active2 var/t1 = stripped_multiline_input("Add Comment:", "Med. records", null, null) @@ -502,7 +502,7 @@ var/counter = 1 while(src.active2.fields[text("com_[]", counter)]) counter++ - src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), year_integer+540, t1) + src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) else if(href_list["del_c"]) if((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])])) @@ -515,7 +515,7 @@ src.active1 = null src.active2 = null t1 = lowertext(t1) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"]) || t1 == lowertext(R.fields["b_dna"]))) src.active2 = R else @@ -523,7 +523,7 @@ if(!( src.active2 )) src.temp = text("Could not locate record [].", sanitize(t1)) else - for(var/datum/data/record/E in data_core.general) + for(var/datum/data/record/E in GLOB.data_core.general) if((E.fields["name"] == src.active2.fields["name"] || E.fields["id"] == src.active2.fields["id"])) src.active1 = E else @@ -533,28 +533,28 @@ else if(href_list["print_p"]) if(!( src.printing )) src.printing = 1 - data_core.medicalPrintCount++ + GLOB.data_core.medicalPrintCount++ playsound(loc, 'sound/items/poster_being_created.ogg', 100, 1) sleep(30) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc ) - P.info = "
Medical Record - (MR-[data_core.medicalPrintCount])

" - if(active1 in data_core.general) + P.info = "
Medical Record - (MR-[GLOB.data_core.medicalPrintCount])

" + if(active1 in GLOB.data_core.general) P.info += text("Name: [] ID: []
\nSex: []
\nAge: []
", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["sex"], src.active1.fields["age"]) if(config.mutant_races) P.info += "\nSpecies: [active1.fields["species"]]
" P.info += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"]) else P.info += "General Record Lost!
" - if(active2 in data_core.medical) + if(active2 in GLOB.data_core.medical) P.info += text("
\n
Medical Data

\nBlood Type: []
\nDNA: []
\n
\nMinor Disabilities: []
\nDetails: []
\n
\nMajor Disabilities: []
\nDetails: []
\n
\nAllergies: []
\nDetails: []
\n
\nCurrent Diseases: [] (per disease info placed in log/comment section)
\nDetails: []
\n
\nImportant Notes:
\n\t[]
\n
\n
Comments/Log

", src.active2.fields["blood_type"], src.active2.fields["b_dna"], src.active2.fields["mi_dis"], src.active2.fields["mi_dis_d"], src.active2.fields["ma_dis"], src.active2.fields["ma_dis_d"], src.active2.fields["alg"], src.active2.fields["alg_d"], src.active2.fields["cdi"], src.active2.fields["cdi_d"], src.active2.fields["notes"]) var/counter = 1 while(src.active2.fields[text("com_[]", counter)]) P.info += text("[]
", src.active2.fields[text("com_[]", counter)]) counter++ - P.name = text("MR-[] '[]'", data_core.medicalPrintCount, src.active1.fields["name"]) + P.name = text("MR-[] '[]'", GLOB.data_core.medicalPrintCount, src.active1.fields["name"]) else P.info += "Medical Record Lost!
" - P.name = text("MR-[] '[]'", data_core.medicalPrintCount, "Record Lost") + P.name = text("MR-[] '[]'", GLOB.data_core.medicalPrintCount, "Record Lost") P.info += "" src.printing = null @@ -564,7 +564,7 @@ /obj/machinery/computer/med_data/emp_act(severity) if(!(stat & (BROKEN|NOPOWER))) - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if(prob(10/severity)) switch(rand(1,6)) if(1) diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 17cb756cf1667..00ac48ad5a754 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -60,8 +60,8 @@ ..() //Is the server isn't linked to a server, and there's a server available, default it to the first one in the list. if(!linkedServer) - if(message_servers && message_servers.len > 0) - linkedServer = message_servers[1] + if(GLOB.message_servers && GLOB.message_servers.len > 0) + linkedServer = GLOB.message_servers[1] /obj/machinery/computer/message_monitor/attack_hand(mob/living/user) if(..()) @@ -269,11 +269,11 @@ if(auth) linkedServer.active = !linkedServer.active //Find a server if (href_list["find"]) - if(message_servers && message_servers.len > 1) - src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers + if(GLOB.message_servers && GLOB.message_servers.len > 1) + src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in GLOB.message_servers message = "NOTICE: Server selected." - else if(message_servers && message_servers.len > 0) - linkedServer = message_servers[1] + else if(GLOB.message_servers && GLOB.message_servers.len > 0) + linkedServer = GLOB.message_servers[1] message = "NOTICE: Only Single Server Detected - Server selected." else message = noserver @@ -376,7 +376,7 @@ if("Recepient") //Get out list of viable PDAs var/list/obj/item/device/pda/sendPDAs = get_viewable_pdas() - if(PDAs && PDAs.len > 0) + if(GLOB.PDAs && GLOB.PDAs.len > 0) customrecepient = input(usr, "Select a PDA from the list.") as null|anything in sortNames(sendPDAs) else customrecepient = null @@ -458,8 +458,8 @@ /obj/item/weapon/paper/monitorkey/New() ..() spawn(10) - if(message_servers) - for(var/obj/machinery/message_server/server in message_servers) + if(GLOB.message_servers) + for(var/obj/machinery/message_server/server in GLOB.message_servers) if(!isnull(server)) if(!isnull(server.decryptkey)) info = "

Daily Key Reset


The new message monitor key is '[server.decryptkey]'.
Please keep this a secret and away from the clown.
If necessary, change the password to a more secure one." diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index b68b3efb61311..eaa256b5cd066 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -130,7 +130,7 @@ name = "\improper ProComp Executive IIc" desc = "The Syndicate operate on a tight budget. Operates external airlocks." title = "External Airlock Controls" - req_access = list(access_syndicate) + req_access = list(GLOB.access_syndicate) /obj/machinery/computer/pod/old/syndicate/attack_hand(mob/user) if(!allowed(user)) diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index c91828b71c226..27d4275ee5afc 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -3,7 +3,7 @@ desc = "Used to manage tracking implants placed inside criminals." icon_screen = "explosive" icon_keyboard = "security_key" - req_access = list(access_brig) + req_access = list(GLOB.access_brig) var/id = 0 var/temp = null var/status = 0 @@ -34,7 +34,7 @@ dat += "

Prisoner Implant Management

" dat += "
Chemical Implants
" var/turf/Tr = null - for(var/obj/item/weapon/implant/chem/C in tracked_chem_implants) + for(var/obj/item/weapon/implant/chem/C in GLOB.tracked_chem_implants) Tr = get_turf(C) if((Tr) && (Tr.z != src.z)) continue//Out of range @@ -47,7 +47,7 @@ dat += "((10))
" dat += "********************************
" dat += "
Tracking Implants
" - for(var/obj/item/weapon/implant/tracking/T in tracked_implants) + for(var/obj/item/weapon/implant/tracking/T in GLOB.tracked_implants) if(!isliving(T.imp_in)) continue Tr = get_turf(T) @@ -111,16 +111,16 @@ num = min(num,1000) //Cap the quota to the equivilent of 10 minutes. inserted_id.goal = num else if(href_list["inject1"]) - var/obj/item/weapon/implant/I = locate(href_list["inject1"]) in tracked_chem_implants + var/obj/item/weapon/implant/I = locate(href_list["inject1"]) in GLOB.tracked_chem_implants if(I && istype(I)) I.activate(1) else if(href_list["inject5"]) - var/obj/item/weapon/implant/I = locate(href_list["inject5"]) in tracked_chem_implants + var/obj/item/weapon/implant/I = locate(href_list["inject5"]) in GLOB.tracked_chem_implants if(I && istype(I)) I.activate(5) else if(href_list["inject10"]) - var/obj/item/weapon/implant/I = locate(href_list["inject10"]) in tracked_chem_implants + var/obj/item/weapon/implant/I = locate(href_list["inject10"]) in GLOB.tracked_chem_implants if(I && istype(I)) I.activate(10) @@ -134,7 +134,7 @@ var/warning = copytext(sanitize(input(usr,"Message:","Enter your message here!","")),1,MAX_MESSAGE_LEN) if(!warning) return - var/obj/item/weapon/implant/I = locate(href_list["warn"]) in tracked_implants + var/obj/item/weapon/implant/I = locate(href_list["warn"]) in GLOB.tracked_implants if(I && istype(I) && I.imp_in) var/mob/living/R = I.imp_in to_chat(R, "You hear a voice in your head saying: '[warning]'") diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm index 2e81d9b19f91b..fe3992724be00 100644 --- a/code/game/machinery/computer/robot.dm +++ b/code/game/machinery/computer/robot.dm @@ -6,7 +6,7 @@ desc = "Used to remotely lockdown or detonate linked Cyborgs." icon_screen = "robot" icon_keyboard = "rd_key" - req_access = list(access_robotics) + req_access = list(GLOB.access_robotics) circuit = /obj/item/weapon/circuitboard/computer/robotics var/temp = null @@ -37,7 +37,7 @@ user.set_machine(src) var/dat var/robots = 0 - for(var/mob/living/silicon/robot/R in mob_list) + for(var/mob/living/silicon/robot/R in GLOB.mob_list) if(!can_control(user, R)) continue robots++ @@ -75,7 +75,7 @@ dat += "
" var/drones = 0 - for(var/mob/living/simple_animal/drone/D in mob_list) + for(var/mob/living/simple_animal/drone/D in GLOB.mob_list) if(D.hacked) continue drones++ @@ -103,7 +103,7 @@ else if (href_list["killbot"]) if(src.allowed(usr)) - var/mob/living/silicon/robot/R = locate(href_list["killbot"]) in silicon_mobs + var/mob/living/silicon/robot/R = locate(href_list["killbot"]) in GLOB.silicon_mobs if(can_control(usr, R)) var/choice = input("Are you certain you wish to detonate [R.name]?") in list("Confirm", "Abort") if(choice == "Confirm" && can_control(usr, R) && !..()) @@ -123,7 +123,7 @@ else if (href_list["stopbot"]) if(src.allowed(usr)) - var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) in silicon_mobs + var/mob/living/silicon/robot/R = locate(href_list["stopbot"]) in GLOB.silicon_mobs if(can_control(usr, R)) var/choice = input("Are you certain you wish to [R.canmove ? "lock down" : "release"] [R.name]?") in list("Confirm", "Abort") if(choice == "Confirm" && can_control(usr, R) && !..()) @@ -139,7 +139,7 @@ else if (href_list["magbot"]) if((issilicon(usr) && is_special_character(usr)) || IsAdminGhost(usr)) - var/mob/living/silicon/robot/R = locate(href_list["magbot"]) in silicon_mobs + var/mob/living/silicon/robot/R = locate(href_list["magbot"]) in GLOB.silicon_mobs if(istype(R) && !R.emagged && ((R.syndicate && R == usr) || R.connected_ai == usr || IsAdminGhost(usr)) && !R.scrambledcodes && can_control(usr, R)) log_game("[key_name(usr)] emagged [R.name] using robotic console!") message_admins("[key_name_admin(usr)] emagged cyborg [key_name_admin(R)] using robotic console!") @@ -149,7 +149,7 @@ else if(href_list["convert"]) if(issilicon(usr) && is_special_character(usr)) - var/mob/living/silicon/robot/R = locate(href_list["convert"]) in silicon_mobs + var/mob/living/silicon/robot/R = locate(href_list["convert"]) in GLOB.silicon_mobs if(istype(R) && !is_servant_of_ratvar(R) && is_servant_of_ratvar(usr) && R.connected_ai == usr) log_game("[key_name(usr)] converted [R.name] using robotic console!") message_admins("[key_name_admin(usr)] converted cyborg [key_name_admin(R)] using robotic console!") diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 4c370c4b75cba..ef669cfd025e7 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -3,7 +3,7 @@ desc = "Used to view and edit personnel's security records." icon_screen = "security" icon_keyboard = "security_key" - req_one_access = list(access_security, access_forensics_lockers) + req_one_access = list(GLOB.access_security, GLOB.access_forensics_lockers) circuit = /obj/item/weapon/circuitboard/computer/secure_data var/obj/item/weapon/card/id/scan = null var/authenticated = null @@ -122,10 +122,10 @@ "} - if(!isnull(data_core.general)) - for(var/datum/data/record/R in sortRecord(data_core.general, sortBy, order)) + if(!isnull(GLOB.data_core.general)) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general, sortBy, order)) var/crimstat = "" - for(var/datum/data/record/E in data_core.security) + for(var/datum/data/record/E in GLOB.data_core.security) if((E.fields["name"] == R.fields["name"]) && (E.fields["id"] == R.fields["id"])) crimstat = E.fields["criminal"] var/background @@ -163,7 +163,7 @@ dat += "
Delete All Records

Back" if(3) dat += "Security Record
" - if(istype(active1, /datum/data/record) && data_core.general.Find(active1)) + if(istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)) if(istype(active1.fields["photo_front"], /obj/item/weapon/photo)) var/obj/item/weapon/photo/P1 = active1.fields["photo_front"] user << browse_rsc(P1.img, "photo_front") @@ -189,7 +189,7 @@
Medical Record
General Record Lost!

Medical Data
Blood Type: [active2.fields["blood_type"]] 
DNA: [active2.fields["b_dna"]] 

Minor Disabilities:

 [active2.fields["mi_dis"]] 
Fingerprints Criminal Status
"} else dat += "
General Record Lost!
" - if((istype(active2, /datum/data/record) && data_core.security.Find(active2))) + if((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2))) dat += "Security Data" dat += "
Criminal Status: [active2.fields["criminal"]]" dat += "

Minor Crimes: Add New" @@ -262,9 +262,9 @@ What a mess.*/ . = ..() if(.) return . - if(!( data_core.general.Find(active1) )) + if(!( GLOB.data_core.general.Find(active1) )) active1 = null - if(!( data_core.security.Find(active2) )) + if(!( GLOB.data_core.security.Find(active2) )) active2 = null if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || issilicon(usr) || IsAdminGhost(usr)) usr.set_machine(src) @@ -341,10 +341,10 @@ What a mess.*/ if("Browse Record") var/datum/data/record/R = locate(href_list["d_rec"]) var/S = locate(href_list["d_rec"]) - if(!( data_core.general.Find(R) )) + if(!( GLOB.data_core.general.Find(R) )) temp = "Record Not Found!" else - for(var/datum/data/record/E in data_core.security) + for(var/datum/data/record/E in GLOB.data_core.security) if((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"])) S = E active1 = R @@ -355,19 +355,19 @@ What a mess.*/ if("Print Record") if(!( printing )) printing = 1 - data_core.securityPrintCount++ + GLOB.data_core.securityPrintCount++ playsound(loc, 'sound/items/poster_being_created.ogg', 100, 1) sleep(30) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( loc ) - P.info = "
Security Record - (SR-[data_core.securityPrintCount])

" - if((istype(active1, /datum/data/record) && data_core.general.Find(active1))) + P.info = "
Security Record - (SR-[GLOB.data_core.securityPrintCount])

" + if((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1))) P.info += text("Name: [] ID: []
\nSex: []
\nAge: []
", active1.fields["name"], active1.fields["id"], active1.fields["sex"], active1.fields["age"]) if(config.mutant_races) P.info += "\nSpecies: [active1.fields["species"]]
" P.info += text("\nFingerprint: []
\nPhysical Status: []
\nMental Status: []
", active1.fields["fingerprint"], active1.fields["p_stat"], active1.fields["m_stat"]) else P.info += "General Record Lost!
" - if((istype(active2, /datum/data/record) && data_core.security.Find(active2))) + if((istype(active2, /datum/data/record) && GLOB.data_core.security.Find(active2))) P.info += text("
\n
Security Data

\nCriminal Status: []", active2.fields["criminal"]) P.info += "
\n
\nMinor Crimes:
\n" @@ -408,10 +408,10 @@ What a mess.*/ while(active2.fields[text("com_[]", counter)]) P.info += text("[]
", active2.fields[text("com_[]", counter)]) counter++ - P.name = text("SR-[] '[]'", data_core.securityPrintCount, active1.fields["name"]) + P.name = text("SR-[] '[]'", GLOB.data_core.securityPrintCount, active1.fields["name"]) else P.info += "Security Record Lost!
" - P.name = text("SR-[] '[]'", data_core.securityPrintCount, "Record Lost") + P.name = text("SR-[] '[]'", GLOB.data_core.securityPrintCount, "Record Lost") P.info += "" printing = null if("Print Poster") @@ -439,7 +439,7 @@ What a mess.*/ playsound(loc, 'sound/items/poster_being_created.ogg', 100, 1) printing = 1 sleep(30) - if((istype(active1, /datum/data/record) && data_core.general.Find(active1)))//make sure the record still exists. + if((istype(active1, /datum/data/record) && GLOB.data_core.general.Find(active1)))//make sure the record still exists. var/obj/item/weapon/photo/photo = active1.fields["photo_front"] new /obj/item/weapon/poster/wanted(src.loc, photo.img, wanted_name, info) printing = 0 @@ -453,9 +453,9 @@ What a mess.*/ if("Purge All Records") investigate_log("[usr.name] ([usr.key]) has purged all the security records.", "records") - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) qdel(R) - data_core.security.Cut() + GLOB.data_core.security.Cut() temp = "All Security records deleted." if("Add Entry") @@ -468,7 +468,7 @@ What a mess.*/ var/counter = 1 while(active2.fields[text("com_[]", counter)]) counter++ - active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), year_integer+540, t1) + active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [] [], []
[]", src.authenticated, src.rank, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) if("Delete Record (ALL)") if(active1) @@ -496,7 +496,7 @@ What a mess.*/ R.fields["mi_crim"] = list() R.fields["ma_crim"] = list() R.fields["notes"] = "No notes." - data_core.security += R + GLOB.data_core.security += R active2 = R screen = 3 @@ -515,7 +515,7 @@ What a mess.*/ G.fields["fingerprint"] = "?????" G.fields["p_stat"] = "Active" G.fields["m_stat"] = "Stable" - data_core.general += G + GLOB.data_core.general += G active1 = G //Security Record @@ -527,7 +527,7 @@ What a mess.*/ R.fields["mi_crim"] = list() R.fields["ma_crim"] = list() R.fields["notes"] = "No notes." - data_core.security += R + GLOB.data_core.security += R active2 = R //Medical Record @@ -545,7 +545,7 @@ What a mess.*/ M.fields["cdi"] = "None" M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." M.fields["notes"] = "No notes." - data_core.medical += M + GLOB.data_core.medical += M @@ -593,7 +593,7 @@ What a mess.*/ active1.fields["age"] = t1 if("species") if(istype(active1, /datum/data/record)) - var/t1 = input("Select a species", "Species Selection") as null|anything in roundstart_species + var/t1 = input("Select a species", "Species Selection") as null|anything in GLOB.roundstart_species if(!canUseSecurityRecordsConsole(usr, t1, a1)) return active1.fields["species"] = t1 @@ -623,28 +623,28 @@ What a mess.*/ var/t2 = stripped_multiline_input(usr, "Please input minor crime details:", "Secure. records", "", null) if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) return - var/crime = data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text()) - data_core.addMinorCrime(active1.fields["id"], crime) + var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text()) + GLOB.data_core.addMinorCrime(active1.fields["id"], crime) if("mi_crim_delete") if(istype(active1, /datum/data/record)) if(href_list["cdataid"]) if(!canUseSecurityRecordsConsole(usr, "delete", null, a2)) return - data_core.removeMinorCrime(active1.fields["id"], href_list["cdataid"]) + GLOB.data_core.removeMinorCrime(active1.fields["id"], href_list["cdataid"]) if("ma_crim_add") if(istype(active1, /datum/data/record)) var/t1 = stripped_input(usr, "Please input major crime names:", "Secure. records", "", null) var/t2 = stripped_multiline_input(usr, "Please input major crime details:", "Secure. records", "", null) if(!canUseSecurityRecordsConsole(usr, t1, null, a2)) return - var/crime = data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text()) - data_core.addMajorCrime(active1.fields["id"], crime) + var/crime = GLOB.data_core.createCrimeEntry(t1, t2, authenticated, worldtime2text()) + GLOB.data_core.addMajorCrime(active1.fields["id"], crime) if("ma_crim_delete") if(istype(active1, /datum/data/record)) if(href_list["cdataid"]) if(!canUseSecurityRecordsConsole(usr, "delete", null, a2)) return - data_core.removeMajorCrime(active1.fields["id"], href_list["cdataid"]) + GLOB.data_core.removeMajorCrime(active1.fields["id"], href_list["cdataid"]) if("notes") if(istype(active2, /datum/data/record)) var/t1 = stripped_input(usr, "Please summarize notes:", "Secure. records", active2.fields["notes"], null) @@ -697,7 +697,7 @@ What a mess.*/ if("released") active2.fields["criminal"] = "Discharged" investigate_log("[active1.fields["name"]] has been set from [old_field] to [active2.fields["criminal"]] by [usr.name] ([usr.key]).", "records") - for(var/mob/living/carbon/human/H in mob_list) //thanks for forcing me to do this, whoever wrote this shitty records system + for(var/mob/living/carbon/human/H in GLOB.mob_list) //thanks for forcing me to do this, whoever wrote this shitty records system H.sec_hud_set_security_status() if("Delete Record (Security) Execute") investigate_log("[usr.name] ([usr.key]) has deleted the security records for [active1.fields["name"]].", "records") @@ -708,7 +708,7 @@ What a mess.*/ if("Delete Record (ALL) Execute") if(active1) investigate_log("[usr.name] ([usr.key]) has deleted all records for [active1.fields["name"]].", "records") - for(var/datum/data/record/R in data_core.medical) + for(var/datum/data/record/R in GLOB.data_core.medical) if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"])) qdel(R) break @@ -742,14 +742,14 @@ What a mess.*/ ..(severity) return - for(var/datum/data/record/R in data_core.security) + for(var/datum/data/record/R in GLOB.data_core.security) if(prob(10/severity)) switch(rand(1,8)) if(1) if(prob(10)) R.fields["name"] = "[pick(lizard_name(MALE),lizard_name(FEMALE))]" else - R.fields["name"] = "[pick(pick(first_names_male), pick(first_names_female))] [pick(last_names)]" + R.fields["name"] = "[pick(pick(GLOB.first_names_male), pick(GLOB.first_names_female))] [pick(GLOB.last_names)]" if(2) R.fields["sex"] = pick("Male", "Female") if(3) @@ -761,9 +761,9 @@ What a mess.*/ if(6) R.fields["m_stat"] = pick("*Insane*", "*Unstable*", "*Watch*", "Stable") if(7) - R.fields["species"] = pick(roundstart_species) + R.fields["species"] = pick(GLOB.roundstart_species) if(8) - var/datum/data/record/G = pick(data_core.general) + var/datum/data/record/G = pick(GLOB.data_core.general) R.fields["photo_front"] = G.fields["photo_front"] R.fields["photo_side"] = G.fields["photo_side"] continue diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm index 5b8a69e7559fd..443c0c1fdf548 100644 --- a/code/game/machinery/computer/station_alert.dm +++ b/code/game/machinery/computer/station_alert.dm @@ -9,7 +9,7 @@ light_color = LIGHT_COLOR_CYAN /obj/machinery/computer/station_alert/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "station_alert", name, 300, 500, master_ui, state) diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm index 75e163a9c46bc..1515c1f32fb6f 100644 --- a/code/game/machinery/computer/telecrystalconsoles.dm +++ b/code/game/machinery/computer/telecrystalconsoles.dm @@ -1,6 +1,6 @@ #define NUKESCALINGMODIFIER 1 -var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","Foxtrot","Zero", "Niner") +GLOBAL_LIST_INIT(possible_uplinker_IDs, list("Alfa","Bravo","Charlie","Delta","Echo","Foxtrot","Zero", "Niner")) /obj/machinery/computer/telecrystals name = "\improper Telecrystal assignment station" @@ -24,7 +24,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F /obj/machinery/computer/telecrystals/uplinker/Initialize() ..() - var/ID = pick_n_take(possible_uplinker_IDs) + var/ID = pick_n_take(GLOB.possible_uplinker_IDs) if(!ID) ID = rand(1,999) name = "[name] [ID]" @@ -144,8 +144,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F /obj/machinery/computer/telecrystals/boss/proc/getDangerous()//This scales the TC assigned with the round population. ..() - var/danger - danger = joined_player_list.len - SSticker.mode.syndicates.len + var/danger = GLOB.joined_player_list.len - SSticker.mode.syndicates.len danger = Ceiling(danger, 10) scaleTC(danger) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index ff599d0de5235..df5366024b429 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -41,7 +41,6 @@ #define ELECTRIFIED_PERMANENT -1 -var/list/airlock_overlays = list() /obj/machinery/door/airlock name = "airlock" @@ -95,12 +94,14 @@ var/list/airlock_overlays = list() var/air_tight = FALSE //TRUE means density will be set as soon as the door begins to close var/prying_so_hard = FALSE + var/static/list/airlock_overlays = list() + /obj/machinery/door/airlock/Initialize() ..() wires = new /datum/wires/airlock(src) if(src.closeOtherId != null) spawn (5) - for (var/obj/machinery/door/airlock/A in airlocks) + for (var/obj/machinery/door/airlock/A in GLOB.airlocks) if(A.closeOtherId == src.closeOtherId && A != src) src.closeOther = A break @@ -115,7 +116,7 @@ var/list/airlock_overlays = list() if(damage_deflection == AIRLOCK_DAMAGE_DEFLECTION_N && security_level > AIRLOCK_SECURITY_METAL) damage_deflection = AIRLOCK_DAMAGE_DEFLECTION_R prepare_huds() - var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC] diag_hud.add_to_hud(src) diag_hud_set_electrified() @@ -212,7 +213,7 @@ var/list/airlock_overlays = list() cyclelinkedairlock.cyclelinkedairlock = null cyclelinkedairlock = null if(id_tag) - for(var/obj/machinery/doorButtons/D in machines) + for(var/obj/machinery/doorButtons/D in GLOB.machines) D.removeMe(src) return ..() @@ -491,6 +492,9 @@ var/list/airlock_overlays = list() add_overlay(damag_overlay) /proc/get_airlock_overlay(icon_state, icon_file) + var/obj/machinery/door/airlock/A + pass(A) //suppress unused warning + var/list/airlock_overlays = A.airlock_overlays var/iconkey = "[icon_state][icon_file]" if(airlock_overlays[iconkey]) return airlock_overlays[iconkey] diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm index 9771c9176389a..705eafa381579 100644 --- a/code/game/machinery/doors/airlock_electronics.dm +++ b/code/game/machinery/doors/airlock_electronics.dm @@ -1,12 +1,12 @@ /obj/item/weapon/electronics/airlock name = "airlock electronics" - req_access = list(access_maint_tunnels) + req_access = list(GLOB.access_maint_tunnels) var/list/accesses = list() var/one_access = 0 /obj/item/weapon/electronics/airlock/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = hands_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state) SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "airlock_electronics", name, 975, 420, master_ui, state) diff --git a/code/game/machinery/doors/alarmlock.dm b/code/game/machinery/doors/alarmlock.dm index 65a25732c77bf..0966916559d53 100644 --- a/code/game/machinery/doors/alarmlock.dm +++ b/code/game/machinery/doors/alarmlock.dm @@ -24,7 +24,7 @@ /obj/machinery/door/airlock/alarmlock/Initialize() ..() SSradio.remove_object(src, air_frequency) - air_connection = SSradio.add_object(src, air_frequency, RADIO_TO_AIRALARM) + air_connection = SSradio.add_object(src, air_frequency, GLOB.RADIO_TO_AIRALARM) open() /obj/machinery/door/airlock/alarmlock/receive_signal(datum/signal/signal) diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index af0a4940e70d0..f2ed267e4ee5f 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -23,7 +23,7 @@ icon = 'icons/obj/status_display.dmi' icon_state = "frame" desc = "A remote control for a door." - req_access = list(access_security) + req_access = list(GLOB.access_security) anchored = 1 density = 0 var/id = null // id of linked machinery/lockers @@ -112,8 +112,8 @@ return 0 if(!forced) - Radio.set_frequency(SEC_FREQ) - Radio.talk_into(src, "Timer has expired. Releasing prisoner.", SEC_FREQ, get_default_language()) + Radio.set_frequency(GLOB.SEC_FREQ) + Radio.talk_into(src, "Timer has expired. Releasing prisoner.", GLOB.SEC_FREQ, get_default_language()) timing = FALSE activation_time = null @@ -147,7 +147,7 @@ timer_duration = new_time /obj/machinery/door_timer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "brig_timer", name, 300, 200, master_ui, state) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index a30e24d3c426a..c57c210855a10 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -40,7 +40,7 @@ layer = OPEN_DOOR_LAYER //Under all objects if opened. 2.7 due to tables being at 2.6 update_freelook_sight() air_update_turf(1) - airlocks += src + GLOB.airlocks += src spark_system = new /datum/effect_system/spark_spread spark_system.set_up(2, 1, src) @@ -50,7 +50,7 @@ density = 0 air_update_turf(1) update_freelook_sight() - airlocks -= src + GLOB.airlocks -= src if(spark_system) qdel(spark_system) spark_system = null @@ -314,8 +314,8 @@ return !(stat & NOPOWER) /obj/machinery/door/proc/update_freelook_sight() - if(!glass && cameranet) - cameranet.updateVisibility(src, 0) + if(!glass && GLOB.cameranet) + GLOB.cameranet.updateVisibility(src, 0) /obj/machinery/door/BlockSuperconductivity() // All non-glass airlocks block heat, this is intended. if(opacity || heat_proof) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index d8f480ca7f541..42685bee61ff9 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -4,9 +4,6 @@ #define CONSTRUCTION_GUTTED 3 //Wires are removed, circuit ready to remove #define CONSTRUCTION_NOCIRCUIT 4 //Circuit board removed, can safely weld apart -/var/const/OPEN = 1 -/var/const/CLOSED = 2 - /obj/machinery/door/firedoor name = "firelock" desc = "Apply crowbar." @@ -183,10 +180,10 @@ if(operating || stat & NOPOWER || !nextstate) return switch(nextstate) - if(OPEN) + if(FIREDOOR_OPEN) nextstate = null open() - if(CLOSED) + if(FIREDOOR_CLOSED) nextstate = null close() @@ -422,4 +419,4 @@ /obj/structure/firelock_frame/heavy name = "heavy firelock frame" - reinforced = 1 + reinforced = 1 \ No newline at end of file diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index fb06454d41019..47e18f32e68b1 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -344,7 +344,7 @@ open() /obj/machinery/door/window/clockwork/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) obj_integrity = max_integrity /obj/machinery/door/window/clockwork/hasPower() diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index 13754e4a1956d..2a710ded2fc4d 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -1,4 +1,4 @@ -var/list/doppler_arrays = list() +GLOBAL_LIST_EMPTY(doppler_arrays) /obj/machinery/doppler_array name = "tachyon-doppler array" @@ -13,10 +13,10 @@ var/list/doppler_arrays = list() /obj/machinery/doppler_array/New() ..() - doppler_arrays += src + GLOB.doppler_arrays += src /obj/machinery/doppler_array/Destroy() - doppler_arrays -= src + GLOB.doppler_arrays -= src return ..() /obj/machinery/doppler_array/process() diff --git a/code/game/machinery/embedded_controller/access_controller.dm b/code/game/machinery/embedded_controller/access_controller.dm index 2f67440e2400b..8fcdc7c4a3ae0 100644 --- a/code/game/machinery/embedded_controller/access_controller.dm +++ b/code/game/machinery/embedded_controller/access_controller.dm @@ -47,11 +47,11 @@ var/busy /obj/machinery/doorButtons/access_button/findObjsByTag() - for(var/obj/machinery/doorButtons/airlock_controller/A in machines) + for(var/obj/machinery/doorButtons/airlock_controller/A in GLOB.machines) if(A.idSelf == idSelf) controller = A break - for(var/obj/machinery/door/airlock/I in machines) + for(var/obj/machinery/door/airlock/I in GLOB.machines) if(I.id_tag == idDoor) door = I break @@ -120,7 +120,7 @@ exteriorAirlock = null /obj/machinery/doorButtons/airlock_controller/Destroy() - for(var/obj/machinery/doorButtons/access_button/A in machines) + for(var/obj/machinery/doorButtons/access_button/A in GLOB.machines) if(A.controller == src) A.controller = null return ..() @@ -241,7 +241,7 @@ update_icon() /obj/machinery/doorButtons/airlock_controller/findObjsByTag() - for(var/obj/machinery/door/airlock/A in machines) + for(var/obj/machinery/door/airlock/A in GLOB.machines) if(A.id_tag == idInterior) interiorAirlock = A else if(A.id_tag == idExterior) diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 2d079432a894a..6cfb84498113f 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -63,7 +63,7 @@ return if(src.z == ZLEVEL_STATION) - add_overlay("overlay_[security_level]") + add_overlay("overlay_[GLOB.security_level]") else //var/green = SEC_LEVEL_GREEN add_overlay("overlay_[SEC_LEVEL_GREEN]") @@ -111,7 +111,7 @@ addtimer(CALLBACK(src, .proc/reset), time) /obj/machinery/firealarm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "firealarm", name, 300, 150, master_ui, state) diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm index 826d707f0ac84..61d1588372a8d 100644 --- a/code/game/machinery/gulag_item_reclaimer.dm +++ b/code/game/machinery/gulag_item_reclaimer.dm @@ -3,7 +3,7 @@ desc = "Used to reclaim your items after you finish your sentence at the labor camp" icon = 'icons/obj/terminals.dmi' icon_state = "dorm_taken" - req_access = list(access_security) //reqaccess to access all stored items + req_access = list(GLOB.access_security) //reqaccess to access all stored items density = 0 anchored = 1 use_power = 1 @@ -43,7 +43,7 @@ return ..() /obj/machinery/gulag_item_reclaimer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "gulag_item_reclaimer", name, 455, 440, master_ui, state) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 6a5a2da8c34f8..fc97dfdb983d9 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -29,9 +29,7 @@ Possible to do for anyone motivated enough: #define RANGE_BASED 4 #define AREA_BASED 6 -var/const/HOLOPAD_MODE = RANGE_BASED - -var/list/holopads = list() +#define HOLOPAD_MODE RANGE_BASED /obj/machinery/holopad name = "\improper AI holopad" @@ -50,6 +48,7 @@ var/list/holopads = list() var/last_request = 0 //to prevent request spam. ~Carn var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating. var/temp = "" + var/static/list/holopads = list() /obj/machinery/holopad/New() ..() @@ -121,7 +120,7 @@ var/list/holopads = list() temp = "You requested an AI's presence.
" temp += "Main Menu" var/area/area = get_area(src) - for(var/mob/living/silicon/ai/AI in living_mob_list) + for(var/mob/living/silicon/ai/AI in GLOB.living_mob_list) if(!AI.client) continue to_chat(AI, "Your presence is requested at \the [area].") diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 5e57532c79a07..137a492b3a96a 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -128,7 +128,7 @@ Class Procs: if (!armor) armor = list(melee = 25, bullet = 10, laser = 10, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 50, acid = 70) ..() - machines += src + GLOB.machines += src if(!speed_process) START_PROCESSING(SSmachines, src) else @@ -136,7 +136,7 @@ Class Procs: power_change() /obj/machinery/Destroy() - machines.Remove(src) + GLOB.machines.Remove(src) if(!speed_process) STOP_PROCESSING(SSmachines, src) else diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 473ed97e0c6fb..41917d8eb416b 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -37,7 +37,7 @@ spawn(10) // must wait for map loading to finish if(SSradio) - SSradio.add_object(src, freq, RADIO_MAGNETS) + SSradio.add_object(src, freq, GLOB.RADIO_MAGNETS) spawn() magnetic_process() @@ -233,14 +233,14 @@ ..() if(autolink) - for(var/obj/machinery/magnetic_module/M in machines) + for(var/obj/machinery/magnetic_module/M in GLOB.machines) if(M.freq == frequency && M.code == code) magnets.Add(M) spawn(45) // must wait for map loading to finish if(SSradio) - radio_connection = SSradio.add_object(src, frequency, RADIO_MAGNETS) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_MAGNETS) if(path) // check for default path @@ -255,7 +255,7 @@ /obj/machinery/magnetic_controller/process() if(magnets.len == 0 && autolink) - for(var/obj/machinery/magnetic_module/M in machines) + for(var/obj/machinery/magnetic_module/M in GLOB.machines) if(M.freq == frequency && M.code == code) magnets.Add(M) @@ -323,7 +323,7 @@ // Broadcast the signal - radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) + radio_connection.post_signal(src, signal, filter = GLOB.RADIO_MAGNETS) spawn(1) updateUsrDialog() // pretty sure this increases responsiveness @@ -390,7 +390,7 @@ // Broadcast the signal spawn() - radio_connection.post_signal(src, signal, filter = RADIO_MAGNETS) + radio_connection.post_signal(src, signal, filter = GLOB.RADIO_MAGNETS) if(speed == 10) sleep(1) diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index ea502741345d7..2c460705218ad 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -21,7 +21,7 @@ var/list/codes // assoc. list of transponder codes var/codes_txt = "" // codes as set on map: "tag1;tag2" or "tag1=value;tag2=value" - req_access = list(access_engine, access_robotics) + req_access = list(GLOB.access_engine, GLOB.access_robotics) /obj/machinery/navbeacon/New() ..() @@ -31,16 +31,16 @@ var/turf/T = loc hide(T.intact) if(codes["patrol"]) - if(!navbeacons["[z]"]) - navbeacons["[z]"] = list() - navbeacons["[z]"] += src //Register with the patrol list! + if(!GLOB.navbeacons["[z]"]) + GLOB.navbeacons["[z]"] = list() + GLOB.navbeacons["[z]"] += src //Register with the patrol list! if(codes["delivery"]) - deliverybeacons += src - deliverybeacontags += location + GLOB.deliverybeacons += src + GLOB.deliverybeacontags += location /obj/machinery/navbeacon/Destroy() - navbeacons["[z]"] -= src //Remove from beacon list, if in one. - deliverybeacons -= src + GLOB.navbeacons["[z]"] -= src //Remove from beacon list, if in one. + GLOB.deliverybeacons -= src return ..() // set the transponder codes assoc list from codes_txt diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 1fbbfbb41b57a..a50a2973fcada 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -1,5 +1,5 @@ -var/datum/newscaster/feed_network/news_network = new /datum/newscaster/feed_network -var/list/obj/machinery/newscaster/allCasters = list() +GLOBAL_DATUM_INIT(news_network, /datum/newscaster/feed_network, new) +GLOBAL_LIST_EMPTY(allCasters) /datum/newscaster @@ -26,7 +26,7 @@ var/list/obj/machinery/newscaster/allCasters = list() /datum/newscaster/feed_message/proc/returnAuthor(censor) if(censor == -1) censor = authorCensor - var/txt = "[news_network.redactedText]" + var/txt = "[GLOB.news_network.redactedText]" if(!censor) txt = author return txt @@ -34,26 +34,26 @@ var/list/obj/machinery/newscaster/allCasters = list() /datum/newscaster/feed_message/proc/returnBody(censor) if(censor == -1) censor = bodyCensor - var/txt = "[news_network.redactedText]" + var/txt = "[GLOB.news_network.redactedText]" if(!censor) txt = body return txt /datum/newscaster/feed_message/proc/toggleCensorAuthor() if(authorCensor) - authorCensorTime.Add(news_network.lastAction*-1) + authorCensorTime.Add(GLOB.news_network.lastAction*-1) else - authorCensorTime.Add(news_network.lastAction) + authorCensorTime.Add(GLOB.news_network.lastAction) authorCensor = !authorCensor - news_network.lastAction ++ + GLOB.news_network.lastAction ++ /datum/newscaster/feed_message/proc/toggleCensorBody() if(bodyCensor) - bodyCensorTime.Add(news_network.lastAction*-1) + bodyCensorTime.Add(GLOB.news_network.lastAction*-1) else - bodyCensorTime.Add(news_network.lastAction) + bodyCensorTime.Add(GLOB.news_network.lastAction) bodyCensor = !bodyCensor - news_network.lastAction ++ + GLOB.news_network.lastAction ++ /datum/newscaster/feed_channel var/channel_name = "" @@ -69,26 +69,26 @@ var/list/obj/machinery/newscaster/allCasters = list() /datum/newscaster/feed_channel/proc/returnAuthor(censor) if(censor == -1) censor = authorCensor - var/txt = "[news_network.redactedText]" + var/txt = "[GLOB.news_network.redactedText]" if(!censor) txt = author return txt /datum/newscaster/feed_channel/proc/toggleCensorDclass() if(censored) - DclassCensorTime.Add(news_network.lastAction*-1) + DclassCensorTime.Add(GLOB.news_network.lastAction*-1) else - DclassCensorTime.Add(news_network.lastAction) + DclassCensorTime.Add(GLOB.news_network.lastAction) censored = !censored - news_network.lastAction ++ + GLOB.news_network.lastAction ++ /datum/newscaster/feed_channel/proc/toggleCensorAuthor() if(authorCensor) - authorCensorTime.Add(news_network.lastAction*-1) + authorCensorTime.Add(GLOB.news_network.lastAction*-1) else - authorCensorTime.Add(news_network.lastAction) + authorCensorTime.Add(GLOB.news_network.lastAction) authorCensor = !authorCensor - news_network.lastAction ++ + GLOB.news_network.lastAction ++ /datum/newscaster/wanted_message var/active @@ -130,7 +130,7 @@ var/list/obj/machinery/newscaster/allCasters = list() if(FC.channel_name == channel_name) FC.messages += newMsg break - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.newsAlert(channel_name) lastAction ++ newMsg.creationTime = lastAction @@ -144,7 +144,7 @@ var/list/obj/machinery/newscaster/allCasters = list() if(photo) wanted_issue.img = photo.img if(newMessage) - for(var/obj/machinery/newscaster/N in allCasters) + for(var/obj/machinery/newscaster/N in GLOB.allCasters) N.newsAlert() N.update_icon() @@ -154,7 +154,7 @@ var/list/obj/machinery/newscaster/allCasters = list() wanted_issue.body = null wanted_issue.scannedUser = null wanted_issue.img = null - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.update_icon() @@ -205,13 +205,13 @@ var/list/obj/machinery/newscaster/allCasters = list() pixel_x = (dir & 3)? 0 : (dir == 4 ? -32 : 32) pixel_y = (dir & 3)? (dir ==1 ? -32 : 32) : 0 - allCasters += src - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + GLOB.allCasters += src + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) unit_no++ update_icon() /obj/machinery/newscaster/Destroy() - allCasters -= src + GLOB.allCasters -= src viewing_channel = null photo = null return ..() @@ -221,7 +221,7 @@ var/list/obj/machinery/newscaster/allCasters = list() if(stat & (NOPOWER|BROKEN)) icon_state = "newscaster_off" else - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) icon_state = "newscaster_wanted" else icon_state = "newscaster_normal" @@ -268,7 +268,7 @@ var/list/obj/machinery/newscaster/allCasters = list() if(0) dat += "Welcome to Newscasting Unit #[unit_no].
Interface & News networks Operational." dat += "
Property of Nanotrasen Inc" - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) dat+= "
Read Wanted Issue" dat+= "

Create Feed Channel" dat+= "
View Feed Channels" @@ -278,7 +278,7 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+= "

Exit" if(securityCaster) var/wanted_already = 0 - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) wanted_already = 1 dat+="
Feed Security functions:
" dat+="
[(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue" @@ -287,10 +287,10 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+="

The newscaster recognises you as: [scanned_user]" if(1) dat+= "Station Feed Channels
" - if( isemptylist(news_network.network_channels) ) + if( isemptylist(GLOB.news_network.network_channels) ) dat+="No active channels found..." else - for(var/datum/newscaster/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels) if(CHANNEL.is_admin_channel) dat+="[CHANNEL.channel_name]
" else @@ -329,9 +329,9 @@ var/list/obj/machinery/newscaster/allCasters = list() if(7) dat+="ERROR: Could not submit Feed Channel to Network.

" var/list/existing_authors = list() - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.authorCensor) - existing_authors += news_network.redactedText + existing_authors += GLOB.news_network.redactedText else existing_authors += FC.author if(scanned_user in existing_authors) @@ -339,7 +339,7 @@ var/list/obj/machinery/newscaster/allCasters = list() if(channel_name=="" || channel_name == "\[REDACTED\]") dat+="Invalid channel name.
" var/check = 0 - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == channel_name) check = 1 break @@ -349,10 +349,10 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+="Channel author unverified.
" dat+="
Return
" if(8) - var/total_num=length(news_network.network_channels) + var/total_num=length(GLOB.news_network.network_channels) var/active_num=total_num var/message_num=0 - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(!FC.censored) message_num += length(FC.messages) else @@ -395,10 +395,10 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+="NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
" dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.
" dat+="
Select Feed channel to get Stories from:
" - if(isemptylist(news_network.network_channels)) + if(isemptylist(GLOB.news_network.network_channels)) dat+="No feed channels found active...
" else - for(var/datum/newscaster/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()]
" dat+="
Cancel" if(11) @@ -406,10 +406,10 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+="A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's" dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed" dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
" - if(isemptylist(news_network.network_channels)) + if(isemptylist(GLOB.news_network.network_channels)) dat+="No feed channels found active...
" else - for(var/datum/newscaster/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()]
" dat+="
Back" if(12) @@ -442,7 +442,7 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+="Wanted Issue Handler:" var/wanted_already = 0 var/end_param = 1 - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) wanted_already = 1 end_param = 2 if(wanted_already) @@ -452,7 +452,7 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+="Description: [msg]
" dat+="Attach Photo: [(photo ? "Photo Attached" : "No Photo")]
" if(wanted_already) - dat+="Wanted Issue created by:[news_network.wanted_issue.scannedUser]
" + dat+="Wanted Issue created by:[GLOB.news_network.wanted_issue.scannedUser]
" else dat+="Wanted Issue will be created under prosecutor:[scanned_user]
" dat+="
[(wanted_already) ? ("Edit Issue") : ("Submit")]" @@ -475,13 +475,13 @@ var/list/obj/machinery/newscaster/allCasters = list() dat+="Wanted Issue successfully deleted from Circulation
" dat+="
Return
" if(18) - if(news_network.wanted_issue.active) - dat+="-- STATIONWIDE WANTED ISSUE --
\[Submitted by: [news_network.wanted_issue.scannedUser]\]
" - dat+="Criminal: [news_network.wanted_issue.criminal]
" - dat+="Description: [news_network.wanted_issue.body]
" + if(GLOB.news_network.wanted_issue.active) + dat+="-- STATIONWIDE WANTED ISSUE --
\[Submitted by: [GLOB.news_network.wanted_issue.scannedUser]\]
" + dat+="Criminal: [GLOB.news_network.wanted_issue.criminal]
" + dat+="Description: [GLOB.news_network.wanted_issue.body]
" dat+="Photo:: " - if(news_network.wanted_issue.img) - usr << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png") + if(GLOB.news_network.wanted_issue.img) + usr << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png") dat+="
" else dat+="None" @@ -518,13 +518,13 @@ var/list/obj/machinery/newscaster/allCasters = list() updateUsrDialog() else if(href_list["submit_new_channel"]) var/list/existing_authors = list() - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.authorCensor) - existing_authors += news_network.redactedText + existing_authors += GLOB.news_network.redactedText else existing_authors += FC.author var/check = 0 - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == channel_name) check = 1 break @@ -534,13 +534,13 @@ var/list/obj/machinery/newscaster/allCasters = list() var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel") if(choice=="Confirm") scan_user(usr) - news_network.CreateFeedChannel(channel_name, scanned_user, c_locked) + GLOB.news_network.CreateFeedChannel(channel_name, scanned_user, c_locked) feedback_inc("newscaster_channels",1) screen=5 updateUsrDialog() else if(href_list["set_channel_receiving"]) var/list/available_channels = list() - for(var/datum/newscaster/feed_channel/F in news_network.network_channels) + for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels) if( (!F.locked || F.author == scanned_user) && !F.censored) available_channels += F.channel_name channel_name = input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels @@ -557,7 +557,7 @@ var/list/obj/machinery/newscaster/allCasters = list() if(msg =="" || msg=="\[REDACTED\]" || scanned_user == "Unknown" || channel_name == "" ) screen=6 else - news_network.SubmitArticle("[parsepencode(msg, usr, SIGNFONT)]", scanned_user, channel_name, photo, 0, allow_comments) + GLOB.news_network.SubmitArticle("[parsepencode(msg, usr, SIGNFONT)]", scanned_user, channel_name, photo, 0, allow_comments) feedback_inc("newscaster_stories",1) screen=4 msg = "" @@ -586,11 +586,11 @@ var/list/obj/machinery/newscaster/allCasters = list() updateUsrDialog() else if(href_list["menu_wanted"]) var/already_wanted = 0 - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) already_wanted = 1 if(already_wanted) - channel_name = news_network.wanted_issue.criminal - msg = news_network.wanted_issue.body + channel_name = GLOB.news_network.wanted_issue.criminal + msg = GLOB.news_network.wanted_issue.body screen = 14 updateUsrDialog() else if(href_list["set_wanted_name"]) @@ -608,22 +608,22 @@ var/list/obj/machinery/newscaster/allCasters = list() if(choice=="Confirm") scan_user(usr) if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. - news_network.submitWanted(channel_name, msg, scanned_user, photo, 0 , 1) + GLOB.news_network.submitWanted(channel_name, msg, scanned_user, photo, 0 , 1) screen = 15 else - if(news_network.wanted_issue.isAdminMsg) + if(GLOB.news_network.wanted_issue.isAdminMsg) alert("The wanted issue has been distributed by a Nanotrasen higherup. You cannot edit it.","Ok") return - news_network.submitWanted(channel_name, msg, scanned_user, photo) + GLOB.news_network.submitWanted(channel_name, msg, scanned_user, photo) screen = 19 updateUsrDialog() else if(href_list["cancel_wanted"]) - if(news_network.wanted_issue.isAdminMsg) + if(GLOB.news_network.wanted_issue.isAdminMsg) alert("The wanted issue has been distributed by a Nanotrasen higherup. You cannot take it down.","Ok") return var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") - news_network.deleteWanted() + GLOB.news_network.deleteWanted() screen=17 updateUsrDialog() else if(href_list["view_wanted"]) @@ -852,16 +852,16 @@ var/list/obj/machinery/newscaster/allCasters = list() /obj/machinery/newscaster/proc/print_paper() feedback_inc("newscaster_newspapers_printed",1) var/obj/item/weapon/newspaper/NEWSPAPER = new /obj/item/weapon/newspaper - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) NEWSPAPER.news_content += FC - if(news_network.wanted_issue.active) - NEWSPAPER.wantedAuthor = news_network.wanted_issue.scannedUser - NEWSPAPER.wantedCriminal = news_network.wanted_issue.criminal - NEWSPAPER.wantedBody = news_network.wanted_issue.body - if(news_network.wanted_issue.img) - NEWSPAPER.wantedPhoto = news_network.wanted_issue.img + if(GLOB.news_network.wanted_issue.active) + NEWSPAPER.wantedAuthor = GLOB.news_network.wanted_issue.scannedUser + NEWSPAPER.wantedCriminal = GLOB.news_network.wanted_issue.criminal + NEWSPAPER.wantedBody = GLOB.news_network.wanted_issue.body + if(GLOB.news_network.wanted_issue.img) + NEWSPAPER.wantedPhoto = GLOB.news_network.wanted_issue.img NEWSPAPER.loc = get_turf(src) - NEWSPAPER.creationTime = news_network.lastAction + NEWSPAPER.creationTime = GLOB.news_network.lastAction paper_remaining-- /obj/machinery/newscaster/proc/newsAlert(channel) diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index ca4a96f1dd2b7..11b21d275d34d 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -22,7 +22,7 @@ Buildable meters var/flipped = 0 var/is_bent = 0 - var/global/list/pipe_types = list( + var/static/list/pipe_types = list( PIPE_SIMPLE, \ PIPE_MANIFOLD, \ PIPE_4WAYMANIFOLD, \ @@ -73,7 +73,7 @@ Buildable meters src.pipe_type = pipe_type src.setDir(dir) - if(src.dir in diagonals) + if(src.dir in GLOB.diagonals) is_bent = 1 update() @@ -81,7 +81,7 @@ Buildable meters src.pixel_y = rand(-5, 5) //update the name and icon of the pipe item depending on the type -var/global/list/pipeID2State = list( +GLOBAL_LIST_INIT(pipeID2State, list( "[PIPE_SIMPLE]" = "simple", \ "[PIPE_MANIFOLD]" = "manifold", \ "[PIPE_4WAYMANIFOLD]" = "manifold4w", \ @@ -103,7 +103,7 @@ var/global/list/pipeID2State = list( \ "[PIPE_GAS_FILTER]" = "filter", \ "[PIPE_GAS_MIXER]" = "mixer", \ -) +)) /obj/item/pipe/proc/update() var/list/nlist = list(\ @@ -133,7 +133,7 @@ var/global/list/pipeID2State = list( ) //fix_pipe_type() name = nlist["[pipe_type][is_bent ? "_b" : ""]"] + " fitting" - icon_state = pipeID2State["[pipe_type]"] + icon_state = GLOB.pipeID2State["[pipe_type]"] // rotate the pipe item clockwise @@ -186,7 +186,7 @@ var/global/list/pipeID2State = list( setDir(old_dir )//pipes changing direction when moved is just annoying and buggy /obj/item/pipe/proc/unflip(direction) - if(direction in diagonals) + if(direction in GLOB.diagonals) return turn(direction, 45) return direction diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 29a3a57b98759..4caf258853270 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -12,7 +12,7 @@ use_power = 1 //this turret uses and requires power idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power active_power_usage = 300 //when active, this turret takes up constant 300 Equipment power - req_access = list(access_security) + req_access = list(GLOB.access_security) power_channel = EQUIP //drains power from the EQUIPMENT channel var/base_icon_state = "standard" @@ -467,7 +467,7 @@ if(check_records) //if the turret can check the records, check if they are set to *Arrest* on records var/perpname = perp.get_face_name(perp.get_id_name()) - var/datum/data/record/R = find_record("name", perpname, data_core.security) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) if(!R || (R.fields["criminal"] == "*Arrest*")) threatcount += 4 @@ -634,7 +634,7 @@ var/locked = 1 var/control_area = null //can be area name, path or nothing. var/ailock = 0 // AI cannot use this - req_access = list(access_ai_upload) + req_access = list(GLOB.access_ai_upload) var/list/obj/machinery/porta_turret/turrets = list() resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF @@ -656,7 +656,7 @@ if(!mapload) return if(control_area && istext(control_area)) - for(var/V in sortedAreas) + for(var/V in GLOB.sortedAreas) var/area/A = V if(A.name == control_area) control_area = A @@ -845,7 +845,7 @@ . = ..() /obj/machinery/porta_turret/lasertag - req_access = list(access_maint_tunnels, access_theatre) + req_access = list(GLOB.access_maint_tunnels, GLOB.access_theatre) check_records = 0 criminals = 0 auth_weapons = 1 diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index fa71f8e68de8e..0ebc0a096e649 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -7,7 +7,7 @@ use_power = 1 idle_power_usage = 5 active_power_usage = 1000 - req_access = list(access_robotics) + req_access = list(GLOB.access_robotics) var/recharge_speed var/repairs state_open = 1 diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index c81900c1cdb54..03a9bc2d0b916 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -1,4 +1,4 @@ -var/const/SAFETY_COOLDOWN = 100 +#define SAFETY_COOLDOWN 100 /obj/machinery/recycler name = "recycler" @@ -204,3 +204,5 @@ var/const/SAFETY_COOLDOWN = 100 /obj/item/weapon/paper/recycler name = "paper - 'garbage duty instructions'" info = "

New Assignment

You have been assigned to collect garbage from trash bins, located around the station. The crewmembers will put their trash into it and you will collect the said trash.

There is a recycling machine near your closet, inside maintenance; use it to recycle the trash for a small chance to get useful minerals. Then deliver these minerals to cargo or engineering. You are our last hope for a clean station, do not screw this up!" + +#undef SAFETY_COOLDOWN \ No newline at end of file diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index ee72082f1eac2..fd494dd156053 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -1,10 +1,10 @@ /******************** Requests Console ********************/ /** Originally written by errorage, updated by: Carn, needs more work though. I just added some security fixes */ -var/req_console_assistance = list() -var/req_console_supplies = list() -var/req_console_information = list() -var/list/obj/machinery/requests_console/allConsoles = list() +GLOBAL_LIST_EMPTY(req_console_assistance) +GLOBAL_LIST_EMPTY(req_console_supplies) +GLOBAL_LIST_EMPTY(req_console_information) +GLOBAL_LIST_EMPTY(allConsoles) /obj/machinery/requests_console name = "requests console" @@ -91,46 +91,46 @@ var/list/obj/machinery/requests_console/allConsoles = list() /obj/machinery/requests_console/Initialize() ..() name = "\improper [department] requests console" - allConsoles += src + GLOB.allConsoles += src switch(departmentType) if(1) - if(!("[department]" in req_console_assistance)) - req_console_assistance += department + if(!("[department]" in GLOB.req_console_assistance)) + GLOB.req_console_assistance += department if(2) - if(!("[department]" in req_console_supplies)) - req_console_supplies += department + if(!("[department]" in GLOB.req_console_supplies)) + GLOB.req_console_supplies += department if(3) - if(!("[department]" in req_console_information)) - req_console_information += department + if(!("[department]" in GLOB.req_console_information)) + GLOB.req_console_information += department if(4) - if(!("[department]" in req_console_assistance)) - req_console_assistance += department - if(!("[department]" in req_console_supplies)) - req_console_supplies += department + if(!("[department]" in GLOB.req_console_assistance)) + GLOB.req_console_assistance += department + if(!("[department]" in GLOB.req_console_supplies)) + GLOB.req_console_supplies += department if(5) - if(!("[department]" in req_console_assistance)) - req_console_assistance += department - if(!("[department]" in req_console_information)) - req_console_information += department + if(!("[department]" in GLOB.req_console_assistance)) + GLOB.req_console_assistance += department + if(!("[department]" in GLOB.req_console_information)) + GLOB.req_console_information += department if(6) - if(!("[department]" in req_console_supplies)) - req_console_supplies += department - if(!("[department]" in req_console_information)) - req_console_information += department + if(!("[department]" in GLOB.req_console_supplies)) + GLOB.req_console_supplies += department + if(!("[department]" in GLOB.req_console_information)) + GLOB.req_console_information += department if(7) - if(!("[department]" in req_console_assistance)) - req_console_assistance += department - if(!("[department]" in req_console_supplies)) - req_console_supplies += department - if(!("[department]" in req_console_information)) - req_console_information += department + if(!("[department]" in GLOB.req_console_assistance)) + GLOB.req_console_assistance += department + if(!("[department]" in GLOB.req_console_supplies)) + GLOB.req_console_supplies += department + if(!("[department]" in GLOB.req_console_information)) + GLOB.req_console_information += department Radio = new /obj/item/device/radio(src) Radio.listening = 0 /obj/machinery/requests_console/Destroy() QDEL_NULL(Radio) - allConsoles -= src + GLOB.allConsoles -= src return ..() /obj/machinery/requests_console/attack_hand(mob/user) @@ -142,7 +142,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() if(1) //req. assistance dat += "Which department do you need assistance from?

" dat += "" - for(var/dpt in req_console_assistance) + for(var/dpt in GLOB.req_console_assistance) if (dpt != department) dat += "" dat += "" @@ -157,7 +157,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() if(2) //req. supplies dat += "Which department do you need supplies from?

" dat += "
[dpt]
" - for(var/dpt in req_console_supplies) + for(var/dpt in GLOB.req_console_supplies) if (dpt != department) dat += "" dat += "" @@ -172,7 +172,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() if(3) //relay information dat += "Which department would you like to send information to?

" dat += "
[dpt]
" - for(var/dpt in req_console_information) + for(var/dpt in GLOB.req_console_information) if (dpt != department) dat += "" dat += "" @@ -193,7 +193,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() dat += "Continue
" if(8) //view messages - for (var/obj/machinery/requests_console/Console in allConsoles) + for (var/obj/machinery/requests_console/Console in GLOB.allConsoles) if (Console.department == department) Console.newmessagepriority = 0 Console.update_icon() @@ -304,7 +304,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() if(!announcementConsole) return minor_announce(message, "[department] Announcement:") - news_network.SubmitArticle(message, department, "Station Announcements", null) + GLOB.news_network.SubmitArticle(message, department, "Station Announcements", null) log_say("[key_name(usr)] has made a station announcement: [message]") message_admins("[key_name_admin(usr)] has made a station announcement.") announceAuth = 0 @@ -316,13 +316,13 @@ var/list/obj/machinery/requests_console/allConsoles = list() var/radio_freq switch(text2num(href_list["emergency"])) if(1) //Security - radio_freq = SEC_FREQ + radio_freq = GLOB.SEC_FREQ emergency = "Security" if(2) //Engineering - radio_freq = ENG_FREQ + radio_freq = GLOB.ENG_FREQ emergency = "Engineering" if(3) //Medical - radio_freq = MED_FREQ + radio_freq = GLOB.MED_FREQ emergency = "Medical" if(radio_freq) Radio.set_frequency(radio_freq) @@ -343,7 +343,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() screen = 7 //if it's successful, this will get overrwritten (7 = unsufccessfull, 6 = successfull) if (sending) var/pass = 0 - for (var/obj/machinery/message_server/MS in machines) + for (var/obj/machinery/message_server/MS in GLOB.machines) if(!MS.active) continue MS.send_rc_message(href_list["department"],department,log_msg,msgStamped,msgVerified,priority) pass = 1 @@ -352,24 +352,24 @@ var/list/obj/machinery/requests_console/allConsoles = list() var/radio_freq = 0 switch(href_list["department"]) if("bridge") - radio_freq = COMM_FREQ + radio_freq = GLOB.COMM_FREQ if("medbay") - radio_freq = MED_FREQ + radio_freq = GLOB.MED_FREQ if("science") - radio_freq = SCI_FREQ + radio_freq = GLOB.SCI_FREQ if("engineering") - radio_freq = ENG_FREQ + radio_freq = GLOB.ENG_FREQ if("security") - radio_freq = SEC_FREQ + radio_freq = GLOB.SEC_FREQ if("cargobay" || "mining") - radio_freq = SUPP_FREQ + radio_freq = GLOB.SUPP_FREQ Radio.set_frequency(radio_freq) var/authentic if(msgVerified || msgStamped) authentic = " (Authenticated)" var/alert = "" - for (var/obj/machinery/requests_console/Console in allConsoles) + for (var/obj/machinery/requests_console/Console in GLOB.allConsoles) if (ckey(Console.department) == ckey(href_list["department"])) switch(priority) if(2) //High priority @@ -515,7 +515,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() msgVerified = "Verified by [ID.registered_name] ([ID.assignment])" updateUsrDialog() if(screen == 10) - if (access_RC_announce in ID.access) + if (GLOB.access_RC_announce in ID.access) announceAuth = 1 else announceAuth = 0 diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 562328810bc8e..b6cea7c1cd6f1 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -81,7 +81,7 @@ opacity = 0 anchored = 0 pressure_resistance = 2*ONE_ATMOSPHERE - req_access = list(access_engine) + req_access = list(GLOB.access_engine) max_integrity = 100 obj_integrity = 100 var/active = 0 @@ -232,7 +232,7 @@ icon_state = "Shield_Gen" anchored = 0 density = 1 - req_access = list(access_teleporter) + req_access = list(GLOB.access_teleporter) flags = CONDUCT use_power = 0 obj_integrity = 300 diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 0f29c50de5568..df76fef5a9f51 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -175,7 +175,7 @@ return ..() /obj/machinery/space_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "space_heater", name, 400, 305, master_ui, state) diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm index 5a924b2bfa2f8..5db4276333ff7 100644 --- a/code/game/machinery/suit_storage_unit.dm +++ b/code/game/machinery/suit_storage_unit.dm @@ -322,7 +322,7 @@ return ..() /obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = notcontained_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state) diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index 1531ca8844d3a..8fce85a04bbab 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -22,7 +22,7 @@ if(surplus() < 1500) if(user) to_chat(user, "The connected wire doesn't have enough current.") return - for(var/obj/singularity/singulo in singularities) + for(var/obj/singularity/singulo in GLOB.singularities) if(singulo.z == z) singulo.target = src icon_state = "[icontype]1" @@ -32,7 +32,7 @@ /obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null) - for(var/obj/singularity/singulo in singularities) + for(var/obj/singularity/singulo in GLOB.singularities) if(singulo.target == src) singulo.target = null icon_state = "[icontype]0" @@ -88,7 +88,7 @@ add_load(1500) if(cooldown <= world.time) cooldown = world.time + 100 - for(var/obj/singularity/singulo in singularities) + for(var/obj/singularity/singulo in GLOB.singularities) if(singulo.z == z) say("The [singulo] is now [get_dist(src,singulo)] standard lengths away to the [dir2text(get_dir(src,singulo))]") else diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 6f7e7ec90254a..4d8ad29941397 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -533,7 +533,7 @@ /obj/item/device/syndicatedetonator/attack_self(mob/user) if(timer < world.time) - for(var/obj/machinery/syndicatebomb/B in machines) + for(var/obj/machinery/syndicatebomb/B in GLOB.machines) if(B.active) B.detonation_timer = world.time + BUTTON_DELAY detonated++ @@ -545,7 +545,7 @@ var/area/A = get_area(T) detonated-- var/log_str = "[ADMIN_LOOKUPFLW(user)] has remotely detonated [detonated ? "syndicate bombs" : "a syndicate bomb"] using a [name] at [A.name] [ADMIN_JMP(T)]." - bombers += log_str + GLOB.bombers += log_str message_admins(log_str) log_game("[key_name(user)] has remotely detonated [detonated ? "syndicate bombs" : "a syndicate bomb"] using a [name] at [A.name][COORD(T)]") detonated = 0 diff --git a/code/game/machinery/telecomms/broadcasting.dm b/code/game/machinery/telecomms/broadcasting.dm index 566fe74f0f97a..84321a1760497 100644 --- a/code/game/machinery/telecomms/broadcasting.dm +++ b/code/game/machinery/telecomms/broadcasting.dm @@ -83,7 +83,7 @@ // --- Broadcast only to intercom devices --- if(data == 1) - for(var/obj/item/device/radio/intercom/R in all_radios["[freq]"]) + for(var/obj/item/device/radio/intercom/R in GLOB.all_radios["[freq]"]) if(R.receive_range(freq, level) > -1) radios += R @@ -91,7 +91,7 @@ else if(data == 2) - for(var/obj/item/device/radio/R in all_radios["[freq]"]) + for(var/obj/item/device/radio/R in GLOB.all_radios["[freq]"]) if(R.subspace_transmission) continue @@ -104,7 +104,7 @@ else if(data == 5) - for(var/obj/item/device/radio/R in all_radios["[freq]"]) + for(var/obj/item/device/radio/R in GLOB.all_radios["[freq]"]) if(!R.independent) continue @@ -114,13 +114,13 @@ // --- Broadcast to ALL radio devices --- else - for(var/obj/item/device/radio/R in all_radios["[freq]"]) + for(var/obj/item/device/radio/R in GLOB.all_radios["[freq]"]) if(R.receive_range(freq, level) > -1) radios += R var/freqtext = num2text(freq) - for(var/obj/item/device/radio/R in all_radios["[SYND_FREQ]"]) //syndicate radios use magic that allows them to hear everything. this was already the case, now it just doesn't need the allinone anymore. solves annoying bugs that aren't worth solving. - if(R.receive_range(SYND_FREQ, list(R.z)) > -1 && freqtext in radiochannelsreverse) + for(var/obj/item/device/radio/R in GLOB.all_radios["[GLOB.SYND_FREQ]"]) //syndicate radios use magic that allows them to hear everything. this was already the case, now it just doesn't need the allinone anymore. solves annoying bugs that aren't worth solving. + if(R.receive_range(GLOB.SYND_FREQ, list(R.z)) > -1 && freqtext in GLOB.reverseradiochannels) radios |= R // Get a list of mobs who can hear from the radios we collected. @@ -130,7 +130,7 @@ if (R.client && R.client.holder && !(R.client.prefs.chat_toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios. receive -= R - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTRADIO)) receive |= M @@ -142,30 +142,30 @@ // --- This following recording is intended for research and feedback in the use of department radio channels --- var/blackbox_msg = "[AM] [AM.say_quote(message, spans)]" - if(istype(blackbox)) + if(istype(GLOB.blackbox)) switch(freq) if(1459) - blackbox.msg_common += blackbox_msg + GLOB.blackbox.msg_common += blackbox_msg if(1351) - blackbox.msg_science += blackbox_msg + GLOB.blackbox.msg_science += blackbox_msg if(1353) - blackbox.msg_command += blackbox_msg + GLOB.blackbox.msg_command += blackbox_msg if(1355) - blackbox.msg_medical += blackbox_msg + GLOB.blackbox.msg_medical += blackbox_msg if(1357) - blackbox.msg_engineering += blackbox_msg + GLOB.blackbox.msg_engineering += blackbox_msg if(1359) - blackbox.msg_security += blackbox_msg + GLOB.blackbox.msg_security += blackbox_msg if(1441) - blackbox.msg_deathsquad += blackbox_msg + GLOB.blackbox.msg_deathsquad += blackbox_msg if(1213) - blackbox.msg_syndicate += blackbox_msg + GLOB.blackbox.msg_syndicate += blackbox_msg if(1349) - blackbox.msg_service += blackbox_msg + GLOB.blackbox.msg_service += blackbox_msg if(1347) - blackbox.msg_cargo += blackbox_msg + GLOB.blackbox.msg_cargo += blackbox_msg else - blackbox.messages += blackbox_msg + GLOB.blackbox.messages += blackbox_msg spawn(50) qdel(virt) @@ -198,7 +198,7 @@ signal.frequency = 1459// Common channel //#### Sending the signal to all subspace receivers ####// - for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) R.receive_signal(signal) sleep(rand(10,25)) diff --git a/code/game/machinery/telecomms/computers/logbrowser.dm b/code/game/machinery/telecomms/computers/logbrowser.dm index ab71f51c57c1d..31cbe7412c64a 100644 --- a/code/game/machinery/telecomms/computers/logbrowser.dm +++ b/code/game/machinery/telecomms/computers/logbrowser.dm @@ -13,7 +13,7 @@ var/universal_translate = 0 // set to 1 if it can translate nonhuman speech - req_access = list(access_tcomsat) + req_access = list(GLOB.access_tcomsat) circuit = /obj/item/weapon/circuitboard/computer/comm_server /obj/machinery/computer/telecomms/server/attack_hand(mob/user) diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 643efd81df45f..6568d14211a26 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -256,7 +256,7 @@ if(newfreq && canAccess(usr)) if(findtext(num2text(newfreq), ".")) newfreq *= 10 // shift the decimal one place - if(newfreq == SYND_FREQ) + if(newfreq == GLOB.SYND_FREQ) temp = "-% Error: Interference preventing filtering frequency: \"[newfreq] GHz\" %-" else if(!(newfreq in freq_listening) && newfreq < 10000) diff --git a/code/game/machinery/telecomms/machines/allinone.dm b/code/game/machinery/telecomms/machines/allinone.dm index 367a9896f01cd..5589a1be248e8 100644 --- a/code/game/machinery/telecomms/machines/allinone.dm +++ b/code/game/machinery/telecomms/machines/allinone.dm @@ -33,7 +33,7 @@ sleep(signal.data["slow"]) // simulate the network lag if necessary /* ###### Broadcast a message using signal.data ###### */ - if(signal.frequency == SYND_FREQ) // if syndicate broadcast, just + if(signal.frequency == GLOB.SYND_FREQ) // if syndicate broadcast, just Broadcast_Message(signal.data["mob"], signal.data["vmask"], signal.data["radio"], signal.data["message"], diff --git a/code/game/machinery/telecomms/machines/broadcaster.dm b/code/game/machinery/telecomms/machines/broadcaster.dm index 877f80dbcb7ac..dd83638c57744 100644 --- a/code/game/machinery/telecomms/machines/broadcaster.dm +++ b/code/game/machinery/telecomms/machines/broadcaster.dm @@ -5,8 +5,8 @@ They receive their message from a server after the message has been logged. */ -var/list/recentmessages = list() // global list of recent messages broadcasted : used to circumvent massive radio spam -var/message_delay = 0 // To make sure restarting the recentmessages list is kept in sync +GLOBAL_LIST_EMPTY(recentmessages) // global list of recent messages broadcasted : used to circumvent massive radio spam +GLOBAL_VAR_INIT(message_delay, 0) // To make sure restarting the recentmessages list is kept in sync /obj/machinery/telecomms/broadcaster name = "subspace broadcaster" @@ -38,9 +38,9 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept original.data["level"] = signal.data["level"] var/signal_message = "[signal.frequency]:[signal.data["message"]]:[signal.data["realname"]]" - if(signal_message in recentmessages) + if(signal_message in GLOB.recentmessages) return - recentmessages.Add(signal_message) + GLOB.recentmessages.Add(signal_message) if(signal.data["slow"] > 0) sleep(signal.data["slow"]) // simulate the network lag if necessary @@ -73,11 +73,11 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept signal.data["realname"], 4, signal.data["compression"], signal.data["level"], signal.frequency, signal.data["spans"], signal.data["verb_say"], signal.data["verb_ask"], signal.data["verb_exclaim"], signal.data["verb_yell"], signal.data["language"]) - if(!message_delay) - message_delay = 1 + if(!GLOB.message_delay) + GLOB.message_delay = 1 spawn(10) - message_delay = 0 - recentmessages = list() + GLOB.message_delay = 0 + GLOB.recentmessages = list() /* --- Do a snazzy animation! --- */ flick("broadcaster_send", src) @@ -100,8 +100,8 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept /obj/machinery/telecomms/broadcaster/Destroy() // In case message_delay is left on 1, otherwise it won't reset the list and people can't say the same thing twice anymore. - if(message_delay) - message_delay = 0 + if(GLOB.message_delay) + GLOB.message_delay = 0 return ..() diff --git a/code/game/machinery/telecomms/machines/bus.dm b/code/game/machinery/telecomms/machines/bus.dm index ae43084253ec0..81392f956efa6 100644 --- a/code/game/machinery/telecomms/machines/bus.dm +++ b/code/game/machinery/telecomms/machines/bus.dm @@ -25,7 +25,7 @@ if(is_freq_listening(signal)) if(change_frequency) - if(signal.frequency != SYND_FREQ) + if(signal.frequency != GLOB.SYND_FREQ) signal.frequency = change_frequency if(!istype(machine_from, /obj/machinery/telecomms/processor) && machine_from != src) // Signal must be ready (stupid assuming machine), let's send it @@ -72,25 +72,25 @@ /obj/machinery/telecomms/bus/preset_one id = "Bus 1" network = "tcommsat" - freq_listening = list(SCI_FREQ, MED_FREQ) + freq_listening = list(GLOB.SCI_FREQ, GLOB.MED_FREQ) autolinkers = list("processor1", "science", "medical") /obj/machinery/telecomms/bus/preset_two id = "Bus 2" network = "tcommsat" - freq_listening = list(SUPP_FREQ,SERV_FREQ) + freq_listening = list(GLOB.SUPP_FREQ,GLOB.SERV_FREQ) autolinkers = list("processor2", "supply", "service") /obj/machinery/telecomms/bus/preset_three id = "Bus 3" network = "tcommsat" - freq_listening = list(SEC_FREQ, COMM_FREQ) + freq_listening = list(GLOB.SEC_FREQ, GLOB.COMM_FREQ) autolinkers = list("processor3", "security", "command") /obj/machinery/telecomms/bus/preset_four id = "Bus 4" network = "tcommsat" - freq_listening = list(ENG_FREQ) + freq_listening = list(GLOB.ENG_FREQ) autolinkers = list("processor4", "engineering", "common") /obj/machinery/telecomms/bus/preset_four/New() diff --git a/code/game/machinery/telecomms/machines/receiver.dm b/code/game/machinery/telecomms/machines/receiver.dm index f66d860664f18..1b872b5d15314 100644 --- a/code/game/machinery/telecomms/machines/receiver.dm +++ b/code/game/machinery/telecomms/machines/receiver.dm @@ -77,7 +77,7 @@ id = "Receiver A" network = "tcommsat" autolinkers = list("receiverA") // link to relay - freq_listening = list(SCI_FREQ, MED_FREQ, SUPP_FREQ, SERV_FREQ) // science, medical, supply, service + freq_listening = list(GLOB.SCI_FREQ, GLOB.MED_FREQ, GLOB.SUPP_FREQ, GLOB.SERV_FREQ) // science, medical, supply, service //--PRESET RIGHT--// @@ -86,7 +86,7 @@ id = "Receiver B" network = "tcommsat" autolinkers = list("receiverB") // link to relay - freq_listening = list(COMM_FREQ, ENG_FREQ, SEC_FREQ) //command, engineering, security + freq_listening = list(GLOB.COMM_FREQ, GLOB.ENG_FREQ, GLOB.SEC_FREQ) //command, engineering, security //Common and other radio frequencies for people to freely use /obj/machinery/telecomms/receiver/preset_right/New() diff --git a/code/game/machinery/telecomms/machines/server.dm b/code/game/machinery/telecomms/machines/server.dm index f26e7cfe4d02d..519e5771c135e 100644 --- a/code/game/machinery/telecomms/machines/server.dm +++ b/code/game/machinery/telecomms/machines/server.dm @@ -142,22 +142,22 @@ /obj/machinery/telecomms/server/presets/science id = "Science Server" - freq_listening = list(SCI_FREQ) + freq_listening = list(GLOB.SCI_FREQ) autolinkers = list("science") /obj/machinery/telecomms/server/presets/medical id = "Medical Server" - freq_listening = list(MED_FREQ) + freq_listening = list(GLOB.MED_FREQ) autolinkers = list("medical") /obj/machinery/telecomms/server/presets/supply id = "Supply Server" - freq_listening = list(SUPP_FREQ) + freq_listening = list(GLOB.SUPP_FREQ) autolinkers = list("supply") /obj/machinery/telecomms/server/presets/service id = "Service Server" - freq_listening = list(SERV_FREQ) + freq_listening = list(GLOB.SERV_FREQ) autolinkers = list("service") /obj/machinery/telecomms/server/presets/common @@ -174,17 +174,17 @@ /obj/machinery/telecomms/server/presets/command id = "Command Server" - freq_listening = list(COMM_FREQ) + freq_listening = list(GLOB.COMM_FREQ) autolinkers = list("command") /obj/machinery/telecomms/server/presets/engineering id = "Engineering Server" - freq_listening = list(ENG_FREQ) + freq_listening = list(GLOB.ENG_FREQ) autolinkers = list("engineering") /obj/machinery/telecomms/server/presets/security id = "Security Server" - freq_listening = list(SEC_FREQ) + freq_listening = list(GLOB.SEC_FREQ) autolinkers = list("security") /obj/machinery/telecomms/server/presets/common/birdstation/New() diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm index d7792ec314b7c..acbe6792b2d07 100644 --- a/code/game/machinery/telecomms/telecomunications.dm +++ b/code/game/machinery/telecomms/telecomunications.dm @@ -12,7 +12,7 @@ Look at radio.dm for the prequel to this code. */ -var/global/list/obj/machinery/telecomms/telecomms_list = list() +GLOBAL_LIST_EMPTY(telecomms_list) /obj/machinery/telecomms icon = 'icons/obj/machines/telecomms.dmi' @@ -134,7 +134,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() /obj/machinery/telecomms/New() - telecomms_list += src + GLOB.telecomms_list += src ..() //Set the listening_level if there's none. @@ -156,13 +156,13 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list() for(var/obj/machinery/telecomms/T in urange(20, src, 1)) add_link(T) else - for(var/obj/machinery/telecomms/T in telecomms_list) + for(var/obj/machinery/telecomms/T in GLOB.telecomms_list) add_link(T) /obj/machinery/telecomms/Destroy() - telecomms_list -= src - for(var/obj/machinery/telecomms/comm in telecomms_list) + GLOB.telecomms_list -= src + for(var/obj/machinery/telecomms/comm in GLOB.telecomms_list) comm.links -= src links = list() return ..() diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 55d9fac2eddda..396214d2245a4 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -165,7 +165,7 @@ var/list/L = list() var/list/areaindex = list() if(regime_set == "Teleporter") - for(var/obj/item/device/radio/beacon/R in teleportbeacons) + for(var/obj/item/device/radio/beacon/R in GLOB.teleportbeacons) var/turf/T = get_turf(R) if(!T) continue @@ -173,7 +173,7 @@ continue L[avoid_assoc_duplicate_keys(T.loc.name, areaindex)] = R - for(var/obj/item/weapon/implant/tracking/I in tracked_implants) + for(var/obj/item/weapon/implant/tracking/I in GLOB.tracked_implants) if(!I.imp_in || !ismob(I.loc)) continue else diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index b81522d5bbf40..4e9534b508f0b 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -162,7 +162,7 @@ while(R.amount>0) var/obj/O = new dump_path(loc) - step(O, pick(alldirs)) //we only drop 20% of the total of each products and spread it + step(O, pick(GLOB.alldirs)) //we only drop 20% of the total of each products and spread it R.amount -= 5 //around to not fill the turf with too many objects. dump_amount++ if(dump_amount > 15) //so we don't drop too many items (e.g. ClothesMate) diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index 597ed7827a274..768c6cd1f0c4e 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -23,7 +23,7 @@ armor = list(melee = 40, bullet = 40, laser = 50, energy = 35, bomb = 20, bio = 0, rad = 0, fire = 100, acid = 100) max_temperature = 35000 leg_overload_coeff = 100 - operation_req_access = list(access_syndicate) + operation_req_access = list(GLOB.access_syndicate) wreckage = /obj/structure/mecha_wreckage/gygax/dark max_equip = 4 diff --git a/code/game/mecha/combat/honker.dm b/code/game/mecha/combat/honker.dm index 3f8bf6bd35a8f..cee8c641fdc2f 100644 --- a/code/game/mecha/combat/honker.dm +++ b/code/game/mecha/combat/honker.dm @@ -10,7 +10,7 @@ armor = list(melee = -20, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 100) max_temperature = 25000 infra_luminosity = 5 - operation_req_access = list(access_theatre) + operation_req_access = list(GLOB.access_theatre) wreckage = /obj/structure/mecha_wreckage/honker add_req_access = 0 max_equip = 3 diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index ea0e307525527..5f14a9f89a500 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -10,7 +10,7 @@ max_temperature = 60000 resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF infra_luminosity = 3 - operation_req_access = list(access_cent_specops) + operation_req_access = list(GLOB.access_cent_specops) wreckage = /obj/structure/mecha_wreckage/marauder add_req_access = 0 internal_damage_threshold = 25 @@ -45,7 +45,7 @@ desc = "Heavy-duty, command-type exosuit. This is a custom model, utilized only by high-ranking military personnel." name = "\improper Seraph" icon_state = "seraph" - operation_req_access = list(access_cent_specops) + operation_req_access = list(GLOB.access_cent_specops) step_in = 3 obj_integrity = 550 wreckage = /obj/structure/mecha_wreckage/seraph @@ -71,7 +71,7 @@ desc = "Heavy-duty, combat exosuit, developed off of the existing Marauder model." name = "\improper Mauler" icon_state = "mauler" - operation_req_access = list(access_syndicate) + operation_req_access = list(GLOB.access_syndicate) wreckage = /obj/structure/mecha_wreckage/mauler max_equip = 5 diff --git a/code/game/mecha/combat/reticence.dm b/code/game/mecha/combat/reticence.dm index d0b0d00b176bf..41ddacc748797 100644 --- a/code/game/mecha/combat/reticence.dm +++ b/code/game/mecha/combat/reticence.dm @@ -10,7 +10,7 @@ armor = list(melee = 25, bullet = 20, laser = 30, energy = 15, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 100) max_temperature = 15000 wreckage = /obj/structure/mecha_wreckage/reticence - operation_req_access = list(access_theatre) + operation_req_access = list(GLOB.access_theatre) add_req_access = 0 internal_damage_threshold = 25 max_equip = 2 diff --git a/code/game/mecha/equipment/tools/work_tools.dm b/code/game/mecha/equipment/tools/work_tools.dm index 09f12d207e91f..e7e837909530f 100644 --- a/code/game/mecha/equipment/tools/work_tools.dm +++ b/code/game/mecha/equipment/tools/work_tools.dm @@ -199,11 +199,11 @@ var/mode = 0 //0 - deconstruct, 1 - wall or floor, 2 - airlock. /obj/item/mecha_parts/mecha_equipment/rcd/New() - rcd_list += src + GLOB.rcd_list += src ..() /obj/item/mecha_parts/mecha_equipment/rcd/Destroy() - rcd_list -= src + GLOB.rcd_list -= src return ..() /obj/item/mecha_parts/mecha_equipment/rcd/action(atom/target) @@ -420,7 +420,7 @@ if(!PN) PN = new() - powernets += PN + GLOB.powernets += PN NC.powernet = PN PN.cables += NC NC.mergeConnectedNetworks(NC.d2) diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index f669960f88352..134bd78e8420b 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -95,7 +95,7 @@ return interact(user) -/obj/machinery/computer/mech_bay_power_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/obj/machinery/computer/mech_bay_power_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "mech_bay_power_console", "Mech Bay Power Control Console", 400, 170, master_ui, state) @@ -130,7 +130,7 @@ return recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in range(1) if(!recharge_port ) - for(var/D in cardinal) + for(var/D in GLOB.cardinal) var/turf/A = get_step(src, D) A = get_step(A, D) recharge_port = locate(/obj/machinery/mech_bay_recharge_port) in A diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index e94aca889dfc5..f5a6e9fac4922 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -8,7 +8,7 @@ use_power = 1 idle_power_usage = 20 active_power_usage = 5000 - req_access = list(access_robotics) + req_access = list(GLOB.access_robotics) var/time_coeff = 1 var/component_coeff = 1 var/datum/material_container/materials diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index b2fac45c4c835..f4c52c03003f9 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -65,7 +65,7 @@ var/internal_damage = 0 //contains bitflags var/list/operation_req_access = list()//required access level for mecha operation - var/list/internals_req_access = list(access_engine,access_robotics)//required access level to open cell compartment + var/list/internals_req_access = list(GLOB.access_engine,GLOB.access_robotics)//required access level to open cell compartment var/wreckage @@ -132,11 +132,11 @@ smoke_system.attach(src) add_cell() START_PROCESSING(SSobj, src) - poi_list |= src + GLOB.poi_list |= src log_message("[src.name] created.") - mechas_list += src //global mech list + GLOB.mechas_list += src //global mech list prepare_huds() - var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC] diag_hud.add_to_hud(src) diag_hud_set_mechhealth() diag_hud_set_mechcell() @@ -185,7 +185,7 @@ if(AI) AI.gib() //No wreck, no AI to recover STOP_PROCESSING(SSobj, src) - poi_list.Remove(src) + GLOB.poi_list.Remove(src) equipment.Cut() cell = null internal_tank = null @@ -200,7 +200,7 @@ qdel(smoke_system) smoke_system = null - mechas_list -= src //global mech list + GLOB.mechas_list -= src //global mech list return ..() //////////////////////// @@ -1011,7 +1011,7 @@ /obj/mecha/proc/log_message(message as text,red=null) log.len++ - log[log.len] = list("time"="[worldtime2text()]","date","year"="[year_integer+540]","message"="[red?"":null][message][red?"":null]") + log[log.len] = list("time"="[worldtime2text()]","date","year"="[GLOB.year_integer+540]","message"="[red?"":null][message][red?"":null]") return log.len /obj/mecha/proc/log_append_to_last(message as text,red=null) @@ -1019,8 +1019,8 @@ last_entry["message"] += "
[red?"":null][message][red?"":null]" return -var/year = time2text(world.realtime,"YYYY") -var/year_integer = text2num(year) // = 2013??? +GLOBAL_VAR_INIT(year, time2text(world.realtime,"YYYY")) +GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013??? /////////////////////// ///// Power stuff ///// diff --git a/code/game/mecha/mecha_control_console.dm b/code/game/mecha/mecha_control_console.dm index bbafd46dd2488..96c59f62f359d 100644 --- a/code/game/mecha/mecha_control_console.dm +++ b/code/game/mecha/mecha_control_console.dm @@ -3,7 +3,7 @@ desc = "Used to remotely locate or lockdown exosuits." icon_screen = "mecha" icon_keyboard = "tech_key" - req_access = list(access_robotics) + req_access = list(GLOB.access_robotics) circuit = /obj/item/weapon/circuitboard/computer/mecha_control var/list/located = list() var/screen = 0 @@ -17,7 +17,7 @@ if(screen == 0) dat += "

Tracking beacons data

" var/list/trackerlist = list() - for(var/obj/mecha/MC in mechas_list) + for(var/obj/mecha/MC in GLOB.mechas_list) trackerlist += MC.trackers for(var/obj/item/mecha_parts/mecha_tracking/TR in trackerlist) var/answer = TR.get_mecha_info() diff --git a/code/game/mecha/mecha_defense.dm b/code/game/mecha/mecha_defense.dm index 512629cae358c..564b59f7868e9 100644 --- a/code/game/mecha/mecha_defense.dm +++ b/code/game/mecha/mecha_defense.dm @@ -312,7 +312,7 @@ L.narsie_act() /obj/mecha/ratvar_act() - if((ratvar_awakens || clockwork_gateway_activated) && occupant) + if((GLOB.ratvar_awakens || GLOB.clockwork_gateway_activated) && occupant) if(is_servant_of_ratvar(occupant)) //reward the minion that got a mech by repairing it full_repair(TRUE) else diff --git a/code/game/mecha/medical/odysseus.dm b/code/game/mecha/medical/odysseus.dm index f9ae636dff922..d9539cfcd16f7 100644 --- a/code/game/mecha/medical/odysseus.dm +++ b/code/game/mecha/medical/odysseus.dm @@ -17,7 +17,7 @@ if(H.glasses && istype(H.glasses, /obj/item/clothing/glasses/hud)) occupant_message("Your [H.glasses] prevent you from using the built-in medical hud.") else - var/datum/atom_hud/data/human/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] A.add_hud_to(H) builtin_hud_user = 1 return 1 @@ -27,7 +27,7 @@ /obj/mecha/medical/odysseus/go_out() if(ishuman(occupant) && builtin_hud_user) var/mob/living/carbon/human/H = occupant - var/datum/atom_hud/data/human/medical/advanced/A = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/data/human/medical/advanced/A = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] A.remove_hud_from(H) ..() return diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm index a501e59981df9..071c95cb46de2 100644 --- a/code/game/objects/effects/anomalies.dm +++ b/code/game/objects/effects/anomalies.dm @@ -19,7 +19,7 @@ /obj/effect/anomaly/Initialize(mapload, new_lifespan) ..() - poi_list |= src + GLOB.poi_list |= src START_PROCESSING(SSobj, src) impact_area = get_area(src) @@ -47,14 +47,14 @@ qdel(src) /obj/effect/anomaly/Destroy() - poi_list.Remove(src) + GLOB.poi_list.Remove(src) STOP_PROCESSING(SSobj, src) qdel(countdown) return ..() /obj/effect/anomaly/proc/anomalyEffect() if(prob(movechance)) - step(src,pick(alldirs)) + step(src,pick(GLOB.alldirs)) /obj/effect/anomaly/proc/detonate() return @@ -198,7 +198,7 @@ // Calculate new position (searches through beacons in world) var/obj/item/device/radio/beacon/chosen var/list/possible = list() - for(var/obj/item/device/radio/beacon/W in teleportbeacons) + for(var/obj/item/device/radio/beacon/W in GLOB.teleportbeacons) possible += W if(possible.len > 0) diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm index 722f29e913247..a804a2d4c7dde 100644 --- a/code/game/objects/effects/bump_teleporter.dm +++ b/code/game/objects/effects/bump_teleporter.dm @@ -1,5 +1,3 @@ -var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() - /obj/effect/bump_teleporter name = "bump-teleporter" icon = 'icons/mob/screen_gen.dmi' @@ -11,12 +9,14 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() density = 1 opacity = 0 + var/static/list/AllTeleporters + /obj/effect/bump_teleporter/New() ..() - BUMP_TELEPORTERS += src + LAZYADD(AllTeleporters, src) /obj/effect/bump_teleporter/Destroy() - BUMP_TELEPORTERS -= src + LAZYREMOVE(AllTeleporters, src) return ..() /obj/effect/bump_teleporter/Bumped(atom/user) @@ -28,7 +28,7 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() //user.loc = src.loc //Stop at teleporter location, there is nowhere to teleport to. return - for(var/obj/effect/bump_teleporter/BT in BUMP_TELEPORTERS) + for(var/obj/effect/bump_teleporter/BT in AllTeleporters) if(BT.id == src.id_target) usr.loc = BT.loc //Teleport to location with correct id. return \ No newline at end of file diff --git a/code/game/objects/effects/decals/Cleanable/humans.dm b/code/game/objects/effects/decals/Cleanable/humans.dm index d94a68a1afcf5..58007fc050dcd 100644 --- a/code/game/objects/effects/decals/Cleanable/humans.dm +++ b/code/game/objects/effects/decals/Cleanable/humans.dm @@ -139,23 +139,23 @@ /obj/effect/decal/cleanable/blood/footprints/update_icon() cut_overlays() - for(var/Ddir in cardinal) + for(var/Ddir in GLOB.cardinal) if(entered_dirs & Ddir) var/image/I - if(bloody_footprints_cache["entered-[blood_state]-[Ddir]"]) - I = bloody_footprints_cache["entered-[blood_state]-[Ddir]"] + if(GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"]) + I = GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] else I = image(icon,"[blood_state]1",dir = Ddir) - bloody_footprints_cache["entered-[blood_state]-[Ddir]"] = I + GLOB.bloody_footprints_cache["entered-[blood_state]-[Ddir]"] = I if(I) add_overlay(I) if(exited_dirs & Ddir) var/image/I - if(bloody_footprints_cache["exited-[blood_state]-[Ddir]"]) - I = bloody_footprints_cache["exited-[blood_state]-[Ddir]"] + if(GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"]) + I = GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"] else I = image(icon,"[blood_state]2",dir = Ddir) - bloody_footprints_cache["exited-[blood_state]-[Ddir]"] = I + GLOB.bloody_footprints_cache["exited-[blood_state]-[Ddir]"] = I if(I) add_overlay(I) diff --git a/code/game/objects/effects/decals/crayon.dm b/code/game/objects/effects/decals/crayon.dm index 0b80d6b0d92fe..6a41809eb1778 100644 --- a/code/game/objects/effects/decals/crayon.dm +++ b/code/game/objects/effects/decals/crayon.dm @@ -12,7 +12,7 @@ name = e_name desc = "A [name] vandalizing the station." if(type == "poseur tag") - type = pick(gang_name_pool) + type = pick(GLOB.gang_name_pool) if(alt_icon) icon = alt_icon diff --git a/code/game/objects/effects/effect_system/effect_system.dm b/code/game/objects/effects/effect_system/effect_system.dm index f544263fda8d5..34b20fde6f3b0 100644 --- a/code/game/objects/effects/effect_system/effect_system.dm +++ b/code/game/objects/effects/effect_system/effect_system.dm @@ -14,11 +14,11 @@ would spawn and follow the beaker, even if it is carried or thrown. /obj/effect/particle_effect/New() ..() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) /obj/effect/particle_effect/Destroy() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) . = ..() /datum/effect_system @@ -60,9 +60,9 @@ would spawn and follow the beaker, even if it is carried or thrown. total_effects++ var/direction if(cardinals) - direction = pick(cardinal) + direction = pick(GLOB.cardinal) else - direction = pick(alldirs) + direction = pick(GLOB.alldirs) var/steps_amt = pick(1,2,3) for(var/j in 1 to steps_amt) sleep(5) diff --git a/code/game/objects/effects/effect_system/effects_explosion.dm b/code/game/objects/effects/effect_system/effects_explosion.dm index c8d54842b6cec..bd9a54880da46 100644 --- a/code/game/objects/effects/effect_system/effects_explosion.dm +++ b/code/game/objects/effects/effect_system/effects_explosion.dm @@ -15,7 +15,7 @@ for(var/i in 1 to number) spawn(0) var/obj/effect/particle_effect/expl_particles/expl = new /obj/effect/particle_effect/expl_particles(location) - var/direct = pick(alldirs) + var/direct = pick(GLOB.alldirs) var/steps_amt = pick(1;25,2;50,3,4;200) for(var/j in 1 to steps_amt) sleep(1) diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm index c41acdcf85357..a34e30e689f1e 100644 --- a/code/game/objects/effects/effect_system/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/effects_smoke.dm @@ -84,7 +84,7 @@ smoke_mob(L) var/obj/effect/particle_effect/smoke/S = new type(T) reagents.copy_to(S, reagents.total_volume) - S.setDir(pick(cardinal)) + S.setDir(pick(GLOB.cardinal)) S.amount = amount-1 S.add_atom_colour(color, FIXED_COLOUR_PRIORITY) S.lifetime = lifetime diff --git a/code/game/objects/effects/effect_system/effects_water.dm b/code/game/objects/effects/effect_system/effects_water.dm index e12894d970e0a..0cd476e00160a 100644 --- a/code/game/objects/effects/effect_system/effects_water.dm +++ b/code/game/objects/effects/effect_system/effects_water.dm @@ -34,7 +34,7 @@ // 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 + 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 diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm index 80255d3e6cd77..9b0702edbec59 100644 --- a/code/game/objects/effects/glowshroom.dm +++ b/code/game/objects/effects/glowshroom.dm @@ -1,9 +1,5 @@ //separate dm since hydro is getting bloated already -var/list/blacklisted_glowshroom_turfs = typecacheof(list( - /turf/open/floor/plating/lava, - /turf/open/floor/plating/beach/water)) - /obj/structure/glowshroom name = "glowshroom" desc = "Mycena Bregprox, a species of mushroom that glows in the dark." @@ -20,6 +16,9 @@ var/list/blacklisted_glowshroom_turfs = typecacheof(list( var/generation = 1 var/spreadIntoAdjacentChance = 60 var/obj/item/seeds/myseed = /obj/item/seeds/glowshroom + var/static/list/blacklisted_glowshroom_turfs = typecacheof(list( + /turf/open/floor/plating/lava, + /turf/open/floor/plating/beach/water)) /obj/structure/glowshroom/glowcap name = "glowcap" @@ -110,7 +109,7 @@ var/list/blacklisted_glowshroom_turfs = typecacheof(list( var/placeCount = 1 for(var/obj/structure/glowshroom/shroom in newLoc) shroomCount++ - for(var/wallDir in cardinal) + for(var/wallDir in GLOB.cardinal) var/turf/isWall = get_step(newLoc,wallDir) if(isWall.density) placeCount++ @@ -131,7 +130,7 @@ var/list/blacklisted_glowshroom_turfs = typecacheof(list( /obj/structure/glowshroom/proc/CalcDir(turf/location = loc) var/direction = 16 - for(var/wallDir in cardinal) + for(var/wallDir in GLOB.cardinal) var/turf/newTurf = get_step(location,wallDir) if(newTurf.density) direction |= wallDir diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index 3bb66f30095ac..57e3763ef70d9 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -8,10 +8,10 @@ /obj/effect/landmark/New() ..() tag = text("landmark*[]", name) - landmarks_list += src + GLOB.landmarks_list += src /obj/effect/landmark/Destroy() - landmarks_list -= src + GLOB.landmarks_list -= src return ..() /obj/effect/landmark/start @@ -21,13 +21,13 @@ anchored = 1 /obj/effect/landmark/start/New() - start_landmarks_list += src + GLOB.start_landmarks_list += src ..() if(name != "start") tag = "start*[name]" /obj/effect/landmark/start/Destroy() - start_landmarks_list -= src + GLOB.start_landmarks_list -= src return ..() // START LANDMARKS FOLLOW. Don't change the names unless @@ -136,10 +136,10 @@ /obj/effect/landmark/start/depsec/New() ..() - department_security_spawns += src + GLOB.department_security_spawns += src /obj/effect/landmark/start/depsec/Destroy() - department_security_spawns -= src + GLOB.department_security_spawns -= src return ..() /obj/effect/landmark/start/depsec/supply @@ -159,7 +159,7 @@ /obj/effect/landmark/start/wizard/Initialize(mapload) ..() - wizardstart += loc + GLOB.wizardstart += loc qdel(src) /obj/effect/landmark/start/new_player @@ -169,7 +169,7 @@ // join before SSatom initializes everything. /obj/effect/landmark/start/new_player/New(loc) ..() - newplayer_start += loc + GLOB.newplayer_start += loc /obj/effect/landmark/start/new_player/Initialize(mapload) ..() @@ -182,7 +182,7 @@ /obj/effect/landmark/latejoin/Initialize(mapload) ..() - latejoin += loc + GLOB.latejoin += loc qdel(src) // carp. @@ -228,7 +228,7 @@ /obj/effect/landmark/xeno_spawn/Initialize(mapload) ..() - xeno_spawn += loc + GLOB.xeno_spawn += loc qdel(src) // blobs. @@ -237,7 +237,7 @@ /obj/effect/landmark/blobstart/Initialize(mapload) ..() - blobstart += loc + GLOB.blobstart += loc qdel(src) /obj/effect/landmark/secequipment @@ -245,7 +245,7 @@ /obj/effect/landmark/secequipment/Initialize(mapload) ..() - secequipment += loc + GLOB.secequipment += loc qdel(src) /obj/effect/landmark/prisonwarp @@ -253,7 +253,7 @@ /obj/effect/landmark/prisonwarp/Initialize(mapload) ..() - prisonwarp += loc + GLOB.prisonwarp += loc qdel(src) /obj/effect/landmark/ert_spawn @@ -261,7 +261,7 @@ /obj/effect/landmark/ert_spawn/Initialize(mapload) ..() - emergencyresponseteamspawn += loc + GLOB.emergencyresponseteamspawn += loc qdel(src) /obj/effect/landmark/holding_facility @@ -269,7 +269,7 @@ /obj/effect/landmark/holding_facility/Initialize(mapload) ..() - holdingfacility += loc + GLOB.holdingfacility += loc qdel(src) /obj/effect/landmark/thunderdome/observe @@ -277,7 +277,7 @@ /obj/effect/landmark/thunderdome/observe/Initialize(mapload) ..() - tdomeobserve += loc + GLOB.tdomeobserve += loc qdel(src) /obj/effect/landmark/thunderdome/one @@ -285,7 +285,7 @@ /obj/effect/landmark/thunderdome/one/Initialize(mapload) ..() - tdome1 += loc + GLOB.tdome1 += loc qdel(src) /obj/effect/landmark/thunderdome/two @@ -293,7 +293,7 @@ /obj/effect/landmark/thunderdome/two/Initialize(mapload) ..() - tdome2 += loc + GLOB.tdome2 += loc qdel(src) /obj/effect/landmark/thunderdome/admin @@ -301,7 +301,7 @@ /obj/effect/landmark/thunderdome/admin/Initialize(mapload) ..() - tdomeadmin += loc + GLOB.tdomeadmin += loc qdel(src) //generic event spawns @@ -312,22 +312,22 @@ /obj/effect/landmark/event_spawn/New() ..() - generic_event_spawns += src + GLOB.generic_event_spawns += src /obj/effect/landmark/event_spawn/Destroy() - generic_event_spawns -= src + GLOB.generic_event_spawns -= src return ..() /obj/effect/landmark/ruin var/datum/map_template/ruin/ruin_template /obj/effect/landmark/ruin/New(loc, my_ruin_template) - name = "ruin_[ruin_landmarks.len + 1]" + name = "ruin_[GLOB.ruin_landmarks.len + 1]" ..(loc) ruin_template = my_ruin_template - ruin_landmarks |= src + GLOB.ruin_landmarks |= src /obj/effect/landmark/ruin/Destroy() - ruin_landmarks -= src + GLOB.ruin_landmarks -= src ruin_template = null . = ..() diff --git a/code/game/objects/effects/manifest.dm b/code/game/objects/effects/manifest.dm index 5052531cf38cc..6981329bc68f4 100644 --- a/code/game/objects/effects/manifest.dm +++ b/code/game/objects/effects/manifest.dm @@ -8,7 +8,7 @@ /obj/effect/manifest/proc/manifest() var/dat = "Crew Manifest:
" - for(var/mob/living/carbon/human/M in mob_list) + for(var/mob/living/carbon/human/M in GLOB.mob_list) dat += text(" [] - []
", M.name, M.get_assignment()) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc ) P.info = dat diff --git a/code/game/objects/effects/overlays.dm b/code/game/objects/effects/overlays.dm index 1310523669f5e..e83ecda8094b7 100644 --- a/code/game/objects/effects/overlays.dm +++ b/code/game/objects/effects/overlays.dm @@ -34,7 +34,7 @@ /obj/effect/overlay/temp/New() ..() if(randomdir) - setDir(pick(cardinal)) + setDir(pick(GLOB.cardinal)) flick("[icon_state]", src) //Because we might be pulling it from a pool, flick whatever icon it uses so it starts at the start of the icon's animation. timerid = QDEL_IN(src, duration) @@ -58,7 +58,7 @@ var/splatter_type = "splatter" /obj/effect/overlay/temp/dir_setting/bloodsplatter/New(loc, set_dir) - if(set_dir in diagonals) + if(set_dir in GLOB.diagonals) icon_state = "[splatter_type][pick(1, 2, 6)]" else icon_state = "[splatter_type][pick(3, 4, 5)]" diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 9a51c63ca721f..6aff1855fb5f8 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -30,7 +30,7 @@ /obj/effect/portal/New(loc, turf/target, creator=null, lifespan=300) ..() - portals += src + GLOB.portals += src src.target = target src.creator = creator @@ -42,7 +42,7 @@ QDEL_IN(src, lifespan) /obj/effect/portal/Destroy() - portals -= src + GLOB.portals -= src if(istype(creator, /obj/item/weapon/hand_tele)) var/obj/item/weapon/hand_tele/O = creator O.active_portals-- diff --git a/code/game/objects/effects/spawners/gibspawner.dm b/code/game/objects/effects/spawners/gibspawner.dm index 19a7250d87c8a..43c0990c69801 100644 --- a/code/game/objects/effects/spawners/gibspawner.dm +++ b/code/game/objects/effects/spawners/gibspawner.dm @@ -64,7 +64,7 @@ /obj/effect/gibspawner/human/Initialize() playsound(src, 'sound/effects/blobattack.ogg', 50, 1) - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list()) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list()) ..() @@ -74,7 +74,7 @@ /obj/effect/gibspawner/humanbodypartless/Initialize() playsound(src, 'sound/effects/blobattack.ogg', 50, 1) - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, list()) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list()) ..() @@ -84,7 +84,7 @@ /obj/effect/gibspawner/xeno/Initialize() playsound(src, 'sound/effects/blobattack.ogg', 60, 1) - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs, list()) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs, list()) ..() @@ -95,7 +95,7 @@ /obj/effect/gibspawner/xenobodypartless/Initialize() playsound(src, 'sound/effects/blobattack.ogg', 60, 1) - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, list()) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, list()) ..() /obj/effect/gibspawner/larva @@ -104,7 +104,7 @@ /obj/effect/gibspawner/larva/Initialize() playsound(src, 'sound/effects/blobattack.ogg', 60, 1) - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list(), alldirs) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST), list(), GLOB.alldirs) ..() /obj/effect/gibspawner/larvabodypartless @@ -122,6 +122,6 @@ gibamounts = list(1,1,1,1,1,1) /obj/effect/gibspawner/robot/Initialize() - gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), alldirs, alldirs) + gibdirections = list(list(NORTH, NORTHEAST, NORTHWEST),list(SOUTH, SOUTHEAST, SOUTHWEST),list(WEST, NORTHWEST, SOUTHWEST),list(EAST, NORTHEAST, SOUTHEAST), GLOB.alldirs, GLOB.alldirs) gibamounts[6] = pick(0,1,2) ..() diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 90ef6857d4711..2c57f4930b341 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -1,5 +1,3 @@ -var/explosionid = 1 - /proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0 ,silent = 0, smoke = 1) set waitfor = 0 src = null //so we don't abort once src is deleted @@ -14,11 +12,11 @@ var/explosionid = 1 if(!ignorecap && epicenter.z != ZLEVEL_MINING) //Clamp all values to MAX_EXPLOSION_RANGE - devastation_range = min(MAX_EX_DEVESTATION_RANGE, devastation_range) - heavy_impact_range = min(MAX_EX_HEAVY_RANGE, heavy_impact_range) - light_impact_range = min(MAX_EX_LIGHT_RANGE, light_impact_range) - flash_range = min(MAX_EX_FLASH_RANGE, flash_range) - flame_range = min(MAX_EX_FLAME_RANGE, flame_range) + devastation_range = min(GLOB.MAX_EX_DEVESTATION_RANGE, devastation_range) + heavy_impact_range = min(GLOB.MAX_EX_HEAVY_RANGE, heavy_impact_range) + light_impact_range = min(GLOB.MAX_EX_LIGHT_RANGE, light_impact_range) + flash_range = min(GLOB.MAX_EX_FLASH_RANGE, flash_range) + flame_range = min(GLOB.MAX_EX_FLAME_RANGE, flame_range) //DO NOT REMOVE THIS SLEEP, IT BREAKS THINGS //not sleeping causes us to ex_act() the thing that triggered the explosion @@ -29,6 +27,7 @@ var/explosionid = 1 //and somethings expect us to ex_act them so they can qdel() sleep(1) //tldr, let the calling proc call qdel(src) before we explode + var/static/explosionid = 1 var/id = explosionid++ var/start = world.timeofday @@ -52,7 +51,7 @@ var/explosionid = 1 if(!silent) var/frequency = get_rand_frequency() var/ex_sound = get_sfx("explosion") - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) // Double check for client if(M && M.client) var/turf/M_turf = get_turf(M) @@ -180,11 +179,11 @@ var/explosionid = 1 var/took = (world.timeofday-start)/10 //You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare - if(Debug2) + if(GLOB.Debug2) log_world("## 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/array in doppler_arrays) + for(var/array in GLOB.doppler_arrays) var/obj/machinery/doppler_array/A = array A.sense_explosion(epicenter,devastation_range,heavy_impact_range,light_impact_range,took,orig_dev_range,orig_heavy_range,orig_light_range) @@ -278,7 +277,7 @@ var/explosionid = 1 if(!power) return var/range = 0 - range = round((2 * power)**DYN_EX_SCALE) + range = round((2 * power)**GLOB.DYN_EX_SCALE) explosion(epicenter, round(range * 0.25), round(range * 0.5), round(range), flash_range*range, adminlog, ignorecap, flame_range*range, silent, smoke) // Using default dyn_ex scale: diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 85b1886e6c986..9e962ddeecaaa 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,4 +1,4 @@ -var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_state" = "fire") +GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/effects/fire.dmi', "icon_state" = "fire")) /obj/item name = "item" @@ -502,7 +502,7 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s if(.) if(initial(icon) && initial(icon_state)) var/index = blood_splatter_index() - var/icon/blood_splatter_icon = blood_splatter_icons[index] + var/icon/blood_splatter_icon = GLOB.blood_splatter_icons[index] if(blood_splatter_icon) cut_overlay(blood_splatter_icon) diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm index fb6c349f17731..edc7d0f3fe841 100644 --- a/code/game/objects/items/apc_frame.dm +++ b/code/game/objects/items/apc_frame.dm @@ -12,7 +12,7 @@ if(get_dist(on_wall,user)>1) return var/ndir = get_dir(on_wall, user) - if(!(ndir in cardinal)) + if(!(ndir in GLOB.cardinal)) return var/turf/T = get_turf(user) var/area/A = get_area(T) diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index f1e5b7f83bf69..f1535db19d2b1 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -168,18 +168,18 @@ /obj/item/areaeditor/blueprints/proc/view_wire_devices(mob/user) var/message = "
You examine the wire legend.
" - for(var/wireset in wire_color_directory) - message += "
[wire_name_directory[wireset]]" + for(var/wireset in GLOB.wire_color_directory) + message += "
[GLOB.wire_name_directory[wireset]]" message += "

" return message /obj/item/areaeditor/blueprints/proc/view_wire_set(mob/user, wireset) //for some reason you can't use wireset directly as a derefencer so this is the next best :/ - for(var/device in wire_color_directory) + for(var/device in GLOB.wire_color_directory) if("[device]" == wireset) //I know... don't change it... - var/message = "

[wire_name_directory[device]]:" - for(var/Col in wire_color_directory[device]) - var/wire_name = wire_color_directory[device][Col] + var/message = "

[GLOB.wire_name_directory[device]]:" + for(var/Col in GLOB.wire_color_directory[device]) + var/wire_name = GLOB.wire_color_directory[device][Col] if(!findtext(wire_name, WIRE_DUD_PREFIX)) //don't show duds message += "

[Col]: [wire_name]

" message += "

" @@ -309,7 +309,7 @@ return ROOM_ERR_TOOLARGE var/turf/T = pending[1] //why byond havent list::pop()? pending -= T - for (var/dir in cardinal) + for (var/dir in GLOB.cardinal) var/skip = 0 for (var/obj/structure/window/W in T) if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))) @@ -343,7 +343,7 @@ for(var/V in border) //lazy but works var/turf/F = V - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction == border[F]) continue //don't want to grab turfs from outside the border var/turf/U = get_step(F, direction) diff --git a/code/game/objects/items/cardboard_cutouts.dm b/code/game/objects/items/cardboard_cutouts.dm index b7e5e9edf8f3c..352a4fb9a7bc4 100644 --- a/code/game/objects/items/cardboard_cutouts.dm +++ b/code/game/objects/items/cardboard_cutouts.dm @@ -97,15 +97,15 @@ add_atom_colour("#FFD7A7", FIXED_COLOUR_PRIORITY) switch(new_appearance) if("Assistant") - name = "[pick(first_names_male)] [pick(last_names)]" + name = "[pick(GLOB.first_names_male)] [pick(GLOB.last_names)]" desc = "A cardboat cutout of an assistant." icon_state = "cutout_greytide" if("Clown") - name = pick(clown_names) + name = pick(GLOB.clown_names) desc = "A cardboard cutout of a clown. You get the feeling that it should be in a corner." icon_state = "cutout_clown" if("Mime") - name = pick(mime_names) + name = pick(GLOB.mime_names) desc = "...(A cardboard cutout of a mime.)" icon_state = "cutout_mime" if("Traitor") @@ -121,7 +121,7 @@ desc = "A cardboard cutout of a cultist." icon_state = "cutout_cultist" if("Clockwork Cultist") - name = "[pick(first_names_male)] [pick(last_names)]" + name = "[pick(GLOB.first_names_male)] [pick(GLOB.last_names)]" desc = "A cardboard cutout of a servant of Ratvar." icon_state = "cutout_servant" if("Revolutionary") @@ -129,7 +129,7 @@ desc = "A cardboard cutout of a revolutionary." icon_state = "cutout_viva" if("Wizard") - name = "[pick(wizard_first)], [pick(wizard_second)]" + name = "[pick(GLOB.wizard_first)], [pick(GLOB.wizard_second)]" desc = "A cardboard cutout of a wizard." icon_state = "cutout_wizard" if("Shadowling") @@ -151,7 +151,7 @@ desc = "A cardboard cutout of an ash walker." icon_state = "cutout_free_antag" if("Deathsquad Officer") - name = pick(commando_names) + name = pick(GLOB.commando_names) desc = "A cardboard cutout of a death commando." icon_state = "cutout_deathsquad" if("Ian") diff --git a/code/game/objects/items/charter.dm b/code/game/objects/items/charter.dm index ad23d12754abb..e5f4ac1cb75bc 100644 --- a/code/game/objects/items/charter.dm +++ b/code/game/objects/items/charter.dm @@ -18,10 +18,10 @@ /obj/item/station_charter/New() . = ..() if(!standard_station_regex) - var/prefixes = jointext(station_prefixes, "|") - var/names = jointext(station_names, "|") - var/suffixes = jointext(station_suffixes, "|") - var/numerals = jointext(station_numerals, "|") + var/prefixes = jointext(GLOB.station_prefixes, "|") + var/names = jointext(GLOB.station_names, "|") + var/suffixes = jointext(GLOB.station_suffixes, "|") + var/numerals = jointext(GLOB.station_numerals, "|") var/regexstr = "(([prefixes]) )?(([names]) ?)([suffixes]) ([numerals])" standard_station_regex = new(regexstr) @@ -35,7 +35,7 @@ if(used) to_chat(user, "This charter has already been used to name the station.") return - if(!ignores_timeout && (world.time-round_start_time > STATION_RENAME_TIME_LIMIT)) //5 minutes + if(!ignores_timeout && (world.time-SSticker.round_start_time > STATION_RENAME_TIME_LIMIT)) //5 minutes to_chat(user, "The crew has already settled into the shift. It probably wouldn't be good to rename the station right now.") return if(response_timer_id) @@ -60,7 +60,7 @@ to_chat(user, "Your name has been sent to your employers for approval.") // Autoapproves after a certain time response_timer_id = addtimer(CALLBACK(src, .proc/rename_station, new_name, user.name, user.real_name, key_name(user)), approval_time, TIMER_STOPPABLE) - to_chat(admins, "CUSTOM STATION RENAME:[key_name_admin(user)] (?) proposes to rename the station to [new_name] (will autoapprove in [approval_time / 10] seconds). [ADMIN_SMITE(user)] (REJECT) (RPLY)") + to_chat(GLOB.admins, "CUSTOM STATION RENAME:[key_name_admin(user)] (?) proposes to rename the station to [new_name] (will autoapprove in [approval_time / 10] seconds). [ADMIN_SMITE(user)] (REJECT) (RPLY)") /obj/item/station_charter/proc/reject_proposed(user) if(!user) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 9268536ca9b5a..098d33712338f 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -137,7 +137,7 @@ qdel(src) . = TRUE -/obj/item/toy/crayon/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = hands_state) +/obj/item/toy/crayon/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state) // tgui is a plague upon this codebase SStgui.try_update_ui(user, src, ui_key, ui, force_open) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index c6c940c623b36..1f8ef2cde222b 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -1,7 +1,7 @@ //The advanced pea-green monochrome lcd of tomorrow. -var/global/list/obj/item/device/pda/PDAs = list() +GLOBAL_LIST_EMPTY(PDAs) /obj/item/device/pda @@ -62,7 +62,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if(fon) set_light(f_lum) - PDAs += src + GLOB.PDAs += src if(default_cartridge) cartridge = new default_cartridge(src) inserted_item = new /obj/item/weapon/pen(src) @@ -138,7 +138,7 @@ var/global/list/obj/item/device/pda/PDAs = list() dat += text("
[id ? "Update PDA Info" : ""]

") dat += "[worldtime2text()]
" //:[world.time / 100 % 6][world.time / 100 % 10]" - dat += "[time2text(world.realtime, "MMM DD")] [year_integer+540]" + dat += "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]" dat += "

" @@ -474,7 +474,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if("Toggle Door") if(cartridge && cartridge.access_remote_door) - for(var/obj/machinery/door/poddoor/M in machines) + for(var/obj/machinery/door/poddoor/M in GLOB.machines) if(M.id == cartridge.remote_door_id) if(M.density) M.open() @@ -636,7 +636,7 @@ var/global/list/obj/item/device/pda/PDAs = list() add_overlay(image(icon, icon_alert)) /obj/item/device/pda/proc/show_to_ghosts(mob/living/user, datum/data_pda_msg/msg,multiple = 0) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(isobserver(M) && M.client && (M.client.prefs.chat_toggles & CHAT_GHOSTPDA)) var/link = FOLLOW_LINK(M, user) to_chat(M, "[link] [msg.sender] PDA Message --> [multiple ? "Everyone" : msg.recipient]: [msg.message][msg.get_photo_ref()]") @@ -646,8 +646,8 @@ var/global/list/obj/item/device/pda/PDAs = list() return null var/obj/machinery/message_server/useMS = null - if(message_servers) - for (var/obj/machinery/message_server/MS in message_servers) + if(GLOB.message_servers) + for (var/obj/machinery/message_server/MS in GLOB.message_servers) //PDAs are now dependant on the Message Server. if(MS.active) useMS = MS @@ -895,7 +895,7 @@ var/global/list/obj/item/device/pda/PDAs = list() return /obj/item/device/pda/Destroy() - PDAs -= src + GLOB.PDAs -= src if(id) qdel(id) id = null @@ -1004,7 +1004,7 @@ var/global/list/obj/item/device/pda/PDAs = list() /proc/get_viewable_pdas() . = list() // Returns a list of PDAs which can be viewed from another PDA/message monitor. - for(var/obj/item/device/pda/P in PDAs) + for(var/obj/item/device/pda/P in GLOB.PDAs) if(!P.owner || P.toff || P.hidden) continue . += P return . diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 8336fae85f5c9..3e044cb4a5239 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -305,8 +305,8 @@ Code: menu = "

Crew Manifest

" menu += "Entries cannot be modified from this terminal.

" - if(data_core.general) - for (var/datum/data/record/t in sortRecord(data_core.general)) + if(GLOB.data_core.general) + for (var/datum/data/record/t in sortRecord(GLOB.data_core.general)) menu += "[t.fields["name"]] - [t.fields["rank"]]
" menu += "
" @@ -332,7 +332,7 @@ Code: - for(var/obj/machinery/computer/monitor/pMon in machines) + for(var/obj/machinery/computer/monitor/pMon in GLOB.machines) if(!(pMon.stat & (NOPOWER|BROKEN)) ) powercount++ powermonitors += pMon @@ -379,14 +379,14 @@ Code: if (44) //medical records //This thing only displays a single screen so it's hard to really get the sub-menu stuff working. menu = "

Medical Record List

" - if(data_core.general) - for(var/datum/data/record/R in sortRecord(data_core.general)) + if(GLOB.data_core.general) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) menu += "[R.fields["id"]]: [R.fields["name"]]
" menu += "
" if(441) menu = "

Medical Record

" - if(active1 in data_core.general) + if(active1 in GLOB.data_core.general) menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]
" menu += "Sex: [active1.fields["sex"]]
" menu += "Age: [active1.fields["age"]]
" @@ -400,7 +400,7 @@ Code: menu += "
" menu += "

Medical Data

" - if(active2 in data_core.medical) + if(active2 in GLOB.data_core.medical) menu += "Blood Type: [active2.fields["blood_type"]]

" menu += "Minor Disabilities: [active2.fields["mi_dis"]]
" @@ -422,15 +422,15 @@ Code: menu += "
" if (45) //security records menu = "

Security Record List

" - if(data_core.general) - for (var/datum/data/record/R in sortRecord(data_core.general)) + if(GLOB.data_core.general) + for (var/datum/data/record/R in sortRecord(GLOB.data_core.general)) menu += "
[R.fields["id"]]: [R.fields["name"]]
" menu += "
" if(451) menu = "

Security Record

" - if(active1 in data_core.general) + if(active1 in GLOB.data_core.general) menu += "Name: [active1.fields["name"]] ID: [active1.fields["id"]]
" menu += "Sex: [active1.fields["sex"]]
" menu += "Age: [active1.fields["age"]]
" @@ -444,7 +444,7 @@ Code: menu += "
" menu += "

Security Data

" - if(active3 in data_core.security) + if(active3 in GLOB.data_core.security) menu += "Criminal Status: [active3.fields["criminal"]]
" menu += text("
\nMinor Crimes:") @@ -563,7 +563,7 @@ Code: menu += "

Located Cleanbots:

" ldat = null - for (var/mob/living/simple_animal/bot/cleanbot/B in living_mob_list) + for (var/mob/living/simple_animal/bot/cleanbot/B in GLOB.living_mob_list) var/turf/bl = get_turf(B) if(bl) @@ -585,7 +585,7 @@ Code: menu = "

Newscaster Access

" menu += "
Current Newsfeed:
[current_channel ? current_channel : "None"]
" var/datum/newscaster/feed_channel/current - for(var/datum/newscaster/feed_channel/chan in news_network.network_channels) + for(var/datum/newscaster/feed_channel/chan in GLOB.news_network.network_channels) if (chan.channel_name == current_channel) current = chan if(!current) @@ -619,18 +619,18 @@ Code: switch(href_list["choice"]) if("Medical Records") - active1 = find_record("id", href_list["target"], data_core.general) + active1 = find_record("id", href_list["target"], GLOB.data_core.general) if(active1) - active2 = find_record("id", href_list["target"], data_core.medical) + active2 = find_record("id", href_list["target"], GLOB.data_core.medical) pda.mode = 441 mode = 441 if(!active2) active1 = null if("Security Records") - active1 = find_record("id", href_list["target"], data_core.general) + active1 = find_record("id", href_list["target"], GLOB.data_core.general) if(active1) - active3 = find_record("id", href_list["target"], data_core.security) + active3 = find_record("id", href_list["target"], GLOB.data_core.security) pda.mode = 451 mode = 451 if(!active3) @@ -685,14 +685,14 @@ Code: var/pda_owner_name = pda.id ? "[pda.id.registered_name] ([pda.id.assignment])" : "Unknown" var/message = pda.msg_input() var/datum/newscaster/feed_channel/current - for(var/datum/newscaster/feed_channel/chan in news_network.network_channels) + for(var/datum/newscaster/feed_channel/chan in GLOB.news_network.network_channels) if (chan.channel_name == current_channel) current = chan if(current.locked && current.author != pda_owner_name) pda.cart += "
ERROR : NOT AUTHORIZED [pda.id ? "" : "- ID SLOT EMPTY"]
" pda.Topic(null,list("choice"="Refresh")) return - news_network.SubmitArticle(message,pda.owner,current_channel) + GLOB.news_network.SubmitArticle(message,pda.owner,current_channel) pda.Topic(null,list("choice"=num2text(mode))) return @@ -775,7 +775,7 @@ Code: var/turf/current_turf = get_turf(src) var/zlevel = current_turf.z var/botcount = 0 - for(Bot in living_mob_list) //Git da botz + for(Bot in GLOB.living_mob_list) //Git da botz if(!Bot.on || Bot.z != zlevel || Bot.remote_disabled || !(bot_access_flags & Bot.bot_type)) //Only non-emagged bots on the same Z-level are detected! continue //Also, the PDA must have access to the bot type. menu += "[Bot.name] ([Bot.get_mode()])
" diff --git a/code/game/objects/items/devices/PDA/radio.dm b/code/game/objects/items/devices/PDA/radio.dm index e1ae98de1ecbc..281ef8aad6be1 100644 --- a/code/game/objects/items/devices/PDA/radio.dm +++ b/code/game/objects/items/devices/PDA/radio.dm @@ -54,7 +54,7 @@ var/time = time2text(world.realtime,"hh:mm:ss") var/turf/T = get_turf(src) - lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") + GLOB.lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") var/datum/signal/signal = new signal.source = src diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm index 5a0dec5807ae5..86104f7b941fa 100644 --- a/code/game/objects/items/devices/aicard.dm +++ b/code/game/objects/items/devices/aicard.dm @@ -38,7 +38,7 @@ cut_overlays() /obj/item/device/aicard/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = hands_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "intellicard", name, 500, 500, master_ui, state) diff --git a/code/game/objects/items/devices/camera_bug.dm b/code/game/objects/items/devices/camera_bug.dm index d36af0cc04aeb..b2a9e6420c173 100644 --- a/code/game/objects/items/devices/camera_bug.dm +++ b/code/game/objects/items/devices/camera_bug.dm @@ -74,7 +74,7 @@ /obj/item/device/camera_bug/proc/get_cameras() if( world.time > (last_net_update + 100)) bugged_cameras = list() - for(var/obj/machinery/camera/camera in cameranet.cameras) + for(var/obj/machinery/camera/camera in GLOB.cameranet.cameras) if(camera.stat || !camera.can_use()) continue if(length(list("SS13","MINE")&camera.network)) diff --git a/code/game/objects/items/devices/multitool.dm b/code/game/objects/items/devices/multitool.dm index e3177d8dadbe5..2a49674035a4d 100644 --- a/code/game/objects/items/devices/multitool.dm +++ b/code/game/objects/items/devices/multitool.dm @@ -53,13 +53,13 @@ /obj/item/device/multitool/ai_detect/proc/multitool_detect() var/turf/our_turf = get_turf(src) - for(var/mob/living/silicon/ai/AI in ai_list) + for(var/mob/living/silicon/ai/AI in GLOB.ai_list) if(AI.cameraFollow == src) detect_state = PROXIMITY_ON_SCREEN break - if(!detect_state && cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)) - var/datum/camerachunk/chunk = cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z) + if(!detect_state && GLOB.cameranet.chunkGenerated(our_turf.x, our_turf.y, our_turf.z)) + var/datum/camerachunk/chunk = GLOB.cameranet.getCameraChunk(our_turf.x, our_turf.y, our_turf.z) if(chunk) if(chunk.seenby.len) for(var/mob/camera/aiEye/A in chunk.seenby) @@ -78,7 +78,7 @@ /obj/item/device/multitool/ai_detect/admin/multitool_detect() var/turf/our_turf = get_turf(src) for(var/mob/J in urange(rangewarning,our_turf)) - if(admin_datums[J.ckey]) + if(GLOB.admin_datums[J.ckey]) detect_state = PROXIMITY_NEAR var/turf/detect_turf = get_turf(J) if(get_dist(our_turf, detect_turf) < rangealert) diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 8b0b5a8940884..a64d355228371 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -9,14 +9,14 @@ var/mob/living/silicon/pai/pai resistance_flags = FIRE_PROOF | ACID_PROOF | INDESTRUCTIBLE -/obj/item/device/paicard/New() +/obj/item/device/paicard/Initialize() ..() - pai_card_list += src + SSpai.pai_card_list += src add_overlay("pai-off") /obj/item/device/paicard/Destroy() //Will stop people throwing friend pAIs into the singularity so they can respawn - pai_card_list -= src + SSpai.pai_card_list -= src if(!isnull(pai)) pai.death(0) return ..() diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index a7a53b19adc2a..976895118c61a 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -9,10 +9,10 @@ /obj/item/device/radio/beacon/New() ..() - teleportbeacons += src + GLOB.teleportbeacons += src /obj/item/device/radio/beacon/Destroy() - teleportbeacons.Remove(src) + GLOB.teleportbeacons.Remove(src) return ..() /obj/item/device/radio/beacon/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans) diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index c46329129a0e8..2c40f59ec6a8e 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -19,7 +19,7 @@ /obj/item/device/electropack/Initialize() ..() - SSradio.add_object(src, frequency, RADIO_CHAT) + SSradio.add_object(src, frequency, GLOB.RADIO_CHAT) /obj/item/device/electropack/Destroy() if(SSradio) @@ -66,7 +66,7 @@ if(href_list["freq"]) SSradio.remove_object(src, frequency) frequency = sanitize_frequency(frequency + text2num(href_list["freq"])) - SSradio.add_object(src, frequency, RADIO_CHAT) + SSradio.add_object(src, frequency, GLOB.RADIO_CHAT) else if(href_list["code"]) code += text2num(href_list["code"]) @@ -107,7 +107,7 @@ spawn(100) shock_cooldown = 0 var/mob/M = loc - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) to_chat(M, "You feel a sharp shock!") var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index e222a7e6ce73e..46535b881e812 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -231,7 +231,7 @@ for(var/ch_name in channels) - SSradio.remove_object(src, radiochannels[ch_name]) + SSradio.remove_object(src, GLOB.radiochannels[ch_name]) secure_radio_connections[ch_name] = null @@ -296,7 +296,7 @@ for(var/ch_name in channels) - secure_radio_connections[ch_name] = add_radio(src, radiochannels[ch_name]) + secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name]) return diff --git a/code/game/objects/items/devices/radio/intercom.dm b/code/game/objects/items/devices/radio/intercom.dm index 8d53145e3dbd7..1e39bb0bfa1dc 100644 --- a/code/game/objects/items/devices/radio/intercom.dm +++ b/code/game/objects/items/devices/radio/intercom.dm @@ -27,7 +27,7 @@ /obj/item/device/radio/intercom/interact(mob/user) ..() - ui_interact(user, state = default_state) + ui_interact(user, state = GLOB.default_state) /obj/item/device/radio/intercom/receive_range(freq, level) if(!on) @@ -40,7 +40,7 @@ return -1 if(!src.listening) return -1 - if(freq == SYND_FREQ) + if(freq == GLOB.SYND_FREQ) if(!(src.syndie)) return -1//Prevents broadcast of messages over devices lacking the encryption diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 5d36d76de9718..d29eb79a4b652 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -75,7 +75,7 @@ independent = TRUE for(var/ch_name in channels) - secure_radio_connections[ch_name] = add_radio(src, radiochannels[ch_name]) + secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name]) /obj/item/device/radio/proc/make_syndie() // Turns normal radios into Syndicate radios! qdel(keyslot) @@ -97,7 +97,7 @@ set_frequency(frequency) for(var/ch_name in channels) - secure_radio_connections[ch_name] = add_radio(src, radiochannels[ch_name]) + secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name]) /obj/item/device/radio/interact(mob/user) if (..()) @@ -108,7 +108,7 @@ ui_interact(user) /obj/item/device/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = inventory_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state) @@ -241,7 +241,7 @@ var/turf/position = get_turf(src) var/jammed = FALSE - for(var/obj/item/device/jammer/jammer in active_jammers) + for(var/obj/item/device/jammer/jammer in GLOB.active_jammers) if(get_dist(position,get_turf(jammer)) < jammer.range) jammed = TRUE break @@ -267,7 +267,7 @@ // --- Human: use their job as seen on the crew manifest - makes it unneeded to carry an ID for an AI to see their job if(ishuman(M)) - var/datum/data/record/findjob = find_record("name", voice, data_core.general) + var/datum/data/record/findjob = find_record("name", voice, GLOB.data_core.general) if(voice != real_name) voicemask = 1 @@ -380,11 +380,11 @@ //#### Sending the signal to all subspace receivers ####// - for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) R.receive_signal(signal) // Allinone can act as receivers. - for(var/obj/machinery/telecomms/allinone/R in telecomms_list) + for(var/obj/machinery/telecomms/allinone/R in GLOB.telecomms_list) R.receive_signal(signal) // Receiving code can be located in Telecommunications.dm @@ -427,7 +427,7 @@ "verb_yell" = M.verb_yell ) signal.frequency = freqnum // Quick frequency set - for(var/obj/machinery/telecomms/receiver/R in telecomms_list) + for(var/obj/machinery/telecomms/receiver/R in GLOB.telecomms_list) R.receive_signal(signal) @@ -476,10 +476,10 @@ var/turf/position = get_turf(src) if(!position || !(position.z in level)) return -1 - if(freq == SYND_FREQ) + if(freq == GLOB.SYND_FREQ) if(!(src.syndie)) //Checks to see if it's allowed on that frequency, based on the encryption keys return -1 - if(freq == CENTCOM_FREQ) + if(freq == GLOB.CENTCOM_FREQ) if(!independent) return -1 if (!on) @@ -492,7 +492,7 @@ if (!accept) for(var/ch_name in channels) if(channels[ch_name] & FREQ_LISTENING) - if(radiochannels[ch_name] == text2num(freq) || syndie) //the radiochannels list is located in communications.dm + if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie) //the GLOB.radiochannels list is located in communications.dm accept = 1 break if (!accept) @@ -561,14 +561,14 @@ /obj/item/device/radio/borg/syndicate/New() ..() - set_frequency(SYND_FREQ) + set_frequency(GLOB.SYND_FREQ) /obj/item/device/radio/borg/attackby(obj/item/weapon/W, mob/user, params) if(istype(W, /obj/item/weapon/screwdriver)) if(keyslot) for(var/ch_name in channels) - SSradio.remove_object(src, radiochannels[ch_name]) + SSradio.remove_object(src, GLOB.radiochannels[ch_name]) secure_radio_connections[ch_name] = null diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 5e871c49e9f7e..4c19700a786ac 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -195,7 +195,7 @@ MASS SPECTROMETER var/blood_percent = round((C.blood_volume / BLOOD_VOLUME_NORMAL)*100) var/blood_type = C.dna.blood_type if(blood_id != "blood")//special blood substance - var/datum/reagent/R = chemical_reagents_list[blood_id] + var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id] if(R) blood_type = R.name else @@ -285,7 +285,7 @@ MASS SPECTROMETER if(total_moles) var/list/env_gases = environment.gases - environment.assert_gases(arglist(hardcoded_gases)) + environment.assert_gases(arglist(GLOB.hardcoded_gases)) var/o2_concentration = env_gases["o2"][MOLES]/total_moles var/n2_concentration = env_gases["n2"][MOLES]/total_moles var/co2_concentration = env_gases["co2"][MOLES]/total_moles @@ -314,7 +314,7 @@ MASS SPECTROMETER for(var/id in env_gases) - if(id in hardcoded_gases) + if(id in GLOB.hardcoded_gases) continue var/gas_concentration = env_gases[id][MOLES]/total_moles to_chat(user, "[env_gases[id][GAS_META][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] %") @@ -368,7 +368,7 @@ MASS SPECTROMETER dat += "
None" else for(var/R in blood_traces) - dat += "
[chemical_reagents_list[R]]" + dat += "
[GLOB.chemical_reagents_list[R]]" if(details) dat += " ([blood_traces[R]] units)" dat += "" diff --git a/code/game/objects/items/devices/sensor_device.dm b/code/game/objects/items/devices/sensor_device.dm index d15e254904e2c..a2deafe91694d 100644 --- a/code/game/objects/items/devices/sensor_device.dm +++ b/code/game/objects/items/devices/sensor_device.dm @@ -8,4 +8,4 @@ origin_tech = "programming=3;materials=3;magnets=3" /obj/item/device/sensor_device/attack_self(mob/user) - crewmonitor.show(user) //Proc already exists, just had to call it + GLOB.crewmonitor.show(user) //Proc already exists, just had to call it diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index eef611d81078a..7a9470d991141 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -236,9 +236,9 @@ effective or pretty fucking useless. to_chat(user,"You [active ? "deactivate" : "activate"] the [src]") active = !active if(active) - active_jammers |= src + GLOB.active_jammers |= src else - active_jammers -= src + GLOB.active_jammers -= src update_icon() \ No newline at end of file diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 4316acf0f66b8..450d0c021fe9f 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -53,7 +53,7 @@ A.holder = src A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb). - bombers += "[key_name(user)] attached a [item] to a transfer valve." + GLOB.bombers += "[key_name(user)] attached a [item] to a transfer valve." message_admins("[key_name_admin(user)] attached a [item] to a transfer valve.") log_game("[key_name_admin(user)] attached a [item] to a transfer valve.") attacher = user @@ -189,7 +189,7 @@ var/bomb_message = "[log_str1]
[A.name] [log_str2][log_attacher] [log_str3][last_touch_info]" - bombers += bomb_message + GLOB.bombers += bomb_message message_admins(bomb_message, 0, 1) log_game("[log_str1] [A.name]([A.x],[A.y],[A.z]) [log_str2] [log_str3]") diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm index eb3a4172f7188..5b93529fa756b 100644 --- a/code/game/objects/items/eightball.dm +++ b/code/game/objects/items/eightball.dm @@ -98,10 +98,10 @@ /obj/item/toy/eightball/haunted/Initialize(mapload) ..() votes = list() - poi_list |= src + GLOB.poi_list |= src /obj/item/toy/eightball/haunted/Destroy() - poi_list -= src + GLOB.poi_list -= src . = ..() /obj/item/toy/eightball/haunted/attack_ghost(mob/user) @@ -155,7 +155,7 @@ return most_popular_answer -/obj/item/toy/eightball/haunted/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state=observer_state) +/obj/item/toy/eightball/haunted/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state = GLOB.observer_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 3e335aa2227a1..169d8eeb2b78d 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -1,8 +1,8 @@ -var/global/list/datum/stack_recipe/rod_recipes = list ( \ +GLOBAL_LIST_INIT(rod_recipes, list ( \ new/datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("scooter frame", /obj/item/scooter_frame, 10, time = 25, one_per_turf = 0), \ - ) + )) /obj/item/stack/rods name = "metal rod" @@ -24,7 +24,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list ( \ /obj/item/stack/rods/Initialize(mapload, new_amount, merge = TRUE) ..() - recipes = rod_recipes + recipes = GLOB.rod_recipes update_icon() /obj/item/stack/rods/update_icon() diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 0fe26d2a7819f..74028f344a8e2 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -8,10 +8,10 @@ /* * Glass sheets */ -var/global/list/datum/stack_recipe/glass_recipes = list ( \ +GLOBAL_LIST_INIT(glass_recipes, list ( \ new/datum/stack_recipe("directional window", /obj/structure/window/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \ new/datum/stack_recipe("fulltile window", /obj/structure/window/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \ -) +)) /obj/item/stack/sheet/glass name = "glass" @@ -33,7 +33,7 @@ var/global/list/datum/stack_recipe/glass_recipes = list ( \ amount = 50 /obj/item/stack/sheet/glass/Initialize(mapload, new_amount, merge = TRUE) - recipes = glass_recipes + recipes = GLOB.glass_recipes ..() /obj/item/stack/sheet/glass/attackby(obj/item/W, mob/user, params) @@ -70,12 +70,12 @@ var/global/list/datum/stack_recipe/glass_recipes = list ( \ /* * Reinforced glass sheets */ -var/global/list/datum/stack_recipe/reinforced_glass_recipes = list ( \ +GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \ new/datum/stack_recipe("windoor frame", /obj/structure/windoor_assembly, 5, time = 0, on_floor = TRUE, window_checks = TRUE), \ null, \ new/datum/stack_recipe("directional reinforced window", /obj/structure/window/reinforced/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \ new/datum/stack_recipe("fulltile reinforced window", /obj/structure/window/reinforced/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE) \ -) +)) /obj/item/stack/sheet/rglass @@ -107,7 +107,7 @@ var/global/list/datum/stack_recipe/reinforced_glass_recipes = list ( \ glasource.add_charge(amount * glacost) /obj/item/stack/sheet/rglass/Initialize(mapload, new_amount, merge = TRUE) - recipes = reinforced_glass_recipes + recipes = GLOB.reinforced_glass_recipes ..() diff --git a/code/game/objects/items/stacks/sheets/leather.dm b/code/game/objects/items/stacks/sheets/leather.dm index 3719c6d962182..b02f4219562f5 100644 --- a/code/game/objects/items/stacks/sheets/leather.dm +++ b/code/game/objects/items/stacks/sheets/leather.dm @@ -9,12 +9,12 @@ singular_name = "human skin piece" icon_state = "sheet-hide" -var/global/list/datum/stack_recipe/human_recipes = list( \ +GLOBAL_LIST_INIT(human_recipes, list( \ new/datum/stack_recipe("bloated human costume", /obj/item/clothing/suit/hooded/bloated_human, 5, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/animalhide/human/Initialize(mapload, new_amount, merge = TRUE) - recipes = human_recipes + recipes = GLOB.human_recipes return ..() /obj/item/stack/sheet/animalhide/generic @@ -29,12 +29,12 @@ var/global/list/datum/stack_recipe/human_recipes = list( \ singular_name = "corgi hide piece" icon_state = "sheet-corgi" -var/global/list/datum/stack_recipe/corgi_recipes = list ( \ +GLOBAL_LIST_INIT(corgi_recipes, list ( \ new/datum/stack_recipe("corgi costume", /obj/item/clothing/suit/hooded/ian_costume, 3, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/animalhide/corgi/Initialize(mapload, new_amount, merge = TRUE) - recipes = corgi_recipes + recipes = GLOB.corgi_recipes return ..() /obj/item/stack/sheet/animalhide/cat @@ -49,13 +49,13 @@ var/global/list/datum/stack_recipe/corgi_recipes = list ( \ singular_name = "monkey hide piece" icon_state = "sheet-monkey" -var/global/list/datum/stack_recipe/monkey_recipes = list ( \ +GLOBAL_LIST_INIT(monkey_recipes, list ( \ new/datum/stack_recipe("monkey mask", /obj/item/clothing/mask/gas/monkeymask, 1, on_floor = 1), \ new/datum/stack_recipe("monkey suit", /obj/item/clothing/suit/monkeysuit, 2, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/animalhide/monkey/Initialize(mapload, new_amount, merge = TRUE) - recipes = monkey_recipes + recipes = GLOB.monkey_recipes return ..() /obj/item/stack/sheet/animalhide/lizard @@ -70,13 +70,13 @@ var/global/list/datum/stack_recipe/monkey_recipes = list ( \ singular_name = "alien hide piece" icon_state = "sheet-xeno" -var/global/list/datum/stack_recipe/xeno_recipes = list ( \ +GLOBAL_LIST_INIT(xeno_recipes, list ( \ new/datum/stack_recipe("alien helmet", /obj/item/clothing/head/xenos, 1, on_floor = 1), \ new/datum/stack_recipe("alien suit", /obj/item/clothing/suit/xenos, 2, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/animalhide/xeno/Initialize(mapload, new_amount, merge = TRUE) - recipes = xeno_recipes + recipes = GLOB.xeno_recipes return ..() //don't see anywhere else to put these, maybe together they could be used to make the xenos suit? @@ -134,12 +134,12 @@ var/global/list/datum/stack_recipe/xeno_recipes = list ( \ origin_tech = "biotech=4" -var/global/list/datum/stack_recipe/sinew_recipes = list ( \ +GLOBAL_LIST_INIT(sinew_recipes, list ( \ new/datum/stack_recipe("sinew restraints", /obj/item/weapon/restraints/handcuffs/sinew, 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/sinew/Initialize(mapload, new_amount, merge = TRUE) - recipes = sinew_recipes + recipes = GLOB.sinew_recipes return ..() /* * Plates diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index 61eb42d6ca48e..611ef76eb4646 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -26,14 +26,14 @@ Mineral Sheets * Sandstone */ -var/global/list/datum/stack_recipe/sandstone_recipes = list ( \ +GLOBAL_LIST_INIT(sandstone_recipes, list ( \ new/datum/stack_recipe("pile of dirt", /obj/machinery/hydroponics/soil, 3, time = 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("sandstone door", /obj/structure/mineral_door/sandstone, 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Assistant Statue", /obj/structure/statue/sandstone/assistant, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Breakdown into sand", /obj/item/weapon/ore/glass, 1, one_per_turf = 0, on_floor = 1), \ /* new/datum/stack_recipe("sandstone wall", ???), \ new/datum/stack_recipe("sandstone floor", ???),\ */ - ) + )) /obj/item/stack/sheet/mineral/sandstone name = "sandstone brick" @@ -47,7 +47,7 @@ var/global/list/datum/stack_recipe/sandstone_recipes = list ( \ sheettype = "sandstone" /obj/item/stack/sheet/mineral/sandstone/Initialize(mapload, new_amount, merge = TRUE) - recipes = sandstone_recipes + recipes = GLOB.sandstone_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -67,12 +67,12 @@ var/global/list/datum/stack_recipe/sandstone_recipes = list ( \ layer = LOW_ITEM_LAYER origin_tech = "materials=2" -var/global/list/datum/stack_recipe/sandbag_recipes = list ( \ +GLOBAL_LIST_INIT(sandbag_recipes, list ( \ new/datum/stack_recipe("sandbags", /obj/structure/barricade/sandbags, 1, time = 25, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/mineral/sandbags/Initialize(mapload, new_amount, merge = TRUE) - recipes = sandbag_recipes + recipes = GLOB.sandbag_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -88,16 +88,16 @@ var/global/list/datum/stack_recipe/sandbag_recipes = list ( \ sheettype = "diamond" materials = list(MAT_DIAMOND=MINERAL_MATERIAL_AMOUNT) -var/global/list/datum/stack_recipe/diamond_recipes = list ( \ +GLOBAL_LIST_INIT(diamond_recipes, list ( \ new/datum/stack_recipe("diamond door", /obj/structure/mineral_door/transparent/diamond, 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("diamond tile", /obj/item/stack/tile/mineral/diamond, 1, 4, 20), \ new/datum/stack_recipe("Captain Statue", /obj/structure/statue/diamond/captain, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("AI Hologram Statue", /obj/structure/statue/diamond/ai1, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("AI Core Statue", /obj/structure/statue/diamond/ai2, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/mineral/diamond/Initialize(mapload, new_amount, merge = TRUE) - recipes = diamond_recipes + recipes = GLOB.diamond_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -113,15 +113,15 @@ var/global/list/datum/stack_recipe/diamond_recipes = list ( \ sheettype = "uranium" materials = list(MAT_URANIUM=MINERAL_MATERIAL_AMOUNT) -var/global/list/datum/stack_recipe/uranium_recipes = list ( \ +GLOBAL_LIST_INIT(uranium_recipes, list ( \ new/datum/stack_recipe("uranium door", /obj/structure/mineral_door/uranium, 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("uranium tile", /obj/item/stack/tile/mineral/uranium, 1, 4, 20), \ new/datum/stack_recipe("Nuke Statue", /obj/structure/statue/uranium/nuke, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Engineer Statue", /obj/structure/statue/uranium/eng, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/mineral/uranium/Initialize(mapload, new_amount, merge = TRUE) - recipes = uranium_recipes + recipes = GLOB.uranium_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -140,14 +140,14 @@ var/global/list/datum/stack_recipe/uranium_recipes = list ( \ max_integrity = 100 materials = list(MAT_PLASMA=MINERAL_MATERIAL_AMOUNT) -var/global/list/datum/stack_recipe/plasma_recipes = list ( \ +GLOBAL_LIST_INIT(plasma_recipes, list ( \ new/datum/stack_recipe("plasma door", /obj/structure/mineral_door/transparent/plasma, 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("plasma tile", /obj/item/stack/tile/mineral/plasma, 1, 4, 20), \ new/datum/stack_recipe("Scientist Statue", /obj/structure/statue/plasma/scientist, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/mineral/plasma/Initialize(mapload, new_amount, merge = TRUE) - recipes = plasma_recipes + recipes = GLOB.plasma_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -175,7 +175,7 @@ var/global/list/datum/stack_recipe/plasma_recipes = list ( \ sheettype = "gold" materials = list(MAT_GOLD=MINERAL_MATERIAL_AMOUNT) -var/global/list/datum/stack_recipe/gold_recipes = list ( \ +GLOBAL_LIST_INIT(gold_recipes, list ( \ new/datum/stack_recipe("golden door", /obj/structure/mineral_door/gold, 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("gold tile", /obj/item/stack/tile/mineral/gold, 1, 4, 20), \ new/datum/stack_recipe("HoS Statue", /obj/structure/statue/gold/hos, 5, one_per_turf = 1, on_floor = 1), \ @@ -184,10 +184,10 @@ var/global/list/datum/stack_recipe/gold_recipes = list ( \ new/datum/stack_recipe("RD Statue", /obj/structure/statue/gold/rd, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Simple Crown", /obj/item/clothing/head/crown, 5), \ new/datum/stack_recipe("CMO Statue", /obj/structure/statue/gold/cmo, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/mineral/gold/Initialize(mapload, new_amount, merge = TRUE) - recipes = gold_recipes + recipes = GLOB.gold_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -203,7 +203,7 @@ var/global/list/datum/stack_recipe/gold_recipes = list ( \ sheettype = "silver" materials = list(MAT_SILVER=MINERAL_MATERIAL_AMOUNT) -var/global/list/datum/stack_recipe/silver_recipes = list ( \ +GLOBAL_LIST_INIT(silver_recipes, list ( \ new/datum/stack_recipe("silver door", /obj/structure/mineral_door/silver, 10, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("silver tile", /obj/item/stack/tile/mineral/silver, 1, 4, 20), \ new/datum/stack_recipe("Med Officer Statue", /obj/structure/statue/silver/md, 5, one_per_turf = 1, on_floor = 1), \ @@ -211,10 +211,10 @@ var/global/list/datum/stack_recipe/silver_recipes = list ( \ new/datum/stack_recipe("Sec Officer Statue", /obj/structure/statue/silver/sec, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Sec Borg Statue", /obj/structure/statue/silver/secborg, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Med Borg Statue", /obj/structure/statue/silver/medborg, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/mineral/silver/Initialize(mapload, new_amount, merge = TRUE) - recipes = silver_recipes + recipes = GLOB.silver_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -230,13 +230,13 @@ var/global/list/datum/stack_recipe/silver_recipes = list ( \ sheettype = "clown" materials = list(MAT_BANANIUM=MINERAL_MATERIAL_AMOUNT) -var/global/list/datum/stack_recipe/clown_recipes = list ( \ +GLOBAL_LIST_INIT(clown_recipes, list ( \ new/datum/stack_recipe("bananium tile", /obj/item/stack/tile/mineral/bananium, 1, 4, 20), \ new/datum/stack_recipe("Clown Statue", /obj/structure/statue/bananium/clown, 5, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/mineral/bananium/Initialize(mapload, new_amount, merge = TRUE) - recipes = clown_recipes + recipes = GLOB.clown_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -257,12 +257,12 @@ var/global/list/datum/stack_recipe/clown_recipes = list ( \ sheettype = "titanium" materials = list(MAT_TITANIUM=MINERAL_MATERIAL_AMOUNT) -var/global/list/datum/stack_recipe/titanium_recipes = list ( \ +GLOBAL_LIST_INIT(titanium_recipes, list ( \ new/datum/stack_recipe("titanium tile", /obj/item/stack/tile/mineral/titanium, 1, 4, 20), \ - ) + )) /obj/item/stack/sheet/mineral/titanium/Initialize(mapload, new_amount, merge = TRUE) - recipes = titanium_recipes + recipes = GLOB.titanium_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -284,12 +284,12 @@ var/global/list/datum/stack_recipe/titanium_recipes = list ( \ sheettype = "plastitanium" materials = list(MAT_TITANIUM=2000, MAT_PLASMA=2000) -var/global/list/datum/stack_recipe/plastitanium_recipes = list ( \ +GLOBAL_LIST_INIT(plastitanium_recipes, list ( \ new/datum/stack_recipe("plas-titanium tile", /obj/item/stack/tile/mineral/plastitanium, 1, 4, 20), \ - ) + )) /obj/item/stack/sheet/mineral/plastitanium/Initialize(mapload, new_amount, merge = TRUE) - recipes = plastitanium_recipes + recipes = GLOB.plastitanium_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -307,14 +307,14 @@ var/global/list/datum/stack_recipe/plastitanium_recipes = list ( \ origin_tech = "materials=1" sheettype = "snow" -var/global/list/datum/stack_recipe/snow_recipes = list ( \ +GLOBAL_LIST_INIT(snow_recipes, list ( \ new/datum/stack_recipe("Snow Wall",/turf/closed/wall/mineral/snow, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Snowman", /obj/structure/statue/snow/snowman, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Snowball", /obj/item/toy/snowball, 1), \ - ) + )) /obj/item/stack/sheet/mineral/snow/Initialize(mapload, new_amount, merge = TRUE) - recipes = snow_recipes + recipes = GLOB.snow_recipes pixel_x = rand(0,4)-4 pixel_y = rand(0,4)-4 ..() @@ -360,7 +360,7 @@ var/global/list/datum/stack_recipe/snow_recipes = list ( \ origin_tech = "materials=6;abductor=1" sheettype = "abductor" -var/global/list/datum/stack_recipe/abductor_recipes = list ( \ +GLOBAL_LIST_INIT(abductor_recipes, list ( \ /* new/datum/stack_recipe("alien chair", /obj/structure/chair, one_per_turf = 1, on_floor = 1), \ */ new/datum/stack_recipe("alien bed", /obj/structure/bed/abductor, 2, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("alien locker", /obj/structure/closet/abductor, 1, time = 15, one_per_turf = 1, on_floor = 1), \ @@ -371,8 +371,8 @@ var/global/list/datum/stack_recipe/abductor_recipes = list ( \ /* null, \ new/datum/stack_recipe("Abductor Agent Statue", /obj/structure/statue/bananium/clown, 5, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("Abductor Sciencist Statue", /obj/structure/statue/bananium/clown, 5, one_per_turf = 1, on_floor = 1)*/ - ) + )) /obj/item/stack/sheet/mineral/abductor/Initialize(mapload, new_amount, merge = TRUE) - recipes = abductor_recipes + recipes = GLOB.abductor_recipes ..() diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 93e3bc6f51987..dbd2de2e75edd 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -13,7 +13,7 @@ /* * Metal */ -var/global/list/datum/stack_recipe/metal_recipes = list ( \ +GLOBAL_LIST_INIT(metal_recipes, list ( \ new/datum/stack_recipe("stool", /obj/structure/chair/stool, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("bar stool", /obj/structure/chair/stool/bar, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("chair", /obj/structure/chair, one_per_turf = 1, on_floor = 1), \ @@ -52,7 +52,7 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ null, \ new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("floodlight frame", /obj/structure/floodlight_frame, 5, one_per_turf = 1, on_floor = 1), \ -) +)) /obj/item/stack/sheet/metal name = "metal" @@ -87,16 +87,16 @@ var/global/list/datum/stack_recipe/metal_recipes = list ( \ cost = 500 /obj/item/stack/sheet/metal/Initialize(mapload, new_amount, merge = TRUE) - recipes = metal_recipes + recipes = GLOB.metal_recipes return ..() /* * Plasteel */ -var/global/list/datum/stack_recipe/plasteel_recipes = list ( \ +GLOBAL_LIST_INIT(plasteel_recipes, list ( \ new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = 1), \ new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 50), \ -) +)) /obj/item/stack/sheet/plasteel name = "plasteel" @@ -113,7 +113,7 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list ( \ merge_type = /obj/item/stack/sheet/plasteel /obj/item/stack/sheet/plasteel/Initialize(mapload, new_amount, merge = TRUE) - recipes = plasteel_recipes + recipes = GLOB.plasteel_recipes return ..() /obj/item/stack/sheet/plasteel/twenty @@ -125,7 +125,7 @@ var/global/list/datum/stack_recipe/plasteel_recipes = list ( \ /* * Wood */ -var/global/list/datum/stack_recipe/wood_recipes = list ( \ +GLOBAL_LIST_INIT(wood_recipes, list ( \ new/datum/stack_recipe("wooden sandals", /obj/item/clothing/shoes/sandal, 1), \ new/datum/stack_recipe("wood floor tile", /obj/item/stack/tile/wood, 1, 4, 20), \ new/datum/stack_recipe("wood table frame", /obj/structure/table_frame/wood, 2, time = 10), \ @@ -147,7 +147,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ new/datum/stack_recipe("honey frame", /obj/item/honey_frame, 5, time = 10),\ new/datum/stack_recipe("ore box", /obj/structure/ore_box, 4, time = 50, one_per_turf = 1, on_floor = 1),\ new/datum/stack_recipe("baseball bat", /obj/item/weapon/melee/baseball_bat, 5, time = 15),\ - ) + )) /obj/item/stack/sheet/mineral/wood name = "wooden plank" @@ -162,7 +162,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ merge_type = /obj/item/stack/sheet/mineral/wood /obj/item/stack/sheet/mineral/wood/Initialize(mapload, new_amount, merge = TRUE) - recipes = wood_recipes + recipes = GLOB.wood_recipes return ..() /obj/item/stack/sheet/mineral/wood/fifty @@ -171,7 +171,7 @@ var/global/list/datum/stack_recipe/wood_recipes = list ( \ /* * Cloth */ -var/global/list/datum/stack_recipe/cloth_recipes = list ( \ +GLOBAL_LIST_INIT(cloth_recipes, list ( \ new/datum/stack_recipe("grey jumpsuit", /obj/item/clothing/under/color/grey, 3), \ new/datum/stack_recipe("black shoes", /obj/item/clothing/shoes/sneakers/black, 2), \ null, \ @@ -193,7 +193,7 @@ var/global/list/datum/stack_recipe/cloth_recipes = list ( \ new/datum/stack_recipe("black gloves", /obj/item/clothing/gloves/color/black, 3), \ null, \ new/datum/stack_recipe("blindfold", /obj/item/clothing/glasses/sunglasses/blindfold, 2), \ - ) + )) /obj/item/stack/sheet/cloth name = "cloth" @@ -207,7 +207,7 @@ var/global/list/datum/stack_recipe/cloth_recipes = list ( \ merge_type = /obj/item/stack/sheet/cloth /obj/item/stack/sheet/cloth/Initialize(mapload, new_amount, merge = TRUE) - recipes = cloth_recipes + recipes = GLOB.cloth_recipes return ..() /obj/item/stack/sheet/cloth/ten @@ -216,7 +216,7 @@ var/global/list/datum/stack_recipe/cloth_recipes = list ( \ /* * Cardboard */ -var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ +GLOBAL_LIST_INIT(cardboard_recipes, list ( \ new/datum/stack_recipe("box", /obj/item/weapon/storage/box), \ new/datum/stack_recipe("light tubes", /obj/item/weapon/storage/box/lights/tubes), \ new/datum/stack_recipe("light bulbs", /obj/item/weapon/storage/box/lights/bulbs), \ @@ -227,7 +227,7 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ new/datum/stack_recipe("folder", /obj/item/weapon/folder), \ new/datum/stack_recipe("large box", /obj/structure/closet/cardboard, 4), \ new/datum/stack_recipe("cardboard cutout", /obj/item/cardboard_cutout, 5), \ -) +)) /obj/item/stack/sheet/cardboard //BubbleWrap //it's cardboard you fuck name = "cardboard" @@ -239,8 +239,8 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ merge_type = /obj/item/stack/sheet/cardboard /obj/item/stack/sheet/cardboard/Initialize(mapload, new_amount, merge = TRUE) - recipes = cardboard_recipes - return ..() + recipes = GLOB.cardboard_recipes + return ..() /obj/item/stack/sheet/cardboard/fifty amount = 50 @@ -249,14 +249,14 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list ( \ * Runed Metal */ -var/global/list/datum/stack_recipe/runed_metal_recipes = list ( \ +GLOBAL_LIST_INIT(runed_metal_recipes, list ( \ new/datum/stack_recipe("runed door", /obj/machinery/door/airlock/cult, 1, time = 50, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("runed girder", /obj/structure/girder/cult, 1, time = 50, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("pylon", /obj/structure/destructible/cult/pylon, 4, time = 40, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("forge", /obj/structure/destructible/cult/forge, 3, time = 40, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("archives", /obj/structure/destructible/cult/tome, 3, time = 40, one_per_turf = 1, on_floor = 1), \ new/datum/stack_recipe("altar", /obj/structure/destructible/cult/talisman, 3, time = 40, one_per_turf = 1, on_floor = 1), \ - ) + )) /obj/item/stack/sheet/runed_metal name = "runed metal" @@ -287,13 +287,13 @@ var/global/list/datum/stack_recipe/runed_metal_recipes = list ( \ amount = 50 /obj/item/stack/sheet/runed_metal/Initialize(mapload, new_amount, merge = TRUE) - recipes = runed_metal_recipes + recipes = GLOB.runed_metal_recipes return ..() /* * Brass */ -var/global/list/datum/stack_recipe/brass_recipes = list ( \ +GLOBAL_LIST_INIT(brass_recipes, list ( \ new/datum/stack_recipe("wall gear", /obj/structure/destructible/clockwork/wall_gear, 3, time = 30, one_per_turf = TRUE, on_floor = TRUE), \ null, new/datum/stack_recipe("pinion airlock", /obj/machinery/door/airlock/clockwork, 5, time = 50, one_per_turf = TRUE, on_floor = TRUE), \ @@ -303,7 +303,7 @@ var/global/list/datum/stack_recipe/brass_recipes = list ( \ new/datum/stack_recipe("directional brass window", /obj/structure/window/reinforced/clockwork/unanchored, time = 0, on_floor = TRUE, window_checks = TRUE), \ new/datum/stack_recipe("fulltile brass window", /obj/structure/window/reinforced/clockwork/fulltile/unanchored, 2, time = 0, on_floor = TRUE, window_checks = TRUE), \ new/datum/stack_recipe("brass table frame", /obj/structure/table_frame/brass, 1, time = 5, one_per_turf = TRUE, on_floor = TRUE) \ -) +)) /obj/item/stack/tile/brass name = "brass" @@ -324,7 +324,7 @@ var/global/list/datum/stack_recipe/brass_recipes = list ( \ qdel(src) /obj/item/stack/tile/brass/Initialize(mapload, new_amount, merge = TRUE) - recipes = brass_recipes + recipes = GLOB.brass_recipes ..() pixel_x = 0 pixel_y = 0 @@ -360,8 +360,8 @@ var/global/list/datum/stack_recipe/brass_recipes = list ( \ throw_range = 3 origin_tech = "materials=2;biotech=2" -var/global/list/datum/stack_recipe/plastic_recipes = list( - new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = 1, on_floor = 1, time = 40)) +GLOBAL_LIST_INIT(plastic_recipes, list( + new /datum/stack_recipe("plastic flaps", /obj/structure/plasticflaps, 5, one_per_turf = 1, on_floor = 1, time = 40))) /obj/item/stack/sheet/plastic name = "plastic" @@ -380,5 +380,5 @@ var/global/list/datum/stack_recipe/plastic_recipes = list( amount = 5 /obj/item/stack/sheet/plastic/Initialize(mapload, new_amount, merge = TRUE) - recipes = plastic_recipes + recipes = GLOB.plastic_recipes . = ..() diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 04c90fdf317a1..f332422578f19 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -532,10 +532,10 @@ var/datum/devilinfo/devil = randomDevilInfo() var/list/messages = list() messages += "Some fun facts about: [devil.truename]" - messages += "[lawlorify[LORE][devil.bane]]" - messages += "[lawlorify[LORE][devil.obligation]]" - messages += "[lawlorify[LORE][devil.ban]]" - messages += "[lawlorify[LORE][devil.banish]]" + messages += "[GLOB.lawlorify[LORE][devil.bane]]" + messages += "[GLOB.lawlorify[LORE][devil.obligation]]" + messages += "[GLOB.lawlorify[LORE][devil.ban]]" + messages += "[GLOB.lawlorify[LORE][devil.banish]]" return messages /obj/item/toy/talking/owl diff --git a/code/game/objects/items/weapons/AI_modules.dm b/code/game/objects/items/weapons/AI_modules.dm index 3fb99d53853f2..9775481b30bf1 100644 --- a/code/game/objects/items/weapons/AI_modules.dm +++ b/code/game/objects/items/weapons/AI_modules.dm @@ -67,7 +67,7 @@ AI MODULES var/time = time2text(world.realtime,"hh:mm:ss") var/ainame = law_datum.owner ? law_datum.owner.name : "empty AI core" var/aikey = law_datum.owner ? law_datum.owner.ckey : "null" - lawchanges.Add("[time] : [user.name]([user.key]) used [src.name] on [ainame]([aikey]).[law2log ? " The law specified [law2log]" : ""]") + GLOB.lawchanges.Add("[time] : [user.name]([user.key]) used [src.name] on [ainame]([aikey]).[law2log ? " The law specified [law2log]" : ""]") log_law("[user.key]/[user.name] used [src.name] on [aikey]/([ainame]).[law2log ? " The law specified [law2log]" : ""]") message_admins("[key_name_admin(user)] used [src.name] on [key_name_admin(law_datum.owner)].[law2log ? " The law specified [law2log]" : ""]") diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 6cd581460a08d..dbb3149a385d0 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -213,13 +213,13 @@ RCD src.spark_system = new /datum/effect_system/spark_spread spark_system.set_up(5, 0, src) spark_system.attach(src) - rcd_list += src + GLOB.rcd_list += src /obj/item/weapon/rcd/Destroy() qdel(spark_system) spark_system = null - rcd_list -= src + GLOB.rcd_list -= src . = ..() /obj/item/weapon/rcd/attackby(obj/item/weapon/W, mob/user, params) diff --git a/code/game/objects/items/weapons/RPD.dm b/code/game/objects/items/weapons/RPD.dm index 3daa86ed8ec0c..c0065b7751462 100644 --- a/code/game/objects/items/weapons/RPD.dm +++ b/code/game/objects/items/weapons/RPD.dm @@ -31,7 +31,7 @@ RPD /datum/pipe_info/New(pid,direction,dt) src.id=pid - src.icon_state=pipeID2State["[pid]"] + src.icon_state=GLOB.pipeID2State["[pid]"] src.dir = direction src.dirtype=dt @@ -48,7 +48,7 @@ RPD /datum/pipe_info/meter/Render(dispenser,label) return "
  • [label]
  • " //hardcoding is no -var/global/list/disposalpipeID2State=list( +GLOBAL_LIST_INIT(disposalpipeID2State, list( "pipe-s", "pipe-c", "pipe-j1", @@ -59,8 +59,7 @@ var/global/list/disposalpipeID2State=list( "outlet", "intake", "pipe-j1s", - "pipe-j2s" -) + "pipe-j2s")) /datum/pipe_info/disposal categoryId = CATEGORY_DISPOSALS @@ -69,7 +68,7 @@ var/global/list/disposalpipeID2State=list( /datum/pipe_info/disposal/New(var/pid,var/dt) src.id=pid - src.icon_state=disposalpipeID2State[pid+1] + src.icon_state=GLOB.disposalpipeID2State[pid+1] src.dir = SOUTH src.dirtype=dt if(pidDISP_END_CHUTE) @@ -79,7 +78,7 @@ var/global/list/disposalpipeID2State=list( return "
  • [label]
  • " //avoid hardcoding. //find these defines in code\game\machinery\pipe\consruction.dm -var/global/list/RPD_recipes=list( +GLOBAL_LIST_INIT(RPD_recipes, list( "Regular Pipes" = list( "Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 1, PIPE_BENDABLE), //"Bent Pipe" = new /datum/pipe_info(PIPE_SIMPLE, 5, PIPE_BENT), @@ -119,7 +118,7 @@ var/global/list/RPD_recipes=list( "Chute" = new /datum/pipe_info/disposal(DISP_END_CHUTE, PIPE_UNARY), "Sort Junction" = new /datum/pipe_info/disposal(DISP_SORTJUNCTION, PIPE_TRINARY), ) -) +)) /obj/item/weapon/pipe_dispenser name = "Rapid Piping Device (RPD)" desc = "A device used to rapidly pipe things." @@ -205,8 +204,8 @@ var/global/list/RPD_recipes=list( var/icon/preview=null var/datbuild = "" - for(var/category in RPD_recipes) - var/list/cat=RPD_recipes[category] + for(var/category in GLOB.RPD_recipes) + var/list/cat = GLOB.RPD_recipes[category] for(var/label in cat) var/datum/pipe_info/I = cat[label] var/found=0 diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 268596a6bea51..635f673e69a5a 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -131,7 +131,7 @@ update_label("John Doe", "Clowny") /obj/item/weapon/card/id/syndicate name = "agent card" - access = list(access_maint_tunnels, access_syndicate) + access = list(GLOB.access_maint_tunnels, GLOB.access_syndicate) origin_tech = "syndicate=1" var/anyone = FALSE //Can anyone forge the ID or just syndicate? @@ -181,7 +181,7 @@ update_label("John Doe", "Clowny") desc = "An ID straight from the Syndicate." registered_name = "Syndicate" assignment = "Syndicate Overlord" - access = list(access_syndicate) + access = list(GLOB.access_syndicate) /obj/item/weapon/card/id/captains_spare name = "captain's spare ID" @@ -215,7 +215,7 @@ update_label("John Doe", "Clowny") assignment = "Emergency Response Team Commander" /obj/item/weapon/card/id/ert/Initialize() - access = get_all_accesses()+get_ert_access("commander")-access_change_ids + access = get_all_accesses()+get_ert_access("commander")-GLOB.access_change_ids ..() /obj/item/weapon/card/id/ert/Security @@ -223,7 +223,7 @@ update_label("John Doe", "Clowny") assignment = "Security Response Officer" /obj/item/weapon/card/id/ert/Security/Initialize() - access = get_all_accesses()+get_ert_access("sec")-access_change_ids + access = get_all_accesses()+get_ert_access("sec")-GLOB.access_change_ids ..() /obj/item/weapon/card/id/ert/Engineer @@ -231,7 +231,7 @@ update_label("John Doe", "Clowny") assignment = "Engineer Response Officer" /obj/item/weapon/card/id/ert/Engineer/Initialize() - access = get_all_accesses()+get_ert_access("eng")-access_change_ids + access = get_all_accesses()+get_ert_access("eng")-GLOB.access_change_ids ..() /obj/item/weapon/card/id/ert/Medical @@ -239,7 +239,7 @@ update_label("John Doe", "Clowny") assignment = "Medical Response Officer" /obj/item/weapon/card/id/ert/Medical/Initialize() - access = get_all_accesses()+get_ert_access("med")-access_change_ids + access = get_all_accesses()+get_ert_access("med")-GLOB.access_change_ids ..() /obj/item/weapon/card/id/prisoner @@ -285,18 +285,18 @@ update_label("John Doe", "Clowny") /obj/item/weapon/card/id/mining name = "mining ID" - access = list(access_mining, access_mining_station, access_mineral_storeroom) + access = list(GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) /obj/item/weapon/card/id/away name = "a perfectly generic identification card" desc = "A perfectly generic identification card. Looks like it could use some flavor." - access = list(access_away_general) + access = list(GLOB.access_away_general) /obj/item/weapon/card/id/away/hotel name = "Staff ID" desc = "A staff ID used to access the hotel's doors." - access = list(access_away_general, access_away_maint) + access = list(GLOB.access_away_general, GLOB.access_away_maint) /obj/item/weapon/card/id/away/hotel/securty name = "Officer ID" - access = list(access_away_general, access_away_maint, access_away_sec) + access = list(GLOB.access_away_general, GLOB.access_away_maint, GLOB.access_away_sec) diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 3fe3a3c1964cc..86f9244130c28 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -23,9 +23,9 @@ /obj/item/weapon/dnainjector/proc/prepare() for(var/mut_key in add_mutations_static) - add_mutations.Add(mutations_list[mut_key]) + add_mutations.Add(GLOB.mutations_list[mut_key]) for(var/mut_key in remove_mutations_static) - remove_mutations.Add(mutations_list[mut_key]) + remove_mutations.Add(GLOB.mutations_list[mut_key]) /obj/item/weapon/dnainjector/proc/inject(mob/living/carbon/M, mob/user) prepare() diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index a9ff059da2f79..65d191927e26d 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -88,7 +88,7 @@ forceMove(null) var/message = "[ADMIN_LOOKUPFLW(user)] planted [name] on [target.name] at [ADMIN_COORDJMP(target)] with [timer] second fuse" - bombers += message + GLOB.bombers += message message_admins(message,0,1) log_game("[key_name(user)] planted [name] on [target.name] at [COORD(target)] with [timer] second fuse") diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 1813af6e8c3ed..1989d15af134e 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -56,7 +56,7 @@ var/turf/bombturf = get_turf(src) var/area/A = get_area(bombturf) var/message = "[ADMIN_LOOKUPFLW(user)]) has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)]" - bombers += message + GLOB.bombers += message message_admins(message) log_game("[key_name(usr)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].") if(iscarbon(user)) diff --git a/code/game/objects/items/weapons/implants/implant_abductor.dm b/code/game/objects/items/weapons/implants/implant_abductor.dm index f5a38e2098145..1d382a4ece6d4 100644 --- a/code/game/objects/items/weapons/implants/implant_abductor.dm +++ b/code/game/objects/items/weapons/implants/implant_abductor.dm @@ -39,7 +39,7 @@ /obj/item/weapon/implant/abductor/proc/get_team_console(var/team) var/obj/machinery/abductor/console/console - for(var/obj/machinery/abductor/console/c in machines) + for(var/obj/machinery/abductor/console/c in GLOB.machines) if(c.team == team) console = c break diff --git a/code/game/objects/items/weapons/implants/implant_chem.dm b/code/game/objects/items/weapons/implants/implant_chem.dm index 9814d9091c194..e537bf44de0f1 100644 --- a/code/game/objects/items/weapons/implants/implant_chem.dm +++ b/code/game/objects/items/weapons/implants/implant_chem.dm @@ -24,11 +24,11 @@ /obj/item/weapon/implant/chem/New() ..() create_reagents(50) - tracked_chem_implants += src + GLOB.tracked_chem_implants += src /obj/item/weapon/implant/chem/Destroy() . = ..() - tracked_chem_implants -= src + GLOB.tracked_chem_implants -= src /obj/item/weapon/implant/chem/trigger(emote, mob/source) if(emote == "deathgasp") diff --git a/code/game/objects/items/weapons/implants/implant_track.dm b/code/game/objects/items/weapons/implants/implant_track.dm index 68b7285ca9c15..ea631e360d051 100644 --- a/code/game/objects/items/weapons/implants/implant_track.dm +++ b/code/game/objects/items/weapons/implants/implant_track.dm @@ -6,11 +6,11 @@ /obj/item/weapon/implant/tracking/New() ..() - tracked_implants += src + GLOB.tracked_implants += src /obj/item/weapon/implant/tracking/Destroy() . = ..() - tracked_implants -= src + GLOB.tracked_implants -= src /obj/item/weapon/implanter/tracking imp_type = /obj/item/weapon/implant/tracking diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm index 819998b531a6c..733ba72590964 100644 --- a/code/game/objects/items/weapons/implants/implantchair.dm +++ b/code/game/objects/items/weapons/implants/implantchair.dm @@ -27,7 +27,7 @@ /obj/machinery/implantchair/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = notcontained_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm index babc6c37b09dd..97457e21f5db2 100644 --- a/code/game/objects/items/weapons/scrolls.dm +++ b/code/game/objects/items/weapons/scrolls.dm @@ -50,10 +50,10 @@ var/A - A = input(user, "Area to jump to", "BOOYEA", A) as null|anything in teleportlocs + A = input(user, "Area to jump to", "BOOYEA", A) as null|anything in GLOB.teleportlocs if(!src || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated() || !A || !uses) return - var/area/thearea = teleportlocs[A] + var/area/thearea = GLOB.teleportlocs[A] var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(2, user.loc) diff --git a/code/game/objects/items/weapons/storage/book.dm b/code/game/objects/items/weapons/storage/book.dm index 4292bf7b887b7..abf852d403022 100644 --- a/code/game/objects/items/weapons/storage/book.dm +++ b/code/game/objects/items/weapons/storage/book.dm @@ -13,9 +13,9 @@ /obj/item/weapon/storage/book/attack_self(mob/user) to_chat(user, "The pages of [title] have been cut out!") -var/global/list/biblenames = list("Bible", "Quran", "Scrapbook", "Burning Bible", "Clown Bible", "Banana Bible", "Creeper Bible", "White Bible", "Holy Light", "The God Delusion", "Tome", "The King in Yellow", "Ithaqua", "Scientology", "Melted Bible", "Necronomicon") -var/global/list/biblestates = list("bible", "koran", "scrapbook", "burning", "honk1", "honk2", "creeper", "white", "holylight", "atheist", "tome", "kingyellow", "ithaqua", "scientology", "melted", "necronomicon") -var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible", "bible", "bible", "syringe_kit", "syringe_kit", "syringe_kit", "syringe_kit", "syringe_kit", "kingyellow", "ithaqua", "scientology", "melted", "necronomicon") +GLOBAL_LIST_INIT(biblenames, list("Bible", "Quran", "Scrapbook", "Burning Bible", "Clown Bible", "Banana Bible", "Creeper Bible", "White Bible", "Holy Light", "The God Delusion", "Tome", "The King in Yellow", "Ithaqua", "Scientology", "Melted Bible", "Necronomicon")) +GLOBAL_LIST_INIT(biblestates, list("bible", "koran", "scrapbook", "burning", "honk1", "honk2", "creeper", "white", "holylight", "atheist", "tome", "kingyellow", "ithaqua", "scientology", "melted", "necronomicon")) +GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", "bible", "bible", "syringe_kit", "syringe_kit", "syringe_kit", "syringe_kit", "syringe_kit", "kingyellow", "ithaqua", "scientology", "melted", "necronomicon")) /obj/item/weapon/storage/book/bible name = "bible" @@ -36,9 +36,9 @@ var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible", if(!SSreligion.Bible_icon_state && H.job == "Chaplain") var/dat = "Pick Bible Style

    Pick a bible style

    [dpt]
    " var/i - for(i = 1, i < biblestates.len, i++) - var/icon/bibleicon = icon('icons/obj/storage.dmi', biblestates[i]) - var/nicename = biblenames[i] + for(i = 1, i < GLOB.biblestates.len, i++) + var/icon/bibleicon = icon('icons/obj/storage.dmi', GLOB.biblestates[i]) + var/nicename = GLOB.biblenames[i] H << browse_rsc(bibleicon, nicename) dat += {""} dat += "
    [nicename]
    " @@ -49,10 +49,10 @@ var/global/list/bibleitemstates = list("bible", "koran", "scrapbook", "bible", return if(href_list["seticon"] && SSticker && !SSreligion.Bible_icon_state) var/iconi = text2num(href_list["seticon"]) - var/biblename = biblenames[iconi] + var/biblename = GLOB.biblenames[iconi] var/obj/item/weapon/storage/book/bible/B = locate(href_list["src"]) - B.icon_state = biblestates[iconi] - B.item_state = bibleitemstates[iconi] + B.icon_state = GLOB.biblestates[iconi] + B.item_state = GLOB.bibleitemstates[iconi] if(B.icon_state == "honk1" || B.icon_state == "honk2") var/mob/living/carbon/human/H = usr diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm index ea07603c380fc..121ffcd8aa6be 100644 --- a/code/game/objects/items/weapons/storage/lockbox.dm +++ b/code/game/objects/items/weapons/storage/lockbox.dm @@ -9,7 +9,7 @@ max_w_class = WEIGHT_CLASS_NORMAL max_combined_w_class = 14 //The sum of the w_classes of all the items in this storage item. storage_slots = 4 - req_access = list(access_armory) + req_access = list(GLOB.access_armory) var/locked = 1 var/broken = 0 var/icon_locked = "lockbox+l" @@ -78,7 +78,7 @@ /obj/item/weapon/storage/lockbox/loyalty name = "lockbox of mindshield implants" - req_access = list(access_security) + req_access = list(GLOB.access_security) /obj/item/weapon/storage/lockbox/loyalty/New() ..() @@ -90,7 +90,7 @@ /obj/item/weapon/storage/lockbox/clusterbang name = "lockbox of clusterbangs" desc = "You have a bad feeling about opening this." - req_access = list(access_security) + req_access = list(GLOB.access_security) /obj/item/weapon/storage/lockbox/clusterbang/New() ..() @@ -104,7 +104,7 @@ w_class = WEIGHT_CLASS_NORMAL max_w_class = WEIGHT_CLASS_SMALL storage_slots = 10 - req_access = list(access_captain) + req_access = list(GLOB.access_captain) icon_locked = "medalbox+l" icon_closed = "medalbox" icon_broken = "medalbox+b" diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index ccaf383ad7ed9..078cb97025fdc 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -164,7 +164,7 @@ if(ishuman(L)) var/mob/living/carbon/human/H = L - H.forcesay(hit_appends) + H.forcesay(GLOB.hit_appends) return 1 diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index ffac4b240b236..0595076901ddf 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -120,7 +120,7 @@ for(var/obj/item/W in H) H.dropItemToGround(W) if(prob(50)) - step(W, pick(alldirs)) + step(W, pick(GLOB.alldirs)) H.status_flags |= DISFIGURED H.bleed_rate = 5 H.gib_animation() @@ -143,7 +143,7 @@ . = ..() /obj/item/weapon/tank/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = hands_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "tanks", name, 420, 200, master_ui, state) diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index a2dfa8af0a33d..87254406ffa42 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -60,7 +60,7 @@ Frequency: if (sr) src.temp += "Located Beacons:
    " - for(var/obj/item/device/radio/beacon/W in teleportbeacons) + for(var/obj/item/device/radio/beacon/W in GLOB.teleportbeacons) if (W.frequency == src.frequency) var/turf/tr = get_turf(W) if (tr.z == sr.z && tr) @@ -78,7 +78,7 @@ Frequency: src.temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]
    " src.temp += "Extranneous Signals:
    " - for (var/obj/item/weapon/implant/tracking/W in tracked_implants) + for (var/obj/item/weapon/implant/tracking/W in GLOB.tracked_implants) if (!W.imp_in || !ismob(W.loc)) continue else @@ -145,7 +145,7 @@ Frequency: to_chat(user, "\The [src] is malfunctioning.") return var/list/L = list( ) - for(var/obj/machinery/computer/teleporter/com in machines) + for(var/obj/machinery/computer/teleporter/com in GLOB.machines) if(com.target) var/area/A = get_area(com.target) if(!A || A.noteleport) diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 2b1b52b0a7002..d7465876c0ec9 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -123,7 +123,7 @@ /obj/item/weapon/claymore/highlander/attack_self(mob/living/user) var/closest_victim var/closest_distance = 255 - for(var/mob/living/carbon/human/H in player_list - user) + for(var/mob/living/carbon/human/H in GLOB.player_list - user) if(H.client && H.mind.special_role == "highlander" && (!closest_victim || get_dist(user, closest_victim) < closest_distance)) closest_victim = H if(!closest_victim) diff --git a/code/game/objects/obj_defense.dm b/code/game/objects/obj_defense.dm index a8c9518685f55..f9b9e69091e24 100644 --- a/code/game/objects/obj_defense.dm +++ b/code/game/objects/obj_defense.dm @@ -148,7 +148,7 @@ ///// ACID -var/global/image/acid_overlay = image("icon" = 'icons/effects/effects.dmi', "icon_state" = "acid") +GLOBAL_DATUM_INIT(acid_overlay, /image, image("icon" = 'icons/effects/effects.dmi', "icon_state" = "acid")) //the obj's reaction when touched by acid /obj/acid_act(acidpwr, acid_volume) @@ -156,7 +156,7 @@ var/global/image/acid_overlay = image("icon" = 'icons/effects/effects.dmi', "ico if(!acid_level) SSacid.processing[src] = src - add_overlay(acid_overlay, TRUE) + add_overlay(GLOB.acid_overlay, TRUE) var/acid_cap = acidpwr * 300 //so we cannot use huge amounts of weak acids to do as well as strong acids. if(acid_level < acid_cap) acid_level = min(acid_level + acidpwr * acid_volume, acid_cap) @@ -194,7 +194,7 @@ var/global/image/acid_overlay = image("icon" = 'icons/effects/effects.dmi', "ico if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE)) resistance_flags |= ON_FIRE SSfire_burning.processing[src] = src - add_overlay(fire_overlay, TRUE) + add_overlay(GLOB.fire_overlay, TRUE) return 1 //called when the obj is destroyed by fire @@ -206,7 +206,7 @@ var/global/image/acid_overlay = image("icon" = 'icons/effects/effects.dmi', "ico /obj/proc/extinguish() if(resistance_flags & ON_FIRE) resistance_flags &= ~ON_FIRE - cut_overlay(fire_overlay, TRUE) + cut_overlay(GLOB.fire_overlay, TRUE) SSfire_burning.processing -= src diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm index 4c538a166a51d..697e14346252f 100644 --- a/code/game/objects/structures.dm +++ b/code/game/objects/structures.dm @@ -18,11 +18,11 @@ queue_smooth_neighbors(src) icon_state = "" if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) /obj/structure/Destroy() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) if(smooth) queue_smooth_neighbors(src) return ..() diff --git a/code/game/objects/structures/artstuff.dm b/code/game/objects/structures/artstuff.dm index b4e80bf9dada5..23bbc40ed8a04 100644 --- a/code/game/objects/structures/artstuff.dm +++ b/code/game/objects/structures/artstuff.dm @@ -45,7 +45,7 @@ #define AMT_OF_CANVASES 4 //Keep this up to date or shit will break. //To safe memory on making /icons we cache the blanks.. -var/global/list/globalBlankCanvases[AMT_OF_CANVASES] +GLOBAL_LIST_INIT(globalBlankCanvases, new(AMT_OF_CANVASES)) /obj/item/weapon/canvas name = "canvas" @@ -71,11 +71,11 @@ var/global/list/globalBlankCanvases[AMT_OF_CANVASES] //Find the right size blank canvas /obj/item/weapon/canvas/proc/getGlobalBackup() . = null - if(globalBlankCanvases[whichGlobalBackup]) - . = globalBlankCanvases[whichGlobalBackup] + if(GLOB.globalBlankCanvases[whichGlobalBackup]) + . = GLOB.globalBlankCanvases[whichGlobalBackup] else var/icon/I = icon(initial(icon),initial(icon_state)) - globalBlankCanvases[whichGlobalBackup] = I + GLOB.globalBlankCanvases[whichGlobalBackup] = I . = I diff --git a/code/game/objects/structures/barsigns.dm b/code/game/objects/structures/barsigns.dm index 880fbec68606e..2b1319c50e4c5 100644 --- a/code/game/objects/structures/barsigns.dm +++ b/code/game/objects/structures/barsigns.dm @@ -3,7 +3,7 @@ desc = "A bar sign with no writing on it" icon = 'icons/obj/barsigns.dmi' icon_state = "empty" - req_access = list(access_bar) + req_access = list(GLOB.access_bar) obj_integrity = 500 max_integrity = 500 integrity_failure = 250 @@ -132,7 +132,7 @@ sleep(100) //10 seconds set_sign(new /datum/barsign/hiddensigns/syndibarsign) emagged = 1 - req_access = list(access_syndicate) + req_access = list(GLOB.access_syndicate) diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 4c3e68ad3f935..fdded787bd6f3 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -25,7 +25,7 @@ return ..() /obj/structure/chair/proc/RemoveFromLatejoin() - latejoin -= src //These may be here due to the arrivals shuttle + GLOB.latejoin -= src //These may be here due to the arrivals shuttle /obj/structure/chair/deconstruct() // If we have materials, and don't have the NOCONSTRUCT flag diff --git a/code/game/objects/structures/crates_lockers/closets/secure/bar.dm b/code/game/objects/structures/crates_lockers/closets/secure/bar.dm index c97b08e8322fd..70d098d122951 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/bar.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/bar.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/bar name = "booze storage" - req_access = list(access_bar) + req_access = list(GLOB.access_bar) icon_state = "cabinet" resistance_flags = FLAMMABLE obj_integrity = 70 diff --git a/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm b/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm index 5f450053199a2..75382f3dccc17 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/quartermaster name = "\proper quartermaster's locker" - req_access = list(access_qm) + req_access = list(GLOB.access_qm) icon_state = "qm" /obj/structure/closet/secure_closet/quartermaster/PopulateContents() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm index 6c75822ceae60..38ffdad47bf9d 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/engineering_chief name = "\proper chief engineer's locker" - req_access = list(access_ce) + req_access = list(GLOB.access_ce) icon_state = "ce" /obj/structure/closet/secure_closet/engineering_chief/PopulateContents() @@ -29,7 +29,7 @@ /obj/structure/closet/secure_closet/engineering_electrical name = "electrical supplies locker" - req_access = list(access_engine_equip) + req_access = list(GLOB.access_engine_equip) icon_state = "eng" icon_door = "eng_elec" @@ -46,7 +46,7 @@ /obj/structure/closet/secure_closet/engineering_welding name = "welding supplies locker" - req_access = list(access_engine_equip) + req_access = list(GLOB.access_engine_equip) icon_state = "eng" icon_door = "eng_weld" @@ -59,7 +59,7 @@ /obj/structure/closet/secure_closet/engineering_personal name = "engineer's locker" - req_access = list(access_engine_equip) + req_access = list(GLOB.access_engine_equip) icon_state = "eng_secure" /obj/structure/closet/secure_closet/engineering_personal/PopulateContents() @@ -75,7 +75,7 @@ /obj/structure/closet/secure_closet/atmospherics name = "\proper atmospheric technician's locker" - req_access = list(access_atmospherics) + req_access = list(GLOB.access_atmospherics) icon_state = "atmos" /obj/structure/closet/secure_closet/atmospherics/PopulateContents() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm index 17666ddbded3a..dc9cdb3e716cd 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm @@ -3,7 +3,7 @@ /obj/structure/closet/secure_closet/freezer/kitchen name = "kitchen Cabinet" - req_access = list(access_kitchen) + req_access = list(GLOB.access_kitchen) /obj/structure/closet/secure_closet/freezer/kitchen/PopulateContents() ..() @@ -51,7 +51,7 @@ /obj/structure/closet/secure_closet/freezer/money name = "freezer" desc = "This contains cold hard cash." - req_access = list(access_heads_vault) + req_access = list(GLOB.access_heads_vault) /obj/structure/closet/secure_closet/freezer/money/PopulateContents() ..() @@ -65,7 +65,7 @@ /obj/structure/closet/secure_closet/freezer/cream_pie name = "cream pie closet" desc = "Contains pies filled with cream and/or custard, you sickos." - req_access = list(access_theatre) + req_access = list(GLOB.access_theatre) /obj/structure/closet/secure_closet/freezer/pie/PopulateContents() ..() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm b/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm index 4cbbc46b6297d..658612e09be3e 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/hydroponics.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/hydroponics name = "botanist's locker" - req_access = list(access_hydroponics) + req_access = list(GLOB.access_hydroponics) icon_state = "hydro" /obj/structure/closet/secure_closet/hydroponics/PopulateContents() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm index f0ff0c92d4070..3fb35b0dafd83 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm @@ -2,7 +2,7 @@ name = "medicine closet" desc = "Filled to the brim with medical junk." icon_state = "med" - req_access = list(access_medical) + req_access = list(GLOB.access_medical) /obj/structure/closet/secure_closet/medical1/PopulateContents() ..() @@ -24,7 +24,7 @@ /obj/structure/closet/secure_closet/medical2 name = "anesthetic closet" desc = "Used to knock people out." - req_access = list(access_surgery) + req_access = list(GLOB.access_surgery) /obj/structure/closet/secure_closet/medical2/PopulateContents() ..() @@ -35,7 +35,7 @@ /obj/structure/closet/secure_closet/medical3 name = "medical doctor's locker" - req_access = list(access_surgery) + req_access = list(GLOB.access_surgery) icon_state = "med_secure" /obj/structure/closet/secure_closet/medical3/PopulateContents() @@ -49,7 +49,7 @@ /obj/structure/closet/secure_closet/CMO name = "\proper chief medical officer's locker" - req_access = list(access_cmo) + req_access = list(GLOB.access_cmo) icon_state = "cmo" /obj/structure/closet/secure_closet/CMO/PopulateContents() @@ -74,7 +74,7 @@ /obj/structure/closet/secure_closet/animal name = "animal control" - req_access = list(access_surgery) + req_access = list(GLOB.access_surgery) /obj/structure/closet/secure_closet/animal/PopulateContents() ..() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/misc.dm b/code/game/objects/structures/crates_lockers/closets/secure/misc.dm index 20cbea2f22d0e..632dbd30e385b 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/misc.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/misc.dm @@ -1,7 +1,7 @@ /obj/structure/closet/secure_closet/ertCom name = "commander's closet" desc = "Emergency Response Team equipment locker." - req_access = list(access_cent_captain) + req_access = list(GLOB.access_cent_captain) icon_state = "cap" /obj/structure/closet/secure_closet/ertCom/PopulateContents() @@ -22,7 +22,7 @@ /obj/structure/closet/secure_closet/ertSec name = "security closet" desc = "Emergency Response Team equipment locker." - req_access = list(access_cent_specops) + req_access = list(GLOB.access_cent_specops) icon_state = "hos" /obj/structure/closet/secure_closet/ertSec/PopulateContents() @@ -36,7 +36,7 @@ /obj/structure/closet/secure_closet/ertMed name = "medical closet" desc = "Emergency Response Team equipment locker." - req_access = list(access_cent_medical) + req_access = list(GLOB.access_cent_medical) icon_state = "cmo" /obj/structure/closet/secure_closet/ertMed/PopulateContents() @@ -52,7 +52,7 @@ /obj/structure/closet/secure_closet/ertEngi name = "engineer closet" desc = "Emergency Response Team equipment locker." - req_access = list(access_cent_storage) + req_access = list(GLOB.access_cent_storage) icon_state = "ce" /obj/structure/closet/secure_closet/ertEngi/PopulateContents() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm index a7f7b4b74b42a..a35c18350c90e 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm @@ -1,7 +1,7 @@ /obj/structure/closet/secure_closet/personal desc = "It's a secure locker for personnel. The first card swiped gains control." name = "personal closet" - req_access = list(access_all_personal_lockers) + req_access = list(GLOB.access_all_personal_lockers) var/registered_name = null /obj/structure/closet/secure_closet/personal/PopulateContents() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm index 0363907169d39..b1a97839aa1f5 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/RD name = "\proper research director's locker" - req_access = list(access_rd) + req_access = list(GLOB.access_rd) icon_state = "rd" /obj/structure/closet/secure_closet/RD/PopulateContents() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm index 3b6ccb4740393..9040bbccc05da 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -1,6 +1,6 @@ /obj/structure/closet/secure_closet/captains name = "\proper captain's locker" - req_access = list(access_captain) + req_access = list(GLOB.access_captain) icon_state = "cap" /obj/structure/closet/secure_closet/captains/PopulateContents() @@ -32,7 +32,7 @@ /obj/structure/closet/secure_closet/hop name = "\proper head of personnel's locker" - req_access = list(access_hop) + req_access = list(GLOB.access_hop) icon_state = "hop" /obj/structure/closet/secure_closet/hop/PopulateContents() @@ -56,7 +56,7 @@ /obj/structure/closet/secure_closet/hos name = "\proper head of security's locker" - req_access = list(access_hos) + req_access = list(GLOB.access_hos) icon_state = "hos" /obj/structure/closet/secure_closet/hos/PopulateContents() @@ -85,7 +85,7 @@ /obj/structure/closet/secure_closet/warden name = "\proper warden's locker" - req_access = list(access_armory) + req_access = list(GLOB.access_armory) icon_state = "warden" /obj/structure/closet/secure_closet/warden/PopulateContents() @@ -109,7 +109,7 @@ /obj/structure/closet/secure_closet/security name = "security officer's locker" - req_access = list(access_security) + req_access = list(GLOB.access_security) icon_state = "sec" /obj/structure/closet/secure_closet/security/PopulateContents() @@ -157,7 +157,7 @@ /obj/structure/closet/secure_closet/detective name = "\proper detective's cabinet" - req_access = list(access_forensics_lockers) + req_access = list(GLOB.access_forensics_lockers) icon_state = "cabinet" resistance_flags = FLAMMABLE obj_integrity = 70 @@ -185,7 +185,7 @@ /obj/structure/closet/secure_closet/injection name = "lethal injections" - req_access = list(access_hos) + req_access = list(GLOB.access_hos) /obj/structure/closet/secure_closet/injection/PopulateContents() ..() @@ -194,7 +194,7 @@ /obj/structure/closet/secure_closet/brig name = "brig locker" - req_access = list(access_brig) + req_access = list(GLOB.access_brig) anchored = 1 var/id = null @@ -205,7 +205,7 @@ /obj/structure/closet/secure_closet/courtroom name = "courtroom locker" - req_access = list(access_court) + req_access = list(GLOB.access_court) /obj/structure/closet/secure_closet/courtroom/PopulateContents() ..() @@ -219,7 +219,7 @@ /obj/structure/closet/secure_closet/armory1 name = "armory armor locker" - req_access = list(access_armory) + req_access = list(GLOB.access_armory) icon_state = "armory" /obj/structure/closet/secure_closet/armory1/PopulateContents() @@ -234,7 +234,7 @@ /obj/structure/closet/secure_closet/armory2 name = "armory ballistics locker" - req_access = list(access_armory) + req_access = list(GLOB.access_armory) icon_state = "armory" /obj/structure/closet/secure_closet/armory2/PopulateContents() @@ -247,7 +247,7 @@ /obj/structure/closet/secure_closet/armory3 name = "armory energy gun locker" - req_access = list(access_armory) + req_access = list(GLOB.access_armory) icon_state = "armory" /obj/structure/closet/secure_closet/armory3/PopulateContents() @@ -261,7 +261,7 @@ /obj/structure/closet/secure_closet/tac name = "armory tac locker" - req_access = list(access_armory) + req_access = list(GLOB.access_armory) icon_state = "tac" /obj/structure/closet/secure_closet/tac/PopulateContents() @@ -273,7 +273,7 @@ /obj/structure/closet/secure_closet/lethalshots name = "shotgun lethal rounds" - req_access = list(access_armory) + req_access = list(GLOB.access_armory) icon_state = "tac" /obj/structure/closet/secure_closet/lethalshots/PopulateContents() diff --git a/code/game/objects/structures/crates_lockers/crates/secure.dm b/code/game/objects/structures/crates_lockers/crates/secure.dm index 0e07b9ed2de3f..ff0e4db9a8228 100644 --- a/code/game/objects/structures/crates_lockers/crates/secure.dm +++ b/code/game/objects/structures/crates_lockers/crates/secure.dm @@ -33,7 +33,7 @@ if(user) to_chat(user, "The crate's anti-tamper system activates!") var/message = "[ADMIN_LOOKUPFLW(user)] has detonated [src.name]." - bombers += message + GLOB.bombers += message message_admins(message) log_game("[key_name(user)] has detonated [src.name].") for(var/atom/movable/AM in src) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index e5ba388435d0a..47e4157408706 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -242,10 +242,10 @@ /obj/structure/displaycase/captain alert = 1 start_showpiece_type = /obj/item/weapon/gun/energy/laser/captain - req_access = list(access_cent_specops) + req_access = list(GLOB.access_cent_specops) /obj/structure/displaycase/labcage name = "lab cage" desc = "A glass lab container for storing interesting creatures." start_showpiece_type = /obj/item/clothing/mask/facehugger/lamarr - req_access = list(access_rd) + req_access = list(GLOB.access_rd) diff --git a/code/game/objects/structures/dresser.dm b/code/game/objects/structures/dresser.dm index cf6d55311ab6b..1205ea6c87929 100644 --- a/code/game/objects/structures/dresser.dm +++ b/code/game/objects/structures/dresser.dm @@ -18,16 +18,16 @@ return switch(choice) if("Underwear") - var/new_undies = input(user, "Select your underwear", "Changing") as null|anything in underwear_list + var/new_undies = input(user, "Select your underwear", "Changing") as null|anything in GLOB.underwear_list if(new_undies) H.underwear = new_undies if("Undershirt") - var/new_undershirt = input(user, "Select your undershirt", "Changing") as null|anything in undershirt_list + var/new_undershirt = input(user, "Select your undershirt", "Changing") as null|anything in GLOB.undershirt_list if(new_undershirt) H.undershirt = new_undershirt if("Socks") - var/new_socks = input(user, "Select your socks", "Changing") as null|anything in socks_list + var/new_socks = input(user, "Select your socks", "Changing") as null|anything in GLOB.socks_list if(new_socks) H.socks= new_socks diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index 8c7c248667d44..466be07c501f6 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -339,5 +339,5 @@ return ..() /obj/structure/falsewall/brass/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) obj_integrity = max_integrity diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm index 46d6c9dab13a8..6c29061fcb8ff 100644 --- a/code/game/objects/structures/flora.dm +++ b/code/game/objects/structures/flora.dm @@ -262,7 +262,7 @@ /obj/item/weapon/twohanded/required/kirbyplants/equipped(mob/living/user) var/image/I = image(icon = 'icons/obj/flora/plants.dmi' , icon_state = src.icon_state, loc = user) I.override = 1 - user.add_alt_appearance("sneaking_mission", I, player_list) + user.add_alt_appearance("sneaking_mission", I, GLOB.player_list) ..() /obj/item/weapon/twohanded/required/kirbyplants/dropped(mob/living/user) diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index 298541a40f2ee..e38bc936e2d0b 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -15,18 +15,18 @@ /obj/structure/ladder/Initialize(mapload) if(!initialized) - ladders += src + GLOB.ladders += src ..() if(mapload) return TRUE update_link() /obj/structure/ladder/Destroy() - ladders -= src + GLOB.ladders -= src . = ..() /obj/structure/ladder/proc/update_link() - for(var/obj/structure/ladder/L in ladders) + for(var/obj/structure/ladder/L in GLOB.ladders) if(L.id == id) if(L.height == (height - 1)) down = L diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 5b051bea40c45..cfcfd425f32fd 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -25,7 +25,7 @@ //handle facial hair (if necessary) if(H.gender == MALE) - var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in facial_hair_styles_list + var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list if(userloc != H.loc) return //no tele-grooming if(new_style) @@ -34,7 +34,7 @@ H.facial_hair_style = "Shaved" //handle normal hair - var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in hair_styles_list + var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list if(userloc != H.loc) return //no tele-grooming if(new_style) @@ -102,7 +102,7 @@ ..() /obj/structure/mirror/magic/lesser/New() - choosable_races = roundstart_species + choosable_races = GLOB.roundstart_species ..() /obj/structure/mirror/magic/badmin/New() @@ -140,7 +140,7 @@ if("race") var/newrace var/racechoice = input(H, "What are we again?", "Race change") as null|anything in choosable_races - newrace = species_list[racechoice] + newrace = GLOB.species_list[racechoice] if(!newrace) return @@ -149,7 +149,7 @@ H.set_species(newrace, icon_update=0) if(H.dna.species.use_skintones) - var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in skin_tones + var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones if(new_s_tone) H.skin_tone = new_s_tone diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 30002acc2e482..833b76d93c9b6 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -147,7 +147,7 @@ /* * Crematorium */ -var/global/list/crematoriums = new/list() +GLOBAL_LIST_EMPTY(crematoriums) /obj/structure/bodycontainer/crematorium name = "crematorium" desc = "A human incinerator. Works well on barbeque nights." @@ -160,14 +160,14 @@ var/global/list/crematoriums = new/list() return /obj/structure/bodycontainer/crematorium/Destroy() - crematoriums.Remove(src) + GLOB.crematoriums.Remove(src) return ..() /obj/structure/bodycontainer/crematorium/New() connected = new/obj/structure/tray/c_tray(src) connected.connected = src - crematoriums.Add(src) + GLOB.crematoriums.Add(src) ..() /obj/structure/bodycontainer/crematorium/update_icon() diff --git a/code/game/objects/structures/noticeboard.dm b/code/game/objects/structures/noticeboard.dm index 56ec86aa1eacd..b584e88dc9ad4 100644 --- a/code/game/objects/structures/noticeboard.dm +++ b/code/game/objects/structures/noticeboard.dm @@ -90,39 +90,39 @@ /obj/structure/noticeboard/captain name = "Captain's Notice Board" desc = "Important notices from the Captain." - req_access = list(access_captain) + req_access = list(GLOB.access_captain) /obj/structure/noticeboard/hop name = "Head of Personnel's Notice Board" desc = "Important notices from the Head of Personnel." - req_access = list(access_hop) + req_access = list(GLOB.access_hop) /obj/structure/noticeboard/ce name = "Chief Engineer's Notice Board" desc = "Important notices from the Chief Engineer." - req_access = list(access_ce) + req_access = list(GLOB.access_ce) /obj/structure/noticeboard/hos name = "Head of Security's Notice Board" desc = "Important notices from the Head of Security." - req_access = list(access_hos) + req_access = list(GLOB.access_hos) /obj/structure/noticeboard/cmo name = "Chief Medical Officer's Notice Board" desc = "Important notices from the Chief Medical Officer." - req_access = list(access_cmo) + req_access = list(GLOB.access_cmo) /obj/structure/noticeboard/rd name = "Research Director's Notice Board" desc = "Important notices from the Research Director." - req_access = list(access_rd) + req_access = list(GLOB.access_rd) /obj/structure/noticeboard/qm name = "Quartermaster's Notice Board" desc = "Important notices from the Quartermaster." - req_access = list(access_qm) + req_access = list(GLOB.access_qm) /obj/structure/noticeboard/staff name = "Staff Notice Board" desc = "Important notices from the heads of staff." - req_access = list(access_heads) + req_access = list(GLOB.access_heads) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 55483cbc80e2a..31eba8febe001 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -366,7 +366,7 @@ /obj/structure/table/optable/New() ..() - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) computer = locate(/obj/machinery/computer/operating, get_step(src, dir)) if(computer) computer.table = src diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm index 0b05ced1444fe..8b935aab2a898 100644 --- a/code/game/objects/structures/tank_dispenser.dm +++ b/code/game/objects/structures/tank_dispenser.dm @@ -69,7 +69,7 @@ update_icon() /obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "tank_dispenser", name, 275, 100, master_ui, state) diff --git a/code/game/objects/structures/transit_tubes/transit_tube.dm b/code/game/objects/structures/transit_tubes/transit_tube.dm index 135f5ca02f5a0..eae2041a315c2 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube.dm @@ -129,7 +129,7 @@ /obj/structure/transit_tube/proc/generate_tube_overlays() for(var/direction in tube_dirs) - if(direction in diagonals) + if(direction in GLOB.diagonals) if(direction & NORTH) create_tube_overlay(direction ^ 3, NORTH) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 9aabba3ed8c1b..d5bcb8b60b5e3 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -546,7 +546,7 @@ return ..() /obj/structure/window/reinforced/clockwork/ratvar_act() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) obj_integrity = max_integrity update_icon() diff --git a/code/game/say.dm b/code/game/say.dm index 1cb400d694e98..cebabc2f47835 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -3,7 +3,7 @@ This file has the basic atom/movable level speech procs. And the base of the send_speech() proc, which is the core of saycode. */ -var/list/freqtospan = list( +GLOBAL_LIST_INIT(freqtospan, list( "1351" = "sciradio", "1355" = "medradio", "1357" = "engradio", @@ -16,7 +16,7 @@ var/list/freqtospan = list( "1337" = "centcomradio", "1215" = "redteamradio", "1217" = "blueteamradio" - ) + )) /atom/movable/proc/say(message, datum/language/language = null) if(!can_speak()) @@ -102,13 +102,13 @@ var/list/freqtospan = list( return "makes a strange sound." /proc/get_radio_span(freq) - var/returntext = freqtospan["[freq]"] + var/returntext = GLOB.freqtospan["[freq]"] if(returntext) return returntext return "radio" /proc/get_radio_name(freq) - var/returntext = radiochannelsreverse["[freq]"] + var/returntext = GLOB.reverseradiochannels["[freq]"] if(returntext) return returntext return "[copytext("[freq]", 1, 4)].[copytext("[freq]", 4, 5)]" diff --git a/code/game/sound.dm b/code/game/sound.dm index 5b0a77382203b..8d0c20d63d78e 100644 --- a/code/game/sound.dm +++ b/code/game/sound.dm @@ -14,7 +14,7 @@ channel = channel || open_sound_channel() // Looping through the player list has the added bonus of working for mobs inside containers - for (var/P in player_list) + for (var/P in GLOB.player_list) var/mob/M = P if(!M || !M.client) continue @@ -137,5 +137,5 @@ return soundin /proc/playsound_global(file, repeat=0, wait, channel, volume) - for(var/V in clients) + for(var/V in GLOB.clients) V << sound(file, repeat, wait, channel, volume) diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm index d9a990bd83a24..ee5527c0f599e 100644 --- a/code/game/turfs/open.dm +++ b/code/game/turfs/open.dm @@ -59,7 +59,7 @@ //cache some vars var/list/atmos_adjacent_turfs = src.atmos_adjacent_turfs - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/open/enemy_tile = get_step(src, direction) if(!istype(enemy_tile)) if (atmos_adjacent_turfs) diff --git a/code/game/turfs/simulated/chasm.dm b/code/game/turfs/simulated/chasm.dm index 682530a4d7262..8890c501293d7 100644 --- a/code/game/turfs/simulated/chasm.dm +++ b/code/game/turfs/simulated/chasm.dm @@ -149,7 +149,7 @@ AM.alpha = oldalpha AM.color = oldcolor AM.transform = oldtransform - AM.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1, 10),rand(1, 10)) + AM.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1, 10),rand(1, 10)) /turf/open/chasm/straight_down/lava_land_surface/normal_air initial_gas_mix = "o2=22;n2=82;TEMP=293.15" diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index f428fbaaec07b..98c28256e92d4 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -1,20 +1,3 @@ -//This is so damaged or burnt tiles or platings don't get remembered as the default tile -var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4", - "damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2", - "platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2", - "light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken", - "light_on_broken","light_off","wall_thermite","grass", "sand", - "asteroid","asteroid_dug", - "asteroid0","asteroid1","asteroid2","asteroid3","asteroid4", - "asteroid5","asteroid6","asteroid7","asteroid8","asteroid9","asteroid10","asteroid11","asteroid12", - "basalt","basalt_dug", - "basalt0","basalt1","basalt2","basalt3","basalt4", - "basalt5","basalt6","basalt7","basalt8","basalt9","basalt10","basalt11","basalt12", - "oldburning","light-on-r","light-on-y","light-on-g","light-on-b", "wood", "wood-broken", - "carpetcorner", "carpetside", "carpet", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5", - "ironsand6", "ironsand7", "ironsand8", "ironsand9", "ironsand10", "ironsand11", - "ironsand12", "ironsand13", "ironsand14", "ironsand15") - /turf/open/floor //NOTE: Floor code has been refactored, many procs were removed and refactored //- you should use istype() if you want to find out whether a floor has a certain type @@ -39,6 +22,22 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," if (!burnt_states) burnt_states = list() ..() + //This is so damaged or burnt tiles or platings don't get remembered as the default tile + var/static/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","damaged4", + "damaged5","panelscorched","floorscorched1","floorscorched2","platingdmg1","platingdmg2", + "platingdmg3","plating","light_on","light_on_flicker1","light_on_flicker2", + "light_on_clicker3","light_on_clicker4","light_on_clicker5","light_broken", + "light_on_broken","light_off","wall_thermite","grass", "sand", + "asteroid","asteroid_dug", + "asteroid0","asteroid1","asteroid2","asteroid3","asteroid4", + "asteroid5","asteroid6","asteroid7","asteroid8","asteroid9","asteroid10","asteroid11","asteroid12", + "basalt","basalt_dug", + "basalt0","basalt1","basalt2","basalt3","basalt4", + "basalt5","basalt6","basalt7","basalt8","basalt9","basalt10","basalt11","basalt12", + "oldburning","light-on-r","light-on-y","light-on-g","light-on-b", "wood", "wood-broken", + "carpetcorner", "carpetside", "carpet", "ironsand1", "ironsand2", "ironsand3", "ironsand4", "ironsand5", + "ironsand6", "ironsand7", "ironsand8", "ironsand9", "ironsand10", "ironsand11", + "ironsand12", "ironsand13", "ironsand14", "ironsand15") if(icon_state in icons_to_ignore_at_floor_init) //so damaged/burned tiles or plating icons aren't saved as the default icon_regular_floor = "floor" else diff --git a/code/game/turfs/simulated/floor/plating/asteroid.dm b/code/game/turfs/simulated/floor/plating/asteroid.dm index 6eec8039a0aae..a17fcf2ca8b3c 100644 --- a/code/game/turfs/simulated/floor/plating/asteroid.dm +++ b/code/game/turfs/simulated/floor/plating/asteroid.dm @@ -202,7 +202,7 @@ length = set_length // Get our directiosn - forward_cave_dir = pick(alldirs - exclude_dir) + forward_cave_dir = pick(GLOB.alldirs - exclude_dir) // Get the opposite direction of our facing direction backward_cave_dir = angle2dir(dir2angle(forward_cave_dir) + 180) diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm index 38095ae38d5e4..ba84d0ff11323 100644 --- a/code/game/turfs/simulated/minerals.dm +++ b/code/game/turfs/simulated/minerals.dm @@ -32,7 +32,7 @@ icon = smooth_icon ..() if (mineralType && mineralAmt && spread && spreadChance) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) if(prob(spreadChance)) var/turf/T = get_step(src, dir) if(istype(T, /turf/closed/mineral/random)) diff --git a/code/game/turfs/simulated/river.dm b/code/game/turfs/simulated/river.dm index 18e521b23f7f7..49ac9a6d32786 100644 --- a/code/game/turfs/simulated/river.dm +++ b/code/game/turfs/simulated/river.dm @@ -78,7 +78,7 @@ var/turf/closed/mineral/M = T logged_turf_type = M.turf_type - if(get_dir(src, F) in cardinal) + if(get_dir(src, F) in GLOB.cardinal) cardinal_turfs += F else diagonal_turfs += F diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index cd25b28b774ca..73bc579b853f4 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -153,22 +153,22 @@ cur_y = cur_pos["y"] if(src.x <= 1) - next_x = (--cur_x||global_map.len) - y_arr = global_map[next_x] + next_x = (--cur_x||GLOB.global_map.len) + y_arr = GLOB.global_map[next_x] target_z = y_arr[cur_y] next_x = world.maxx - 2 else if (src.x >= world.maxx) - next_x = (++cur_x > global_map.len ? 1 : cur_x) - y_arr = global_map[next_x] + next_x = (++cur_x > GLOB.global_map.len ? 1 : cur_x) + y_arr = GLOB.global_map[next_x] target_z = y_arr[cur_y] next_x = 3 else if (src.y <= 1) - y_arr = global_map[cur_x] + y_arr = GLOB.global_map[cur_x] next_y = (--cur_y||y_arr.len) target_z = y_arr[next_y] next_y = world.maxy - 2 else if (src.y >= world.maxy) - y_arr = global_map[cur_x] + y_arr = GLOB.global_map[cur_x] next_y = (++cur_y > y_arr.len ? 1 : cur_y) target_z = y_arr[next_y] next_y = 3 diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index a88b838405ad9..b6ed50c576c24 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -217,7 +217,7 @@ /turf/proc/ChangeTurf(path, defer_change = FALSE, ignore_air = FALSE) if(!path) return - if(!use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed + if(!GLOB.use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed return src var/old_baseturf = baseturf @@ -353,7 +353,7 @@ /turf/proc/visibilityChanged() if(SSticker) - cameranet.updateVisibility(src) + GLOB.cameranet.updateVisibility(src) /turf/proc/burn_tile() diff --git a/code/modules/VR/vr_sleeper.dm b/code/modules/VR/vr_sleeper.dm index 9eda00a8ea792..41f3bbc001936 100644 --- a/code/modules/VR/vr_sleeper.dm +++ b/code/modules/VR/vr_sleeper.dm @@ -27,7 +27,7 @@ if(!available_vr_spawnpoints || !available_vr_spawnpoints.len) //(re)build spawnpoint lists available_vr_spawnpoints = list() - for(var/obj/effect/landmark/vr_spawn/V in landmarks_list) + for(var/obj/effect/landmark/vr_spawn/V in GLOB.landmarks_list) available_vr_spawnpoints[V.vr_category] = list() var/turf/T = get_turf(V) if(T) @@ -80,7 +80,7 @@ ui_interact(occupant) -/obj/machinery/vr_sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/obj/machinery/vr_sleeper/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "vr_sleeper", "VR Sleeper", 475, 340, master_ui, state) diff --git a/code/modules/admin/DB_ban/functions.dm b/code/modules/admin/DB_ban/functions.dm index 5d825380ccbb2..5cb2541e190f3 100644 --- a/code/modules/admin/DB_ban/functions.dm +++ b/code/modules/admin/DB_ban/functions.dm @@ -6,7 +6,7 @@ if(!check_rights(R_BAN)) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(src, "Failed to establish database connection.") return @@ -71,7 +71,7 @@ computerid = bancid ip = banip - var/DBQuery/query_add_ban_get_id = dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'") + var/DBQuery/query_add_ban_get_id = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("player")] WHERE ckey = '[ckey]'") if(!query_add_ban_get_id.warn_execute()) return var/validckey = 0 @@ -97,14 +97,14 @@ return var/who - for(var/client/C in clients) + for(var/client/C in GLOB.clients) if(!who) who = "[C]" else who += ", [C]" var/adminwho - for(var/client/C in admins) + for(var/client/C in GLOB.admins) if(!adminwho) adminwho = "[C]" else @@ -113,7 +113,7 @@ reason = sanitizeSQL(reason) if(maxadminbancheck) - var/DBQuery/query_check_adminban_amt = dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") + var/DBQuery/query_check_adminban_amt = GLOB.dbcon.NewQuery("SELECT count(id) AS num FROM [format_table_name("ban")] WHERE (a_ckey = '[a_ckey]') AND (bantype = 'ADMIN_PERMABAN' OR (bantype = 'ADMIN_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") if(!query_check_adminban_amt.warn_execute()) return if(query_check_adminban_amt.NextRow()) @@ -126,7 +126,7 @@ if(!ip) ip = "0.0.0.0" var/sql = "INSERT INTO [format_table_name("ban")] (`bantime`,`server_ip`,`server_port`,`bantype`,`reason`,`job`,`duration`,`expiration_time`,`ckey`,`computerid`,`ip`,`a_ckey`,`a_computerid`,`a_ip`,`who`,`adminwho`) VALUES (Now(), INET_ATON('[world.internet_address]'), '[world.port]', '[bantype_str]', '[reason]', '[job]', [(duration)?"[duration]":"0"], Now() + INTERVAL [(duration>0) ? duration : 0] MINUTE, '[ckey]', '[computerid]', INET_ATON('[ip]'), '[a_ckey]', '[a_computerid]', INET_ATON('[a_ip]'), '[who]', '[adminwho]')" - var/DBQuery/query_add_ban = dbcon.NewQuery(sql) + var/DBQuery/query_add_ban = GLOB.dbcon.NewQuery(sql) if(!query_add_ban.warn_execute()) return to_chat(usr, "Ban saved to database.") @@ -187,13 +187,13 @@ if(job) sql += " AND job = '[job]'" - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) return var/ban_id var/ban_number = 0 //failsafe - var/DBQuery/query_unban_get_id = dbcon.NewQuery(sql) + var/DBQuery/query_unban_get_id = GLOB.dbcon.NewQuery(sql) if(!query_unban_get_id.warn_execute()) return while(query_unban_get_id.NextRow()) @@ -225,7 +225,7 @@ to_chat(usr, "Cancelled") return - var/DBQuery/query_edit_ban_get_details = dbcon.NewQuery("SELECT ckey, duration, reason FROM [format_table_name("ban")] WHERE id = [banid]") + var/DBQuery/query_edit_ban_get_details = GLOB.dbcon.NewQuery("SELECT ckey, duration, reason FROM [format_table_name("ban")] WHERE id = [banid]") if(!query_edit_ban_get_details.warn_execute()) return @@ -254,7 +254,7 @@ to_chat(usr, "Cancelled") return - var/DBQuery/query_edit_ban_reason = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from \\\"[reason]\\\" to \\\"[value]\\\"
    ') WHERE id = [banid]") + var/DBQuery/query_edit_ban_reason = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET reason = '[value]', edits = CONCAT(edits,'- [eckey] changed ban reason from \\\"[reason]\\\" to \\\"[value]\\\"
    ') WHERE id = [banid]") if(!query_edit_ban_reason.warn_execute()) return message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s reason from [reason] to [value]",1) @@ -265,7 +265,7 @@ to_chat(usr, "Cancelled") return - var/DBQuery/query_edit_ban_duration = dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]
    '), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]") + var/DBQuery/query_edit_ban_duration = GLOB.dbcon.NewQuery("UPDATE [format_table_name("ban")] SET duration = [value], edits = CONCAT(edits,'- [eckey] changed ban duration from [duration] to [value]
    '), expiration_time = DATE_ADD(bantime, INTERVAL [value] MINUTE) WHERE id = [banid]") if(!query_edit_ban_duration.warn_execute()) return message_admins("[key_name_admin(usr)] has edited a ban for [pckey]'s duration from [duration] to [value]",1) @@ -287,13 +287,13 @@ var/sql = "SELECT ckey FROM [format_table_name("ban")] WHERE id = [id]" - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) return var/ban_number = 0 //failsafe var/pckey - var/DBQuery/query_unban_get_ckey = dbcon.NewQuery(sql) + var/DBQuery/query_unban_get_ckey = GLOB.dbcon.NewQuery(sql) if(!query_unban_get_ckey.warn_execute()) return while(query_unban_get_ckey.NextRow()) @@ -316,7 +316,7 @@ var/unban_ip = src.owner:address var/sql_update = "UPDATE [format_table_name("ban")] SET unbanned = 1, unbanned_datetime = Now(), unbanned_ckey = '[unban_ckey]', unbanned_computerid = '[unban_computerid]', unbanned_ip = INET_ATON('[unban_ip]') WHERE id = [id]" - var/DBQuery/query_unban = dbcon.NewQuery(sql_update) + var/DBQuery/query_unban = GLOB.dbcon.NewQuery(sql_update) if(!query_unban.warn_execute()) return message_admins("[key_name_admin(usr)] has lifted [pckey]'s ban.",1) @@ -339,7 +339,7 @@ if(!check_rights(R_BAN)) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return @@ -371,7 +371,7 @@ output += "" for(var/j in get_all_jobs()) output += "" - for(var/j in nonhuman_positions) + for(var/j in GLOB.nonhuman_positions) output += "" for(var/j in list("traitor","changeling","operative","revolutionary", "gangster","cultist","wizard")) output += "" @@ -405,7 +405,7 @@ var/bansperpage = 15 var/pagecount = 0 page = text2num(page) - var/DBQuery/query_count_bans = dbcon.NewQuery("SELECT COUNT(id) FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch]") + var/DBQuery/query_count_bans = GLOB.dbcon.NewQuery("SELECT COUNT(id) FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch]") if(!query_count_bans.warn_execute()) return if(query_count_bans.NextRow()) @@ -431,7 +431,7 @@ output += "OPTIONS" output += "" var/limit = " LIMIT [bansperpage * page], [bansperpage]" - var/DBQuery/query_search_bans = dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] ORDER BY bantime DESC[limit]") + var/DBQuery/query_search_bans = GLOB.dbcon.NewQuery("SELECT id, bantime, bantype, reason, job, duration, expiration_time, ckey, a_ckey, unbanned, unbanned_ckey, unbanned_datetime, edits FROM [format_table_name("ban")] WHERE 1 [playersearch] [adminsearch] ORDER BY bantime DESC[limit]") if(!query_search_bans.warn_execute()) return diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index cb17cf6f92fb1..8ea072f7f379e 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -16,7 +16,7 @@ return list("reason"="invalid login data", "desc"="Error: Could not check ban status, Please try again. Error message: Your computer provided an invalid Computer ID.)") var/admin = 0 var/ckey = ckey(key) - if((ckey in admin_datums) || (ckey in deadmins)) + if((ckey in GLOB.admin_datums) || (ckey in GLOB.deadmins)) admin = 1 //Whitelist @@ -32,10 +32,10 @@ //Guest Checking if(IsGuestKey(key)) - if (!guests_allowed) + if (!GLOB.guests_allowed) log_access("Failed Login: [key] - Guests not allowed") return list("reason"="guest", "desc"="\nReason: Guests not allowed. Please sign in with a byond account.") - if (config.panic_bunker && dbcon && dbcon.IsConnected()) + if (config.panic_bunker && GLOB.dbcon && GLOB.dbcon.IsConnected()) log_access("Failed Login: [key] - Guests not allowed during panic bunker") return list("reason"="guest", "desc"="\nReason: Sorry but the server is currently not accepting connections from never before seen players or guests. If you have played on this server with a byond account before, please log in to the byond account you have played from.") @@ -61,9 +61,9 @@ var/ckeytext = ckey(key) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) log_world("Ban database connection failure. Key [ckeytext] not checked") - diary << "Ban database connection failure. Key [ckeytext] not checked" + GLOB.diary << "Ban database connection failure. Key [ckeytext] not checked" return var/ipquery = "" @@ -74,7 +74,7 @@ if(computer_id) cidquery = " OR computerid = '[computer_id]' " - var/DBQuery/query_ban_check = dbcon.NewQuery("SELECT ckey, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)") + var/DBQuery/query_ban_check = GLOB.dbcon.NewQuery("SELECT ckey, a_ckey, reason, expiration_time, duration, bantime, bantype FROM [format_table_name("ban")] WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR bantype = 'ADMIN_PERMABAN' OR ((bantype = 'TEMPBAN' OR bantype = 'ADMIN_TEMPBAN') AND expiration_time > Now())) AND isnull(unbanned)") if(!query_ban_check.Execute()) return while(query_ban_check.NextRow()) @@ -120,7 +120,7 @@ bannedckey = ban["ckey"] var/newmatch = FALSE - var/client/C = directory[ckey] + var/client/C = GLOB.directory[ckey] var/cachedban = SSstickyban.cache[bannedckey] //rogue ban in the process of being reverted. diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index 0af6ae210e0a1..1e5a1826dad0e 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -1,76 +1,77 @@ -var/CMinutes = null -var/savefile/Banlist +GLOBAL_VAR(CMinutes) +GLOBAL_DATUM(Banlist, /savefile) +GLOBAL_PROTECT(Banlist) /proc/CheckBan(ckey, id, address) - if(!Banlist) // if Banlist cannot be located for some reason + if(!GLOB.Banlist) // if Banlist cannot be located for some reason LoadBans() // try to load the bans - if(!Banlist) // uh oh, can't find bans! + if(!GLOB.Banlist) // uh oh, can't find bans! return 0 // ABORT ABORT ABORT . = list() var/appeal if(config && config.banappeals) appeal = "\nFor more information on your ban, or to appeal, head to [config.banappeals]" - Banlist.cd = "/base" - if( "[ckey][id]" in Banlist.dir ) - Banlist.cd = "[ckey][id]" - if (Banlist["temp"]) - if (!GetExp(Banlist["minutes"])) + GLOB.Banlist.cd = "/base" + if( "[ckey][id]" in GLOB.Banlist.dir ) + GLOB.Banlist.cd = "[ckey][id]" + if (GLOB.Banlist["temp"]) + if (!GetExp(GLOB.Banlist["minutes"])) ClearTempbans() return 0 else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: [GetExp(GLOB.Banlist["minutes"])]\nBy: [GLOB.Banlist["bannedby"]][appeal]" else - Banlist.cd = "/base/[ckey][id]" - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: PERMENANT\nBy: [Banlist["bannedby"]][appeal]" + GLOB.Banlist.cd = "/base/[ckey][id]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: PERMENANT\nBy: [GLOB.Banlist["bannedby"]][appeal]" .["reason"] = "ckey/id" return . else - for (var/A in Banlist.dir) - Banlist.cd = "/base/[A]" + for (var/A in GLOB.Banlist.dir) + GLOB.Banlist.cd = "/base/[A]" var/matches - if( ckey == Banlist["key"] ) + if( ckey == GLOB.Banlist["key"] ) matches += "ckey" - if( id == Banlist["id"] ) + if( id == GLOB.Banlist["id"] ) if(matches) matches += "/" matches += "id" - if( address == Banlist["ip"] ) + if( address == GLOB.Banlist["ip"] ) if(matches) matches += "/" matches += "ip" if(matches) - if(Banlist["temp"]) - if (!GetExp(Banlist["minutes"])) + if(GLOB.Banlist["temp"]) + if (!GetExp(GLOB.Banlist["minutes"])) ClearTempbans() return 0 else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: [GetExp(Banlist["minutes"])]\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: [GetExp(GLOB.Banlist["minutes"])]\nBy: [GLOB.Banlist["bannedby"]][appeal]" else - .["desc"] = "\nReason: [Banlist["reason"]]\nExpires: PERMENANT\nBy: [Banlist["bannedby"]][appeal]" + .["desc"] = "\nReason: [GLOB.Banlist["reason"]]\nExpires: PERMENANT\nBy: [GLOB.Banlist["bannedby"]][appeal]" .["reason"] = matches return . return 0 /proc/UpdateTime() //No idea why i made this a proc. - CMinutes = (world.realtime / 10) / 60 + GLOB.CMinutes = (world.realtime / 10) / 60 return 1 /proc/LoadBans() - Banlist = new("data/banlist.bdb") + GLOB.Banlist = new("data/banlist.bdb") log_admin("Loading Banlist") - if (!length(Banlist.dir)) log_admin("Banlist is empty.") + if (!length(GLOB.Banlist.dir)) log_admin("Banlist is empty.") - if (!Banlist.dir.Find("base")) + if (!GLOB.Banlist.dir.Find("base")) log_admin("Banlist missing base dir.") - Banlist.dir.Add("base") - Banlist.cd = "/base" - else if (Banlist.dir.Find("base")) - Banlist.cd = "/base" + GLOB.Banlist.dir.Add("base") + GLOB.Banlist.cd = "/base" + else if (GLOB.Banlist.dir.Find("base")) + GLOB.Banlist.cd = "/base" ClearTempbans() return 1 @@ -78,17 +79,17 @@ var/savefile/Banlist /proc/ClearTempbans() UpdateTime() - Banlist.cd = "/base" - for (var/A in Banlist.dir) - Banlist.cd = "/base/[A]" - if (!Banlist["key"] || !Banlist["id"]) + GLOB.Banlist.cd = "/base" + for (var/A in GLOB.Banlist.dir) + GLOB.Banlist.cd = "/base/[A]" + if (!GLOB.Banlist["key"] || !GLOB.Banlist["id"]) RemoveBan(A) log_admin("Invalid Ban.") message_admins("Invalid Ban.") continue - if (!Banlist["temp"]) continue - if (CMinutes >= Banlist["minutes"]) RemoveBan(A) + if (!GLOB.Banlist["temp"]) continue + if (GLOB.CMinutes >= GLOB.Banlist["minutes"]) RemoveBan(A) return 1 @@ -99,23 +100,23 @@ var/savefile/Banlist if (temp) UpdateTime() - bantimestamp = CMinutes + minutes + bantimestamp = GLOB.CMinutes + minutes - Banlist.cd = "/base" - if ( Banlist.dir.Find("[ckey][computerid]") ) + GLOB.Banlist.cd = "/base" + if ( GLOB.Banlist.dir.Find("[ckey][computerid]") ) to_chat(usr, text("Ban already exists.")) return 0 else - Banlist.dir.Add("[ckey][computerid]") - Banlist.cd = "/base/[ckey][computerid]" - Banlist["key"] << ckey - Banlist["id"] << computerid - Banlist["ip"] << address - Banlist["reason"] << reason - Banlist["bannedby"] << bannedby - Banlist["temp"] << temp + GLOB.Banlist.dir.Add("[ckey][computerid]") + GLOB.Banlist.cd = "/base/[ckey][computerid]" + GLOB.Banlist["key"] << ckey + GLOB.Banlist["id"] << computerid + GLOB.Banlist["ip"] << address + GLOB.Banlist["reason"] << reason + GLOB.Banlist["bannedby"] << bannedby + GLOB.Banlist["temp"] << temp if (temp) - Banlist["minutes"] << bantimestamp + GLOB.Banlist["minutes"] << bantimestamp if(!temp) create_message("note", ckey, bannedby, "Permanently banned - [reason]", null, null, 0, 0) else @@ -126,12 +127,12 @@ var/savefile/Banlist var/key var/id - Banlist.cd = "/base/[foldername]" - Banlist["key"] >> key - Banlist["id"] >> id - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base/[foldername]" + GLOB.Banlist["key"] >> key + GLOB.Banlist["id"] >> id + GLOB.Banlist.cd = "/base" - if (!Banlist.dir.Remove(foldername)) return 0 + if (!GLOB.Banlist.dir.Remove(foldername)) return 0 if(!usr) log_admin_private("Ban Expired: [key]") @@ -142,18 +143,18 @@ var/savefile/Banlist message_admins("[key_name_admin(usr)] unbanned: [key]") feedback_inc("ban_unban",1) usr.client.holder.DB_ban_unban( ckey(key), BANTYPE_ANY_FULLBAN) - for (var/A in Banlist.dir) - Banlist.cd = "/base/[A]" - if (key == Banlist["key"] /*|| id == Banlist["id"]*/) - Banlist.cd = "/base" - Banlist.dir.Remove(A) + for (var/A in GLOB.Banlist.dir) + GLOB.Banlist.cd = "/base/[A]" + if (key == GLOB.Banlist["key"] /*|| id == Banlist["id"]*/) + GLOB.Banlist.cd = "/base" + GLOB.Banlist.dir.Remove(A) continue return 1 /proc/GetExp(minutes as num) UpdateTime() - var/exp = minutes - CMinutes + var/exp = minutes - GLOB.CMinutes if (exp <= 0) return 0 else @@ -170,19 +171,19 @@ var/savefile/Banlist var/count = 0 var/dat //var/dat = "
    Unban Player: \blue(U) = Unban , (E) = Edit Ban\green (Total
    " - Banlist.cd = "/base" - for (var/A in Banlist.dir) + GLOB.Banlist.cd = "/base" + for (var/A in GLOB.Banlist.dir) count++ - Banlist.cd = "/base/[A]" + GLOB.Banlist.cd = "/base/[A]" var/ref = "\ref[src]" - var/key = Banlist["key"] - var/id = Banlist["id"] - var/ip = Banlist["ip"] - var/reason = Banlist["reason"] - var/by = Banlist["bannedby"] + var/key = GLOB.Banlist["key"] + var/id = GLOB.Banlist["id"] + var/ip = GLOB.Banlist["ip"] + var/reason = GLOB.Banlist["reason"] + var/by = GLOB.Banlist["bannedby"] var/expiry - if(Banlist["temp"]) - expiry = GetExp(Banlist["minutes"]) + if(GLOB.Banlist["temp"]) + expiry = GetExp(GLOB.Banlist["minutes"]) if(!expiry) expiry = "Removal Pending" else @@ -207,26 +208,26 @@ var/savefile/Banlist var/a = pick(1,0) var/b = pick(1,0) if(b) - Banlist.cd = "/base" - Banlist.dir.Add("trash[i]trashid[i]") - Banlist.cd = "/base/trash[i]trashid[i]" - Banlist["key"] << "trash[i]" + GLOB.Banlist.cd = "/base" + GLOB.Banlist.dir.Add("trash[i]trashid[i]") + GLOB.Banlist.cd = "/base/trash[i]trashid[i]" + GLOB.Banlist["key"] << "trash[i]" else - Banlist.cd = "/base" - Banlist.dir.Add("[last]trashid[i]") - Banlist.cd = "/base/[last]trashid[i]" - Banlist["key"] << last - Banlist["id"] << "trashid[i]" - Banlist["reason"] << "Trashban[i]." - Banlist["temp"] << a - Banlist["minutes"] << CMinutes + rand(1,2000) - Banlist["bannedby"] << "trashmin" + GLOB.Banlist.cd = "/base" + GLOB.Banlist.dir.Add("[last]trashid[i]") + GLOB.Banlist.cd = "/base/[last]trashid[i]" + GLOB.Banlist["key"] << last + GLOB.Banlist["id"] << "trashid[i]" + GLOB.Banlist["reason"] << "Trashban[i]." + GLOB.Banlist["temp"] << a + GLOB.Banlist["minutes"] << GLOB.CMinutes + rand(1,2000) + GLOB.Banlist["bannedby"] << "trashmin" last = "trash[i]" - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base" /proc/ClearAllBans() - Banlist.cd = "/base" - for (var/A in Banlist.dir) + GLOB.Banlist.cd = "/base" + for (var/A in GLOB.Banlist.dir) RemoveBan(A) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index f15ffda1cc5cb..bb19286ab6150 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1,19 +1,17 @@ -var/global/BSACooldown = 0 - //////////////////////////////// /proc/message_admins(msg) msg = "ADMIN LOG: [msg]" - to_chat(admins, msg) + to_chat(GLOB.admins, msg) /proc/relay_msg_admins(msg) msg = "RELAY: [msg]" - to_chat(admins, msg) + to_chat(GLOB.admins, msg) ///////////////////////////////////////////////////////////////////////////////////////////////Panels -/datum/admins/proc/show_player_panel(mob/M in mob_list) +/datum/admins/proc/show_player_panel(mob/M in GLOB.mob_list) set category = "Admin" set name = "Show Player Panel" set desc="Edit player (respawn, ban, heal, etc)" @@ -189,14 +187,14 @@ var/global/BSACooldown = 0 dat += "Welcome to the admin newscaster.
    Here you can add, edit and censor every newspiece on the network." dat += "
    Feed channels and stories entered through here will be uneditable and handled as official news by the rest of the units." dat += "
    Note that this panel allows full freedom over the news network, there are no constrictions except the few basic ones. Don't break things!" - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) dat+= "
    Read Wanted Issue" dat+= "

    Create Feed Channel" dat+= "
    View Feed Channels" dat+= "
    Submit new Feed story" dat+= "

    Exit" var/wanted_already = 0 - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) wanted_already = 1 dat+="
    Feed Security functions:
    " dat+="
    [(wanted_already) ? ("Manage") : ("Publish")] \"Wanted\" Issue" @@ -205,10 +203,10 @@ var/global/BSACooldown = 0 dat+="

    The newscaster recognises you as:
    [src.admin_signature]
    " if(1) dat+= "Station Feed Channels
    " - if( isemptylist(news_network.network_channels) ) + if( isemptylist(GLOB.news_network.network_channels) ) dat+="No active channels found..." else - for(var/datum/newscaster/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels) if(CHANNEL.is_admin_channel) dat+="[CHANNEL.channel_name]
    " else @@ -245,7 +243,7 @@ var/global/BSACooldown = 0 if(src.admincaster_feed_channel.channel_name =="" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]") dat+="•Invalid channel name.
    " var/check = 0 - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.admincaster_feed_channel.channel_name) check = 1 break @@ -280,10 +278,10 @@ var/global/BSACooldown = 0 dat+="NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible.
    " dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it.
    " dat+="
    Select Feed channel to get Stories from:
    " - if(isemptylist(news_network.network_channels)) + if(isemptylist(GLOB.news_network.network_channels)) dat+="No feed channels found active...
    " else - for(var/datum/newscaster/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()]
    " dat+="
    Cancel" if(11) @@ -291,10 +289,10 @@ var/global/BSACooldown = 0 dat+="A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's" dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed" dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time.
    " - if(isemptylist(news_network.network_channels)) + if(isemptylist(GLOB.news_network.network_channels)) dat+="No feed channels found active...
    " else - for(var/datum/newscaster/feed_channel/CHANNEL in news_network.network_channels) + for(var/datum/newscaster/feed_channel/CHANNEL in GLOB.news_network.network_channels) dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()]
    " dat+="
    Back" @@ -329,7 +327,7 @@ var/global/BSACooldown = 0 dat+="Wanted Issue Handler:" var/wanted_already = 0 var/end_param = 1 - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) wanted_already = 1 end_param = 2 if(wanted_already) @@ -338,7 +336,7 @@ var/global/BSACooldown = 0 dat+="Criminal Name: [src.admincaster_wanted_message.criminal]
    " dat+="Description: [src.admincaster_wanted_message.body]
    " if(wanted_already) - dat+="Wanted Issue created by:[news_network.wanted_issue.scannedUser]
    " + dat+="Wanted Issue created by:[GLOB.news_network.wanted_issue.scannedUser]
    " else dat+="Wanted Issue will be created under prosecutor:[src.admin_signature]
    " dat+="
    [(wanted_already) ? ("Edit Issue") : ("Submit")]" @@ -359,12 +357,12 @@ var/global/BSACooldown = 0 dat+="Wanted Issue successfully deleted from Circulation
    " dat+="
    Return
    " if(18) - dat+="-- STATIONWIDE WANTED ISSUE --
    \[Submitted by: [news_network.wanted_issue.scannedUser]\]
    " - dat+="Criminal: [news_network.wanted_issue.criminal]
    " - dat+="Description: [news_network.wanted_issue.body]
    " + dat+="-- STATIONWIDE WANTED ISSUE --
    \[Submitted by: [GLOB.news_network.wanted_issue.scannedUser]\]
    " + dat+="Criminal: [GLOB.news_network.wanted_issue.criminal]
    " + dat+="Description: [GLOB.news_network.wanted_issue.body]
    " dat+="Photo:: " - if(news_network.wanted_issue.img) - usr << browse_rsc(news_network.wanted_issue.img, "tmp_photow.png") + if(GLOB.news_network.wanted_issue.img) + usr << browse_rsc(GLOB.news_network.wanted_issue.img, "tmp_photow.png") dat+="
    " else dat+="None" @@ -389,7 +387,7 @@ var/global/BSACooldown = 0
    Game Panel

    \n Change Game Mode
    "} - if(master_mode == "secret") + if(GLOB.master_mode == "secret") dat += "(Force Secret Mode)
    " dat += {" @@ -461,20 +459,20 @@ var/global/BSACooldown = 0 if(!check_rights(0)) return - var/new_admin_notice = input(src,"Set a public notice for this round. Everyone who joins the server will see it.\n(Leaving it blank will delete the current notice):","Set Notice",admin_notice) as message|null + var/new_admin_notice = input(src,"Set a public notice for this round. Everyone who joins the server will see it.\n(Leaving it blank will delete the current notice):","Set Notice",GLOB.admin_notice) as message|null if(new_admin_notice == null) return - if(new_admin_notice == admin_notice) + if(new_admin_notice == GLOB.admin_notice) return if(new_admin_notice == "") message_admins("[key_name(usr)] removed the admin notice.") - log_admin("[key_name(usr)] removed the admin notice:\n[admin_notice]") + log_admin("[key_name(usr)] removed the admin notice:\n[GLOB.admin_notice]") else message_admins("[key_name(usr)] set the admin notice.") log_admin("[key_name(usr)] set the admin notice:\n[new_admin_notice]") to_chat(world, "Admin Notice:\n \t [new_admin_notice]") feedback_add_details("admin_verb","SAN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - admin_notice = new_admin_notice + GLOB.admin_notice = new_admin_notice return /datum/admins/proc/toggleooc() @@ -490,7 +488,7 @@ var/global/BSACooldown = 0 set category = "Server" set desc="Toggle dis bitch" set name="Toggle Dead OOC" - dooc_allowed = !( dooc_allowed ) + GLOB.dooc_allowed = !( GLOB.dooc_allowed ) log_admin("[key_name(usr)] toggled OOC.") message_admins("[key_name_admin(usr)] toggled Dead OOC.") @@ -529,8 +527,8 @@ var/global/BSACooldown = 0 set category = "Server" set desc="People can't enter" set name="Toggle Entering" - enter_allowed = !( enter_allowed ) - if (!( enter_allowed )) + GLOB.enter_allowed = !( GLOB.enter_allowed ) + if (!( GLOB.enter_allowed )) to_chat(world, "New players may no longer enter the game.") else to_chat(world, "New players may now enter the game.") @@ -556,13 +554,13 @@ var/global/BSACooldown = 0 set category = "Server" set desc="Respawn basically" set name="Toggle Respawn" - abandon_allowed = !( abandon_allowed ) - if (abandon_allowed) + GLOB.abandon_allowed = !( GLOB.abandon_allowed ) + if (GLOB.abandon_allowed) to_chat(world, "You may now respawn.") else to_chat(world, "You may no longer respawn :(") - message_admins("[key_name_admin(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].") - log_admin("[key_name(usr)] toggled respawn to [abandon_allowed ? "On" : "Off"].") + message_admins("[key_name_admin(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].") + log_admin("[key_name(usr)] toggled respawn to [GLOB.abandon_allowed ? "On" : "Off"].") world.update_status() feedback_add_details("admin_verb","TR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -585,11 +583,11 @@ var/global/BSACooldown = 0 log_admin("[key_name(usr)] set the pre-game delay to [newtime] seconds.") feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/unprison(mob/M in mob_list) +/datum/admins/proc/unprison(mob/M in GLOB.mob_list) set category = "Admin" set name = "Unprison" if (M.z == ZLEVEL_CENTCOM) - M.loc = pick(latejoin) + M.loc = pick(GLOB.latejoin) message_admins("[key_name_admin(usr)] has unprisoned [key_name_admin(M)]") log_admin("[key_name(usr)] has unprisoned [key_name(M)]") else @@ -638,7 +636,7 @@ var/global/BSACooldown = 0 feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/datum/admins/proc/show_traitor_panel(mob/M in mob_list) +/datum/admins/proc/show_traitor_panel(mob/M in GLOB.mob_list) set category = "Admin" set desc = "Edit mobs's memory and role" set name = "Show Traitor Panel" @@ -658,8 +656,8 @@ var/global/BSACooldown = 0 set category = "Debug" set desc="Reduces view range when wearing welding helmets" set name="Toggle tinted welding helmes" - tinted_weldhelh = !( tinted_weldhelh ) - if (tinted_weldhelh) + GLOB.tinted_weldhelh = !( GLOB.tinted_weldhelh ) + if (GLOB.tinted_weldhelh) to_chat(world, "The tinted_weldhelh has been enabled!") else to_chat(world, "The tinted_weldhelh has been disabled!") @@ -671,18 +669,18 @@ var/global/BSACooldown = 0 set category = "Server" set desc="Guests can't enter" set name="Toggle guests" - guests_allowed = !( guests_allowed ) - if (!( guests_allowed )) + GLOB.guests_allowed = !( GLOB.guests_allowed ) + if (!( GLOB.guests_allowed )) to_chat(world, "Guests may no longer enter the game.") else to_chat(world, "Guests may now enter the game.") - log_admin("[key_name(usr)] toggled guests game entering [guests_allowed?"":"dis"]allowed.") - message_admins("[key_name_admin(usr)] toggled guests game entering [guests_allowed?"":"dis"]allowed.") + log_admin("[key_name(usr)] toggled guests game entering [GLOB.guests_allowed?"":"dis"]allowed.") + message_admins("[key_name_admin(usr)] toggled guests game entering [GLOB.guests_allowed?"":"dis"]allowed.") feedback_add_details("admin_verb","TGU") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /datum/admins/proc/output_ai_laws() var/ai_number = 0 - for(var/mob/living/silicon/S in mob_list) + for(var/mob/living/silicon/S in GLOB.mob_list) ai_number++ if(isAI(S)) to_chat(usr, "AI [key_name(S, usr)]'s laws:") @@ -770,7 +768,7 @@ var/global/BSACooldown = 0 //returns a list of ckeys of the kicked clients /proc/kick_clients_in_lobby(message, kick_only_afk = 0) var/list/kicked_client_names = list() - for(var/client/C in clients) + for(var/client/C in GLOB.clients) if(isnewplayer(C.mob)) if(kick_only_afk && !C.is_afk()) //Ignore clients who are not afk continue diff --git a/code/modules/admin/admin_investigate.dm b/code/modules/admin/admin_investigate.dm index 6733005760f18..f1951a2c71ad8 100644 --- a/code/modules/admin/admin_investigate.dm +++ b/code/modules/admin/admin_investigate.dm @@ -38,8 +38,8 @@ return src << browse(F,"window=investigate[subject];size=800x300") if("hrefs") //persistent logs and stuff - if(href_logfile) - src << browse(href_logfile,"window=investigate[subject];size=800x300") + if(GLOB.href_logfile) + src << browse(GLOB.href_logfile,"window=investigate[subject];size=800x300") else if(!config.log_hrefs) to_chat(src, "Href logging is off and no logfile was found.") return diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm index dbcbb04916a56..2f8e94636ca88 100644 --- a/code/modules/admin/admin_ranks.dm +++ b/code/modules/admin/admin_ranks.dm @@ -1,4 +1,5 @@ -var/list/admin_ranks = list() //list of all admin_rank datums +GLOBAL_LIST_EMPTY(admin_ranks) //list of all admin_rank datums +GLOBAL_PROTECT(admin_ranks) /datum/admin_rank var/name = "NoRank" @@ -99,7 +100,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums //load our rank - > rights associations /proc/load_admin_ranks() - admin_ranks.Cut() + GLOB.admin_ranks.Cut() if(config.admin_legacy_system) var/previous_rights = 0 @@ -114,7 +115,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/datum/admin_rank/R = new(ckeyEx(copytext(line, 1, next))) if(!R) continue - admin_ranks += R + GLOB.admin_ranks += R var/prev = findchar(line, "+-", next, 0) while(prev) @@ -124,14 +125,14 @@ var/list/admin_ranks = list() //list of all admin_rank datums previous_rights = R.rights else - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) log_world("Failed to connect to database in load_admin_ranks(). Reverting to legacy system.") - diary << "Failed to connect to database in load_admin_ranks(). Reverting to legacy system." + GLOB.diary << "Failed to connect to database in load_admin_ranks(). Reverting to legacy system." config.admin_legacy_system = 1 load_admin_ranks() return - var/DBQuery/query_load_admin_ranks = dbcon.NewQuery("SELECT rank, flags FROM [format_table_name("admin_ranks")]") + var/DBQuery/query_load_admin_ranks = GLOB.dbcon.NewQuery("SELECT rank, flags FROM [format_table_name("admin_ranks")]") if(!query_load_admin_ranks.Execute()) return while(query_load_admin_ranks.NextRow()) @@ -142,11 +143,11 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/datum/admin_rank/R = new(rank_name, flags) if(!R) continue - admin_ranks += R + GLOB.admin_ranks += R #ifdef TESTING var/msg = "Permission Sets Built:\n" - for(var/datum/admin_rank/R in admin_ranks) + for(var/datum/admin_rank/R in GLOB.admin_ranks) msg += "\t[R.name]" var/rights = rights2text(R.rights,"\n\t\t",R.adds,R.subs) if(rights) @@ -158,18 +159,18 @@ var/list/admin_ranks = list() //list of all admin_rank datums /proc/load_admins(target = null) //clear the datums references if(!target) - admin_datums.Cut() - for(var/client/C in admins) + GLOB.admin_datums.Cut() + for(var/client/C in GLOB.admins) C.remove_admin_verbs() C.holder = null - admins.Cut() + GLOB.admins.Cut() load_admin_ranks() //Clear profile access for(var/A in world.GetConfig("admin")) world.SetConfig("APP/admin", A, null) var/list/rank_names = list() - for(var/datum/admin_rank/R in admin_ranks) + for(var/datum/admin_rank/R in GLOB.admin_ranks) rank_names[R.name] = R if(config.admin_legacy_system) @@ -197,16 +198,16 @@ var/list/admin_ranks = list() //list of all admin_rank datums continue //will occur if an invalid rank is provided if(D.rank.rights & R_DEBUG) //grant profile access world.SetConfig("APP/admin", ckey, "role=admin") - D.associate(directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum + D.associate(GLOB.directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum else - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) log_world("Failed to connect to database in load_admins(). Reverting to legacy system.") - diary << "Failed to connect to database in load_admins(). Reverting to legacy system." + GLOB.diary << "Failed to connect to database in load_admins(). Reverting to legacy system." config.admin_legacy_system = 1 load_admins() return - var/DBQuery/query_load_admins = dbcon.NewQuery("SELECT ckey, rank FROM [format_table_name("admin")]") + var/DBQuery/query_load_admins = GLOB.dbcon.NewQuery("SELECT ckey, rank FROM [format_table_name("admin")]") if(!query_load_admins.Execute()) return while(query_load_admins.NextRow()) @@ -224,19 +225,19 @@ var/list/admin_ranks = list() //list of all admin_rank datums continue //will occur if an invalid rank is provided if(D.rank.rights & R_DEBUG) //grant profile access world.SetConfig("APP/admin", ckey, "role=admin") - D.associate(directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum + D.associate(GLOB.directory[ckey]) //find the client for a ckey if they are connected and associate them with the new admin datum #ifdef TESTING var/msg = "Admins Built:\n" - for(var/ckey in admin_datums) - var/datum/admins/D = admin_datums[ckey] + for(var/ckey in GLOB.admin_datums) + var/datum/admins/D = GLOB.admin_datums[ckey] msg += "\t[ckey] - [D.rank.name]\n" testing(msg) #endif #ifdef TESTING -/client/verb/changerank(newrank in admin_ranks) +/client/verb/changerank(newrank in GLOB.admin_ranks) if(holder) holder.rank = newrank else @@ -266,7 +267,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/new_ckey = ckey(input(usr,"New admin's ckey","Admin ckey", null) as text|null) if(!new_ckey) return - if(new_ckey in admin_datums) + if(new_ckey in GLOB.admin_datums) to_chat(usr, "Error: Topic 'editrights': [new_ckey] is already an admin") return adm_ckey = new_ckey @@ -277,7 +278,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums to_chat(usr, "Error: Topic 'editrights': No valid ckey") return - var/datum/admins/D = admin_datums[adm_ckey] + var/datum/admins/D = GLOB.admin_datums[adm_ckey] switch(task) if("remove") @@ -288,7 +289,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums message_admins("[key_name_admin(usr)] attempted to remove [adm_ckey] from the admins list without sufficient rights.") log_admin("[key_name(usr)] attempted to remove [adm_ckey] from the admins list without sufficient rights.") return - admin_datums -= adm_ckey + GLOB.admin_datums -= adm_ckey D.disassociate() updateranktodb(adm_ckey, "player") @@ -300,7 +301,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums var/datum/admin_rank/R var/list/rank_names = list("*New Rank*") - for(R in admin_ranks) + for(R in GLOB.admin_ranks) rank_names[R.name] = R var/new_rank = input("Please select a rank", "New rank", null, null) as null|anything in rank_names @@ -325,7 +326,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums R = new(new_rank, D.rank.rights, D.rank.adds, D.rank.subs) //duplicate our previous admin_rank but with a new name else R = new(new_rank) //blank new admin_rank - admin_ranks += R + GLOB.admin_ranks += R if(D) //they were previously an admin D.disassociate() //existing admin needs to be disassociated @@ -333,7 +334,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums else D = new(R,adm_ckey) //new admin - var/client/C = directory[adm_ckey] //find the client with the specified ckey (if they are logged in) + var/client/C = GLOB.directory[adm_ckey] //find the client with the specified ckey (if they are logged in) D.associate(C) //link up with the client and add verbs updateranktodb(adm_ckey, new_rank) @@ -362,7 +363,7 @@ var/list/admin_ranks = list() //list of all admin_rank datums D.rank.process_keyword(keyword) - var/client/C = directory[adm_ckey] //find the client with the specified ckey (if they are logged in) + var/client/C = GLOB.directory[adm_ckey] //find the client with the specified ckey (if they are logged in) D.associate(C) //link up with the client and add verbs message_admins("[key_name(usr)] added keyword [keyword] to permission of [adm_ckey]") @@ -372,10 +373,10 @@ var/list/admin_ranks = list() //list of all admin_rank datums edit_admin_permissions() /datum/admins/proc/updateranktodb(ckey,newrank) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) return var/sql_ckey = sanitizeSQL(ckey) var/sql_admin_rank = sanitizeSQL(newrank) - var/DBQuery/query_admin_rank_update = dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'") + var/DBQuery/query_admin_rank_update = GLOB.dbcon.NewQuery("UPDATE [format_table_name("player")] SET lastadminrank = '[sql_admin_rank]' WHERE ckey = '[sql_ckey]'") query_admin_rank_update.Execute() diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 0374b2ecde137..da7bf7aa9a728 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,5 +1,8 @@ //admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless -var/list/admin_verbs_default = list( +GLOBAL_PROTECT(admin_verbs_default) +GLOBAL_LIST_INIT(admin_verbs_default, AVerbsDefault()) +/proc/AVerbsDefault() + return list( /client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/ /client/proc/toggleannouncelogin, /*toggles if an admin's login is announced during a round*/ /client/proc/deadmin, /*destroys our own admin datum so we can play as a regular player*/ @@ -20,7 +23,10 @@ var/list/admin_verbs_default = list( /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ /client/proc/stop_sounds ) -var/list/admin_verbs_admin = list( +GLOBAL_PROTECT(admin_verbs_admin) +GLOBAL_LIST_INIT(admin_verbs_admin, AVerbsAdmin()) +/proc/AVerbsAdmin() + return list( /client/proc/player_panel_new, /*shows an interface for all players, with links to various panels*/ /client/proc/invisimin, /*allows our mob to go invisible/visible*/ // /datum/admins/proc/show_traitor_panel, /*interface which shows a mob's mind*/ -Removed due to rare practical use. Moved to debug verbs ~Errorage @@ -66,17 +72,14 @@ var/list/admin_verbs_admin = list( /client/proc/resetSNPC, /* Resets any interactive crewmembers in the world */ /client/proc/open_shuttle_manipulator /* Opens shuttle manipulator UI */ ) -var/list/admin_verbs_ban = list( - /client/proc/unban_panel, - /client/proc/DB_ban_panel, - /client/proc/stickybanpanel - ) -var/list/admin_verbs_sounds = list( - /client/proc/play_local_sound, - /client/proc/play_sound, - /client/proc/set_round_end_sound, - ) -var/list/admin_verbs_fun = list( +GLOBAL_PROTECT(admin_verbs_ban) +GLOBAL_LIST_INIT(admin_verbs_ban, list(/client/proc/unban_panel,/client/proc/DB_ban_panel,/client/proc/stickybanpanel)) +GLOBAL_PROTECT(admin_verbs_sounds) +GLOBAL_LIST_INIT(admin_verbs_sounds, list(/client/proc/play_local_sound,/client/proc/play_sound,/client/proc/set_round_end_sound)) +GLOBAL_PROTECT(admin_verbs_fun) +GLOBAL_LIST_INIT(admin_verbs_fun, AVerbsFun()) +/proc/AVerbsFun() + return list( /client/proc/cmd_admin_dress, /client/proc/cmd_admin_gib_self, /client/proc/drop_bomb, @@ -99,11 +102,12 @@ var/list/admin_verbs_fun = list( /client/proc/show_tip, /client/proc/smite ) -var/list/admin_verbs_spawn = list( - /datum/admins/proc/spawn_atom, /*allows us to spawn instances*/ - /client/proc/respawn_character - ) -var/list/admin_verbs_server = list( +GLOBAL_PROTECT(admin_verbs_spawn) +GLOBAL_LIST_INIT(admin_verbs_spawn, list(/datum/admins/proc/spawn_atom,/client/proc/respawn_character)) +GLOBAL_PROTECT(admin_verbs_server) +GLOBAL_LIST_INIT(admin_verbs_server, AVerbsServer()) +/proc/AVerbsServer() + return list( /datum/admins/proc/startnow, /datum/admins/proc/restart, /datum/admins/proc/end_round, @@ -119,9 +123,11 @@ var/list/admin_verbs_server = list( /client/proc/adminchangemap, /client/proc/panicbunker, /client/proc/toggle_hub - ) -var/list/admin_verbs_debug = list( +GLOBAL_PROTECT(admin_verbs_debug) +GLOBAL_LIST_INIT(admin_verbs_debug, AVerbsDebug()) +/proc/AVerbsDebug() + return list( /client/proc/restart_controller, /client/proc/cmd_admin_list_open_jobs, /client/proc/Debug2, @@ -155,20 +161,18 @@ var/list/admin_verbs_debug = list( /client/proc/view_runtimes, /client/proc/pump_random_event ) -var/list/admin_verbs_possess = list( - /proc/possess, - /proc/release - ) -var/list/admin_verbs_permissions = list( - /client/proc/edit_admin_permissions, - /client/proc/create_poll - ) -var/list/admin_verbs_rejuv = list( - /client/proc/respawn_character - ) +GLOBAL_PROTECT(admin_verbs_possess) +GLOBAL_LIST_INIT(admin_verbs_possess, list(/proc/possess,/proc/release)) +GLOBAL_PROTECT(admin_verbs_permissions) +GLOBAL_LIST_INIT(admin_verbs_permissions, list(/client/proc/edit_admin_permissions,/client/proc/create_poll)) +GLOBAL_PROTECT(admin_verbs_rejuv) +GLOBAL_LIST_INIT(admin_verbs_rejuv, list(/client/proc/respawn_character)) //verbs which can be hidden - needs work -var/list/admin_verbs_hideable = list( +GLOBAL_PROTECT(admin_verbs_hideable) +GLOBAL_LIST_INIT(admin_verbs_hideable, AVerbsHideable()) +/proc/AVerbsHideable() + return list( /client/proc/set_ooc, /client/proc/reset_ooc, /client/proc/deadmin, @@ -245,31 +249,31 @@ var/list/admin_verbs_hideable = list( control_freak = CONTROL_FREAK_SKIN | CONTROL_FREAK_MACROS var/rights = holder.rank.rights - verbs += admin_verbs_default + verbs += GLOB.admin_verbs_default if(rights & R_BUILDMODE) verbs += /client/proc/togglebuildmodeself if(rights & R_ADMIN) - verbs += admin_verbs_admin + verbs += GLOB.admin_verbs_admin if(rights & R_BAN) - verbs += admin_verbs_ban + verbs += GLOB.admin_verbs_ban if(rights & R_FUN) - verbs += admin_verbs_fun + verbs += GLOB.admin_verbs_fun if(rights & R_SERVER) - verbs += admin_verbs_server + verbs += GLOB.admin_verbs_server if(rights & R_DEBUG) - verbs += admin_verbs_debug + verbs += GLOB.admin_verbs_debug if(rights & R_POSSESS) - verbs += admin_verbs_possess + verbs += GLOB.admin_verbs_possess if(rights & R_PERMISSIONS) - verbs += admin_verbs_permissions + verbs += GLOB.admin_verbs_permissions if(rights & R_STEALTH) verbs += /client/proc/stealth if(rights & R_REJUVINATE) - verbs += admin_verbs_rejuv + verbs += GLOB.admin_verbs_rejuv if(rights & R_SOUNDS) - verbs += admin_verbs_sounds + verbs += GLOB.admin_verbs_sounds if(rights & R_SPAWN) - verbs += admin_verbs_spawn + verbs += GLOB.admin_verbs_spawn for(var/path in holder.rank.adds) verbs += path @@ -278,19 +282,19 @@ var/list/admin_verbs_hideable = list( /client/proc/remove_admin_verbs() verbs.Remove( - admin_verbs_default, + GLOB.admin_verbs_default, /client/proc/togglebuildmodeself, - admin_verbs_admin, - admin_verbs_ban, - admin_verbs_fun, - admin_verbs_server, - admin_verbs_debug, - admin_verbs_possess, - admin_verbs_permissions, + GLOB.admin_verbs_admin, + GLOB.admin_verbs_ban, + GLOB.admin_verbs_fun, + GLOB.admin_verbs_server, + GLOB.admin_verbs_debug, + GLOB.admin_verbs_possess, + GLOB.admin_verbs_permissions, /client/proc/stealth, - admin_verbs_rejuv, - admin_verbs_sounds, - admin_verbs_spawn, + GLOB.admin_verbs_rejuv, + GLOB.admin_verbs_sounds, + GLOB.admin_verbs_spawn, /*Debug verbs added by "show debug verbs"*/ /client/proc/Cell, /client/proc/do_not_use_these, @@ -316,7 +320,7 @@ var/list/admin_verbs_hideable = list( set name = "Adminverbs - Hide Most" set category = "Admin" - verbs.Remove(/client/proc/hide_most_verbs, admin_verbs_hideable) + verbs.Remove(/client/proc/hide_most_verbs, GLOB.admin_verbs_hideable) verbs += /client/proc/show_verbs to_chat(src, "Most of your adminverbs have been hidden.") @@ -437,10 +441,10 @@ var/list/admin_verbs_hideable = list( /client/proc/findStealthKey(txt) if(txt) - for(var/P in stealthminID) - if(stealthminID[P] == txt) + for(var/P in GLOB.stealthminID) + if(GLOB.stealthminID[P] == txt) return P - txt = stealthminID[ckey] + txt = GLOB.stealthminID[ckey] return txt /client/proc/createStealthKey() @@ -448,11 +452,11 @@ var/list/admin_verbs_hideable = list( var/i = 0 while(i == 0) i = 1 - for(var/P in stealthminID) - if(num == stealthminID[P]) + for(var/P in GLOB.stealthminID) + if(num == GLOB.stealthminID[P]) num++ i = 0 - stealthminID["[ckey]"] = "@[num2text(num)]" + GLOB.stealthminID["[ckey]"] = "@[num2text(num)]" /client/proc/stealth() set category = "Admin" @@ -501,7 +505,7 @@ var/list/admin_verbs_hideable = list( if("Big Bomb (3, 5, 7, 5)") explosion(epicenter, 3, 5, 7, 5, TRUE, TRUE) if("Maxcap") - explosion(epicenter, MAX_EX_DEVESTATION_RANGE, MAX_EX_HEAVY_RANGE, MAX_EX_LIGHT_RANGE, MAX_EX_FLASH_RANGE) + explosion(epicenter, GLOB.MAX_EX_DEVESTATION_RANGE, GLOB.MAX_EX_HEAVY_RANGE, GLOB.MAX_EX_LIGHT_RANGE, GLOB.MAX_EX_FLASH_RANGE) if("Custom Bomb") var/devastation_range = input("Devastation range (in tiles):") as null|num if(devastation_range == null) @@ -515,7 +519,7 @@ var/list/admin_verbs_hideable = list( var/flash_range = input("Flash range (in tiles):") as null|num if(flash_range == null) return - if(devastation_range > MAX_EX_DEVESTATION_RANGE || heavy_impact_range > MAX_EX_HEAVY_RANGE || light_impact_range > MAX_EX_LIGHT_RANGE || flash_range > MAX_EX_FLASH_RANGE) + if(devastation_range > GLOB.MAX_EX_DEVESTATION_RANGE || heavy_impact_range > GLOB.MAX_EX_HEAVY_RANGE || light_impact_range > GLOB.MAX_EX_LIGHT_RANGE || flash_range > GLOB.MAX_EX_FLASH_RANGE) if(alert("Bomb is bigger than the maxcap. Continue?",,"Yes","No") != "Yes") return epicenter = mob.loc //We need to reupdate as they may have moved again @@ -543,7 +547,7 @@ var/list/admin_verbs_hideable = list( set desc = "Get the estimated range of a bomb, using explosive power." var/ex_power = input("Explosive Power:") as null|num - var/range = round((2 * ex_power)**DYN_EX_SCALE) + var/range = round((2 * ex_power)**GLOB.DYN_EX_SCALE) to_chat(usr, "Estimated Explosive Range: (Devestation: [round(range*0.25)], Heavy: [round(range*0.5)], Light: [round(range)])") /client/proc/get_dynex_power() @@ -552,7 +556,7 @@ var/list/admin_verbs_hideable = list( set desc = "Get the estimated required power of a bomb, to reach a specific range." var/ex_range = input("Light Explosion Range:") as null|num - var/power = (0.5 * ex_range)**(1/DYN_EX_SCALE) + var/power = (0.5 * ex_range)**(1/GLOB.DYN_EX_SCALE) to_chat(usr, "Estimated Explosive Power: [power]") /client/proc/set_dynex_scale() @@ -563,18 +567,18 @@ var/list/admin_verbs_hideable = list( var/ex_scale = input("New DynEx Scale:") as null|num if(!ex_scale) return - DYN_EX_SCALE = ex_scale + GLOB.DYN_EX_SCALE = ex_scale log_admin("[key_name(usr)] has modified Dynamic Explosion Scale: [ex_scale]") message_admins("[key_name_admin(usr)] has modified Dynamic Explosion Scale: [ex_scale]") -/client/proc/give_spell(mob/T in mob_list) +/client/proc/give_spell(mob/T in GLOB.mob_list) set category = "Fun" set name = "Give Spell" set desc = "Gives a spell to a mob." var/list/spell_list = list() var/type_length = length("/obj/effect/proc_holder/spell") + 2 - for(var/A in spells) + for(var/A in GLOB.spells) spell_list[copytext("[A]", type_length)] = A var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list if(!S) @@ -591,7 +595,7 @@ var/list/admin_verbs_hideable = list( T.AddSpell(new S) message_admins("Spells given to mindless mobs will not be transferred in mindswap or cloning!") -/client/proc/remove_spell(mob/T in mob_list) +/client/proc/remove_spell(mob/T in GLOB.mob_list) set category = "Fun" set name = "Remove Spell" set desc = "Remove a spell from the selected mob." @@ -604,11 +608,11 @@ var/list/admin_verbs_hideable = list( message_admins("[key_name_admin(usr)] removed the spell [S] from [key_name(T)].") feedback_add_details("admin_verb","RS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/give_disease(mob/T in mob_list) +/client/proc/give_disease(mob/T in GLOB.mob_list) set category = "Fun" set name = "Give Disease" set desc = "Gives a Disease to a mob." - var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in diseases + var/datum/disease/D = input("Choose the disease to give to that guy", "ACHOO") as null|anything in SSdisease.diseases if(!D) return T.ForceContractDisease(new D) feedback_add_details("admin_verb","GD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -666,8 +670,8 @@ var/list/admin_verbs_hideable = list( holder.disassociate() qdel(holder) - deadmins += ckey - admin_datums -= ckey + GLOB.deadmins += ckey + GLOB.admin_datums -= ckey verbs += /client/proc/readmin to_chat(src, "You are now a normal player.") @@ -685,7 +689,7 @@ var/list/admin_verbs_hideable = list( if(!holder) // Something went wrong... return - deadmins -= ckey + GLOB.deadmins -= ckey verbs -= /client/proc/readmin to_chat(src, "You are now an admin.") @@ -708,7 +712,7 @@ var/list/admin_verbs_hideable = list( j = 100 do - area = pick(the_station_areas) + area = pick(GLOB.the_station_areas) if (area) diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index ea4a657f2d212..cbbe62ce19f59 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -4,7 +4,7 @@ return 0 if(!M.client) //no cache. fallback to a DBQuery - var/DBQuery/query_jobban_check_ban = dbcon.NewQuery("SELECT reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(M.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[sanitizeSQL(rank)]'") + var/DBQuery/query_jobban_check_ban = GLOB.dbcon.NewQuery("SELECT reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(M.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[sanitizeSQL(rank)]'") if(!query_jobban_check_ban.warn_execute()) return if(query_jobban_check_ban.NextRow()) @@ -24,7 +24,7 @@ /proc/jobban_buildcache(client/C) if(C && istype(C)) C.jobbancache = list() - var/DBQuery/query_jobban_build_cache = dbcon.NewQuery("SELECT job, reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(C.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") + var/DBQuery/query_jobban_build_cache = GLOB.dbcon.NewQuery("SELECT job, reason FROM [format_table_name("ban")] WHERE ckey = '[sanitizeSQL(C.ckey)]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)") if(!query_jobban_build_cache.warn_execute()) return while(query_jobban_build_cache.NextRow()) diff --git a/code/modules/admin/create_mob.dm b/code/modules/admin/create_mob.dm index 8edcfbedb7ecd..97137c7d1912f 100644 --- a/code/modules/admin/create_mob.dm +++ b/code/modules/admin/create_mob.dm @@ -1,5 +1,6 @@ -/var/create_mob_html = null + /datum/admins/proc/create_mob(mob/user) + var/static/create_mob_html if (!create_mob_html) var/mobjs = null mobjs = jointext(typesof(/mob), ";") diff --git a/code/modules/admin/create_object.dm b/code/modules/admin/create_object.dm index 708b6a9e74b17..fcf6db8d98e8a 100644 --- a/code/modules/admin/create_object.dm +++ b/code/modules/admin/create_object.dm @@ -1,10 +1,5 @@ -var/create_object_html = null -var/list/create_object_forms = list( - /obj, /obj/structure, /obj/machinery, /obj/effect, - /obj/item, /obj/item/clothing, /obj/item/stack, /obj/item/device, - /obj/item/weapon, /obj/item/weapon/reagent_containers, /obj/item/weapon/gun) - /datum/admins/proc/create_object(mob/user) + var/static/create_object_html = null if (!create_object_html) var/objectjs = null objectjs = jointext(typesof(/obj), ";") @@ -13,8 +8,12 @@ var/list/create_object_forms = list( user << browse(replacetext(create_object_html, "/* ref src */", "\ref[src]"), "window=create_object;size=425x475") - /datum/admins/proc/quick_create_object(mob/user) + var/static/list/create_object_forms = list( + /obj, /obj/structure, /obj/machinery, /obj/effect, + /obj/item, /obj/item/clothing, /obj/item/stack, /obj/item/device, + /obj/item/weapon, /obj/item/weapon/reagent_containers, /obj/item/weapon/gun) + var/path = input("Select the path of the object you wish to create.", "Path", /obj) in create_object_forms var/html_form = create_object_forms[path] diff --git a/code/modules/admin/create_poll.dm b/code/modules/admin/create_poll.dm index 8f71cb20df086..325e68e347e0d 100644 --- a/code/modules/admin/create_poll.dm +++ b/code/modules/admin/create_poll.dm @@ -3,16 +3,16 @@ set category = "Special Verbs" if(!check_rights(R_PERMISSIONS)) return - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(src, "Failed to establish database connection.") return var/returned = create_poll_function() if(returned) - var/DBQuery/query_check_option = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [returned]") + var/DBQuery/query_check_option = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [returned]") if(!query_check_option.warn_execute()) return if(query_check_option.NextRow()) - var/DBQuery/query_log_get = dbcon.NewQuery("SELECT polltype, question, adminonly FROM [format_table_name("poll_question")] WHERE id = [returned]") + var/DBQuery/query_log_get = GLOB.dbcon.NewQuery("SELECT polltype, question, adminonly FROM [format_table_name("poll_question")] WHERE id = [returned]") if(!query_log_get.warn_execute()) return if(query_log_get.NextRow()) @@ -23,7 +23,7 @@ message_admins("[key_name_admin(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"]
    Question: [question]") else to_chat(src, "Poll question created without any options, poll will be deleted.") - var/DBQuery/query_del_poll = dbcon.NewQuery("DELETE FROM [format_table_name("poll_question")] WHERE id = [returned]") + var/DBQuery/query_del_poll = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("poll_question")] WHERE id = [returned]") if(!query_del_poll.warn_execute()) return @@ -51,7 +51,7 @@ if(!endtime) return endtime = sanitizeSQL(endtime) - var/DBQuery/query_validate_time = dbcon.NewQuery("SELECT STR_TO_DATE('[endtime]','%Y-%c-%d %T')") + var/DBQuery/query_validate_time = GLOB.dbcon.NewQuery("SELECT STR_TO_DATE('[endtime]','%Y-%c-%d %T')") if(!query_validate_time.warn_execute()) return if(query_validate_time.NextRow()) @@ -59,7 +59,7 @@ if(!endtime) to_chat(src, "Datetime entered is invalid.") return - var/DBQuery/query_time_later = dbcon.NewQuery("SELECT TIMESTAMP('[endtime]') < NOW()") + var/DBQuery/query_time_later = GLOB.dbcon.NewQuery("SELECT TIMESTAMP('[endtime]') < NOW()") if(!query_time_later.warn_execute()) return if(query_time_later.NextRow()) @@ -88,7 +88,7 @@ if(!question) return question = sanitizeSQL(question) - var/DBQuery/query_polladd_question = dbcon.NewQuery("INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, dontshow) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', INET_ATON('[address]'), '[dontshow]')") + var/DBQuery/query_polladd_question = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_question")] (polltype, starttime, endtime, question, adminonly, multiplechoiceoptions, createdby_ckey, createdby_ip, dontshow) VALUES ('[polltype]', '[starttime]', '[endtime]', '[question]', '[adminonly]', '[choice_amount]', '[sql_ckey]', INET_ATON('[address]'), '[dontshow]')") if(!query_polladd_question.warn_execute()) return if(polltype == POLLTYPE_TEXT) @@ -96,7 +96,7 @@ message_admins("[key_name_admin(usr)] has created a new server poll. Poll type: [polltype] - Admin Only: [adminonly ? "Yes" : "No"]
    Question: [question]") return var/pollid = 0 - var/DBQuery/query_get_id = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = INET_ATON('[address]')") + var/DBQuery/query_get_id = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE question = '[question]' AND starttime = '[starttime]' AND endtime = '[endtime]' AND createdby_ckey = '[sql_ckey]' AND createdby_ip = INET_ATON('[address]')") if(!query_get_id.warn_execute()) return if(query_get_id.NextRow()) @@ -146,7 +146,7 @@ descmax = sanitizeSQL(descmax) else if(descmax == null) return pollid - var/DBQuery/query_polladd_option = dbcon.NewQuery("INSERT INTO [format_table_name("poll_option")] (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('[pollid]', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')") + var/DBQuery/query_polladd_option = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_option")] (pollid, text, percentagecalc, minval, maxval, descmin, descmid, descmax) VALUES ('[pollid]', '[option]', '[percentagecalc]', '[minval]', '[maxval]', '[descmin]', '[descmid]', '[descmax]')") if(!query_polladd_option.warn_execute()) return pollid switch(alert(" ",,"Add option","Finish", "Cancel")) diff --git a/code/modules/admin/create_turf.dm b/code/modules/admin/create_turf.dm index 4bfa6a0a09da3..3ff6b010dd9af 100644 --- a/code/modules/admin/create_turf.dm +++ b/code/modules/admin/create_turf.dm @@ -1,5 +1,5 @@ -/var/create_turf_html = null /datum/admins/proc/create_turf(mob/user) + var/static/create_turf_html if (!create_turf_html) var/turfjs = null turfjs = jointext(typesof(/turf), ";") diff --git a/code/modules/admin/fun_balloon.dm b/code/modules/admin/fun_balloon.dm index 5ca3e50c57ac5..b886232e0055c 100644 --- a/code/modules/admin/fun_balloon.dm +++ b/code/modules/admin/fun_balloon.dm @@ -159,7 +159,7 @@ /obj/effect/forcefield/arena_shuttle_entrance/Bumped(mob/M as mob|obj) if(!warp_points.len) - for(var/obj/effect/landmark/shuttle_arena_entrance/S in landmarks_list) + for(var/obj/effect/landmark/shuttle_arena_entrance/S in GLOB.landmarks_list) warp_points |= S if(!isliving(M)) return diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 33a0f4bc323cb..6111c839be7a9 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -1,4 +1,5 @@ -var/list/admin_datums = list() +GLOBAL_LIST_EMPTY(admin_datums) +GLOBAL_PROTECT(admin_datums) /datum/admins var/datum/admin_rank/rank @@ -27,7 +28,7 @@ var/list/admin_datums = list() return rank = R admin_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]" - admin_datums[ckey] = src + GLOB.admin_datums[ckey] = src /datum/admins/proc/associate(client/C) if(istype(C)) @@ -35,11 +36,11 @@ var/list/admin_datums = list() owner.holder = src owner.add_admin_verbs() //TODO owner.verbs -= /client/proc/readmin - admins |= C + GLOB.admins |= C /datum/admins/proc/disassociate() if(owner) - admins -= owner + GLOB.admins -= owner owner.remove_admin_verbs() owner.holder = null owner = null diff --git a/code/modules/admin/ipintel.dm b/code/modules/admin/ipintel.dm index d4e354db09b66..7d61e69624664 100644 --- a/code/modules/admin/ipintel.dm +++ b/code/modules/admin/ipintel.dm @@ -33,8 +33,8 @@ cachedintel.cache = TRUE return cachedintel - if(dbcon.Connect()) - var/DBQuery/query_get_ip_intel = dbcon.NewQuery({" + if(GLOB.dbcon.Connect()) + var/DBQuery/query_get_ip_intel = GLOB.dbcon.NewQuery({" SELECT date, intel, TIMESTAMPDIFF(MINUTE,date,NOW()) FROM [format_table_name("ipintel")] WHERE @@ -62,8 +62,8 @@ res.intel = ip_intel_query(ip) if (updatecache && res.intel >= 0) SSipintel.cache[ip] = res - if(dbcon.Connect()) - var/DBQuery/query_add_ip_intel = dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()") + if(GLOB.dbcon.Connect()) + var/DBQuery/query_add_ip_intel = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("ipintel")] (ip, intel) VALUES (INET_ATON('[ip]'), [res.intel]) ON DUPLICATE KEY UPDATE intel = VALUES(intel), date = NOW()") query_add_ip_intel.Execute() diff --git a/code/modules/admin/permissionverbs/permissionedit.dm b/code/modules/admin/permissionverbs/permissionedit.dm index fb0f8a3ffa4a6..016c07a582c6a 100644 --- a/code/modules/admin/permissionverbs/permissionedit.dm +++ b/code/modules/admin/permissionverbs/permissionedit.dm @@ -27,8 +27,8 @@ "} - for(var/adm_ckey in admin_datums) - var/datum/admins/D = admin_datums[adm_ckey] + for(var/adm_ckey in GLOB.admin_datums) + var/datum/admins/D = GLOB.admin_datums[adm_ckey] if(!D) continue @@ -60,7 +60,7 @@ if (!check_rights(R_PERMISSIONS)) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return @@ -75,7 +75,7 @@ if(!istext(adm_ckey) || !istext(new_rank)) return - var/DBQuery/query_get_admin = dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") + var/DBQuery/query_get_admin = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") if(!query_get_admin.warn_execute()) return @@ -86,19 +86,19 @@ admin_id = text2num(query_get_admin.item[1]) if(new_admin) - var/DBQuery/query_add_admin = dbcon.NewQuery("INSERT INTO `[format_table_name("admin")]` (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)") + var/DBQuery/query_add_admin = GLOB.dbcon.NewQuery("INSERT INTO `[format_table_name("admin")]` (`id`, `ckey`, `rank`, `level`, `flags`) VALUES (null, '[adm_ckey]', '[new_rank]', -1, 0)") if(!query_add_admin.warn_execute()) return - var/DBQuery/query_add_admin_log = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');") + var/DBQuery/query_add_admin_log = GLOB.dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Added new admin [adm_ckey] to rank [new_rank]');") if(!query_add_admin_log.warn_execute()) return to_chat(usr, "New admin added.") else if(!isnull(admin_id) && isnum(admin_id)) - var/DBQuery/query_change_admin = dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET rank = '[new_rank]' WHERE id = [admin_id]") + var/DBQuery/query_change_admin = GLOB.dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET rank = '[new_rank]' WHERE id = [admin_id]") if(!query_change_admin.warn_execute()) return - var/DBQuery/query_change_admin_log = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');") + var/DBQuery/query_change_admin_log = GLOB.dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edited the rank of [adm_ckey] to [new_rank]');") if(!query_change_admin_log.warn_execute()) return to_chat(usr, "Admin rank changed.") @@ -112,14 +112,14 @@ if(check_rights(R_PERMISSIONS)) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return if(!adm_ckey || !istext(adm_ckey) || !isnum(new_permission)) return - var/DBQuery/query_get_perms = dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") + var/DBQuery/query_get_perms = GLOB.dbcon.NewQuery("SELECT id, flags FROM [format_table_name("admin")] WHERE ckey = '[adm_ckey]'") if(!query_get_perms.warn_execute()) return @@ -130,8 +130,8 @@ if(!admin_id) return - var/DBQuery/query_change_perms = dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET flags = [new_permission] WHERE id = [admin_id]") + var/DBQuery/query_change_perms = GLOB.dbcon.NewQuery("UPDATE `[format_table_name("admin")]` SET flags = [new_permission] WHERE id = [admin_id]") if(!query_change_perms.warn_execute()) return - var/DBQuery/query_change_perms_log = dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edit permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');") + var/DBQuery/query_change_perms_log = GLOB.dbcon.NewQuery("INSERT INTO `[format_table_name("admin_log")]` (`id` ,`datetime` ,`adminckey` ,`adminip` ,`log` ) VALUES (NULL , NOW( ) , '[usr.ckey]', '[usr.client.address]', 'Edit permission [rights2text(new_permission)] (flag = [new_permission]) to admin [adm_ckey]');") query_change_perms_log.warn_execute() diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index c3158fc040d07..aa61cbcc8d3b2 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -339,7 +339,7 @@ dat += "If limits past: [SSticker.mode.round_ends_with_antag_death ? "End The Round" : "Continue As Extended"]
    " dat += "End Round Now
    " dat += "[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]" - var/connected_players = clients.len + var/connected_players = GLOB.clients.len var/lobby_players = 0 var/observers = 0 var/observers_connected = 0 @@ -350,7 +350,7 @@ var/other_players = 0 var/living_skipped = 0 var/drones = 0 - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.ckey) if(isnewplayer(M)) lobby_players++ @@ -395,7 +395,7 @@ dat += "" dat += "" dat += "
    [N.name]([N.key]) Nuclear Operative Body destroyed!PM

    " - for(var/obj/item/weapon/disk/nuclear/N in poi_list) + for(var/obj/item/weapon/disk/nuclear/N in GLOB.poi_list) dat += "
    Nuclear Disk(s)
    [N.name], " var/atom/disk_loc = N.loc while(!isturf(disk_loc)) @@ -441,7 +441,7 @@ dat += "
    " for(var/datum/gang/G in SSticker.mode.gangs) - dat += "
    " + dat += "
    [G.name] Gang: [G.points] Influence | [round((G.territory.len/start_state.num_territories)*100, 1)]% Control
    " for(var/datum/mind/N in G.bosses) var/mob/M = N.current if(!M) @@ -548,7 +548,7 @@ dat += "" dat += "
    [G.name] Gang: [G.points] Influence | [round((G.territory.len/GLOB.start_state.num_territories)*100, 1)]% Control
    PM
    " dat += "
    " - for(var/obj/machinery/abductor/experiment/E in machines) + for(var/obj/machinery/abductor/experiment/E in GLOB.machines) for(var/datum/mind/abductee in E.abductee_minds) var/mob/M = abductee.current if(M) @@ -591,7 +591,7 @@ dat += "
    Abductees
    " var/list/blob_minds = list() - for(var/mob/camera/blob/B in mob_list) + for(var/mob/camera/blob/B in GLOB.mob_list) blob_minds |= B.mind if(istype(SSticker.mode, /datum/game_mode/blob) || blob_minds.len) @@ -599,7 +599,7 @@ if(istype(SSticker.mode,/datum/game_mode/blob)) var/datum/game_mode/blob/mode = SSticker.mode blob_minds |= mode.blob_overminds - dat += "Progress: [blobs_legit.len]/[mode.blobwincount]" + dat += "Progress: [GLOB.blobs_legit.len]/[mode.blobwincount]" for(var/datum/mind/blob in blob_minds) var/mob/M = blob.current diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 96fba22b28396..a4e49f7b337c5 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -19,8 +19,8 @@ Cure all diseases currently in existence
    Bombing List
    Show current traitors and objectives
    - Show last [length(lastsignalers)] signalers
    - Show last [length(lawchanges)] law changes
    + Show last [length(GLOB.lastsignalers)] signalers
    + Show last [length(GLOB.lawchanges)] law changes
    Show AI Laws
    Show Game Mode
    Show Crew Manifest
    @@ -96,9 +96,9 @@ switch(item) if("admin_log") var/dat = "Admin Log
    " - for(var/l in admin_log) + for(var/l in GLOB.admin_log) dat += "
  • [l]
  • " - if(!admin_log.len) + if(!GLOB.admin_log.len) dat += "No-one has done anything this round!" usr << browse(dat, "window=admin_log") @@ -116,9 +116,9 @@ if("show_admins") var/dat = "Current admins:
    " - if(admin_datums) - for(var/ckey in admin_datums) - var/datum/admins/D = admin_datums[ckey] + if(GLOB.admin_datums) + for(var/ckey in GLOB.admin_datums) + var/datum/admins/D = GLOB.admin_datums[ckey] dat += "[ckey] - [D.rank.name]
    " usr << browse(dat, "window=showadmins;size=600x500") @@ -174,23 +174,23 @@ if(!check_rights(R_ADMIN)) return var/dat = "Bombing List
    " - for(var/l in bombers) + for(var/l in GLOB.bombers) dat += text("[l]
    ") usr << browse(dat, "window=bombers") if("list_signalers") if(!check_rights(R_ADMIN)) return - var/dat = "Showing last [length(lastsignalers)] signalers.
    " - for(var/sig in lastsignalers) + var/dat = "Showing last [length(GLOB.lastsignalers)] signalers.
    " + for(var/sig in GLOB.lastsignalers) dat += "[sig]
    " usr << browse(dat, "window=lastsignalers;size=800x500") if("list_lawchanges") if(!check_rights(R_ADMIN)) return - var/dat = "Showing last [length(lawchanges)] law changes.
    " - for(var/sig in lawchanges) + var/dat = "Showing last [length(GLOB.lawchanges)] law changes.
    " + for(var/sig in GLOB.lawchanges) dat += "[sig]
    " usr << browse(dat, "window=lawchanges;size=800x500") @@ -251,7 +251,7 @@ return var/dat = "Showing Crew Manifest.
    " dat += "" - for(var/datum/data/record/t in data_core.general) + for(var/datum/data/record/t in GLOB.data_core.general) dat += "" dat += "
    NamePosition
    [t.fields["name"]][t.fields["rank"]]
    " usr << browse(dat, "window=manifest;size=440x410") @@ -260,7 +260,7 @@ return var/dat = "Showing DNA from blood.
    " dat += "" - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) if(H.ckey) dat += "" dat += "
    NameDNABlood Type
    [H][H.dna.unique_enzymes][H.dna.blood_type]
    " @@ -270,7 +270,7 @@ return var/dat = "Showing Fingerprints.
    " dat += "" - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) if(H.ckey) dat += "" dat += "
    NameFingerprints
    [H][md5(H.dna.uni_identity)]
    " @@ -281,7 +281,7 @@ return feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","M") - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) spawn(0) H.monkeyize() ok = 1 @@ -289,12 +289,12 @@ if("allspecies") if(!check_rights(R_FUN)) return - var/result = input(usr, "Please choose a new species","Species") as null|anything in species_list + var/result = input(usr, "Please choose a new species","Species") as null|anything in GLOB.species_list if(result) log_admin("[key_name(usr)] turned all humans into [result]", 1) message_admins("\blue [key_name_admin(usr)] turned all humans into [result]") - var/newtype = species_list[result] - for(var/mob/living/carbon/human/H in mob_list) + var/newtype = GLOB.species_list[result] + for(var/mob/living/carbon/human/H in GLOB.mob_list) H.set_species(newtype) if("corgi") @@ -302,7 +302,7 @@ return feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","M") - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) spawn(0) H.corgize() ok = 1 @@ -352,7 +352,7 @@ return feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","TA([objective])") - for(var/mob/living/carbon/human/H in player_list) + for(var/mob/living/carbon/human/H in GLOB.player_list) if(H.stat == 2 || !H.client || !H.mind) continue if(is_special_character(H)) continue //traitorize(H, objective, 0) @@ -365,7 +365,7 @@ SSticker.mode.greet_traitor(H.mind) //SSticker.mode.forge_traitor_objectives(H.mind) SSticker.mode.finalize_traitor(H.mind) - for(var/mob/living/silicon/A in player_list) + for(var/mob/living/silicon/A in GLOB.player_list) if(A.stat == 2 || !A.client || !A.mind) continue if(ispAI(A)) continue else if(is_special_character(A)) continue @@ -386,19 +386,19 @@ feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","BC") - var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", MAX_EX_LIGHT_RANGE) as num|null + var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", GLOB.MAX_EX_LIGHT_RANGE) as num|null if (newBombCap < 4) return - MAX_EX_DEVESTATION_RANGE = round(newBombCap/4) - MAX_EX_HEAVY_RANGE = round(newBombCap/2) - MAX_EX_LIGHT_RANGE = newBombCap + GLOB.MAX_EX_DEVESTATION_RANGE = round(newBombCap/4) + GLOB.MAX_EX_HEAVY_RANGE = round(newBombCap/2) + GLOB.MAX_EX_LIGHT_RANGE = newBombCap //I don't know why these are their own variables, but fuck it, they are. - MAX_EX_FLASH_RANGE = newBombCap - MAX_EX_FLAME_RANGE = newBombCap + GLOB.MAX_EX_FLASH_RANGE = newBombCap + GLOB.MAX_EX_FLAME_RANGE = newBombCap - message_admins("[key_name_admin(usr)] changed the bomb cap to [MAX_EX_DEVESTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]") - log_admin("[key_name(usr)] changed the bomb cap to [MAX_EX_DEVESTATION_RANGE], [MAX_EX_HEAVY_RANGE], [MAX_EX_LIGHT_RANGE]") + message_admins("[key_name_admin(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]") + log_admin("[key_name(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]") if("lightsout") @@ -415,7 +415,7 @@ feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","BO") message_admins("[key_name_admin(usr)] broke all lights") - for(var/obj/machinery/light/L in machines) + for(var/obj/machinery/light/L in GLOB.machines) L.break_light_tube() if("anime") @@ -424,7 +424,7 @@ feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","CC") message_admins("[key_name_admin(usr)] made everything kawaii.") - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) H << sound('sound/AI/animes.ogg') if(H.dna.species.id == "human") @@ -450,7 +450,7 @@ feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","WO") message_admins("[key_name_admin(usr)] fixed all lights") - for(var/obj/machinery/light/L in machines) + for(var/obj/machinery/light/L in GLOB.machines) L.fix() if("floorlava") @@ -477,7 +477,7 @@ return feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","RET") - for(var/mob/living/carbon/human/H in player_list) + for(var/mob/living/carbon/human/H in GLOB.player_list) to_chat(H, "You suddenly feel stupid.") H.setBrainLoss(60) message_admins("[key_name_admin(usr)] made everybody retarded") @@ -487,7 +487,7 @@ return feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","EgL") - for(var/obj/machinery/door/airlock/W in machines) + for(var/obj/machinery/door/airlock/W in GLOB.machines) if(W.z == ZLEVEL_STATION && !istype(get_area(W), /area/bridge) && !istype(get_area(W), /area/crew_quarters) && !istype(get_area(W), /area/security/prison)) W.req_access = list() message_admins("[key_name_admin(usr)] activated Egalitarian Station mode") @@ -545,7 +545,7 @@ return feedback_inc("admin_secrets_fun_used",1) feedback_add_details("admin_secrets_fun_used","DF") - for(var/mob/living/carbon/human/B in mob_list) + for(var/mob/living/carbon/human/B in GLOB.mob_list) B.facial_hair_style = "Dward Beard" B.update_hair() message_admins("[key_name_admin(usr)] activated dorf mode") @@ -577,19 +577,19 @@ if("maint_access_brig") if(!check_rights(R_DEBUG)) return - for(var/obj/machinery/door/airlock/maintenance/M in machines) + for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) M.check_access() - if (access_maint_tunnels in M.req_access) - M.req_access = list(access_brig) + if (GLOB.access_maint_tunnels in M.req_access) + M.req_access = list(GLOB.access_brig) message_admins("[key_name_admin(usr)] made all maint doors brig access-only.") if("maint_access_engiebrig") if(!check_rights(R_DEBUG)) return - for(var/obj/machinery/door/airlock/maintenance/M in machines) + for(var/obj/machinery/door/airlock/maintenance/M in GLOB.machines) M.check_access() - if (access_maint_tunnels in M.req_access) + if (GLOB.access_maint_tunnels in M.req_access) M.req_access = list() - M.req_one_access = list(access_brig,access_engine) + M.req_one_access = list(GLOB.access_brig,GLOB.access_engine) message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.") if("infinite_sec") if(!check_rights(R_DEBUG)) diff --git a/code/modules/admin/sql_message_system.dm b/code/modules/admin/sql_message_system.dm index 3d287c2228689..bcb2013867db5 100644 --- a/code/modules/admin/sql_message_system.dm +++ b/code/modules/admin/sql_message_system.dm @@ -1,5 +1,5 @@ /proc/create_message(type, target_ckey, admin_ckey, text, timestamp, server, secret, logged = 1, browse) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return if(!type) @@ -9,7 +9,7 @@ if(!new_ckey) return new_ckey = sanitizeSQL(new_ckey) - var/DBQuery/query_find_ckey = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'") + var/DBQuery/query_find_ckey = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ckey = '[new_ckey]'") if(!query_find_ckey.warn_execute()) return if(!query_find_ckey.NextRow()) @@ -44,7 +44,7 @@ secret = 0 else return - var/DBQuery/query_create_message = dbcon.NewQuery("INSERT INTO [format_table_name("messages")] (type, targetckey, adminckey, text, timestamp, server, secret) VALUES ('[type]', '[target_ckey]', '[admin_ckey]', '[text]', '[timestamp]', '[server]', '[secret]')") + var/DBQuery/query_create_message = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("messages")] (type, targetckey, adminckey, text, timestamp, server, secret) VALUES ('[type]', '[target_ckey]', '[admin_ckey]', '[text]', '[timestamp]', '[server]', '[secret]')") if(!query_create_message.warn_execute()) return if(logged) @@ -56,7 +56,7 @@ browse_messages(target_ckey = target_ckey) /proc/delete_message(message_id, logged = 1, browse) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return message_id = text2num(message_id) @@ -65,14 +65,14 @@ var/type var/target_ckey var/text - var/DBQuery/query_find_del_message = dbcon.NewQuery("SELECT type, targetckey, adminckey, text FROM [format_table_name("messages")] WHERE id = [message_id]") + var/DBQuery/query_find_del_message = GLOB.dbcon.NewQuery("SELECT type, targetckey, adminckey, text FROM [format_table_name("messages")] WHERE id = [message_id]") if(!query_find_del_message.warn_execute()) return if(query_find_del_message.NextRow()) type = query_find_del_message.item[1] target_ckey = query_find_del_message.item[2] text = query_find_del_message.item[4] - var/DBQuery/query_del_message = dbcon.NewQuery("DELETE FROM [format_table_name("messages")] WHERE id = [message_id]") + var/DBQuery/query_del_message = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("messages")] WHERE id = [message_id]") if(!query_del_message.warn_execute()) return if(logged) @@ -84,13 +84,13 @@ browse_messages(target_ckey = target_ckey) /proc/edit_message(message_id, browse) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return message_id = text2num(message_id) if(!message_id) return - var/DBQuery/query_find_edit_message = dbcon.NewQuery("SELECT type, targetckey, adminckey, text FROM [format_table_name("messages")] WHERE id = [message_id]") + var/DBQuery/query_find_edit_message = GLOB.dbcon.NewQuery("SELECT type, targetckey, adminckey, text FROM [format_table_name("messages")] WHERE id = [message_id]") if(!query_find_edit_message.warn_execute()) return if(query_find_edit_message.NextRow()) @@ -104,7 +104,7 @@ return new_text = sanitizeSQL(new_text) var/edit_text = sanitizeSQL("Edited by [editor_ckey] on [SQLtime()] from
    [old_text]
    to
    [new_text]
    ") - var/DBQuery/query_edit_message = dbcon.NewQuery("UPDATE [format_table_name("messages")] SET text = '[new_text]', lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id]") + var/DBQuery/query_edit_message = GLOB.dbcon.NewQuery("UPDATE [format_table_name("messages")] SET text = '[new_text]', lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id]") if(!query_edit_message.warn_execute()) return log_admin_private("[key_name(usr)] has edited a [type] [(type == "note" || type == "message" || type == "watchlist entry") ? " for [target_ckey]" : ""] made by [admin_ckey] from [old_text] to [new_text]") @@ -115,13 +115,13 @@ browse_messages(target_ckey = target_ckey) /proc/toggle_message_secrecy(message_id) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return message_id = text2num(message_id) if(!message_id) return - var/DBQuery/query_find_message_secret = dbcon.NewQuery("SELECT type, targetckey, adminckey, secret FROM [format_table_name("messages")] WHERE id = [message_id]") + var/DBQuery/query_find_message_secret = GLOB.dbcon.NewQuery("SELECT type, targetckey, adminckey, secret FROM [format_table_name("messages")] WHERE id = [message_id]") if(!query_find_message_secret.warn_execute()) return if(query_find_message_secret.NextRow()) @@ -131,7 +131,7 @@ var/secret = text2num(query_find_message_secret.item[4]) var/editor_ckey = sanitizeSQL(usr.ckey) var/edit_text = "Made [secret ? "not secret" : "secret"] by [editor_ckey] on [SQLtime()]
    " - var/DBQuery/query_message_secret = dbcon.NewQuery("UPDATE [format_table_name("messages")] SET secret = NOT secret, lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id]") + var/DBQuery/query_message_secret = GLOB.dbcon.NewQuery("UPDATE [format_table_name("messages")] SET secret = NOT secret, lasteditor = '[editor_ckey]', edits = CONCAT(IFNULL(edits,''),'[edit_text]') WHERE id = [message_id]") if(!query_message_secret.warn_execute()) return log_admin_private("[key_name(usr)] has toggled [target_ckey]'s [type] made by [admin_ckey] to [secret ? "not secret" : "secret"]") @@ -139,13 +139,13 @@ browse_messages(target_ckey = target_ckey) /proc/browse_messages(type, target_ckey, index, linkless = 0, filter) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return var/output var/ruler = "
    " var/navbar = "\[All\]|\[#\]" - for(var/letter in alphabet) + for(var/letter in GLOB.alphabet) navbar += "|\[[letter]\]" navbar += "|\[Memos\]|\[Watchlist\]" navbar += "
    \ @@ -166,13 +166,13 @@ else output += "|\[Filter offline clients\]" output += ruler - var/DBQuery/query_get_type_messages = dbcon.NewQuery("SELECT id, targetckey, adminckey, text, timestamp, server, lasteditor FROM [format_table_name("messages")] WHERE type = '[type]'") + var/DBQuery/query_get_type_messages = GLOB.dbcon.NewQuery("SELECT id, targetckey, adminckey, text, timestamp, server, lasteditor FROM [format_table_name("messages")] WHERE type = '[type]'") if(!query_get_type_messages.warn_execute()) return while(query_get_type_messages.NextRow()) var/id = query_get_type_messages.item[1] var/t_ckey = query_get_type_messages.item[2] - if(type == "watchlist entry" && filter && !(t_ckey in directory)) + if(type == "watchlist entry" && filter && !(t_ckey in GLOB.directory)) continue var/admin_ckey = query_get_type_messages.item[3] var/text = query_get_type_messages.item[4] @@ -190,7 +190,7 @@ output += "
    [text]
    " if(target_ckey) target_ckey = sanitizeSQL(target_ckey) - var/DBQuery/query_get_messages = dbcon.NewQuery("SELECT type, secret, id, adminckey, text, timestamp, server, lasteditor FROM [format_table_name("messages")] WHERE type <> 'memo' AND targetckey = '[target_ckey]' ORDER BY timestamp DESC") + var/DBQuery/query_get_messages = GLOB.dbcon.NewQuery("SELECT type, secret, id, adminckey, text, timestamp, server, lasteditor FROM [format_table_name("messages")] WHERE type <> 'memo' AND targetckey = '[target_ckey]' ORDER BY timestamp DESC") if(!query_get_messages.warn_execute()) return var/messagedata @@ -265,7 +265,7 @@ search = "^\[^\[:alpha:\]\]" else search = "^[index]" - var/DBQuery/query_list_messages = dbcon.NewQuery("SELECT DISTINCT targetckey FROM [format_table_name("messages")] WHERE type <> 'memo' AND targetckey REGEXP '[search]' ORDER BY targetckey") + var/DBQuery/query_list_messages = GLOB.dbcon.NewQuery("SELECT DISTINCT targetckey FROM [format_table_name("messages")] WHERE type <> 'memo' AND targetckey REGEXP '[search]' ORDER BY targetckey") if(!query_list_messages.warn_execute()) return while(query_list_messages.NextRow()) @@ -277,7 +277,7 @@ usr << browse(output, "window=browse_messages;size=900x500") proc/get_message_output(type, target_ckey) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return if(!type) @@ -288,7 +288,7 @@ proc/get_message_output(type, target_ckey) var/query = "SELECT id, adminckey, text, timestamp, lasteditor FROM [format_table_name("messages")] WHERE type = '[type]'" if(type == "message" || type == "watchlist entry") query += " AND targetckey = '[target_ckey]'" - var/DBQuery/query_get_message_output = dbcon.NewQuery(query) + var/DBQuery/query_get_message_output = GLOB.dbcon.NewQuery(query) if(!query_get_message_output.warn_execute()) return while(query_get_message_output.NextRow()) @@ -301,7 +301,7 @@ proc/get_message_output(type, target_ckey) if("message") output += "Admin message left by [admin_ckey] on [timestamp]" output += "
    [text]
    " - var/DBQuery/query_message_read = dbcon.NewQuery("UPDATE [format_table_name("messages")] SET type = 'message sent' WHERE id = [message_id]") + var/DBQuery/query_message_read = GLOB.dbcon.NewQuery("UPDATE [format_table_name("messages")] SET type = 'message sent' WHERE id = [message_id]") if(!query_message_read.warn_execute()) return if("watchlist entry") @@ -333,7 +333,7 @@ proc/get_message_output(type, target_ckey) var/timestamp = note.group[1] notetext = note.group[2] var/admin_ckey = note.group[3] - var/DBQuery/query_convert_time = dbcon.NewQuery("SELECT ADDTIME(STR_TO_DATE('[timestamp]','%d-%b-%Y'), '0')") + var/DBQuery/query_convert_time = GLOB.dbcon.NewQuery("SELECT ADDTIME(STR_TO_DATE('[timestamp]','%d-%b-%Y'), '0')") if(!query_convert_time.Execute()) return if(query_convert_time.NextRow()) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 690f539e758e7..8fa56d903daf5 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -11,7 +11,7 @@ return if(!check_rights(R_ADMIN)) return - var/client/C = locate(href_list["rejectadminhelp"]) in clients + var/client/C = locate(href_list["rejectadminhelp"]) in GLOB.clients if(!C) return if (deltimer(C.adminhelptimerid)) @@ -31,7 +31,7 @@ if(world.time && spamcooldown > world.time) to_chat(usr, "Please wait [max(round((spamcooldown - world.time)*0.1, 0.1), 0)] seconds.") return - var/client/C = locate(href_list["icissue"]) in clients + var/client/C = locate(href_list["icissue"]) in GLOB.clients if(!C) return @@ -242,7 +242,7 @@ var/mob/playermob - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.ckey == banckey) playermob = M break @@ -466,8 +466,8 @@ return var/banfolder = href_list["unbanf"] - Banlist.cd = "/base/[banfolder]" - var/key = Banlist["key"] + GLOB.Banlist.cd = "/base/[banfolder]" + var/key = GLOB.Banlist["key"] if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes") if(RemoveBan(banfolder)) unbanpanel() @@ -483,14 +483,14 @@ var/reason var/banfolder = href_list["unbane"] - Banlist.cd = "/base/[banfolder]" - var/reason2 = Banlist["reason"] - var/temp = Banlist["temp"] + GLOB.Banlist.cd = "/base/[banfolder]" + var/reason2 = GLOB.Banlist["reason"] + var/temp = GLOB.Banlist["temp"] - var/minutes = Banlist["minutes"] + var/minutes = GLOB.Banlist["minutes"] - var/banned_key = Banlist["key"] - Banlist.cd = "/base" + var/banned_key = GLOB.Banlist["key"] + GLOB.Banlist.cd = "/base" var/duration @@ -498,12 +498,12 @@ if("Yes") temp = 1 var/mins = 0 - if(minutes > CMinutes) - mins = minutes - CMinutes + if(minutes > GLOB.CMinutes) + mins = minutes - GLOB.CMinutes mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null if(!mins) return - minutes = CMinutes + mins + minutes = GLOB.CMinutes + mins duration = GetExp(minutes) reason = input(usr,"Please State Reason.","Reason",reason2) as message|null if(!reason) @@ -518,12 +518,12 @@ log_admin_private("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") message_admins("[key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") - Banlist.cd = "/base/[banfolder]" - Banlist["reason"] << reason - Banlist["temp"] << temp - Banlist["minutes"] << minutes - Banlist["bannedby"] << usr.ckey - Banlist.cd = "/base" + GLOB.Banlist.cd = "/base/[banfolder]" + GLOB.Banlist["reason"] << reason + GLOB.Banlist["temp"] << temp + GLOB.Banlist["minutes"] << minutes + GLOB.Banlist["bannedby"] << usr.ckey + GLOB.Banlist.cd = "/base" feedback_inc("ban_edit",1) unbanpanel() @@ -599,8 +599,8 @@ //Regular jobs //Command (Blue) dat += "" - dat += "" - for(var/jobPos in command_positions) + dat += "" + for(var/jobPos in GLOB.command_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -618,8 +618,8 @@ //Security (Red) counter = 0 dat += "
    Command Positions
    Command Positions
    " - dat += "" - for(var/jobPos in security_positions) + dat += "" + for(var/jobPos in GLOB.security_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -637,8 +637,8 @@ //Engineering (Yellow) counter = 0 dat += "
    Security Positions
    Security Positions
    " - dat += "" - for(var/jobPos in engineering_positions) + dat += "" + for(var/jobPos in GLOB.engineering_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -656,8 +656,8 @@ //Medical (White) counter = 0 dat += "
    Engineering Positions
    Engineering Positions
    " - dat += "" - for(var/jobPos in medical_positions) + dat += "" + for(var/jobPos in GLOB.medical_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -675,8 +675,8 @@ //Science (Purple) counter = 0 dat += "
    Medical Positions
    Medical Positions
    " - dat += "" - for(var/jobPos in science_positions) + dat += "" + for(var/jobPos in GLOB.science_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -694,8 +694,8 @@ //Supply (Brown) counter = 0 dat += "
    Science Positions
    Science Positions
    " - dat += "" - for(var/jobPos in supply_positions) + dat += "" + for(var/jobPos in GLOB.supply_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -713,8 +713,8 @@ //Civilian (Grey) counter = 0 dat += "
    Supply Positions
    Supply Positions
    " - dat += "" - for(var/jobPos in civilian_positions) + dat += "" + for(var/jobPos in GLOB.civilian_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -732,8 +732,8 @@ //Non-Human (Green) counter = 0 dat += "
    Civilian Positions
    Civilian Positions
    " - dat += "" - for(var/jobPos in nonhuman_positions) + dat += "" + for(var/jobPos in GLOB.nonhuman_positions) if(!jobPos) continue if(jobban_isbanned(M, jobPos)) @@ -880,42 +880,42 @@ var/list/joblist = list() switch(href_list["jobban3"]) if("commanddept") - for(var/jobPos in command_positions) + for(var/jobPos in GLOB.command_positions) if(!jobPos) continue joblist += jobPos if("securitydept") - for(var/jobPos in security_positions) + for(var/jobPos in GLOB.security_positions) if(!jobPos) continue joblist += jobPos if("engineeringdept") - for(var/jobPos in engineering_positions) + for(var/jobPos in GLOB.engineering_positions) if(!jobPos) continue joblist += jobPos if("medicaldept") - for(var/jobPos in medical_positions) + for(var/jobPos in GLOB.medical_positions) if(!jobPos) continue joblist += jobPos if("sciencedept") - for(var/jobPos in science_positions) + for(var/jobPos in GLOB.science_positions) if(!jobPos) continue joblist += jobPos if("supplydept") - for(var/jobPos in supply_positions) + for(var/jobPos in GLOB.supply_positions) if(!jobPos) continue joblist += jobPos if("civiliandept") - for(var/jobPos in civilian_positions) + for(var/jobPos in GLOB.civilian_positions) if(!jobPos) continue joblist += jobPos if("nonhumandept") - for(var/jobPos in nonhuman_positions) + for(var/jobPos in GLOB.nonhuman_positions) if(!jobPos) continue joblist += jobPos @@ -1109,7 +1109,7 @@ else if(href_list["messageedits"]) var/message_id = sanitizeSQL("[href_list["messageedits"]]") - var/DBQuery/query_get_message_edits = dbcon.NewQuery("SELECT edits FROM [format_table_name("messages")] WHERE id = '[message_id]'") + var/DBQuery/query_get_message_edits = GLOB.dbcon.NewQuery("SELECT edits FROM [format_table_name("messages")] WHERE id = '[message_id]'") if(!query_get_message_edits.warn_execute()) return if(query_get_message_edits.NextRow()) @@ -1196,7 +1196,7 @@ dat += {"[config.mode_names[mode]]
    "} dat += {"Secret
    "} dat += {"Random
    "} - dat += {"Now: [master_mode]"} + dat += {"Now: [GLOB.master_mode]"} usr << browse(dat, "window=c_mode") else if(href_list["f_secret"]) @@ -1205,13 +1205,13 @@ if(SSticker && SSticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - if(master_mode != "secret") + if(GLOB.master_mode != "secret") return alert(usr, "The game mode has to be secret!", null, null, null, null) var/dat = {"What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.
    "} for(var/mode in config.modes) dat += {"[config.mode_names[mode]]
    "} dat += {"Random (default)
    "} - dat += {"Now: [secret_force_mode]"} + dat += {"Now: [GLOB.secret_force_mode]"} usr << browse(dat, "window=f_secret") else if(href_list["c_mode2"]) @@ -1220,12 +1220,12 @@ if (SSticker && SSticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - master_mode = href_list["c_mode2"] - log_admin("[key_name(usr)] set the mode as [master_mode].") - message_admins("[key_name_admin(usr)] set the mode as [master_mode].") - to_chat(world, "The mode is now: [master_mode]") + GLOB.master_mode = href_list["c_mode2"] + log_admin("[key_name(usr)] set the mode as [GLOB.master_mode].") + message_admins("[key_name_admin(usr)] set the mode as [GLOB.master_mode].") + to_chat(world, "The mode is now: [GLOB.master_mode]") Game() // updates the main game menu - world.save_mode(master_mode) + world.save_mode(GLOB.master_mode) .(href, list("c_mode"=1)) else if(href_list["f_secret2"]) @@ -1234,11 +1234,11 @@ if(SSticker && SSticker.mode) return alert(usr, "The game has already started.", null, null, null, null) - if(master_mode != "secret") + if(GLOB.master_mode != "secret") return alert(usr, "The game mode has to be secret!", null, null, null, null) - secret_force_mode = href_list["f_secret2"] - log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].") - message_admins("[key_name_admin(usr)] set the forced secret mode as [secret_force_mode].") + GLOB.secret_force_mode = href_list["f_secret2"] + log_admin("[key_name(usr)] set the forced secret mode as [GLOB.secret_force_mode].") + message_admins("[key_name_admin(usr)] set the forced secret mode as [GLOB.secret_force_mode].") Game() // updates the main game menu .(href, list("f_secret"=1)) @@ -1313,7 +1313,7 @@ if(alert(usr, "Send [key_name(M)] to Prison?", "Message", "Yes", "No") != "Yes") return - M.loc = pick(prisonwarp) + M.loc = pick(GLOB.prisonwarp) to_chat(M, "You have been sent to Prison!") log_admin("[key_name(usr)] has sent [key_name(M)] to Prison!") @@ -1363,7 +1363,7 @@ M.Paralyse(5) sleep(5) - M.loc = pick(tdome1) + M.loc = pick(GLOB.tdome1) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)") @@ -1389,7 +1389,7 @@ M.Paralyse(5) sleep(5) - M.loc = pick(tdome2) + M.loc = pick(GLOB.tdome2) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)") @@ -1412,7 +1412,7 @@ M.Paralyse(5) sleep(5) - M.loc = pick(tdomeadmin) + M.loc = pick(GLOB.tdomeadmin) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)") @@ -1442,7 +1442,7 @@ observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/sneakers/black(observer), slot_shoes) M.Paralyse(5) sleep(5) - M.loc = pick(tdomeobserve) + M.loc = pick(GLOB.tdomeobserve) spawn(50) to_chat(M, "You have been sent to the Thunderdome.") log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)") @@ -1579,7 +1579,7 @@ output_devil_info(M) else if(href_list["adminmoreinfo"]) - var/mob/M = locate(href_list["adminmoreinfo"]) in mob_list + var/mob/M = locate(href_list["adminmoreinfo"]) in GLOB.mob_list if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob.") return @@ -1714,7 +1714,7 @@ if(!check_rights(R_ADMIN|R_FUN)) return - var/mob/living/carbon/human/H = locate(href_list["adminsmite"]) in mob_list + var/mob/living/carbon/human/H = locate(href_list["adminsmite"]) in GLOB.mob_list if(!H || !istype(H)) to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human") return @@ -1722,7 +1722,7 @@ usr.client.smite(H) else if(href_list["CentcommReply"]) - var/mob/living/carbon/human/H = locate(href_list["CentcommReply"]) in mob_list + var/mob/living/carbon/human/H = locate(href_list["CentcommReply"]) in GLOB.mob_list if(!istype(H)) to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human") return @@ -1808,7 +1808,7 @@ if(!check_rights(R_ADMIN)) return - var/mob/M = locate(href_list["individuallog"]) in mob_list + var/mob/M = locate(href_list["individuallog"]) in GLOB.mob_list if(!ismob(M)) to_chat(usr, "This can only be used on instances of type /mob.") return @@ -1818,7 +1818,7 @@ if(!check_rights(R_ADMIN)) return - var/mob/living/L = locate(href_list["languagemenu"]) in mob_list + var/mob/living/L = locate(href_list["languagemenu"]) in GLOB.mob_list if(!isliving(L)) to_chat(usr, "This can only be used on instances of type /mob/living.") return @@ -1996,7 +1996,7 @@ else if(href_list["ac_submit_new_channel"]) var/check = 0 - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == src.admincaster_feed_channel.channel_name) check = 1 break @@ -2005,7 +2005,7 @@ else var/choice = alert("Please confirm Feed channel creation.","Network Channel Handler","Confirm","Cancel") if(choice=="Confirm") - news_network.CreateFeedChannel(src.admincaster_feed_channel.channel_name, src.admin_signature, src.admincaster_feed_channel.locked, 1) + GLOB.news_network.CreateFeedChannel(src.admincaster_feed_channel.channel_name, src.admin_signature, src.admincaster_feed_channel.locked, 1) feedback_inc("newscaster_channels",1) log_admin("[key_name(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!") src.admincaster_screen=5 @@ -2013,7 +2013,7 @@ else if(href_list["ac_set_channel_receiving"]) var/list/available_channels = list() - for(var/datum/newscaster/feed_channel/F in news_network.network_channels) + for(var/datum/newscaster/feed_channel/F in GLOB.news_network.network_channels) available_channels += F.channel_name src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel.", "Network Channel Handler") in available_channels ) src.access_news_network() @@ -2028,11 +2028,11 @@ if(src.admincaster_feed_message.returnBody(-1) =="" || src.admincaster_feed_message.returnBody(-1) =="\[REDACTED\]" || src.admincaster_feed_channel.channel_name == "" ) src.admincaster_screen = 6 else - news_network.SubmitArticle(src.admincaster_feed_message.returnBody(-1), src.admin_signature, src.admincaster_feed_channel.channel_name, null, 1) + GLOB.news_network.SubmitArticle(src.admincaster_feed_message.returnBody(-1), src.admin_signature, src.admincaster_feed_channel.channel_name, null, 1) feedback_inc("newscaster_stories",1) src.admincaster_screen=4 - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.newsAlert(src.admincaster_feed_channel.channel_name) log_admin("[key_name(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!") @@ -2056,12 +2056,12 @@ else if(href_list["ac_menu_wanted"]) var/already_wanted = 0 - if(news_network.wanted_issue.active) + if(GLOB.news_network.wanted_issue.active) already_wanted = 1 if(already_wanted) - src.admincaster_wanted_message.criminal = news_network.wanted_issue.criminal - src.admincaster_wanted_message.body = news_network.wanted_issue.body + src.admincaster_wanted_message.criminal = GLOB.news_network.wanted_issue.criminal + src.admincaster_wanted_message.body = GLOB.news_network.wanted_issue.body src.admincaster_screen = 14 src.access_news_network() @@ -2085,10 +2085,10 @@ var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. See the else below - news_network.submitWanted(admincaster_wanted_message.criminal, admincaster_wanted_message.body, admin_signature, null, 1, 1) + GLOB.news_network.submitWanted(admincaster_wanted_message.criminal, admincaster_wanted_message.body, admin_signature, null, 1, 1) src.admincaster_screen = 15 else - news_network.submitWanted(admincaster_wanted_message.criminal, admincaster_wanted_message.body, admin_signature) + GLOB.news_network.submitWanted(admincaster_wanted_message.criminal, admincaster_wanted_message.body, admin_signature) src.admincaster_screen = 19 log_admin("[key_name(usr)] issued a Station-wide Wanted Notification for [src.admincaster_wanted_message.criminal]!") src.access_news_network() @@ -2096,7 +2096,7 @@ else if(href_list["ac_cancel_wanted"]) var/choice = alert("Please confirm Wanted Issue removal.","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") - news_network.deleteWanted() + GLOB.news_network.deleteWanted() src.admincaster_screen=17 src.access_news_network() @@ -2219,14 +2219,14 @@ O.belt = text2path(href_list["outfit_belt"]) O.ears = text2path(href_list["outfit_ears"]) - custom_outfits.Add(O) + GLOB.custom_outfits.Add(O) message_admins("[key_name(usr)] created \"[O.name]\" outfit!") else if(href_list["set_selfdestruct_code"]) if(!check_rights(R_ADMIN)) return var/code = random_nukecode() - for(var/obj/machinery/nuclearbomb/selfdestruct/SD in nuke_list) + for(var/obj/machinery/nuclearbomb/selfdestruct/SD in GLOB.nuke_list) SD.r_code = code message_admins("[key_name_admin(usr)] has set the self-destruct \ code to \"[code]\".") diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index 76c9486531a57..f60d07a884f12 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -11,7 +11,7 @@ var/list/forenames = list() var/list/ckeys = list() var/founds = "" - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) var/list/indexing = list(M.real_name, M.name) if(M.mind) indexing += M.mind.name @@ -80,7 +80,7 @@ set category = "Admin" set name = "Adminhelp" - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return @@ -112,7 +112,7 @@ //send this msg to all admins - for(var/client/X in admins) + for(var/client/X in GLOB.admins) if(X.prefs.toggles & SOUND_ADMINHELP) X << 'sound/effects/adminhelp.ogg' window_flash(X, ignorepref = TRUE) @@ -132,7 +132,7 @@ /proc/get_admin_counts(requiredflags = R_BAN) . = list("total" = list(), "noflags" = list(), "afk" = list(), "stealth" = list(), "present" = list()) - for(var/client/X in admins) + for(var/client/X in GLOB.admins) .["total"] += X if(requiredflags != 0 && !check_rights_for(X, requiredflags)) .["noflags"] += X @@ -172,7 +172,7 @@ message["message_sender"] = source message["message"] = msg message["source"] = "([config.cross_name])" - message["key"] = global.comms_key + message["key"] = GLOB.comms_key message["crossmessage"] = type world.Export("[config.cross_address]?[list2params(message)]") @@ -181,7 +181,7 @@ /proc/ircadminwho() var/list/message = list("Admins: ") var/list/admin_keys = list() - for(var/adm in admins) + for(var/adm in GLOB.admins) var/client/C = adm admin_keys += "[C][C.holder.fakekey ? "(Stealth)" : ""][C.is_afk() ? "(AFK)" : ""]" diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index 3c6268b688c7f..4c08230efb8f3 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -1,4 +1,4 @@ -/client/proc/jumptoarea(area/A in sortedAreas) +/client/proc/jumptoarea(area/A in GLOB.sortedAreas) set name = "Jump to Area" set desc = "Area to jump to" set category = "Admin" @@ -38,7 +38,7 @@ feedback_add_details("admin_verb","JT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return -/client/proc/jumptomob(mob/M in mob_list) +/client/proc/jumptomob(mob/M in GLOB.mob_list) set category = "Admin" set name = "Jump to Mob" @@ -82,7 +82,7 @@ return var/list/keys = list() - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) keys += M.client var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) if(!selection) @@ -96,7 +96,7 @@ feedback_add_details("admin_verb","JK") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/Getmob(mob/M in mob_list) +/client/proc/Getmob(mob/M in GLOB.mob_list) set category = "Admin" set name = "Get Mob" set desc = "Mob to teleport" @@ -119,7 +119,7 @@ return var/list/keys = list() - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) keys += M.client var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in sortKey(keys) if(!selection) @@ -141,7 +141,7 @@ if(!src.holder) to_chat(src, "Only administrators may use this command.") return - var/area/A = input(usr, "Pick an area.", "Pick an area") in sortedAreas|null + var/area/A = input(usr, "Pick an area.", "Pick an area") in GLOB.sortedAreas|null if(A && istype(A)) if(M.forceMove(safepick(get_area_turfs(A)))) diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 4917349c66ca8..022edb20e018d 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -2,7 +2,7 @@ //allows right clicking mobs to send an admin PM to their client, forwards the selected mob's client to cmd_admin_pm -/client/proc/cmd_admin_pm_context(mob/M in mob_list) +/client/proc/cmd_admin_pm_context(mob/M in GLOB.mob_list) set category = null set name = "Admin PM Mob" if(!holder) @@ -43,7 +43,7 @@ if(istext(whom)) if(cmptext(copytext(whom,1,2),"@")) whom = findStealthKey(whom) - C = directory[whom] + C = GLOB.directory[whom] else if(istype(whom,/client)) C = whom if(!C) @@ -72,7 +72,7 @@ if(whom == "IRCKEY") irc = 1 else - C = directory[whom] + C = GLOB.directory[whom] else if(istype(whom,/client)) C = whom if(irc) @@ -177,13 +177,13 @@ if(irc) log_admin_private("PM: [key_name(src)]->IRC: [rawmsg]") - for(var/client/X in admins) + for(var/client/X in GLOB.admins) to_chat(X, "PM: [key_name(src, X, 0)]->IRC: \blue [keywordparsedmsg]" ) else window_flash(C, ignorepref = TRUE) log_admin_private("PM: [key_name(src)]->[key_name(C)]: [rawmsg]") //we don't use message_admins here because the sender/receiver might get it too - for(var/client/X in admins) + for(var/client/X in GLOB.admins) if(X.key!=key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient to_chat(X, "PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]: \blue [keywordparsedmsg]" ) @@ -192,7 +192,7 @@ /proc/IrcPm(target,msg,sender) - var/client/C = directory[target] + var/client/C = GLOB.directory[target] var/static/stealthkey var/adminname = config.showircname ? "[sender](IRC)" : "Administrator" @@ -229,12 +229,12 @@ var/i = 0 while(i == 0) i = 1 - for(var/P in stealthminID) - if(num == stealthminID[P]) + for(var/P in GLOB.stealthminID) + if(num == GLOB.stealthminID[P]) num++ i = 0 var/stealth = "@[num2text(num)]" - stealthminID["IRCKEY"] = stealth + GLOB.stealthminID["IRCKEY"] = stealth return stealth #undef IRCREPLYCOUNT diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index 30057bb6a1856..d5abf18586de6 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -13,10 +13,10 @@ msg = keywords_lookup(msg) if(check_rights(R_ADMIN,0)) msg = "ADMIN: [key_name(usr, 1)] (FLW): [msg]" - to_chat(admins, msg) + to_chat(GLOB.admins, msg) else msg = "ADMIN: [key_name(usr, 1)]: [msg]" - to_chat(admins, msg) + to_chat(GLOB.admins, msg) feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index a76c7600cc5aa..c7fb53090d4d8 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -7,17 +7,17 @@ feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! //all plumbing - yes, some things might get stated twice, doesn't matter. - for (var/obj/machinery/atmospherics/plumbing in machines) + for (var/obj/machinery/atmospherics/plumbing in GLOB.machines) if (plumbing.nodealert) to_chat(usr, "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])") //Manifolds - for (var/obj/machinery/atmospherics/pipe/manifold/pipe in machines) + for (var/obj/machinery/atmospherics/pipe/manifold/pipe in GLOB.machines) if (!pipe.NODE1 || !pipe.NODE2 || !pipe.NODE3) to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])") //Pipes - for (var/obj/machinery/atmospherics/pipe/simple/pipe in machines) + for (var/obj/machinery/atmospherics/pipe/simple/pipe in GLOB.machines) if (!pipe.NODE1 || !pipe.NODE2) to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])") @@ -29,7 +29,7 @@ return feedback_add_details("admin_verb","CPOW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - for (var/datum/powernet/PN in powernets) + for (var/datum/powernet/PN in GLOB.powernets) if (!PN.nodes || !PN.nodes.len) if(PN.cables && (PN.cables.len > 1)) var/obj/structure/cable/C = PN.cables[1] diff --git a/code/modules/admin/verbs/bluespacearty.dm b/code/modules/admin/verbs/bluespacearty.dm index 2a4c9a2d57a8f..a09dd4b527cb2 100644 --- a/code/modules/admin/verbs/bluespacearty.dm +++ b/code/modules/admin/verbs/bluespacearty.dm @@ -1,4 +1,4 @@ -/client/proc/bluespace_artillery(mob/M in mob_list) +/client/proc/bluespace_artillery(mob/M in GLOB.mob_list) if(!holder || !check_rights(R_FUN)) return diff --git a/code/modules/admin/verbs/buildmode.dm b/code/modules/admin/verbs/buildmode.dm index affda973a08b2..64ba4349229f4 100644 --- a/code/modules/admin/verbs/buildmode.dm +++ b/code/modules/admin/verbs/buildmode.dm @@ -185,7 +185,7 @@ if("number") valueholder = input(user,"Enter variable value:" ,"Value", 123) as num if("mob-reference") - valueholder = input(user,"Enter variable value:" ,"Value") as mob in mob_list + valueholder = input(user,"Enter variable value:" ,"Value") as mob in GLOB.mob_list if("obj-reference") valueholder = input(user,"Enter variable value:" ,"Value") as obj in world if("turf-reference") @@ -218,7 +218,7 @@ cornerA = null cornerB = null -/proc/togglebuildmode(mob/M in player_list) +/proc/togglebuildmode(mob/M in GLOB.player_list) set name = "Toggle Build Mode" set category = "Special Verbs" if(M.client) diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm index 88ae7cac120e8..962068348a5e6 100644 --- a/code/modules/admin/verbs/deadsay.dm +++ b/code/modules/admin/verbs/deadsay.dm @@ -23,7 +23,7 @@ var/rendered = "DEAD: ADMIN([src.holder.fakekey ? pick(nicknames) : src.key]) says, \"[msg]\"" - for (var/mob/M in player_list) + for (var/mob/M in GLOB.player_list) if(isnewplayer(M)) continue if (M.stat == DEAD || (M.client && M.client.holder && (M.client.prefs.chat_toggles & CHAT_DEAD))) //admins can toggle deadchat on and off. This is a proc in admin.dm and is only give to Administrators and above diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index a3ef6c863b121..183517eab6f43 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -4,12 +4,12 @@ if(!check_rights(R_DEBUG)) return - if(Debug2) - Debug2 = 0 + if(GLOB.Debug2) + GLOB.Debug2 = 0 message_admins("[key_name(src)] toggled debugging off.") log_admin("[key_name(src)] toggled debugging off.") else - Debug2 = 1 + GLOB.Debug2 = 1 message_admins("[key_name(src)] toggled debugging on.") log_admin("[key_name(src)] toggled debugging on.") @@ -171,13 +171,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that var/t = "" for(var/id in env_gases) - if(id in hardcoded_gases || env_gases[id][MOLES]) + if(id in GLOB.hardcoded_gases || env_gases[id][MOLES]) t+= "[env_gases[id][GAS_META][META_GAS_NAME]] : [env_gases[id][MOLES]]\n" to_chat(usr, t) feedback_add_details("admin_verb","ASL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_robotize(mob/M in mob_list) +/client/proc/cmd_admin_robotize(mob/M in GLOB.mob_list) set category = "Fun" set name = "Make Robot" @@ -193,7 +193,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that else alert("Invalid mob") -/client/proc/cmd_admin_blobize(mob/M in mob_list) +/client/proc/cmd_admin_blobize(mob/M in GLOB.mob_list) set category = "Fun" set name = "Make Blob" @@ -211,7 +211,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that alert("Invalid mob") -/client/proc/cmd_admin_animalize(mob/M in mob_list) +/client/proc/cmd_admin_animalize(mob/M in GLOB.mob_list) set category = "Fun" set name = "Make Simple Animal" @@ -232,13 +232,13 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.Animalize() -/client/proc/makepAI(turf/T in mob_list) +/client/proc/makepAI(turf/T in GLOB.mob_list) set category = "Fun" set name = "Make pAI" set desc = "Specify a location to spawn a pAI device, then specify a key to play that pAI" var/list/available = list() - for(var/mob/C in mob_list) + for(var/mob/C in GLOB.mob_list) if(C.key) available.Add(C) var/mob/choice = input("Choose a player to play the pAI", "Spawn pAI") in available @@ -259,7 +259,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that SSpai.candidates.Remove(candidate) feedback_add_details("admin_verb","MPAI") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_alienize(mob/M in mob_list) +/client/proc/cmd_admin_alienize(mob/M in GLOB.mob_list) set category = "Fun" set name = "Make Alien" @@ -276,7 +276,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that else alert("Invalid mob") -/client/proc/cmd_admin_slimeize(mob/M in mob_list) +/client/proc/cmd_admin_slimeize(mob/M in GLOB.mob_list) set category = "Fun" set name = "Make slime" @@ -293,40 +293,39 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that else alert("Invalid mob") -var/list/TYPES_SHORTCUTS = list( - /obj/effect/decal/cleanable = "CLEANABLE", - /obj/item/device/radio/headset = "HEADSET", - /obj/item/clothing/head/helmet/space = "SPESSHELMET", - /obj/item/weapon/book/manual = "MANUAL", - /obj/item/weapon/reagent_containers/food/drinks = "DRINK", //longest paths comes first - /obj/item/weapon/reagent_containers/food = "FOOD", - /obj/item/weapon/reagent_containers = "REAGENT_CONTAINERS", - /obj/item/weapon = "WEAPON", - /obj/machinery/atmospherics = "ATMOS_MECH", - /obj/machinery/portable_atmospherics = "PORT_ATMOS", - /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack = "MECHA_MISSILE_RACK", - /obj/item/mecha_parts/mecha_equipment = "MECHA_EQUIP", - /obj/item/organ = "ORGAN", - /obj/item = "ITEM", - /obj/machinery = "MACHINERY", - /obj/effect = "EFFECT", - /obj = "O", - /datum = "D", - /turf/open = "OPEN", - /turf/closed = "CLOSED", - /turf = "T", - /mob/living/carbon = "CARBON", - /mob/living/simple_animal = "SIMPLE", - /mob/living = "LIVING", - /mob = "M" -) - /proc/make_types_fancy(var/list/types) if (ispath(types)) types = list(types) . = list() for(var/type in types) var/typename = "[type]" + var/static/list/TYPES_SHORTCUTS = list( + /obj/effect/decal/cleanable = "CLEANABLE", + /obj/item/device/radio/headset = "HEADSET", + /obj/item/clothing/head/helmet/space = "SPESSHELMET", + /obj/item/weapon/book/manual = "MANUAL", + /obj/item/weapon/reagent_containers/food/drinks = "DRINK", //longest paths comes first + /obj/item/weapon/reagent_containers/food = "FOOD", + /obj/item/weapon/reagent_containers = "REAGENT_CONTAINERS", + /obj/item/weapon = "WEAPON", + /obj/machinery/atmospherics = "ATMOS_MECH", + /obj/machinery/portable_atmospherics = "PORT_ATMOS", + /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack = "MECHA_MISSILE_RACK", + /obj/item/mecha_parts/mecha_equipment = "MECHA_EQUIP", + /obj/item/organ = "ORGAN", + /obj/item = "ITEM", + /obj/machinery = "MACHINERY", + /obj/effect = "EFFECT", + /obj = "O", + /datum = "D", + /turf/open = "OPEN", + /turf/closed = "CLOSED", + /turf = "T", + /mob/living/carbon = "CARBON", + /mob/living/simple_animal = "SIMPLE", + /mob/living = "LIVING", + /mob = "M" + ) for (var/tn in TYPES_SHORTCUTS) if (copytext(typename,1, length("[tn]/")+1)=="[tn]/" /*findtextEx(typename,"[tn]/",1,2)*/ ) typename = TYPES_SHORTCUTS[tn]+copytext(typename,length("[tn]/")) @@ -388,7 +387,7 @@ var/list/TYPES_SHORTCUTS = list( message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.", 0) feedback_add_details("admin_verb","MPWN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_grantfullaccess(mob/M in mob_list) +/client/proc/cmd_admin_grantfullaccess(mob/M in GLOB.mob_list) set category = "Admin" set name = "Grant Full Access" @@ -428,7 +427,7 @@ var/list/TYPES_SHORTCUTS = list( log_admin("[key_name(src)] has granted [M.key] full access.") message_admins("[key_name_admin(usr)] has granted [M.key] full access.") -/client/proc/cmd_assume_direct_control(mob/M in mob_list) +/client/proc/cmd_assume_direct_control(mob/M in GLOB.mob_list) set category = "Admin" set name = "Assume direct control" set desc = "Direct intervention" @@ -464,37 +463,37 @@ var/list/TYPES_SHORTCUTS = list( if(!(A.type in areas_all)) areas_all.Add(A.type) - for(var/obj/machinery/power/apc/APC in apcs_list) + for(var/obj/machinery/power/apc/APC in GLOB.apcs_list) var/area/A = get_area(APC) if(!(A.type in areas_with_APC)) areas_with_APC.Add(A.type) - for(var/obj/machinery/airalarm/AA in machines) + for(var/obj/machinery/airalarm/AA in GLOB.machines) var/area/A = get_area(AA) if(!(A.type in areas_with_air_alarm)) areas_with_air_alarm.Add(A.type) - for(var/obj/machinery/requests_console/RC in machines) + for(var/obj/machinery/requests_console/RC in GLOB.machines) var/area/A = get_area(RC) if(!(A.type in areas_with_RC)) areas_with_RC.Add(A.type) - for(var/obj/machinery/light/L in machines) + for(var/obj/machinery/light/L in GLOB.machines) var/area/A = get_area(L) if(!(A.type in areas_with_light)) areas_with_light.Add(A.type) - for(var/obj/machinery/light_switch/LS in machines) + for(var/obj/machinery/light_switch/LS in GLOB.machines) var/area/A = get_area(LS) if(!(A.type in areas_with_LS)) areas_with_LS.Add(A.type) - for(var/obj/item/device/radio/intercom/I in machines) + for(var/obj/item/device/radio/intercom/I in GLOB.machines) var/area/A = get_area(I) if(!(A.type in areas_with_intercom)) areas_with_intercom.Add(A.type) - for(var/obj/machinery/camera/C in machines) + for(var/obj/machinery/camera/C in GLOB.machines) var/area/A = get_area(C) if(!(A.type in areas_with_camera)) areas_with_camera.Add(A.type) @@ -535,7 +534,7 @@ var/list/TYPES_SHORTCUTS = list( for(var/areatype in areas_without_camera) to_chat(world, "* [areatype]") -/client/proc/cmd_admin_dress(mob/living/carbon/human/M in mob_list) +/client/proc/cmd_admin_dress(mob/living/carbon/human/M in GLOB.mob_list) set category = "Fun" set name = "Select equipment" if(!ishuman(M)) @@ -573,7 +572,7 @@ var/list/TYPES_SHORTCUTS = list( var/datum/outfit/custom = null if (dresscode == "Custom") var/list/custom_names = list() - for(var/datum/outfit/D in custom_outfits) + for(var/datum/outfit/D in GLOB.custom_outfits) custom_names[D.name] = D var/selected_name = input("Select outfit", "Robust quick dress shop") as null|anything in custom_names custom = custom_names[selected_name] @@ -607,11 +606,11 @@ var/list/TYPES_SHORTCUTS = list( if(alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Yes","No") != "Yes") return - for(var/obj/machinery/power/emitter/E in machines) + for(var/obj/machinery/power/emitter/E in GLOB.machines) if(E.anchored) E.active = 1 - for(var/obj/machinery/field/generator/F in machines) + for(var/obj/machinery/field/generator/F in GLOB.machines) if(F.active == 0) F.active = 1 F.state = 2 @@ -622,7 +621,7 @@ var/list/TYPES_SHORTCUTS = list( F.update_icon() spawn(30) - for(var/obj/machinery/the_singularitygen/G in machines) + for(var/obj/machinery/the_singularitygen/G in GLOB.machines) if(G.anchored) var/obj/singularity/S = new /obj/singularity(get_turf(G), 50) // qdel(G) @@ -639,7 +638,7 @@ var/list/TYPES_SHORTCUTS = list( //S.dissipate_track = 0 //S.dissipate_strength = 10 - for(var/obj/machinery/power/rad_collector/Rad in machines) + for(var/obj/machinery/power/rad_collector/Rad in GLOB.machines) if(Rad.anchored) if(!Rad.loaded_tank) var/obj/item/weapon/tank/internals/plasma/Plasma = new/obj/item/weapon/tank/internals/plasma(Rad) @@ -652,7 +651,7 @@ var/list/TYPES_SHORTCUTS = list( if(!Rad.active) Rad.toggle_power() - for(var/obj/machinery/power/smes/SMES in machines) + for(var/obj/machinery/power/smes/SMES in GLOB.machines) if(SMES.anchored) SMES.input_attempt = 1 @@ -663,19 +662,19 @@ var/list/TYPES_SHORTCUTS = list( switch(input("Which list?") in list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients")) if("Players") - to_chat(usr, jointext(player_list,",")) + to_chat(usr, jointext(GLOB.player_list,",")) if("Admins") - to_chat(usr, jointext(admins,",")) + to_chat(usr, jointext(GLOB.admins,",")) if("Mobs") - to_chat(usr, jointext(mob_list,",")) + to_chat(usr, jointext(GLOB.mob_list,",")) if("Living Mobs") - to_chat(usr, jointext(living_mob_list,",")) + to_chat(usr, jointext(GLOB.living_mob_list,",")) if("Dead Mobs") - to_chat(usr, jointext(dead_mob_list,",")) + to_chat(usr, jointext(GLOB.dead_mob_list,",")) if("Clients") - to_chat(usr, jointext(clients,",")) + to_chat(usr, jointext(GLOB.clients,",")) if("Joined Clients") - to_chat(usr, jointext(joined_player_list,",")) + to_chat(usr, jointext(GLOB.joined_player_list,",")) /client/proc/cmd_display_del_log() set category = "Debug" @@ -703,7 +702,7 @@ var/list/TYPES_SHORTCUTS = list( if(!holder) return - debug_variables(huds[i]) + debug_variables(GLOB.huds[i]) /client/proc/jump_to_ruin() set category = "Debug" @@ -712,7 +711,7 @@ var/list/TYPES_SHORTCUTS = list( if(!holder) return var/list/names = list() - for(var/i in ruin_landmarks) + for(var/i in GLOB.ruin_landmarks) var/obj/effect/landmark/ruin/ruin_landmark = i var/datum/map_template/ruin/template = ruin_landmark.ruin_template @@ -757,11 +756,11 @@ var/list/TYPES_SHORTCUTS = list( if(!holder) return - global.medals_enabled = !global.medals_enabled + GLOB.medals_enabled = !GLOB.medals_enabled - message_admins("[key_name_admin(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.") + message_admins("[key_name_admin(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.") feedback_add_details("admin_verb","TMH") // If... - log_admin("[key_name(src)] [global.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.") + log_admin("[key_name(src)] [GLOB.medals_enabled ? "disabled" : "enabled"] the medal hub lockout.") /client/proc/view_runtimes() set category = "Debug" @@ -771,7 +770,7 @@ var/list/TYPES_SHORTCUTS = list( if(!holder) return - error_cache.show_to(src) + GLOB.error_cache.show_to(src) /client/proc/pump_random_event() set category = "Debug" diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 8cc400891fc57..69cb5e2b2cef6 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -54,12 +54,12 @@ set name = "Radio report" var/filters = list( - "1" = "RADIO_TO_AIRALARM", - "2" = "RADIO_FROM_AIRALARM", - "3" = "RADIO_CHAT", - "4" = "RADIO_ATMOSIA", - "5" = "RADIO_NAVBEACONS", - "6" = "RADIO_AIRLOCK", + "1" = "GLOB.RADIO_TO_AIRALARM", + "2" = "GLOB.RADIO_FROM_AIRALARM", + "3" = "GLOB.RADIO_CHAT", + "4" = "GLOB.RADIO_ATMOSIA", + "5" = "GLOB.RADIO_NAVBEACONS", + "6" = "GLOB.RADIO_AIRLOCK", "7" = "RADIO_SECBOT", "8" = "RADIO_MULEBOT", "_default" = "NO_FILTER" diff --git a/code/modules/admin/verbs/getlogs.dm b/code/modules/admin/verbs/getlogs.dm index f020ad3a884f5..116e106e24a33 100644 --- a/code/modules/admin/verbs/getlogs.dm +++ b/code/modules/admin/verbs/getlogs.dm @@ -27,7 +27,7 @@ to_chat(src, "Only Admins may use this command.") return - var/client/target = input(src,"Choose somebody to grant access to the server's runtime logs (permissions expire at the end of each round):","Grant Permissions",null) as null|anything in clients + var/client/target = input(src,"Choose somebody to grant access to the server's runtime logs (permissions expire at the end of each round):","Grant Permissions",null) as null|anything in GLOB.clients if(!istype(target,/client)) to_chat(src, "Error: giveruntimelog(): Client not found.") return @@ -85,8 +85,8 @@ set name = "Show Server Log" set desc = "Shows today's server log." - if(fexists("[diary]")) - src << ftp(diary) + if(fexists("[GLOB.diary]")) + src << ftp(GLOB.diary) else to_chat(src, "Server log not found, try using .getserverlog.") return @@ -99,8 +99,8 @@ set name = "Show Server Attack Log" set desc = "Shows today's server attack log." - if(fexists("[diaryofmeanpeople]")) - src << ftp(diaryofmeanpeople) + if(fexists("[GLOB.diaryofmeanpeople]")) + src << ftp(GLOB.diaryofmeanpeople) else to_chat(src, "Server attack log not found, try using .getserverlog.") return diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 4636cd6115305..e5e20e2e13939 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -18,9 +18,9 @@ //- Check for any misplaced or stacked piece of wire //- 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/intercom_range_display_status = 0 -var/list/admin_verbs_debug_mapping = list( +GLOBAL_PROTECT(admin_verbs_debug_mapping) +GLOBAL_LIST_INIT(admin_verbs_debug_mapping, list( /client/proc/do_not_use_these, //-errorage /client/proc/camera_view, //-errorage /client/proc/sec_camera_report, //-errorage @@ -43,7 +43,7 @@ var/list/admin_verbs_debug_mapping = list( /client/proc/cmd_show_at_list, /client/proc/cmd_show_at_list, /client/proc/manipulate_organs -) +)) /obj/effect/debugging/mapfix_marker name = "map fix marker" @@ -76,7 +76,7 @@ var/list/admin_verbs_debug_mapping = list( if(!on) var/list/seen = list() - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) for(var/turf/T in C.can_see()) seen[T]++ for(var/turf/T in seen) @@ -95,7 +95,7 @@ var/list/admin_verbs_debug_mapping = list( var/list/obj/machinery/camera/CL = list() - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) CL += C var/output = {"CAMERA ANNOMALITIES REPORT
    @@ -129,6 +129,7 @@ var/list/admin_verbs_debug_mapping = list( set category = "Mapping" set name = "Intercom Range Display" + var/static/intercom_range_display_status = 0 if(intercom_range_display_status) intercom_range_display_status = 0 else @@ -153,8 +154,8 @@ var/list/admin_verbs_debug_mapping = list( var/dat = {"Coordinate list of Active Turfs at Roundstart
    Real-time Active Turfs list you can see in Air Subsystem at active_turfs var
    "} - for(var/i=1; i<=active_turfs_startlist.len; i++) - dat += active_turfs_startlist[i] + for(var/i=1; i<=GLOB.active_turfs_startlist.len; i++) + dat += GLOB.active_turfs_startlist[i] dat += "
    " usr << browse(dat, "window=at_list") @@ -167,13 +168,13 @@ var/list/admin_verbs_debug_mapping = list( if(!check_rights(R_DEBUG)) return verbs -= /client/proc/enable_debug_verbs - verbs.Add(/client/proc/disable_debug_verbs, admin_verbs_debug_mapping) + verbs.Add(/client/proc/disable_debug_verbs, GLOB.admin_verbs_debug_mapping) feedback_add_details("admin_verb","mDVE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/disable_debug_verbs() set category = "Debug" set name = "Debug verbs - Disable" - verbs.Remove(/client/proc/disable_debug_verbs, admin_verbs_debug_mapping) + verbs.Remove(/client/proc/disable_debug_verbs, GLOB.admin_verbs_debug_mapping) verbs += /client/proc/enable_debug_verbs feedback_add_details("admin_verb", "mDVD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -249,13 +250,13 @@ var/list/admin_verbs_debug_mapping = list( //This proc is intended to detect lag problems relating to communication procs -var/global/say_disabled = 0 +GLOBAL_VAR_INIT(say_disabled, FALSE) /client/proc/disable_communication() set category = "Mapping" set name = "Disable all communication verbs" - say_disabled = !say_disabled - if(say_disabled) + GLOB.say_disabled = !GLOB.say_disabled + if(GLOB.say_disabled) message_admins("[src.ckey] used 'Disable all communication verbs', killing all communication methods.") else message_admins("[src.ckey] used 'Disable all communication verbs', restoring all communication methods.") diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index a4d4fe4fa9c05..7e7236e394067 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -37,16 +37,16 @@ var/default var/var_value = O.vars[variable] - if(variable in VVckey_edit) + if(variable in GLOB.VVckey_edit) to_chat(src, "It's forbidden to mass-modify ckeys. It'll crash everyone's client you dummy.") return - if(variable in VVlocked) + if(variable in GLOB.VVlocked) if(!check_rights(R_DEBUG)) return - if(variable in VVicon_edit_lock) + if(variable in GLOB.VVicon_edit_lock) if(!check_rights(R_FUN|R_DEBUG)) return - if(variable in VVpixelmovement) + if(variable in GLOB.VVpixelmovement) if(!check_rights(R_DEBUG)) return var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT") @@ -205,19 +205,19 @@ typecache = typecacheof(typecache) . = list() if (ispath(T, /mob)) - for(var/mob/thing in mob_list) + for(var/mob/thing in GLOB.mob_list) if (typecache[thing.type]) . += thing CHECK_TICK else if (ispath(T, /obj/machinery/door)) - for(var/obj/machinery/door/thing in airlocks) + for(var/obj/machinery/door/thing in GLOB.airlocks) if (typecache[thing.type]) . += thing CHECK_TICK else if (ispath(T, /obj/machinery)) - for(var/obj/machinery/thing in machines) + for(var/obj/machinery/thing in GLOB.machines) if (typecache[thing.type]) . += thing CHECK_TICK @@ -247,7 +247,7 @@ CHECK_TICK else if (ispath(T, /client)) - for(var/client/thing in clients) + for(var/client/thing in GLOB.clients) if (typecache[thing.type]) . += thing CHECK_TICK diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index fc7fc2f5a951e..2ac8c73d71c14 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -1,7 +1,11 @@ -var/list/VVlocked = list("vars", "var_edited", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "force_ending") -var/list/VVicon_edit_lock = list("icon", "icon_state", "overlays", "underlays", "resize") -var/list/VVckey_edit = list("key", "ckey") -var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width", "bound_x", "bound_y") +GLOBAL_LIST_INIT(VVlocked, list("vars", "var_edited", "client", "virus", "viruses", "cuffed", "last_eaten", "unlock_content", "force_ending")) +GLOBAL_PROTECT(VVlocked) +GLOBAL_LIST_INIT(VVicon_edit_lock, list("icon", "icon_state", "overlays", "underlays", "resize")) +GLOBAL_PROTECT(VVicon_edit_lock) +GLOBAL_LIST_INIT(VVckey_edit, list("key", "ckey")) +GLOBAL_PROTECT(VVckey_edit) +GLOBAL_LIST_INIT(VVpixelmovement, list("step_x", "step_y", "bound_height", "bound_width", "bound_x", "bound_y")) +GLOBAL_PROTECT(VVpixelmovement) /client/proc/vv_get_class(var/var_value) @@ -176,7 +180,7 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width if (VV_CLIENT) - .["value"] = input("Select reference:", "Reference", current_value) as null|anything in clients + .["value"] = input("Select reference:", "Reference", current_value) as null|anything in GLOB.clients if (.["value"] == null) .["class"] = null return @@ -527,16 +531,16 @@ var/list/VVpixelmovement = list("step_x", "step_y", "bound_height", "bound_width var_value = O.vars[variable] - if(variable in VVlocked) + if(variable in GLOB.VVlocked) if(!check_rights(R_DEBUG)) return - if(variable in VVckey_edit) + if(variable in GLOB.VVckey_edit) if(!check_rights(R_SPAWN|R_DEBUG)) return - if(variable in VVicon_edit_lock) + if(variable in GLOB.VVicon_edit_lock) if(!check_rights(R_FUN|R_DEBUG)) return - if(variable in VVpixelmovement) + if(variable in GLOB.VVpixelmovement) if(!check_rights(R_DEBUG)) return var/prompt = alert(src, "Editing this var may irreparably break tile gliding for the rest of the round. THIS CAN'T BE UNDONE", "DANGER", "ABORT ", "Continue", " ABORT") diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index 829d32a09ece8..0f2ce94d31d7a 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -41,7 +41,7 @@ var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in player_list) + for(var/mob/living/carbon/human/applicant in GLOB.player_list) if(ROLE_TRAITOR in applicant.client.prefs.be_special) if(!applicant.stat) if(applicant.mind) @@ -77,7 +77,7 @@ var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in player_list) + for(var/mob/living/carbon/human/applicant in GLOB.player_list) if(ROLE_CHANGELING in applicant.client.prefs.be_special) var/turf/T = get_turf(applicant) if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION) @@ -110,7 +110,7 @@ var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in player_list) + for(var/mob/living/carbon/human/applicant in GLOB.player_list) if(ROLE_REV in applicant.client.prefs.be_special) var/turf/T = get_turf(applicant) if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION) @@ -152,7 +152,7 @@ var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in player_list) + for(var/mob/living/carbon/human/applicant in GLOB.player_list) if(ROLE_CULTIST in applicant.client.prefs.be_special) var/turf/T = get_turf(applicant) if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION) @@ -185,7 +185,7 @@ var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in player_list) + for(var/mob/living/carbon/human/applicant in GLOB.player_list) if(ROLE_SERVANT_OF_RATVAR in applicant.client.prefs.be_special) var/turf/T = get_turf(applicant) if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION) @@ -241,13 +241,13 @@ var/nuke_code = random_nukecode() - var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in nuke_list + var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in GLOB.nuke_list if(nuke) nuke.r_code = nuke_code //Let's find the spawn locations var/list/turf/synd_spawn = list() - for(var/obj/effect/landmark/A in landmarks_list) + for(var/obj/effect/landmark/A in GLOB.landmarks_list) if(A.name == "Syndicate-Spawn") synd_spawn += get_turf(A) continue @@ -294,7 +294,7 @@ if(candidates.len >= 2) //Minimum 2 to be considered a squad //Pick the lucky players var/numagents = min(5,candidates.len) //How many commandos to spawn - var/list/spawnpoints = emergencyresponseteamspawn + var/list/spawnpoints = GLOB.emergencyresponseteamspawn while(numagents && candidates.len) if (numagents > spawnpoints.len) numagents-- @@ -309,15 +309,15 @@ var/mob/living/carbon/human/Commando = new(spawnloc) chosen_candidate.client.prefs.copy_to(Commando) if(numagents == 1) //If Squad Leader - Commando.real_name = "Officer [pick(commando_names)]" + Commando.real_name = "Officer [pick(GLOB.commando_names)]" Commando.equipOutfit(/datum/outfit/death_commando/officer) else - Commando.real_name = "Trooper [pick(commando_names)]" + Commando.real_name = "Trooper [pick(GLOB.commando_names)]" Commando.equipOutfit(/datum/outfit/death_commando) Commando.dna.update_dna_identity() Commando.key = chosen_candidate.key Commando.mind.assigned_role = "Death Commando" - for(var/obj/machinery/door/poddoor/ert/door in airlocks) + for(var/obj/machinery/door/poddoor/ert/door in GLOB.airlocks) spawn(0) door.open() @@ -370,7 +370,7 @@ var/list/mob/living/carbon/human/candidates = list() var/mob/living/carbon/human/H = null - for(var/mob/living/carbon/human/applicant in player_list) + for(var/mob/living/carbon/human/applicant in GLOB.player_list) if(ROLE_GANG in applicant.client.prefs.be_special) var/turf/T = get_turf(applicant) if(applicant.stat == CONSCIOUS && applicant.mind && !applicant.mind.special_role && T.z == ZLEVEL_STATION) @@ -382,7 +382,7 @@ if(candidates.len >= 2) for(var/needs_assigned=2,needs_assigned>0,needs_assigned--) H = pick(candidates) - if(gang_colors_pool.len) + if(GLOB.gang_colors_pool.len) var/datum/gang/newgang = new() SSticker.mode.gangs += newgang H.mind.make_Gang(newgang) @@ -402,7 +402,7 @@ var/mob/dead/observer/chosen_candidate = pick(candidates) //Create the official - var/mob/living/carbon/human/newmob = new (pick(emergencyresponseteamspawn)) + var/mob/living/carbon/human/newmob = new (pick(GLOB.emergencyresponseteamspawn)) chosen_candidate.client.prefs.copy_to(newmob) newmob.real_name = newmob.dna.species.random_name(newmob.gender,1) newmob.dna.update_dna_identity() @@ -467,7 +467,7 @@ if (alert == "Red") numagents = min(teamsize,candidates.len) redalert = 1 - var/list/spawnpoints = emergencyresponseteamspawn + var/list/spawnpoints = GLOB.emergencyresponseteamspawn while(numagents && candidates.len) if (numagents > spawnpoints.len) numagents-- @@ -480,7 +480,7 @@ //Spawn and equip the officer var/mob/living/carbon/human/ERTOperative = new(spawnloc) - var/list/lastname = last_names + var/list/lastname = GLOB.last_names chosen_candidate.client.prefs.copy_to(ERTOperative) var/ertname = pick(lastname) switch(numagents) @@ -511,7 +511,7 @@ //Open the Armory doors if(alert != "Blue") - for(var/obj/machinery/door/poddoor/ert/door in airlocks) + for(var/obj/machinery/door/poddoor/ert/door in GLOB.airlocks) spawn(0) door.open() diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index 762be9e00debf..d8db479d5b8a6 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -1,16 +1,16 @@ -var/highlander = FALSE +GLOBAL_VAR_INIT(highlander, FALSE) /client/proc/only_one() //Gives everyone kilts, berets, claymores, and pinpointers, with the objective to hijack the emergency shuttle. if(!SSticker || !SSticker.mode) alert("The game hasn't started yet!") return - highlander = TRUE + GLOB.highlander = TRUE send_to_playing_players("THERE CAN BE ONLY ONE") - for(var/obj/item/weapon/disk/nuclear/N in poi_list) + for(var/obj/item/weapon/disk/nuclear/N in GLOB.poi_list) N.relocate() //Gets it out of bags and such - for(var/mob/living/carbon/human/H in player_list) + for(var/mob/living/carbon/human/H in GLOB.player_list) if(H.stat == DEAD || !(H.client)) continue H.make_scottish() @@ -64,7 +64,7 @@ var/highlander = FALSE equip_to_slot_or_del(W, slot_wear_id) var/obj/item/weapon/claymore/highlander/H1 = new(src) - if(!highlander) + if(!GLOB.highlander) H1.admin_spawned = TRUE //To prevent announcing put_in_hands(H1) H1.pickup(src) //For the stun shielding @@ -83,7 +83,7 @@ var/highlander = FALSE alert("The game hasn't started yet!") return - for(var/mob/living/carbon/human/H in player_list) + for(var/mob/living/carbon/human/H in GLOB.player_list) if(H.stat == 2 || !(H.client)) continue if(is_special_character(H)) continue diff --git a/code/modules/admin/verbs/panicbunker.dm b/code/modules/admin/verbs/panicbunker.dm index ac31c26071a3a..66c28442c79da 100644 --- a/code/modules/admin/verbs/panicbunker.dm +++ b/code/modules/admin/verbs/panicbunker.dm @@ -9,7 +9,7 @@ log_admin("[key_name(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"on":"off")]") message_admins("[key_name_admin(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"enabled":"disabled")].") - if (config.panic_bunker && (!dbcon || !dbcon.IsConnected())) + if (config.panic_bunker && (!GLOB.dbcon || !GLOB.dbcon.IsConnected())) message_admins("The Database is not connected! Panic bunker will not work until the connection is reestablished.") feedback_add_details("admin_verb","PANIC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index 27a6c1107e537..f6ad9621698fb 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,6 +1,3 @@ - -var/sound/admin_sound - /client/proc/play_sound(S as sound) set category = "Fun" set name = "Play Global Sound" @@ -24,7 +21,7 @@ var/sound/admin_sound admin_sound.repeat = 0 admin_sound.status = SOUND_STREAM - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.client.prefs.toggles & SOUND_MIDI) M << admin_sound @@ -65,7 +62,7 @@ var/sound/admin_sound log_admin("[key_name(src)] stopped all currently playing sounds.") message_admins("[key_name_admin(src)] stopped all currently playing sounds.") - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.client) M << sound(null) feedback_add_details("admin_verb","SS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/possess.dm b/code/modules/admin/verbs/possess.dm index 8afc0fdca8de4..2623e28cec8c9 100644 --- a/code/modules/admin/verbs/possess.dm +++ b/code/modules/admin/verbs/possess.dm @@ -43,7 +43,7 @@ usr.control_object = null feedback_add_details("admin_verb","RO") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/proc/givetestverbs(mob/M in mob_list) +/proc/givetestverbs(mob/M in GLOB.mob_list) set desc = "Give this guy possess/release verbs" set category = "Debug" set name = "Give Possessing Verbs" diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm index e9688ec89edd0..7427684082fbd 100644 --- a/code/modules/admin/verbs/pray.dm +++ b/code/modules/admin/verbs/pray.dm @@ -2,7 +2,7 @@ set category = "IC" set name = "Pray" - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return @@ -35,7 +35,7 @@ msg = "\icon[cross][prayer_type][deity ? " (to [deity])" : ""]: [ADMIN_FULLMONTY(src)] [ADMIN_SC(src)] [ADMIN_SMITE(src)]: [msg]" - for(var/client/C in admins) + for(var/client/C in GLOB.admins) if(C.prefs.chat_toggles & CHAT_PRAYER) to_chat(C, msg) if(C.prefs.toggles & SOUND_PRAYERS) @@ -49,20 +49,20 @@ /proc/Centcomm_announce(text , mob/Sender) var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN) msg = "CENTCOM:[ADMIN_FULLMONTY(Sender)] [ADMIN_SMITE(Sender)] [ADMIN_CENTCOM_REPLY(Sender)]: [msg]" - to_chat(admins, msg) - for(var/obj/machinery/computer/communications/C in machines) + to_chat(GLOB.admins, msg) + for(var/obj/machinery/computer/communications/C in GLOB.machines) C.overrideCooldown() /proc/Syndicate_announce(text , mob/Sender) var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN) msg = "SYNDICATE:[ADMIN_FULLMONTY(Sender)] [ADMIN_SMITE(Sender)] [ADMIN_SYNDICATE_REPLY(Sender)]: [msg]" - to_chat(admins, msg) - for(var/obj/machinery/computer/communications/C in machines) + to_chat(GLOB.admins, msg) + for(var/obj/machinery/computer/communications/C in GLOB.machines) C.overrideCooldown() /proc/Nuke_request(text , mob/Sender) var/msg = copytext(sanitize(text), 1, MAX_MESSAGE_LEN) msg = "NUKE CODE REQUEST:[ADMIN_FULLMONTY(Sender)] [ADMIN_SMITE(Sender)] [ADMIN_CENTCOM_REPLY(Sender)] [ADMIN_SET_SD_CODE]: [msg]" - to_chat(admins, msg) - for(var/obj/machinery/computer/communications/C in machines) + to_chat(GLOB.admins, msg) + for(var/obj/machinery/computer/communications/C in GLOB.machines) C.overrideCooldown() diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 6446f1c1f5b62..02f54454098d9 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1,4 +1,4 @@ -/client/proc/cmd_admin_drop_everything(mob/M in mob_list) +/client/proc/cmd_admin_drop_everything(mob/M in GLOB.mob_list) set category = null set name = "Drop Everything" if(!holder) @@ -19,7 +19,7 @@ feedback_add_details("admin_verb","DEVR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_subtle_message(mob/M in mob_list) +/client/proc/cmd_admin_subtle_message(mob/M in GLOB.mob_list) set category = "Special Verbs" set name = "Subtle Message" @@ -70,7 +70,7 @@ return if(!M) - M = input("Direct narrate to whom?", "Active Players") as null|anything in player_list + M = input("Direct narrate to whom?", "Active Players") as null|anything in GLOB.player_list if(!M) return @@ -107,7 +107,7 @@ message_admins(" LocalNarrate: [key_name_admin(usr)] at ([get_area(A)]): [msg]
    ") feedback_add_details("admin_verb","LN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_godmode(mob/M in mob_list) +/client/proc/cmd_admin_godmode(mob/M in GLOB.mob_list) set category = "Special Verbs" set name = "Godmode" if(!holder) @@ -147,7 +147,7 @@ if(istype(whom, /client)) C = whom else if(istext(whom)) - C = directory[whom] + C = GLOB.directory[whom] else return @@ -155,7 +155,7 @@ if(C) P = C.prefs else - P = preferences_datums[whom] + P = GLOB.preferences_datums[whom] if(!P) return @@ -194,7 +194,7 @@ /proc/create_xeno(ckey) if(!ckey) var/list/candidates = list() - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.stat != DEAD) continue //we are not dead! if(!(ROLE_ALIEN in M.client.prefs.be_special)) @@ -212,7 +212,7 @@ return 0 var/alien_caste = input(usr, "Please choose which caste to spawn.","Pick a caste",null) as null|anything in list("Queen","Praetorian","Hunter","Sentinel","Drone","Larva") - var/obj/effect/landmark/spawn_here = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin) + var/obj/effect/landmark/spawn_here = GLOB.xeno_spawn.len ? pick(GLOB.xeno_spawn) : pick(GLOB.latejoin) var/mob/living/carbon/alien/new_xeno switch(alien_caste) if("Queen") @@ -251,7 +251,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/mob/dead/observer/G_found - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) if(G.ckey == input) G_found = G break @@ -265,10 +265,10 @@ Traitors and the like can also be revived with the previous role mostly intact. if(G_found.mind.assigned_role=="Alien") if(alert("This character appears to have been an alien. Would you like to respawn them as such?",,"Yes","No")=="Yes") var/turf/T - if(xeno_spawn.len) - T = pick(xeno_spawn) + if(GLOB.xeno_spawn.len) + T = pick(GLOB.xeno_spawn) else - T = pick(latejoin) + T = pick(GLOB.latejoin) var/mob/living/carbon/alien/new_xeno switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were. @@ -296,7 +296,7 @@ Traitors and the like can also be revived with the previous role mostly intact. //check if they were a monkey else if(findtext(G_found.real_name,"monkey")) if(alert("This character appears to have been a monkey. Would you like to respawn them as such?",,"Yes","No")=="Yes") - var/mob/living/carbon/monkey/new_monkey = new(pick(latejoin)) + var/mob/living/carbon/monkey/new_monkey = new(pick(GLOB.latejoin)) G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use new_monkey.key = G_found.key to_chat(new_monkey, "You have been fully respawned. Enjoy the game.") @@ -305,15 +305,15 @@ Traitors and the like can also be revived with the previous role mostly intact. //Ok, it's not a xeno or a monkey. So, spawn a human. - var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. + var/mob/living/carbon/human/new_character = new(pick(GLOB.latejoin))//The mob being spawned. var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character. if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something - /*Try and locate a record for the person being respawned through data_core. + /*Try and locate a record for the person being respawned through GLOB.data_core. This isn't an exact science but it does the trick more often than not.*/ var/id = md5("[G_found.real_name][G_found.mind.assigned_role]") - record_found = find_record("id", id, data_core.locked) + record_found = find_record("id", id, GLOB.data_core.locked) if(record_found)//If they have a record we can determine a few things. new_character.real_name = record_found.fields["name"] @@ -354,7 +354,7 @@ Traitors and the like can also be revived with the previous role mostly intact. SSjob.EquipRank(new_character, new_character.mind.assigned_role, 1) SSticker.mode.equip_traitor(new_character) if("Wizard") - new_character.loc = pick(wizardstart) + new_character.loc = pick(GLOB.wizardstart) //SSticker.mode.learn_basic_spells(new_character) SSticker.mode.equip_wizard(new_character) if("Syndicate") @@ -364,7 +364,7 @@ Traitors and the like can also be revived with the previous role mostly intact. call(/datum/game_mode/proc/equip_syndicate)(new_character) if("Space Ninja") var/list/ninja_spawn = list() - for(var/obj/effect/landmark/L in landmarks_list) + for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(L.name=="carpspawn") ninja_spawn += L new_character.equip_space_ninja() @@ -392,7 +392,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!record_found&&new_character.mind.assigned_role!=new_character.mind.special_role)//If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway. //Power to the user! if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes") - data_core.manifest_inject(new_character) + GLOB.data_core.manifest_inject(new_character) if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes") AnnounceArrival(new_character, new_character.mind.assigned_role) @@ -426,7 +426,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","IONC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/cmd_admin_rejuvenate(mob/living/M in mob_list) +/client/proc/cmd_admin_rejuvenate(mob/living/M in GLOB.mob_list) set category = "Special Verbs" set name = "Rejuvenate" if(!holder) @@ -565,7 +565,7 @@ Traitors and the like can also be revived with the previous role mostly intact. else return -/client/proc/cmd_admin_gib(mob/M in mob_list) +/client/proc/cmd_admin_gib(mob/M in GLOB.mob_list) set category = "Special Verbs" set name = "Gib" @@ -603,7 +603,7 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! mob.gib(1, 1, 1) -/client/proc/cmd_admin_check_contents(mob/living/M in mob_list) +/client/proc/cmd_admin_check_contents(mob/living/M in GLOB.mob_list) set category = "Special Verbs" set name = "Check Contents" @@ -731,7 +731,7 @@ Traitors and the like can also be revived with the previous role mostly intact. message_admins("[key_name_admin(usr)] changed the security level to [level]") feedback_add_details("admin_verb","CSL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in nuke_list) +/client/proc/toggle_nuke(obj/machinery/nuclearbomb/N in GLOB.nuke_list) set name = "Toggle Nuke" set category = "Fun" set popup_menu = 0 @@ -750,7 +750,7 @@ Traitors and the like can also be revived with the previous role mostly intact. message_admins("[ADMIN_LOOKUPFLW(usr)] [N.timing ? "activated" : "deactivated"] a nuke at [ADMIN_COORDJMP(N)].") feedback_add_details("admin_verb","TN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -var/list/datum/outfit/custom_outfits = list() //Admin created outfits +GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits /client/proc/create_outfits() set category = "Debug" @@ -935,7 +935,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits var/adding_hud = !has_antag_hud() - for(var/datum/atom_hud/H in huds) + for(var/datum/atom_hud/H in GLOB.huds) if(istype(H, /datum/atom_hud/antag)) (adding_hud) ? H.add_hud_to(usr) : H.remove_hud_from(usr) @@ -949,7 +949,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits feedback_add_details("admin_verb","TAH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/has_antag_hud() - var/datum/atom_hud/A = huds[ANTAG_HUD_TRAITOR] + var/datum/atom_hud/A = GLOB.huds[ANTAG_HUD_TRAITOR] return mob in A.hudusers /client/proc/open_shuttle_manipulator() @@ -957,7 +957,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits set name = "Shuttle Manipulator" set desc = "Opens the shuttle manipulator UI." - for(var/obj/machinery/shuttle_manipulator/M in machines) + for(var/obj/machinery/shuttle_manipulator/M in GLOB.machines) M.ui_interact(usr) /client/proc/mass_zombie_infection() @@ -973,7 +973,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits if(confirm != "Yes") return - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) new /obj/item/organ/zombie_infection(H) message_admins("[key_name_admin(usr)] added a latent zombie infection to all humans.") @@ -991,7 +991,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits if(confirm != "Yes") return - for(var/obj/item/organ/zombie_infection/I in zombie_infection_list) + for(var/obj/item/organ/zombie_infection/I in GLOB.zombie_infection_list) qdel(I) message_admins("[key_name_admin(usr)] cured all zombies.") @@ -1010,7 +1010,7 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits if(confirm != "Yes") return - var/list/mobs = shuffle(living_mob_list.Copy()) // might change while iterating + var/list/mobs = shuffle(GLOB.living_mob_list.Copy()) // might change while iterating var/who_did_it = key_name_admin(usr) message_admins("[key_name_admin(usr)] started polymorphed all living mobs.") @@ -1061,13 +1061,13 @@ var/list/datum/outfit/custom_outfits = list() //Admin created outfits #define ON_PURRBATION(H) (!(H.dna.features["tail_human"] == "None" && H.dna.features["ears"] == "None")) /proc/mass_purrbation() - for(var/M in mob_list) + for(var/M in GLOB.mob_list) if(ishumanbasic(M)) purrbation_apply(M) CHECK_TICK /proc/mass_remove_purrbation() - for(var/M in mob_list) + for(var/M in GLOB.mob_list) if(ishumanbasic(M)) purrbation_remove(M) CHECK_TICK diff --git a/code/modules/admin/verbs/reestablish_db_connection.dm b/code/modules/admin/verbs/reestablish_db_connection.dm index f8daf79da6ef3..597de3b13f9c2 100644 --- a/code/modules/admin/verbs/reestablish_db_connection.dm +++ b/code/modules/admin/verbs/reestablish_db_connection.dm @@ -5,7 +5,7 @@ to_chat(usr, "The Database is not enabled!") return - if (dbcon && dbcon.IsConnected()) + if (GLOB.dbcon && GLOB.dbcon.IsConnected()) if (!check_rights(R_DEBUG,0)) alert("The database is already connected! (Only those with +debug can force a reconnection)", "The database is already connected!") return @@ -14,7 +14,7 @@ if (reconnect != "Force Reconnect") return - dbcon.Disconnect() + GLOB.dbcon.Disconnect() log_admin("[key_name(usr)] has forced the database to disconnect") message_admins("[key_name_admin(usr)] has forced the database to disconnect!") feedback_add_details("admin_verb","FRDB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -23,8 +23,8 @@ message_admins("[key_name_admin(usr)] is attempting to re-established the DB Connection") feedback_add_details("admin_verb","RDB") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - dbcon.failed_connections = 0 - if(!dbcon.Connect()) - message_admins("Database connection failed: " + dbcon.ErrorMsg()) + GLOB.dbcon.failed_connections = 0 + if(!GLOB.dbcon.Connect()) + message_admins("Database connection failed: " + GLOB.dbcon.ErrorMsg()) else message_admins("Database connection re-established") \ No newline at end of file diff --git a/code/modules/admin/whitelist.dm b/code/modules/admin/whitelist.dm index 079f502668677..b922518812ca8 100644 --- a/code/modules/admin/whitelist.dm +++ b/code/modules/admin/whitelist.dm @@ -1,22 +1,23 @@ #define WHITELISTFILE "config/whitelist.txt" -var/list/whitelist +GLOBAL_LIST(whitelist) +GLOBAL_PROTECT(whitelist) /proc/load_whitelist() - whitelist = list() + GLOB.whitelist = list() for(var/line in file2list(WHITELISTFILE)) if(!line) continue if(findtextEx(line,"#",1,2)) continue - whitelist += line + GLOB.whitelist += line - if(!whitelist.len) - whitelist = null + if(!GLOB.whitelist.len) + GLOB.whitelist = null /proc/check_whitelist(var/ckey) - if(!whitelist) + if(!GLOB.whitelist) return FALSE - . = (ckey in whitelist) + . = (ckey in GLOB.whitelist) #undef WHITELISTFILE diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index 481e692a5d794..e761b05e9296e 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -45,12 +45,12 @@ if((istype(W, /obj/item/weapon/weldingtool) && W:welding)) if(!status) status = 1 - bombers += "[key_name(user)] welded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]" + GLOB.bombers += "[key_name(user)] welded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]" message_admins("[key_name_admin(user)] welded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]") to_chat(user, "A pressure hole has been bored to [bombtank] valve. \The [bombtank] can now be ignited.") else status = 0 - bombers += "[key_name(user)] unwelded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]" + GLOB.bombers += "[key_name(user)] unwelded a single tank bomb. Temp: [bombtank.air_contents.temperature-T0C]" to_chat(user, "The hole has been closed.") add_fingerprint(user) ..() diff --git a/code/modules/assembly/doorcontrol.dm b/code/modules/assembly/doorcontrol.dm index 14ad9a6c3b859..630dc3d0bcaae 100644 --- a/code/modules/assembly/doorcontrol.dm +++ b/code/modules/assembly/doorcontrol.dm @@ -17,7 +17,7 @@ /obj/item/device/assembly/control/activate() cooldown = 1 var/openclose - for(var/obj/machinery/door/poddoor/M in machines) + for(var/obj/machinery/door/poddoor/M in GLOB.machines) if(M.id == src.id) if(openclose == null) openclose = M.density @@ -49,7 +49,7 @@ cooldown = 1 var/doors_need_closing = FALSE var/list/obj/machinery/door/airlock/open_or_close = list() - for(var/obj/machinery/door/airlock/D in airlocks) + for(var/obj/machinery/door/airlock/D in GLOB.airlocks) if(D.id_tag == src.id) if(specialfunctions & OPEN) open_or_close += D @@ -84,20 +84,20 @@ /obj/item/device/assembly/control/massdriver/activate() cooldown = 1 - for(var/obj/machinery/door/poddoor/M in machines) + for(var/obj/machinery/door/poddoor/M in GLOB.machines) if (M.id == src.id) spawn( 0 ) M.open() sleep(10) - for(var/obj/machinery/mass_driver/M in machines) + for(var/obj/machinery/mass_driver/M in GLOB.machines) if(M.id == src.id) M.drive() sleep(60) - for(var/obj/machinery/door/poddoor/M in machines) + for(var/obj/machinery/door/poddoor/M in GLOB.machines) if (M.id == src.id) spawn( 0 ) M.close() @@ -112,12 +112,12 @@ /obj/item/device/assembly/control/igniter/activate() cooldown = 1 - for(var/obj/machinery/sparker/M in machines) + for(var/obj/machinery/sparker/M in GLOB.machines) if (M.id == src.id) spawn( 0 ) M.ignite() - for(var/obj/machinery/igniter/M in machines) + for(var/obj/machinery/igniter/M in GLOB.machines) if(M.id == src.id) M.use_power(50) M.on = !M.on @@ -133,7 +133,7 @@ /obj/item/device/assembly/control/flasher/activate() cooldown = 1 - for(var/obj/machinery/flasher/M in machines) + for(var/obj/machinery/flasher/M in GLOB.machines) if(M.id == src.id) spawn(0) M.flash() @@ -148,7 +148,7 @@ /obj/item/device/assembly/control/crematorium/activate() cooldown = 1 - for (var/obj/structure/bodycontainer/crematorium/C in crematoriums) + for (var/obj/structure/bodycontainer/crematorium/C in GLOB.crematoriums) if (C.id == id) C.cremate(usr) diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index cf00655c3a3f2..e81ac988e254b 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -118,7 +118,7 @@ Code: var/time = time2text(world.realtime,"hh:mm:ss") var/turf/T = get_turf(src) if(usr) - lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") + GLOB.lastsignalers.Add("[time] : [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) : [format_frequency(frequency)]/[code]") return @@ -153,7 +153,7 @@ Code: return SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_CHAT) return // Embedded signaller used in grenade construction. diff --git a/code/modules/assembly/timer.dm b/code/modules/assembly/timer.dm index 12f8f464dc598..f4c36c1f4a457 100644 --- a/code/modules/assembly/timer.dm +++ b/code/modules/assembly/timer.dm @@ -95,7 +95,7 @@ if(timing && istype(holder, /obj/item/device/transfer_valve)) var/timer_message = "[key_name_admin(usr)](?) (FLW) activated [src] attachment on [holder]." message_admins(timer_message) - bombers += timer_message + GLOB.bombers += timer_message log_game("[key_name(usr)] activated [src] attachment for [loc]") update_icon() if(href_list["repeat"]) diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm index ae9065eacfddd..a52a725954911 100644 --- a/code/modules/atmospherics/environmental/LINDA_fire.dm +++ b/code/modules/atmospherics/environmental/LINDA_fire.dm @@ -61,7 +61,7 @@ ..() SSair.hotspots += src perform_exposure() - setDir(pick(cardinal)) + setDir(pick(GLOB.cardinal)) air_update_turf() diff --git a/code/modules/atmospherics/environmental/LINDA_system.dm b/code/modules/atmospherics/environmental/LINDA_system.dm index ae4841c5e6ff8..196d4dca9c370 100644 --- a/code/modules/atmospherics/environmental/LINDA_system.dm +++ b/code/modules/atmospherics/environmental/LINDA_system.dm @@ -39,7 +39,7 @@ /turf/proc/CalculateAdjacentTurfs() var/list/atmos_adjacent_turfs = src.atmos_adjacent_turfs - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src, direction) if(!T) continue @@ -72,11 +72,11 @@ var/turf/curloc = src - for (var/direction in diagonals) + for (var/direction in GLOB.diagonals) var/matchingDirections = 0 var/turf/S = get_step(curloc, direction) - for (var/checkDirection in cardinal) + for (var/checkDirection in GLOB.cardinal) var/turf/checkTurf = get_step(S, checkDirection) if(!S.atmos_adjacent_turfs || !S.atmos_adjacent_turfs[checkTurf]) continue diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index 4b42f1370d71c..f78f1724d8b15 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -364,7 +364,7 @@ /turf/open/conductivity_directions() if(blocks_air) return ..() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(src, direction) if(!(T in atmos_adjacent_turfs) && !(atmos_supeconductivity & direction)) . |= direction @@ -393,7 +393,7 @@ if(conductivity_directions) //Conduct with tiles around me - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(conductivity_directions & direction) var/turf/neighbor = get_step(src,direction) diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index a83504a631304..ec6f402d1f33b 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -7,22 +7,22 @@ What are the archived variables for? #define QUANTIZE(variable) (round(variable,0.0000001))/*I feel the need to document what happens here. Basically this is used to catch most rounding errors, however it's previous value made it so that once gases got hot enough, most procedures wouldnt occur due to the fact that the mole counts would get rounded away. Thus, we lowered it a few orders of magnititude */ -var/list/meta_gas_info = meta_gas_list() //see ATMOSPHERICS/gas_types.dm -var/list/gaslist_cache = init_gaslist_cache() +GLOBAL_LIST_INIT(meta_gas_info, meta_gas_list()) //see ATMOSPHERICS/gas_types.dm +GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache()) /proc/init_gaslist_cache() . = list() - for(var/id in meta_gas_info) + for(var/id in GLOB.meta_gas_info) var/list/cached_gas = new(3) .[id] = cached_gas cached_gas[MOLES] = 0 cached_gas[ARCHIVE] = 0 - cached_gas[GAS_META] = meta_gas_info[id] + cached_gas[GAS_META] = GLOB.meta_gas_info[id] #define GASLIST(id, out_list)\ - var/list/tmp_gaslist = gaslist_cache[id];\ + var/list/tmp_gaslist = GLOB.gaslist_cache[id];\ out_list = tmp_gaslist.Copy(); /datum/gas_mixture diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 74f025e93e3bb..10a9a7f65d995 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -1,4 +1,4 @@ -var/list/hardcoded_gases = list("o2","n2","co2","plasma") //the main four gases, which were at one time hardcoded +GLOBAL_LIST_INIT(hardcoded_gases, list("o2","n2","co2","plasma")) //the main four gases, which were at one time hardcoded /proc/meta_gas_list() . = new /list diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 3d65e5be24ecd..5c197332d12ca 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -54,7 +54,7 @@ idle_power_usage = 4 active_power_usage = 8 power_channel = ENVIRON - req_access = list(access_atmospherics) + req_access = list(GLOB.access_atmospherics) obj_integrity = 250 max_integrity = 250 integrity_failure = 80 @@ -158,7 +158,7 @@ return UI_CLOSE /obj/machinery/airalarm/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "airalarm", name, 440, 650, master_ui, state) @@ -277,11 +277,11 @@ thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max1", "selected" = selected.max1)) thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max2", "selected" = selected.max2)) - for(var/gas_id in meta_gas_info) + for(var/gas_id in GLOB.meta_gas_info) if(!(gas_id in TLV)) // We're not interested in this gas, it seems. continue selected = TLV[gas_id] - thresholds += list(list("name" = meta_gas_info[gas_id][META_GAS_NAME], "settings" = list())) + thresholds += list(list("name" = GLOB.meta_gas_info[gas_id][META_GAS_NAME], "settings" = list())) thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min2", "selected" = selected.min2)) thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min1", "selected" = selected.min1)) thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "max1", "selected" = selected.max1)) @@ -389,7 +389,7 @@ /obj/machinery/airalarm/proc/set_frequency(new_frequency) SSradio.remove_object(src, frequency) frequency = new_frequency - radio_connection = SSradio.add_object(src, frequency, RADIO_TO_AIRALARM) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_TO_AIRALARM) /obj/machinery/airalarm/proc/send_signal(target, list/command)//sends signal 'command' to 'target'. Returns 0 if no radio connection, 1 otherwise if(!radio_connection) @@ -403,7 +403,7 @@ signal.data["tag"] = target signal.data["sigtype"] = "command" - radio_connection.post_signal(src, signal, RADIO_FROM_AIRALARM) + radio_connection.post_signal(src, signal, GLOB.RADIO_FROM_AIRALARM) // to_chat(world, text("Signal [] Broadcasted to []", command, target)) return 1 diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 35a80ae314641..44f9091530925 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -67,7 +67,7 @@ Pipelines + Other Objects -> Pipe network node_connects.len = device_type for(DEVICE_TYPE_LOOP) - for(var/D in cardinal) + for(var/D in GLOB.cardinal) if(D & GetInitDirections()) if(D in node_connects) continue @@ -170,7 +170,7 @@ Pipelines + Other Objects -> Pipe network var/fuck_you_dir = get_dir(src, user) // Because fuck you... if(!fuck_you_dir) - fuck_you_dir = pick(cardinal) + fuck_you_dir = pick(GLOB.cardinal) var/turf/target = get_edge_target_turf(user, fuck_you_dir) var/range = pressures/250 var/speed = range/5 @@ -245,7 +245,7 @@ Pipelines + Other Objects -> Pipe network var/obj/machinery/atmospherics/target_move = findConnecting(direction) if(target_move) if(target_move.can_crawl_through()) - if(is_type_in_list(target_move, ventcrawl_machinery)) + if(is_type_in_list(target_move, GLOB.ventcrawl_machinery)) user.forceMove(target_move.loc) //handle entering and so on. user.visible_message("You hear something squeezing through the ducts...","You climb out the ventilation system.") else @@ -258,7 +258,7 @@ Pipelines + Other Objects -> Pipe network user.last_played_vent = world.time playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3) else - if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent + if((direction & initialize_directions) || is_type_in_list(src, GLOB.ventcrawl_machinery) && can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent user.forceMove(src.loc) user.visible_message("You hear something squeezing through the ducts...","You climb out the ventilation system.") user.canmove = 0 @@ -267,7 +267,7 @@ Pipelines + Other Objects -> Pipe network /obj/machinery/atmospherics/AltClick(mob/living/L) - if(is_type_in_list(src, ventcrawl_machinery)) + if(is_type_in_list(src, GLOB.ventcrawl_machinery)) L.handle_ventcrawl(src) return ..() diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index b61e862502cf8..7aae7f5530eaa 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -126,7 +126,7 @@ Acts like a normal vent, but has an input AND output. SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/dp_vent_pump/proc/broadcast_status() if(!radio_connection) @@ -147,7 +147,7 @@ Acts like a normal vent, but has an input AND output. "external" = external_pressure_bound, "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) return 1 diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm index fe0716a901742..6ddeca63787f8 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm @@ -70,7 +70,7 @@ Passive gate is similar to the regular pump except: SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/passive_gate/proc/broadcast_status() if(!radio_connection) @@ -88,12 +88,12 @@ Passive gate is similar to the regular pump except: "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) return 1 /obj/machinery/atmospherics/components/binary/passive_gate/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_pump", name, 335, 115, master_ui, state) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm index 742ddfb52e335..319c9895317ef 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm @@ -77,7 +77,7 @@ Thus, the two variables affect pump operation are set in New(): SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, filter = RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, filter = GLOB.RADIO_ATMOSIA) /obj/machinery/atmospherics/components/binary/pump/proc/broadcast_status() if(!radio_connection) @@ -95,12 +95,12 @@ Thus, the two variables affect pump operation are set in New(): "sigtype" = "status" ) - radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA) + radio_connection.post_signal(src, signal, filter = GLOB.RADIO_ATMOSIA) return 1 /obj/machinery/atmospherics/components/binary/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_pump", name, 335, 115, master_ui, state) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm index 8aa6bacee5798..6b5c0c18db0e9 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm @@ -95,7 +95,7 @@ Thus, the two variables affect pump operation are set in New(): return 1 /obj/machinery/atmospherics/components/binary/volume_pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_pump", name, 310, 115, master_ui, state) diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm index 83f5e2cb6a61c..9bf5f276f5bba 100644 --- a/code/modules/atmospherics/machinery/components/components_base.dm +++ b/code/modules/atmospherics/machinery/components/components_base.dm @@ -31,7 +31,7 @@ Iconnery /obj/machinery/atmospherics/components/proc/icon_addbroken(var/connected = 0) var/unconnected = (~connected) & initialize_directions - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(unconnected & direction) underlays += getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_exposed", direction) diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm index e8edd9b2a2fea..4b9c2c710f136 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm @@ -17,7 +17,7 @@ SSradio.remove_object(src, frequency) frequency = new_frequency if(frequency) - radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA) + radio_connection = SSradio.add_object(src, frequency, GLOB.RADIO_ATMOSIA) /obj/machinery/atmospherics/components/trinary/filter/Destroy() if(SSradio) @@ -26,7 +26,7 @@ /obj/machinery/atmospherics/components/trinary/filter/update_icon() cut_overlays() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction & initialize_directions) var/obj/machinery/atmospherics/node = findConnecting(direction) if(node) @@ -113,7 +113,7 @@ return ..() /obj/machinery/atmospherics/components/trinary/filter/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_filter", name, 475, 155, master_ui, state) @@ -154,9 +154,9 @@ filter_type = "" var/filter_name = "nothing" var/gas = params["mode"] - if(gas in meta_gas_info) + if(gas in GLOB.meta_gas_info) filter_type = gas - filter_name = meta_gas_info[gas][META_GAS_NAME] + filter_name = GLOB.meta_gas_info[gas][META_GAS_NAME] investigate_log("was set to filter [filter_name] by [key_name(usr)]", "atmos") . = TRUE update_icon() diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm index 97322d3d503a3..ed168c7153d08 100644 --- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm +++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm @@ -19,7 +19,7 @@ /obj/machinery/atmospherics/components/trinary/mixer/update_icon() cut_overlays() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) if(direction & initialize_directions) var/obj/machinery/atmospherics/node = findConnecting(direction) if(node) @@ -117,7 +117,7 @@ return TRUE /obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "atmos_mixer", name, 370, 165, master_ui, state) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 29e2455f206be..c601d1601d72a 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -239,7 +239,7 @@ return ..() /obj/machinery/atmospherics/components/unary/cryo_cell/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = notcontained_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "cryo", name, 400, 550, master_ui, state) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index ca5e4960376f8..8761211f7251a 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -146,7 +146,7 @@ return UI_CLOSE /obj/machinery/atmospherics/components/unary/thermomachine/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "thermomachine", name, 400, 240, master_ui, state) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index 771e718e0dfbe..8c43a28da4eeb 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -178,8 +178,8 @@ /obj/machinery/atmospherics/components/unary/vent_pump/atmosinit() //some vents work his own spesial way - radio_filter_in = frequency==1439?(RADIO_FROM_AIRALARM):null - radio_filter_out = frequency==1439?(RADIO_TO_AIRALARM):null + radio_filter_in = frequency==1439?(GLOB.RADIO_FROM_AIRALARM):null + radio_filter_out = frequency==1439?(GLOB.RADIO_TO_AIRALARM):null if(frequency) set_frequency(frequency) broadcast_status() diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm index 4a3d6fbc195e5..baa3a2e85f338 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm @@ -142,8 +142,8 @@ return 1 /obj/machinery/atmospherics/components/unary/vent_scrubber/atmosinit() - radio_filter_in = frequency==initial(frequency)?(RADIO_FROM_AIRALARM):null - radio_filter_out = frequency==initial(frequency)?(RADIO_TO_AIRALARM):null + radio_filter_in = frequency==initial(frequency)?(GLOB.RADIO_FROM_AIRALARM):null + radio_filter_out = frequency==initial(frequency)?(GLOB.RADIO_TO_AIRALARM):null if(frequency) set_frequency(frequency) broadcast_status() diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm index d794b01bf77db..67b1d0d569bbb 100644 --- a/code/modules/atmospherics/machinery/datum_pipeline.dm +++ b/code/modules/atmospherics/machinery/datum_pipeline.dm @@ -29,8 +29,6 @@ reconcile_air() update = air.react() -var/pipenetwarnings = 10 - /datum/pipeline/proc/build_pipeline(obj/machinery/atmospherics/base) var/volume = 0 if(istype(base, /obj/machinery/atmospherics/pipe)) @@ -57,6 +55,7 @@ var/pipenetwarnings = 10 if(!members.Find(item)) if(item.parent) + var/static/pipenetwarnings = 10 if(pipenetwarnings > 0) warning("build_pipeline(): [item.type] added to a pipenet while still having one. (pipes leading to the same spot stacking in one turf) Nearby: ([item.x], [item.y], [item.z])") pipenetwarnings -= 1 diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm index 9dcad6efa66b8..46ebf95dd00c4 100644 --- a/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm +++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/simple.dm @@ -10,7 +10,7 @@ device_type = BINARY /obj/machinery/atmospherics/pipe/heat_exchanging/simple/SetInitDirections() - if(dir in diagonals) + if(dir in GLOB.diagonals) initialize_directions_he = dir switch(dir) if(NORTH,SOUTH) diff --git a/code/modules/atmospherics/machinery/pipes/simple.dm b/code/modules/atmospherics/machinery/pipes/simple.dm index 188f5ca3f8fed..984c006b74de9 100644 --- a/code/modules/atmospherics/machinery/pipes/simple.dm +++ b/code/modules/atmospherics/machinery/pipes/simple.dm @@ -16,7 +16,7 @@ The regular pipe you see everywhere, including bent ones. device_type = BINARY /obj/machinery/atmospherics/pipe/simple/SetInitDirections() - if(dir in diagonals) + if(dir in GLOB.diagonals) initialize_directions = dir switch(dir) if(NORTH,SOUTH) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 5660ea6165438..f5613c0b7ea19 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -315,7 +315,7 @@ update_icon() /obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "canister", name, 420, 405, master_ui, state) @@ -364,7 +364,7 @@ if("restricted") restricted = !restricted if(restricted) - req_access = list(access_engine) + req_access = list(GLOB.access_engine) else req_access = list() . = TRUE diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm index 22c5af86a217f..33f50a3c50304 100644 --- a/code/modules/atmospherics/machinery/portable/pump.dm +++ b/code/modules/atmospherics/machinery/portable/pump.dm @@ -70,7 +70,7 @@ /obj/machinery/portable_atmospherics/pump/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "portable_pump", name, 420, 415, master_ui, state) diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm index 308daa43f2a64..77325119a366a 100644 --- a/code/modules/atmospherics/machinery/portable/scrubber.dm +++ b/code/modules/atmospherics/machinery/portable/scrubber.dm @@ -63,7 +63,7 @@ ..() /obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "portable_scrubber", name, 420, 335, master_ui, state) diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm index 099f1d537e711..1a4c67f988553 100644 --- a/code/modules/awaymissions/bluespaceartillery.dm +++ b/code/modules/awaymissions/bluespaceartillery.dm @@ -40,8 +40,8 @@ if(..()) return var/A - A = input("Area to bombard", "Open Fire", A) in teleportlocs - var/area/thearea = teleportlocs[A] + A = input("Area to bombard", "Open Fire", A) in GLOB.teleportlocs + var/area/thearea = GLOB.teleportlocs[A] if(usr.stat || usr.restrained()) return if(reload < reload_cooldown) @@ -58,8 +58,8 @@ /*/mob/proc/openfire() var/A - A = input("Area to jump bombard", "Open Fire", A) in teleportlocs - var/area/thearea = teleportlocs[A] + A = input("Area to jump bombard", "Open Fire", A) in GLOB.teleportlocs + var/area/thearea = GLOB.teleportlocs[A] priority_announce("Bluespace artillery fire detected. Brace for impact.") spawn(30) var/list/L = list() diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index 3dd0e6d5d70fa..2e04e02fc5749 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -41,7 +41,7 @@ /obj/item/weapon/twohanded/ctf/process() if(world.time > reset_cooldown) forceMove(get_turf(src.reset)) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) var/area/mob_area = get_area(M) if(istype(mob_area, /area/ctf)) to_chat(M, "\The [src] has been returned to base!") @@ -63,7 +63,7 @@ dropped(user) return user.anchored = TRUE - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) var/area/mob_area = get_area(M) if(istype(mob_area, /area/ctf)) to_chat(M, "\The [src] has been taken!") @@ -74,7 +74,7 @@ user.anchored = FALSE reset_cooldown = world.time + 200 //20 seconds START_PROCESSING(SSobj, src) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) var/area/mob_area = get_area(M) if(istype(mob_area, /area/ctf)) to_chat(M, "\The [src] has been dropped!") @@ -119,7 +119,7 @@ /proc/toggle_all_ctf(mob/user) var/ctf_enabled = FALSE - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) ctf_enabled = CTF.toggle_ctf() message_admins("[key_name_admin(user)] has [ctf_enabled? "enabled" : "disabled"] CTF!") notify_ghosts("CTF has been [ctf_enabled? "enabled" : "disabled"]!",'sound/effects/ghost2.ogg') @@ -163,10 +163,10 @@ /obj/effect/ctf, /obj/item/weapon/twohanded/ctf )) - poi_list |= src + GLOB.poi_list |= src /obj/machinery/capture_the_flag/Destroy() - poi_list.Remove(src) + GLOB.poi_list.Remove(src) ..() /obj/machinery/capture_the_flag/process() @@ -218,7 +218,7 @@ spawn_team_member(new_team_member) return - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) if(CTF == src || CTF.ctf_enabled == FALSE) continue if(user.ckey in CTF.team_members) @@ -264,7 +264,7 @@ if(flag.team != src.team) user.transferItemToLoc(flag, get_turf(flag.reset), TRUE) points++ - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) var/area/mob_area = get_area(M) if(istype(mob_area, /area/ctf)) to_chat(M, "[user.real_name] has captured \the [flag], scoring a point for [team] team! They now have [points]/[points_to_win] points!") @@ -272,7 +272,7 @@ victory() /obj/machinery/capture_the_flag/proc/victory() - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) var/area/mob_area = get_area(M) if(istype(mob_area, /area/ctf)) to_chat(M, "[team] team wins!") @@ -280,10 +280,10 @@ for(var/obj/item/weapon/twohanded/ctf/W in M) M.dropItemToGround(W) M.dust() - for(var/obj/machinery/control_point/control in machines) + for(var/obj/machinery/control_point/control in GLOB.machines) control.icon_state = "dominator" control.controlling = null - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) if(CTF.ctf_enabled == TRUE) CTF.points = 0 CTF.control_points = 0 @@ -327,7 +327,7 @@ ctf_enabled = FALSE arena_reset = FALSE var/area/A = get_area(src) - for(var/i in mob_list) + for(var/i in GLOB.mob_list) var/mob/M = i if((get_area(A) == A) && (M.ckey in team_members)) M.dust() @@ -336,13 +336,13 @@ recently_dead_ckeys.Cut() /obj/machinery/capture_the_flag/proc/instagib_mode() - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) if(CTF.ctf_enabled == TRUE) CTF.ctf_gear = CTF.instagib_gear CTF.respawn_cooldown = INSTAGIB_RESPAWN /obj/machinery/capture_the_flag/proc/normal_mode() - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) if(CTF.ctf_enabled == TRUE) CTF.ctf_gear = initial(ctf_gear) CTF.respawn_cooldown = DEFAULT_RESPAWN @@ -508,7 +508,7 @@ /datum/outfit/ctf/red/post_equip(mob/living/carbon/human/H) ..() var/obj/item/device/radio/R = H.ears - R.set_frequency(REDTEAM_FREQ) + R.set_frequency(GLOB.REDTEAM_FREQ) R.freqlock = TRUE R.independent = TRUE H.dna.species.stunmod = 0 @@ -516,7 +516,7 @@ /datum/outfit/ctf/blue/post_equip(mob/living/carbon/human/H) ..() var/obj/item/device/radio/R = H.ears - R.set_frequency(BLUETEAM_FREQ) + R.set_frequency(GLOB.BLUETEAM_FREQ) R.freqlock = TRUE R.independent = TRUE H.dna.species.stunmod = 0 @@ -593,7 +593,7 @@ /obj/effect/ctf/ammo/proc/reload(mob/living/M) if(!ishuman(M)) return - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) if(M in CTF.spawned_mobs) var/outfit = CTF.ctf_gear var/datum/outfit/O = new outfit @@ -613,7 +613,7 @@ /obj/effect/ctf/dead_barricade/Initialize(mapload) ..() - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) CTF.dead_barricades += src /obj/effect/ctf/dead_barricade/proc/respawn() @@ -649,11 +649,11 @@ /obj/machinery/control_point/proc/capture(mob/user) if(do_after(user, 30, target = src)) - for(var/obj/machinery/capture_the_flag/CTF in machines) + for(var/obj/machinery/capture_the_flag/CTF in GLOB.machines) if(CTF.ctf_enabled && (user.ckey in CTF.team_members)) controlling = CTF icon_state = "dominator-[CTF.team]" - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) var/area/mob_area = get_area(M) if(istype(mob_area, /area/ctf)) to_chat(M, "[user.real_name] has captured \the [src], claiming it for [CTF.team]! Go take it back!") diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index bd4f2b0ef8ecf..d9663f97c9523 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -41,10 +41,10 @@ if(instant || (roundstart && (mapload || (SSticker && SSticker.current_state > GAME_STATE_SETTING_UP)))) create() else - poi_list |= src + GLOB.poi_list |= src /obj/effect/mob_spawn/Destroy() - poi_list.Remove(src) + GLOB.poi_list.Remove(src) . = ..() /obj/effect/mob_spawn/proc/special(mob/M) @@ -258,7 +258,7 @@ back = /obj/item/weapon/storage/backpack has_id = 1 id_job = "Operative" - id_access_list = list(access_syndicate) + id_access_list = list(GLOB.access_syndicate) /obj/effect/mob_spawn/human/syndicatecommando name = "Syndicate Commando" @@ -272,7 +272,7 @@ pocket1 = /obj/item/weapon/tank/internals/emergency_oxygen has_id = 1 id_job = "Operative" - id_access_list = list(access_syndicate) + id_access_list = list(GLOB.access_syndicate) ///////////Civilians////////////////////// @@ -349,7 +349,7 @@ glasses = /obj/item/clothing/glasses/sunglasses/reagent has_id = 1 id_job = "Bartender" - id_access_list = list(access_bar) + id_access_list = list(GLOB.access_bar) /obj/effect/mob_spawn/human/bartender/alive death = FALSE @@ -386,7 +386,7 @@ glasses = /obj/item/clothing/glasses/sunglasses has_id = 1 id_job = "Bridge Officer" - id_access_list = list(access_cent_captain) + id_access_list = list(GLOB.access_cent_captain) /obj/effect/mob_spawn/human/commander name = "Commander" @@ -401,7 +401,7 @@ pocket1 = /obj/item/weapon/lighter has_id = 1 id_job = "Commander" - id_access_list = list(access_cent_captain) + id_access_list = list(GLOB.access_cent_captain) /obj/effect/mob_spawn/human/nanotrasensoldier name = "Nanotrasen Private Security Officer" @@ -414,7 +414,7 @@ back = /obj/item/weapon/storage/backpack/security has_id = 1 id_job = "Private Security Force" - id_access_list = list(access_cent_specops) + id_access_list = list(GLOB.access_cent_specops) /obj/effect/mob_spawn/human/commander/alive death = FALSE diff --git a/code/modules/awaymissions/exile.dm b/code/modules/awaymissions/exile.dm index 35af4aa91c2a8..1e3ecfc93fa0e 100644 --- a/code/modules/awaymissions/exile.dm +++ b/code/modules/awaymissions/exile.dm @@ -1,7 +1,7 @@ /obj/structure/closet/secure_closet/exile name = "exile implants" - req_access = list(access_hos) + req_access = list(GLOB.access_hos) /obj/structure/closet/secure_closet/exile/New() ..() diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index b1b320de69512..1c6c0e3a1add7 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -1,4 +1,4 @@ -var/obj/machinery/gateway/centerstation/the_gateway = null +GLOBAL_DATUM(the_gateway, /obj/machinery/gateway/centerstation) /obj/machinery/gateway name = "gateway" @@ -16,7 +16,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null var/can_link = FALSE //Is this the centerpiece? /obj/machinery/gateway/Initialize() - randomspawns = awaydestinations + randomspawns = GLOB.awaydestinations update_icon() if(!istype(src, /obj/machinery/gateway/centerstation) && !istype(src, /obj/machinery/gateway/centeraway)) switch(dir) @@ -38,7 +38,7 @@ var/obj/machinery/gateway/centerstation/the_gateway = null var/turf/T = loc var/ready = FALSE - for(var/i in alldirs) + for(var/i in GLOB.alldirs) T = get_step(loc, i) var/obj/machinery/gateway/G = locate(/obj/machinery/gateway) in T if(G) @@ -77,12 +77,12 @@ var/obj/machinery/gateway/centerstation/the_gateway = null /obj/machinery/gateway/centerstation/New() ..() - if(!the_gateway) - the_gateway = src + if(!GLOB.the_gateway) + GLOB.the_gateway = src /obj/machinery/gateway/centerstation/Destroy() - if(the_gateway == src) - the_gateway = null + if(GLOB.the_gateway == src) + GLOB.the_gateway = null return ..() //this is da important part wot makes things go diff --git a/code/modules/awaymissions/mission_code/Academy.dm b/code/modules/awaymissions/mission_code/Academy.dm index 6eee12663748f..d192587f96160 100644 --- a/code/modules/awaymissions/mission_code/Academy.dm +++ b/code/modules/awaymissions/mission_code/Academy.dm @@ -47,7 +47,7 @@ /obj/structure/academy_wizard_spawner/process() if(next_check < world.time) if(!current_wizard) - for(var/mob/living/L in player_list) + for(var/mob/living/L in GLOB.player_list) if(L.z == src.z && L.stat != DEAD && !(faction in L.faction)) summon_wizard() break @@ -160,7 +160,7 @@ user.death() if(3) //Swarm of creatures - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/T = get_turf(src) new /mob/living/simple_animal/hostile/creature(get_step(T,direction)) if(4) @@ -180,7 +180,7 @@ //Throw user.Stun(3) user.adjustBruteLoss(50) - var/throw_dir = pick(cardinal) + var/throw_dir = pick(GLOB.cardinal) var/atom/throw_target = get_edge_target_turf(user, throw_dir) user.throw_at(throw_target, 200, 4) if(8) @@ -203,7 +203,7 @@ if(13) //Mad Dosh var/turf/Start = get_turf(src) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/T = get_step(Start,direction) if(rand(0,1)) new /obj/item/stack/spacecash/c1000(T) @@ -284,7 +284,7 @@ if(!target_mob) return var/turf/Start = get_turf(user) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/T = get_step(Start,direction) if(!T.density) target_mob.Move(T) diff --git a/code/modules/awaymissions/mission_code/stationCollision.dm b/code/modules/awaymissions/mission_code/stationCollision.dm index cc2b7c51c19f7..fb1d37585410d 100644 --- a/code/modules/awaymissions/mission_code/stationCollision.dm +++ b/code/modules/awaymissions/mission_code/stationCollision.dm @@ -72,23 +72,23 @@ */ //These vars hold the code itself, they'll be generated at round-start -var/sc_safecode1 = "[rand(0,9)]" -var/sc_safecode2 = "[rand(0,9)]" -var/sc_safecode3 = "[rand(0,9)]" -var/sc_safecode4 = "[rand(0,9)]" -var/sc_safecode5 = "[rand(0,9)]" +GLOBAL_VAR_INIT(sc_safecode1, "[rand(0,9)]") +GLOBAL_VAR_INIT(sc_safecode2, "[rand(0,9)]") +GLOBAL_VAR_INIT(sc_safecode3, "[rand(0,9)]") +GLOBAL_VAR_INIT(sc_safecode4, "[rand(0,9)]") +GLOBAL_VAR_INIT(sc_safecode5, "[rand(0,9)]") //Pieces of paper actually containing the hints /obj/item/weapon/paper/sc_safehint_paper_prison name = "smudged paper" /obj/item/weapon/paper/sc_safehint_paper_prison/New() - info = "The ink is smudged, you can only make out a couple numbers: '[sc_safecode1]**[sc_safecode4]*'" + info = "The ink is smudged, you can only make out a couple numbers: '[GLOB.sc_safecode1]**[GLOB.sc_safecode4]*'" /obj/item/weapon/paper/sc_safehint_paper_hydro name = "shredded paper" /obj/item/weapon/paper/sc_safehint_paper_hydro/New() - info = "Although the paper is shredded, you can clearly see the number: '[sc_safecode2]'" + info = "Although the paper is shredded, you can clearly see the number: '[GLOB.sc_safecode2]'" /obj/item/weapon/paper/sc_safehint_paper_caf name = "blood-soaked paper" @@ -99,7 +99,7 @@ var/sc_safecode5 = "[rand(0,9)]" name = "hidden paper" /obj/item/weapon/paper/sc_safehint_paper_bible/New() info = {"It would appear that the pen hidden with the paper had leaked ink over the paper. - However you can make out the last three digits:'[sc_safecode3][sc_safecode4][sc_safecode5]' + However you can make out the last three digits:'[GLOB.sc_safecode3][GLOB.sc_safecode4][GLOB.sc_safecode5]' "} /obj/item/weapon/paper/sc_safehint_paper_shuttle @@ -123,7 +123,7 @@ var/sc_safecode5 = "[rand(0,9)]" /obj/item/weapon/storage/secure/safe/sc_ssafe/New() ..() - l_code = "[sc_safecode1][sc_safecode2][sc_safecode3][sc_safecode4][sc_safecode5]" + l_code = "[GLOB.sc_safecode1][GLOB.sc_safecode2][GLOB.sc_safecode3][GLOB.sc_safecode4][GLOB.sc_safecode5]" l_set = 1 new /obj/item/weapon/gun/energy/mindflayer(src) new /obj/item/device/soulstone(src) diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 961fb7b39be5d..c21ec750ff74e 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -75,7 +75,7 @@ if("Peace") to_chat(user, "Whatever alien sentience that the Wish Granter possesses is satisfied with your wish. There is a distant wailing as the last of the Faithless begin to die, then silence.") to_chat(user, "You feel as if you just narrowly avoided a terrible fate...") - for(var/mob/living/simple_animal/hostile/faithless/F in mob_list) + for(var/mob/living/simple_animal/hostile/faithless/F in GLOB.mob_list) F.death() diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index e7b7e585169ac..382be07fbe655 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -1,33 +1,33 @@ // How much "space" we give the edge of the map -var/global/list/potentialRandomZlevels = generateMapList(filename = "config/awaymissionconfig.txt") +GLOBAL_LIST_INIT(potentialRandomZlevels, generateMapList(filename = "config/awaymissionconfig.txt")) /proc/createRandomZlevel() - if(awaydestinations.len) //crude, but it saves another var! + if(GLOB.awaydestinations.len) //crude, but it saves another var! return - if(potentialRandomZlevels && potentialRandomZlevels.len) + if(GLOB.potentialRandomZlevels && GLOB.potentialRandomZlevels.len) to_chat(world, "Loading away mission...") - var/map = pick(potentialRandomZlevels) + var/map = pick(GLOB.potentialRandomZlevels) load_new_z_level(map) to_chat(world, "Away mission loaded.") /proc/reset_gateway_spawns(reset = FALSE) for(var/obj/machinery/gateway/G in world) if(reset) - G.randomspawns = awaydestinations + G.randomspawns = GLOB.awaydestinations else - G.randomspawns.Add(awaydestinations) + G.randomspawns.Add(GLOB.awaydestinations) /obj/effect/landmark/awaystart name = "away mission spawn" desc = "Randomly picked away mission spawn points" /obj/effect/landmark/awaystart/New() - awaydestinations += src + GLOB.awaydestinations += src ..() /obj/effect/landmark/awaystart/Destroy() - awaydestinations -= src + GLOB.awaydestinations -= src return ..() /proc/generateMapList(filename) diff --git a/code/modules/cargo/console.dm b/code/modules/cargo/console.dm index 057dff604df65..e097cd6e7ebb1 100644 --- a/code/modules/cargo/console.dm +++ b/code/modules/cargo/console.dm @@ -38,7 +38,7 @@ board.emagged = TRUE /obj/machinery/computer/cargo/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "cargo", name, 1000, 800, master_ui, state) diff --git a/code/modules/cargo/exports.dm b/code/modules/cargo/exports.dm index 1fb393ba253ea..dda86e5257378 100644 --- a/code/modules/cargo/exports.dm +++ b/code/modules/cargo/exports.dm @@ -27,7 +27,7 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they then the player gets the profit from selling his own wasted time. */ /proc/export_item_and_contents(atom/movable/AM, contraband, emagged, dry_run=FALSE) - if(!exports_list.len) + if(!GLOB.exports_list.len) setupExports() var/sold_str = "" @@ -38,7 +38,7 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they // We go backwards, so it'll be innermost objects sold first for(var/i in reverseRange(contents)) var/atom/movable/thing = i - for(var/datum/export/E in exports_list) + for(var/datum/export/E in GLOB.exports_list) if(!E) continue if(E.applies_to(thing, contraband, emagged)) @@ -134,10 +134,10 @@ Credit dupes that require a lot of manual work shouldn't be removed, unless they total_cost = 0 total_amount = 0 -var/list/exports_list = list() +GLOBAL_LIST_EMPTY(exports_list) /proc/setupExports() for(var/subtype in subtypesof(/datum/export)) var/datum/export/E = new subtype if(E.export_types && E.export_types.len) // Exports without a type are invalid/base types - exports_list += E + GLOB.exports_list += E diff --git a/code/modules/cargo/packs.dm b/code/modules/cargo/packs.dm index 308126dea3f81..b7c7a7e3771b8 100644 --- a/code/modules/cargo/packs.dm +++ b/code/modules/cargo/packs.dm @@ -40,7 +40,7 @@ /datum/supply_pack/emergency/spacesuit name = "Space Suit Crate" cost = 3000 - access = access_eva + access = GLOB.access_eva contains = list(/obj/item/clothing/suit/space, /obj/item/clothing/suit/space, /obj/item/clothing/head/helmet/space, @@ -121,7 +121,7 @@ /datum/supply_pack/emergency/atmostank name = "Firefighting Watertank" cost = 1000 - access = access_atmospherics + access = GLOB.access_atmospherics contains = list(/obj/item/weapon/watertank/atmos) crate_name = "firefighting watertank crate" crate_type = /obj/structure/closet/crate/secure @@ -144,7 +144,7 @@ /datum/supply_pack/emergency/weedcontrol name = "Weed Control Crate" cost = 1500 - access = access_hydroponics + access = GLOB.access_hydroponics contains = list(/obj/item/weapon/scythe, /obj/item/clothing/mask/gas, /obj/item/weapon/grenade/chem_grenade/antiweed, @@ -209,7 +209,7 @@ /datum/supply_pack/security group = "Security" - access = access_security + access = GLOB.access_security crate_type = /obj/structure/closet/crate/secure/gear /datum/supply_pack/security/supplies @@ -290,7 +290,7 @@ crate_name = "forensics crate" /datum/supply_pack/security/armory - access = access_armory + access = GLOB.access_armory crate_type = /obj/structure/closet/crate/secure/weapon /datum/supply_pack/security/armory/riothelmets @@ -378,7 +378,7 @@ /datum/supply_pack/security/armory/fire name = "Incendiary Weapons Crate" cost = 1500 - access = access_heads + access = GLOB.access_heads contains = list(/obj/item/weapon/flamethrower/full, /obj/item/weapon/tank/internals/plasma, /obj/item/weapon/tank/internals/plasma, @@ -510,7 +510,7 @@ /datum/supply_pack/science/nitrous_oxide_canister name = "Nitrous Oxide Canister" cost = 3000 - access = access_atmospherics + access = GLOB.access_atmospherics contains = list(/obj/machinery/portable_atmospherics/canister/nitrous_oxide) crate_name = "nitrous oxide canister crate" crate_type = /obj/structure/closet/crate/secure @@ -620,7 +620,7 @@ /datum/supply_pack/engineering/engine name = "Emitter Crate" cost = 1500 - access = access_ce + access = GLOB.access_ce contains = list(/obj/machinery/power/emitter, /obj/machinery/power/emitter) crate_name = "emitter crate" @@ -669,7 +669,7 @@ /datum/supply_pack/engineering/engine/supermatter_shard name = "Supermatter Shard Crate" cost = 10000 - access = access_ce + access = GLOB.access_ce contains = list(/obj/machinery/power/supermatter_shard) crate_name = "supermatter shard crate" crate_type = /obj/structure/closet/crate/secure/engineering @@ -782,7 +782,7 @@ /datum/supply_pack/medical/virus name = "Virus Crate" cost = 2500 - access = access_cmo + access = GLOB.access_cmo contains = list(/obj/item/weapon/reagent_containers/glass/bottle/flu_virion, /obj/item/weapon/reagent_containers/glass/bottle/cold, /obj/item/weapon/reagent_containers/glass/bottle/epiglottis_virion, @@ -839,7 +839,7 @@ /datum/supply_pack/science/robotics name = "Robotics Assembly Crate" cost = 1000 - access = access_robotics + access = GLOB.access_robotics contains = list(/obj/item/device/assembly/prox_sensor, /obj/item/device/assembly/prox_sensor, /obj/item/device/assembly/prox_sensor, @@ -853,7 +853,7 @@ /datum/supply_pack/science/robotics/mecha_ripley name = "Circuit Crate (Ripley APLU)" cost = 3000 - access = access_robotics + access = GLOB.access_robotics contains = list(/obj/item/weapon/book/manual/ripley_build_and_repair, /obj/item/weapon/circuitboard/mecha/ripley/main, /obj/item/weapon/circuitboard/mecha/ripley/peripherals) @@ -863,7 +863,7 @@ /datum/supply_pack/science/robotics/mecha_odysseus name = "Circuit Crate (Odysseus)" cost = 2500 - access = access_robotics + access = GLOB.access_robotics contains = list(/obj/item/weapon/circuitboard/mecha/odysseus/peripherals, /obj/item/weapon/circuitboard/mecha/odysseus/main) crate_name = "\improper Odysseus circuit crate" @@ -872,7 +872,7 @@ /datum/supply_pack/science/plasma name = "Plasma Assembly Crate" cost = 1000 - access = access_tox_storage + access = GLOB.access_tox_storage contains = list(/obj/item/weapon/tank/internals/plasma, /obj/item/weapon/tank/internals/plasma, /obj/item/weapon/tank/internals/plasma, @@ -891,7 +891,7 @@ /datum/supply_pack/science/shieldwalls name = "Shield Generators" cost = 2000 - access = access_teleporter + access = GLOB.access_teleporter contains = list(/obj/machinery/shieldwallgen, /obj/machinery/shieldwallgen, /obj/machinery/shieldwallgen, @@ -902,7 +902,7 @@ /datum/supply_pack/science/transfer_valves name = "Tank Transfer Valves Crate" cost = 6000 - access = access_rd + access = GLOB.access_rd contains = list(/obj/item/device/transfer_valve, /obj/item/device/transfer_valve) crate_name = "tank transfer valves crate" @@ -912,7 +912,7 @@ /datum/supply_pack/science/bz_canister name = "BZ Canister" cost = 2000 - access_any = list(access_rd, access_atmospherics) + access_any = list(GLOB.access_rd, GLOB.access_atmospherics) contains = list(/obj/machinery/portable_atmospherics/canister/bz) crate_name = "bz canister crate" crate_type = /obj/structure/closet/crate/secure/science @@ -921,7 +921,7 @@ /datum/supply_pack/science/freon_canister name = "Freon Canister" cost = 6000 - access_any = list(access_rd, access_atmospherics) + access_any = list(GLOB.access_rd, GLOB.access_atmospherics) contains = list(/obj/machinery/portable_atmospherics/canister/freon) crate_name = "freon canister crate" crate_type = /obj/structure/closet/crate/secure/science @@ -930,7 +930,7 @@ /datum/supply_pack/science/research name = "Machine Prototype Crate" cost = 8000 - access = access_research + access = GLOB.access_research contains = list(/obj/item/device/machineprototype) crate_name = "machine prototype crate" crate_type = /obj/structure/closet/crate/secure/science @@ -986,7 +986,7 @@ contains = list(/obj/item/weapon/storage/backpack/dufflebag/clown/cream_pie) crate_name = "party equipment crate" contraband = TRUE - access = access_theatre + access = GLOB.access_theatre crate_type = /obj/structure/closet/crate/secure /datum/supply_pack/organic/monkey @@ -1111,7 +1111,7 @@ /datum/supply_pack/organic/hydroponics/hydrotank name = "Hydroponics Backpack Crate" cost = 1000 - access = access_hydroponics + access = GLOB.access_hydroponics contains = list(/obj/item/weapon/watertank) crate_name = "hydroponics backpack crate" crate_type = /obj/structure/closet/crate/secure @@ -1284,7 +1284,7 @@ /datum/supply_pack/misc/minerkit name = "Shaft Miner Starter Kit" cost = 2500 - access = access_qm + access = GLOB.access_qm contains = list(/obj/item/weapon/pickaxe/mini, /obj/item/clothing/glasses/meson, /obj/item/device/t_scanner/adv_mining_scanner/lesser, @@ -1459,7 +1459,7 @@ /datum/supply_pack/misc/janitor/janitank name = "Janitor Backpack Crate" cost = 1000 - access = access_janitor + access = GLOB.access_janitor contains = list(/obj/item/weapon/watertank/janitor) crate_name = "janitor backpack crate" crate_type = /obj/structure/closet/crate/secure @@ -1492,7 +1492,7 @@ /datum/supply_pack/misc/costume name = "Standard Costume Crate" cost = 1000 - access = access_theatre + access = GLOB.access_theatre contains = list(/obj/item/weapon/storage/backpack/clown, /obj/item/clothing/shoes/clown_shoes, /obj/item/clothing/mask/gas/clown_hat, @@ -1685,7 +1685,7 @@ crate_name = "librarian engraving/scribbling crate" cost = 3000 contains = list(/obj/item/soapstone) - access = access_library + access = GLOB.access_library crate_type = /obj/structure/closet/crate/secure diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm index e7970c5e3653a..6d8ffa64381d6 100644 --- a/code/modules/client/asset_cache.dm +++ b/code/modules/client/asset_cache.dm @@ -141,16 +141,16 @@ You can set verify to TRUE if you want send() to sleep until the client has the //These datums are used to populate the asset cache, the proc "register()" does this. //all of our asset datums, used for referring to these later -/var/global/list/asset_datums = list() +GLOBAL_LIST_EMPTY(asset_datums) //get a assetdatum or make a new one /proc/get_asset_datum(var/type) - if (!(type in asset_datums)) + if (!(type in GLOB.asset_datums)) return new type() - return asset_datums[type] + return GLOB.asset_datums[type] /datum/asset/New() - asset_datums[type] = src + GLOB.asset_datums[type] = src /datum/asset/proc/register() return diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 7a14e07f97d90..6f2d282b1913d 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -70,8 +70,8 @@ return //Logs all hrefs - if(config && config.log_hrefs && href_logfile) - href_logfile << "[time_stamp(show_ds = TRUE)] [src] (usr:[usr]) || [hsrc ? "[hsrc] " : ""][href]
    " + if(config && config.log_hrefs && GLOB.href_logfile) + GLOB.href_logfile << "[time_stamp(show_ds = TRUE)] [src] (usr:[usr]) || [hsrc ? "[hsrc] " : ""][href]
    " // Admin PM if(href_list["priv_msg"]) @@ -138,8 +138,7 @@ //CONNECT// /////////// #if (PRELOAD_RSC == 0) -var/list/external_rsc_urls -var/next_external_rsc = 0 +GLOBAL_LIST(external_rsc_urls) #endif @@ -151,13 +150,14 @@ var/next_external_rsc = 0 return null #if (PRELOAD_RSC == 0) + var/static/next_external_rsc = 0 if(external_rsc_urls && external_rsc_urls.len) next_external_rsc = Wrap(next_external_rsc+1, 1, external_rsc_urls.len+1) preload_rsc = external_rsc_urls[next_external_rsc] #endif - clients += src - directory[ckey] = src + GLOB.clients += src + GLOB.directory[ckey] = src //Admin Authorisation var/localhost_addresses = list("127.0.0.1", "::1") @@ -167,9 +167,9 @@ var/next_external_rsc = 0 var/datum/admins/localhost_holder = new(localhost_rank, ckey) localhost_holder.associate(src) if(config.autoadmin) - if(!admin_datums[ckey]) + if(!GLOB.admin_datums[ckey]) var/datum/admin_rank/autorank - for(var/datum/admin_rank/R in admin_ranks) + for(var/datum/admin_rank/R in GLOB.admin_ranks) if(R.name == config.autoadmin_rank) autorank = R break @@ -177,17 +177,17 @@ var/next_external_rsc = 0 to_chat(world, "Autoadmin rank not found") else var/datum/admins/D = new(autorank, ckey) - admin_datums[ckey] = D - holder = admin_datums[ckey] + GLOB.admin_datums[ckey] = D + holder = GLOB.admin_datums[ckey] if(holder) - admins |= src + GLOB.admins |= src holder.owner = src //preferences datum - also holds some persistent 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 = 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 if(world.byond_version >= 511 && byond_version >= 511 && prefs.clientfps) @@ -197,7 +197,7 @@ var/next_external_rsc = 0 log_access("Login: [key_name(src)] from [address ? address : "localhost"]-[computer_id] || BYOND v[byond_version]") var/alert_mob_dupe_login = FALSE if(config.log_access) - for(var/I in clients) + for(var/I in GLOB.clients) if(I == src) continue var/client/C = I @@ -256,22 +256,22 @@ var/next_external_rsc = 0 qdel(src) return 0 - if( (world.address == address || !address) && !host ) - host = key + if( (world.address == address || !address) && !GLOB.host ) + GLOB.host = key world.update_status() if(holder) add_admin_verbs() to_chat(src, get_message_output("memo")) adminGreet() - if((global.comms_key == "default_pwd" || length(global.comms_key) <= 6) && global.comms_allowed) //It's the default value or less than 6 characters long, but it somehow didn't disable comms. + if((GLOB.comms_key == "default_pwd" || length(GLOB.comms_key) <= 6) && GLOB.comms_allowed) //It's the default value or less than 6 characters long, but it somehow didn't disable comms. to_chat(src, "The server's API key is either too short or is the default value! Consider changing it immediately!") add_verbs_from_config() set_client_age_from_db() if (isnum(player_age) && player_age == -1) //first connection - if (config.panic_bunker && !holder && !(ckey in deadmins)) + if (config.panic_bunker && !holder && !(ckey in GLOB.deadmins)) log_access("Failed Login: [key] - New account attempting to connect during panic bunker") message_admins("Failed Login: [key] - New account attempting to connect during panic bunker") to_chat(src, "Sorry but the server is currently not accepting connections from never before seen players.") @@ -292,7 +292,7 @@ var/next_external_rsc = 0 else if (isnum(player_age) && player_age < config.notify_new_player_age) message_admins("New user: [key_name_admin(src)] just connected with an age of [player_age] day[(player_age==1?"":"s")]") - if(!IsGuestKey(key) && dbcon.IsConnected()) + if(!IsGuestKey(key) && GLOB.dbcon.IsConnected()) findJoinDate() sync_client_with_db(tdata) @@ -306,17 +306,17 @@ var/next_external_rsc = 0 screen += void - if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates. + if(prefs.lastchangelog != GLOB.changelog_hash) //bolds the changelog button on the interface so we know there are updates. to_chat(src, "You have unread updates in the changelog.") if(config.aggressive_changelog) changelog() else winset(src, "infowindow.changelog", "font-style=bold") - if(ckey in clientmessages) - for(var/message in clientmessages[ckey]) + if(ckey in GLOB.clientmessages) + for(var/message in GLOB.clientmessages[ckey]) to_chat(src, message) - clientmessages.Remove(ckey) + GLOB.clientmessages.Remove(ckey) if(config && config.autoconvert_notes) convert_notes_sql(ckey) @@ -339,9 +339,9 @@ var/next_external_rsc = 0 if(holder) adminGreet(1) holder.owner = null - admins -= src - directory -= ckey - clients -= src + GLOB.admins -= src + GLOB.directory -= ckey + GLOB.clients -= src if(movingmob != null) movingmob.client_mobs_in_contents -= mob UNSETEMPTY(movingmob.client_mobs_in_contents) @@ -354,12 +354,12 @@ var/next_external_rsc = 0 if (IsGuestKey(src.key)) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) return var/sql_ckey = sanitizeSQL(src.ckey) - var/DBQuery/query_get_client_age = dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'") + var/DBQuery/query_get_client_age = GLOB.dbcon.NewQuery("SELECT id, datediff(Now(),firstseen) as age FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'") if(!query_get_client_age.Execute()) return @@ -375,18 +375,18 @@ var/next_external_rsc = 0 if (IsGuestKey(src.key)) return - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) return var/sql_ckey = sanitizeSQL(ckey) - var/DBQuery/query_get_ip = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ip = INET_ATON('[address]') AND ckey != '[sql_ckey]'") + var/DBQuery/query_get_ip = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE ip = INET_ATON('[address]') AND ckey != '[sql_ckey]'") query_get_ip.Execute() related_accounts_ip = "" while(query_get_ip.NextRow()) related_accounts_ip += "[query_get_ip.item[1]], " - var/DBQuery/query_get_cid = dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE computerid = '[computer_id]' AND ckey != '[sql_ckey]'") + var/DBQuery/query_get_cid = GLOB.dbcon.NewQuery("SELECT ckey FROM [format_table_name("player")] WHERE computerid = '[computer_id]' AND ckey != '[sql_ckey]'") if(!query_get_cid.Execute()) return related_accounts_cid = "" @@ -405,13 +405,13 @@ var/next_external_rsc = 0 var/sql_admin_rank = sanitizeSQL(admin_rank) - var/DBQuery/query_log_player = dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[sql_ckey]', Now(), Now(), INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]') ON DUPLICATE KEY UPDATE lastseen = VALUES(lastseen), ip = VALUES(ip), computerid = VALUES(computerid), lastadminrank = VALUES(lastadminrank)") + var/DBQuery/query_log_player = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("player")] (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[sql_ckey]', Now(), Now(), INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]') ON DUPLICATE KEY UPDATE lastseen = VALUES(lastseen), ip = VALUES(ip), computerid = VALUES(computerid), lastadminrank = VALUES(lastadminrank)") if(!query_log_player.Execute()) return //Logging player access - var/DBQuery/query_log_connection = dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),INET_ATON('[world.internet_address]'),'[world.port]','[sql_ckey]',INET_ATON('[sql_ip]'),'[sql_computerid]')") + var/DBQuery/query_log_connection = GLOB.dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),INET_ATON('[world.internet_address]'),'[world.port]','[sql_ckey]',INET_ATON('[sql_ip]'),'[sql_computerid]')") query_log_connection.Execute() /client/proc/check_randomizer(topic) @@ -467,7 +467,7 @@ var/next_external_rsc = 0 cidcheck -= ckey else var/sql_ckey = sanitizeSQL(ckey) - var/DBQuery/query_cidcheck = dbcon.NewQuery("SELECT computerid FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'") + var/DBQuery/query_cidcheck = GLOB.dbcon.NewQuery("SELECT computerid FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'") query_cidcheck.Execute() var/lastcid @@ -495,13 +495,13 @@ var/next_external_rsc = 0 var/const/adminckey = "CID-Error" var/sql_ckey = sanitizeSQL(ckey) //check to see if we noted them in the last day. - var/DBQuery/query_get_notes = dbcon.NewQuery("SELECT id FROM [format_table_name("messages")] WHERE type = 'note' AND targetckey = '[sql_ckey]' AND adminckey = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW()") + var/DBQuery/query_get_notes = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("messages")] WHERE type = 'note' AND targetckey = '[sql_ckey]' AND adminckey = '[adminckey]' AND timestamp + INTERVAL 1 DAY < NOW()") if(!query_get_notes.Execute()) return if(query_get_notes.NextRow()) return //regardless of above, make sure their last note is not from us, as no point in repeating the same note over and over. - query_get_notes = dbcon.NewQuery("SELECT adminckey FROM [format_table_name("messages")] WHERE targetckey = '[sql_ckey]' ORDER BY timestamp DESC LIMIT 1") + query_get_notes = GLOB.dbcon.NewQuery("SELECT adminckey FROM [format_table_name("messages")] WHERE targetckey = '[sql_ckey]' ORDER BY timestamp DESC LIMIT 1") if(!query_get_notes.Execute()) return if(query_get_notes.NextRow()) diff --git a/code/modules/client/message.dm b/code/modules/client/message.dm index d804fd390f57b..2b4f8453d7457 100644 --- a/code/modules/client/message.dm +++ b/code/modules/client/message.dm @@ -1,9 +1,9 @@ -var/list/clientmessages = list() +GLOBAL_LIST_EMPTY(clientmessages) /proc/addclientmessage(var/ckey, var/message) ckey = ckey(ckey) if (!ckey || !message) return - if (!(ckey in clientmessages)) - clientmessages[ckey] = list() - clientmessages[ckey] += message \ No newline at end of file + if (!(ckey in GLOB.clientmessages)) + GLOB.clientmessages[ckey] = list() + GLOB.clientmessages[ckey] += message \ No newline at end of file diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index eb7ec707ddfc2..8c83cc473892e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1,6 +1,6 @@ -var/list/preferences_datums = list() +GLOBAL_LIST_EMPTY(preferences_datums) @@ -104,10 +104,10 @@ var/list/preferences_datums = list() /datum/preferences/New(client/C) parent = C - custom_names["ai"] = pick(ai_names) - custom_names["cyborg"] = pick(ai_names) - custom_names["clown"] = pick(clown_names) - custom_names["mime"] = pick(mime_names) + custom_names["ai"] = pick(GLOB.ai_names) + custom_names["cyborg"] = pick(GLOB.ai_names) + custom_names["clown"] = pick(GLOB.clown_names) + custom_names["mime"] = pick(GLOB.mime_names) if(istype(C)) if(!IsGuestKey(C.key)) load_path(C.ckey) @@ -343,7 +343,7 @@ var/list/preferences_datums = list() dat += "" - if("wings" in pref_species.mutant_bodyparts && r_wings_list.len >1) + if("wings" in pref_species.mutant_bodyparts && GLOB.r_wings_list.len >1) dat += "
    " continue - if((rank in command_positions) || (rank == "AI"))//Bold head jobs + if((rank in GLOB.command_positions) || (rank == "AI"))//Bold head jobs HTML += "[rank]" else HTML += "[rank]" @@ -746,7 +746,7 @@ var/list/preferences_datums = list() if(href_list["jobbancheck"]) var/job = sanitizeSQL(href_list["jobbancheck"]) var/sql_ckey = sanitizeSQL(user.ckey) - var/DBQuery/query_get_jobban = dbcon.NewQuery("SELECT reason, bantime, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey = '[sql_ckey]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[job]'") + var/DBQuery/query_get_jobban = GLOB.dbcon.NewQuery("SELECT reason, bantime, duration, expiration_time, a_ckey FROM [format_table_name("ban")] WHERE ckey = '[sql_ckey]' AND (bantype = 'JOB_PERMABAN' OR (bantype = 'JOB_TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned) AND job = '[job]'") if(!query_get_jobban.warn_execute()) return if(query_get_jobban.NextRow()) @@ -815,7 +815,7 @@ var/list/preferences_datums = list() if("s_tone") skin_tone = random_skin_tone() if("bag") - backbag = pick(backbaglist) + backbag = pick(GLOB.backbaglist) if("all") random_character() @@ -823,12 +823,12 @@ var/list/preferences_datums = list() switch(href_list["preference"]) if("ghostform") if(unlock_content) - var/new_form = input(user, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in ghost_forms + var/new_form = input(user, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms if(new_form) ghost_form = new_form if("ghostorbit") if(unlock_content) - var/new_orbit = input(user, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND", null) as null|anything in ghost_orbits + var/new_orbit = input(user, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND", null) as null|anything in GLOB.ghost_orbits if(new_orbit) ghost_orbit = new_orbit @@ -878,23 +878,23 @@ var/list/preferences_datums = list() if("hair_style") var/new_hair_style if(gender == MALE) - new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in hair_styles_male_list + new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in GLOB.hair_styles_male_list else - new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in hair_styles_female_list + new_hair_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in GLOB.hair_styles_female_list if(new_hair_style) hair_style = new_hair_style if("next_hair_style") if (gender == MALE) - hair_style = next_list_item(hair_style, hair_styles_male_list) + hair_style = next_list_item(hair_style, GLOB.hair_styles_male_list) else - hair_style = next_list_item(hair_style, hair_styles_female_list) + hair_style = next_list_item(hair_style, GLOB.hair_styles_female_list) if("previous_hair_style") if (gender == MALE) - hair_style = previous_list_item(hair_style, hair_styles_male_list) + hair_style = previous_list_item(hair_style, GLOB.hair_styles_male_list) else - hair_style = previous_list_item(hair_style, hair_styles_female_list) + hair_style = previous_list_item(hair_style, GLOB.hair_styles_female_list) if("facial") var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as null|color @@ -904,45 +904,45 @@ var/list/preferences_datums = list() if("facial_hair_style") var/new_facial_hair_style if(gender == MALE) - new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in facial_hair_styles_male_list + new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in GLOB.facial_hair_styles_male_list else - new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in facial_hair_styles_female_list + new_facial_hair_style = input(user, "Choose your character's facial-hair style:", "Character Preference") as null|anything in GLOB.facial_hair_styles_female_list if(new_facial_hair_style) facial_hair_style = new_facial_hair_style if("next_facehair_style") if (gender == MALE) - facial_hair_style = next_list_item(facial_hair_style, facial_hair_styles_male_list) + facial_hair_style = next_list_item(facial_hair_style, GLOB.facial_hair_styles_male_list) else - facial_hair_style = next_list_item(facial_hair_style, facial_hair_styles_female_list) + facial_hair_style = next_list_item(facial_hair_style, GLOB.facial_hair_styles_female_list) if("previous_facehair_style") if (gender == MALE) - facial_hair_style = previous_list_item(facial_hair_style, facial_hair_styles_male_list) + facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_male_list) else - facial_hair_style = previous_list_item(facial_hair_style, facial_hair_styles_female_list) + facial_hair_style = previous_list_item(facial_hair_style, GLOB.facial_hair_styles_female_list) if("underwear") var/new_underwear if(gender == MALE) - new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in underwear_m + new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in GLOB.underwear_m else - new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in underwear_f + new_underwear = input(user, "Choose your character's underwear:", "Character Preference") as null|anything in GLOB.underwear_f if(new_underwear) underwear = new_underwear if("undershirt") var/new_undershirt if(gender == MALE) - new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_m + new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in GLOB.undershirt_m else - new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in undershirt_f + new_undershirt = input(user, "Choose your character's undershirt:", "Character Preference") as null|anything in GLOB.undershirt_f if(new_undershirt) undershirt = new_undershirt if("socks") var/new_socks - new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in socks_list + new_socks = input(user, "Choose your character's socks:", "Character Preference") as null|anything in GLOB.socks_list if(new_socks) socks = new_socks @@ -953,10 +953,10 @@ var/list/preferences_datums = list() if("species") - var/result = input(user, "Select a species", "Species Selection") as null|anything in roundstart_species + var/result = input(user, "Select a species", "Species Selection") as null|anything in GLOB.roundstart_species if(result) - var/newtype = roundstart_species[result] + var/newtype = GLOB.roundstart_species[result] pref_species = new newtype() //Now that we changed our species, we must verify that the mutant colour is still allowed. var/temp_hsv = RGBtoHSV(features["mcolor"]) @@ -976,66 +976,66 @@ var/list/preferences_datums = list() if("tail_lizard") var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in tails_list_lizard + new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_lizard if(new_tail) features["tail_lizard"] = new_tail if("tail_human") var/new_tail - new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in tails_list_human + new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in GLOB.tails_list_human if(new_tail) features["tail_human"] = new_tail if("snout") var/new_snout - new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in snouts_list + new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in GLOB.snouts_list if(new_snout) features["snout"] = new_snout if("horns") var/new_horns - new_horns = input(user, "Choose your character's horns:", "Character Preference") as null|anything in horns_list + new_horns = input(user, "Choose your character's horns:", "Character Preference") as null|anything in GLOB.horns_list if(new_horns) features["horns"] = new_horns if("ears") var/new_ears - new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in ears_list + new_ears = input(user, "Choose your character's ears:", "Character Preference") as null|anything in GLOB.ears_list if(new_ears) features["ears"] = new_ears if("wings") var/new_wings - new_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in r_wings_list + new_wings = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.r_wings_list if(new_wings) features["wings"] = new_wings if("frills") var/new_frills - new_frills = input(user, "Choose your character's frills:", "Character Preference") as null|anything in frills_list + new_frills = input(user, "Choose your character's frills:", "Character Preference") as null|anything in GLOB.frills_list if(new_frills) features["frills"] = new_frills if("spines") var/new_spines - new_spines = input(user, "Choose your character's spines:", "Character Preference") as null|anything in spines_list + new_spines = input(user, "Choose your character's spines:", "Character Preference") as null|anything in GLOB.spines_list if(new_spines) features["spines"] = new_spines if("body_markings") var/new_body_markings - new_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in body_markings_list + new_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in GLOB.body_markings_list if(new_body_markings) features["body_markings"] = new_body_markings if("legs") var/new_legs - new_legs = input(user, "Choose your character's legs:", "Character Preference") as null|anything in legs_list + new_legs = input(user, "Choose your character's legs:", "Character Preference") as null|anything in GLOB.legs_list if(new_legs) features["legs"] = new_legs if("s_tone") - var/new_s_tone = input(user, "Choose your character's skin-tone:", "Character Preference") as null|anything in skin_tones + var/new_s_tone = input(user, "Choose your character's skin-tone:", "Character Preference") as null|anything in GLOB.skin_tones if(new_s_tone) skin_tone = new_s_tone @@ -1045,12 +1045,12 @@ var/list/preferences_datums = list() ooccolor = sanitize_ooccolor(new_ooccolor) if("bag") - var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in backbaglist + var/new_backbag = input(user, "Choose your character's style of bag:", "Character Preference") as null|anything in GLOB.backbaglist if(new_backbag) backbag = new_backbag if("uplink_loc") - var/new_loc = input(user, "Choose your character's traitor uplink spawn location:", "Character Preference") as null|anything in uplink_spawn_loc_list + var/new_loc = input(user, "Choose your character's traitor uplink spawn location:", "Character Preference") as null|anything in GLOB.uplink_spawn_loc_list if(new_loc) uplink_spawn_loc = new_loc @@ -1097,7 +1097,7 @@ var/list/preferences_datums = list() to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") if("sec_dept") - var/department = input(user, "Choose your prefered security department:", "Security Departments") as null|anything in security_depts_prefs + var/department = input(user, "Choose your prefered security department:", "Security Departments") as null|anything in GLOB.security_depts_prefs if(department) prefered_security_department = department @@ -1249,9 +1249,9 @@ var/list/preferences_datums = list() var/firstspace = findtext(real_name, " ") var/name_length = length(real_name) if(!firstspace) //we need a surname - real_name += " [pick(last_names)]" + real_name += " [pick(GLOB.last_names)]" else if(firstspace == name_length) - real_name += "[pick(last_names)]" + real_name += "[pick(GLOB.last_names)]" character.real_name = real_name character.name = character.real_name diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index b7675d43fddbb..f85b6dfe61e40 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -106,7 +106,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //It's only really meant to avoid annoying frequent players //if your savefile is 3 months out of date, then 'tough shit'. /datum/preferences/proc/update_character(current_version, savefile/S) - if(pref_species && !(pref_species.id in roundstart_species)) + if(pref_species && !(pref_species.id in GLOB.roundstart_species)) var/rando_race = pick(config.roundstart_races) pref_species = new rando_race() @@ -195,10 +195,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car toggles = sanitize_integer(toggles, 0, 65535, initial(toggles)) clientfps = sanitize_integer(clientfps, 0, 1000, 0) parallax = sanitize_integer(parallax, PARALLAX_INSANE, PARALLAX_DISABLE, null) - ghost_form = sanitize_inlist(ghost_form, ghost_forms, initial(ghost_form)) - ghost_orbit = sanitize_inlist(ghost_orbit, ghost_orbits, initial(ghost_orbit)) - ghost_accs = sanitize_inlist(ghost_accs, ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION) - ghost_others = sanitize_inlist(ghost_others, ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION) + ghost_form = sanitize_inlist(ghost_form, GLOB.ghost_forms, initial(ghost_form)) + ghost_orbit = sanitize_inlist(ghost_orbit, GLOB.ghost_orbits, initial(ghost_orbit)) + ghost_accs = sanitize_inlist(ghost_accs, GLOB.ghost_accs_options, GHOST_ACCS_DEFAULT_OPTION) + ghost_others = sanitize_inlist(ghost_others, GLOB.ghost_others_options, GHOST_OTHERS_DEFAULT_OPTION) return 1 @@ -262,8 +262,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //Species var/species_id S["species"] >> species_id - if(config.mutant_races && species_id && (species_id in roundstart_species)) - var/newtype = roundstart_species[species_id] + if(config.mutant_races && species_id && (species_id in GLOB.roundstart_species)) + var/newtype = GLOB.roundstart_species[species_id] pref_species = new newtype() else var/rando_race = pick(config.roundstart_races) @@ -339,33 +339,33 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car be_random_body = sanitize_integer(be_random_body, 0, 1, initial(be_random_body)) gender = sanitize_gender(gender) if(gender == MALE) - hair_style = sanitize_inlist(hair_style, hair_styles_male_list) - facial_hair_style = sanitize_inlist(facial_hair_style, facial_hair_styles_male_list) - underwear = sanitize_inlist(underwear, underwear_m) - undershirt = sanitize_inlist(undershirt, undershirt_m) + hair_style = sanitize_inlist(hair_style, GLOB.hair_styles_male_list) + facial_hair_style = sanitize_inlist(facial_hair_style, GLOB.hair_styles_male_list) + underwear = sanitize_inlist(underwear, GLOB.underwear_m) + undershirt = sanitize_inlist(undershirt, GLOB.undershirt_m) else - hair_style = sanitize_inlist(hair_style, hair_styles_female_list) - facial_hair_style = sanitize_inlist(facial_hair_style, facial_hair_styles_female_list) - underwear = sanitize_inlist(underwear, underwear_f) - undershirt = sanitize_inlist(undershirt, undershirt_f) - socks = sanitize_inlist(socks, socks_list) + hair_style = sanitize_inlist(hair_style, GLOB.hair_styles_female_list) + facial_hair_style = sanitize_inlist(facial_hair_style, GLOB.facial_hair_styles_female_list) + underwear = sanitize_inlist(underwear, GLOB.underwear_f) + undershirt = sanitize_inlist(undershirt, GLOB.undershirt_f) + socks = sanitize_inlist(socks, GLOB.socks_list) age = sanitize_integer(age, AGE_MIN, AGE_MAX, initial(age)) hair_color = sanitize_hexcolor(hair_color, 3, 0) facial_hair_color = sanitize_hexcolor(facial_hair_color, 3, 0) eye_color = sanitize_hexcolor(eye_color, 3, 0) - skin_tone = sanitize_inlist(skin_tone, skin_tones) - backbag = sanitize_inlist(backbag, backbaglist, initial(backbag)) - uplink_spawn_loc = sanitize_inlist(uplink_spawn_loc, uplink_spawn_loc_list, initial(uplink_spawn_loc)) + skin_tone = sanitize_inlist(skin_tone, GLOB.skin_tones) + backbag = sanitize_inlist(backbag, GLOB.backbaglist, initial(backbag)) + uplink_spawn_loc = sanitize_inlist(uplink_spawn_loc, GLOB.uplink_spawn_loc_list, initial(uplink_spawn_loc)) features["mcolor"] = sanitize_hexcolor(features["mcolor"], 3, 0) - features["tail_lizard"] = sanitize_inlist(features["tail_lizard"], tails_list_lizard) - features["tail_human"] = sanitize_inlist(features["tail_human"], tails_list_human, "None") - features["snout"] = sanitize_inlist(features["snout"], snouts_list) - features["horns"] = sanitize_inlist(features["horns"], horns_list) - features["ears"] = sanitize_inlist(features["ears"], ears_list, "None") - features["frills"] = sanitize_inlist(features["frills"], frills_list) - features["spines"] = sanitize_inlist(features["spines"], spines_list) - features["body_markings"] = sanitize_inlist(features["body_markings"], body_markings_list) - features["feature_lizard_legs"] = sanitize_inlist(features["legs"], legs_list, "Normal Legs") + features["tail_lizard"] = sanitize_inlist(features["tail_lizard"], GLOB.tails_list_lizard) + features["tail_human"] = sanitize_inlist(features["tail_human"], GLOB.tails_list_human, "None") + features["snout"] = sanitize_inlist(features["snout"], GLOB.snouts_list) + features["horns"] = sanitize_inlist(features["horns"], GLOB.horns_list) + features["ears"] = sanitize_inlist(features["ears"], GLOB.ears_list, "None") + features["frills"] = sanitize_inlist(features["frills"], GLOB.frills_list) + features["spines"] = sanitize_inlist(features["spines"], GLOB.spines_list) + features["body_markings"] = sanitize_inlist(features["body_markings"], GLOB.body_markings_list) + features["feature_lizard_legs"] = sanitize_inlist(features["legs"], GLOB.legs_list, "Normal Legs") joblessrole = sanitize_integer(joblessrole, 1, 3, initial(joblessrole)) job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high)) diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index 8a82649d6b74b..24a4fdcee1a53 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -158,14 +158,9 @@ prefs.save_preferences() if(prefs.toggles & SOUND_MIDI) to_chat(src, "You will now hear any sounds uploaded by admins.") - if(admin_sound) - to_chat(src, admin_sound) else - to_chat(src, "You will no longer hear sounds uploaded by admins; any currently playing midis have been disabled.") - if(admin_sound && !(admin_sound.status & SOUND_PAUSED)) - admin_sound.status |= SOUND_PAUSED - to_chat(src, admin_sound) - admin_sound.status ^= SOUND_PAUSED + to_chat(src, "You will no longer hear sounds uploaded by admins") + mob.stop_sound_channel(CHANNEL_ADMIN) feedback_add_details("admin_verb","TMidi") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/verb/stop_client_sounds() @@ -226,16 +221,16 @@ src.ambience_playing = 0 feedback_add_details("admin_verb", "SAmbi") //If you are copy-pasting this, I bet you read this comment expecting to see the same thing :^) -var/global/list/ghost_forms = list("ghost","ghostking","ghostian2","skeleghost","ghost_red","ghost_black", \ +GLOBAL_LIST_INIT(ghost_forms, list("ghost","ghostking","ghostian2","skeleghost","ghost_red","ghost_black", \ "ghost_blue","ghost_yellow","ghost_green","ghost_pink", \ "ghost_cyan","ghost_dblue","ghost_dred","ghost_dgreen", \ "ghost_dcyan","ghost_grey","ghost_dyellow","ghost_dpink", "ghost_purpleswirl","ghost_funkypurp","ghost_pinksherbert","ghost_blazeit",\ - "ghost_mellow","ghost_rainbow","ghost_camo","ghost_fire", "catghost") + "ghost_mellow","ghost_rainbow","ghost_camo","ghost_fire", "catghost")) /client/proc/pick_form() if(!is_content_unlocked()) alert("This setting is for accounts with BYOND premium only.") return - var/new_form = input(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in ghost_forms + var/new_form = input(src, "Thanks for supporting BYOND - Choose your ghostly form:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_forms if(new_form) prefs.ghost_form = new_form prefs.save_preferences() @@ -243,13 +238,13 @@ var/global/list/ghost_forms = list("ghost","ghostking","ghostian2","skeleghost", var/mob/dead/observer/O = mob O.update_icon(new_form) -var/global/list/ghost_orbits = list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOST_ORBIT_SQUARE,GHOST_ORBIT_HEXAGON,GHOST_ORBIT_PENTAGON) +GLOBAL_LIST_INIT(ghost_orbits, list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOST_ORBIT_SQUARE,GHOST_ORBIT_HEXAGON,GHOST_ORBIT_PENTAGON)) /client/proc/pick_ghost_orbit() if(!is_content_unlocked()) alert("This setting is for accounts with BYOND premium only.") return - var/new_orbit = input(src, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND",null) as null|anything in ghost_orbits + var/new_orbit = input(src, "Thanks for supporting BYOND - Choose your ghostly orbit:","Thanks for supporting BYOND",null) as null|anything in GLOB.ghost_orbits if(new_orbit) prefs.ghost_orbit = new_orbit prefs.save_preferences() diff --git a/code/modules/client/verbs/ooc.dm b/code/modules/client/verbs/ooc.dm index 2200bf5de7d0e..76aa46fc1ef35 100644 --- a/code/modules/client/verbs/ooc.dm +++ b/code/modules/client/verbs/ooc.dm @@ -2,7 +2,7 @@ set name = "OOC" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite set category = "OOC" - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return @@ -30,10 +30,10 @@ return if(!holder) - if(!ooc_allowed) + if(!GLOB.ooc_allowed) to_chat(src, "OOC is globally muted.") return - if(!dooc_allowed && (mob.stat == DEAD)) + if(!GLOB.dooc_allowed && (mob.stat == DEAD)) to_chat(usr, "OOC for dead mobs has been turned off.") return if(prefs.muted & MUTE_OOC) @@ -57,9 +57,9 @@ var/keyname = key if(prefs.unlock_content) if(prefs.toggles & MEMBER_PUBLIC) - keyname = "[keyname]" + keyname = "[keyname]" - for(var/client/C in clients) + for(var/client/C in GLOB.clients) if(C.prefs.chat_toggles & CHAT_OOC) if(holder) if(!holder.fakekey || C.holder) @@ -68,33 +68,33 @@ else to_chat(C, "OOC: [keyname][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]") else - to_chat(C, "OOC: [holder.fakekey ? holder.fakekey : key]: [msg]") + to_chat(C, "OOC: [holder.fakekey ? holder.fakekey : key]: [msg]") else if(!(key in C.prefs.ignoring)) - to_chat(C, "OOC: [keyname]: [msg]") + to_chat(C, "OOC: [keyname]: [msg]") /proc/toggle_ooc(toggle = null) if(toggle != null) //if we're specifically en/disabling ooc - if(toggle != ooc_allowed) - ooc_allowed = toggle + if(toggle != GLOB.ooc_allowed) + GLOB.ooc_allowed = toggle else return else //otherwise just toggle it - ooc_allowed = !ooc_allowed - to_chat(world, "The OOC channel has been globally [ooc_allowed ? "enabled" : "disabled"].") + GLOB.ooc_allowed = !GLOB.ooc_allowed + to_chat(world, "The OOC channel has been globally [GLOB.ooc_allowed ? "enabled" : "disabled"].") -var/global/normal_ooc_colour = OOC_COLOR +GLOBAL_VAR_INIT(normal_ooc_colour, OOC_COLOR) /client/proc/set_ooc(newColor as color) set name = "Set Player OOC Color" set desc = "Modifies player OOC Color" set category = "Fun" - normal_ooc_colour = sanitize_ooccolor(newColor) + GLOB.normal_ooc_colour = sanitize_ooccolor(newColor) /client/proc/reset_ooc() set name = "Reset Player OOC Color" set desc = "Returns player OOC Color to default" set category = "Fun" - normal_ooc_colour = OOC_COLOR + GLOB.normal_ooc_colour = OOC_COLOR /client/verb/colorooc() set name = "Set Your OOC Color" @@ -129,8 +129,8 @@ var/global/normal_ooc_colour = OOC_COLOR set category = "Admin" set desc ="Check the admin notice if it has been set" - if(admin_notice) - to_chat(src, "Admin Notice:\n \t [admin_notice]") + if(GLOB.admin_notice) + to_chat(src, "Admin Notice:\n \t [GLOB.admin_notice]") else to_chat(src, "There are no admin notices at the moment.") @@ -139,8 +139,8 @@ var/global/normal_ooc_colour = OOC_COLOR set category = "OOC" set desc ="Check the Message of the Day" - if(join_motd) - to_chat(src, "
    [join_motd]
    ") + if(GLOB.join_motd) + to_chat(src, "
    [GLOB.join_motd]
    ") else to_chat(src, "The Message of the Day has not been set.") @@ -169,7 +169,7 @@ var/global/normal_ooc_colour = OOC_COLOR set category = "OOC" set desc ="Ignore a player's messages on the OOC channel" - var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in sortKey(clients) + var/selection = input("Please, select a player!", "Ignore", null, null) as null|anything in sortKey(GLOB.clients) if(!selection) return if(selection == src) diff --git a/code/modules/client/verbs/who.dm b/code/modules/client/verbs/who.dm index d926ade68bef9..58095cd857e89 100644 --- a/code/modules/client/verbs/who.dm +++ b/code/modules/client/verbs/who.dm @@ -11,7 +11,7 @@ var/mob/dead/observer/G = src.mob if(!G.started_as_observer)//If you aghost to do this, KorPhaeron will deadmin you in your sleep. log_admin("[key_name(usr)] checked advanced who in-round") - for(var/client/C in clients) + for(var/client/C in GLOB.clients) var/entry = "\t[C.key]" if(C.holder && C.holder.fakekey) entry += " (as [C.holder.fakekey])" @@ -37,14 +37,14 @@ entry += " ([round(C.avgping, 1)]ms)" Lines += entry else//If they don't have +ADMIN, only show hidden admins - for(var/client/C in clients) + for(var/client/C in GLOB.clients) var/entry = "\t[C.key]" if(C.holder && C.holder.fakekey) entry += " (as [C.holder.fakekey])" entry += " ([round(C.avgping, 1)]ms)" Lines += entry else - for(var/client/C in clients) + for(var/client/C in GLOB.clients) if(C.holder && C.holder.fakekey) Lines += "[C.holder.fakekey] ([round(C.avgping, 1)]ms)" else @@ -62,7 +62,7 @@ var/msg = "Current Admins:\n" if(holder) - for(var/client/C in admins) + for(var/client/C in GLOB.admins) msg += "\t[C] is a [C.holder.rank]" if(C.holder.fakekey) @@ -79,7 +79,7 @@ msg += " (AFK)" msg += "\n" else - for(var/client/C in admins) + for(var/client/C in GLOB.admins) if(C.is_afk()) continue //Don't show afk admins to adminwho if(!C.holder.fakekey) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 89ef6d6a24cff..666daf70b0d92 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -160,10 +160,10 @@ if(!damaged_clothes) update_clothes_damaged_state(TRUE) -var/list/damaged_clothes_icons = list() /obj/item/clothing/proc/update_clothes_damaged_state(damaging = TRUE) var/index = "\ref[initial(icon)]-[initial(icon_state)]" + var/static/list/damaged_clothes_icons = list() if(damaging) damaged_clothes = 1 var/icon/damaged_clothes_icon = damaged_clothes_icons[index] @@ -646,7 +646,7 @@ BLIND // can't see anything var/icon/female_s = icon("icon"='icons/mob/uniform.dmi', "icon_state"="[(type == FEMALE_UNIFORM_FULL) ? "female_full" : "female_top"]") female_clothing_icon.Blend(female_s, ICON_MULTIPLY) female_clothing_icon = fcopy_rsc(female_clothing_icon) - female_clothing_icons[index] = female_clothing_icon + GLOB.female_clothing_icons[index] = female_clothing_icon /obj/item/clothing/under/verb/toggle() set name = "Adjust Suit Sensors" diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm index c23a87f0b0466..28839fc0291be 100644 --- a/code/modules/clothing/glasses/hud.dm +++ b/code/modules/clothing/glasses/hud.dm @@ -8,13 +8,13 @@ /obj/item/clothing/glasses/hud/equipped(mob/living/carbon/human/user, slot) ..() if(hud_type && slot == slot_glasses) - var/datum/atom_hud/H = huds[hud_type] + var/datum/atom_hud/H = GLOB.huds[hud_type] H.add_hud_to(user) /obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user) ..() if(hud_type && istype(user) && user.glasses == src) - var/datum/atom_hud/H = huds[hud_type] + var/datum/atom_hud/H = GLOB.huds[hud_type] H.remove_hud_from(user) /obj/item/clothing/glasses/hud/emp_act(severity) @@ -161,7 +161,7 @@ return if (hud_type) - var/datum/atom_hud/H = huds[hud_type] + var/datum/atom_hud/H = GLOB.huds[hud_type] H.remove_hud_from(user) if (hud_type == DATA_HUD_MEDICAL_ADVANCED) @@ -172,7 +172,7 @@ hud_type = DATA_HUD_SECURITY_ADVANCED if (hud_type) - var/datum/atom_hud/H = huds[hud_type] + var/datum/atom_hud/H = GLOB.huds[hud_type] H.add_hud_to(user) /obj/item/clothing/glasses/hud/toggle/thermal diff --git a/code/modules/clothing/outfits/ert.dm b/code/modules/clothing/outfits/ert.dm index 3e82a2e02b009..83a8747252ebd 100644 --- a/code/modules/clothing/outfits/ert.dm +++ b/code/modules/clothing/outfits/ert.dm @@ -14,7 +14,7 @@ L.implant(H, null, 1) var/obj/item/device/radio/R = H.ears - R.set_frequency(CENTCOM_FREQ) + R.set_frequency(GLOB.CENTCOM_FREQ) R.freqlock = 1 var/obj/item/weapon/card/id/W = H.wear_id @@ -188,7 +188,7 @@ var/obj/item/weapon/card/id/W = H.wear_id W.icon_state = "centcom" W.access = get_centcom_access("Centcom Official") - W.access += access_weapons + W.access += GLOB.access_weapons W.assignment = "Centcom Official" W.registered_name = H.real_name W.update_label() diff --git a/code/modules/clothing/outfits/standard.dm b/code/modules/clothing/outfits/standard.dm index 2f7fcc99eff06..944d3a624ef69 100644 --- a/code/modules/clothing/outfits/standard.dm +++ b/code/modules/clothing/outfits/standard.dm @@ -239,7 +239,7 @@ W.update_label() var/obj/item/device/radio/headset/R = H.ears - R.set_frequency(CENTCOM_FREQ) + R.set_frequency(GLOB.CENTCOM_FREQ) R.freqlock = 1 /datum/outfit/wizard @@ -355,7 +355,7 @@ return var/obj/item/device/radio/R = H.ears - R.set_frequency(CENTCOM_FREQ) + R.set_frequency(GLOB.CENTCOM_FREQ) R.freqlock = 1 var/obj/item/weapon/implant/mindshield/L = new/obj/item/weapon/implant/mindshield(H)//Here you go Deuryn diff --git a/code/modules/clothing/spacesuits/flightsuit.dm b/code/modules/clothing/spacesuits/flightsuit.dm index bf3906a8727f2..275ad542b5731 100644 --- a/code/modules/clothing/spacesuits/flightsuit.dm +++ b/code/modules/clothing/spacesuits/flightsuit.dm @@ -617,7 +617,7 @@ for(var/i in 1 to knockback) target = get_step(target, direction) for(var/i in 1 to knockback/3) - target = get_step(target, pick(alldirs)) + target = get_step(target, pick(GLOB.alldirs)) if(knockback) victim.throw_at(target, knockback, part_manip.rating) if(isobj(victim)) @@ -635,7 +635,7 @@ if(move) while(momentum_x != 0 || momentum_y != 0) sleep(2) - step(wearer, pick(cardinal)) + step(wearer, pick(GLOB.cardinal)) momentum_decay() adjust_momentum(0, 0, 10) wearer.visible_message("[wearer]'s flight suit crashes into the ground!") @@ -1266,13 +1266,13 @@ /obj/item/clothing/head/helmet/space/hardsuit/flightsuit/equipped(mob/living/carbon/human/wearer, slot) ..() for(var/hudtype in datahuds) - var/datum/atom_hud/H = huds[hudtype] + var/datum/atom_hud/H = GLOB.huds[hudtype] H.add_hud_to(wearer) /obj/item/clothing/head/helmet/space/hardsuit/flightsuit/dropped(mob/living/carbon/human/wearer) ..() for(var/hudtype in datahuds) - var/datum/atom_hud/H = huds[hudtype] + var/datum/atom_hud/H = GLOB.huds[hudtype] H.remove_hud_from(wearer) if(zoom) toggle_zoom(wearer, TRUE) diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index b9c4a117cb8f5..6cc485a34c9fd 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -430,13 +430,13 @@ to_chat(user, ("Your [user.glasses] prevents you using [src]'s diagnostic visor HUD.")) else onboard_hud_enabled = 1 - var/datum/atom_hud/DHUD = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_DIAGNOSTIC] DHUD.add_hud_to(user) /obj/item/clothing/head/helmet/space/hardsuit/rd/dropped(mob/living/carbon/human/user) ..() if(onboard_hud_enabled && !(user.glasses && istype(user.glasses, /obj/item/clothing/glasses/hud/diagnostic))) - var/datum/atom_hud/DHUD = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_DIAGNOSTIC] DHUD.remove_hud_from(user) /obj/item/clothing/suit/space/hardsuit/rd diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm index f0bff99baad96..e0b92a8fad64f 100644 --- a/code/modules/clothing/suits/miscellaneous.dm +++ b/code/modules/clothing/suits/miscellaneous.dm @@ -179,7 +179,7 @@ var/image/I = image(icon = 'icons/mob/robots.dmi' , icon_state = "robot", loc = H) I.override = 1 I.add_overlay(image(icon = 'icons/mob/robots.dmi' , icon_state = "robot_e")) //gotta look realistic - H.add_alt_appearance("standard_borg_disguise", I, silicon_mobs+H) //you look like a robot to robots! (including yourself because you're totally a robot) + H.add_alt_appearance("standard_borg_disguise", I, GLOB.silicon_mobs+H) //you look like a robot to robots! (including yourself because you're totally a robot) /obj/item/clothing/suit/snowman diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm index aa87429f9ad88..658289cfe9303 100644 --- a/code/modules/clothing/under/color.dm +++ b/code/modules/clothing/under/color.dm @@ -28,7 +28,7 @@ desc = "A terribly ragged and frayed grey jumpsuit. It looks like it hasn't been washed in over a decade." /obj/item/clothing/under/color/grey/glorf/hit_reaction(mob/living/carbon/human/owner) - owner.forcesay(hit_appends) + owner.forcesay(GLOB.hit_appends) return 0 /obj/item/clothing/under/color/blue diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm index 356f260bfacaf..77d1e1d6d9c07 100644 --- a/code/modules/crafting/craft.dm +++ b/code/modules/crafting/craft.dm @@ -253,7 +253,7 @@ qdel(DL) -/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = not_incapacitated_turf_state) +/datum/personal_crafting/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.not_incapacitated_turf_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "personal_crafting", "Crafting Menu", 700, 800, master_ui, state) @@ -273,7 +273,7 @@ var/list/surroundings = get_surroundings(user) var/list/can_craft = list() var/list/cant_craft = list() - for(var/rec in crafting_recipes) + for(var/rec in GLOB.crafting_recipes) var/datum/crafting_recipe/R = rec if(R.category != cur_category) continue diff --git a/code/modules/emoji/emoji_parse.dm b/code/modules/emoji/emoji_parse.dm index 364a17e95a6c9..3a0281f3f0d71 100644 --- a/code/modules/emoji/emoji_parse.dm +++ b/code/modules/emoji/emoji_parse.dm @@ -1,11 +1,8 @@ -var/list/emojis - /proc/emoji_parse(text) . = text if(!config.emojis) return - if(!emojis) - emojis = icon_states(icon('icons/emoji.dmi')) + var/static/list/emojis = icon_states(icon('icons/emoji.dmi')) var/parsed = "" var/pos = 1 var/search = 0 diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm index 7c88c604b614e..b48dd40e093a0 100644 --- a/code/modules/error_handler/error_handler.dm +++ b/code/modules/error_handler/error_handler.dm @@ -1,18 +1,20 @@ -var/global/list/error_last_seen = list() -var/global/list/error_cooldown = list() /* Error_cooldown items will either be positive(cooldown time) or negative(silenced error) - If negative, starts at -1, and goes down by 1 each time that error gets skipped*/ -var/global/total_runtimes = 0 -var/global/total_runtimes_skipped = 0 +GLOBAL_VAR_INIT(total_runtimes, 0) +GLOBAL_VAR_INIT(total_runtimes_skipped, 0) #ifdef DEBUG /world/Error(exception/E, datum/e_src) if(!istype(E)) //Something threw an unusual exception log_world("\[[time_stamp()]] Uncaught exception: [E]") return ..() + + var/static/list/error_last_seen = list() + var/static/list/error_cooldown = list() /* Error_cooldown items will either be positive(cooldown time) or negative(silenced error) + If negative, starts at -1, and goes down by 1 each time that error gets skipped*/ + if(!error_last_seen) // A runtime is occurring too early in start-up initialization return ..() - total_runtimes++ + GLOB.total_runtimes++ var/erroruid = "[E.file][E.line]" var/last_seen = error_last_seen[erroruid] @@ -24,7 +26,7 @@ var/global/total_runtimes_skipped = 0 if(cooldown < 0) error_cooldown[erroruid]-- //Used to keep track of skip count for this error - total_runtimes_skipped++ + GLOB.total_runtimes_skipped++ return //Error is currently silenced, skip handling it //Handle cooldowns and silencing spammy errors var/silencing = FALSE @@ -54,7 +56,7 @@ var/global/total_runtimes_skipped = 0 error_cooldown[erroruid] = 0 if(skipcount > 0) world.log << "\[[time_stamp()]] Skipped [skipcount] runtimes in [E.file],[E.line]." - error_cache.log_error(E, skip_count = skipcount) + GLOB.error_cache.log_error(E, skip_count = skipcount) error_last_seen[erroruid] = world.time error_cooldown[erroruid] = cooldown @@ -87,8 +89,8 @@ var/global/total_runtimes_skipped = 0 desclines.Add(usrinfo) if(silencing) desclines += " (This error will now be silenced for [configured_error_silence_time / 600] minutes)" - if(error_cache) - error_cache.log_error(E, desclines) + if(GLOB.error_cache) + GLOB.error_cache.log_error(E, desclines) world.log << "\[[time_stamp()]] Runtime in [E.file],[E.line]: [E]" for(var/line in desclines) @@ -106,7 +108,7 @@ var/global/total_runtimes_skipped = 0 split[i] = "\[[time2text(world.timeofday,"hh:mm:ss")]\][split[i]]" E.desc = jointext(split, "\n") if(config && config.log_runtimes) - world.log = runtime_diary + world.log = GLOB.runtime_diary ..(E) world.log = null diff --git a/code/modules/error_handler/error_viewer.dm b/code/modules/error_handler/error_viewer.dm index 11d7532023b91..eee95fe0af8f9 100644 --- a/code/modules/error_handler/error_viewer.dm +++ b/code/modules/error_handler/error_viewer.dm @@ -8,10 +8,10 @@ // right here: #ifdef DEBUG -/var/datum/error_viewer/error_cache/error_cache = new() +GLOBAL_DATUM_INIT(error_cache, /datum/error_viewer/error_cache, new) #else // If debugging is disabled, there's nothing useful to log, so don't bother. -/var/datum/error_viewer/error_cache/error_cache = null +GLOBAL_DATUM(error_cache, /datum/error_viewer/error_cache) #endif // - error_source datums exist for each line (of code) that generates an error, @@ -80,7 +80,7 @@ /datum/error_viewer/error_cache/show_to(user, datum/error_viewer/back_to, linear) var/html = build_header() - html += "[global.total_runtimes] runtimes, [global.total_runtimes_skipped] skipped

    " + html += "[GLOB.total_runtimes] runtimes, [GLOB.total_runtimes_skipped] skipped

    " if (!linear) html += "organized | [make_link("linear", null, 1)]
    " var/datum/error_viewer/error_source/error_source @@ -137,7 +137,7 @@ /datum/error_viewer/error_source/show_to(user, datum/error_viewer/back_to, linear) if (!istype(back_to)) - back_to = error_cache + back_to = GLOB.error_cache var/html = build_header(back_to) for (var/datum/error_viewer/error_entry/error_entry in errors) diff --git a/code/modules/events/alien_infestation.dm b/code/modules/events/alien_infestation.dm index 67651c6bee912..e43349934f9df 100644 --- a/code/modules/events/alien_infestation.dm +++ b/code/modules/events/alien_infestation.dm @@ -36,7 +36,7 @@ /datum/round_event/ghost_role/alien_infestation/spawn_role() var/list/vents = list() - for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in machines) + for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in GLOB.machines) if(QDELETED(temp_vent)) continue if(temp_vent.loc.z == ZLEVEL_STATION && !temp_vent.welded) diff --git a/code/modules/events/blob.dm b/code/modules/events/blob.dm index 2989cc81c5046..1296205fc0144 100644 --- a/code/modules/events/blob.dm +++ b/code/modules/events/blob.dm @@ -24,14 +24,14 @@ /datum/round_event/ghost_role/blob/spawn_role() - if(!blobstart.len) + if(!GLOB.blobstart.len) return MAP_ERROR var/list/candidates = get_candidates("blob", null, ROLE_BLOB) if(!candidates.len) return NOT_ENOUGH_PLAYERS var/mob/dead/observer/new_blob = pick(candidates) - var/obj/structure/blob/core/BC = new/obj/structure/blob/core(pick(blobstart), new_blob.client, new_rate) - BC.overmind.blob_points = min(20 + player_list.len, BC.overmind.max_blob_points) + var/obj/structure/blob/core/BC = new/obj/structure/blob/core(pick(GLOB.blobstart), new_blob.client, new_rate) + BC.overmind.blob_points = min(20 + GLOB.player_list.len, BC.overmind.max_blob_points) spawned_mobs += BC.overmind message_admins("[key_name_admin(BC.overmind)] has been made into a blob overmind by an event.") log_game("[key_name(BC.overmind)] was spawned as a blob overmind by an event.") diff --git a/code/modules/events/brand_intelligence.dm b/code/modules/events/brand_intelligence.dm index 38691383a0e0e..cd477d736ff25 100644 --- a/code/modules/events/brand_intelligence.dm +++ b/code/modules/events/brand_intelligence.dm @@ -26,7 +26,7 @@ /datum/round_event/brand_intelligence/start() - for(var/obj/machinery/vending/V in machines) + for(var/obj/machinery/vending/V in GLOB.machines) if(V.z != 1) continue vendingMachines.Add(V) diff --git a/code/modules/events/camerafailure.dm b/code/modules/events/camerafailure.dm index 695b82a192600..1ba0ac2f553c4 100644 --- a/code/modules/events/camerafailure.dm +++ b/code/modules/events/camerafailure.dm @@ -12,10 +12,10 @@ /datum/round_event/camera_failure/tick() var/iterations = 1 - var/obj/machinery/camera/C = pick(cameranet.cameras) + var/obj/machinery/camera/C = pick(GLOB.cameranet.cameras) while(prob(round(100/iterations))) while(!("SS13" in C.network)) - C = pick(cameranet.cameras) + C = pick(GLOB.cameranet.cameras) if(C.status) C.toggle_cam(null, 0) iterations *= 2.5 diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm index a7af3fe9a3130..774dbee461ab4 100644 --- a/code/modules/events/carp_migration.dm +++ b/code/modules/events/carp_migration.dm @@ -18,7 +18,7 @@ /datum/round_event/carp_migration/start() - for(var/obj/effect/landmark/C in landmarks_list) + for(var/obj/effect/landmark/C in GLOB.landmarks_list) if(C.name == "carpspawn") if(prob(95)) new /mob/living/simple_animal/hostile/carp(C.loc) diff --git a/code/modules/events/communications_blackout.dm b/code/modules/events/communications_blackout.dm index 6dc9751baf059..5543db7517bdf 100644 --- a/code/modules/events/communications_blackout.dm +++ b/code/modules/events/communications_blackout.dm @@ -8,13 +8,13 @@ /datum/round_event/communications_blackout/announce() var/alert = pick( "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you*%fj00)`5vc-BZZT", \ - "Ionospheric anomalies detected. Temporary telecommunication failu*3mga;b4;'1v¬-BZZZT", \ + "Ionospheric anomalies detected. Temporary telecommunication failu*3mga;b4;'1v�-BZZZT", \ "Ionospheric anomalies detected. Temporary telec#MCi46:5.;@63-BZZZZT", \ "Ionospheric anomalies dete'fZ\\kg5_0-BZZZZZT", \ - "Ionospheri:%£ MCayj^j<.3-BZZZZZZT", \ - "#4nd%;f4y6,>£%-BZZZZZZZT") + "Ionospheri:%� MCayj^j<.3-BZZZZZZT", \ + "#4nd%;f4y6,>�%-BZZZZZZZT") - for(var/mob/living/silicon/ai/A in ai_list) //AIs are always aware of communication blackouts. + for(var/mob/living/silicon/ai/A in GLOB.ai_list) //AIs are always aware of communication blackouts. to_chat(A, "
    [alert]
    ") if(prob(30)) //most of the time, we don't want an announcement, so as to allow AIs to fake blackouts. @@ -22,5 +22,5 @@ /datum/round_event/communications_blackout/start() - for(var/obj/machinery/telecomms/T in telecomms_list) + for(var/obj/machinery/telecomms/T in GLOB.telecomms_list) T.emp_act(1) diff --git a/code/modules/events/devil.dm b/code/modules/events/devil.dm index 5a7b9d483ecc2..e4a90fc1841e3 100644 --- a/code/modules/events/devil.dm +++ b/code/modules/events/devil.dm @@ -14,7 +14,7 @@ /datum/round_event/ghost_role/devil/spawn_role() //selecting a spawn_loc - var/list/spawn_locs = latejoin + var/list/spawn_locs = GLOB.latejoin var/spawn_loc = pick(spawn_locs) if(!spawn_loc) return MAP_ERROR diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm index d19c54d508072..1d870b7f65562 100644 --- a/code/modules/events/disease_outbreak.dm +++ b/code/modules/events/disease_outbreak.dm @@ -21,7 +21,7 @@ if(!virus_type) virus_type = pick(/datum/disease/dnaspread, /datum/disease/advance/flu, /datum/disease/advance/cold, /datum/disease/brainrot, /datum/disease/magnitis) - for(var/mob/living/carbon/human/H in shuffle(living_mob_list)) + for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list)) var/turf/T = get_turf(H) if(!T) continue diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm index 2aa71f91233e5..25b3283defb21 100644 --- a/code/modules/events/dust.dm +++ b/code/modules/events/dust.dm @@ -12,7 +12,7 @@ announceWhen = 0 /datum/round_event/space_dust/start() - spawn_meteors(1, meteorsC) + spawn_meteors(1, GLOB.meteorsC) /datum/round_event_control/sandstorm name = "Sandstorm" @@ -27,4 +27,4 @@ announceWhen = 0 /datum/round_event/sandstorm/tick() - spawn_meteors(10, meteorsC) \ No newline at end of file + spawn_meteors(10, GLOB.meteorsC) \ No newline at end of file diff --git a/code/modules/events/electrical_storm.dm b/code/modules/events/electrical_storm.dm index 1568e409207ce..3034f1c8f55ce 100644 --- a/code/modules/events/electrical_storm.dm +++ b/code/modules/events/electrical_storm.dm @@ -20,7 +20,7 @@ for(var/i=1, i <= lightsoutAmount, i++) var/list/possibleEpicentres = list() - for(var/obj/effect/landmark/newEpicentre in landmarks_list) + for(var/obj/effect/landmark/newEpicentre in GLOB.landmarks_list) if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList)) possibleEpicentres += newEpicentre if(possibleEpicentres.len) diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm index a7a6a3564eaf9..d66ce62c3e714 100644 --- a/code/modules/events/grid_check.dm +++ b/code/modules/events/grid_check.dm @@ -13,7 +13,7 @@ /datum/round_event/grid_check/start() - for(var/P in apcs_list) + for(var/P in GLOB.apcs_list) var/obj/machinery/power/apc/C = P if(C.cell && C.z == ZLEVEL_STATION) C.energy_fail(rand(30,120)) \ No newline at end of file diff --git a/code/modules/events/holiday/halloween.dm b/code/modules/events/holiday/halloween.dm index 336665877f3b2..2bedd05866c09 100644 --- a/code/modules/events/holiday/halloween.dm +++ b/code/modules/events/holiday/halloween.dm @@ -8,7 +8,7 @@ /datum/round_event/spooky/start() ..() - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) var/obj/item/weapon/storage/backpack/b = locate() in H.contents new /obj/item/weapon/storage/spooky(b) if(ishuman(H) || islizard(H)) @@ -17,9 +17,9 @@ else H.set_species(/datum/species/zombie) - for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in mob_list) + for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_list) Ian.place_on_head(new /obj/item/weapon/bedsheet(Ian)) - for(var/mob/living/simple_animal/parrot/Poly/Poly in mob_list) + for(var/mob/living/simple_animal/parrot/Poly/Poly in GLOB.mob_list) new /mob/living/simple_animal/parrot/Poly/ghost(Poly.loc) qdel(Poly) @@ -35,7 +35,7 @@ earliest_start = 0 /datum/round_event/carp_migration/eyeballs/start() - for(var/obj/effect/landmark/C in landmarks_list) + for(var/obj/effect/landmark/C in GLOB.landmarks_list) if(C.name == "carpspawn") new /mob/living/simple_animal/hostile/carp/eyeball(C.loc) @@ -52,7 +52,7 @@ /datum/round_event/meteor_wave/spooky/tick() if(IsMultiple(activeFor, 4)) - spawn_meteors(3, meteorsSPOOKY) //meteor list types defined in gamemode/meteor/meteors.dm + spawn_meteors(3, GLOB.meteorsSPOOKY) //meteor list types defined in gamemode/meteor/meteors.dm //Creepy clown invasion /datum/round_event_control/creepy_clowns @@ -66,7 +66,7 @@ endWhen = 40 /datum/round_event/creepy_clowns/start() - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(!H.client || !istype(H)) return to_chat(H, "Honk...") @@ -77,7 +77,7 @@ /datum/round_event/creepy_clowns/tick() if(IsMultiple(activeFor, 4)) - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if (prob(66)) playsound(H.loc, pick('sound/spookoween/scary_horn.ogg','sound/spookoween/scary_horn2.ogg', 'sound/spookoween/scary_horn3.ogg'), 100, 1) if (prob(33)) diff --git a/code/modules/events/holiday/vday.dm b/code/modules/events/holiday/vday.dm index 12023f4ab4cf2..c53854a8e809f 100644 --- a/code/modules/events/holiday/vday.dm +++ b/code/modules/events/holiday/vday.dm @@ -14,14 +14,14 @@ /datum/round_event/valentines/start() ..() - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) H.put_in_hands(new /obj/item/weapon/valentine) var/obj/item/weapon/storage/backpack/b = locate() in H.contents new /obj/item/weapon/reagent_containers/food/snacks/candyheart(b) var/list/valentines = list() - for(var/mob/living/M in player_list) + for(var/mob/living/M in GLOB.player_list) if(!M.stat && M.client && M.mind) valentines |= M diff --git a/code/modules/events/holiday/xmas.dm b/code/modules/events/holiday/xmas.dm index 1aa4f7585e52d..c5f74ed68e658 100644 --- a/code/modules/events/holiday/xmas.dm +++ b/code/modules/events/holiday/xmas.dm @@ -30,9 +30,9 @@ for(var/turf/open/floor/T in orange(1,xmas)) for(var/i=1,i<=rand(1,5),i++) new /obj/item/weapon/a_gift(T) - for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in mob_list) + for(var/mob/living/simple_animal/pet/dog/corgi/Ian/Ian in GLOB.mob_list) Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian)) - for(var/obj/machinery/computer/security/telescreen/entertainment/Monitor in machines) + for(var/obj/machinery/computer/security/telescreen/entertainment/Monitor in GLOB.machines) Monitor.icon_state = "entertainment_xmas" /datum/round_event/presents/announce() @@ -60,7 +60,7 @@ "What do you get from eating tree decorations?\n\nTinsilitis!", "What do snowmen wear on their heads?\n\nIce caps!", "Why is Christmas just like life on ss13?\n\nYou do all the work and the fat guy gets all the credit.", - "Why doesn’t Santa have any children?\n\nBecause he only comes down the chimney.") + "Why doesn�t Santa have any children?\n\nBecause he only comes down the chimney.") new /obj/item/clothing/head/festive(target.loc) user.update_icons() cracked = 1 @@ -103,11 +103,11 @@ priority_announce("Santa is coming to town!", "Unknown Transmission") /datum/round_event/santa/start() - for(var/mob/M in dead_mob_list) + for(var/mob/M in GLOB.dead_mob_list) spawn(0) var/response = alert(M, "Santa is coming to town! Do you want to be santa?", "Ho ho ho!", "Yes", "No") if(response == "Yes" && M && M.client && M.stat == DEAD && !santa) - santa = new /mob/living/carbon/human(pick(blobstart)) + santa = new /mob/living/carbon/human(pick(GLOB.blobstart)) santa.key = M.key qdel(M) diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm index a7f2ec62c8aba..fabd2d7387dff 100644 --- a/code/modules/events/immovable_rod.dm +++ b/code/modules/events/immovable_rod.dm @@ -20,7 +20,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 priority_announce("What the fuck was that?!", "General Alert") /datum/round_event/immovable_rod/start() - var/startside = pick(cardinal) + var/startside = pick(GLOB.cardinal) var/turf/startT = spaceDebrisStartLoc(startside, 1) var/turf/endT = spaceDebrisFinishLoc(startside, 1) new /obj/effect/immovablerod(startT, endT) @@ -47,7 +47,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 notify_ghosts("\A [src] is inbound!", enter_link="(Click to orbit)", source=src, action=NOTIFY_ORBIT) - poi_list += src + GLOB.poi_list += src if(end && end.z==z_original) walk_towards(src, destination, 1) @@ -58,7 +58,7 @@ In my current plan for it, 'solid' will be defined as anything with density == 1 ghost.ManualFollow(src) /obj/effect/immovablerod/Destroy() - poi_list -= src + GLOB.poi_list -= src . = ..() /obj/effect/immovablerod/Move() diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 93b31a9a3bd5b..b159468642d7f 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -32,7 +32,7 @@ /datum/round_event/ion_storm/start() //AI laws - for(var/mob/living/silicon/ai/M in living_mob_list) + for(var/mob/living/silicon/ai/M in GLOB.living_mob_list) M.laws_sanity_check() if(M.stat != 2 && M.see_in_dark != 0) if(prob(replaceLawsetChance)) @@ -55,7 +55,7 @@ M.post_lawchange() if(botEmagChance) - for(var/mob/living/simple_animal/bot/bot in living_mob_list) + for(var/mob/living/simple_animal/bot/bot in GLOB.living_mob_list) if(prob(botEmagChance)) bot.emag_act() diff --git a/code/modules/events/mass_hallucination.dm b/code/modules/events/mass_hallucination.dm index 1705598c36e1c..3f8d2bb3ecd75 100644 --- a/code/modules/events/mass_hallucination.dm +++ b/code/modules/events/mass_hallucination.dm @@ -6,5 +6,5 @@ min_players = 1 /datum/round_event/mass_hallucination/start() - for(var/mob/living/carbon/C in living_mob_list) + for(var/mob/living/carbon/C in GLOB.living_mob_list) C.hallucination += rand(20, 50) \ No newline at end of file diff --git a/code/modules/events/meteor_wave.dm b/code/modules/events/meteor_wave.dm index 92e14315b1343..19a04705e9884 100644 --- a/code/modules/events/meteor_wave.dm +++ b/code/modules/events/meteor_wave.dm @@ -27,15 +27,15 @@ "catastrophic" = 10)) switch(wave_name) if("normal") - wave_type = meteors_normal + wave_type = GLOB.meteors_normal if("threatening") - wave_type = meteors_threatening + wave_type = GLOB.meteors_threatening if("catastrophic") - wave_type = meteors_catastrophic + wave_type = GLOB.meteors_catastrophic if("meaty") - wave_type = meteorsB + wave_type = GLOB.meteorsB if("space dust") - wave_type = meteorsC + wave_type = GLOB.meteorsC else WARNING("Wave name of [wave_name] not recognised.") kill() diff --git a/code/modules/events/operative.dm b/code/modules/events/operative.dm index 0e18cf576f16a..4db2029ce7d2f 100644 --- a/code/modules/events/operative.dm +++ b/code/modules/events/operative.dm @@ -16,7 +16,7 @@ var/mob/dead/selected = pick_n_take(candidates) var/list/spawn_locs = list() - for(var/obj/effect/landmark/L in landmarks_list) + for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(L.name in list("ninjaspawn","carpspawn")) spawn_locs += L.loc if(!spawn_locs.len) @@ -35,7 +35,7 @@ SSticker.mode.traitors |= Mind Mind.active = 1 - var/obj/machinery/nuclearbomb/selfdestruct/nuke = locate() in machines + var/obj/machinery/nuclearbomb/selfdestruct/nuke = locate() in GLOB.machines if(nuke) var/nuke_code if(!nuke.r_code || nuke.r_code == "ADMIN") diff --git a/code/modules/events/portal_storm.dm b/code/modules/events/portal_storm.dm index 68dc65671992a..8f95552a4b970 100644 --- a/code/modules/events/portal_storm.dm +++ b/code/modules/events/portal_storm.dm @@ -50,14 +50,14 @@ for(var/hostile in hostile_types) number_of_hostiles += hostile_types[hostile] - var/list/b_spawns = generic_event_spawns.Copy() + var/list/b_spawns = GLOB.generic_event_spawns.Copy() while(number_of_bosses > boss_spawn.len) var/turf/F = get_turf(pick_n_take(b_spawns)) if(!F) F = safepick(get_area_turfs(pick(station_areas))) boss_spawn += F - var/list/h_spawns = generic_event_spawns.Copy() + var/list/h_spawns = GLOB.generic_event_spawns.Copy() while(number_of_hostiles > hostiles_spawn.len) var/turf/T = get_turf(pick_n_take(h_spawns)) if(!T) diff --git a/code/modules/events/processor_overload.dm b/code/modules/events/processor_overload.dm index b4f20fb93cf76..19d7973d3db31 100644 --- a/code/modules/events/processor_overload.dm +++ b/code/modules/events/processor_overload.dm @@ -15,7 +15,7 @@ "Exospheri:%£ QCbyj^j[alert]
    ") @@ -27,7 +27,7 @@ /datum/round_event/processor_overload/start() - for(var/obj/machinery/telecomms/T in telecomms_list) + for(var/obj/machinery/telecomms/T in GLOB.telecomms_list) if(istype(T, /obj/machinery/telecomms/processor)) var/obj/machinery/telecomms/processor/P = T if(prob(10)) diff --git a/code/modules/events/sentience.dm b/code/modules/events/sentience.dm index 0b607e87e62e8..64175e11e9960 100644 --- a/code/modules/events/sentience.dm +++ b/code/modules/events/sentience.dm @@ -29,11 +29,11 @@ // find our chosen mob to breathe life into // Mobs have to be simple animals, mindless and on station var/list/potential = list() - for(var/mob/living/simple_animal/L in living_mob_list) + for(var/mob/living/simple_animal/L in GLOB.living_mob_list) var/turf/T = get_turf(L) if(T.z != ZLEVEL_STATION) continue - if(!(L in player_list) && !L.mind) + if(!(L in GLOB.player_list) && !L.mind) potential += L if(!potential.len) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index c50b2dc919314..5dc56ceac89f0 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -434,14 +434,14 @@ var/list/growth_queue = list() var/spread_multiplier = 5 var/spread_cap = 30 - var/list/mutations_list = list() + var/list/GLOB.mutations_list = list() var/mutativeness = 1 /obj/effect/spacevine_controller/New(loc, list/muts, potency, production) add_atom_colour("#ffffff", FIXED_COLOUR_PRIORITY) spawn_spacevine_piece(loc, , muts) START_PROCESSING(SSobj, src) - init_subtypes(/datum/spacevine_mutation/, mutations_list) + init_subtypes(/datum/spacevine_mutation/, GLOB.mutations_list) if(potency != null) mutativeness = potency / 10 if(production != null) @@ -476,7 +476,7 @@ var/parentcolor = parent.atom_colours[FIXED_COLOUR_PRIORITY] SV.add_atom_colour(parentcolor, FIXED_COLOUR_PRIORITY) if(prob(mutativeness)) - var/datum/spacevine_mutation/randmut = pick(mutations_list - SV.mutations) + var/datum/spacevine_mutation/randmut = pick(GLOB.mutations_list - SV.mutations) randmut.add_mutation_to_vinepiece(SV) for(var/datum/spacevine_mutation/SM in SV.mutations) @@ -547,7 +547,7 @@ buckle_mob(V, 1) /obj/structure/spacevine/proc/spread() - var/direction = pick(cardinal) + var/direction = pick(GLOB.cardinal) var/turf/stepturf = get_step(src,direction) for(var/datum/spacevine_mutation/SM in mutations) SM.on_spread(src, stepturf) diff --git a/code/modules/events/spontaneous_appendicitis.dm b/code/modules/events/spontaneous_appendicitis.dm index 491da24ba6c01..4bd0a72988270 100644 --- a/code/modules/events/spontaneous_appendicitis.dm +++ b/code/modules/events/spontaneous_appendicitis.dm @@ -7,7 +7,7 @@ min_players = 5 // To make your chance of getting help a bit higher. /datum/round_event/spontaneous_appendicitis/start() - for(var/mob/living/carbon/human/H in shuffle(living_mob_list)) + for(var/mob/living/carbon/human/H in shuffle(GLOB.living_mob_list)) var/foundAlready = 0 //don't infect someone that already has the virus for(var/datum/disease/D in H.viruses) foundAlready = 1 diff --git a/code/modules/events/vent_clog.dm b/code/modules/events/vent_clog.dm index dcbdba4db9cf3..dc7fccf05b499 100644 --- a/code/modules/events/vent_clog.dm +++ b/code/modules/events/vent_clog.dm @@ -18,7 +18,7 @@ /datum/round_event/vent_clog/setup() endWhen = rand(25, 100) - for(var/obj/machinery/atmospherics/components/unary/vent_scrubber/temp_vent in machines) + for(var/obj/machinery/atmospherics/components/unary/vent_scrubber/temp_vent in GLOB.machines) if(temp_vent.loc.z == ZLEVEL_STATION && !temp_vent.welded) var/datum/pipeline/temp_vent_parent = temp_vent.PARENT1 if(temp_vent_parent.other_atmosmch.len > 20) diff --git a/code/modules/events/wizard/aid.dm b/code/modules/events/wizard/aid.dm index 8bf84cd0b862b..799b9fe8cfe59 100644 --- a/code/modules/events/wizard/aid.dm +++ b/code/modules/events/wizard/aid.dm @@ -9,7 +9,7 @@ /datum/round_event/wizard/robelesscasting/start() - for(var/mob/living/L in mob_list) //Hey if a corgi has magic missle he should get the same benifit as anyone + for(var/mob/living/L in GLOB.mob_list) //Hey if a corgi has magic missle he should get the same benifit as anyone if(L.mind && L.mind.spell_list.len != 0) var/spell_improved = 0 for(var/obj/effect/proc_holder/spell/S in L.mind.spell_list) @@ -29,7 +29,7 @@ earliest_start = 0 /datum/round_event/wizard/improvedcasting/start() - for(var/mob/living/L in mob_list) + for(var/mob/living/L in GLOB.mob_list) if(L.mind && L.mind.spell_list.len != 0) for(var/obj/effect/proc_holder/spell/S in L.mind.spell_list) S.name = initial(S.name) diff --git a/code/modules/events/wizard/blobies.dm b/code/modules/events/wizard/blobies.dm index 6953370e4585e..bffa138933a9d 100644 --- a/code/modules/events/wizard/blobies.dm +++ b/code/modules/events/wizard/blobies.dm @@ -7,5 +7,5 @@ /datum/round_event/wizard/blobies/start() - for(var/mob/living/carbon/human/H in dead_mob_list) + for(var/mob/living/carbon/human/H in GLOB.dead_mob_list) new /mob/living/simple_animal/hostile/blob/blobspore(H.loc) diff --git a/code/modules/events/wizard/curseditems.dm b/code/modules/events/wizard/curseditems.dm index f20be708b2775..2d0b5251d508b 100644 --- a/code/modules/events/wizard/curseditems.dm +++ b/code/modules/events/wizard/curseditems.dm @@ -37,7 +37,7 @@ ruins_spaceworthiness = 1 ruins_wizard_loadout = 1 - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(ruins_spaceworthiness && (H.z != 1 || isspaceturf(H.loc) || isplasmaman(H))) continue //#savetheminers if(ruins_wizard_loadout && H.mind && ((H.mind in SSticker.mode.wizards) || (H.mind in SSticker.mode.apprentices))) @@ -54,7 +54,7 @@ I.flags |= NODROP I.name = "cursed " + I.name - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() diff --git a/code/modules/events/wizard/departmentrevolt.dm b/code/modules/events/wizard/departmentrevolt.dm index cfe253a6cd93d..83f05fae2c10f 100644 --- a/code/modules/events/wizard/departmentrevolt.dm +++ b/code/modules/events/wizard/departmentrevolt.dm @@ -35,7 +35,7 @@ nation += pick("stan", "topia", "land", "nia", "ca", "tova", "dor", "ador", "tia", "sia", "ano", "tica", "tide", "cis", "marea", "co", "taoide", "slavia", "stotzka") - for(var/mob/living/carbon/human/H in mob_list) + for(var/mob/living/carbon/human/H in GLOB.mob_list) if(H.mind) var/datum/mind/M = H.mind if(M.assigned_role && !(M in SSticker.mode.traitors)) diff --git a/code/modules/events/wizard/fakeexplosion.dm b/code/modules/events/wizard/fakeexplosion.dm index 10892f2132c44..2dec270472beb 100644 --- a/code/modules/events/wizard/fakeexplosion.dm +++ b/code/modules/events/wizard/fakeexplosion.dm @@ -6,6 +6,6 @@ earliest_start = 0 /datum/round_event/wizard/fake_explosion/start() - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) M << 'sound/machines/Alarm.ogg' addtimer(CALLBACK(SSticker, /datum/controller/subsystem/ticker/.proc/station_explosion_cinematic, 1, "fake"), 100) //:o) \ No newline at end of file diff --git a/code/modules/events/wizard/ghost.dm b/code/modules/events/wizard/ghost.dm index 1227833de2739..d29c6c0534fe4 100644 --- a/code/modules/events/wizard/ghost.dm +++ b/code/modules/events/wizard/ghost.dm @@ -20,7 +20,7 @@ earliest_start = 0 /datum/round_event/wizard/possession/start() - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) G.verbs += /mob/dead/observer/verb/boo G.verbs += /mob/dead/observer/verb/possess to_chat(G, "You suddenly feel a welling of new spooky powers...") diff --git a/code/modules/events/wizard/greentext.dm b/code/modules/events/wizard/greentext.dm index 5106f191f24be..a2db78ee67964 100644 --- a/code/modules/events/wizard/greentext.dm +++ b/code/modules/events/wizard/greentext.dm @@ -7,7 +7,7 @@ /datum/round_event/wizard/greentext/start() - var/list/holder_canadates = player_list.Copy() + var/list/holder_canadates = GLOB.player_list.Copy() for(var/mob/M in holder_canadates) if(!ishuman(M)) holder_canadates -= M @@ -33,7 +33,7 @@ /obj/item/weapon/greentext/New() ..() - poi_list |= src + GLOB.poi_list |= src /obj/item/weapon/greentext/equipped(mob/living/user as mob) to_chat(user, "So long as you leave this place with greentext in hand you know will be happy...") @@ -82,8 +82,8 @@ return QDEL_HINT_LETMELIVE . = ..() - poi_list.Remove(src) - for(var/mob/M in mob_list) + GLOB.poi_list.Remove(src) + for(var/mob/M in GLOB.mob_list) var/message = "A dark temptation has passed from this world" if(M in color_altered_mobs) message += " and you're finally able to forgive yourself" diff --git a/code/modules/events/wizard/invincible.dm b/code/modules/events/wizard/invincible.dm index f8436773ecfad..adb0a107b2465 100644 --- a/code/modules/events/wizard/invincible.dm +++ b/code/modules/events/wizard/invincible.dm @@ -7,6 +7,6 @@ /datum/round_event/wizard/invincible/start() - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) H.reagents.add_reagent("adminordrazine", 40) //100 ticks of absolute invinciblity (barring gibs) to_chat(H, "You feel invincible, nothing can hurt you!") \ No newline at end of file diff --git a/code/modules/events/wizard/magicarp.dm b/code/modules/events/wizard/magicarp.dm index fe89f02b91459..3d0461d3cf337 100644 --- a/code/modules/events/wizard/magicarp.dm +++ b/code/modules/events/wizard/magicarp.dm @@ -16,7 +16,7 @@ priority_announce("Unknown magical entities have been detected near [station_name()], please stand-by.", "Lifesign Alert") /datum/round_event/wizard/magicarp/start() - for(var/obj/effect/landmark/C in landmarks_list) + for(var/obj/effect/landmark/C in GLOB.landmarks_list) if(C.name == "carpspawn") if(prob(5)) new /mob/living/simple_animal/hostile/carp/ranged/chaos(C.loc) diff --git a/code/modules/events/wizard/petsplosion.dm b/code/modules/events/wizard/petsplosion.dm index 30d6d631ac522..d69549e2051ba 100644 --- a/code/modules/events/wizard/petsplosion.dm +++ b/code/modules/events/wizard/petsplosion.dm @@ -12,6 +12,6 @@ /datum/round_event/wizard/petsplosion/tick() if(activeFor >= 30 * countdown) // 0 seconds : 2 animals | 30 seconds : 4 animals | 1 minute : 8 animals countdown += 1 - for(var/mob/living/simple_animal/F in living_mob_list) //If you cull the heard before the next replication, things will be easier for you + for(var/mob/living/simple_animal/F in GLOB.living_mob_list) //If you cull the heard before the next replication, things will be easier for you if(!ishostile(F)) new F.type(F.loc) \ No newline at end of file diff --git a/code/modules/events/wizard/race.dm b/code/modules/events/wizard/race.dm index 03952d03ae289..298d92dd3c988 100644 --- a/code/modules/events/wizard/race.dm +++ b/code/modules/events/wizard/race.dm @@ -20,7 +20,7 @@ if(prob(50)) all_the_same = 1 - for(var/mob/living/carbon/human/H in mob_list) //yes, even the dead + for(var/mob/living/carbon/human/H in GLOB.mob_list) //yes, even the dead H.set_species(new_species) H.real_name = new_species.random_name(H.gender,1) H.dna.unique_enzymes = H.dna.generate_unique_enzymes() diff --git a/code/modules/events/wizard/shuffle.dm b/code/modules/events/wizard/shuffle.dm index a5ffbfa658166..e1db0666740d5 100644 --- a/code/modules/events/wizard/shuffle.dm +++ b/code/modules/events/wizard/shuffle.dm @@ -12,7 +12,7 @@ var/list/moblocs = list() var/list/mobs = list() - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(H.z != 1) continue //lets not try to strand people in space or stuck in the wizards den moblocs += H.loc @@ -30,7 +30,7 @@ do_teleport(H, moblocs[moblocs.len]) moblocs.len -= 1 - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() @@ -48,7 +48,7 @@ var/list/mobnames = list() var/list/mobs = list() - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) mobnames += H.real_name mobs += H @@ -64,7 +64,7 @@ H.real_name = mobnames[mobnames.len] mobnames.len -= 1 - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() @@ -81,7 +81,7 @@ /datum/round_event/wizard/shuffleminds/start() var/list/mobs = list() - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(H.stat || !H.mind || (H.mind in SSticker.mode.wizards) || (H.mind in SSticker.mode.apprentices)) continue //the wizard(s) are spared on this one mobs += H @@ -98,7 +98,7 @@ swapper.cast(list(H), mobs[mobs.len], 1) mobs -= mobs[mobs.len] - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) var/datum/effect_system/smoke_spread/smoke = new smoke.set_up(0, H.loc) smoke.start() diff --git a/code/modules/events/wormholes.dm b/code/modules/events/wormholes.dm index 04313515b7604..29837075ac2da 100644 --- a/code/modules/events/wormholes.dm +++ b/code/modules/events/wormholes.dm @@ -39,7 +39,7 @@ O.loc = T /datum/round_event/wormholes/end() - portals.Remove(wormholes) + GLOB.portals.Remove(wormholes) for(var/obj/effect/portal/wormhole/O in wormholes) O.loc = null wormholes.Cut() @@ -67,8 +67,8 @@ if(istype(M, /atom/movable)) var/turf/target - if(portals.len) - var/obj/effect/portal/P = pick(portals) + if(GLOB.portals.len) + var/obj/effect/portal/P = pick(GLOB.portals) if(P && isturf(P.loc)) target = P.loc if(!target) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index a1a64f1f3bbe6..d735d8e534f64 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -148,7 +148,7 @@ Gunshots/explosions/opening doors/less rare audio (done) /obj/effect/hallucination/fake_flood/proc/Expand() for(var/turf/FT in flood_turfs) - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/turf/T = get_step(FT, dir) if((T in flood_turfs) || !FT.CanAtmosPass(T)) continue @@ -216,7 +216,7 @@ Gunshots/explosions/opening doors/less rare audio (done) /obj/effect/hallucination/simple/clown/Initialize(mapload, var/mob/living/carbon/T,duration) ..(loc, T) - name = pick(clown_names) + name = pick(GLOB.clown_names) QDEL_IN(src,duration) /obj/effect/hallucination/simple/clown/scary @@ -441,7 +441,7 @@ Gunshots/explosions/opening doors/less rare audio (done) target = T var/image/A = null var/kind = force_kind ? force_kind : pick("clown","corgi","carp","skeleton","demon","zombie") - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(H == target) continue if(skip_nearby && (H in view(target))) @@ -518,7 +518,7 @@ Gunshots/explosions/opening doors/less rare audio (done) var/mob/living/carbon/human/clone = null var/clone_weapon = null - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(H.stat || H.lying) continue clone = H @@ -527,7 +527,24 @@ Gunshots/explosions/opening doors/less rare audio (done) if(!clone) return + var/static/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/ballistic, /obj/item/ammo_box/a357,\ + /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow, /obj/item/weapon/melee/energy/sword/saber,\ + /obj/item/weapon/storage/box/syndicate, /obj/item/weapon/storage/box/emps,\ + /obj/item/weapon/cartridge/syndicate, /obj/item/clothing/under/chameleon,\ + /obj/item/clothing/shoes/chameleon, /obj/item/weapon/card/id/syndicate,\ + /obj/item/clothing/mask/chameleon, /obj/item/clothing/glasses/thermal,\ + /obj/item/device/chameleon, /obj/item/weapon/card/emag, /obj/item/weapon/grenade/plastic/x4,\ + /obj/item/weapon/storage/toolbox/syndicate, /obj/item/weapon/aiModule,\ + /obj/item/device/radio/headset/syndicate, /obj/item/weapon/grenade/plastic/c4,\ + /obj/item/device/powersink, /obj/item/weapon/storage/box/syndie_kit,\ + /obj/item/toy/syndicateballoon, /obj/item/weapon/gun/energy/laser/captain,\ + /obj/item/weapon/hand_tele, /obj/item/weapon/rcd, /obj/item/weapon/tank/jetpack,\ + /obj/item/clothing/under/rank/captain, /obj/item/device/aicard,\ + /obj/item/clothing/shoes/magboots, /obj/item/areaeditor/blueprints, /obj/item/weapon/disk/nuclear,\ + /obj/item/clothing/suit/space/nasavoid, /obj/item/weapon/tank) + var/obj/effect/fake_attacker/F = new/obj/effect/fake_attacker(get_turf(target),target) + for(var/obj/item/I in clone.held_items) if(!(locate(I) in non_fakeattack_weapons)) clone_weapon = I.name @@ -655,21 +672,7 @@ Gunshots/explosions/opening doors/less rare audio (done) to_chat(target, I) QDEL_IN(O, 300) -var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/ballistic, /obj/item/ammo_box/a357,\ - /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow, /obj/item/weapon/melee/energy/sword/saber,\ - /obj/item/weapon/storage/box/syndicate, /obj/item/weapon/storage/box/emps,\ - /obj/item/weapon/cartridge/syndicate, /obj/item/clothing/under/chameleon,\ - /obj/item/clothing/shoes/chameleon, /obj/item/weapon/card/id/syndicate,\ - /obj/item/clothing/mask/chameleon, /obj/item/clothing/glasses/thermal,\ - /obj/item/device/chameleon, /obj/item/weapon/card/emag, /obj/item/weapon/grenade/plastic/x4,\ - /obj/item/weapon/storage/toolbox/syndicate, /obj/item/weapon/aiModule,\ - /obj/item/device/radio/headset/syndicate, /obj/item/weapon/grenade/plastic/c4,\ - /obj/item/device/powersink, /obj/item/weapon/storage/box/syndie_kit,\ - /obj/item/toy/syndicateballoon, /obj/item/weapon/gun/energy/laser/captain,\ - /obj/item/weapon/hand_tele, /obj/item/weapon/rcd, /obj/item/weapon/tank/jetpack,\ - /obj/item/clothing/under/rank/captain, /obj/item/device/aicard,\ - /obj/item/clothing/shoes/magboots, /obj/item/areaeditor/blueprints, /obj/item/weapon/disk/nuclear,\ - /obj/item/clothing/suit/space/nasavoid, /obj/item/weapon/tank) + /obj/effect/hallucination/bolts var/list/doors = list() @@ -703,7 +706,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/ballistic, /obj/item ..() target = T var/speak_messages = list("I'm watching you...","[target.first_name()]!","Get out!","Kchck-Chkck? Kchchck!","Did you hear that?","What did you do ?","Why?","Give me that!","HELP!!","EI NATH!!", "RUN!!", "Kill me!","O bidai nabora se'sma!", "[text2ratvar("Divinity, grant...")]") - var/radio_messages = list("Xenos!","Singularity loose!","Comms down!","They are arming the nuke!","They butchered Ian!","H-help!","[pick("Cult", "Wizard", "Ling", "Ops", "Revenant", "Murderer", "Harm", "I hear flashing", "Help")] in [pick(teleportlocs)][prob(50)?"!":"!!"]","Where's [target.first_name()]?","Call the shuttle!","AI rogue!!") + var/radio_messages = list("Xenos!","Singularity loose!","Comms down!","They are arming the nuke!","They butchered Ian!","H-help!","[pick("Cult", "Wizard", "Ling", "Ops", "Revenant", "Murderer", "Harm", "I hear flashing", "Help")] in [pick(GLOB.teleportlocs)][prob(50)?"!":"!!"]","Where's [target.first_name()]?","Call the shuttle!","AI rogue!!") var/list/mob/living/carbon/people = list() var/list/mob/living/carbon/person = null @@ -726,7 +729,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/ballistic, /obj/item target.client.images.Remove(speech_overlay) else // Radio talk var/list/humans = list() - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) humans += H person = pick(humans) to_chat(target, target.compose_message(person,understood_language,pick(radio_messages),"1459",person.get_spans())) @@ -1006,7 +1009,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/ballistic, /obj/item to_chat(src, "[mind.name] has died at [area.name].") if(prob(50)) var/list/dead_people = list() - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) dead_people += G var/mob/dead/observer/fakemob = pick(dead_people) if(fakemob) diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm index 4c74464e5df54..7c3d130244551 100644 --- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm +++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm @@ -372,12 +372,12 @@ var/turf/bombturf = get_turf(src) var/area/bombarea = get_area(bombturf) var/message = "[ADMIN_LOOKUP(user)] has primed a [name] for detonation at [ADMIN_COORDJMP(bombturf)]." - bombers += message + GLOB.bombers += message message_admins(message) log_game("[key_name(user)] has primed a [name] for detonation at [bombarea] [COORD(bombturf)].") to_chat(user, "You light [src] on fire.") - add_overlay(fire_overlay) + add_overlay(GLOB.fire_overlay) if(!isGlass) spawn(50) if(active) @@ -399,5 +399,5 @@ to_chat(user, "The flame's spread too far on it!") return to_chat(user, "You snuff out the flame on [src].") - cut_overlay(fire_overlay) + cut_overlay(GLOB.fire_overlay) active = 0 diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 13b7f4d8f5fd9..9784a03a20d59 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -22,7 +22,7 @@ /obj/machinery/gibber/autogibber/New() ..() spawn(5) - for(var/i in cardinal) + for(var/i in GLOB.cardinal) var/obj/machinery/mineral/input/input_obj = locate( /obj/machinery/mineral/input, get_step(src.loc, i) ) if(input_obj) if(isturf(input_obj.loc)) @@ -31,7 +31,7 @@ break if(!input_plate) - diary << "a [src] didn't find an input plate." + GLOB.diary << "a [src] didn't find an input plate." return /obj/machinery/gibber/autogibber/Bumped(atom/A) diff --git a/code/modules/food_and_drinks/pizzabox.dm b/code/modules/food_and_drinks/pizzabox.dm index 7e7f049c767f5..c84b381ac5bd3 100644 --- a/code/modules/food_and_drinks/pizzabox.dm +++ b/code/modules/food_and_drinks/pizzabox.dm @@ -109,7 +109,7 @@ bomb_defused = FALSE var/message = "[ADMIN_LOOKUPFLW(user)] has trapped a [src] with [bomb] set to [bomb_timer * 2] seconds." - bombers += message + GLOB.bombers += message message_admins(message) log_game("[key_name(user)] has trapped a [src] with [bomb] set to [bomb_timer * 2] seconds.") bomb.adminlog = "The [bomb.name] in [src.name] that [key_name(user)] activated has detonated!" diff --git a/code/modules/games/cas.dm b/code/modules/games/cas.dm index ed768a2063f23..4cc32d9d6ad31 100644 --- a/code/modules/games/cas.dm +++ b/code/modules/games/cas.dm @@ -4,7 +4,6 @@ // https://creativecommons.org/licenses/by-nc-sa/2.0/legalcode // Original code by Zuhayr, Polaris Station, ported with modifications -var/global/list/cards_against_space /obj/item/toy/cards/deck/cas name = "\improper CAS deck (white)" @@ -29,8 +28,7 @@ var/global/list/cards_against_space card_text_file = "strings/cas_black.txt" /obj/item/toy/cards/deck/cas/New() - if(!cards_against_space) //saves loading from the files every single time a new deck is created, but still lets each deck have a random assortment, it's purely an optimisation - cards_against_space = list("cas_white" = file2list("strings/cas_white.txt"),"cas_black" = file2list("strings/cas_black.txt")) + var/static/list/cards_against_space = list("cas_white" = file2list("strings/cas_white.txt"),"cas_black" = file2list("strings/cas_black.txt")) allcards = cards_against_space[card_face] var/list/possiblecards = allcards.Copy() if(possiblecards.len < decksize) // sanity check diff --git a/code/modules/holiday/easter.dm b/code/modules/holiday/easter.dm index 95fb66bcc79af..29172c9b68f8b 100644 --- a/code/modules/holiday/easter.dm +++ b/code/modules/holiday/easter.dm @@ -26,7 +26,7 @@ /datum/round_event/rabbitrelease/start() - for(var/obj/effect/landmark/R in landmarks_list) + for(var/obj/effect/landmark/R in GLOB.landmarks_list) if(R.name != "blobspawn") if(prob(35)) if(isspaceturf(R.loc)) diff --git a/code/modules/holiday/holidays.dm b/code/modules/holiday/holidays.dm index 55055f8b0c9a5..29d5fd7c28073 100644 --- a/code/modules/holiday/holidays.dm +++ b/code/modules/holiday/holidays.dm @@ -144,7 +144,7 @@ /datum/holiday/april_fools/celebrate() if(SSticker) SSticker.login_music = 'sound/ambience/clown.ogg' - for(var/mob/dead/new_player/P in mob_list) + for(var/mob/dead/new_player/P in GLOB.mob_list) if(P.client) P.client.playtitlemusic() @@ -330,7 +330,7 @@ end_day = 31 /datum/holiday/festive_season/celebrate() - for(var/obj/effect/landmark/xmastree/XT in landmarks_list) + for(var/obj/effect/landmark/xmastree/XT in GLOB.landmarks_list) new XT.tree(get_turf(XT)) qdel(XT) diff --git a/code/modules/html_interface/html_interface.dm b/code/modules/html_interface/html_interface.dm index 10bc46f036514..7979604a21d60 100644 --- a/code/modules/html_interface/html_interface.dm +++ b/code/modules/html_interface/html_interface.dm @@ -80,7 +80,7 @@ You have to use modules/client/asset_cache to ensure they get sent BEFORE the in */ -/var/list/html_interfaces = new/list() +GLOBAL_LIST_EMPTY(html_interfaces) /datum/html_interface // The atom we should report to. @@ -112,7 +112,7 @@ You have to use modules/client/asset_cache to ensure they get sent BEFORE the in var/static/list/asset_list /datum/html_interface/New(atom/ref, title, width = 700, height = 480, head = "") - html_interfaces.Add(src) + GLOB.html_interfaces.Add(src) . = ..() @@ -125,7 +125,7 @@ You have to use modules/client/asset_cache to ensure they get sent BEFORE the in /datum/html_interface/Destroy() src.closeAll() - html_interfaces.Remove(src) + GLOB.html_interfaces.Remove(src) return ..() diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 5a62ff3f34342..c0bbd617bcd37 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -63,7 +63,7 @@ var/datum/reagent/R = null if(random_reagent) R = pick(subtypesof(/datum/reagent)) - R = chemical_reagents_list[initial(R.id)] + R = GLOB.chemical_reagents_list[initial(R.id)] queen_bee = new(src) queen_bee.beehome = src diff --git a/code/modules/hydroponics/beekeeping/honeycomb.dm b/code/modules/hydroponics/beekeeping/honeycomb.dm index 63e85ae5dc71e..442dd84aaf5e1 100644 --- a/code/modules/hydroponics/beekeeping/honeycomb.dm +++ b/code/modules/hydroponics/beekeeping/honeycomb.dm @@ -31,7 +31,7 @@ /obj/item/weapon/reagent_containers/honeycomb/proc/set_reagent(reagent) - var/datum/reagent/R = chemical_reagents_list[reagent] + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent] if(istype(R)) name = "honeycomb ([R.name])" honey_color = R.color diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index d70aa7325668e..b7fe78f35e4cd 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -65,7 +65,7 @@ var/reag_txt = "" if(seed) for(var/reagent_id in seed.reagents_add) - var/datum/reagent/R = chemical_reagents_list[reagent_id] + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] var/amt = reagents.get_reagent_amount(reagent_id) reag_txt += "\n- [R.name]: [amt]" diff --git a/code/modules/hydroponics/grown/citrus.dm b/code/modules/hydroponics/grown/citrus.dm index 3a7ce53d16385..133d0d71f41e4 100644 --- a/code/modules/hydroponics/grown/citrus.dm +++ b/code/modules/hydroponics/grown/citrus.dm @@ -109,7 +109,7 @@ var/area/A = get_area(user) user.visible_message("[user] primes the [src]!", "You prime the [src]!") var/message = "[ADMIN_LOOKUPFLW(user)] primed a combustible lemon for detonation at [A] [ADMIN_COORDJMP(user)]" - bombers += message + GLOB.bombers += message message_admins(message) log_game("[key_name(user)] primed a combustible lemon for detonation at [A] [COORD(user)].") if(iscarbon(user)) diff --git a/code/modules/hydroponics/grown/mushrooms.dm b/code/modules/hydroponics/grown/mushrooms.dm index 915c5792af6ae..d12f9c52cf0e2 100644 --- a/code/modules/hydroponics/grown/mushrooms.dm +++ b/code/modules/hydroponics/grown/mushrooms.dm @@ -240,7 +240,7 @@ return FALSE var/count = 0 var/maxcount = 1 - for(var/tempdir in cardinal) + for(var/tempdir in GLOB.cardinal) var/turf/closed/wall = get_step(user.loc, tempdir) if(istype(wall)) maxcount++ diff --git a/code/modules/hydroponics/grown/replicapod.dm b/code/modules/hydroponics/grown/replicapod.dm index 43566d5696b56..1a98a4715df32 100644 --- a/code/modules/hydroponics/grown/replicapod.dm +++ b/code/modules/hydroponics/grown/replicapod.dm @@ -57,7 +57,7 @@ var/ckey_holder = null if(config.revival_pod_plants) if(ckey) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(isobserver(M)) var/mob/dead/observer/O = M if(O.ckey == ckey && O.can_reenter_corpse) @@ -71,7 +71,7 @@ make_podman = !L.hellbound break else //If the player has ghosted from his corpse before blood was drawn, his ckey is no longer attached to the mob, so we need to match up the cloned player through the mind key - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(mind && M.mind && ckey(M.mind.key) == ckey(mind.key) && M.ckey && M.client && M.stat == 2 && !M.suiciding) if(isobserver(M)) var/mob/dead/observer/O = M diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index e86dd7565f15b..8e3b2e705a351 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -93,7 +93,7 @@ while(processing_atoms.len) var/atom/a = processing_atoms[1] - for(var/step_dir in cardinal) + for(var/step_dir in GLOB.cardinal) var/obj/machinery/hydroponics/h = locate() in get_step(a, step_dir) // Soil plots aren't dense if(h && h.using_irrigation && h.density && !(h in connected) && !(h in processing_atoms)) @@ -279,7 +279,7 @@ /obj/machinery/hydroponics/proc/update_icon_hoses() var/n = 0 - for(var/Dir in cardinal) + for(var/Dir in GLOB.cardinal) var/obj/machinery/hydroponics/t = locate() in get_step(src,Dir) if(t && t.using_irrigation && using_irrigation) n += Dir diff --git a/code/modules/hydroponics/plant_genes.dm b/code/modules/hydroponics/plant_genes.dm index 866818e1b832e..15f5fc948da86 100644 --- a/code/modules/hydroponics/plant_genes.dm +++ b/code/modules/hydroponics/plant_genes.dm @@ -107,7 +107,7 @@ reagent_id = reag_id name = "UNKNOWN" - var/datum/reagent/R = chemical_reagents_list[reag_id] + var/datum/reagent/R = GLOB.chemical_reagents_list[reag_id] if(R && R.id == reagent_id) name = R.name diff --git a/code/modules/hydroponics/sample.dm b/code/modules/hydroponics/sample.dm index 2d3a5d6b2a4e1..a4ab2919be815 100644 --- a/code/modules/hydroponics/sample.dm +++ b/code/modules/hydroponics/sample.dm @@ -1,26 +1,3 @@ -var/list/chem_t1_reagents = list( - "hydrogen", "oxygen", "silicon", - "phosphorus", "sulfur", "carbon", - "nitrogen", "water" -) - -var/list/chem_t2_reagents = list( - "lithium", "copper", "mercury", - "sodium", "iodine", "bromine" -) // "sugar", "sacid" removed because they are already in roundstart plants - -var/list/chem_t3_reagents = list( - "ethanol", "chlorine", "potassium", - "aluminium", "radium", "fluorine", - "iron", "welding_fuel", "silver", - "stable_plasma" -) - -var/list/chem_t4_reagents = list( - "oil", "ash", "acetone", - "saltpetre", "ammonia", "diethylamine" -) - /obj/item/seeds/sample name = "plant sample" icon_state = "sample-empty" diff --git a/code/modules/jobs/access.dm b/code/modules/jobs/access.dm index 1ed7452b1fe40..be6b662790ef7 100644 --- a/code/modules/jobs/access.dm +++ b/code/modules/jobs/access.dm @@ -1,101 +1,101 @@ -/var/const/access_security = 1 // Security equipment -/var/const/access_brig = 2 // Brig timers and permabrig -/var/const/access_armory = 3 -/var/const/access_forensics_lockers= 4 -/var/const/access_medical = 5 -/var/const/access_morgue = 6 -/var/const/access_tox = 7 -/var/const/access_tox_storage = 8 -/var/const/access_genetics = 9 -/var/const/access_engine = 10 -/var/const/access_engine_equip= 11 -/var/const/access_maint_tunnels = 12 -/var/const/access_external_airlocks = 13 -/var/const/access_emergency_storage = 14 -/var/const/access_change_ids = 15 -/var/const/access_ai_upload = 16 -/var/const/access_teleporter = 17 -/var/const/access_eva = 18 -/var/const/access_heads = 19 -/var/const/access_captain = 20 -/var/const/access_all_personal_lockers = 21 -/var/const/access_chapel_office = 22 -/var/const/access_tech_storage = 23 -/var/const/access_atmospherics = 24 -/var/const/access_bar = 25 -/var/const/access_janitor = 26 -/var/const/access_crematorium = 27 -/var/const/access_kitchen = 28 -/var/const/access_robotics = 29 -/var/const/access_rd = 30 -/var/const/access_cargo = 31 -/var/const/access_construction = 32 -/var/const/access_chemistry = 33 -/var/const/access_cargo_bot = 34 -/var/const/access_hydroponics = 35 -/var/const/access_manufacturing = 36 -/var/const/access_library = 37 -/var/const/access_lawyer = 38 -/var/const/access_virology = 39 -/var/const/access_cmo = 40 -/var/const/access_qm = 41 -/var/const/access_court = 42 -/var/const/access_surgery = 45 -/var/const/access_theatre = 46 -/var/const/access_research = 47 -/var/const/access_mining = 48 -/var/const/access_mining_office = 49 //not in use -/var/const/access_mailsorting = 50 -/var/const/access_mint = 51 -/var/const/access_mint_vault = 52 -/var/const/access_heads_vault = 53 -/var/const/access_mining_station = 54 -/var/const/access_xenobiology = 55 -/var/const/access_ce = 56 -/var/const/access_hop = 57 -/var/const/access_hos = 58 -/var/const/access_RC_announce = 59 //Request console announcements -/var/const/access_keycard_auth = 60 //Used for events which require at least two people to confirm them -/var/const/access_tcomsat = 61 // has access to the entire telecomms satellite / machinery -/var/const/access_gateway = 62 -/var/const/access_sec_doors = 63 // Security front doors -/var/const/access_mineral_storeroom = 64 -/var/const/access_minisat = 65 -/var/const/access_weapons = 66 //Weapon authorization for secbots -/var/const/access_network = 67 -/var/const/access_cloning = 68 //Cloning room +GLOBAL_VAR_CONST(access_security, 1) // Security equipment +GLOBAL_VAR_CONST(access_brig, 2) // Brig timers and permabrig +GLOBAL_VAR_CONST(access_armory, 3) +GLOBAL_VAR_CONST(access_forensics_lockers, 4) +GLOBAL_VAR_CONST(access_medical, 5) +GLOBAL_VAR_CONST(access_morgue, 6) +GLOBAL_VAR_CONST(access_tox, 7) +GLOBAL_VAR_CONST(access_tox_storage, 8) +GLOBAL_VAR_CONST(access_genetics, 9) +GLOBAL_VAR_CONST(access_engine, 10) +GLOBAL_VAR_CONST(access_engine_equip, 11) +GLOBAL_VAR_CONST(access_maint_tunnels, 12) +GLOBAL_VAR_CONST(access_external_airlocks, 13) +GLOBAL_VAR_CONST(access_emergency_storage, 14) +GLOBAL_VAR_CONST(access_change_ids, 15) +GLOBAL_VAR_CONST(access_ai_upload, 16) +GLOBAL_VAR_CONST(access_teleporter, 17) +GLOBAL_VAR_CONST(access_eva, 18) +GLOBAL_VAR_CONST(access_heads, 19) +GLOBAL_VAR_CONST(access_captain, 20) +GLOBAL_VAR_CONST(access_all_personal_lockers, 21) +GLOBAL_VAR_CONST(access_chapel_office, 22) +GLOBAL_VAR_CONST(access_tech_storage, 23) +GLOBAL_VAR_CONST(access_atmospherics, 24) +GLOBAL_VAR_CONST(access_bar, 25) +GLOBAL_VAR_CONST(access_janitor, 26) +GLOBAL_VAR_CONST(access_crematorium, 27) +GLOBAL_VAR_CONST(access_kitchen, 28) +GLOBAL_VAR_CONST(access_robotics, 29) +GLOBAL_VAR_CONST(access_rd, 30) +GLOBAL_VAR_CONST(access_cargo, 31) +GLOBAL_VAR_CONST(access_construction, 32) +GLOBAL_VAR_CONST(access_chemistry, 33) +GLOBAL_VAR_CONST(access_cargo_bot, 34) +GLOBAL_VAR_CONST(access_hydroponics, 35) +GLOBAL_VAR_CONST(access_manufacturing, 36) +GLOBAL_VAR_CONST(access_library, 37) +GLOBAL_VAR_CONST(access_lawyer, 38) +GLOBAL_VAR_CONST(access_virology, 39) +GLOBAL_VAR_CONST(access_cmo, 40) +GLOBAL_VAR_CONST(access_qm, 41) +GLOBAL_VAR_CONST(access_court, 42) +GLOBAL_VAR_CONST(access_surgery, 45) +GLOBAL_VAR_CONST(access_theatre, 46) +GLOBAL_VAR_CONST(access_research, 47) +GLOBAL_VAR_CONST(access_mining, 48) +GLOBAL_VAR_CONST(access_mining_office, 49) //not in use +GLOBAL_VAR_CONST(access_mailsorting, 50) +GLOBAL_VAR_CONST(access_mint, 51) +GLOBAL_VAR_CONST(access_mint_vault, 52) +GLOBAL_VAR_CONST(access_heads_vault, 53) +GLOBAL_VAR_CONST(access_mining_station, 54) +GLOBAL_VAR_CONST(access_xenobiology, 55) +GLOBAL_VAR_CONST(access_ce, 56) +GLOBAL_VAR_CONST(access_hop, 57) +GLOBAL_VAR_CONST(access_hos, 58) +GLOBAL_VAR_CONST(access_RC_announce, 59) //Request console announcements +GLOBAL_VAR_CONST(access_keycard_auth, 60) //Used for events which require at least two people to confirm them +GLOBAL_VAR_CONST(access_tcomsat, 61) // has access to the entire telecomms satellite / machinery +GLOBAL_VAR_CONST(access_gateway, 62) +GLOBAL_VAR_CONST(access_sec_doors, 63) // Security front doors +GLOBAL_VAR_CONST(access_mineral_storeroom, 64) +GLOBAL_VAR_CONST(access_minisat, 65) +GLOBAL_VAR_CONST(access_weapons, 66) //Weapon authorization for secbots +GLOBAL_VAR_CONST(access_network, 67) +GLOBAL_VAR_CONST(access_cloning, 68) //Cloning room //BEGIN CENTCOM ACCESS /*Should leave plenty of room if we need to add more access levels. -/var/const/Mostly for admin fun times.*/ -/var/const/access_cent_general = 101//General facilities. -/var/const/access_cent_thunder = 102//Thunderdome. -/var/const/access_cent_specops = 103//Special Ops. -/var/const/access_cent_medical = 104//Medical/Research -/var/const/access_cent_living = 105//Living quarters. -/var/const/access_cent_storage = 106//Generic storage areas. -/var/const/access_cent_teleporter = 107//Teleporter. -/var/const/access_cent_captain = 109//Captain's office/ID comp/AI. -/var/const/access_cent_bar = 110 // The non-existent Centcom Bar + Mostly for admin fun times.*/ +GLOBAL_VAR_CONST(access_cent_general, 101)//General facilities. +GLOBAL_VAR_CONST(access_cent_thunder, 102)//Thunderdome. +GLOBAL_VAR_CONST(access_cent_specops, 103)//Special Ops. +GLOBAL_VAR_CONST(access_cent_medical, 104)//Medical/Research +GLOBAL_VAR_CONST(access_cent_living, 105)//Living quarters. +GLOBAL_VAR_CONST(access_cent_storage, 106)//Generic storage areas. +GLOBAL_VAR_CONST(access_cent_teleporter, 107)//Teleporter. +GLOBAL_VAR_CONST(access_cent_captain, 109)//Captain's office/ID comp/AI. +GLOBAL_VAR_CONST(access_cent_bar, 110) // The non-existent Centcom Bar //The Syndicate -/var/const/access_syndicate = 150//General Syndicate Access -/var/const/access_syndicate_leader = 151//Nuke Op Leader Access +GLOBAL_VAR_CONST(access_syndicate, 150)//General Syndicate Access +GLOBAL_VAR_CONST(access_syndicate_leader, 151)//Nuke Op Leader Access //Away Missions or Ruins /*For generic away-mission/ruin access. Why would normal crew have access to a long-abandoned derelict or a 2000 year-old temple? */ -/var/const/access_away_general = 200//General facilities. -/var/const/access_away_maint = 201//Away maintenance -/var/const/access_away_med = 202//Away medical -/var/const/access_away_sec = 203//Away security -/var/const/access_away_engine = 204//Away engineering -/var/const/access_away_generic1 = 205//Away generic access -/var/const/access_away_generic2 = 206 -/var/const/access_away_generic3 = 207 -/var/const/access_away_generic4 = 208 +GLOBAL_VAR_CONST(access_away_general, 200)//General facilities. +GLOBAL_VAR_CONST(access_away_maint, 201)//Away maintenance +GLOBAL_VAR_CONST(access_away_med, 202)//Away medical +GLOBAL_VAR_CONST(access_away_sec, 203)//Away security +GLOBAL_VAR_CONST(access_away_engine, 204)//Away engineering +GLOBAL_VAR_CONST(access_away_generic1, 205)//Away generic access +GLOBAL_VAR_CONST(access_away_generic2, 206) +GLOBAL_VAR_CONST(access_away_generic3, 207) +GLOBAL_VAR_CONST(access_away_generic4, 208) /obj/var/list/req_access = null /obj/var/req_access_txt = "0" @@ -203,21 +203,21 @@ /proc/get_centcom_access(job) switch(job) if("VIP Guest") - return list(access_cent_general) + return list(GLOB.access_cent_general) if("Custodian") - return list(access_cent_general, access_cent_living, access_cent_storage) + return list(GLOB.access_cent_general, GLOB.access_cent_living, GLOB.access_cent_storage) if("Thunderdome Overseer") - return list(access_cent_general, access_cent_thunder) + return list(GLOB.access_cent_general, GLOB.access_cent_thunder) if("Centcom Official") - return list(access_cent_general, access_cent_living) + return list(GLOB.access_cent_general, GLOB.access_cent_living) if("Medical Officer") - return list(access_cent_general, access_cent_living, access_cent_medical) + return list(GLOB.access_cent_general, GLOB.access_cent_living, GLOB.access_cent_medical) if("Death Commando") - return list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage) + return list(GLOB.access_cent_general, GLOB.access_cent_specops, GLOB.access_cent_living, GLOB.access_cent_storage) if("Research Officer") - return list(access_cent_general, access_cent_specops, access_cent_medical, access_cent_teleporter, access_cent_storage) + return list(GLOB.access_cent_general, GLOB.access_cent_specops, GLOB.access_cent_medical, GLOB.access_cent_teleporter, GLOB.access_cent_storage) if("Special Ops Officer") - return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_living, access_cent_storage) + return list(GLOB.access_cent_general, GLOB.access_cent_thunder, GLOB.access_cent_specops, GLOB.access_cent_living, GLOB.access_cent_storage) if("Admiral") return get_all_centcom_access() if("Centcom Commander") @@ -231,56 +231,56 @@ if("Medical Response Officer") return get_ert_access("med") if("Centcom Bartender") - return list(access_cent_general, access_cent_living, access_cent_bar) + return list(GLOB.access_cent_general, GLOB.access_cent_living, GLOB.access_cent_bar) /proc/get_all_accesses() - return list(access_security, access_sec_doors, access_brig, access_armory, access_forensics_lockers, access_court, - access_medical, access_genetics, access_morgue, access_rd, - access_tox, access_tox_storage, access_chemistry, access_engine, access_engine_equip, access_maint_tunnels, - access_external_airlocks, access_change_ids, access_ai_upload, - access_teleporter, access_eva, access_heads, access_captain, access_all_personal_lockers, - access_tech_storage, access_chapel_office, access_atmospherics, access_kitchen, - access_bar, access_janitor, access_crematorium, access_robotics, access_cargo, access_construction, - access_hydroponics, access_library, access_lawyer, access_virology, access_cmo, access_qm, access_surgery, - access_theatre, access_research, access_mining, access_mailsorting, access_weapons, - access_heads_vault, access_mining_station, access_xenobiology, access_ce, access_hop, access_hos, access_RC_announce, - access_keycard_auth, access_tcomsat, access_gateway, access_mineral_storeroom, access_minisat, access_network, access_cloning) + return list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_forensics_lockers, GLOB.access_court, + GLOB.access_medical, GLOB.access_genetics, GLOB.access_morgue, GLOB.access_rd, + GLOB.access_tox, GLOB.access_tox_storage, GLOB.access_chemistry, GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_maint_tunnels, + GLOB.access_external_airlocks, GLOB.access_change_ids, GLOB.access_ai_upload, + GLOB.access_teleporter, GLOB.access_eva, GLOB.access_heads, GLOB.access_captain, GLOB.access_all_personal_lockers, + GLOB.access_tech_storage, GLOB.access_chapel_office, GLOB.access_atmospherics, GLOB.access_kitchen, + GLOB.access_bar, GLOB.access_janitor, GLOB.access_crematorium, GLOB.access_robotics, GLOB.access_cargo, GLOB.access_construction, + GLOB.access_hydroponics, GLOB.access_library, GLOB.access_lawyer, GLOB.access_virology, GLOB.access_cmo, GLOB.access_qm, GLOB.access_surgery, + GLOB.access_theatre, GLOB.access_research, GLOB.access_mining, GLOB.access_mailsorting, GLOB.access_weapons, + GLOB.access_heads_vault, GLOB.access_mining_station, GLOB.access_xenobiology, GLOB.access_ce, GLOB.access_hop, GLOB.access_hos, GLOB.access_RC_announce, + GLOB.access_keycard_auth, GLOB.access_tcomsat, GLOB.access_gateway, GLOB.access_mineral_storeroom, GLOB.access_minisat, GLOB.access_network, GLOB.access_cloning) /proc/get_all_centcom_access() - return list(access_cent_general, access_cent_thunder, access_cent_specops, access_cent_medical, access_cent_living, access_cent_storage, access_cent_teleporter, access_cent_captain) + return list(GLOB.access_cent_general, GLOB.access_cent_thunder, GLOB.access_cent_specops, GLOB.access_cent_medical, GLOB.access_cent_living, GLOB.access_cent_storage, GLOB.access_cent_teleporter, GLOB.access_cent_captain) /proc/get_ert_access(class) switch(class) if("commander") return get_all_centcom_access() if("sec") - return list(access_cent_general, access_cent_specops, access_cent_living) + return list(GLOB.access_cent_general, GLOB.access_cent_specops, GLOB.access_cent_living) if("eng") - return list(access_cent_general, access_cent_specops, access_cent_living, access_cent_storage) + return list(GLOB.access_cent_general, GLOB.access_cent_specops, GLOB.access_cent_living, GLOB.access_cent_storage) if("med") - return list(access_cent_general, access_cent_specops, access_cent_medical, access_cent_living) + return list(GLOB.access_cent_general, GLOB.access_cent_specops, GLOB.access_cent_medical, GLOB.access_cent_living) /proc/get_all_syndicate_access() - return list(access_syndicate, access_syndicate) + return list(GLOB.access_syndicate, GLOB.access_syndicate) /proc/get_region_accesses(code) switch(code) if(0) return get_all_accesses() if(1) //station general - return list(access_kitchen,access_bar, access_hydroponics, access_janitor, access_chapel_office, access_crematorium, access_library, access_theatre, access_lawyer) + return list(GLOB.access_kitchen,GLOB.access_bar, GLOB.access_hydroponics, GLOB.access_janitor, GLOB.access_chapel_office, GLOB.access_crematorium, GLOB.access_library, GLOB.access_theatre, GLOB.access_lawyer) if(2) //security - return list(access_sec_doors, access_weapons, access_security, access_brig, access_armory, access_forensics_lockers, access_court, access_hos) + return list(GLOB.access_sec_doors, GLOB.access_weapons, GLOB.access_security, GLOB.access_brig, GLOB.access_armory, GLOB.access_forensics_lockers, GLOB.access_court, GLOB.access_hos) if(3) //medbay - return list(access_medical, access_genetics, access_cloning, access_morgue, access_chemistry, access_virology, access_surgery, access_cmo) + return list(GLOB.access_medical, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_morgue, GLOB.access_chemistry, GLOB.access_virology, GLOB.access_surgery, GLOB.access_cmo) if(4) //research - return list(access_research, access_tox, access_tox_storage, access_genetics, access_robotics, access_xenobiology, access_minisat, access_rd, access_network) + return list(GLOB.access_research, GLOB.access_tox, GLOB.access_tox_storage, GLOB.access_genetics, GLOB.access_robotics, GLOB.access_xenobiology, GLOB.access_minisat, GLOB.access_rd, GLOB.access_network) if(5) //engineering and maintenance - return list(access_construction, access_maint_tunnels, access_engine, access_engine_equip, access_external_airlocks, access_tech_storage, access_atmospherics, access_tcomsat, access_minisat, access_ce) + return list(GLOB.access_construction, GLOB.access_maint_tunnels, GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_external_airlocks, GLOB.access_tech_storage, GLOB.access_atmospherics, GLOB.access_tcomsat, GLOB.access_minisat, GLOB.access_ce) if(6) //supply - return list(access_mailsorting, access_mining, access_mining_station, access_mineral_storeroom, access_cargo, access_qm) + return list(GLOB.access_mailsorting, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom, GLOB.access_cargo, GLOB.access_qm) if(7) //command - return list(access_heads, access_RC_announce, access_keycard_auth, access_change_ids, access_ai_upload, access_teleporter, access_eva, access_gateway, access_all_personal_lockers, access_heads_vault, access_hop, access_captain) + return list(GLOB.access_heads, GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_change_ids, GLOB.access_ai_upload, GLOB.access_teleporter, GLOB.access_eva, GLOB.access_gateway, GLOB.access_all_personal_lockers, GLOB.access_heads_vault, GLOB.access_hop, GLOB.access_captain) /proc/get_region_accesses_name(code) switch(code) @@ -303,158 +303,158 @@ /proc/get_access_desc(A) switch(A) - if(access_cargo) + if(GLOB.access_cargo) return "Cargo Bay" - if(access_cargo_bot) + if(GLOB.access_cargo_bot) return "Delivery Chutes" - if(access_security) + if(GLOB.access_security) return "Security" - if(access_brig) + if(GLOB.access_brig) return "Holding Cells" - if(access_court) + if(GLOB.access_court) return "Courtroom" - if(access_forensics_lockers) + if(GLOB.access_forensics_lockers) return "Forensics" - if(access_medical) + if(GLOB.access_medical) return "Medical" - if(access_genetics) + if(GLOB.access_genetics) return "Genetics Lab" - if(access_morgue) + if(GLOB.access_morgue) return "Morgue" - if(access_tox) + if(GLOB.access_tox) return "R&D Lab" - if(access_tox_storage) + if(GLOB.access_tox_storage) return "Toxins Lab" - if(access_chemistry) + if(GLOB.access_chemistry) return "Chemistry Lab" - if(access_rd) + if(GLOB.access_rd) return "RD Office" - if(access_bar) + if(GLOB.access_bar) return "Bar" - if(access_janitor) + if(GLOB.access_janitor) return "Custodial Closet" - if(access_engine) + if(GLOB.access_engine) return "Engineering" - if(access_engine_equip) + if(GLOB.access_engine_equip) return "Power Equipment" - if(access_maint_tunnels) + if(GLOB.access_maint_tunnels) return "Maintenance" - if(access_external_airlocks) + if(GLOB.access_external_airlocks) return "External Airlocks" - if(access_emergency_storage) + if(GLOB.access_emergency_storage) return "Emergency Storage" - if(access_change_ids) + if(GLOB.access_change_ids) return "ID Console" - if(access_ai_upload) + if(GLOB.access_ai_upload) return "AI Chambers" - if(access_teleporter) + if(GLOB.access_teleporter) return "Teleporter" - if(access_eva) + if(GLOB.access_eva) return "EVA" - if(access_heads) + if(GLOB.access_heads) return "Bridge" - if(access_captain) + if(GLOB.access_captain) return "Captain" - if(access_all_personal_lockers) + if(GLOB.access_all_personal_lockers) return "Personal Lockers" - if(access_chapel_office) + if(GLOB.access_chapel_office) return "Chapel Office" - if(access_tech_storage) + if(GLOB.access_tech_storage) return "Technical Storage" - if(access_atmospherics) + if(GLOB.access_atmospherics) return "Atmospherics" - if(access_crematorium) + if(GLOB.access_crematorium) return "Crematorium" - if(access_armory) + if(GLOB.access_armory) return "Armory" - if(access_construction) + if(GLOB.access_construction) return "Construction" - if(access_kitchen) + if(GLOB.access_kitchen) return "Kitchen" - if(access_hydroponics) + if(GLOB.access_hydroponics) return "Hydroponics" - if(access_library) + if(GLOB.access_library) return "Library" - if(access_lawyer) + if(GLOB.access_lawyer) return "Law Office" - if(access_robotics) + if(GLOB.access_robotics) return "Robotics" - if(access_virology) + if(GLOB.access_virology) return "Virology" - if(access_cmo) + if(GLOB.access_cmo) return "CMO Office" - if(access_qm) + if(GLOB.access_qm) return "Quartermaster" - if(access_surgery) + if(GLOB.access_surgery) return "Surgery" - if(access_theatre) + if(GLOB.access_theatre) return "Theatre" - if(access_manufacturing) + if(GLOB.access_manufacturing) return "Manufacturing" - if(access_research) + if(GLOB.access_research) return "Science" - if(access_mining) + if(GLOB.access_mining) return "Mining" - if(access_mining_office) + if(GLOB.access_mining_office) return "Mining Office" - if(access_mailsorting) + if(GLOB.access_mailsorting) return "Cargo Office" - if(access_mint) + if(GLOB.access_mint) return "Mint" - if(access_mint_vault) + if(GLOB.access_mint_vault) return "Mint Vault" - if(access_heads_vault) + if(GLOB.access_heads_vault) return "Main Vault" - if(access_mining_station) + if(GLOB.access_mining_station) return "Mining EVA" - if(access_xenobiology) + if(GLOB.access_xenobiology) return "Xenobiology Lab" - if(access_hop) + if(GLOB.access_hop) return "HoP Office" - if(access_hos) + if(GLOB.access_hos) return "HoS Office" - if(access_ce) + if(GLOB.access_ce) return "CE Office" - if(access_RC_announce) + if(GLOB.access_RC_announce) return "RC Announcements" - if(access_keycard_auth) + if(GLOB.access_keycard_auth) return "Keycode Auth." - if(access_tcomsat) + if(GLOB.access_tcomsat) return "Telecommunications" - if(access_gateway) + if(GLOB.access_gateway) return "Gateway" - if(access_sec_doors) + if(GLOB.access_sec_doors) return "Brig" - if(access_mineral_storeroom) + if(GLOB.access_mineral_storeroom) return "Mineral Storage" - if(access_minisat) + if(GLOB.access_minisat) return "AI Satellite" - if(access_weapons) + if(GLOB.access_weapons) return "Weapon Permit" - if(access_network) + if(GLOB.access_network) return "Network Access" - if(access_cloning) + if(GLOB.access_cloning) return "Cloning Room" /proc/get_centcom_access_desc(A) switch(A) - if(access_cent_general) + if(GLOB.access_cent_general) return "Code Grey" - if(access_cent_thunder) + if(GLOB.access_cent_thunder) return "Code Yellow" - if(access_cent_storage) + if(GLOB.access_cent_storage) return "Code Orange" - if(access_cent_living) + if(GLOB.access_cent_living) return "Code Green" - if(access_cent_medical) + if(GLOB.access_cent_medical) return "Code White" - if(access_cent_teleporter) + if(GLOB.access_cent_teleporter) return "Code Blue" - if(access_cent_specops) + if(GLOB.access_cent_specops) return "Code Black" - if(access_cent_captain) + if(GLOB.access_cent_captain) return "Code Gold" - if(access_cent_bar) + if(GLOB.access_cent_bar) return "Code Scotch" /proc/get_all_jobs() diff --git a/code/modules/jobs/job_types/assistant.dm b/code/modules/jobs/job_types/assistant.dm index 2e120b58bc9c6..34cd229fab65f 100644 --- a/code/modules/jobs/job_types/assistant.dm +++ b/code/modules/jobs/job_types/assistant.dm @@ -18,7 +18,7 @@ Assistant /datum/job/assistant/get_access() if((config.jobs_have_maint_access & ASSISTANTS_HAVE_MAINT_ACCESS) || !config.jobs_have_minimal_access) //Config has assistant maint access set . = ..() - . |= list(access_maint_tunnels) + . |= list(GLOB.access_maint_tunnels) else return ..() diff --git a/code/modules/jobs/job_types/captain.dm b/code/modules/jobs/job_types/captain.dm index a40b9d42fa1a7..9912bc0e203a2 100644 --- a/code/modules/jobs/job_types/captain.dm +++ b/code/modules/jobs/job_types/captain.dm @@ -67,18 +67,18 @@ Head of Personnel outfit = /datum/outfit/job/hop - access = list(access_security, access_sec_doors, access_court, access_weapons, - access_medical, access_engine, access_change_ids, access_ai_upload, access_eva, access_heads, - access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue, - access_crematorium, access_kitchen, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer, - access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station, - access_hop, access_RC_announce, access_keycard_auth, access_gateway, access_mineral_storeroom) - minimal_access = list(access_security, access_sec_doors, access_court, access_weapons, - access_medical, access_engine, access_change_ids, access_ai_upload, access_eva, access_heads, - access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue, - access_crematorium, access_kitchen, access_cargo, access_cargo_bot, access_mailsorting, access_qm, access_hydroponics, access_lawyer, - access_theatre, access_chapel_office, access_library, access_research, access_mining, access_heads_vault, access_mining_station, - access_hop, access_RC_announce, access_keycard_auth, access_gateway, access_mineral_storeroom) + access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_court, GLOB.access_weapons, + GLOB.access_medical, GLOB.access_engine, GLOB.access_change_ids, GLOB.access_ai_upload, GLOB.access_eva, GLOB.access_heads, + GLOB.access_all_personal_lockers, GLOB.access_maint_tunnels, GLOB.access_bar, GLOB.access_janitor, GLOB.access_construction, GLOB.access_morgue, + GLOB.access_crematorium, GLOB.access_kitchen, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_mailsorting, GLOB.access_qm, GLOB.access_hydroponics, GLOB.access_lawyer, + GLOB.access_theatre, GLOB.access_chapel_office, GLOB.access_library, GLOB.access_research, GLOB.access_mining, GLOB.access_heads_vault, GLOB.access_mining_station, + GLOB.access_hop, GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_gateway, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_court, GLOB.access_weapons, + GLOB.access_medical, GLOB.access_engine, GLOB.access_change_ids, GLOB.access_ai_upload, GLOB.access_eva, GLOB.access_heads, + GLOB.access_all_personal_lockers, GLOB.access_maint_tunnels, GLOB.access_bar, GLOB.access_janitor, GLOB.access_construction, GLOB.access_morgue, + GLOB.access_crematorium, GLOB.access_kitchen, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_mailsorting, GLOB.access_qm, GLOB.access_hydroponics, GLOB.access_lawyer, + GLOB.access_theatre, GLOB.access_chapel_office, GLOB.access_library, GLOB.access_research, GLOB.access_mining, GLOB.access_heads_vault, GLOB.access_mining_station, + GLOB.access_hop, GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_gateway, GLOB.access_mineral_storeroom) /datum/outfit/job/hop diff --git a/code/modules/jobs/job_types/cargo_service.dm b/code/modules/jobs/job_types/cargo_service.dm index 9fe97f82534b8..a863f983cf584 100644 --- a/code/modules/jobs/job_types/cargo_service.dm +++ b/code/modules/jobs/job_types/cargo_service.dm @@ -14,8 +14,8 @@ Quartermaster outfit = /datum/outfit/job/quartermaster - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) - minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) + access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) /datum/outfit/job/quartermaster name = "Quartermaster" @@ -44,8 +44,8 @@ Cargo Technician outfit = /datum/outfit/job/cargo_tech - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) - minimal_access = list(access_maint_tunnels, access_cargo, access_cargo_bot, access_mailsorting, access_mineral_storeroom) + access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_maint_tunnels, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_mailsorting, GLOB.access_mineral_storeroom) /datum/outfit/job/cargo_tech name = "Cargo Technician" @@ -72,8 +72,8 @@ Shaft Miner outfit = /datum/outfit/job/miner - access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station, access_mineral_storeroom) - minimal_access = list(access_mining, access_mining_station, access_mailsorting, access_mineral_storeroom) + access = list(GLOB.access_maint_tunnels, GLOB.access_mailsorting, GLOB.access_cargo, GLOB.access_cargo_bot, GLOB.access_qm, GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_mining, GLOB.access_mining_station, GLOB.access_mailsorting, GLOB.access_mineral_storeroom) /datum/outfit/job/miner name = "Shaft Miner (Lavaland)" @@ -148,8 +148,8 @@ Bartender outfit = /datum/outfit/job/bartender - access = list(access_hydroponics, access_bar, access_kitchen, access_morgue, access_weapons) - minimal_access = list(access_bar) + access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue, GLOB.access_weapons) + minimal_access = list(GLOB.access_bar) /datum/outfit/job/bartender @@ -181,8 +181,8 @@ Cook outfit = /datum/outfit/job/cook - access = list(access_hydroponics, access_bar, access_kitchen, access_morgue) - minimal_access = list(access_kitchen, access_morgue) + access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue) + minimal_access = list(GLOB.access_kitchen, GLOB.access_morgue) /datum/outfit/job/cook name = "Cook" @@ -228,8 +228,8 @@ Botanist outfit = /datum/outfit/job/botanist - access = list(access_hydroponics, access_bar, access_kitchen, access_morgue) - minimal_access = list(access_hydroponics, access_morgue) + access = list(GLOB.access_hydroponics, GLOB.access_bar, GLOB.access_kitchen, GLOB.access_morgue) + minimal_access = list(GLOB.access_hydroponics, GLOB.access_morgue) // Removed tox and chem access because STOP PISSING OFF THE CHEMIST GUYS // Removed medical access because WHAT THE FUCK YOU AREN'T A DOCTOR YOU GROW WHEAT // Given Morgue access because they have a viable means of cloning. @@ -267,8 +267,8 @@ Janitor outfit = /datum/outfit/job/janitor - access = list(access_janitor, access_maint_tunnels) - minimal_access = list(access_janitor, access_maint_tunnels) + access = list(GLOB.access_janitor, GLOB.access_maint_tunnels) + minimal_access = list(GLOB.access_janitor, GLOB.access_maint_tunnels) /datum/outfit/job/janitor name = "Janitor" diff --git a/code/modules/jobs/job_types/civilian.dm b/code/modules/jobs/job_types/civilian.dm index 0eed62b3e1192..605a0a9c358bc 100644 --- a/code/modules/jobs/job_types/civilian.dm +++ b/code/modules/jobs/job_types/civilian.dm @@ -14,8 +14,8 @@ Clown outfit = /datum/outfit/job/clown - access = list(access_theatre) - minimal_access = list(access_theatre) + access = list(GLOB.access_theatre) + minimal_access = list(GLOB.access_theatre) /datum/job/clown/after_spawn(mob/living/carbon/human/H, mob/M) H.rename_self("clown", M.client) @@ -52,7 +52,7 @@ Clown if(visualsOnly) return - H.fully_replace_character_name(H.real_name, pick(clown_names)) + H.fully_replace_character_name(H.real_name, pick(GLOB.clown_names)) /datum/outfit/job/clown/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) ..() @@ -77,8 +77,8 @@ Mime outfit = /datum/outfit/job/mime - access = list(access_theatre) - minimal_access = list(access_theatre) + access = list(GLOB.access_theatre) + minimal_access = list(GLOB.access_theatre) /datum/job/mime/after_spawn(mob/living/carbon/human/H, mob/M) H.rename_self("mime", M.client) @@ -127,8 +127,8 @@ Librarian outfit = /datum/outfit/job/librarian - access = list(access_library) - minimal_access = list(access_library) + access = list(GLOB.access_library) + minimal_access = list(GLOB.access_library) /datum/outfit/job/librarian name = "Librarian" @@ -160,8 +160,8 @@ Lawyer outfit = /datum/outfit/job/lawyer - access = list(access_lawyer, access_court, access_sec_doors) - minimal_access = list(access_lawyer, access_court, access_sec_doors) + access = list(GLOB.access_lawyer, GLOB.access_court, GLOB.access_sec_doors) + minimal_access = list(GLOB.access_lawyer, GLOB.access_court, GLOB.access_sec_doors) /datum/outfit/job/lawyer name = "Lawyer" diff --git a/code/modules/jobs/job_types/civilian_chaplain.dm b/code/modules/jobs/job_types/civilian_chaplain.dm index 7c9177b7cdd27..eb26e6576c6b2 100644 --- a/code/modules/jobs/job_types/civilian_chaplain.dm +++ b/code/modules/jobs/job_types/civilian_chaplain.dm @@ -15,8 +15,8 @@ Chaplain outfit = /datum/outfit/job/chaplain - access = list(access_morgue, access_chapel_office, access_crematorium, access_theatre) - minimal_access = list(access_morgue, access_chapel_office, access_crematorium, access_theatre) + access = list(GLOB.access_morgue, GLOB.access_chapel_office, GLOB.access_crematorium, GLOB.access_theatre) + minimal_access = list(GLOB.access_morgue, GLOB.access_chapel_office, GLOB.access_crematorium, GLOB.access_theatre) /datum/outfit/job/chaplain name = "Chaplain" diff --git a/code/modules/jobs/job_types/engineering.dm b/code/modules/jobs/job_types/engineering.dm index fc2410b22841e..5ecbb2b4278db 100644 --- a/code/modules/jobs/job_types/engineering.dm +++ b/code/modules/jobs/job_types/engineering.dm @@ -17,14 +17,14 @@ Chief Engineer outfit = /datum/outfit/job/ce - access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, - access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva, - access_heads, access_construction, access_sec_doors, access_minisat, - access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_mineral_storeroom) - minimal_access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, - access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva, - access_heads, access_construction, access_sec_doors, access_minisat, - access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_mineral_storeroom) + access = list(GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_tech_storage, GLOB.access_maint_tunnels, + GLOB.access_external_airlocks, GLOB.access_atmospherics, GLOB.access_emergency_storage, GLOB.access_eva, + GLOB.access_heads, GLOB.access_construction, GLOB.access_sec_doors, GLOB.access_minisat, + GLOB.access_ce, GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_tcomsat, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_tech_storage, GLOB.access_maint_tunnels, + GLOB.access_external_airlocks, GLOB.access_atmospherics, GLOB.access_emergency_storage, GLOB.access_eva, + GLOB.access_heads, GLOB.access_construction, GLOB.access_sec_doors, GLOB.access_minisat, + GLOB.access_ce, GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_tcomsat, GLOB.access_mineral_storeroom) /datum/outfit/job/ce name = "Chief Engineer" @@ -74,10 +74,10 @@ Station Engineer outfit = /datum/outfit/job/engineer - access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, - access_external_airlocks, access_construction, access_atmospherics, access_tcomsat) - minimal_access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, - access_external_airlocks, access_construction, access_tcomsat) + access = list(GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_tech_storage, GLOB.access_maint_tunnels, + GLOB.access_external_airlocks, GLOB.access_construction, GLOB.access_atmospherics, GLOB.access_tcomsat) + minimal_access = list(GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_tech_storage, GLOB.access_maint_tunnels, + GLOB.access_external_airlocks, GLOB.access_construction, GLOB.access_tcomsat) /datum/outfit/job/engineer name = "Station Engineer" @@ -125,9 +125,9 @@ Atmospheric Technician outfit = /datum/outfit/job/atmos - access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, - access_external_airlocks, access_construction, access_atmospherics) - minimal_access = list(access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction) + access = list(GLOB.access_engine, GLOB.access_engine_equip, GLOB.access_tech_storage, GLOB.access_maint_tunnels, + GLOB.access_external_airlocks, GLOB.access_construction, GLOB.access_atmospherics) + minimal_access = list(GLOB.access_atmospherics, GLOB.access_maint_tunnels, GLOB.access_emergency_storage, GLOB.access_construction) /datum/outfit/job/atmos name = "Atmospheric Technician" diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index ea43fa173726f..b8a5430d0dfe8 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -70,7 +70,7 @@ if(!visualsOnly && announce) announce(H) - if(config.enforce_human_authority && (title in command_positions)) + if(config.enforce_human_authority && (title in GLOB.command_positions)) H.dna.features["tail_human"] = "None" H.dna.features["ears"] = "None" H.regenerate_icons() @@ -87,12 +87,12 @@ . = src.access.Copy() if(config.jobs_have_maint_access & EVERYONE_HAS_MAINT_ACCESS) //Config has global maint access set - . |= list(access_maint_tunnels) + . |= list(GLOB.access_maint_tunnels) /datum/job/proc/announce_head(var/mob/living/carbon/human/H, var/channels) //tells the given channel that the given mob is the new department head. See communications.dm for valid channels. spawn(4) //to allow some initialization - if(H && announcement_systems.len) - var/obj/machinery/announcement_system/announcer = pick(announcement_systems) + if(H && GLOB.announcement_systems.len) + var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems) announcer.announce("NEWHEAD", H.real_name, H.job, channels) //If the configuration option is set to require players to be logged as old enough to play certain jobs, then this proc checks that they are, otherwise it just returns 1 diff --git a/code/modules/jobs/job_types/medical.dm b/code/modules/jobs/job_types/medical.dm index 51a316026c640..4a59ed2cd5465 100644 --- a/code/modules/jobs/job_types/medical.dm +++ b/code/modules/jobs/job_types/medical.dm @@ -3,7 +3,7 @@ Chief Medical Officer */ /datum/job/cmo title = "Chief Medical Officer" - flag = CMO + flag = CMO_JF department_head = list("Captain") department_flag = MEDSCI head_announce = list("Medical") @@ -17,12 +17,12 @@ Chief Medical Officer outfit = /datum/outfit/job/cmo - access = list(access_medical, access_morgue, access_genetics, access_cloning, access_heads, access_mineral_storeroom, - access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce, - access_keycard_auth, access_sec_doors, access_maint_tunnels) - minimal_access = list(access_medical, access_morgue, access_genetics, access_cloning, access_heads, access_mineral_storeroom, - access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce, - access_keycard_auth, access_sec_doors, access_maint_tunnels) + access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_heads, GLOB.access_mineral_storeroom, + GLOB.access_chemistry, GLOB.access_virology, GLOB.access_cmo, GLOB.access_surgery, GLOB.access_RC_announce, + GLOB.access_keycard_auth, GLOB.access_sec_doors, GLOB.access_maint_tunnels) + minimal_access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_heads, GLOB.access_mineral_storeroom, + GLOB.access_chemistry, GLOB.access_virology, GLOB.access_cmo, GLOB.access_surgery, GLOB.access_RC_announce, + GLOB.access_keycard_auth, GLOB.access_sec_doors, GLOB.access_maint_tunnels) /datum/outfit/job/cmo name = "Chief Medical Officer" @@ -58,8 +58,8 @@ Medical Doctor outfit = /datum/outfit/job/doctor - access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_genetics, access_cloning, access_mineral_storeroom) - minimal_access = list(access_medical, access_morgue, access_surgery, access_cloning) + access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_surgery, GLOB.access_chemistry, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_surgery, GLOB.access_cloning) /datum/outfit/job/doctor name = "Medical Doctor" @@ -93,8 +93,8 @@ Chemist outfit = /datum/outfit/job/chemist - access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_genetics, access_cloning, access_mineral_storeroom) - minimal_access = list(access_medical, access_chemistry, access_mineral_storeroom) + access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_surgery, GLOB.access_chemistry, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_medical, GLOB.access_chemistry, GLOB.access_mineral_storeroom) /datum/outfit/job/chemist name = "Chemist" @@ -127,8 +127,8 @@ Geneticist outfit = /datum/outfit/job/geneticist - access = list(access_medical, access_morgue, access_chemistry, access_genetics, access_cloning, access_research, access_xenobiology, access_robotics, access_mineral_storeroom, access_tech_storage) - minimal_access = list(access_medical, access_morgue, access_genetics, access_cloning, access_research) + access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_chemistry, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_research, GLOB.access_xenobiology, GLOB.access_robotics, GLOB.access_mineral_storeroom, GLOB.access_tech_storage) + minimal_access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_research) /datum/outfit/job/geneticist name = "Geneticist" @@ -161,8 +161,8 @@ Virologist outfit = /datum/outfit/job/virologist - access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics, access_cloning, access_mineral_storeroom) - minimal_access = list(access_medical, access_virology, access_mineral_storeroom) + access = list(GLOB.access_medical, GLOB.access_morgue, GLOB.access_surgery, GLOB.access_chemistry, GLOB.access_virology, GLOB.access_genetics, GLOB.access_cloning, GLOB.access_mineral_storeroom) + minimal_access = list(GLOB.access_medical, GLOB.access_virology, GLOB.access_mineral_storeroom) /datum/outfit/job/virologist name = "Virologist" diff --git a/code/modules/jobs/job_types/science.dm b/code/modules/jobs/job_types/science.dm index 743730bb7b33b..12bee2fbef75b 100644 --- a/code/modules/jobs/job_types/science.dm +++ b/code/modules/jobs/job_types/science.dm @@ -3,7 +3,7 @@ Research Director */ /datum/job/rd title = "Research Director" - flag = RD + flag = RD_JF department_head = list("Captain") department_flag = MEDSCI head_announce = list("Science") @@ -17,16 +17,16 @@ Research Director outfit = /datum/outfit/job/rd - access = list(access_rd, access_heads, access_tox, access_genetics, access_morgue, - access_tox_storage, access_teleporter, access_sec_doors, - access_research, access_robotics, access_xenobiology, access_ai_upload, - access_RC_announce, access_keycard_auth, access_gateway, access_mineral_storeroom, - access_tech_storage, access_minisat, access_maint_tunnels, access_network) - minimal_access = list(access_rd, access_heads, access_tox, access_genetics, access_morgue, - access_tox_storage, access_teleporter, access_sec_doors, - access_research, access_robotics, access_xenobiology, access_ai_upload, - access_RC_announce, access_keycard_auth, access_gateway, access_mineral_storeroom, - access_tech_storage, access_minisat, access_maint_tunnels, access_network) + access = list(GLOB.access_rd, GLOB.access_heads, GLOB.access_tox, GLOB.access_genetics, GLOB.access_morgue, + GLOB.access_tox_storage, GLOB.access_teleporter, GLOB.access_sec_doors, + GLOB.access_research, GLOB.access_robotics, GLOB.access_xenobiology, GLOB.access_ai_upload, + GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_gateway, GLOB.access_mineral_storeroom, + GLOB.access_tech_storage, GLOB.access_minisat, GLOB.access_maint_tunnels, GLOB.access_network) + minimal_access = list(GLOB.access_rd, GLOB.access_heads, GLOB.access_tox, GLOB.access_genetics, GLOB.access_morgue, + GLOB.access_tox_storage, GLOB.access_teleporter, GLOB.access_sec_doors, + GLOB.access_research, GLOB.access_robotics, GLOB.access_xenobiology, GLOB.access_ai_upload, + GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_gateway, GLOB.access_mineral_storeroom, + GLOB.access_tech_storage, GLOB.access_minisat, GLOB.access_maint_tunnels, GLOB.access_network) /datum/outfit/job/rd name = "Research Director" @@ -70,8 +70,8 @@ Scientist outfit = /datum/outfit/job/scientist - access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_mineral_storeroom, access_tech_storage, access_genetics) - minimal_access = list(access_tox, access_tox_storage, access_research, access_xenobiology, access_mineral_storeroom) + access = list(GLOB.access_robotics, GLOB.access_tox, GLOB.access_tox_storage, GLOB.access_research, GLOB.access_xenobiology, GLOB.access_mineral_storeroom, GLOB.access_tech_storage, GLOB.access_genetics) + minimal_access = list(GLOB.access_tox, GLOB.access_tox_storage, GLOB.access_research, GLOB.access_xenobiology, GLOB.access_mineral_storeroom) /datum/outfit/job/scientist name = "Scientist" @@ -102,8 +102,8 @@ Roboticist outfit = /datum/outfit/job/roboticist - access = list(access_robotics, access_tox, access_tox_storage, access_tech_storage, access_morgue, access_research, access_mineral_storeroom, access_xenobiology, access_genetics) - minimal_access = list(access_robotics, access_tech_storage, access_morgue, access_research, access_mineral_storeroom) + access = list(GLOB.access_robotics, GLOB.access_tox, GLOB.access_tox_storage, GLOB.access_tech_storage, GLOB.access_morgue, GLOB.access_research, GLOB.access_mineral_storeroom, GLOB.access_xenobiology, GLOB.access_genetics) + minimal_access = list(GLOB.access_robotics, GLOB.access_tech_storage, GLOB.access_morgue, GLOB.access_research, GLOB.access_mineral_storeroom) /datum/outfit/job/roboticist name = "Roboticist" diff --git a/code/modules/jobs/job_types/security.dm b/code/modules/jobs/job_types/security.dm index ac6ade168294c..c2a1daae6a972 100644 --- a/code/modules/jobs/job_types/security.dm +++ b/code/modules/jobs/job_types/security.dm @@ -1,7 +1,7 @@ //Warden and regular officers add this result to their get_access() /datum/job/proc/check_config_for_sec_maint() if(config.jobs_have_maint_access & SECURITY_HAS_MAINT_ACCESS) - return list(access_maint_tunnels) + return list(GLOB.access_maint_tunnels) return list() /* @@ -23,14 +23,14 @@ Head of Security outfit = /datum/outfit/job/hos - access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_weapons, - access_forensics_lockers, access_morgue, access_maint_tunnels, access_all_personal_lockers, - access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting, - access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_maint_tunnels) - minimal_access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_weapons, - access_forensics_lockers, access_morgue, access_maint_tunnels, access_all_personal_lockers, - access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting, - access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_maint_tunnels) + access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_weapons, + GLOB.access_forensics_lockers, GLOB.access_morgue, GLOB.access_maint_tunnels, GLOB.access_all_personal_lockers, + GLOB.access_research, GLOB.access_engine, GLOB.access_mining, GLOB.access_medical, GLOB.access_construction, GLOB.access_mailsorting, + GLOB.access_heads, GLOB.access_hos, GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_gateway, GLOB.access_maint_tunnels) + minimal_access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_weapons, + GLOB.access_forensics_lockers, GLOB.access_morgue, GLOB.access_maint_tunnels, GLOB.access_all_personal_lockers, + GLOB.access_research, GLOB.access_engine, GLOB.access_mining, GLOB.access_medical, GLOB.access_construction, GLOB.access_mailsorting, + GLOB.access_heads, GLOB.access_hos, GLOB.access_RC_announce, GLOB.access_keycard_auth, GLOB.access_gateway, GLOB.access_maint_tunnels) /datum/outfit/job/hos name = "Head of Security" @@ -74,8 +74,8 @@ Warden outfit = /datum/outfit/job/warden - access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_maint_tunnels, access_morgue, access_weapons, access_forensics_lockers) - minimal_access = list(access_security, access_sec_doors, access_brig, access_armory, access_court, access_weapons) //See /datum/job/warden/get_access() + access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_maint_tunnels, GLOB.access_morgue, GLOB.access_weapons, GLOB.access_forensics_lockers) + minimal_access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_armory, GLOB.access_court, GLOB.access_weapons) //See /datum/job/warden/get_access() /datum/job/warden/get_access() var/list/L = list() @@ -124,8 +124,8 @@ Detective outfit = /datum/outfit/job/detective - access = list(access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court, access_brig, access_weapons) - minimal_access = list(access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_court, access_brig, access_weapons) + access = list(GLOB.access_sec_doors, GLOB.access_forensics_lockers, GLOB.access_morgue, GLOB.access_maint_tunnels, GLOB.access_court, GLOB.access_brig, GLOB.access_weapons) + minimal_access = list(GLOB.access_sec_doors, GLOB.access_forensics_lockers, GLOB.access_morgue, GLOB.access_maint_tunnels, GLOB.access_court, GLOB.access_brig, GLOB.access_weapons) /datum/outfit/job/detective name = "Detective" @@ -172,8 +172,8 @@ Security Officer outfit = /datum/outfit/job/security - access = list(access_security, access_sec_doors, access_brig, access_court, access_maint_tunnels, access_morgue, access_weapons, access_forensics_lockers) - minimal_access = list(access_security, access_sec_doors, access_brig, access_court, access_weapons) //But see /datum/job/warden/get_access() + access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_court, GLOB.access_maint_tunnels, GLOB.access_morgue, GLOB.access_weapons, GLOB.access_forensics_lockers) + minimal_access = list(GLOB.access_security, GLOB.access_sec_doors, GLOB.access_brig, GLOB.access_court, GLOB.access_weapons) //But see /datum/job/warden/get_access() /datum/job/officer/get_access() @@ -181,19 +181,19 @@ Security Officer L |= ..() | check_config_for_sec_maint() return L -var/list/available_depts = list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY) +GLOBAL_LIST_INIT(available_depts, list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY)) /datum/job/officer/after_spawn(mob/living/carbon/human/H, mob/M) // Assign department security var/department if(M && M.client && M.client.prefs) department = M.client.prefs.prefered_security_department - if(!LAZYLEN(available_depts) || department == "None") + if(!LAZYLEN(GLOB.available_depts) || department == "None") return - else if(department in available_depts) - LAZYREMOVE(available_depts, department) + else if(department in GLOB.available_depts) + LAZYREMOVE(GLOB.available_depts, department) else - department = pick_n_take(available_depts) + department = pick_n_take(GLOB.available_depts) var/ears = null var/tie = null var/list/dep_access = null @@ -202,27 +202,27 @@ var/list/available_depts = list(SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT switch(department) if(SEC_DEPT_SUPPLY) ears = /obj/item/device/radio/headset/headset_sec/alt/department/supply - dep_access = list(access_mailsorting, access_mining, access_mining_station) + dep_access = list(GLOB.access_mailsorting, GLOB.access_mining, GLOB.access_mining_station) destination = /area/security/checkpoint/supply - spawn_point = locate(/obj/effect/landmark/start/depsec/supply) in department_security_spawns + spawn_point = locate(/obj/effect/landmark/start/depsec/supply) in GLOB.department_security_spawns tie = /obj/item/clothing/tie/armband/cargo if(SEC_DEPT_ENGINEERING) ears = /obj/item/device/radio/headset/headset_sec/alt/department/engi - dep_access = list(access_construction, access_engine) + dep_access = list(GLOB.access_construction, GLOB.access_engine) destination = /area/security/checkpoint/engineering - spawn_point = locate(/obj/effect/landmark/start/depsec/engineering) in department_security_spawns + spawn_point = locate(/obj/effect/landmark/start/depsec/engineering) in GLOB.department_security_spawns tie = /obj/item/clothing/tie/armband/engine if(SEC_DEPT_MEDICAL) ears = /obj/item/device/radio/headset/headset_sec/alt/department/med - dep_access = list(access_medical) + dep_access = list(GLOB.access_medical) destination = /area/security/checkpoint/medical - spawn_point = locate(/obj/effect/landmark/start/depsec/medical) in department_security_spawns + spawn_point = locate(/obj/effect/landmark/start/depsec/medical) in GLOB.department_security_spawns tie = /obj/item/clothing/tie/armband/medblue if(SEC_DEPT_SCIENCE) ears = /obj/item/device/radio/headset/headset_sec/alt/department/sci - dep_access = list(access_research) + dep_access = list(GLOB.access_research) destination = /area/security/checkpoint/science - spawn_point = locate(/obj/effect/landmark/start/depsec/science) in department_security_spawns + spawn_point = locate(/obj/effect/landmark/start/depsec/science) in GLOB.department_security_spawns tie = /obj/item/clothing/tie/armband/science if(tie) diff --git a/code/modules/jobs/job_types/silicon.dm b/code/modules/jobs/job_types/silicon.dm index 23691428bcd6e..d959d6cbcefa8 100644 --- a/code/modules/jobs/job_types/silicon.dm +++ b/code/modules/jobs/job_types/silicon.dm @@ -3,7 +3,7 @@ AI */ /datum/job/ai title = "AI" - flag = AI + flag = AI_JF department_flag = ENGSEC faction = "Station" total_positions = 0 @@ -21,7 +21,7 @@ AI //we may have been created after our borg if(SSticker.current_state == GAME_STATE_SETTING_UP) - for(var/mob/living/silicon/robot/R in silicon_mobs) + for(var/mob/living/silicon/robot/R in GLOB.silicon_mobs) if(!R.connected_ai) R.TryConnectToAI() diff --git a/code/modules/jobs/jobs.dm b/code/modules/jobs/jobs.dm index 454f7e5109435..6d2448cd8ecf7 100644 --- a/code/modules/jobs/jobs.dm +++ b/code/modules/jobs/jobs.dm @@ -1,100 +1,40 @@ - -var/const/ENGSEC =(1<<0) - -var/const/CAPTAIN =(1<<0) -var/const/HOS =(1<<1) -var/const/WARDEN =(1<<2) -var/const/DETECTIVE =(1<<3) -var/const/OFFICER =(1<<4) -var/const/CHIEF =(1<<5) -var/const/ENGINEER =(1<<6) -var/const/ATMOSTECH =(1<<7) -var/const/ROBOTICIST =(1<<8) -var/const/AI =(1<<9) -var/const/CYBORG =(1<<10) - - -var/const/MEDSCI =(1<<1) - -var/const/RD =(1<<0) -var/const/SCIENTIST =(1<<1) -var/const/CHEMIST =(1<<2) -var/const/CMO =(1<<3) -var/const/DOCTOR =(1<<4) -var/const/GENETICIST =(1<<5) -var/const/VIROLOGIST =(1<<6) - - -var/const/CIVILIAN =(1<<2) - -var/const/HOP =(1<<0) -var/const/BARTENDER =(1<<1) -var/const/BOTANIST =(1<<2) -var/const/COOK =(1<<3) -var/const/JANITOR =(1<<4) -var/const/LIBRARIAN =(1<<5) -var/const/QUARTERMASTER =(1<<6) -var/const/CARGOTECH =(1<<7) -var/const/MINER =(1<<8) -var/const/LAWYER =(1<<9) -var/const/CHAPLAIN =(1<<10) -var/const/CLOWN =(1<<11) -var/const/MIME =(1<<12) -var/const/ASSISTANT =(1<<13) - - -var/list/assistant_occupations = list( - "Assistant", - "Atmospheric Technician", - "Cargo Technician", - "Chaplain", - "Lawyer", - "Librarian" -) - - -var/list/command_positions = list( +GLOBAL_LIST_INIT(command_positions, list( "Captain", "Head of Personnel", "Head of Security", "Chief Engineer", "Research Director", - "Chief Medical Officer" -) + "Chief Medical Officer")) -var/list/engineering_positions = list( +GLOBAL_LIST_INIT(engineering_positions, list( "Chief Engineer", "Station Engineer", - "Atmospheric Technician", -) + "Atmospheric Technician")) -var/list/medical_positions = list( +GLOBAL_LIST_INIT(medical_positions, list( "Chief Medical Officer", "Medical Doctor", "Geneticist", "Virologist", - "Chemist" -) + "Chemist")) -var/list/science_positions = list( +GLOBAL_LIST_INIT(science_positions, list( "Research Director", "Scientist", - "Roboticist" -) + "Roboticist")) -var/list/supply_positions = list( +GLOBAL_LIST_INIT(supply_positions, list( "Head of Personnel", "Quartermaster", "Cargo Technician", - "Shaft Miner", -) + "Shaft Miner")) -var/list/civilian_positions = list( +GLOBAL_LIST_INIT(civilian_positions, list( "Bartender", "Botanist", "Cook", @@ -104,27 +44,24 @@ var/list/civilian_positions = list( "Chaplain", "Clown", "Mime", - "Assistant" -) + "Assistant")) -var/list/security_positions = list( +GLOBAL_LIST_INIT(security_positions, list( "Head of Security", "Warden", "Detective", - "Security Officer" -) + "Security Officer")) -var/list/nonhuman_positions = list( +GLOBAL_LIST_INIT(nonhuman_positions, list( "AI", "Cyborg", - "pAI" -) + "pAI")) /proc/guest_jobbans(job) - return ((job in command_positions) || (job in nonhuman_positions) || (job in security_positions)) + return ((job in GLOB.command_positions) || (job in GLOB.nonhuman_positions) || (job in GLOB.security_positions)) @@ -138,22 +75,22 @@ var/list/nonhuman_positions = list( if(J.title == job_title) return J.department_head //this is a list -var/static/regex/cap_expand = new("cap(?!tain)") -var/static/regex/cmo_expand = new("cmo") -var/static/regex/hos_expand = new("hos") -var/static/regex/hop_expand = new("hop") -var/static/regex/rd_expand = new("rd") -var/static/regex/ce_expand = new("ce") -var/static/regex/qm_expand = new("qm") -var/static/regex/sec_expand = new("(?

    [lawlorify[LORE][devil.ban]]
    [lawlorify[LORE][devil.bane]]
    [lawlorify[LORE][devil.obligation]]
    [lawlorify[LORE][devil.banish]]", "window=book[window_size != null ? ";size=[window_size]" : ""]") + user << browse("Information on [devilName]


    [GLOB.lawlorify[LORE][devil.ban]]
    [GLOB.lawlorify[LORE][devil.bane]]
    [GLOB.lawlorify[LORE][devil.obligation]]
    [GLOB.lawlorify[LORE][devil.banish]]", "window=book[window_size != null ? ";size=[window_size]" : ""]") inUse = 0 sleep(10) if(!prob(willpower)) diff --git a/code/modules/library/lib_machines.dm b/code/modules/library/lib_machines.dm index 49ae29fa0c338..54cb25ea22984 100644 --- a/code/modules/library/lib_machines.dm +++ b/code/modules/library/lib_machines.dm @@ -43,7 +43,7 @@ dat += "Filter by Author: [author]
    " dat += "\[Start Search\]
    " if(1) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance.
    " else if(!SQLquery) dat += "ERROR: Malformed search request. Please contact your system administrator for assistance.
    " @@ -51,7 +51,7 @@ dat += "
    Non-human Positions
    Non-human Positions
    " dat += "

    Wings

    " @@ -381,7 +381,7 @@ var/list/preferences_datums = list() dat += "Announce Login: [(toggles & ANNOUNCE_LOGIN)?"On":"Off"]
    " if(unlock_content || check_rights_for(user.client, R_ADMIN)) - dat += "OOC:     Change
    " + dat += "OOC:     Change
    " if(unlock_content) dat += "BYOND Membership Publicity: [(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]
    " @@ -452,13 +452,13 @@ var/list/preferences_datums = list() src.be_special = list() - for (var/i in special_roles) + for (var/i in GLOB.special_roles) if(jobban_isbanned(user, i)) dat += "Be [capitalize(i)]: BANNED
    " else var/days_remaining = null - if(config.use_age_restriction_for_jobs && ispath(special_roles[i])) //If it's a game mode antag, check if the player meets the minimum age - var/mode_path = special_roles[i] + if(config.use_age_restriction_for_jobs && ispath(GLOB.special_roles[i])) //If it's a game mode antag, check if the player meets the minimum age + var/mode_path = GLOB.special_roles[i] var/datum/game_mode/temp_mode = new mode_path days_remaining = temp_mode.get_remaining_days(user.client) @@ -542,7 +542,7 @@ var/list/preferences_datums = list() else HTML += "[rank]
    \[NON-HUMAN\]
    " dat += "" - var/DBQuery/query_library_list_books = dbcon.NewQuery(SQLquery) + var/DBQuery/query_library_list_books = GLOB.dbcon.NewQuery(SQLquery) if(!query_library_list_books.Execute()) dat += "ERROR: Unable to retrieve book listings. Please contact your system administrator for assistance.
    " while(query_library_list_books.NextRow()) @@ -128,16 +128,16 @@ var/author var/category -var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums +GLOBAL_LIST(cachedbooks) // List of our cached book datums /proc/load_library_db_to_cache() - if(cachedbooks) + if(GLOB.cachedbooks) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) return - cachedbooks = list() - var/DBQuery/query_library_cache = dbcon.NewQuery("SELECT id, author, title, category FROM [format_table_name("library")] WHERE isnull(deleted)") + GLOB.cachedbooks = list() + var/DBQuery/query_library_cache = GLOB.dbcon.NewQuery("SELECT id, author, title, category FROM [format_table_name("library")] WHERE isnull(deleted)") if(!query_library_cache.Execute()) return while(query_library_cache.NextRow()) @@ -146,7 +146,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums newbook.author = query_library_cache.item[2] newbook.title = query_library_cache.item[3] newbook.category = query_library_cache.item[4] - cachedbooks += newbook + GLOB.cachedbooks += newbook @@ -181,12 +181,12 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums if(libcomp_menu) return load_library_db_to_cache() - if(!cachedbooks) + if(!GLOB.cachedbooks) return libcomp_menu = list("") - for(var/i in 1 to cachedbooks.len) - var/datum/cachedbook/C = cachedbooks[i] + for(var/i in 1 to GLOB.cachedbooks.len) + var/datum/cachedbook/C = GLOB.cachedbooks[i] var/page = round(i/250)+1 if (libcomp_menu.len < page) libcomp_menu.len = page @@ -257,7 +257,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums dat += "

    External Archive

    " build_library_menu() - if(!cachedbooks) + if(!GLOB.cachedbooks) dat += "ERROR: Unable to contact External Archive. Please contact your system administrator for assistance." else dat += "(Order book by SS13BN)

    " @@ -411,7 +411,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums if(scanner.cache) var/choice = input("Are you certain you wish to upload this title to the Archive?") in list("Confirm", "Abort") if(choice == "Confirm") - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) alert("Connection to Archive has been severed. Aborting.") else @@ -419,7 +419,7 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums var/sqlauthor = sanitizeSQL(scanner.cache.author) var/sqlcontent = sanitizeSQL(scanner.cache.dat) var/sqlcategory = sanitizeSQL(upload_category) - var/DBQuery/query_library_upload = dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())") + var/DBQuery/query_library_upload = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())") if(!query_library_upload.Execute()) alert("Database error encountered uploading to Archive") return @@ -427,16 +427,16 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums log_game("[usr.name]/[usr.key] has uploaded the book titled [scanner.cache.name], [length(scanner.cache.dat)] signs") alert("Upload Complete. Uploaded title will be unavailable for printing for a short period") if(href_list["newspost"]) - if(!news_network) + if(!GLOB.news_network) alert("No news network found on station. Aborting.") var/channelexists = 0 - for(var/datum/newscaster/feed_channel/FC in news_network.network_channels) + for(var/datum/newscaster/feed_channel/FC in GLOB.news_network.network_channels) if(FC.channel_name == "Nanotrasen Book Club") channelexists = 1 break if(!channelexists) - news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null) - news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null) + GLOB.news_network.CreateFeedChannel("Nanotrasen Book Club", "Library", null) + GLOB.news_network.SubmitArticle(scanner.cache.dat, "[scanner.cache.name]", "Nanotrasen Book Club", null) alert("Upload complete. Your uploaded title is now available on station newscasters.") if(href_list["orderbyid"]) if(cooldown > world.time) @@ -449,13 +449,13 @@ var/global/list/datum/cachedbook/cachedbooks // List of our cached book datums if(href_list["targetid"]) var/sqlid = sanitizeSQL(href_list["targetid"]) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) alert("Connection to Archive has been severed. Aborting.") if(cooldown > world.time) say("Printer unavailable. Please allow a short time before attempting to print.") else cooldown = world.time + PRINTER_COOLDOWN - var/DBQuery/query_library_print = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE id=[sqlid] AND isnull(deleted)") + var/DBQuery/query_library_print = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE id=[sqlid] AND isnull(deleted)") if(!query_library_print.Execute()) say("PRINTER ERROR! Failed to print document (0x0000000F)") return diff --git a/code/modules/library/random_books.dm b/code/modules/library/random_books.dm index a5c2bf4db4a4d..bbc57db8cbff5 100644 --- a/code/modules/library/random_books.dm +++ b/code/modules/library/random_books.dm @@ -36,7 +36,7 @@ . = list() if(!isnum(amount) || amount<1) return - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) if(fail_loud || prob(5)) var/obj/item/weapon/paper/P = new(location) P.info = "There once was a book from Nantucket
    But the database failed us, so f*$! it.
    I tried to be good to you
    Now this is an I.O.U
    If you're feeling entitled, well, stuff it!

    ~" @@ -45,7 +45,7 @@ if(prob(25)) category = null var/c = category? " AND category='[sanitizeSQL(category)]'" :"" - var/DBQuery/query_get_random_books = dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") // isdeleted copyright (c) not me + var/DBQuery/query_get_random_books = GLOB.dbcon.NewQuery("SELECT * FROM [format_table_name("library")] WHERE isnull(deleted)[c] GROUP BY title ORDER BY rand() LIMIT [amount];") // isdeleted copyright (c) not me if(query_get_random_books.Execute()) while(query_get_random_books.NextRow()) var/obj/item/weapon/book/B = new(location) diff --git a/code/modules/library/soapstone.dm b/code/modules/library/soapstone.dm index 424f3756c0c7b..231f5417ab6b7 100644 --- a/code/modules/library/soapstone.dm +++ b/code/modules/library/soapstone.dm @@ -229,7 +229,7 @@ SSpersistence.chisel_messages -= src . = ..() -/obj/structure/chisel_message/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = always_state) +/obj/structure/chisel_message/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.always_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/modules/lighting/lighting_corner.dm b/code/modules/lighting/lighting_corner.dm index a2ca166b71d4a..4e3b1821b9476 100644 --- a/code/modules/lighting/lighting_corner.dm +++ b/code/modules/lighting/lighting_corner.dm @@ -1,11 +1,9 @@ -/var/list/datum/lighting_corner/all_lighting_corners = list() -/var/datum/lighting_corner/dummy/dummy_lighting_corner = new // Because we can control each corner of every lighting object. // And corners get shared between multiple turfs (unless you're on the corners of the map, then 1 corner doesn't). // For the record: these should never ever ever be deleted, even if the turf doesn't have dynamic lighting. // This list is what the code that assigns corners listens to, the order in this list is the order in which corners are added to the /turf/corners list. -/var/list/LIGHTING_CORNER_DIAGONAL = list(NORTHEAST, SOUTHEAST, SOUTHWEST, NORTHWEST) +GLOBAL_LIST_INIT(LIGHTING_CORNER_DIAGONAL, list(NORTHEAST, SOUTHEAST, SOUTHWEST, NORTHWEST)) /datum/lighting_corner var/list/turf/masters = list() @@ -32,8 +30,6 @@ /datum/lighting_corner/New(var/turf/new_turf, var/diagonal) . = ..() - all_lighting_corners += src - masters[new_turf] = turn(diagonal, 180) z = new_turf.z @@ -56,7 +52,7 @@ T.corners = list(null, null, null, null) masters[T] = diagonal - i = LIGHTING_CORNER_DIAGONAL.Find(turn(diagonal, 180)) + i = GLOB.LIGHTING_CORNER_DIAGONAL.Find(turn(diagonal, 180)) T.corners[i] = src // Now the horizontal one. @@ -66,7 +62,7 @@ T.corners = list(null, null, null, null) masters[T] = ((T.x > x) ? EAST : WEST) | ((T.y > y) ? NORTH : SOUTH) // Get the dir based on coordinates. - i = LIGHTING_CORNER_DIAGONAL.Find(turn(masters[T], 180)) + i = GLOB.LIGHTING_CORNER_DIAGONAL.Find(turn(masters[T], 180)) T.corners[i] = src // And finally the vertical one. @@ -76,7 +72,7 @@ T.corners = list(null, null, null, null) masters[T] = ((T.x > x) ? EAST : WEST) | ((T.y > y) ? NORTH : SOUTH) // Get the dir based on coordinates. - i = LIGHTING_CORNER_DIAGONAL.Find(turn(masters[T], 180)) + i = GLOB.LIGHTING_CORNER_DIAGONAL.Find(turn(masters[T], 180)) T.corners[i] = src update_active() @@ -98,7 +94,7 @@ if (!needs_update) needs_update = TRUE - lighting_update_corners += src + GLOB.lighting_update_corners += src /datum/lighting_corner/proc/update_objects() // Cache these values a head of time so 4 individual lighting objects don't all calculate them individually. @@ -129,7 +125,7 @@ if (T.lighting_object) if (!T.lighting_object.needs_update) T.lighting_object.needs_update = TRUE - lighting_update_objects += T.lighting_object + GLOB.lighting_update_objects += T.lighting_object /datum/lighting_corner/dummy/New() diff --git a/code/modules/lighting/lighting_object.dm b/code/modules/lighting/lighting_object.dm index fead5abdab0c1..369129fc57883 100644 --- a/code/modules/lighting/lighting_object.dm +++ b/code/modules/lighting/lighting_object.dm @@ -1,4 +1,4 @@ -/var/list/all_lighting_objects = list() // Global list of lighting objects. +GLOBAL_LIST_EMPTY(all_lighting_objects) // Global list of lighting objects. /atom/movable/lighting_object name = "" @@ -19,7 +19,7 @@ /atom/movable/lighting_object/Initialize(mapload, var/no_update = FALSE) . = ..() verbs.Cut() - global.all_lighting_objects += src + GLOB.all_lighting_objects += src var/turf/T = loc // If this runtimes atleast we'll know what's creating overlays in things that aren't turfs. T.lighting_object = src @@ -35,8 +35,8 @@ /atom/movable/lighting_object/Destroy(var/force) if (force) - global.all_lighting_objects -= src - global.lighting_update_objects -= src + GLOB.all_lighting_objects -= src + GLOB.lighting_update_objects -= src var/turf/T = loc if (istype(T)) @@ -68,6 +68,7 @@ // Including with these comments. // See LIGHTING_CORNER_DIAGONAL in lighting_corner.dm for why these values are what they are. + var/static/datum/lighting_corner/dummy/dummy_lighting_corner = new var/datum/lighting_corner/cr = T.corners[3] || dummy_lighting_corner var/datum/lighting_corner/cg = T.corners[2] || dummy_lighting_corner var/datum/lighting_corner/cb = T.corners[4] || dummy_lighting_corner @@ -94,7 +95,7 @@ #if LIGHTING_SOFT_THRESHOLD != 0 var/set_luminosity = max > LIGHTING_SOFT_THRESHOLD #else - // Because of floating points™?, it won't even be a flat 0. + // Because of floating points�?, it won't even be a flat 0. // This number is mostly arbitrary. var/set_luminosity = max > 1e-6 #endif diff --git a/code/modules/lighting/lighting_source.dm b/code/modules/lighting/lighting_source.dm index 5688866c2db92..99b437fd3337f 100644 --- a/code/modules/lighting/lighting_source.dm +++ b/code/modules/lighting/lighting_source.dm @@ -81,7 +81,7 @@ #define EFFECT_UPDATE \ if (!needs_update) \ { \ - lighting_update_lights += src; \ + GLOB.lighting_update_lights += src; \ needs_update = TRUE; \ } diff --git a/code/modules/lighting/lighting_turf.dm b/code/modules/lighting/lighting_turf.dm index 4d7d725e24180..65b1ec2615846 100644 --- a/code/modules/lighting/lighting_turf.dm +++ b/code/modules/lighting/lighting_turf.dm @@ -127,11 +127,11 @@ if (corners[i]) // Already have a corner on this direction. continue - corners[i] = new/datum/lighting_corner(src, LIGHTING_CORNER_DIAGONAL[i]) + corners[i] = new/datum/lighting_corner(src, GLOB.LIGHTING_CORNER_DIAGONAL[i]) /turf/ChangeTurf(path) - if (!path || (!use_preloader && path == type) || !SSlighting.initialized) + if (!path || (!GLOB.use_preloader && path == type) || !SSlighting.initialized) return ..() var/old_opacity = opacity diff --git a/code/modules/mapping/reader.dm b/code/modules/mapping/reader.dm index a2b95f51bb07b..25a7e6366b263 100644 --- a/code/modules/mapping/reader.dm +++ b/code/modules/mapping/reader.dm @@ -3,8 +3,8 @@ ////////////////////////////////////////////////////////////// //global datum that will preload variables on atoms instanciation -var/global/use_preloader = FALSE -var/global/dmm_suite/preloader/_preloader = new +GLOBAL_VAR_INIT(use_preloader, FALSE) +GLOBAL_DATUM_INIT(_preloader, /dmm_suite/preloader, new) /dmm_suite // /"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}/g @@ -275,14 +275,14 @@ var/global/dmm_suite/preloader/_preloader = new index = members.len if(members[index] != /area/template_noop) var/atom/instance - _preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation + GLOB._preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation instance = locate(members[index]) if(crds) instance.contents.Add(crds) - if(use_preloader && instance) - _preloader.load(instance) + if(GLOB.use_preloader && instance) + GLOB._preloader.load(instance) //then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect @@ -318,7 +318,7 @@ var/global/dmm_suite/preloader/_preloader = new //Instance an atom at (x,y,z) and gives it the variables in attributes /dmm_suite/proc/instance_atom(path,list/attributes, turf/crds, no_changeturf) - _preloader.setup(attributes, path) + GLOB._preloader.setup(attributes, path) if(crds) if(!no_changeturf && ispath(path, /turf)) @@ -326,8 +326,8 @@ var/global/dmm_suite/preloader/_preloader = new else . = new path (crds)//first preloader pass - if(use_preloader && .)//second preloader pass, for those atoms that don't ..() in New() - _preloader.load(.) + if(GLOB.use_preloader && .)//second preloader pass, for those atoms that don't ..() in New() + GLOB._preloader.load(.) //custom CHECK_TICK here because we don't want things created while we're sleeping to not initialize if(TICK_CHECK) @@ -429,7 +429,7 @@ var/global/dmm_suite/preloader/_preloader = new /dmm_suite/preloader/proc/setup(list/the_attributes, path) if(the_attributes.len) - use_preloader = TRUE + GLOB.use_preloader = TRUE attributes = the_attributes target_path = path @@ -439,7 +439,7 @@ var/global/dmm_suite/preloader/_preloader = new if(islist(value)) value = deepCopyList(value) what.vars[attribute] = value - use_preloader = FALSE + GLOB.use_preloader = FALSE /area/template_noop name = "Area Passthrough" diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index 40d168d6ba1ce..b98a3cfd98f66 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -19,7 +19,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also var/launch_warning = TRUE var/list/turrets = list() //List of connected turrets - req_one_access = list(access_cargo, access_construction, access_heads, access_research) + req_one_access = list(GLOB.access_cargo, GLOB.access_construction, GLOB.access_heads, GLOB.access_research) var/possible_destinations clockwork = TRUE var/obj/item/device/gps/internal/base/locator @@ -199,7 +199,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also var/turf/T = get_turf(user) var/obj/machinery/computer/auxillary_base/AB - for (var/obj/machinery/computer/auxillary_base/A in machines) + for (var/obj/machinery/computer/auxillary_base/A in GLOB.machines) if(A.z == ZLEVEL_STATION) AB = A break @@ -274,7 +274,7 @@ obj/docking_port/stationary/public_mining_dock/onShuttleMove() to_chat(user, "This device is only to be used in a mining zone.") return var/obj/machinery/computer/auxillary_base/aux_base_console - for(var/obj/machinery/computer/auxillary_base/ABC in machines) + for(var/obj/machinery/computer/auxillary_base/ABC in GLOB.machines) if(get_dist(landing_spot, ABC) <= console_range) aux_base_console = ABC break diff --git a/code/modules/mining/aux_base_camera.dm b/code/modules/mining/aux_base_camera.dm index cb4519d2db413..fcbced3210da8 100644 --- a/code/modules/mining/aux_base_camera.dm +++ b/code/modules/mining/aux_base_camera.dm @@ -62,7 +62,7 @@ /obj/machinery/computer/camera_advanced/base_construction/CreateEye() var/spawn_spot - for(var/obj/machinery/computer/auxillary_base/ABC in machines) + for(var/obj/machinery/computer/auxillary_base/ABC in GLOB.machines) if(istype(get_area(ABC), /area/shuttle/auxillary_base)) found_aux_console = ABC break diff --git a/code/modules/mining/equipment.dm b/code/modules/mining/equipment.dm index 3e964875992a2..2b10ab055310b 100644 --- a/code/modules/mining/equipment.dm +++ b/code/modules/mining/equipment.dm @@ -82,7 +82,7 @@ var/list/destinations = list() if(isgolem(user)) - for(var/obj/item/device/radio/beacon/B in teleportbeacons) + for(var/obj/item/device/radio/beacon/B in GLOB.teleportbeacons) var/turf/T = get_turf(B) if(istype(T.loc, /area/ruin/powered/golem_ship)) destinations += B @@ -91,7 +91,7 @@ if(destinations.len) return destinations - for(var/obj/item/device/radio/beacon/B in teleportbeacons) + for(var/obj/item/device/radio/beacon/B in GLOB.teleportbeacons) var/turf/T = get_turf(B) if(T.z == ZLEVEL_STATION) destinations += B diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index c919d829c4321..7ef051293324d 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -1,4 +1,4 @@ -var/list/total_extraction_beacons = list() +GLOBAL_LIST_EMPTY(total_extraction_beacons) /obj/item/weapon/extraction_pack name = "fulton extraction pack" @@ -18,7 +18,7 @@ var/list/total_extraction_beacons = list() /obj/item/weapon/extraction_pack/attack_self(mob/user) var/list/possible_beacons = list() - for(var/B in total_extraction_beacons) + for(var/B in GLOB.total_extraction_beacons) var/obj/structure/extraction_point/EP = B if(EP.beacon_network in beacon_networks) possible_beacons += EP @@ -160,11 +160,11 @@ var/list/total_extraction_beacons = list() /obj/structure/extraction_point/New() var/area/area_name = get_area(src) name += " ([rand(100,999)]) ([area_name.name])" - total_extraction_beacons += src + GLOB.total_extraction_beacons += src ..() /obj/structure/extraction_point/Destroy() - total_extraction_beacons -= src + GLOB.total_extraction_beacons -= src ..() /obj/effect/extraction_holder diff --git a/code/modules/mining/laborcamp/laborshuttle.dm b/code/modules/mining/laborcamp/laborshuttle.dm index 540cd299b03c2..4d6ffe69d891c 100644 --- a/code/modules/mining/laborcamp/laborshuttle.dm +++ b/code/modules/mining/laborcamp/laborshuttle.dm @@ -4,7 +4,7 @@ circuit = /obj/item/weapon/circuitboard/computer/labor_shuttle shuttleId = "laborcamp" possible_destinations = "laborcamp_home;laborcamp_away" - req_access = list(access_brig) + req_access = list(GLOB.access_brig) /obj/machinery/computer/shuttle/labor/one_way diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm index 4d58f8207d46e..50c149538e53a 100644 --- a/code/modules/mining/laborcamp/laborstacker.dm +++ b/code/modules/mining/laborcamp/laborstacker.dm @@ -35,7 +35,7 @@ return ..() /obj/machinery/mineral/labor_claim_console/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "labor_claim_console", name, 450, 475, master_ui, state) @@ -104,8 +104,8 @@ to_chat(usr, "No permission to dock could be granted.") else if(!emagged) - Radio.set_frequency(SEC_FREQ) - Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", SEC_FREQ, get_spans(), get_default_language()) + Radio.set_frequency(GLOB.SEC_FREQ) + Radio.talk_into(src, "[inserted_id.registered_name] has returned to the station. Minerals and Prisoner ID card ready for retrieval.", GLOB.SEC_FREQ, get_spans(), get_default_language()) to_chat(usr, "Shuttle received message and will be sent shortly.") /obj/machinery/mineral/labor_claim_console/proc/check_auth() diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index c1122cc38f807..a1ab36b83305e 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -486,14 +486,14 @@ ..() spirits = list() START_PROCESSING(SSobj, src) - poi_list |= src + GLOB.poi_list |= src /obj/item/weapon/melee/ghost_sword/Destroy() for(var/mob/dead/observer/G in spirits) - G.invisibility = observer_default_invisibility + G.invisibility = GLOB.observer_default_invisibility spirits.Cut() STOP_PROCESSING(SSobj, src) - poi_list -= src + GLOB.poi_list -= src . = ..() /obj/item/weapon/melee/ghost_sword/attack_self(mob/user) @@ -537,7 +537,7 @@ current_spirits |= G for(var/mob/dead/observer/G in spirits - current_spirits) - G.invisibility = observer_default_invisibility + G.invisibility = GLOB.observer_default_invisibility spirits = current_spirits @@ -722,7 +722,7 @@ if(used) return used = TRUE - var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in player_list + var/choice = input(user,"Who do you want dead?","Choose Your Victim") as null|anything in GLOB.player_list if(!(isliving(choice))) to_chat(user, "[choice] is already dead!") @@ -747,7 +747,7 @@ var/obj/effect/mine/pickup/bloodbath/B = new(L) B.mineEffect(L) - for(var/mob/living/carbon/human/H in player_list) + for(var/mob/living/carbon/human/H in GLOB.player_list) if(H == L) continue to_chat(H, "You have an overwhelming desire to kill [L]. [L.p_they(TRUE)] [L.p_have()] been marked red! Go kill [L.p_them()]!") @@ -975,7 +975,7 @@ playsound(T,'sound/effects/bin_close.ogg', 200, 1) sleep(2) new /obj/effect/overlay/temp/hierophant/blast(T, user, friendly_fire_check) - for(var/d in cardinal) + for(var/d in GLOB.cardinal) INVOKE_ASYNC(src, .proc/blast_wall, T, d, user) /obj/item/weapon/hierophant_club/proc/blast_wall(turf/T, dir, mob/living/user) //make a wall of blasts blast_range tiles long diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 2928857f2bbd8..4af7330641c49 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -10,8 +10,8 @@ anchored = 1 input_dir = NORTH output_dir = SOUTH - req_access = list(access_mineral_storeroom) - var/req_access_reclaim = access_mining_station + req_access = list(GLOB.access_mineral_storeroom) + var/req_access_reclaim = GLOB.access_mining_station var/stk_types = list() var/stk_amt = list() var/stack_list = list() //Key: Type. Value: Instance of type. @@ -85,7 +85,7 @@ var/obj/item/stack/sheet/sheet = stack_list[s] msg += "[capitalize(sheet.name)]: [sheet.amount] sheets
    " - for(var/obj/machinery/requests_console/D in allConsoles) + for(var/obj/machinery/requests_console/D in GLOB.allConsoles) if(D.receive_ore_updates) D.createmessage("Ore Redemption Machine", "New minerals available!", msg, 1, 0) diff --git a/code/modules/mining/machine_vending.dm b/code/modules/mining/machine_vending.dm index 3f5d284fcff23..dc6bc87d189fa 100644 --- a/code/modules/mining/machine_vending.dm +++ b/code/modules/mining/machine_vending.dm @@ -272,10 +272,10 @@ /obj/item/weapon/card/mining_access_card/afterattack(atom/movable/AM, mob/user, proximity) if(istype(AM, /obj/item/weapon/card/id) && proximity) var/obj/item/weapon/card/id/I = AM - I.access |= access_mining - I.access |= access_mining_station - I.access |= access_mineral_storeroom - I.access |= access_cargo + I.access |= GLOB.access_mining + I.access |= GLOB.access_mining_station + I.access |= GLOB.access_mineral_storeroom + I.access |= GLOB.access_cargo to_chat(user, "You upgrade [I] with mining access.") qdel(src) ..() diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 729ee970fae2b..2d3b1e42c633f 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -37,7 +37,7 @@ /obj/structure/closet/secure_closet/miner name = "miner's equipment" icon_state = "mining" - req_access = list(access_mining) + req_access = list(GLOB.access_mining) /obj/structure/closet/secure_closet/miner/New() ..() diff --git a/code/modules/mining/minebot.dm b/code/modules/mining/minebot.dm index f1390264616b9..5e95e401ef970 100644 --- a/code/modules/mining/minebot.dm +++ b/code/modules/mining/minebot.dm @@ -136,7 +136,7 @@ var/obj/item/weapon/ore/O for(O in src.loc) O.loc = src - for(var/dir in alldirs) + for(var/dir in GLOB.alldirs) var/turf/T = get_step(src,dir) for(O in T) O.loc = src diff --git a/code/modules/mob/dead/new_player/login.dm b/code/modules/mob/dead/new_player/login.dm index 220a4f1272abc..39c097c8ef2a0 100644 --- a/code/modules/mob/dead/new_player/login.dm +++ b/code/modules/mob/dead/new_player/login.dm @@ -6,11 +6,11 @@ ..() - if(join_motd) - to_chat(src, "
    [join_motd]
    ") + if(GLOB.join_motd) + to_chat(src, "
    [GLOB.join_motd]
    ") - if(admin_notice) - to_chat(src, "Admin Notice:\n \t [admin_notice]") + if(GLOB.admin_notice) + to_chat(src, "Admin Notice:\n \t [GLOB.admin_notice]") if(config.soft_popcap && living_player_count() >= config.soft_popcap) to_chat(src, "Server Notice:\n \t [config.soft_popcap_message]") diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 1e26185d9f30b..b6b90f2bbced0 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -20,14 +20,14 @@ stack_trace("Warning: [src]([type]) initialized multiple times!") initialized = TRUE tag = "mob_[next_mob_id++]" - mob_list += src + GLOB.mob_list += src if(client && SSticker.state == GAME_STATE_STARTUP) var/obj/screen/splash/S = new(client, TRUE, TRUE) S.Fade(TRUE) - if(length(newplayer_start)) - loc = pick(newplayer_start) + if(length(GLOB.newplayer_start)) + loc = pick(GLOB.newplayer_start) else loc = locate(1,1,1) @@ -48,11 +48,11 @@ output += "

    Observe

    " if(!IsGuestKey(src.key)) - if (dbcon.Connect()) + if (GLOB.dbcon.Connect()) var/isadmin = 0 if(src.client && src.client.holder) isadmin = 1 - var/DBQuery/query_get_new_polls = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")") + var/DBQuery/query_get_new_polls = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM [format_table_name("poll_vote")] WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM [format_table_name("poll_textreply")] WHERE ckey = \"[ckey]\")") if(!query_get_new_polls.Execute()) return var/newpoll = 0 @@ -77,7 +77,7 @@ ..() if(statpanel("Lobby")) - stat("Game Mode:", (SSticker.hide_mode) ? "Secret" : "[master_mode]") + stat("Game Mode:", (SSticker.hide_mode) ? "Secret" : "[GLOB.master_mode]") stat("Map:", SSmapping.config.map_name) if(SSticker.current_state == GAME_STATE_PREGAME) @@ -156,7 +156,7 @@ LateChoices() return - if(SSticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in admin_datums))) + if(SSticker.queued_players.len || (relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in GLOB.admin_datums))) to_chat(usr, "[config.hard_popcap_message]") var/queue_position = SSticker.queued_players.Find(usr) @@ -175,11 +175,11 @@ if(href_list["SelectedJob"]) - if(!enter_allowed) + if(!GLOB.enter_allowed) to_chat(usr, "There is an administrative lock on entering the game!") return - if(SSticker.queued_players.len && !(ckey(key) in admin_datums)) + if(SSticker.queued_players.len && !(ckey(key) in GLOB.admin_datums)) if((living_player_count() >= relevant_cap) || (src != SSticker.queued_players[1])) to_chat(usr, "Server is full.") return @@ -325,8 +325,8 @@ character = equip var/D - if(latejoin.len) - D = get_turf(pick(latejoin)) + if(GLOB.latejoin.len) + D = get_turf(pick(GLOB.latejoin)) if(!D) for(var/turf/T in get_area_turfs(/area/shuttle/arrival)) if(!T.density) @@ -353,17 +353,17 @@ humanc = character //Let's retypecast the var to be human, if(humanc) //These procs all expect humans - data_core.manifest_inject(humanc) + GLOB.data_core.manifest_inject(humanc) if(SSshuttle.arrivals) SSshuttle.arrivals.QueueAnnounce(humanc, rank) else AnnounceArrival(humanc, rank) AddEmploymentContract(humanc) - if(highlander) + if(GLOB.highlander) to_chat(humanc, "THERE CAN BE ONLY ONE!!!") humanc.make_scottish() - joined_player_list += character.ckey + GLOB.joined_player_list += character.ckey if(config.allow_latejoin_antagonists && humanc) //Borgs aren't allowed to be antags. Will need to be tweaked if we get true latejoin ais. if(SSshuttle.emergency) @@ -378,14 +378,14 @@ /mob/dead/new_player/proc/AddEmploymentContract(mob/living/carbon/human/employee) //TODO: figure out a way to exclude wizards/nukeops/demons from this. sleep(30) - for(var/C in employmentCabinets) + for(var/C in GLOB.employmentCabinets) var/obj/structure/filingcabinet/employment/employmentCabinet = C if(!employmentCabinet.virgin) employmentCabinet.addFile(employee) /mob/dead/new_player/proc/LateChoices() - var/mills = world.time - round_start_time // 1/10 of a second, not real milliseconds but whatever + var/mills = world.time - SSticker.round_start_time // 1/10 of a second, not real milliseconds but whatever //var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence.. or something var/mins = (mills % 36000) / 600 var/hours = mills / 36000 @@ -425,7 +425,7 @@ if (job_count > round(available_job_count / 2)) dat += "
    " var/position_class = "otherPosition" - if (job.title in command_positions) + if (job.title in GLOB.command_positions) position_class = "commandPosition" dat += "[job.title] ([job.current_positions])
    " if(!job_count) //if there's nowhere to go, assistant opens up. @@ -476,7 +476,7 @@ /mob/dead/new_player/proc/ViewManifest() var/dat = "" dat += "

    Crew Manifest

    " - dat += data_core.get_manifest(OOC = 1) + dat += GLOB.data_core.get_manifest(OOC = 1) src << browse(dat, "window=manifest;size=387x420;can_close=1") diff --git a/code/modules/mob/dead/new_player/poll.dm b/code/modules/mob/dead/new_player/poll.dm index 2f77767558f98..00b643691c285 100644 --- a/code/modules/mob/dead/new_player/poll.dm +++ b/code/modules/mob/dead/new_player/poll.dm @@ -3,10 +3,10 @@ var/optiontext /mob/dead/new_player/proc/handle_player_polling() - if(!dbcon.IsConnected()) + if(!GLOB.dbcon.IsConnected()) to_chat(usr, "Failed to establish database connection.") return - var/DBQuery/query_poll_get = dbcon.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE Now() BETWEEN starttime AND endtime [(client.holder ? "" : "AND adminonly = false")]") + var/DBQuery/query_poll_get = GLOB.dbcon.NewQuery("SELECT id, question FROM [format_table_name("poll_question")] WHERE Now() BETWEEN starttime AND endtime [(client.holder ? "" : "AND adminonly = false")]") if(!query_poll_get.warn_execute()) return var/output = "
    Player polls
    AUTHORTITLECATEGORYSS13BN
    " @@ -22,10 +22,10 @@ /mob/dead/new_player/proc/poll_player(pollid) if(!pollid) return - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return - var/DBQuery/query_poll_get_details = dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]") + var/DBQuery/query_poll_get_details = GLOB.dbcon.NewQuery("SELECT starttime, endtime, question, polltype, multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]") if(!query_poll_get_details.warn_execute()) return var/pollstarttime = "" @@ -41,14 +41,14 @@ multiplechoiceoptions = text2num(query_poll_get_details.item[5]) switch(polltype) if(POLLTYPE_OPTION) - var/DBQuery/query_option_get_votes = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/query_option_get_votes = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") if(!query_option_get_votes.warn_execute()) return var/votedoptionid = 0 if(query_option_get_votes.NextRow()) votedoptionid = text2num(query_option_get_votes.item[1]) var/list/datum/polloption/options = list() - var/DBQuery/query_option_options = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/query_option_options = GLOB.dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") if(!query_option_options.warn_execute()) return while(query_option_options.NextRow()) @@ -82,7 +82,7 @@ src << browse(null ,"window=playerpolllist") src << browse(output,"window=playerpoll;size=500x250") if(POLLTYPE_TEXT) - var/DBQuery/query_text_get_votes = dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/query_text_get_votes = GLOB.dbcon.NewQuery("SELECT replytext FROM [format_table_name("poll_textreply")] WHERE pollid = [pollid] AND ckey = '[ckey]'") if(!query_text_get_votes.warn_execute()) return var/vote_text = "" @@ -111,7 +111,7 @@ src << browse(null ,"window=playerpolllist") src << browse(output,"window=playerpoll;size=500x500") if(POLLTYPE_RATING) - var/DBQuery/query_rating_get_votes = dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, [format_table_name("poll_vote")] v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid") + var/DBQuery/query_rating_get_votes = GLOB.dbcon.NewQuery("SELECT o.text, v.rating FROM [format_table_name("poll_option")] o, [format_table_name("poll_vote")] v WHERE o.pollid = [pollid] AND v.ckey = '[ckey]' AND o.id = v.optionid") if(!query_rating_get_votes.warn_execute()) return var/output = "
    Player poll
    " @@ -129,7 +129,7 @@ output += "" var/minid = 999999 var/maxid = 0 - var/DBQuery/query_rating_options = dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/query_rating_options = GLOB.dbcon.NewQuery("SELECT id, text, minval, maxval, descmin, descmid, descmax FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") if(!query_rating_options.warn_execute()) return while(query_rating_options.NextRow()) @@ -163,7 +163,7 @@ src << browse(null ,"window=playerpolllist") src << browse(output,"window=playerpoll;size=500x500") if(POLLTYPE_MULTI) - var/DBQuery/query_multi_get_votes = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/query_multi_get_votes = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") if(!query_multi_get_votes.warn_execute()) return var/list/votedfor = list() @@ -172,7 +172,7 @@ var/list/datum/polloption/options = list() var/maxoptionid = 0 var/minoptionid = 0 - var/DBQuery/query_multi_options = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/query_multi_options = GLOB.dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") if(!query_multi_options.warn_execute()) return while(query_multi_options.NextRow()) @@ -214,7 +214,7 @@ var/datum/asset/irv_assets = get_asset_datum(/datum/asset/simple/IRV) irv_assets.send(src) - var/DBQuery/query_irv_get_votes = dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/query_irv_get_votes = GLOB.dbcon.NewQuery("SELECT optionid FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") if(!query_irv_get_votes.warn_execute()) return @@ -224,7 +224,7 @@ var/list/datum/polloption/options = list() - var/DBQuery/query_irv_options = dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/query_irv_options = GLOB.dbcon.NewQuery("SELECT id, text FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") if(!query_irv_options.warn_execute()) return while(query_irv_options.NextRow()) @@ -327,10 +327,10 @@ var/table = "poll_vote" if (text) table = "poll_textreply" - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(usr, "Failed to establish database connection.") return - var/DBQuery/query_hasvoted = dbcon.NewQuery("SELECT id FROM `[format_table_name(table)]` WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/query_hasvoted = GLOB.dbcon.NewQuery("SELECT id FROM `[format_table_name(table)]` WHERE pollid = [pollid] AND ckey = '[ckey]'") if(!query_hasvoted.warn_execute()) return if(query_hasvoted.NextRow()) @@ -355,14 +355,14 @@ return 1 /mob/dead/new_player/proc/vote_valid_check(pollid, holder, type) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(src, "Failed to establish database connection.") return 0 pollid = text2num(pollid) if (!pollid || pollid < 0) return 0 //validate the poll is actually the right type of poll and its still active - var/DBQuery/query_validate_poll = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime AND polltype = '[type]' [(holder ? "" : "AND adminonly = false")]") + var/DBQuery/query_validate_poll = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_question")] WHERE id = [pollid] AND Now() BETWEEN starttime AND endtime AND polltype = '[type]' [(holder ? "" : "AND adminonly = false")]") if(!query_validate_poll.warn_execute()) return 0 if (!query_validate_poll.NextRow()) @@ -370,7 +370,7 @@ return 1 /mob/dead/new_player/proc/vote_on_irv_poll(pollid, list/votelist) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(src, "Failed to establish database connection.") return 0 if (!vote_rig_check()) @@ -395,7 +395,7 @@ return 0 //lets collect the options - var/DBQuery/query_irv_id = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") + var/DBQuery/query_irv_id = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_option")] WHERE pollid = [pollid]") if(!query_irv_id.warn_execute()) return 0 var/list/optionlist = list() @@ -426,12 +426,12 @@ sqlrowlist += "(Now(), [pollid], [vote], '[sanitizeSQL(ckey)]', INET_ATON('[sanitizeSQL(address)]'), '[sanitizeSQL(rank)]')" //now lets delete their old votes (if any) - var/DBQuery/query_irv_del_old = dbcon.NewQuery("DELETE FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/query_irv_del_old = GLOB.dbcon.NewQuery("DELETE FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") if(!query_irv_del_old.warn_execute()) return 0 //now to add the new ones. - var/DBQuery/query_irv_vote = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES [sqlrowlist]") + var/DBQuery/query_irv_vote = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES [sqlrowlist]") if(!query_irv_vote.warn_execute()) return 0 src << browse(null,"window=playerpoll") @@ -439,7 +439,7 @@ /mob/dead/new_player/proc/vote_on_poll(pollid, optionid) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(src, "Failed to establish database connection.") return 0 if (!vote_rig_check()) @@ -452,14 +452,14 @@ var/adminrank = sanitizeSQL(poll_check_voted(pollid)) if(!adminrank) return - var/DBQuery/query_option_vote = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')") + var/DBQuery/query_option_vote = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')") if(!query_option_vote.warn_execute()) return usr << browse(null,"window=playerpoll") return 1 /mob/dead/new_player/proc/log_text_poll_reply(pollid, replytext) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(src, "Failed to establish database connection.") return 0 if (!vote_rig_check()) @@ -479,14 +479,14 @@ if(!(length(replytext) > 0) || !(length(replytext) <= 8000)) to_chat(usr, "The text you entered was invalid or too long. Please correct the text and submit again.") return - var/DBQuery/query_text_vote = dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (Now(), [pollid], '[ckey]', INET_ATON('[client.address]'), '[replytext]', '[adminrank]')") + var/DBQuery/query_text_vote = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_textreply")] (datetime ,pollid ,ckey ,ip ,replytext ,adminrank) VALUES (Now(), [pollid], '[ckey]', INET_ATON('[client.address]'), '[replytext]', '[adminrank]')") if(!query_text_vote.warn_execute()) return usr << browse(null,"window=playerpoll") return 1 /mob/dead/new_player/proc/vote_on_numval_poll(pollid, optionid, rating) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(src, "Failed to establish database connection.") return 0 if (!vote_rig_check()) @@ -496,7 +496,7 @@ //validate the poll if (!vote_valid_check(pollid, client.holder, POLLTYPE_RATING)) return 0 - var/DBQuery/query_numval_hasvoted = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'") + var/DBQuery/query_numval_hasvoted = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE optionid = [optionid] AND ckey = '[ckey]'") if(!query_numval_hasvoted.warn_execute()) return if(query_numval_hasvoted.NextRow()) @@ -506,14 +506,14 @@ if(client.holder) adminrank = client.holder.rank.name adminrank = sanitizeSQL(adminrank) - var/DBQuery/query_numval_vote = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]', [(isnull(rating)) ? "null" : rating])") + var/DBQuery/query_numval_vote = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime ,pollid ,optionid ,ckey ,ip ,adminrank, rating) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]', [(isnull(rating)) ? "null" : rating])") if(!query_numval_vote.warn_execute()) return usr << browse(null,"window=playerpoll") return 1 /mob/dead/new_player/proc/vote_on_multi_poll(pollid, optionid) - if (!dbcon.Connect()) + if (!GLOB.dbcon.Connect()) to_chat(src, "Failed to establish database connection.") return 0 if (!vote_rig_check()) @@ -523,13 +523,13 @@ //validate the poll if (!vote_valid_check(pollid, client.holder, POLLTYPE_MULTI)) return 0 - var/DBQuery/query_multi_choicelen = dbcon.NewQuery("SELECT multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]") + var/DBQuery/query_multi_choicelen = GLOB.dbcon.NewQuery("SELECT multiplechoiceoptions FROM [format_table_name("poll_question")] WHERE id = [pollid]") if(!query_multi_choicelen.warn_execute()) return 1 var/i if(query_multi_choicelen.NextRow()) i = text2num(query_multi_choicelen.item[1]) - var/DBQuery/query_multi_hasvoted = dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") + var/DBQuery/query_multi_hasvoted = GLOB.dbcon.NewQuery("SELECT id FROM [format_table_name("poll_vote")] WHERE pollid = [pollid] AND ckey = '[ckey]'") if(!query_multi_hasvoted.warn_execute()) return 1 while(i) @@ -543,7 +543,7 @@ if(client.holder) adminrank = client.holder.rank.name adminrank = sanitizeSQL(adminrank) - var/DBQuery/query_multi_vote = dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')") + var/DBQuery/query_multi_vote = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("poll_vote")] (datetime, pollid, optionid, ckey, ip, adminrank) VALUES (Now(), [pollid], [optionid], '[ckey]', INET_ATON('[client.address]'), '[adminrank]')") if(!query_multi_vote.warn_execute()) return 1 usr << browse(null,"window=playerpoll") diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index f1079e12912b8..5d2bb57e83957 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -24,7 +24,7 @@ // Silicons only need a very basic preview since there is no customization for them. if(job_engsec_high) switch(job_engsec_high) - if(AI) + if(AI_JF) preview_icon = icon('icons/mob/AI.dmi', "AI", SOUTH) preview_icon.Scale(64, 64) return diff --git a/code/modules/mob/dead/observer/logout.dm b/code/modules/mob/dead/observer/logout.dm index 4ec9a54ba59ed..5d423d329a704 100644 --- a/code/modules/mob/dead/observer/logout.dm +++ b/code/modules/mob/dead/observer/logout.dm @@ -1,6 +1,6 @@ /mob/dead/observer/Logout() if (client) - client.images -= ghost_darkness_images + client.images -= GLOB.ghost_darkness_images if(observetarget) if(ismob(observetarget)) var/mob/target = observetarget diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 9ce2ff1310428..aa005c75bc1de 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -1,9 +1,9 @@ -var/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness, BUT NOT THE GHOSTS THEMSELVES! -var/list/image/ghost_images_full = list() //this is a list of full images of the ghosts themselves -var/list/image/ghost_images_default = list() //this is a list of the default (non-accessorized, non-dir) images of the ghosts themselves -var/list/image/ghost_images_simple = list() //this is a list of all ghost images as the simple white ghost +GLOBAL_LIST_EMPTY(ghost_darkness_images) //this is a list of images for things ghosts should still be able to see when they toggle darkness, BUT NOT THE GHOSTS THEMSELVES! +GLOBAL_LIST_EMPTY(ghost_images_full) //this is a list of full images of the ghosts themselves +GLOBAL_LIST_EMPTY(ghost_images_default) //this is a list of the default (non-accessorized, non-dir) images of the ghosts themselves +GLOBAL_LIST_EMPTY(ghost_images_simple) //this is a list of all ghost images as the simple white ghost -var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER +GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) /mob/dead/observer name = "ghost" @@ -58,7 +58,7 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER var/deadchat_name /mob/dead/observer/Initialize() - invisibility = observer_default_invisibility + invisibility = GLOB.observer_default_invisibility verbs += /mob/dead/observer/proc/dead_tele @@ -66,14 +66,14 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER verbs += /mob/dead/observer/proc/server_hop ghostimage = image(src.icon,src,src.icon_state) - if(icon_state in ghost_forms_with_directions_list) + if(icon_state in GLOB.ghost_forms_with_directions_list) ghostimage_default = image(src.icon,src,src.icon_state + "_nodir") else ghostimage_default = image(src.icon,src,src.icon_state) ghostimage_simple = image(src.icon,src,"ghost_nodir") - ghost_images_full |= ghostimage - ghost_images_default |= ghostimage_default - ghost_images_simple |= ghostimage_simple + GLOB.ghost_images_full |= ghostimage + GLOB.ghost_images_default |= ghostimage_default + GLOB.ghost_images_simple |= ghostimage_simple updateallghostimages() var/turf/T @@ -138,15 +138,15 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER addtimer(CALLBACK(src, /atom/proc/update_atom_colour), 10) /mob/dead/observer/Destroy() - ghost_images_full -= ghostimage + GLOB.ghost_images_full -= ghostimage qdel(ghostimage) ghostimage = null - ghost_images_default -= ghostimage_default + GLOB.ghost_images_default -= ghostimage_default qdel(ghostimage_default) ghostimage_default = null - ghost_images_simple -= ghostimage_simple + GLOB.ghost_images_simple -= ghostimage_simple qdel(ghostimage_simple) ghostimage_simple = null @@ -182,21 +182,21 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER if(new_form) icon_state = new_form ghostimage.icon_state = new_form - if(icon_state in ghost_forms_with_directions_list) + if(icon_state in GLOB.ghost_forms_with_directions_list) ghostimage_default.icon_state = new_form + "_nodir" //if this icon has dirs, the default ghostimage must use its nodir version or clients with the preference set to default sprites only will see the dirs else ghostimage_default.icon_state = new_form - if(ghost_accs >= GHOST_ACCS_DIR && icon_state in ghost_forms_with_directions_list) //if this icon has dirs AND the client wants to show them, we make sure we update the dir on movement + if(ghost_accs >= GHOST_ACCS_DIR && icon_state in GLOB.ghost_forms_with_directions_list) //if this icon has dirs AND the client wants to show them, we make sure we update the dir on movement updatedir = 1 else updatedir = 0 //stop updating the dir in case we want to show accessories with dirs on a ghost sprite without dirs setDir(2 )//reset the dir to its default so the sprites all properly align up - if(ghost_accs == GHOST_ACCS_FULL && icon_state in ghost_forms_with_accessories_list) //check if this form supports accessories and if the client wants to show them + if(ghost_accs == GHOST_ACCS_FULL && icon_state in GLOB.ghost_forms_with_accessories_list) //check if this form supports accessories and if the client wants to show them var/datum/sprite_accessory/S if(facial_hair_style) - S = facial_hair_styles_list[facial_hair_style] + S = GLOB.facial_hair_styles_list[facial_hair_style] if(S) facial_hair_image = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER) if(facial_hair_color) @@ -205,7 +205,7 @@ var/global/static/observer_default_invisibility = INVISIBILITY_OBSERVER add_overlay(facial_hair_image) ghostimage.add_overlay(facial_hair_image) if(hair_style) - S = hair_styles_list[hair_style] + S = GLOB.hair_styles_list[hair_style] if(S) hair_image = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER) if(hair_color) @@ -317,7 +317,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(istype(SSticker.mode, /datum/game_mode/blob)) var/datum/game_mode/blob/B = SSticker.mode if(B.message_sent) - stat(null, "Blobs to Blob Win: [blobs_legit.len]/[B.blobwincount]") + stat(null, "Blobs to Blob Win: [GLOB.blobs_legit.len]/[B.blobwincount]") /mob/dead/observer/verb/reenter_corpse() set category = "Ghost" @@ -368,7 +368,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(usr, "Not when you're not dead!") return var/A - A = input("Area to jump to", "BOOYEA", A) as null|anything in sortedAreas + A = input("Area to jump to", "BOOYEA", A) as null|anything in GLOB.sortedAreas var/area/thearea = A if(!thearea) return @@ -533,12 +533,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp updateghostimages() /proc/updateallghostimages() - listclearnulls(ghost_images_full) - listclearnulls(ghost_images_default) - listclearnulls(ghost_images_simple) - listclearnulls(ghost_darkness_images) + listclearnulls(GLOB.ghost_images_full) + listclearnulls(GLOB.ghost_images_default) + listclearnulls(GLOB.ghost_images_simple) + listclearnulls(GLOB.ghost_darkness_images) - for (var/mob/dead/observer/O in player_list) + for (var/mob/dead/observer/O in GLOB.player_list) O.updateghostimages() /mob/dead/observer/proc/updateghostimages() @@ -548,30 +548,30 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(lastsetting) switch(lastsetting) //checks the setting we last came from, for a little efficiency so we don't try to delete images from the client that it doesn't have anyway if(GHOST_OTHERS_THEIR_SETTING) - client.images -= ghost_images_full + client.images -= GLOB.ghost_images_full if(GHOST_OTHERS_DEFAULT_SPRITE) - client.images -= ghost_images_default + client.images -= GLOB.ghost_images_default if(GHOST_OTHERS_SIMPLE) - client.images -= ghost_images_simple + client.images -= GLOB.ghost_images_simple if ((seedarkness || !ghostvision) && client.prefs.ghost_others == GHOST_OTHERS_THEIR_SETTING) - client.images -= ghost_darkness_images + client.images -= GLOB.ghost_darkness_images lastsetting = null else if(ghostvision && (!seedarkness || client.prefs.ghost_others <= GHOST_OTHERS_DEFAULT_SPRITE)) //add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now if(!lastsetting) - client.images |= ghost_darkness_images + client.images |= GLOB.ghost_darkness_images switch(client.prefs.ghost_others) if(GHOST_OTHERS_THEIR_SETTING) - client.images |= ghost_images_full + client.images |= GLOB.ghost_images_full if (ghostimage) client.images -= ghostimage //remove ourself if(GHOST_OTHERS_DEFAULT_SPRITE) - client.images |= ghost_images_default + client.images |= GLOB.ghost_images_default if(ghostimage_default) client.images -= ghostimage_default if(GHOST_OTHERS_SIMPLE) - client.images |= ghost_images_simple + client.images |= GLOB.ghost_images_simple if(ghostimage_simple) client.images -= ghostimage_simple lastsetting = client.prefs.ghost_others @@ -582,8 +582,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp set desc= "Take over the body of a mindless creature!" var/list/possessible = list() - for(var/mob/living/L in living_mob_list) - if(!(L in player_list) && !L.mind) + for(var/mob/living/L in GLOB.living_mob_list) + if(!(L in GLOB.player_list) && !L.mind) possessible += L var/mob/living/target = input("Your new life begins today!", "Possess Mob", null, null) as null|anything in possessible @@ -631,7 +631,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /proc/show_server_hop_transfer_screen(expected_key) //only show it to incoming ghosts - for(var/mob/dead/observer/O in player_list) + for(var/mob/dead/observer/O in GLOB.player_list) if(O.key == expected_key) if(O.client) new /obj/screen/splash(O.client, TRUE) @@ -652,7 +652,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp var/dat dat += "

    Crew Manifest

    " - dat += data_core.get_manifest() + dat += GLOB.data_core.get_manifest() src << browse(dat, "window=manifest;size=387x420;can_close=1") @@ -692,12 +692,12 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/proc/show_data_huds() for(var/hudtype in datahuds) - var/datum/atom_hud/H = huds[hudtype] + var/datum/atom_hud/H = GLOB.huds[hudtype] H.add_hud_to(src) /mob/dead/observer/proc/remove_data_huds() for(var/hudtype in datahuds) - var/datum/atom_hud/H = huds[hudtype] + var/datum/atom_hud/H = GLOB.huds[hudtype] H.remove_hud_from(src) /mob/dead/observer/verb/toggle_data_huds() @@ -827,8 +827,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp change_mob_type( /mob/living/carbon/human , null, null, TRUE) //always delmob, ghosts shouldn't be left lingering /proc/set_observer_default_invisibility(amount, message=null) - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) G.invisibility = amount if(message) to_chat(G, message) - observer_default_invisibility = amount + GLOB.observer_default_invisibility = amount diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm index 18372d5e3011b..397824d83013d 100644 --- a/code/modules/mob/living/brain/MMI.dm +++ b/code/modules/mob/living/brain/MMI.dm @@ -64,8 +64,8 @@ brainmob.container = src if(!newbrain.damaged_brain) // the brain organ hasn't been beaten to death. brainmob.stat = CONSCIOUS //we manually revive the brain mob - dead_mob_list -= brainmob - living_mob_list += brainmob + GLOB.dead_mob_list -= brainmob + GLOB.living_mob_list += brainmob brainmob.reset_perspective() brain = newbrain @@ -97,8 +97,8 @@ brainmob.stat = DEAD brainmob.emp_damage = 0 brainmob.reset_perspective() //so the brainmob follows the brain organ instead of the mmi. And to update our vision - living_mob_list -= brainmob //Get outta here - dead_mob_list += brainmob + GLOB.living_mob_list -= brainmob //Get outta here + GLOB.dead_mob_list += brainmob brain.brainmob = brainmob //Set the brain to use the brainmob brainmob = null //Set mmi brainmob var to null if(user) diff --git a/code/modules/mob/living/brain/posibrain.dm b/code/modules/mob/living/brain/posibrain.dm index 6708f7c11e03c..ceb3cae704884 100644 --- a/code/modules/mob/living/brain/posibrain.dm +++ b/code/modules/mob/living/brain/posibrain.dm @@ -1,5 +1,3 @@ -var/global/posibrain_notif_cooldown = 0 - /obj/item/device/mmi/posibrain name = "positronic brain" desc = "A cube of shining metal, four inches to a side and covered in shallow grooves." @@ -11,7 +9,7 @@ var/global/posibrain_notif_cooldown = 0 var/askDelay = 600 //one minute var/used = 0 //Prevents split personality virus. May be reset if personality deletion code is added. brainmob = null - req_access = list(access_robotics) + req_access = list(GLOB.access_robotics) mecha = null//This does not appear to be used outside of reference in mecha.dm. braintype = "Android" var/autoping = TRUE //if it pings on creation immediately @@ -27,6 +25,7 @@ var/global/posibrain_notif_cooldown = 0 var/dead_message = "It appears to be completely inactive. The reset light is blinking." var/list/fluff_names var/picked_fluff_name //which fluff name we picked + var/static/posibrain_notif_cooldown = FALSE /obj/item/device/mmi/posibrain/Topic(href, href_list) @@ -39,11 +38,11 @@ var/global/posibrain_notif_cooldown = 0 if(newlymade || !posibrain_notif_cooldown) notify_ghosts("[name] [msg] in [get_area(src)]!", ghost_sound = !newlymade ? 'sound/effects/ghost2.ogg':null, enter_link = "(Click to enter)", source = src, action = NOTIFY_ATTACK, flashwindow = FALSE) if(!newlymade) - posibrain_notif_cooldown = 1 + posibrain_notif_cooldown = TRUE addtimer(CALLBACK(src, .proc/reset_posibrain_cooldown), askDelay) /obj/item/device/mmi/posibrain/proc/reset_posibrain_cooldown() - posibrain_notif_cooldown = 0 + posibrain_notif_cooldown = FALSE /obj/item/device/mmi/posibrain/attack_self(mob/user) if(brainmob && !brainmob.key && !notified) @@ -109,8 +108,8 @@ var/global/posibrain_notif_cooldown = 0 to_chat(brainmob, welcome_message) brainmob.mind.assigned_role = new_role brainmob.stat = CONSCIOUS - dead_mob_list -= brainmob - living_mob_list += brainmob + GLOB.dead_mob_list -= brainmob + GLOB.living_mob_list += brainmob visible_message(new_mob_message) update_icon() @@ -136,7 +135,7 @@ var/global/posibrain_notif_cooldown = 0 /obj/item/device/mmi/posibrain/New() brainmob = new(src) if(!fluff_names || !fluff_names.len) - picked_fluff_name = pick(posibrain_names) + picked_fluff_name = pick(GLOB.posibrain_names) else picked_fluff_name = pick(fluff_names) brainmob.name = "[picked_fluff_name]-[rand(100, 999)]" diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 43a909df807af..292aeb547511b 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -109,7 +109,7 @@ Des: Gives the client of the alien an image on each infected mob. ----------------------------------------*/ /mob/living/carbon/alien/proc/AddInfectionImages() if (client) - for (var/mob/living/C in mob_list) + for (var/mob/living/C in GLOB.mob_list) if(C.status_flags & XENO_HOST) var/obj/item/organ/body_egg/alien_embryo/A = C.getorgan(/obj/item/organ/body_egg/alien_embryo) if(A) diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 2ae25c71ee981..6cfd8473dd708 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -87,7 +87,7 @@ Doesn't work on other aliens/AI.*/ log_say("AlienWhisper: [key_name(user)]->[M.key] : [msg]") to_chat(M, "You hear a strange, alien voice in your head...[msg]") to_chat(user, "You said: \"[msg]\" to [M]") - for(var/ded in dead_mob_list) + for(var/ded in GLOB.dead_mob_list) if(!isobserver(ded)) continue var/follow_link_user = FOLLOW_LINK(ded, user) diff --git a/code/modules/mob/living/carbon/alien/humanoid/death.dm b/code/modules/mob/living/carbon/alien/humanoid/death.dm index 27304e5f0cd4d..1ccfcad572d52 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/death.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/death.dm @@ -13,7 +13,7 @@ if(stat == DEAD) return - for(var/mob/living/carbon/C in living_mob_list) + for(var/mob/living/carbon/C in GLOB.living_mob_list) if(C == src) //Make sure not to proc it on ourselves. continue var/obj/item/organ/alien/hivenode/node = C.getorgan(/obj/item/organ/alien/hivenode) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 6393ad49695cb..be2852f64b132 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -108,7 +108,7 @@ //For alien evolution/promotion/queen finder procs. Checks for an active alien of that type /proc/get_alien_type(var/alienpath) - for(var/mob/living/carbon/alien/humanoid/A in living_mob_list) + for(var/mob/living/carbon/alien/humanoid/A in GLOB.living_mob_list) if(!istype(A, alienpath)) continue if(!A.key || A.stat == DEAD) //Only living aliens with a ckey are valid. diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 2ce6ea31926d4..20d40e324cddb 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -46,7 +46,7 @@ /mob/living/carbon/alien/humanoid/royal/queen/Initialize() //there should only be one queen - for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in living_mob_list) + for(var/mob/living/carbon/alien/humanoid/royal/queen/Q in GLOB.living_mob_list) if(Q == src) continue if(Q.stat == DEAD) diff --git a/code/modules/mob/living/carbon/alien/say.dm b/code/modules/mob/living/carbon/alien/say.dm index 38e55b3530892..a42ad17307fd8 100644 --- a/code/modules/mob/living/carbon/alien/say.dm +++ b/code/modules/mob/living/carbon/alien/say.dm @@ -5,10 +5,10 @@ var/message_a = say_quote(message, get_spans()) var/rendered = "Hivemind, [shown_name] [message_a]" - for(var/mob/S in player_list) + for(var/mob/S in GLOB.player_list) if(!S.stat && S.hivecheck()) to_chat(S, rendered) - if(S in dead_mob_list) + if(S in GLOB.dead_mob_list) var/link = FOLLOW_LINK(S, src) to_chat(S, "[link] [rendered]") diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm index cea0a9b26bd5d..63f79d2eb8c71 100644 --- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm +++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm @@ -117,7 +117,7 @@ Proc: AddInfectionImages(C) Des: Adds the infection image to all aliens for this embryo ----------------------------------------*/ /obj/item/organ/body_egg/alien_embryo/AddInfectionImages() - for(var/mob/living/carbon/alien/alien in player_list) + for(var/mob/living/carbon/alien/alien in GLOB.player_list) if(alien.client) var/I = image('icons/mob/alien.dmi', loc = owner, icon_state = "infected[stage]") alien.client.images += I @@ -127,7 +127,7 @@ Proc: RemoveInfectionImage(C) Des: Removes all images from the mob infected by this embryo ----------------------------------------*/ /obj/item/organ/body_egg/alien_embryo/RemoveInfectionImages() - for(var/mob/living/carbon/alien/alien in player_list) + for(var/mob/living/carbon/alien/alien in GLOB.player_list) if(alien.client) for(var/image/I in alien.client.images) if(dd_hasprefix_case(I.icon_state, "infected") && I.loc == owner) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index f21aff65d1095..c6d7a103f2628 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -556,7 +556,7 @@ //to recalculate and update the mob's total tint from tinted equipment it's wearing. /mob/living/carbon/proc/update_tint() - if(!tinted_weldhelh) + if(!GLOB.tinted_weldhelh) return tinttotal = get_total_tint() if(tinttotal >= TINT_BLIND) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index fb01950fa5e20..5a1803da4d404 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -44,4 +44,7 @@ /obj/item/bodypart/r_arm, /obj/item/bodypart/r_leg, /obj/item/bodypart/l_leg) //Gets filled up in create_bodyparts() - var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems) \ No newline at end of file + var/list/hand_bodyparts = list() //a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems) + + var/icon_render_key = "" + var/static/list/limb_icon_cache = list() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index 703b2840d0d3f..5b1f43d58cf5f 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -19,12 +19,6 @@ if(legcuffed) . += legcuffed.slowdown - -var/const/NO_SLIP_WHEN_WALKING = 1 -var/const/SLIDE = 2 -var/const/GALOSHES_DONT_HELP = 4 -var/const/SLIDE_ICE = 8 - /mob/living/carbon/slip(s_amount, w_amount, obj/O, lube) if(movement_type & FLYING) return 0 diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 23010aac482d2..59c04c9841fa1 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -35,7 +35,7 @@ if(org_zone == "chest") O.Remove(src) O.forceMove(get_turf(src)) - O.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) else for(var/X in internal_organs) var/obj/item/organ/I = X @@ -44,11 +44,11 @@ continue I.Remove(src) I.forceMove(get_turf(src)) - I.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) + I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) /mob/living/carbon/spread_bodyparts() for(var/X in bodyparts) var/obj/item/bodypart/BP = X BP.drop_limb() - BP.throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),5) \ No newline at end of file + BP.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 25ec62df45721..b3a791528df08 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -142,7 +142,7 @@ if(!key) var/foundghost = 0 if(mind) - for(var/mob/dead/observer/G in player_list) + for(var/mob/dead/observer/G in GLOB.player_list) if(G.mind == mind) foundghost = 1 if (G.can_reenter_corpse == 0) @@ -289,7 +289,7 @@ if(istype(H.glasses, /obj/item/clothing/glasses/hud) || CIH) var/perpname = get_face_name(get_id_name("")) if(perpname) - var/datum/data/record/R = find_record("name", perpname, data_core.general) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.general) if(R) msg += "Rank: [R.fields["rank"]]
    " msg += "\[Front photo\] " @@ -307,7 +307,7 @@ msg += "\[[health_r]\]" health_r = R.fields["m_stat"] msg += "\[[health_r]\]
    " - R = find_record("name", perpname, data_core.medical) + R = find_record("name", perpname, GLOB.data_core.medical) if(R) msg += "\[Medical evaluation\]
    " @@ -317,7 +317,7 @@ //|| !user.canmove || user.restrained()) Fluff: Sechuds have eye-tracking technology and sets 'arrest' to people that the wearer looks and blinks at. var/criminal = "None" - R = find_record("name", perpname, data_core.security) + R = find_record("name", perpname, GLOB.data_core.security) if(R) criminal = R.fields["criminal"] diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 315629bd19827..f3df3bf532b42 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -302,7 +302,7 @@ var/mob/living/carbon/human/H = usr var/perpname = get_face_name(get_id_name("")) if(istype(H.glasses, /obj/item/clothing/glasses/hud) || istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud)) - var/datum/data/record/R = find_record("name", perpname, data_core.general) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.general) if(href_list["photo_front"] || href_list["photo_side"]) if(R) if(!H.canUseHUD()) @@ -392,7 +392,7 @@ if (!G.emagged) if(H.wear_id) var/list/access = H.wear_id.GetAccess() - if(access_sec_doors in access) + if(GLOB.access_sec_doors in access) allowed_access = H.get_authentification_name() else allowed_access = "@%&ERROR_%$*" @@ -403,7 +403,7 @@ return if(perpname) - R = find_record("name", perpname, data_core.security) + R = find_record("name", perpname, GLOB.data_core.security) if(R) if(href_list["status"]) var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Discharged", "Cancel") @@ -451,8 +451,8 @@ return else if(!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security)) return - var/crime = data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text()) - data_core.addMinorCrime(R.fields["id"], crime) + var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text()) + GLOB.data_core.addMinorCrime(R.fields["id"], crime) to_chat(usr, "Successfully added a minor crime.") return if("Major Crime") @@ -466,8 +466,8 @@ return else if (!istype(H.glasses, /obj/item/clothing/glasses/hud/security) && !istype(H.getorganslot("eye_hud"), /obj/item/organ/cyberimp/eyes/hud/security)) return - var/crime = data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text()) - data_core.addMajorCrime(R.fields["id"], crime) + var/crime = GLOB.data_core.createCrimeEntry(t1, t2, allowed_access, worldtime2text()) + GLOB.data_core.addMajorCrime(R.fields["id"], crime) to_chat(usr, "Successfully added a major crime.") return @@ -498,7 +498,7 @@ var/counter = 1 while(R.fields[text("com_[]", counter)]) counter++ - R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []
    []", allowed_access, worldtime2text(), time2text(world.realtime, "MMM DD"), year_integer+540, t1) + R.fields[text("com_[]", counter)] = text("Made by [] on [] [], []
    []", allowed_access, worldtime2text(), time2text(world.realtime, "MMM DD"), GLOB.year_integer+540, t1) to_chat(usr, "Successfully added comment.") return to_chat(usr, "Unable to locate a data core entry for this person.") @@ -585,7 +585,7 @@ //Check for weapons if(judgebot.weaponscheck) - if(!idcard || !(access_weapons in idcard.access)) + if(!idcard || !(GLOB.access_weapons in idcard.access)) for(var/obj/item/I in held_items) if(judgebot.check_for_weapons(I)) threatcount += 4 @@ -595,7 +595,7 @@ //Check for arrest warrant if(judgebot.check_records) var/perpname = get_face_name(get_id_name()) - var/datum/data/record/R = find_record("name", perpname, data_core.security) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) if(R && R.fields["criminal"]) switch(R.fields["criminal"]) if("*Arrest*") @@ -768,7 +768,7 @@ ..() /mob/living/carbon/human/replace_records_name(oldname,newname) // Only humans have records right now, move this up if changed. - for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked)) + for(var/list/L in list(GLOB.data_core.general,GLOB.data_core.medical,GLOB.data_core.security,GLOB.data_core.locked)) var/datum/data/record/R = find_record("name", oldname, L) if(R) R.fields["name"] = newname diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 1f9beb52bf7e0..dfebb8905e2fe 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -1,4 +1,3 @@ -var/global/default_martial_art = new/datum/martial_art /mob/living/carbon/human initial_languages = list(/datum/language/common) hud_possible = list(HEALTH_HUD,STATUS_HUD,ID_HUD,WANTED_HUD,IMPLOYAL_HUD,IMPCHEM_HUD,IMPTRACK_HUD,ANTAG_HUD) @@ -42,6 +41,7 @@ var/global/default_martial_art = new/datum/martial_art var/bleedsuppress = 0 //for stopping bloodloss, eventually this will be limb-based like bleeding var/datum/martial_art/martial_art = null + var/static/default_martial_art = new/datum/martial_art var/name_override //For temporary visible name changes @@ -49,4 +49,4 @@ var/global/default_martial_art = new/datum/martial_art var/datum/personal_crafting/handcrafting can_buckle = TRUE buckle_lying = FALSE - can_ride_typecache = list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot) + can_ride_typecache = list(/mob/living/carbon/human, /mob/living/simple_animal/slime, /mob/living/simple_animal/parrot) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/interactive.dm b/code/modules/mob/living/carbon/human/interactive.dm index 5e9c38562ae8e..559b792809322 100644 --- a/code/modules/mob/living/carbon/human/interactive.dm +++ b/code/modules/mob/living/carbon/human/interactive.dm @@ -198,7 +198,7 @@ T.doSetup() if(prob(25)) var/list/validchoices = list() - for(var/mob/living/carbon/human/M in mob_list) + for(var/mob/living/carbon/human/M in GLOB.mob_list) validchoices += M var/mob/living/carbon/human/chosen = pick(validchoices) var/datum/dna/toDoppel = chosen.dna @@ -223,7 +223,7 @@ if(shouldDoppel) if(shouldDoppel == "Yes") var/list/validchoices = list() - for(var/mob/living/carbon/human/M in mob_list) + for(var/mob/living/carbon/human/M in GLOB.mob_list) validchoices += M var/mob/living/carbon/human/chosen = input("Which crewmember?") as null|anything in validchoices @@ -348,14 +348,14 @@ switch(traitorType) if(SNPC_BRUTE) // SMASH KILL RAAARGH - traitorTarget = pick(mob_list) + traitorTarget = pick(GLOB.mob_list) if(SNPC_STEALTH) // Shhh we is sneekies var/A = pick(typesof(/datum/objective_item/steal) - /datum/objective_item/steal) var/datum/objective_item/steal/S = new A traitorTarget = locate(S.targetitem) in world if(SNPC_MARTYR) // MY LIFE FOR SPESZUL var/targetType = pick(/obj/machinery/gravity_generator/main/station,/obj/machinery/power/smes/engineering,/obj/machinery/telecomms/hub) - traitorTarget = locate(targetType) in machines + traitorTarget = locate(targetType) in GLOB.machines if(SNPC_PSYCHO) // YOU'RE LIKE A FLESH BICYLE AND I WANT TO DISMANTLE YOU traitorTarget = null @@ -545,7 +545,7 @@ //VIEW FUNCTIONS //doorscan is now integrated into life and runs before all other procs - for(var/dir in alldirs) + for(var/dir in GLOB.alldirs) var/turf/T = get_step(src,dir) if(T) for(var/obj/machinery/door/D in T.contents) @@ -1107,7 +1107,7 @@ for(var/mob/living/carbon/human/C in nearby) var/perpname = C.get_face_name(C.get_id_name()) - var/datum/data/record/R = find_record("name", perpname, data_core.security) + var/datum/data/record/R = find_record("name", perpname, GLOB.data_core.security) if(R && R.fields["criminal"]) switch(R.fields["criminal"]) if("*Arrest*") diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 4d5d1c26eb5bc..28978d230c6c8 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -91,7 +91,7 @@ ears.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE - if(message_mode in radiochannels) + if(message_mode in GLOB.radiochannels) if(ears) ears.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 72f9c0928b957..6cd9e2e7f3b74 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -87,21 +87,21 @@ var/randname if(gender == MALE) - randname = pick(first_names_male) + randname = pick(GLOB.first_names_male) else - randname = pick(first_names_female) + randname = pick(GLOB.first_names_female) if(lastname) randname += " [lastname]" else - randname += " [pick(last_names)]" + randname += " [pick(GLOB.last_names)]" return randname //Please override this locally if you want to define when what species qualifies for what rank if human authority is enforced. /datum/species/proc/qualifies_for_rank(rank, list/features) - if(rank in command_positions) + if(rank in GLOB.command_positions) return 0 return 1 @@ -197,7 +197,7 @@ facialhair_hidden = TRUE if(H.facial_hair_style && (FACEHAIR in species_traits) && (!facialhair_hidden || dynamic_fhair_suffix)) - S = facial_hair_styles_list[H.facial_hair_style] + S = GLOB.facial_hair_styles_list[H.facial_hair_style] if(S) //List of all valid dynamic_fhair_suffixes @@ -254,7 +254,7 @@ standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained", "layer" = -HAIR_LAYER) else if(H.hair_style && (HAIR in species_traits)) - S = hair_styles_list[H.hair_style] + S = GLOB.hair_styles_list[H.hair_style] if(S) //List of all valid dynamic_hair_suffixes @@ -326,12 +326,12 @@ //Underwear, Undershirts & Socks if(H.underwear) - var/datum/sprite_accessory/underwear/underwear = underwear_list[H.underwear] + var/datum/sprite_accessory/underwear/underwear = GLOB.underwear_list[H.underwear] if(underwear) standing += image("icon"=underwear.icon, "icon_state"="[underwear.icon_state]", "layer"=-BODY_LAYER) if(H.undershirt) - var/datum/sprite_accessory/undershirt/undershirt = undershirt_list[H.undershirt] + var/datum/sprite_accessory/undershirt/undershirt = GLOB.undershirt_list[H.undershirt] if(undershirt) if(H.dna.species.sexes && H.gender == FEMALE) standing += wear_female_version("[undershirt.icon_state]", undershirt.icon, BODY_LAYER) @@ -339,7 +339,7 @@ standing += image("icon"=undershirt.icon, "icon_state"="[undershirt.icon_state]", "layer"=-BODY_LAYER) if(H.socks && H.get_num_legs() >= 2 && !(DIGITIGRADE in species_traits)) - var/datum/sprite_accessory/socks/socks = socks_list[H.socks] + var/datum/sprite_accessory/socks/socks = GLOB.socks_list[H.socks] if(socks) standing += image("icon"=socks.icon, "icon_state"="[socks.icon_state]", "layer"=-BODY_LAYER) @@ -458,33 +458,33 @@ var/datum/sprite_accessory/S switch(bodypart) if("tail_lizard") - S = tails_list_lizard[H.dna.features["tail_lizard"]] + S = GLOB.tails_list_lizard[H.dna.features["tail_lizard"]] if("waggingtail_lizard") - S.= animated_tails_list_lizard[H.dna.features["tail_lizard"]] + S.= GLOB.animated_tails_list_lizard[H.dna.features["tail_lizard"]] if("tail_human") - S = tails_list_human[H.dna.features["tail_human"]] + S = GLOB.tails_list_human[H.dna.features["tail_human"]] if("waggingtail_human") - S.= animated_tails_list_human[H.dna.features["tail_human"]] + S.= GLOB.animated_tails_list_human[H.dna.features["tail_human"]] if("spines") - S = spines_list[H.dna.features["spines"]] + S = GLOB.spines_list[H.dna.features["spines"]] if("waggingspines") - S.= animated_spines_list[H.dna.features["spines"]] + S.= GLOB.animated_spines_list[H.dna.features["spines"]] if("snout") - S = snouts_list[H.dna.features["snout"]] + S = GLOB.snouts_list[H.dna.features["snout"]] if("frills") - S = frills_list[H.dna.features["frills"]] + S = GLOB.frills_list[H.dna.features["frills"]] if("horns") - S = horns_list[H.dna.features["horns"]] + S = GLOB.horns_list[H.dna.features["horns"]] if("ears") - S = ears_list[H.dna.features["ears"]] + S = GLOB.ears_list[H.dna.features["ears"]] if("body_markings") - S = body_markings_list[H.dna.features["body_markings"]] + S = GLOB.body_markings_list[H.dna.features["body_markings"]] if("wings") - S = wings_list[H.dna.features["wings"]] + S = GLOB.wings_list[H.dna.features["wings"]] if("wingsopen") - S = wings_open_list[H.dna.features["wings"]] + S = GLOB.wings_open_list[H.dna.features["wings"]] if("legs") - S = legs_list[H.dna.features["legs"]] + S = GLOB.legs_list[H.dna.features["legs"]] if(!S || S.icon_state == "none") continue @@ -1050,9 +1050,9 @@ target.visible_message("[user] has weakened [target]!", \ "[user] has weakened [target]!") target.apply_effect(4, WEAKEN, armor_block) - target.forcesay(hit_appends) + target.forcesay(GLOB.hit_appends) else if(target.lying) - target.forcesay(hit_appends) + target.forcesay(GLOB.hit_appends) @@ -1085,7 +1085,7 @@ target.visible_message("[user] has pushed [target]!", "[user] has pushed [target]!", null, COMBAT_MESSAGE_RANGE) target.apply_effect(2, WEAKEN, target.run_armor_check(affecting, "melee", "Your armor prevents your fall!", "Your armor softens your fall!")) - target.forcesay(hit_appends) + target.forcesay(GLOB.hit_appends) add_logs(user, target, "disarmed", " pushing them to the ground") return @@ -1227,7 +1227,7 @@ H.update_inv_w_uniform() if(Iforce > 10 || Iforce >= 5 && prob(33)) - H.forcesay(hit_appends) //forcesay checks stat already. + H.forcesay(GLOB.hit_appends) //forcesay checks stat already. return TRUE /datum/species/proc/apply_damage(damage, damagetype = BRUTE, def_zone = null, blocked, mob/living/carbon/human/H) @@ -1331,7 +1331,7 @@ H.apply_damage(HEAT_DAMAGE_LEVEL_3*heatmod, BURN) else H.apply_damage(HEAT_DAMAGE_LEVEL_2*heatmod, BURN) - else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !(mutations_list[COLDRES] in H.dna.mutations)) + else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !(GLOB.mutations_list[COLDRES] in H.dna.mutations)) switch(H.bodytemperature) if(200 to 260) H.throw_alert("temp", /obj/screen/alert/cold, 1) diff --git a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm index 1fe33f1ce1dcc..ed05138502394 100644 --- a/code/modules/mob/living/carbon/human/species_types/golems.dm +++ b/code/modules/mob/living/carbon/human/species_types/golems.dm @@ -26,11 +26,11 @@ var/list/special_names /datum/species/golem/random_name(gender,unique,lastname) - var/golem_surname = pick(golem_names) + var/golem_surname = pick(GLOB.golem_names) // 3% chance that our golem has a human surname, because // cultural contamination if(prob(3)) - golem_surname = pick(last_names) + golem_surname = pick(GLOB.last_names) else if(special_names && prob(5)) golem_surname = pick(special_names) @@ -444,7 +444,7 @@ var/active = null /datum/species/golem/bananium/random_name(gender,unique,lastname) - var/clown_name = pick(clown_names) + var/clown_name = pick(GLOB.clown_names) var/golem_name = "[uppertext(clown_name)]" return golem_name diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm index 4dc34402dd3f7..0c1cf44e38857 100644 --- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm @@ -227,7 +227,7 @@ else ui_interact(owner) -/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = conscious_state) +/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.conscious_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm index bed4e3fb91bc3..025a256c04520 100644 --- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm +++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm @@ -1,5 +1,3 @@ -var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_state"="plasmaman") - /datum/species/plasmaman name = "Plasmaman" id = "plasmaman" @@ -52,7 +50,7 @@ var/global/image/plasmaman_on_fire = image("icon"='icons/mob/OnFire.dmi', "icon_ return 0 /datum/species/plasmaman/qualifies_for_rank(rank, list/features) - if(rank in security_positions) + if(rank in GLOB.security_positions) return 0 if(rank == "Clown" || rank == "Mime")//No funny bussiness return 0 diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 4382f88e1f689..e7d78bf8ff1c7 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -385,10 +385,10 @@ There are several things that need to be remembered: /proc/wear_female_version(t_color, icon, layer, type) var/index = t_color - var/icon/female_clothing_icon = female_clothing_icons[index] + var/icon/female_clothing_icon = GLOB.female_clothing_icons[index] if(!female_clothing_icon) //Create standing/laying icons if they don't exist generate_female_clothing(index,t_color,icon,type) - var/standing = image("icon"=female_clothing_icons["[t_color]"], "layer"=-layer) + var/standing = image("icon"=GLOB.female_clothing_icons["[t_color]"], "layer"=-layer) return(standing) /mob/living/carbon/human/proc/get_overlays_copy(list/unwantedLayers) diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index f392981ed4e18..fea481ac2f991 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -9,7 +9,7 @@ if(!language) language = get_default_language() - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return @@ -53,7 +53,7 @@ return var/list/listening_dead = list() - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.stat == DEAD && M.client && ((M.client.prefs.chat_toggles & CHAT_GHOSTWHISPER) || (get_dist(M, src) <= 7))) listening_dead |= M diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 5232eaa59f01e..f54d20bf0e45d 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -253,7 +253,7 @@ dna.previous.Remove("blood_type") dna.temporary_mutations.Remove(mut) continue - HM = mutations_list[mut] + HM = GLOB.mutations_list[mut] HM.force_lose(src) dna.temporary_mutations.Remove(mut) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 21a761c8fc11c..4508b686b6a47 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -16,7 +16,7 @@ if(stat == CONSCIOUS) if(!handle_combat()) if(prob(33) && canmove && isturf(loc) && !pulledby) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) if(prob(1)) emote(pick("scratch","jump","roll","tail")) else diff --git a/code/modules/mob/living/carbon/update_icons.dm b/code/modules/mob/living/carbon/update_icons.dm index 6247dc2d5e901..4e76b3da1e918 100644 --- a/code/modules/mob/living/carbon/update_icons.dm +++ b/code/modules/mob/living/carbon/update_icons.dm @@ -270,12 +270,6 @@ See RemieRichards on irc.rizon.net #coderbus */ -var/global/list/limb_icon_cache = list() - -/mob/living/carbon - var/icon_render_key = "" - - //produces a key based on the mob's limbs /mob/living/carbon/proc/generate_icon_render_key() diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm index d0d0aac615f1d..099cb03260a7b 100644 --- a/code/modules/mob/living/death.dm +++ b/code/modules/mob/living/death.dm @@ -55,9 +55,9 @@ deadchat_broadcast(rendered, follow_target = src, turf_target = T, message_type=DEADCHAT_DEATHRATTLE) if(mind) mind.store_memory("Time of death: [tod]", 0) - living_mob_list -= src + GLOB.living_mob_list -= src if(!gibbed) - dead_mob_list += src + GLOB.dead_mob_list += src paralysis = 0 stunned = 0 weakened = 0 diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index b0991f6180e3c..f43386181c36b 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -7,7 +7,8 @@ param = copytext(act, custom_param + 1, length(act) + 1) act = copytext(act, 1, custom_param) - var/datum/emote/E = emote_list[act] + var/datum/emote/E + E = E.emote_list[act] if(!E) to_chat(src, "Unusable emote '[act]'. Say *help for a list.") return @@ -425,10 +426,12 @@ var/list/keys = list() var/list/message = list("Available emotes, you can use them with say \"*emote\": ") + var/datum/emote/E + var/list/emote_list = E.emote_list for(var/e in emote_list) if(e in keys) continue - var/datum/emote/E = emote_list[e] + E = emote_list[e] if(E.can_run_emote(user, TRUE)) keys += E.key diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 1c3f9f378114a..02106dd0e9ab8 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -9,7 +9,7 @@ return if(!loc) if(client) - for(var/obj/effect/landmark/error/E in landmarks_list) + for(var/obj/effect/landmark/error/E in GLOB.landmarks_list) loc = E.loc break message_admins("[key_name_admin(src)] was found to have no .loc with an attached client, if the cause is unknown it would be wise to ask how this was accomplished.") @@ -67,7 +67,7 @@ if(!digitaldisguise) src.digitaldisguise = image(loc = src) src.digitaldisguise.override = 1 - for(var/mob/living/silicon/ai/AI in player_list) + for(var/mob/living/silicon/ai/AI in GLOB.player_list) AI.client.images |= src.digitaldisguise diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index ccd98d1498946..93de6c61c8aea 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -2,7 +2,7 @@ . = ..() generateStaticOverlay() if(staticOverlays.len) - for(var/mob/living/simple_animal/drone/D in player_list) + for(var/mob/living/simple_animal/drone/D in GLOB.player_list) if(D && D.seeStatic) if(D.staticChoice in staticOverlays) D.staticOverlays |= staticOverlays[D.staticChoice] @@ -13,7 +13,7 @@ if(unique_name) name = "[name] ([rand(1, 1000)])" real_name = name - var/datum/atom_hud/data/human/medical/advanced/medhud = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/data/human/medical/advanced/medhud = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medhud.add_to_hud(src) faction += "\ref[src]" @@ -35,7 +35,7 @@ buckled.unbuckle_mob(src,force=1) QDEL_NULL(riding_datum) - for(var/mob/living/simple_animal/drone/D in player_list) + for(var/mob/living/simple_animal/drone/D in GLOB.player_list) for(var/image/I in staticOverlays) D.staticOverlays.Remove(I) D.client.images.Remove(I) @@ -346,8 +346,8 @@ if(full_heal) fully_heal(admin_revive) if(stat == DEAD && can_be_revived()) //in some cases you can't revive (e.g. no brain) - dead_mob_list -= src - living_mob_list += src + GLOB.dead_mob_list -= src + GLOB.living_mob_list += src suiciding = 0 stat = UNCONSCIOUS //the mob starts unconscious, blind_eyes(1) @@ -484,7 +484,7 @@ newdir = NORTH else if(newdir == 12) //E + W newdir = EAST - if((newdir in cardinal) && (prob(50))) + if((newdir in GLOB.cardinal) && (prob(50))) newdir = turn(get_dir(T, src.loc), 180) if(!blood_exists) new /obj/effect/decal/cleanable/trail_holder(src.loc) @@ -734,7 +734,7 @@ if(istype(SSticker.mode, /datum/game_mode/blob)) var/datum/game_mode/blob/B = SSticker.mode if(B.message_sent) - stat(null, "Blobs to Blob Win: [blobs_legit.len]/[B.blobwincount]") + stat(null, "Blobs to Blob Win: [GLOB.blobs_legit.len]/[B.blobwincount]") /mob/living/cancel_camera() ..() diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index c6ff1ca9a03a8..12c3ba1bc105d 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -1,4 +1,4 @@ -var/list/department_radio_keys = list( +GLOBAL_LIST_INIT(department_radio_keys, list( ":r" = "right hand", "#r" = "right hand", ".r" = "right hand", ":l" = "left hand", "#l" = "left hand", ".l" = "left hand", ":i" = "intercom", "#i" = "intercom", ".i" = "intercom", @@ -59,10 +59,7 @@ var/list/department_radio_keys = list( ":ô" = "alientalk", "#ô" = "alientalk", ".ô" = "alientalk", ":å" = "Syndicate", "#å" = "Syndicate", ".å" = "Syndicate", ":é" = "Supply", "#é" = "Supply", ".é" = "Supply", - ":ï" = "changeling", "#ï" = "changeling", ".ï" = "changeling" -) - -var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) + ":ï" = "changeling", "#ï" = "changeling", ".ï" = "changeling")) /mob/living/say(message, bubble_type,var/list/spans = list(), sanitize = TRUE, datum/language/language = null) if(sanitize) @@ -99,7 +96,8 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) if(!can_speak_basic(original_message)) //Stat is seperate so I can handle whispers properly. return - + + var/static/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) if(stat && !(message_mode in crit_allowed_modes)) return @@ -137,10 +135,10 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) spans += get_spans() if(language) - var/datum/language/L = language_datums[language] + var/datum/language/L = GLOB.language_datums[language] if(!istype(L)) L = new language - language_datums[language] = L + GLOB.language_datums[language] = L spans |= L.spans @@ -191,7 +189,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) /mob/living/send_speech(message, message_range = 7, obj/source = src, bubble_type = bubble_icon, list/spans, datum/language/message_language=null) var/list/listening = get_hearers_in_view(message_range, source) - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.stat == DEAD && M.client && ((M.client.prefs.chat_toggles & CHAT_GHOSTEARS) || (get_dist(M, src) <= 7 && M.z == z)) && client) // client is so that ghosts don't have to listen to mice listening |= M @@ -246,7 +244,7 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) if(copytext(message, 1, 2) == ";") return MODE_HEADSET else if(length(message) > 2) - return department_radio_keys[copytext(message, 1, 3)] + return GLOB.department_radio_keys[copytext(message, 1, 3)] /mob/living/proc/get_message_language(message) var/static/list/langlist @@ -266,8 +264,8 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) switch(lingcheck()) if(3) var/msg = "[src.mind]: [message]" - for(var/mob/M in mob_list) - if(M in dead_mob_list) + for(var/mob/M in GLOB.mob_list) + if(M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [msg]") else @@ -282,8 +280,8 @@ var/list/crit_allowed_modes = list(MODE_WHISPER,MODE_CHANGELING,MODE_ALIEN) if(2) var/msg = "[mind.changeling.changelingID]: [message]" log_say("[mind.changeling.changelingID]/[src.key] : [message]") - for(var/mob/M in mob_list) - if(M in dead_mob_list) + for(var/mob/M in GLOB.mob_list) + if(M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [msg]") else diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index c753b0cd9fffe..02d2ac70d0110 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1,11 +1,10 @@ #define CALL_BOT_COOLDOWN 900 -var/list/ai_list = list() //Not sure why this is necessary... /proc/AutoUpdateAI(obj/subject) var/is_in_use = 0 if (subject!=null) - for(var/A in ai_list) + for(var/A in GLOB.ai_list) var/mob/living/silicon/ai/M = A if ((M.client && M.machine == subject)) is_in_use = 1 @@ -149,16 +148,16 @@ var/list/ai_list = list() /mob/living/silicon/ai/proc/toggle_camera_light, /mob/living/silicon/ai/proc/botcall,\ /mob/living/silicon/ai/proc/control_integrated_radio, /mob/living/silicon/ai/proc/set_automatic_say_channel) - ai_list += src - shuttle_caller_list += src + GLOB.ai_list += src + GLOB.shuttle_caller_list += src builtInCamera = new /obj/machinery/camera/portable(src) builtInCamera.network = list("SS13") /mob/living/silicon/ai/Destroy() - ai_list -= src - shuttle_caller_list -= src + GLOB.ai_list -= src + GLOB.shuttle_caller_list -= src SSshuttle.autoEvac() qdel(eyeobj) // No AI, no Eye malfhack = null @@ -261,7 +260,7 @@ var/list/ai_list = list() //Name, Health, Battery, Module, Area, and Status! Everything an AI wants to know about its borgies! stat(null, text("[R.name] | S.Integrity: [R.health]% | Cell: [R.cell ? "[R.cell.charge]/[R.cell.maxcharge]" : "Empty"] | \ Module: [R.designation] | Loc: [borg_area.name] | Status: [robot_status]")) - stat(null, text("AI shell beacons detected: [LAZYLEN(available_ai_shells)]")) //Count of total AI shells + stat(null, text("AI shell beacons detected: [LAZYLEN(GLOB.available_ai_shells)]")) //Count of total AI shells else stat(null, text("Systems nonfunctional")) @@ -301,7 +300,7 @@ var/list/ai_list = list() /mob/living/silicon/ai/proc/ai_roster() var/dat = "Crew RosterCrew Roster:

    " - dat += data_core.get_manifest() + dat += GLOB.data_core.get_manifest() dat += "" src << browse(dat, "window=airoster") @@ -323,7 +322,7 @@ var/list/ai_list = list() // hack to display shuttle timer if(!EMERGENCY_IDLE_OR_RECALLED) - var/obj/machinery/computer/communications/C = locate() in machines + var/obj/machinery/computer/communications/C = locate() in GLOB.machines if(C) C.post_status("shuttle") @@ -371,7 +370,7 @@ var/list/ai_list = list() unset_machine() src << browse(null, t1) if (href_list["switchcamera"]) - switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras + switchCamera(locate(href_list["switchcamera"])) in GLOB.cameranet.cameras if (href_list["showalerts"]) ai_alerts() #ifdef AI_VOX @@ -411,14 +410,14 @@ var/list/ai_list = list() if(call_bot_cooldown > world.time) to_chat(src, "Error: Your last call bot command is still processing, please wait for the bot to finish calculating a route.") return - Bot = locate(href_list["callbot"]) in living_mob_list + Bot = locate(href_list["callbot"]) in GLOB.living_mob_list if(!Bot || Bot.remote_disabled || src.control_disabled) return //True if there is no bot found, the bot is manually emagged, or the AI is carded with wireless off. waypoint_mode = 1 to_chat(src, "Set your waypoint by clicking on a valid location free of obstructions.") return if(href_list["interface"]) //Remotely connect to a bot! - Bot = locate(href_list["interface"]) in living_mob_list + Bot = locate(href_list["interface"]) in GLOB.living_mob_list if(!Bot || Bot.remote_disabled || src.control_disabled) return Bot.attack_ai(src) @@ -431,7 +430,7 @@ var/list/ai_list = list() if(controlled_mech) to_chat(src, "You are already loaded into an onboard computer!") return - if(!cameranet.checkCameraVis(M)) + if(!GLOB.cameranet.checkCameraVis(M)) to_chat(src, "Exosuit is no longer near active cameras.") return if(lacks_power()) @@ -478,7 +477,7 @@ var/list/ai_list = list() d += "Query network status
    " d += "
    " - for (Bot in living_mob_list) + for (Bot in GLOB.living_mob_list) if(Bot.z == ai_Zlevel && !Bot.remote_disabled) //Only non-emagged bots on the same Z-level are detected! bot_area = get_area(Bot) var/bot_mode = Bot.get_mode() @@ -500,7 +499,7 @@ var/list/ai_list = list() //The target must be in view of a camera or near the core. if(turf_check in range(get_turf(src))) call_bot(turf_check) - else if(cameranet && cameranet.checkTurfVis(turf_check)) + else if(GLOB.cameranet && GLOB.cameranet.checkTurfVis(turf_check)) call_bot(turf_check) else to_chat(src, "Selected location is not visible.") @@ -590,7 +589,7 @@ var/list/ai_list = list() var/mob/living/silicon/ai/U = usr - for (var/obj/machinery/camera/C in cameranet.cameras) + for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue @@ -609,7 +608,7 @@ var/list/ai_list = list() if(isnull(network)) network = old_network // If nothing is selected else - for(var/obj/machinery/camera/C in cameranet.cameras) + for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue if(network in C.network) @@ -633,7 +632,7 @@ var/list/ai_list = list() return //won't work if dead var/list/ai_emotions = list("Very Happy", "Happy", "Neutral", "Unsure", "Confused", "Sad", "BSOD", "Blank", "Problems?", "Awesome", "Facepalm", "Friend Computer", "Dorfy", "Blue Glow", "Red Glow") var/emote = input("Please, select a status!", "AI Status", null, null) in ai_emotions - for (var/obj/machinery/M in machines) //change status + for (var/obj/machinery/M in GLOB.machines) //change status if(istype(M, /obj/machinery/ai_status_display)) var/obj/machinery/ai_status_display/AISD = M AISD.emotion = emote @@ -660,7 +659,7 @@ var/list/ai_list = list() if("Crew Member") var/list/personnel_list = list() - for(var/datum/data/record/t in data_core.locked)//Look in data core locked. + for(var/datum/data/record/t in GLOB.data_core.locked)//Look in data core locked. personnel_list["[t.fields["name"]]: [t.fields["rank"]]"] = t.fields["image"]//Pull names, rank, and image. if(personnel_list.len) @@ -827,7 +826,7 @@ var/list/ai_list = list() //stop AIs from leaving windows open and using then after they lose vision //apc_override is needed here because AIs use their own APC when powerless //get_turf_pixel() is because APCs in maint aren't actually in view of the inner camera - if(M && cameranet && !cameranet.checkTurfVis(get_turf_pixel(M)) && !apc_override) + if(M && GLOB.cameranet && !GLOB.cameranet.checkTurfVis(get_turf_pixel(M)) && !apc_override) return return 1 @@ -926,7 +925,7 @@ var/list/ai_list = list() var/list/possible = list() - for(var/borgie in available_ai_shells) + for(var/borgie in GLOB.available_ai_shells) var/mob/living/silicon/robot/R = borgie if(R.shell && !R.deployed && (R.stat != DEAD) && (!R.connected_ai ||(R.connected_ai == src))) possible += R diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index b969249b2558e..d9b157b024a82 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -16,7 +16,7 @@ if(eyeobj) eyeobj.setLoc(get_turf(src)) - shuttle_caller_list -= src + GLOB.shuttle_caller_list -= src SSshuttle.autoEvac() ShutOffDoomsdayDevice() @@ -35,7 +35,7 @@ if(nuking) set_security_level("red") nuking = FALSE - for(var/obj/item/weapon/pinpointer/P in pinpointer_list) + for(var/obj/item/weapon/pinpointer/P in GLOB.pinpointer_list) P.switch_mode_to(TRACK_NUKE_DISK) //Party's over, back to work, everyone P.nuke_warning = FALSE diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index 626d883ff0a96..34d53ed2676ae 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -2,9 +2,9 @@ // // The datum containing all the chunks. -var/const/CHUNK_SIZE = 16 // Only chunk sizes that are to the power of 2. E.g: 2, 4, 8, 16, etc.. +#define CHUNK_SIZE 16 // Only chunk sizes that are to the power of 2. E.g: 2, 4, 8, 16, etc.. -var/datum/cameranet/cameranet = new() +GLOBAL_DATUM_INIT(cameranet, /datum/cameranet, new) /datum/cameranet var/name = "Camera Net" // Name to show for VV and stat() @@ -151,7 +151,7 @@ var/datum/cameranet/cameranet = new() if(!statclick) statclick = new/obj/effect/statclick/debug(null, "Initializing...", src) - stat(name, statclick.update("Cameras: [cameranet.cameras.len] | Chunks: [cameranet.chunks.len]")) + stat(name, statclick.update("Cameras: [GLOB.cameranet.cameras.len] | Chunks: [GLOB.cameranet.chunks.len]")) // Debug verb for VVing the chunk that the turf is in. /* diff --git a/code/modules/mob/living/silicon/ai/freelook/chunk.dm b/code/modules/mob/living/silicon/ai/freelook/chunk.dm index 258fe7a15188c..fde7cc6c084fc 100644 --- a/code/modules/mob/living/silicon/ai/freelook/chunk.dm +++ b/code/modules/mob/living/silicon/ai/freelook/chunk.dm @@ -173,4 +173,5 @@ t.obscured.plane = LIGHTING_PLANE+1 obscured += t.obscured -#undef UPDATE_BUFFER \ No newline at end of file +#undef UPDATE_BUFFER +#undef CHUNK_SIZE \ No newline at end of file diff --git a/code/modules/mob/living/silicon/ai/freelook/eye.dm b/code/modules/mob/living/silicon/ai/freelook/eye.dm index 75d87d7323100..62c375a589e2a 100644 --- a/code/modules/mob/living/silicon/ai/freelook/eye.dm +++ b/code/modules/mob/living/silicon/ai/freelook/eye.dm @@ -21,7 +21,7 @@ return T = get_turf(T) loc = T - cameranet.visibility(src) + GLOB.cameranet.visibility(src) if(ai.client) ai.client.eye = src update_parallax_contents() diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index 329b3120cba0e..26dca0e327d26 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -147,7 +147,7 @@ to_chat(src, "Receiving control information from APC.") sleep(2) apc_override = 1 - theAPC.ui_interact(src, state = conscious_state) + theAPC.ui_interact(src, state = GLOB.conscious_state) apc_override = 0 aiRestorePowerRoutine = POWER_RESTORATION_APC_FOUND sleep(50) diff --git a/code/modules/mob/living/silicon/ai/login.dm b/code/modules/mob/living/silicon/ai/login.dm index 21f12ab915d78..5fd5965f401b9 100644 --- a/code/modules/mob/living/silicon/ai/login.dm +++ b/code/modules/mob/living/silicon/ai/login.dm @@ -6,7 +6,7 @@ client.images += blood if(stat != DEAD) - for(var/obj/machinery/ai_status_display/O in machines) //change status + for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status O.mode = 1 O.emotion = "Neutral" view_core() diff --git a/code/modules/mob/living/silicon/ai/say.dm b/code/modules/mob/living/silicon/ai/say.dm index 39daec4105574..bc51735190cbc 100644 --- a/code/modules/mob/living/silicon/ai/say.dm +++ b/code/modules/mob/living/silicon/ai/say.dm @@ -57,10 +57,7 @@ // Make sure that the code compiles with AI_VOX undefined #ifdef AI_VOX - -var/announcing_vox = 0 // Stores the time of the last announcement -var/const/VOX_DELAY = 600 - +#define VOX_DELAY 600 /mob/living/silicon/ai/verb/announcement_help() set name = "Announcement Help" @@ -77,10 +74,10 @@ var/const/VOX_DELAY = 600 WARNING:
    Misuse of the announcement system will get you job banned.
    " var/index = 0 - for(var/word in vox_sounds) + for(var/word in GLOB.vox_sounds) index++ dat += "[capitalize(word)]" - if(index != vox_sounds.len) + if(index != GLOB.vox_sounds.len) dat += " / " var/datum/browser/popup = new(src, "announce_help", "Announcement Help", 500, 400) @@ -89,6 +86,7 @@ var/const/VOX_DELAY = 600 /mob/living/silicon/ai/proc/announcement() + var/static/announcing_vox = 0 // Stores the time of the last announcement if(announcing_vox > world.time) to_chat(src, "Please wait [round((announcing_vox - world.time) / 10)] seconds.") return @@ -118,7 +116,7 @@ var/const/VOX_DELAY = 600 if(!word) words -= word continue - if(!vox_sounds[word]) + if(!GLOB.vox_sounds[word]) incorrect_words += word if(incorrect_words.len) @@ -145,16 +143,16 @@ var/const/VOX_DELAY = 600 word = lowertext(word) - if(vox_sounds[word]) + if(GLOB.vox_sounds[word]) - var/sound_file = vox_sounds[word] + var/sound_file = GLOB.vox_sounds[word] var/sound/voice = sound(sound_file, wait = 1, channel = CHANNEL_VOX) voice.status = SOUND_STREAM // If there is no single listener, broadcast to everyone in the same z level if(!only_listener) // Play voice for all mobs in the z level - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.client && !M.ear_deaf && (M.client.prefs.toggles & SOUND_ANNOUNCEMENTS)) var/turf/T = get_turf(M) if(T.z == z_level) diff --git a/code/modules/mob/living/silicon/ai/vox_sounds.dm b/code/modules/mob/living/silicon/ai/vox_sounds.dm index 317e887e90ad9..04e4a201cc2e6 100644 --- a/code/modules/mob/living/silicon/ai/vox_sounds.dm +++ b/code/modules/mob/living/silicon/ai/vox_sounds.dm @@ -2,7 +2,7 @@ // Dynamically loading it has bad results with sounds overtaking each other, even with the wait variable. #ifdef AI_VOX -var/list/vox_sounds = list("," = 'sound/vox_fem/,.ogg', +GLOBAL_LIST_INIT(vox_sounds, list("," = 'sound/vox_fem/,.ogg', "." = 'sound/vox_fem/..ogg', "a" = 'sound/vox_fem/a.ogg', "abortions" = 'sound/vox_fem/abortions.ogg', @@ -713,6 +713,5 @@ var/list/vox_sounds = list("," = 'sound/vox_fem/,.ogg', "z" = 'sound/vox_fem/z.ogg', "zero" = 'sound/vox_fem/zero.ogg', "zone" = 'sound/vox_fem/zone.ogg', -"zulu" = 'sound/vox_fem/zulu.ogg', -) +"zulu" = 'sound/vox_fem/zulu.ogg')) #endif \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm index 8d2d059a0ba64..ec0fdfed64996 100644 --- a/code/modules/mob/living/silicon/pai/death.dm +++ b/code/modules/mob/living/silicon/pai/death.dm @@ -10,6 +10,6 @@ clear_fullscreens() //New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here. - living_mob_list -= src + GLOB.living_mob_list -= src ghostize() qdel(src) \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index b02b51e9696eb..d42fce7405a2c 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -78,13 +78,13 @@ . += slowdown /mob/living/silicon/pai/Destroy() - pai_list -= src + GLOB.pai_list -= src ..() /mob/living/silicon/pai/Initialize() var/obj/item/device/paicard/P = loc START_PROCESSING(SSfastprocess, src) - pai_list += src + GLOB.pai_list += src make_laws() canmove = 0 if(!istype(P)) //when manually spawning a pai, we create a card to put it into. diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm index 2d8e36e7a616e..bce5dacef473d 100644 --- a/code/modules/mob/living/silicon/pai/software.dm +++ b/code/modules/mob/living/silicon/pai/software.dm @@ -33,7 +33,7 @@ if(temp) left_part = temp else if(src.stat == 2) // Show some flavor text if the pAI is dead - left_part = "ÈRrÖR Ða†Ä ÇÖRrÚþ†Ìoñ" + left_part = "�Rr�R �a�� ��Rr����o�" right_part = "
    Program index hash not found
    " else @@ -220,18 +220,18 @@ // Accessing medical records if("medicalrecord") if(subscreen == 1) - medicalActive1 = find_record("id", href_list["med_rec"], data_core.general) + medicalActive1 = find_record("id", href_list["med_rec"], GLOB.data_core.general) if(medicalActive1) - medicalActive2 = find_record("id", href_list["med_rec"], data_core.medical) + medicalActive2 = find_record("id", href_list["med_rec"], GLOB.data_core.medical) if(!medicalActive2) medicalActive1 = null temp = "Unable to locate requested security record. Record may have been deleted, or never have existed." if("securityrecord") if(subscreen == 1) - securityActive1 = find_record("id", href_list["sec_rec"], data_core.general) + securityActive1 = find_record("id", href_list["sec_rec"], GLOB.data_core.general) if(securityActive1) - securityActive2 = find_record("id", href_list["sec_rec"], data_core.security) + securityActive2 = find_record("id", href_list["sec_rec"], GLOB.data_core.security) if(!securityActive2) securityActive1 = null temp = "Unable to locate requested security record. Record may have been deleted, or never have existed." @@ -241,7 +241,7 @@ if(secHUD) add_sec_hud() else - var/datum/atom_hud/sec = huds[sec_hud] + var/datum/atom_hud/sec = GLOB.huds[sec_hud] sec.remove_hud_from(src) if("medicalhud") if(href_list["toggle"]) @@ -249,7 +249,7 @@ if(medHUD) add_med_hud() else - var/datum/atom_hud/med = huds[med_hud] + var/datum/atom_hud/med = GLOB.huds[med_hud] med.remove_hud_from(src) if("translator") if(href_list["toggle"]) @@ -414,8 +414,8 @@ // Crew Manifest /mob/living/silicon/pai/proc/softwareManifest() . += "

    Crew Manifest



    " - if(data_core.general) - for(var/datum/data/record/t in sortRecord(data_core.general)) + if(GLOB.data_core.general) + for(var/datum/data/record/t in sortRecord(GLOB.data_core.general)) . += "[t.fields["name"]] - [t.fields["rank"]]
    " . += "" return . @@ -425,16 +425,16 @@ switch(subscreen) if(0) . += "

    Medical Records


    " - if(data_core.general) - for(var/datum/data/record/R in sortRecord(data_core.general)) + if(GLOB.data_core.general) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) . += "[R.fields["id"]]: [R.fields["name"]]
    " if(1) . += "
    Medical Record

    " - if(medicalActive1 in data_core.general) + if(medicalActive1 in GLOB.data_core.general) . += "Name: [medicalActive1.fields["name"]] ID: [medicalActive1.fields["id"]]
    \nSex: [medicalActive1.fields["sex"]]
    \nAge: [medicalActive1.fields["age"]]
    \nFingerprint: [medicalActive1.fields["fingerprint"]]
    \nPhysical Status: [medicalActive1.fields["p_stat"]]
    \nMental Status: [medicalActive1.fields["m_stat"]]
    " else . += "
    Requested medical record not found.

    " - if(medicalActive2 in data_core.medical) + if(medicalActive2 in GLOB.data_core.medical) . += "
    \n
    Medical Data

    \nBlood Type:
    [medicalActive2.fields["blood_type"]]
    \nDNA: [medicalActive2.fields["b_dna"]]
    \n
    \nMinor Disabilities: [medicalActive2.fields["mi_dis"]]
    \nDetails: [medicalActive2.fields["mi_dis_d"]]
    \n
    \nMajor Disabilities: [medicalActive2.fields["ma_dis"]]
    \nDetails: [medicalActive2.fields["ma_dis_d"]]
    \n
    \nAllergies: [medicalActive2.fields["alg"]]
    \nDetails: [medicalActive2.fields["alg_d"]]
    \n
    \nCurrent Diseases: [medicalActive2.fields["cdi"]] (per disease info placed in log/comment section)
    \nDetails: [medicalActive2.fields["cdi_d"]]
    \n
    \nImportant Notes:
    \n\t[medicalActive2.fields["notes"]]
    \n
    \n
    Comments/Log

    " else . += "
    Requested medical record not found.

    " @@ -447,16 +447,16 @@ switch(subscreen) if(0) . += "

    Security Records


    " - if(data_core.general) - for(var/datum/data/record/R in sortRecord(data_core.general)) + if(GLOB.data_core.general) + for(var/datum/data/record/R in sortRecord(GLOB.data_core.general)) . += "[R.fields["id"]]: [R.fields["name"]]
    " if(1) . += "

    Security Record

    " - if(securityActive1 in data_core.general) + if(securityActive1 in GLOB.data_core.general) . += "Name:
    [securityActive1.fields["name"]] ID: [securityActive1.fields["id"]]
    \nSex: [securityActive1.fields["sex"]]
    \nAge: [securityActive1.fields["age"]]
    \nRank: [securityActive1.fields["rank"]]
    \nFingerprint: [securityActive1.fields["fingerprint"]]
    \nPhysical Status: [securityActive1.fields["p_stat"]]
    \nMental Status: [securityActive1.fields["m_stat"]]
    " else . += "
    Requested security record not found,

    " - if(securityActive2 in data_core.security) + if(securityActive2 in GLOB.data_core.security) . += "
    \nSecurity Data
    \nCriminal Status: [securityActive2.fields["criminal"]]
    \n
    \nMinor Crimes: [securityActive2.fields["mi_crim"]]
    \nDetails: [securityActive2.fields["mi_crim_d"]]
    \n
    \nMajor Crimes: [securityActive2.fields["ma_crim"]]
    \nDetails: [securityActive2.fields["ma_crim_d"]]
    \n
    \nImportant Notes:
    \n\t[securityActive2.fields["notes"]]
    \n
    \n
    Comments/Log

    " else . += "
    Requested security record not found,

    " @@ -599,7 +599,7 @@ // Door Jack - supporting proc /mob/living/silicon/pai/proc/hackloop() var/turf/T = get_turf(src.loc) - for(var/mob/living/silicon/ai/AI in player_list) + for(var/mob/living/silicon/ai/AI in GLOB.player_list) if(T.loc) to_chat(AI, "Network Alert: Brute-force encryption crack in progress in [T.loc].") else diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 06a981b9b2d21..f327f58df0ccb 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -51,7 +51,7 @@ var/ident = 0 var/locked = 1 - var/list/req_access = list(access_robotics) + var/list/req_access = list(GLOB.access_robotics) var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list(), "Camera"=list(), "Burglar"=list()) @@ -167,8 +167,8 @@ if(mmi.brainmob) if(mmi.brainmob.stat == DEAD) mmi.brainmob.stat = CONSCIOUS - dead_mob_list -= mmi.brainmob - living_mob_list += mmi.brainmob + GLOB.dead_mob_list -= mmi.brainmob + GLOB.living_mob_list += mmi.brainmob mind.transfer_to(mmi.brainmob) mmi.update_icon() else @@ -179,7 +179,7 @@ if(connected_ai) connected_ai.connected_robots -= src if(shell) - available_ai_shells -= src + GLOB.available_ai_shells -= src qdel(wires) qdel(module) qdel(eye_lights) @@ -611,7 +611,7 @@ /mob/living/silicon/robot/proc/do_camera_update(oldLoc) if(oldLoc != src.loc) - cameranet.updatePortableCamera(src.camera) + GLOB.cameranet.updatePortableCamera(src.camera) updating = 0 /mob/living/silicon/robot/Move(a, b, flag) @@ -793,7 +793,7 @@ icon_state = "syndie_bloodhound" faction = list("syndicate") bubble_icon = "syndibot" - req_access = list(access_syndicate) + req_access = list(GLOB.access_syndicate) lawupdate = FALSE scrambledcodes = TRUE // These are rogue borgs. ionpulse = TRUE @@ -1001,7 +1001,7 @@ braintype = "AI Shell" name = "[designation] AI Shell [rand(100,999)]" real_name = name - available_ai_shells |= src + GLOB.available_ai_shells |= src if(camera) camera.c_tag = real_name //update the camera name too diag_hud_set_aishell() @@ -1015,7 +1015,7 @@ //A player forced reset of a borg would drop the module before this is called, so this is for catching edge cases qdel(boris) shell = FALSE - available_ai_shells -= src + GLOB.available_ai_shells -= src name = "Unformatted Cyborg [rand(100,999)]" real_name = name if(camera) @@ -1039,7 +1039,7 @@ radio.subspace_transmission = TRUE radio.channels = AI.radio.channels for(var/chan in radio.channels) - radio.secure_radio_connections[chan] = add_radio(radio, radiochannels[chan]) + radio.secure_radio_connections[chan] = add_radio(radio, GLOB.radiochannels[chan]) diag_hud_set_aishell() undeployment_action.Grant(src) diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index e78b12b8c59f2..01c700768f189 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -141,7 +141,7 @@ message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overridden.") log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.") var/time = time2text(world.realtime,"hh:mm:ss") - lawchanges.Add("[time] : [user.name]([user.key]) emagged [name]([key])") + GLOB.lawchanges.Add("[time] : [user.name]([user.key]) emagged [name]([key])") to_chat(src, "ALERT: Foreign software detected.") sleep(5) to_chat(src, "Initiating diagnostics...") diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index d7633f4107c2d..8d21cfb7f62cf 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -10,7 +10,7 @@ desig = trim_left(S.designation + " " + S.job) var/message_a = say_quote(message, get_spans()) var/rendered = "Robotic Talk, [name] [message_a]" - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.binarycheck()) if(isAI(M)) var/renderedAI = "Robotic Talk, [name] ([desig]) [message_a]" @@ -43,7 +43,7 @@ radio.talk_into(src, message, , spans, language) return REDUCE_RANGE - else if(message_mode in radiochannels) + else if(message_mode in GLOB.radiochannels) if(radio) radio.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index bc6d1d7fe04a3..ca4a15beea3eb 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -39,8 +39,8 @@ /mob/living/silicon/Initialize() ..() - silicon_mobs += src - var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC] + GLOB.silicon_mobs += src + var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC] diag_hud.add_to_hud(src) diag_hud_set_status() diag_hud_set_health() @@ -54,7 +54,7 @@ /mob/living/silicon/Destroy() radio = null aicamera = null - silicon_mobs -= src + GLOB.silicon_mobs -= src return ..() /mob/living/silicon/contents_explosion(severity, target) @@ -305,8 +305,8 @@ else if(Autochan == "None") //Prevents use of the radio for automatic annoucements. radiomod = "" else //For department channels, if any, given by the internal radio. - for(var/key in department_radio_keys) - if(department_radio_keys[key] == Autochan) + for(var/key in GLOB.department_radio_keys) + if(GLOB.department_radio_keys[key] == Autochan) radiomod = key break @@ -325,23 +325,23 @@ return -10 /mob/living/silicon/proc/remove_med_sec_hud() - var/datum/atom_hud/secsensor = huds[sec_hud] - var/datum/atom_hud/medsensor = huds[med_hud] - var/datum/atom_hud/diagsensor = huds[d_hud] + var/datum/atom_hud/secsensor = GLOB.huds[sec_hud] + var/datum/atom_hud/medsensor = GLOB.huds[med_hud] + var/datum/atom_hud/diagsensor = GLOB.huds[d_hud] secsensor.remove_hud_from(src) medsensor.remove_hud_from(src) diagsensor.remove_hud_from(src) /mob/living/silicon/proc/add_sec_hud() - var/datum/atom_hud/secsensor = huds[sec_hud] + var/datum/atom_hud/secsensor = GLOB.huds[sec_hud] secsensor.add_hud_to(src) /mob/living/silicon/proc/add_med_hud() - var/datum/atom_hud/medsensor = huds[med_hud] + var/datum/atom_hud/medsensor = GLOB.huds[med_hud] medsensor.add_hud_to(src) /mob/living/silicon/proc/add_diag_hud() - var/datum/atom_hud/diagsensor = huds[d_hud] + var/datum/atom_hud/diagsensor = GLOB.huds[d_hud] diagsensor.add_hud_to(src) /mob/living/silicon/proc/sensor_mode() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index e41d7f07e60de..b09a3ef9416bd 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -119,7 +119,7 @@ ..() access_card = new /obj/item/weapon/card/id(src) //This access is so bots can be immediately set to patrol and leave Robotics, instead of having to be let out first. - access_card.access += access_robotics + access_card.access += GLOB.access_robotics set_custom_texts() Radio = new/obj/item/device/radio(src) if(radio_key) @@ -132,7 +132,7 @@ //Adds bot to the diagnostic HUD system prepare_huds() - var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC] diag_hud.add_to_hud(src) diag_hud_set_bothealth() diag_hud_set_botstat() @@ -348,7 +348,7 @@ Radio.talk_into(src, message, message_mode, spans, language) return REDUCE_RANGE - if(message_mode in radiochannels) + if(message_mode in GLOB.radiochannels) Radio.talk_into(src, message, message_mode, spans, language) return REDUCE_RANGE return 0 @@ -610,7 +610,7 @@ Pass a positive integer as an argument to override a bot's default speed. /mob/living/simple_animal/bot/proc/get_next_patrol_target() // search the beacon list for the next target in the list. - for(var/obj/machinery/navbeacon/NB in navbeacons["[z]"]) + for(var/obj/machinery/navbeacon/NB in GLOB.navbeacons["[z]"]) if(NB.location == next_destination) //Does the Beacon location text match the destination? destination = new_destination //We now know the name of where we want to go. patrol_target = NB.loc //Get its location and set it as the target. @@ -618,7 +618,7 @@ Pass a positive integer as an argument to override a bot's default speed. return 1 /mob/living/simple_animal/bot/proc/find_nearest_beacon() - for(var/obj/machinery/navbeacon/NB in navbeacons["[z]"]) + for(var/obj/machinery/navbeacon/NB in GLOB.navbeacons["[z]"]) var/dist = get_dist(src, NB) if(nearest_beacon) //Loop though the beacon net to find the true closest beacon. //Ignore the beacon if were are located on it. @@ -925,5 +925,5 @@ Pass a positive integer as an argument to override a bot's default speed. //If a bot has its own HUD (for player bots), provide it. if(!data_hud_type) return - var/datum/atom_hud/datahud = huds[data_hud_type] + var/datum/atom_hud/datahud = GLOB.huds[data_hud_type] datahud.add_hud_to(src) diff --git a/code/modules/mob/living/simple_animal/bot/cleanbot.dm b/code/modules/mob/living/simple_animal/bot/cleanbot.dm index 15612fa82c292..4c5c2c14c538f 100644 --- a/code/modules/mob/living/simple_animal/bot/cleanbot.dm +++ b/code/modules/mob/living/simple_animal/bot/cleanbot.dm @@ -265,7 +265,7 @@ ..() /obj/machinery/bot_core/cleanbot - req_one_access = list(access_janitor, access_robotics) + req_one_access = list(GLOB.access_janitor, GLOB.access_robotics) /mob/living/simple_animal/bot/cleanbot/get_controls(mob/user) diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm index fc67908f46dbb..ef133252d700d 100644 --- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm +++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm @@ -59,7 +59,7 @@ shot_delay = 6//Longer shot delay because JESUS CHRIST check_records = 0//Don't actively target people set to arrest arrest_type = 1//Don't even try to cuff - bot_core.req_access = list(access_maint_tunnels, access_theatre) + bot_core.req_access = list(GLOB.access_maint_tunnels, GLOB.access_theatre) arrest_type = 1 if((lasercolor == "b") && (name == "\improper ED-209 Security Robot"))//Picks a name if there isn't already a custome one name = pick("BLUE BALLER","SANIC","BLUE KILLDEATH MURDERBOT") @@ -67,7 +67,7 @@ name = pick("RED RAMPAGE","RED ROVER","RED KILLDEATH MURDERBOT") //SECHUD - var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED] + var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] secsensor.add_hud_to(src) /mob/living/simple_animal/bot/ed209/turn_on() diff --git a/code/modules/mob/living/simple_animal/bot/floorbot.dm b/code/modules/mob/living/simple_animal/bot/floorbot.dm index 61fe93792b357..c8208e7a3b48e 100644 --- a/code/modules/mob/living/simple_animal/bot/floorbot.dm +++ b/code/modules/mob/living/simple_animal/bot/floorbot.dm @@ -387,7 +387,7 @@ ..() /obj/machinery/bot_core/floorbot - req_one_access = list(access_construction, access_robotics) + req_one_access = list(GLOB.access_construction, GLOB.access_robotics) /mob/living/simple_animal/bot/floorbot/UnarmedAttack(atom/A) if(isturf(A)) diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm index bed161ad9db6e..9a2c781e1fe40 100644 --- a/code/modules/mob/living/simple_animal/bot/medbot.dm +++ b/code/modules/mob/living/simple_animal/bot/medbot.dm @@ -496,7 +496,7 @@ return /mob/living/simple_animal/bot/medbot/proc/check_overdose(mob/living/carbon/patient,reagent_id,injection_amount) - var/datum/reagent/R = chemical_reagents_list[reagent_id] + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_id] if(!R.overdose_threshold) //Some chems do not have an OD threshold return 0 var/current_volume = patient.reagents.get_reagent_amount(reagent_id) @@ -545,4 +545,4 @@ declare_cooldown = 0 /obj/machinery/bot_core/medbot - req_one_access =list(access_medical, access_robotics) + req_one_access =list(GLOB.access_medical, GLOB.access_robotics) diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index 50fe9bc41025c..30c2c4e9a9a79 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -4,8 +4,6 @@ // Navigates via floor navbeacons // Remote Controlled from QM's PDA -var/global/mulebot_count = 0 - #define SIGH 0 #define ANNOYED 1 #define DELIGHT 2 @@ -58,10 +56,10 @@ var/global/mulebot_count = 0 cell.charge = 2000 cell.maxcharge = 2000 - spawn(10) // must wait for map loading to finish - mulebot_count += 1 - if(!suffix) - set_suffix("#[mulebot_count]") + var/static/mulebot_count = 0 + mulebot_count += 1 + if(!suffix) + set_suffix("#[mulebot_count]") /mob/living/simple_animal/bot/mulebot/Destroy() unload(0) @@ -165,7 +163,7 @@ var/global/mulebot_count = 0 ui_interact(user) /mob/living/simple_animal/bot/mulebot/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "mulebot", name, 600, 375, master_ui, state) @@ -231,7 +229,7 @@ var/global/mulebot_count = 0 if(mode == BOT_IDLE || mode == BOT_DELIVER) start_home() if("destination") - var/new_dest = input(user, "Enter Destination:", name, destination) as null|anything in deliverybeacontags + var/new_dest = input(user, "Enter Destination:", name, destination) as null|anything in GLOB.deliverybeacontags if(new_dest) set_destination(new_dest) if("setid") @@ -239,7 +237,7 @@ var/global/mulebot_count = 0 if(new_id) set_suffix(new_id) if("sethome") - var/new_home = input(user, "Enter Home:", name, home_destination) as null|anything in deliverybeacontags + var/new_home = input(user, "Enter Home:", name, home_destination) as null|anything in GLOB.deliverybeacontags if(new_home) home_destination = new_home if("unload") @@ -686,7 +684,7 @@ var/global/mulebot_count = 0 if(!on || wires.is_cut(WIRE_BEACON)) return - for(var/obj/machinery/navbeacon/NB in deliverybeacons) + for(var/obj/machinery/navbeacon/NB in GLOB.deliverybeacons) if(NB.location == new_destination) // if the beacon location matches the set destination // the we will navigate there destination = new_destination @@ -754,4 +752,4 @@ var/global/mulebot_count = 0 #undef DELIGHT /obj/machinery/bot_core/mulebot - req_access = list(access_cargo) + req_access = list(GLOB.access_cargo) diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm index 4da4911b7dd71..1315793eedaf6 100644 --- a/code/modules/mob/living/simple_animal/bot/secbot.dm +++ b/code/modules/mob/living/simple_animal/bot/secbot.dm @@ -71,7 +71,7 @@ prev_access = access_card.access //SECHUD - var/datum/atom_hud/secsensor = huds[DATA_HUD_SECURITY_ADVANCED] + var/datum/atom_hud/secsensor = GLOB.huds[DATA_HUD_SECURITY_ADVANCED] secsensor.add_hud_to(src) /mob/living/simple_animal/bot/secbot/turn_on() @@ -420,4 +420,4 @@ Auto Patrol: []"}, ..() /obj/machinery/bot_core/secbot - req_access = list(access_security) + req_access = list(GLOB.access_security) diff --git a/code/modules/mob/living/simple_animal/corpse.dm b/code/modules/mob/living/simple_animal/corpse.dm index 95d4e17619586..a013b6a543f58 100644 --- a/code/modules/mob/living/simple_animal/corpse.dm +++ b/code/modules/mob/living/simple_animal/corpse.dm @@ -20,7 +20,7 @@ back = /obj/item/weapon/storage/backpack has_id = 1 id_job = "Operative" - id_access_list = list(access_syndicate) + id_access_list = list(GLOB.access_syndicate) /obj/effect/mob_spawn/human/corpse/syndicatecommando name = "Syndicate Commando" @@ -34,7 +34,7 @@ pocket1 = /obj/item/weapon/tank/internals/emergency_oxygen has_id = 1 id_job = "Operative" - id_access_list = list(access_syndicate) + id_access_list = list(GLOB.access_syndicate) /obj/effect/mob_spawn/human/corpse/syndicatestormtrooper name = "Syndicate Stormtrooper" @@ -47,7 +47,7 @@ back = /obj/item/weapon/tank/jetpack/oxygen/harness has_id = 1 id_job = "Operative" - id_access_list = list(access_syndicate) + id_access_list = list(GLOB.access_syndicate) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 74c1f9621348e..73e78827ec82d 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -101,7 +101,7 @@ else verbs -= /mob/living/simple_animal/drone/verb/toggle_statics - var/datum/atom_hud/data/diagnostic/diag_hud = huds[DATA_HUD_DIAGNOSTIC] + var/datum/atom_hud/data/diagnostic/diag_hud = GLOB.huds[DATA_HUD_DIAGNOSTIC] diag_hud.add_to_hud(src) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm index 97b42d4a57abd..8881eb5407764 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/drones_as_items.dm @@ -21,10 +21,10 @@ var/area/A = get_area(src) if(A) notify_ghosts("A drone shell has been created in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE) - poi_list |= src + GLOB.poi_list |= src /obj/item/drone_shell/Destroy() - poi_list -= src + GLOB.poi_list -= src . = ..() /obj/item/drone_shell/attack_ghost(mob/user) diff --git a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm index 837258b5738d0..6a57e50aadae3 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm @@ -144,7 +144,7 @@ /mob/living/simple_animal/drone/cogscarab/Login() ..() add_servant_of_ratvar(src, TRUE) - to_chat(src,"You yourself are one of these servants, and will be able to utilize almost anything they can[ratvar_awakens ? "":", excluding a clockwork slab"].") // this can't go with flavortext because i'm assuming it requires them to be ratvar'd + to_chat(src,"You yourself are one of these servants, and will be able to utilize almost anything they can[GLOB.ratvar_awakens ? "":", excluding a clockwork slab"].") // this can't go with flavortext because i'm assuming it requires them to be ratvar'd /mob/living/simple_animal/drone/cogscarab/binarycheck() return FALSE @@ -169,12 +169,12 @@ ..() /mob/living/simple_animal/drone/cogscarab/can_use_guns(obj/item/weapon/gun/G) - if(!ratvar_awakens) + if(!GLOB.ratvar_awakens) changeNext_move(CLICK_CD_RANGE*4) //about as much delay as an unupgraded kinetic accelerator return TRUE /mob/living/simple_animal/drone/cogscarab/get_armor_effectiveness() - if(ratvar_awakens) + if(GLOB.ratvar_awakens) return 1 return ..() diff --git a/code/modules/mob/living/simple_animal/friendly/drone/say.dm b/code/modules/mob/living/simple_animal/friendly/drone/say.dm index 6559dfee041da..4462adfe9dff9 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/say.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/say.dm @@ -18,7 +18,7 @@ //Base proc for anything to call /proc/_alert_drones(msg, dead_can_hear = 0, mob/living/faction_checked_mob, exact_faction_match) - for(var/W in mob_list) + for(var/W in GLOB.mob_list) var/mob/living/simple_animal/drone/M = W if(istype(M) && M.stat != DEAD) if(faction_checked_mob) @@ -26,7 +26,7 @@ to_chat(M, msg) else to_chat(M, msg) - if(dead_can_hear && (M in dead_mob_list)) + if(dead_can_hear && (M in GLOB.dead_mob_list)) var/link = FOLLOW_LINK(M, faction_checked_mob) to_chat(M, "[link] [msg]") diff --git a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm index 5d634d938ea9a..52c4c63dd53b2 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/visuals_icons.dm @@ -151,7 +151,7 @@ staticOverlays.len = 0 if(seeStatic) - for(var/mob/living/L in mob_list) + for(var/mob/living/L in GLOB.mob_list) if(isdrone(L)) continue var/image/chosen diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 6a132cf8d0e59..d1507b055e36d 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -200,9 +200,6 @@ ..() amount_grown = 0 -var/const/MAX_CHICKENS = 50 -var/global/chicken_count = 0 - /mob/living/simple_animal/chicken name = "\improper chicken" desc = "Hopefully the eggs are good this season." @@ -237,6 +234,7 @@ var/global/chicken_count = 0 var/list/layMessage = list("lays an egg.","squats down and croons.","begins making a huge racket.","begins clucking raucously.") var/list/validColors = list("brown","black","white") gold_core_spawnable = 2 + var/static/chicken_count = 0 /mob/living/simple_animal/chicken/Initialize() ..() @@ -247,11 +245,11 @@ var/global/chicken_count = 0 icon_dead = "[icon_prefix]_[body_color]_dead" pixel_x = rand(-6, 6) pixel_y = rand(0, 10) - chicken_count += 1 + ++chicken_count -/mob/living/simple_animal/chicken/death(gibbed) - ..(gibbed) - chicken_count -= 1 +/mob/living/simple_animal/chicken/Destroy() + --chicken_count + return ..() /mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params) if(istype(O, food_type)) //feedin' dem chickens diff --git a/code/modules/mob/living/simple_animal/guardian/guardian.dm b/code/modules/mob/living/simple_animal/guardian/guardian.dm index 740ede826dd4c..1eec40c264f63 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardian.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardian.dm @@ -1,5 +1,5 @@ -var/global/list/parasites = list() //all currently existing/living guardians +GLOBAL_LIST_EMPTY(parasites) //all currently existing/living guardians #define GUARDIAN_HANDS_LAYER 1 #define GUARDIAN_TOTAL_LAYERS 1 @@ -51,7 +51,7 @@ var/global/list/parasites = list() //all currently existing/living guardians var/carp_fluff_string = "CARP CARP CARP SOME SORT OF HORRIFIC BUG BLAME THE CODERS CARP CARP CARP" /mob/living/simple_animal/hostile/guardian/Initialize(mapload, theme) - parasites |= src + GLOB.parasites += src setthemename(theme) ..() @@ -72,7 +72,7 @@ var/global/list/parasites = list() //all currently existing/living guardians holder.icon_state = "hudhealthy" /mob/living/simple_animal/hostile/guardian/Destroy() - parasites -= src + GLOB.parasites -= src return ..() /mob/living/simple_animal/hostile/guardian/proc/setthemename(pickedtheme) //set the guardian's theme to something cool! @@ -366,7 +366,7 @@ var/global/list/parasites = list() //all currently existing/living guardians var/list/guardians = summoner.hasparasites() for(var/para in guardians) to_chat(para, my_message) - for(var/M in dead_mob_list) + for(var/M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [my_message]") @@ -388,7 +388,7 @@ var/global/list/parasites = list() //all currently existing/living guardians for(var/para in guardians) var/mob/living/simple_animal/hostile/guardian/G = para to_chat(G, "[src]: [preliminary_message]" ) - for(var/M in dead_mob_list) + for(var/M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, src) to_chat(M, "[link] [my_message]") @@ -449,10 +449,10 @@ var/global/list/parasites = list() //all currently existing/living guardians /mob/living/proc/hasparasites() //returns a list of guardians the mob is a summoner for . = list() - for(var/P in parasites) + for(var/P in GLOB.parasites) var/mob/living/simple_animal/hostile/guardian/G = P if(G.summoner == src) - . |= G + . += G /mob/living/simple_animal/hostile/guardian/proc/hasmatchingsummoner(mob/living/simple_animal/hostile/guardian/G) //returns 1 if the summoner matches the target's summoner return (istype(G) && G.summoner == summoner) diff --git a/code/modules/mob/living/simple_animal/guardian/guardiannaming.dm b/code/modules/mob/living/simple_animal/guardian/guardiannaming.dm index 662a38538788a..f2e1b57255a3b 100644 --- a/code/modules/mob/living/simple_animal/guardian/guardiannaming.dm +++ b/code/modules/mob/living/simple_animal/guardian/guardiannaming.dm @@ -15,7 +15,7 @@ stainself = 1 /datum/guardianname/carp/New() - prefixname = pick(carp_names) + prefixname = pick(GLOB.carp_names) /datum/guardianname/carp/sand suffixcolour = "Sand" diff --git a/code/modules/mob/living/simple_animal/guardian/types/protector.dm b/code/modules/mob/living/simple_animal/guardian/types/protector.dm index e242ba50bf4ae..80212004217df 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/protector.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/protector.dm @@ -22,7 +22,7 @@ /mob/living/simple_animal/hostile/guardian/protector/adjustHealth(amount, updating_health = TRUE, forced = FALSE) . = ..() if(. > 0 && toggle) - var/image/I = new('icons/effects/effects.dmi', src, "shield-flash", MOB_LAYER+0.01, dir = pick(cardinal)) + var/image/I = new('icons/effects/effects.dmi', src, "shield-flash", MOB_LAYER+0.01, dir = pick(GLOB.cardinal)) if(namedatum) I.color = namedatum.colour flick_overlay_view(I, src, 5) diff --git a/code/modules/mob/living/simple_animal/guardian/types/support.dm b/code/modules/mob/living/simple_animal/guardian/types/support.dm index 04399b8eee3b2..469ba6ab97df3 100644 --- a/code/modules/mob/living/simple_animal/guardian/types/support.dm +++ b/code/modules/mob/living/simple_animal/guardian/types/support.dm @@ -17,7 +17,7 @@ /mob/living/simple_animal/hostile/guardian/healer/Initialize() ..() - var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medsensor.add_hud_to(src) /mob/living/simple_animal/hostile/guardian/healer/Stat() diff --git a/code/modules/mob/living/simple_animal/hostile/bees.dm b/code/modules/mob/living/simple_animal/hostile/bees.dm index 5312ea346174d..fbbd2c20c87b5 100644 --- a/code/modules/mob/living/simple_animal/hostile/bees.dm +++ b/code/modules/mob/living/simple_animal/hostile/bees.dm @@ -212,7 +212,7 @@ /mob/living/simple_animal/hostile/poison/bees/toxin/Initialize() . = ..() var/datum/reagent/R = pick(typesof(/datum/reagent/toxin)) - assign_reagent(chemical_reagents_list[initial(R.id)]) + assign_reagent(GLOB.chemical_reagents_list[initial(R.id)]) /mob/living/simple_animal/hostile/poison/bees/queen name = "queen bee" @@ -272,7 +272,7 @@ else to_chat(user, "You don't have enough royal bee jelly to split a bee in two!") else - var/datum/reagent/R = chemical_reagents_list[S.reagents.get_master_reagent_id()] + var/datum/reagent/R = GLOB.chemical_reagents_list[S.reagents.get_master_reagent_id()] if(R && S.reagents.has_reagent(R.id, 5)) S.reagents.remove_reagent(R.id,5) queen.assign_reagent(R) diff --git a/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm b/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm index 873476fd46488..2829bf574e1bf 100644 --- a/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm +++ b/code/modules/mob/living/simple_animal/hostile/bosses/paperwizard.dm @@ -41,7 +41,7 @@ /mob/living/simple_animal/hostile/stickman, /mob/living/simple_animal/hostile/stickman/ranged, /mob/living/simple_animal/hostile/stickman/dog) - var/list/directions = cardinal.Copy() + var/list/directions = GLOB.cardinal.Copy() for(var/i in 1 to 3) var/minions_chosen = pick_n_take(minions) new minions_chosen (get_step(boss,pick_n_take(directions)), 1) @@ -71,7 +71,7 @@ target = pick(threats) if(target) var/mob/living/simple_animal/hostile/boss/paper_wizard/wiz = boss - var/directions = cardinal.Copy() + var/directions = GLOB.cardinal.Copy() for(var/i in 1 to 3) var/mob/living/simple_animal/hostile/boss/paper_wizard/copy/C = new (get_step(target,pick_n_take(directions))) wiz.copies += C diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 17976c3b75965..9bf7a4fa51deb 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -361,7 +361,7 @@ /mob/living/simple_animal/hostile/proc/DestroySurroundings() if(environment_smash) EscapeConfinement() - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) var/turf/T = get_step(targets_from, dir) if(iswallturf(T) || ismineralturf(T)) if(T.Adjacent(targets_from)) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm index 4c550e5325593..24b8b9b1ee60d 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/bubblegum.dm @@ -63,9 +63,9 @@ Difficulty: Hard if(. > 0 && prob(25)) var/obj/effect/decal/cleanable/blood/gibs/bubblegum/B = new /obj/effect/decal/cleanable/blood/gibs/bubblegum(loc) if(prob(40)) - step(B, pick(cardinal)) + step(B, pick(GLOB.cardinal)) else - B.setDir(pick(cardinal)) + B.setDir(pick(GLOB.cardinal)) /obj/effect/decal/cleanable/blood/gibs/bubblegum name = "thick blood" @@ -105,7 +105,7 @@ Difficulty: Hard /mob/living/simple_animal/hostile/megafauna/bubblegum/Initialize() ..() - for(var/mob/living/simple_animal/hostile/megafauna/bubblegum/B in mob_list) + for(var/mob/living/simple_animal/hostile/megafauna/bubblegum/B in GLOB.mob_list) if(B != src) qdel(src) //There can be only one return diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index fc9858beeb384..a0e7c3694f340 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -64,7 +64,7 @@ Difficulty: Very Hard visible_message("\"You can't dodge.\"") ranged_cooldown = world.time + 30 telegraph() - dir_shots(alldirs) + dir_shots(GLOB.alldirs) move_to_delay = 3 return else @@ -127,13 +127,13 @@ Difficulty: Very Hard . = TRUE /mob/living/simple_animal/hostile/megafauna/colossus/proc/alternating_dir_shots() - dir_shots(diagonals) + dir_shots(GLOB.diagonals) sleep(10) - dir_shots(cardinal) + dir_shots(GLOB.cardinal) sleep(10) - dir_shots(diagonals) + dir_shots(GLOB.diagonals) sleep(10) - dir_shots(cardinal) + dir_shots(GLOB.cardinal) /mob/living/simple_animal/hostile/megafauna/colossus/proc/double_spiral() visible_message("\"Die.\"") @@ -224,7 +224,7 @@ Difficulty: Very Hard /mob/living/simple_animal/hostile/megafauna/colossus/proc/dir_shots(list/dirs) if(!islist(dirs)) - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() playsound(get_turf(src), 'sound/magic/clockwork/invoke_general.ogg', 200, 1, 2) for(var/d in dirs) var/turf/E = get_step(src, d) @@ -631,7 +631,7 @@ Difficulty: Very Hard ..() verbs -= /mob/living/verb/pulled verbs -= /mob/verb/me_verb - var/datum/atom_hud/medsensor = huds[DATA_HUD_MEDICAL_ADVANCED] + var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] medsensor.add_hud_to(src) /mob/living/simple_animal/hostile/lightgeist/AttackingTarget() diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm index 951df8196856c..9bc32993fa9c7 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm @@ -162,7 +162,7 @@ Difficulty: Medium /mob/living/simple_animal/hostile/megafauna/dragon/proc/fire_walls() playsound(get_turf(src),'sound/magic/Fireball.ogg', 200, 1) - for(var/d in cardinal) + for(var/d in GLOB.cardinal) INVOKE_ASYNC(src, .proc/fire_wall, d) /mob/living/simple_animal/hostile/megafauna/dragon/proc/fire_wall(dir) @@ -231,7 +231,7 @@ Difficulty: Medium if(L && !QDELETED(L)) // Some mobs are deleted on death var/throw_dir = get_dir(src, L) if(L.loc == loc) - throw_dir = pick(alldirs) + throw_dir = pick(GLOB.alldirs) var/throwtarget = get_edge_target_turf(src, throw_dir) L.throw_at(throwtarget, 3) visible_message("[L] is thrown clear of [src]!") diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 9d19edad31a47..d9f099e2f118b 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -243,7 +243,7 @@ Difficulty: Hard var/oldcolor = color animate(src, color = "#660099", time = 10) var/list/targets = ListTargets() - var/list/cardinal_copy = cardinal.Copy() + var/list/cardinal_copy = GLOB.cardinal.Copy() while(health && targets.len && cardinal_copy.len) var/mob/living/pickedtarget = pick(targets) if(targets.len > 4) @@ -285,7 +285,7 @@ Difficulty: Hard if((prob(anger_modifier) || target.Adjacent(src)) && target != src) var/obj/effect/overlay/temp/hierophant/chaser/OC = new /obj/effect/overlay/temp/hierophant/chaser(loc, src, target, max(1.5, 5 - anger_modifier * 0.07), FALSE) OC.moving = 4 - OC.moving_dir = pick(cardinal - C.moving_dir) + OC.moving_dir = pick(GLOB.cardinal - C.moving_dir) else //just release a burst of power INVOKE_ASYNC(src, .proc/burst, get_turf(src)) @@ -297,7 +297,7 @@ Difficulty: Hard playsound(T,'sound/effects/bin_close.ogg', 200, 1) sleep(2) new /obj/effect/overlay/temp/hierophant/blast(T, src, FALSE) - for(var/d in diagonals) + for(var/d in GLOB.diagonals) INVOKE_ASYNC(src, .proc/blast_wall, T, d) /mob/living/simple_animal/hostile/megafauna/hierophant/proc/cardinal_blasts(mob/victim) //fire cardinal cross blasts with a delay @@ -308,7 +308,7 @@ Difficulty: Hard playsound(T,'sound/effects/bin_close.ogg', 200, 1) sleep(2) new /obj/effect/overlay/temp/hierophant/blast(T, src, FALSE) - for(var/d in cardinal) + for(var/d in GLOB.cardinal) INVOKE_ASYNC(src, .proc/blast_wall, T, d) /mob/living/simple_animal/hostile/megafauna/hierophant/proc/alldir_blasts(mob/victim) //fire alldir cross blasts with a delay @@ -319,7 +319,7 @@ Difficulty: Hard playsound(T,'sound/effects/bin_close.ogg', 200, 1) sleep(2) new /obj/effect/overlay/temp/hierophant/blast(T, src, FALSE) - for(var/d in alldirs) + for(var/d in GLOB.alldirs) INVOKE_ASYNC(src, .proc/blast_wall, T, d) /mob/living/simple_animal/hostile/megafauna/hierophant/proc/blast_wall(turf/T, set_dir) //make a wall of blasts beam_range tiles long @@ -338,7 +338,7 @@ Difficulty: Hard if((istype(get_area(T), /area/ruin/unpowered/hierophant) || istype(get_area(src), /area/ruin/unpowered/hierophant)) && victim != src) return arena_cooldown = world.time + initial(arena_cooldown) - for(var/d in cardinal) + for(var/d in GLOB.cardinal) INVOKE_ASYNC(src, .proc/arena_squares, T, d) for(var/t in RANGE_TURFS(11, T)) if(t && get_dist(t, T) == 11) @@ -491,7 +491,7 @@ Difficulty: Hard /obj/effect/overlay/temp/hierophant/chaser/proc/get_target_dir() . = get_cardinal_dir(src, targetturf) if((. != previous_moving_dir && . == more_previouser_moving_dir) || . == 0) //we're alternating, recalculate - var/list/cardinal_copy = cardinal.Copy() + var/list/cardinal_copy = GLOB.cardinal.Copy() cardinal_copy -= more_previouser_moving_dir . = pick(cardinal_copy) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm index 169b83169b43b..bf834fce03ddb 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/legion.dm @@ -117,7 +117,7 @@ Difficulty: Medium visible_message("[src] splits in twain!") else var/last_legion = TRUE - for(var/mob/living/simple_animal/hostile/megafauna/legion/other in mob_list) + for(var/mob/living/simple_animal/hostile/megafauna/legion/other in GLOB.mob_list) if(other != src) last_legion = FALSE break diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm index 8af5c76f5be7e..dcb37610cf25e 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm @@ -118,7 +118,7 @@ if(admin_spawned) return FALSE - if(global.medal_hub && global.medal_pass && global.medals_enabled) + if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) for(var/mob/living/L in view(7,src)) if(L.stat) continue @@ -135,11 +135,11 @@ if(!player || !medal) return - if(global.medal_hub && global.medal_pass && global.medals_enabled) + if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) spawn() - var/result = world.SetMedal(medal, player, global.medal_hub, global.medal_pass) + var/result = world.SetMedal(medal, player, GLOB.medal_hub, GLOB.medal_pass) if(isnull(result)) - global.medals_enabled = FALSE + GLOB.medals_enabled = FALSE log_game("MEDAL ERROR: Could not contact hub to award medal:[medal] player:[player.ckey]") message_admins("Error! Failed to contact hub to award [medal] medal to [player.ckey]!") else if (result) @@ -150,7 +150,7 @@ if(!score || !player) return - if(global.medal_hub && global.medal_pass && global.medals_enabled) + if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) spawn() var/list/oldscore = GetScore(score,player,1) @@ -164,10 +164,10 @@ var/newscoreparam = list2params(oldscore) - var/result = world.SetScores(player.ckey, newscoreparam, global.medal_hub, global.medal_pass) + var/result = world.SetScores(player.ckey, newscoreparam, GLOB.medal_hub, GLOB.medal_pass) if(isnull(result)) - global.medals_enabled = FALSE + GLOB.medals_enabled = FALSE log_game("SCORE ERROR: Could not contact hub to set score. Score:[score] player:[player.ckey]") message_admins("Error! Failed to contact hub to set [score] score for [player.ckey]!") @@ -176,11 +176,11 @@ if(!score || !player) return - if(global.medal_hub && global.medal_pass && global.medals_enabled) + if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) - var/scoreget = world.GetScores(player.ckey, score, global.medal_hub, global.medal_pass) + var/scoreget = world.GetScores(player.ckey, score, GLOB.medal_hub, GLOB.medal_pass) if(isnull(scoreget)) - global.medals_enabled = FALSE + GLOB.medals_enabled = FALSE log_game("SCORE ERROR: Could not contact hub to get score. Score:[score] player:[player.ckey]") message_admins("Error! Failed to contact hub to get score: [score] for [player.ckey]!") return @@ -197,12 +197,12 @@ if(!player || !medal) return - if(global.medal_hub && global.medal_pass && global.medals_enabled) + if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) - var/result = world.GetMedal(medal, player, global.medal_hub, global.medal_pass) + var/result = world.GetMedal(medal, player, GLOB.medal_hub, GLOB.medal_pass) if(isnull(result)) - global.medals_enabled = FALSE + GLOB.medals_enabled = FALSE log_game("MEDAL ERROR: Could not contact hub to get medal:[medal] player:[player.ckey]") message_admins("Error! Failed to contact hub to get [medal] medal for [player.ckey]!") else if (result) @@ -212,12 +212,12 @@ if(!player || !medal) return - if(global.medal_hub && global.medal_pass && global.medals_enabled) + if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) - var/result = world.ClearMedal(medal, player, global.medal_hub, global.medal_pass) + var/result = world.ClearMedal(medal, player, GLOB.medal_hub, GLOB.medal_pass) if(isnull(result)) - global.medals_enabled = FALSE + GLOB.medals_enabled = FALSE log_game("MEDAL ERROR: Could not contact hub to clear medal:[medal] player:[player.ckey]") message_admins("Error! Failed to contact hub to clear [medal] medal for [player.ckey]!") else if (result) @@ -227,6 +227,6 @@ /proc/ClearScore(client/player) - world.SetScores(player.ckey, "", global.medal_hub, global.medal_pass) + world.SetScores(player.ckey, "", GLOB.medal_hub, GLOB.medal_pass) #undef MEDAL_PREFIX diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm index 1e6229e4fd955..8b6c9c5e1cd7a 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/swarmer.dm @@ -17,19 +17,19 @@ Difficulty: Special */ -var/global/list/mob/living/simple_animal/hostile/swarmer/ai/AISwarmers = list() -var/global/list/mob/living/simple_animal/hostile/swarmer/ai/AISwarmersByType = list()//AISwarmersByType[.../resource] = list(1st, 2nd, nth), AISwarmersByType[../ranged] = list(1st, 2nd, nth) etc. -var/global/list/AISwarmerCapsByType = list(/mob/living/simple_animal/hostile/swarmer/ai/resource = 30, /mob/living/simple_animal/hostile/swarmer/ai/ranged_combat = 20, /mob/living/simple_animal/hostile/swarmer/ai/melee_combat = 10) +GLOBAL_LIST_EMPTY(AISwarmers) +GLOBAL_LIST_EMPTY(AISwarmersByType)//AISwarmersByType[.../resource] = list(1st, 2nd, nth), AISwarmersByType[../ranged] = list(1st, 2nd, nth) etc. +GLOBAL_LIST_INIT(AISwarmerCapsByType, list(/mob/living/simple_animal/hostile/swarmer/ai/resource = 30, /mob/living/simple_animal/hostile/swarmer/ai/ranged_combat = 20, /mob/living/simple_animal/hostile/swarmer/ai/melee_combat = 10)) //returns a type of AI swarmer that is NOT at max cap //type order is shuffled, to prevent bias /proc/GetUncappedAISwarmerType() var/static/list/swarmerTypes = subtypesof(/mob/living/simple_animal/hostile/swarmer/ai) - LAZYINITLIST(AISwarmersByType) + LAZYINITLIST(GLOB.AISwarmersByType) for(var/t in shuffle(swarmerTypes)) - var/list/amount = AISwarmersByType[t] - if(!amount || amount.len < AISwarmerCapsByType[t]) + var/list/amount = GLOB.AISwarmersByType[t] + if(!amount || amount.len < GLOB.AISwarmerCapsByType[t]) return t @@ -37,9 +37,9 @@ var/global/list/AISwarmerCapsByType = list(/mob/living/simple_animal/hostile/swa /proc/GetTotalAISwarmerCap() var/static/list/swarmerTypes = subtypesof(/mob/living/simple_animal/hostile/swarmer/ai) . = 0 - LAZYINITLIST(AISwarmersByType) + LAZYINITLIST(GLOB.AISwarmersByType) for(var/t in swarmerTypes) - . += AISwarmerCapsByType[t] + . += GLOB.AISwarmerCapsByType[t] /mob/living/simple_animal/hostile/megafauna/swarmer_swarm_beacon @@ -67,9 +67,9 @@ var/global/list/AISwarmerCapsByType = list(/mob/living/simple_animal/hostile/swa /mob/living/simple_animal/hostile/megafauna/swarmer_swarm_beacon/Initialize() ..() - swarmer_caps = AISwarmerCapsByType //for admin-edits + swarmer_caps = GLOB.AISwarmerCapsByType //for admin-edits internal = new/obj/item/device/gps/internal/swarmer_beacon(src) - for(var/ddir in cardinal) + for(var/ddir in GLOB.cardinal) new /obj/structure/swarmer/blockade (get_step(src, ddir)) var/mob/living/simple_animal/hostile/swarmer/ai/resource/R = new(loc) step(R, ddir) //Step the swarmers, instead of spawning them there, incase the turf is solid @@ -79,7 +79,7 @@ var/global/list/AISwarmerCapsByType = list(/mob/living/simple_animal/hostile/swa . = ..() if(.) var/createtype = GetUncappedAISwarmerType() - if(createtype && world.time > swarmer_spawn_cooldown && AISwarmers.len < (GetTotalAISwarmerCap()*0.5)) + if(createtype && world.time > swarmer_spawn_cooldown && GLOB.AISwarmers.len < (GetTotalAISwarmerCap()*0.5)) swarmer_spawn_cooldown = world.time + swarmer_spawn_cooldown_amt new createtype(loc) @@ -111,14 +111,14 @@ var/global/list/AISwarmerCapsByType = list(/mob/living/simple_animal/hostile/swa /mob/living/simple_animal/hostile/swarmer/ai/Initialize() ..() ToggleLight() //so you can see them eating you out of house and home/shooting you/stunlocking you for eternity - LAZYINITLIST(AISwarmersByType[type]) - AISwarmers += src - AISwarmersByType[type] += src + LAZYINITLIST(GLOB.AISwarmersByType[type]) + GLOB.AISwarmers += src + GLOB.AISwarmersByType[type] += src /mob/living/simple_animal/hostile/swarmer/ai/Destroy() - AISwarmers -= src - AISwarmersByType[type] -= src + GLOB.AISwarmers -= src + GLOB.AISwarmersByType[type] -= src return ..() @@ -224,7 +224,7 @@ var/global/list/AISwarmerCapsByType = list(/mob/living/simple_animal/hostile/swa . = ..() if(.) if(!stop_automated_movement) - if(AISwarmers.len < GetTotalAISwarmerCap() && resources >= 50) + if(GLOB.AISwarmers.len < GetTotalAISwarmerCap() && resources >= 50) StartAction(100) //so they'll actually sit still and use the verbs CreateSwarmer() return diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index a6ee0d8de894e..825b376a07ff4 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -92,7 +92,7 @@ O.loc = C ..() -var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window) +GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/cable, /obj/structure/window)) /mob/living/simple_animal/hostile/mimic/copy health = 100 @@ -130,7 +130,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca faction |= "\ref[owner]" /mob/living/simple_animal/hostile/mimic/copy/proc/CheckObject(obj/O) - if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, protected_objects)) + if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, GLOB.protected_objects)) return 1 return 0 diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm index 1c64d25decd93..daeb73cc2abef 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs.dm @@ -502,7 +502,7 @@ for(var/obj/effect/goliath_tentacle/original/O in loc)//No more GG NO RE from 2+ goliaths simultaneously tentacling you if(O != src) qdel(src) - var/list/directions = cardinal.Copy() + var/list/directions = GLOB.cardinal.Copy() var/counter for(counter = 1, counter <= 3, counter++) var/spawndir = pick(directions) @@ -1009,12 +1009,12 @@ #define MEDAL_PREFIX "Tendril" /mob/living/simple_animal/hostile/spawner/lavaland/death() var/last_tendril = TRUE - for(var/mob/living/simple_animal/hostile/spawner/lavaland/other in mob_list) + for(var/mob/living/simple_animal/hostile/spawner/lavaland/other in GLOB.mob_list) if(other != src) last_tendril = FALSE break if(last_tendril && !admin_spawned) - if(global.medal_hub && global.medal_pass && global.medals_enabled) + if(GLOB.medal_hub && GLOB.medal_pass && GLOB.medals_enabled) for(var/mob/living/L in view(7,src)) if(L.stat) continue diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm index 0353b6b3a0459..20bb9c497e376 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/ghost.dm @@ -45,9 +45,9 @@ else switch(rand(0,1)) if(0) - name = "ghost of [pick(first_names_male)] [pick(last_names)]" + name = "ghost of [pick(GLOB.first_names_male)] [pick(GLOB.last_names)]" if(1) - name = "ghost of [pick(first_names_female)] [pick(last_names)]" + name = "ghost of [pick(GLOB.first_names_female)] [pick(GLOB.last_names)]" give_hair() diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index c930871bcd4de..9e0b304c63b94 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -187,7 +187,7 @@ range = 10 /obj/effect/proc_holder/spell/aoe_turf/blindness/cast(list/targets,mob/user = usr) - for(var/mob/living/L in living_mob_list) + for(var/mob/living/L in GLOB.living_mob_list) var/turf/T = get_turf(L.loc) if(T && T in targets) L.blind_eyes(4) diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 6b0f0d4a3f161..9fb62975d2314 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -170,7 +170,7 @@ ears.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE - if(message_mode in radiochannels) + if(message_mode in GLOB.radiochannels) if(ears) ears.talk_into(src, message, message_mode, spans, language) return ITALICS | REDUCE_RANGE @@ -215,7 +215,7 @@ ears.loc = src.loc ears = null for(var/possible_phrase in speak) - if(copytext(possible_phrase,1,3) in department_radio_keys) + if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys) possible_phrase = copytext(possible_phrase,3) else to_chat(usr, "There is nothing to remove from its [remove_from]!") @@ -424,7 +424,7 @@ if(prob(50)) useradio = 1 - if(copytext(possible_phrase,1,3) in department_radio_keys) + if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys) possible_phrase = "[useradio?pick(available_channels):""][copytext(possible_phrase,3)]" //crop out the channel prefix else possible_phrase = "[useradio?pick(available_channels):""][possible_phrase]" @@ -433,7 +433,7 @@ else //If we have no headset or channels to use, dont try to use any! for(var/possible_phrase in speak) - if(copytext(possible_phrase,1,3) in department_radio_keys) + if(copytext(possible_phrase,1,3) in GLOB.department_radio_keys) possible_phrase = "[copytext(possible_phrase,3,length(possible_phrase)+1)]" //crop out the channel prefix newspeak.Add(possible_phrase) speak = newspeak @@ -455,7 +455,7 @@ //Wander around aimlessly. This will help keep the loops from searches down //and possibly move the mob into a new are in view of something they can use if(prob(90)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) return if(!held_item && !parrot_perch) //If we've got nothing to do.. look for something to do. diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 78849e3ceb690..43cd74b554115 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -145,7 +145,7 @@ turns_since_move++ if(turns_since_move >= turns_per_move) if(!(stop_automated_movement_when_pulled && pulledby)) //Some animals don't move when pulled - var/anydir = pick(cardinal) + var/anydir = pick(GLOB.cardinal) if(Process_Spacemove(anydir)) Move(get_step(src, anydir), anydir) turns_since_move = 0 @@ -196,7 +196,7 @@ var/turf/open/ST = src.loc if(ST.air) var/ST_gases = ST.air.gases - ST.air.assert_gases(arglist(hardcoded_gases)) + ST.air.assert_gases(arglist(GLOB.hardcoded_gases)) var/tox = ST_gases["plasma"][MOLES] var/oxy = ST_gases["o2"][MOLES] diff --git a/code/modules/mob/living/simple_animal/slime/death.dm b/code/modules/mob/living/simple_animal/slime/death.dm index 12fc2132e3734..aab8e907c0531 100644 --- a/code/modules/mob/living/simple_animal/slime/death.dm +++ b/code/modules/mob/living/simple_animal/slime/death.dm @@ -37,7 +37,7 @@ /mob/living/simple_animal/slime/Destroy() - for(var/obj/machinery/computer/camera_advanced/xenobio/X in machines) + for(var/obj/machinery/computer/camera_advanced/xenobio/X in GLOB.machines) if(src in X.stored_slimes) X.stored_slimes -= src return ..() diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index 6910fe6df1de4..eaee4a6b6223f 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -383,7 +383,7 @@ if (holding_still) holding_still = max(holding_still - hungry, 0) else if(canmove && isturf(loc) && prob(50)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) else if(holding_still) @@ -391,7 +391,7 @@ else if (docile && pulledby) holding_still = 10 else if(canmove && isturf(loc) && prob(33)) - step(src, pick(cardinal)) + step(src, pick(GLOB.cardinal)) else if(!AIproc) INVOKE_ASYNC(src, .proc/AIprocess) diff --git a/code/modules/mob/living/simple_animal/slime/slime.dm b/code/modules/mob/living/simple_animal/slime/slime.dm index b3e664c89d95f..1fc6ff2e78b48 100644 --- a/code/modules/mob/living/simple_animal/slime/slime.dm +++ b/code/modules/mob/living/simple_animal/slime/slime.dm @@ -1,9 +1,3 @@ -var/list/slime_colours = list("rainbow", "grey", "purple", "metal", "orange", - "blue", "dark blue", "dark purple", "yellow", "silver", "pink", "red", - "gold", "green", "adamantine", "oil", "light pink", "bluespace", - "cerulean", "sepia", "black", "pyrite") - - /mob/living/simple_animal/slime name = "grey baby slime (123)" icon = 'icons/mob/slimes.dmi' @@ -76,6 +70,11 @@ var/list/slime_colours = list("rainbow", "grey", "purple", "metal", "orange", var/coretype = /obj/item/slime_extract/grey var/list/slime_mutation[4] + var/static/list/slime_colours = list("rainbow", "grey", "purple", "metal", "orange", + "blue", "dark blue", "dark purple", "yellow", "silver", "pink", "red", + "gold", "green", "adamantine", "oil", "light pink", "bluespace", + "cerulean", "sepia", "black", "pyrite") + /mob/living/simple_animal/slime/Initialize(mapload, new_colour="grey", new_is_adult=FALSE) var/datum/action/innate/slime/feed/F = new F.Grant(src) diff --git a/code/modules/mob/living/taste.dm b/code/modules/mob/living/taste.dm index 7d570e008f685..45fdf55fb4514 100644 --- a/code/modules/mob/living/taste.dm +++ b/code/modules/mob/living/taste.dm @@ -22,7 +22,7 @@ // We dont want to spam the same message over and over again at the // person. Give it a bit of a buffer. if(hallucination > 50 && prob(25)) - text_output = pick("spiders","[pick(wire_colors)]","dreams","nightmares","the future","the past","victory",\ + text_output = pick("spiders","dreams","nightmares","the future","the past","victory",\ "defeat","pain","bliss","revenge","poison","time","space","death","life","truth","lies","justice","memory",\ "regrets","your soul","suffering","music","noise","blood","hunger","the american way") if(text_output != last_taste_text || last_taste_time + 100 < world.time) diff --git a/code/modules/mob/living/ventcrawling.dm b/code/modules/mob/living/ventcrawling.dm index a157e06402fb1..a1430f6cd4336 100644 --- a/code/modules/mob/living/ventcrawling.dm +++ b/code/modules/mob/living/ventcrawling.dm @@ -1,5 +1,5 @@ -var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary/vent_pump, /obj/machinery/atmospherics/components/unary/vent_scrubber) +GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/components/unary/vent_pump, /obj/machinery/atmospherics/components/unary/vent_scrubber)) //VENTCRAWLING @@ -32,7 +32,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/components/unary if(!vent_found) for(var/obj/machinery/atmospherics/machine in range(1,src)) - if(is_type_in_list(machine, ventcrawl_machinery)) + if(is_type_in_list(machine, GLOB.ventcrawl_machinery)) vent_found = machine if(!vent_found.can_crawl_through()) diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index e14419a491917..754be99450865 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -1,5 +1,5 @@ /mob/Login() - player_list |= src + GLOB.player_list |= src lastKnownIP = client.address computer_id = client.computer_id log_access("Mob Login: [key_name(src)] was assigned to a [type]") @@ -28,7 +28,7 @@ reload_fullscreen() // Reload any fullscreen overlays this mob has. - if(ckey in deadmins) + if(ckey in GLOB.deadmins) verbs += /client/proc/readmin add_click_catcher() diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index cf5d167a16de2..0a6fcb00171db 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -1,10 +1,10 @@ /mob/Logout() SStgui.on_logout(src) unset_machine() - player_list -= src - if(admin_datums[src.ckey]) + GLOB.player_list -= src + if(GLOB.admin_datums[src.ckey]) if (SSticker && SSticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing. - var/admins_number = admins.len + var/admins_number = GLOB.admins.len if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell. var/cheesy_message = pick( list( \ "I have no admins online!",\ diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index d9de0686e6e98..01be8584aee45 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1,8 +1,8 @@ /mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game. - mob_list -= src - dead_mob_list -= src - living_mob_list -= src - all_clockwork_mobs -= src + GLOB.mob_list -= src + GLOB.dead_mob_list -= src + GLOB.living_mob_list -= src + GLOB.all_clockwork_mobs -= src if(observers && observers.len) for(var/M in observers) var/mob/dead/observe = M @@ -19,14 +19,13 @@ ..() return QDEL_HINT_HARDDEL -var/next_mob_id = 0 /mob/Initialize() tag = "mob_[next_mob_id++]" - mob_list += src + GLOB.mob_list += src if(stat == DEAD) - dead_mob_list += src + GLOB.dead_mob_list += src else - living_mob_list += src + GLOB.living_mob_list += src prepare_huds() can_ride_typecache = typecacheof(can_ride_typecache) ..() @@ -429,7 +428,7 @@ var/next_mob_id = 0 set name = "Respawn" set category = "OOC" - if (!( abandon_allowed )) + if (!( GLOB.abandon_allowed )) return if ((stat != 2 || !( SSticker ))) to_chat(usr, "You must be dead to use this!") @@ -573,6 +572,7 @@ var/next_mob_id = 0 stat("Location:", "([x], [y], [z])") stat("CPU:", "[world.cpu]") stat("Instances:", "[world.contents.len]") + GLOB.stat_entry() config.stat_entry() stat(null) if(Master) @@ -587,7 +587,7 @@ var/next_mob_id = 0 stat(null) for(var/datum/controller/subsystem/SS in Master.subsystems) SS.stat_entry() - cameranet.stat_entry() + GLOB.cameranet.stat_entry() if(listed_turf && client) if(!TurfAdjacent(listed_turf)) @@ -865,7 +865,7 @@ var/next_mob_id = 0 return FALSE -//This will update a mob's name, real_name, mind.name, data_core records, pda, id and traitor text +//This will update a mob's name, real_name, mind.name, GLOB.data_core records, pda, id and traitor text //Calling this proc without an oldname will only update the mob and skip updating the pda, id and records ~Carn /mob/proc/fully_replace_character_name(oldname,newname) if(!newname) @@ -889,7 +889,7 @@ var/next_mob_id = 0 obj.update_explanation_text() return 1 -//Updates data_core records with new name , see mob/living/carbon/human +//Updates GLOB.data_core records with new name , see mob/living/carbon/human /mob/proc/replace_records_name(oldname,newname) return @@ -927,11 +927,11 @@ var/next_mob_id = 0 switch(var_name) if("stat") if((stat == DEAD) && (var_value < DEAD))//Bringing the dead back to life - dead_mob_list -= src - living_mob_list += src + GLOB.dead_mob_list -= src + GLOB.living_mob_list += src if((stat < DEAD) && (var_value == DEAD))//Kill he - living_mob_list -= src - dead_mob_list += src + GLOB.living_mob_list -= src + GLOB.dead_mob_list += src . = ..() switch(var_name) if("weakened") diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index ef416c938fc58..cce92825d72c7 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -8,6 +8,8 @@ var/datum/mind/mind var/list/datum/action/actions = list() + var/static/next_mob_id = 0 + var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index c24cff34d039d..3f8ab79fa9dc0 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -269,14 +269,13 @@ It's fairly easy to fix if dealing with single letters but not so much with comp /proc/findname(msg) if(!istext(msg)) msg = "[msg]" - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.real_name == msg) return M return 0 -var/static/regex/firstname = new("^\[^\\s-\]+") //First word before whitespace or "-" - /mob/proc/first_name() + var/static/regex/firstname = new("^\[^\\s-\]+") //First word before whitespace or "-" firstname.Find(real_name) return firstname.match @@ -381,7 +380,7 @@ var/static/regex/firstname = new("^\[^\\s-\]+") //First word before whitespace o /proc/notify_ghosts(var/message, var/ghost_sound = null, var/enter_link = null, var/atom/source = null, var/image/alert_overlay = null, var/action = NOTIFY_JUMP, flashwindow = TRUE) //Easy notification of ghosts. if(SSatoms.initialized != INITIALIZATION_INNEW_REGULAR) //don't notify for objects created during a map load return - for(var/mob/dead/observer/O in player_list) + for(var/mob/dead/observer/O in GLOB.player_list) if(O.client) to_chat(O, "[message][(enter_link) ? " [enter_link]" : ""]") if(ghost_sound) diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 9fa225f26dc5b..c8ed520c28dc5 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -163,7 +163,7 @@ if(mob.confused) if(mob.confused > 40) - step(mob, pick(cardinal)) + step(mob, pick(GLOB.cardinal)) else if(prob(mob.confused * 1.5)) step(mob, angle2dir(dir2angle(direct) + pick(90, -90))) else if(prob(mob.confused * 3)) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index c6449c7b5a3fe..413bda94969ae 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -2,7 +2,7 @@ /mob/verb/say_verb(message as text) set name = "Say" set category = "IC" - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return usr.say(message) @@ -11,7 +11,7 @@ /mob/verb/whisper_verb(message as text) set name = "Whisper" set category = "IC" - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return whisper(message) @@ -23,7 +23,7 @@ set name = "Me" set category = "IC" - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return @@ -35,7 +35,7 @@ var/name = real_name var/alt_name = "" - if(say_disabled) //This is here to try to identify lag problems + if(GLOB.say_disabled) //This is here to try to identify lag problems to_chat(usr, "Speech is currently admin-disabled.") return diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 943fba1952913..300ed47ead8f3 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -57,7 +57,7 @@ if(tr_flags & TR_KEEPSE) O.dna.struc_enzymes = dna.struc_enzymes - var/datum/mutation/human/race/R = mutations_list[RACEMUT] + var/datum/mutation/human/race/R = GLOB.mutations_list[RACEMUT] O.dna.struc_enzymes = R.set_se(O.dna.struc_enzymes, on=1)//we don't want to keep the race block inactive if(suiciding) @@ -205,7 +205,7 @@ if(tr_flags & TR_KEEPSE) O.dna.struc_enzymes = dna.struc_enzymes - var/datum/mutation/human/race/R = mutations_list[RACEMUT] + var/datum/mutation/human/race/R = GLOB.mutations_list[RACEMUT] O.dna.struc_enzymes = R.set_se(O.dna.struc_enzymes, on=0)//we don't want to keep the race block active O.domutcheck() @@ -311,21 +311,21 @@ stop_sound_channel(CHANNEL_LOBBYMUSIC) var/turf/loc_landmark - for(var/obj/effect/landmark/start/sloc in landmarks_list) + for(var/obj/effect/landmark/start/sloc in GLOB.landmarks_list) if(sloc.name != "AI") continue if(locate(/mob/living/silicon/ai) in sloc.loc) continue loc_landmark = sloc.loc if(!loc_landmark) - for(var/obj/effect/landmark/tripai in landmarks_list) + for(var/obj/effect/landmark/tripai in GLOB.landmarks_list) if(tripai.name == "tripai") if(locate(/mob/living/silicon/ai) in tripai.loc) continue loc_landmark = tripai.loc if(!loc_landmark) to_chat(src, "Oh god sorry we can't find an unoccupied AI spawn location, so we're spawning you on top of someone.") - for(var/obj/effect/landmark/start/sloc in landmarks_list) + for(var/obj/effect/landmark/start/sloc in GLOB.landmarks_list) if (sloc.name == "AI") loc_landmark = sloc.loc diff --git a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm index 55998071e7135..c4ef258ae3849 100644 --- a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm +++ b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm @@ -1,5 +1,3 @@ -var/global/static/ntnrc_uid = 0 - /datum/ntnet_conversation var/id = null var/title = "Untitled Conversation" @@ -7,17 +5,17 @@ var/global/static/ntnrc_uid = 0 var/list/messages = list() var/list/clients = list() var/password + var/static/ntnrc_uid = 0 /datum/ntnet_conversation/New() - id = ntnrc_uid - ntnrc_uid++ - if(ntnet_global) - ntnet_global.chat_channels.Add(src) + id = ntnrc_uid++ + if(GLOB.ntnet_global) + GLOB.ntnet_global.chat_channels.Add(src) ..() /datum/ntnet_conversation/Destroy() - if(ntnet_global) - ntnet_global.chat_channels.Remove(src) + if(GLOB.ntnet_global) + GLOB.ntnet_global.chat_channels.Remove(src) return ..() /datum/ntnet_conversation/proc/add_message(message, username) diff --git a/code/modules/modular_computers/NTNet/NTNet.dm b/code/modules/modular_computers/NTNet/NTNet.dm index 6816a402c70ff..033b32d6afe98 100644 --- a/code/modules/modular_computers/NTNet/NTNet.dm +++ b/code/modules/modular_computers/NTNet/NTNet.dm @@ -1,4 +1,4 @@ -var/global/datum/ntnet/ntnet_global = new() +GLOBAL_DATUM_INIT(ntnet_global, /datum/ntnet, new) // This is the NTNet datum. There can be only one NTNet datum in game at once. Modular computers read data from this. @@ -26,9 +26,9 @@ var/global/datum/ntnet/ntnet_global = new() // If new NTNet datum is spawned, it replaces the old one. /datum/ntnet/New() - if(ntnet_global && (ntnet_global != src)) - ntnet_global = src // There can be only one. - for(var/obj/machinery/ntnet_relay/R in machines) + if(GLOB.ntnet_global && (GLOB.ntnet_global != src)) + GLOB.ntnet_global = src // There can be only one. + for(var/obj/machinery/ntnet_relay/R in GLOB.machines) relays.Add(R) R.NTNet = src build_software_lists() diff --git a/code/modules/modular_computers/NTNet/NTNet_relay.dm b/code/modules/modular_computers/NTNet/NTNet_relay.dm index 9269459308ea1..9a864331edd73 100644 --- a/code/modules/modular_computers/NTNet/NTNet_relay.dm +++ b/code/modules/modular_computers/NTNet/NTNet_relay.dm @@ -51,15 +51,15 @@ if((dos_overload > dos_capacity) && !dos_failure) dos_failure = 1 update_icon() - ntnet_global.add_log("Quantum relay switched from normal operation mode to overload recovery mode.") + GLOB.ntnet_global.add_log("Quantum relay switched from normal operation mode to overload recovery mode.") // If the DoS buffer reaches 0 again, restart. if((dos_overload == 0) && dos_failure) dos_failure = 0 update_icon() - ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.") + GLOB.ntnet_global.add_log("Quantum relay switched from overload recovery mode to normal operation mode.") ..() -/obj/machinery/ntnet_relay/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/obj/machinery/ntnet_relay/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) @@ -85,10 +85,10 @@ dos_overload = 0 dos_failure = 0 update_icon() - ntnet_global.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.") + GLOB.ntnet_global.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.") if("toggle") enabled = !enabled - ntnet_global.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].") + GLOB.ntnet_global.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].") update_icon() @@ -102,16 +102,16 @@ var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/ntnet_relay(null) B.apply_default_parts(src) - if(ntnet_global) - ntnet_global.relays.Add(src) - NTNet = ntnet_global - ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]") + if(GLOB.ntnet_global) + GLOB.ntnet_global.relays.Add(src) + NTNet = GLOB.ntnet_global + GLOB.ntnet_global.add_log("New quantum relay activated. Current amount of linked relays: [NTNet.relays.len]") ..() /obj/machinery/ntnet_relay/Destroy() - if(ntnet_global) - ntnet_global.relays.Remove(src) - ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]") + if(GLOB.ntnet_global) + GLOB.ntnet_global.relays.Remove(src) + GLOB.ntnet_global.add_log("Quantum relay connection severed. Current amount of linked relays: [NTNet.relays.len]") NTNet = null for(var/datum/computer_file/program/ntnet_dos/D in dos_sources) diff --git a/code/modules/modular_computers/computers/item/computer.dm b/code/modules/modular_computers/computers/item/computer.dm index de6c2b74cae7f..32513d0405c9a 100644 --- a/code/modules/modular_computers/computers/item/computer.dm +++ b/code/modules/modular_computers/computers/item/computer.dm @@ -357,7 +357,7 @@ if(!get_ntnet_status()) return FALSE var/obj/item/weapon/computer_hardware/network_card/network_card = all_components[MC_NET] - return ntnet_global.add_log(text, network_card) + return GLOB.ntnet_global.add_log(text, network_card) /obj/item/device/modular_computer/proc/shutdown_computer(loud = 1) kill_program(forced = TRUE) diff --git a/code/modules/modular_computers/computers/item/computer_power.dm b/code/modules/modular_computers/computers/item/computer_power.dm index c5aab99ce5777..c03570c335330 100644 --- a/code/modules/modular_computers/computers/item/computer_power.dm +++ b/code/modules/modular_computers/computers/item/computer_power.dm @@ -13,10 +13,10 @@ if(battery_module && battery_module.battery && battery_module.battery.charge) var/obj/item/weapon/stock_parts/cell/cell = battery_module.battery - if(cell.use(amount * CELLRATE)) + if(cell.use(amount * GLOB.CELLRATE)) return TRUE else // Discharge the cell anyway. - cell.use(min(amount*CELLRATE, cell.charge)) + cell.use(min(amount*GLOB.CELLRATE, cell.charge)) return FALSE return FALSE diff --git a/code/modules/modular_computers/computers/item/computer_ui.dm b/code/modules/modular_computers/computers/item/computer_ui.dm index 304a9877c695b..c574b759cb423 100644 --- a/code/modules/modular_computers/computers/item/computer_ui.dm +++ b/code/modules/modular_computers/computers/item/computer_ui.dm @@ -1,5 +1,5 @@ // Operates TGUI -/obj/item/device/modular_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/obj/item/device/modular_computer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) if(!enabled) if(ui) ui.close() diff --git a/code/modules/modular_computers/computers/machinery/modular_computer.dm b/code/modules/modular_computers/computers/machinery/modular_computer.dm index 2a9d58f485610..b7b258d1efa41 100644 --- a/code/modules/modular_computers/computers/machinery/modular_computer.dm +++ b/code/modules/modular_computers/computers/machinery/modular_computer.dm @@ -1,6 +1,3 @@ -// Global var to track modular computers -var/list/global_modular_computers = list() - // Modular Computer - device that runs various programs and operates with hardware // DO NOT SPAWN THIS TYPE. Use /laptop/ or /console/ instead. /obj/machinery/modular_computer @@ -34,7 +31,6 @@ var/list/global_modular_computers = list() ..() cpu = new(src) cpu.physical = src - global_modular_computers.Add(src) /obj/machinery/modular_computer/Destroy() if(cpu) diff --git a/code/modules/modular_computers/file_system/computer_file.dm b/code/modules/modular_computers/file_system/computer_file.dm index 40860cb58e0c2..ce20cc450cc04 100644 --- a/code/modules/modular_computers/file_system/computer_file.dm +++ b/code/modules/modular_computers/file_system/computer_file.dm @@ -1,5 +1,3 @@ -var/global/file_uid = 0 - /datum/computer_file var/filename = "NewFile" // Placeholder. No spacebars var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case @@ -8,11 +6,11 @@ var/global/file_uid = 0 var/unsendable = 0 // Whether the file may be sent to someone via NTNet transfer or other means. var/undeletable = 0 // Whether the file may be deleted. Setting to 1 prevents deletion/renaming/etc. var/uid // UID of this file + var/static/file_uid = 0 /datum/computer_file/New() ..() - uid = file_uid - file_uid++ + uid = file_uid++ /datum/computer_file/Destroy() if(!holder) diff --git a/code/modules/modular_computers/file_system/program.dm b/code/modules/modular_computers/file_system/program.dm index 51afc6371d67c..3935112e7b5bf 100644 --- a/code/modules/modular_computers/file_system/program.dm +++ b/code/modules/modular_computers/file_system/program.dm @@ -144,7 +144,7 @@ // This is called every tick when the program is enabled. Ensure you do parent call if you override it. If parent returns 1 continue with UI initialisation. -/datum/computer_file/program/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) if(program_state != PROGRAM_STATE_ACTIVE) // Our program was closed. Close the ui if it exists. return computer.ui_interact(user) return 1 diff --git a/code/modules/modular_computers/file_system/programs/airestorer.dm b/code/modules/modular_computers/file_system/programs/airestorer.dm index 5c9917b4f5106..96a4b4ec2b8bd 100644 --- a/code/modules/modular_computers/file_system/programs/airestorer.dm +++ b/code/modules/modular_computers/file_system/programs/airestorer.dm @@ -8,7 +8,7 @@ size = 12 requires_ntnet = 0 usage_flags = PROGRAM_CONSOLE - transfer_access = access_heads + transfer_access = GLOB.access_heads available_on_ntnet = 1 var/restoring = FALSE @@ -114,7 +114,7 @@ return data -/datum/computer_file/program/aidiag/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/aidiag/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "ai_restorer", "Integrity Restorer", 600, 400, master_ui, state) diff --git a/code/modules/modular_computers/file_system/programs/alarm.dm b/code/modules/modular_computers/file_system/programs/alarm.dm index 0d15e2306962c..9bfb9a5e7bf55 100644 --- a/code/modules/modular_computers/file_system/programs/alarm.dm +++ b/code/modules/modular_computers/file_system/programs/alarm.dm @@ -31,7 +31,7 @@ /datum/computer_file/program/alarm_monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "station_alert_prog", "Alarm Monitoring", 300, 500, master_ui, state) @@ -103,8 +103,8 @@ /datum/computer_file/program/alarm_monitor/run_program(mob/user) . = ..(user) - alarmdisplay += src + GLOB.alarmdisplay += src /datum/computer_file/program/alarm_monitor/kill_program(forced = FALSE) - alarmdisplay -= src + GLOB.alarmdisplay -= src ..() \ No newline at end of file diff --git a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm index 3d54938ba11ee..ee1498fd7998d 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/dos.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/dos.dm @@ -37,7 +37,7 @@ ..() -/datum/computer_file/program/ntnet_dos/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/ntnet_dos/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) @@ -53,7 +53,7 @@ return 1 switch(action) if("PRG_target_relay") - for(var/obj/machinery/ntnet_relay/R in ntnet_global.relays) + for(var/obj/machinery/ntnet_relay/R in GLOB.ntnet_global.relays) if("[R.uid]" == params["targid"]) target = R return 1 @@ -68,14 +68,14 @@ if(target) executed = 1 target.dos_sources.Add(src) - if(ntnet_global.intrusion_detection_enabled) + if(GLOB.ntnet_global.intrusion_detection_enabled) var/obj/item/weapon/computer_hardware/network_card/network_card = computer.all_components[MC_NET] - ntnet_global.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [network_card.get_network_tag()]") - ntnet_global.intrusion_detection_alarm = 1 + GLOB.ntnet_global.add_log("IDS WARNING - Excess traffic flood targeting relay [target.uid] detected from device: [network_card.get_network_tag()]") + GLOB.ntnet_global.intrusion_detection_alarm = 1 return 1 /datum/computer_file/program/ntnet_dos/ui_data(mob/user) - if(!ntnet_global) + if(!GLOB.ntnet_global) return var/list/data = list() @@ -100,7 +100,7 @@ data["dos_strings"] += list(list("nums" = string)) else data["relays"] = list() - for(var/obj/machinery/ntnet_relay/R in ntnet_global.relays) + for(var/obj/machinery/ntnet_relay/R in GLOB.ntnet_global.relays) data["relays"] += list(list("id" = R.uid)) data["focus"] = target ? target.uid : null diff --git a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm index 4278159d1a934..ea6a36b549ecd 100644 --- a/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm +++ b/code/modules/modular_computers/file_system/programs/antagonist/revelation.dm @@ -58,7 +58,7 @@ temp.armed = armed return temp -/datum/computer_file/program/revelation/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/revelation/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) diff --git a/code/modules/modular_computers/file_system/programs/card.dm b/code/modules/modular_computers/file_system/programs/card.dm index 792c79f4639a1..b959ced6cf4b2 100644 --- a/code/modules/modular_computers/file_system/programs/card.dm +++ b/code/modules/modular_computers/file_system/programs/card.dm @@ -3,7 +3,7 @@ filedesc = "ID card modification program" program_icon_state = "id" extended_desc = "Program for programming employee ID cards to access parts of the station." - transfer_access = access_change_ids + transfer_access = GLOB.access_change_ids requires_ntnet = 0 size = 8 var/mod_mode = 1 @@ -52,8 +52,8 @@ /datum/computer_file/program/card_mod/proc/can_open_job(datum/job/job) if(job) if(!job_blacklisted(job.title)) - if((job.total_positions <= player_list.len * (max_relative_positions / 100))) - var/delta = (world.time / 10) - time_last_changed_position + if((job.total_positions <= GLOB.player_list.len * (max_relative_positions / 100))) + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] < 0)) return 1 return -2 @@ -65,7 +65,7 @@ if(job) if(!job_blacklisted(job.title)) if(job.total_positions > job.current_positions) - var/delta = (world.time / 10) - time_last_changed_position + var/delta = (world.time / 10) - GLOB.time_last_changed_position if((change_position_cooldown < delta) || (opened_positions[job.title] > 0)) return 1 return -2 @@ -73,7 +73,7 @@ return 0 -/datum/computer_file/program/card_mod/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/card_mod/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) @@ -161,7 +161,7 @@ else var/contents = {"

    Crew Manifest


    - [data_core ? data_core.get_manifest(0) : ""] + [GLOB.data_core ? GLOB.data_core.get_manifest(0) : ""] "} if(!printer.print_text(contents,text("crew manifest ([])", worldtime2text()))) to_chat(usr, "Hardware error: Printer was unable to print the file. It may be out of paper.") @@ -174,7 +174,7 @@ switch(select) if("id") if(id_card) - data_core.manifest_modify(id_card.registered_name, id_card.assignment) + GLOB.data_core.manifest_modify(id_card.registered_name, id_card.assignment) card_slot.try_eject(1, user) else var/obj/item/I = usr.get_active_held_item() @@ -186,7 +186,7 @@ if("auth") if(auth_card) if(id_card) - data_core.manifest_modify(id_card.registered_name, id_card.assignment) + GLOB.data_core.manifest_modify(id_card.registered_name, id_card.assignment) head_subordinates = null region_access = null authenticated = 0 @@ -260,7 +260,7 @@ if(can_open_job(j) != 1) return 0 if(opened_positions[edit_job_target] >= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions++ opened_positions[edit_job_target]++ if("PRG_close_job") @@ -272,7 +272,7 @@ return 0 //Allow instant closing without cooldown if a position has been opened before if(opened_positions[edit_job_target] <= 0) - time_last_changed_position = world.time / 10 + GLOB.time_last_changed_position = world.time / 10 j.total_positions-- opened_positions[edit_job_target]-- if("PRG_regsel") @@ -344,7 +344,7 @@ if(!mod_mode) data["manifest"] = list() var/list/crew = list() - for(var/datum/data/record/t in sortRecord(data_core.general)) + for(var/datum/data/record/t in sortRecord(GLOB.data_core.general)) crew.Add(list(list( "name" = t.fields["name"], "rank" = t.fields["rank"]))) @@ -376,12 +376,12 @@ data["id_name"] = id_card ? strip_html_simple(id_card.name) : "-----" if(show_assignments) - data["engineering_jobs"] = format_jobs(engineering_positions) - data["medical_jobs"] = format_jobs(medical_positions) - data["science_jobs"] = format_jobs(science_positions) - data["security_jobs"] = format_jobs(security_positions) - data["cargo_jobs"] = format_jobs(supply_positions) - data["civilian_jobs"] = format_jobs(civilian_positions) + data["engineering_jobs"] = format_jobs(GLOB.engineering_positions) + data["medical_jobs"] = format_jobs(GLOB.medical_positions) + data["science_jobs"] = format_jobs(GLOB.science_positions) + data["security_jobs"] = format_jobs(GLOB.security_positions) + data["cargo_jobs"] = format_jobs(GLOB.supply_positions) + data["civilian_jobs"] = format_jobs(GLOB.civilian_positions) data["centcom_jobs"] = format_jobs(get_all_centcom_jobs()) @@ -435,7 +435,7 @@ out = "[open ? "Open Position" : "Close Position"]" enable = 1 else if(can_change == -2) - var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - time_last_changed_position), 1) + var/time_to_wait = round(change_position_cooldown - ((world.time / 10) - GLOB.time_last_changed_position), 1) var/mins = round(time_to_wait / 60) var/seconds = time_to_wait - (60*mins) out = "Cooldown ongoing: [mins]:[(seconds < 10) ? "0[seconds]" : "[seconds]"]" @@ -457,20 +457,20 @@ authenticated = 1 return 1 else - if((access_hop in auth_card.access) && ((target_dept==1) || !target_dept)) + if((GLOB.access_hop in auth_card.access) && ((target_dept==1) || !target_dept)) region_access |= 1 region_access |= 6 get_subordinates("Head of Personnel") - if((access_hos in auth_card.access) && ((target_dept==2) || !target_dept)) + if((GLOB.access_hos in auth_card.access) && ((target_dept==2) || !target_dept)) region_access |= 2 get_subordinates("Head of Security") - if((access_cmo in auth_card.access) && ((target_dept==3) || !target_dept)) + if((GLOB.access_cmo in auth_card.access) && ((target_dept==3) || !target_dept)) region_access |= 3 get_subordinates("Chief Medical Officer") - if((access_rd in auth_card.access) && ((target_dept==4) || !target_dept)) + if((GLOB.access_rd in auth_card.access) && ((target_dept==4) || !target_dept)) region_access |= 4 get_subordinates("Research Director") - if((access_ce in auth_card.access) && ((target_dept==5) || !target_dept)) + if((GLOB.access_ce in auth_card.access) && ((target_dept==5) || !target_dept)) region_access |= 5 get_subordinates("Chief Engineer") if(region_access.len) diff --git a/code/modules/modular_computers/file_system/programs/configurator.dm b/code/modules/modular_computers/file_system/programs/configurator.dm index 57348d274414a..dc8b5ac97d201 100644 --- a/code/modules/modular_computers/file_system/programs/configurator.dm +++ b/code/modules/modular_computers/file_system/programs/configurator.dm @@ -15,7 +15,7 @@ var/obj/item/device/modular_computer/movable = null -/datum/computer_file/program/computerconfig/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/computerconfig/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) diff --git a/code/modules/modular_computers/file_system/programs/file_browser.dm b/code/modules/modular_computers/file_system/programs/file_browser.dm index c2cbd4cf5eb17..0271b4ad8e760 100644 --- a/code/modules/modular_computers/file_system/programs/file_browser.dm +++ b/code/modules/modular_computers/file_system/programs/file_browser.dm @@ -144,7 +144,7 @@ t = replacetext(t, "\[u\]", "") t = replacetext(t, "\[/u\]", "") t = replacetext(t, "\[time\]", "[worldtime2text()]") - t = replacetext(t, "\[date\]", "[time2text(world.realtime, "MMM DD")] [year_integer+540]") + t = replacetext(t, "\[date\]", "[time2text(world.realtime, "MMM DD")] [GLOB.year_integer+540]") t = replacetext(t, "\[large\]", "") t = replacetext(t, "\[/large\]", "") t = replacetext(t, "\[h1\]", "

    ") @@ -176,7 +176,7 @@ t = parse_tags(t) return t -/datum/computer_file/program/filemanager/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/filemanager/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) diff --git a/code/modules/modular_computers/file_system/programs/ntdownloader.dm b/code/modules/modular_computers/file_system/programs/ntdownloader.dm index 01d5dd3d918b9..d9255b17ee185 100644 --- a/code/modules/modular_computers/file_system/programs/ntdownloader.dm +++ b/code/modules/modular_computers/file_system/programs/ntdownloader.dm @@ -21,7 +21,7 @@ if(downloaded_file) return 0 - var/datum/computer_file/program/PRG = ntnet_global.find_ntnet_file_by_name(filename) + var/datum/computer_file/program/PRG = GLOB.ntnet_global.find_ntnet_file_by_name(filename) if(!PRG || !istype(PRG)) return 0 @@ -37,10 +37,10 @@ ui_header = "downloader_running.gif" - if(PRG in ntnet_global.available_station_software) + if(PRG in GLOB.ntnet_global.available_station_software) generate_network_log("Began downloading file [PRG.filename].[PRG.filetype] from NTNet Software Repository.") hacked_download = 0 - else if(PRG in ntnet_global.available_antag_software) + else if(PRG in GLOB.ntnet_global.available_antag_software) generate_network_log("Began downloading file **ENCRYPTED**.[PRG.filetype] from unspecified server.") hacked_download = 1 else @@ -103,7 +103,7 @@ return 1 return 0 -/datum/computer_file/program/ntnetdownload/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/ntnetdownload/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) @@ -136,7 +136,7 @@ data["disk_size"] = hard_drive.max_capacity data["disk_used"] = hard_drive.used_capacity var/list/all_entries[0] - for(var/A in ntnet_global.available_station_software) + for(var/A in GLOB.ntnet_global.available_station_software) var/datum/computer_file/program/P = A // Only those programs our user can run will show in the list if(!P.can_run(user,transfer = 1)) @@ -151,7 +151,7 @@ data["hackedavailable"] = 0 if(computer.emagged) // If we are running on emagged computer we have access to some "bonus" software var/list/hacked_programs[0] - for(var/S in ntnet_global.available_antag_software) + for(var/S in GLOB.ntnet_global.available_antag_software) var/datum/computer_file/program/P = S data["hackedavailable"] = 1 hacked_programs.Add(list(list( diff --git a/code/modules/modular_computers/file_system/programs/ntmonitor.dm b/code/modules/modular_computers/file_system/programs/ntmonitor.dm index e12299b250be9..6661bceac4f31 100644 --- a/code/modules/modular_computers/file_system/programs/ntmonitor.dm +++ b/code/modules/modular_computers/file_system/programs/ntmonitor.dm @@ -5,10 +5,10 @@ extended_desc = "This program monitors stationwide NTNet network, provides access to logging systems, and allows for configuration changes" size = 12 requires_ntnet = 1 - required_access = access_network //Network control is a more secure program. + required_access = GLOB.access_network //Network control is a more secure program. available_on_ntnet = 1 -/datum/computer_file/program/ntnetmonitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/ntnetmonitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) @@ -28,22 +28,22 @@ switch(action) if("resetIDS") . = 1 - if(ntnet_global) - ntnet_global.resetIDS() + if(GLOB.ntnet_global) + GLOB.ntnet_global.resetIDS() return 1 if("toggleIDS") . = 1 - if(ntnet_global) - ntnet_global.toggleIDS() + if(GLOB.ntnet_global) + GLOB.ntnet_global.toggleIDS() return 1 if("toggleWireless") . = 1 - if(!ntnet_global) + if(!GLOB.ntnet_global) return 1 // NTNet is disabled. Enabling can be done without user prompt - if(ntnet_global.setting_disabled) - ntnet_global.setting_disabled = 0 + if(GLOB.ntnet_global.setting_disabled) + GLOB.ntnet_global.setting_disabled = 0 return 1 // NTNet is enabled and user is about to shut it down. Let's ask them if they really want to do it, as wirelessly connected computers won't connect without NTNet being enabled (which may prevent people from turning it back on) @@ -52,43 +52,43 @@ return 1 var/response = alert(user, "Really disable NTNet wireless? If your computer is connected wirelessly you won't be able to turn it back on! This will affect all connected wireless devices.", "NTNet shutdown", "Yes", "No") if(response == "Yes") - ntnet_global.setting_disabled = 1 + GLOB.ntnet_global.setting_disabled = 1 return 1 if("purgelogs") . = 1 - if(ntnet_global) - ntnet_global.purge_logs() + if(GLOB.ntnet_global) + GLOB.ntnet_global.purge_logs() if("updatemaxlogs") . = 1 var/mob/user = usr var/logcount = text2num(input(user,"Enter amount of logs to keep in memory ([MIN_NTNET_LOGS]-[MAX_NTNET_LOGS]):")) - if(ntnet_global) - ntnet_global.update_max_log_count(logcount) + if(GLOB.ntnet_global) + GLOB.ntnet_global.update_max_log_count(logcount) if("toggle_function") . = 1 - if(!ntnet_global) + if(!GLOB.ntnet_global) return 1 - ntnet_global.toggle_function(text2num(params["id"])) + GLOB.ntnet_global.toggle_function(text2num(params["id"])) /datum/computer_file/program/ntnetmonitor/ui_data(mob/user) - if(!ntnet_global) + if(!GLOB.ntnet_global) return var/list/data = get_header_data() - data["ntnetstatus"] = ntnet_global.check_function() - data["ntnetrelays"] = ntnet_global.relays.len - data["idsstatus"] = ntnet_global.intrusion_detection_enabled - data["idsalarm"] = ntnet_global.intrusion_detection_alarm + data["ntnetstatus"] = GLOB.ntnet_global.check_function() + data["ntnetrelays"] = GLOB.ntnet_global.relays.len + data["idsstatus"] = GLOB.ntnet_global.intrusion_detection_enabled + data["idsalarm"] = GLOB.ntnet_global.intrusion_detection_alarm - data["config_softwaredownload"] = ntnet_global.setting_softwaredownload - data["config_peertopeer"] = ntnet_global.setting_peertopeer - data["config_communication"] = ntnet_global.setting_communication - data["config_systemcontrol"] = ntnet_global.setting_systemcontrol + data["config_softwaredownload"] = GLOB.ntnet_global.setting_softwaredownload + data["config_peertopeer"] = GLOB.ntnet_global.setting_peertopeer + data["config_communication"] = GLOB.ntnet_global.setting_communication + data["config_systemcontrol"] = GLOB.ntnet_global.setting_systemcontrol data["ntnetlogs"] = list() - for(var/i in ntnet_global.logs) + for(var/i in GLOB.ntnet_global.logs) data["ntnetlogs"] += list(list("entry" = i)) - data["ntnetmaxlogs"] = ntnet_global.setting_maxlogcount + data["ntnetmaxlogs"] = GLOB.ntnet_global.setting_maxlogcount return data \ No newline at end of file diff --git a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm index 1b8ff8876730e..b4c7884fe71d5 100644 --- a/code/modules/modular_computers/file_system/programs/ntnrc_client.dm +++ b/code/modules/modular_computers/file_system/programs/ntnrc_client.dm @@ -37,7 +37,7 @@ if("PRG_joinchannel") . = 1 var/datum/ntnet_conversation/C - for(var/datum/ntnet_conversation/chan in ntnet_global.chat_channels) + for(var/datum/ntnet_conversation/chan in GLOB.ntnet_global.chat_channels) if(chan.id == text2num(params["id"])) C = chan break @@ -83,7 +83,7 @@ channel = null return 1 var/mob/living/user = usr - if(can_run(usr, 1, access_network)) + if(can_run(usr, 1, GLOB.access_network)) if(channel) var/response = alert(user, "Really engage admin-mode? You will be disconnected from your current channel!", "NTNRC Admin mode", "Yes", "No") if(response == "Yes") @@ -180,7 +180,7 @@ channel = null ..() -/datum/computer_file/program/chatclient/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/chatclient/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) @@ -196,7 +196,7 @@ /datum/computer_file/program/chatclient/ui_data(mob/user) - if(!ntnet_global || !ntnet_global.chat_channels) + if(!GLOB.ntnet_global || !GLOB.ntnet_global.chat_channels) return var/list/data = list() @@ -225,7 +225,7 @@ else // Channel selection screen var/list/all_channels[0] - for(var/C in ntnet_global.chat_channels) + for(var/C in GLOB.ntnet_global.chat_channels) var/datum/ntnet_conversation/conv = C if(conv && conv.title) all_channels.Add(list(list( diff --git a/code/modules/modular_computers/file_system/programs/nttransfer.dm b/code/modules/modular_computers/file_system/programs/nttransfer.dm index 7d42bb8212687..0d46755f6b8bf 100644 --- a/code/modules/modular_computers/file_system/programs/nttransfer.dm +++ b/code/modules/modular_computers/file_system/programs/nttransfer.dm @@ -1,5 +1,3 @@ -var/global/nttransfer_uid = 0 - /datum/computer_file/program/nttransfer filename = "nttransfer" filedesc = "NTNet P2P Transfer Client" @@ -22,10 +20,10 @@ var/global/nttransfer_uid = 0 var/actual_netspeed = 0 // Displayed in the UI, this is the actual transfer speed. var/unique_token // UID of this program var/upload_menu = 0 // Whether we show the program list and upload menu + var/static/nttransfer_uid = 0 /datum/computer_file/program/nttransfer/New() - unique_token = nttransfer_uid - nttransfer_uid++ + unique_token = nttransfer_uid++ ..() /datum/computer_file/program/nttransfer/process_tick() @@ -85,7 +83,7 @@ var/global/nttransfer_uid = 0 download_completion = 0 -/datum/computer_file/program/nttransfer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/computer_file/program/nttransfer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if (!ui) @@ -103,7 +101,7 @@ var/global/nttransfer_uid = 0 return 1 switch(action) if("PRG_downloadfile") - for(var/datum/computer_file/program/nttransfer/P in ntnet_global.fileservers) + for(var/datum/computer_file/program/nttransfer/P in GLOB.ntnet_global.fileservers) if("[P.unique_token]" == params["id"]) remote = P break @@ -121,8 +119,8 @@ var/global/nttransfer_uid = 0 error = "" upload_menu = 0 finalize_download() - if(src in ntnet_global.fileservers) - ntnet_global.fileservers.Remove(src) + if(src in GLOB.ntnet_global.fileservers) + GLOB.ntnet_global.fileservers.Remove(src) for(var/datum/computer_file/program/nttransfer/T in connected_clients) T.crash_download("Remote server has forcibly closed the connection") provided_file = null @@ -148,7 +146,7 @@ var/global/nttransfer_uid = 0 if(!P.can_run(usr,transfer = 1)) error = "Access Error: Insufficient rights to upload file." provided_file = F - ntnet_global.fileservers.Add(src) + GLOB.ntnet_global.fileservers.Add(src) return error = "I/O Error: Unable to locate file on hard drive." return 1 @@ -186,7 +184,7 @@ var/global/nttransfer_uid = 0 data["upload_filelist"] = all_files else var/list/all_servers[0] - for(var/datum/computer_file/program/nttransfer/P in ntnet_global.fileservers) + for(var/datum/computer_file/program/nttransfer/P in GLOB.ntnet_global.fileservers) all_servers.Add(list(list( "uid" = P.unique_token, "filename" = "[P.provided_file.filename].[P.provided_file.filetype]", diff --git a/code/modules/modular_computers/file_system/programs/powermonitor.dm b/code/modules/modular_computers/file_system/programs/powermonitor.dm index d09fe31f03d76..b9103256426da 100644 --- a/code/modules/modular_computers/file_system/programs/powermonitor.dm +++ b/code/modules/modular_computers/file_system/programs/powermonitor.dm @@ -6,7 +6,7 @@ program_icon_state = "power_monitor" extended_desc = "This program connects to sensors around the station to provide information about electrical systems" ui_header = "power_norm.gif" - transfer_access = access_engine + transfer_access = GLOB.access_engine usage_flags = PROGRAM_CONSOLE requires_ntnet = 0 network_destination = "power monitoring system" @@ -53,7 +53,7 @@ demand.Cut(1, 2) /datum/computer_file/program/power_monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/modules/modular_computers/hardware/network_card.dm b/code/modules/modular_computers/hardware/network_card.dm index 554a5084a5653..19e30cd42d2ba 100644 --- a/code/modules/modular_computers/hardware/network_card.dm +++ b/code/modules/modular_computers/hardware/network_card.dm @@ -1,5 +1,3 @@ -var/global/ntnet_card_uid = 1 - /obj/item/weapon/computer_hardware/network_card name = "network card" desc = "A basic wireless network card for usage with standard NTNet frequencies." @@ -12,6 +10,7 @@ var/global/ntnet_card_uid = 1 var/ethernet = 0 // Hard-wired, therefore always on, ignores NTNet wireless checks. malfunction_probability = 1 device_type = MC_NET + var/global/ntnet_card_uid = 1 /obj/item/weapon/computer_hardware/network_card/diagnostics(var/mob/user) ..() @@ -25,9 +24,8 @@ var/global/ntnet_card_uid = 1 to_chat(user, "OpenEth (Physical Connection) - Physical network connection port") /obj/item/weapon/computer_hardware/network_card/New(var/l) - ..(l) - identification_id = ntnet_card_uid - ntnet_card_uid++ + ..() + identification_id = ntnet_card_uid++ // Returns a string identifier of this network card /obj/item/weapon/computer_hardware/network_card/proc/get_network_tag() @@ -44,7 +42,7 @@ var/global/ntnet_card_uid = 1 if(ethernet) // Computer is connected via wired connection. return 3 - if(!ntnet_global || !ntnet_global.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal. + if(!GLOB.ntnet_global || !GLOB.ntnet_global.check_function(specific_action)) // NTNet is down and we are not connected via wired connection. No signal. return 0 if(holder) diff --git a/code/modules/modular_computers/hardware/recharger.dm b/code/modules/modular_computers/hardware/recharger.dm index 85431aaabf92a..67582334ac0a7 100644 --- a/code/modules/modular_computers/hardware/recharger.dm +++ b/code/modules/modular_computers/hardware/recharger.dm @@ -20,7 +20,7 @@ return if(use_power(charge_rate, charging=1)) - holder.give_power(charge_rate * CELLRATE) + holder.give_power(charge_rate * GLOB.CELLRATE) /obj/item/weapon/computer_hardware/recharger/APC diff --git a/code/modules/modular_computers/laptop_vendor.dm b/code/modules/modular_computers/laptop_vendor.dm index abbfc5aaba7f2..cd8219e044ce8 100644 --- a/code/modules/modular_computers/laptop_vendor.dm +++ b/code/modules/modular_computers/laptop_vendor.dm @@ -225,7 +225,7 @@ /obj/machinery/lapvend/attack_hand(mob/user) ui_interact(user) -/obj/machinery/lapvend/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/obj/machinery/lapvend/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) if(stat & (BROKEN | NOPOWER | MAINT)) if(ui) ui.close() diff --git a/code/modules/ninja/admin_ninja_verbs.dm b/code/modules/ninja/admin_ninja_verbs.dm index 7164f39c39ba9..7338d9bb0be8b 100644 --- a/code/modules/ninja/admin_ninja_verbs.dm +++ b/code/modules/ninja/admin_ninja_verbs.dm @@ -8,7 +8,7 @@ Contents: //ADMIN CREATE NINJA (From Player) -/client/proc/cmd_admin_ninjafy(mob/living/carbon/human/H in player_list) +/client/proc/cmd_admin_ninjafy(mob/living/carbon/human/H in GLOB.player_list) set category = null set name = "Make Space Ninja" @@ -49,7 +49,7 @@ Contents: if(alert("Are you sure you want to send in a space ninja?",,"Yes","No")=="No") return - var/client/C = input("Pick character to spawn as the Space Ninja", "Key", "") as null|anything in clients + var/client/C = input("Pick character to spawn as the Space Ninja", "Key", "") as null|anything in GLOB.clients if(!C) return diff --git a/code/modules/ninja/ninja_event.dm b/code/modules/ninja/ninja_event.dm index 9b802b401c8a9..e83f3a17e2e2c 100644 --- a/code/modules/ninja/ninja_event.dm +++ b/code/modules/ninja/ninja_event.dm @@ -39,7 +39,7 @@ Contents: //selecting a spawn_loc if(!spawn_loc) var/list/spawn_locs = list() - for(var/obj/effect/landmark/L in landmarks_list) + for(var/obj/effect/landmark/L in GLOB.landmarks_list) if(isturf(L.loc)) switch(L.name) if("ninjaspawn","carpspawn") @@ -69,7 +69,7 @@ Contents: if(ishuman(M.current)) if(M.special_role) possible_targets[M] = 0 //bad-guy - else if(M.assigned_role in command_positions) + else if(M.assigned_role in GLOB.command_positions) possible_targets[M] = 1 //good-guy var/list/objectives = list(1,2,3,4) @@ -168,7 +168,7 @@ Contents: /proc/create_space_ninja(spawn_loc) var/mob/living/carbon/human/new_ninja = new(spawn_loc) var/datum/preferences/A = new()//Randomize appearance for the ninja. - A.real_name = "[pick(ninja_titles)] [pick(ninja_names)]" + A.real_name = "[pick(GLOB.ninja_titles)] [pick(GLOB.ninja_names)]" A.copy_to(new_ninja) new_ninja.dna.update_dna_identity() new_ninja.equip_space_ninja() @@ -216,11 +216,11 @@ Contents: return 1 /datum/game_mode/proc/update_ninja_icons_added(var/mob/living/carbon/human/ninja) - var/datum/atom_hud/antag/ninjahud = huds[ANTAG_HUD_NINJA] + var/datum/atom_hud/antag/ninjahud = GLOB.huds[ANTAG_HUD_NINJA] ninjahud.join_hud(ninja) set_antag_hud(ninja, "ninja") /datum/game_mode/proc/update_ninja_icons_removed(datum/mind/ninja_mind) - var/datum/atom_hud/antag/ninjahud = huds[ANTAG_HUD_NINJA] + var/datum/atom_hud/antag/ninjahud = GLOB.huds[ANTAG_HUD_NINJA] ninjahud.leave_hud(ninja_mind.current) set_antag_hud(ninja_mind.current, null) diff --git a/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm b/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm index 6580260cdb7cd..1f5fdc6ea0595 100644 --- a/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm +++ b/code/modules/ninja/suit/n_suit_verbs/energy_net_nets.dm @@ -75,7 +75,7 @@ It is possible to destroy the net by the occupant or someone else. new /obj/effect/overlay/temp/dir_setting/ninja/phase/out(get_turf(M), M.dir) visible_message("[M] suddenly vanishes!") - M.forceMove(pick(holdingfacility)) //Throw mob in to the holding facility. + M.forceMove(pick(GLOB.holdingfacility)) //Throw mob in to the holding facility. to_chat(M, "You appear in a strange place!") if(!isnull(master))//As long as they still exist. diff --git a/code/modules/ninja/suit/ninjaDrainAct.dm b/code/modules/ninja/suit/ninjaDrainAct.dm index 0879e73008cc7..7a3e119a56d86 100644 --- a/code/modules/ninja/suit/ninjaDrainAct.dm +++ b/code/modules/ninja/suit/ninjaDrainAct.dm @@ -124,7 +124,7 @@ They *could* go in their appropriate files, but this is supposed to be modular to_chat(H, "Hacking \the [src]...") spawn(0) var/turf/location = get_turf(H) - for(var/mob/living/silicon/ai/AI in player_list) + for(var/mob/living/silicon/ai/AI in GLOB.player_list) to_chat(AI, "Network Alert: Hacking attempt detected[location?" in [location]":". Unable to pinpoint location"].") if(files && files.known_tech.len) @@ -156,7 +156,7 @@ They *could* go in their appropriate files, but this is supposed to be modular to_chat(H, "Hacking \the [src]...") spawn(0) var/turf/location = get_turf(H) - for(var/mob/living/silicon/ai/AI in player_list) + for(var/mob/living/silicon/ai/AI in GLOB.player_list) to_chat(AI, "Network Alert: Hacking attempt detected[location?" in [location]":". Unable to pinpoint location"].") if(files && files.known_tech.len) diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 1c925b6217c2e..3b120840c0f01 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -120,8 +120,8 @@ /obj/structure/filingcabinet/security/proc/populate() if(virgin) - for(var/datum/data/record/G in data_core.general) - var/datum/data/record/S = find_record("name", G.fields["name"], data_core.security) + for(var/datum/data/record/G in GLOB.data_core.general) + var/datum/data/record/S = find_record("name", G.fields["name"], GLOB.data_core.security) if(!S) continue var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src) @@ -152,8 +152,8 @@ /obj/structure/filingcabinet/medical/proc/populate() if(virgin) - for(var/datum/data/record/G in data_core.general) - var/datum/data/record/M = find_record("name", G.fields["name"], data_core.medical) + for(var/datum/data/record/G in GLOB.data_core.general) + var/datum/data/record/M = find_record("name", G.fields["name"], GLOB.data_core.medical) if(!M) continue var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src) @@ -179,7 +179,7 @@ * Employment contract Cabinets */ -var/list/employmentCabinets = list() +GLOBAL_LIST_EMPTY(employmentCabinets) /obj/structure/filingcabinet/employment var/cooldown = 0 @@ -187,16 +187,16 @@ var/list/employmentCabinets = list() var/virgin = 1 /obj/structure/filingcabinet/employment/New() - employmentCabinets += src + GLOB.employmentCabinets += src return ..() /obj/structure/filingcabinet/employment/Destroy() - employmentCabinets -= src + GLOB.employmentCabinets -= src return ..() /obj/structure/filingcabinet/employment/proc/fillCurrent() //This proc fills the cabinet with the current crew. - for(var/record in data_core.locked) + for(var/record in GLOB.data_core.locked) var/datum/data/record/G = record if(!G) continue diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 23ab11817ec87..b91e5b211a186 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -284,7 +284,7 @@ var/list/turfs = list() for(var/turf/T in range(1, target)) if(T in seen) - if(isAi && !cameranet.checkTurfVis(T)) + if(isAi && !GLOB.cameranet.checkTurfVis(T)) continue else turfs += T diff --git a/code/modules/power/antimatter/shielding.dm b/code/modules/power/antimatter/shielding.dm index b6c5e20e5fbe9..527d5d62a26d0 100644 --- a/code/modules/power/antimatter/shielding.dm +++ b/code/modules/power/antimatter/shielding.dm @@ -1,7 +1,7 @@ //like orange but only checks north/south/east/west for one step /proc/cardinalrange(var/center) var/list/things = list() - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) var/turf/T = get_step(center, direction) if(!T) continue things += T.contents @@ -52,7 +52,7 @@ break if(!control_unit)//No other guys nearby look for a control unit - for(var/direction in cardinal) + for(var/direction in GLOB.cardinal) for(var/obj/machinery/power/am_control_unit/AMC in cardinalrange(src)) if(AMC.add_shielding(src)) break @@ -110,7 +110,7 @@ dirs = 0 coredirs = 0 cut_overlays() - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/T = get_step(loc, direction) for(var/obj/machinery/machine in T) if(istype(machine, /obj/machinery/am_shielding)) @@ -118,11 +118,11 @@ if(shield.control_unit == control_unit) if(shield.processing) coredirs |= direction - if(direction in cardinal) + if(direction in GLOB.cardinal) dirs |= direction else - if(istype(machine, /obj/machinery/power/am_control_unit) && (direction in cardinal)) + if(istype(machine, /obj/machinery/power/am_control_unit) && (direction in GLOB.cardinal)) var/obj/machinery/power/am_control_unit/control = machine if(control == control_unit) dirs |= direction @@ -175,7 +175,7 @@ //Scans cards for shields or the control unit and if all there it /obj/machinery/am_shielding/proc/core_check() - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/found_am_device=0 for(var/obj/machinery/machine in get_step(loc, direction)) //var/machine = locate(/obj/machinery, get_step(loc, direction)) @@ -191,7 +191,7 @@ /obj/machinery/am_shielding/proc/setup_core() processing = 1 - machines |= src + GLOB.machines |= src START_PROCESSING(SSmachines, src) if(!control_unit) return diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index e02413e1180dd..db8ab18bdf77b 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -111,11 +111,11 @@ /obj/machinery/power/apc/New(turf/loc, var/ndir, var/building=0) if (!req_access) - req_access = list(access_engine_equip) + req_access = list(GLOB.access_engine_equip) if (!armor) armor = list(melee = 20, bullet = 20, laser = 10, energy = 100, bomb = 30, bio = 100, rad = 100, fire = 90, acid = 50) ..() - apcs_list += src + GLOB.apcs_list += src wires = new /datum/wires/apc(src) // offset 24 pixels in direction of dir @@ -140,7 +140,7 @@ addtimer(CALLBACK(src, .proc/update), 5) /obj/machinery/power/apc/Destroy() - apcs_list -= src + GLOB.apcs_list -= src if(malfai && operating) malfai.malf_picker.processing_time = Clamp(malfai.malf_picker.processing_time - 10,0,1000) @@ -677,7 +677,7 @@ ..() /obj/machinery/power/apc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) @@ -904,7 +904,7 @@ occupier.loc = src.loc occupier.death() occupier.gib() - for(var/obj/item/weapon/pinpointer/P in pinpointer_list) + for(var/obj/item/weapon/pinpointer/P in GLOB.pinpointer_list) P.switch_mode_to(TRACK_NUKE_DISK) //Pinpointers go back to tracking the nuke disk P.nuke_warning = FALSE @@ -1030,18 +1030,18 @@ if(cell && !shorted) // draw power from cell as before to power the area - var/cellused = min(cell.charge, CELLRATE * lastused_total) // clamp deduction to a max, amount left in cell + var/cellused = min(cell.charge, GLOB.CELLRATE * lastused_total) // clamp deduction to a max, amount left in cell cell.use(cellused) if(excess > lastused_total) // if power excess recharge the cell // by the same amount just used cell.give(cellused) - add_load(cellused/CELLRATE) // add the load used to recharge the cell + add_load(cellused/GLOB.CELLRATE) // add the load used to recharge the cell else // no excess, and not enough per-apc - if((cell.charge/CELLRATE + excess) >= lastused_total) // can we draw enough from cell+grid to cover last usage? - cell.charge = min(cell.maxcharge, cell.charge + CELLRATE * excess) //recharge with what we can + if((cell.charge/GLOB.CELLRATE + excess) >= lastused_total) // can we draw enough from cell+grid to cover last usage? + cell.charge = min(cell.maxcharge, cell.charge + GLOB.CELLRATE * excess) //recharge with what we can add_load(excess) // so draw what we can from the grid charging = 0 @@ -1089,8 +1089,8 @@ if(chargemode && charging == 1 && operating) if(excess > 0) // check to make sure we have enough to charge // Max charge is capped to % per second constant - var/ch = min(excess*CELLRATE, cell.maxcharge*CHARGELEVEL) - add_load(ch/CELLRATE) // Removes the power we're taking from the grid + var/ch = min(excess*GLOB.CELLRATE, cell.maxcharge*GLOB.CHARGELEVEL) + add_load(ch/GLOB.CELLRATE) // Removes the power we're taking from the grid cell.give(ch) // actually recharge the cell else @@ -1104,7 +1104,7 @@ if(chargemode) if(!charging) - if(excess > cell.maxcharge*CHARGELEVEL) + if(excess > cell.maxcharge*GLOB.CHARGELEVEL) chargecount++ else chargecount = 0 @@ -1244,7 +1244,7 @@ for(var/obj/machinery/M in area.contents) if(M.critical_machine) return - for(var/A in ai_list) + for(var/A in GLOB.ai_list) var/mob/living/silicon/ai/I = A if(get_area(I) == area) return diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 9e84f752ab166..cbb520b680048 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -80,7 +80,7 @@ By design, d1 is the smallest direction and d2 is the highest var/turf/T = src.loc // hide if turf is not intact if(level==1) hide(T.intact) - cable_list += src //add it to the global cable list + GLOB.cable_list += src //add it to the global cable list if(d1) stored = new/obj/item/stack/cable_coil(null,2,cable_color) @@ -90,7 +90,7 @@ By design, d1 is the smallest direction and d2 is the highest /obj/structure/cable/Destroy() // called when a cable is deleted if(powernet) cut_cable_from_powernet() // update the powernets - cable_list -= src //remove it from global cable list + GLOB.cable_list -= src //remove it from global cable list return ..() // then go ahead and delete the cable /obj/structure/cable/deconstruct(disassembled = TRUE) @@ -437,9 +437,7 @@ By design, d1 is the smallest direction and d2 is the highest // Definitions //////////////////////////////// -var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \ - new/datum/stack_recipe("cable restraints", /obj/item/weapon/restraints/handcuffs/cable, 15), \ - ) +GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restraints", /obj/item/weapon/restraints/handcuffs/cable, 15))) /obj/item/stack/cable_coil name = "cable coil" @@ -488,7 +486,7 @@ var/global/list/datum/stack_recipe/cable_coil_recipes = list ( \ pixel_x = rand(-2,2) pixel_y = rand(-2,2) update_icon() - recipes = cable_coil_recipes + recipes = GLOB.cable_coil_recipes /////////////////////////////////// // General procedures diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 39952a82762f5..c23597f95f8a6 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -3,16 +3,16 @@ // Gravity Generator // -var/list/gravity_generators = list() // We will keep track of this by adding new gravity generators to the list, and keying it with the z level. +GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding new gravity generators to the list, and keying it with the z level. -var/const/POWER_IDLE = 0 -var/const/POWER_UP = 1 -var/const/POWER_DOWN = 2 +#define POWER_IDLE 0 +#define POWER_UP 1 +#define POWER_DOWN 2 -var/const/GRAV_NEEDS_SCREWDRIVER = 0 -var/const/GRAV_NEEDS_WELDING = 1 -var/const/GRAV_NEEDS_PLASTEEL = 2 -var/const/GRAV_NEEDS_WRENCH = 3 +#define GRAV_NEEDS_SCREWDRIVER 0 +#define GRAV_NEEDS_WELDING 1 +#define GRAV_NEEDS_PLASTEEL 2 +#define GRAV_NEEDS_WRENCH 3 // // Abstract Generator @@ -371,7 +371,7 @@ var/const/GRAV_NEEDS_WRENCH = 3 // Shake everyone on the z level to let them know that gravity was enagaged/disenagaged. /obj/machinery/gravity_generator/main/proc/shake_everyone() var/turf/T = get_turf(src) - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.z != z) continue M.update_gravity(M.mob_has_gravity()) @@ -383,19 +383,19 @@ var/const/GRAV_NEEDS_WRENCH = 3 var/turf/T = get_turf(src) if(!T) return 0 - if(gravity_generators["[T.z]"]) - return length(gravity_generators["[T.z]"]) + if(GLOB.gravity_generators["[T.z]"]) + return length(GLOB.gravity_generators["[T.z]"]) return 0 /obj/machinery/gravity_generator/main/proc/update_list() var/turf/T = get_turf(src.loc) if(T) - if(!gravity_generators["[T.z]"]) - gravity_generators["[T.z]"] = list() + if(!GLOB.gravity_generators["[T.z]"]) + GLOB.gravity_generators["[T.z]"] = list() if(on) - gravity_generators["[T.z]"] |= src + GLOB.gravity_generators["[T.z]"] |= src else - gravity_generators["[T.z]"] -= src + GLOB.gravity_generators["[T.z]"] -= src // Misc diff --git a/code/modules/power/monitor.dm b/code/modules/power/monitor.dm index f360ed2b0a3a1..49222337bb598 100644 --- a/code/modules/power/monitor.dm +++ b/code/modules/power/monitor.dm @@ -51,7 +51,7 @@ demand.Cut(1, 2) /obj/machinery/computer/monitor/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "power_monitor", name, 1200, 1000, master_ui, state) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 6767788c034e6..c27566e5bc03a 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -139,7 +139,7 @@ var/cdir var/turf/T - for(var/card in cardinal) + for(var/card in GLOB.cardinal) T = get_step(loc,card) cdir = get_dir(T,loc) @@ -159,7 +159,7 @@ var/cdir var/turf/T - for(var/card in cardinal) + for(var/card in GLOB.cardinal) T = get_step(loc,card) cdir = get_dir(T,loc) @@ -337,9 +337,9 @@ var/drained_energy = drained_hp*20 if (source_area) - source_area.use_power(drained_energy/CELLRATE) + source_area.use_power(drained_energy/GLOB.CELLRATE) else if (istype(power_source,/datum/powernet)) - var/drained_power = drained_energy/CELLRATE //convert from "joules" to "watts" + var/drained_power = drained_energy/GLOB.CELLRATE //convert from "joules" to "watts" PN.load+=drained_power else if (istype(power_source, /obj/item/weapon/stock_parts/cell)) cell.use(drained_energy) @@ -361,6 +361,6 @@ return null /area/proc/get_apc() - for(var/obj/machinery/power/apc/APC in apcs_list) + for(var/obj/machinery/power/apc/APC in GLOB.apcs_list) if(APC.area == src) return APC diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm index 1aa18f8adeb74..7e04df570f238 100644 --- a/code/modules/power/singularity/collector.dm +++ b/code/modules/power/singularity/collector.dm @@ -1,5 +1,5 @@ -var/global/list/rad_collectors = list() +GLOBAL_LIST_EMPTY(rad_collectors) /obj/machinery/power/rad_collector name = "Radiation Collector Array" @@ -8,7 +8,7 @@ var/global/list/rad_collectors = list() icon_state = "ca" anchored = 0 density = 1 - req_access = list(access_engine_equip) + req_access = list(GLOB.access_engine_equip) // use_power = 0 obj_integrity = 350 max_integrity = 350 @@ -21,10 +21,10 @@ var/global/list/rad_collectors = list() /obj/machinery/power/rad_collector/New() ..() - rad_collectors += src + GLOB.rad_collectors += src /obj/machinery/power/rad_collector/Destroy() - rad_collectors -= src + GLOB.rad_collectors -= src return ..() /obj/machinery/power/rad_collector/process() diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 9284b69fcb7f8..d32274bdd2585 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -8,7 +8,7 @@ var/icon_state_on = "emitter_+a" anchored = 0 density = 1 - req_access = list(access_engine_equip) + req_access = list(GLOB.access_engine_equip) use_power = 0 idle_power_usage = 10 diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm index dc72a29e333b5..602359c089861 100644 --- a/code/modules/power/singularity/field_generator.dm +++ b/code/modules/power/singularity/field_generator.dm @@ -319,7 +319,7 @@ field_generator power level display //I want to avoid using global variables. spawn(1) var/temp = 1 //stops spam - for(var/obj/singularity/O in singularities) + for(var/obj/singularity/O in GLOB.singularities) if(O.last_warning && temp) if((world.time - O.last_warning) > 50) //to stop message-spam temp = 0 diff --git a/code/modules/power/singularity/narsie.dm b/code/modules/power/singularity/narsie.dm index a9f7400289ede..dc54a3db4e700 100644 --- a/code/modules/power/singularity/narsie.dm +++ b/code/modules/power/singularity/narsie.dm @@ -91,13 +91,13 @@ /obj/singularity/narsie/proc/pickcultist() //Narsie rewards her cultists with being devoured first, then picks a ghost to follow. var/list/cultists = list() var/list/noncultists = list() - for(var/obj/structure/destructible/clockwork/massive/ratvar/enemy in poi_list) //Prioritize killing Ratvar + for(var/obj/structure/destructible/clockwork/massive/ratvar/enemy in GLOB.poi_list) //Prioritize killing Ratvar if(enemy.z != z) continue acquire(enemy) return - for(var/mob/living/carbon/food in living_mob_list) //we don't care about constructs or cult-Ians or whatever. cult-monkeys are fair game i guess + for(var/mob/living/carbon/food in GLOB.living_mob_list) //we don't care about constructs or cult-Ians or whatever. cult-monkeys are fair game i guess var/turf/pos = get_turf(food) if(pos.z != src.z) continue @@ -116,7 +116,7 @@ return //no living humans, follow a ghost instead. - for(var/mob/dead/observer/ghost in player_list) + for(var/mob/dead/observer/ghost in GLOB.player_list) if(!ghost.client) continue var/turf/pos = get_turf(ghost) diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 8dae7e97d970d..3b0bc3087b099 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -36,9 +36,9 @@ src.energy = starting_energy ..() START_PROCESSING(SSobj, src) - poi_list |= src - singularities |= src - for(var/obj/machinery/power/singularity_beacon/singubeacon in machines) + GLOB.poi_list |= src + GLOB.singularities |= src + for(var/obj/machinery/power/singularity_beacon/singubeacon in GLOB.machines) if(singubeacon.active) target = singubeacon break @@ -46,8 +46,8 @@ /obj/singularity/Destroy() STOP_PROCESSING(SSobj, src) - poi_list.Remove(src) - singularities.Remove(src) + GLOB.poi_list.Remove(src) + GLOB.singularities.Remove(src) return ..() /obj/singularity/Move(atom/newloc, direct) @@ -287,7 +287,7 @@ if(!move_self) return 0 - var/movement_dir = pick(alldirs - last_failed_movement) + var/movement_dir = pick(GLOB.alldirs - last_failed_movement) if(force_move) movement_dir = force_move @@ -431,7 +431,7 @@ /obj/singularity/proc/pulse() - for(var/obj/machinery/power/rad_collector/R in rad_collectors) + for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors) if(R.z == z && get_dist(R, src) <= 15) // Better than using orange() every process R.receive_pulse(energy) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 5006603b6f3b2..bac70db69be94 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -53,7 +53,7 @@ spawn(5) dir_loop: - for(var/d in cardinal) + for(var/d in GLOB.cardinal) var/turf/T = get_step(src, d) for(var/obj/machinery/power/terminal/term in T) if(term && term.dir == turn(d, 180)) @@ -354,7 +354,7 @@ terminal.powernet.load += amount /obj/machinery/power/smes/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "smes", name, 340, 440, master_ui, state) diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm index 3a27f546d3620..e5097d422a01c 100644 --- a/code/modules/power/solar.dm +++ b/code/modules/power/solar.dm @@ -348,7 +348,7 @@ add_overlay(image('icons/obj/computer.dmi', "solcon-o", FLY_LAYER, angle2dir(currentdir))) /obj/machinery/power/solar_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "solar_control", name, 500, 400, master_ui, state) diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index b6a0bac451f9f..cacf66cd62992 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -131,7 +131,7 @@ . = ..() countdown = new(src) countdown.start() - poi_list |= src + GLOB.poi_list |= src radio = new(src) radio.listening = 0 investigate_log("has been created.", "supermatter") @@ -140,7 +140,7 @@ /obj/machinery/power/supermatter_shard/Destroy() investigate_log("has been destroyed.", "supermatter") QDEL_NULL(radio) - poi_list -= src + GLOB.poi_list -= src QDEL_NULL(countdown) . = ..() @@ -162,7 +162,7 @@ /obj/machinery/power/supermatter_shard/proc/explode() var/turf/T = get_turf(src) - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.z == z) M << 'sound/magic/Charge.ogg' to_chat(M, "You feel reality distort for a moment...") @@ -360,7 +360,7 @@ SPEAK("Warning: Critical coolant mass reached.") if(damage > explosion_point) - for(var/mob in living_mob_list) + for(var/mob in GLOB.living_mob_list) var/mob/living/L = mob if(istype(L) && L.z == z) if(ishuman(mob)) @@ -399,7 +399,7 @@ investigate_log("Supermatter shard consumed by singularity.","singulo") message_admins("Singularity has consumed a supermatter shard and can now become stage six.") visible_message("[src] is consumed by the singularity!") - for(var/mob/M in mob_list) + for(var/mob/M in GLOB.mob_list) if(M.z == z) M << 'sound/effects/supermatter.ogg' //everyone goan know bout this to_chat(M, "A horrible screeching fills your ears, and a wave of dread washes over you...") @@ -451,7 +451,7 @@ Consume(user) /obj/machinery/power/supermatter_shard/proc/transfer_energy() - for(var/obj/machinery/power/rad_collector/R in rad_collectors) + for(var/obj/machinery/power/rad_collector/R in GLOB.rad_collectors) if(R.z == z && get_dist(R, src) <= 15) //Better than using orange() every process R.receive_pulse(power * (1 + power_transmission_bonus)/10 * freon_transmit_modifier) diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index d3a2c97e64063..478ae43d90161 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -1,7 +1,7 @@ #define TESLA_DEFAULT_POWER 1738260 #define TESLA_MINI_POWER 869130 -var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics, +GLOBAL_LIST_INIT(blacklisted_tesla_types, typecacheof(list(/obj/machinery/atmospherics, /obj/machinery/power/emitter, /obj/machinery/field/generator, /mob/living/simple_animal, @@ -18,7 +18,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics, /obj/machinery/gateway, /obj/structure/lattice, /obj/structure/grille, - /obj/machinery/the_singularitygen/tesla)) + /obj/machinery/the_singularitygen/tesla))) /obj/singularity/energy_ball name = "energy ball" desc = "An energy ball." @@ -85,7 +85,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics, //we face the last thing we zapped, so this lets us favor that direction a bit var/first_move = dir for(var/i in 0 to move_amount) - var/move_dir = pick(alldirs + first_move) //give the first move direction a bit of favoring. + var/move_dir = pick(GLOB.alldirs + first_move) //give the first move direction a bit of favoring. if(target && prob(60)) move_dir = get_dir(src,target) var/turf/T = get_step(src, move_dir) @@ -137,7 +137,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics, /obj/singularity/energy_ball/orbit(obj/singularity/energy_ball/target) if (istype(target)) target.orbiting_balls += src - poi_list -= src + GLOB.poi_list -= src target.dissipate_strength = target.orbiting_balls.len . = ..() @@ -197,7 +197,7 @@ var/list/blacklisted_tesla_types = typecacheof(list(/obj/machinery/atmospherics, closest_atom = A closest_dist = dist - else if(closest_grounding_rod || is_type_in_typecache(A, blacklisted_tesla_types)) + else if(closest_grounding_rod || is_type_in_typecache(A, GLOB.blacklisted_tesla_types)) continue else if(isliving(A)) diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 4f9f826a6cbd4..f0941946dcfc0 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -25,7 +25,7 @@ BB = new projectile_type(src) pixel_x = rand(-10, 10) pixel_y = rand(-10, 10) - setDir(pick(alldirs)) + setDir(pick(GLOB.alldirs)) update_icon() /obj/item/ammo_casing/update_icon() diff --git a/code/modules/projectiles/guns/energy/pulse.dm b/code/modules/projectiles/guns/energy/pulse.dm index c403799580300..e99ff04add9cb 100644 --- a/code/modules/projectiles/guns/energy/pulse.dm +++ b/code/modules/projectiles/guns/energy/pulse.dm @@ -18,7 +18,7 @@ /obj/item/weapon/gun/energy/pulse/prize/New() . = ..() - poi_list |= src + GLOB.poi_list |= src var/msg = "A pulse rifle prize has been created at ([x],[y],[z] - (\ \ JMP)" @@ -30,7 +30,7 @@ action = NOTIFY_ORBIT) /obj/item/weapon/gun/energy/pulse/prize/Destroy() - poi_list -= src + GLOB.poi_list -= src . = ..() /obj/item/weapon/gun/energy/pulse/loyalpin diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index b734432b80ae3..934c2ef53ff04 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -73,7 +73,7 @@ ..() set_light(3) var/obj/item/device/radio/beacon/teletarget = null - for(var/obj/machinery/computer/teleporter/com in machines) + for(var/obj/machinery/computer/teleporter/com in GLOB.machines) if(com.target) if(com.power_station && com.power_station.teleporter_hub && com.power_station.engaged) teletarget = com.target diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index fbba77e9818a9..5cd94748e45e8 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -292,7 +292,7 @@ ..() /atom/proc/animate_atom_living(var/mob/living/owner = null) - if((istype(src, /obj/item) || istype(src, /obj/structure)) && !is_type_in_list(src, protected_objects)) + if((istype(src, /obj/item) || istype(src, /obj/structure)) && !is_type_in_list(src, GLOB.protected_objects)) if(istype(src, /obj/structure/statue/petrified)) var/obj/structure/statue/petrified/P = src if(P.petrified_mob) diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index e3cdb3566f0dc..b5c2a93996b7b 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -324,7 +324,7 @@ for(var/atom/movable/A in range(T, power)) if(A == src|| (firer && A == src.firer) || A.anchored || thrown_items[A]) continue - A.throw_at(get_edge_target_turf(A, pick(cardinal)), power+1, 1) + A.throw_at(get_edge_target_turf(A, pick(GLOB.cardinal)), power+1, 1) thrown_items[A] = A for(var/turf/Z in range(T,power)) new /obj/effect/overlay/temp/gravpush(Z) diff --git a/code/modules/reagents/chem_splash.dm b/code/modules/reagents/chem_splash.dm index e586e6f806b52..6839dbd07d85c 100644 --- a/code/modules/reagents/chem_splash.dm +++ b/code/modules/reagents/chem_splash.dm @@ -42,7 +42,7 @@ for(var/turf/T in (orange(i, epicenter) - orange(i-1, epicenter))) turflist |= T for(var/turf/T in turflist) - if( !(get_dir(T,epicenter) in cardinal) && (abs(T.x - epicenter.x) == abs(T.y - epicenter.y) )) + if( !(get_dir(T,epicenter) in GLOB.cardinal) && (abs(T.x - epicenter.x) == abs(T.y - epicenter.y) )) turflist.Remove(T) turflist.Add(T) // we move the purely diagonal turfs to the end of the list. for(var/turf/T in turflist) @@ -52,7 +52,7 @@ var/turf/NT = thing if(!(NT in accessible)) continue - if(!(get_dir(T,NT) in cardinal)) + if(!(get_dir(T,NT) in GLOB.cardinal)) continue accessible[T] = 1 break diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index b66bfc208f200..dbbb0b80b9870 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -1,11 +1,5 @@ -var/const/TOUCH = 1 //splashing -var/const/INGEST = 2 //ingestion -var/const/VAPOR = 3 //foam, spray, blob attack -var/const/PATCH = 4 //patches -var/const/INJECT = 5 //injection - /////////////////////////////////////////////////////////////////////////////////// /datum/reagents @@ -26,21 +20,21 @@ var/const/INJECT = 5 //injection START_PROCESSING(SSobj, src) //I dislike having these here but map-objects are initialised before world/New() is called. >_> - if(!chemical_reagents_list) + if(!GLOB.chemical_reagents_list) //Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id var/paths = subtypesof(/datum/reagent) - chemical_reagents_list = list() + GLOB.chemical_reagents_list = list() for(var/path in paths) var/datum/reagent/D = new path() - chemical_reagents_list[D.id] = D - if(!chemical_reactions_list) + GLOB.chemical_reagents_list[D.id] = D + if(!GLOB.chemical_reactions_list) //Chemical Reactions - Initialises all /datum/chemical_reaction into a list // It is filtered into multiple lists within a list. // For example: // chemical_reaction_list["plasma"] is a list of all reactions relating to plasma var/paths = subtypesof(/datum/chemical_reaction) - chemical_reactions_list = list() + GLOB.chemical_reactions_list = list() for(var/path in paths) @@ -53,9 +47,9 @@ var/const/INJECT = 5 //injection // Create filters based on each reagent id in the required reagents list for(var/id in reaction_ids) - if(!chemical_reactions_list[id]) - chemical_reactions_list[id] = list() - chemical_reactions_list[id] += D + if(!GLOB.chemical_reactions_list[id]) + GLOB.chemical_reactions_list[id] = list() + GLOB.chemical_reactions_list[id] += D break // Don't bother adding ourselves to other reagent ids, it is redundant. /datum/reagents/Destroy() @@ -330,7 +324,7 @@ var/const/INJECT = 5 //injection /datum/reagents/proc/handle_reactions() var/list/cached_reagents = reagent_list - var/list/cached_reactions = chemical_reactions_list + var/list/cached_reactions = GLOB.chemical_reactions_list var/datum/cached_my_atom = my_atom if(flags & REAGENT_NOREACT) return //Yup, no reactions here. No siree. @@ -555,7 +549,7 @@ var/const/INJECT = 5 //injection handle_reactions() return TRUE - var/datum/reagent/D = chemical_reagents_list[reagent] + var/datum/reagent/D = GLOB.chemical_reagents_list[reagent] if(D) var/datum/reagent/R = new D.type(data) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 4f5894d8843fd..b4166d8070edd 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -97,7 +97,7 @@ cut_overlays() /obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "chem_dispenser", name, 550, 550, master_ui, state) @@ -129,7 +129,7 @@ var chemicals[0] for(var/re in dispensable_reagents) - var/datum/reagent/temp = chemical_reagents_list[re] + var/datum/reagent/temp = GLOB.chemical_reagents_list[re] if(temp) chemicals.Add(list(list("title" = temp.name, "id" = temp.id))) data["chemicals"] = chemicals diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 2d0d4f98fae44..2c6f7712e4ddd 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -73,7 +73,7 @@ eject_beaker() /obj/machinery/chem_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "chem_heater", name, 275, 400, master_ui, state) diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 1b067c3f9c36f..a94a1c01fff3e 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -137,7 +137,7 @@ /obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "chem_master", name, 500, 550, master_ui, state) @@ -321,7 +321,7 @@ . = TRUE if("analyze") - var/datum/reagent/R = chemical_reagents_list[params["id"]] + var/datum/reagent/R = GLOB.chemical_reagents_list[params["id"]] if(R) var/state = "Unknown" if(initial(R.reagent_state) == 1) diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index a369ca19603d1..cfc8198b382b7 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -81,8 +81,8 @@ var/vaccine_name = "Unknown" if(!ispath(vaccine_type)) - if(archive_diseases[path]) - var/datum/disease/D = archive_diseases[path] + if(SSdisease.archive_diseases[path]) + var/datum/disease/D = SSdisease.archive_diseases[path] if(D) vaccine_name = D.name vaccine_type = path @@ -106,11 +106,11 @@ var/datum/disease/D = null if(!ispath(type)) D = GetVirusByIndex(text2num(href_list["create_virus_culture"])) - var/datum/disease/advance/A = archive_diseases[D.GetDiseaseID()] + var/datum/disease/advance/A = SSdisease.archive_diseases[D.GetDiseaseID()] if(A) D = new A.type(0, A) else if(type) - if(type in diseases) // Make sure this is a disease + if(type in SSdisease.diseases) // Make sure this is a disease D = new type(0, null) if(!D) return @@ -159,8 +159,8 @@ if(..()) return var/id = GetVirusTypeByIndex(text2num(href_list["name_disease"])) - if(archive_diseases[id]) - var/datum/disease/advance/A = archive_diseases[id] + if(SSdisease.archive_diseases[id]) + var/datum/disease/advance/A = SSdisease.archive_diseases[id] A.AssignName(new_name) for(var/datum/disease/advance/AD in SSdisease.processing) AD.Refresh() @@ -215,7 +215,7 @@ if(istype(D, /datum/disease/advance)) var/datum/disease/advance/A = D - D = archive_diseases[A.GetDiseaseID()] + D = SSdisease.archive_diseases[A.GetDiseaseID()] if(D && D.name == "Unknown") dat += "Name Disease
    " @@ -255,7 +255,7 @@ var/disease_name = "Unknown" if(!ispath(type)) - var/datum/disease/advance/A = archive_diseases[type] + var/datum/disease/advance/A = SSdisease.archive_diseases[type] if(A) disease_name = A.name else diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index 5a20d17b19a5c..fddb22a1ccc2a 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -15,7 +15,7 @@ M.set_drugginess(15) if(isturf(M.loc) && !isspaceturf(M.loc)) if(M.canmove) - if(prob(10)) step(M, pick(cardinal)) + if(prob(10)) step(M, pick(GLOB.cardinal)) if(prob(7)) M.emote(pick("twitch","drool","moan","giggle")) ..() @@ -176,7 +176,7 @@ /datum/reagent/drug/methamphetamine/overdose_process(mob/living/M) if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i in 1 to 4) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(20)) M.emote("laugh") if(prob(33)) @@ -205,7 +205,7 @@ /datum/reagent/drug/methamphetamine/addiction_act_stage3(mob/living/M) if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i = 0, i < 4, i++) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) M.Jitter(15) M.Dizzy(15) if(prob(40)) @@ -215,7 +215,7 @@ /datum/reagent/drug/methamphetamine/addiction_act_stage4(mob/living/carbon/human/M) if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i = 0, i < 8, i++) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) M.Jitter(20) M.Dizzy(20) M.adjustToxLoss(5, 0) @@ -247,8 +247,8 @@ M.adjustToxLoss(0.1, 0) M.hallucination += 10 if(M.canmove && !istype(M.loc, /atom/movable)) - step(M, pick(cardinal)) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) + step(M, pick(GLOB.cardinal)) ..() . = 1 @@ -256,7 +256,7 @@ M.hallucination += 10 if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i in 1 to 8) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(20)) M.emote(pick("twitch","drool","moan")) if(prob(33)) @@ -269,7 +269,7 @@ M.hallucination += 10 if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i = 0, i < 8, i++) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) M.Jitter(5) M.adjustBrainLoss(10) if(prob(20)) @@ -280,7 +280,7 @@ M.hallucination += 20 if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i = 0, i < 8, i++) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) M.Jitter(10) M.Dizzy(10) M.adjustBrainLoss(10) @@ -292,7 +292,7 @@ M.hallucination += 30 if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i = 0, i < 12, i++) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) M.Jitter(15) M.Dizzy(15) M.adjustBrainLoss(10) @@ -304,7 +304,7 @@ M.hallucination += 40 if(M.canmove && !istype(M.loc, /atom/movable)) for(var/i = 0, i < 16, i++) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) M.Jitter(50) M.Dizzy(50) M.adjustToxLoss(5, 0) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 7739115a64ffa..d2a1cbdb2836f 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -657,7 +657,7 @@ /datum/reagent/mercury/on_mob_life(mob/living/M) if(M.canmove && isspaceturf(M.loc)) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch","drool","moan")) M.adjustBrainLoss(2) @@ -737,7 +737,7 @@ /datum/reagent/lithium/on_mob_life(mob/living/M) if(M.canmove && isspaceturf(M.loc)) - step(M, pick(cardinal)) + step(M, pick(GLOB.cardinal)) if(prob(5)) M.emote(pick("twitch","drool","moan")) ..() @@ -1368,8 +1368,8 @@ if(method == TOUCH || method == VAPOR) if(M && ishuman(M)) var/mob/living/carbon/human/H = M - var/datum/sprite_accessory/hair/picked_hair = pick(hair_styles_list) - var/datum/sprite_accessory/facial_hair/picked_beard = pick(facial_hair_styles_list) + var/datum/sprite_accessory/hair/picked_hair = pick(GLOB.hair_styles_list) + var/datum/sprite_accessory/facial_hair/picked_beard = pick(GLOB.facial_hair_styles_list) H.hair_style = picked_hair H.facial_hair_style = picked_beard H.update_hair() diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm index 3de44af126c34..9e0bb2d0e4f7c 100644 --- a/code/modules/reagents/chemistry/recipes.dm +++ b/code/modules/reagents/chemistry/recipes.dm @@ -21,9 +21,9 @@ return //I recommend you set the result amount to the total volume of all components. -var/list/chemical_mob_spawn_meancritters = list() // list of possible hostile mobs -var/list/chemical_mob_spawn_nicecritters = list() // and possible friendly mobs /datum/chemical_reaction/proc/chemical_mob_spawn(datum/reagents/holder, amount_to_spawn, reaction_name, mob_faction = "chemicalsummon") + var/static/list/chemical_mob_spawn_meancritters = list() // list of possible hostile mobs + var/static/list/chemical_mob_spawn_nicecritters = list() // and possible friendly mobs if(holder && holder.my_atom) if (chemical_mob_spawn_meancritters.len <= 0 || chemical_mob_spawn_nicecritters.len <= 0) for (var/T in typesof(/mob/living/simple_animal)) diff --git a/code/modules/reagents/reagent_containers/borghydro.dm b/code/modules/reagents/reagent_containers/borghydro.dm index 9303e8a1a6060..46e41ecfeb85d 100644 --- a/code/modules/reagents/reagent_containers/borghydro.dm +++ b/code/modules/reagents/reagent_containers/borghydro.dm @@ -110,7 +110,7 @@ Borg Hypospray return mode = chosen_reagent playsound(loc, 'sound/effects/pop.ogg', 50, 0) - var/datum/reagent/R = chemical_reagents_list[reagent_ids[mode]] + var/datum/reagent/R = GLOB.chemical_reagents_list[reagent_ids[mode]] to_chat(user, "[src] is now dispensing '[R.name]'.") return diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 20f1b1b580548..a30e7b0b7612f 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -87,7 +87,7 @@ if(!QDELETED(src)) //wasn't deleted by the projectile's effects. if(!P.nodamage && ((P.damage_type == BURN) || (P.damage_type == BRUTE))) var/boom_message = "[key_name_admin(P.firer)] triggered a fueltank explosion via projectile." - bombers += boom_message + GLOB.bombers += boom_message message_admins(boom_message) var/log_message = "triggered a fueltank explosion via projectile." P.firer.log_message(log_message, INDIVIDUAL_ATTACK_LOG) @@ -111,7 +111,7 @@ else user.visible_message("[user] catastrophically fails at refilling [user.p_their()] [W.name]!", "That was stupid of you.") var/message_admins = "[key_name_admin(user)] triggered a fueltank explosion via welding tool." - bombers += message_admins + GLOB.bombers += message_admins message_admins(message_admins) var/message_log = "triggered a fueltank explosion via welding tool." user.log_message(message_log, INDIVIDUAL_ATTACK_LOG) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 2ef0842a04d40..71b73de0e1459 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -222,7 +222,7 @@ update() conveyors = list() - for(var/obj/machinery/conveyor/C in machines) + for(var/obj/machinery/conveyor/C in GLOB.machines) if(C.id == id) conveyors += C @@ -271,7 +271,7 @@ update() // find any switches with same id as this one, and set their positions to match us - for(var/obj/machinery/conveyor_switch/S in machines) + for(var/obj/machinery/conveyor_switch/S in GLOB.machines) if(S.id == src.id) S.position = position S.update() diff --git a/code/modules/recycling/disposal-structures.dm b/code/modules/recycling/disposal-structures.dm index 1fd66eb1d2f46..a823b4a62e184 100644 --- a/code/modules/recycling/disposal-structures.dm +++ b/code/modules/recycling/disposal-structures.dm @@ -329,7 +329,7 @@ stored.anchored = 1 stored.update_icon() else - for(var/D in cardinal) + for(var/D in GLOB.cardinal) if(D & dpdir) var/obj/structure/disposalpipe/broken/P = new(src.loc) P.setDir(D) @@ -425,7 +425,7 @@ if(sortTypes.len>0) to_chat(user, "It is tagged with the following tags:") for(var/t in sortTypes) - to_chat(user, TAGGERLOCATIONS[t]) + to_chat(user, GLOB.TAGGERLOCATIONS[t]) else to_chat(user, "It has no sorting tags set.") @@ -467,10 +467,10 @@ if(O.currTag > 0)// Tag set if(O.currTag in sortTypes) sortTypes -= O.currTag - to_chat(user, "Removed \"[TAGGERLOCATIONS[O.currTag]]\" filter.") + to_chat(user, "Removed \"[GLOB.TAGGERLOCATIONS[O.currTag]]\" filter.") else sortTypes |= O.currTag - to_chat(user, "Added \"[TAGGERLOCATIONS[O.currTag]]\" filter.") + to_chat(user, "Added \"[GLOB.TAGGERLOCATIONS[O.currTag]]\" filter.") playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1) else return ..() @@ -731,7 +731,7 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() src.streak(dirs) @@ -740,6 +740,6 @@ if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45)) else - dirs = alldirs.Copy() + dirs = GLOB.alldirs.Copy() src.streak(dirs) diff --git a/code/modules/recycling/disposal-unit.dm b/code/modules/recycling/disposal-unit.dm index bf5421190fa95..7cc890c1f6455 100644 --- a/code/modules/recycling/disposal-unit.dm +++ b/code/modules/recycling/disposal-unit.dm @@ -285,7 +285,7 @@ // handle machine interaction /obj/machinery/disposal/bin/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = default_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) if(stat & BROKEN) return if(user.loc == src) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 331260dd19542..ef6c1ffaa857c 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -27,7 +27,7 @@ var/obj/item/device/destTagger/O = W if(sortTag != O.currTag) - var/tag = uppertext(TAGGERLOCATIONS[O.currTag]) + var/tag = uppertext(GLOB.TAGGERLOCATIONS[O.currTag]) to_chat(user, "*[tag]*") sortTag = O.currTag playsound(loc, 'sound/machines/twobeep.ogg', 100, 1) @@ -108,7 +108,7 @@ var/obj/item/device/destTagger/O = W if(sortTag != O.currTag) - var/tag = uppertext(TAGGERLOCATIONS[O.currTag]) + var/tag = uppertext(GLOB.TAGGERLOCATIONS[O.currTag]) to_chat(user, "*[tag]*") sortTag = O.currTag playsound(loc, 'sound/machines/twobeep.ogg', 100, 1) @@ -151,13 +151,13 @@ var/dat = "

    TagMaster 2.2

    " dat += "

    Name

    Status

    Location

    Control

    " - for (var/i = 1, i <= TAGGERLOCATIONS.len, i++) - dat += "" + for (var/i = 1, i <= GLOB.TAGGERLOCATIONS.len, i++) + dat += "" if(i%4==0) dat += "" - dat += "
    [TAGGERLOCATIONS[i]][GLOB.TAGGERLOCATIONS[i]]

    Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]
    " + dat += "
    Current Selection: [currTag ? GLOB.TAGGERLOCATIONS[currTag] : "None"]" user << browse(dat, "window=destTagScreen;size=450x350") onclose(user, "destTagScreen") diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm index 6e69f10f445f0..877ef70c66fdb 100644 --- a/code/modules/research/experimentor.dm +++ b/code/modules/research/experimentor.dm @@ -84,8 +84,8 @@ var/obj/item/weapon/circuitboard/machine/B = new /obj/item/weapon/circuitboard/machine/experimentor(null) B.apply_default_parts(src) - trackedIan = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in mob_list - trackedRuntime = locate(/mob/living/simple_animal/pet/cat/Runtime) in mob_list + trackedIan = locate(/mob/living/simple_animal/pet/dog/corgi/Ian) in GLOB.mob_list + trackedRuntime = locate(/mob/living/simple_animal/pet/cat/Runtime) in GLOB.mob_list SetTypeReactions() /obj/item/weapon/circuitboard/machine/experimentor diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm index b7ab3587ecc79..ec99299f06d18 100644 --- a/code/modules/research/message_server.dm +++ b/code/modules/research/message_server.dm @@ -1,4 +1,4 @@ -var/global/list/obj/machinery/message_server/message_servers = list() +GLOBAL_LIST_INIT(message_servers, list()) /datum/data_pda_msg var/recipient = "Unspecified" //name of the person @@ -79,14 +79,14 @@ var/global/list/obj/machinery/message_server/message_servers = list() var/decryptkey = "password" /obj/machinery/message_server/New() - message_servers += src + GLOB.message_servers += src decryptkey = GenerateKey() send_pda_message("System Administrator", "system", "This is an automated message. The messaging system is functioning correctly.") ..() return /obj/machinery/message_server/Destroy() - message_servers -= src + GLOB.message_servers -= src return ..() /obj/machinery/message_server/proc/GenerateKey() diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 2a6afe066dfae..f2bdd738c460c 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -47,7 +47,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, var/sync = 1 //If sync = 0, it doesn't show up on Server Control Console var/first_use = 1 //If first_use = 1, it will try to auto-connect with nearby devices - req_access = list(access_tox) //Data and setting manipulation requires scientist access. + req_access = list(GLOB.access_tox) //Data and setting manipulation requires scientist access. var/selected_category var/list/datum/design/matching_designs = list() //for the search function @@ -55,18 +55,18 @@ won't update every console in existence) but it's more of a hassle to do. Also, /proc/CallTechName(ID) //A simple helper proc to find the name of a tech with a given ID. - if(tech_list[ID]) - var/datum/tech/tech = tech_list[ID] + if(GLOB.tech_list[ID]) + var/datum/tech/tech = GLOB.tech_list[ID] return tech.name return "ERROR: Report This" /proc/CallMaterialName(ID) - if (copytext(ID, 1, 2) == "$" && materials_list[ID]) - var/datum/material/material = materials_list[ID] + if (copytext(ID, 1, 2) == "$" && GLOB.materials_list[ID]) + var/datum/material/material = GLOB.materials_list[ID] return material.name - else if(chemical_reagents_list[ID]) - var/datum/reagent/reagent = chemical_reagents_list[ID] + else if(GLOB.chemical_reagents_list[ID]) + var/datum/reagent/reagent = GLOB.chemical_reagents_list[ID] return reagent.name return "ERROR: Report This" @@ -90,7 +90,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, //Have it automatically push research to the centcom server so wild griffins can't fuck up R&D's work --NEO /obj/machinery/computer/rdconsole/proc/griefProtection() - for(var/obj/machinery/r_n_d/server/centcom/C in machines) + for(var/obj/machinery/r_n_d/server/centcom/C in GLOB.machines) for(var/v in files.known_tech) var/datum/tech/T = files.known_tech[v] C.files.AddTech2Known(T) @@ -350,7 +350,7 @@ won't update every console in existence) but it's more of a hassle to do. Also, griefProtection() //Putting this here because I dont trust the sync process spawn(30) if(src) - for(var/obj/machinery/r_n_d/server/S in machines) + for(var/obj/machinery/r_n_d/server/S in GLOB.machines) var/server_processed = 0 if(S.disabled) continue diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm index 03613990f53ac..4b8242c1f86ea 100644 --- a/code/modules/research/server.dm +++ b/code/modules/research/server.dm @@ -12,7 +12,7 @@ var/heat_gen = 100 var/heating_power = 40000 var/delay = 10 - req_access = list(access_rd) //Only the R&D can change server settings. + req_access = list(GLOB.access_rd) //Only the R&D can change server settings. /obj/machinery/r_n_d/server/New() ..() @@ -90,7 +90,7 @@ //Backup files to centcom to help admins recover data after greifer attacks /obj/machinery/r_n_d/server/proc/griefProtection() - for(var/obj/machinery/r_n_d/server/centcom/C in machines) + for(var/obj/machinery/r_n_d/server/centcom/C in GLOB.machines) for(var/v in files.known_tech) var/datum/tech/T = files.known_tech[v] C.files.AddTech2Known(T) @@ -143,7 +143,7 @@ /proc/fix_noid_research_servers() var/list/no_id_servers = list() var/list/server_ids = list() - for(var/obj/machinery/r_n_d/server/S in machines) + for(var/obj/machinery/r_n_d/server/S in GLOB.machines) switch(S.server_id) if(-1) continue @@ -195,20 +195,20 @@ temp_server = null consoles = list() servers = list() - for(var/obj/machinery/r_n_d/server/S in machines) + for(var/obj/machinery/r_n_d/server/S in GLOB.machines) if(S.server_id == text2num(href_list["access"]) || S.server_id == text2num(href_list["data"]) || S.server_id == text2num(href_list["transfer"])) temp_server = S break if(href_list["access"]) screen = 1 - for(var/obj/machinery/computer/rdconsole/C in machines) + for(var/obj/machinery/computer/rdconsole/C in GLOB.machines) if(C.sync) consoles += C else if(href_list["data"]) screen = 2 else if(href_list["transfer"]) screen = 3 - for(var/obj/machinery/r_n_d/server/S in machines) + for(var/obj/machinery/r_n_d/server/S in GLOB.machines) if(S == src) continue servers += S @@ -256,7 +256,7 @@ if(0) //Main Menu dat += "Connected Servers:

    " - for(var/obj/machinery/r_n_d/server/S in machines) + for(var/obj/machinery/r_n_d/server/S in GLOB.machines) if(istype(S, /obj/machinery/r_n_d/server/centcom) && !badmin) continue dat += "[S.name] || " diff --git a/code/modules/research/xenobiology/xenobio_camera.dm b/code/modules/research/xenobiology/xenobio_camera.dm index 72bfb66573c9b..c02894bc3c9f7 100644 --- a/code/modules/research/xenobiology/xenobio_camera.dm +++ b/code/modules/research/xenobiology/xenobio_camera.dm @@ -118,7 +118,7 @@ var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/X = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/simple_animal/slime/S in X.stored_slimes) S.loc = remote_eye.loc S.visible_message("[S] warps in!") @@ -137,7 +137,7 @@ var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/X = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/simple_animal/slime/S in remote_eye.loc) if(X.stored_slimes.len >= X.max_slimes) break @@ -162,7 +162,7 @@ var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/X = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) if(X.monkeys >= 1) var/mob/living/carbon/monkey/food = new /mob/living/carbon/monkey(remote_eye.loc) food.LAssailant = C @@ -183,7 +183,7 @@ var/mob/camera/aiEye/remote/xenobio/remote_eye = C.remote_control var/obj/machinery/computer/camera_advanced/xenobio/X = target - if(cameranet.checkTurfVis(remote_eye.loc)) + if(GLOB.cameranet.checkTurfVis(remote_eye.loc)) for(var/mob/living/carbon/monkey/M in remote_eye.loc) if(M.stat) M.visible_message("[M] vanishes as they are reclaimed for recycling!") diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index ac33e8c91323d..f31cd01131242 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -556,7 +556,7 @@ /obj/effect/timestop/New() ..() - for(var/mob/living/M in player_list) + for(var/mob/living/M in GLOB.player_list) for(var/obj/effect/proc_holder/spell/aoe_turf/conjure/timestop/T in M.mind.spell_list) //People who can stop time are immune to timestop immune |= M timestop() diff --git a/code/modules/ruins/lavaland_ruin_code.dm b/code/modules/ruins/lavaland_ruin_code.dm index 5e7ecec21b295..376c8aa9f2637 100644 --- a/code/modules/ruins/lavaland_ruin_code.dm +++ b/code/modules/ruins/lavaland_ruin_code.dm @@ -137,7 +137,7 @@ icon_state = "sleeper" has_id = 1 flavour_text = "You are a syndicate agent, employed in a top secret research facility developing biological weapons. Unfortunatley, your hated enemy, Nanotrasen, has begun mining in this sector. Continue your research as best you can, and try to keep a low profile. Do not abandon the base without good cause. The base is rigged with explosives should the worst happen, do not let the base fall into enemy hands!
    " - id_access_list = list(access_syndicate) + id_access_list = list(GLOB.access_syndicate) /obj/effect/mob_spawn/human/lavaland_syndicate/comms name = "Syndicate Comms Agent" diff --git a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm index 86e9afe420504..6d18ce98f7e70 100644 --- a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm +++ b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm @@ -16,7 +16,7 @@ var/is_anyone_home = FALSE /obj/structure/necropolis_gate/attack_hand(mob/user) - for(var/mob/living/simple_animal/hostile/megafauna/legion/L in mob_list) + for(var/mob/living/simple_animal/hostile/megafauna/legion/L in GLOB.mob_list) return if(is_anyone_home) return @@ -42,7 +42,7 @@ visible_message("Something horrible emerges from the Necropolis!") message_admins("[key_name_admin(user)] has summoned Legion!") log_game("[key_name(user)] summoned Legion.") - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.z == z) to_chat(M, "Discordant whispers flood your mind in a thousand voices. Each one speaks your name, over and over. Something horrible has come.") M << 'sound/creatures/legion_spawn.ogg' diff --git a/code/modules/security_levels/keycard_authentication.dm b/code/modules/security_levels/keycard_authentication.dm index 389330867b9e0..e7c115e1004eb 100644 --- a/code/modules/security_levels/keycard_authentication.dm +++ b/code/modules/security_levels/keycard_authentication.dm @@ -1,4 +1,4 @@ -var/datum/events/keycard_events = new() +GLOBAL_DATUM_INIT(keycard_events, /datum/events, new) /obj/machinery/keycard_auth name = "Keycard Authentication Device" @@ -10,7 +10,7 @@ var/datum/events/keycard_events = new() idle_power_usage = 2 active_power_usage = 6 power_channel = ENVIRON - req_access = list(access_keycard_auth) + req_access = list(GLOB.access_keycard_auth) resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF var/datum/callback/ev var/event = "" @@ -20,15 +20,15 @@ var/datum/events/keycard_events = new() /obj/machinery/keycard_auth/New() . = ..() - ev = keycard_events.addEvent("triggerEvent", CALLBACK(src, .proc/triggerEvent)) + ev = GLOB.keycard_events.addEvent("triggerEvent", CALLBACK(src, .proc/triggerEvent)) /obj/machinery/keycard_auth/Destroy() - keycard_events.clearEvent("triggerEvent", ev) + GLOB.keycard_events.clearEvent("triggerEvent", ev) qdel(ev) . = ..() /obj/machinery/keycard_auth/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "keycard_auth", name, 375, 125, master_ui, state) @@ -39,7 +39,7 @@ var/datum/events/keycard_events = new() data["waiting"] = waiting data["auth_required"] = event_source ? event_source.event : 0 data["red_alert"] = (seclevel2num(get_security_level()) >= SEC_LEVEL_RED) ? 1 : 0 - data["emergency_maint"] = emergency_access + data["emergency_maint"] = GLOB.emergency_access return data /obj/machinery/keycard_auth/ui_status(mob/user) @@ -72,7 +72,7 @@ var/datum/events/keycard_events = new() triggerer = usr event = event_type waiting = 1 - keycard_events.fireEvent("triggerEvent", src) + GLOB.keycard_events.fireEvent("triggerEvent", src) addtimer(CALLBACK(src, .proc/eventSent), 20) /obj/machinery/keycard_auth/proc/eventSent() @@ -101,14 +101,14 @@ var/datum/events/keycard_events = new() feedback_inc("alert_keycard_auth_maint",1) -/var/emergency_access = 0 +GLOBAL_VAR_INIT(emergency_access, FALSE) /proc/make_maint_all_access() for(var/area/maintenance/A in world) for(var/obj/machinery/door/airlock/D in A) D.emergency = 1 D.update_icon(0) minor_announce("Access restrictions on maintenance and external airlocks have been lifted.", "Attention! Station-wide emergency declared!",1) - emergency_access = 1 + GLOB.emergency_access = TRUE /proc/revoke_maint_all_access() for(var/area/maintenance/A in world) @@ -116,4 +116,4 @@ var/datum/events/keycard_events = new() D.emergency = 0 D.update_icon(0) minor_announce("Access restrictions in maintenance areas have been restored.", "Attention! Station-wide emergency rescinded:") - emergency_access = 0 + GLOB.emergency_access = FALSE diff --git a/code/modules/security_levels/security_levels.dm b/code/modules/security_levels/security_levels.dm index 7cb6a2e64f447..496f607e946f6 100644 --- a/code/modules/security_levels/security_levels.dm +++ b/code/modules/security_levels/security_levels.dm @@ -1,4 +1,4 @@ -/var/security_level = 0 +GLOBAL_VAR_INIT(security_level, 0) //0 = code green //1 = code blue //2 = code red @@ -18,21 +18,21 @@ level = SEC_LEVEL_DELTA //Will not be announced if you try to set to the same level as it already is - if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != security_level) + if(level >= SEC_LEVEL_GREEN && level <= SEC_LEVEL_DELTA && level != GLOB.security_level) switch(level) if(SEC_LEVEL_GREEN) minor_announce(config.alert_desc_green, "Attention! Security level lowered to green:") if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL) - if(security_level >= SEC_LEVEL_RED) + if(GLOB.security_level >= SEC_LEVEL_RED) SSshuttle.emergency.modTimer(4) else SSshuttle.emergency.modTimer(2) - security_level = SEC_LEVEL_GREEN - for(var/obj/machinery/firealarm/FA in machines) + GLOB.security_level = SEC_LEVEL_GREEN + for(var/obj/machinery/firealarm/FA in GLOB.machines) if(FA.z == ZLEVEL_STATION) FA.update_icon() if(SEC_LEVEL_BLUE) - if(security_level < SEC_LEVEL_BLUE) + if(GLOB.security_level < SEC_LEVEL_BLUE) minor_announce(config.alert_desc_blue_upto, "Attention! Security level elevated to blue:",1) if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL) SSshuttle.emergency.modTimer(0.5) @@ -40,50 +40,50 @@ minor_announce(config.alert_desc_blue_downto, "Attention! Security level lowered to blue:") if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL) SSshuttle.emergency.modTimer(2) - security_level = SEC_LEVEL_BLUE - for(var/obj/machinery/firealarm/FA in machines) + GLOB.security_level = SEC_LEVEL_BLUE + for(var/obj/machinery/firealarm/FA in GLOB.machines) if(FA.z == ZLEVEL_STATION) FA.update_icon() if(SEC_LEVEL_RED) - if(security_level < SEC_LEVEL_RED) + if(GLOB.security_level < SEC_LEVEL_RED) minor_announce(config.alert_desc_red_upto, "Attention! Code red!",1) if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL) - if(security_level == SEC_LEVEL_GREEN) + if(GLOB.security_level == SEC_LEVEL_GREEN) SSshuttle.emergency.modTimer(0.25) else SSshuttle.emergency.modTimer(0.5) else minor_announce(config.alert_desc_red_downto, "Attention! Code red!") - security_level = SEC_LEVEL_RED + GLOB.security_level = SEC_LEVEL_RED /* - At the time of commit, setting status displays didn't work properly var/obj/machinery/computer/communications/CC = locate(/obj/machinery/computer/communications,world) if(CC) CC.post_status("alert", "redalert")*/ - for(var/obj/machinery/firealarm/FA in machines) + for(var/obj/machinery/firealarm/FA in GLOB.machines) if(FA.z == ZLEVEL_STATION) FA.update_icon() - for(var/obj/machinery/computer/shuttle/pod/pod in machines) + for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines) pod.admin_controlled = 0 if(SEC_LEVEL_DELTA) minor_announce(config.alert_desc_delta, "Attention! Delta security level reached!",1) if(SSshuttle.emergency.mode == SHUTTLE_CALL || SSshuttle.emergency.mode == SHUTTLE_RECALL) - if(security_level == SEC_LEVEL_GREEN) + if(GLOB.security_level == SEC_LEVEL_GREEN) SSshuttle.emergency.modTimer(0.25) - else if(security_level == SEC_LEVEL_BLUE) + else if(GLOB.security_level == SEC_LEVEL_BLUE) SSshuttle.emergency.modTimer(0.5) - security_level = SEC_LEVEL_DELTA - for(var/obj/machinery/firealarm/FA in machines) + GLOB.security_level = SEC_LEVEL_DELTA + for(var/obj/machinery/firealarm/FA in GLOB.machines) if(FA.z == ZLEVEL_STATION) FA.update_icon() - for(var/obj/machinery/computer/shuttle/pod/pod in machines) + for(var/obj/machinery/computer/shuttle/pod/pod in GLOB.machines) pod.admin_controlled = 0 else return /proc/get_security_level() - switch(security_level) + switch(GLOB.security_level) if(SEC_LEVEL_GREEN) return "green" if(SEC_LEVEL_BLUE) diff --git a/code/modules/shuttle/arrivals.dm b/code/modules/shuttle/arrivals.dm index 686c54e3dd780..cc0efd5359455 100644 --- a/code/modules/shuttle/arrivals.dm +++ b/code/modules/shuttle/arrivals.dm @@ -39,23 +39,23 @@ areas = list() var/list/new_latejoin = list() - for(var/area/shuttle/arrival/A in sortedAreas) + for(var/area/shuttle/arrival/A in GLOB.sortedAreas) for(var/obj/structure/chair/C in A) new_latejoin += C if(!console) console = locate(/obj/machinery/requests_console) in A areas += A - if(latejoin.len) + if(GLOB.latejoin.len) WARNING("Map contains predefined latejoin spawn points and an arrivals shuttle. Using the arrivals shuttle.") if(!new_latejoin.len) WARNING("Arrivals shuttle contains no chairs for spawn points. Reverting to latejoin landmarks.") - if(!latejoin.len) + if(!GLOB.latejoin.len) WARNING("No latejoin landmarks exist. Players will spawn unbuckled on the shuttle.") return - latejoin = new_latejoin + GLOB.latejoin = new_latejoin /obj/docking_port/mobile/arrivals/dockRoundstart() SSshuttle.generate_transit_dock(src) @@ -88,7 +88,7 @@ damaged = TRUE if(console) console.say("Alert, hull breach detected!") - var/obj/machinery/announcement_system/announcer = pick(announcement_systems) + var/obj/machinery/announcement_system/announcer = pick(GLOB.announcement_systems) announcer.announce("ARRIVALS_BROKEN", channels = list()) if(mode != SHUTTLE_CALL) sound_played = FALSE @@ -112,7 +112,7 @@ Launch(FALSE) /obj/docking_port/mobile/arrivals/proc/CheckTurfsPressure() - for(var/I in latejoin) + for(var/I in GLOB.latejoin) var/turf/open/T = get_turf(I) var/pressure = T.air.return_pressure() if(pressure < HAZARD_LOW_PRESSURE || pressure > HAZARD_HIGH_PRESSURE) //simple safety check @@ -120,7 +120,7 @@ return FALSE /obj/docking_port/mobile/arrivals/proc/PersonCheck() - for(var/M in (living_mob_list & player_list)) + for(var/M in (GLOB.living_mob_list & GLOB.player_list)) var/mob/living/L = M if((get_area(M) in areas) && L.stat != DEAD) return TRUE diff --git a/code/modules/shuttle/assault_pod.dm b/code/modules/shuttle/assault_pod.dm index 0e18c4cdc52d8..37cd0238b3017 100644 --- a/code/modules/shuttle/assault_pod.dm +++ b/code/modules/shuttle/assault_pod.dm @@ -32,8 +32,8 @@ /obj/item/device/assault_pod/attack_self(mob/living/user) var/target_area - target_area = input("Area to land", "Select a Landing Zone", target_area) in teleportlocs - var/area/picked_area = teleportlocs[target_area] + target_area = input("Area to land", "Select a Landing Zone", target_area) in GLOB.teleportlocs + var/area/picked_area = GLOB.teleportlocs[target_area] if(!src || QDELETED(src)) return @@ -49,7 +49,7 @@ landing_zone.height = height landing_zone.setDir(lz_dir) - for(var/obj/machinery/computer/shuttle/S in machines) + for(var/obj/machinery/computer/shuttle/S in GLOB.machines) if(S.shuttleId == shuttle_id) S.possible_destinations = "[landing_zone.id]" diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index 358023f937be6..07c135d7955a5 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -16,7 +16,7 @@ say("Please equip your ID card into your ID slot to authenticate.") . = ..() -/obj/machinery/computer/emergency_shuttle/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = human_adjacent_state) +/obj/machinery/computer/emergency_shuttle/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.human_adjacent_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) @@ -63,7 +63,7 @@ to_chat(user, "You don't have an ID.") return - if(!(access_heads in ID.access)) + if(!(GLOB.access_heads in ID.access)) to_chat(user, "The access level of your card is not high enough.") return @@ -243,7 +243,7 @@ /obj/docking_port/mobile/emergency/proc/is_hijacked() var/has_people = FALSE - for(var/mob/living/player in player_list) + for(var/mob/living/player in GLOB.player_list) if(player.mind) if(player.stat != DEAD) if(issilicon(player)) //Borgs are technically dead anyways @@ -330,7 +330,7 @@ if(time_left <= 50 && !sound_played) //4 seconds left:REV UP THOSE ENGINES BOYS. - should sync up with the launch sound_played = 1 //Only rev them up once. var/list/areas = list() - for(var/area/shuttle/escape/E in sortedAreas) + for(var/area/shuttle/escape/E in GLOB.sortedAreas) areas += E hyperspace_sound(HYPERSPACE_WARMUP, areas) @@ -344,7 +344,7 @@ //now move the actual emergency shuttle to its transit dock var/list/areas = list() - for(var/area/shuttle/escape/E in sortedAreas) + for(var/area/shuttle/escape/E in GLOB.sortedAreas) areas += E hyperspace_sound(HYPERSPACE_LAUNCH, areas) enterTransit() @@ -359,7 +359,7 @@ if(SHUTTLE_ESCAPE) if(sound_played && time_left <= HYPERSPACE_END_TIME) var/list/areas = list() - for(var/area/shuttle/escape/E in sortedAreas) + for(var/area/shuttle/escape/E in GLOB.sortedAreas) areas += E hyperspace_sound(HYPERSPACE_END, areas) if(areaInstance.parallax_movedir && time_left <= PARALLAX_LOOP_TIME) @@ -404,7 +404,7 @@ /obj/docking_port/mobile/pod/request() var/obj/machinery/computer/shuttle/S = getControlConsole() - if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA || (S && S.emagged)) + if(GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA || (S && S.emagged)) if(launch_status == UNLAUNCHED) launch_status = EARLY_LAUNCHED return ..() @@ -510,7 +510,7 @@ return /obj/item/weapon/storage/pod/MouseDrop(over_object, src_location, over_location) - if(security_level == SEC_LEVEL_RED || security_level == SEC_LEVEL_DELTA || unlocked) + if(GLOB.security_level == SEC_LEVEL_RED || GLOB.security_level == SEC_LEVEL_DELTA || unlocked) . = ..() else to_chat(usr, "The storage unit will only unlock during a Red or Delta security alert.") diff --git a/code/modules/shuttle/ferry.dm b/code/modules/shuttle/ferry.dm index c9d73759e60cf..f90fe2f7e08a6 100644 --- a/code/modules/shuttle/ferry.dm +++ b/code/modules/shuttle/ferry.dm @@ -3,7 +3,7 @@ circuit = /obj/item/weapon/circuitboard/computer/ferry shuttleId = "ferry" possible_destinations = "ferry_home;ferry_away" - req_access = list(access_cent_general) + req_access = list(GLOB.access_cent_general) var/aiControlDisabled = 1 @@ -20,7 +20,7 @@ var/last_request //prevents spamming admins var/cooldown = 600 possible_destinations = "ferry_home;ferry_away" - req_access = list(access_cent_general) + req_access = list(GLOB.access_cent_general) resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF /obj/machinery/computer/shuttle/ferry/request/Topic(href, href_list) @@ -30,4 +30,4 @@ return last_request = world.time to_chat(usr, "Your request has been recieved by Centcom.") - to_chat(admins, "FERRY: [key_name_admin(usr)] (?) (FLW) (Move Ferry) is requesting to move the transport ferry to Centcom.") + to_chat(GLOB.admins, "FERRY: [key_name_admin(usr)] (?) (FLW) (Move Ferry) is requesting to move the transport ferry to Centcom.") diff --git a/code/modules/shuttle/manipulator.dm b/code/modules/shuttle/manipulator.dm index 64303e0e36afa..bb2f401cdba6a 100644 --- a/code/modules/shuttle/manipulator.dm +++ b/code/modules/shuttle/manipulator.dm @@ -35,7 +35,7 @@ /obj/machinery/shuttle_manipulator/ui_interact(mob/user, ui_key = "main", \ datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, \ - datum/ui_state/state = admin_state) + datum/ui_state/state = GLOB.admin_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) diff --git a/code/modules/shuttle/shuttle.dm b/code/modules/shuttle/shuttle.dm index 699f1921b2a84..a271ddfe41721 100644 --- a/code/modules/shuttle/shuttle.dm +++ b/code/modules/shuttle/shuttle.dm @@ -428,7 +428,7 @@ return ripple_turfs /obj/docking_port/mobile/proc/check_poddoors() - for(var/obj/machinery/door/poddoor/shuttledock/pod in airlocks) + for(var/obj/machinery/door/poddoor/shuttledock/pod in GLOB.airlocks) pod.check() //this is the main proc. It instantly moves our mobile port to stationary port S1 diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index f6b4c53da6f02..9e1cde78577b7 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -151,7 +151,7 @@ /mob/living/simple_animal/drone/snowflake/bardrone/Initialize() . = ..() - access_card.access |= access_cent_bar + access_card.access |= GLOB.access_cent_bar grant_all_languages(omnitongue=TRUE) /mob/living/simple_animal/hostile/alien/maid/barmaid @@ -169,7 +169,7 @@ access_card = new /obj/item/weapon/card/id(src) var/datum/job/captain/C = new /datum/job/captain access_card.access = C.get_access() - access_card.access |= access_cent_bar + access_card.access |= GLOB.access_cent_bar access_card.flags |= NODROP grant_all_languages(omnitongue=TRUE) @@ -212,7 +212,7 @@ return TRUE var/obj/item/weapon/card/id/ID = user.get_idcard() - if(ID && (access_cent_bar in ID.access)) + if(ID && (GLOB.access_cent_bar in ID.access)) return TRUE //Luxury Shuttle Blockers diff --git a/code/modules/shuttle/supply.dm b/code/modules/shuttle/supply.dm index 8f391570fc70c..1e3b9906bebb3 100644 --- a/code/modules/shuttle/supply.dm +++ b/code/modules/shuttle/supply.dm @@ -1,4 +1,4 @@ -var/list/blacklisted_cargo_types = typecacheof(list( +GLOBAL_LIST_INIT(blacklisted_cargo_types, typecacheof(list( /mob/living, /obj/structure/blob, /obj/effect/rune, @@ -18,7 +18,7 @@ var/list/blacklisted_cargo_types = typecacheof(list( /obj/effect/clockwork/spatial_gateway, /obj/structure/destructible/clockwork/powered/clockwork_obelisk, /obj/item/device/warp_cube - )) + ))) /obj/docking_port/mobile/supply name = "supply shuttle" @@ -49,7 +49,7 @@ var/list/blacklisted_cargo_types = typecacheof(list( for(var/trf in areaInstance) var/turf/T = trf for(var/a in T.GetAllContents()) - if(is_type_in_typecache(a, blacklisted_cargo_types)) + if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types)) return FALSE return TRUE @@ -102,7 +102,7 @@ var/list/blacklisted_cargo_types = typecacheof(list( /obj/docking_port/mobile/supply/proc/sell() var/presale_points = SSshuttle.points - if(!exports_list.len) // No exports list? Generate it! + if(!GLOB.exports_list.len) // No exports list? Generate it! setupExports() var/msg = "" @@ -116,7 +116,7 @@ var/list/blacklisted_cargo_types = typecacheof(list( if(sold_atoms) sold_atoms += "." - for(var/a in exports_list) + for(var/a in GLOB.exports_list) var/datum/export/E = a var/export_text = E.total_printout() if(!export_text) diff --git a/code/modules/shuttle/syndicate.dm b/code/modules/shuttle/syndicate.dm index c7c126b0cb635..8151b864442d8 100644 --- a/code/modules/shuttle/syndicate.dm +++ b/code/modules/shuttle/syndicate.dm @@ -6,7 +6,7 @@ icon_screen = "syndishuttle" icon_keyboard = "syndie_key" light_color = LIGHT_COLOR_RED - req_access = list(access_syndicate) + req_access = list(GLOB.access_syndicate) shuttleId = "syndicate" possible_destinations = "syndicate_away;syndicate_z5;syndicate_ne;syndicate_nw;syndicate_n;syndicate_se;syndicate_sw;syndicate_s" resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF @@ -32,11 +32,11 @@ var/moved = FALSE /obj/item/weapon/circuitboard/computer/syndicate_shuttle/New() - syndicate_shuttle_boards += src + GLOB.syndicate_shuttle_boards += src ..() /obj/item/weapon/circuitboard/computer/syndicate_shuttle/Destroy() - syndicate_shuttle_boards -= src + GLOB.syndicate_shuttle_boards -= src return ..() /obj/machinery/computer/shuttle/syndicate/drop_pod @@ -44,7 +44,7 @@ icon = 'icons/obj/terminals.dmi' icon_state = "dorm_available" light_color = LIGHT_COLOR_BLUE - req_access = list(access_syndicate) + req_access = list(GLOB.access_syndicate) shuttleId = "steel_rain" possible_destinations = null clockwork = TRUE //it'd look weird diff --git a/code/modules/shuttle/transit.dm b/code/modules/shuttle/transit.dm index 24bed0c63c50d..c03d4a2645065 100644 --- a/code/modules/shuttle/transit.dm +++ b/code/modules/shuttle/transit.dm @@ -7,8 +7,8 @@ /obj/effect/landmark/transit/New() . = ..() - transit_markers += src + GLOB.transit_markers += src /obj/effect/landmark/transit/Destroy() - transit_markers -= src + GLOB.transit_markers -= src . = ..() diff --git a/code/modules/space_transition/space_transition.dm b/code/modules/space_transition/space_transition.dm index 5c1def150bd2c..e1a4c743bf578 100644 --- a/code/modules/space_transition/space_transition.dm +++ b/code/modules/space_transition/space_transition.dm @@ -5,8 +5,7 @@ #define Z_LEVEL_EAST "4" #define Z_LEVEL_WEST "8" - -var/list/z_levels_list = list() +GLOBAL_LIST_EMPTY(z_levels_list) /datum/space_level var/name = "Your config settings failed, you need to fix this for the datum space levels to work" @@ -86,7 +85,7 @@ var/list/z_levels_list = list() D.name = A D.z_value = k if(D.linked != CROSSLINKED) - z_levels_list["[D.z_value]"] = D + GLOB.z_levels_list["[D.z_value]"] = D else SLS.Add(D) k++ @@ -116,8 +115,8 @@ var/list/z_levels_list = list() P = pick(possible_points) grid["[D.z_value]"] = D - for(var/A in z_levels_list) - grid[A] = z_levels_list[A] + for(var/A in GLOB.z_levels_list) + grid[A] = GLOB.z_levels_list[A] //Lists below are pre-calculated values arranged in the list in such a way to be easily accessable in the loop by the counter //Its either this or madness with lotsa math @@ -157,7 +156,7 @@ var/list/z_levels_list = list() //S.maptext = "[zdestination]" // for debugging for(var/A in grid) - z_levels_list[A] = grid[A] + GLOB.z_levels_list[A] = grid[A] #undef Z_LEVEL_NORTH #undef Z_LEVEL_SOUTH diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index d734c09922e0a..5a9ef2d6668f7 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -9,7 +9,7 @@ var/mob/living/ranged_ability_user var/ranged_clickcd_override = -1 -var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin verb for now +GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for the badmin verb for now /obj/effect/proc_holder/Destroy() if(ranged_ability_user) diff --git a/code/modules/spells/spell_types/area_teleport.dm b/code/modules/spells/spell_types/area_teleport.dm index 4abd8a297e0f2..0ff91495ed183 100644 --- a/code/modules/spells/spell_types/area_teleport.dm +++ b/code/modules/spells/spell_types/area_teleport.dm @@ -24,12 +24,12 @@ var/A = null if(!randomise_selection) - A = input("Area to teleport to", "Teleport", A) as null|anything in teleportlocs + A = input("Area to teleport to", "Teleport", A) as null|anything in GLOB.teleportlocs else - A = pick(teleportlocs) + A = pick(GLOB.teleportlocs) if(!A) return - var/area/thearea = teleportlocs[A] + var/area/thearea = GLOB.teleportlocs[A] return thearea diff --git a/code/modules/spells/spell_types/ethereal_jaunt.dm b/code/modules/spells/spell_types/ethereal_jaunt.dm index d470ac5feabdf..a282ec72b7c36 100644 --- a/code/modules/spells/spell_types/ethereal_jaunt.dm +++ b/code/modules/spells/spell_types/ethereal_jaunt.dm @@ -56,7 +56,7 @@ qdel(holder) if(!QDELETED(target)) if(mobloc.density) - for(var/direction in alldirs) + for(var/direction in GLOB.alldirs) var/turf/T = get_step(mobloc, direction) if(T) if(target.Move(T)) diff --git a/code/modules/spells/spell_types/lichdom.dm b/code/modules/spells/spell_types/lichdom.dm index 6ac5fa60709f9..f72eff6302cf7 100644 --- a/code/modules/spells/spell_types/lichdom.dm +++ b/code/modules/spells/spell_types/lichdom.dm @@ -90,7 +90,7 @@ name = "phylactery of [mind.name]" active_phylacteries++ - poi_list |= src + GLOB.poi_list |= src START_PROCESSING(SSobj, src) set_light(lon_range) if(initial(SSticker.mode.round_ends_with_antag_death)) @@ -99,7 +99,7 @@ /obj/item/phylactery/Destroy(force=FALSE) STOP_PROCESSING(SSobj, src) active_phylacteries-- - poi_list -= src + GLOB.poi_list -= src if(!active_phylacteries) SSticker.mode.round_ends_with_antag_death = initial(SSticker.mode.round_ends_with_antag_death) . = ..() diff --git a/code/modules/spells/spell_types/rightandwrong.dm b/code/modules/spells/spell_types/rightandwrong.dm index 621952e67c203..93d6b4c1dad87 100644 --- a/code/modules/spells/spell_types/rightandwrong.dm +++ b/code/modules/spells/spell_types/rightandwrong.dm @@ -9,7 +9,7 @@ to_chat(user, "You summoned [summon_type ? "magic" : "guns"]!") message_admins("[key_name_admin(user, 1)] summoned [summon_type ? "magic" : "guns"]!") log_game("[key_name(user)] summoned [summon_type ? "magic" : "guns"]!") - for(var/mob/living/carbon/human/H in player_list) + for(var/mob/living/carbon/human/H in GLOB.player_list) if(H.stat == 2 || !(H.client)) continue if(H.mind) if(H.mind.special_role == "Wizard" || H.mind.special_role == "apprentice" || H.mind.special_role == "survivalist") continue diff --git a/code/modules/spells/spell_types/spacetime_distortion.dm b/code/modules/spells/spell_types/spacetime_distortion.dm index f78737d2703b7..bed0255b027a1 100644 --- a/code/modules/spells/spell_types/spacetime_distortion.dm +++ b/code/modules/spells/spell_types/spacetime_distortion.dm @@ -75,8 +75,8 @@ /obj/effect/cross_action/spacetime_dist/Initialize(mapload) ..() - sound = "sound/guitar/[safepick(guitar_notes)]" - dir = pick(cardinal) + sound = "sound/guitar/[safepick(GLOB.guitar_notes)]" + dir = pick(GLOB.cardinal) /obj/effect/cross_action/spacetime_dist/proc/walk_link(atom/movable/AM) if(linked_dist && walks_left > 0) diff --git a/code/modules/station_goals/bsa.dm b/code/modules/station_goals/bsa.dm index a0e481cccaf90..0d4200d49eb1d 100644 --- a/code/modules/station_goals/bsa.dm +++ b/code/modules/station_goals/bsa.dm @@ -248,7 +248,7 @@ var/area_aim = FALSE //should also show areas for targeting /obj/machinery/computer/bsa_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = physical_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "bsa", name, 400, 305, master_ui, state) @@ -280,12 +280,12 @@ /obj/machinery/computer/bsa_control/proc/calibrate(mob/user) var/list/gps_locators = list() - for(var/obj/item/device/gps/G in GPS_list) //nulls on the list somehow + for(var/obj/item/device/gps/G in GLOB.GPS_list) //nulls on the list somehow gps_locators[G.gpstag] = G var/list/options = gps_locators if(area_aim) - options += teleportlocs + options += GLOB.teleportlocs var/V = input(user,"Select target", "Select target",null) in options|null target = options[V] diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index a21cb0a0fbc7a..3556b7d38b5f8 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -53,7 +53,7 @@ /datum/station_goal/dna_vault/check_completion() if(..()) return TRUE - for(var/obj/machinery/dna_vault/V in machines) + for(var/obj/machinery/dna_vault/V in GLOB.machines) if(V.animals.len >= animal_count && V.plants.len >= plant_count && V.dna.len >= human_count) return TRUE return FALSE @@ -75,8 +75,6 @@ plants = list() dna = list() -var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/monkey,/mob/living/carbon/alien)) - /obj/item/device/dna_probe/afterattack(atom/target, mob/user, proximity) ..() if(!proximity || !target) @@ -96,6 +94,7 @@ var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/monkey,/mob/li to_chat(user, "Plant data added to local storage.") //animals + var/static/list/non_simple_animals = typecacheof(list(/mob/living/carbon/monkey,/mob/living/carbon/alien)) if(isanimal(target) || is_type_in_typecache(target,non_simple_animals)) if(isanimal(target)) var/mob/living/simple_animal/A = target @@ -180,7 +179,7 @@ var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/monkey,/mob/li . = ..() -/obj/machinery/dna_vault/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = physical_state) +/obj/machinery/dna_vault/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) roll_powers(user) diff --git a/code/modules/station_goals/shield.dm b/code/modules/station_goals/shield.dm index f2c721d14bf0e..863d7d4bde3d9 100644 --- a/code/modules/station_goals/shield.dm +++ b/code/modules/station_goals/shield.dm @@ -30,7 +30,7 @@ /datum/station_goal/proc/get_coverage() var/list/coverage = list() - for(var/obj/machinery/satellite/meteor_shield/A in machines) + for(var/obj/machinery/satellite/meteor_shield/A in GLOB.machines) if(!A.active || A.z != ZLEVEL_STATION) continue coverage |= view(A.kill_range,A) @@ -47,7 +47,7 @@ circuit = /obj/item/weapon/circuitboard/machine/computer/sat_control var/notice -/obj/machinery/computer/sat_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/obj/machinery/computer/sat_control/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "sat_control", name, 400, 305, master_ui, state) @@ -62,7 +62,7 @@ . = TRUE /obj/machinery/computer/sat_control/proc/toggle(id) - for(var/obj/machinery/satellite/S in machines) + for(var/obj/machinery/satellite/S in GLOB.machines) if(S.id == id && S.z == z) S.toggle() @@ -70,7 +70,7 @@ var/list/data = list() data["satellites"] = list() - for(var/obj/machinery/satellite/S in machines) + for(var/obj/machinery/satellite/S in GLOB.machines) data["satellites"] += list(list( "id" = S.id, "active" = S.active, @@ -147,7 +147,7 @@ /obj/machinery/satellite/meteor_shield/process() if(!active) return - for(var/obj/effect/meteor/M in meteor_list) + for(var/obj/effect/meteor/M in GLOB.meteor_list) if(M.z != z) continue if(get_dist(M,src) > kill_range) diff --git a/code/modules/station_goals/station_goal.dm b/code/modules/station_goals/station_goal.dm index 67e7e41eb43f1..30146592055bb 100644 --- a/code/modules/station_goals/station_goal.dm +++ b/code/modules/station_goals/station_goal.dm @@ -13,7 +13,7 @@ /datum/station_goal/proc/send_report() priority_announce("Priority Nanotrasen directive received. Project \"[name]\" details inbound.", "Incoming Priority Message", 'sound/AI/commandreport.ogg') - print_command_report(get_report(),"Nanotrasen Directive [pick(phonetic_alphabet)] \Roman[rand(1,50)]", announce=FALSE) + print_command_report(get_report(),"Nanotrasen Directive [pick(GLOB.phonetic_alphabet)] \Roman[rand(1,50)]", announce=FALSE) on_report() /datum/station_goal/proc/on_report() diff --git a/code/modules/stock_market/articles.dm b/code/modules/stock_market/articles.dm index 08c693b6803f1..1ed89d786f2d1 100644 --- a/code/modules/stock_market/articles.dm +++ b/code/modules/stock_market/articles.dm @@ -14,11 +14,11 @@ M += ucfirst(P) return jointext(M, " ") -var/global/list/FrozenAccounts = list() +GLOBAL_LIST_EMPTY(FrozenAccounts) /proc/list_frozen() - for (var/A in FrozenAccounts) - to_chat(usr, "[A]: [length(FrozenAccounts[A])] borrows") + for (var/A in GLOB.FrozenAccounts) + to_chat(usr, "[A]: [length(GLOB.FrozenAccounts[A])] borrows") /datum/article var/headline = "Something big is happening" @@ -94,11 +94,11 @@ var/global/list/FrozenAccounts = list() /datum/article/proc/generateAuthorName() switch(rand(1,3)) if (1) - return "[consonant()]. [pick(last_names)]" + return "[consonant()]. [pick(GLOB.last_names)]" if (2) - return "[prob(50) ? pick(first_names_male) : pick(first_names_female)] [consonant()].[prob(50) ? "[consonant()]. " : null] [pick(last_names)]" + return "[prob(50) ? pick(GLOB.first_names_male) : pick(GLOB.first_names_female)] [consonant()].[prob(50) ? "[consonant()]. " : null] [pick(GLOB.last_names)]" if (3) - return "[prob(50) ? pick(first_names_male) : pick(first_names_female)] \"[prob(50) ? pick(first_names_male) : pick(first_names_female)]\" [pick(last_names)]" + return "[prob(50) ? pick(GLOB.first_names_male) : pick(GLOB.first_names_female)] \"[prob(50) ? pick(GLOB.first_names_male) : pick(GLOB.first_names_female)]\" [pick(GLOB.last_names)]" /datum/article/proc/formatSpacetime() var/ticksc = round(ticks/100) diff --git a/code/modules/stock_market/computer.dm b/code/modules/stock_market/computer.dm index 51ced45e401a7..5299debf24fcb 100644 --- a/code/modules/stock_market/computer.dm +++ b/code/modules/stock_market/computer.dm @@ -64,8 +64,8 @@ a.updated { var/dat = "[station_name()] Stock Exchange[css]" dat += "Welcome, [logged_in]
    Credits: [balance()]
    " - for (var/datum/stock/S in stockExchange.last_read) - var/list/LR = stockExchange.last_read[S] + for (var/datum/stock/S in GLOB.stockExchange.last_read) + var/list/LR = GLOB.stockExchange.last_read[S] if (!(logged_in in LR)) LR[logged_in] = 0 dat += "View mode: [vmode ? "Compact" : "Full"] " @@ -76,7 +76,7 @@ a.updated { dat += "

    Listed stocks

    " if (vmode == 0) - for (var/datum/stock/S in stockExchange.stocks) + for (var/datum/stock/S in GLOB.stockExchange.stocks) var/mystocks = 0 if (logged_in && (logged_in in S.shareholders)) mystocks = S.shareholders[logged_in] @@ -94,7 +94,7 @@ a.updated { dat += "[prod]
    " var/news = 0 if (logged_in) - var/list/LR = stockExchange.last_read[S] + var/list/LR = GLOB.stockExchange.last_read[S] var/lrt = LR[logged_in] for (var/datum/article/A in S.articles) if (A.ticks > lrt) @@ -111,7 +111,7 @@ a.updated { dat += "" dat += "" - for (var/datum/stock/S in stockExchange.stocks) + for (var/datum/stock/S in GLOB.stockExchange.stocks) var/mystocks = 0 if (logged_in && (logged_in in S.shareholders)) mystocks = S.shareholders[logged_in] @@ -144,7 +144,7 @@ a.updated { dat += "" var/news = 0 if (logged_in) - var/list/LR = stockExchange.last_read[S] + var/list/LR = GLOB.stockExchange.last_read[S] var/lrt = LR[logged_in] for (var/datum/article/A in S.articles) if (A.ticks > lrt) @@ -205,7 +205,7 @@ a.updated { to_chat(user, "Could not complete transaction.") return to_chat(user, "Sold [amt] shares of [S.name] at [S.current_value] a share for [total] credits.") - stockExchange.add_log(/datum/stock_log/sell, user.name, S.name, amt, S.current_value, total) + GLOB.stockExchange.add_log(/datum/stock_log/sell, user.name, S.name, amt, S.current_value, total) /obj/machinery/computer/stockexchange/proc/buy_some_shares(var/datum/stock/S, var/mob/user) if (!user || !S) @@ -240,12 +240,12 @@ a.updated { var/total = amt * S.current_value to_chat(user, "Bought [amt] shares of [S.name] at [S.current_value] a share for [total] credits.") - stockExchange.add_log(/datum/stock_log/buy, user.name, S.name, amt, S.current_value, total) + GLOB.stockExchange.add_log(/datum/stock_log/buy, user.name, S.name, amt, S.current_value, total) /obj/machinery/computer/stockexchange/proc/do_borrowing_deal(var/datum/borrow/B, var/mob/user) if (B.stock.borrow(B, logged_in)) to_chat(user, "You successfully borrowed [B.share_amount] shares. Deposit: [B.deposit].") - stockExchange.add_log(/datum/stock_log/borrow, user.name, B.stock.name, B.share_amount, B.deposit) + GLOB.stockExchange.add_log(/datum/stock_log/borrow, user.name, B.stock.name, B.share_amount, B.deposit) else to_chat(user, "Could not complete transaction. Check your account balance.") @@ -257,7 +257,7 @@ a.updated { usr.machine = src if (href_list["viewhistory"]) - var/datum/stock/S = locate(href_list["viewhistory"]) in stockExchange.stocks + var/datum/stock/S = locate(href_list["viewhistory"]) in GLOB.stockExchange.stocks if (S) S.displayValues(usr) @@ -265,18 +265,18 @@ a.updated { logged_in = null if (href_list["buyshares"]) - var/datum/stock/S = locate(href_list["buyshares"]) in stockExchange.stocks + var/datum/stock/S = locate(href_list["buyshares"]) in GLOB.stockExchange.stocks if (S) buy_some_shares(S, usr) if (href_list["sellshares"]) - var/datum/stock/S = locate(href_list["sellshares"]) in stockExchange.stocks + var/datum/stock/S = locate(href_list["sellshares"]) in GLOB.stockExchange.stocks if (S) sell_some_shares(S, usr) if (href_list["show_logs"]) var/dat = "Stock Transaction Logs

    Stock Transaction Logs


    " - for(var/D in stockExchange.logs) + for(var/D in GLOB.stockExchange.logs) var/datum/stock_log/L = D if(istype(L, /datum/stock_log/buy)) dat += "[L.time] | [L.user_name] bought [L.stocks] stocks at [L.shareprice] a share for [L.money] total credits in [L.company_name].
    " @@ -295,7 +295,7 @@ a.updated { if (href_list["archive"]) var/datum/stock/S = locate(href_list["archive"]) if (logged_in && logged_in != "") - var/list/LR = stockExchange.last_read[S] + var/list/LR = GLOB.stockExchange.last_read[S] LR[logged_in] = world.time var/dat = "News feed for [S.name]

    News feed for [S.name]

    " dat += "

    Events

    " diff --git a/code/modules/stock_market/events.dm b/code/modules/stock_market/events.dm index 72f9858ea3d94..17a92ea83fefe 100644 --- a/code/modules/stock_market/events.dm +++ b/code/modules/stock_market/events.dm @@ -102,11 +102,11 @@ company.bankrupt = 1 for (var/X in company.shareholders) var/amt = company.shareholders[X] - stockExchange.balanceLog(X, -amt * company.current_value) + GLOB.stockExchange.balanceLog(X, -amt * company.current_value) company.shareholders = list() company.current_value = 0 company.borrow_brokers = list() - stockExchange.generateStocks(1) + GLOB.stockExchange.generateStocks(1) var/bailout = (effect > 0 && prob(80)) || (effect < 0 && prob(20)) current_title = "[company.name] [bailout ? "bailed out" : "on a painful rebound"]" @@ -180,7 +180,7 @@ /datum/stockEvent/arrest/transition() switch (phase_id) if (0) - tname = "[female ? pick(first_names_female) : pick(first_names_male)] [pick(last_names)]" + tname = "[female ? pick(GLOB.first_names_female) : pick(GLOB.first_names_male)] [pick(GLOB.last_names)]" next_phase = world.time + rand(300*TIME_MULTIPLIER, 600*TIME_MULTIPLIER) * (10*TIME_MULTIPLIER) var/datum/article/A = generateArrestArticle() if (!A.opinion) diff --git a/code/modules/stock_market/stockmarket.dm b/code/modules/stock_market/stockmarket.dm index 9bb1828f8a6c1..9d09d38119e2a 100644 --- a/code/modules/stock_market/stockmarket.dm +++ b/code/modules/stock_market/stockmarket.dm @@ -123,7 +123,7 @@ L.time = time2text(world.timeofday, "hh:mm") logs += L -var/global/datum/stockMarket/stockExchange = new +GLOBAL_DATUM_INIT(stockExchange, /datum/stockMarket, new) /proc/plotBarGraph(var/list/points, var/base_text, var/width=400, var/height=400) var/output = "
     IDNameValueOwnedAvailActions
    [S.available_shares]
    " diff --git a/code/modules/stock_market/stocks.dm b/code/modules/stock_market/stocks.dm index 9969136ec516d..2b4a4c3d6fdfd 100644 --- a/code/modules/stock_market/stocks.dm +++ b/code/modules/stock_market/stocks.dm @@ -190,10 +190,10 @@ if (world.time > borrow.grace_expires) modifyAccount(borrow.borrower, -max(current_value * borrow.share_debt, 0), 1) borrows -= borrow - if (borrow.borrower in FrozenAccounts) - FrozenAccounts[borrow.borrower] -= borrow - if (length(FrozenAccounts[borrow.borrower]) == 0) - FrozenAccounts -= borrow.borrower + if (borrow.borrower in GLOB.FrozenAccounts) + GLOB.FrozenAccounts[borrow.borrower] -= borrow + if (length(GLOB.FrozenAccounts[borrow.borrower]) == 0) + GLOB.FrozenAccounts -= borrow.borrower qdel(borrow) else if (world.time > borrow.lease_expires) if (borrow.borrower in shareholders) @@ -201,10 +201,10 @@ if (amt > borrow.share_debt) shareholders[borrow.borrower] -= borrow.share_debt borrows -= borrow - if (borrow.borrower in FrozenAccounts) - FrozenAccounts[borrow.borrower] -= borrow - if (length(FrozenAccounts[borrow.borrower]) == 0) - FrozenAccounts -= borrow.borrower + if (borrow.borrower in GLOB.FrozenAccounts) + GLOB.FrozenAccounts[borrow.borrower] -= borrow + if (length(GLOB.FrozenAccounts[borrow.borrower]) == 0) + GLOB.FrozenAccounts -= borrow.borrower qdel(borrow) else shareholders -= borrow.borrower @@ -229,9 +229,9 @@ /datum/stock/proc/generateBrokers() if (borrow_brokers.len > 2) return - if (!stockExchange.stockBrokers.len) - stockExchange.generateBrokers() - var/broker = pick(stockExchange.stockBrokers) + if (!GLOB.stockExchange.stockBrokers.len) + GLOB.stockExchange.generateBrokers() + var/broker = pick(GLOB.stockExchange.stockBrokers) var/datum/borrow/B = new B.broker = broker B.stock = src @@ -248,7 +248,7 @@ if (by < 0 && SSshuttle.points + by < 0 && !force) return 0 SSshuttle.points += by - stockExchange.balanceLog(whose, by) + GLOB.stockExchange.balanceLog(whose, by) return 1 return 0 @@ -271,10 +271,10 @@ borrows += B B.borrower = who B.grace_expires = B.lease_expires + B.grace_time - if (!(who in FrozenAccounts)) - FrozenAccounts[who] = list(B) + if (!(who in GLOB.FrozenAccounts)) + GLOB.FrozenAccounts[who] = list(B) else - FrozenAccounts[who] += B + GLOB.FrozenAccounts[who] += B return 1 /datum/stock/proc/buyShares(var/who, var/howmany) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 8e5197ef60026..1025e28669079 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -30,7 +30,7 @@ var/turf/location = C.loc if(istype(location)) C.add_splatter_floor(location) - var/direction = pick(cardinal) + var/direction = pick(GLOB.cardinal) var/t_range = rand(2,max(throw_range/2, 2)) var/turf/target_turf = get_turf(src) for(var/i in 1 to t_range-1) diff --git a/code/modules/surgery/bodyparts/head.dm b/code/modules/surgery/bodyparts/head.dm index 193279365423d..6417ade81987d 100644 --- a/code/modules/surgery/bodyparts/head.dm +++ b/code/modules/surgery/bodyparts/head.dm @@ -126,7 +126,7 @@ if(status != BODYPART_ROBOTIC) //having a robotic head hides certain features. //facial hair if(facial_hair_style) - S = facial_hair_styles_list[facial_hair_style] + S = GLOB.facial_hair_styles_list[facial_hair_style] if(S) var/image/img_facial = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER, "dir"=SOUTH) img_facial.color = "#" + facial_hair_color @@ -143,7 +143,7 @@ standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained", "layer" = -HAIR_LAYER, "dir"=SOUTH) else if(hair_style) - S = hair_styles_list[hair_style] + S = GLOB.hair_styles_list[hair_style] if(S) var/image/img_hair = image("icon" = S.icon, "icon_state" = "[S.icon_state]", "layer" = -HAIR_LAYER, "dir"=SOUTH) img_hair.color = "#" + hair_color diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index 9740267051802..7066743a84371 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -20,7 +20,7 @@ current_surgery = S if(!current_surgery) - var/list/all_surgeries = surgeries_list.Copy() + var/list/all_surgeries = GLOB.surgeries_list.Copy() var/list/available_surgeries = list() for(var/datum/surgery/S in all_surgeries) diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 7ca10c5c5e3f0..75014626bee54 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -17,13 +17,13 @@ /obj/item/organ/cyberimp/eyes/hud/Insert(var/mob/living/carbon/M, var/special = 0) ..() if(HUD_type) - var/datum/atom_hud/H = huds[HUD_type] + var/datum/atom_hud/H = GLOB.huds[HUD_type] H.add_hud_to(M) M.permanent_huds |= H /obj/item/organ/cyberimp/eyes/hud/Remove(var/mob/living/carbon/M, var/special = 0) if(HUD_type) - var/datum/atom_hud/H = huds[HUD_type] + var/datum/atom_hud/H = GLOB.huds[HUD_type] M.permanent_huds ^= H H.remove_hud_from(M) ..() diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 78ce15808faf4..abff3cf0310e3 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -457,7 +457,7 @@ if(H && H.dna && H.dna.species && H.dna.species.species_traits) species_traits = H.dna.species.species_traits - if(!(mutations_list[COLDRES] in H.dna.mutations) && !(RESISTCOLD in species_traits)) // COLD DAMAGE + if(!(GLOB.mutations_list[COLDRES] in H.dna.mutations) && !(RESISTCOLD in species_traits)) // COLD DAMAGE switch(breath.temperature) if(-INFINITY to 120) H.apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head") @@ -584,7 +584,7 @@ //Hacks var/mob/living/carbon/human/user = usr var/rendered = "[user.name]: [message]" - for(var/mob/living/carbon/human/H in living_mob_list) + for(var/mob/living/carbon/human/H in GLOB.living_mob_list) var/obj/item/organ/tongue/T = H.getorganslot("tongue") if(!T || T.type != type) continue @@ -594,7 +594,7 @@ if(Ayy.team != Byy.team) continue to_chat(H, rendered) - for(var/mob/M in dead_mob_list) + for(var/mob/M in GLOB.dead_mob_list) var/link = FOLLOW_LINK(M, user) to_chat(M, "[link] [rendered]") return "" diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 6c2e8a4ad6cd8..e844918eeba73 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -1,48 +1,3 @@ -var/static/regex/stun_words = regex("stop|wait|stand still|hold on|halt") -var/static/regex/weaken_words = regex("drop|fall|trip|weaken") -var/static/regex/sleep_words = regex("sleep|slumber") -var/static/regex/vomit_words = regex("vomit|throw up") -var/static/regex/silence_words = regex("shut up|silence|ssh|quiet|hush") -var/static/regex/hallucinate_words = regex("see the truth|hallucinate") -var/static/regex/wakeup_words = regex("wake up|awaken") -var/static/regex/heal_words = regex("live|heal|survive|mend|heroes never die") -var/static/regex/hurt_words = regex("die|suffer|hurt|pain") -var/static/regex/bleed_words = regex("bleed|there will be blood") -var/static/regex/burn_words = regex("burn|ignite") -var/static/regex/hot_words = regex("heat|hot|hell") -var/static/regex/cold_words = regex("cold|cool down|chill|freeze") -var/static/regex/repulse_words = regex("shoo|go away|leave me alone|begone|flee|fus ro dah|get away|repulse") -var/static/regex/attract_words = regex("come here|come to me|get over here|attract") -var/static/regex/whoareyou_words = regex("who are you|say your name|state your name|identify") -var/static/regex/saymyname_words = regex("say my name|who am i|whoami") -var/static/regex/knockknock_words = regex("knock knock") -var/static/regex/statelaws_words = regex("state laws|state your laws") -var/static/regex/move_words = regex("move|walk") -var/static/regex/left_words = regex("left|west|port") -var/static/regex/right_words = regex("right|east|starboard") -var/static/regex/up_words = regex("up|north|fore") -var/static/regex/down_words = regex("down|south|aft") -var/static/regex/walk_words = regex("slow down") -var/static/regex/run_words = regex("run") -var/static/regex/helpintent_words = regex("help|hug") -var/static/regex/disarmintent_words = regex("disarm") -var/static/regex/grabintent_words = regex("grab") -var/static/regex/harmintent_words = regex("harm|fight|punch") -var/static/regex/throwmode_words = regex("throw|catch") -var/static/regex/flip_words = regex("flip|rotate|revolve|roll|somersault") -var/static/regex/speak_words = regex("speak|say something") -var/static/regex/rest_words = regex("rest") -var/static/regex/getup_words = regex("get up") -var/static/regex/sit_words = regex("sit") -var/static/regex/stand_words = regex("stand") -var/static/regex/dance_words = regex("dance") -var/static/regex/jump_words = regex("jump") -var/static/regex/salute_words = regex("salute") -var/static/regex/deathgasp_words = regex("play dead") -var/static/regex/clap_words = regex("clap|applaud") -var/static/regex/honk_words = regex("ho+nk") //hooooooonk -var/static/regex/multispin_words = regex("like a record baby|right round") - #define COOLDOWN_STUN 1200 #define COOLDOWN_DAMAGE 600 #define COOLDOWN_MEME 300 @@ -170,7 +125,7 @@ var/static/regex/multispin_words = regex("like a record baby|right round") if(user.mind.assigned_role == "Chaplain") power_multiplier *= 2 //Command staff has authority - if(user.mind.assigned_role in command_positions) + if(user.mind.assigned_role in GLOB.command_positions) power_multiplier *= 1.4 //Why are you speaking if(user.mind.assigned_role == "Mime") @@ -218,6 +173,51 @@ var/static/regex/multispin_words = regex("like a record baby|right round") power_multiplier *= (1 + (1/specific_listeners.len)) //2x on a single guy, 1.5x on two and so on message = copytext(message, 0, 1)+copytext(message, 1 + length(found_string), length(message) + 1) + var/static/regex/stun_words = regex("stop|wait|stand still|hold on|halt") + var/static/regex/weaken_words = regex("drop|fall|trip|weaken") + var/static/regex/sleep_words = regex("sleep|slumber") + var/static/regex/vomit_words = regex("vomit|throw up") + var/static/regex/silence_words = regex("shut up|silence|ssh|quiet|hush") + var/static/regex/hallucinate_words = regex("see the truth|hallucinate") + var/static/regex/wakeup_words = regex("wake up|awaken") + var/static/regex/heal_words = regex("live|heal|survive|mend|heroes never die") + var/static/regex/hurt_words = regex("die|suffer|hurt|pain") + var/static/regex/bleed_words = regex("bleed|there will be blood") + var/static/regex/burn_words = regex("burn|ignite") + var/static/regex/hot_words = regex("heat|hot|hell") + var/static/regex/cold_words = regex("cold|cool down|chill|freeze") + var/static/regex/repulse_words = regex("shoo|go away|leave me alone|begone|flee|fus ro dah|get away|repulse") + var/static/regex/attract_words = regex("come here|come to me|get over here|attract") + var/static/regex/whoareyou_words = regex("who are you|say your name|state your name|identify") + var/static/regex/saymyname_words = regex("say my name|who am i|whoami") + var/static/regex/knockknock_words = regex("knock knock") + var/static/regex/statelaws_words = regex("state laws|state your laws") + var/static/regex/move_words = regex("move|walk") + var/static/regex/left_words = regex("left|west|port") + var/static/regex/right_words = regex("right|east|starboard") + var/static/regex/up_words = regex("up|north|fore") + var/static/regex/down_words = regex("down|south|aft") + var/static/regex/walk_words = regex("slow down") + var/static/regex/run_words = regex("run") + var/static/regex/helpintent_words = regex("help|hug") + var/static/regex/disarmintent_words = regex("disarm") + var/static/regex/grabintent_words = regex("grab") + var/static/regex/harmintent_words = regex("harm|fight|punch") + var/static/regex/throwmode_words = regex("throw|catch") + var/static/regex/flip_words = regex("flip|rotate|revolve|roll|somersault") + var/static/regex/speak_words = regex("speak|say something") + var/static/regex/rest_words = regex("rest") + var/static/regex/getup_words = regex("get up") + var/static/regex/sit_words = regex("sit") + var/static/regex/stand_words = regex("stand") + var/static/regex/dance_words = regex("dance") + var/static/regex/jump_words = regex("jump") + var/static/regex/salute_words = regex("salute") + var/static/regex/deathgasp_words = regex("play dead") + var/static/regex/clap_words = regex("clap|applaud") + var/static/regex/honk_words = regex("ho+nk") //hooooooonk + var/static/regex/multispin_words = regex("like a record baby|right round") + //STUN if(findtext(message, stun_words)) cooldown = COOLDOWN_STUN @@ -371,7 +371,7 @@ var/static/regex/multispin_words = regex("like a record baby|right round") for(var/i=1, i<=(5*power_multiplier), i++) for(var/V in listeners) var/mob/living/L = V - step(L, direction ? direction : pick(cardinal)) + step(L, direction ? direction : pick(GLOB.cardinal)) sleep(10) //WALK diff --git a/code/modules/telesci/gps.dm b/code/modules/telesci/gps.dm index 6cbde6f4759b9..90542d9ea3c38 100644 --- a/code/modules/telesci/gps.dm +++ b/code/modules/telesci/gps.dm @@ -1,4 +1,4 @@ -var/list/GPS_list = list() +GLOBAL_LIST_EMPTY(GPS_list) /obj/item/device/gps name = "global positioning system" desc = "Helping lost spacemen find their way through the planets since 2016. Alt+click to toggle power." @@ -14,12 +14,12 @@ var/list/GPS_list = list() /obj/item/device/gps/New() ..() - GPS_list.Add(src) + GLOB.GPS_list.Add(src) name = "global positioning system ([gpstag])" add_overlay("working") /obj/item/device/gps/Destroy() - GPS_list.Remove(src) + GLOB.GPS_list.Remove(src) return ..() /obj/item/device/gps/emp_act(severity) @@ -53,7 +53,7 @@ var/list/GPS_list = list() return var/obj/item/device/gps/t = "" - var/gps_window_height = 110 + GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show + var/gps_window_height = 110 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show if(emped) t += "ERROR" else @@ -63,7 +63,7 @@ var/list/GPS_list = list() t += "
    Bluespace coordinates saved: [locked_location.loc]" gps_window_height += 20 - for(var/obj/item/device/gps/G in GPS_list) + for(var/obj/item/device/gps/G in GLOB.GPS_list) var/turf/pos = get_turf(G) var/area/gps_area = get_area(G) var/tracked_gpstag = G.gpstag diff --git a/code/modules/tgui/external.dm b/code/modules/tgui/external.dm index d3d5c1a70373b..4c6102cc3755c 100644 --- a/code/modules/tgui/external.dm +++ b/code/modules/tgui/external.dm @@ -17,7 +17,7 @@ * optional master_ui datum/tgui The parent UI. * optional state datum/ui_state The state used to determine status. **/ -/datum/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state) +/datum/proc/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) return -1 // Not implemented. /** diff --git a/code/modules/tgui/states/admin.dm b/code/modules/tgui/states/admin.dm index 62e18bb6b96c3..945a86443011a 100644 --- a/code/modules/tgui/states/admin.dm +++ b/code/modules/tgui/states/admin.dm @@ -4,7 +4,7 @@ * Checks that the user is an admin, end-of-story. **/ -/var/global/datum/ui_state/admin_state/admin_state = new() +GLOBAL_DATUM_INIT(admin_state, /datum/ui_state/admin_state, new) /datum/ui_state/admin_state/can_use_topic(src_object, mob/user) if(check_rights_for(user.client, R_ADMIN)) diff --git a/code/modules/tgui/states/always.dm b/code/modules/tgui/states/always.dm index e039abd3078a1..b6c689d5d8b42 100644 --- a/code/modules/tgui/states/always.dm +++ b/code/modules/tgui/states/always.dm @@ -5,7 +5,7 @@ * Always grants the user UI_INTERACTIVE. Period. **/ -/var/global/datum/ui_state/always_state/always_state = new() +GLOBAL_DATUM_INIT(always_state, /datum/ui_state/always_state, new) /datum/ui_state/always_state/can_use_topic(src_object, mob/user) return UI_INTERACTIVE diff --git a/code/modules/tgui/states/conscious.dm b/code/modules/tgui/states/conscious.dm index 9a5c1a5e54fa0..4323c1391c410 100644 --- a/code/modules/tgui/states/conscious.dm +++ b/code/modules/tgui/states/conscious.dm @@ -4,7 +4,7 @@ * Only checks if the user is conscious. **/ -/var/global/datum/ui_state/conscious_state/conscious_state = new() +GLOBAL_DATUM_INIT(conscious_state, /datum/ui_state/conscious_state, new) /datum/ui_state/conscious_state/can_use_topic(src_object, mob/user) if(user.stat == CONSCIOUS) diff --git a/code/modules/tgui/states/contained.dm b/code/modules/tgui/states/contained.dm index 6cb88abea284b..7387f7e6cbb74 100644 --- a/code/modules/tgui/states/contained.dm +++ b/code/modules/tgui/states/contained.dm @@ -4,7 +4,7 @@ * Checks that the user is inside the src_object. **/ -/var/global/datum/ui_state/contained_state/contained_state = new() +GLOBAL_DATUM_INIT(contained_state, /datum/ui_state/contained_state, new) /datum/ui_state/contained_state/can_use_topic(atom/src_object, mob/user) if(!src_object.contains(user)) diff --git a/code/modules/tgui/states/deep_inventory.dm b/code/modules/tgui/states/deep_inventory.dm index 70f2a59992e0f..06bdb92f3a5c6 100644 --- a/code/modules/tgui/states/deep_inventory.dm +++ b/code/modules/tgui/states/deep_inventory.dm @@ -4,7 +4,7 @@ * Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory. **/ -/var/global/datum/ui_state/deep_inventory_state/deep_inventory_state = new() +GLOBAL_DATUM_INIT(deep_inventory_state, /datum/ui_state/deep_inventory_state, new) /datum/ui_state/deep_inventory_state/can_use_topic(src_object, mob/user) if(!user.contains(src_object)) diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm index 38c3f4d196c65..573dcdf7cf241 100644 --- a/code/modules/tgui/states/default.dm +++ b/code/modules/tgui/states/default.dm @@ -4,7 +4,7 @@ * Checks a number of things -- mostly physical distance for humans and view for robots. **/ -/var/global/datum/ui_state/default/default_state = new() +GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new) /datum/ui_state/default/can_use_topic(src_object, mob/user) return user.default_can_use_topic(src_object) // Call the individual mob-overriden procs. @@ -43,7 +43,7 @@ return // The AI can interact with anything it can see nearby, or with cameras. - if((get_dist(src, src_object) <= client.view) || cameranet.checkTurfVis(get_turf_pixel(src_object))) + if((get_dist(src, src_object) <= client.view) || GLOB.cameranet.checkTurfVis(get_turf_pixel(src_object))) return UI_INTERACTIVE return UI_CLOSE diff --git a/code/modules/tgui/states/hands.dm b/code/modules/tgui/states/hands.dm index a312bcecddf2f..5da0e5d500f19 100644 --- a/code/modules/tgui/states/hands.dm +++ b/code/modules/tgui/states/hands.dm @@ -4,7 +4,7 @@ * Checks that the src_object is in the user's hands. **/ -/var/global/datum/ui_state/hands_state/hands_state = new() +GLOBAL_DATUM_INIT(hands_state, /datum/ui_state/hands_state, new) /datum/ui_state/hands_state/can_use_topic(src_object, mob/user) . = user.shared_ui_interaction(src_object) diff --git a/code/modules/tgui/states/human_adjacent.dm b/code/modules/tgui/states/human_adjacent.dm index feedd45702059..0ab20b36ffd0e 100644 --- a/code/modules/tgui/states/human_adjacent.dm +++ b/code/modules/tgui/states/human_adjacent.dm @@ -6,7 +6,7 @@ * human adjacent user. **/ -/var/global/datum/ui_state/human_adjacent_state/human_adjacent_state = new() +GLOBAL_DATUM_INIT(human_adjacent_state, /datum/ui_state/human_adjacent_state, new) /datum/ui_state/human_adjacent_state/can_use_topic(src_object, mob/user) . = user.default_can_use_topic(src_object) diff --git a/code/modules/tgui/states/inventory.dm b/code/modules/tgui/states/inventory.dm index 0287029633896..b8b1ad3b6a99d 100644 --- a/code/modules/tgui/states/inventory.dm +++ b/code/modules/tgui/states/inventory.dm @@ -4,7 +4,7 @@ * Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory. **/ -/var/global/datum/ui_state/inventory_state/inventory_state = new() +GLOBAL_DATUM_INIT(inventory_state, /datum/ui_state/inventory_state, new) /datum/ui_state/inventory_state/can_use_topic(src_object, mob/user) if(!(src_object in user)) diff --git a/code/modules/tgui/states/language_menu.dm b/code/modules/tgui/states/language_menu.dm index e7dea65024a1b..4a370e8213067 100644 --- a/code/modules/tgui/states/language_menu.dm +++ b/code/modules/tgui/states/language_menu.dm @@ -2,7 +2,7 @@ * tgui state: language_menu_state */ -/var/global/datum/ui_state/language_menu/language_menu_state = new() +GLOBAL_DATUM_INIT(language_menu_state, /datum/ui_state/language_menu, new) /datum/ui_state/language_menu/can_use_topic(src_object, mob/user) . = UI_CLOSE diff --git a/code/modules/tgui/states/not_incapacitated.dm b/code/modules/tgui/states/not_incapacitated.dm index f7e793d1cae2b..12fe266bc5208 100644 --- a/code/modules/tgui/states/not_incapacitated.dm +++ b/code/modules/tgui/states/not_incapacitated.dm @@ -4,7 +4,7 @@ * Checks that the user isn't incapacitated **/ -/var/global/datum/ui_state/not_incapacitated_state/not_incapacitated_state = new() +GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/ui_state/not_incapacitated_state, new) /** * tgui state: not_incapacitated_turf_state @@ -12,7 +12,7 @@ * Checks that the user isn't incapacitated and that their loc is a turf **/ -/var/global/datum/ui_state/not_incapacitated_state/not_incapacitated_turf_state = new(no_turfs = TRUE) +GLOBAL_DATUM_INIT(not_incapacitated_turf_state, /datum/ui_state/not_incapacitated_state, new(no_turfs = TRUE)) /datum/ui_state/not_incapacitated_state var/turf_check = FALSE diff --git a/code/modules/tgui/states/notcontained.dm b/code/modules/tgui/states/notcontained.dm index 0b6462fe33162..77a7fe01b0074 100644 --- a/code/modules/tgui/states/notcontained.dm +++ b/code/modules/tgui/states/notcontained.dm @@ -4,7 +4,7 @@ * Checks that the user is not inside src_object, and then makes the default checks. **/ -/var/global/datum/ui_state/notcontained_state/notcontained_state = new() +GLOBAL_DATUM_INIT(notcontained_state, /datum/ui_state/notcontained_state, new) /datum/ui_state/notcontained_state/can_use_topic(atom/src_object, mob/user) . = user.shared_ui_interaction(src_object) diff --git a/code/modules/tgui/states/observer.dm b/code/modules/tgui/states/observer.dm index 98fa40509a24b..ade0ce66bb85f 100644 --- a/code/modules/tgui/states/observer.dm +++ b/code/modules/tgui/states/observer.dm @@ -4,7 +4,7 @@ * Checks that the user is an observer/ghost. **/ -/var/global/datum/ui_state/observer_state/observer_state = new() +GLOBAL_DATUM_INIT(observer_state, /datum/ui_state/observer_state, new) /datum/ui_state/observer_state/can_use_topic(src_object, mob/user) if(isobserver(user)) diff --git a/code/modules/tgui/states/physical.dm b/code/modules/tgui/states/physical.dm index a967f25916a97..a4cea7c7c20c9 100644 --- a/code/modules/tgui/states/physical.dm +++ b/code/modules/tgui/states/physical.dm @@ -4,7 +4,7 @@ * Short-circuits the default state to only check physical distance. **/ -/var/global/datum/ui_state/physical/physical_state = new() +GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new) /datum/ui_state/physical/can_use_topic(src_object, mob/user) . = user.shared_ui_interaction(src_object) diff --git a/code/modules/tgui/states/self.dm b/code/modules/tgui/states/self.dm index b08fe373c6ad1..10849772c6c9e 100644 --- a/code/modules/tgui/states/self.dm +++ b/code/modules/tgui/states/self.dm @@ -4,7 +4,7 @@ * Only checks that the user and src_object are the same. **/ -/var/global/datum/ui_state/self_state/self_state = new() +GLOBAL_DATUM_INIT(self_state, /datum/ui_state/self_state, new) /datum/ui_state/self_state/can_use_topic(src_object, mob/user) if(src_object != user) diff --git a/code/modules/tgui/states/zlevel.dm b/code/modules/tgui/states/zlevel.dm index a7842383a69c4..6ccfd0fe7dd29 100644 --- a/code/modules/tgui/states/zlevel.dm +++ b/code/modules/tgui/states/zlevel.dm @@ -4,7 +4,7 @@ * Only checks that the Z-level of the user and src_object are the same. **/ -/var/global/datum/ui_state/z_state/z_state = new() +GLOBAL_DATUM_INIT(z_state, /datum/ui_state/z_state, new) /datum/ui_state/z_state/can_use_topic(src_object, mob/user) var/turf/turf_obj = get_turf(src_object) diff --git a/code/modules/tgui/tgui.dm b/code/modules/tgui/tgui.dm index 5c0dd819f898d..16dc15681ec0d 100644 --- a/code/modules/tgui/tgui.dm +++ b/code/modules/tgui/tgui.dm @@ -53,7 +53,7 @@ * * return datum/tgui The requested UI. **/ -/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = default_state, browser_id = null) +/datum/tgui/New(mob/user, datum/src_object, ui_key, interface, title, width = 0, height = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state, browser_id = null) src.user = user src.src_object = src_object src.ui_key = ui_key diff --git a/code/modules/uplink/uplink.dm b/code/modules/uplink/uplink.dm index f682758614297..0538232fc06b2 100644 --- a/code/modules/uplink/uplink.dm +++ b/code/modules/uplink/uplink.dm @@ -1,4 +1,4 @@ -var/global/list/uplinks = list() +GLOBAL_LIST_EMPTY(uplinks) /** * Uplinks @@ -22,7 +22,7 @@ var/global/list/uplinks = list() /obj/item/device/uplink/New() ..() - uplinks += src + GLOB.uplinks += src uplink_items = get_uplink_items(gamemode) /obj/item/device/uplink/proc/set_gamemode(gamemode) @@ -30,7 +30,7 @@ var/global/list/uplinks = list() uplink_items = get_uplink_items(gamemode) /obj/item/device/uplink/Destroy() - uplinks -= src + GLOB.uplinks -= src return ..() /obj/item/device/uplink/attackby(obj/item/I, mob/user, params) @@ -60,7 +60,7 @@ var/global/list/uplinks = list() ui_interact(user) /obj/item/device/uplink/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \ - datum/tgui/master_ui = null, datum/ui_state/state = inventory_state) + datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state) ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open) if(!ui) ui = new(user, src, ui_key, "uplink", name, 450, 750, master_ui, state) diff --git a/code/modules/uplink/uplink_item.dm b/code/modules/uplink/uplink_item.dm index bc29e73966b17..dd33cb0b1bfac 100644 --- a/code/modules/uplink/uplink_item.dm +++ b/code/modules/uplink/uplink_item.dm @@ -1,25 +1,25 @@ -var/list/uplink_items = list() // Global list so we only initialize this once. +GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once. /proc/initialize_global_uplink_items() - uplink_items = list() + GLOB.uplink_items = list() for(var/item in subtypesof(/datum/uplink_item)) var/datum/uplink_item/I = new item() if(!I.item) continue - if(!uplink_items[I.category]) - uplink_items[I.category] = list() - uplink_items[I.category][I.name] = I + if(!GLOB.uplink_items[I.category]) + GLOB.uplink_items[I.category] = list() + GLOB.uplink_items[I.category][I.name] = I /proc/get_uplink_items(var/datum/game_mode/gamemode = null) - if(!uplink_items.len) + if(!GLOB.uplink_items.len) initialize_global_uplink_items() var/list/filtered_uplink_items = list() var/list/sale_items = list() - for(var/category in uplink_items) - for(var/item in uplink_items[category]) - var/datum/uplink_item/I = uplink_items[category][item] + for(var/category in GLOB.uplink_items) + for(var/item in GLOB.uplink_items[category]) + var/datum/uplink_item/I = GLOB.uplink_items[category][item] if(!istype(I)) continue if(I.include_modes.len) @@ -32,7 +32,7 @@ var/list/uplink_items = list() // Global list so we only initialize this once. continue if(gamemode && (gamemode in I.exclude_modes)) continue - if(I.player_minimum && I.player_minimum > joined_player_list.len) + if(I.player_minimum && I.player_minimum > GLOB.joined_player_list.len) continue if(!filtered_uplink_items[category]) @@ -124,8 +124,8 @@ var/list/uplink_items = list() // Global list so we only initialize this once. return 1 /datum/uplink_item/Destroy() - if(src in uplink_items) - uplink_items -= src //Take us out instead of leaving a null! + if(src in GLOB.uplink_items) + GLOB.uplink_items -= src //Take us out instead of leaving a null! return ..() //Discounts (dynamically filled above) diff --git a/code/modules/vehicles/bicycle.dm b/code/modules/vehicles/bicycle.dm index e904b8deeacc1..184b03a6bfdf2 100644 --- a/code/modules/vehicles/bicycle.dm +++ b/code/modules/vehicles/bicycle.dm @@ -4,9 +4,9 @@ icon_state = "bicycle" var/easter_egg_chance = 1 -var/static/list/bike_music = list('sound/misc/bike1.mid', - 'sound/misc/bike2.mid', - 'sound/misc/bike3.mid') + var/static/list/bike_music = list('sound/misc/bike1.mid', + 'sound/misc/bike2.mid', + 'sound/misc/bike3.mid') /obj/vehicle/bicycle/New() ..() riding_datum = new/datum/riding/bicycle diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index b4a0e85b0a25a..257230678410b 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -52,7 +52,7 @@ ..() if(A.density && has_buckled_mobs()) var/mob/living/carbon/H = buckled_mobs[1] - var/atom/throw_target = get_edge_target_turf(H, pick(cardinal)) + var/atom/throw_target = get_edge_target_turf(H, pick(GLOB.cardinal)) unbuckle_mob(H) H.throw_at(throw_target, 4, 3) H.Weaken(5) diff --git a/code/modules/zombie/organs.dm b/code/modules/zombie/organs.dm index 2b449925ee1ff..295d7745955a9 100644 --- a/code/modules/zombie/organs.dm +++ b/code/modules/zombie/organs.dm @@ -17,10 +17,10 @@ . = ..() if(iscarbon(loc)) Insert(loc) - zombie_infection_list += src + GLOB.zombie_infection_list += src /obj/item/organ/zombie_infection/Destroy() - zombie_infection_list -= src + GLOB.zombie_infection_list -= src . = ..() /obj/item/organ/zombie_infection/Insert(var/mob/living/carbon/M, special = 0) diff --git a/code/orphaned_procs/AStar.dm b/code/orphaned_procs/AStar.dm index 7775d0ffd0ab4..8a538cf6b8352 100644 --- a/code/orphaned_procs/AStar.dm +++ b/code/orphaned_procs/AStar.dm @@ -155,7 +155,7 @@ Actual Adjacent procs : var/list/L = new() var/turf/T - for(var/dir in cardinal) + for(var/dir in GLOB.cardinal) T = get_step(src,dir) if(simulated_only && !istype(T)) continue diff --git a/code/orphaned_procs/dbcore.dm b/code/orphaned_procs/dbcore.dm index 1f4b1ef0d3419..a073780ea05c9 100644 --- a/code/orphaned_procs/dbcore.dm +++ b/code/orphaned_procs/dbcore.dm @@ -34,8 +34,8 @@ // Deprecated! See global.dm for new configuration vars /* -var/DB_SERVER = "" // This is the location of your MySQL server (localhost is USUALLY fine) -var/DB_PORT = 3306 // This is the port your MySQL server is running on (3306 is the default) + var/DB_SERVER = "" // This is the location of your MySQL server (localhost is USUALLY fine) + var/DB_PORT = 3306 // This is the port your MySQL server is running on (3306 is the default) */ DBConnection @@ -63,11 +63,11 @@ DBConnection/proc/Connect() if(failed_connections > FAILED_DB_CONNECTION_CUTOFF) //If it failed to establish a connection more than 5 times in a row, don't bother attempting to connect anymore. return FALSE - var/user = sqlfdbklogin - var/pass = sqlfdbkpass - var/db = sqlfdbkdb - var/address = sqladdress - var/port = sqlport + var/user = GLOB.sqlfdbklogin + var/pass = GLOB.sqlfdbkpass + var/db = GLOB.sqlfdbkdb + var/address = GLOB.sqladdress + var/port = GLOB.sqlport doConnect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") . = IsConnected() @@ -98,7 +98,7 @@ DBConnection/proc/ErrorMsg() return _dm_db_error_msg(_db_con) DBConnection/proc/SelectDB(database_name,dbi) if(IsConnected()) Disconnect() //return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[DB_SERVER]:[DB_PORT]"]",user,password) - return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[sqladdress]:[sqlport]"]",user,password) + return Connect("[dbi?"[dbi]":"dbi:mysql:[database_name]:[GLOB.sqladdress]:[GLOB.sqlport]"]",user,password) DBConnection/proc/NewQuery(sql_query,cursor_handler=src.default_cursor) return new/DBQuery(sql_query,src,cursor_handler) diff --git a/code/orphaned_procs/priority_announce.dm b/code/orphaned_procs/priority_announce.dm index 26b3548e3ea8f..46d71dc0e293d 100644 --- a/code/orphaned_procs/priority_announce.dm +++ b/code/orphaned_procs/priority_announce.dm @@ -10,21 +10,21 @@ announcement += "

    [html_encode(title)]

    " else if(type == "Captain") announcement += "

    Captain Announces

    " - news_network.SubmitArticle(text, "Captain's Announcement", "Station Announcements", null) + GLOB.news_network.SubmitArticle(text, "Captain's Announcement", "Station Announcements", null) else announcement += "

    [command_name()] Update

    " if (title && length(title) > 0) announcement += "

    [html_encode(title)]

    " if(title == "") - news_network.SubmitArticle(text, "Central Command Update", "Station Announcements", null) + GLOB.news_network.SubmitArticle(text, "Central Command Update", "Station Announcements", null) else - news_network.SubmitArticle(title + "

    " + text, "Central Command", "Station Announcements", null) + GLOB.news_network.SubmitArticle(title + "

    " + text, "Central Command", "Station Announcements", null) announcement += "
    [html_encode(text)]
    " announcement += "
    " - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(!isnewplayer(M) && !M.ear_deaf) to_chat(M, announcement) if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS) @@ -37,7 +37,7 @@ if(announce) priority_announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/AI/commandreport.ogg') - for(var/obj/machinery/computer/communications/C in machines) + for(var/obj/machinery/computer/communications/C in GLOB.machines) if(!(C.stat & (BROKEN|NOPOWER)) && C.z == ZLEVEL_STATION) var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(C.loc) P.name = "paper - '[title]'" @@ -50,7 +50,7 @@ if(!message) return - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(!isnewplayer(M) && !M.ear_deaf) to_chat(M, "[title]
    [message]

    ") if(M.client.prefs.toggles & SOUND_ANNOUNCEMENTS) diff --git a/code/orphaned_procs/statistics.dm b/code/orphaned_procs/statistics.dm index 8d233aafbb8e1..b429e780044f6 100644 --- a/code/orphaned_procs/statistics.dm +++ b/code/orphaned_procs/statistics.dm @@ -1,4 +1,4 @@ -var/datum/feedback/blackbox = new() +GLOBAL_DATUM_INIT(blackbox, /datum/feedback, new) //the feedback datum; stores all feedback /datum/feedback @@ -33,7 +33,7 @@ var/datum/feedback/blackbox = new() var/pda_msg_amt = 0 var/rc_msg_amt = 0 - for (var/obj/machinery/message_server/MS in message_servers) + for (var/obj/machinery/message_server/MS in GLOB.message_servers) if (MS.pda_msgs.len > pda_msg_amt) pda_msg_amt = MS.pda_msgs.len if (MS.rc_msgs.len > rc_msg_amt) @@ -62,10 +62,10 @@ var/datum/feedback/blackbox = new() if (!feedback) return round_end_data_gathering() //round_end time logging and some other data processing - if (!dbcon.Connect()) return + if (!GLOB.dbcon.Connect()) return var/round_id - var/DBQuery/query_feedback_max_id = dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM [format_table_name("feedback")]") + var/DBQuery/query_feedback_max_id = GLOB.dbcon.NewQuery("SELECT MAX(round_id) AS round_id FROM [format_table_name("feedback")]") if(!query_feedback_max_id.Execute()) return while (query_feedback_max_id.NextRow()) @@ -86,15 +86,15 @@ var/datum/feedback/blackbox = new() if (sqlrowlist == "") return - var/DBQuery/query_feedback_save = dbcon.NewQuery("INSERT DELAYED IGNORE INTO [format_table_name("feedback")] VALUES " + sqlrowlist) + var/DBQuery/query_feedback_save = GLOB.dbcon.NewQuery("INSERT DELAYED IGNORE INTO [format_table_name("feedback")] VALUES " + sqlrowlist) query_feedback_save.Execute() /proc/feedback_set(variable,value) - if(!blackbox) + if(!GLOB.blackbox) return - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return @@ -102,10 +102,10 @@ var/datum/feedback/blackbox = new() FV.set_value(value) /proc/feedback_inc(variable,value) - if(!blackbox) + if(!GLOB.blackbox) return - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return @@ -113,10 +113,10 @@ var/datum/feedback/blackbox = new() FV.inc(value) /proc/feedback_dec(variable,value) - if(!blackbox) + if(!GLOB.blackbox) return - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return @@ -124,10 +124,10 @@ var/datum/feedback/blackbox = new() FV.dec(value) /proc/feedback_set_details(variable,details) - if(!blackbox) + if(!GLOB.blackbox) return - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return @@ -135,10 +135,10 @@ var/datum/feedback/blackbox = new() FV.set_details(details) /proc/feedback_add_details(variable,details) - if(!blackbox) + if(!GLOB.blackbox) return - var/datum/feedback_variable/FV = blackbox.find_feedback_datum(variable) + var/datum/feedback_variable/FV = GLOB.blackbox.find_feedback_datum(variable) if(!FV) return @@ -209,20 +209,20 @@ var/datum/feedback/blackbox = new() /proc/sql_poll_population() if(!config.sql_enabled) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) return var/playercount = 0 - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.client) playercount += 1 - var/admincount = admins.len - var/DBQuery/query_record_playercount = dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time, server_ip, server_port) VALUES ([playercount], [admincount], '[SQLtime()]', INET_ATON('[world.internet_address]'), '[world.port]')") + var/admincount = GLOB.admins.len + var/DBQuery/query_record_playercount = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time, server_ip, server_port) VALUES ([playercount], [admincount], '[SQLtime()]', INET_ATON('[world.internet_address]'), '[world.port]')") query_record_playercount.Execute() /proc/sql_report_death(mob/living/L) if(!config.sql_enabled) return - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) return if(!L || !L.key || !L.mind) return @@ -249,5 +249,5 @@ var/datum/feedback/blackbox = new() var/sqlstamina = sanitizeSQL(L.getStaminaLoss()) var/coord = sanitizeSQL("[L.x], [L.y], [L.z]") var/map = sanitizeSQL(SSmapping.config.map_name) - var/DBQuery/query_report_death = dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss, coord, mapname, server_ip, server_port) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[SQLtime()]', '[laname]', '[lakey]', '[sqlgender]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina], '[coord]', '[map]', INET_ATON('[world.internet_address]'), '[world.port]')") + var/DBQuery/query_report_death = GLOB.dbcon.NewQuery("INSERT INTO [format_table_name("death")] (name, byondkey, job, special, pod, tod, laname, lakey, gender, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss, coord, mapname, server_ip, server_port) VALUES ('[sqlname]', '[sqlkey]', '[sqljob]', '[sqlspecial]', '[sqlpod]', '[SQLtime()]', '[laname]', '[lakey]', '[sqlgender]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina], '[coord]', '[map]', INET_ATON('[world.internet_address]'), '[world.port]')") query_report_death.Execute() diff --git a/code/world.dm b/code/world.dm index 3e9ae0c8c9eed..f3e947d68f211 100644 --- a/code/world.dm +++ b/code/world.dm @@ -27,16 +27,16 @@ #endif //logs var/date_string = time2text(world.realtime, "YYYY/MM-Month/DD-Day") - href_logfile = file("data/logs/[date_string] hrefs.htm") - diary = file("data/logs/[date_string].log") - diaryofmeanpeople = file("data/logs/[date_string] Attack.log") - diary << "\n\nStarting up. [time_stamp()]\n---------------------" - diaryofmeanpeople << "\n\nStarting up. [time_stamp()]\n---------------------" - changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently + GLOB.href_logfile = file("data/logs/[date_string] hrefs.htm") + GLOB.diary = file("data/logs/[date_string].log") + GLOB.diaryofmeanpeople = file("data/logs/[date_string] Attack.log") + GLOB.diary << "\n\nStarting up. [time_stamp()]\n---------------------" + GLOB.diaryofmeanpeople << "\n\nStarting up. [time_stamp()]\n---------------------" + GLOB.changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) load_configuration() - revdata.DownloadPRDetails() + GLOB.revdata.DownloadPRDetails() load_mode() load_motd() load_admins() @@ -45,37 +45,37 @@ LoadBans() investigate_reset() - timezoneOffset = text2num(time2text(0,"hh")) * 36000 + GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000 if(config.sql_enabled) - if(!dbcon.Connect()) + if(!GLOB.dbcon.Connect()) log_world("Your server failed to establish a connection with the database.") else log_world("Database connection established.") - data_core = new /datum/datacore() + GLOB.data_core = new /datum/datacore() Master.Initialize(10, FALSE) #define IRC_STATUS_THROTTLE 50 /world/Topic(T, addr, master, key) if(config && config.log_world_topic) - diary << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]" + GLOB.diary << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]" var/list/input = params2list(T) - var/key_valid = (global.comms_allowed && input["key"] == global.comms_key) + var/key_valid = (GLOB.comms_allowed && input["key"] == GLOB.comms_key) var/static/last_irc_status = 0 if("ping" in input) var/x = 1 - for (var/client/C in clients) + for (var/client/C in GLOB.clients) x++ return x else if("players" in input) var/n = 0 - for(var/mob/M in player_list) + for(var/mob/M in GLOB.player_list) if(M.client) n++ return n @@ -86,23 +86,23 @@ var/list/adm = get_admin_counts() var/list/allmins = adm["total"] var/status = "Admins: [allmins.len] (Active: [english_list(adm["present"])] AFK: [english_list(adm["afk"])] Stealth: [english_list(adm["stealth"])] Skipped: [english_list(adm["noflags"])]). " - status += "Players: [clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [SSticker.mode.name]." + status += "Players: [GLOB.clients.len] (Active: [get_active_player_count(0,1,0)]). Mode: [SSticker.mode.name]." send2irc("Status", status) last_irc_status = world.time else if("status" in input) var/list/s = list() - s["version"] = game_version - s["mode"] = master_mode - s["respawn"] = config ? abandon_allowed : 0 - s["enter"] = enter_allowed + s["version"] = GLOB.game_version + s["mode"] = GLOB.master_mode + s["respawn"] = config ? GLOB.abandon_allowed : 0 + s["enter"] = GLOB.enter_allowed s["vote"] = config.allow_vote_mode s["ai"] = config.allow_ai s["host"] = host ? host : null s["active_players"] = get_active_player_count() - s["players"] = clients.len - s["revision"] = revdata.commit - s["revision_date"] = revdata.date + s["players"] = GLOB.clients.len + s["revision"] = GLOB.revdata.commit + s["revision_date"] = GLOB.revdata.date var/list/adm = get_admin_counts() var/list/presentmins = adm["present"] @@ -119,7 +119,7 @@ // Key-authed callers may know the truth behind the "secret" s["security_level"] = get_security_level() - s["round_duration"] = round((world.time-round_start_time)/10) + s["round_duration"] = SSticker ? round((world.time-SSticker.round_start_time)/10) : 0 // Amount of world's ticks in seconds, useful for calculating round duration if(SSshuttle && SSshuttle.emergency) @@ -135,7 +135,7 @@ return "Bad Key" else #define CHAT_PULLR 64 //defined in preferences.dm, but not available here at compilation time - for(var/client/C in clients) + for(var/client/C in GLOB.clients) if(C.prefs && (C.prefs.chat_toggles & CHAT_PULLR)) to_chat(C, "PR: [input["announce"]]") #undef CHAT_PULLR @@ -148,7 +148,7 @@ relay_msg_admins("HELP: [input["source"]] [input["message_sender"]]: [input["message"]]") if(input["crossmessage"] == "Comms_Console") minor_announce(input["message"], "Incoming message from [input["message_sender"]]") - for(var/obj/machinery/computer/communications/CM in machines) + for(var/obj/machinery/computer/communications/CM in GLOB.machines) CM.overrideCooldown() if(input["crossmessage"] == "News_Report") minor_announce(input["message"], "Breaking Update From [input["message_sender"]]") @@ -194,7 +194,7 @@ var/round_end_sound_sent = FALSE if(SSticker.round_end_sound) round_end_sound_sent = TRUE - for(var/thing in clients) + for(var/thing in GLOB.clients) var/client/C = thing if (!C) continue @@ -218,13 +218,13 @@ if(count > 10) log << "#[count]\t[index]" #endif - if(blackbox) - blackbox.save_all_data_to_sql() + if(GLOB.blackbox) + GLOB.blackbox.save_all_data_to_sql() Master.Shutdown() //run SS shutdowns RoundEndAnimation(round_end_sound_sent) kick_clients_in_lobby("The round came to an end with you in the lobby.", 1) //second parameter ensures only afk clients are kicked to_chat(world, "Rebooting world...") - for(var/thing in clients) + for(var/thing in GLOB.clients) var/client/C = thing if(C && config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite C << link("byond://[config.server]") @@ -235,7 +235,7 @@ if(!SSticker && SSticker.round_end_sound) round_end_sound = SSticker.round_end_sound if (!round_end_sound_sent) - for(var/thing in clients) + for(var/thing in GLOB.clients) var/client/C = thing if (!C) continue @@ -251,7 +251,7 @@ 'sound/roundend/disappointed.ogg'\ ) - for(var/thing in clients) + for(var/thing in GLOB.clients) var/obj/screen/splash/S = new(thing, FALSE) S.Fade(FALSE,FALSE) @@ -261,8 +261,8 @@ var/list/Lines = file2list("data/mode.txt") if(Lines.len) if(Lines[1]) - master_mode = Lines[1] - diary << "Saved mode is '[master_mode]'" + GLOB.master_mode = Lines[1] + GLOB.diary << "Saved mode is '[GLOB.master_mode]'" /world/proc/save_mode(the_mode) var/F = file("data/mode.txt") @@ -270,7 +270,7 @@ F << the_mode /world/proc/load_motd() - join_motd = file2text("config/motd.txt") + "
    " + revdata.GetTestMergeInfo() + GLOB.join_motd = file2text("config/motd.txt") + "
    " + GLOB.revdata.GetTestMergeInfo() /world/proc/load_configuration() config = new /datum/configuration() @@ -281,7 +281,7 @@ config.loadmaplist("config/maps.txt") // apply some settings from config.. - abandon_allowed = config.respawn + GLOB.abandon_allowed = config.respawn /world/proc/update_status() @@ -301,15 +301,15 @@ var/list/features = list() if(SSticker) - if(master_mode) - features += master_mode + if(GLOB.master_mode) + features += GLOB.master_mode else features += "STARTING" - if (!enter_allowed) + if (!GLOB.enter_allowed) features += "closed" - features += abandon_allowed ? "respawn" : "no respawn" + features += GLOB.abandon_allowed ? "respawn" : "no respawn" if (config && config.allow_vote_mode) features += "vote" @@ -318,7 +318,7 @@ features += "AI allowed" var/n = 0 - for (var/mob/M in player_list) + for (var/mob/M in GLOB.player_list) if (M.client) n++ @@ -333,4 +333,4 @@ if (features) s += ": [jointext(features, ", ")]" - status = s + status = s \ No newline at end of file diff --git a/interface/interface.dm b/interface/interface.dm index ef9ad52b487f0..9774e74aa4760 100644 --- a/interface/interface.dm +++ b/interface/interface.dm @@ -53,9 +53,9 @@ set hidden = 1 if(config.githuburl) var/message = "This will open the Github issue reporter in your browser. Are you sure?" - if(revdata.testmerge.len) + if(GLOB.revdata.testmerge.len) message += "
    The following experimental changes are active and are probably the cause of any new or sudden issues you may experience. If possible, please try to find a specific thread for your issue instead of posting to the general issue tracker:
    " - message += revdata.GetTestMergeInfo(FALSE) + message += GLOB.revdata.GetTestMergeInfo(FALSE) if(tgalert(src, message, "Report Issue","Yes","No")=="No") return src << link("[config.githuburl]/issues/new") @@ -102,8 +102,8 @@ Admin: 'html/changelog.html' ) src << browse('html/changelog.html', "window=changes;size=675x650") - if(prefs.lastchangelog != changelog_hash) - prefs.lastchangelog = changelog_hash + if(prefs.lastchangelog != GLOB.changelog_hash) + prefs.lastchangelog = GLOB.changelog_hash prefs.save_preferences() winset(src, "infowindow.changelog", "font-style=;") diff --git a/tgstation.dme b/tgstation.dme index 0f7487af2aa56..689227549ff64 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -17,6 +17,7 @@ #include "_maps\loadallmaps.dm" #include "code\_compile_options.dm" #include "code\world.dm" +#include "code\__DATASTRUCTURES\globals.dm" #include "code\__DATASTRUCTURES\heap.dm" #include "code\__DATASTRUCTURES\linked_lists.dm" #include "code\__DATASTRUCTURES\priority_queue.dm" @@ -35,6 +36,7 @@ #include "code\__DEFINES\hud.dm" #include "code\__DEFINES\inventory.dm" #include "code\__DEFINES\is_helpers.dm" +#include "code\__DEFINES\jobs.dm" #include "code\__DEFINES\language.dm" #include "code\__DEFINES\layers.dm" #include "code\__DEFINES\lighting.dm" @@ -105,6 +107,8 @@ #include "code\_globalvars\lists\objects.dm" #include "code\_globalvars\lists\poll_ignore.dm" #include "code\_globalvars\lists\typecache.dm" +#include "code\_js\byjax.dm" +#include "code\_js\menus.dm" #include "code\_onclick\adjacent.dm" #include "code\_onclick\ai.dm" #include "code\_onclick\autoclick.dm" @@ -146,6 +150,7 @@ #include "code\controllers\configuration.dm" #include "code\controllers\controller.dm" #include "code\controllers\failsafe.dm" +#include "code\controllers\globals.dm" #include "code\controllers\master.dm" #include "code\controllers\subsystem.dm" #include "code\controllers\subsystem\acid.dm" @@ -948,8 +953,6 @@ #include "code\game\turfs\simulated\wall\shuttle_walls.dm" #include "code\game\turfs\space\space.dm" #include "code\game\turfs\space\transit.dm" -#include "code\js\byjax.dm" -#include "code\js\menus.dm" #include "code\modules\admin\admin.dm" #include "code\modules\admin\admin_investigate.dm" #include "code\modules\admin\admin_ranks.dm" diff --git a/tools/travis/build_byond.sh b/tools/travis/build_byond.sh index 27c9c71569ca2..54add5c78d381 100755 --- a/tools/travis/build_byond.sh +++ b/tools/travis/build_byond.sh @@ -13,6 +13,11 @@ if [ "$BUILD_TOOLS" = false ]; then echo "base /turf path use detected in maps, please replace with proper paths." exit 1 fi; + if grep '^/*var/' code/**/*.dm; then + echo "Unmanaged global var use detected in code, please use the helpers." + grep '^var/' code/*.dm | echo + exit 1 + fi; source $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin/byondsetup if [ "$BUILD_TESTING" = true ]; then tools/travis/dm.sh -DTRAVISBUILDING tgstation.dme