diff --git a/.github/workflows/byond.yml b/.github/workflows/byond.yml index c5ac12de1ad..c0647f9c513 100644 --- a/.github/workflows/byond.yml +++ b/.github/workflows/byond.yml @@ -15,7 +15,7 @@ on: env: MACRO_COUNT: 0 GENDER_COUNT: 6 - TO_WORLD_COUNT: 183 + TO_WORLD_COUNT: 179 #These variables are filled from dependencies.sh inside the steps, DO NOT SET THEM HERE BYOND_MAJOR: "" diff --git a/.vscode/global_vars.code-snippets b/.vscode/global_vars.code-snippets new file mode 100644 index 00000000000..b6a142ac92b --- /dev/null +++ b/.vscode/global_vars.code-snippets @@ -0,0 +1,81 @@ +{ + // Place your Aurora.3 workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and + // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope + // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is + // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: + // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. + // Placeholders with the same ids are connected. + // Example: + // "Print to console": { + // "scope": "javascript,typescript", + // "prefix": "log", + // "body": [ + // "console.log('$1');", + // "$2" + // ], + // "description": "Log output to console" + // } + // + // Refer to https://code.visualstudio.com/docs/editor/userdefinedsnippets + + "GLOBAL_VAR": { + "prefix": ["GLOBAL_VAR"], + "body": ["GLOBAL_VAR(${1:variable_name})"], + "description": "Create an untyped null global" + }, + + "GLOBAL_VAR_INIT": { + "prefix": ["GLOBAL_VAR_INIT"], + "body": ["GLOBAL_VAR_INIT(${1:variable_name}, ${2:value})"], + "description": "Create an untyped global with an initializer expression" + }, + + "GLOBAL_DATUM": { + "prefix": ["GLOBAL_DATUM"], + "body": ["GLOBAL_DATUM(${1:variable_name}, ${2:/typepath})"], + "description": "Create a typed null global" + }, + + "GLOBAL_DATUM_INIT": { + "prefix": ["GLOBAL_DATUM_INIT"], + "body": ["GLOBAL_DATUM_INIT(${1:variable_name}, ${2:/typepath}, ${3:value})"], + "description": "Create a typed global with an initializer expression" + }, + + "GLOBAL_LIST": { + "prefix": ["GLOBAL_LIST"], + "body": ["GLOBAL_LIST(${1:list_name})"], + "description": "Create a null global list" + }, + + "GLOBAL_LIST_EMPTY": { + "prefix": ["GLOBAL_LIST_EMPTY"], + "body": ["GLOBAL_LIST_EMPTY(${1:list_name})"], + "description": "Create a list global that is initialized as an empty list" + }, + + "GLOBAL_LIST_INIT": { + "prefix": ["GLOBAL_LIST_INIT"], + "body": ["GLOBAL_LIST_INIT(${1:list_name}, ${2:value})"], + "description": "Create a list global with an initializer expression" + }, + + "GLOBAL_LIST_EMPTY_TYPED": { + "prefix": ["GLOBAL_LIST_EMPTY_TYPED"], + "body": ["GLOBAL_LIST_EMPTY_TYPED(${1:list_name}, ${2:/typepath})"], + "description": "Create a typed list global that is initialized as an empty list" + }, + + "GLOBAL_LIST_INIT_TYPED": { + "prefix": ["GLOBAL_LIST_INIT_TYPED"], + "body": ["GLOBAL_LIST_INIT_TYPED(${1:list_name}, ${2:/typepath}, ${3:value})"], + "description": "Create a typed list global with an initializer expression" + }, + + "GLOBAL_PROTECT": { + "prefix": ["GLOBAL_PROTECT"], + "body": ["GLOBAL_PROTECT(${1:variable_name})"], + "description": "Prevents a given global from being VV'd" + }, + +} diff --git a/aurorastation.dme b/aurorastation.dme index 4b1b44dedf5..cc8f0a166a2 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -186,7 +186,6 @@ #include "code\__DEFINES\dcs\signals\signals_object\signals_object.dm" #include "code\__HELPERS\_global_objects.dm" #include "code\__HELPERS\_lists.dm" -#include "code\__HELPERS\_string_lists.dm" #include "code\__HELPERS\area_movement.dm" #include "code\__HELPERS\areas.dm" #include "code\__HELPERS\atmospherics.dm" @@ -274,6 +273,7 @@ #include "code\_globalvars\tgui.dm" #include "code\_globalvars\lists\mapping.dm" #include "code\_globalvars\lists\mobs.dm" +#include "code\_globalvars\lists\names.dm" #include "code\_onclick\adjacent.dm" #include "code\_onclick\ai.dm" #include "code\_onclick\click.dm" @@ -1522,8 +1522,6 @@ #include "code\game\turfs\unsimulated\walls.dm" #include "code\game\verbs\ooc.dm" #include "code\game\verbs\who.dm" -#include "code\js\byjax.dm" -#include "code\js\menus.dm" #include "code\modules\abstract\_abstract.dm" #include "code\modules\abstract\abstract_exterior_marker.dm" #include "code\modules\abstract\abstract_weather_marker.dm" diff --git a/code/ZAS/Airflow.dm b/code/ZAS/Airflow.dm index abb673de75b..6f847c58562 100644 --- a/code/ZAS/Airflow.dm +++ b/code/ZAS/Airflow.dm @@ -6,7 +6,7 @@ Contains helper procs for airflow, handled in /connection_group. /mob/proc/airflow_stun() if(stat == 2) return 0 - if(last_airflow_stun > world.time - vsc.airflow_stun_cooldown) return 0 + if(last_airflow_stun > world.time - GLOB.vsc.airflow_stun_cooldown) return 0 if(!(status_flags & CANSTUN) && !(status_flags & CANWEAKEN)) to_chat(src, SPAN_NOTICE("You stay upright as the air rushes past you.")) @@ -34,12 +34,12 @@ Contains helper procs for airflow, handled in /connection_group. if(anchored && !ismob(src)) return 0 - if(!istype(src,/obj/item) && n < vsc.airflow_dense_pressure) return 0 + if(!istype(src,/obj/item) && n < GLOB.vsc.airflow_dense_pressure) return 0 return 1 /mob/check_airflow_movable(n) - if(n < vsc.airflow_heavy_pressure) + if(n < GLOB.vsc.airflow_heavy_pressure) return 0 return 1 @@ -54,11 +54,11 @@ Contains helper procs for airflow, handled in /connection_group. . = ..() switch(w_class) if(2) - if(n < vsc.airflow_lightest_pressure) return 0 + if(n < GLOB.vsc.airflow_lightest_pressure) return 0 if(3) - if(n < vsc.airflow_light_pressure) return 0 + if(n < GLOB.vsc.airflow_light_pressure) return 0 if(4,5) - if(n < vsc.airflow_medium_pressure) return 0 + if(n < GLOB.vsc.airflow_medium_pressure) return 0 /atom/movable/var/tmp/turf/airflow_dest /atom/movable/var/tmp/airflow_speed = 0 @@ -124,17 +124,17 @@ Contains helper procs for airflow, handled in /connection_group. if (prob(33)) loc:add_blood(src) bloody_body(src) - var/b_loss = airflow_speed * vsc.airflow_damage + var/b_loss = airflow_speed * GLOB.vsc.airflow_damage apply_damage(b_loss/3, DAMAGE_BRUTE, BP_HEAD, used_weapon = "Airflow") apply_damage(b_loss/3, DAMAGE_BRUTE, BP_CHEST, used_weapon = "Airflow") apply_damage(b_loss/3, DAMAGE_BRUTE, BP_GROIN, used_weapon = "Airflow") if(airflow_speed > 10) - Paralyse(round(airflow_speed * vsc.airflow_stun)) + Paralyse(round(airflow_speed * GLOB.vsc.airflow_stun)) Stun(paralysis + 3) else - Stun(round(airflow_speed * vsc.airflow_stun/2)) + Stun(round(airflow_speed * GLOB.vsc.airflow_stun/2)) . = ..() /zone/proc/movables(list/origins) diff --git a/code/ZAS/ConnectionGroup.dm b/code/ZAS/ConnectionGroup.dm index ff678f234c6..bf0e72a9a9f 100644 --- a/code/ZAS/ConnectionGroup.dm +++ b/code/ZAS/ConnectionGroup.dm @@ -98,14 +98,14 @@ Class Procs: var/atom/movable/M = thing //If they're already being tossed, don't do it again. - if(M.last_airflow > world.time - vsc.airflow_delay) + if(M.last_airflow > world.time - GLOB.vsc.airflow_delay) continue if(M.airflow_speed) continue //Check for knocking people over - if(ismob(M) && differential > vsc.airflow_stun_pressure) + if(ismob(M) && differential > GLOB.vsc.airflow_stun_pressure) var/mob/mob = M if(mob.status_flags & GODMODE) continue @@ -166,7 +166,7 @@ Class Procs: var/equiv = A.air.share_ratio(B.air, coefficient) var/differential = A.air.return_pressure() - B.air.return_pressure() - if(abs(differential) >= vsc.airflow_lightest_pressure) + if(abs(differential) >= GLOB.vsc.airflow_lightest_pressure) var/list/attracted var/list/repelled if(differential > 0) @@ -240,7 +240,7 @@ Class Procs: var/equiv = A.air.share_space(air) var/differential = A.air.return_pressure() - air.return_pressure() - if(abs(differential) >= vsc.airflow_lightest_pressure) + if(abs(differential) >= GLOB.vsc.airflow_lightest_pressure) var/list/attracted = A.movables(connecting_turfs) // This call is async, with waitfor = FALSE flow(attracted, abs(differential), differential < 0) diff --git a/code/ZAS/Debug.dm b/code/ZAS/Debug.dm index e314c8cc543..794af84ed4c 100644 --- a/code/ZAS/Debug.dm +++ b/code/ZAS/Debug.dm @@ -1,11 +1,11 @@ -var/image/assigned = image('icons/zone.dmi', icon_state = "assigned") -var/image/created = image('icons/zone.dmi', icon_state = "created") -var/image/merged = image('icons/zone.dmi', icon_state = "merged") -var/image/invalid_zone = image('icons/zone.dmi', icon_state = "invalid") -var/image/air_blocked = image('icons/zone.dmi', icon_state = "block") -var/image/zone_blocked = image('icons/zone.dmi', icon_state = "zoneblock") -var/image/blocked = image('icons/zone.dmi', icon_state = "fullblock") -var/image/mark = image('icons/zone.dmi', icon_state = "mark") +GLOBAL_DATUM_INIT(assigned, /image, image('icons/zone.dmi', icon_state = "assigned")) +GLOBAL_DATUM_INIT(created, /image, image('icons/zone.dmi', icon_state = "created")) +GLOBAL_DATUM_INIT(merged, /image, image('icons/zone.dmi', icon_state = "merged")) +GLOBAL_DATUM_INIT(invalid_zone, /image, image('icons/zone.dmi', icon_state = "invalid")) +GLOBAL_DATUM_INIT(air_blocked, /image, image('icons/zone.dmi', icon_state = "block")) +GLOBAL_DATUM_INIT(zone_blocked, /image, image('icons/zone.dmi', icon_state = "zoneblock")) +GLOBAL_DATUM_INIT(blocked, /image, image('icons/zone.dmi', icon_state = "fullblock")) +GLOBAL_DATUM_INIT(mark, /image, image('icons/zone.dmi', icon_state = "mark")) /connection_edge/var/dbg_out = 0 diff --git a/code/ZAS/Diagnostic.dm b/code/ZAS/Diagnostic.dm index b51a2e5f44f..faac8be5bc5 100644 --- a/code/ZAS/Diagnostic.dm +++ b/code/ZAS/Diagnostic.dm @@ -82,4 +82,4 @@ /client/proc/ZASSettings() set category = "Debug" - vsc.SetDefault(mob) + GLOB.vsc.SetDefault(mob) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 1f5be0346a7..708721dfec3 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -40,7 +40,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin return igniting /zone/proc/process_fire() - var/datum/gas_mixture/burn_gas = air.remove_ratio(vsc.fire_consuption_rate, LAZYLEN(fire_tiles)) + var/datum/gas_mixture/burn_gas = air.remove_ratio(GLOB.vsc.fire_consuption_rate, LAZYLEN(fire_tiles)) var/firelevel = burn_gas.zburn(src, fire_tiles, force_burn = 1, no_check = 1) @@ -183,7 +183,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin continue //Spread the fire. - if(prob( 50 + 50 * (firelevel/vsc.fire_firelevel_multiplier) ) && my_tile.CanPass(null, enemy_tile, 0,0) && enemy_tile.CanPass(null, my_tile, 0,0)) + if(prob( 50 + 50 * (firelevel/GLOB.vsc.fire_firelevel_multiplier) ) && my_tile.CanPass(null, enemy_tile, 0,0) && enemy_tile.CanPass(null, my_tile, 0,0)) enemy_tile.create_fire(firelevel) else @@ -212,7 +212,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin SSair.active_hotspots += src /obj/fire/proc/fire_color(var/env_temperature) - var/temperature = max(4000*sqrt(firelevel/vsc.fire_firelevel_multiplier), env_temperature) + var/temperature = max(4000*sqrt(firelevel/GLOB.vsc.fire_firelevel_multiplier), env_temperature) return heat2color(temperature) /obj/fire/Destroy() @@ -283,12 +283,12 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin var/reaction_limit = min(total_oxidizers*(FIRE_REACTION_FUEL_AMOUNT/FIRE_REACTION_OXIDIZER_AMOUNT), total_fuel) //stoichiometric limit //vapour fuels are extremely volatile! The reaction progress is a percentage of the total fuel (similar to old zburn).) - var/gas_firelevel = calculate_firelevel(gas_fuel, total_oxidizers, reaction_limit, volume*group_multiplier) / vsc.fire_firelevel_multiplier + var/gas_firelevel = calculate_firelevel(gas_fuel, total_oxidizers, reaction_limit, volume*group_multiplier) / GLOB.vsc.fire_firelevel_multiplier var/min_burn = 0.30*volume*group_multiplier/CELL_VOLUME //in moles - so that fires with very small gas concentrations burn out fast var/gas_reaction_progress = min(max(min_burn, gas_firelevel*gas_fuel)*FIRE_GAS_BURNRATE_MULT, gas_fuel) //liquid fuels are not as volatile, and the reaction progress depends on the size of the area that is burning. Limit the burn rate to a certain amount per area. - var/liquid_firelevel = calculate_firelevel(liquid_fuel, total_oxidizers, reaction_limit, 0) / vsc.fire_firelevel_multiplier + var/liquid_firelevel = calculate_firelevel(liquid_fuel, total_oxidizers, reaction_limit, 0) / GLOB.vsc.fire_firelevel_multiplier var/liquid_reaction_progress = min((liquid_firelevel*0.2 + 0.05)*fuel_area*FIRE_LIQUID_BURNRATE_MULT, liquid_fuel) var/firelevel = (gas_fuel*gas_firelevel + liquid_fuel*liquid_firelevel)/total_fuel @@ -328,7 +328,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin zone.remove_liquidfuel(used_liquid_fuel, !check_combustability()) //calculate the energy produced by the reaction and then set the new temperature of the mix - temperature = (starting_energy + vsc.fire_fuel_energy_release * (used_gas_fuel + used_liquid_fuel)) / heat_capacity() + temperature = (starting_energy + GLOB.vsc.fire_fuel_energy_release * (used_gas_fuel + used_liquid_fuel)) / heat_capacity() update_values() #ifdef ZASDBG @@ -360,7 +360,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin /datum/gas_mixture/proc/check_combustability(obj/effect/decal/cleanable/liquid_fuel/liquid=null) . = 0 for(var/g in gas) - if(gas_data.flags[g] & XGM_GAS_OXIDIZER && QUANTIZE(gas[g] * vsc.fire_consuption_rate) >= 0.1) + if(gas_data.flags[g] & XGM_GAS_OXIDIZER && QUANTIZE(gas[g] * GLOB.vsc.fire_consuption_rate) >= 0.1) . = 1 break @@ -372,7 +372,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin . = 0 for(var/g in gas) - if(gas_data.flags[g] & XGM_GAS_FUEL && QUANTIZE(gas[g] * vsc.fire_consuption_rate) >= 0.005) + if(gas_data.flags[g] & XGM_GAS_FUEL && QUANTIZE(gas[g] * GLOB.vsc.fire_consuption_rate) >= 0.005) . = 1 break @@ -409,13 +409,13 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin #endif //toss everything together -- should produce a value between 0 and fire_firelevel_multiplier - firelevel = vsc.fire_firelevel_multiplier * mix_multiplier * damping_multiplier + firelevel = GLOB.vsc.fire_firelevel_multiplier * mix_multiplier * damping_multiplier return max( 0, firelevel) /mob/living/proc/FireBurn(var/firelevel, var/last_temperature, var/pressure) - var/mx = 5 * firelevel/vsc.fire_firelevel_multiplier * min(pressure / ONE_ATMOSPHERE, 1) + var/mx = 5 * firelevel/GLOB.vsc.fire_firelevel_multiplier * min(pressure / ONE_ATMOSPHERE, 1) apply_damage(2.5*mx, DAMAGE_BURN) @@ -447,7 +447,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin if(C.body_parts_covered & ARMS) arms_exposure = 0 //minimize this for low-pressure enviroments - var/mx = 5 * firelevel/vsc.fire_firelevel_multiplier * min(pressure / ONE_ATMOSPHERE, 1) + var/mx = 5 * firelevel/GLOB.vsc.fire_firelevel_multiplier * min(pressure / ONE_ATMOSPHERE, 1) //Always check these damage procs first if fire damage isn't working. They're probably what's wrong. diff --git a/code/ZAS/Phoron.dm b/code/ZAS/Phoron.dm index adb65ecc321..581d3efb17e 100644 --- a/code/ZAS/Phoron.dm +++ b/code/ZAS/Phoron.dm @@ -1,4 +1,4 @@ -var/image/contamination_overlay = image('icons/effects/contamination.dmi') +GLOBAL_DATUM_INIT(contamination_overlay, /image, image('icons/effects/contamination.dmi')) /pl_control var/PHORON_DMG = 3 @@ -53,11 +53,11 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') //Do a contamination overlay? Temporary measure to keep contamination less deadly than it was. if(!contaminated) contaminated = 1 - AddOverlays(contamination_overlay, ATOM_ICON_CACHE_PROTECTED) + AddOverlays(GLOB.contamination_overlay, ATOM_ICON_CACHE_PROTECTED) /obj/item/proc/decontaminate() contaminated = 0 - CutOverlays(contamination_overlay, ATOM_ICON_CACHE_PROTECTED) + CutOverlays(GLOB.contamination_overlay, ATOM_ICON_CACHE_PROTECTED) /mob/proc/contaminate() @@ -76,7 +76,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') //Handles all the bad things phoron can do. //Contamination - if(vsc.plc.CLOTH_CONTAMINATION) contaminate() + if(GLOB.vsc.plc.CLOTH_CONTAMINATION) contaminate() //Anything else requires them to not be dead. if(stat >= DEAD) @@ -86,7 +86,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') return //Burn skin if exposed. - if(vsc.plc.SKIN_BURNS) + if(GLOB.vsc.plc.SKIN_BURNS) if(!pl_head_protected() || !pl_suit_protected()) burn_skin(3) if(prob(20)) @@ -94,7 +94,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') updatehealth() //Burn eyes if exposed. - if(vsc.plc.EYE_BURNS) + if(GLOB.vsc.plc.EYE_BURNS) var/burn_eyes = 1 @@ -116,8 +116,8 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') //Genetic Corruption - if(vsc.plc.GENETIC_CORRUPTION) - if(rand(1,10000) < vsc.plc.GENETIC_CORRUPTION) + if(GLOB.vsc.plc.GENETIC_CORRUPTION) + if(rand(1,10000) < GLOB.vsc.plc.GENETIC_CORRUPTION) randmutb(src) to_chat(src, SPAN_DANGER("High levels of toxins cause you to spontaneously mutate!")) domutcheck(src,null) @@ -140,7 +140,7 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') /mob/living/carbon/human/proc/pl_head_protected() //Checks if the head is adequately sealed. if(head) - if(vsc.plc.PHORONGUARD_ONLY) + if(GLOB.vsc.plc.PHORONGUARD_ONLY) if(head.item_flags & ITEM_FLAG_PHORON_GUARD) return 1 else if(head.body_parts_covered & EYES) @@ -153,11 +153,11 @@ var/image/contamination_overlay = image('icons/effects/contamination.dmi') for(var/obj/item/protection in list(wear_suit, gloves, shoes)) if(!protection) continue - if(vsc.plc.PHORONGUARD_ONLY && !(protection.item_flags & ITEM_FLAG_PHORON_GUARD)) + if(GLOB.vsc.plc.PHORONGUARD_ONLY && !(protection.item_flags & ITEM_FLAG_PHORON_GUARD)) return 0 coverage |= protection.body_parts_covered - if(vsc.plc.PHORONGUARD_ONLY) + if(GLOB.vsc.plc.PHORONGUARD_ONLY) return 1 return BIT_TEST_ALL(coverage, UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS) diff --git a/code/ZAS/Turf.dm b/code/ZAS/Turf.dm index e0e1eeb8a4c..0a32f209a2f 100644 --- a/code/ZAS/Turf.dm +++ b/code/ZAS/Turf.dm @@ -52,7 +52,7 @@ #define GET_ZONE_NEIGHBOURS(T, ret) \ ret = 0; \ if (T.zone) { \ - for (var/_gzn_dir in gzn_check) { \ + for (var/_gzn_dir in GLOB.gzn_check) { \ var/turf/simulated/other = get_step(T, _gzn_dir); \ if (istype(other) && other.zone == T.zone) { \ var/block; \ @@ -82,7 +82,7 @@ if (!(. & (. - 1))) return TRUE - for(var/dir in csrfz_check) + for(var/dir in GLOB.csrfz_check) //for each pair of "adjacent" cardinals (e.g. NORTH and WEST, but not NORTH and SOUTH) if((dir & check_dirs) == dir) //check that they are connected by the corner turf @@ -201,7 +201,7 @@ sim.zone.add(src) #ifdef ZASDBG - dbg(assigned) + dbg(GLOB.assigned) log_subsystem_zas_debug("Added to [zone]") #endif @@ -229,7 +229,7 @@ newzone.add(src) #ifdef ZASDBG - dbg(created) + dbg(GLOB.created) ASSERT(zone) #endif diff --git a/code/ZAS/Variable Settings.dm b/code/ZAS/Variable Settings.dm index 3bbeccbc3ec..fddb54ff01d 100644 --- a/code/ZAS/Variable Settings.dm +++ b/code/ZAS/Variable Settings.dm @@ -1,4 +1,4 @@ -var/global/vs_control/vsc = new +GLOBAL_DATUM_INIT(vsc, /vs_control, new()) /vs_control var/fire_consuption_rate = 0.25 diff --git a/code/ZAS/Zone.dm b/code/ZAS/Zone.dm index 29322395721..9affbfa503d 100644 --- a/code/ZAS/Zone.dm +++ b/code/ZAS/Zone.dm @@ -108,7 +108,7 @@ Class Procs: into.add(T) T.update_graphic(graphic_remove = air.graphic) #ifdef ZASDBG - T.dbg(merged) + T.dbg(GLOB.merged) #endif //rebuild the old zone's edges so that they will be possessed by the new zone @@ -124,7 +124,7 @@ Class Procs: SSair.remove_zone(src) #ifdef ZASDBG for(var/turf/simulated/T in contents) - T.dbg(invalid_zone) + T.dbg(GLOB.invalid_zone) #endif /zone/proc/rebuild() @@ -151,7 +151,7 @@ Class Procs: if(air.temperature >= PHORON_FLASHPOINT && !(src in SSair.active_fire_zones) && air.check_combustability() && contents.len) var/turf/T = pick(contents) if(istype(T)) - T.create_fire(vsc.fire_firelevel_multiplier) + T.create_fire(GLOB.vsc.fire_firelevel_multiplier) var/world_time_counter = world.time var/list/graphic_add = list() diff --git a/code/__DEFINES/ZAS.dm b/code/__DEFINES/ZAS.dm index 4044c3e474b..3578759b132 100644 --- a/code/__DEFINES/ZAS.dm +++ b/code/__DEFINES/ZAS.dm @@ -18,8 +18,8 @@ #ifdef MULTIZAS -var/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTHUP, EASTUP, WESTUP, SOUTHUP, NORTHDOWN, EASTDOWN, WESTDOWN, SOUTHDOWN) -var/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN) +GLOBAL_LIST_INIT(csrfz_check, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST, NORTHUP, EASTUP, WESTUP, SOUTHUP, NORTHDOWN, EASTDOWN, WESTDOWN, SOUTHDOWN)) +GLOBAL_LIST_INIT(gzn_check, list(NORTH, SOUTH, EAST, WEST, UP, DOWN)) #define ATMOS_CANPASS_TURF(ret,A,B) \ if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \ @@ -63,8 +63,8 @@ var/list/gzn_check = list(NORTH, SOUTH, EAST, WEST, UP, DOWN) } #else -var/list/csrfz_check = list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) -var/list/gzn_check = list(NORTH, SOUTH, EAST, WEST) +GLOBAL_LIST_INIT(csrfz_check, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)) +GLOBAL_LIST_INIT(gzn_check, list(NORTH, SOUTH, EAST, WEST)) #define ATMOS_CANPASS_TURF(ret,A,B) \ if (A.blocks_air & AIR_BLOCKED || B.blocks_air & AIR_BLOCKED) { \ diff --git a/code/__DEFINES/__globals.dm b/code/__DEFINES/__globals.dm index 45313ca62fe..3639d559255 100644 --- a/code/__DEFINES/__globals.dm +++ b/code/__DEFINES/__globals.dm @@ -1,4 +1,5 @@ // See also controllers/globals.dm +// See initialization order in /code/game/world.dm /// Creates a global initializer with a given InitValue expression, do not use #define GLOBAL_MANAGED(X, InitValue)\ diff --git a/code/__DEFINES/_macros.dm b/code/__DEFINES/_macros.dm index 32661a15e52..b68e5a5c7cb 100644 --- a/code/__DEFINES/_macros.dm +++ b/code/__DEFINES/_macros.dm @@ -15,7 +15,7 @@ #define UNDERSCORE_OR_NULL(target) "[target ? "[target]_" : ""]" -#define sequential_id(key) uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, key) +#define sequential_id(key) GLOB.uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, key) /// General I/O helpers #define to_target(target, payload) target << (payload) diff --git a/code/__DEFINES/_unit_tests.dm b/code/__DEFINES/_unit_tests.dm index cd7e692a9a0..9f8e6e39327 100644 --- a/code/__DEFINES/_unit_tests.dm +++ b/code/__DEFINES/_unit_tests.dm @@ -71,3 +71,25 @@ return fail("Expected [isnull(lhs) ? "null" : lhs] to not be equal to [isnull(rhs) ? "null" : rhs].[message ? " [message]" : ""]", __FILE__, __LINE__); \ } \ } while (FALSE) + +//Temporarily just defined here +#define ANSICOLORS + +/// Change color to red on ANSI terminal output, if enabled with -DANSICOLORS. +#ifdef ANSICOLORS +#define TEST_OUTPUT_RED(text) "\x1B\x5B1;31m[text]\x1B\x5B0m" +#else +#define TEST_OUTPUT_RED(text) (text) +#endif +/// Change color to green on ANSI terminal output, if enabled with -DANSICOLORS. +#ifdef ANSICOLORS +#define TEST_OUTPUT_GREEN(text) "\x1B\x5B1;32m[text]\x1B\x5B0m" +#else +#define TEST_OUTPUT_GREEN(text) (text) +#endif +/// Change color to yellow on ANSI terminal output, if enabled with -DANSICOLORS. +#ifdef ANSICOLORS +#define TEST_OUTPUT_YELLOW(text) "\x1B\x5B1;33m[text]\x1B\x5B0m" +#else +#define TEST_OUTPUT_YELLOW(text) (text) +#endif diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index a5b81105e49..c9f23bf2dc3 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -18,15 +18,13 @@ #define ZM_MIMIC_DEFAULTS (ZM_MIMIC_BELOW) // For debug purposes, should contain the above defines in ascending order. -var/list/mimic_defines = list( - "ZM_MIMIC_BELOW", +GLOBAL_LIST_INIT(mimic_defines, list("ZM_MIMIC_BELOW", "ZM_MIMIC_OVERWRITE", // "ZM_ALLOW_LIGHTING", //Exists on Nebula, but not Aurora? "ZM_ALLOW_ATMOS", "ZM_MIMIC_NO_AO", "ZM_NO_OCCLUDE", - "ZM_MIMIC_BASETURF" -) + "ZM_MIMIC_BASETURF")) //EMP protection #define EMP_PROTECT_SELF (1<<0) diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm index 25a116e0477..69a5fdb2ac6 100644 --- a/code/__DEFINES/lighting.dm +++ b/code/__DEFINES/lighting.dm @@ -130,7 +130,7 @@ #define HOLOSCREEN_MULTIPLICATION_OPACITY 1 // Just so we can avoid unneeded proc calls when profiling is disabled. -#define L_PROF(O,T) if (lighting_profiling) {lprof_write(O,T);} +#define L_PROF(O,T) if (GLOB.lighting_profiling) {lprof_write(O,T);} // -- Ambient Occlusion -- diff --git a/code/__DEFINES/machinery.dm b/code/__DEFINES/machinery.dm index d008489bd59..99e7946e795 100644 --- a/code/__DEFINES/machinery.dm +++ b/code/__DEFINES/machinery.dm @@ -87,7 +87,7 @@ // Those networks can only be accessed by pre-existing terminals. AIs and new terminals can't use them. -var/list/restricted_camera_networks = list(NETWORK_ERT,NETWORK_MERCENARY,"Secret") +GLOBAL_LIST_INIT(restricted_camera_networks, list(NETWORK_ERT,NETWORK_MERCENARY,"Secret")) //singularity defines diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index c952dd342b9..e9a0e2f01ba 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -500,3 +500,5 @@ example: // arbitrary low pressure bound for wind weather effects #define MIN_WIND_PRESSURE 10 + +#define NO_EMAG_ACT -50 diff --git a/code/__DEFINES/regex.dm b/code/__DEFINES/regex.dm index 725070b5379..9bf85a4f564 100644 --- a/code/__DEFINES/regex.dm +++ b/code/__DEFINES/regex.dm @@ -2,36 +2,24 @@ // The lazy URL finder. Lazy in that it matches the bare minimum // Replicates BYOND's own URL parser in functionality. -var/global/regex/url_find_lazy +GLOBAL_DATUM_INIT(url_find_lazy, /regex, new("((https?|byond):\\/\\/\[^\\s\]*)", "g")) // REGEX datums used for process_chat_markup. -var/global/regex/markup_bold -var/global/regex/markup_italics -var/global/regex/markup_strike -var/global/regex/markup_underline +GLOBAL_DATUM_INIT(markup_bold, /regex, new("((\\W|^)\\*)(\[^\\*\]*)(\\*(\\W|$))", "g")) +GLOBAL_DATUM_INIT(markup_italics, /regex, new("((\\W|^)\\/)(\[^\\/\]*)(\\/(\\W|$))", "g")) +GLOBAL_DATUM_INIT(markup_strike, /regex, new("((\\W|^)\\~)(\[^\\~\]*)(\\~(\\W|$))", "g")) +GLOBAL_DATUM_INIT(markup_underline, /regex, new("((\\W|^)\\_)(\[^\\_\]*)(\\_(\\W|$))", "g")) // Global list for mark-up REGEX datums. // Initialized in the hook, to avoid passing by null value. -GLOBAL_LIST_EMPTY(markup_regex) +// GLOBAL_LIST_EMPTY(markup_regex) +GLOBAL_LIST_INIT(markup_regex, list("/" = GLOB.markup_italics, + "*" = GLOB.markup_bold, + "~" = GLOB.markup_strike, + "_" = GLOB.markup_underline)) // Global list for mark-up REGEX tag collection. -var/global/list/markup_tags = list("/" = list("", ""), +GLOBAL_LIST_INIT(markup_tags, list("/" = list("", ""), "*" = list("", ""), "~" = list("", ""), - "_" = list("", "")) - -/hook/startup/proc/initialize_global_regex() - url_find_lazy = new("((https?|byond):\\/\\/\[^\\s\]*)", "g") - - markup_bold = new("((\\W|^)\\*)(\[^\\*\]*)(\\*(\\W|$))", "g") - markup_italics = new("((\\W|^)\\/)(\[^\\/\]*)(\\/(\\W|$))", "g") - markup_strike = new("((\\W|^)\\~)(\[^\\~\]*)(\\~(\\W|$))", "g") - markup_underline = new("((\\W|^)\\_)(\[^\\_\]*)(\\_(\\W|$))", "g") - - // List needs to be initialized here, due to DM mixing and matching pass-by-value and -reference as it chooses. - GLOB.markup_regex = list("/" = markup_italics, - "*" = markup_bold, - "~" = markup_strike, - "_" = markup_underline) - - return 1 + "_" = list("", ""))) diff --git a/code/__DEFINES/singletons.dm b/code/__DEFINES/singletons.dm index e6e90d3f9f5..dbd1a0cf1fe 100644 --- a/code/__DEFINES/singletons.dm +++ b/code/__DEFINES/singletons.dm @@ -4,20 +4,20 @@ /// Get a singleton instance according to path P. Creates it if necessary. Null if abstract or not a singleton. #define GET_SINGLETON(P)\ - (ispath(P, /singleton) ? (Singletons.resolved_instances[P] ? Singletons.instances[P] : Singletons.GetInstanceOf(P)) : Singletons.GetInstance(P)) + (ispath(P, /singleton) ? (GLOB.Singletons.resolved_instances[P] ? GLOB.Singletons.instances[P] : GLOB.Singletons.GetInstanceOf(P)) : GLOB.Singletons.GetInstance(P)) /// Get a (path = instance) map of valid singletons according to typesof(P). #define GET_SINGLETON_TYPE_MAP(P)\ - (ispath(P, /singleton) ? (Singletons.resolved_type_maps[P] ? Singletons.type_maps[P] : Singletons.GetTypeMap(P)) : list()) + (ispath(P, /singleton) ? (GLOB.Singletons.resolved_type_maps[P] ? GLOB.Singletons.type_maps[P] : GLOB.Singletons.GetTypeMap(P)) : list()) /// Get a (path = instance) map of valid singletons according to subtypesof(P). #define GET_SINGLETON_SUBTYPE_MAP(P)\ - (ispath(P, /singleton) ? (Singletons.resolved_subtype_maps[P] ? Singletons.subtype_maps[P] : Singletons.GetSubtypeMap(P)) : list()) + (ispath(P, /singleton) ? (GLOB.Singletons.resolved_subtype_maps[P] ? GLOB.Singletons.subtype_maps[P] : GLOB.Singletons.GetSubtypeMap(P)) : list()) /// Get a list of valid singletons according to typesof(path). #define GET_SINGLETON_TYPE_LIST(P)\ - (ispath(P, /singleton) ? (Singletons.resolved_type_lists[P] ? Singletons.type_lists[P] : Singletons.GetTypeList(P)) : list()) + (ispath(P, /singleton) ? (GLOB.Singletons.resolved_type_lists[P] ? GLOB.Singletons.type_lists[P] : GLOB.Singletons.GetTypeList(P)) : list()) /// Get a list of valid singletons according to subtypesof(path). #define GET_SINGLETON_SUBTYPE_LIST(P)\ - (ispath(P, /singleton) ? (Singletons.resolved_subtype_lists[P] ? Singletons.subtype_lists[P] : Singletons.GetSubtypeListOf(P)) : Singletons.GetSubtypeList(P)) + (ispath(P, /singleton) ? (GLOB.Singletons.resolved_subtype_lists[P] ? GLOB.Singletons.subtype_lists[P] : GLOB.Singletons.GetSubtypeListOf(P)) : GLOB.Singletons.GetSubtypeList(P)) diff --git a/code/__DEFINES/text.dm b/code/__DEFINES/text.dm index 088bcbffe68..c31e45f3128 100644 --- a/code/__DEFINES/text.dm +++ b/code/__DEFINES/text.dm @@ -49,19 +49,25 @@ /// Max width of chat message in pixels #define CHAT_MESSAGE_WIDTH 112 -//Since we do not have GLOB (yet), this will have to do -var/regex/html_tags = regex(@"<.*?>", "g") -var/regex/angular_brackets = regex(@"[<>]", "g") -var/regex/filename_forbidden_chars = regex(@{""|[\\\n\t/?%*:|<>]|\.\."}, "g") +//All < and > characters +GLOBAL_DATUM_INIT(angular_brackets, /regex, regex(@"[<>]", "g")) + +//All characters between < a > inclusive of the bracket +GLOBAL_DATUM_INIT(html_tags, /regex, regex(@"<.*?>", "g")) + +//All characters forbidden by filenames: ", \, \n, \t, /, ?, %, *, :, |, <, >, .. +GLOBAL_DATUM_INIT(filename_forbidden_chars, /regex, regex(@{""|[\\\n\t/?%*:|<>]|\.\."}, "g")) +GLOBAL_PROTECT(filename_forbidden_chars) +// had to use the OR operator for quotes instead of putting them in the character class because it breaks the syntax highlighting otherwise. /// Removes characters incompatible with file names. -#define SANITIZE_FILENAME(text) (filename_forbidden_chars.Replace(text, "")) +#define SANITIZE_FILENAME(text) (GLOB.filename_forbidden_chars.Replace(text, "")) /// Simply removes the < and > characters, and limits the length of the message. -#define STRIP_HTML_SIMPLE(text, limit) (angular_brackets.Replace(copytext(text, 1, limit), "")) +#define STRIP_HTML_SIMPLE(text, limit) (GLOB.angular_brackets.Replace(copytext(text, 1, limit), "")) /// Removes everything enclose in < and > inclusive of the bracket, and limits the length of the message. -#define STRIP_HTML_FULL(text, limit) (html_tags.Replace(copytext(text, 1, limit), "")) +#define STRIP_HTML_FULL(text, limit) (GLOB.html_tags.Replace(copytext(text, 1, limit), "")) /// BYOND's string procs don't support being used on datum references (as in it doesn't look for a name for stringification) /// We just use this macro to ensure that we will only pass strings to this BYOND-level function without developers needing to really worry about it. diff --git a/code/__HELPERS/_global_objects.dm b/code/__HELPERS/_global_objects.dm index b42c2cfb17d..252da3aed15 100644 --- a/code/__HELPERS/_global_objects.dm +++ b/code/__HELPERS/_global_objects.dm @@ -1,4 +1,4 @@ //Gear tweaks and underwear. -var/datum/gear_tweak/color/gear_tweak_free_color_choice = new() -var/datum/gear_tweak/alpha/gear_tweak_alpha_choice = new() -var/datum/category_collection/underwear/global_underwear = new() +GLOBAL_DATUM_INIT(gear_tweak_free_color_choice, /datum/gear_tweak/color, new()) +GLOBAL_DATUM_INIT(gear_tweak_alpha_choice, /datum/gear_tweak/alpha, new()) +GLOBAL_DATUM_INIT(global_underwear, /datum/category_collection/underwear, new()) diff --git a/code/__HELPERS/_string_lists.dm b/code/__HELPERS/_string_lists.dm deleted file mode 100644 index e58ae7f56ec..00000000000 --- a/code/__HELPERS/_string_lists.dm +++ /dev/null @@ -1,41 +0,0 @@ -#define pick_list(FILE, KEY) (pick(strings(FILE, KEY))) -#define pick_list_replacements(FILE, KEY) (strings_replacement(FILE, KEY)) -#define json_load(FILE) (json_decode(file2text(FILE))) - -var/list/string_cache -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]) - var/regex/r = regex("@pick\\((\\D+?)\\)", "g") - response = r.Replace(response, /proc/strings_subkey_lookup) - return response - else - CRASH("strings list not found: strings/[filename], index=[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] - else - CRASH("strings list not found: strings/[filename], index=[key]") - -/proc/strings_subkey_lookup(match, group1) - return pick_list(string_filename_current_key, group1) - -/proc/load_strings_file(filename) - string_filename_current_key = filename - if(filename in string_cache) - return //no work to do - - if(!string_cache) - string_cache = new - - if(fexists("strings/[filename]")) - string_cache[filename] = json_load("strings/[filename]") - else - CRASH("file not found: strings/[filename]") diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 890ea77bb5c..f71b172f070 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -279,7 +279,7 @@ if(enabled_spooking) return 1 else - return (cult.current_antagonists.len > spookiness_threshold) + return (GLOB.cult.current_antagonists.len > spookiness_threshold) /// Adds an image to a client's `.images`. Useful as a callback. /proc/add_image_to_client(image/image_to_remove, client/add_to) diff --git a/code/__HELPERS/matrices.dm b/code/__HELPERS/matrices.dm index 1e87f46e70b..7582fc6fd33 100644 --- a/code/__HELPERS/matrices.dm +++ b/code/__HELPERS/matrices.dm @@ -307,7 +307,7 @@ round(cos_inv_third+sqrt3_sin, 0.001), round(cos_inv_third-sqrt3_sin, 0.001), ro LUMA_B + cos * -LUMA_B + sin * (1-LUMA_B), LUMA_B + cos * -LUMA_B + sin * constC, LUMA_B + cos * (1-LUMA_B) + sin * LUMA_B ) -var/global/list/delta_index = list( +GLOBAL_LIST_INIT(delta_index, list( 0, 0.01, 0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.1, 0.11, 0.12, 0.14, 0.15, 0.16, 0.17, 0.18, 0.20, 0.21, 0.22, 0.24, 0.25, 0.27, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42, @@ -318,7 +318,7 @@ var/global/list/delta_index = list( 2.37, 2.50, 2.62, 2.75, 2.87, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.3, 4.7, 4.9, 5.0, 5.5, 6.0, 6.5, 6.8, 7.0, 7.3, 7.5, 7.8, 8.0, 8.4, 8.7, 9.0, 9.4, 9.6, 9.8, - 10.0) + 10.0)) ///Exxagerates or removes brightness /proc/color_contrast(value) @@ -333,9 +333,9 @@ var/global/list/delta_index = list( else x = value % 1 if(x == 0) - x = delta_index[value] + x = GLOB.delta_index[value] else - x = delta_index[value] * (1-x) + delta_index[value+1] * x//use linear interpolation for more granularity. + x = GLOB.delta_index[value] * (1-x) + GLOB.delta_index[value+1] * x//use linear interpolation for more granularity. x = x * 127 + 127 var/mult = x / 127 diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 21078425c25..a33a5b98e11 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -106,9 +106,9 @@ if(!current_species || current_species.name_language == null) if(gender==FEMALE) - return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) else - return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) else return current_species.get_random_name(gender) diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index a5243f2524c..0d398073a94 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -1,32 +1,3 @@ -var/church_name = null -/proc/church_name() - if (church_name) - return church_name - - var/name = "" - - name += pick("Holy", "United", "First", "Second", "Last") - - if (prob(20)) - name += " Space" - - name += " " + pick("Church", "Cathedral", "Body", "Worshippers", "Movement", "Witnesses") - name += " of [religion_name()]" - - return name - -var/religion_name = null -/proc/religion_name() - if (religion_name) - return religion_name - - var/name = "" - - name += pick("bee", "science", "edu", "captain", "assistant", "monkey", "alien", "space", "unit", "sprocket", "gadget", "bomb", "revolution", "beyond", "station", "goon", "robot", "ivor", "hobnob") - name += pick("ism", "ia", "ology", "istism", "ites", "ick", "ian", "ity") - - return capitalize(name) - /proc/world_name(var/name) SSatlas.current_map.station_name = name @@ -37,10 +8,10 @@ var/religion_name = null return name -var/syndicate_name = null +GLOBAL_VAR(syndicate_name) /proc/syndicate_name() - if (syndicate_name) - return syndicate_name + if (GLOB.syndicate_name) + return GLOB.syndicate_name var/name = "" @@ -64,13 +35,16 @@ var/syndicate_name = null name += pick("-", "*", "") name += pick("Tech", "Sun", "Co", "Tek", "X", "Inc", "Gen", "Star", "Dyne", "Code", "Hive") - syndicate_name = name + GLOB.syndicate_name = name return name //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. + +///Code phrase for traitors. +GLOBAL_VAR(syndicate_code_phrase) +///Code response for traitors. +GLOBAL_VAR(syndicate_code_response) /* Should be expanded. @@ -88,10 +62,10 @@ var/syndicate_code_response //Code response for traitors. // Helper. Called in misc_late.dm for late misc init. /proc/populate_code_phrases(override = FALSE) - if (override || !syndicate_code_phrase) - syndicate_code_phrase = generate_code_phrase() - if (override || !syndicate_code_response) - syndicate_code_response = generate_code_phrase() + if (override || !GLOB.syndicate_code_phrase) + GLOB.syndicate_code_phrase = generate_code_phrase() + if (override || !GLOB.syndicate_code_response) + GLOB.syndicate_code_response = generate_code_phrase() /proc/generate_code_phrase() //Proc is used for phrase and response in master_controller.dm @@ -120,9 +94,9 @@ var/syndicate_code_response //Code response for traitors. if (1) //1 and 2 can only be selected once each to prevent more than two specific names/places/etc. switch (rand(1,2)) //Mainly to add more options later. if (1) - 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(GLOB.joblist) //Returns a job. safety -= 1 @@ -142,9 +116,9 @@ var/syndicate_code_response //Code response for traitors. if (1) code_phrase += pick(nouns) if (2) - code_phrase += pick(adjectives) + code_phrase += pick(GLOB.adjectives) if (3) - code_phrase += pick(verbs) + code_phrase += pick(GLOB.verbs) if (words == 1) code_phrase += "." else diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index e68a4841786..75872faa58f 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -517,8 +517,8 @@ // ---Begin URL caching. var/list/urls = list() var/i = 1 - while (url_find_lazy.Find_char(message)) - urls["[REF(urls)]-[i]"] = url_find_lazy.match + while (GLOB.url_find_lazy.Find_char(message)) + urls["[REF(urls)]-[i]"] = GLOB.url_find_lazy.match i++ for (var/ref in urls) @@ -526,9 +526,9 @@ // ---End URL caching var/regex/tag_markup - for (var/tag in (markup_tags - ignore_tags)) + for (var/tag in (GLOB.markup_tags - ignore_tags)) tag_markup = GLOB.markup_regex[tag] - message = tag_markup.Replace_char(message, "$2[markup_tags[tag][1]]$3[markup_tags[tag][2]]$5") + message = tag_markup.Replace_char(message, "$2[GLOB.markup_tags[tag][1]]$3[GLOB.markup_tags[tag][2]]$5") // ---Unload URL cache for (var/ref in urls) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 332263d8102..c164244dafc 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -892,21 +892,21 @@ Turf and target are seperate in case you want to teleport some distance from a t return get_turf(location) -//Quick type checks for some tools -var/global/list/common_tools = list( -/obj/item/stack/cable_coil, -/obj/item/wrench, -/obj/item/pipewrench, -/obj/item/weldingtool, -/obj/item/screwdriver, -/obj/item/wirecutters, -/obj/item/powerdrill, -/obj/item/combitool, -/obj/item/device/multitool, -/obj/item/crowbar) +//Quick type checks for some tools ~ BRAH wtf is this shit that's not how one should do this +GLOBAL_LIST_INIT(common_tools, list( + /obj/item/stack/cable_coil, + /obj/item/wrench, + /obj/item/pipewrench, + /obj/item/weldingtool, + /obj/item/screwdriver, + /obj/item/wirecutters, + /obj/item/powerdrill, + /obj/item/combitool, + /obj/item/device/multitool, + /obj/item/crowbar)) /proc/istool(O) - if(O && is_type_in_list(O, common_tools)) + if(O && is_type_in_list(O, GLOB.common_tools)) return 1 return 0 @@ -992,7 +992,7 @@ var/global/list/common_tools = list( /* Checks if that loc and dir has a item on the wall */ -var/list/wall_items = typecacheof(list( +GLOBAL_LIST_INIT(wall_items, typecacheof(list( /obj/machinery/power/apc, /obj/machinery/alarm, /obj/item/device/radio/intercom, @@ -1014,11 +1014,11 @@ var/list/wall_items = typecacheof(list( /obj/structure/fireaxecabinet, /obj/machinery/computer/security/telescreen/entertainment, /obj/structure/sign -)) +))) /proc/gotwallitem(loc, dir) for(var/obj/O in loc) - if (is_type_in_typecache(O, global.wall_items)) + if (is_type_in_typecache(O, GLOB.wall_items)) //Direction works sometimes if(O.dir == dir) return 1 @@ -1040,14 +1040,13 @@ var/list/wall_items = typecacheof(list( //Some stuff is placed directly on the wallturf (signs) for(var/obj/O in get_step(loc, dir)) - if (is_type_in_typecache(O, global.wall_items) && O.pixel_x == 0 && O.pixel_y == 0) + if (is_type_in_typecache(O, GLOB.wall_items) && O.pixel_x == 0 && O.pixel_y == 0) return 1 return 0 // Returns a variable type as string, optionally with some details: // Objects (datums) get their type, paths get the type name, scalars show length (text) and value (numbers), lists show length. // Also attempts some detection of otherwise undetectable types using ref IDs -var/global/known_proc = /proc/get_type_ref_bytes /proc/get_debug_type(var/V, var/details = TRUE, var/print_numbers = TRUE, var/path_names = TRUE, var/text_lengths = TRUE, var/list_lengths = TRUE, var/show_useless_subtypes = TRUE) // scalars / basic types if(isnull(V)) @@ -1116,6 +1115,8 @@ var/global/known_proc = /proc/get_type_ref_bytes var/refType = get_type_ref_bytes(V) if(refType == "") return "unknown" + + var/known_proc = /proc/get_type_ref_bytes if(refType == get_type_ref_bytes(known_proc)) // it's a proc of some kind if(istext(V?:name) && V:name != "") // procs with names are generally verbs return "verb" diff --git a/code/_globalvars/lists/names.dm b/code/_globalvars/lists/names.dm new file mode 100644 index 00000000000..6abebd21cab --- /dev/null +++ b/code/_globalvars/lists/names.dm @@ -0,0 +1,21 @@ +GLOBAL_LIST_INIT(ai_names, world.file2list("config/names/ai.txt")) +GLOBAL_LIST_INIT(ninja_titles, world.file2list("config/names/ninjatitle.txt")) +GLOBAL_LIST_INIT(ninja_names, world.file2list("config/names/ninjaname.txt")) +GLOBAL_LIST_INIT(first_names_male, world.file2list("config/names/first_male.txt")) +GLOBAL_LIST_INIT(first_names_female, world.file2list("config/names/first_female.txt")) +GLOBAL_LIST_INIT(last_names, world.file2list("config/names/last.txt")) +GLOBAL_LIST_INIT(verbs, world.file2list("config/names/verbs.txt")) +GLOBAL_LIST_INIT(adjectives, world.file2list("config/names/adjectives.txt")) + +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" +)) + +GLOBAL_LIST_INIT(nato_phonetic_letters, list( + "Alfa", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", + "Hotel", "India", "Juliett", "Kilo", "Lima", "Mike", "November", + "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", + "Victor", "Whiskey", "X-ray", "Yankee", "Zulu" +)) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 0edd81b8951..d81d800578e 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -421,7 +421,7 @@ if(direction != dir) facedir(direction, force_face) -var/global/list/click_catchers +GLOBAL_LIST(click_catchers) /atom/movable/screen/click_catcher icon = 'icons/mob/screen_gen.dmi' diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 1871e0dea6d..134b3ccf726 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -2,8 +2,8 @@ The global hud: Uses the same visual objects for all players. */ -var/datum/global_hud/global_hud // Initialized in SSatoms. -var/list/global_huds +GLOBAL_DATUM_INIT(global_hud, /datum/global_hud, new) +GLOBAL_LIST(global_huds) /datum/hud/var/atom/movable/screen/grab_intent /datum/hud/var/atom/movable/screen/hurt_intent @@ -432,7 +432,7 @@ var/list/global_huds update_action_buttons() /mob/proc/add_click_catcher() - client.screen |= click_catchers + client.screen |= GLOB.click_catchers /mob/abstract/new_player/add_click_catcher() return diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 564b7c39fc9..eca83ed3f1b 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -1,4 +1,4 @@ -var/atom/movable/screen/robot_inventory +GLOBAL_DATUM(robot_inventory, /atom/movable/screen) /mob/living/silicon/robot/instantiate_hud(datum/hud/HUD) HUD.robot_hud() @@ -102,11 +102,11 @@ var/atom/movable/screen/robot_inventory mymob.throw_icon.screen_loc = ui_borg_store //Inventory - robot_inventory = new /atom/movable/screen() - robot_inventory.name = "inventory" - robot_inventory.icon = 'icons/mob/screen/robot.dmi' - robot_inventory.icon_state = "inventory" - robot_inventory.screen_loc = ui_borg_inventory + GLOB.robot_inventory = new /atom/movable/screen() + GLOB.robot_inventory.name = "inventory" + GLOB.robot_inventory.icon = 'icons/mob/screen/robot.dmi' + GLOB.robot_inventory.icon_state = "inventory" + GLOB.robot_inventory.screen_loc = ui_borg_inventory //Temp @@ -144,7 +144,7 @@ var/atom/movable/screen/robot_inventory r.cells, mymob.up_hint, mymob.pullin, - robot_inventory, + GLOB.robot_inventory, mymob.gun_setting_icon, mymob.toggle_firing_mode, mymob.unique_action_icon, diff --git a/code/controllers/master/admin.dm b/code/controllers/master/admin.dm index a52cb1bcd2c..bf6d8123111 100644 --- a/code/controllers/master/admin.dm +++ b/code/controllers/master/admin.dm @@ -66,22 +66,22 @@ // Subsystems that cmd_ss_panic can hard-restart. // *MUST* have New() use NEW_SS_GLOBAL. -var/list/panic_targets = list( +GLOBAL_LIST_INIT(panic_targets, list( "Garbage" = /datum/controller/subsystem/garbage, "Air" = /datum/controller/subsystem/air, "Explosives" = /datum/controller/subsystem/explosives, "Game Ticker" = /datum/controller/subsystem/ticker, "Timer" = /datum/controller/subsystem/timer, "Effects Master" = /datum/controller/subsystem/effects -) +)) // Subsystems that might do funny things or lose data if hard-restarted. // Makes subsystem require an additional confirmation to restart. -var/list/panic_targets_data_loss = list( +GLOBAL_LIST_INIT(panic_targets_data_loss, list( "Game Ticker" = TRUE -) +)) -/client/proc/cmd_ss_panic(controller in panic_targets) +/client/proc/cmd_ss_panic(controller in GLOB.panic_targets) set category = "Server" set name = "Force-Restart Subsystem" set desc = "Hard-restarts a subsystem. May break things, use with caution." @@ -94,7 +94,7 @@ var/list/panic_targets_data_loss = list( return // If it's marked as potentially causing data-loss (like SStimer), require another confirmation. - if (panic_targets_data_loss[controller]) + if (GLOB.panic_targets_data_loss[controller]) if (alert("This subsystem ([controller]) may cause data loss or strange behavior if restarted! Continue?", "AAAAAA", "No", "No", "Yes") != "Yes") to_chat(usr, "Aborted.") return @@ -103,7 +103,7 @@ var/list/panic_targets_data_loss = list( LOG_DEBUG("SS PANIC: [controller] hard-restart by [usr]!") // NEW_SS_GLOBAL will handle destruction of old controller & data transfer, just create a new one and add it to the MC. - var/ctype = panic_targets[controller] + var/ctype = GLOB.panic_targets[controller] Master.subsystems += new ctype sortTim(Master.subsystems, GLOBAL_PROC_REF(cmp_subsystem_display)) diff --git a/code/controllers/subsystems/ai_obfuscation.dm b/code/controllers/subsystems/ai_obfuscation.dm index 7f96cc4475d..6b3d8ccdc6a 100644 --- a/code/controllers/subsystems/ai_obfuscation.dm +++ b/code/controllers/subsystems/ai_obfuscation.dm @@ -9,7 +9,7 @@ SUBSYSTEM_DEF(ai_obfuscation) return obfuscation_images += added_image - for(var/ai in ai_list) + for(var/ai in GLOB.ai_list) var/mob/living/silicon/ai/A = ai if(A.client) A.client.images += added_image @@ -19,7 +19,7 @@ SUBSYSTEM_DEF(ai_obfuscation) return obfuscation_images -= removed_image - for(var/ai in ai_list) + for(var/ai in GLOB.ai_list) var/mob/living/silicon/ai/A = ai if(A.client) A.client.images -= removed_image diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index 304fda263c8..876bfc8f4f8 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -202,7 +202,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun T.post_update_air_properties() T.needs_air_update = 0 #ifdef ZASDBG - T.CutOverlays(mark) + T.CutOverlays(GLOB.mark) updated++ #endif @@ -219,7 +219,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun T.post_update_air_properties() T.needs_air_update = 0 #ifdef ZASDBG - T.CutOverlays(mark) + T.CutOverlays(GLOB.mark) updated++ #endif @@ -368,7 +368,7 @@ Total Unsimulated Turfs: [world.maxx*world.maxy*world.maxz - simulated_turf_coun return tiles_to_update += T #ifdef ZASDBG - T.AddOverlays(mark) + T.AddOverlays(GLOB.mark) #endif T.needs_air_update = 1 diff --git a/code/controllers/subsystems/alarm.dm b/code/controllers/subsystems/alarm.dm index fc267e44357..0d1b9429da9 100644 --- a/code/controllers/subsystems/alarm.dm +++ b/code/controllers/subsystems/alarm.dm @@ -1,8 +1,8 @@ -/var/global/datum/alarm_handler/atmosphere/atmosphere_alarm = new() -/var/global/datum/alarm_handler/camera/camera_alarm = new() -/var/global/datum/alarm_handler/fire/fire_alarm = new() -/var/global/datum/alarm_handler/motion/motion_alarm = new() -/var/global/datum/alarm_handler/power/power_alarm = new() +GLOBAL_DATUM_INIT(atmosphere_alarm, /datum/alarm_handler/atmosphere, new()) +GLOBAL_DATUM_INIT(camera_alarm, /datum/alarm_handler/camera, new()) +GLOBAL_DATUM_INIT(fire_alarm, /datum/alarm_handler/fire, new()) +GLOBAL_DATUM_INIT(motion_alarm, /datum/alarm_handler/motion, new()) +GLOBAL_DATUM_INIT(power_alarm, /datum/alarm_handler/power, new()) SUBSYSTEM_DEF(alarm) name = "Alarms" @@ -16,7 +16,7 @@ SUBSYSTEM_DEF(alarm) var/tmp/list/active_alarm_cache = list() /datum/controller/subsystem/alarm/Initialize(timeofday) - all_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm) + all_handlers = list(GLOB.atmosphere_alarm, GLOB.camera_alarm, GLOB.fire_alarm, GLOB.motion_alarm, GLOB.power_alarm) return SS_INIT_SUCCESS diff --git a/code/controllers/subsystems/cult.dm b/code/controllers/subsystems/cult.dm index e81101de64b..d3b501e8b49 100644 --- a/code/controllers/subsystems/cult.dm +++ b/code/controllers/subsystems/cult.dm @@ -45,7 +45,7 @@ SUBSYSTEM_DEF(cult) else return TRUE else - return ((length(rune_list) + rune_boost + length(cult.current_antagonists)) >= rune_limit) + return ((length(rune_list) + rune_boost + length(GLOB.cult.current_antagonists)) >= rune_limit) /datum/controller/subsystem/cult/proc/remove_rune(var/datum/rune/R) if(R in rune_list) diff --git a/code/controllers/subsystems/discord.dm b/code/controllers/subsystems/discord.dm index 77a9b8bd9f8..deee03024ec 100644 --- a/code/controllers/subsystems/discord.dm +++ b/code/controllers/subsystems/discord.dm @@ -342,7 +342,7 @@ SUBSYSTEM_DEF(discord) /datum/controller/subsystem/discord/proc/post_webhook_event(var/tag, var/list/data) SHOULD_NOT_SLEEP(TRUE) var/escape_text - if(evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) + if(GLOB.evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) escape_text = "escaped" else escape_text = "transfered" diff --git a/code/controllers/subsystems/economy.dm b/code/controllers/subsystems/economy.dm index 6c5501806bf..843ae73a9a0 100644 --- a/code/controllers/subsystems/economy.dm +++ b/code/controllers/subsystems/economy.dm @@ -14,8 +14,8 @@ SUBSYSTEM_DEF(economy) for(var/loc_type in typesof(/datum/trade_destination) - /datum/trade_destination) var/datum/trade_destination/D = new loc_type - weighted_randomevent_locations[D] = D.viable_random_events.len - weighted_mundaneevent_locations[D] = D.viable_mundane_events.len + GLOB.weighted_randomevent_locations[D] = D.viable_random_events.len + GLOB.weighted_mundaneevent_locations[D] = D.viable_mundane_events.len create_station_account() diff --git a/code/controllers/subsystems/evac.dm b/code/controllers/subsystems/evac.dm index 6b9fb025e8c..96fd77ef7a3 100644 --- a/code/controllers/subsystems/evac.dm +++ b/code/controllers/subsystems/evac.dm @@ -6,11 +6,11 @@ SUBSYSTEM_DEF(evac) wait = 2 SECONDS /datum/controller/subsystem/evac/Initialize() - if(!evacuation_controller) - evacuation_controller = new SSatlas.current_map.evac_controller_type () - evacuation_controller.set_up() + if(!GLOB.evacuation_controller) + GLOB.evacuation_controller = new SSatlas.current_map.evac_controller_type () + GLOB.evacuation_controller.set_up() return SS_INIT_SUCCESS /datum/controller/subsystem/evac/fire() - evacuation_controller.process() + GLOB.evacuation_controller.process() diff --git a/code/controllers/subsystems/evacuation/evacuation.dm b/code/controllers/subsystems/evacuation/evacuation.dm index 20f930df1d4..cd3f8071c03 100644 --- a/code/controllers/subsystems/evacuation/evacuation.dm +++ b/code/controllers/subsystems/evacuation/evacuation.dm @@ -1,4 +1,4 @@ -var/datum/evacuation_controller/evacuation_controller +GLOBAL_DATUM(evacuation_controller, /datum/evacuation_controller) /datum/evacuation_controller diff --git a/code/controllers/subsystems/evacuation/evacuation_pods.dm b/code/controllers/subsystems/evacuation/evacuation_pods.dm index 5fcadf358ac..44adcd0bb4e 100644 --- a/code/controllers/subsystems/evacuation/evacuation_pods.dm +++ b/code/controllers/subsystems/evacuation/evacuation_pods.dm @@ -27,7 +27,7 @@ . = ..() // Arm the escape pods. if(evacuation_type == TRANSFER_EMERGENCY) - for (var/datum/shuttle/autodock/ferry/escape_pod/pod in escape_pods) + for (var/datum/shuttle/autodock/ferry/escape_pod/pod in GLOB.escape_pods) if (pod.arming_controller) pod.arming_controller.arm() @@ -38,7 +38,7 @@ switch(evacuation_type) if("evacuation") // Abandon Ship - for(var/datum/shuttle/autodock/ferry/escape_pod/pod in escape_pods) // Launch the pods! + for(var/datum/shuttle/autodock/ferry/escape_pod/pod in GLOB.escape_pods) // Launch the pods! if(!pod.arming_controller || pod.arming_controller.armed) pod.move_time = (evac_transit_delay/10) pod.launch(src) @@ -80,18 +80,18 @@ abandon_ship = TRUE /datum/evacuation_option/abandon_ship/execute(mob/user) - if (!evacuation_controller) + if (!GLOB.evacuation_controller) return - if (evacuation_controller.deny) + if (GLOB.evacuation_controller.deny) to_chat(user, "Unable to initiate escape procedures.") return - if (evacuation_controller.is_on_cooldown()) - to_chat(user, evacuation_controller.get_cooldown_message()) + if (GLOB.evacuation_controller.is_on_cooldown()) + to_chat(user, GLOB.evacuation_controller.get_cooldown_message()) return - if (evacuation_controller.is_evacuating()) + if (GLOB.evacuation_controller.is_evacuating()) to_chat(user, "Escape procedures already in progress.") return - if (evacuation_controller.call_evacuation(user, 1)) + if (GLOB.evacuation_controller.call_evacuation(user, 1)) log_and_message_admins("[user? key_name(user) : "Autotransfer"] has initiated abandonment of the spacecraft.") /datum/evacuation_option/bluespace_jump @@ -102,18 +102,18 @@ silicon_allowed = TRUE /datum/evacuation_option/bluespace_jump/execute(mob/user) - if (!evacuation_controller) + if (!GLOB.evacuation_controller) return - if (evacuation_controller.deny) + if (GLOB.evacuation_controller.deny) to_chat(user, "Unable to initiate jump preparation.") return - if (evacuation_controller.is_on_cooldown()) - to_chat(user, evacuation_controller.get_cooldown_message()) + if (GLOB.evacuation_controller.is_on_cooldown()) + to_chat(user, GLOB.evacuation_controller.get_cooldown_message()) return - if (evacuation_controller.is_evacuating()) + if (GLOB.evacuation_controller.is_evacuating()) to_chat(user, "Jump preparation already in progress.") return - if (evacuation_controller.call_evacuation(user, 0)) + if (GLOB.evacuation_controller.call_evacuation(user, 0)) log_and_message_admins("[user? key_name(user) : "Autotransfer"] has initiated bluespace jump preparation.") /datum/evacuation_option/crew_transfer @@ -124,18 +124,18 @@ silicon_allowed = TRUE /datum/evacuation_option/crew_transfer/execute(mob/user) - if(!evacuation_controller) + if(!GLOB.evacuation_controller) return - if(evacuation_controller.deny) + if(GLOB.evacuation_controller.deny) to_chat(user, "Unable to initiate crew transfer preparation.") return - if(evacuation_controller.is_on_cooldown()) - to_chat(user, evacuation_controller.get_cooldown_message()) + if(GLOB.evacuation_controller.is_on_cooldown()) + to_chat(user, GLOB.evacuation_controller.get_cooldown_message()) return - if(evacuation_controller.is_evacuating()) + if(GLOB.evacuation_controller.is_evacuating()) to_chat(user, "Crew transfer preparation already in progress.") return - if(evacuation_controller.call_evacuation(user, 0)) + if(GLOB.evacuation_controller.call_evacuation(user, 0)) log_and_message_admins("[user? key_name(user) : "Autotransfer"] has initiated crew transfer preparation.") /datum/evacuation_option/cancel_abandon_ship @@ -146,7 +146,7 @@ silicon_allowed = FALSE /datum/evacuation_option/cancel_abandon_ship/execute(mob/user) - if (evacuation_controller && evacuation_controller.cancel_evacuation()) + if (GLOB.evacuation_controller?.cancel_evacuation()) log_and_message_admins("[key_name(user)] has cancelled abandonment of the spacecraft.") /datum/evacuation_option/cancel_bluespace_jump @@ -157,7 +157,7 @@ silicon_allowed = FALSE /datum/evacuation_option/cancel_bluespace_jump/execute(mob/user) - if (evacuation_controller && evacuation_controller.cancel_evacuation()) + if (GLOB.evacuation_controller?.cancel_evacuation()) log_and_message_admins("[key_name(user)] has cancelled the bluespace jump.") /datum/evacuation_option/cancel_crew_transfer @@ -168,7 +168,7 @@ silicon_allowed = FALSE /datum/evacuation_option/cancel_crew_transfer/execute(mob/user) - if(evacuation_controller && evacuation_controller.cancel_evacuation()) + if(GLOB.evacuation_controller?.cancel_evacuation()) log_and_message_admins("[key_name(user)] has cancelled the crew transfer.") /atom/movable/screen/fullscreen/bluespace_overlay diff --git a/code/controllers/subsystems/evacuation/evacuation_shuttle.dm b/code/controllers/subsystems/evacuation/evacuation_shuttle.dm index 3235ce4e159..e0b6df07ff9 100644 --- a/code/controllers/subsystems/evacuation/evacuation_shuttle.dm +++ b/code/controllers/subsystems/evacuation/evacuation_shuttle.dm @@ -31,7 +31,7 @@ if(waiting_to_leave()) return - for (var/datum/shuttle/autodock/ferry/escape_pod/pod in escape_pods) + for (var/datum/shuttle/autodock/ferry/escape_pod/pod in GLOB.escape_pods) if (!pod.arming_controller || pod.arming_controller.armed) pod.move_time = evac_transit_delay pod.launch(src) @@ -59,7 +59,7 @@ . = ..() // Arm the escape pods. if(evacuation_type == TRANSFER_EMERGENCY) - for (var/datum/shuttle/autodock/ferry/escape_pod/pod in escape_pods) + for (var/datum/shuttle/autodock/ferry/escape_pod/pod in GLOB.escape_pods) if (pod.arming_controller) pod.arming_controller.arm() diff --git a/code/controllers/subsystems/event.dm b/code/controllers/subsystems/event.dm index c011b93b32a..5bc1f1c103a 100644 --- a/code/controllers/subsystems/event.dm +++ b/code/controllers/subsystems/event.dm @@ -131,7 +131,7 @@ SUBSYSTEM_DEF(events) html += "Back
" html += "Time till start: [round(event_time / 600, 0.1)]
" html += "
" - html += "

Available [severity_to_string[selected_event_container.severity]] Events (queued & running events will not be displayed)

" + html += "

Available [GLOB.severity_to_string[selected_event_container.severity]] Events (queued & running events will not be displayed)

" html += "" html += "Name Weight MinWeight MaxWeight OneShot Enabled CurrWeight Remove" var/list/active_with_role = number_active_with_role() @@ -173,7 +173,7 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = event_containers[severity] var/next_event_at = max(0, EC.next_event_time - world.time) html += "" - html += "[severity_to_string[severity]]" + html += "[GLOB.severity_to_string[severity]]" html += "[worldtime2text(max(EC.next_event_time, world.time))]" html += "[round(next_event_at / 600, 0.1)]" html += "" @@ -200,7 +200,7 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = event_containers[severity] var/datum/event_meta/EM = EC.next_event html += "" - html += "[severity_to_string[severity]]" + html += "[GLOB.severity_to_string[severity]]" html += "[EM ? EM.name : "Random"]" html += "View" html += "Clear" @@ -220,7 +220,7 @@ SUBSYSTEM_DEF(events) var/ends_at = E.startedAt + (E.lastProcessAt() * 20) // A best estimate, based on how often the alarm manager processes var/ends_in = max(0, round((ends_at - world.time) / 600, 0.1)) html += "" - html += "[severity_to_string[EM.severity]]" + html += "[GLOB.severity_to_string[EM.severity]]" html += "[EM.name]" html += "[worldtime2text(ends_at)]" html += "[ends_in]" @@ -242,21 +242,21 @@ SUBSYSTEM_DEF(events) var/datum/event_container/EC = locate(href_list["event"]) var/decrease = 60 * (10 ** text2num(href_list["dec_timer"])) EC.next_event_time -= decrease - log_and_message_admins("decreased timer for [severity_to_string[EC.severity]] events by [decrease/600] minute(s).") + log_and_message_admins("decreased timer for [GLOB.severity_to_string[EC.severity]] events by [decrease/600] minute(s).") else if(href_list["inc_timer"]) var/datum/event_container/EC = locate(href_list["event"]) var/increase = 60 * (10 ** text2num(href_list["inc_timer"])) EC.next_event_time += increase - log_and_message_admins("increased timer for [severity_to_string[EC.severity]] events by [increase/600] minute(s).") + log_and_message_admins("increased timer for [GLOB.severity_to_string[EC.severity]] events by [increase/600] minute(s).") else if(href_list["select_event"]) var/datum/event_container/EC = locate(href_list["select_event"]) var/datum/event_meta/EM = EC.SelectEvent() if(EM) - log_and_message_admins("has queued the [severity_to_string[EC.severity]] event '[EM.name]'.") + log_and_message_admins("has queued the [GLOB.severity_to_string[EC.severity]] event '[EM.name]'.") else if(href_list["pause"]) var/datum/event_container/EC = locate(href_list["pause"]) EC.delayed = !EC.delayed - log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [severity_to_string[EC.severity]] events.") + log_and_message_admins("has [EC.delayed ? "paused" : "resumed"] countdown for [GLOB.severity_to_string[EC.severity]] events.") else if(href_list["pause_all"]) GLOB.config.allow_random_events = text2num(href_list["pause_all"]) log_and_message_admins("has [GLOB.config.allow_random_events ? "resumed" : "paused"] countdown for all events.") @@ -265,13 +265,13 @@ SUBSYSTEM_DEF(events) if(delay && delay > 0) var/datum/event_container/EC = locate(href_list["interval"]) EC.delay_modifier = delay - log_and_message_admins("has set the interval modifier for [severity_to_string[EC.severity]] events to [EC.delay_modifier].") + log_and_message_admins("has set the interval modifier for [GLOB.severity_to_string[EC.severity]] events to [EC.delay_modifier].") else if(href_list["stop"]) if(alert("Stopping an event may have unintended side-effects. Continue?","Stopping Event!","Yes","No") != "Yes") return var/datum/event/E = locate(href_list["stop"]) var/datum/event_meta/EM = E.event_meta - log_and_message_admins("has stopped the [severity_to_string[EM.severity]] event '[EM.name]'.") + log_and_message_admins("has stopped the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") E.end() E.kill() else if(href_list["view_events"]) @@ -294,23 +294,23 @@ SUBSYSTEM_DEF(events) var/datum/event_meta/EM = locate(href_list["set_weight"]) EM.weight = weight if(EM != new_event) - log_and_message_admins("has changed the weight of the [severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].") + log_and_message_admins("has changed the weight of the [GLOB.severity_to_string[EM.severity]] event '[EM.name]' to [EM.weight].") else if(href_list["toggle_oneshot"]) var/datum/event_meta/EM = locate(href_list["toggle_oneshot"]) EM.one_shot = !EM.one_shot if(EM != new_event) - log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [severity_to_string[EM.severity]] event '[EM.name]'.") + log_and_message_admins("has [EM.one_shot ? "set" : "unset"] the oneshot flag for the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["toggle_enabled"]) var/datum/event_meta/EM = locate(href_list["toggle_enabled"]) EM.enabled = !EM.enabled - log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [severity_to_string[EM.severity]] event '[EM.name]'.") + log_and_message_admins("has [EM.enabled ? "enabled" : "disabled"] the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["remove"]) if(alert("This will remove the event from rotation. Continue?","Removing Event!","Yes","No") != "Yes") return var/datum/event_meta/EM = locate(href_list["remove"]) var/datum/event_container/EC = locate(href_list["EC"]) EC.available_events -= EM - log_and_message_admins("has removed the [severity_to_string[EM.severity]] event '[EM.name]'.") + log_and_message_admins("has removed the [GLOB.severity_to_string[EM.severity]] event '[EM.name]'.") else if(href_list["add"]) if(!new_event.name || !new_event.event_type) return @@ -318,12 +318,12 @@ SUBSYSTEM_DEF(events) return new_event.severity = selected_event_container.severity selected_event_container.available_events += new_event - log_and_message_admins("has added \a [severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].") + log_and_message_admins("has added \a [GLOB.severity_to_string[new_event.severity]] event '[new_event.name]' of type [new_event.event_type] with weight [new_event.weight].") new_event = new else if(href_list["clear"]) var/datum/event_container/EC = locate(href_list["clear"]) if(EC.next_event) - log_and_message_admins("has dequeued the [severity_to_string[EC.severity]] event '[EC.next_event.name]'.") + log_and_message_admins("has dequeued the [GLOB.severity_to_string[EC.severity]] event '[EC.next_event.name]'.") EC.next_event = null Interact(usr) diff --git a/code/controllers/subsystems/initialization/atlas.dm b/code/controllers/subsystems/initialization/atlas.dm index 8d986dcfb37..074e9f7d6ec 100644 --- a/code/controllers/subsystems/initialization/atlas.dm +++ b/code/controllers/subsystems/initialization/atlas.dm @@ -266,7 +266,7 @@ SUBSYSTEM_DEF(atlas) SHOULD_NOT_SLEEP(TRUE) // This needs to be done after current_map is set, but before mapload. - admin_departments = list( + GLOB.admin_departments = list( "[current_map.boss_name]", "External Routing", "Supply" diff --git a/code/controllers/subsystems/initialization/misc_early.dm b/code/controllers/subsystems/initialization/misc_early.dm index 84af95b973a..5b7a80a6def 100644 --- a/code/controllers/subsystems/initialization/misc_early.dm +++ b/code/controllers/subsystems/initialization/misc_early.dm @@ -8,16 +8,15 @@ SUBSYSTEM_DEF(misc_early) /datum/controller/subsystem/misc_early/Initialize(timeofday) // Setup the global HUD. - global_hud = new - global_huds = list( - global_hud.druggy, - global_hud.blurry, - global_hud.vimpaired, - global_hud.darkMask, - global_hud.nvg, - global_hud.thermal, - global_hud.meson, - global_hud.science, + GLOB.global_huds = list( + GLOB.global_hud.druggy, + GLOB.global_hud.blurry, + GLOB.global_hud.vimpaired, + GLOB.global_hud.darkMask, + GLOB.global_hud.nvg, + GLOB.global_hud.thermal, + GLOB.global_hud.meson, + GLOB.global_hud.science, ) // Populate global list of tips by category @@ -43,6 +42,6 @@ SUBSYSTEM_DEF(misc_early) // Setup cargo spawn lists. setup_cargo_spawn_lists() - click_catchers = create_click_catcher() + GLOB.click_catchers = create_click_catcher() return SS_INIT_SUCCESS diff --git a/code/controllers/subsystems/initialization/misc_late.dm b/code/controllers/subsystems/initialization/misc_late.dm index d46834c6728..2b4d8347728 100644 --- a/code/controllers/subsystems/initialization/misc_late.dm +++ b/code/controllers/subsystems/initialization/misc_late.dm @@ -17,8 +17,8 @@ SUBSYSTEM_DEF(misc_late) if (area_turfs.len) // Check the area is mapped GLOB.ghostteleportlocs += AR.name GLOB.ghostteleportlocs[AR.name] = AR - if(SSatlas.current_map.use_overmap && map_overmap) - GLOB.ghostteleportlocs[map_overmap.name] = map_overmap + if(SSatlas.current_map.use_overmap && GLOB.map_overmap) + GLOB.ghostteleportlocs[GLOB.map_overmap.name] = GLOB.map_overmap sortTim(GLOB.ghostteleportlocs, GLOBAL_PROC_REF(cmp_text_asc)) diff --git a/code/controllers/subsystems/job.dm b/code/controllers/subsystems/job.dm index 49d6bc5bea7..0ec1b53e373 100644 --- a/code/controllers/subsystems/job.dm +++ b/code/controllers/subsystems/job.dm @@ -664,7 +664,7 @@ SUBSYSTEM_DEF(jobs) return FALSE for(var/thing in prefs.gear) - var/datum/gear/G = gear_datums[thing] + var/datum/gear/G = GLOB.gear_datums[thing] if(G) if(G.augment) //augments are handled somewhere else continue @@ -713,7 +713,7 @@ SUBSYSTEM_DEF(jobs) . = list() log_loadout("ECD/([H]): Entry.") for (var/thing in items) - var/datum/gear/G = gear_datums[thing] + var/datum/gear/G = GLOB.gear_datums[thing] if (G.slot in used_slots) . += thing @@ -773,7 +773,7 @@ SUBSYSTEM_DEF(jobs) if (B) for (var/thing in items) to_chat(H, SPAN_NOTICE("Placing \the [thing] in your [B.name]!")) - var/datum/gear/G = gear_datums[thing] + var/datum/gear/G = GLOB.gear_datums[thing] var/metadata var/list/gear_test = prefs.gear[G.display_name] if(gear_test?.len) @@ -830,7 +830,7 @@ SUBSYSTEM_DEF(jobs) return FALSE for(var/thing in prefs.gear) - var/datum/gear/G = gear_datums[thing] + var/datum/gear/G = GLOB.gear_datums[thing] if(G) if(!G.augment) continue @@ -895,7 +895,7 @@ SUBSYSTEM_DEF(jobs) var/spawned_uniform = FALSE var/spawned_suit = FALSE for(var/item in prefs.gear) - var/datum/gear/L = gear_datums[item] + var/datum/gear/L = GLOB.gear_datums[item] if(L.slot == slot_w_uniform) if(U.uniform && !spawned_uniform && !istype(H.w_uniform, U.uniform)) H.equip_or_collect(new U.uniform(H), H.back) diff --git a/code/controllers/subsystems/lighting.dm b/code/controllers/subsystems/lighting.dm index f8aa2f73890..c2e129f6f5d 100644 --- a/code/controllers/subsystems/lighting.dm +++ b/code/controllers/subsystems/lighting.dm @@ -1,5 +1,5 @@ -/var/lighting_profiling = FALSE -/var/lighting_overlays_initialized = FALSE +GLOBAL_VAR_INIT(lighting_profiling, FALSE) +GLOBAL_VAR_INIT(lighting_overlays_initialized, FALSE) SUBSYSTEM_DEF(lighting) name = "Lighting" @@ -89,7 +89,7 @@ SUBSYSTEM_DEF(lighting) CHECK_TICK - lighting_overlays_initialized = TRUE + GLOB.lighting_overlays_initialized = TRUE admin_notice(SPAN_DANGER("Created [overlaycount] lighting overlays in [(REALTIMEOFDAY - starttime)/10] seconds."), R_DEBUG) diff --git a/code/controllers/subsystems/news.dm b/code/controllers/subsystems/news.dm index 11bd9b135df..42d56fdfe04 100644 --- a/code/controllers/subsystems/news.dm +++ b/code/controllers/subsystems/news.dm @@ -151,7 +151,7 @@ SUBSYSTEM_DEF(news) /datum/controller/subsystem/news/proc/alert_readers(var/annoncement) SHOULD_NOT_SLEEP(TRUE) - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.newsAlert(annoncement) NEWSCASTER.update_icon() diff --git a/code/controllers/subsystems/pai.dm b/code/controllers/subsystems/pai.dm index e62246ed751..7cf89a5b588 100644 --- a/code/controllers/subsystems/pai.dm +++ b/code/controllers/subsystems/pai.dm @@ -90,7 +90,7 @@ SUBSYSTEM_DEF(pai) if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate)) 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 diff --git a/code/controllers/subsystems/processing/airflow.dm b/code/controllers/subsystems/processing/airflow.dm index 4a6b3f66504..9f8c1f82781 100644 --- a/code/controllers/subsystems/processing/airflow.dm +++ b/code/controllers/subsystems/processing/airflow.dm @@ -40,7 +40,7 @@ PROCESSING_SUBSYSTEM_DEF(airflow) target.airflow_process_delay = 0 target.airflow_speed = min(target.airflow_speed, 15) - target.airflow_speed -= vsc.airflow_speed_decay + target.airflow_speed -= GLOB.vsc.airflow_speed_decay if (!target.airflow_skip_speedcheck) if (target.airflow_speed > 7) if (target.airflow_time++ >= target.airflow_speed - 7) @@ -85,7 +85,7 @@ PROCESSING_SUBSYSTEM_DEF(airflow) if(ismob(target)) var/mob/target_mob = target if(target_mob.client) - target_mob:setMoveCooldown(vsc.airflow_mob_slowdown) + target_mob:setMoveCooldown(GLOB.vsc.airflow_mob_slowdown) if (MC_TICK_CHECK) return @@ -100,7 +100,7 @@ PROCESSING_SUBSYSTEM_DEF(airflow) var/tmp/airflow_skip_speedcheck /atom/movable/proc/prepare_airflow(n) - if (!airflow_dest || airflow_speed < 0 || last_airflow > world.time - vsc.airflow_delay) + if (!airflow_dest || airflow_speed < 0 || last_airflow > world.time - GLOB.vsc.airflow_delay) return FALSE if (airflow_speed) airflow_speed = n / max(get_dist(src, airflow_dest), 1) diff --git a/code/controllers/subsystems/processing/psi.dm b/code/controllers/subsystems/processing/psi.dm index 289aed120fd..6dcd0b024d8 100644 --- a/code/controllers/subsystems/processing/psi.dm +++ b/code/controllers/subsystems/processing/psi.dm @@ -1,4 +1,4 @@ -var/global/list/psychic_ranks_to_strings = list("Psionically Sensitive", "Psionically Harmonious", "Psionic Apex", "Limitless") +GLOBAL_LIST_INIT(psychic_ranks_to_strings, list("Psionically Sensitive", "Psionically Harmonious", "Psionic Apex", "Limitless")) PROCESSING_SUBSYSTEM_DEF(psi) name = "Psionics" diff --git a/code/controllers/subsystems/statpanel.dm b/code/controllers/subsystems/statpanel.dm index d4a983417c6..595a0f32ce3 100644 --- a/code/controllers/subsystems/statpanel.dm +++ b/code/controllers/subsystems/statpanel.dm @@ -25,8 +25,8 @@ SUBSYSTEM_DEF(statpanels) var/current_month = text2num(time2text(world.realtime, "MM")) var/current_day = text2num(time2text(world.realtime, "DD")) var/eta_status = "No ETA" - if(evacuation_controller) - eta_status = evacuation_controller.get_status_panel_eta() + if(GLOB.evacuation_controller) + eta_status = GLOB.evacuation_controller.get_status_panel_eta() global_data = list( "Map: [SSatlas.current_map.name]", "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]", diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index a8afb8b9f85..ad73a77b876 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -185,7 +185,7 @@ var/datum/controller/subsystem/ticker/SSticker game_finished = TRUE mode_finished = TRUE else - game_finished = (evacuation_controller.round_over() || mode.station_was_nuked) + game_finished = (GLOB.evacuation_controller.round_over() || mode.station_was_nuked) mode_finished = (!post_game && mode.check_finished()) if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game)) @@ -197,7 +197,7 @@ var/datum/controller/subsystem/ticker/SSticker spawn(50) callHook("roundend") - if (universe_has_ended) + if (GLOB.universe_has_ended) if(mode.station_was_nuked) feedback_set_details("end_proper","nuke") else @@ -253,7 +253,7 @@ var/datum/controller/subsystem/ticker/SSticker if(Player.stat != DEAD) var/turf/playerTurf = get_turf(Player) var/area/playerArea = get_area(playerTurf) - if(evacuation_controller.round_over() && evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) + if(GLOB.evacuation_controller.round_over() && GLOB.evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) if(is_station_level(playerTurf.z) && is_station_area(playerArea)) to_chat(Player, SPAN_GOOD(SPAN_BOLD("You managed to survive the events on [station_name()] as [Player.real_name]."))) else @@ -425,7 +425,7 @@ var/datum/controller/subsystem/ticker/SSticker to_world(SPAN_VOTE(SPAN_BOLD("Tip of the round:") + " [html_encode(message)]")) /datum/controller/subsystem/ticker/proc/print_testmerges() - var/data = revdata.testmerge_overview() + var/data = GLOB.revdata.testmerge_overview() if (data) to_world(data) diff --git a/code/controllers/subsystems/virtual_reality.dm b/code/controllers/subsystems/virtual_reality.dm index ad47fee09b0..ba368818cff 100644 --- a/code/controllers/subsystems/virtual_reality.dm +++ b/code/controllers/subsystems/virtual_reality.dm @@ -143,7 +143,7 @@ SUBSYSTEM_DEF(virtualreality) M.swap_languages(target) if(target.client) - target.client.screen |= global_hud.vr_control + target.client.screen |= GLOB.global_hud.vr_control if(istype(target, /mob/living/simple_animal/spiderbot) && !istype(target, /mob/living/simple_animal/spiderbot/ai)) var/mob/living/simple_animal/spiderbot/spider = target diff --git a/code/controllers/subsystems/zcopy.dm b/code/controllers/subsystems/zcopy.dm index 83afc220cb3..ffaf8cee571 100644 --- a/code/controllers/subsystems/zcopy.dm +++ b/code/controllers/subsystems/zcopy.dm @@ -560,7 +560,7 @@ SUBSYSTEM_DEF(zcopy) "

Analysis of [T] at [T.x],[T.y],[T.z]

", "Queue occurrences: [T.z_queued]", "Above space: Apparent [T.z_eventually_space ? "Yes" : "No"], Actual [is_above_space ? "Yes" : "No"] - [T.z_eventually_space == is_above_space ? "OK" : "MISMATCH"]", - "Z Flags: [english_list(bitfield2list(T.z_flags, global.mimic_defines), "(none)")]", + "Z Flags: [english_list(bitfield2list(T.z_flags, GLOB.mimic_defines), "(none)")]", "Has Shadower: [T.shadower ? "Yes" : "No"]", "Has turf proxy: [T.mimic_proxy ? "Yes" : "No"]", "Has above copy: [T.mimic_above_copy ? "Yes" : "No"]", diff --git a/code/controllers/verbs.dm b/code/controllers/verbs.dm index 3c9170a3e14..3ecad6ac8bd 100644 --- a/code/controllers/verbs.dm +++ b/code/controllers/verbs.dm @@ -20,7 +20,7 @@ if (MC_RUNNING() && SS.flags & SS_NO_DISPLAY) continue available_controllers[SS.name] = SS - available_controllers["Evacuation Controller"] = evacuation_controller + available_controllers["Evacuation Controller"] = GLOB.evacuation_controller var/css = input("What controller would you like to debug?", "Controllers") as null|anything in available_controllers if(!css) return diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm index b3136f9aca7..f5a48c8243c 100644 --- a/code/datums/ai_laws.dm +++ b/code/datums/ai_laws.dm @@ -1,4 +1,4 @@ -var/global/const/base_law_type = /datum/ai_laws/nanotrasen +GLOBAL_VAR_INIT(base_law_type, /datum/ai_laws/nanotrasen) /datum/ai_law var/law = "" diff --git a/code/datums/helper_datums/getrev.dm b/code/datums/helper_datums/getrev.dm index f1c5983af88..192cfc77e7c 100644 --- a/code/datums/helper_datums/getrev.dm +++ b/code/datums/helper_datums/getrev.dm @@ -1,11 +1,11 @@ -var/global/datum/getrev/revdata = new() +GLOBAL_DATUM_INIT(revdata, /datum/getrev, new()) /hook/startup/proc/initialize_test_merges() - if (!revdata) + if (!GLOB.revdata) LOG_DEBUG("GETREV: No rev found.") return TRUE - revdata.testmerge_initialize() + GLOB.revdata.testmerge_initialize() return TRUE @@ -45,12 +45,12 @@ var/global/datum/getrev/revdata = new() set name = "Show Server Revision" set desc = "Check the current server code revision" - if(revdata.revision) - to_chat(src, "Server revision: [revdata.branch] - [revdata.date]") + if(GLOB.revdata.revision) + to_chat(src, "Server revision: [GLOB.revdata.branch] - [GLOB.revdata.date]") if(GLOB.config.githuburl) - to_chat(src, "[revdata.revision]") + to_chat(src, "[GLOB.revdata.revision]") else - to_chat(src, revdata.revision) + to_chat(src, GLOB.revdata.revision) else to_chat(src, "Revision unknown") diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index bdce42505bc..ef87073e8f2 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -48,7 +48,7 @@ var/list/turf/good_turfs = list() var/list/turf/bad_turfs = list() var/turf/T = get_turf(adestination) - for(var/found_inhibitor in bluespace_inhibitors) + for(var/found_inhibitor in GLOB.bluespace_inhibitors) var/obj/machinery/anti_bluespace/AB = found_inhibitor if(T.z != AB.z || get_dist(adestination, AB) > 8 || (AB.stat & (NOPOWER | BROKEN))) continue diff --git a/code/datums/late_choices.dm b/code/datums/late_choices.dm index 7094ec74264..4bf5ef7044b 100755 --- a/code/datums/late_choices.dm +++ b/code/datums/late_choices.dm @@ -66,11 +66,11 @@ data["character_name"] = user.client.prefs.real_name var/shuttle_status = "" - if(evacuation_controller) //In case NanoTrasen decides to repossess CentComm's shuttles. - if(evacuation_controller.has_evacuated()) //Shuttle is going to centcomm, not recalled + if(GLOB.evacuation_controller) //In case NanoTrasen decides to repossess CentComm's shuttles. + if(GLOB.evacuation_controller.has_evacuated()) //Shuttle is going to centcomm, not recalled shuttle_status = "post-evac" - if(evacuation_controller.is_evacuating()) - if(evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) // Emergency shuttle is past the point of no recall + if(GLOB.evacuation_controller.is_evacuating()) + if(GLOB.evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) // Emergency shuttle is past the point of no recall shuttle_status = "evac" else // Crew transfer initiated shuttle_status = TRANSFER_CREW diff --git a/code/datums/modules.dm b/code/datums/modules.dm index f96a5103f89..c0b41d31bed 100644 --- a/code/datums/modules.dm +++ b/code/datums/modules.dm @@ -13,8 +13,7 @@ var/list/modcount = list() // assoc list of the count of modules for a type -var/list/modules = list( // global associative list -"/obj/machinery/power/apc" = "card_reader,power_control,id_auth,cell_power,cell_charge") +GLOBAL_LIST_INIT(modules, list("/obj/machinery/power/apc" = "card_reader,power_control,id_auth,cell_power,cell_charge")) /datum/module/New(var/obj/O) @@ -32,18 +31,18 @@ var/list/modules = list( // global associative list installed = needed /datum/moduletypes/proc/addmod(var/type, var/modtextlist) - modules += type // index by type text - modules[type] = modtextlist + GLOB.modules += type // index by type text + GLOB.modules[type] = modtextlist /datum/moduletypes/proc/inmodlist(var/type) - return ("[type]" in modules) + return ("[type]" in GLOB.modules) /datum/moduletypes/proc/getbitmask(var/type) var/count = modcount["[type]"] if(count) return 2**count-1 - var/modtext = modules["[type]"] + var/modtext = GLOB.modules["[type]"] var/num = 1 var/pos = 1 diff --git a/code/datums/outfits/outfit.dm b/code/datums/outfits/outfit.dm index b9405fefc05..de2830a8d62 100644 --- a/code/datums/outfits/outfit.dm +++ b/code/datums/outfits/outfit.dm @@ -314,8 +314,8 @@ if(islist(path)) //If its a list, select a random item var/itempath = pick(path) I = new itempath(H) - else if(gear_datums[path]) //If its something else, we´ll check if its a gearpath and try to spawn it - var/datum/gear/G = gear_datums[path] + else if(GLOB.gear_datums[path]) //If its something else, we´ll check if its a gearpath and try to spawn it + var/datum/gear/G = GLOB.gear_datums[path] I = G.spawn_random() else I = new path(H) //As fallback treat it as a path diff --git a/code/datums/outfits/outfit_admin.dm b/code/datums/outfits/outfit_admin.dm index 17853eed5fc..62cfe3895e9 100644 --- a/code/datums/outfits/outfit_admin.dm +++ b/code/datums/outfits/outfit_admin.dm @@ -81,7 +81,7 @@ H.equip_or_collect(new path(), slot_wear_mask) if(prob(20)) //Equip some headgear - var/datum/gear/G = gear_datums[pick(list("cap selection","beret, red","hat selection","hijab selection","turban selection"))] + var/datum/gear/G = GLOB.gear_datums[pick(list("cap selection","beret, red","hat selection","hijab selection","turban selection"))] H.equip_or_collect(G.spawn_random(), slot_head) if(prob(20)) //Equip some sunglasses @@ -96,7 +96,7 @@ H.equip_or_collect(new path(), slot_glasses) if(prob(20)) //Equip some gloves - var/datum/gear/G = gear_datums["gloves selection"] + var/datum/gear/G = GLOB.gear_datums["gloves selection"] H.equip_or_collect(G.spawn_random(), slot_gloves) /obj/outfit/admin/random/visitor diff --git a/code/datums/outfits/outfit_antag.dm b/code/datums/outfits/outfit_antag.dm index 19af30e25ea..eb53d6cb096 100644 --- a/code/datums/outfits/outfit_antag.dm +++ b/code/datums/outfits/outfit_antag.dm @@ -683,7 +683,7 @@ var/obj/item/technomancer_core/TC = H.back if(TC) - technomancer_belongings.Add(TC) + GLOB.technomancer_belongings.Add(TC) var/obj/item/technomancer_catalog/catalog = H.l_store if(catalog) @@ -728,7 +728,7 @@ var/obj/item/technomancer_core/TC = H.back if(TC) - technomancer_belongings.Add(TC) + GLOB.technomancer_belongings.Add(TC) var/obj/item/technomancer_catalog/catalog = H.l_store if(catalog) diff --git a/code/datums/records.dm b/code/datums/records.dm index c2ee8b572bf..83a3fda439a 100644 --- a/code/datums/records.dm +++ b/code/datums/records.dm @@ -238,10 +238,10 @@ var/authorization = "Unauthorized" var/wtype = "Unknown" -var/warrant_uid = 0 +GLOBAL_VAR_INIT(warrant_uid, 0) /datum/record/warrant/New() ..() - id = warrant_uid++ + id = GLOB.warrant_uid++ // Virus record /datum/record/virus @@ -259,10 +259,10 @@ var/warrant_uid = 0 var/pilot = FALSE var/lead = FALSE -var/shuttle_uid = 0 +GLOBAL_VAR_INIT(shuttle_uid, 0) /datum/record/shuttle_manifest/New() ..() - id = shuttle_uid++ + id = GLOB.shuttle_uid++ /datum/record/shuttle_assignment var/shuttle diff --git a/code/datums/repositories/cameras.dm b/code/datums/repositories/cameras.dm index 0188247d3bc..b3c6cd8696c 100644 --- a/code/datums/repositories/cameras.dm +++ b/code/datums/repositories/cameras.dm @@ -1,9 +1,9 @@ -var/global/datum/repository/cameras/camera_repository = new() +GLOBAL_DATUM_INIT(camera_repository, /datum/repository/cameras, new()) /proc/invalidateCameraCache() - camera_repository.networks.Cut() - camera_repository.invalidated = 1 - camera_repository.camera_cache_id = (++camera_repository.camera_cache_id % 999999) + GLOB.camera_repository.networks.Cut() + GLOB.camera_repository.invalidated = 1 + GLOB.camera_repository.camera_cache_id = (++GLOB.camera_repository.camera_cache_id % 999999) /datum/repository/cameras var/list/networks diff --git a/code/datums/repositories/crew.dm b/code/datums/repositories/crew.dm index 7c1596046a1..f5eb2f1349d 100644 --- a/code/datums/repositories/crew.dm +++ b/code/datums/repositories/crew.dm @@ -8,7 +8,7 @@ #define OXYGENATION_STATE_NONE 1 #define OXYGENATION_STATE_UNDEFINED 0 -var/global/datum/repository/crew/crew_repository = new() +GLOBAL_DATUM_INIT(crew_repository, /datum/repository/crew, new()) /datum/repository/crew var/list/cache_data diff --git a/code/datums/repositories/singletons.dm b/code/datums/repositories/singletons.dm index 38d8bf21beb..1490408981a 100644 --- a/code/datums/repositories/singletons.dm +++ b/code/datums/repositories/singletons.dm @@ -1,5 +1,4 @@ -var/global/repository/singletons/Singletons = new - +GLOBAL_DATUM_INIT(Singletons, /repository/singletons, new()) /repository/singletons /// A cache of individual singletons as (/singleton/path = Instance, ...) diff --git a/code/datums/repositories/sound_channels.dm b/code/datums/repositories/sound_channels.dm index 4529bb0d9d9..65fea8a32c9 100644 --- a/code/datums/repositories/sound_channels.dm +++ b/code/datums/repositories/sound_channels.dm @@ -1,4 +1,4 @@ -var/repository/sound_channels/sound_channels = new() +GLOBAL_DATUM_INIT(sound_channels, /repository/sound_channels, new()) // lobby_sound_channel = sound_channels.RequestChannel("LOBBY") // vote_sound_channel = sound_channels.RequestChannel("VOTE") // admin_sound_channel = sound_channels.RequestChannel("ADMIN_FUN") diff --git a/code/datums/repositories/unique.dm b/code/datums/repositories/unique.dm index 85a083414ec..991cc5d4a65 100644 --- a/code/datums/repositories/unique.dm +++ b/code/datums/repositories/unique.dm @@ -1,4 +1,4 @@ -var/repository/unique/uniqueness_repository = new() +GLOBAL_DATUM_INIT(uniqueness_repository, /repository/unique, new()) /repository/unique var/list/generators diff --git a/code/datums/sound_player.dm b/code/datums/sound_player.dm index b950a1a1463..ca564d4f5e6 100644 --- a/code/datums/sound_player.dm +++ b/code/datums/sound_player.dm @@ -47,7 +47,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new) if(length(sound_tokens)) return - sound_channels.ReleaseChannel(channel) + GLOB.sound_channels.ReleaseChannel(channel) taken_channels -= sound_id sound_tokens_by_sound_id -= sound_id @@ -56,7 +56,7 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new) . = taken_channels[sound_id] // Does this sound_id already have an assigned channel? if(!.) // If not, request a new one. - . = sound_channels.RequestChannel(sound_id) + . = GLOB.sound_channels.RequestChannel(sound_id) if(!.) // Oh no, still no channel. Abort return taken_channels[sound_id] = . diff --git a/code/datums/state_machine.dm b/code/datums/state_machine.dm index c2ed0fc3269..048e519b935 100644 --- a/code/datums/state_machine.dm +++ b/code/datums/state_machine.dm @@ -1,18 +1,18 @@ -// List and procs for caching state machine instances. -var/global/list/state_machines = list() +/// List and procs for caching state machine instances. +GLOBAL_LIST_INIT(state_machines, list()) /proc/get_state_machine(var/datum/holder, var/base_type) if(istype(holder) && base_type && holder.has_state_machine) - var/list/machines = global.state_machines["[REF(holder)]"] + var/list/machines = GLOB.state_machines["[REF(holder)]"] return islist(machines) && machines[base_type] /proc/add_state_machine(var/datum/holder, var/base_type, var/fsm_type) if(istype(holder) && base_type) var/holder_ref = "[REF(holder)]" - var/list/machines = global.state_machines[holder_ref] + var/list/machines = GLOB.state_machines[holder_ref] if(!islist(machines)) machines = list() - global.state_machines[holder_ref] = machines + GLOB.state_machines[holder_ref] = machines if(!machines[base_type]) if(!fsm_type) fsm_type = base_type @@ -24,11 +24,11 @@ var/global/list/state_machines = list() /proc/remove_state_machine(var/datum/holder, var/base_type) if(istype(holder) && base_type && holder.has_state_machine) var/holder_ref = "[REF(holder)]" - var/list/machines = global.state_machines[holder_ref] + var/list/machines = GLOB.state_machines[holder_ref] if(length(machines)) machines -= base_type if(!length(machines)) - global.state_machines -= holder_ref + GLOB.state_machines -= holder_ref holder.has_state_machine = FALSE return TRUE return FALSE diff --git a/code/datums/trading/trade.dm b/code/datums/trading/trade.dm index b0bd05011de..01de77b97b1 100644 --- a/code/datums/trading/trade.dm +++ b/code/datums/trading/trade.dm @@ -66,7 +66,7 @@ ..() if(name_language) if(name_language == TRADER_DEFAULT_NAME) - name = capitalize(pick(first_names_female + first_names_male)) + " " + capitalize(pick(last_names)) + name = capitalize(pick(GLOB.first_names_female + GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) else var/datum/language/L = GLOB.all_languages[name_language] if(L) diff --git a/code/datums/underwear/underwear.dm b/code/datums/underwear/underwear.dm index e6ca44542b0..862a58cce85 100644 --- a/code/datums/underwear/underwear.dm +++ b/code/datums/underwear/underwear.dm @@ -53,7 +53,7 @@ /datum/category_item/underwear/New() if(has_color) - tweaks += gear_tweak_free_color_choice + tweaks += GLOB.gear_tweak_free_color_choice /datum/category_item/underwear/dd_SortValue() if(always_last) diff --git a/code/datums/uplink/badassery.dm b/code/datums/uplink/badassery.dm index b3373eecdd5..8ba5b670338 100644 --- a/code/datums/uplink/badassery.dm +++ b/code/datums/uplink/badassery.dm @@ -27,11 +27,11 @@ desc = "Buys you one random item." /datum/uplink_item/item/badassery/random_one/buy(var/obj/item/device/uplink/U, var/mob/user) - var/datum/uplink_item/item = default_uplink_selection.get_random_item(U.telecrystals) + var/datum/uplink_item/item = GLOB.default_uplink_selection.get_random_item(U.telecrystals) return item.buy(U, user) /datum/uplink_item/item/badassery/random_one/can_buy_telecrystals(obj/item/device/uplink/U) - return default_uplink_selection.get_random_item(U.telecrystals, U) != null + return GLOB.default_uplink_selection.get_random_item(U.telecrystals, U) != null /datum/uplink_item/item/badassery/random_many name = "Random Items" diff --git a/code/datums/uplink/uplink_items.dm b/code/datums/uplink/uplink_items.dm index bb4a79dfb6c..9fea6e936ca 100644 --- a/code/datums/uplink/uplink_items.dm +++ b/code/datums/uplink/uplink_items.dm @@ -207,7 +207,7 @@ GLOBAL_DATUM(uplink, /datum/uplink) /proc/get_random_uplink_items(var/obj/item/device/uplink/U, var/remaining_TC, var/loc) var/list/bought_items = list() while(remaining_TC) - var/datum/uplink_item/I = default_uplink_selection.get_random_item(remaining_TC, U, bought_items) + var/datum/uplink_item/I = GLOB.default_uplink_selection.get_random_item(remaining_TC, U, bought_items) if(!I) break bought_items += I diff --git a/code/datums/votes/crew_transfer.dm b/code/datums/votes/crew_transfer.dm index 726f6ba96dc..54cd203ae13 100644 --- a/code/datums/votes/crew_transfer.dm +++ b/code/datums/votes/crew_transfer.dm @@ -11,7 +11,7 @@ GLOBAL_VAR(last_transfer_vote) /datum/vote/crewtransfer/can_be_initiated(mob/by_who, forced) . = ..() //Transfer already in progress, noone can call another vote - if(SSatlas.current_map.shuttle_call_restart_timer || (evacuation_controller.state != EVAC_IDLE)) + if(SSatlas.current_map.shuttle_call_restart_timer || (GLOB.evacuation_controller.state != EVAC_IDLE)) to_chat(by_who, SPAN_NOTICE("Transfer or evacuation are already in progress.")) return FALSE diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm index b6c22c83c92..44c8c12cda6 100644 --- a/code/datums/wires/wires.dm +++ b/code/datums/wires/wires.dm @@ -1,7 +1,7 @@ #define MAXIMUM_EMP_WIRES 3 -var/global/list/wire_color_directory = list() -var/global/list/wire_name_directory = list() +GLOBAL_LIST_INIT(wire_color_directory, list()) +GLOBAL_LIST_INIT(wire_name_directory, list()) /datum/wires /// The holder (atom that contains these wires). @@ -45,12 +45,12 @@ var/global/list/wire_name_directory = list() if(random) randomize() else - if(!wire_color_directory[key]) + if(!GLOB.wire_color_directory[key]) randomize() - wire_color_directory[key] = colors - wire_name_directory[key] = proper_name + GLOB.wire_color_directory[key] = colors + GLOB.wire_name_directory[key] = proper_name else - colors = wire_color_directory[key] + colors = GLOB.wire_color_directory[key] /datum/wires/Destroy() holder = null diff --git a/code/game/antagonist/alien/borer.dm b/code/game/antagonist/alien/borer.dm index 74b62edca2d..b1f1d2d4192 100644 --- a/code/game/antagonist/alien/borer.dm +++ b/code/game/antagonist/alien/borer.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/xenos/borer/borers +GLOBAL_DATUM(borers, /datum/antagonist/xenos/borer) /datum/antagonist/xenos/borer id = MODE_BORER @@ -22,8 +22,8 @@ var/datum/antagonist/xenos/borer/borers initial_spawn_target = 3 /datum/antagonist/xenos/borer/New() - ..(TRUE) - borers = src + ..() + GLOB.borers = src /datum/antagonist/xenos/borer/create_objectives(var/datum/mind/player) if(!..()) @@ -60,7 +60,7 @@ var/datum/antagonist/xenos/borer/borers borer.forceMove(chosen_host) if(borer.host.mind) - borers.add_antagonist_mind(borer.host.mind, 1, borers.faction_role_text, borers.faction_welcome) + GLOB.borers.add_antagonist_mind(borer.host.mind, 1, GLOB.borers.faction_role_text, GLOB.borers.faction_welcome) var/obj/item/organ/external/head = borer.host.get_organ(BP_HEAD) head.implants += borer diff --git a/code/game/antagonist/antagonist_equip.dm b/code/game/antagonist/antagonist_equip.dm index 4a909e4514b..81db5981a2e 100644 --- a/code/game/antagonist/antagonist_equip.dm +++ b/code/game/antagonist/antagonist_equip.dm @@ -28,8 +28,8 @@ /datum/antagonist/proc/give_codewords(mob/living/traitor_mob) to_chat(traitor_mob, "Your employers/contacts provided you with the following information on how to identify possible allies:") - to_chat(traitor_mob, "Code Phrase: [syndicate_code_phrase]") - to_chat(traitor_mob, "Code Response: [syndicate_code_response]") - traitor_mob.mind.store_memory("Code Phrase: [syndicate_code_phrase]") - traitor_mob.mind.store_memory("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: [GLOB.syndicate_code_phrase]") + traitor_mob.mind.store_memory("Code Response: [GLOB.syndicate_code_response]") to_chat(traitor_mob, "Use the code words, preferably in the order provided, during regular conversation, to identify other agents. Proceed with caution, however, as everyone is a potential foe.") diff --git a/code/game/antagonist/antagonist_factions.dm b/code/game/antagonist/antagonist_factions.dm index 306afa744f5..c12cd5c542b 100644 --- a/code/game/antagonist/antagonist_factions.dm +++ b/code/game/antagonist/antagonist_factions.dm @@ -14,7 +14,7 @@ if (I.implanted) to_chat(src, SPAN_WARNING("[M] is too loyal to be subverted!")) return - convert_to_faction(src, M.mind, revs) + convert_to_faction(src, M.mind, GLOB.revs) /proc/convert_to_faction(var/client/antag, var/datum/mind/player, var/datum/antagonist/faction) @@ -65,5 +65,5 @@ return if(!M.mind) return - convert_to_faction(src, M.mind, loyalists) + convert_to_faction(src, M.mind, GLOB.loyalists) diff --git a/code/game/antagonist/outsider/burglar.dm b/code/game/antagonist/outsider/burglar.dm index af3e56e1106..8a930a2c0a7 100644 --- a/code/game/antagonist/outsider/burglar.dm +++ b/code/game/antagonist/outsider/burglar.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/burglar/burglars +GLOBAL_DATUM(burglars, /datum/antagonist/burglar) /datum/antagonist/burglar id = MODE_BURGLAR @@ -22,7 +22,7 @@ var/datum/antagonist/burglar/burglars /datum/antagonist/burglar/New() ..() - burglars = src + GLOB.burglars = src welcome_text = "You are a Burglar, someone underequipped to deal with the [station_name()]. You will probably not survive for the whole round, so don't sweat it if you die!
\ Your (syndicate) sponsored uplink will grant you access to various tools you may need to attempt to accomplish your goal.
\ You can use :H or :B to talk on your encrypted channel, which only you and your partner can read.
\ diff --git a/code/game/antagonist/outsider/commando.dm b/code/game/antagonist/outsider/commando.dm index e4e18b80e2e..c6f8aa96ad2 100644 --- a/code/game/antagonist/outsider/commando.dm +++ b/code/game/antagonist/outsider/commando.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/deathsquad/mercenary/commandos +GLOBAL_DATUM(commandos, /datum/antagonist/deathsquad/mercenary) /datum/antagonist/deathsquad/mercenary id = MODE_COMMANDO @@ -20,4 +20,4 @@ var/datum/antagonist/deathsquad/mercenary/commandos /datum/antagonist/deathsquad/mercenary/New() ..() - commandos = src + GLOB.commandos = src diff --git a/code/game/antagonist/outsider/deathsquad.dm b/code/game/antagonist/outsider/deathsquad.dm index f07e60ff688..9d38e03206c 100644 --- a/code/game/antagonist/outsider/deathsquad.dm +++ b/code/game/antagonist/outsider/deathsquad.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/deathsquad/deathsquad +GLOBAL_DATUM(deathsquad, /datum/antagonist/deathsquad) /datum/antagonist/deathsquad id = MODE_DEATHSQUAD @@ -24,7 +24,7 @@ var/datum/antagonist/deathsquad/deathsquad /datum/antagonist/deathsquad/New(var/no_reference) ..() if(!no_reference) - deathsquad = src + GLOB.deathsquad = src /datum/antagonist/deathsquad/attempt_spawn() if(..()) diff --git a/code/game/antagonist/outsider/ert.dm b/code/game/antagonist/outsider/ert.dm index 0916a16e2ab..28323015444 100644 --- a/code/game/antagonist/outsider/ert.dm +++ b/code/game/antagonist/outsider/ert.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/ert/ert +GLOBAL_DATUM(ert, /datum/antagonist/ert) /datum/antagonist/ert id = MODE_ERT @@ -20,4 +20,4 @@ var/datum/antagonist/ert/ert /datum/antagonist/ert/New() ..() - ert = src + GLOB.ert = src diff --git a/code/game/antagonist/outsider/jockey.dm b/code/game/antagonist/outsider/jockey.dm index e29dcf82c09..d1069faff1f 100644 --- a/code/game/antagonist/outsider/jockey.dm +++ b/code/game/antagonist/outsider/jockey.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/jockey/jockeys +GLOBAL_DATUM(jockeys, /datum/antagonist/jockey) /datum/antagonist/jockey id = MODE_JOCKEY @@ -25,7 +25,7 @@ var/datum/antagonist/jockey/jockeys /datum/antagonist/jockey/New() ..() - jockeys = src + GLOB.jockeys = src /datum/antagonist/jockey/update_access(var/mob/living/player) for(var/obj/item/storage/wallet/W in player.contents) diff --git a/code/game/antagonist/outsider/loner.dm b/code/game/antagonist/outsider/loner.dm index 356f2eda186..787582072a6 100644 --- a/code/game/antagonist/outsider/loner.dm +++ b/code/game/antagonist/outsider/loner.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/loner/loners +GLOBAL_DATUM(loners, /datum/antagonist/loner) /datum/antagonist/loner id = MODE_LONER @@ -24,7 +24,7 @@ var/datum/antagonist/loner/loners ..() welcome_text = "You are a Loner, someone underequipped to deal with the [station_name()]. You will probably not survive for the whole round, so don't sweat it if you die!
\ You have a special psionic power that allows you to absorb a psionic energy from a being's Zona Bovinae, granting you an extra point to be used in the Point Shop." - loners = src + GLOB.loners = src /datum/antagonist/loner/equip(var/mob/living/carbon/human/player) if(!..()) diff --git a/code/game/antagonist/outsider/mercenary.dm b/code/game/antagonist/outsider/mercenary.dm index 0dcfc3c6513..8ef1d2a6e81 100644 --- a/code/game/antagonist/outsider/mercenary.dm +++ b/code/game/antagonist/outsider/mercenary.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/mercenary/mercs +GLOBAL_DATUM(mercs, /datum/antagonist/mercenary) /datum/antagonist/mercenary id = MODE_MERCENARY @@ -26,7 +26,7 @@ var/datum/antagonist/mercenary/mercs /datum/antagonist/mercenary/New() ..() - mercs = src + GLOB.mercs = src /datum/antagonist/mercenary/create_global_objectives() if(!..()) diff --git a/code/game/antagonist/outsider/ninja.dm b/code/game/antagonist/outsider/ninja.dm index 0266b967449..a35d8bb87d3 100644 --- a/code/game/antagonist/outsider/ninja.dm +++ b/code/game/antagonist/outsider/ninja.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/ninja/ninjas +GLOBAL_DATUM(ninjas, /datum/antagonist/ninja) /datum/antagonist/ninja id = MODE_NINJA @@ -23,7 +23,7 @@ var/datum/antagonist/ninja/ninjas /datum/antagonist/ninja/New() ..() - ninjas = src + GLOB.ninjas = src /datum/antagonist/ninja/attempt_random_spawn() if(GLOB.config.ninjas_allowed) ..() @@ -93,8 +93,8 @@ var/datum/antagonist/ninja/ninjas /datum/antagonist/ninja/update_antag_mob(var/datum/mind/player) ..() - var/ninja_title = pick(ninja_titles) - var/ninja_name = pick(ninja_names) + var/ninja_title = pick(GLOB.ninja_titles) + var/ninja_name = pick(GLOB.ninja_names) var/mob/living/carbon/human/H = player.current if(istype(H)) H.real_name = "[ninja_title] [ninja_name]" diff --git a/code/game/antagonist/outsider/raider.dm b/code/game/antagonist/outsider/raider.dm index fa57d106b19..701d1e3e872 100644 --- a/code/game/antagonist/outsider/raider.dm +++ b/code/game/antagonist/outsider/raider.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/raider/raiders +GLOBAL_DATUM(raiders, /datum/antagonist/raider) /datum/antagonist/raider id = MODE_RAIDER @@ -25,7 +25,7 @@ var/datum/antagonist/raider/raiders /datum/antagonist/raider/New() ..() - raiders = src + GLOB.raiders = src /datum/antagonist/raider/update_access(var/mob/living/player) for(var/obj/item/storage/wallet/W in player.contents) diff --git a/code/game/antagonist/outsider/raider_techno.dm b/code/game/antagonist/outsider/raider_techno.dm index a66b57f7a51..86e5afc1a9e 100644 --- a/code/game/antagonist/outsider/raider_techno.dm +++ b/code/game/antagonist/outsider/raider_techno.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/raider_techno/raider_techno +GLOBAL_DATUM(raider_techno, /datum/antagonist/raider_techno) /datum/antagonist/raider_techno id = MODE_RAIDER_TECHNO @@ -25,7 +25,7 @@ var/datum/antagonist/raider_techno/raider_techno /datum/antagonist/raider_techno/New() ..() - raider_techno = src + GLOB.raider_techno = src /datum/antagonist/raider_techno/update_access(var/mob/living/player) for(var/obj/item/storage/wallet/W in player.contents) diff --git a/code/game/antagonist/outsider/revenant.dm b/code/game/antagonist/outsider/revenant.dm index f525ed2804a..eefc649e74a 100644 --- a/code/game/antagonist/outsider/revenant.dm +++ b/code/game/antagonist/outsider/revenant.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/revenant/revenants = null +GLOBAL_DATUM(revenants, /datum/antagonist/revenant) /datum/antagonist/revenant id = MODE_REVENANT @@ -21,12 +21,12 @@ var/datum/antagonist/revenant/revenants = null /datum/antagonist/revenant/New() ..() - revenants = src + GLOB.revenants = src /datum/antagonist/revenant/proc/destroyed_rift() - revenants.revenant_rift = null - revenants.rifts_left-- - if(revenants.rifts_left <= 0) + GLOB.revenants.revenant_rift = null + GLOB.revenants.rifts_left-- + if(GLOB.revenants.rifts_left <= 0) command_announcement.Announce("[SSatlas.current_map.station_name], we aren't detecting any more rift energy signatures. Mop up the rest of the invaders. Good work.", "Bluespace Breach Alert") /datum/antagonist/revenant/is_obvious_antag(datum/mind/player) diff --git a/code/game/antagonist/outsider/technomancer.dm b/code/game/antagonist/outsider/technomancer.dm index 96e084a76f4..d511888198e 100644 --- a/code/game/antagonist/outsider/technomancer.dm +++ b/code/game/antagonist/outsider/technomancer.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/technomancer/technomancers +GLOBAL_DATUM(technomancers, /datum/antagonist/technomancer) /datum/antagonist/technomancer id = MODE_TECHNOMANCER @@ -21,7 +21,7 @@ var/datum/antagonist/technomancer/technomancers /datum/antagonist/technomancer/New() ..() - technomancers = src + GLOB.technomancers = src welcome_text = "You will need to purchase functions and perhaps some equipment from the various machines around your \ base. Choose your technological arsenal carefully. Remember that without the core on your back, your functions are \ powerless, and therefore you will be as well.
\ @@ -60,7 +60,7 @@ var/datum/antagonist/technomancer/technomancers /datum/antagonist/technomancer/print_player_summary() ..() - for(var/obj/item/technomancer_core/core in technomancer_belongings) + for(var/obj/item/technomancer_core/core in GLOB.technomancer_belongings) if(core.wearer) continue // Only want abandoned cores. if(!core.spells.len) @@ -83,7 +83,7 @@ var/datum/antagonist/technomancer/technomancers /datum/antagonist/technomancer/proc/is_technomancer(var/datum/mind/player) if(player in current_antagonists) return TRUE - if(raider_techno.is_antagonist(player)) + if(GLOB.raider_techno.is_antagonist(player)) return TRUE return FALSE diff --git a/code/game/antagonist/station/changeling/morph.dm b/code/game/antagonist/station/changeling/morph.dm index 786c2742c57..35533bd2b78 100644 --- a/code/game/antagonist/station/changeling/morph.dm +++ b/code/game/antagonist/station/changeling/morph.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/morph/morphs = null +GLOBAL_DATUM(morphs, /datum/antagonist/morph) /datum/antagonist/morph id = MODE_MORPH @@ -12,7 +12,7 @@ var/datum/antagonist/morph/morphs = null /datum/antagonist/morph/New() ..() - morphs = src + GLOB.morphs = src /datum/antagonist/morph/greet(datum/mind/player) . = ..() diff --git a/code/game/antagonist/station/cultist.dm b/code/game/antagonist/station/cultist.dm index 3d1eb4d9471..29cc60e87d6 100644 --- a/code/game/antagonist/station/cultist.dm +++ b/code/game/antagonist/station/cultist.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/cultist/cult +GLOBAL_DATUM(cult, /datum/antagonist/cultist) /proc/iscultist(var/mob/player) if(player.faction == "cult") @@ -6,7 +6,7 @@ var/datum/antagonist/cultist/cult if(player.mind) if(player.mind.antag_datums[MODE_CULTIST]) return TRUE - if(cult && (player.mind in cult.current_antagonists)) + if(GLOB.cult && (player.mind in GLOB.cult.current_antagonists)) return TRUE return FALSE @@ -42,7 +42,7 @@ var/datum/antagonist/cultist/cult /datum/antagonist/cultist/New() ..() welcome_text = "You have a talisman in your possession; one that will help you start the cult on the [station_name(TRUE)]. Use it well and remember - there are others." - cult = src + GLOB.cult = src /datum/antagonist/cultist/create_global_objectives() @@ -119,7 +119,7 @@ var/datum/antagonist/cultist/cult if(!istype(target)) return - if(!cult.can_become_antag(target.mind) || jobban_isbanned(target, "cultist") || player_is_antag(target.mind)) + if(!GLOB.cult.can_become_antag(target.mind) || jobban_isbanned(target, "cultist") || player_is_antag(target.mind)) to_chat(usr, SPAN_CULT("You get the sense that [target] would be an unworthy offering.")) else to_chat(usr, SPAN_CULT("You get the sense that your master would be pleased to welcome [target] into the cult.")) diff --git a/code/game/antagonist/station/highlander.dm b/code/game/antagonist/station/highlander.dm index df59546b84b..f181a104ec0 100644 --- a/code/game/antagonist/station/highlander.dm +++ b/code/game/antagonist/station/highlander.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/highlander/highlanders +GLOBAL_DATUM(highlanders, /datum/antagonist/highlander) /datum/antagonist/highlander role_text = "Highlander" @@ -16,7 +16,7 @@ var/datum/antagonist/highlander/highlanders /datum/antagonist/highlander/New() ..() - highlanders = src + GLOB.highlanders = src /datum/antagonist/highlander/create_objectives(var/datum/mind/player) @@ -56,7 +56,7 @@ var/datum/antagonist/highlander/highlanders for(var/mob/living/carbon/human/H in GLOB.player_list) if(H.stat == 2 || !(H.client)) continue if(is_special_character(H)) continue - highlanders.add_antagonist(H.mind) + GLOB.highlanders.add_antagonist(H.mind) message_admins(SPAN_NOTICE("[key_name_admin(usr)] used THERE CAN BE ONLY ONE!"), 1) log_admin("[key_name(usr)] used there can be only one.") diff --git a/code/game/antagonist/station/loyalist.dm b/code/game/antagonist/station/loyalist.dm index 3531c4e3e8f..5f6a41141cc 100644 --- a/code/game/antagonist/station/loyalist.dm +++ b/code/game/antagonist/station/loyalist.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/loyalists/loyalists +GLOBAL_DATUM(loyalists, /datum/antagonist/loyalists) /datum/antagonist/loyalists id = MODE_LOYALIST @@ -33,7 +33,7 @@ var/datum/antagonist/loyalists/loyalists /datum/antagonist/loyalists/New() ..() - loyalists = src + GLOB.loyalists = src /datum/antagonist/loyalists/create_global_objectives() if(!..()) diff --git a/code/game/antagonist/station/renegade.dm b/code/game/antagonist/station/renegade.dm index 97ef184f47c..5822530d001 100644 --- a/code/game/antagonist/station/renegade.dm +++ b/code/game/antagonist/station/renegade.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/renegade/renegades +GLOBAL_DATUM(renegades, /datum/antagonist/renegade) /datum/antagonist/renegade role_text = "Renegade" @@ -15,7 +15,7 @@ var/datum/antagonist/renegade/renegades /datum/antagonist/renegade/New() ..() - renegades = src + GLOB.renegades = src /datum/antagonist/renegade/can_become_antag(var/datum/mind/player, var/ignore_role) if(..()) @@ -45,4 +45,4 @@ var/datum/antagonist/renegade/renegades for(var/mob/living/carbon/human/H in GLOB.player_list) if(H.stat == 2 || !(H.client)) continue if(is_special_character(H)) continue - renegades.add_antagonist(H.mind) + GLOB.renegades.add_antagonist(H.mind) diff --git a/code/game/antagonist/station/revolutionary.dm b/code/game/antagonist/station/revolutionary.dm index 87ec2a6c03e..5282ac0941b 100644 --- a/code/game/antagonist/station/revolutionary.dm +++ b/code/game/antagonist/station/revolutionary.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/revolutionary/revs +GLOBAL_DATUM(revs, /datum/antagonist/revolutionary) /datum/antagonist/revolutionary id = MODE_REVOLUTIONARY @@ -32,7 +32,7 @@ var/datum/antagonist/revolutionary/revs /datum/antagonist/revolutionary/New() ..() - revs = src + GLOB.revs = src /datum/antagonist/revolutionary/create_antagonist() faction_welcome = "You joined a subversive organization in the crew of the [SSatlas.current_map.station_name]. United under a forward-thinking leader, you must achieve their goals." diff --git a/code/game/antagonist/station/rogue_ai.dm b/code/game/antagonist/station/rogue_ai.dm index 1b00c74fc75..75068cfdf66 100644 --- a/code/game/antagonist/station/rogue_ai.dm +++ b/code/game/antagonist/station/rogue_ai.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/rogue_ai/malf +GLOBAL_DATUM(malf, /datum/antagonist/rogue_ai) /datum/antagonist/rogue_ai id = MODE_MALFUNCTION @@ -21,7 +21,7 @@ var/datum/antagonist/rogue_ai/malf /datum/antagonist/rogue_ai/New() ..() victory_text = "The AI has taken control of all of the [station_name(TRUE)]'s systems." - malf = src + GLOB.malf = src /datum/antagonist/rogue_ai/build_candidate_list() diff --git a/code/game/antagonist/station/thrall.dm b/code/game/antagonist/station/thrall.dm index 0dda23f28ef..c42a8967220 100644 --- a/code/game/antagonist/station/thrall.dm +++ b/code/game/antagonist/station/thrall.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/thrall/thralls = null +GLOBAL_DATUM(thralls, /datum/antagonist/thrall) /datum/antagonist/thrall id = MODE_THRALL @@ -24,7 +24,7 @@ var/datum/antagonist/thrall/thralls = null /datum/antagonist/thrall/New() ..() - thralls = src + GLOB.thralls = src /datum/antagonist/thrall/handle_latelogin(var/mob/user) var/datum/mind/M = user.mind diff --git a/code/game/antagonist/station/traitor.dm b/code/game/antagonist/station/traitor.dm index f2b0d68328e..694fe3a00ca 100644 --- a/code/game/antagonist/station/traitor.dm +++ b/code/game/antagonist/station/traitor.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/traitor/traitors +GLOBAL_DATUM(traitors, /datum/antagonist/traitor) // Inherits most of its vars from the base datum. /datum/antagonist/traitor @@ -13,7 +13,7 @@ var/datum/antagonist/traitor/traitors /datum/antagonist/traitor/New() ..() - traitors = src + GLOB.traitors = src /datum/antagonist/traitor/get_extra_panel_options(var/datum/mind/player) return "\[set crystals\]\[spawn uplink\]" diff --git a/code/game/antagonist/station/vampire.dm b/code/game/antagonist/station/vampire.dm index 977d381ec4f..d9962b13ab8 100644 --- a/code/game/antagonist/station/vampire.dm +++ b/code/game/antagonist/station/vampire.dm @@ -1,4 +1,4 @@ -var/datum/antagonist/vampire/vamp = null +GLOBAL_DATUM(vamp, /datum/antagonist/vampire) /datum/antagonist/vampire id = MODE_VAMPIRE @@ -31,10 +31,10 @@ var/datum/antagonist/vampire/vamp = null /datum/antagonist/vampire/New() ..() - vamp = src + GLOB.vamp = src - for (var/type in vampirepower_types) - vampirepowers += new type() + for (var/type in GLOB.vampirepower_types) + GLOB.vampirepowers += new type() vampire_data = {"

This guide contains important OOC information on vampire related mechanics, as well as a short lore introduction.

@@ -52,7 +52,7 @@ var/datum/antagonist/vampire/vamp = null
"} - for(var/thing in vampirepowers) + for(var/thing in GLOB.vampirepowers) var/datum/power/vampire/VP = thing vampire_data += "
" vampire_data += "[capitalize_first_letters(VP.name)]: [VP.desc]
" @@ -77,7 +77,7 @@ var/datum/antagonist/vampire/vamp = null . = ..() if(.) remove_verb(player.current, /datum/antagonist/vampire/proc/vampire_help) - for(var/datum/power/vampire/P in vampirepowers) + for(var/datum/power/vampire/P in GLOB.vampirepowers) remove_verb(player.current, P.verbpath) else // something went wrong when removing the antag status, readd them @@ -113,6 +113,6 @@ var/datum/antagonist/vampire/vamp = null set desc = "Opens a help window with overview of available powers and other important information." var/datum/browser/vampire_win = new(usr, "VampirePowers", "The Veil", 600, 700) - vampire_win.set_content(vamp.vampire_data) + vampire_win.set_content(GLOB.vamp.vampire_data) vampire_win.add_stylesheet("cult", 'html/browser/cult.css') vampire_win.open() diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index fb7459e6379..90e5eabb6d3 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -7,7 +7,7 @@ #define VOLUME_MUSIC 30 /// This list of names is here to make sure we don't state the area blurb to a mob more than once. -var/global/list/area_blurb_stated_to = list() +GLOBAL_LIST_INIT(area_blurb_stated_to, list()) /area var/global/global_uid = 0 @@ -186,9 +186,9 @@ var/global/list/area_blurb_stated_to = list() /area/proc/atmosalert(danger_level, var/alarm_source) if (danger_level == 0) - atmosphere_alarm.clearAlarm(src, alarm_source) + GLOB.atmosphere_alarm.clearAlarm(src, alarm_source) else - atmosphere_alarm.triggerAlarm(src, alarm_source, severity = danger_level) + GLOB.atmosphere_alarm.triggerAlarm(src, alarm_source, severity = danger_level) //Check all the alarms before lowering atmosalm. Raising is perfectly fine. for (var/obj/machinery/alarm/AA in src) @@ -532,8 +532,8 @@ var/global/list/area_blurb_stated_to = list() to_chat(target_mob, EXAMINE_BLOCK_GREY("There's nothing particularly noteworthy about this area.")) return - if(!(target_mob.ckey in global.area_blurb_stated_to[area_blurb_category]) || override) - LAZYADD(global.area_blurb_stated_to[area_blurb_category], target_mob.ckey) + if(!(target_mob.ckey in GLOB.area_blurb_stated_to[area_blurb_category]) || override) + LAZYADD(GLOB.area_blurb_stated_to[area_blurb_category], target_mob.ckey) to_chat(target_mob, EXAMINE_BLOCK_GREY(area_blurb)) /// A verb to view an area's blurb on demand. Overrides the check for if you have seen the blurb before so you can always see it when used. diff --git a/code/game/gamemodes/antagspawner.dm b/code/game/gamemodes/antagspawner.dm index f7f69c94173..3e6c4a04823 100644 --- a/code/game/gamemodes/antagspawner.dm +++ b/code/game/gamemodes/antagspawner.dm @@ -84,7 +84,7 @@ G.preEquipOutfit(outfit_type, FALSE) G.equipOutfit(outfit_type, FALSE) - technomancers.add_antagonist(G.mind, FALSE, TRUE, FALSE, FALSE, preserve_appearance) + GLOB.technomancers.add_antagonist(G.mind, FALSE, TRUE, FALSE, FALSE, preserve_appearance) G.client.init_verbs() diff --git a/code/game/gamemodes/changeling/helpers/_framework.dm b/code/game/gamemodes/changeling/helpers/_framework.dm index ffb800e54e1..5bb8da8da8e 100644 --- a/code/game/gamemodes/changeling/helpers/_framework.dm +++ b/code/game/gamemodes/changeling/helpers/_framework.dm @@ -1,4 +1,4 @@ -var/global/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") +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")) /datum/changeling //stores changeling powers, changeling recharge thingie, changeling absorbed DNA and changeling ID (for changeling hivemind) var/list/datum/absorbed_dna/absorbed_dna = list() @@ -26,9 +26,9 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E /datum/changeling/New(var/gender=FEMALE) ..() var/honorific = (gender == FEMALE) ? "Ms." : "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)]" diff --git a/code/game/gamemodes/changeling/implements/hivemind.dm b/code/game/gamemodes/changeling/implements/hivemind.dm index 430c36f4714..703fa5117aa 100644 --- a/code/game/gamemodes/changeling/implements/hivemind.dm +++ b/code/game/gamemodes/changeling/implements/hivemind.dm @@ -63,7 +63,7 @@ var/mob/living/simple_animal/hostile/morph/M = new /mob/living/simple_animal/hostile/morph(get_turf(changeling_mob)) M.stop_thinking = TRUE // prevent the AI from taking over when the player ghosts M.ckey = ckey - morphs.add_antagonist(M.mind, TRUE, TRUE, FALSE, TRUE, TRUE) + GLOB.morphs.add_antagonist(M.mind, TRUE, TRUE, FALSE, TRUE, TRUE) var/datum/changeling/changeling = changeling_mob.mind.antag_datums[MODE_CHANGELING] changeling.hivemind_members -= src diff --git a/code/game/gamemodes/changeling/implements/powers/resources.dm b/code/game/gamemodes/changeling/implements/powers/resources.dm index 0b58cf77a55..8c6c9e2ebe2 100644 --- a/code/game/gamemodes/changeling/implements/powers/resources.dm +++ b/code/game/gamemodes/changeling/implements/powers/resources.dm @@ -26,7 +26,7 @@ // HIVE MIND UPLOAD/DOWNLOAD DNA -var/list/datum/absorbed_dna/hivemind_bank = list() +GLOBAL_LIST_INIT_TYPED(hivemind_bank, /datum/absorbed_dna, list()) /mob/proc/changeling_hiveupload() set category = "Changeling" @@ -40,7 +40,7 @@ var/list/datum/absorbed_dna/hivemind_bank = list() var/list/names = list() for(var/datum/absorbed_dna/DNA in changeling.absorbed_dna) var/valid = TRUE - for(var/datum/absorbed_dna/DNB in hivemind_bank) + for(var/datum/absorbed_dna/DNB in GLOB.hivemind_bank) if(DNA.name == DNB.name) valid = FALSE break @@ -60,7 +60,7 @@ var/list/datum/absorbed_dna/hivemind_bank = list() return changeling.use_charges(10) - hivemind_bank += chosen_dna + GLOB.hivemind_bank += chosen_dna to_chat(src, SPAN_NOTICE("We channel the DNA of [S] to the air.")) feedback_add_details("changeling_powers", "HU") return TRUE @@ -75,7 +75,7 @@ var/list/datum/absorbed_dna/hivemind_bank = list() return var/list/names = list() - for(var/datum/absorbed_dna/DNA in hivemind_bank) + for(var/datum/absorbed_dna/DNA in GLOB.hivemind_bank) if(!(changeling.GetDNA(DNA.name))) names[DNA.name] = DNA diff --git a/code/game/gamemodes/cult/cultify/mob.dm b/code/game/gamemodes/cult/cultify/mob.dm index e154bea17a3..7a303018c70 100644 --- a/code/game/gamemodes/cult/cultify/mob.dm +++ b/code/game/gamemodes/cult/cultify/mob.dm @@ -28,7 +28,7 @@ G.set_invisibility(0) to_chat(G, SPAN_DANGER("You feel relieved as what's left of your soul finally escapes its prison of flesh.")) - cult.harvested += G.mind + GLOB.cult.harvested += G.mind else dust() diff --git a/code/game/gamemodes/cult/narsie.dm b/code/game/gamemodes/cult/narsie.dm index cbf39a0a143..85157866093 100644 --- a/code/game/gamemodes/cult/narsie.dm +++ b/code/game/gamemodes/cult/narsie.dm @@ -1,5 +1,5 @@ -var/global/narsie_behaviour = "CultStation13" -var/global/narsie_cometh = 0 +GLOBAL_VAR_INIT(narsie_behaviour, "CultStation13") +GLOBAL_VAR_INIT(narsie_cometh, 0) GLOBAL_LIST_EMPTY(narsie_list) /obj/singularity/narsie //Moving narsie to its own file for the sake of being clearer @@ -51,15 +51,15 @@ GLOBAL_LIST_EMPTY(narsie_list) log_and_message_admins("Narsie has been spawned.", location = get_turf(loc)) - if(!narsie_cometh)//so we don't initiate Hell more than one time. + if(!GLOB.narsie_cometh)//so we don't initiate Hell more than one time. if(cause_hell) SetUniversalState(/datum/universal_state/hell) - narsie_cometh = 1 + GLOB.narsie_cometh = 1 spawn(10 SECONDS) - if(evacuation_controller) - evacuation_controller.call_evacuation(null, TRANSFER_EMERGENCY, 1) - evacuation_controller.evac_no_return = 0 // Cannot recall + if(GLOB.evacuation_controller) + GLOB.evacuation_controller.call_evacuation(null, TRANSFER_EMERGENCY, 1) + GLOB.evacuation_controller.evac_no_return = 0 // Cannot recall /obj/singularity/narsie/process() eat() @@ -185,12 +185,12 @@ GLOBAL_LIST_EMPTY(narsie_list) /obj/singularity/narsie/large/consume(const/atom/A) //Has its own consume proc because it doesn't need energy and I don't want BoHs to explode it. --NEO //NEW BEHAVIOUR - if(narsie_behaviour == "CultStation13") + if(GLOB.narsie_behaviour == "CultStation13") //MOB PROCESSING new_narsie(A) //OLD BEHAVIOUR - else if(narsie_behaviour == "Nar-Singulo") + else if(GLOB.narsie_behaviour == "Nar-Singulo") old_narsie(A) /obj/singularity/narsie/proc/new_narsie(const/atom/A) @@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(narsie_list) /obj/singularity/narsie/proc/pickcultist() //Narsie rewards his cultists with being devoured first, then picks a ghost to follow. --NEO var/list/cultists = list() - for(var/datum/mind/cult_nh_mind in cult.current_antagonists) + for(var/datum/mind/cult_nh_mind in GLOB.cult.current_antagonists) if(!cult_nh_mind.current) continue if(cult_nh_mind.current.stat) diff --git a/code/game/gamemodes/cult/runes/armor.dm b/code/game/gamemodes/cult/runes/armor.dm index 55dd2b6932b..90ed4cf5c38 100644 --- a/code/game/gamemodes/cult/runes/armor.dm +++ b/code/game/gamemodes/cult/runes/armor.dm @@ -10,7 +10,7 @@ if(istype(user, /mob/living/simple_animal/construct)) var/mob/living/simple_animal/construct/C = user var/construct_class - if(narsie_cometh) + if(GLOB.narsie_cometh) construct_class = alert(C, "Please choose which type of construct you wish to become.", "Construct Selection", "Juggernaut", "Wraith", "Harvester") else construct_class = alert(C, "Please choose which type of construct you wish to become.", "Construct Selection", "Juggernaut", "Wraith", "Artificer") @@ -25,7 +25,7 @@ Z.health = Z.health * (C.health / C.maxHealth) Z.key = C.key if(iscultist(C)) - cult.add_antagonist(Z.mind) + GLOB.cult.add_antagonist(Z.mind) C.death() construct_msg(Z, construct_class) Z.cancel_camera() diff --git a/code/game/gamemodes/cult/runes/convert.dm b/code/game/gamemodes/cult/runes/convert.dm index c40bbfcca4b..e73cda06774 100644 --- a/code/game/gamemodes/cult/runes/convert.dm +++ b/code/game/gamemodes/cult/runes/convert.dm @@ -74,7 +74,7 @@ if(!waiting_for_input[target]) //so we don't spam them with dialogs if they hesitate waiting_for_input[target] = TRUE - if(!cult.can_become_antag(target.mind) || player_is_antag(target.mind)) + if(!GLOB.cult.can_become_antag(target.mind) || player_is_antag(target.mind)) if(jobban_isbanned(target.mind, "cultist")) shard_player(target, A) else @@ -87,7 +87,7 @@ waiting_for_input[target] = FALSE switch(choice) if("Submit") - cult.add_antagonist(target.mind, do_not_equip) + GLOB.cult.add_antagonist(target.mind, do_not_equip) converting -= target target.hallucination = 0 //sudden clarity target.setBrainLoss(0) // nar'sie heals you diff --git a/code/game/gamemodes/cult/runes/free_cultist.dm b/code/game/gamemodes/cult/runes/free_cultist.dm index 171002794f0..9ba7b1ebfec 100644 --- a/code/game/gamemodes/cult/runes/free_cultist.dm +++ b/code/game/gamemodes/cult/runes/free_cultist.dm @@ -5,7 +5,7 @@ /datum/rune/freedom/do_rune_action(mob/living/user, atom/movable/A) var/list/mob/living/carbon/human/cultists = list() - for(var/datum/mind/H in cult.current_antagonists) + for(var/datum/mind/H in GLOB.cult.current_antagonists) if(ishuman(H.current)) cultists += H.current diff --git a/code/game/gamemodes/cult/runes/manifest_ghost.dm b/code/game/gamemodes/cult/runes/manifest_ghost.dm index daf01f9786d..e7e0a5dcbb7 100644 --- a/code/game/gamemodes/cult/runes/manifest_ghost.dm +++ b/code/game/gamemodes/cult/runes/manifest_ghost.dm @@ -49,7 +49,7 @@ apparition.universal_speak = TRUE apparition.all_underwear.Cut() apparition.key = ghost.key - cult.add_antagonist(apparition.mind) + GLOB.cult.add_antagonist(apparition.mind) playsound(get_turf(A), 'sound/magic/exit_blood.ogg', 100, 1) if(!chose_name) diff --git a/code/game/gamemodes/cult/runes/raise_dead.dm b/code/game/gamemodes/cult/runes/raise_dead.dm index 6000f969151..9d18ef7b146 100644 --- a/code/game/gamemodes/cult/runes/raise_dead.dm +++ b/code/game/gamemodes/cult/runes/raise_dead.dm @@ -10,7 +10,7 @@ var/is_sacrifice_target for(var/mob/living/carbon/human/M in get_turf(A)) if(M.stat == DEAD) - if(M.mind == cult?.sacrifice_target) + if(M.mind == GLOB.cult?.sacrifice_target) is_sacrifice_target = TRUE else corpse_to_raise = M @@ -26,7 +26,7 @@ for(var/datum/rune/R in SScult.rune_list) var/found_sacrifice = FALSE for(var/mob/living/carbon/human/N in get_turf(R.parent)) - if(N?.mind == cult?.sacrifice_target) + if(N?.mind == GLOB.cult?.sacrifice_target) is_sacrifice_target = TRUE else if(N.stat != DEAD) diff --git a/code/game/gamemodes/cult/runes/sacrifice.dm b/code/game/gamemodes/cult/runes/sacrifice.dm index bc7e2ff9782..6df1c7fd17b 100644 --- a/code/game/gamemodes/cult/runes/sacrifice.dm +++ b/code/game/gamemodes/cult/runes/sacrifice.dm @@ -38,9 +38,9 @@ var/output if(SSticker.mode.name == "Cult") - if(H.mind == cult.sacrifice_target) + if(H.mind == GLOB.cult.sacrifice_target) if(cultists_in_range.len >= 3) - cult.sacrificed += H.mind + GLOB.cult.sacrificed += H.mind if(isrobot(H)) H.dust() // To prevent the MMI from remaining else diff --git a/code/game/gamemodes/cult/runes/summon_cultist.dm b/code/game/gamemodes/cult/runes/summon_cultist.dm index 9543f8eaed2..799aeec56f3 100644 --- a/code/game/gamemodes/cult/runes/summon_cultist.dm +++ b/code/game/gamemodes/cult/runes/summon_cultist.dm @@ -5,7 +5,7 @@ /datum/rune/summon_cultist/do_rune_action(mob/living/user, atom/movable/A) var/list/mob/living/carbon/cultists = list() - for(var/datum/mind/H in cult.current_antagonists) + for(var/datum/mind/H in GLOB.cult.current_antagonists) if(iscarbon(H.current)) cultists += H.current diff --git a/code/game/gamemodes/cult/runes/summon_narsie.dm b/code/game/gamemodes/cult/runes/summon_narsie.dm index 61ad02552e8..6d79b5ed7c0 100644 --- a/code/game/gamemodes/cult/runes/summon_narsie.dm +++ b/code/game/gamemodes/cult/runes/summon_narsie.dm @@ -4,7 +4,7 @@ rune_flags = NO_TALISMAN /datum/rune/summon_narsie/do_rune_action(mob/living/user, atom/movable/A) - if(!cult.allow_narsie) + if(!GLOB.cult.allow_narsie) return fizzle(user, A) var/turf/T = get_turf(A) @@ -25,7 +25,7 @@ new /obj/singularity/narsie/large(get_turf(A)) // Can't summon a singular entity twice. - cult.allow_narsie = FALSE + GLOB.cult.allow_narsie = FALSE return else for(var/mob/M in cultists) diff --git a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm index a3d812aaab4..2c4ef0f095a 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/universe.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/universe.dm @@ -1,4 +1,4 @@ -var/global/universe_has_ended = 0 +GLOBAL_VAR_INIT(universe_has_ended, 0) /datum/universal_state/supermatter_cascade @@ -45,7 +45,7 @@ var/global/universe_has_ended = 0 for(var/mob/M in GLOB.player_list) M.flash_act() - if(evacuation_controller.cancel_evacuation()) + if(GLOB.evacuation_controller.cancel_evacuation()) priority_announcement.Announce("The evacuation has been aborted due to bluespace distortion.") SSskybox.change_skybox("cascade", new_use_stars = FALSE, new_use_overmap_details = FALSE) @@ -56,7 +56,7 @@ var/global/universe_has_ended = 0 OverlayAndAmbientSet() // Disable Nar-Sie. - cult.allow_narsie = 0 + GLOB.cult.allow_narsie = 0 PlayerSet() @@ -87,7 +87,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked /datum/universal_state/supermatter_cascade/proc/end_universe() SSticker.station_explosion_cinematic(0, null, SSatlas.current_map.player_levels) // TODO: Custom cinematic - universe_has_ended = 1 + GLOB.universe_has_ended = 1 /datum/universal_state/supermatter_cascade/proc/AreaSet() for(var/area/A in get_sorted_areas()) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 71576228dea..699eb272af3 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -1,6 +1,3 @@ -var/eventchance = 10 // Percent chance per 5 minutes. -var/hadevent = 0 - //Changing this to affect the main station. Blame Urist. --Pete /proc/prison_break() // -- Callagan diff --git a/code/game/gamemodes/events/holidays/holidays.dm b/code/game/gamemodes/events/holidays/holidays.dm index 86059e5999a..c305b51a8fc 100644 --- a/code/game/gamemodes/events/holidays/holidays.dm +++ b/code/game/gamemodes/events/holidays/holidays.dm @@ -191,12 +191,3 @@ var/global/Holiday = null Christmas_Game_Start() return - -//Nested in the random events loop. Will be triggered every 2 minutes. -/proc/Holiday_Random_Event() - switch(Holiday) //special holidays - - if("",null) //no Holiday today! Back to work! - return - if("Christmas","Christmas Eve") - if(prob(eventchance)) ChristmasEvent() diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 876c5334886..b54a5d8dac1 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -1,4 +1,3 @@ -var/global/antag_add_failed // Used in antag type voting. GLOBAL_LIST_EMPTY(additional_antag_types) /datum/game_mode @@ -288,8 +287,8 @@ GLOBAL_LIST_EMPTY(additional_antag_types) if(!(antag.flags & ANTAG_NO_ROUNDSTART_SPAWN)) antag.finalize_spawn() //actually spawn antags - if(evacuation_controller && auto_recall_shuttle) - evacuation_controller.auto_recall(1) + if(GLOB.evacuation_controller && auto_recall_shuttle) + GLOB.evacuation_controller.auto_recall(1) feedback_set_details("round_start","[time2text(world.realtime)]") if(SSticker.mode) @@ -339,7 +338,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) command_announcement.Announce("The presence of [pick(reasons)] in the region is tying up all available local emergency resources; emergency response teams cannot be called at this time, and post-evacuation recovery efforts will be substantially delayed.","Emergency Transmission") /datum/game_mode/proc/check_finished() - return evacuation_controller.round_over() || station_was_nuked + return GLOB.evacuation_controller.round_over() || station_was_nuked /datum/game_mode/proc/cleanup() //This is called when the round has ended but not the game, if any cleanup would be necessary in that case. return @@ -390,7 +389,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) var/text = "" var/escape_text - if(evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) + if(GLOB.evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) escape_text = "escaped" else escape_text = "transfered" @@ -488,7 +487,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) antag_templates |= antag shuffle(antag_templates) //In the case of multiple antag types - newscaster_announcements = pick(newscaster_standard_feeds) + newscaster_announcements = pick(GLOB.newscaster_standard_feeds) /datum/game_mode/proc/check_victory() return diff --git a/code/game/gamemodes/game_mode_latespawn.dm b/code/game/gamemodes/game_mode_latespawn.dm index 94785300222..93fb9881f94 100644 --- a/code/game/gamemodes/game_mode_latespawn.dm +++ b/code/game/gamemodes/game_mode_latespawn.dm @@ -6,7 +6,7 @@ ///process() ///Called by the gameticker /datum/game_mode/process() - if(round_autoantag && world.time >= next_spawn && !evacuation_controller.round_over()) + if(round_autoantag && world.time >= next_spawn && !GLOB.evacuation_controller.round_over()) process_autoantag() // Process loop for objectives like the brig one. @@ -21,7 +21,7 @@ /datum/game_mode/proc/process_autoantag() message_admins("[uppertext(name)]: Attempting autospawn.") - if(evacuation_controller.is_evacuating()) + if(GLOB.evacuation_controller.is_evacuating()) message_admins("[uppertext(name)]: An evac or transfer shuttle is on the way. Aborted.") next_spawn = world.time + min_autotraitor_delay return diff --git a/code/game/gamemodes/meteor/meteor.dm b/code/game/gamemodes/meteor/meteor.dm index 8051b76fb8d..5985a4b40fe 100644 --- a/code/game/gamemodes/meteor/meteor.dm +++ b/code/game/gamemodes/meteor/meteor.dm @@ -50,7 +50,7 @@ alert_sent = 2 command_announcement.Announce(start_text, alert_title) if(SSatlas.current_map.use_overmap) - var/area/map = global.map_overmap + var/area/map = GLOB.map_overmap for(var/turf/T in map) new/obj/effect/overmap/event/meteor(T) next_wave = round_duration_in_ticks + meteor_wave_delay diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 7549fcacdba..3325cc3032d 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -2,7 +2,7 @@ MERCENARY ROUNDTYPE */ -var/list/nuke_disks = list() +GLOBAL_LIST_INIT_TYPED(nuke_disks, /obj/item/disk/nuclear, list()) /datum/game_mode/nuclear name = "Mercenary" @@ -23,13 +23,13 @@ var/list/nuke_disks = list() //delete all nuke disks not on a station zlevel /datum/game_mode/nuclear/proc/check_nuke_disks() - for(var/obj/item/disk/nuclear/N in nuke_disks) + for(var/obj/item/disk/nuclear/N in GLOB.nuke_disks) var/turf/T = get_turf(N) if(!is_station_level(T.z)) qdel(N) //checks if L has a nuke disk on their person /datum/game_mode/nuclear/proc/check_mob(mob/living/L) - for(var/obj/item/disk/nuclear/N in nuke_disks) + for(var/obj/item/disk/nuclear/N in GLOB.nuke_disks) if(N.storage_depth(L) >= 0) return 1 return 0 @@ -39,12 +39,12 @@ var/list/nuke_disks = list() ..() return var/disk_rescued = 1 - for(var/obj/item/disk/nuclear/D in nuke_disks) + for(var/obj/item/disk/nuclear/D in GLOB.nuke_disks) var/disk_area = get_area(D) if(!is_type_in_list(disk_area, GLOB.centcom_areas)) disk_rescued = 0 break - var/crew_evacuated = (evacuation_controller.round_over()) + var/crew_evacuated = (GLOB.evacuation_controller.round_over()) if(!disk_rescued && station_was_nuked && !syndies_didnt_escape) feedback_set_details("round_end_result","win - syndicate nuke") @@ -66,7 +66,7 @@ var/list/nuke_disks = list() to_world("[syndicate_name()] operatives have earned Darwin Award!") to_world("[syndicate_name()] operatives blew up something that wasn't [station_name()] and got caught in the explosion. Next time, don't lose the disk!") - else if (disk_rescued && mercs.antags_are_dead()) + else if (disk_rescued && GLOB.mercs.antags_are_dead()) feedback_set_details("round_end_result","loss - evacuation - disk secured - syndi team dead") to_world("Crew Major Victory!") to_world("The Research Staff has saved the disc and killed the [syndicate_name()] Operatives") @@ -76,7 +76,7 @@ var/list/nuke_disks = list() to_world("Crew Major Victory") to_world("The Research Staff has saved the disc and stopped the [syndicate_name()] Operatives!") - else if (!disk_rescued && mercs.antags_are_dead()) + else if (!disk_rescued && GLOB.mercs.antags_are_dead()) feedback_set_details("round_end_result","loss - evacuation - disk not secured") to_world("Mercenary Minor Victory!") to_world("The Research Staff failed to secure the authentication disk but did manage to kill most of the [syndicate_name()] Operatives!") diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index 5a34d30044d..0b3eabd4180 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -246,7 +246,7 @@ if(mode) //Check in case the mode changes while operating worklocation() return - if(bomb_set) //If the bomb is set, lead to the shuttle + if(GLOB.bomb_set) //If the bomb is set, lead to the shuttle mode = 1 //Ensures worklocation() continues to work worklocation() playsound(loc, 'sound/machines/twobeep.ogg', 50, 1) //Plays a beep @@ -276,7 +276,7 @@ if(!mode) workdisk() return - if(!bomb_set) + if(!GLOB.bomb_set) mode = 0 workdisk() playsound(loc, 'sound/machines/twobeep.ogg', 50, 1) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 1245b34cb6f..86565bd0d84 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -235,7 +235,7 @@ GLOBAL_LIST_EMPTY(process_objectives) /datum/objective/hijack/check_completion() if(!owner.current || owner.current.stat) return 0 - if(!evacuation_controller.round_over()) + if(!GLOB.evacuation_controller.round_over()) return 0 if(issilicon(owner.current)) return 0 @@ -257,7 +257,7 @@ GLOBAL_LIST_EMPTY(process_objectives) /datum/objective/block/check_completion() if(!istype(owner.current, /mob/living/silicon)) return 0 - if(!evacuation_controller.round_over()) + if(!GLOB.evacuation_controller.round_over()) return 0 if(!owner.current) return 0 @@ -275,7 +275,7 @@ GLOBAL_LIST_EMPTY(process_objectives) explanation_text = "Do not allow anyone to escape the [station_name()]. Only allow the shuttle to be called when everyone is dead and your story is the only one left." /datum/objective/silence/check_completion() - if(!evacuation_controller.round_over()) + if(!GLOB.evacuation_controller.round_over()) return 0 for(var/mob/living/player in GLOB.player_list) @@ -300,7 +300,7 @@ GLOBAL_LIST_EMPTY(process_objectives) return 0 if(isbrain(owner.current)) return 0 - if(!evacuation_controller.round_over()) + if(!GLOB.evacuation_controller.round_over()) return 0 if(!owner.current || owner.current.stat ==2) return 0 @@ -713,7 +713,7 @@ GLOBAL_LIST_EMPTY(process_objectives) if(istype(I,target)) total_amount++ if(total_amount >= target_amount) return 1 - for(var/datum/mind/raider in raiders.current_antagonists) + for(var/datum/mind/raider in GLOB.raiders.current_antagonists) if(raider.current) for(var/obj/O in raider.current.get_contents()) if(istype(O,target)) total_amount++ @@ -768,7 +768,7 @@ GLOBAL_LIST_EMPTY(process_objectives) S = I total_amount += S.get_amount() - for(var/datum/mind/raider in raiders.current_antagonists) + for(var/datum/mind/raider in GLOB.raiders.current_antagonists) if(raider.current) for(var/obj/item/O in raider.current.get_contents()) if(istype(O,/obj/item/stack/material)) @@ -784,7 +784,7 @@ GLOBAL_LIST_EMPTY(process_objectives) explanation_text = "Do not leave anyone behind, alive or dead." /datum/objective/heist/preserve_crew/check_completion() - if(raiders && raiders.is_raider_crew_safe()) return 1 + if(GLOB.raiders?.is_raider_crew_safe()) return 1 return 0 //Borer objective(s). @@ -827,9 +827,9 @@ GLOBAL_LIST_EMPTY(process_objectives) /datum/objective/cult/survive/check_completion() var/acolytes_survived = 0 - if(!cult) + if(!GLOB.cult) return 0 - for(var/datum/mind/cult_mind in cult.current_antagonists) + for(var/datum/mind/cult_mind in GLOB.cult.current_antagonists) if (cult_mind.current && cult_mind.current.stat!=2) var/area/A = get_area(cult_mind.current ) if ( is_type_in_list(A, GLOB.centcom_areas)) @@ -852,14 +852,14 @@ GLOBAL_LIST_EMPTY(process_objectives) var/list/possible_targets = list() if(!possible_targets.len) for(var/mob/living/carbon/human/player in GLOB.player_list) - if(player.mind && !(player.mind in cult)) + if(player.mind && !(player.mind in GLOB.cult)) possible_targets += player.mind if(possible_targets.len > 0) target = pick(possible_targets) if(target) explanation_text = "Sacrifice [target.name], the [target.assigned_role]. You will need the sacrifice rune and three acolytes to do so." /datum/objective/cult/sacrifice/check_completion() - return (target && cult && !cult.sacrificed.Find(target)) + return (target && GLOB.cult && !GLOB.cult.sacrificed.Find(target)) /datum/objective/rev/find_target() ..() @@ -887,7 +887,7 @@ GLOBAL_LIST_EMPTY(process_objectives) if(H.stat == DEAD || H.restrained()) return 1 // Check if they're converted - if(target in revs.current_antagonists) + if(target in GLOB.revs.current_antagonists) return 1 var/turf/T = get_turf(H) if(T && !is_station_level(T.z)) //If they leave the station they count as dead for this diff --git a/code/game/gamemodes/technomancer/assistance/assistance.dm b/code/game/gamemodes/technomancer/assistance/assistance.dm index e4e8888b322..c9e8999316a 100644 --- a/code/game/gamemodes/technomancer/assistance/assistance.dm +++ b/code/game/gamemodes/technomancer/assistance/assistance.dm @@ -47,7 +47,7 @@ if(!ishuman(user) || !user.mind) return // since this gives us a catalogue with more points than it costs, prevent the antag from farming points by using this - if(technomancers.is_technomancer(user.mind)) + if(GLOB.technomancers.is_technomancer(user.mind)) to_chat(user, SPAN_WARNING("You're already in the fold, you can't use this!")) return var/turf/user_turf = get_turf(user) @@ -57,7 +57,7 @@ var/initiate_welcome_text = "You will need to purchase functions and perhaps some equipment from your initiate's catalogue. \ Choose your technological arsenal carefully. Remember that without the core on your wrist, your functions are \ powerless, and therefore you will be as well." - technomancers.add_antagonist_mind(user.mind, 1, "Technomancer Initiate", initiate_welcome_text) + GLOB.technomancers.add_antagonist_mind(user.mind, 1, "Technomancer Initiate", initiate_welcome_text) if(user.wrists) user.drop_from_inventory(user.wrists, get_turf(user_turf)) var/obj/item/technomancer_core/bracelet/bracelet = new(user_turf) diff --git a/code/game/gamemodes/technomancer/catalog.dm b/code/game/gamemodes/technomancer/catalog.dm index 22421b34e40..f3b1ed92390 100644 --- a/code/game/gamemodes/technomancer/catalog.dm +++ b/code/game/gamemodes/technomancer/catalog.dm @@ -1,7 +1,7 @@ -var/list/all_technomancer_spells = typesof(/datum/technomancer/spell) - /datum/technomancer/spell -var/list/all_technomancer_equipment = typesof(/datum/technomancer/equipment) - /datum/technomancer/equipment -var/list/all_technomancer_consumables = typesof(/datum/technomancer/consumable) - /datum/technomancer/consumable -var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - /datum/technomancer/assistance +GLOBAL_LIST_INIT(all_technomancer_spells, (typesof(/datum/technomancer/spell) - /datum/technomancer/spell)) +GLOBAL_LIST_INIT(all_technomancer_equipment, (typesof(/datum/technomancer/equipment) - /datum/technomancer/equipment)) +GLOBAL_LIST_INIT(all_technomancer_consumables, (typesof(/datum/technomancer/consumable) - /datum/technomancer/consumable)) +GLOBAL_LIST_INIT(all_technomancer_assistance, (typesof(/datum/technomancer/assistance) - /datum/technomancer/assistance)) /datum/technomancer var/name = "technomancer thing" @@ -69,7 +69,7 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - // Parameters: 1 (new_owner - mob that the book is trying to bind to) // Description: Links the catalog to hopefully the technomancer, so that only they can access it. /obj/item/technomancer_catalog/proc/bind_to_owner(var/mob/living/carbon/human/new_owner) - if(!owner && technomancers.is_technomancer(new_owner.mind)) + if(!owner && GLOB.technomancers.is_technomancer(new_owner.mind)) owner = new_owner // Proc: New() @@ -84,17 +84,17 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - // Description: Instantiates all the catalog datums for everything that can be bought. /obj/item/technomancer_catalog/proc/set_up() if(!spell_instances.len) - for(var/S in all_technomancer_spells) + for(var/S in GLOB.all_technomancer_spells) spell_instances += new S() if(!equipment_instances.len) - for(var/E in all_technomancer_equipment) + for(var/E in GLOB.all_technomancer_equipment) equipment_instances += new E() if(!consumable_instances.len) - for(var/C in all_technomancer_consumables) + for(var/C in GLOB.all_technomancer_consumables) consumable_instances += new C() if(has_assistance_items) if(!assistance_instances.len) - for(var/A in all_technomancer_assistance) + for(var/A in GLOB.all_technomancer_assistance) assistance_instances += new A() // Proc: show_categories() @@ -342,7 +342,7 @@ var/list/all_technomancer_assistance = typesof(/datum/technomancer/assistance) - budget -= desired_object.cost to_chat(H, SPAN_NOTICE("You have just bought \a [desired_object.name].")) var/obj/O = new desired_object.obj_path(get_turf(H)) - technomancer_belongings.Add(O) // Used for the Track spell. + GLOB.technomancer_belongings.Add(O) // Used for the Track spell. else //Can't afford. to_chat(H, SPAN_DANGER("You can't afford that!")) diff --git a/code/game/gamemodes/technomancer/core_obj.dm b/code/game/gamemodes/technomancer/core_obj.dm index f32f8d75446..5ce4939c8ab 100644 --- a/code/game/gamemodes/technomancer/core_obj.dm +++ b/code/game/gamemodes/technomancer/core_obj.dm @@ -96,7 +96,7 @@ if(world.time % 5 == 0) // Maintaining fat lists is expensive, I imagine. maintain_summon_list() if(wearer && wearer.mind) - if(!technomancers.is_technomancer(wearer.mind)) // In case someone tries to wear a stolen core. + if(!GLOB.technomancers.is_technomancer(wearer.mind)) // In case someone tries to wear a stolen core. wearer.adjust_instability(20) if(!never_remove && (!wearer || wearer.stat == DEAD)) // Unlock if we're dead or not worn. canremove = TRUE @@ -152,7 +152,7 @@ if(picked != "Reset" && !ispath(chameleon_options[picked])) return - if(!usr.mind || !technomancers.is_technomancer(usr.mind)) + if(!usr.mind || !GLOB.technomancers.is_technomancer(usr.mind)) to_chat(usr, SPAN_WARNING("You have no idea how to do this!")) return diff --git a/code/game/gamemodes/technomancer/spell_objs.dm b/code/game/gamemodes/technomancer/spell_objs.dm index c41b91850dc..ca5a800aeb0 100644 --- a/code/game/gamemodes/technomancer/spell_objs.dm +++ b/code/game/gamemodes/technomancer/spell_objs.dm @@ -236,7 +236,7 @@ if(core.loc != owner || (owner.back != core && owner.wrists != core)) //Make sure the core's being worn. to_chat(owner, SPAN_DANGER("You need to be wearing a core on your back or your wrists!")) return FALSE - if(!core.simple_operation && !technomancers.is_technomancer(owner.mind)) //Now make sure the person using this is the actual antag. + if(!core.simple_operation && !GLOB.technomancers.is_technomancer(owner.mind)) //Now make sure the person using this is the actual antag. to_chat(owner, SPAN_DANGER("You can't seem to figure out how to make the machine work properly.")) return FALSE else diff --git a/code/game/gamemodes/technomancer/spell_objs_helpers.dm b/code/game/gamemodes/technomancer/spell_objs_helpers.dm index 5351299809b..8b8960f92e9 100644 --- a/code/game/gamemodes/technomancer/spell_objs_helpers.dm +++ b/code/game/gamemodes/technomancer/spell_objs_helpers.dm @@ -17,7 +17,7 @@ /obj/item/spell/proc/is_ally(var/mob/living/L) if(L == owner) // The best ally is ourselves. return 1 - if(L.mind && technomancers.is_technomancer(L.mind)) // This should be done better since we might want opposing technomancers later. + if(L.mind && GLOB.technomancers.is_technomancer(L.mind)) // This should be done better since we might want opposing technomancers later. return 1 if(istype(L, /mob/living/simple_animal/hostile)) // Mind controlled simple mobs count as allies too. var/mob/living/simple_animal/hostile/SM = L diff --git a/code/game/gamemodes/technomancer/spells/mark_recall.dm b/code/game/gamemodes/technomancer/spells/mark_recall.dm index 9f50e4fb986..89bead3c48e 100644 --- a/code/game/gamemodes/technomancer/spells/mark_recall.dm +++ b/code/game/gamemodes/technomancer/spells/mark_recall.dm @@ -17,7 +17,7 @@ anchored = 1 //This is global, to avoid looping through a list of all objects, or god forbid, looping through world. -/var/global/obj/effect/mark_spell/mark_spell_ref = null +GLOBAL_DATUM(mark_spell_ref, /obj/effect/mark_spell) /obj/item/spell/mark name = "mark" @@ -32,11 +32,11 @@ to_chat(user, SPAN_WARNING("You can't teleport here!")) return 0 if(pay_energy(1000)) - if(!mark_spell_ref) - mark_spell_ref = new(get_turf(user)) + if(!GLOB.mark_spell_ref) + GLOB.mark_spell_ref = new(get_turf(user)) to_chat(user, SPAN_NOTICE("You mark \the [get_turf(user)] under you.")) else - mark_spell_ref.forceMove(get_turf(user)) + GLOB.mark_spell_ref.forceMove(get_turf(user)) to_chat(user, SPAN_NOTICE("Your mark is moved from its old position to \the [get_turf(user)] under you.")) adjust_instability(5) return 1 @@ -66,7 +66,7 @@ /obj/item/spell/recall/on_use_cast(mob/living/user) . = ..() if(pay_energy(3000)) - if(!mark_spell_ref) + if(!GLOB.mark_spell_ref) to_chat(user, SPAN_DANGER("There's no Mark!")) return 0 else @@ -88,7 +88,7 @@ time_left-- sleep(1 SECOND) - var/turf/target_turf = get_turf(mark_spell_ref) + var/turf/target_turf = get_turf(GLOB.mark_spell_ref) var/turf/old_turf = get_turf(user) for(var/obj/item/grab/G in user.contents) // People the Technomancer is grabbing come along for the ride. diff --git a/code/game/gamemodes/technomancer/spells/track.dm b/code/game/gamemodes/technomancer/spells/track.dm index 98c5e08fda3..3135fa00441 100644 --- a/code/game/gamemodes/technomancer/spells/track.dm +++ b/code/game/gamemodes/technomancer/spells/track.dm @@ -8,9 +8,9 @@ ability_icon_state = "tech_track" category = UTILITY_SPELLS -// This stores a ref to all important items that belong to a Technomancer, in case of theft. Used by the spell below. -// I feel dirty for adding yet another global list used by one thing, but the only alternative is to loop through world, and yeahhh. -var/list/technomancer_belongings = list() +/// This stores a ref to all important items that belong to a Technomancer, in case of theft. Used by the spell below. +/// I feel dirty for adding yet another global list used by one thing, but the only alternative is to loop through world, and yeahhh. +GLOBAL_LIST_EMPTY_TYPED(technomancer_belongings, /obj) /obj/item/spell/track name = "track" @@ -35,7 +35,7 @@ var/list/technomancer_belongings = list() return var/can_track_non_allies = 0 - var/list/object_choices = technomancer_belongings.Copy() + var/list/object_choices = GLOB.technomancer_belongings.Copy() if(check_for_scepter()) can_track_non_allies = 1 var/list/mob_choices = list() diff --git a/code/game/gamemodes/vampire/modular_vampire.dm b/code/game/gamemodes/vampire/modular_vampire.dm index 369aab55006..99fc1d51788 100644 --- a/code/game/gamemodes/vampire/modular_vampire.dm +++ b/code/game/gamemodes/vampire/modular_vampire.dm @@ -1,5 +1,5 @@ -var/list/vampirepower_types = typesof(/datum/power/vampire) - /datum/power/vampire -var/list/datum/power/vampire/vampirepowers = list() +GLOBAL_LIST_INIT(vampirepower_types, (typesof(/datum/power/vampire) - /datum/power/vampire)) +GLOBAL_LIST_INIT_TYPED(vampirepowers, /list/datum/power/vampire, list()) /datum/power/vampire var/blood_cost = 0 diff --git a/code/game/gamemodes/vampire/vampire_helpers.dm b/code/game/gamemodes/vampire/vampire_helpers.dm index e32012f4455..475d3c1bc65 100644 --- a/code/game/gamemodes/vampire/vampire_helpers.dm +++ b/code/game/gamemodes/vampire/vampire_helpers.dm @@ -20,7 +20,7 @@ add_verb(src, /datum/antagonist/vampire/proc/vampire_help) - for(var/datum/power/vampire/P in vampirepowers) + for(var/datum/power/vampire/P in GLOB.vampirepowers) if(!(P in vampire.purchased_powers)) if(!P.blood_cost) vampire.add_power(mind, P, 0) @@ -35,7 +35,7 @@ if(!vampire) return - for (var/datum/power/vampire/P in vampirepowers) + for (var/datum/power/vampire/P in GLOB.vampirepowers) if (P.blood_cost <= vampire.blood_total) if (!(P in vampire.purchased_powers)) vampire.add_power(mind, P, 1) diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm index 0acdba9aa21..d85c065f563 100644 --- a/code/game/gamemodes/vampire/vampire_powers.dm +++ b/code/game/gamemodes/vampire/vampire_powers.dm @@ -761,7 +761,7 @@ return to_chat(T, SPAN_DANGER("Your mind blanks as you finish feeding from [src]'s wrist.")) - thralls.add_antagonist(T.mind, 1, 1, 0, 1, 1) + GLOB.thralls.add_antagonist(T.mind, 1, 1, 0, 1, 1) var/datum/vampire/T_vampire = T.mind.antag_datums[MODE_VAMPIRE] T_vampire.assign_master(T, src, vampire) @@ -915,7 +915,7 @@ to_chat(src, SPAN_NOTICE("[denial_response]")) return - thralls.remove_antagonist(T.mind, 0, 0) + GLOB.thralls.remove_antagonist(T.mind, 0, 0) qdel(draining_vamp) draining_vamp = null else @@ -956,7 +956,7 @@ to_chat(T, SPAN_DANGER("A dark force pushes you back into your body. You find yourself somehow still clinging to life.")) T.Weaken(15) - vamp.add_antagonist(T.mind, 1, 1, 0, 0, 1) + GLOB.vamp.add_antagonist(T.mind, 1, 1, 0, 0, 1) admin_attack_log(src, T, "successfully embraced [key_name(T)]", "was successfully embraced by [key_name(src)]", "successfully embraced and turned into a vampire") diff --git a/code/game/jobs/access.dm b/code/game/jobs/access.dm index 8b743565de3..cecc092da60 100644 --- a/code/game/jobs/access.dm +++ b/code/game/jobs/access.dm @@ -82,33 +82,33 @@ /proc/get_distress_access_lesser() return list(ACCESS_DISTRESS, ACCESS_EXTERNAL_AIRLOCKS) -/var/list/datum/access/priv_all_access_datums +GLOBAL_LIST_INIT_TYPED(priv_all_access_datums, /datum/access, null) /proc/get_all_access_datums() - if(!priv_all_access_datums) - priv_all_access_datums = init_subtypes(/datum/access) - sortTim(priv_all_access_datums, GLOBAL_PROC_REF(cmp_access), FALSE) + if(!GLOB.priv_all_access_datums) + GLOB.priv_all_access_datums = init_subtypes(/datum/access) + sortTim(GLOB.priv_all_access_datums, GLOBAL_PROC_REF(cmp_access), FALSE) - return priv_all_access_datums + return GLOB.priv_all_access_datums -/var/list/datum/access/priv_all_access_datums_id +GLOBAL_LIST_INIT_TYPED(priv_all_access_datums_id, /datum/access, null) /proc/get_all_access_datums_by_id() - if(!priv_all_access_datums_id) - priv_all_access_datums_id = list() + if(!GLOB.priv_all_access_datums_id) + GLOB.priv_all_access_datums_id = list() for(var/datum/access/A in get_all_access_datums()) - priv_all_access_datums_id["[A.id]"] = A + GLOB.priv_all_access_datums_id["[A.id]"] = A - return priv_all_access_datums_id + return GLOB.priv_all_access_datums_id -/var/list/datum/access/priv_all_access_datums_region +GLOBAL_LIST_INIT_TYPED(priv_all_access_datums_region, /datum/access, null) /proc/get_all_access_datums_by_region() - if(!priv_all_access_datums_region) - priv_all_access_datums_region = list() + if(!GLOB.priv_all_access_datums_region) + GLOB.priv_all_access_datums_region = list() for(var/datum/access/A in get_all_access_datums()) - if(!priv_all_access_datums_region[A.region]) - priv_all_access_datums_region[A.region] = list() - priv_all_access_datums_region[A.region] += A + if(!GLOB.priv_all_access_datums_region[A.region]) + GLOB.priv_all_access_datums_region[A.region] = list() + GLOB.priv_all_access_datums_region[A.region] += A - return priv_all_access_datums_region + return GLOB.priv_all_access_datums_region /proc/get_access_ids(var/access_types = ACCESS_TYPE_ALL) var/list/L = new() @@ -117,47 +117,47 @@ L += A.id return L -/var/list/priv_all_access +GLOBAL_LIST(priv_all_access) /proc/get_all_accesses() - if(!priv_all_access) - priv_all_access = get_access_ids() + if(!GLOB.priv_all_access) + GLOB.priv_all_access = get_access_ids() - return priv_all_access.Copy() + return GLOB.priv_all_access.Copy() -/var/list/priv_station_access +GLOBAL_LIST(priv_station_access) /proc/get_all_station_access() - if(!priv_station_access) - priv_station_access = get_access_ids(ACCESS_TYPE_STATION) + if(!GLOB.priv_station_access) + GLOB.priv_station_access = get_access_ids(ACCESS_TYPE_STATION) - return priv_station_access.Copy() + return GLOB.priv_station_access.Copy() -/var/list/priv_centcom_access +GLOBAL_LIST(priv_centcom_access) /proc/get_all_centcom_access() - if(!priv_centcom_access) - priv_centcom_access = get_access_ids(ACCESS_TYPE_CENTCOM) + if(!GLOB.priv_centcom_access) + GLOB.priv_centcom_access = get_access_ids(ACCESS_TYPE_CENTCOM) - return priv_centcom_access.Copy() + return GLOB.priv_centcom_access.Copy() -/var/list/priv_syndicate_access +GLOBAL_LIST(priv_syndicate_access) /proc/get_all_syndicate_access() - if(!priv_syndicate_access) - priv_syndicate_access = get_access_ids(ACCESS_TYPE_SYNDICATE) + if(!GLOB.priv_syndicate_access) + GLOB.priv_syndicate_access = get_access_ids(ACCESS_TYPE_SYNDICATE) - return priv_syndicate_access.Copy() + return GLOB.priv_syndicate_access.Copy() -/var/list/priv_region_access +GLOBAL_LIST(priv_region_access) /proc/get_region_accesses(var/code) if(code == ACCESS_REGION_ALL) return get_all_station_access() - if(!priv_region_access) - priv_region_access = list() + if(!GLOB.priv_region_access) + GLOB.priv_region_access = list() for(var/datum/access/A in get_all_access_datums()) - if(!priv_region_access["[A.region]"]) - priv_region_access["[A.region]"] = list() - priv_region_access["[A.region]"] += A.id + if(!GLOB.priv_region_access["[A.region]"]) + GLOB.priv_region_access["[A.region]"] = list() + GLOB.priv_region_access["[A.region]"] += A.id - return priv_region_access["[code]"] + return GLOB.priv_region_access["[code]"] /proc/get_region_accesses_name(var/code) switch(code) @@ -222,14 +222,14 @@ /mob/proc/GetIdCard() return null -var/obj/item/card/id/all_access/ghost_all_access +GLOBAL_LIST_INIT_TYPED(ghost_all_access, /obj/item/card/id/all_access, list()) /mob/abstract/ghost/observer/GetIdCard() if(!is_admin(src)) return - if(!ghost_all_access) - ghost_all_access = new() - return ghost_all_access + if(!GLOB.ghost_all_access) + GLOB.ghost_all_access = new() + return GLOB.ghost_all_access /mob/living/bot/GetIdCard() return botcard diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index 7678c6c0fc1..9ec35412b33 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -1,4 +1,4 @@ -var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) +GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newscast = 1)) /datum/job/captain title = "Captain" @@ -73,7 +73,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) /datum/job/captain/announce(mob/living/carbon/human/H) . = ..() - captain_announcement.Announce("All hands, Captain [H.real_name] on deck!") + GLOB.captain_announcement.Announce("All hands, Captain [H.real_name] on deck!") callHook("captain_spawned", list(H)) /datum/job/xo diff --git a/code/game/jobs/job/outsider/representative.dm b/code/game/jobs/job/outsider/representative.dm index 898f5c0925a..7f9ab8f18e8 100644 --- a/code/game/jobs/job/outsider/representative.dm +++ b/code/game/jobs/job/outsider/representative.dm @@ -172,7 +172,7 @@ if(prob(25)) faxtext += "
  • [get_objectives(H, REPRESENTATIVE_MISSION_HIGH)].
  • " - for (var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for (var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if (F.department == fax_department) var/obj/item/paper/P = new /obj/item/paper(get_turf(F)) P.name = "[name] - Directives" diff --git a/code/game/machinery/anti_bluespace.dm b/code/game/machinery/anti_bluespace.dm index bf95026e000..ccc6ded812c 100644 --- a/code/game/machinery/anti_bluespace.dm +++ b/code/game/machinery/anti_bluespace.dm @@ -1,4 +1,4 @@ -var/global/list/bluespace_inhibitors +GLOBAL_LIST_INIT_TYPED(bluespace_inhibitors, /obj/machinery/anti_bluespace, null) /obj/machinery/anti_bluespace name = "bluespace inhibitor" @@ -12,10 +12,10 @@ var/global/list/bluespace_inhibitors /obj/machinery/anti_bluespace/Initialize() . = ..() - LAZYADD(bluespace_inhibitors, src) + LAZYADD(GLOB.bluespace_inhibitors, src) /obj/machinery/anti_bluespace/Destroy() - LAZYREMOVE(bluespace_inhibitors, src) + LAZYREMOVE(GLOB.bluespace_inhibitors, src) return ..() /obj/machinery/anti_bluespace/update_icon() diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index b4e7967850d..5ddb6e48979 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -66,7 +66,7 @@ set_pixel_offsets() - var/list/open_networks = difflist(network, restricted_camera_networks) + var/list/open_networks = difflist(network, GLOB.restricted_camera_networks) on_open_network = open_networks.len if(on_open_network) GLOB.cameranet.add_source(src) @@ -359,14 +359,14 @@ /obj/machinery/camera/proc/triggerCameraAlarm(var/duration = 0) alarm_on = 1 - camera_alarm.triggerAlarm(loc, src, duration) + GLOB.camera_alarm.triggerAlarm(loc, src, duration) /obj/machinery/camera/proc/cancelCameraAlarm(var/force = FALSE) if(wires.is_cut(WIRE_ALARM) && !force) return alarm_on = 0 - camera_alarm.clearAlarm(loc, src) + GLOB.camera_alarm.clearAlarm(loc, src) //if false, then the camera is listed as DEACTIVATED and cannot be used /obj/machinery/camera/proc/can_use() diff --git a/code/game/machinery/camera/motion.dm b/code/game/machinery/camera/motion.dm index e90f57b90aa..3bc42f3cdf7 100644 --- a/code/game/machinery/camera/motion.dm +++ b/code/game/machinery/camera/motion.dm @@ -29,7 +29,7 @@ if (!status || (stat & NOPOWER)) return 0 if (detectTime == -1) - motion_alarm.clearAlarm(loc, src) + GLOB.motion_alarm.clearAlarm(loc, src) detectTime = 0 return 1 @@ -37,7 +37,7 @@ if (!status || (stat & NOPOWER)) return 0 if (!detectTime) return 0 - motion_alarm.triggerAlarm(loc, src) + GLOB.motion_alarm.triggerAlarm(loc, src) detectTime = -1 return 1 diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index 2e6111f0fa6..511cb9ef098 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -1,12 +1,12 @@ // PRESETS -var/global/list/engineering_networks = list( +GLOBAL_LIST_INIT(engineering_networks, list( NETWORK_REACTOR, NETWORK_ENGINEERING, NETWORK_ENGINEERING_OUTPOST, "Atmosphere Alarms", "Fire Alarms", "Power Alarms" -) +)) /obj/machinery/camera/network/crescent network = list(NETWORK_CRESCENT) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 0e3bb2f4110..439b9fd84b7 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -221,7 +221,7 @@ /obj/structure/AIcore/deactivated/proc/check_malf(var/mob/living/silicon/ai/ai) if(!ai) return - for (var/datum/mind/malfai in malf.current_antagonists) + for (var/datum/mind/malfai in GLOB.malf.current_antagonists) if (ai.mind == malfai) return 1 diff --git a/code/game/machinery/computer/arcade_orion.dm b/code/game/machinery/computer/arcade_orion.dm index ecfe6fbf651..f9a0d214a19 100644 --- a/code/game/machinery/computer/arcade_orion.dm +++ b/code/game/machinery/computer/arcade_orion.dm @@ -81,9 +81,9 @@ settlers = list("[usr]") for(var/i=0; i<3; i++) if(prob(50)) - settlers += pick(first_names_male) + settlers += pick(GLOB.first_names_male) else - settlers += pick(first_names_female) + settlers += pick(GLOB.first_names_female) num_traitors = 0 event = ORION_TRAIL_START port = 0 diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 81f37e08461..188610d84c3 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -16,10 +16,10 @@ GLOBAL_LIST_EMPTY(minor_air_alarms) /obj/machinery/computer/atmos_alert/Initialize() . = ..() - atmosphere_alarm.register_alarm(src, TYPE_PROC_REF(/atom, update_icon)) + GLOB.atmosphere_alarm.register_alarm(src, TYPE_PROC_REF(/atom, update_icon)) /obj/machinery/computer/atmos_alert/Destroy() - atmosphere_alarm.unregister_alarm(src) + GLOB.atmosphere_alarm.unregister_alarm(src) return ..() /obj/machinery/computer/atmos_alert/attack_hand(mob/user) @@ -30,10 +30,10 @@ GLOBAL_LIST_EMPTY(minor_air_alarms) var/major_alarms[0] var/minor_alarms[0] - for(var/datum/alarm/alarm in atmosphere_alarm.major_alarms()) + for(var/datum/alarm/alarm in GLOB.atmosphere_alarm.major_alarms()) major_alarms[++major_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "[REF(alarm)]") - for(var/datum/alarm/alarm in atmosphere_alarm.minor_alarms()) + for(var/datum/alarm/alarm in GLOB.atmosphere_alarm.minor_alarms()) minor_alarms[++minor_alarms.len] = list("name" = sanitize(alarm.alarm_name()), "ref" = "[REF(alarm)]") data["priority_alarms"] = major_alarms @@ -48,11 +48,11 @@ GLOBAL_LIST_EMPTY(minor_air_alarms) /obj/machinery/computer/atmos_alert/update_icon() if(!(stat & (NOPOWER|BROKEN))) - var/list/alarms = atmosphere_alarm.major_alarms() + var/list/alarms = GLOB.atmosphere_alarm.major_alarms() if(alarms.len) icon_screen = "alert:2" else - alarms = atmosphere_alarm.minor_alarms() + alarms = GLOB.atmosphere_alarm.minor_alarms() if(alarms.len) icon_screen = "alert:1" else @@ -64,17 +64,17 @@ GLOBAL_LIST_EMPTY(minor_air_alarms) return 1 if(href_list["clear_alarm"]) - var/datum/alarm/alarm = locate(href_list["clear_alarm"]) in atmosphere_alarm.alarms + var/datum/alarm/alarm = locate(href_list["clear_alarm"]) in GLOB.atmosphere_alarm.alarms if(alarm) for(var/datum/alarm_source/alarm_source in alarm.sources) var/obj/machinery/alarm/air_alarm = alarm_source.source if(istype(air_alarm)) var/list/new_ref = list("atmos_reset" = 1) - air_alarm.Topic(href, new_ref, state = air_alarm_topic) + air_alarm.Topic(href, new_ref, state = GLOB.air_alarm_topic) return 1 -var/datum/ui_state/air_alarm_topic/air_alarm_topic = new() +GLOBAL_DATUM_INIT(air_alarm_topic, /datum/ui_state/air_alarm_topic, new()) /datum/ui_state/air_alarm_topic/href_list(var/mob/user) var/list/extra_href = list() diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index 99b8dbdfe94..1c8d5142664 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -61,7 +61,7 @@ data["networks"] = all_networks if(current_network) - data["cameras"] = camera_repository.cameras_in_network(current_network) + data["cameras"] = GLOB.camera_repository.cameras_in_network(current_network) data["current_camera"] = current_camera ? current_camera.nano_structure() : null data["current_network"] = current_network @@ -206,8 +206,8 @@ switch_to_camera(user,jump_to) /obj/machinery/computer/security/process() - if(cache_id != camera_repository.camera_cache_id) - cache_id = camera_repository.camera_cache_id + if(cache_id != GLOB.camera_repository.camera_cache_id) + cache_id = GLOB.camera_repository.camera_cache_id SSnanoui.update_uis(src) /obj/machinery/computer/security/proc/can_access_camera(var/obj/machinery/camera/C) @@ -300,7 +300,7 @@ /obj/machinery/computer/security/engineering/Initialize() if(!network) - network = engineering_networks.Copy() + network = GLOB.engineering_networks.Copy() . = ..() /obj/machinery/computer/security/nuclear diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index adf9ebeafee..aefec18f555 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -17,12 +17,12 @@ if(stat & (BROKEN|NOPOWER)) return - var/datum/evacuation_controller/shuttle/evac_control = evacuation_controller + var/datum/evacuation_controller/shuttle/evac_control = GLOB.evacuation_controller if(!istype(evac_control)) to_chat(user, SPAN_DANGER("This console should not in use on this map. Please report this to a developer.")) return - if ((!( istype(W, /obj/item/card) ) || !( SSticker ) || evacuation_controller.has_evacuated() || !( user ))) + if ((!( istype(W, /obj/item/card) ) || !( SSticker ) || GLOB.evacuation_controller.has_evacuated() || !( user ))) return if (W.GetID()) @@ -42,7 +42,7 @@ return 0 var/choice = alert(user, "Would you like to (un)authorize a shortened launch time? [(src.auth_need - src.authorized.len)] authorization\s are still needed. Use abort to cancel all authorizations.", "Shuttle Launch", "Authorize", "Repeal", "Abort") - if(evacuation_controller.is_prepared() && user.get_active_hand() != id) + if(GLOB.evacuation_controller.is_prepared() && user.get_active_hand() != id) return 0 switch(choice) if("Authorize") @@ -56,7 +56,7 @@ message_admins("[key_name_admin(user)] has launched the shuttle") log_game("[key_name(user)] has launched the shuttle early") to_world(SPAN_NOTICE("Alert: Shuttle launch time shortened to 10 seconds!")) - evacuation_controller.set_launch_time(world.time+100) + GLOB.evacuation_controller.set_launch_time(world.time+100) //src.authorized = null qdel(src.authorized) src.authorized = list( ) @@ -73,11 +73,11 @@ else if (istype(W, /obj/item/card/emag) && !emagged) var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel") - if(!emagged && !evacuation_controller.is_prepared() && user.get_active_hand() == W) + if(!emagged && !GLOB.evacuation_controller.is_prepared() && user.get_active_hand() == W) switch(choice) if("Launch") to_world(SPAN_NOTICE("Alert: Shuttle launch time shortened to 10 seconds!")) - evacuation_controller.set_launch_time(world.time+100) + GLOB.evacuation_controller.set_launch_time(world.time+100) emagged = 1 if("Cancel") return diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 41723b60354..e218366b4c4 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -231,7 +231,7 @@ /obj/machinery/door/proc/bumpopen(mob/user as mob) if(operating) return - if(user.last_airflow > world.time - vsc.airflow_delay) //Fakkit + if(user.last_airflow > world.time - GLOB.vsc.airflow_delay) //Fakkit return src.add_fingerprint(user) if(density) diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index 955d39bb994..12a7e39f5ff 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_INIT_TYPED(doppler_arrays, /obj/machinery/doppler_array, list()) /obj/machinery/doppler_array name = "tachyon-doppler array" @@ -12,11 +12,11 @@ var/list/doppler_arrays = list() /obj/machinery/doppler_array/Initialize() . = ..() - doppler_arrays += src + GLOB.doppler_arrays += src update_icon() /obj/machinery/doppler_array/Destroy() - doppler_arrays -= src + GLOB.doppler_arrays -= src return ..() /obj/machinery/doppler_array/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index c0f73b35c9c..b51e9537e3f 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -254,7 +254,7 @@ return var/area/area = get_area(src) for(var/obj/machinery/firealarm/FA in area) - fire_alarm.clearAlarm(loc, FA) + GLOB.fire_alarm.clearAlarm(loc, FA) FA.soundloop.stop(FA) update_icon() return @@ -264,7 +264,7 @@ return var/area/area = get_area(src) for(var/obj/machinery/firealarm/FA in area) - fire_alarm.triggerAlarm(loc, FA, duration) + GLOB.fire_alarm.triggerAlarm(loc, FA, duration) FA.soundloop.start(FA) update_icon() return diff --git a/code/game/machinery/floor_light.dm b/code/game/machinery/floor_light.dm index d57ff190d7a..c8a94a1af4e 100644 --- a/code/game/machinery/floor_light.dm +++ b/code/game/machinery/floor_light.dm @@ -1,5 +1,3 @@ -var/list/floor_light_cache = list() - /obj/machinery/floor_light name = "floor light" icon = 'icons/obj/machinery/floor_light.dmi' diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 9c381fe1a85..7bfb96db81f 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -19,7 +19,7 @@ dir = EAST; \ pixel_x = 8; ///Global list that contains reference to all newscasters in existence. -var/list/obj/machinery/newscaster/allCasters = list() +GLOBAL_LIST_INIT_TYPED(allCasters, /obj/machinery/newscaster, list()) /obj/machinery/newscaster name = "newscaster" @@ -120,9 +120,9 @@ var/list/obj/machinery/newscaster/allCasters = list() /obj/machinery/newscaster/Initialize(mapload) . = ..() //I just realised the newscasters weren't in the global machines list. The superconstructor call will tend to that - allCasters += src + GLOB.allCasters += src paper_remaining = 15 // Will probably change this to something better - unit_no = allCasters.len + 1 + unit_no = GLOB.allCasters.len + 1 if(dir & NORTH) alpha = 127 update_icon() //for any custom ones on the map... @@ -131,7 +131,7 @@ var/list/obj/machinery/newscaster/allCasters = list() set_pixel_offsets() /obj/machinery/newscaster/Destroy() - allCasters -= src + GLOB.allCasters -= src return ..() /obj/machinery/newscaster/set_pixel_offsets() @@ -773,7 +773,7 @@ var/list/obj/machinery/newscaster/allCasters = list() var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") SSnews.wanted_issue = null - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.update_icon() src.screen=17 src.updateUsrDialog() diff --git a/code/game/machinery/nuclear_bomb.dm b/code/game/machinery/nuclear_bomb.dm index 1456da0ca43..37bcee2a6aa 100644 --- a/code/game/machinery/nuclear_bomb.dm +++ b/code/game/machinery/nuclear_bomb.dm @@ -1,4 +1,4 @@ -var/bomb_set +GLOBAL_VAR(bomb_set) /obj/machinery/nuclearbomb name = "\improper Nuclear Fission Explosive" @@ -281,7 +281,7 @@ var/bomb_set if (!timing && !safety) timing = 1 log_and_message_admins("engaged a nuclear bomb") - bomb_set++ //There can still be issues with this resetting when there are multiple bombs. Not a big deal though for Nuke/N + GLOB.bomb_set++ //There can still be issues with this resetting when there are multiple bombs. Not a big deal though for Nuke/N update_icon() else secure_device() @@ -321,7 +321,7 @@ var/bomb_set if(timing <= 0) return - bomb_set-- + GLOB.bomb_set-- timing = 0 timeleft = clamp(timeleft, 120, 600) update_icon() @@ -372,7 +372,7 @@ var/bomb_set //kinda shit but I couldn't get permission to do what I wanted to do. if(!SSticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is - universe_has_ended = 1 + GLOB.universe_has_ended = 1 return /obj/machinery/nuclearbomb/update_icon() @@ -397,11 +397,11 @@ var/bomb_set /obj/item/disk/nuclear/Initialize() . = ..() - nuke_disks |= src + GLOB.nuke_disks |= src /obj/item/disk/nuclear/Destroy() - nuke_disks -= src - if(!nuke_disks.len) + GLOB.nuke_disks -= src + if(!GLOB.nuke_disks.len) var/turf/T = pick_area_turf(/area/maintenance, list(/proc/is_station_turf, /proc/not_turf_contains_dense_objects)) if(T) var/obj/D = new /obj/item/disk/nuclear(T) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index d3109bb51e9..a9e30c95fb4 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -46,10 +46,10 @@ pixel_x = 12; ///Forms database #define RCS_FORMS 9 -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_INIT(req_console_assistance, list()) +GLOBAL_LIST_INIT(req_console_supplies, list()) +GLOBAL_LIST_INIT(req_console_information, list()) +GLOBAL_LIST_INIT_TYPED(allConsoles, /obj/machinery/requests_console, list()) /obj/machinery/requests_console name = "requests console" @@ -200,13 +200,13 @@ var/list/obj/machinery/requests_console/allConsoles = list() announcement.newscast = 1 name = "[department] requests console" - allConsoles += src + GLOB.allConsoles += src if (departmentType & RC_ASSIST) - req_console_assistance |= department + GLOB.req_console_assistance |= department if (departmentType & RC_SUPPLY) - req_console_supplies |= department + GLOB.req_console_supplies |= department if (departmentType & RC_INFO) - req_console_information |= department + GLOB.req_console_information |= department update_icon() if(!mapload) @@ -217,19 +217,19 @@ var/list/obj/machinery/requests_console/allConsoles = list() pixel_y = DIR2PIXEL_Y(dir) /obj/machinery/requests_console/Destroy() - allConsoles -= src + GLOB.allConsoles -= src var/lastDeptRC = 1 - for (var/obj/machinery/requests_console/Console in allConsoles) + for (var/obj/machinery/requests_console/Console in GLOB.allConsoles) if (Console.department == department) lastDeptRC = 0 break if(lastDeptRC) if (departmentType & RC_ASSIST) - req_console_assistance -= department + GLOB.req_console_assistance -= department if (departmentType & RC_SUPPLY) - req_console_supplies -= department + GLOB.req_console_supplies -= department if (departmentType & RC_INFO) - req_console_information -= department + GLOB.req_console_information -= department alert_pdas.Cut() return ..() @@ -249,9 +249,9 @@ var/list/obj/machinery/requests_console/allConsoles = list() data["silent"] = silent data["announcementConsole"] = announcementConsole - data["assist_dept"] = req_console_assistance - data["supply_dept"] = req_console_supplies - data["info_dept"] = req_console_information + data["assist_dept"] = GLOB.req_console_assistance + data["supply_dept"] = GLOB.req_console_supplies + data["info_dept"] = GLOB.req_console_information data["message"] = message data["recipient"] = recipient @@ -347,7 +347,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() if(tempScreen == RCS_ANNOUNCE && !announcementConsole) return if(tempScreen == RCS_VIEWMSGS) - 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.icon_state = "req_comp0" @@ -508,7 +508,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() return FALSE /obj/machinery/requests_console/proc/fax_send(var/obj/item/O, var/mob/user) - var/sendto = tgui_input_list(user, "Select department.", "Send Fax", allConsoles) + var/sendto = tgui_input_list(user, "Select department.", "Send Fax", GLOB.allConsoles) if(!sendto) return if(use_check_and_message(user)) @@ -517,7 +517,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() var/msg = "NOTICE: No server detected!" audible_message("The Requests Console beeps, [SPAN_WARNING(msg)]") return - for(var/cc in allConsoles) + for(var/cc in GLOB.allConsoles) var/obj/machinery/requests_console/Console = cc if(Console == sendto) var/paperstock_usage = 1 diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 52309cb7999..0eda4c631bd 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -98,16 +98,16 @@ remove_messages() return 1 if(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME) //emergency shuttle timer - if(evacuation_controller) - if(evacuation_controller.is_prepared()) + if(GLOB.evacuation_controller) + if(GLOB.evacuation_controller.is_prepared()) message1 = "-ETD-" - if (evacuation_controller.waiting_to_leave()) + if (GLOB.evacuation_controller.waiting_to_leave()) message2 = "Launch" else message2 = get_shuttle_timer() set_messages(message1, message2) AddOverlays(emissive_appearance(icon, "outline", src, alpha = src.alpha)) - else if(evacuation_controller.has_eta()) + else if(GLOB.evacuation_controller.has_eta()) message1 = "-ETA-" message2 = get_shuttle_timer() set_messages(message1, message2) @@ -234,7 +234,7 @@ set_light(1.5, 0.7, LIGHT_COLOR_FAINT_CYAN) // blue light /obj/machinery/status_display/proc/get_shuttle_timer() - var/timeleft = evacuation_controller.get_eta() + var/timeleft = GLOB.evacuation_controller.get_eta() if(timeleft < 0) return "" return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]" diff --git a/code/game/machinery/status_display_ai.dm b/code/game/machinery/status_display_ai.dm index 183d8ae0134..3d1ce8f26bc 100644 --- a/code/game/machinery/status_display_ai.dm +++ b/code/game/machinery/status_display_ai.dm @@ -6,7 +6,7 @@ overlay = over ckey = key -var/list/ai_status_emotions = list( +GLOBAL_LIST_INIT(ai_status_emotions, list( "Very Happy" = new /datum/ai_emotion("ai_veryhappy"), "Happy" = new /datum/ai_emotion("ai_happy"), "Neutral" = new /datum/ai_emotion("ai_neutral"), @@ -26,12 +26,12 @@ var/list/ai_status_emotions = list( "Diagnostics" = new /datum/ai_emotion("ai_diagnostics"), "Tribunal" = new /datum/ai_emotion("ai_tribunal", "serithi"), "Tribunal Malfunctioning" = new /datum/ai_emotion("ai_tribunal_malf", "serithi") - ) + )) /proc/get_ai_emotions(var/ckey) var/list/emotions = new - for(var/emotion_name in ai_status_emotions) - var/datum/ai_emotion/emotion = ai_status_emotions[emotion_name] + for(var/emotion_name in GLOB.ai_status_emotions) + var/datum/ai_emotion/emotion = GLOB.ai_status_emotions[emotion_name] if(!emotion.ckey || emotion.ckey == ckey) emotions += emotion_name @@ -92,7 +92,7 @@ var/list/ai_status_emotions = list( ClearOverlays() if (1) // AI emoticon - var/datum/ai_emotion/ai_emotion = ai_status_emotions[emotion] + var/datum/ai_emotion/ai_emotion = GLOB.ai_status_emotions[emotion] set_picture(ai_emotion.overlay) if (2) // BSOD diff --git a/code/game/machinery/telecomms/machines/message_server.dm b/code/game/machinery/telecomms/machines/message_server.dm index 43e6462a885..4428ee17224 100644 --- a/code/game/machinery/telecomms/machines/message_server.dm +++ b/code/game/machinery/telecomms/machines/message_server.dm @@ -118,7 +118,7 @@ authmsg += "[id_auth]
    " if (stamp) authmsg += "[stamp]
    " - for (var/obj/machinery/requests_console/Console in allConsoles) + for (var/obj/machinery/requests_console/Console in GLOB.allConsoles) if (ckey(Console.department) == ckey(recipient)) if(!Console.operable()) Console.message_log += "Message lost due to console failure.
    Please contact [station_name()] system adminsitrator or AI for technical assistance.
    " diff --git a/code/game/objects/effects/bump_teleporter.dm b/code/game/objects/effects/bump_teleporter.dm index 054f7fcd27f..79ce7c4092c 100644 --- a/code/game/objects/effects/bump_teleporter.dm +++ b/code/game/objects/effects/bump_teleporter.dm @@ -1,4 +1,4 @@ -var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() +GLOBAL_LIST_INIT_TYPED(bump_teleporters, /obj/effect/bump_teleporter, list()) /obj/effect/bump_teleporter name = "bump-teleporter" @@ -13,10 +13,10 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() /obj/effect/bump_teleporter/New() ..() - BUMP_TELEPORTERS += src + GLOB.bump_teleporters += src /obj/effect/bump_teleporter/Destroy() - BUMP_TELEPORTERS -= src + GLOB.bump_teleporters -= src return ..() /obj/effect/bump_teleporter/CollidedWith(atom/bumped_atom) @@ -30,7 +30,7 @@ var/list/obj/effect/bump_teleporter/BUMP_TELEPORTERS = list() //user.forceMove(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 GLOB.bump_teleporters) if(BT.id == src.id_target) usr.forceMove(BT.loc) //Teleport to location with correct id. return diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm index 3e50f96dd26..1145f808ee5 100644 --- a/code/game/objects/effects/effect_system.dm +++ b/code/game/objects/effects/effect_system.dm @@ -48,10 +48,10 @@ would spawn and follow the beaker, even if it is carried or thrown. // will always spawn at the items location, even if it's moved. /* Example: -var/datum/effect/system/steam_spread/steam = new /datum/effect/system/steam_spread() -- creates new system -steam.set_up(5, 0, mob.loc) -- sets up variables -OPTIONAL: steam.attach(mob) -steam.start() -- spawns the effect + var/datum/effect/system/steam_spread/steam = new /datum/effect/system/steam_spread() -- creates new system + steam.set_up(5, 0, mob.loc) -- sets up variables + OPTIONAL: steam.attach(mob) + steam.start() -- spawns the effect */ ///////////////////////////////////////////// /obj/effect/effect/steam diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 09d18749e0e..91d5ba8f0f8 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -289,14 +289,14 @@ /obj/effect/portal/revenant/Initialize(mapload) . = ..() - if(revenants.revenant_rift) + if(GLOB.revenants.revenant_rift) return INITIALIZE_HINT_QDEL var/turf/T = get_turf(src) log_and_message_admins("Revenant Bluespace Rift spawned at \the [get_area(T)]", null, T) - revenants.revenant_rift = src + GLOB.revenants.revenant_rift = src /obj/effect/portal/revenant/Destroy() - revenants.destroyed_rift() + GLOB.revenants.destroyed_rift() visible_message(FONT_LARGE(SPAN_DANGER("\The [src] collapses!"))) new /obj/random/highvalue/no_crystal(src) new /obj/random/highvalue/no_crystal(src) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index b281edef1b3..94af864fd0d 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -17,7 +17,7 @@ SSexplosives.queue(data) //Machines which report explosions. - for(var/thing in doppler_arrays) + for(var/thing in GLOB.doppler_arrays) var/obj/machinery/doppler_array/Array = thing Array.sense_explosion(epicenter.x,epicenter.y,epicenter.z,devastation_range,heavy_impact_range,light_impact_range) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index bdf27c72592..c084a4941cd 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -624,8 +624,8 @@ /obj/item/proc/item_action_slot_check(mob/user, slot) return TRUE -//Defines which slots correspond to which slot flags -var/list/global/slot_flags_enumeration = list( +///Defines which slots correspond to which slot flags +GLOBAL_LIST_INIT(slot_flags_enumeration, list( "[slot_wear_mask]" = SLOT_MASK, "[slot_back]" = SLOT_BACK, "[slot_wear_suit]" = SLOT_OCLOTHING, @@ -641,7 +641,7 @@ var/list/global/slot_flags_enumeration = list( "[slot_tie]" = SLOT_TIE, "[slot_wrists]" = SLOT_WRISTS, "[slot_pants]" = SLOT_PANTS - ) + )) //the mob M is attempting to equip this item into the slot passed through as 'slot'. Return 1 if it can do this and 0 if it can't. //If you are making custom procs but would like to retain partial or complete functionality of this one, include a 'return ..()' to where you want this to happen. @@ -662,8 +662,8 @@ var/list/global/slot_flags_enumeration = list( return 0 //First check if the item can be equipped to the desired slot. - if("[slot]" in slot_flags_enumeration) - var/req_flags = slot_flags_enumeration["[slot]"] + if("[slot]" in GLOB.slot_flags_enumeration) + var/req_flags = GLOB.slot_flags_enumeration["[slot]"] if(!(req_flags & slot_flags)) return 0 @@ -948,7 +948,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. if(M.stat || !(ishuman(M))) to_chat(M, SPAN_WARNING("You are unable to focus through \the [devicename]!")) cannotzoom = 1 - else if(!zoom && (global_hud.darkMask[1] in M.client.screen)) + else if(!zoom && (GLOB.global_hud.darkMask[1] in M.client.screen)) to_chat(M, SPAN_WARNING("Your visor gets in the way of looking through the [devicename]!")) cannotzoom = 1 else if(do_device_check && !zoom && M.get_active_hand() != src) diff --git a/code/game/objects/items/blueprints.dm b/code/game/objects/items/blueprints.dm index 44e40517b37..04c49ec7518 100644 --- a/code/game/objects/items/blueprints.dm +++ b/code/game/objects/items/blueprints.dm @@ -98,7 +98,7 @@ desc = "Some dusty old blueprints. The markings are old, and seem entirely irrelevant for your wherabouts." return FALSE desc = "Blueprints for the daring souls wanting to establish a planetary outpost. Has some sketchy looking stains and what appears to be bite holes." - var/area/overmap/map = global.map_overmap + var/area/overmap/map = GLOB.map_overmap for(var/obj/effect/overmap/visitable/sector/exoplanet/E in map) valid_z_levels += E.map_z if(length(SSodyssey.scenario_zlevels)) diff --git a/code/game/objects/items/devices/radio_jammer.dm b/code/game/objects/items/devices/radio_jammer.dm index fe6158b24be..ec86ddd131b 100644 --- a/code/game/objects/items/devices/radio_jammer.dm +++ b/code/game/objects/items/devices/radio_jammer.dm @@ -1,12 +1,12 @@ //Global list for housing active radiojammers: -var/list/active_radio_jammers = list() +GLOBAL_LIST_INIT_TYPED(active_radio_jammers, /obj/item/device/radiojammer, list()) // tests if an object is near a radio jammer // if need_all_blocked is false, the jammer only needs to be on JAMMER_SYNTHETIC to work /proc/within_jamming_range(var/atom/test, var/need_all_blocked = TRUE) - if(length(active_radio_jammers)) + if(length(GLOB.active_radio_jammers)) var/turf/our_turf = get_turf(test) - for(var/obj/item/device/radiojammer/J in active_radio_jammers) + for(var/obj/item/device/radiojammer/J in GLOB.active_radio_jammers) var/turf/jammer_turf = get_turf(J) if(our_turf.z != jammer_turf.z) continue @@ -37,7 +37,7 @@ var/list/active_radio_jammers = list() update_icon() /obj/item/device/radiojammer/Destroy() - active_radio_jammers -= src + GLOB.active_radio_jammers -= src return ..() /obj/item/device/radiojammer/attack_self(mob/user) @@ -83,10 +83,10 @@ var/list/active_radio_jammers = list() /obj/item/device/radiojammer/update_icon() if(active > 0) - active_radio_jammers += src + GLOB.active_radio_jammers += src icon_state = icon_state_active else - active_radio_jammers -= src + GLOB.active_radio_jammers -= src icon_state = icon_state_inactive @@ -156,11 +156,11 @@ var/list/active_radio_jammers = list() /obj/item/device/radiojammer/improvised/update_icon() if(active > 0) - active_radio_jammers += src + GLOB.active_radio_jammers += src icon_state = icon_state_active START_PROCESSING(SSprocessing, src) last_updated = world.time else - active_radio_jammers -= src + GLOB.active_radio_jammers -= src icon_state = initial(icon_state) STOP_PROCESSING(SSprocessing, src) diff --git a/code/game/objects/items/devices/uplink.dm b/code/game/objects/items/devices/uplink.dm index 0247b6d3fa6..dec71964bfb 100644 --- a/code/game/objects/items/devices/uplink.dm +++ b/code/game/objects/items/devices/uplink.dm @@ -74,15 +74,20 @@ Then check if it's true, if true return. This will stop the normal menu appearin var/pda_code = "" -// The hidden uplink MUST be inside an obj/item's contents. /obj/item/device/uplink/hidden/New() - spawn(2) - if(!istype(loc, /obj/item)) - qdel(src) ..() tgui_data = list() update_tgui_data() +/obj/item/device/uplink/hidden/Initialize(mapload, datum/mind/owner, new_telecrystals, new_bluecrystals) + . = ..() + return INITIALIZE_HINT_LATELOAD + +/obj/item/device/uplink/hidden/LateInitialize() + // The hidden uplink MUST be inside an obj/item's contents. + if(!istype(loc, /obj/item)) + qdel(src) + // Toggles the uplink on and off. Normally this will bypass the item's normal functions and go to the uplink menu, if activated. /obj/item/device/uplink/hidden/proc/toggle() active = !active diff --git a/code/game/objects/items/devices/uplink_random_lists.dm b/code/game/objects/items/devices/uplink_random_lists.dm index 1d3292fd31c..9dfc0dce783 100644 --- a/code/game/objects/items/devices/uplink_random_lists.dm +++ b/code/game/objects/items/devices/uplink_random_lists.dm @@ -1,4 +1,4 @@ -var/datum/uplink_random_selection/default_uplink_selection = new/datum/uplink_random_selection/default() +GLOBAL_DATUM_INIT(default_uplink_selection, /datum/uplink_random_selection, new/datum/uplink_random_selection/default()) /datum/uplink_random_item var/uplink_item // The uplink item @@ -12,7 +12,7 @@ var/datum/uplink_random_selection/default_uplink_selection = new/datum/uplink_ra src.keep_probability = keep_probability src.reselect_probability = reselect_probability -/datum/uplink_random_selection +ABSTRACT_TYPE(/datum/uplink_random_selection) var/list/datum/uplink_random_item/items /datum/uplink_random_selection/New() diff --git a/code/game/objects/items/items_icon.dm b/code/game/objects/items/items_icon.dm index 58b3f5685e3..ec39f635562 100644 --- a/code/game/objects/items/items_icon.dm +++ b/code/game/objects/items/items_icon.dm @@ -1,4 +1,4 @@ -var/list/mob_icon_icon_states = list() +GLOBAL_LIST_INIT(mob_icon_icon_states, list()) /obj/item/proc/get_mob_overlay(var/mob/living/carbon/human/H, var/mob_icon, var/mob_state, var/slot, var/main_call = TRUE) SHOULD_NOT_SLEEP(TRUE) @@ -6,12 +6,12 @@ var/list/mob_icon_icon_states = list() RETURN_TYPE(/image) // If we don't actually need to offset this, don't bother with any of the generation/caching. - if(!mob_icon_icon_states[mob_icon]) - mob_icon_icon_states[mob_icon] = icon_states(mob_icon) + if(!GLOB.mob_icon_icon_states[mob_icon]) + GLOB.mob_icon_icon_states[mob_icon] = icon_states(mob_icon) var/needs_shift = !(H.species.bodytype in sprite_sheets) if(!needs_shift && length(item_icons)) needs_shift = (slot in item_icons) - if(LAZYLEN(H.species.equip_adjust) && H.species.equip_adjust[slot] && length(H.species.equip_adjust[slot]) && (mob_state in mob_icon_icon_states[mob_icon]) && needs_shift) + if(LAZYLEN(H.species.equip_adjust) && H.species.equip_adjust[slot] && length(H.species.equip_adjust[slot]) && (mob_state in GLOB.mob_icon_icon_states[mob_icon]) && needs_shift) // Check the cache for previously made icons. var/image_key_mod = get_image_key_mod() var/image_key = "[mob_icon]-[mob_state]-[color]-[slot][!isnull(image_key_mod) ? "-[image_key_mod]" : ""]" diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 0f61dbd293e..c24f28cdc36 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -1,4 +1,4 @@ -var/global/list/datum/stack_recipe/rod_recipes = list( +GLOBAL_LIST_INIT_TYPED(rod_recipes, /datum/stack_recipe, list( new /datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = TRUE, on_floor = TRUE), new /datum/stack_recipe("floor-mounted catwalk", /obj/structure/lattice/catwalk/indoor, 4, time = 10, one_per_turf = TRUE, on_floor = TRUE), new /datum/stack_recipe("grate, dark", /obj/structure/lattice/catwalk/indoor/grate, 1, time = 10, one_per_turf = TRUE, on_floor = TRUE), @@ -13,7 +13,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list( new /datum/stack_recipe("bolt", /obj/item/arrow, 1, time = 6), new /datum/stack_recipe("small animal trap", /obj/item/trap/animal, 6, time = 10), new /datum/stack_recipe("medium animal trap", /obj/item/trap/animal/medium, 12, time = 20) -) +)) /obj/item/stack/rods name = "metal rod" @@ -58,7 +58,7 @@ var/global/list/datum/stack_recipe/rod_recipes = list( /obj/item/stack/rods/New(var/loc, var/amount=null) ..() - recipes = rod_recipes + recipes = GLOB.rod_recipes /obj/item/stack/rods/attackby(obj/item/attacking_item, mob/user) ..() diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index d4ed855e7d6..0130de6c6a8 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -66,7 +66,6 @@ item_state = "card-id" origin_tech = list(TECH_MAGNET = 2, TECH_ILLEGAL = 2) -var/const/NO_EMAG_ACT = -50 /obj/item/card/emag/resolve_attackby(atom/A, mob/user, var/click_parameters) var/used_uses = A.emag_act(uses, user, src) if(used_uses == NO_EMAG_ACT) diff --git a/code/game/objects/items/weapons/cards_ids_syndicate.dm b/code/game/objects/items/weapons/cards_ids_syndicate.dm index e3fdab01b4a..d07e5b44fc8 100644 --- a/code/game/objects/items/weapons/cards_ids_syndicate.dm +++ b/code/game/objects/items/weapons/cards_ids_syndicate.dm @@ -255,20 +255,20 @@ // Always update the UI, or buttons will spin indefinitely SSnanoui.update_uis(src) -/var/global/list/id_card_states +GLOBAL_LIST_INIT_TYPED(id_card_states, /datum/card_state, null) /proc/id_card_states() - if(!id_card_states) - id_card_states = list() + if(!GLOB.id_card_states) + GLOB.id_card_states = list() for(var/path in typesof(/obj/item/card/id)) var/obj/item/card/id/ID = path var/datum/card_state/CS = new() CS.icon_state = initial(ID.icon_state) CS.item_state = initial(ID.item_state) CS.name = initial(ID.name) + " - " + initial(ID.icon_state) - id_card_states += CS - sortTim(id_card_states, GLOBAL_PROC_REF(cmp_cardstate), FALSE) + GLOB.id_card_states += CS + sortTim(GLOB.id_card_states, GLOBAL_PROC_REF(cmp_cardstate), FALSE) - return id_card_states + return GLOB.id_card_states /datum/card_state var/name diff --git a/code/game/objects/items/weapons/chaplain_items.dm b/code/game/objects/items/weapons/chaplain_items.dm index d9bd8dcf85a..ccab93ad912 100644 --- a/code/game/objects/items/weapons/chaplain_items.dm +++ b/code/game/objects/items/weapons/chaplain_items.dm @@ -291,13 +291,13 @@ if("Give in") K.visible_message(SPAN_NOTICE("[K]'s eyes become clearer, the evil gone, but not without leaving scars.")) K.take_overall_damage(10, 20) - thralls.remove_antagonist(K.mind) + GLOB.thralls.remove_antagonist(K.mind) admin_attack_log(user, target_mob, "successfully deconverted", "was successfully deconverted by", "successfully deconverted") else if (vampire.status & VAMP_FRENZIED) K.visible_message(SPAN_DANGER("[user] thrusts \the [src] towards [K], who recoils in horror as they erupt into flames!"), SPAN_DANGER("[user] thrusts \the [src] towards you, its holy light scorching your corrupted flesh!")) K.adjust_fire_stacks(10) K.IgniteMob() - else if(cult && (K.mind in cult.current_antagonists) && prob(75)) + else if(GLOB.cult && (K.mind in GLOB.cult.current_antagonists) && prob(75)) if(do_after(user, 1.5 SECONDS)) K.visible_message(SPAN_DANGER("[user] waves \the [src] over \the [K]'s head, [K] looks captivated by it."), SPAN_WARNING("[user] waves the [src] over your head. You see a foreign light, asking you to follow it. Its presence burns and blinds.")) var/choice = alert(K,"Do you want to give up your goal?","Become cleansed","Resist","Give in") @@ -310,7 +310,7 @@ if("Give in") K.visible_message(SPAN_NOTICE("[K]'s eyes become clearer, the evil gone, but not without leaving scars.")) K.take_overall_damage(10, 20) - cult.remove_antagonist(K.mind) + GLOB.cult.remove_antagonist(K.mind) admin_attack_log(user, target_mob, "successfully deconverted", "was successfully deconverted by", "successfully deconverted") else user.visible_message(SPAN_WARNING("[user]'s concentration is broken!"), SPAN_WARNING("Your concentration is broken! You and your target need to stay uninterrupted for longer!")) diff --git a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm index aa0303d50fb..560ea27eb13 100644 --- a/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm +++ b/code/game/objects/items/weapons/circuitboards/computer/camera_monitor.dm @@ -21,7 +21,7 @@ /obj/item/circuitboard/security/engineering/New() ..() - network = engineering_networks + network = GLOB.engineering_networks /obj/item/circuitboard/security/mining name = T_BOARD("mining camera monitor") @@ -67,7 +67,7 @@ to_chat(usr, "No input found please hang up and try your call again.") return var/list/tempnetwork = text2list(input, ",") - tempnetwork = difflist(tempnetwork,restricted_camera_networks,1) + tempnetwork = difflist(tempnetwork, GLOB.restricted_camera_networks, 1) if(tempnetwork.len < 1) to_chat(usr, "No network found please hang up and try your call again.") return diff --git a/code/game/objects/items/weapons/neutralizer.dm b/code/game/objects/items/weapons/neutralizer.dm index 6a20ef77ba5..d3398bb484f 100644 --- a/code/game/objects/items/weapons/neutralizer.dm +++ b/code/game/objects/items/weapons/neutralizer.dm @@ -14,7 +14,7 @@ icon_state = "neutralizer[active ? "-a" : ""]" /obj/item/bluespace_neutralizer/attack_self(mob/user) - if(vamp.current_antagonists.len || revenants.revenant_rift || active) + if(GLOB.vamp.current_antagonists.len || GLOB.revenants.revenant_rift || active) toggle(user) else to_chat(user, SPAN_WARNING("\The [src] doesn't detect any large bluespace rifts in the region.")) @@ -31,23 +31,23 @@ update_icon() /obj/item/bluespace_neutralizer/process() - if(active && revenants.revenant_rift) + if(active && GLOB.revenants.revenant_rift) var/turf/our_turf = get_turf(src) - if(!(our_turf.z == revenants.revenant_rift.z && get_dist(src, revenants.revenant_rift) < 5 && is_in_sight(src, revenants.revenant_rift))) + if(!(our_turf.z == GLOB.revenants.revenant_rift.z && get_dist(src, GLOB.revenants.revenant_rift) < 5 && is_in_sight(src, GLOB.revenants.revenant_rift))) tethered = FALSE return if(!tethered) - visible_message(SPAN_DANGER("\The [src] tethers with \the [revenants.revenant_rift]!")) + visible_message(SPAN_DANGER("\The [src] tethers with \the [GLOB.revenants.revenant_rift]!")) last_zap = world.time tethered = TRUE - Beam(revenants.revenant_rift, icon_state="n_beam", icon = 'icons/effects/beam.dmi', time=2, maxdistance=5, beam_datum_type=/datum/beam/held) + Beam(GLOB.revenants.revenant_rift, icon_state="n_beam", icon = 'icons/effects/beam.dmi', time=2, maxdistance=5, beam_datum_type=/datum/beam/held) playsound(get_turf(src), 'sound/magic/Charge.ogg', 70, TRUE, extrarange = 30) return - revenants.revenant_rift.reduce_health(world.time - last_zap) + GLOB.revenants.revenant_rift.reduce_health(world.time - last_zap) last_zap = world.time - Beam(revenants.revenant_rift, icon_state="lightning[rand(1,12)]", icon = 'icons/effects/effects.dmi', time=2, maxdistance=5, beam_datum_type=/datum/beam/held) + Beam(GLOB.revenants.revenant_rift, icon_state="lightning[rand(1,12)]", icon = 'icons/effects/effects.dmi', time=2, maxdistance=5, beam_datum_type=/datum/beam/held) playsound(get_turf(src), 'sound/magic/LightningShock.ogg', 50, TRUE, extrarange = 30) - if(active && vamp.current_antagonists.len) + if(active && GLOB.vamp.current_antagonists.len) for(var/obj/effect/dummy/veil_walk/veilwalk in range(src, 8)) Beam(veilwalk, icon_state="lightning[rand(1,12)]", icon = 'icons/effects/effects.dmi', time=2, maxdistance=5, beam_datum_type=/datum/beam/held) playsound(get_turf(src), 'sound/magic/LightningShock.ogg', 50, TRUE, extrarange = 30) diff --git a/code/game/objects/items/weapons/policetape.dm b/code/game/objects/items/weapons/policetape.dm index c837189835f..f561df0e9ac 100644 --- a/code/game/objects/items/weapons/policetape.dm +++ b/code/game/objects/items/weapons/policetape.dm @@ -1,4 +1,4 @@ -var/list/tape_roll_applications = list() +GLOBAL_LIST_INIT(tape_roll_applications, list()) //Define all tape types in policetape.dm /obj/item/taperoll @@ -189,17 +189,17 @@ var/list/tape_roll_applications = list() var/turf/F = A var/direction = user.loc == F ? user.dir : turn(user.dir, 180) var/icon/hazard_overlay = hazard_overlays["[direction]"] - if(tape_roll_applications[F] == null) - tape_roll_applications[F] = 0 + if(GLOB.tape_roll_applications[F] == null) + GLOB.tape_roll_applications[F] = 0 - if(tape_roll_applications[F] & direction) // hazard_overlay in F.overlays wouldn't work. + if(GLOB.tape_roll_applications[F] & direction) // hazard_overlay in F.overlays wouldn't work. user.visible_message("[user] uses the adhesive of \the [src] to remove area markings from \the [F].", "You use the adhesive of \the [src] to remove area markings from \the [F].") F.CutOverlays(hazard_overlay, ATOM_ICON_CACHE_PROTECTED) - tape_roll_applications[F] &= ~direction + GLOB.tape_roll_applications[F] &= ~direction else user.visible_message("[user] applied \the [src] on \the [F] to create area markings.", "You apply \the [src] on \the [F] to create area markings.") F.AddOverlays(hazard_overlay, ATOM_ICON_CACHE_PROTECTED) - tape_roll_applications[F] |= direction + GLOB.tape_roll_applications[F] |= direction return /obj/item/tape/proc/crumple(var/mob/user) diff --git a/code/game/objects/items/weapons/syndie.dm b/code/game/objects/items/weapons/syndie.dm index 8d25a16b535..ceaee54e1f0 100644 --- a/code/game/objects/items/weapons/syndie.dm +++ b/code/game/objects/items/weapons/syndie.dm @@ -122,7 +122,7 @@ /obj/item/syndie/teleporter/get_examine_text(mob/user, distance, is_adjacent, infix, suffix) . = ..() - if(!ready_to_use && burglars.is_antagonist(user.mind)) + if(!ready_to_use && GLOB.burglars.is_antagonist(user.mind)) . += SPAN_NOTICE("Charging: [num2loadingbar(world.time / when_recharge)]") /obj/item/syndie/teleporter/set_initial_maptext() diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index fbe10c40264..3c2711fc06c 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -10,7 +10,7 @@ * Special inhibitor handling. Different from the one used by teleport datums. */ /proc/check_inhibitors(var/turf/T) - for(var/found_inhibitor in bluespace_inhibitors) + for(var/found_inhibitor in GLOB.bluespace_inhibitors) var/obj/machinery/anti_bluespace/AB = found_inhibitor if(T.z != AB.z || get_dist(T, AB) > 8 || (AB.stat & (NOPOWER | BROKEN))) continue diff --git a/code/game/objects/items/weapons/tether.dm b/code/game/objects/items/weapons/tether.dm index 0a92eca6b7f..a8313b0e06f 100644 --- a/code/game/objects/items/weapons/tether.dm +++ b/code/game/objects/items/weapons/tether.dm @@ -1,4 +1,4 @@ -var/list/global/all_tethers = list() +GLOBAL_LIST_INIT_TYPED(all_tethers, /obj/item/tethering_device, list()) /obj/item/tethering_device name = "tethering device" @@ -18,7 +18,7 @@ var/list/global/all_tethers = list() /obj/item/tethering_device/Initialize(mapload, ...) . = ..() - all_tethers += src + GLOB.all_tethers += src /obj/item/tethering_device/update_icon() ClearOverlays() @@ -28,7 +28,7 @@ var/list/global/all_tethers = list() /obj/item/tethering_device/Destroy() STOP_PROCESSING(SSprocessing, src) deactivate() - all_tethers -= src + GLOB.all_tethers -= src return ..() /obj/item/tethering_device/attack_self(mob/user) @@ -44,7 +44,7 @@ var/list/global/all_tethers = list() /obj/item/tethering_device/process() var/turf/our_turf = get_turf(src) - for(var/tether in all_tethers - src) + for(var/tether in GLOB.all_tethers - src) var/obj/item/tethering_device/TD = tether if(!TD.active) continue @@ -74,7 +74,7 @@ var/list/global/all_tethers = list() for(var/beam in active_beams) var/datum/beam/exploration/B = active_beams[beam] B.End() - for(var/tether in all_tethers) + for(var/tether in GLOB.all_tethers) var/obj/item/tethering_device/TD = tether TD.untether(src) diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index 1487cde927b..dc02ae6f313 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -656,11 +656,11 @@ var/stocktype = pickweight(spawntypes) switch (stocktype) if ("1") - return pickweight(random_stock_rare) + return pickweight(GLOB.random_stock_rare) if ("2") - return pickweight(random_stock_uncommon) + return pickweight(GLOB.random_stock_uncommon) if ("3") - return pickweight(random_stock_common) + return pickweight(GLOB.random_stock_common) /obj/structure/closet/crate/extinguisher_cartridges name = "crate of extinguisher cartridges" diff --git a/code/game/objects/structures/under_wardrobe.dm b/code/game/objects/structures/under_wardrobe.dm index 1127388d8f0..e9875d8c7d1 100644 --- a/code/game/objects/structures/under_wardrobe.dm +++ b/code/game/objects/structures/under_wardrobe.dm @@ -19,7 +19,7 @@ /obj/structure/undies_wardrobe/interact(var/mob/living/carbon/human/H) var/dat = list() dat += "Underwear:
    " - for(var/datum/category_group/underwear/UWC in global_underwear.categories) + for(var/datum/category_group/underwear/UWC in GLOB.global_underwear.categories) var/datum/category_item/underwear/UWI = H.all_underwear[UWC.name] var/item_name = UWI?.name || "None" dat += "[UWC.name]: [item_name]" @@ -68,7 +68,7 @@ H.all_underwear -= href_list["remove_underwear"] . = TRUE else if(href_list["change_underwear"]) - var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[href_list["change_underwear"]] + var/datum/category_group/underwear/UWC = GLOB.global_underwear.categories_by_name[href_list["change_underwear"]] if(!UWC) return var/datum/category_item/underwear/selected_underwear = tgui_input_list(H, "Choose your underwear.", "Choose Underwear", UWC.items, H.all_underwear[UWC.name]) diff --git a/code/game/periodic_news.dm b/code/game/periodic_news.dm index a89a877eb32..4afdec39789 100644 --- a/code/game/periodic_news.dm +++ b/code/game/periodic_news.dm @@ -103,18 +103,17 @@ the riots. More on this at 6."} round_time = 60 * 60 - -var/global/list/newscaster_standard_feeds = list(/datum/news_announcement/bluespace_research, /datum/news_announcement/lotus_tree, /datum/news_announcement/random_junk, /datum/news_announcement/food_riots) +GLOBAL_LIST_INIT(newscaster_standard_feeds, list(/datum/news_announcement/bluespace_research, /datum/news_announcement/lotus_tree, /datum/news_announcement/random_junk, /datum/news_announcement/food_riots)) /proc/process_newscaster() check_for_newscaster_updates(SSticker.mode.newscaster_announcements) -var/global/tmp/announced_news_types = list() +GLOBAL_LIST_INIT(announced_news_types, list()) /proc/check_for_newscaster_updates(type) for(var/subtype in typesof(type)-type) var/datum/news_announcement/news = new subtype() - if(news.round_time * 10 <= world.time && !(subtype in announced_news_types)) - announced_news_types += subtype + if(news.round_time * 10 <= world.time && !(subtype in GLOB.announced_news_types)) + GLOB.announced_news_types += subtype announce_newscaster_news(news) /proc/announce_newscaster_news(datum/news_announcement/news) diff --git a/code/game/turfs/initialization/maintenance.dm b/code/game/turfs/initialization/maintenance.dm index e8153fcb5a3..52675c93f1a 100644 --- a/code/game/turfs/initialization/maintenance.dm +++ b/code/game/turfs/initialization/maintenance.dm @@ -28,21 +28,21 @@ if(prob(25)) // Keep in mind that only "corners" get any sort of web attempt_web(T, cardinal_turfs) -var/global/list/random_junk +GLOBAL_LIST_INIT_TYPED(random_junk, /obj, null) /datum/turf_initializer/maintenance/proc/junk() if(prob(25)) return /obj/effect/decal/cleanable/generic - if(!random_junk) - random_junk = subtypesof(/obj/item/trash) - random_junk += typesof(/obj/item/trash/cigbutt) - random_junk += /obj/effect/decal/cleanable/spiderling_remains - random_junk += /obj/effect/decal/remains/rat - random_junk += /obj/effect/decal/remains/robot - random_junk -= /obj/item/trash/plate - random_junk -= /obj/item/trash/snack_bowl - random_junk -= /obj/item/trash/syndi_cakes - random_junk -= /obj/item/trash/tray - return pick(random_junk) + if(!GLOB.random_junk) + GLOB.random_junk = subtypesof(/obj/item/trash) + GLOB.random_junk += typesof(/obj/item/trash/cigbutt) + GLOB.random_junk += /obj/effect/decal/cleanable/spiderling_remains + GLOB.random_junk += /obj/effect/decal/remains/rat + GLOB.random_junk += /obj/effect/decal/remains/robot + GLOB.random_junk -= /obj/item/trash/plate + GLOB.random_junk -= /obj/item/trash/snack_bowl + GLOB.random_junk -= /obj/item/trash/syndi_cakes + GLOB.random_junk -= /obj/item/trash/tray + return pick(GLOB.random_junk) /datum/turf_initializer/maintenance/proc/dirty_neighbors(var/list/cardinal_turfs) var/how_dirty = 0 diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 05e3d213463..7ad97815884 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -35,7 +35,7 @@ if(use_space_appearance) appearance = SSskybox.space_appearance_cache[(((x + y) ^ ~(x * y) + z) % 25) + 1] - if(GLOB.config.starlight && use_starlight && lighting_overlays_initialized) + if(GLOB.config.starlight && use_starlight && GLOB.lighting_overlays_initialized) update_starlight() for(var/atom/movable/AM as mob|obj in src) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index e6661b99250..1dfe263a74e 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -349,8 +349,6 @@ return FALSE return TRUE -var/const/enterloopsanity = 100 - /turf/Entered(atom/movable/arrived, atom/old_loc) if(movement_disabled) to_chat(usr, SPAN_WARNING("Movement is admin-disabled.")) //This is to identify lag problems) @@ -413,7 +411,7 @@ var/const/enterloopsanity = 100 var/objects = 0 if(arrived && (arrived.movable_flags & MOVABLE_FLAG_PROXMOVE) && arrived.simulated) for(var/atom/movable/oAM in range(1, src)) - if(objects > enterloopsanity) + if(objects > 100) break objects++ @@ -434,7 +432,7 @@ var/const/enterloopsanity = 100 //Items that are in phoron, but not on a mob, can still be contaminated. var/obj/item/I = arrived - if(istype(I) && vsc.plc.CLOTH_CONTAMINATION && I.can_contaminate()) + if(istype(I) && GLOB.vsc.plc.CLOTH_CONTAMINATION && I.can_contaminate()) var/datum/gas_mixture/env = return_air(1) if(!env) return diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 50d4eff6ef0..305c7a86f52 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -88,7 +88,7 @@ regenerate_ao() #endif - if(lighting_overlays_initialized) + if(GLOB.lighting_overlays_initialized) recalc_atom_opacity() lighting_overlay = old_lighting_overlay if (lighting_overlay && lighting_overlay.loc != src) diff --git a/code/game/world.dm b/code/game/world.dm index dd812518746..242e19e5a4a 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -103,7 +103,7 @@ GLOBAL_PROTECT(config) #ifdef UNIT_TEST #if defined(MANUAL_UNIT_TEST) - world.log << "[ascii_green] *** NOTICE *** [ascii_reset] Unit Tests Enabled. This will destroy the world when testing is complete." + world.log << TEST_OUTPUT_GREEN("*** NOTICE *** Unit Tests Enabled. This will destroy the world when testing is complete.") #else @@ -120,7 +120,7 @@ GLOBAL_PROTECT(config) return -var/list/world_api_rate_limit = list() +GLOBAL_LIST_INIT(world_api_rate_limit, list()) /world/Topic(T, addr, master, key) var/list/response[] = list() diff --git a/code/js/byjax.dm b/code/js/byjax.dm deleted file mode 100644 index a7949d18570..00000000000 --- a/code/js/byjax.dm +++ /dev/null @@ -1,50 +0,0 @@ -//this function places received data into element with specified id. -var/const/js_byjax = {" - -function replaceContent() { - var args = Array.prototype.slice.call(arguments); - var id = args\[0\]; - var content = args\[1\]; - var callback = null; - if(args\[2\]){ - callback = args\[2\]; - if(args\[3\]){ - args = args.slice(3); - } - } - var parent = document.getElementById(id); - if(typeof(parent)!=='undefined' && parent!=null){ - parent.innerHTML = content?content:''; - } - if(callback && window\[callback\]){ - window\[callback\].apply(null,args); - } -} -"} - -/* -sends data to control_id:replaceContent - -receiver - mob -control_id - window id (for windows opened with browse(), it'll be "windowname.browser") -target_element - HTML element id -new_content - HTML content -callback - js function that will be called after the data is sent -callback_args - arguments for callback function - -Be sure to include required js functions in your page, or it'll raise an exception. -*/ -/proc/send_byjax(receiver, control_id, target_element, new_content=null, callback=null, list/callback_args=null) - if(receiver && target_element && control_id) // && winexists(receiver, control_id)) - var/list/argums = list(target_element, new_content) - if(callback) - argums += callback - if(callback_args) - argums += callback_args - argums = list2params(argums) -/* if(callback_args) - argums += "&[list2params(callback_args)]" -*/ - send_output(receiver, argums, "[control_id]:replaceContent") - return - diff --git a/code/js/menus.dm b/code/js/menus.dm deleted file mode 100644 index 0064522c2f8..00000000000 --- a/code/js/menus.dm +++ /dev/null @@ -1,37 +0,0 @@ -var/const/js_dropdowns = {" -function dropdowns() { - var divs = document.getElementsByTagName('div'); - var headers = new Array(); - var links = new Array(); - for(var i=0;i=0) { - elem.className = elem.className.replace('visible','hidden'); - this.className = this.className.replace('open','closed'); - this.innerHTML = this.innerHTML.replace('-','+'); - } - else { - elem.className = elem.className.replace('hidden','visible'); - this.className = this.className.replace('closed','open'); - this.innerHTML = this.innerHTML.replace('+','-'); - } - return false; - } - })(links\[i\]); - } - } -} -"} diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index db50850439c..53047a946f0 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1,6 +1,5 @@ var/global/BSACooldown = 0 -var/global/floorIsLava = 0 var/global/enabled_spooking = 0 //////////////////////////////// @@ -109,7 +108,7 @@ var/global/enabled_spooking = 0 body += "" for(var/psi_rank in list(PSI_RANK_SENSITIVE, PSI_RANK_HARMONIOUS, PSI_RANK_APEX, PSI_RANK_LIMITLESS)) var/owner_rank = psyker.psi ? psyker.psi.get_rank() : 0 - var/psi_title = psychic_ranks_to_strings[psi_rank] + var/psi_title = GLOB.psychic_ranks_to_strings[psi_rank] if(psi_rank == owner_rank) psi_title = "[psi_title]" if(psi_rank != PSI_RANK_LIMITLESS) @@ -612,9 +611,9 @@ var/global/enabled_spooking = 0 var/dat = "Job Bans!
    " dat += "Search via ckey
    " dat += "
    " - for (var/ckey in jobban_keylist) - for (var/job in jobban_keylist[ckey]) - var/list/ban = jobban_keylist[ckey][job] + for (var/ckey in GLOB.jobban_keylist) + for (var/job in GLOB.jobban_keylist[ckey]) + var/list/ban = GLOB.jobban_keylist[ckey][job] if (!jobban_isexpired(ban, null, job, ckey)) dat += "" @@ -987,11 +986,11 @@ var/global/enabled_spooking = 0 if(!check_rights(R_SPAWN)) return - var/owner = input("Select a ckey.", "Spawn Custom Item") as null|anything in custom_items - if(!owner|| !custom_items[owner]) + var/owner = input("Select a ckey.", "Spawn Custom Item") as null|anything in GLOB.custom_items + if(!owner|| !GLOB.custom_items[owner]) return - var/list/possible_items = custom_items[owner] + var/list/possible_items = GLOB.custom_items[owner] var/datum/custom_item/item_to_spawn = input("Select an item to spawn.", "Spawn Custom Item") as null|anything in possible_items if(!item_to_spawn) return @@ -1368,7 +1367,7 @@ var/global/enabled_spooking = 0 var/list/sounds = file2list('sound/serversound_list.txt'); sounds += "--CANCEL--" sounds += "--LOCAL--" - sounds += sounds_cache + sounds += GLOB.sounds_cache var/melody = tgui_input_list(usr, "Select a sound from the server to play.", "Sound Selection", sounds) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index ec1da3db540..ad0469d7c20 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,5 +1,6 @@ //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_LIST_INIT(admin_verbs_default, list( /datum/admins/proc/show_player_panel, //shows an interface for individual players, with various links (links require additional flags), /client/proc/player_panel_modern, /client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/ @@ -8,8 +9,9 @@ var/list/admin_verbs_default = list( /client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/ /client/proc/cmd_mentor_check_new_players, /client/proc/notification_add /*allows everyone to set up player notifications*/ - ) -var/list/admin_verbs_admin = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_admin, list( /client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game.*/ /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 */ @@ -103,19 +105,22 @@ var/list/admin_verbs_admin = list( /client/proc/toggle_aooc, /client/proc/force_away_mission, /client/proc/alooc -) -var/list/admin_verbs_ban = list( +)) + +GLOBAL_LIST_INIT(admin_verbs_ban, list( /client/proc/unban_panel, /client/proc/jobbans, /client/proc/warning_panel, /client/proc/stickybanpanel - ) -var/list/admin_verbs_sounds = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_sounds, list( /client/proc/play_local_sound, /client/proc/play_sound, /client/proc/play_server_sound - ) -var/list/admin_verbs_fun = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_fun, list( /client/proc/object_talk, /client/proc/cmd_admin_dress, /client/proc/cmd_admin_grab_observers, @@ -139,9 +144,9 @@ var/list/admin_verbs_fun = list( /client/proc/apply_sunstate, /datum/admins/proc/ccannoucment, /datum/admins/proc/set_odyssey - ) + )) -var/list/admin_verbs_spawn = list( +GLOBAL_LIST_INIT(admin_verbs_spawn, list( /client/proc/game_panel, /datum/admins/proc/spawn_fruit, /datum/admins/proc/spawn_custom_item, @@ -149,8 +154,9 @@ var/list/admin_verbs_spawn = list( /datum/admins/proc/spawn_atom, // allows us to spawn instances, /client/proc/respawn_character, /client/proc/spawn_chemdisp_cartridge - ) -var/list/admin_verbs_server = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_server, list( /datum/admins/proc/capture_map_part, /client/proc/Set_Holiday, /datum/admins/proc/startnow, @@ -175,8 +181,9 @@ var/list/admin_verbs_server = list( /client/proc/configure_access_control, /datum/admins/proc/togglehubvisibility, //toggles visibility on the BYOND Hub /client/proc/force_away_mission - ) -var/list/admin_verbs_debug = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_debug, list( /client/proc/getruntimelog, // allows us to access runtime logs to somebody, /client/proc/cmd_admin_list_open_jobs, /client/proc/Debug2, @@ -237,27 +244,31 @@ var/list/admin_verbs_debug = list( /datum/admins/proc/force_initialize_weather, /datum/admins/proc/force_weather_state, /datum/admins/proc/force_kill_weather - ) + )) -var/list/admin_verbs_paranoid_debug = list( +GLOBAL_LIST_INIT(admin_verbs_paranoid_debug, list( /client/proc/callproc, /client/proc/callproc_target, /client/proc/debug_controller - ) + )) -var/list/admin_verbs_possess = list( + +GLOBAL_LIST_INIT(admin_verbs_possess, list( /proc/possess, /proc/release - ) -var/list/admin_verbs_permissions = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_permissions, list( /client/proc/edit_admin_permissions - ) -var/list/admin_verbs_rejuv = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_rejuv, list( /client/proc/respawn_character - ) + )) + //verbs which can be hidden -var/list/admin_verbs_hideable = list( +GLOBAL_LIST_INIT(admin_verbs_hideable, list( /client/proc/allow_character_respawn, /client/proc/toggle_view_range, /client/proc/stealth, @@ -414,8 +425,9 @@ var/list/admin_verbs_hideable = list( /proc/release, /client/proc/force_away_mission, /client/proc/profiler_start, - ) -var/list/admin_verbs_mod = list( + )) + +GLOBAL_LIST_INIT(admin_verbs_mod, list( /client/proc/cmd_admin_pm_context, // right-click adminPM interface, /client/proc/cmd_admin_pm_panel, // admin-pm list, /client/proc/debug_variables, // allows us to -see- the variables of any instance in the game., @@ -439,9 +451,10 @@ var/list/admin_verbs_mod = list( /client/proc/toggle_aooc, /client/proc/alooc, /client/proc/allow_character_respawn -) +)) -var/list/admin_verbs_dev = list( //will need to be altered - Ryan784 + +GLOBAL_LIST_INIT(admin_verbs_dev, list( //will need to be altered - Ryan784 ///datum/admins/proc/restart, /client/proc/Jump, /client/proc/jumptokey, /*allows us to jump to the location of a mob with a certain ckey*/ @@ -486,8 +499,9 @@ var/list/admin_verbs_dev = list( //will need to be altered - Ryan784 /client/proc/cmd_generate_lag, /client/proc/create_poll, //Allows to create polls /client/proc/profiler_start, -) -var/list/admin_verbs_cciaa = list( +)) + +GLOBAL_LIST_INIT(admin_verbs_cciaa, list( /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ /client/proc/cmd_admin_create_centcom_report, /client/proc/cmd_cciaa_say, @@ -498,54 +512,55 @@ var/list/admin_verbs_cciaa = list( /client/proc/check_antagonists, /client/proc/odyssey_panel, /client/proc/toggle_aooc -) +)) + /client/proc/add_admin_verbs() SHOULD_NOT_SLEEP(TRUE) if(holder) - add_verb(src, admin_verbs_default) + add_verb(src, GLOB.admin_verbs_default) if(holder.rights & R_BUILDMODE) add_verb(src, /client/proc/togglebuildmodeself) - if(holder.rights & R_ADMIN) add_verb(src, admin_verbs_admin) - if(holder.rights & R_BAN) add_verb(src, admin_verbs_ban) - if(holder.rights & R_FUN) add_verb(src, admin_verbs_fun) - if(holder.rights & R_SERVER) add_verb(src, admin_verbs_server) + if(holder.rights & R_ADMIN) add_verb(src, GLOB.admin_verbs_admin) + if(holder.rights & R_BAN) add_verb(src, GLOB.admin_verbs_ban) + if(holder.rights & R_FUN) add_verb(src, GLOB.admin_verbs_fun) + if(holder.rights & R_SERVER) add_verb(src, GLOB.admin_verbs_server) if(holder.rights & R_DEBUG) - add_verb(src, admin_verbs_debug) + add_verb(src, GLOB.admin_verbs_debug) if(GLOB.config.debugparanoid && !(holder.rights & R_ADMIN)) - remove_verb(src, admin_verbs_paranoid_debug) //Right now it's just callproc but we can easily add others later on. - if(holder.rights & R_POSSESS) add_verb(src, admin_verbs_possess) - if(holder.rights & R_PERMISSIONS) add_verb(src, admin_verbs_permissions) + remove_verb(src, GLOB.admin_verbs_paranoid_debug) //Right now it's just callproc but we can easily add others later on. + if(holder.rights & R_POSSESS) add_verb(src, GLOB.admin_verbs_possess) + if(holder.rights & R_PERMISSIONS) add_verb(src, GLOB.admin_verbs_permissions) if(holder.rights & R_STEALTH) add_verb(src, /client/proc/stealth) - if(holder.rights & R_REJUVINATE) add_verb(src, admin_verbs_rejuv) - if(holder.rights & R_SPAWN) add_verb(src, admin_verbs_spawn) - if(holder.rights & R_SOUNDS) add_verb(src, admin_verbs_sounds) - if(holder.rights & R_MOD) add_verb(src, admin_verbs_mod) - if(holder.rights & R_DEV) add_verb(src, admin_verbs_dev) - if(holder.rights & R_CCIAA) add_verb(src, admin_verbs_cciaa) + if(holder.rights & R_REJUVINATE) add_verb(src, GLOB.admin_verbs_rejuv) + if(holder.rights & R_SPAWN) add_verb(src, GLOB.admin_verbs_spawn) + if(holder.rights & R_SOUNDS) add_verb(src, GLOB.admin_verbs_sounds) + if(holder.rights & R_MOD) add_verb(src, GLOB.admin_verbs_mod) + if(holder.rights & R_DEV) add_verb(src, GLOB.admin_verbs_dev) + if(holder.rights & R_CCIAA) add_verb(src, GLOB.admin_verbs_cciaa) /client/proc/remove_admin_verbs() - remove_verb(src, admin_verbs_default) + remove_verb(src, GLOB.admin_verbs_default) remove_verb(src, /client/proc/togglebuildmodeself) - remove_verb(src, admin_verbs_admin) - remove_verb(src, admin_verbs_ban) - remove_verb(src, admin_verbs_fun) - remove_verb(src, admin_verbs_server) - remove_verb(src, admin_verbs_debug) - remove_verb(src, admin_verbs_possess) - remove_verb(src, admin_verbs_permissions) + remove_verb(src, GLOB.admin_verbs_admin) + remove_verb(src, GLOB.admin_verbs_ban) + remove_verb(src, GLOB.admin_verbs_fun) + remove_verb(src, GLOB.admin_verbs_server) + remove_verb(src, GLOB.admin_verbs_debug) + remove_verb(src, GLOB.admin_verbs_possess) + remove_verb(src, GLOB.admin_verbs_permissions) remove_verb(src, /client/proc/stealth) - remove_verb(src, admin_verbs_rejuv) - remove_verb(src, admin_verbs_sounds) - remove_verb(src, admin_verbs_spawn) - remove_verb(src, debug_verbs) + remove_verb(src, GLOB.admin_verbs_rejuv) + remove_verb(src, GLOB.admin_verbs_sounds) + remove_verb(src, GLOB.admin_verbs_spawn) + remove_verb(src, GLOB.debug_verbs) add_aooc_if_necessary() /client/proc/hide_most_verbs()//Allows you to keep some functionality while hiding some verbs set name = "Adminverbs - Hide Most" set category = "Admin" - remove_verb(src, admin_verbs_hideable) + remove_verb(src, GLOB.admin_verbs_hideable) add_verb(src, /client/proc/show_verbs) to_chat(src, "Most of your adminverbs have been hidden.") @@ -1104,7 +1119,7 @@ var/list/admin_verbs_cciaa = list( set category = "Fun" set name = "Give Spell" set desc = "Gives a spell to a mob." - var/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spells + var/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in GLOB.spells if(!S) return T.add_spell(new S) feedback_add_details("admin_verb","GS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -1138,7 +1153,7 @@ var/list/admin_verbs_cciaa = list( if (!check_rights(R_ADMIN)) return - var/mob/living/silicon/ai/target = tgui_input_list(usr, "Choose the AI to force-wipe.", "AI Termination", ai_list) + var/mob/living/silicon/ai/target = tgui_input_list(usr, "Choose the AI to force-wipe.", "AI Termination", GLOB.ai_list) if (!target || alert("Are you sure you want to wipe [target.name]? They will be ghosted and their job slot freed.", "Confirm AI Termination", "No", "No", "Yes") != "Yes") return diff --git a/code/modules/admin/banjob.dm b/code/modules/admin/banjob.dm index 82c149a662a..16394cb4d2c 100644 --- a/code/modules/admin/banjob.dm +++ b/code/modules/admin/banjob.dm @@ -14,7 +14,8 @@ tgt = CKM.ckey; \ } -var/list/jobban_keylist = list() // Global jobban list. +GLOBAL_LIST_INIT(jobban_keylist, list()) +GLOBAL_PROTECT(jobban_keylist) /* * Expected format: @@ -70,11 +71,11 @@ var/list/jobban_keylist = list() // Global jobban list. return // Create a new record if the client isn't logged already. - if (!jobban_keylist[key]) - jobban_keylist[key] = list() + if (!GLOB.jobban_keylist[key]) + GLOB.jobban_keylist[key] = list() // Sanity catch. This shouldn't happen, but better safe than sorry. - if (jobban_keylist[key][rank] && !jobban_isexpired(jobban_keylist[key][rank], player, rank)) + if (GLOB.jobban_keylist[key][rank] && !jobban_isexpired(GLOB.jobban_keylist[key][rank], player, rank)) log_and_message_admins("Attempted to apply a jobban to [key] while they already have an active ban. Job: [rank].") return @@ -84,7 +85,7 @@ var/list/jobban_keylist = list() // Global jobban list. unban_time = world.realtime + (minutes MINUTES) // Create the entry. - jobban_keylist[key][rank] = list(reason, unban_time) + GLOB.jobban_keylist[key][rank] = list(reason, unban_time) // Log the ban to the appropriate place. if (GLOB.config.ban_legacy_system) @@ -137,7 +138,7 @@ var/list/jobban_keylist = list() // Global jobban list. antag_ban = TRUE // Get the user's ckey. - var/list/entry = jobban_keylist[ckey] + var/list/entry = GLOB.jobban_keylist[ckey] // If this is false, then we have no entry. As such, they have no active // bans! @@ -165,11 +166,11 @@ var/list/jobban_keylist = list() // Global jobban list. */ /proc/jobban_loadbanfile() var/savefile/S = new("data/job_full.ban") - S["bans"] >> jobban_keylist + S["bans"] >> GLOB.jobban_keylist log_admin("Loading jobban_rank") - if (!jobban_keylist) - jobban_keylist = list() + if (!GLOB.jobban_keylist) + GLOB.jobban_keylist = list() log_admin("jobban_keylist was empty") /** @@ -195,14 +196,14 @@ var/list/jobban_keylist = list() // Global jobban list. var/job = query.item[3] var/reason = query.item[4] - if (!jobban_keylist[ckey]) - jobban_keylist[ckey] = list() + if (!GLOB.jobban_keylist[ckey]) + GLOB.jobban_keylist[ckey] = list() - if (!jobban_keylist[ckey][job]) + if (!GLOB.jobban_keylist[ckey][job]) // Insert it with 0 time because the expiration of a temp jobban for // MySQL is dependent on the database and query itself. So we can just // politely not care. - jobban_keylist[ckey][job] = list(reason, -1) + GLOB.jobban_keylist[ckey][job] = list(reason, -1) else // Woups. What happened here...? log_and_message_admins("JOBBANS: Duplicate jobban entry in MySQL for [ckey]. Ban ID: #[query.item[1]]") @@ -212,7 +213,7 @@ var/list/jobban_keylist = list() // Global jobban list. */ /proc/jobban_savebanfile() var/savefile/S = new("data/job_full.ban") - S["bans"] << jobban_keylist + S["bans"] << GLOB.jobban_keylist /** * Removes a jobban entry from the code and calls the config appropriate @@ -234,7 +235,7 @@ var/list/jobban_keylist = list() // Global jobban list. return // Check for a player record. - var/list/entry = jobban_keylist[ckey] + var/list/entry = GLOB.jobban_keylist[ckey] if (entry) // Find the specific ban. var/list/ban = entry[rank] @@ -245,8 +246,8 @@ var/list/jobban_keylist = list() // Global jobban list. // If the entry is now empty, remove the entire ckey from the list. if (!entry.len) - jobban_keylist[ckey] = null - jobban_keylist -= ckey + GLOB.jobban_keylist[ckey] = null + GLOB.jobban_keylist -= ckey // Update appropriate ban files. if (GLOB.config.ban_legacy_system) diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 9a1e5905182..981c5c65687 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -70,9 +70,9 @@ var/list/data = list() data["gamemode"] = SSticker.mode.name data["round_duration"] = get_round_duration_formatted() - data["evacuation_is_idle"] = evacuation_controller.is_idle() - data["time_left"] = evacuation_controller.get_eta() - data["waiting_to_leave"] = evacuation_controller.waiting_to_leave() + data["evacuation_is_idle"] = GLOB.evacuation_controller.is_idle() + data["time_left"] = GLOB.evacuation_controller.get_eta() + data["waiting_to_leave"] = GLOB.evacuation_controller.waiting_to_leave() data["round_delayed"] = SSticker.delay_end data["antagonists"] = list() data["antagonist_types"] = list() @@ -89,7 +89,7 @@ data["antagonist_types"] |= A.role_text_plural if(A.flags & ANTAG_HAS_NUKE) data["nuke_disks"] = list() - for(var/obj/item/disk/nuclear/N in nuke_disks) + for(var/obj/item/disk/nuclear/N in GLOB.nuke_disks) var/turf/T = get_turf(N) var/location_name if(ismob(N.loc)) @@ -120,16 +120,16 @@ return switch(params["call_shuttle"]) if("1") - if (evacuation_controller.call_evacuation(usr, TRUE)) + if (GLOB.evacuation_controller.call_evacuation(usr, TRUE)) log_admin("[key_name(usr)] called an evacuation.") message_admins("[key_name_admin(usr)] called an evacuation.", 1) . = TRUE if("2") - if (evacuation_controller.call_evacuation(usr, TRUE)) + if (GLOB.evacuation_controller.call_evacuation(usr, TRUE)) log_admin("[key_name(usr)] called an evacuation.") message_admins("[key_name_admin(usr)] called an evacuation.", 1) - else if (evacuation_controller.cancel_evacuation()) + else if (GLOB.evacuation_controller.cancel_evacuation()) log_admin("[key_name(usr)] cancelled an evacuation.") message_admins("[key_name_admin(usr)] cancelled an evacuation.", 1) . = TRUE diff --git a/code/modules/admin/secrets/admin_secrets/alter_narsie.dm b/code/modules/admin/secrets/admin_secrets/alter_narsie.dm index d834d801afd..b353bbe7785 100644 --- a/code/modules/admin/secrets/admin_secrets/alter_narsie.dm +++ b/code/modules/admin/secrets/admin_secrets/alter_narsie.dm @@ -8,7 +8,7 @@ var/choice = input(user, "How do you wish for Nar-Sie to interact with its surroundings?") as null|anything in list("CultStation13", "Nar-Singulo") if(choice == "CultStation13") log_and_message_admins("has set narsie's behaviour to \"CultStation13\".", user) - narsie_behaviour = choice + GLOB.narsie_behaviour = choice if(choice == "Nar-Singulo") log_and_message_admins("has set narsie's behaviour to \"Nar-Singulo\".", user) - narsie_behaviour = choice + GLOB.narsie_behaviour = choice diff --git a/code/modules/admin/secrets/random_events/trigger_cordical_borer_infestation.dm b/code/modules/admin/secrets/random_events/trigger_cordical_borer_infestation.dm index d7e09d845e6..8488c7b6d96 100644 --- a/code/modules/admin/secrets/random_events/trigger_cordical_borer_infestation.dm +++ b/code/modules/admin/secrets/random_events/trigger_cordical_borer_infestation.dm @@ -4,4 +4,4 @@ /datum/admin_secret_item/random_event/trigger_cordical_borer_infestation/execute(var/mob/user) . = ..() if(.) - return borers.attempt_random_spawn() + return GLOB.borers.attempt_random_spawn() diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index b419472cd8f..8dca8f3cf61 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -116,15 +116,15 @@ switch(href_list["call_shuttle"]) if("1") - if (evacuation_controller.call_evacuation(usr, TRUE)) + if (GLOB.evacuation_controller.call_evacuation(usr, TRUE)) log_admin("[key_name(usr)] called an evacuation.") message_admins("[key_name_admin(usr)] called an evacuation.", 1) if("2") - if (evacuation_controller.call_evacuation(usr, TRUE)) + if (GLOB.evacuation_controller.call_evacuation(usr, TRUE)) log_admin("[key_name(usr)] called an evacuation.") message_admins("[key_name_admin(usr)] called an evacuation.", 1) - else if (evacuation_controller.cancel_evacuation()) + else if (GLOB.evacuation_controller.cancel_evacuation()) log_admin("[key_name(usr)] cancelled an evacuation.") message_admins("[key_name_admin(usr)] cancelled an evacuation.", 1) @@ -1007,7 +1007,7 @@ var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["faxMachine"]) department = fax.department else - department = input("Choose the target department.", "Target Department", null) in alldepartments + department = input("Choose the target department.", "Target Department", null) in GLOB.alldepartments create_admin_fax(department) @@ -1304,7 +1304,7 @@ WANTED.backup_author = src.admincaster_signature //Submitted by WANTED.is_admin_message = 1 SSnews.wanted_issue = WANTED - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.newsAlert() NEWSCASTER.update_icon() src.admincaster_screen = 15 @@ -1320,7 +1320,7 @@ var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") if(choice=="Confirm") SSnews.wanted_issue = null - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + for(var/obj/machinery/newscaster/NEWSCASTER in GLOB.allCasters) NEWSCASTER.update_icon() src.admincaster_screen=17 src.access_news_network() @@ -1458,11 +1458,11 @@ else if(href_list["vsc"]) if(check_rights(R_ADMIN|R_SERVER)) if(href_list["vsc"] == "airflow") - vsc.ChangeSettingsDialog(usr,vsc.settings) + GLOB.vsc.ChangeSettingsDialog(usr, GLOB.vsc.settings) if(href_list["vsc"] == GAS_PHORON) - vsc.ChangeSettingsDialog(usr,vsc.plc.settings) + GLOB.vsc.ChangeSettingsDialog(usr, GLOB.vsc.plc.settings) if(href_list["vsc"] == "default") - vsc.SetDefault(usr) + GLOB.vsc.SetDefault(usr) else if(href_list["toglang"]) if(check_rights(R_SPAWN)) diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index c3b41d63580..52ab55163d6 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -1,6 +1,6 @@ //This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE! -var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as") +GLOBAL_LIST_INIT(adminhelp_ignored_words, list("unknown","the","a","an","of","monkey","alien","as")) /proc/generate_ahelp_key_words(var/mob/mob, var/msg) var/list/surnames = list() @@ -38,7 +38,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey"," for(var/original_word in msglist) var/word = ckey(original_word) if(word) - if(!(word in adminhelp_ignored_words)) + if(!(word in GLOB.adminhelp_ignored_words)) if(word == "ai" && !ai_found) ai_found = 1 msg += "[original_word] (CL) " diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index eb79ba095b4..4ec12e06561 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -163,7 +163,7 @@ set category = "Debug" to_chat(usr, "Jobbans active in this round.") - for(var/t in jobban_keylist) + for(var/t in GLOB.jobban_keylist) to_chat(usr, "[t]") /client/proc/print_jobban_old_filter() @@ -176,6 +176,6 @@ return to_chat(usr, "Jobbans active in this round.") - for(var/t in jobban_keylist) + for(var/t in GLOB.jobban_keylist) if(findtext(t, filter)) to_chat(usr, "[t]") diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 71422fac612..6f6798cfef9 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -19,8 +19,8 @@ //- Identify how hard it is to break into the area and where the weak points are //- Check if the area has too much empty space. If so, make it smaller and replace the rest with maintenance tunnels. -var/camera_range_display_status = 0 -var/intercom_range_display_status = 0 +GLOBAL_VAR_INIT(camera_range_display_status, 0) +GLOBAL_VAR_INIT(intercom_range_display_status, 0) /obj/effect/debugging/camera_range icon = 'icons/480x480.dmi' @@ -45,17 +45,17 @@ var/intercom_range_display_status = 0 set category = "Mapping" set name = "Camera Range Display" - if(camera_range_display_status) - camera_range_display_status = 0 + if(GLOB.camera_range_display_status) + GLOB.camera_range_display_status = 0 else - camera_range_display_status = 1 + GLOB.camera_range_display_status = 1 for(var/obj/effect/debugging/camera_range/C in world) qdel(C) - if(camera_range_display_status) + if(GLOB.camera_range_display_status) for(var/obj/machinery/camera/C in GLOB.cameranet.cameras) new/obj/effect/debugging/camera_range(C.loc) feedback_add_details("admin_verb","mCRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -108,15 +108,15 @@ var/intercom_range_display_status = 0 set category = "Mapping" set name = "Intercom Range Display" - if(intercom_range_display_status) - intercom_range_display_status = 0 + if(GLOB.intercom_range_display_status) + GLOB.intercom_range_display_status = 0 else - intercom_range_display_status = 1 + GLOB.intercom_range_display_status = 1 for(var/obj/effect/debugging/marker/M in world) qdel(M) - if(intercom_range_display_status) + if(GLOB.intercom_range_display_status) for(var/obj/item/device/radio/intercom/I in world) for(var/turf/T in orange(7,I)) var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T) @@ -124,7 +124,7 @@ var/intercom_range_display_status = 0 qdel(F) feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -var/list/debug_verbs = list ( +GLOBAL_LIST_INIT(debug_verbs, list( /client/proc/do_not_use_these ,/client/proc/camera_view ,/client/proc/sec_camera_report @@ -165,7 +165,7 @@ var/list/debug_verbs = list ( ,/client/proc/get_bad_fdoors ,/client/proc/get_bad_doors ,/client/proc/analyze_openturf - ) + )) /client/proc/enable_debug_verbs() @@ -174,7 +174,7 @@ var/list/debug_verbs = list ( if(!check_rights(R_DEBUG|R_DEV)) return - add_verb(src, debug_verbs) + add_verb(src, GLOB.debug_verbs) feedback_add_details("admin_verb","mDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -184,7 +184,7 @@ var/list/debug_verbs = list ( if(!check_rights(R_DEBUG|R_DEV)) return - remove_verb(src, debug_verbs) + remove_verb(src, GLOB.debug_verbs) init_verbs() feedback_add_details("admin_verb","hDV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -332,7 +332,7 @@ var/list/debug_verbs = list ( feedback_add_details("admin_verb","mOBJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -var/global/prevent_airgroup_regroup = 0 +// var/global/prevent_airgroup_regroup = 0 /client/proc/break_all_air_groups() set category = "Mapping" diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index be280f7ae66..a53fc8a826b 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,4 +1,4 @@ -var/list/sounds_cache = list() +GLOBAL_LIST_INIT_TYPED(sounds_cache, /sound, list()) /client/proc/play_sound(S as sound) set category = "Fun" @@ -8,7 +8,7 @@ var/list/sounds_cache = list() var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777) uploaded_sound.priority = 250 - sounds_cache += S + GLOB.sounds_cache += S if(alert("Do you ready?\nSong: [S]\nNow you can also play this sound using \"Play Server Sound\".", "Confirmation request" ,"Play", "Cancel") == "Cancel") return @@ -39,7 +39,7 @@ var/list/sounds_cache = list() var/list/sounds = file2list('sound/serversound_list.txt'); sounds += "--CANCEL--" - sounds += sounds_cache + sounds += GLOB.sounds_cache var/melody = input("Select a sound from the server to play", "Server sound list", "--CANCEL--") in sounds diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 4e8a7a8530c..f3060f9f099 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -282,7 +282,7 @@ Ccomp's first proc. if (G.client) P = G.client.prefs else if (G.ckey) - P = preferences_datums[G.ckey] + P = GLOB.preferences_datums[G.ckey] else to_chat(src, "Something went wrong, couldn't find the target's preferences datum") return 0 @@ -433,9 +433,9 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!new_character.real_name) if(new_character.gender == MALE) - new_character.real_name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + new_character.real_name = capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) else - new_character.real_name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + new_character.real_name = capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) new_character.name = new_character.real_name if(G_found.mind && !G_found.mind.active) @@ -882,7 +882,7 @@ Traitors and the like can also be revived with the previous role mostly intact. set category = "Admin" set name = "Call Evacuation" - if ((!( ROUND_IS_STARTED ) || !evacuation_controller)) + if ((!( ROUND_IS_STARTED ) || !GLOB.evacuation_controller)) return if(!check_rights(R_ADMIN)) @@ -907,7 +907,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return var/choice = input("Is this an emergency evacuation, bluespace jump, or a crew transfer?") in list(TRANSFER_EMERGENCY, TRANSFER_CREW, TRANSFER_JUMP) - evacuation_controller.call_evacuation(usr, choice) + GLOB.evacuation_controller.call_evacuation(usr, choice) feedback_add_details("admin_verb","CSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! @@ -923,7 +923,7 @@ Traitors and the like can also be revived with the previous role mostly intact. if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return - if(!ROUND_IS_STARTED || !evacuation_controller) + if(!ROUND_IS_STARTED || !GLOB.evacuation_controller) return if(SSatlas.current_map.shuttle_call_restarts) @@ -939,7 +939,7 @@ Traitors and the like can also be revived with the previous role mostly intact. return - evacuation_controller.cancel_evacuation() + GLOB.evacuation_controller.cancel_evacuation() feedback_add_details("admin_verb","CCSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] admin-cancelled the evacuation.") message_admins(SPAN_NOTICE("[key_name_admin(usr)] admin-cancelled the evacuation."), 1) @@ -956,10 +956,10 @@ Traitors and the like can also be revived with the previous role mostly intact. if(!check_rights(R_ADMIN)) return - evacuation_controller.deny = !evacuation_controller.deny + GLOB.evacuation_controller.deny = !GLOB.evacuation_controller.deny - log_admin("[key_name(src)] has [evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.") - message_admins("[key_name_admin(usr)] has [evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.") + log_admin("[key_name(src)] has [GLOB.evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.") + message_admins("[key_name_admin(usr)] has [GLOB.evacuation_controller.deny ? "denied" : "allowed"] the evacuation to be called.") /client/proc/cmd_admin_attack_log(mob/M as mob in GLOB.mob_list) set category = "Special Verbs" diff --git a/code/modules/admin/verbs/warning.dm b/code/modules/admin/verbs/warning.dm index e9f0bc820fe..c13e2ded9c3 100644 --- a/code/modules/admin/verbs/warning.dm +++ b/code/modules/admin/verbs/warning.dm @@ -68,7 +68,7 @@ var/datum/preferences/D var/client/C = GLOB.directory[warned_ckey] if(C) D = C.prefs - else D = preferences_datums[warned_ckey] + else D = GLOB.preferences_datums[warned_ckey] if(!D) to_chat(src, SPAN_WARNING("Error: warn_legacy(): No such ckey found.")) diff --git a/code/modules/alarm/alarm.dm b/code/modules/alarm/alarm.dm index 84a85077867..643ca1bf596 100644 --- a/code/modules/alarm/alarm.dm +++ b/code/modules/alarm/alarm.dm @@ -76,9 +76,9 @@ /datum/alarm/proc/cameras() // reset camera cache - if(camera_repository.camera_cache_id != cache_id) + if(GLOB.camera_repository.camera_cache_id != cache_id) cameras = null - cache_id = camera_repository.camera_cache_id + cache_id = GLOB.camera_repository.camera_cache_id // If the alarm origin has changed area, for example a borg containing an alarming camera, reset the list of cameras else if(cameras && (last_camera_area != alarm_area())) cameras = null diff --git a/code/modules/asset_cache/asset_cache.dm b/code/modules/asset_cache/asset_cache.dm index 1e355998ff3..1e33d367c89 100644 --- a/code/modules/asset_cache/asset_cache.dm +++ b/code/modules/asset_cache/asset_cache.dm @@ -2,15 +2,15 @@ //Place any asset datums you create in asset_list_items.dm //all of our asset datums, used for referring to these later -var/list/asset_datums = list() +GLOBAL_LIST_EMPTY(asset_datums) //get an assetdatum or make a new one //does NOT ensure it's filled, if you want that use get_asset_datum() /proc/load_asset_datum(type) - return asset_datums[type] || new type() + return GLOB.asset_datums[type] || new type() /proc/get_asset_datum(type) - var/datum/asset/loaded_asset = asset_datums[type] || new type() + var/datum/asset/loaded_asset = GLOB.asset_datums[type] || new type() return loaded_asset.ensure_ready() /proc/simple_asset_ensure_is_sent(client, type) @@ -32,7 +32,7 @@ var/list/asset_datums = list() var/cross_round_cachable = FALSE /datum/asset/New() - asset_datums[type] = src + GLOB.asset_datums[type] = src register() /// Stub that allows us to react to something trying to get us diff --git a/code/modules/cargo/bounty.dm b/code/modules/cargo/bounty.dm index 253db45ec2a..8d9a7b85d6f 100644 --- a/code/modules/cargo/bounty.dm +++ b/code/modules/cargo/bounty.dm @@ -23,7 +23,7 @@ description = replacetext(description, "%BOSSSHORT", SSatlas.current_map.boss_short) description = replacetext(description, "%COMPNAME", SSatlas.current_map.company_name) description = replacetext(description, "%COMPSHORT", SSatlas.current_map.company_short) - description = replacetext(description, "%PERSONNAME","[pick("Trooper", "Commander", "Agent", "Director", "Doctor")] [pick(last_names)]") + description = replacetext(description, "%PERSONNAME","[pick("Trooper", "Commander", "Agent", "Director", "Doctor")] [pick(GLOB.last_names)]") // Displayed on bounty UI screen. /datum/bounty/proc/completion_string() diff --git a/code/modules/cargo/delivery/_helpers.dm b/code/modules/cargo/delivery/_helpers.dm index 1800e39501f..359ff89fd4a 100644 --- a/code/modules/cargo/delivery/_helpers.dm +++ b/code/modules/cargo/delivery/_helpers.dm @@ -6,7 +6,7 @@ var/turf/current_turf = get_turf(atom) var/list/eligible_delivery_points = list() - for(var/obj/structure/cargo_receptacle/delivery_point in all_cargo_receptacles) + for(var/obj/structure/cargo_receptacle/delivery_point in GLOB.all_cargo_receptacles) var/obj/effect/overmap/visitable/my_sector = GLOB.map_sectors["[current_turf.z]"] var/obj/effect/overmap/visitable/delivery_point_sector = GLOB.map_sectors["[delivery_point.z]"] // no delivering to ourselves diff --git a/code/modules/cargo/delivery/receptacle.dm b/code/modules/cargo/delivery/receptacle.dm index eff34293476..8467731c02d 100644 --- a/code/modules/cargo/delivery/receptacle.dm +++ b/code/modules/cargo/delivery/receptacle.dm @@ -1,4 +1,4 @@ -var/global/list/all_cargo_receptacles = list() +GLOBAL_LIST_INIT_TYPED(all_cargo_receptacles, /obj/structure/cargo_receptacle, list()) /obj/structure/cargo_receptacle name = "cargo delivery point" @@ -49,7 +49,7 @@ var/global/list/all_cargo_receptacles = list() else delivery_sector = null - all_cargo_receptacles += src + GLOB.all_cargo_receptacles += src if(spawns_packages) var/list/warehouse_turfs = list() @@ -67,7 +67,7 @@ var/global/list/all_cargo_receptacles = list() new /obj/item/cargo_package(random_turf, src) /obj/structure/cargo_receptacle/Destroy() - all_cargo_receptacles -= src + GLOB.all_cargo_receptacles -= src return ..() /obj/structure/cargo_receptacle/attackby(obj/item/attacking_item, mob/user) diff --git a/code/modules/cargo/randomstock.dm b/code/modules/cargo/randomstock.dm index 7721d46376a..595b24ecd2e 100644 --- a/code/modules/cargo/randomstock.dm +++ b/code/modules/cargo/randomstock.dm @@ -62,13 +62,13 @@ STOCK_ITEM_COMMON(bees, 2) return 0 switch(src.category) if("common") - return global.random_stock_common[src.spawner_proc] = P + return GLOB.random_stock_common[src.spawner_proc] = P if("uncommon") - return global.random_stock_uncommon[src.spawner_proc] = P + return GLOB.random_stock_uncommon[src.spawner_proc] = P if("rare") - return global.random_stock_rare[src.spawner_proc] = P + return GLOB.random_stock_rare[src.spawner_proc] = P if("large") - return global.random_stock_large[src.spawner_proc] = P + return GLOB.random_stock_large[src.spawner_proc] = P throw EXCEPTION("Cargo spawner definition '[src.type]' has invalid category '[src.category]'. Please fix your definition.") /proc/setup_cargo_spawn_lists() @@ -80,10 +80,10 @@ STOCK_ITEM_COMMON(bees, 2) LOG_DEBUG("Registered [i] cargo spawners.") // These lists are populated by the files in `./random_stock` using the above procs. -var/list/global/random_stock_common = list() -var/list/global/random_stock_uncommon = list() -var/list/global/random_stock_rare = list() -var/list/global/random_stock_large = list() +GLOBAL_LIST_EMPTY(random_stock_common) +GLOBAL_LIST_EMPTY(random_stock_uncommon) +GLOBAL_LIST_EMPTY(random_stock_rare) +GLOBAL_LIST_EMPTY(random_stock_large) /proc/spawn_cargo_stock() var/start_time = world.timeofday @@ -132,7 +132,7 @@ var/list/global/random_stock_large = list() //These locations are designated by large stock marker objects, which are manually mapped in for (var/obj/effect/large_stock_marker/LSM in GLOB.large_stock_markers) if (prob(STOCK_LARGE_PROB)) - var/type = pickweight(random_stock_large) + var/type = pickweight(GLOB.random_stock_large) if (type) call(type)(get_turf(LSM)) qdel(LSM) @@ -188,11 +188,11 @@ var/list/global/random_stock_large = list() var/stocktype = pickweight(spawntypes) switch (stocktype) if ("1") - return pickweight(random_stock_rare) + return pickweight(GLOB.random_stock_rare) if ("2") - return pickweight(random_stock_uncommon) + return pickweight(GLOB.random_stock_uncommon) if ("3") - return pickweight(random_stock_common) + return pickweight(GLOB.random_stock_common) // Moderate mobs are checked per crate #define INFEST_PROB_MODERATE 3 diff --git a/code/modules/cciaa/cciaa.dm b/code/modules/cciaa/cciaa.dm index bda7d680167..040559f52ff 100644 --- a/code/modules/cciaa/cciaa.dm +++ b/code/modules/cciaa/cciaa.dm @@ -8,7 +8,7 @@ return var/list/faxes = list() - for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) faxes[F.department] = F if(!length(faxes)) @@ -56,7 +56,7 @@ to_chat(usr, SPAN_NOTICE("Message transmitted successfully.")) log_and_message_admins("sent a fax message to the [department] fax machine. (JMP)") - sent_faxes += P + GLOB.sent_faxes += P else to_chat(usr, SPAN_WARNING("Message reply failed.")) qdel(P) @@ -75,16 +75,16 @@ data += "
    " data += "
    Received Faxes:

    " - if (arrived_faxes && arrived_faxes.len) - for (var/obj/item/item in arrived_faxes) + if (GLOB.arrived_faxes && GLOB.arrived_faxes.len) + for (var/obj/item/item in GLOB.arrived_faxes) data += "[item.name] - view message
    " else data += "
    No faxes have been received.
    " data += "
    Sent Faxes:

    " - if (sent_faxes && sent_faxes.len) - for (var/obj/item/item in sent_faxes) + if (GLOB.sent_faxes && GLOB.sent_faxes.len) + for (var/obj/item/item in GLOB.sent_faxes) data += "[item.name] - view message
    " else data += "
    No faxes have been sent out.
    " diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 9f8698d003e..5f640004e15 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -1,7 +1,7 @@ -var/list/localhost_addresses = list( +GLOBAL_LIST_INIT(localhost_addresses, list( "127.0.0.1" = TRUE, "::1" = TRUE -) +)) //////////// //SECURITY// @@ -424,10 +424,10 @@ var/list/localhost_addresses = list( SHOULD_NOT_SLEEP(TRUE) //preferences datum - also holds some persistant data for the client (because we may as well keep these datums to a minimum) - prefs = preferences_datums[ckey] + prefs = GLOB.preferences_datums[ckey] if(!prefs) prefs = new /datum/preferences(src) - preferences_datums[ckey] = prefs + GLOB.preferences_datums[ckey] = prefs prefs.gather_notifications(src) prefs.client = src // Safety reasons here. @@ -444,7 +444,7 @@ var/list/localhost_addresses = list( to_chat_immediate(src, SPAN_ALERT("If the title screen is black, resources are still downloading. Please be patient until the title screen appears.")) - var/local_connection = (GLOB.config.auto_local_admin && !GLOB.config.use_forumuser_api && (isnull(address) || localhost_addresses[address])) + var/local_connection = (GLOB.config.auto_local_admin && !GLOB.config.use_forumuser_api && (isnull(address) || GLOB.localhost_addresses[address])) // Automatic admin rights for people connecting locally. // Concept stolen from /tg/ with deepest gratitude. // And ported from Nebula with love. diff --git a/code/modules/client/preference_setup/antagonism/02_setup.dm b/code/modules/client/preference_setup/antagonism/02_setup.dm index ccd3693ead0..1eaba399f23 100644 --- a/code/modules/client/preference_setup/antagonism/02_setup.dm +++ b/code/modules/client/preference_setup/antagonism/02_setup.dm @@ -1,4 +1,4 @@ -var/global/list/uplink_locations = list("PDA", "Headset", "None") +GLOBAL_LIST_INIT(uplink_locations, list("PDA", "Headset", "None")) /datum/category_item/player_setup_item/antagonism/basic name = "Setup" @@ -51,7 +51,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None") return list("records_exploit" = pref.exploit_record, "char_id" = pref.current_character, "uplink_location" = pref.uplinklocation, "id" = pref.current_character, "ckey" = PREF_CLIENT_CKEY) /datum/category_item/player_setup_item/antagonism/basic/sanitize_character() - pref.uplinklocation = sanitize_inlist(pref.uplinklocation, uplink_locations, initial(pref.uplinklocation)) + pref.uplinklocation = sanitize_inlist(pref.uplinklocation, GLOB.uplink_locations, initial(pref.uplinklocation)) /datum/category_item/player_setup_item/antagonism/basic/content(var/mob/user) var/list/dat = list( @@ -68,7 +68,7 @@ var/global/list/uplink_locations = list("PDA", "Headset", "None") /datum/category_item/player_setup_item/antagonism/basic/OnTopic(var/href,var/list/href_list, var/mob/user) if (href_list["antagtask"]) - pref.uplinklocation = next_in_list(pref.uplinklocation, uplink_locations) + pref.uplinklocation = next_in_list(pref.uplinklocation, GLOB.uplink_locations) return TOPIC_REFRESH if(href_list["exploitable_record"]) diff --git a/code/modules/client/preference_setup/general/03_body.dm b/code/modules/client/preference_setup/general/03_body.dm index 32821b03138..6f8415bc9c5 100644 --- a/code/modules/client/preference_setup/general/03_body.dm +++ b/code/modules/client/preference_setup/general/03_body.dm @@ -1,8 +1,8 @@ -var/global/list/valid_bloodtypes = list( +GLOBAL_LIST_INIT(valid_bloodtypes, list( "A+", "A-", "B+", "B-", "AB+", "AB-", "O+", "O-", "SBS" // Synthetic Blood Substitute. Intended for heavily augmented characters. // Sanitized below, removed if character is not augmented enough. -) +)) /datum/preferences var/equip_preview_mob = EQUIP_PREVIEW_ALL @@ -361,7 +361,7 @@ var/global/list/valid_bloodtypes = list( return TOPIC_REFRESH_UPDATE_PREVIEW else if(href_list["blood_type"]) - var/new_b_type = tgui_input_list(user, "Choose your character's blood-type:", "Character Preference", valid_bloodtypes) + var/new_b_type = tgui_input_list(user, "Choose your character's blood-type:", "Character Preference", GLOB.valid_bloodtypes) if(new_b_type && CanUseTopic(user)) pref.b_type = new_b_type return TOPIC_REFRESH diff --git a/code/modules/client/preference_setup/general/04_equipment.dm b/code/modules/client/preference_setup/general/04_equipment.dm index eb574dbb2dd..f6fa20155ec 100644 --- a/code/modules/client/preference_setup/general/04_equipment.dm +++ b/code/modules/client/preference_setup/general/04_equipment.dm @@ -112,7 +112,7 @@ if(!istype(pref.all_underwear)) pref.all_underwear = list() - for(var/datum/category_group/underwear/WRC in global_underwear.categories) + for(var/datum/category_group/underwear/WRC in GLOB.global_underwear.categories) for(var/datum/category_item/underwear/WRI in WRC.items) if(WRI.is_default(pref.gender ? pref.gender : MALE)) pref.all_underwear[WRC.name] = WRI.name @@ -122,7 +122,7 @@ pref.all_underwear_metadata = list() for(var/underwear_category in pref.all_underwear) - var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[underwear_category] + var/datum/category_group/underwear/UWC = GLOB.global_underwear.categories_by_name[underwear_category] if(!UWC) pref.all_underwear -= underwear_category else @@ -147,7 +147,7 @@ /datum/category_item/player_setup_item/general/equipment/content(var/mob/user) . = list() . += "Equipment:
    " - for(var/datum/category_group/underwear/UWC in global_underwear.categories) + for(var/datum/category_group/underwear/UWC in GLOB.global_underwear.categories) var/item_name = pref.all_underwear[UWC.name] ? pref.all_underwear[UWC.name] : "None" . += "[UWC.name]: [item_name]" @@ -236,7 +236,7 @@ return TOPIC_REFRESH_UPDATE_PREVIEW else if(href_list["change_underwear"]) - var/datum/category_group/underwear/UWC = global_underwear.categories_by_name[href_list["change_underwear"]] + var/datum/category_group/underwear/UWC = GLOB.global_underwear.categories_by_name[href_list["change_underwear"]] if(!UWC) return TOPIC_NOACTION var/datum/category_item/underwear/selected_underwear = tgui_input_list(user, "Choose underwear:", "Character Preference", UWC.items, pref.all_underwear[UWC.name]) diff --git a/code/modules/client/preference_setup/global/01_ui.dm b/code/modules/client/preference_setup/global/01_ui.dm index 153b9d638f0..a0f58165417 100644 --- a/code/modules/client/preference_setup/global/01_ui.dm +++ b/code/modules/client/preference_setup/global/01_ui.dm @@ -86,7 +86,7 @@ ) /datum/category_item/player_setup_item/player_global/ui/sanitize_preferences() - pref.UI_style = sanitize_inlist(pref.UI_style, all_ui_styles, initial(pref.UI_style)) + pref.UI_style = sanitize_inlist(pref.UI_style, GLOB.all_ui_styles, initial(pref.UI_style)) pref.UI_style_color = sanitize_hexcolor(pref.UI_style_color, initial(pref.UI_style_color)) pref.UI_style_alpha = sanitize_integer(text2num(pref.UI_style_alpha), 0, 255, initial(pref.UI_style_alpha)) pref.clientfps = sanitize_integer(text2num(pref.clientfps), 0, 1000, initial(pref.clientfps)) @@ -122,7 +122,7 @@ /datum/category_item/player_setup_item/player_global/ui/OnTopic(var/href,var/list/href_list, var/mob/user) if(href_list["select_style"]) - var/UI_style_new = input(user, "Choose UI style.", "Character Preference", pref.UI_style) as null|anything in all_ui_styles + var/UI_style_new = input(user, "Choose UI style.", "Character Preference", pref.UI_style) as null|anything in GLOB.all_ui_styles if(!UI_style_new || !CanUseTopic(user)) return TOPIC_NOACTION pref.UI_style = UI_style_new return TOPIC_REFRESH @@ -181,7 +181,7 @@ return TOPIC_REFRESH else if(href_list["select_tooltip_style"]) - var/tooltip_style_new = input(user, "Choose a new tooltip style.", "Global Preference", pref.tooltip_style) as null|anything in all_tooltip_styles + var/tooltip_style_new = input(user, "Choose a new tooltip style.", "Global Preference", pref.tooltip_style) as null|anything in GLOB.all_tooltip_styles if(!tooltip_style_new || !CanUseTopic(user)) return TOPIC_NOACTION pref.tooltip_style = tooltip_style_new diff --git a/code/modules/client/preference_setup/loadout/gear_tweaks.dm b/code/modules/client/preference_setup/loadout/gear_tweaks.dm index 287919bb660..31d7b336dce 100644 --- a/code/modules/client/preference_setup/loadout/gear_tweaks.dm +++ b/code/modules/client/preference_setup/loadout/gear_tweaks.dm @@ -101,7 +101,7 @@ Alpha adjustment Accent colour */ -var/datum/gear_tweak/color/accent/gear_tweak_accent_color = new() +GLOBAL_DATUM_INIT(gear_tweak_accent_color, /datum/gear_tweak/color/accent, new()) /datum/gear_tweak/color/accent/get_contents(var/metadata) return "Accent Color: " @@ -115,7 +115,8 @@ var/datum/gear_tweak/color/accent/gear_tweak_accent_color = new() /* Color Rotation adjustment */ -var/datum/gear_tweak/color_rotation/gear_tweak_color_rotation = new() + +GLOBAL_DATUM_INIT(gear_tweak_color_rotation, /datum/gear_tweak/color_rotation, new()) /datum/gear_tweak/color_rotation/get_contents(var/metadata) return "Color Rotation: [metadata]" @@ -250,7 +251,7 @@ Reagents adjustment Custom Name */ -var/datum/gear_tweak/custom_name/gear_tweak_free_name = new() +GLOBAL_DATUM_INIT(gear_tweak_free_name, /datum/gear_tweak/custom_name, new()) /datum/gear_tweak/custom_name var/list/valid_custom_names @@ -287,7 +288,8 @@ var/datum/gear_tweak/custom_name/gear_tweak_free_name = new() /* Custom Description */ -var/datum/gear_tweak/custom_desc/gear_tweak_free_desc = new() + +GLOBAL_DATUM_INIT(gear_tweak_free_desc, /datum/gear_tweak/custom_desc, new()) /datum/gear_tweak/custom_desc var/list/valid_custom_desc @@ -378,7 +380,8 @@ Paper Data // Accessory Slot Settings -var/datum/gear_tweak/accessory_slot/gear_tweak_accessory_slot = new() + +GLOBAL_DATUM_INIT(gear_tweak_accessory_slot, /datum/gear_tweak/accessory_slot, new()) /datum/gear_tweak/accessory_slot var/static/list/accessory_slots = list(GEAR_TWEAK_ACCESSORY_SLOT_UNDER, GEAR_TWEAK_ACCESSORY_SLOT_SUIT, GEAR_TWEAK_ACCESSORY_SLOT_SUIT_STANDALONE) diff --git a/code/modules/client/preference_setup/loadout/items/cosmetics.dm b/code/modules/client/preference_setup/loadout/items/cosmetics.dm index ffcd47745a1..17ac1a383e2 100644 --- a/code/modules/client/preference_setup/loadout/items/cosmetics.dm +++ b/code/modules/client/preference_setup/loadout/items/cosmetics.dm @@ -35,7 +35,7 @@ lipsticks["lipstick, teal"] = /obj/item/lipstick/teal gear_tweaks += new /datum/gear_tweak/path(lipsticks) - gear_tweaks += list(gear_tweak_lipstick_application) + gear_tweaks += list(GLOB.gear_tweak_lipstick_application) /datum/gear/cosmetic/lipstick_colorable // not a subtype because we dont want the path gear_tweaks display_name = "colorable lipstick" @@ -44,10 +44,10 @@ /datum/gear/cosmetic/lipstick_colorable/New() ..() - gear_tweaks += list(gear_tweak_lipstick_color) - gear_tweaks += list(gear_tweak_lipstick_application) + gear_tweaks += list(GLOB.gear_tweak_lipstick_color) + gear_tweaks += list(GLOB.gear_tweak_lipstick_application) -var/datum/gear_tweak/color/lipstick/gear_tweak_lipstick_color = new() +GLOBAL_DATUM_INIT(gear_tweak_lipstick_color, /datum/gear_tweak/color/lipstick, new()) /datum/gear_tweak/color/lipstick/get_contents(var/metadata) return "Lipstick Color: " @@ -57,7 +57,7 @@ var/datum/gear_tweak/color/lipstick/gear_tweak_lipstick_color = new() lipstick.update_icon() -var/datum/gear_tweak/lipstick_application/gear_tweak_lipstick_application = new() +GLOBAL_DATUM_INIT(gear_tweak_lipstick_application, /datum/gear_tweak/lipstick_application, new()) /datum/gear_tweak/lipstick_application/get_contents(var/metadata) return "Lipstick Applied: [metadata]" diff --git a/code/modules/client/preference_setup/loadout/items/factions.dm b/code/modules/client/preference_setup/loadout/items/factions.dm index 9725fd58bd8..770bea7f1a2 100644 --- a/code/modules/client/preference_setup/loadout/items/factions.dm +++ b/code/modules/client/preference_setup/loadout/items/factions.dm @@ -370,10 +370,10 @@ /datum/gear/faction/pmc_modsuit/New() ..() - gear_tweaks += list(gear_tweak_modsuit_configuration) + gear_tweaks += list(GLOB.gear_tweak_modsuit_configuration) -var/datum/gear_tweak/modsuit_configuration/gear_tweak_modsuit_configuration = new() +GLOBAL_DATUM_INIT(gear_tweak_modsuit_configuration, /datum/gear_tweak/modsuit_configuration, new()) /datum/gear_tweak/modsuit_configuration /// the configuration of the modsuit, using just a list of the names @@ -443,7 +443,7 @@ var/datum/gear_tweak/modsuit_configuration/gear_tweak_modsuit_configuration = ne pmcg_sec_uniforms["Grupo Amapola uniform"] = /obj/item/clothing/under/rank/security/pmc/grupo_amapola pmcg_sec_uniforms["Nexus Corporate uniform"] = /obj/item/clothing/under/rank/security/pmc/nexus gear_tweaks += new /datum/gear_tweak/path(pmcg_sec_uniforms) - gear_tweaks += list(gear_tweak_uniform_rolled_state) + gear_tweaks += list(GLOB.gear_tweak_uniform_rolled_state) /datum/gear/faction/erisec_patch display_name = "EPMC sleeve patch" diff --git a/code/modules/client/preference_setup/loadout/items/head.dm b/code/modules/client/preference_setup/loadout/items/head.dm index 84e91b16039..d5937147792 100644 --- a/code/modules/client/preference_setup/loadout/items/head.dm +++ b/code/modules/client/preference_setup/loadout/items/head.dm @@ -6,7 +6,7 @@ /datum/gear/head/New() ..() - gear_tweaks += list(gear_tweak_hair_block) + gear_tweaks += list(GLOB.gear_tweak_hair_block) /datum/gear/head/boonie_blue display_name = "blue boonie hat" @@ -532,7 +532,8 @@ /* Block Hair Adjustment */ -var/datum/gear_tweak/hair_block/gear_tweak_hair_block = new() + +GLOBAL_DATUM_INIT(gear_tweak_hair_block, /datum/gear_tweak/hair_block, new()) /datum/gear_tweak/hair_block/get_contents(var/metadata) return "Blocks Hair: [metadata]" diff --git a/code/modules/client/preference_setup/loadout/items/shoes.dm b/code/modules/client/preference_setup/loadout/items/shoes.dm index ececd5353e8..5bb5d705ce3 100644 --- a/code/modules/client/preference_setup/loadout/items/shoes.dm +++ b/code/modules/client/preference_setup/loadout/items/shoes.dm @@ -7,7 +7,7 @@ /datum/gear/shoes/New() ..() - gear_tweaks += list(gear_tweak_shoe_layer) + gear_tweaks += list(GLOB.gear_tweak_shoe_layer) /datum/gear/shoes/color display_name = "sneakers selection" @@ -193,7 +193,8 @@ /* Shoe Layer Adjustment */ -var/datum/gear_tweak/shoe_layer/gear_tweak_shoe_layer = new() + +GLOBAL_DATUM_INIT(gear_tweak_shoe_layer, /datum/gear_tweak/shoe_layer, new()) /datum/gear_tweak/shoe_layer/get_contents(var/metadata) return "Shoe Layer: [metadata] Uniform" diff --git a/code/modules/client/preference_setup/loadout/items/uniform.dm b/code/modules/client/preference_setup/loadout/items/uniform.dm index 98a728a1fd7..5600925403a 100644 --- a/code/modules/client/preference_setup/loadout/items/uniform.dm +++ b/code/modules/client/preference_setup/loadout/items/uniform.dm @@ -7,7 +7,7 @@ /datum/gear/uniform/New() ..() - gear_tweaks += list(gear_tweak_uniform_rolled_state) + gear_tweaks += list(GLOB.gear_tweak_uniform_rolled_state) /datum/gear/uniform/iacjumpsuit display_name = "IAC Jumpsuit" @@ -362,7 +362,7 @@ #define UNIFORM_ROLLED_SLEEVES "Rolled Sleeves" #define UNIFORM_ROLLED_DOWN "Rolled Down" -var/datum/gear_tweak/uniform_rolled_state/gear_tweak_uniform_rolled_state = new() +GLOBAL_DATUM_INIT(gear_tweak_uniform_rolled_state, /datum/gear_tweak/uniform_rolled_state, new()) /datum/gear_tweak/uniform_rolled_state/get_contents(var/metadata) return "Rolled State: [metadata]" diff --git a/code/modules/client/preference_setup/loadout/items/xeno/diona.dm b/code/modules/client/preference_setup/loadout/items/xeno/diona.dm index 2f58ca501fd..0a7335740c1 100644 --- a/code/modules/client/preference_setup/loadout/items/xeno/diona.dm +++ b/code/modules/client/preference_setup/loadout/items/xeno/diona.dm @@ -269,7 +269,7 @@ ABSTRACT_TYPE(/datum/gear/accessory/diona) /datum/gear/accessory/diona/skrell_passport/New() . = ..() - gear_tweaks += list(compat_index_tweak) + gear_tweaks += list(GLOB.compat_index_tweak) /datum/gear/accessory/diona/skrell_passport/check_species_whitelist(mob/living/carbon/human/H) var/static/list/species_list = list(SPECIES_DIONA, SPECIES_DIONA_COEUS) diff --git a/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm b/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm index 146f6ad1a3b..aba52c8b70d 100644 --- a/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm +++ b/code/modules/client/preference_setup/loadout/items/xeno/skrell.dm @@ -213,7 +213,7 @@ ABSTRACT_TYPE(/datum/gear/ears/skrell) /datum/gear/accessory/skrell_passport/New() . = ..() - gear_tweaks += list(compat_index_tweak) + gear_tweaks += list(GLOB.compat_index_tweak) // the whitelisted list ensures only people with skrell, vaurca, or diona whitelists can reach this check /datum/gear/accessory/skrell_passport/check_species_whitelist(mob/living/carbon/human/H) @@ -247,7 +247,8 @@ ABSTRACT_TYPE(/datum/gear/ears/skrell) /* Skrellian Social Compatibility Index */ -var/datum/gear_tweak/compat_index/compat_index_tweak = new() + +GLOBAL_DATUM_INIT(compat_index_tweak, /datum/gear_tweak/compat_index, new()) /datum/gear_tweak/compat_index/get_contents(var/metadata) return "Social Compatibility Index: [metadata]" diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm index 308f95dad0d..81c2e415222 100644 --- a/code/modules/client/preference_setup/loadout/loadout.dm +++ b/code/modules/client/preference_setup/loadout/loadout.dm @@ -1,5 +1,5 @@ -var/list/loadout_categories = list() -var/list/gear_datums = list() +GLOBAL_LIST_INIT(loadout_categories, list()) +GLOBAL_LIST_INIT(gear_datums, list()) /datum/loadout_category var/category = "" @@ -22,15 +22,15 @@ var/list/gear_datums = list() var/use_name = initial(G.display_name) var/use_category = initial(G.sort_category) - if(!loadout_categories[use_category]) - loadout_categories[use_category] = new /datum/loadout_category(use_category) - var/datum/loadout_category/LC = loadout_categories[use_category] - gear_datums[use_name] = new geartype - LC.gear[use_name] = gear_datums[use_name] + if(!GLOB.loadout_categories[use_category]) + GLOB.loadout_categories[use_category] = new /datum/loadout_category(use_category) + var/datum/loadout_category/LC = GLOB.loadout_categories[use_category] + GLOB.gear_datums[use_name] = new geartype + LC.gear[use_name] = GLOB.gear_datums[use_name] - sortTim(loadout_categories, GLOBAL_PROC_REF(cmp_text_asc), FALSE) - for(var/loadout_category in loadout_categories) - var/datum/loadout_category/LC = loadout_categories[loadout_category] + sortTim(GLOB.loadout_categories, GLOBAL_PROC_REF(cmp_text_asc), FALSE) + for(var/loadout_category in GLOB.loadout_categories) + var/datum/loadout_category/LC = GLOB.loadout_categories[loadout_category] sortTim(LC.gear, GLOBAL_PROC_REF(cmp_text_asc), FALSE) return TRUE @@ -109,8 +109,8 @@ var/list/gear_datums = list() if(is_alien_whitelisted(preference_mob, S)) whitelist_cache += S.name - for(var/gear_name in gear_datums) - var/datum/gear/G = gear_datums[gear_name] + for(var/gear_name in GLOB.gear_datums) + var/datum/gear/G = GLOB.gear_datums[gear_name] if(max_cost && G.cost > max_cost) continue else if(G.whitelisted && whitelist_cache.len) @@ -153,19 +153,19 @@ var/list/gear_datums = list() pref.gear_slot = 1 for(var/gear_name in pref.gear) - if(!(gear_name in gear_datums)) + if(!(gear_name in GLOB.gear_datums)) pref.gear -= gear_name var/total_cost = 0 var/list/player_valid_gear_choices = valid_gear_choices() for(var/gear_name in pref.gear) - if(!gear_datums[gear_name]) + if(!GLOB.gear_datums[gear_name]) to_chat(preference_mob, SPAN_WARNING("You cannot have more than one of the \the [gear_name]")) pref.gear -= gear_name else if(!(gear_name in player_valid_gear_choices)) to_chat(preference_mob, SPAN_WARNING("You cannot take \the [gear_name] as you are not whitelisted for the species.")) pref.gear -= gear_name else - var/datum/gear/G = gear_datums[gear_name] + var/datum/gear/G = GLOB.gear_datums[gear_name] if(total_cost + G.cost > GLOB.config.loadout_cost) pref.gear -= gear_name to_chat(preference_mob, SPAN_WARNING("You cannot afford to take \the [gear_name]")) @@ -176,7 +176,7 @@ var/list/gear_datums = list() var/total_cost = 0 if(pref.gear && pref.gear.len) for(var/i = 1; i <= pref.gear.len; i++) - var/datum/gear/G = gear_datums[pref.gear[i]] + var/datum/gear/G = GLOB.gear_datums[pref.gear[i]] if(G) total_cost += G.cost @@ -191,7 +191,7 @@ var/list/gear_datums = list() . += "" - var/datum/loadout_category/LC = loadout_categories[current_tab] + var/datum/loadout_category/LC = GLOB.loadout_categories[current_tab] . += "" . += "
    [ckey] - [ban[2]] - (unban)
    " var/firstcat = 1 - for(var/category in loadout_categories) + for(var/category in GLOB.loadout_categories) if(firstcat) firstcat = 0 @@ -200,7 +200,7 @@ var/list/gear_datums = list() if(category == current_tab) . += " [category] " else - var/datum/loadout_category/LC = loadout_categories[category] + var/datum/loadout_category/LC = GLOB.loadout_categories[category] var/style = "" for(var/thing in LC.gear) if(thing in pref.gear) @@ -209,7 +209,7 @@ var/list/gear_datums = list() . += " [category] " . += "

    " @@ -356,20 +356,20 @@ var/list/gear_datums = list() /datum/category_item/player_setup_item/loadout/OnTopic(href, href_list, user) if(href_list["toggle_gear"]) pref.gear_modified = TRUE - var/datum/gear/TG = gear_datums[href_list["toggle_gear"]] + var/datum/gear/TG = GLOB.gear_datums[href_list["toggle_gear"]] if(TG.display_name in pref.gear) pref.gear -= TG.display_name else var/total_cost = 0 for(var/gear_name in pref.gear) - var/datum/gear/G = gear_datums[gear_name] + var/datum/gear/G = GLOB.gear_datums[gear_name] if(istype(G)) total_cost += G.cost if((total_cost+TG.cost) <= GLOB.config.loadout_cost) pref.gear += TG.display_name return TOPIC_REFRESH_UPDATE_PREVIEW if(href_list["gear"] && href_list["tweak"]) pref.gear_modified = TRUE - var/datum/gear/gear = gear_datums[href_list["gear"]] + var/datum/gear/gear = GLOB.gear_datums[href_list["gear"]] var/datum/gear_tweak/tweak = locate(href_list["tweak"]) if(!tweak || !istype(gear) || !(tweak in gear.gear_tweaks)) return TOPIC_NOACTION @@ -506,19 +506,19 @@ var/list/gear_datums = list() var/obj/O = path description = initial(O.desc) if(flags & GEAR_HAS_COLOR_SELECTION) - gear_tweaks += list(gear_tweak_free_color_choice) + gear_tweaks += list(GLOB.gear_tweak_free_color_choice) if(flags & GEAR_HAS_ALPHA_SELECTION) - gear_tweaks += list(gear_tweak_alpha_choice) + gear_tweaks += list(GLOB.gear_tweak_alpha_choice) if(flags & GEAR_HAS_ACCENT_COLOR_SELECTION) - gear_tweaks += list(gear_tweak_accent_color) + gear_tweaks += list(GLOB.gear_tweak_accent_color) if(flags & GEAR_HAS_NAME_SELECTION) - gear_tweaks += list(gear_tweak_free_name) + gear_tweaks += list(GLOB.gear_tweak_free_name) if(flags & GEAR_HAS_DESC_SELECTION) - gear_tweaks += list(gear_tweak_free_desc) + gear_tweaks += list(GLOB.gear_tweak_free_desc) if(flags & GEAR_HAS_COLOR_ROTATION_SELECTION) - gear_tweaks += list(gear_tweak_color_rotation) + gear_tweaks += list(GLOB.gear_tweak_color_rotation) if(ispath(path, /obj/item/clothing/accessory)) - gear_tweaks += list(gear_tweak_accessory_slot) + gear_tweaks += list(GLOB.gear_tweak_accessory_slot) /datum/gear_data var/path diff --git a/code/modules/client/preference_setup/origin/origin.dm b/code/modules/client/preference_setup/origin/origin.dm index 378230ebbfd..3d09c7754fa 100644 --- a/code/modules/client/preference_setup/origin/origin.dm +++ b/code/modules/client/preference_setup/origin/origin.dm @@ -124,7 +124,7 @@ var/datum/species/S = GLOB.all_species[pref.species] if(href_list["open_culture_menu"]) var/list/options = list() - var/list/possible_cultures = Singletons.GetMap(S.possible_cultures) + var/list/possible_cultures = GLOB.Singletons.GetMap(S.possible_cultures) for(var/decl_type in possible_cultures) var/singleton/origin_item/culture/CL = possible_cultures[decl_type] options[CL.name] = CL @@ -137,7 +137,7 @@ if(href_list["open_origin_menu"]) var/list/options = list() var/singleton/origin_item/culture/our_culture = GET_SINGLETON(text2path(pref.culture)) //plutonians be like - var/list/singleton/origin_item/origin/origins_list = Singletons.GetMap(our_culture.possible_origins) + var/list/singleton/origin_item/origin/origins_list = GLOB.Singletons.GetMap(our_culture.possible_origins) for(var/decl_type in origins_list) var/singleton/origin_item/origin/OR = origins_list[decl_type] options[OR.name] = OR diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index c05b2a37a85..94d89b6aebd 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1,6 +1,6 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33 -var/list/preferences_datums = list() +GLOBAL_LIST_EMPTY_TYPED(preferences_datums, /datum/preferences) /datum/preferences //doohickeys for savefiles @@ -400,9 +400,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 @@ -482,7 +482,7 @@ var/list/preferences_datums = list() character.all_underwear.Cut() character.all_underwear_metadata.Cut() for(var/underwear_category_name in all_underwear) - var/datum/category_group/underwear/underwear_category = global_underwear.categories_by_name[underwear_category_name] + var/datum/category_group/underwear/underwear_category = GLOB.global_underwear.categories_by_name[underwear_category_name] if(underwear_category) var/underwear_item_name = all_underwear[underwear_category_name] character.all_underwear[underwear_category_name] = underwear_category.items_by_name[underwear_item_name] @@ -525,8 +525,8 @@ var/list/preferences_datums = list() /datum/preferences/proc/open_load_dialog_sql(mob/user) var/dat = "
    " - for(var/ckey in preferences_datums) - var/datum/preferences/D = preferences_datums[ckey] + for(var/ckey in GLOB.preferences_datums) + var/datum/preferences/D = GLOB.preferences_datums[ckey] if(D == src) if(!establish_db_connection(GLOB.dbcon)) return open_load_dialog_file(user) diff --git a/code/modules/client/preferences_ambience.dm b/code/modules/client/preferences_ambience.dm index 8afb3651f1b..3917c9ce2b2 100644 --- a/code/modules/client/preferences_ambience.dm +++ b/code/modules/client/preferences_ambience.dm @@ -7,7 +7,7 @@ // Music plays on channel 4. // ASFX Toggles List -/var/global/sfx_toggles = list( +GLOBAL_LIST_INIT(sfx_toggles, list( /client/proc/toggle_footsteps, /client/proc/toggle_asfx_vote, /client/proc/toggle_messagesounds, @@ -15,7 +15,7 @@ /client/proc/toggle_arcadesounds, /client/proc/toggle_radiosounds, /client/proc/toggle_instrumentsounds -) +)) /client/var/has_sfx_verbs = FALSE // ASFX Tab Toggle @@ -25,10 +25,10 @@ set desc = "Toggle the SFX preferences tab" if(!has_sfx_verbs) - add_verb(src, sfx_toggles) + add_verb(src, GLOB.sfx_toggles) has_sfx_verbs = TRUE else - remove_verb(src, sfx_toggles) + remove_verb(src, GLOB.sfx_toggles) has_sfx_verbs = FALSE // Ambience Toggle diff --git a/code/modules/client/ui_style.dm b/code/modules/client/ui_style.dm index 1f596106fde..23c95f0e15a 100644 --- a/code/modules/client/ui_style.dm +++ b/code/modules/client/ui_style.dm @@ -1,24 +1,24 @@ -var/all_ui_styles = list( +GLOBAL_LIST_INIT(all_ui_styles, list( "Midnight" = 'icons/mob/screen/midnight.dmi', "Orange" = 'icons/mob/screen/orange.dmi', "old" = 'icons/mob/screen/old.dmi', "White" = 'icons/mob/screen/white.dmi', "old-noborder" = 'icons/mob/screen/old-noborder.dmi' - ) + )) -var/all_tooltip_styles = list( +GLOBAL_LIST_INIT(all_tooltip_styles, list( "Midnight", //Default for everyone is the first one, "Plasmafire", "Retro", "Slimecore", "Operative", "Clockwork" - ) + )) /proc/ui_style2icon(ui_style) - if(ui_style in all_ui_styles) - return all_ui_styles[ui_style] - return all_ui_styles["White"] + if(ui_style in GLOB.all_ui_styles) + return GLOB.all_ui_styles[ui_style] + return GLOB.all_ui_styles["White"] /client/verb/change_ui() set name = "Change UI" @@ -29,7 +29,7 @@ var/all_tooltip_styles = list( to_chat(usr, SPAN_WARNING("You must be human to use this verb.")) return - var/UI_style_new = input(usr, "Select a style. White is recommended for customization") as null|anything in all_ui_styles + var/UI_style_new = input(usr, "Select a style. White is recommended for customization") as null|anything in GLOB.all_ui_styles if(!UI_style_new) return var/UI_style_alpha_new = input(usr, "Select a new alpha (transparency) parameter for your UI, between 50 and 255") as null|num @@ -46,7 +46,7 @@ var/all_tooltip_styles = list( icons.Add(usr.gun_move_icon) icons.Add(usr.radio_use_icon) - var/icon/ic = all_ui_styles[UI_style_new] + var/icon/ic = GLOB.all_ui_styles[UI_style_new] for(var/atom/movable/screen/I in icons) if(I.name in list(I_HELP, I_HURT, I_DISARM, I_GRAB)) continue diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 51c45980420..b2b3f8388d6 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -123,7 +123,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/meson/Initialize() . = ..() - overlay = global_hud.meson + overlay = GLOB.global_hud.meson /obj/item/clothing/glasses/meson/prescription name = "prescription mesons" @@ -227,7 +227,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/night/Initialize() . = ..() - overlay = global_hud.nvg + overlay = GLOB.global_hud.nvg /obj/item/clothing/glasses/night/aviator name = "aviators" @@ -343,14 +343,14 @@ BLIND // can't see anything /obj/item/clothing/glasses/safety/goggles/science/Initialize() . = ..() - overlay = global_hud.science + overlay = GLOB.global_hud.science /obj/item/clothing/glasses/safety/goggles/science/handle_additional_changes() . = ..() if(up) overlay = null else - overlay = global_hud.science + overlay = GLOB.global_hud.science /obj/item/clothing/glasses/safety/goggles/wasteland name = "wasteland goggles" @@ -1074,7 +1074,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/thermal/Initialize() . = ..() - overlay = global_hud.thermal + overlay = GLOB.global_hud.thermal /mob/living/carbon/human/proc/thermal_reset_blindness() disabilities &= ~NEARSIGHTED @@ -1237,7 +1237,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/eyepatch/hud/meson/Initialize() . = ..() - overlay = global_hud.meson + overlay = GLOB.global_hud.meson /obj/item/clothing/glasses/eyepatch/hud/material name = "MATpatch" @@ -1252,7 +1252,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/eyepatch/hud/science/Initialize() . = ..() - overlay = global_hud.science + overlay = GLOB.global_hud.science /obj/item/clothing/glasses/eyepatch/hud/thermal name = "HEATpatch" @@ -1263,7 +1263,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/eyepatch/hud/thermal/Initialize() . = ..() - overlay = global_hud.thermal + overlay = GLOB.global_hud.thermal /obj/item/clothing/glasses/eyepatch/hud/welder name = "WELDpatch" @@ -1281,7 +1281,7 @@ BLIND // can't see anything /obj/item/clothing/glasses/eyepatch/hud/night/Initialize() . = ..() - overlay = global_hud.nvg + overlay = GLOB.global_hud.nvg //from verkister /obj/item/clothing/glasses/spiffygogs diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm index 453f2cd8bec..e5d76c5b005 100644 --- a/code/modules/clothing/spacesuits/breaches.dm +++ b/code/modules/clothing/spacesuits/breaches.dm @@ -21,21 +21,21 @@ //Some simple descriptors for breaches. Global because lazy, TODO: work out a better way to do this. -var/global/list/breach_brute_descriptors = list( +GLOBAL_LIST_INIT(breach_brute_descriptors, list( "tiny puncture", "ragged tear", "large split", "huge tear", "gaping wound" - ) + )) -var/global/list/breach_burn_descriptors = list( +GLOBAL_LIST_INIT(breach_burn_descriptors, list( "small burn", "melted patch", "sizable burn", "large scorched area", "huge scorched area" - ) + )) /datum/breach/proc/update_descriptor() @@ -43,9 +43,9 @@ var/global/list/breach_burn_descriptors = list( class = between(1, round(class), 5) //Apply the correct descriptor. if(damtype == DAMAGE_BURN) - descriptor = breach_burn_descriptors[class] + descriptor = GLOB.breach_burn_descriptors[class] else if(damtype == DAMAGE_BRUTE) - descriptor = breach_brute_descriptors[class] + descriptor = GLOB.breach_brute_descriptors[class] //Repair a certain amount of brute or burn damage to the suit. /obj/item/clothing/suit/space/proc/repair_breaches(var/damtype, var/amount, var/mob/user) diff --git a/code/modules/clothing/under/accessories/buddy_tag.dm b/code/modules/clothing/under/accessories/buddy_tag.dm index e1aad834290..4487c661475 100644 --- a/code/modules/clothing/under/accessories/buddy_tag.dm +++ b/code/modules/clothing/under/accessories/buddy_tag.dm @@ -1,4 +1,4 @@ -var/list/active_buddy_tags = list() +GLOBAL_LIST_INIT_TYPED(active_buddy_tags, /obj/item/clothing/accessory/buddytag, list()) /obj/item/clothing/accessory/buddytag name = "buddy tag" @@ -18,6 +18,10 @@ var/list/active_buddy_tags = list() . = ..() id = round(rand(1, 1000)) +/obj/item/clothing/accessory/buddytag/Destroy() + GLOB.active_buddy_tags -= src + . = ..() + /obj/item/clothing/accessory/buddytag/update_icon() icon_state = "buddytag[on]" @@ -42,10 +46,10 @@ var/list/active_buddy_tags = list() on = !on if(on) next_search = world.time - active_buddy_tags += src + GLOB.active_buddy_tags += src START_PROCESSING(SSprocessing, src) else - active_buddy_tags -= src + GLOB.active_buddy_tags -= src update_icon() if(href_list["setcode"]) var/newcode = tgui_input_number(usr, "Set new buddy ID number.", "Buddy Tag ID", id) @@ -72,7 +76,7 @@ var/list/active_buddy_tags = list() return next_search = world.time + search_interval var/has_friend - for(var/obj/item/clothing/accessory/buddytag/buddy as anything in active_buddy_tags - src) + for(var/obj/item/clothing/accessory/buddytag/buddy as anything in GLOB.active_buddy_tags - src) if(buddy.id != id) continue if(GET_Z(buddy) != GET_Z(src)) diff --git a/code/modules/clothing/wrists/watches.dm b/code/modules/clothing/wrists/watches.dm index c66a6674aff..a4c5b5cd04e 100644 --- a/code/modules/clothing/wrists/watches.dm +++ b/code/modules/clothing/wrists/watches.dm @@ -94,8 +94,8 @@ if(wired && screwed) to_chat(usr, "You check your watch, spotting a digital collection of numbers reading '[worldtime2text()]'. Today's date is '[time2text(world.time, "Month DD")]. [GLOB.game_year]'.") - if (evacuation_controller.get_status_panel_eta()) - to_chat(usr, SPAN_WARNING("Time until Bluespace Jump: [evacuation_controller.get_status_panel_eta()].")) + if (GLOB.evacuation_controller.get_status_panel_eta()) + to_chat(usr, SPAN_WARNING("Time until Bluespace Jump: [GLOB.evacuation_controller.get_status_panel_eta()].")) else if(wired && !screwed) to_chat(usr, "You check your watch, realising it's still open.") else diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 3ff7978678b..11b3fb577d3 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -26,7 +26,7 @@ // The key in the item_data list is the name of the variable, and the value is the value of the variable. // i.e. `item_data = list("name"="asdf")` would set the name of the item to asdf when its spawned in -/var/list/custom_items = list() +GLOBAL_LIST_INIT(custom_items, list()) //Loads the custom items from the json file if the db backend is disabled /hook/pregame_start/proc/load_custom_items() @@ -84,8 +84,8 @@ ci.item_data["desc"] = item["item_desc"] ci.additional_data = item["additional_data"] ci.req_titles = item["req_titles"] - custom_items.Add(ci) - log_module_customitems("Loaded [length(custom_items)] custom items") + GLOB.custom_items.Add(ci) + log_module_customitems("Loaded [length(GLOB.custom_items)] custom items") else if(fexists("config/custom_items.txt")) //TODO: Retire that at some point down the line log_module_customitems("Loading from txt") log_and_message_admins("The deprecated custom_items.txt file is used. Migrate to SQL or JSON.") @@ -98,7 +98,7 @@ if(findtext(line, "{", 1, 2) || findtext(line, "}", 1, 2)) // New block! if(current_data && current_data.usr_ckey && current_data.usr_charname) - custom_items.Add(current_data) + GLOB.custom_items.Add(current_data) current_data = null var/split = findtext(line,":") @@ -139,11 +139,11 @@ continue if("additional_data") current_data.additional_data = field_data - if(load_from_file == 2 && length(custom_items)) //insert the item into the db + if(load_from_file == 2 && length(GLOB.custom_items)) //insert the item into the db log_module_customitems("Migrating custom_items to database") var/success_count = 0 var/error_count = 0 - for(var/item in custom_items) + for(var/item in GLOB.custom_items) var/datum/custom_item/ci = item log_module_customitems("Migrating Item for: [ci.usr_ckey] - [ci.usr_charname]") @@ -255,7 +255,7 @@ GLOBAL_LIST_EMPTY(character_id_to_custom_items_mapping) if(!GLOB.character_id_to_custom_items_mapping[glob_character_id_key]) var/list/custom_items_list = list() - for(var/item in custom_items) + for(var/item in GLOB.custom_items) CHECK_TICK var/datum/custom_item/ci = item if(lowertext(ci.usr_ckey) != lowertext(player_ckey)) diff --git a/code/modules/economy/Events.dm b/code/modules/economy/Events.dm index 7653ecf4143..4705ce8c0af 100644 --- a/code/modules/economy/Events.dm +++ b/code/modules/economy/Events.dm @@ -10,7 +10,7 @@ /datum/event/economic_event/start() ..() - affected_dest = pickweight(weighted_randomevent_locations) + affected_dest = pickweight(GLOB.weighted_randomevent_locations) if(affected_dest.viable_random_events.len) endWhen = rand(60,300) event_type = pick(affected_dest.viable_random_events) diff --git a/code/modules/economy/Events_Mundane.dm b/code/modules/economy/Events_Mundane.dm index b3dd1daad50..92237aa6e85 100644 --- a/code/modules/economy/Events_Mundane.dm +++ b/code/modules/economy/Events_Mundane.dm @@ -3,7 +3,7 @@ endWhen = 10 /datum/event/mundane_news/announce() - var/datum/trade_destination/affected_dest = pickweight(weighted_mundaneevent_locations) + var/datum/trade_destination/affected_dest = pickweight(GLOB.weighted_mundaneevent_locations) var/event_type = 0 if(affected_dest.viable_mundane_events.len) event_type = pick(affected_dest.viable_mundane_events) @@ -106,9 +106,9 @@ body += "and their partner announced the birth of their [pick("first","second","third")] child on [affected_dest.name] early this morning. \ Doctors say the child is well, and the parents are considering " if(prob(50)) - body += capitalize(pick(first_names_female)) + body += capitalize(pick(GLOB.first_names_female)) else - body += capitalize(pick(first_names_male)) + body += capitalize(pick(GLOB.first_names_male)) body += " for the name." else if(prob(50)) body += "announced their [pick("split","break up","marriage","engagement")] with [pick("TV host","webcast personality","superstar","model","actor","singer")] \ diff --git a/code/modules/economy/TradeDestinations.dm b/code/modules/economy/TradeDestinations.dm index 82e900042ab..122435b7d2f 100644 --- a/code/modules/economy/TradeDestinations.dm +++ b/code/modules/economy/TradeDestinations.dm @@ -1,6 +1,6 @@ -var/list/weighted_randomevent_locations = list() -var/list/weighted_mundaneevent_locations = list() +GLOBAL_LIST_EMPTY(weighted_randomevent_locations) +GLOBAL_LIST_EMPTY(weighted_mundaneevent_locations) /datum/trade_destination var/name = "" diff --git a/code/modules/effects/map_effects/beam_point.dm b/code/modules/effects/map_effects/beam_point.dm index dd61417d643..7acdcee9226 100644 --- a/code/modules/effects/map_effects/beam_point.dm +++ b/code/modules/effects/map_effects/beam_point.dm @@ -1,4 +1,4 @@ -var/global/list/all_beam_points +GLOBAL_LIST_INIT_TYPED(all_beam_points, /obj/effect/map_effect/beam_point, null) // Creates and manages a beam attached to itself and another beam_point. // You can do cool things with these such as moving the beam_point to move the beam, turning them on and off on a timer, triggered by external input, and more. @@ -32,7 +32,7 @@ var/global/list/all_beam_points var/beam_sleep_time = 3 // How often the beam updates visually. Suggested to leave this alone, 3 is already fast. /obj/effect/map_effect/beam_point/Initialize() - LAZYADD(all_beam_points, src) + LAZYADD(GLOB.all_beam_points, src) if(make_beams_on_init) create_beams() if(use_timer) @@ -42,7 +42,7 @@ var/global/list/all_beam_points /obj/effect/map_effect/beam_point/Destroy() destroy_all_beams() use_timer = FALSE - LAZYREMOVE(all_beam_points, src) + LAZYREMOVE(GLOB.all_beam_points, src) return ..() // This is the top level proc to make the magic happen. @@ -58,7 +58,7 @@ var/global/list/all_beam_points // Finds a suitable beam point. /obj/effect/map_effect/beam_point/proc/seek_beam_point() - for(var/obj/effect/map_effect/beam_point/point in all_beam_points) + for(var/obj/effect/map_effect/beam_point/point in GLOB.all_beam_points) if(id != point.id) continue // Not linked together by ID. if(has_active_beam(point)) diff --git a/code/modules/effects/map_effects/portal.dm b/code/modules/effects/map_effects/portal.dm index e0bc26a4df7..15c2f5d59ad 100644 --- a/code/modules/effects/map_effects/portal.dm +++ b/code/modules/effects/map_effects/portal.dm @@ -1,4 +1,4 @@ -var/global/list/all_portal_masters +GLOBAL_LIST_INIT_TYPED(all_portal_masters, /obj/effect/map_effect/portal/master, null) /* Portal map effects allow a mapper to join two distant places together, while looking somewhat seamlessly connected. @@ -146,7 +146,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec var/list/portal_lines = list() /obj/effect/map_effect/portal/master/Initialize() - LAZYADD(all_portal_masters, src) + LAZYADD(GLOB.all_portal_masters, src) become_hearing_sensitive() find_lines() ..() @@ -158,7 +158,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec apply_offset() /obj/effect/map_effect/portal/master/Destroy() - LAZYREMOVE(all_portal_masters, src) + LAZYREMOVE(GLOB.all_portal_masters, src) for(var/thing in portal_lines) qdel(thing) return ..() @@ -179,7 +179,7 @@ when portals are shortly lived, or when portals are made to be obvious with spec // Connects both sides of a portal together. /obj/effect/map_effect/portal/master/proc/find_counterparts() - for(var/thing in all_portal_masters) + for(var/thing in GLOB.all_portal_masters) var/obj/effect/map_effect/portal/master/M = thing if(M == src) continue diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm index 2138e619c8b..0441d934bfd 100644 --- a/code/modules/events/event_container.dm +++ b/code/modules/events/event_container.dm @@ -9,7 +9,7 @@ #define ASSIGNMENT_SECURITY "Security" #define ASSIGNMENT_SURGEON "Surgeon" -var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT_LEVEL_MODERATE = "Moderate", EVENT_LEVEL_MAJOR = "Major") +GLOBAL_LIST_INIT(severity_to_string, list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT_LEVEL_MODERATE = "Moderate", EVENT_LEVEL_MAJOR = "Major")) /datum/event_container var/severity = -1 @@ -46,7 +46,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT new next_event.event_type(next_event) // Events are added and removed from the processing queue in their New/kill procs - LOG_DEBUG("Starting event '[next_event.name]' of severity [severity_to_string[severity]].") + LOG_DEBUG("Starting event '[next_event.name]' of severity [GLOB.severity_to_string[severity]].") next_event = null // When set to null, a random event will be selected next time else // If not, wait for one minute, instead of one tick, before checking again. @@ -111,7 +111,7 @@ var/global/list/severity_to_string = list(EVENT_LEVEL_MUNDANE = "Mundane", EVENT var/event_delay = rand(GLOB.config.event_delay_lower[severity], GLOB.config.event_delay_upper[severity]) * playercount_modifier next_event_time = world.time + event_delay - LOG_DEBUG("Next event of severity [severity_to_string[severity]] in [(next_event_time - world.time)/600] minutes.") + LOG_DEBUG("Next event of severity [GLOB.severity_to_string[severity]] in [(next_event_time - world.time)/600] minutes.") /datum/event_container/proc/SelectEvent() var/datum/event_meta/EM = input("Select an event to queue up.", "Event Selection", null) as null|anything in available_events diff --git a/code/modules/events/money_hacker.dm b/code/modules/events/money_hacker.dm index 21d55edbcc2..a767f882bbd 100644 --- a/code/modules/events/money_hacker.dm +++ b/code/modules/events/money_hacker.dm @@ -1,5 +1,3 @@ -/var/global/account_hack_attempted = 0 - /datum/event/money_hacker var/datum/money_account/affected_account endWhen = 100 @@ -9,8 +7,6 @@ end_time = world.time + 6000 if(SSeconomy.all_money_accounts.len) affected_account = SSeconomy.get_account(pick(SSeconomy.all_money_accounts)) - - account_hack_attempted = 1 else kill(TRUE) diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index b7d2586d8b2..8a17600238d 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -1,5 +1,3 @@ -/var/global/spacevines_spawned = 0 - /datum/event/spacevine announceWhen = 30 ic_name = "a biohazard" @@ -8,7 +6,6 @@ ..() spacevine_infestation() - spacevines_spawned = 1 /datum/event/spacevine/announce() level_seven_announcement(affecting_z) diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index ae3d39ae70b..d2eee93544c 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -1,4 +1,4 @@ -/var/global/sent_spiders_to_station = 0 + /datum/event/spider_infestation announceWhen = 90 @@ -9,7 +9,6 @@ /datum/event/spider_infestation/setup() announceWhen = rand(announceWhen, announceWhen + 60) spawncount = rand(4 * severity, 6 * severity) //spiderlings only have a 50% chance to grow big and strong - sent_spiders_to_station = 0 possible_spiders = list(/mob/living/simple_animal/hostile/giant_spider, /mob/living/simple_animal/hostile/giant_spider/nurse, /mob/living/simple_animal/hostile/giant_spider/emp, /mob/living/simple_animal/hostile/giant_spider/hunter, /mob/living/simple_animal/hostile/giant_spider/bombardier) /datum/event/spider_infestation/announce() diff --git a/code/modules/flufftext/Dreaming.dm b/code/modules/flufftext/Dreaming.dm index 7a1a4488214..fb20d9762a1 100644 --- a/code/modules/flufftext/Dreaming.dm +++ b/code/modules/flufftext/Dreaming.dm @@ -1,5 +1,5 @@ -var/list/dreams = list( +GLOBAL_LIST_INIT(dreams, list( "an ID card","a bottle","a familiar face","a crewmember","a toolbox","a security officer","the captain", "voices from all around","deep space","a doctor","the engine","a traitor","an ally","darkness", "light","a scientist","a monkey","a catastrophe","a loved one","a gun","warmth","freezing","the sun", @@ -12,14 +12,14 @@ var/list/dreams = list( "the chemist","the Machinist","the chef","the bartender","the chaplain","the librarian","a mouse","an ert member", "a beach","the holodeck","a smokey room","a voice","the cold","a mouse","an operating table","the bar","the rain","a skrell", "a unathi","a tajaran","the ai core","the mining station","the research station","a beaker of strange liquid" - ) + )) /mob/living/carbon/proc/dream() dreaming = 1 spawn(0) for(var/i = rand(1,4),i > 0, i--) - to_chat(src, SPAN_NOTICE("... [pick(dreams)] ...")) + to_chat(src, SPAN_NOTICE("... [pick(GLOB.dreams)] ...")) sleep(rand(40,70)) if(paralysis <= 0) break diff --git a/code/modules/ghostroles/spawner/antagonist/revenant.dm b/code/modules/ghostroles/spawner/antagonist/revenant.dm index 68f5f06b0f7..b3fc881475f 100644 --- a/code/modules/ghostroles/spawner/antagonist/revenant.dm +++ b/code/modules/ghostroles/spawner/antagonist/revenant.dm @@ -21,7 +21,7 @@ /datum/ghostspawner/revenant/cant_spawn(mob/user) . = ..() - if(!. && revenants.rifts_left <= 0) + if(!. && GLOB.revenants.rifts_left <= 0) return "The final rift has been closed." /datum/ghostspawner/revenant/spawn_mob(mob/user) @@ -40,7 +40,7 @@ announce_ghost_joinleave(user, FALSE, "They are now a [name].") R.ckey = user.ckey - revenants.add_antagonist(R.mind, TRUE, TRUE, FALSE, TRUE, TRUE) + GLOB.revenants.add_antagonist(R.mind, TRUE, TRUE, FALSE, TRUE, TRUE) if(R.client) to_chat(R, FONT_LARGE(SPAN_CULT("You can now speak with all revenants in the game world by using \"[R.client.prefs.language_prefixes[1]]rs\" before a message."))) if(!has_fired) @@ -59,10 +59,10 @@ has_fired = TRUE /datum/ghostspawner/revenant/proc/check_rift() - if(revenants.revenant_rift || revenants.rifts_left <= 0) + if(GLOB.revenants.revenant_rift || GLOB.revenants.rifts_left <= 0) return - var/kills_needed = ((initial(revenants.rifts_left) - revenants.rifts_left) + 1) * 5 - if(revenants.kill_count > kills_needed) + var/kills_needed = ((initial(GLOB.revenants.rifts_left) - GLOB.revenants.rifts_left) + 1) * 5 + if(GLOB.revenants.kill_count > kills_needed) var/turf/rift_turf var/list/possible_landmarks = list() for(var/thing in GLOB.landmarks_list) diff --git a/code/modules/ghostroles/spawner/human/admin/admin.dm b/code/modules/ghostroles/spawner/human/admin/admin.dm index 483e1f5a975..2f6256cb76c 100644 --- a/code/modules/ghostroles/spawner/human/admin/admin.dm +++ b/code/modules/ghostroles/spawner/human/admin/admin.dm @@ -177,7 +177,7 @@ if(start_location.landmark_tag != "nav_emergency_start") return TRUE - if(evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) + if(GLOB.evacuation_controller.evacuation_type == TRANSFER_EMERGENCY) if(get_security_level() != "green" ) var/datum/wifi/sender/door/wifi_sender = new("odin_arrivals_lockdown", SSghostroles) wifi_sender.activate("close") diff --git a/code/modules/ghostroles/spawner/human/emergencypod.dm b/code/modules/ghostroles/spawner/human/emergencypod.dm index 74043bcee4d..68926bd2577 100644 --- a/code/modules/ghostroles/spawner/human/emergencypod.dm +++ b/code/modules/ghostroles/spawner/human/emergencypod.dm @@ -471,4 +471,4 @@ if(W) W.handle_item_insertion(passport) - burglars.add_antagonist(H.mind, TRUE, TRUE, FALSE, TRUE, TRUE) + GLOB.burglars.add_antagonist(H.mind, TRUE, TRUE, FALSE, TRUE, TRUE) diff --git a/code/modules/ghostroles/spawner/human/human.dm b/code/modules/ghostroles/spawner/human/human.dm index de53199314b..07ee39020e9 100644 --- a/code/modules/ghostroles/spawner/human/human.dm +++ b/code/modules/ghostroles/spawner/human/human.dm @@ -76,7 +76,7 @@ if(!length(mname)) if(mob_name_prefix || mob_name_suffix) - mname = capitalize(pick(last_names)) + mname = capitalize(pick(GLOB.last_names)) else mname = random_name(gender,species) diff --git a/code/modules/hallucinations/types/basic.dm b/code/modules/hallucinations/types/basic.dm index 2726646095f..d7726632a90 100644 --- a/code/modules/hallucinations/types/basic.dm +++ b/code/modules/hallucinations/types/basic.dm @@ -17,12 +17,12 @@ if(2) sound_to(holder, 'sound/AI/strangeobject.ogg') to_chat(holder, "

    Welcome Object

    ") - to_chat(holder, SPAN_ALERT("Transport signature of [pick(adjectives)] origin detected in your path, an object appears to have been nesting aboard the Intrepid. [pick(SShallucinations.hallucinated_phrases)]")) + to_chat(holder, SPAN_ALERT("Transport signature of [pick(GLOB.adjectives)] origin detected in your path, an object appears to have been nesting aboard the Intrepid. [pick(SShallucinations.hallucinated_phrases)]")) if(3) sound_to(holder, 'sound/AI/scrubbers.ogg') to_chat(holder, "

    Reminder: Backpressure Warning

    ") - to_chat(holder, SPAN_ALERT("The scrubbers network is expecting \an [pick(adjectives)] surge. Some ejection of [pick(adjectives)] contents will occur.")) + to_chat(holder, SPAN_ALERT("The scrubbers network is expecting \an [pick(GLOB.adjectives)] surge. Some ejection of [pick(GLOB.adjectives)] contents will occur.")) if(4) sound_to(holder, 'sound/AI/emergency_shuttle_leaving_dock.ogg') @@ -42,7 +42,7 @@ if(7) sound_to(holder, 'sound/AI/meteors_detected_message.ogg') to_chat(holder, "

    Meteor Alarm

    ") - to_chat(holder, SPAN_ALERT("A [pick(adjectives)] meteor storm has been authorized for a destruction course with the [station_name(TRUE)]. Less than three minutes until impact, shields cannot help you; seek shelter in the central ring.")) + to_chat(holder, SPAN_ALERT("A [pick(GLOB.adjectives)] meteor storm has been authorized for a destruction course with the [station_name(TRUE)]. Less than three minutes until impact, shields cannot help you; seek shelter in the central ring.")) if(8) sound_to(holder,'sound/AI/fungi.ogg') diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm index d9b5ce18d3c..1de5d3b849b 100644 --- a/code/modules/heavy_vehicle/mech_interaction.dm +++ b/code/modules/heavy_vehicle/mech_interaction.dm @@ -532,7 +532,7 @@ return h return 0 -/var/global/datum/ui_state/default/mech_state = new() +GLOBAL_DATUM_INIT(mech_state, /datum/ui_state/default, new()) /datum/ui_state/default/mech/can_use_topic(var/mob/living/heavy_vehicle/src_object, var/mob/user) if(istype(src_object)) diff --git a/code/modules/heavy_vehicle/mecha.dm b/code/modules/heavy_vehicle/mecha.dm index 6bfa5f72f90..774be51d745 100644 --- a/code/modules/heavy_vehicle/mecha.dm +++ b/code/modules/heavy_vehicle/mecha.dm @@ -302,7 +302,7 @@ if(istype(exosuit) && exosuit.head && exosuit.head.radio && exosuit.head.radio.is_functional()) return ..() -/obj/item/device/radio/exosuit/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/ui_state/state = mech_state) +/obj/item/device/radio/exosuit/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1, var/datum/ui_state/state = GLOB.mech_state) . = ..() /mob/living/heavy_vehicle/proc/become_remote() diff --git a/code/modules/hydroponics/beekeeping/wax.dm b/code/modules/hydroponics/beekeeping/wax.dm index 28abb07c8dc..001baf83622 100644 --- a/code/modules/hydroponics/beekeeping/wax.dm +++ b/code/modules/hydroponics/beekeeping/wax.dm @@ -1,3 +1,7 @@ +GLOBAL_LIST_INIT_TYPED(wax_recipes, /datum/stack_recipe, list( + new /datum/stack_recipe("candle", /obj/item/flame/candle) +)) + /obj/item/stack/wax name = "wax" singular_name = "wax piece" @@ -8,8 +12,4 @@ /obj/item/stack/wax/New() ..() - recipes = wax_recipes - -var/global/list/datum/stack_recipe/wax_recipes = list( - new /datum/stack_recipe("candle", /obj/item/flame/candle) -) + recipes = GLOB.wax_recipes diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 217d3f2f2b1..e1aa557917e 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -365,7 +365,7 @@ dried_type = /obj/item/reagent_containers/food/snacks/fruit_slice var/datum/seed/seed -var/list/fruit_icon_cache = list() +GLOBAL_LIST_EMPTY(fruit_icon_cache) /obj/item/reagent_containers/food/snacks/fruit_slice/Initialize(mapload, datum/seed/S) . = ..() @@ -381,16 +381,16 @@ var/list/fruit_icon_cache = list() var/rind_colour = seed.get_trait(TRAIT_PRODUCT_COLOUR) var/flesh_colour = seed.get_trait(TRAIT_FLESH_COLOUR) if(!flesh_colour) flesh_colour = rind_colour - if(!fruit_icon_cache["rind-[rind_colour]"]) + if(!GLOB.fruit_icon_cache["rind-[rind_colour]"]) var/image/I = image(icon,"fruit_rind") I.color = rind_colour - fruit_icon_cache["rind-[rind_colour]"] = I - AddOverlays(fruit_icon_cache["rind-[rind_colour]"]) - if(!fruit_icon_cache["slice-[rind_colour]"]) + GLOB.fruit_icon_cache["rind-[rind_colour]"] = I + AddOverlays(GLOB.fruit_icon_cache["rind-[rind_colour]"]) + if(!GLOB.fruit_icon_cache["slice-[rind_colour]"]) var/image/I = image(icon,"fruit_slice") I.color = flesh_colour - fruit_icon_cache["slice-[rind_colour]"] = I - AddOverlays(fruit_icon_cache["slice-[rind_colour]"]) + GLOB.fruit_icon_cache["slice-[rind_colour]"] = I + AddOverlays(GLOB.fruit_icon_cache["slice-[rind_colour]"]) /obj/item/reagent_containers/food/snacks/grown/konyang_tea name = "sencha leaves" diff --git a/code/modules/lighting/lighting_profiler.dm b/code/modules/lighting/lighting_profiler.dm index 5b3c5f27179..ec6ae781125 100644 --- a/code/modules/lighting/lighting_profiler.dm +++ b/code/modules/lighting/lighting_profiler.dm @@ -2,7 +2,7 @@ // FOR DEBUGGING ONLY! /proc/lprof_write(var/atom/movable/obj, var/type = "UNKNOWN") - if (!lighting_profiling || !obj || !establish_db_connection(GLOB.dbcon)) + if (!GLOB.lighting_profiling || !obj || !establish_db_connection(GLOB.dbcon)) return var/x = null @@ -38,4 +38,4 @@ if (err) LOG_DEBUG("lprof_write: SQL Error: [err]") message_admins(SPAN_DANGER("SQL Error during lighting profiling; disabling!")) - lighting_profiling = FALSE + GLOB.lighting_profiling = FALSE diff --git a/code/modules/lighting/lighting_verbs.dm b/code/modules/lighting/lighting_verbs.dm index 1f6110171d6..ceb67c51993 100644 --- a/code/modules/lighting/lighting_verbs.dm +++ b/code/modules/lighting/lighting_verbs.dm @@ -1,11 +1,11 @@ -var/list/admin_verbs_lighting = list( +GLOBAL_LIST_INIT(admin_verbs_lighting, list( /client/proc/lighting_hide_verbs, /client/proc/lighting_flush, /client/proc/lighting_reconsider_target, /client/proc/lighting_build_overlay, /client/proc/lighting_clear_overlay, /client/proc/lighting_toggle_profiling -) +)) /client/proc/lighting_show_verbs() set category = "Debug" @@ -15,7 +15,7 @@ var/list/admin_verbs_lighting = list( if (!check_rights(R_DEBUG|R_DEV)) return to_chat(src, SPAN_NOTICE("Lighting debug verbs have been shown.")) - add_verb(src, admin_verbs_lighting) + add_verb(src, GLOB.admin_verbs_lighting) /client/proc/lighting_hide_verbs() set category = "Lighting" @@ -25,7 +25,7 @@ var/list/admin_verbs_lighting = list( if (!check_rights(R_DEBUG|R_DEV)) return to_chat(src, SPAN_NOTICE("Lighting debug verbs have been hidden.")) - remove_verb(src, admin_verbs_lighting) + remove_verb(src, GLOB.admin_verbs_lighting) /client/proc/lighting_flush() set category = "Lighting" @@ -98,5 +98,5 @@ var/list/admin_verbs_lighting = list( to_chat(usr, SPAN_ALERT("Unable to start profiling: No active database connection.")) return - lighting_profiling = !lighting_profiling - log_and_message_admins("has [lighting_profiling ? "enabled" : "disabled"] lighting profiling.") + GLOB.lighting_profiling = !GLOB.lighting_profiling + log_and_message_admins("has [GLOB.lighting_profiling ? "enabled" : "disabled"] lighting profiling.") diff --git a/code/modules/liquid/splash_simulation.dm b/code/modules/liquid/splash_simulation.dm index 183787fef7e..fffa7ce1a85 100644 --- a/code/modules/liquid/splash_simulation.dm +++ b/code/modules/liquid/splash_simulation.dm @@ -1,8 +1,6 @@ #define LIQUID_TRANSFER_THRESHOLD 0.05 -var/liquid_delay = 4 - -var/list/datum/puddle/puddles = list() +GLOBAL_LIST_INIT_TYPED(puddles, /datum/puddle, list()) /datum/puddle var/list/obj/effect/liquid/liquid_objects = list() @@ -19,10 +17,10 @@ var/list/datum/puddle/puddles = list() /datum/puddle/New() ..() - puddles += src + GLOB.puddles += src /datum/puddle/Destroy() - puddles -= src + GLOB.puddles -= src for(var/obj/O in liquid_objects) qdel(O) return ..() diff --git a/code/modules/mapping/planet_types/lore/konyang.dm b/code/modules/mapping/planet_types/lore/konyang.dm index 2e2487d3b80..471392bd051 100644 --- a/code/modules/mapping/planet_types/lore/konyang.dm +++ b/code/modules/mapping/planet_types/lore/konyang.dm @@ -53,7 +53,7 @@ /obj/effect/overmap/visitable/sector/exoplanet/konyang/Initialize() . = ..() - var/area/overmap/map = global.map_overmap + var/area/overmap/map = GLOB.map_overmap for(var/obj/effect/overmap/visitable/sector/point_verdant/P in map) P.x = x P.y = y diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm index 0df1384d1c8..ff5103473e7 100644 --- a/code/modules/mining/mine_items.dm +++ b/code/modules/mining/mine_items.dm @@ -884,7 +884,7 @@ /**********************"Fultons"**********************/ -var/list/total_extraction_beacons = list() +GLOBAL_LIST_INIT_TYPED(total_extraction_beacons, /obj/structure/extraction_point, list()) /obj/item/extraction_pack name = "warp extraction pack" @@ -904,7 +904,7 @@ var/list/total_extraction_beacons = list() /obj/item/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 @@ -936,7 +936,7 @@ var/list/total_extraction_beacons = list() if(A.anchored) return var/turf/T = get_turf(A) - for(var/found_inhibitor in bluespace_inhibitors) + for(var/found_inhibitor in GLOB.bluespace_inhibitors) var/obj/machinery/anti_bluespace/AB = found_inhibitor if(T.z != AB.z || get_dist(T, AB) > 8 || (AB.stat & (NOPOWER | BROKEN))) continue @@ -989,10 +989,10 @@ var/list/total_extraction_beacons = list() . = ..() 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 return ..() /**********************Resonator**********************/ diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 92655047cd0..01db9e9be79 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -13,12 +13,12 @@ /turf/unsimulated/mineral/konyang color = "#514e5c" -// This is a global list so we can share the same list with all mineral turfs; it's the same for all of them anyways. -var/list/mineral_can_smooth_with = list( +/// This is a global list so we can share the same list with all mineral turfs; it's the same for all of them anyways. +GLOBAL_LIST_INIT(mineral_can_smooth_with, list( /turf/simulated/mineral, /turf/simulated/wall, /turf/unsimulated/wall -) +)) /turf/simulated/mineral name = "rock" @@ -84,7 +84,7 @@ var/list/mineral_can_smooth_with = list( has_opaque_atom = TRUE if(smoothing_flags) - canSmoothWith = mineral_can_smooth_with + canSmoothWith = GLOB.mineral_can_smooth_with rock_health = rand(10,20) @@ -730,13 +730,13 @@ var/list/mineral_can_smooth_with = list( roof_type = null turf_flags = TURF_FLAG_BACKGROUND -// Same as the other, this is a global so we don't have a lot of pointless lists floating around. -// Basalt is explicitly omitted so ash will spill onto basalt turfs. -var/list/asteroid_floor_smooth = list( +/// Same as the other, this is a global so we don't have a lot of pointless lists floating around. +/// Basalt is explicitly omitted so ash will spill onto basalt turfs. +GLOBAL_LIST_INIT(asteroid_floor_smooth, list( /turf/simulated/floor/exoplanet/asteroid/ash, /turf/simulated/mineral, /turf/simulated/wall -) +)) // Copypaste parent for performance. /turf/simulated/floor/exoplanet/asteroid/Initialize(mapload) @@ -762,7 +762,7 @@ var/list/asteroid_floor_smooth = list( queue_ao() if(smoothing_flags) - canSmoothWith = asteroid_floor_smooth + canSmoothWith = GLOB.asteroid_floor_smooth pixel_x = -4 pixel_y = -4 diff --git a/code/modules/mob/abstract/freelook/ai/update_triggers.dm b/code/modules/mob/abstract/freelook/ai/update_triggers.dm index f0bc38d1b67..091c1dc44da 100644 --- a/code/modules/mob/abstract/freelook/ai/update_triggers.dm +++ b/code/modules/mob/abstract/freelook/ai/update_triggers.dm @@ -4,7 +4,7 @@ /obj/machinery/camera/proc/update_coverage(var/network_change = 0) if(network_change) - var/list/open_networks = difflist(network, restricted_camera_networks) + var/list/open_networks = difflist(network, GLOB.restricted_camera_networks) // Add or remove camera from the camera net as necessary if(on_open_network && !open_networks.len) on_open_network = FALSE diff --git a/code/modules/mob/abstract/ghost/ghost.dm b/code/modules/mob/abstract/ghost/ghost.dm index 409481c0fca..96189609d0e 100644 --- a/code/modules/mob/abstract/ghost/ghost.dm +++ b/code/modules/mob/abstract/ghost/ghost.dm @@ -99,7 +99,7 @@ var/list/L = list() var/holyblock = FALSE - if(usr.invisibility <= SEE_INVISIBLE_LIVING || (usr.mind in cult.current_antagonists)) + if(usr.invisibility <= SEE_INVISIBLE_LIVING || (usr.mind in GLOB.cult.current_antagonists)) for(var/turf/T in get_area_turfs(thearea)) if(!T.holy && has_ghost_restrictions) L+=T diff --git a/code/modules/mob/abstract/ghost/observer/observer.dm b/code/modules/mob/abstract/ghost/observer/observer.dm index c9624bcfbfb..3be389b450d 100644 --- a/code/modules/mob/abstract/ghost/observer/observer.dm +++ b/code/modules/mob/abstract/ghost/observer/observer.dm @@ -69,9 +69,9 @@ name = body.real_name else if(gender == MALE) - name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + name = capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) else - name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + name = capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) mind = body.mind //we don't transfer the mind but we keep a reference to it. @@ -85,7 +85,7 @@ forceMove(T) if(!name) //To prevent nameless ghosts - name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + name = capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) real_name = name /mob/abstract/ghost/observer/Destroy() @@ -310,7 +310,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(check_rights(R_ADMIN|R_FUN, 0, src)) return 0 - return (T && T.holy) && (invisibility <= SEE_INVISIBLE_LIVING || (mind in cult.current_antagonists)) + return (T && T.holy) && (invisibility <= SEE_INVISIBLE_LIVING || (mind in GLOB.cult.current_antagonists)) /mob/abstract/ghost/observer/verb/jumptomob(input in getmobs()) //Moves the ghost instead of just changing the ghosts's eye -Nodrak set category = "Ghost" diff --git a/code/modules/mob/abstract/unauthed/login.dm b/code/modules/mob/abstract/unauthed/login.dm index b9e7afcd15d..3a84bbb364d 100644 --- a/code/modules/mob/abstract/unauthed/login.dm +++ b/code/modules/mob/abstract/unauthed/login.dm @@ -1,4 +1,4 @@ -/var/list/unauthed = list() +GLOBAL_LIST_EMPTY(unauthed) /mob/abstract/unauthed authed = FALSE @@ -14,7 +14,7 @@ update_Login_details() to_chat(src, SPAN_DANGER("You need to authenticate before you can continue.")) token = md5("[client.ckey][client.computer_id][world.time][rand()]") - unauthed[token] = src + GLOB.unauthed[token] = src remove_verb(client, typesof(/client/verb)) var/uihtml = "

    Please select:

    " if(GLOB.config.guests_allowed) @@ -67,7 +67,7 @@ if(istype(c.mob, /mob/abstract/unauthed)) c.mob = new /mob/abstract/new_player() - unauthed -= token + GLOB.unauthed -= token /mob/abstract/unauthed/Topic(href, href_list) if(!src.client) diff --git a/code/modules/mob/floating_messages.dm b/code/modules/mob/floating_messages.dm index 999e056a624..8fcc8633bbe 100644 --- a/code/modules/mob/floating_messages.dm +++ b/code/modules/mob/floating_messages.dm @@ -1,5 +1,5 @@ // Thanks to Burger from Burgerstation for the foundation for this -var/list/floating_chat_colors = list() +GLOBAL_LIST_INIT(floating_chat_colors, list()) ///Compute an unique key that is used to associate an image to the client that received said image #define STORED_CHAT_TEXT_HASH(client) "[client.ckey]" @@ -16,7 +16,7 @@ var/list/floating_chat_colors = list() return get_random_colour(0, 160, 230) /atom/movable/proc/set_floating_chat_color(color) - floating_chat_colors[name] = color + GLOB.floating_chat_colors[name] = color /atom/movable/proc/animate_chat(message, datum/language/language, small, list/show_to, duration, override_color) SHOULD_NOT_SLEEP(TRUE) @@ -37,9 +37,9 @@ var/list/floating_chat_colors = list() if(istype(language, /datum/language/noise)) message = "* " + uncapitalize(message) - if(!floating_chat_colors[name]) - floating_chat_colors[name] = get_floating_chat_color() - style += "color: [floating_chat_colors[name]];" + if(!GLOB.floating_chat_colors[name]) + GLOB.floating_chat_colors[name] = get_floating_chat_color() + style += "color: [GLOB.floating_chat_colors[name]];" send_chat_floating_text_to_clients(show_to, message, fontsize, style, duration, language) diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index 0af8e361890..e097025427e 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -1,5 +1,3 @@ -var/list/holder_mob_icon_cache = list() - //Helper object for picking dionaea (and other creatures) up. /obj/item/holder name = "holder" diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 443c3c80157..ec74996e041 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -99,27 +99,27 @@ W.forceMove(T) return T -//The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot. -var/list/slot_equipment_priority = list( \ - slot_back,\ - slot_wear_id,\ - slot_w_uniform,\ - slot_wear_suit,\ - slot_wear_mask,\ - slot_head,\ - slot_shoes,\ - slot_gloves,\ - slot_l_ear,\ - slot_r_ear,\ - slot_glasses,\ - slot_belt,\ - slot_s_store,\ - slot_tie,\ - slot_l_store,\ - slot_r_store,\ - slot_wrists,\ - slot_pants\ - ) +///The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot. +GLOBAL_LIST_INIT(slot_equipment_priority, list( + slot_back, + slot_wear_id, + slot_w_uniform, + slot_wear_suit, + slot_wear_mask, + slot_head, + slot_shoes, + slot_gloves, + slot_l_ear, + slot_r_ear, + slot_glasses, + slot_belt, + slot_s_store, + slot_tie, + slot_l_store, + slot_r_store, + slot_wrists, + slot_pants + )) //Checks if a given slot can be accessed at this time, either to equip or unequip I /mob/proc/slot_is_accessible(var/slot, var/obj/item/I, mob/user=null) @@ -130,7 +130,7 @@ var/list/slot_equipment_priority = list( \ /mob/proc/equip_to_appropriate_slot(obj/item/W) if(!istype(W)) return 0 - for(var/slot in slot_equipment_priority) + for(var/slot in GLOB.slot_equipment_priority) if(equip_to_slot_if_possible(W, slot, delete_on_fail = FALSE, disable_warning = TRUE, redraw_mob = TRUE)) return 1 diff --git a/code/modules/mob/language/language.dm b/code/modules/mob/language/language.dm index 88ecbfcb0be..f1ae1544f80 100644 --- a/code/modules/mob/language/language.dm +++ b/code/modules/mob/language/language.dm @@ -80,9 +80,9 @@ /datum/language/proc/get_random_name(var/gender, name_count=2, syllable_count=4, syllable_divisor=2) if(!syllables || !syllables.len) if(gender==FEMALE) - return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) else - return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) var/full_name = "" var/new_name = "" diff --git a/code/modules/mob/language/station.dm b/code/modules/mob/language/station.dm index 7c9e5b12fcf..29339d201cc 100644 --- a/code/modules/mob/language/station.dm +++ b/code/modules/mob/language/station.dm @@ -370,9 +370,9 @@ /datum/language/human/get_random_name(var/gender) if (prob(80)) if(gender==FEMALE) - return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) else - return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) else return ..() @@ -409,7 +409,7 @@ /datum/language/machine/get_random_name() if(prob(70)) return "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]" - return pick(ai_names) + return pick(GLOB.ai_names) // we're trimming out the punctuation and not readding it, so we need to readd it at the very end /datum/language/machine/scramble(var/input, var/list/known_languages) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index de413423390..26a827502d8 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -122,7 +122,7 @@ else healths.icon_state = "health7" - client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) + client.screen.Remove(GLOB.global_hud.blurry, GLOB.global_hud.druggy, GLOB.global_hud.vimpaired) if(stat != DEAD) if(blinded) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index f29d989344a..ca0217488a7 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -201,7 +201,7 @@ set_see_invisible(SEE_INVISIBLE_LIVING) if (client) - client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) + client.screen.Remove(GLOB.global_hud.blurry, GLOB.global_hud.druggy, GLOB.global_hud.vimpaired) if(stat != DEAD) if(blinded) diff --git a/code/modules/mob/living/carbon/diona_base.dm b/code/modules/mob/living/carbon/diona_base.dm index 02191326ce9..7f7643a47fc 100644 --- a/code/modules/mob/living/carbon/diona_base.dm +++ b/code/modules/mob/living/carbon/diona_base.dm @@ -13,7 +13,7 @@ #define LIMB_REGROW_REQUIREMENT 2500 #define LANGUAGE_POINTS_TO_LEARN 1 //The number of samples of a language required to learn it -var/list/diona_banned_languages = list( +GLOBAL_LIST_INIT(diona_banned_languages, list( /datum/language/cult, /datum/language/cultcommon, /datum/language/corticalborer, @@ -22,7 +22,8 @@ var/list/diona_banned_languages = list( /datum/language/bug, /datum/language/ling, /datum/language/revenant, - /datum/language/machine) + /datum/language/machine, + )) #define DIONA_LIGHT_COEFICIENT 0.25 /mob/living/carbon/proc/diona_handle_light(var/datum/dionastats/DS) //Carbon is the highest common denominator between gestalts and nymphs. They will share light code @@ -667,7 +668,7 @@ var/list/diona_banned_languages = list( //Now we sample their languages! for(var/datum/language/L in H.languages) learned = max(learned, 1) - if (!(L in user.languages) && !(L in diona_banned_languages)) + if (!(L in user.languages) && !(L in GLOB.diona_banned_languages)) //We don't know this language, and we can learn it! var/current_progress = language_progress[L.name] current_progress += 1 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 9859762fcd5..685b19aa54e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -86,7 +86,7 @@ . = ..() hide_underwear.Cut() - for(var/category in global_underwear.categories_by_name) + for(var/category in GLOB.global_underwear.categories_by_name) hide_underwear[category] = FALSE if(dna) @@ -1266,7 +1266,7 @@ if (client) prefs = client.prefs else if (ckey) // Mob might be logged out. - prefs = preferences_datums[ckey(ckey)] // run the ckey through ckey() here so that aghosted mobs can be rejuv'd too. (Their ckeys are prefixed with @) + prefs = GLOB.preferences_datums[ckey(ckey)] // run the ckey through ckey() here so that aghosted mobs can be rejuv'd too. (Their ckeys are prefixed with @) if (prefs && real_name == prefs.real_name) // Re-apply the mob's markings and prosthetics if their pref is their current char. @@ -1913,7 +1913,7 @@ if(stat) return - var/datum/category_group/underwear/UWC = tgui_input_list(usr, "Choose underwear.", "Show/Hide Underwear", global_underwear.categories) + var/datum/category_group/underwear/UWC = tgui_input_list(usr, "Choose underwear.", "Show/Hide Underwear", GLOB.global_underwear.categories) if(!UWC) return var/datum/category_item/underwear/UWI = all_underwear[UWC.name] diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 998613a65ef..a9754c017f1 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -449,10 +449,10 @@ This function restores all organs. var/old_damage = damage var/tally silent = TRUE // Will damage a lot of organs, probably, so avoid spam. - for(var/zone in organ_rel_size) - tally += organ_rel_size[zone] - for(var/zone in organ_rel_size) - damage = old_damage * organ_rel_size[zone]/tally + for(var/zone in GLOB.organ_rel_size) + tally += GLOB.organ_rel_size[zone] + for(var/zone in GLOB.organ_rel_size) + damage = old_damage * GLOB.organ_rel_size[zone]/tally def_zone = zone . = .() || . return diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 6e530294768..2c8dbd88914 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -73,11 +73,11 @@ emp_act /mob/living/carbon/human/get_blocked_ratio(def_zone, damage_type, damage_flags, armor_pen, damage) if(!def_zone && (damage_flags & DAMAGE_FLAG_DISPERSED)) var/tally - for(var/zone in organ_rel_size) - tally += organ_rel_size[zone] - for(var/zone in organ_rel_size) + for(var/zone in GLOB.organ_rel_size) + tally += GLOB.organ_rel_size[zone] + for(var/zone in GLOB.organ_rel_size) def_zone = zone - . += .() * organ_rel_size/tally + . += .() * GLOB.organ_rel_size/tally return return ..() @@ -251,7 +251,7 @@ emp_act //Harder to score a stun but if you do it lasts a bit longer if(prob(effective_force) && head && !istype(head, /obj/item/clothing/head/helmet)) visible_message(SPAN_DANGER("[src] [species.knockout_message]")) - apply_effect(20, PARALYZE, blocked) + apply_effect(20, PARALYZE, GLOB.blocked) //Apply blood if(!(I.atom_flags & ATOM_FLAG_NO_BLOOD)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index af31896fae6..712ee7be746 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -654,11 +654,11 @@ for(var/obj/item/I in src) if(I.contaminated && !(species.flags & PHORON_IMMUNE)) if(I == r_hand) - apply_damage(vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_R_HAND) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_R_HAND) else if(I == l_hand) - apply_damage(vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_L_HAND) + apply_damage(GLOB.vsc.plc.CONTAMINATION_LOSS, DAMAGE_BURN, BP_L_HAND) else - adjustFireLoss(vsc.plc.CONTAMINATION_LOSS) + adjustFireLoss(GLOB.vsc.plc.CONTAMINATION_LOSS) if (intoxication) handle_intoxication() @@ -1418,7 +1418,7 @@ /mob/living/carbon/human/handle_vision() if(client) - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask, global_hud.nvg, global_hud.thermal, global_hud.meson, global_hud.science) + client.screen.Remove(GLOB.global_hud.blurry, GLOB.global_hud.druggy, GLOB.global_hud.vimpaired, GLOB.global_hud.darkMask, GLOB.global_hud.nvg, GLOB.global_hud.thermal, GLOB.global_hud.meson, GLOB.global_hud.science) var/machine_has_equipment_vision = FALSE if(machine) var/viewflags = machine.check_eye(src) diff --git a/code/modules/mob/living/carbon/human/species/outsider/revenant.dm b/code/modules/mob/living/carbon/human/species/outsider/revenant.dm index 74b7dc8b31e..4f5da19aed0 100644 --- a/code/modules/mob/living/carbon/human/species/outsider/revenant.dm +++ b/code/modules/mob/living/carbon/human/species/outsider/revenant.dm @@ -101,7 +101,7 @@ if(player_is_antag(H.mind)) var/datum/ghostspawner/revenant/R = SSghostroles.get_spawner(MODE_REVENANT) R.count = max(R.count - 1, 0) - revenants.kill_count++ + GLOB.revenants.kill_count++ INVOKE_ASYNC(src, PROC_REF(spawn_gore), get_turf(H)) H.set_death_time(ANIMAL, world.time) for(var/obj/item/I in H) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 4958289c7a7..58aaf3dd36d 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -427,9 +427,9 @@ /datum/species/proc/get_random_name(var/gender) if(!name_language) if(gender == FEMALE) - return capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_female)) + " " + capitalize(pick(GLOB.last_names)) else - return capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names)) + return capitalize(pick(GLOB.first_names_male)) + " " + capitalize(pick(GLOB.last_names)) var/datum/language/species_language = GLOB.all_languages[name_language] if(!species_language) @@ -642,7 +642,7 @@ H.set_fullscreen(H.eye_blurry, "blurry", /atom/movable/screen/fullscreen/blurry) if(H.druggy) - H.client.screen += global_hud.druggy + H.client.screen += GLOB.global_hud.druggy if(H.druggy > 5) H.add_client_color(/datum/client_color/oversaturated) else diff --git a/code/modules/mob/living/carbon/human/species/station/golem.dm b/code/modules/mob/living/carbon/human/species/station/golem.dm index bc7795b8025..eb98f1c5545 100644 --- a/code/modules/mob/living/carbon/human/species/station/golem.dm +++ b/code/modules/mob/living/carbon/human/species/station/golem.dm @@ -1,22 +1,22 @@ -var/global/list/golem_types = list( - SPECIES_GOLEM_COAL, - SPECIES_GOLEM_IRON, - SPECIES_GOLEM_BRONZE, - SPECIES_GOLEM_STEEL, - SPECIES_GOLEM_PLASTEEL, - SPECIES_GOLEM_TITANIUM, - SPECIES_GOLEM_CLOTH, - SPECIES_GOLEM_CARDBOARD, - SPECIES_GOLEM_GLASS, - SPECIES_GOLEM_PHORON, - SPECIES_GOLEM_HYDROGEN, - SPECIES_GOLEM_WOOD, - SPECIES_GOLEM_DIAMOND, - SPECIES_GOLEM_SAND, - SPECIES_GOLEM_URANIUM, - SPECIES_GOLEM_MEAT, - SPECIES_GOLEM_ADAMANTINE - ) +GLOBAL_LIST_INIT(golem_types, list( + SPECIES_GOLEM_COAL, + SPECIES_GOLEM_IRON, + SPECIES_GOLEM_BRONZE, + SPECIES_GOLEM_STEEL, + SPECIES_GOLEM_PLASTEEL, + SPECIES_GOLEM_TITANIUM, + SPECIES_GOLEM_CLOTH, + SPECIES_GOLEM_CARDBOARD, + SPECIES_GOLEM_GLASS, + SPECIES_GOLEM_PHORON, + SPECIES_GOLEM_HYDROGEN, + SPECIES_GOLEM_WOOD, + SPECIES_GOLEM_DIAMOND, + SPECIES_GOLEM_SAND, + SPECIES_GOLEM_URANIUM, + SPECIES_GOLEM_MEAT, + SPECIES_GOLEM_ADAMANTINE +)) /datum/species/golem name = SPECIES_GOLEM_COAL diff --git a/code/modules/mob/living/carbon/slime/items.dm b/code/modules/mob/living/carbon/slime/items.dm index 050eae19701..6b811328103 100644 --- a/code/modules/mob/living/carbon/slime/items.dm +++ b/code/modules/mob/living/carbon/slime/items.dm @@ -295,7 +295,7 @@ /obj/effect/golemrune/random_type/Initialize() . = ..() - golem_type = pick(golem_types) + golem_type = pick(GLOB.golem_types) /obj/effect/golemrune/Destroy() SSghostroles.remove_spawn_atom("golem", src) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 4d17e7aa807..1078e83daa5 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -43,12 +43,12 @@ return TRUE /mob/living/proc/apply_damages(var/brute = 0, var/burn = 0, var/tox = 0, var/oxy = 0, var/clone = 0, var/halloss = 0, var/def_zone, var/damage_flags = 0) - if(brute) apply_damage(brute, DAMAGE_BRUTE, def_zone, blocked) - if(burn) apply_damage(burn, DAMAGE_BURN, def_zone, blocked) - if(tox) apply_damage(tox, DAMAGE_TOXIN, def_zone, blocked) - if(oxy) apply_damage(oxy, DAMAGE_OXY, def_zone, blocked) - if(clone) apply_damage(clone, DAMAGE_CLONE, def_zone, blocked) - if(halloss) apply_damage(halloss, DAMAGE_PAIN, def_zone, blocked) + if(brute) apply_damage(brute, DAMAGE_BRUTE, def_zone, GLOB.blocked) + if(burn) apply_damage(burn, DAMAGE_BURN, def_zone, GLOB.blocked) + if(tox) apply_damage(tox, DAMAGE_TOXIN, def_zone, GLOB.blocked) + if(oxy) apply_damage(oxy, DAMAGE_OXY, def_zone, GLOB.blocked) + if(clone) apply_damage(clone, DAMAGE_CLONE, def_zone, GLOB.blocked) + if(halloss) apply_damage(halloss, DAMAGE_PAIN, def_zone, GLOB.blocked) return TRUE /** diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 67b61d7902e..9781825598f 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -244,7 +244,7 @@ return // Push sound to client. Pipe dream TODO: crossfade between the new and old weather ambience. - sound_to(src, sound(null, repeat = 0, wait = 0, volume = 0, channel = sound_channels.weather_channel)) + sound_to(src, sound(null, repeat = 0, wait = 0, volume = 0, channel = GLOB.sound_channels.weather_channel)) if(send_sound) - sound_to(src, sound(send_sound, repeat = TRUE, wait = 0, volume = 30, channel = sound_channels.weather_channel)) + sound_to(src, sound(send_sound, repeat = TRUE, wait = 0, volume = 30, channel = GLOB.sound_channels.weather_channel)) diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index 45802773865..e22f94da81a 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -1,8 +1,9 @@ #define AI_CHECK_WIRELESS 1 #define AI_CHECK_RADIO 2 -var/list/ai_list = list() -var/list/ai_verbs_default = list( +GLOBAL_LIST_INIT_TYPED(ai_list, /mob/living/silicon/ai, list()) + +GLOBAL_LIST_INIT(ai_verbs_default, list( /mob/living/silicon/ai/proc/ai_announcement, /mob/living/silicon/ai/proc/ai_call_shuttle, /mob/living/silicon/ai/proc/ai_emergency_message, @@ -28,13 +29,13 @@ var/list/ai_verbs_default = list( /mob/living/silicon/ai/proc/ai_examine, /mob/living/silicon/ai/proc/multitool_mode, /mob/living/silicon/ai/proc/toggle_hologram_movement -) +)) //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 @@ -107,11 +108,11 @@ var/list/ai_verbs_default = list( var/custom_sprite = FALSE // Whether the selected icon is custom /mob/living/silicon/ai/proc/add_ai_verbs() - add_verb(src, ai_verbs_default) + add_verb(src, GLOB.ai_verbs_default) add_verb(src, silicon_subsystems) /mob/living/silicon/ai/proc/remove_ai_verbs() - remove_verb(src, ai_verbs_default) + remove_verb(src, GLOB.ai_verbs_default) remove_verb(src, silicon_subsystems) /mob/living/silicon/ai/Initialize(mapload, datum/ai_laws/L, obj/item/device/mmi/B, safety = 0) @@ -121,11 +122,11 @@ var/list/ai_verbs_default = list( announcement.announcement_type = "A.I. Announcement" announcement.newscast = TRUE - var/list/possibleNames = ai_names + var/list/possibleNames = GLOB.ai_names var/pickedName while(!pickedName) - pickedName = pick(ai_names) + pickedName = pick(GLOB.ai_names) for(var/mob/living/silicon/ai/A in GLOB.mob_list) if(A.real_name == pickedName && length(possibleNames) > 1) //fixing the theoretically possible infinite loop possibleNames -= pickedName @@ -141,7 +142,7 @@ var/list/ai_verbs_default = list( if(L && istype(L, /datum/ai_laws)) laws = L else - laws = new base_law_type + laws = new GLOB.base_law_type ai_multi = new(src) ai_radio = new(src) @@ -197,7 +198,7 @@ var/list/ai_verbs_default = list( hud_list[IMPTRACK_HUD] = new /image/hud_overlay('icons/hud/hud.dmi', src, "hudblank") hud_list[SPECIALROLE_HUD] = new /image/hud_overlay('icons/hud/hud.dmi', src, "hudblank") - ai_list += src + GLOB.ai_list += src GLOB.cameranet.add_source(src) @@ -213,7 +214,7 @@ var/list/ai_verbs_default = list( QDEL_NULL(psupply) QDEL_NULL(ai_camera) QDEL_NULL(holo_icon) - ai_list -= src + GLOB.ai_list -= src destroy_eyeobj() return ..() @@ -221,7 +222,7 @@ var/list/ai_verbs_default = list( to_chat(src, "

    You are playing the [station_name()]'s AI.

    ") to_chat(src, "\[View help\] (or use OOC command AI-Help at any time)
    ") - if(malf && !(mind in malf.current_antagonists)) + if(GLOB.malf && !(mind in GLOB.malf.current_antagonists)) show_laws() to_chat(src, "These laws may be changed by other players, or by you if you are malfunctioning.") @@ -284,7 +285,7 @@ var/list/ai_verbs_default = list( icon = CUSTOM_ITEM_SYNTH selected_sprite = new/datum/ai_icon("Custom", "[sprite.aichassisicon]", "4", "[sprite.aichassisicon]-crash", "#FFFFFF", "#FFFFFF", "#FFFFFF") else - selected_sprite = default_ai_icon + selected_sprite = GLOB.default_ai_icon update_icon() /mob/living/silicon/ai/pointed(atom/A as mob|obj|turf in view()) @@ -391,7 +392,7 @@ var/list/ai_verbs_default = list( return if (!custom_sprite) - var/new_sprite = tgui_input_list(src, "Select an icon!", "AI", ai_icons, selected_sprite) + var/new_sprite = tgui_input_list(src, "Select an icon!", "AI", GLOB.ai_icons, selected_sprite) if(new_sprite) selected_sprite = new_sprite update_icon() @@ -604,7 +605,7 @@ var/list/ai_verbs_default = list( for (var/obj/machinery/camera/C in GLOB.cameranet.cameras) if(!C.can_use()) continue - var/list/tempnetwork = difflist(C.network,restricted_camera_networks,1) + var/list/tempnetwork = difflist(C.network, GLOB.restricted_camera_networks, 1) for(var/i in tempnetwork) cameralist[i] = i @@ -865,7 +866,7 @@ var/list/ai_verbs_default = list( to_chat(src, SPAN_NOTICE("Multitool mode: [multitool_mode ? "E" : "Dise"]ngaged")) /mob/living/silicon/ai/update_icon() - if(!selected_sprite) selected_sprite = default_ai_icon + if(!selected_sprite) selected_sprite = GLOB.default_ai_icon if(stat == DEAD) icon_state = selected_sprite.dead_icon diff --git a/code/modules/mob/living/silicon/ai/icons.dm b/code/modules/mob/living/silicon/ai/icons.dm index bfdd68e1c1b..b0443ef463f 100644 --- a/code/modules/mob/living/silicon/ai/icons.dm +++ b/code/modules/mob/living/silicon/ai/icons.dm @@ -1,5 +1,5 @@ -var/datum/ai_icon/default_ai_icon = new/datum/ai_icon/blue() -var/list/datum/ai_icon/ai_icons +GLOBAL_DATUM_INIT(default_ai_icon, /datum/ai_icon, new/datum/ai_icon/blue()) +GLOBAL_LIST_INIT_TYPED(ai_icons, /datum/ai_icon, null) /datum/ai_icon var/name @@ -19,9 +19,9 @@ var/list/datum/ai_icon/ai_icons src.alive_light = alive_light src.nopower_light = nopower_light src.dead_light = dead_light - if(!ai_icons) - ai_icons = list() - init_subtypes(/datum/ai_icon, ai_icons) + if(!GLOB.ai_icons) + GLOB.ai_icons = list() + init_subtypes(/datum/ai_icon, GLOB.ai_icons) ..() /datum/ai_icon/red diff --git a/code/modules/mob/living/silicon/laws.dm b/code/modules/mob/living/silicon/laws.dm index 84a7e16eb3f..7bb7ed637d8 100644 --- a/code/modules/mob/living/silicon/laws.dm +++ b/code/modules/mob/living/silicon/laws.dm @@ -1,6 +1,6 @@ /mob/living/silicon/proc/laws_sanity_check() if(!src.laws) - laws = new base_law_type + laws = new GLOB.base_law_type /mob/living/silicon/proc/has_zeroth_law() return laws.zeroth_law != null diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index a8fc896be96..1c070db78b3 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -210,7 +210,7 @@ healths.icon_state = "health7" if(syndicate && client) - for(var/datum/mind/tra in traitors.current_antagonists) + for(var/datum/mind/tra in GLOB.traitors.current_antagonists) if(tra.current) // TODO: Update to new antagonist system. var/I = image('icons/mob/mob.dmi', loc = tra.current, icon_state = "traitor") @@ -220,7 +220,7 @@ // TODO: Update to new antagonist system. if(!mind.special_role) mind.special_role = "traitor" - traitors.current_antagonists |= mind + GLOB.traitors.current_antagonists |= mind if(cells) if(cell) diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 106c1dba895..592b2c7a08f 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -346,11 +346,11 @@ if(module) selecting_module = FALSE return - if(!(mod_type in robot_modules)) + if(!(mod_type in GLOB.robot_modules)) selecting_module = FALSE return - var/module_type = robot_modules[mod_type] + var/module_type = GLOB.robot_modules[mod_type] playsound(get_turf(src), 'sound/effects/pop.ogg', 100, TRUE) spark(get_turf(src), 5, GLOB.alldirs) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 8249b1abf71..36928e0089a 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -1,14 +1,14 @@ -var/global/list/robot_modules = list( - "Service" = /obj/item/robot_module/service/butler, - "Clerical" = /obj/item/robot_module/service/clerical, - "Research" = /obj/item/robot_module/research, - "Mining" = /obj/item/robot_module/miner, - "Rescue" = /obj/item/robot_module/medical/rescue, - "Medical" = /obj/item/robot_module/medical/general, - "Engineering" = /obj/item/robot_module/engineering/general, - "Construction" = /obj/item/robot_module/engineering/construction, - "Custodial" = /obj/item/robot_module/janitor -) +GLOBAL_LIST_INIT(robot_modules, list( + "Service" = /obj/item/robot_module/service/butler, + "Clerical" = /obj/item/robot_module/service/clerical, + "Research" = /obj/item/robot_module/research, + "Mining" = /obj/item/robot_module/miner, + "Rescue" = /obj/item/robot_module/medical/rescue, + "Medical" = /obj/item/robot_module/medical/general, + "Engineering" = /obj/item/robot_module/engineering/general, + "Construction" = /obj/item/robot_module/engineering/construction, + "Custodial" = /obj/item/robot_module/janitor +)) /obj/item/robot_module name = "robot module" diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 23d34ce9d24..2b1d39a956e 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -167,8 +167,8 @@ // this function displays the shuttles ETA in the status panel if the shuttle has been called /mob/living/silicon/proc/show_emergency_shuttle_eta() - if(evacuation_controller) - var/eta_status = evacuation_controller.get_status_panel_eta() + if(GLOB.evacuation_controller) + var/eta_status = GLOB.evacuation_controller.get_status_panel_eta() if(eta_status) stat(null, eta_status) @@ -338,10 +338,10 @@ /mob/living/silicon/proc/is_traitor() - return mind && (mind in traitors.current_antagonists) + return mind && (mind in GLOB.traitors.current_antagonists) /mob/living/silicon/proc/is_malf() - return mind && (mind in malf.current_antagonists) + return mind && (mind in GLOB.malf.current_antagonists) /mob/living/silicon/proc/is_malf_or_traitor() return is_traitor() || is_malf() diff --git a/code/modules/mob/living/simple_animal/borer/borer.dm b/code/modules/mob/living/simple_animal/borer/borer.dm index aa15cb7575b..976523323c9 100644 --- a/code/modules/mob/living/simple_animal/borer/borer.dm +++ b/code/modules/mob/living/simple_animal/borer/borer.dm @@ -46,7 +46,7 @@ /mob/living/simple_animal/borer/LateLogin() ..() if(mind) - borers.add_antagonist_mind(mind, 1, borers.role_text, borers.welcome_text) + GLOB.borers.add_antagonist_mind(mind, 1, GLOB.borers.role_text, GLOB.borers.welcome_text) if(client) client.init_verbs() if(host) @@ -167,8 +167,8 @@ return if(host.mind) - borers.clear_indicators(host.mind) - borers.remove_antagonist(host.mind) + GLOB.borers.clear_indicators(host.mind) + GLOB.borers.remove_antagonist(host.mind) forceMove(get_turf(host)) var/obj/item/organ/external/head = host.get_organ(BP_HEAD) diff --git a/code/modules/mob/living/simple_animal/borer/borer_powers.dm b/code/modules/mob/living/simple_animal/borer/borer_powers.dm index 3e30bfb3736..864a52b1846 100644 --- a/code/modules/mob/living/simple_animal/borer/borer_powers.dm +++ b/code/modules/mob/living/simple_animal/borer/borer_powers.dm @@ -140,7 +140,7 @@ //Update their traitor status. if(host.mind) - borers.add_antagonist_mind(host.mind, 1, borers.faction_role_text, borers.faction_welcome) + GLOB.borers.add_antagonist_mind(host.mind, 1, GLOB.borers.faction_role_text, GLOB.borers.faction_welcome) if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M diff --git a/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm b/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm index 3fc85e209d7..7608953b90c 100644 --- a/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm +++ b/code/modules/mob/living/simple_animal/constructs/constructs/cult_construct.dm @@ -67,7 +67,7 @@ /mob/living/simple_animal/construct/LateLogin() . = ..() if(!iscultist(src)) - cult.add_antagonist_mind(mind) + GLOB.cult.add_antagonist_mind(mind) /mob/living/simple_animal/construct/death() new /obj/item/ectoplasm(get_turf(src)) diff --git a/code/modules/mob/living/simple_animal/hostile/hostile.dm b/code/modules/mob/living/simple_animal/hostile/hostile.dm index 527d0a97ec2..822df114b91 100644 --- a/code/modules/mob/living/simple_animal/hostile/hostile.dm +++ b/code/modules/mob/living/simple_animal/hostile/hostile.dm @@ -496,7 +496,7 @@ ABSTRACT_TYPE(/mob/living/simple_animal/hostile) return ..() /mob/living/simple_animal/hostile/proc/check_horde() - if(evacuation_controller.is_prepared()) + if(GLOB.evacuation_controller.is_prepared()) if(!enroute && !last_found_target) //The shuttle docked, all monsters rush for the escape hallway if(!shuttletarget && GLOB.escape_list.len) //Make sure we didn't already assign it a target, and that there are targets to pick shuttletarget = pick(GLOB.escape_list) //Pick a shuttle target diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 7c8b29e2efa..5249f09c8b7 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -120,7 +120,7 @@ // Copy Mimic // -var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/cable, /obj/structure/window, /obj/projectile/animate) +GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/cable, /obj/structure/window, /obj/projectile/animate)) /mob/living/simple_animal/hostile/mimic/copy @@ -145,7 +145,7 @@ var/global/list/protected_objects = list(/obj/structure/table, /obj/structure/ca /mob/living/simple_animal/hostile/mimic/copy/proc/CopyObject(var/obj/O, var/mob/living/creator) - 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)) O.forceMove(src) appearance = O diff --git a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm index cd4ee8c8ae3..9a93ccba595 100644 --- a/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm +++ b/code/modules/mob/living/simple_animal/hostile/phoron_worm.dm @@ -137,7 +137,7 @@ for(var/mob/living/M in orange(1,src)) if(M != src) M.apply_damage(50, DAMAGE_BRUTE) - M.apply_effect(6, STUN, blocked) + M.apply_effect(6, STUN, GLOB.blocked) M.throw_at(get_random_turf_in_range(get_turf(src), 1), 2) /mob/living/simple_animal/hostile/phoron_worm/small diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 87a9aa220ff..a8080ad1812 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -257,8 +257,8 @@ //TODO: Integrate defence zones and targeting body parts with the actual organ system, move these into organ definitions. -//The base miss chance for the different defence zones -var/list/global/base_miss_chance = list( +///The base miss chance for the different defence zones +GLOBAL_LIST_INIT(base_miss_chance, list( BP_HEAD = 70, BP_CHEST = 10, BP_GROIN = 20, @@ -270,11 +270,11 @@ var/list/global/base_miss_chance = list( BP_R_HAND = 60, BP_L_FOOT = 60, BP_R_FOOT = 60 -) +)) -//Used to weight organs when an organ is hit randomly (i.e. not a directed, aimed attack). -//Also used to weight the protection value that armor provides for covering that body part when calculating protection from full-body effects. -var/list/global/organ_rel_size = list( +///Used to weight organs when an organ is hit randomly (i.e. not a directed, aimed attack). +///Also used to weight the protection value that armor provides for covering that body part when calculating protection from full-body effects. +GLOBAL_LIST_INIT(organ_rel_size, list( BP_HEAD = 25, BP_CHEST = 70, BP_GROIN = 30, @@ -286,7 +286,7 @@ var/list/global/organ_rel_size = list( BP_R_HAND = 10, BP_L_FOOT = 10, BP_R_FOOT = 10 -) +)) ///Find the mob at the bottom of a buckle chain /mob/proc/lowest_buckled_mob() @@ -318,7 +318,7 @@ var/list/global/organ_rel_size = list( if(prob(probability)) zone = check_zone(zone) else - zone = pick_weight(weighted_list ? weighted_list : organ_rel_size) //Slightly different from TG, we have a list with organ sizes + zone = pick_weight(weighted_list ? weighted_list : GLOB.organ_rel_size) //Slightly different from TG, we have a list with organ sizes return zone /// Emulates targetting a specific body part, and miss chances @@ -342,23 +342,23 @@ var/list/global/organ_rel_size = list( /mob/proc/calculate_zone_with_miss_chance(var/zone, var/miss_chance_mod) var/miss_chance = 10 - if (zone in base_miss_chance) - miss_chance = base_miss_chance[zone] + if (zone in GLOB.base_miss_chance) + miss_chance = GLOB.base_miss_chance[zone] miss_chance = max(miss_chance + miss_chance_mod, 0) if(prob(miss_chance)) if(prob(70)) return null - return pick(base_miss_chance) + return pick(GLOB.base_miss_chance) return zone // never a chance to miss, but you might not hit what you want to hit /mob/living/heavy_vehicle/calculate_zone_with_miss_chance(zone, miss_chance_mod) var/miss_chance = 10 - if(zone in base_miss_chance) - miss_chance = base_miss_chance[zone] + if(zone in GLOB.base_miss_chance) + miss_chance = GLOB.base_miss_chance[zone] miss_chance = max(miss_chance + miss_chance_mod, 0) if(prob(miss_chance)) - return pick(base_miss_chance) + return pick(GLOB.base_miss_chance) return zone /** @@ -494,8 +494,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return 0 -//converts intent-strings into numbers and back -var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT) +///converts intent-strings into numbers and back /proc/intent_numeric(argument) if(istext(argument)) switch(argument) @@ -1000,9 +999,9 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT) else if (ckey) // To avoid runtimes during adminghost. if (copytext(ckey, 1, 2) == "@") - P = preferences_datums[copytext(ckey, 2)] + P = GLOB.preferences_datums[copytext(ckey, 2)] else - P = preferences_datums[ckey] + P = GLOB.preferences_datums[ckey] else return null @@ -1018,9 +1017,9 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT) else if (ckey) // To avoid runtimes during adminghost. if (copytext(ckey, 1, 2) == "@") - P = preferences_datums[copytext(ckey, 2)] + P = GLOB.preferences_datums[copytext(ckey, 2)] else - P = preferences_datums[ckey] + P = GLOB.preferences_datums[ckey] else return 0 @@ -1040,9 +1039,9 @@ var/list/intents = list(I_HELP,I_DISARM,I_GRAB,I_HURT) else if (ckey) // To avoid runtimes during adminghost. if (copytext(ckey, 1, 2) == "@") - P = preferences_datums[copytext(ckey, 2)] + P = GLOB.preferences_datums[copytext(ckey, 2)] else - P = preferences_datums[ckey] + P = GLOB.preferences_datums[ckey] else return diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index dda97c47e9d..42ef5d3e995 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -134,7 +134,7 @@ final_destination = loc_landmark.loc - var/mob/living/silicon/ai/O = new (final_destination, base_law_type,,1)//No MMI but safety is in effect. + var/mob/living/silicon/ai/O = new (final_destination, GLOB.base_law_type,,1)//No MMI but safety is in effect. O.set_invisibility(0) O.ai_restore_power_routine = 0 diff --git a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm index 8fc9e496267..58ddc083350 100644 --- a/code/modules/modular_computers/NTNet/NTNRC/conversation.dm +++ b/code/modules/modular_computers/NTNet/NTNRC/conversation.dm @@ -1,4 +1,5 @@ -var/global/ntnrc_uid = 0 +GLOBAL_VAR_INIT(ntnrc_uid, 0) + /datum/ntnet_conversation var/id var/title = "Untitled Conversation" @@ -9,8 +10,8 @@ var/global/ntnrc_uid = 0 var/password /datum/ntnet_conversation/New(var/name, var/no_operator) - id = ntnrc_uid - ntnrc_uid++ + id = GLOB.ntnrc_uid + GLOB.ntnrc_uid++ if(name) title = name if(GLOB.ntnet_global) diff --git a/code/modules/modular_computers/file_system/computer_file.dm b/code/modules/modular_computers/file_system/computer_file.dm index af420b96d61..2970893c308 100644 --- a/code/modules/modular_computers/file_system/computer_file.dm +++ b/code/modules/modular_computers/file_system/computer_file.dm @@ -1,4 +1,4 @@ -var/global/file_uid = 0 +GLOBAL_VAR_INIT(file_uid, 0) /datum/computer_file var/filename = "NewFile" // Placehard_drive. No spacebars @@ -13,8 +13,8 @@ var/global/file_uid = 0 /datum/computer_file/New() ..() - uid = file_uid - file_uid++ + uid = GLOB.file_uid + GLOB.file_uid++ /datum/computer_file/Destroy() if(!hard_drive) diff --git a/code/modules/modular_computers/file_system/programs/command/command_and_communications.dm b/code/modules/modular_computers/file_system/programs/command/command_and_communications.dm index e68321ecfa6..1cff4203feb 100644 --- a/code/modules/modular_computers/file_system/programs/command/command_and_communications.dm +++ b/code/modules/modular_computers/file_system/programs/command/command_and_communications.dm @@ -51,7 +51,7 @@ data["boss_short"] = SSatlas.current_map.boss_short data["current_security_level"] = GLOB.security_level data["current_security_level_title"] = num2seclevel(GLOB.security_level) - data["current_maint_all_access"] = maint_all_access + data["current_maint_all_access"] = GLOB.maint_all_access data["def_SEC_LEVEL_DELTA"] = SEC_LEVEL_DELTA data["def_SEC_LEVEL_YELLOW"] = SEC_LEVEL_YELLOW @@ -60,11 +60,11 @@ var/datum/comm_message_listener/l = obtain_message_listener() data["messages"] = l.messages - data["message_deletion_allowed"] = l != global_message_listener + data["message_deletion_allowed"] = l != GLOB.global_message_listener var/list/processed_evac_options = list() - if(!isnull(evacuation_controller)) - for (var/datum/evacuation_option/EO in evacuation_controller.available_evac_options()) + if(!isnull(GLOB.evacuation_controller)) + for (var/datum/evacuation_option/EO in GLOB.evacuation_controller.available_evac_options()) if(EO.abandon_ship) continue var/list/option = list() @@ -81,7 +81,7 @@ return can_run(user) /datum/computer_file/program/comm/proc/obtain_message_listener() - return global_message_listener + return GLOB.global_message_listener /datum/computer_file/program/comm/proc/can_call_shuttle() return can_call_shuttle @@ -102,7 +102,7 @@ switch(action) if("emergencymaint") if(is_authenticated(user) && (isAI(user) || !issilicon(user))) - if(maint_all_access) + if(GLOB.maint_all_access) revoke_maint_all_access() feedback_inc("alert_comms_maintRevoke",1) log_and_message_admins("disabled emergency maintenance access") @@ -165,7 +165,7 @@ addtimer(CALLBACK(src, PROC_REF(set_centcomm_message_cooldown), FALSE), 300) // thirty second cooldown if("evac") if(is_authenticated(user)) - var/datum/evacuation_option/selected_evac_option = evacuation_controller.evacuation_options[params["target"]] + var/datum/evacuation_option/selected_evac_option = GLOB.evacuation_controller.evacuation_options[params["target"]] if (isnull(selected_evac_option) || !istype(selected_evac_option)) return if (!selected_evac_option.silicon_allowed && issilicon(user)) @@ -174,7 +174,7 @@ return var/confirm = alert("Are you sure you want to [selected_evac_option.option_desc]?", filedesc, "No", "Yes") if (confirm == "Yes" && !computer.use_check_and_message(usr)) - evacuation_controller.handle_evac_option(selected_evac_option.option_target, user) + GLOB.evacuation_controller.handle_evac_option(selected_evac_option.option_target, user) if("setstatus") if(is_authenticated(user) && ntn_cont) switch(params["target"]) @@ -211,7 +211,7 @@ else to_chat(usr, SPAN_WARNING("You press the button, but a red light flashes and nothing happens.")) //This should never happen if("delmessage") - if(is_authenticated(user) && ntn_comm && l != global_message_listener) + if(is_authenticated(user) && ntn_comm && l != GLOB.global_message_listener) l.Remove(params["messageid"]) if("printmessage") if(is_authenticated(user) && ntn_comm) @@ -233,13 +233,13 @@ /* General message handling stuff */ -var/list/comm_message_listeners = list() //We first have to initialize list then we can use it. -var/datum/comm_message_listener/global_message_listener = new //May be used by admins -var/last_message_id = 0 +GLOBAL_LIST_EMPTY_TYPED(comm_message_listeners, /datum/comm_message_listener) +GLOBAL_DATUM_INIT(global_message_listener, /datum/comm_message_listener, new()) //May be used by admins +GLOBAL_VAR_INIT(last_message_id, 0) /proc/get_comm_message_id() - last_message_id = last_message_id + 1 - return last_message_id + GLOB.last_message_id = GLOB.last_message_id + 1 + return GLOB.last_message_id /proc/post_comm_message(var/message_title, var/message_text) var/list/message = list() @@ -247,7 +247,7 @@ var/last_message_id = 0 message["title"] = message_title message["contents"] = message_text - for (var/datum/comm_message_listener/l in comm_message_listeners) + for (var/datum/comm_message_listener/l in GLOB.comm_message_listeners) l.Add(message) for (var/obj/item/modular_computer/computer in get_listeners_by_type("modular_computers", /obj/item/modular_computer)) @@ -263,7 +263,11 @@ var/last_message_id = 0 /datum/comm_message_listener/New() ..() messages = list() - comm_message_listeners.Add(src) + GLOB.comm_message_listeners.Add(src) + +/datum/comm_message_listener/Destroy(force) + GLOB.comm_message_listeners.Remove(src) + . = ..() /datum/comm_message_listener/proc/Add(var/list/message) messages[++messages.len] = message @@ -296,7 +300,7 @@ Command action procs //Returns 1 if recalled 0 if not /proc/cancel_call_proc(var/mob/user) - if(!(ROUND_IS_STARTED) || !evacuation_controller) + if(!(ROUND_IS_STARTED) || !GLOB.evacuation_controller) return FALSE if(SSatlas.current_map.shuttle_call_restarts && SSatlas.current_map.shuttle_call_restart_timer) @@ -310,7 +314,7 @@ Command action procs if(SSticker.mode.name == "Meteor") return FALSE - if(evacuation_controller.cancel_evacuation()) + if(GLOB.evacuation_controller.cancel_evacuation()) log_and_message_admins("has cancelled the evacuation.", user) return TRUE return FALSE @@ -324,14 +328,14 @@ Command action procs //Returns 1 if called 0 if not /proc/call_shuttle_proc(var/mob/user, var/_evac_type = TRANSFER_CREW) - if((!(ROUND_IS_STARTED) || !evacuation_controller)) + if((!(ROUND_IS_STARTED) || !GLOB.evacuation_controller)) return FALSE if(!GLOB.universe.OnShuttleCall(usr)) to_chat(user, SPAN_WARNING("A bluespace connection cannot be established! Please check the user manual for more information.")) return FALSE - if(evacuation_controller.deny) + if(GLOB.evacuation_controller.deny) to_chat(user, SPAN_WARNING("An evacuation cannot be sent at this time. Please try again later.")) return FALSE @@ -339,20 +343,20 @@ Command action procs to_chat(user, SPAN_WARNING("An evacuation cannot be sent at this time. Please wait another [round((GLOB.config.time_to_call_emergency_shuttle-world.time)/600)] minute\s before trying again.")) return FALSE - if(evacuation_controller.is_on_cooldown()) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE - to_chat(user, evacuation_controller.get_cooldown_message()) + if(GLOB.evacuation_controller.is_on_cooldown()) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE + to_chat(user, GLOB.evacuation_controller.get_cooldown_message()) - if(evacuation_controller.is_evacuating()) + if(GLOB.evacuation_controller.is_evacuating()) to_chat(user, "An evacuation is already underway.") return - if(evacuation_controller.call_evacuation(user, _evac_type)) + if(GLOB.evacuation_controller.call_evacuation(user, _evac_type)) log_and_message_admins("[user? key_name(user) : "Autotransfer"] has called a shuttle.") return TRUE /proc/init_shift_change(var/mob/user, var/force = FALSE) - if(!(ROUND_IS_STARTED) || !evacuation_controller) + if(!(ROUND_IS_STARTED) || !GLOB.evacuation_controller) return if(SSatlas.current_map.shuttle_call_restarts) @@ -362,7 +366,7 @@ Command action procs to_world(FONT_LARGE(SPAN_VOTE(SSatlas.current_map.shuttle_called_message))) return - . = evacuation_controller.call_evacuation(null, _evac_type = TRANSFER_CREW, autotransfer = TRUE) + . = GLOB.evacuation_controller.call_evacuation(null, _evac_type = TRANSFER_CREW, autotransfer = TRUE) //delay events in case of an autotransfer if(.) diff --git a/code/modules/modular_computers/file_system/programs/engineering/_engineering.dm b/code/modules/modular_computers/file_system/programs/engineering/_engineering.dm index d506f351ab1..3cd62f2736f 100644 --- a/code/modules/modular_computers/file_system/programs/engineering/_engineering.dm +++ b/code/modules/modular_computers/file_system/programs/engineering/_engineering.dm @@ -38,7 +38,7 @@ /datum/computer_file/program/alarm_monitor/engineering/New() ..() - alarm_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, power_alarm) + alarm_handlers = list(GLOB.atmosphere_alarm, GLOB.camera_alarm, GLOB.fire_alarm, GLOB.power_alarm) /datum/computer_file/program/alarm_monitor/security filename = "alarmmonitorsec" @@ -48,7 +48,7 @@ /datum/computer_file/program/alarm_monitor/security/New() ..() - alarm_handlers = list(camera_alarm, motion_alarm) + alarm_handlers = list(GLOB.camera_alarm, GLOB.motion_alarm) /datum/computer_file/program/alarm_monitor/proc/register_alarm(var/object, var/procName) for(var/datum/alarm_handler/AH in alarm_handlers) diff --git a/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm b/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm index a0393052244..209e3cedf1d 100644 --- a/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm +++ b/code/modules/modular_computers/file_system/programs/medical/suit_sensors.dm @@ -27,7 +27,7 @@ data["crewmembers"] = list() if(SSradio.telecomms_ping(computer)) for(var/z_level in SSatlas.current_map.map_levels) - data["crewmembers"] += crew_repository.health_data(z_level) + data["crewmembers"] += GLOB.crew_repository.health_data(z_level) data["security_level"] = seclevel2num(get_security_level()) diff --git a/code/modules/modular_computers/file_system/programs/security/camera.dm b/code/modules/modular_computers/file_system/programs/security/camera.dm index 7db7fb3d0d6..6036754d643 100644 --- a/code/modules/modular_computers/file_system/programs/security/camera.dm +++ b/code/modules/modular_computers/file_system/programs/security/camera.dm @@ -65,7 +65,7 @@ data["networks"] = all_networks if(current_network) - data["cameras"] = camera_repository.cameras_in_network(current_network) + data["cameras"] = GLOB.camera_repository.cameras_in_network(current_network) return data diff --git a/code/modules/modular_computers/file_system/programs/security/guntracker.dm b/code/modules/modular_computers/file_system/programs/security/guntracker.dm index 690aa0d64e0..3f92b61d01b 100644 --- a/code/modules/modular_computers/file_system/programs/security/guntracker.dm +++ b/code/modules/modular_computers/file_system/programs/security/guntracker.dm @@ -29,7 +29,7 @@ LAZYINITLIST(wireless_firing_pins_data) LAZYCLEARLIST(wireless_firing_pins_data) - for(var/i in wireless_firing_pins) + for(var/i in GLOB.wireless_firing_pins) var/obj/item/device/firing_pin/wireless/P = i if(!istype(P) || !P.gun) continue @@ -55,7 +55,7 @@ //Try and get the pin if a pin is passed var/obj/item/device/firing_pin/wireless/P if(params["pin"]) - P = locate(params["pin"]) in wireless_firing_pins + P = locate(params["pin"]) in GLOB.wireless_firing_pins if(!istype(P)) return diff --git a/code/modules/modular_computers/hardware/network_card.dm b/code/modules/modular_computers/hardware/network_card.dm index bbbc146c9e5..7e1d7b27b97 100644 --- a/code/modules/modular_computers/hardware/network_card.dm +++ b/code/modules/modular_computers/hardware/network_card.dm @@ -1,4 +1,4 @@ -var/global/ntnet_card_uid = 1 +GLOBAL_VAR_INIT(ntnet_card_uid, 1) /obj/item/computer_hardware/network_card name = "basic NTNet network card" @@ -30,8 +30,8 @@ var/global/ntnet_card_uid = 1 /obj/item/computer_hardware/network_card/Initialize() . = ..() - identification_id = ntnet_card_uid - ntnet_card_uid++ + identification_id = GLOB.ntnet_card_uid + GLOB.ntnet_card_uid++ /obj/item/computer_hardware/network_card/signaler name = "NTNet signaler network card" diff --git a/code/modules/multiz/basic.dm b/code/modules/multiz/basic.dm index 658295b7e33..a8f94303452 100644 --- a/code/modules/multiz/basic.dm +++ b/code/modules/multiz/basic.dm @@ -1,4 +1,4 @@ -var/list/list/connected_z_cache = list() +GLOBAL_LIST_EMPTY(connected_z_cache) // If the height is more than 1, we mark all contained levels as connected. /obj/effect/landmark/map_data/New(turf/loc, _height) @@ -26,20 +26,20 @@ var/list/list/connected_z_cache = list() if(zA == 0 || zB == 0) return FALSE - if (connected_z_cache.len >= zA && connected_z_cache[zA]) - return (connected_z_cache[zA].len >= zB && connected_z_cache[zA][zB]) + if (length(GLOB.connected_z_cache) >= zA && GLOB.connected_z_cache[zA]) + return (length(GLOB.connected_z_cache[zA]) >= zB && GLOB.connected_z_cache[zA][zB]) var/list/levels = GetConnectedZlevels(zA) var/list/new_entry = new(max(levels)) for (var/entry in levels) new_entry[entry] = TRUE - if (connected_z_cache.len < zA) - connected_z_cache.len = zA + if (GLOB.connected_z_cache.len < zA) + GLOB.connected_z_cache.len = zA - connected_z_cache[zA] = new_entry + GLOB.connected_z_cache[zA] = new_entry - return (connected_z_cache[zA].len >= zB && connected_z_cache[zA][zB]) + return (length(GLOB.connected_z_cache[zA]) >= zB && GLOB.connected_z_cache[zA][zB]) /proc/get_zstep(atom/ref, dir) if (!isloc(ref)) diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index 4c2583beedd..c97e1c50542 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -315,8 +315,8 @@ LAZYADD(cached_markings, temporary_markings) // Global scope, used in code below. -var/list/flesh_hud_colours = list("#00ff00","#aaff00","#ffff00","#ffaa00","#ff0000","#aa0000","#660000") -var/list/robot_hud_colours = list("#ffffff","#cccccc","#aaaaaa","#888888","#666666","#444444","#222222","#000000") +GLOBAL_LIST_INIT(flesh_hud_colours, list("#00ff00","#aaff00","#ffff00","#ffaa00","#ff0000","#aa0000","#660000")) +GLOBAL_LIST_INIT(robot_hud_colours, list("#ffffff","#cccccc","#aaaaaa","#888888","#666666","#444444","#222222","#000000")) /obj/item/organ/external/proc/get_damage_hud_image() @@ -344,7 +344,7 @@ var/list/robot_hud_colours = list("#ffffff","#cccccc","#aaaaaa","#888888","#6666 if(min_dam_state && dam_state < min_dam_state) dam_state = min_dam_state // Apply colour and return product. - var/list/hud_colours = !BP_IS_ROBOTIC(src) ? flesh_hud_colours : robot_hud_colours + var/list/hud_colours = !BP_IS_ROBOTIC(src) ? GLOB.flesh_hud_colours : GLOB.robot_hud_colours hud_damage_image.color = hud_colours[max(1,min(Ceiling(dam_state*hud_colours.len),hud_colours.len))] return hud_damage_image diff --git a/code/modules/organs/subtypes/augment/augments/timepiece.dm b/code/modules/organs/subtypes/augment/augments/timepiece.dm index 86c11f22850..949622245e7 100644 --- a/code/modules/organs/subtypes/augment/augments/timepiece.dm +++ b/code/modules/organs/subtypes/augment/augments/timepiece.dm @@ -16,5 +16,5 @@ to_chat(owner, SPAN_NOTICE("Hello [user], it is currently: '[worldtime2text()]'. Today's date is '[time2text(world.time, "Month DD")]. [GLOB.game_year]'. Have a lovely day.")) - if(evacuation_controller.get_status_panel_eta()) - to_chat(owner, SPAN_WARNING("Notice: You have one (1) scheduled flight, ETA: [evacuation_controller.get_status_panel_eta()].")) + if(GLOB.evacuation_controller.get_status_panel_eta()) + to_chat(owner, SPAN_WARNING("Notice: You have one (1) scheduled flight, ETA: [GLOB.evacuation_controller.get_status_panel_eta()].")) diff --git a/code/modules/overmap/_defines.dm b/code/modules/overmap/_defines.dm index 7c24f41df7b..04814a908bf 100644 --- a/code/modules/overmap/_defines.dm +++ b/code/modules/overmap/_defines.dm @@ -59,8 +59,9 @@ GLOBAL_LIST_EMPTY(map_templates) I.pixel_x = 5*i + 2 overlays += I -//list used to track which zlevels are being 'moved' by the proc below -var/list/moving_levels = list() +///list used to track which zlevels are being 'moved' by the `toggle_move_stars` proc +GLOBAL_LIST_EMPTY(moving_levels) + //Proc to 'move' stars in spess //yes it looks ugly, but it should only fire when state actually change. //null direction stops movement @@ -76,8 +77,8 @@ var/list/moving_levels = list() if(!direction) gen_dir = null - if (moving_levels["[zlevel]"] != gen_dir) - moving_levels["[zlevel]"] = gen_dir + if (GLOB.moving_levels["[zlevel]"] != gen_dir) + GLOB.moving_levels["[zlevel]"] = gen_dir var/list/spaceturfs = block(locate(1, 1, zlevel), locate(world.maxx, world.maxy, zlevel)) for(var/turf/space/T in spaceturfs) diff --git a/code/modules/overmap/sectors.dm b/code/modules/overmap/sectors.dm index b3f6ddadf44..e09036dc46b 100644 --- a/code/modules/overmap/sectors.dm +++ b/code/modules/overmap/sectors.dm @@ -2,7 +2,7 @@ //Overmap object representing zlevel(s) //=================================================================================== /// Global object used to locate the overmap area. -var/global/area/overmap/map_overmap +GLOBAL_DATUM(map_overmap, /area/overmap) /obj/effect/overmap/visitable name = "map object" @@ -293,7 +293,7 @@ var/global/area/overmap/map_overmap log_module_sectors("Putting overmap on [SSatlas.current_map.overmap_z]") var/area/overmap/A = new - global.map_overmap = A + GLOB.map_overmap = A for (var/square in block(locate(1,1,SSatlas.current_map.overmap_z), locate(SSatlas.current_map.overmap_size,SSatlas.current_map.overmap_size,SSatlas.current_map.overmap_z))) var/turf/T = square if(T.x == SSatlas.current_map.overmap_size || T.y == SSatlas.current_map.overmap_size) diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm index 5d98b675554..bef793e9141 100644 --- a/code/modules/overmap/ships/computers/helm.dm +++ b/code/modules/overmap/ships/computers/helm.dm @@ -63,7 +63,7 @@ return ..() /obj/machinery/computer/ship/helm/proc/get_known_sectors() - var/area/overmap/map = global.map_overmap + var/area/overmap/map = GLOB.map_overmap if(!map) return for(var/obj/effect/overmap/visitable/sector/S in map) diff --git a/code/modules/overmap/ships/engines/engine.dm b/code/modules/overmap/ships/engines/engine.dm index 169818ec717..3184ca02278 100644 --- a/code/modules/overmap/ships/engines/engine.dm +++ b/code/modules/overmap/ships/engines/engine.dm @@ -1,6 +1,7 @@ //Engine component object -var/list/ship_engines = list() +GLOBAL_LIST_INIT_TYPED(ship_engines, /datum/ship_engine, list()) + /datum/ship_engine var/name = "ship engine" var/obj/machinery/holder //actual engine object @@ -8,7 +9,7 @@ var/list/ship_engines = list() /datum/ship_engine/New(var/obj/machinery/_holder) ..() holder = _holder - ship_engines += src + GLOB.ship_engines += src /datum/ship_engine/proc/can_burn() return 0 @@ -40,7 +41,7 @@ var/list/ship_engines = list() return 1 /datum/ship_engine/Destroy() - ship_engines -= src + GLOB.ship_engines -= src for(var/obj/effect/overmap/visitable/ship/S in SSshuttle.ships) S.engines -= src holder = null diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm index 89497760bd7..289c24c8b99 100644 --- a/code/modules/overmap/ships/ship.dm +++ b/code/modules/overmap/ships/ship.dm @@ -1,4 +1,4 @@ -var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND) +#define OVERMAP_SPEED_CONSTANT (1 SECOND) #define SHIP_MOVE_RESOLUTION 0.00001 #define MOVING(speed) abs(speed) >= min_speed #define SANITIZE_SPEED(speed) SIGN(speed) * clamp(abs(speed), 0, max_speed) @@ -290,7 +290,7 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND) S.attempt_hook_up(src) for(var/obj/machinery/computer/shuttle_control/explore/C in SSmachinery.machinery) C.attempt_hook_up(src) - for(var/datum/ship_engine/E in ship_engines) + for(var/datum/ship_engine/E in GLOB.ship_engines) if(check_ownership(E.holder)) engines |= E @@ -387,6 +387,7 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND) /obj/effect/overmap/visitable/ship/proc/get_speed_sensor_increase() return min(get_speed() * 1000, 50) //Engines should never increase sensor visibility by more than 50. +#undef OVERMAP_SPEED_CONSTANT #undef MOVING #undef SANITIZE_SPEED #undef CHANGE_SPEED_BY diff --git a/code/modules/overmap/spacetravel.dm b/code/modules/overmap/spacetravel.dm index cfdc152a918..0c9ce2bbb85 100644 --- a/code/modules/overmap/spacetravel.dm +++ b/code/modules/overmap/spacetravel.dm @@ -1,5 +1,5 @@ -//list used to cache empty zlevels to avoid nedless map bloat -var/list/cached_space = list() +///list used to cache empty zlevels to avoid nedless map bloat +GLOBAL_LIST_INIT_TYPED(cached_space, /obj/effect/overmap/visitable/sector/temporary, list()) //Space stragglers go here @@ -33,9 +33,9 @@ var/list/cached_space = list() var/obj/effect/overmap/visitable/sector/temporary/res = locate(x, y, SSatlas.current_map.overmap_z) if(istype(res)) return res - else if(cached_space.len) - res = cached_space[cached_space.len] - cached_space -= res + else if(GLOB.cached_space.len) + res = GLOB.cached_space[GLOB.cached_space.len] + GLOB.cached_space -= res res.x = x res.y = y return res @@ -112,4 +112,4 @@ var/list/cached_space = list() if (source.can_die()) testing("Caching [M] for future use") source.forceMove(null) - cached_space += source + GLOB.cached_space += source diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 8378465632b..ee9602bb3d6 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -1,8 +1,13 @@ -var/list/obj/machinery/photocopier/faxmachine/allfaxes = list() -var/list/arrived_faxes = list() //cache for faxes that have been sent to the admins -var/list/sent_faxes = list() //cache for faxes that have been sent by the admins -var/list/alldepartments = list() -var/list/admin_departments +GLOBAL_LIST_EMPTY_TYPED(allfaxes, /obj/machinery/photocopier/faxmachine) + +///cache for faxes that have been sent to the admins +GLOBAL_LIST_EMPTY_TYPED(arrived_faxes, /obj/item) + +///cache for faxes that have been sent by the admins +GLOBAL_LIST_EMPTY_TYPED(sent_faxes, /obj/item) + +GLOBAL_LIST_EMPTY(alldepartments) +GLOBAL_LIST_EMPTY(admin_departments) /obj/machinery/photocopier/faxmachine name = "fax machine" @@ -35,13 +40,13 @@ var/list/admin_departments /obj/machinery/photocopier/faxmachine/Initialize() . = ..() - allfaxes += src - if( !(("[department]" in alldepartments) || ("[department]" in admin_departments)) ) - alldepartments |= department + GLOB.allfaxes += src + if( !(("[department]" in GLOB.alldepartments) || ("[department]" in GLOB.admin_departments)) ) + GLOB.alldepartments |= department destination = SSatlas.current_map.boss_name /obj/machinery/photocopier/faxmachine/Destroy() - allfaxes -= src + GLOB.allfaxes -= src QDEL_NULL(identification) . = ..() @@ -65,7 +70,7 @@ var/list/admin_departments for (var/obj/item/modular_computer/pda in alert_pdas) data["alertpdas"] += list(list("name" = "[alert_pdas[pda]]", "ref" = "[REF(pda)]")) data["departments"] = list() - for (var/dept in (alldepartments + admin_departments + broadcast_departments)) + for (var/dept in (GLOB.alldepartments + GLOB.admin_departments + broadcast_departments)) data["departments"] += "[dept]" return data @@ -93,7 +98,7 @@ var/list/admin_departments return if(copy_item && is_authenticated()) - if (destination in admin_departments) + if (destination in GLOB.admin_departments) send_admin_fax(usr, destination) else if (destination == broadcast_departments) send_broadcast_fax() @@ -207,7 +212,7 @@ var/list/admin_departments use_power_oneoff(200) var/success = 0 - for(var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if( F.department == destination ) success = F.receivefax(copy_item) @@ -249,7 +254,7 @@ var/list/admin_departments /obj/machinery/photocopier/faxmachine/proc/send_broadcast_fax() var success = 1 - for (var/dest in (alldepartments - department)) + for (var/dest in (GLOB.alldepartments - department)) // Send to everyone except this department sleep(1) success &= sendfax(dest, 0) // 0: don't display success/error messages @@ -281,7 +286,7 @@ var/list/admin_departments return rcvdcopy.forceMove(null) //hopefully this shouldn't cause trouble - arrived_faxes += rcvdcopy + GLOB.arrived_faxes += rcvdcopy //message badmins that a fax has arrived if (destination == SSatlas.current_map.boss_name) diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 76ac5ed0da3..b98c99a23b3 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -26,7 +26,7 @@ /******** * photo * ********/ -var/global/photo_count = 0 +GLOBAL_VAR_INIT(photo_count, 0) /obj/item/photo name = "photo" @@ -47,7 +47,7 @@ var/global/photo_count = 0 /obj/item/photo/New() . = ..() - id = photo_count++ + id = GLOB.photo_count++ /obj/item/photo/attack_self(mob/user as mob) examinate(user, src) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 3ea31a47a30..0721d286534 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1182,7 +1182,7 @@ ABSTRACT_TYPE(/obj/machinery/power/apc) equipment = autoset(equipment, CHANNEL_OFF) lighting = autoset(lighting, CHANNEL_OFF) environ = autoset(environ, CHANNEL_OFF) - power_alarm.triggerAlarm(loc, src) + GLOB.power_alarm.triggerAlarm(loc, src) autoflag = AUTOFLAG_OFF // update icon & area power if anything changed @@ -1206,27 +1206,27 @@ ABSTRACT_TYPE(/obj/machinery/power/apc) lighting = autoset(lighting, CHANNEL_OFF_AUTO) environ = autoset(environ, CHANNEL_OFF_AUTO) autoflag = AUTOFLAG_ALL_ON - power_alarm.clearAlarm(loc, src) + GLOB.power_alarm.clearAlarm(loc, src) else if((cell.percent() <= 30) && (cell.percent() > 15) && longtermpower < 0) // <30%, turn off equipment if(autoflag != AUTOFLAG_ENVIRON_LIGHTS_ON) equipment = autoset(equipment, CHANNEL_ON) lighting = autoset(lighting, CHANNEL_OFF_AUTO) environ = autoset(environ, CHANNEL_OFF_AUTO) - power_alarm.triggerAlarm(loc, src) + GLOB.power_alarm.triggerAlarm(loc, src) autoflag = AUTOFLAG_ENVIRON_LIGHTS_ON else if(cell.percent() <= 15) // <15%, turn off lighting & equipment if((autoflag > AUTOFLAG_ENVIRON_ON && longtermpower < 0) || (autoflag > AUTOFLAG_ENVIRON_ON && longtermpower >= 0)) equipment = autoset(equipment, CHANNEL_ON) lighting = autoset(lighting, CHANNEL_ON) environ = autoset(environ, CHANNEL_OFF_AUTO) - power_alarm.triggerAlarm(loc, src) + GLOB.power_alarm.triggerAlarm(loc, src) autoflag = AUTOFLAG_ENVIRON_ON else // zero charge, turn all off if(autoflag != AUTOFLAG_OFF) equipment = autoset(equipment, CHANNEL_OFF) lighting = autoset(lighting, CHANNEL_OFF) environ = autoset(environ, CHANNEL_OFF) - power_alarm.triggerAlarm(loc, src) + GLOB.power_alarm.triggerAlarm(loc, src) autoflag = AUTOFLAG_OFF /obj/machinery/power/apc/proc/autoset(var/val, var/on) diff --git a/code/modules/power/fusion/fusion_reactions.dm b/code/modules/power/fusion/fusion_reactions.dm index bbad2c16356..2d128509e02 100644 --- a/code/modules/power/fusion/fusion_reactions.dm +++ b/code/modules/power/fusion/fusion_reactions.dm @@ -1,4 +1,4 @@ -var/global/list/fusion_reactions +GLOBAL_LIST_EMPTY(fusion_reactions) /singleton/fusion_reaction var/p_react = "" // Primary reactant. @@ -16,21 +16,21 @@ var/global/list/fusion_reactions return 0 /proc/get_fusion_reaction(p_react, s_react, m_energy) - if(!fusion_reactions) - fusion_reactions = list() + if(!GLOB.fusion_reactions) + GLOB.fusion_reactions = list() for(var/rtype in typesof(/singleton/fusion_reaction) - /singleton/fusion_reaction) var/singleton/fusion_reaction/cur_reaction = new rtype() - if(!fusion_reactions[cur_reaction.p_react]) - fusion_reactions[cur_reaction.p_react] = list() - fusion_reactions[cur_reaction.p_react][cur_reaction.s_react] = cur_reaction - if(!fusion_reactions[cur_reaction.s_react]) - fusion_reactions[cur_reaction.s_react] = list() - fusion_reactions[cur_reaction.s_react][cur_reaction.p_react] = cur_reaction + if(!GLOB.fusion_reactions[cur_reaction.p_react]) + GLOB.fusion_reactions[cur_reaction.p_react] = list() + GLOB.fusion_reactions[cur_reaction.p_react][cur_reaction.s_react] = cur_reaction + if(!GLOB.fusion_reactions[cur_reaction.s_react]) + GLOB.fusion_reactions[cur_reaction.s_react] = list() + GLOB.fusion_reactions[cur_reaction.s_react][cur_reaction.p_react] = cur_reaction - if(fusion_reactions.Find(p_react)) - var/list/secondary_reactions = fusion_reactions[p_react] + if(GLOB.fusion_reactions.Find(p_react)) + var/list/secondary_reactions = GLOB.fusion_reactions[p_react] if(secondary_reactions.Find(s_react)) - return fusion_reactions[p_react][s_react] + return GLOB.fusion_reactions[p_react][s_react] // Material fuels // deuterium diff --git a/code/modules/power/profiling.dm b/code/modules/power/profiling.dm index d643c22a431..fa2820bac3d 100644 --- a/code/modules/power/profiling.dm +++ b/code/modules/power/profiling.dm @@ -1,5 +1,3 @@ -datum - var/global/enable_power_update_profiling = 0 var/global/power_profiled_time = 0 diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index 5905884f3de..ee03c771a8c 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -236,7 +236,8 @@ Pins Below. var/turf/T = get_turf(src) return !is_station_level(T.z) -var/list/wireless_firing_pins = list() //A list of all initialized wireless firing pins. Used in the firearm tracking program in guntracker.dm +///A list of all initialized wireless firing pins. Used in the firearm tracking program in guntracker.dm +GLOBAL_LIST_EMPTY_TYPED(wireless_firing_pins, /obj/item/device/firing_pin/wireless) /obj/item/device/firing_pin/wireless name = "wireless-control firing pin" @@ -259,11 +260,12 @@ var/list/wireless_firing_pins = list() //A list of all initialized wireless firi to_chat(user, SPAN_NOTICE("The wireless-control firing pin [wireless_description].")) /obj/item/device/firing_pin/wireless/Initialize() //Adds wireless pins to the list of initialized wireless firing pins. - wireless_firing_pins += src - return ..() + . = ..() + + GLOB.wireless_firing_pins += src /obj/item/device/firing_pin/wireless/Destroy() //Removes the wireless pins from the list of initialized wireless firing pins. - wireless_firing_pins -= src + GLOB.wireless_firing_pins -= src return ..() /* diff --git a/code/modules/projectiles/projectile/animate.dm b/code/modules/projectiles/projectile/animate.dm index 1d93c23172d..d116e34816e 100644 --- a/code/modules/projectiles/projectile/animate.dm +++ b/code/modules/projectiles/projectile/animate.dm @@ -6,7 +6,7 @@ check_armor = "energy" /obj/projectile/animate/Collide(atom/change) - if((istype(change, /obj/item) || istype(change, /obj/structure)) && !is_type_in_list(change, protected_objects)) + if((istype(change, /obj/item) || istype(change, /obj/structure)) && !is_type_in_list(change, GLOB.protected_objects)) var/obj/O = change new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer) . = ..() diff --git a/code/modules/projectiles/projectile/change.dm b/code/modules/projectiles/projectile/change.dm index 6d370295be9..59ceaea5ab1 100644 --- a/code/modules/projectiles/projectile/change.dm +++ b/code/modules/projectiles/projectile/change.dm @@ -68,11 +68,11 @@ if(M.gender == MALE) H.gender = MALE - H.name = pick(first_names_male) + H.name = pick(GLOB.first_names_male) else H.gender = FEMALE - H.name = pick(first_names_female) - H.name += " [pick(last_names)]" + H.name = pick(GLOB.first_names_female) + H.name += " [pick(GLOB.last_names)]" H.real_name = H.name INVOKE_ASYNC(H, TYPE_PROC_REF(/mob/living/carbon/human, set_species), randomize) diff --git a/code/modules/psionics/interface/ui_hub.dm b/code/modules/psionics/interface/ui_hub.dm index 47fc04bdfb4..2b061d676ff 100644 --- a/code/modules/psionics/interface/ui_hub.dm +++ b/code/modules/psionics/interface/ui_hub.dm @@ -52,7 +52,7 @@ var/list/data = list() var/owner_rank = owner.psi.get_rank() data["available_psionics"] = list() - data["psi_rank"] = psychic_ranks_to_strings[owner_rank] + data["psi_rank"] = GLOB.psychic_ranks_to_strings[owner_rank] data["psi_points"] = owner.psi.psi_points data["bought_powers"] = owner.psi.psionic_powers for(var/singleton/psionic_power/P in GET_SINGLETON_SUBTYPE_LIST(/singleton/psionic_power)) @@ -70,7 +70,7 @@ continue if(owner_rank < PSI_RANK_HARMONIOUS && (P.ability_flags & PSI_FLAG_ANTAG)) continue - if(!(owner.mind in loners.current_antagonists) && (P.ability_flags & PSI_FLAG_LONER)) + if(!(owner.mind in GLOB.loners.current_antagonists) && (P.ability_flags & PSI_FLAG_LONER)) continue data["available_psionics"] += list( list( diff --git a/code/modules/random_map/drop/drop_types.dm b/code/modules/random_map/drop/drop_types.dm index dd8b63eb9e4..b42d908acd5 100644 --- a/code/modules/random_map/drop/drop_types.dm +++ b/code/modules/random_map/drop/drop_types.dm @@ -1,10 +1,10 @@ -var/global/list/datum/supply_drop_loot/supply_drop +GLOBAL_LIST_INIT_TYPED(supply_drop, /datum/supply_drop_loot, null) /proc/supply_drop_random_loot_types() - if(!supply_drop) - supply_drop = init_subtypes(/datum/supply_drop_loot) - sortTim(supply_drop, GLOBAL_PROC_REF(cmp_supply_drop), FALSE) - return supply_drop + if(!GLOB.supply_drop) + GLOB.supply_drop = init_subtypes(/datum/supply_drop_loot) + sortTim(GLOB.supply_drop, GLOBAL_PROC_REF(cmp_supply_drop), FALSE) + return GLOB.supply_drop /datum/supply_drop_loot var/name = "" diff --git a/code/modules/random_map/mazes/maze_cell.dm b/code/modules/random_map/mazes/maze_cell.dm index 6235adcc8af..0cd0b47fa68 100644 --- a/code/modules/random_map/mazes/maze_cell.dm +++ b/code/modules/random_map/mazes/maze_cell.dm @@ -1,4 +1,4 @@ -var/maze_cell_count = 0 +GLOBAL_VAR_INIT(maze_cell_count, 0) /datum/maze_cell var/name @@ -9,8 +9,8 @@ var/maze_cell_count = 0 var/oy /datum/maze_cell/New(var/nx,var/ny,var/nox,var/noy) - maze_cell_count++ - uid = maze_cell_count + GLOB.maze_cell_count++ + uid = GLOB.maze_cell_count name = "cell #[uid]" x = nx y = ny diff --git a/code/modules/reagents/Chemistry-Logging.dm b/code/modules/reagents/Chemistry-Logging.dm index 1432b18a2e8..5ed02ccf020 100644 --- a/code/modules/reagents/Chemistry-Logging.dm +++ b/code/modules/reagents/Chemistry-Logging.dm @@ -1,5 +1,4 @@ - -/var/list/chemical_reaction_logs = list() +GLOBAL_LIST_EMPTY(chemical_reaction_logs) /proc/log_chemical_reaction(atom/A, datum/chemical_reaction/R, multiplier) if(!A || !R) @@ -8,7 +7,7 @@ var/turf/T = get_turf(A) var/logstr = "[usr ? key_name(usr) : "EVENT"] mixed [R.name] ([R.result]) (x[multiplier]) in \the [A] at [T ? "[T.x],[T.y],[T.z]" : "*null*"]" - chemical_reaction_logs += "\[[time_stamp()]\] [logstr]" + GLOB.chemical_reaction_logs += "\[[time_stamp()]\] [logstr]" if(R.log_is_important) message_admins(logstr) @@ -22,7 +21,7 @@ return var/html = "" - for(var/entry in chemical_reaction_logs) + for(var/entry in GLOB.chemical_reaction_logs) html += "[entry]
    " usr << browse(html, "window=chemlogs") diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm index 6e26b4fa428..efe618209d8 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm @@ -219,12 +219,12 @@ if(vampire) if(vampire.status & VAMP_ISTHRALL) if(prob(10)) - thralls.remove_antagonist(M.mind) + GLOB.thralls.remove_antagonist(M.mind) else vampire.frenzy += removed * 5 M.take_organ_damage(0, removed * 6) - if(cult.is_antagonist(M.mind) && prob(10)) - cult.remove_antagonist(M.mind) + if(GLOB.cult.is_antagonist(M.mind) && prob(10)) + GLOB.cult.remove_antagonist(M.mind) if(alien && alien == IS_UNDEAD) M.adjust_fire_stacks(10) M.IgniteMob() diff --git a/code/modules/reagents/reagent_containers/food/lunch.dm b/code/modules/reagents/reagent_containers/food/lunch.dm index d67c7b5377a..e2f6b3bd241 100644 --- a/code/modules/reagents/reagent_containers/food/lunch.dm +++ b/code/modules/reagents/reagent_containers/food/lunch.dm @@ -1,4 +1,4 @@ -var/list/lunchables_lunches_ = list( +GLOBAL_LIST_INIT(lunchables_lunches_, list( /obj/item/reagent_containers/food/snacks/sandwich, /obj/item/reagent_containers/food/snacks/meatbreadslice/filled, /obj/item/reagent_containers/food/snacks/tofubreadslice/filled, @@ -33,9 +33,9 @@ var/list/lunchables_lunches_ = list( /obj/item/reagent_containers/food/snacks/batwings, /obj/item/reagent_containers/food/snacks/salad/earthenroot, /obj/item/reagent_containers/food/snacks/pepperoniroll -) +)) -var/list/lunchables_snacks_ = list( +GLOBAL_LIST_INIT(lunchables_snacks_, list( /obj/item/reagent_containers/food/snacks/donut/jelly, /obj/item/reagent_containers/food/snacks/donut/cherryjelly, /obj/item/reagent_containers/food/snacks/muffin, @@ -82,9 +82,9 @@ var/list/lunchables_snacks_ = list( /obj/item/reagent_containers/food/snacks/stuffed_meatball, /obj/item/reagent_containers/food/snacks/grilled_peppers, /obj/item/reagent_containers/food/snacks/salmiak -) +)) -var/list/lunchables_drinks_ = list( +GLOBAL_LIST_INIT(lunchables_drinks_, list( /obj/item/reagent_containers/food/drinks/cans/cola, /obj/item/reagent_containers/food/drinks/waterbottle, /obj/item/reagent_containers/food/drinks/cans/space_mountain_wind, @@ -119,16 +119,16 @@ var/list/lunchables_drinks_ = list( /obj/item/reagent_containers/food/drinks/cans/zorasoda/xuizi, /obj/item/reagent_containers/food/drinks/cans/zorasoda/dyn, /obj/item/reagent_containers/food/drinks/cans/zorasoda/buzz -) +)) -var/list/lunchables_vaurca_ = list( +GLOBAL_LIST_INIT(lunchables_vaurca_, list( /obj/item/reagent_containers/food/snacks/koiswaffles, /obj/item/reagent_containers/food/snacks/koisburger, /obj/item/reagent_containers/food/snacks/soup/kois, /obj/item/reagent_containers/food/snacks/koissteak -) +)) -var/list/lunchables_vaurca_snack_ = list( +GLOBAL_LIST_INIT(lunchables_vaurca_snack_, list( /obj/item/reagent_containers/food/snacks/donut/kois, /obj/item/reagent_containers/food/snacks/koiskebab3, /obj/item/reagent_containers/food/snacks/friedkois, @@ -138,28 +138,28 @@ var/list/lunchables_vaurca_snack_ = list( /obj/item/reagent_containers/food/snacks/koisbar_clean, /obj/item/storage/box/fancy/vkrexitaffy, /obj/item/reagent_containers/food/snacks/koisrouladeslice/filled -) +)) -var/list/lunchables_utensil_ = list( +GLOBAL_LIST_INIT(lunchables_utensil_, list( /obj/item/material/kitchen/utensil/fork/chopsticks, /obj/item/material/kitchen/utensil/fork/chopsticks/bamboo, /obj/item/material/kitchen/utensil/fork/plastic, /obj/item/material/kitchen/utensil/spoon/plastic, /obj/item/material/kitchen/utensil/knife/plastic -) +)) // This default list is a bit different, it contains items we don't want -var/list/lunchables_drink_reagents_ = list( +GLOBAL_LIST_INIT(lunchables_drink_reagents_, list( /singleton/reagent/drink/nothing, /singleton/reagent/drink/doctorsdelight, /singleton/reagent/drink/dry_ramen, /singleton/reagent/drink/hell_ramen, /singleton/reagent/drink/hot_ramen, /singleton/reagent/drink/nuka_cola -) +)) // This default list is a bit different, it contains items we don't want -var/list/lunchables_alcohol_reagents_ = list( +GLOBAL_LIST_INIT(lunchables_alcohol_reagents_, list( /singleton/reagent/alcohol, /singleton/reagent/alcohol/acid_spit, /singleton/reagent/alcohol/atomicbomb, @@ -174,49 +174,49 @@ var/list/lunchables_alcohol_reagents_ = list( /singleton/reagent/alcohol/threemileisland, /singleton/reagent/alcohol/toxins_special, /singleton/reagent/alcohol/nmshaan_liquor/darmadhirbrew -) +)) /proc/lunchables_lunches() - if(!(lunchables_lunches_[lunchables_lunches_[1]])) - lunchables_lunches_ = init_lunchable_list(lunchables_lunches_) - return lunchables_lunches_ + if(!(GLOB.lunchables_lunches_[GLOB.lunchables_lunches_[1]])) + GLOB.lunchables_lunches_ = init_lunchable_list(GLOB.lunchables_lunches_) + return GLOB.lunchables_lunches_ /proc/lunchables_vaurca() - if(!(lunchables_vaurca_[lunchables_vaurca_[1]])) - lunchables_vaurca_ = init_lunchable_list(lunchables_vaurca_) - return lunchables_vaurca_ + if(!(GLOB.lunchables_vaurca_[GLOB.lunchables_vaurca_[1]])) + GLOB.lunchables_vaurca_ = init_lunchable_list(GLOB.lunchables_vaurca_) + return GLOB.lunchables_vaurca_ /proc/lunchables_vaurca_snack() - if(!(lunchables_vaurca_snack_[lunchables_vaurca_snack_[1]])) - lunchables_vaurca_snack_ = init_lunchable_list(lunchables_vaurca_snack_) - return lunchables_vaurca_snack_ + if(!(GLOB.lunchables_vaurca_snack_[GLOB.lunchables_vaurca_snack_[1]])) + GLOB.lunchables_vaurca_snack_ = init_lunchable_list(GLOB.lunchables_vaurca_snack_) + return GLOB.lunchables_vaurca_snack_ /proc/lunchables_snacks() - if(!(lunchables_snacks_[lunchables_snacks_[1]])) - lunchables_snacks_ = init_lunchable_list(lunchables_snacks_) - return lunchables_snacks_ + if(!(GLOB.lunchables_snacks_[GLOB.lunchables_snacks_[1]])) + GLOB.lunchables_snacks_ = init_lunchable_list(GLOB.lunchables_snacks_) + return GLOB.lunchables_snacks_ /proc/lunchables_drinks() - if(!(lunchables_drinks_[lunchables_drinks_[1]])) - lunchables_drinks_ = init_lunchable_list(lunchables_drinks_) - return lunchables_drinks_ + if(!(GLOB.lunchables_drinks_[GLOB.lunchables_drinks_[1]])) + GLOB.lunchables_drinks_ = init_lunchable_list(GLOB.lunchables_drinks_) + return GLOB.lunchables_drinks_ /proc/lunchables_utensil() - if(!(lunchables_utensil_[lunchables_utensil_[1]])) - lunchables_utensil_ = init_lunchable_list(lunchables_utensil_) - return lunchables_utensil_ + if(!(GLOB.lunchables_utensil_[GLOB.lunchables_utensil_[1]])) + GLOB.lunchables_utensil_ = init_lunchable_list(GLOB.lunchables_utensil_) + return GLOB.lunchables_utensil_ /proc/lunchables_drink_reagents() - if(!(lunchables_drink_reagents_[lunchables_drink_reagents_[1]])) - lunchables_drink_reagents_ = init_lunchable_reagent_list(lunchables_drink_reagents_, /singleton/reagent/drink) - lunchables_drink_reagents_["Water"] = /singleton/reagent/water //We do it here because it is not considered a 'drink' - lunchables_drink_reagents_ = sortList(lunchables_drink_reagents_) - return lunchables_drink_reagents_ + if(!(GLOB.lunchables_drink_reagents_[GLOB.lunchables_drink_reagents_[1]])) + GLOB.lunchables_drink_reagents_ = init_lunchable_reagent_list(GLOB.lunchables_drink_reagents_, /singleton/reagent/drink) + GLOB.lunchables_drink_reagents_["Water"] = /singleton/reagent/water //We do it here because it is not considered a 'drink' + GLOB.lunchables_drink_reagents_ = sortList(GLOB.lunchables_drink_reagents_) + return GLOB.lunchables_drink_reagents_ /proc/lunchables_alcohol_reagents() - if(!(lunchables_alcohol_reagents_[lunchables_alcohol_reagents_[1]])) - lunchables_alcohol_reagents_ = init_lunchable_reagent_list(lunchables_alcohol_reagents_, /singleton/reagent/alcohol) - return lunchables_alcohol_reagents_ + if(!(GLOB.lunchables_alcohol_reagents_[GLOB.lunchables_alcohol_reagents_[1]])) + GLOB.lunchables_alcohol_reagents_ = init_lunchable_reagent_list(GLOB.lunchables_alcohol_reagents_, /singleton/reagent/alcohol) + return GLOB.lunchables_alcohol_reagents_ /proc/lunchables_all_drink_reagents() return sortList(lunchables_drink_reagents() + lunchables_alcohol_reagents()) diff --git a/code/modules/reagents/reagent_containers/food/snacks/cultural/skrell.dm b/code/modules/reagents/reagent_containers/food/snacks/cultural/skrell.dm index 085a9da1338..f89d390dabb 100644 --- a/code/modules/reagents/reagent_containers/food/snacks/cultural/skrell.dm +++ b/code/modules/reagents/reagent_containers/food/snacks/cultural/skrell.dm @@ -9,16 +9,16 @@ /obj/item/reagent_containers/food/snacks/lortl/Initialize() . = ..() - if(!fruit_icon_cache["rind-#B1E4BE"]) + if(!GLOB.fruit_icon_cache["rind-#B1E4BE"]) var/image/I = image(icon,"fruit_rind") I.color = "#B1E4BE" - fruit_icon_cache["rind-#B1E4BE"] = I - AddOverlays(fruit_icon_cache["rind-#B1E4BE"]) - if(!fruit_icon_cache["slice-#B1E4BE"]) + GLOB.fruit_icon_cache["rind-#B1E4BE"] = I + AddOverlays(GLOB.fruit_icon_cache["rind-#B1E4BE"]) + if(!GLOB.fruit_icon_cache["slice-#B1E4BE"]) var/image/I = image(icon,"fruit_slice") I.color = "#9FE4B0" - fruit_icon_cache["slice-#B1E4BE"] = I - AddOverlays(fruit_icon_cache["slice-#B1E4BE"]) + GLOB.fruit_icon_cache["slice-#B1E4BE"] = I + AddOverlays(GLOB.fruit_icon_cache["slice-#B1E4BE"]) /obj/item/reagent_containers/food/snacks/soup/qilvo name = "qilvo" diff --git a/code/modules/research/research.dm b/code/modules/research/research.dm index 5be049631f9..a3651588cb4 100644 --- a/code/modules/research/research.dm +++ b/code/modules/research/research.dm @@ -44,7 +44,7 @@ research holder datum. ***************************************************************/ // Global design lists -var/global/list/designs = null +GLOBAL_LIST_INIT(designs, null) GLOBAL_LIST_EMPTY(designs_protolathe_categories) GLOBAL_LIST_EMPTY(designs_imprinter_categories) @@ -68,7 +68,7 @@ GLOBAL_LIST_EMPTY(designs_imprinter_categories) else if(antag_start_level) T.level = antag_start_level - if(load_designs && isnull(designs)) + if(load_designs && isnull(GLOB.designs)) InitializeDesigns() RefreshResearch() @@ -79,10 +79,10 @@ GLOBAL_LIST_EMPTY(designs_imprinter_categories) standard_start_level = 3 /datum/research/proc/InitializeDesigns() - designs = list() + GLOB.designs = list() for(var/T in subtypesof(/datum/design)) var/datum/design/D = new T - designs[D.type] = D + GLOB.designs[D.type] = D if(D.build_type & PROTOLATHE) GLOB.designs_protolathe_categories |= D.p_category if(D.build_type & IMPRINTER) @@ -129,8 +129,8 @@ GLOBAL_LIST_EMPTY(designs_imprinter_categories) /datum/research/proc/RefreshResearch() known_designs.Cut() // this is to refresh the ordering of the designs, the alternative is an expensive insertion or sorting proc if(load_designs) - for(var/path in designs) - var/datum/design/PD = designs[path] + for(var/path in GLOB.designs) + var/datum/design/PD = GLOB.designs[path] if(DesignHasReqs(PD)) AddDesign2Known(PD) for(var/id in known_tech) diff --git a/code/modules/research/xenoarchaeology/finds/finds_defines.dm b/code/modules/research/xenoarchaeology/finds/finds_defines.dm index 88d99eee393..6fae71a1c75 100644 --- a/code/modules/research/xenoarchaeology/finds/finds_defines.dm +++ b/code/modules/research/xenoarchaeology/finds/finds_defines.dm @@ -214,7 +214,7 @@ ) return find_type -var/list/responsive_carriers = list( +GLOBAL_LIST_INIT(responsive_carriers, list( "carbon", "potassium", "hydrogen", @@ -223,10 +223,10 @@ var/list/responsive_carriers = list( "iron", "chlorine", "phosphorus", - "phoron" - ) + "phoron", + )) -var/list/finds_as_strings = list( +GLOBAL_LIST_INIT(finds_as_strings, list( "Trace organic cells", "Long exposure particles", "Trace water particles", @@ -235,8 +235,8 @@ var/list/finds_as_strings = list( "Metallic composite", "Metamorphic/igneous rock composite", "Metamorphic/sedimentary rock composite", - "Anomalous material" - ) + "Anomalous material", + )) #undef ARCHAEO_BOWL #undef ARCHAEO_URN diff --git a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm index d23821a2d86..90014083a14 100644 --- a/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm +++ b/code/modules/research/xenoarchaeology/machinery/geosample_scanner.dm @@ -294,7 +294,7 @@ var/anom_found = 0 if(G) - data = " - Spectometric analysis on mineral sample has determined type [finds_as_strings[responsive_carriers.Find(G.source_mineral)]]
    " + data = " - Spectometric analysis on mineral sample has determined type [GLOB.finds_as_strings[GLOB.responsive_carriers.Find(G.source_mineral)]]
    " if(G.age_billion > 0) data += " - Radiometric dating shows age of [G.age_billion].[G.age_million] billion years
    " else if(G.age_million > 0) @@ -304,9 +304,9 @@ data += " - Chromatographic analysis shows the following materials present:
    " for(var/carrier in G.find_presence) if(G.find_presence[carrier]) - var/index = responsive_carriers.Find(carrier) - if(index > 0 && index <= finds_as_strings.len) - data += " > [100 * G.find_presence[carrier]]% [finds_as_strings[index]]
    " + var/index = GLOB.responsive_carriers.Find(carrier) + if(index > 0 && index <= GLOB.finds_as_strings.len) + data += " > [100 * G.find_presence[carrier]]% [GLOB.finds_as_strings[index]]
    " if(G.artifact_id && G.artifact_distance >= 0) anom_found = 1 diff --git a/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm b/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm index b36263ee05c..892ce4c9eea 100644 --- a/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm +++ b/code/modules/research/xenoarchaeology/tools/tools_depthscanner.dm @@ -81,9 +81,9 @@ dat += "Anomaly depth: [current.depth] cm
    " dat += "Clearance above anomaly depth: [current.clearance] cm
    " dat += "Dissonance spread: [current.dissonance_spread]
    " - var/index = responsive_carriers.Find(current.material) - if(index > 0 && index <= finds_as_strings.len) - dat += "Anomaly material: [finds_as_strings[index]]
    " + var/index = GLOB.responsive_carriers.Find(current.material) + if(index > 0 && index <= GLOB.finds_as_strings.len) + dat += "Anomaly material: [GLOB.finds_as_strings[index]]
    " else dat += "Anomaly material: Unknown
    " dat += "clear entry
    " diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index cbc962fea48..72c93ff32dd 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -202,14 +202,14 @@ else return 0 -var/global/maint_all_access = 0 +GLOBAL_VAR_INIT(maint_all_access, FALSE) /proc/make_maint_all_access() - maint_all_access = 1 + GLOB.maint_all_access = TRUE security_announcement.Announce("The maintenance access requirement has been revoked on all airlocks.","Attention!") /proc/revoke_maint_all_access() - maint_all_access = 0 + GLOB.maint_all_access = FALSE security_announcement.Announce("The maintenance access requirement has been readded on all maintenance airlocks.","Attention!") /obj/machinery/door/airlock/allowed(mob/M) @@ -221,7 +221,7 @@ var/global/maint_all_access = 0 return ..(M) var/list/A = I.GetAccess() var/maint_sec_access = ((GLOB.security_level > SEC_LEVEL_GREEN) && has_access(ACCESS_SECURITY, accesses = A)) - var/exceptional_circumstances = maint_all_access || maint_sec_access + var/exceptional_circumstances = GLOB.maint_all_access || maint_sec_access if(exceptional_circumstances && src.check_access_list(list(ACCESS_MAINT_TUNNELS))) return 1 if(access_by_level || req_one_access_by_level) diff --git a/code/modules/shuttles/escape_pods.dm b/code/modules/shuttles/escape_pods.dm index 6cdcb414e88..e11bc3fcf2d 100644 --- a/code/modules/shuttles/escape_pods.dm +++ b/code/modules/shuttles/escape_pods.dm @@ -1,5 +1,5 @@ -var/list/escape_pods = list() -var/list/escape_pods_by_name = list() +GLOBAL_LIST_EMPTY_TYPED(escape_pods, /datum/shuttle/autodock/ferry/escape_pod) +GLOBAL_LIST_EMPTY(escape_pods_by_name) /datum/shuttle/autodock/ferry/escape_pod var/datum/computer/file/embedded_program/docking/simple/escape_pod/arming_controller @@ -13,9 +13,9 @@ var/list/escape_pods_by_name = list() if(!istype(arming_controller)) CRASH("Could not find arming controller for escape pod \"[name]\", tag was '[arming_controller_tag]'.") - escape_pods += src - escape_pods_by_name[name] = src - move_time = evacuation_controller.evac_transit_delay + rand(-30, 60) + GLOB.escape_pods += src + GLOB.escape_pods_by_name[name] = src + move_time = GLOB.evacuation_controller.evac_transit_delay + rand(-30, 60) if(dock_target) var/datum/computer/file/embedded_program/docking/simple/own_target = SSshuttle.docking_registry[dock_target] if(own_target) @@ -23,6 +23,11 @@ var/list/escape_pods_by_name = list() if(own_target_master) own_target_master.pod = src +/datum/shuttle/autodock/ferry/escape_pod/Destroy() + GLOB.escape_pods -= src + GLOB.escape_pods_by_name -= name + . = ..() + /datum/shuttle/autodock/ferry/escape_pod/can_launch() if(arming_controller && !arming_controller.armed) //must be armed return 0 @@ -57,7 +62,7 @@ var/list/escape_pods_by_name = list() "override_enabled" = docking_program.override_enabled, "door_state" = docking_program.memory["door_status"]["state"], "door_lock" = docking_program.memory["door_status"]["lock"], - "can_force" = pod.can_force() || (evacuation_controller.has_evacuated() && pod.can_launch()), //allow players to manually launch ahead of time if the shuttle leaves + "can_force" = pod.can_force() || (GLOB.evacuation_controller.has_evacuated() && pod.can_launch()), //allow players to manually launch ahead of time if the shuttle leaves "is_armed" = pod.arming_controller.armed ) @@ -73,7 +78,7 @@ var/list/escape_pods_by_name = list() if(params["command"] == "force_launch") if (pod.can_force()) pod.force_launch(src) - else if (evacuation_controller.has_evacuated() && pod.can_launch()) //allow players to manually launch ahead of time if the shuttle leaves + else if (GLOB.evacuation_controller.has_evacuated() && pod.can_launch()) //allow players to manually launch ahead of time if the shuttle leaves pod.launch(src) return TRUE diff --git a/code/modules/shuttles/shuttle_emergency.dm b/code/modules/shuttles/shuttle_emergency.dm index 75576720631..f6191b399bb 100644 --- a/code/modules/shuttles/shuttle_emergency.dm +++ b/code/modules/shuttles/shuttle_emergency.dm @@ -5,7 +5,7 @@ /datum/shuttle/autodock/ferry/emergency/New() ..() - emergency_controller = evacuation_controller + emergency_controller = GLOB.evacuation_controller if(!istype(emergency_controller)) CRASH("Escape shuttle created without the appropriate controller type.") if(emergency_controller.shuttle) @@ -61,7 +61,7 @@ return 0 // If the emergency shuttle is waiting to leave the station and the world time exceeded the force time - if(evacuation_controller.is_prepared() && (world.time > emergency_controller.force_time)) + if(GLOB.evacuation_controller.is_prepared() && (world.time > emergency_controller.force_time)) return 0 return ..() diff --git a/code/modules/spell_system/spells/spell_code.dm b/code/modules/spell_system/spells/spell_code.dm index 6094a0c79eb..9a188314e6f 100644 --- a/code/modules/spell_system/spells/spell_code.dm +++ b/code/modules/spell_system/spells/spell_code.dm @@ -1,4 +1,4 @@ -var/list/spells = typesof(/spell) //needed for the badmin verb for now +GLOBAL_LIST_INIT(spells, typesof(/spell)) /spell var/name = "Spell" diff --git a/code/modules/synthesized_instruments/echo_editor.dm b/code/modules/synthesized_instruments/echo_editor.dm index c30671cd7ac..9bd4f3e335e 100644 --- a/code/modules/synthesized_instruments/echo_editor.dm +++ b/code/modules/synthesized_instruments/echo_editor.dm @@ -16,9 +16,9 @@ for (var/i=1 to 18) var/list/echo_data = list() echo_data["index"] = i - echo_data["name"] = musical_config.echo_param_names[i] + echo_data["name"] = GLOB.musical_config.echo_param_names[i] echo_data["value"] = src.player.echo[i] - echo_data["real"] = musical_config.echo_params_bounds[i][3] + echo_data["real"] = GLOB.musical_config.echo_params_bounds[i][3] data["echo_params"] += list(echo_data) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) @@ -38,10 +38,10 @@ to_chat(usr, "Wrong index was provided: [index]") return 0 - var/name = musical_config.echo_param_names[index] - var/desc = musical_config.echo_param_desc[index] - var/default = musical_config.echo_default[index] - var/list/bounds = musical_config.echo_params_bounds[index] + var/name = GLOB.musical_config.echo_param_names[index] + var/desc = GLOB.musical_config.echo_param_desc[index] + var/default = GLOB.musical_config.echo_default[index] + var/list/bounds = GLOB.musical_config.echo_params_bounds[index] var/bound_min = bounds[1] var/bound_max = bounds[2] var/reals_allowed = bounds[3] @@ -56,7 +56,7 @@ if ("reset") src.player.echo[index] = default if ("reset_all") - src.player.echo = musical_config.echo_default.Copy() + src.player.echo = GLOB.musical_config.echo_default.Copy() if ("desc") to_chat(usr, "[name]: from [bound_min] to [bound_max] (default: [default])
    [desc]") diff --git a/code/modules/synthesized_instruments/env_editor.dm b/code/modules/synthesized_instruments/env_editor.dm index b3c4c2053fe..bc1f42a03ba 100644 --- a/code/modules/synthesized_instruments/env_editor.dm +++ b/code/modules/synthesized_instruments/env_editor.dm @@ -15,9 +15,9 @@ for (var/i=1 to 23) var/list/env_data = list() env_data["index"] = i - env_data["name"] = musical_config.env_param_names[i] + env_data["name"] = GLOB.musical_config.env_param_names[i] env_data["value"] = src.player.env[i] - env_data["real"] = musical_config.env_params_bounds[i][3] + env_data["real"] = GLOB.musical_config.env_params_bounds[i][3] data["env_params"] += list(env_data) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) @@ -28,7 +28,7 @@ /datum/nano_module/env_editor/Topic(href, href_list) - if (!musical_config.env_settings_available) + if (!GLOB.musical_config.env_settings_available) return 0 if (..()) @@ -40,10 +40,10 @@ to_chat(usr, "Wrong index was provided: [index]") return 0 - var/name = musical_config.env_param_names[index] - var/desc = musical_config.env_param_desc[index] - var/default = musical_config.env_default[index] - var/list/bounds = musical_config.env_params_bounds[index] + var/name = GLOB.musical_config.env_param_names[index] + var/desc = GLOB.musical_config.env_param_desc[index] + var/default = GLOB.musical_config.env_default[index] + var/list/bounds = GLOB.musical_config.env_params_bounds[index] var/bound_min = bounds[1] var/bound_max = bounds[2] var/reals_allowed = bounds[3] @@ -58,7 +58,7 @@ if ("reset") src.player.env[index] = default if ("reset_all") - src.player.env = musical_config.env_default.Copy() + src.player.env = GLOB.musical_config.env_default.Copy() if ("desc") to_chat(usr, "[name]: from [bound_min] to [bound_max] (default: [default])
    [desc]") diff --git a/code/modules/synthesized_instruments/event_manager.dm b/code/modules/synthesized_instruments/event_manager.dm index ad01d54c087..09fcf44a229 100644 --- a/code/modules/synthesized_instruments/event_manager.dm +++ b/code/modules/synthesized_instruments/event_manager.dm @@ -92,4 +92,4 @@ /datum/musical_event_manager/proc/is_overloaded() - return src.events.len > musical_config.max_events + return src.events.len > GLOB.musical_config.max_events diff --git a/code/modules/synthesized_instruments/globals.dm b/code/modules/synthesized_instruments/globals.dm index fa00cfd07df..cfcf37bef6f 100644 --- a/code/modules/synthesized_instruments/globals.dm +++ b/code/modules/synthesized_instruments/globals.dm @@ -1,4 +1,4 @@ -var/datum/musical_config/musical_config = new() +GLOBAL_DATUM_INIT(musical_config, /datum/musical_config, new()) /datum/musical_config var/highest_octave = 9 diff --git a/code/modules/synthesized_instruments/instruments.dm b/code/modules/synthesized_instruments/instruments.dm index 42a20a76ba7..e8dd08986f6 100644 --- a/code/modules/synthesized_instruments/instruments.dm +++ b/code/modules/synthesized_instruments/instruments.dm @@ -18,17 +18,17 @@ for (var/indx1=1 to delta_1.len-1) var/from_key = delta_1[indx1] var/to_key = delta_1[indx1+1] - var/sample1 = src.samples[musical_config.n2t(from_key)] - var/sample2 = src.samples[musical_config.n2t(to_key)] + var/sample1 = src.samples[GLOB.musical_config.n2t(from_key)] + var/sample2 = src.samples[GLOB.musical_config.n2t(to_key)] var/pivot = round((from_key+to_key)/2) - for (var/key = from_key to pivot) src.sample_map[musical_config.n2t(key)] = new /datum/sample_pair(sample1, key-from_key) // [55+56] / 2 -> 55.5 -> 55 so no changes will occur - for (var/key = pivot+1 to to_key) src.sample_map[musical_config.n2t(key)] = new /datum/sample_pair(sample2, key-to_key) + for (var/key = from_key to pivot) src.sample_map[GLOB.musical_config.n2t(key)] = new /datum/sample_pair(sample1, key-from_key) // [55+56] / 2 -> 55.5 -> 55 so no changes will occur + for (var/key = pivot+1 to to_key) src.sample_map[GLOB.musical_config.n2t(key)] = new /datum/sample_pair(sample2, key-to_key) // Fill in 0 -- first key and last key -- 127 var/first_key = delta_1[1] var/last_key = delta_1[delta_1.len] - var/first_sample = src.samples[musical_config.n2t(first_key)] - var/last_sample = src.samples[musical_config.n2t(last_key)] - for (var/key=0 to first_key-1) src.sample_map[musical_config.n2t(key)] = new /datum/sample_pair(first_sample, key-first_key) - for (var/key=last_key to 127) src.sample_map[musical_config.n2t(key)] = new /datum/sample_pair(last_sample, key-last_key) + var/first_sample = src.samples[GLOB.musical_config.n2t(first_key)] + var/last_sample = src.samples[GLOB.musical_config.n2t(last_key)] + for (var/key=0 to first_key-1) src.sample_map[GLOB.musical_config.n2t(key)] = new /datum/sample_pair(first_sample, key-first_key) + for (var/key=last_key to 127) src.sample_map[GLOB.musical_config.n2t(key)] = new /datum/sample_pair(last_sample, key-last_key) return src.samples diff --git a/code/modules/synthesized_instruments/real_instruments.dm b/code/modules/synthesized_instruments/real_instruments.dm index 9beebd42987..217cf78193c 100644 --- a/code/modules/synthesized_instruments/real_instruments.dm +++ b/code/modules/synthesized_instruments/real_instruments.dm @@ -14,8 +14,8 @@ /datum/real_instrument/New(obj/who, datum/sound_player/how, datum/instrument/what) player = how owner = who - maximum_lines = musical_config.max_lines - maximum_line_length = musical_config.max_line_length + maximum_lines = GLOB.musical_config.max_lines + maximum_line_length = GLOB.musical_config.max_line_length instruments = what //This can be a list, or it can also not be one /datum/real_instrument/proc/Topic_call(href, href_list, usr) @@ -87,20 +87,20 @@ if ("volume") src.player.volume = min(max(min(player.volume+text2num(value), 100), 0), player.max_volume) if ("transposition") - src.player.song.transposition = max(min(player.song.transposition+value, musical_config.highest_transposition), musical_config.lowest_transposition) + src.player.song.transposition = max(min(player.song.transposition+value, GLOB.musical_config.highest_transposition), GLOB.musical_config.lowest_transposition) if ("min_octave") - src.player.song.octave_range_min = max(min(player.song.octave_range_min+value, musical_config.highest_octave), musical_config.lowest_octave) + src.player.song.octave_range_min = max(min(player.song.octave_range_min+value, GLOB.musical_config.highest_octave), GLOB.musical_config.lowest_octave) src.player.song.octave_range_max = max(player.song.octave_range_max, player.song.octave_range_min) if ("max_octave") - src.player.song.octave_range_max = max(min(player.song.octave_range_max+value, musical_config.highest_octave), musical_config.lowest_octave) + src.player.song.octave_range_max = max(min(player.song.octave_range_max+value, GLOB.musical_config.highest_octave), GLOB.musical_config.lowest_octave) src.player.song.octave_range_min = min(player.song.octave_range_max, player.song.octave_range_min) if ("sustain_timer") - src.player.song.sustain_timer = max(min(player.song.sustain_timer+value, musical_config.longest_sustain_timer), 1) + src.player.song.sustain_timer = max(min(player.song.sustain_timer+value, GLOB.musical_config.longest_sustain_timer), 1) if ("soft_coeff") - var/new_coeff = input(usr, "from [musical_config.gentlest_drop] to [musical_config.steepest_drop]") as num + var/new_coeff = input(usr, "from [GLOB.musical_config.gentlest_drop] to [GLOB.musical_config.steepest_drop]") as num if(!CanInteractWith(usr, owner, GLOB.physical_state)) return - new_coeff = round(min(max(new_coeff, musical_config.gentlest_drop), musical_config.steepest_drop), 0.001) + new_coeff = round(min(max(new_coeff, GLOB.musical_config.gentlest_drop), GLOB.musical_config.steepest_drop), 0.001) src.player.song.soft_coeff = new_coeff if ("instrument") if (!islist(instruments)) @@ -129,7 +129,7 @@ if ("decay") src.player.song.linear_decay = value if ("echo") src.player.apply_echo = value if ("show_env_editor") - if (musical_config.env_settings_available) + if (GLOB.musical_config.env_settings_available) if (!src.env_editor) src.env_editor = new (src.player) src.env_editor.ui_interact(usr) @@ -170,8 +170,8 @@ ) ), "advanced_options" = list( - "all_environments" = musical_config.all_environments, - "selected_environment" = musical_config.id_to_environment(src.player.virtual_environment_selected), + "all_environments" = GLOB.musical_config.all_environments, + "selected_environment" = GLOB.musical_config.id_to_environment(src.player.virtual_environment_selected), "apply_echo" = src.player.apply_echo ), "sustain" = list( @@ -181,14 +181,14 @@ ), "show" = list( "playback" = src.player.song.lines.len > 0, - "custom_env_options" = musical_config.is_custom_env(src.player.virtual_environment_selected), - "env_settings" = musical_config.env_settings_available + "custom_env_options" = GLOB.musical_config.is_custom_env(src.player.virtual_environment_selected), + "env_settings" = GLOB.musical_config.env_settings_available ), "status" = list( "channels" = src.player.song.available_channels, "events" = src.player.event_manager.events.len, - "max_channels" = musical_config.channels_per_instrument, - "max_events" = musical_config.max_events, + "max_channels" = GLOB.musical_config.channels_per_instrument, + "max_events" = GLOB.musical_config.max_events, ) ) diff --git a/code/modules/synthesized_instruments/song.dm b/code/modules/synthesized_instruments/song.dm index 3a2f6730564..05b97baa85e 100644 --- a/code/modules/synthesized_instruments/song.dm +++ b/code/modules/synthesized_instruments/song.dm @@ -25,10 +25,10 @@ /datum/synthesized_song/New(datum/sound_player/playing_object, datum/instrument/instrument) src.player = playing_object src.instrument_data = instrument - src.octave_range_min = musical_config.lowest_octave - src.octave_range_max = musical_config.highest_octave + src.octave_range_min = GLOB.musical_config.lowest_octave + src.octave_range_max = GLOB.musical_config.highest_octave instrument.create_full_sample_deviation_map() - available_channels = musical_config.channels_per_instrument + available_channels = GLOB.musical_config.channels_per_instrument /datum/synthesized_song/Destroy() player.event_manager.deactivate() @@ -40,17 +40,17 @@ /datum/synthesized_song/proc/play_synthesized_note(note, acc, oct, duration, where, which_one) - if (oct < musical_config.lowest_octave || oct > musical_config.highest_octave) return + if (oct < GLOB.musical_config.lowest_octave || oct > GLOB.musical_config.highest_octave) return if (oct < src.octave_range_min || oct > src.octave_range_max) return var/delta1 = acc == "b" ? -1 : acc == "#" ? 1 : acc == "s" ? 1 : acc == "n" ? 0 : 0 var/delta2 = 12 * oct - var/note_num = delta1+delta2+musical_config.nn2no[note] + var/note_num = delta1+delta2+GLOB.musical_config.nn2no[note] if (note_num < 0 || note_num > 127) CRASH("play_synthesized note failed because of 0..127 condition, [note], [acc], [oct]") - var/datum/sample_pair/pair = src.instrument_data.sample_map[musical_config.n2t(note_num)] + var/datum/sample_pair/pair = src.instrument_data.sample_map[GLOB.musical_config.n2t(note_num)] #define Q 0.083 // 1/12 var/freq = 2**(Q*pair.deviation) #undef Q diff --git a/code/modules/synthesized_instruments/song_editor.dm b/code/modules/synthesized_instruments/song_editor.dm index 4b08fb600f4..b0e897ae34e 100644 --- a/code/modules/synthesized_instruments/song_editor.dm +++ b/code/modules/synthesized_instruments/song_editor.dm @@ -13,17 +13,17 @@ /datum/nano_module/song_editor/proc/pages() - return Ceil(src.song.lines.len / musical_config.song_editor_lines_per_page) + return Ceil(src.song.lines.len / GLOB.musical_config.song_editor_lines_per_page) /datum/nano_module/song_editor/proc/current_page() - return src.song.current_line > 0 ? Ceil(src.song.current_line / musical_config.song_editor_lines_per_page) : min(src.page, pages()) + return src.song.current_line > 0 ? Ceil(src.song.current_line / GLOB.musical_config.song_editor_lines_per_page) : min(src.page, pages()) /datum/nano_module/song_editor/proc/page_bounds(page_num) return list( - max(min(1 + musical_config.song_editor_lines_per_page * (page_num-1), src.song.lines.len), 1), - min(musical_config.song_editor_lines_per_page * page_num, src.song.lines.len)) + max(min(1 + GLOB.musical_config.song_editor_lines_per_page * (page_num-1), src.song.lines.len), 1), + min(GLOB.musical_config.song_editor_lines_per_page * page_num, src.song.lines.len)) /datum/nano_module/song_editor/ui_interact(mob/user, ui_key = "song_editor", datum/nanoui/ui = null, force_open = 0) var/list/data = list() @@ -33,12 +33,12 @@ data["lines"] = src.song.lines.Copy(line_bounds[1], line_bounds[2]+1) data["active_line"] = src.song.current_line - data["max_lines"] = musical_config.max_lines - data["max_line_length"] = musical_config.max_line_length + data["max_lines"] = GLOB.musical_config.max_lines + data["max_line_length"] = GLOB.musical_config.max_line_length data["tick_lag"] = world.tick_lag data["show_help"] = src.show_help data["page_num"] = current_page - data["page_offset"] = musical_config.song_editor_lines_per_page * (current_page-1) + data["page_offset"] = GLOB.musical_config.song_editor_lines_per_page * (current_page-1) ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) @@ -62,10 +62,10 @@ var/newline = html_encode(input(usr, "Enter your line: ") as text|null) if(!newline) return - if(src.song.lines.len > musical_config.max_lines) + if(src.song.lines.len > GLOB.musical_config.max_lines) return - if(length(newline) > musical_config.max_line_length) - newline = copytext(newline, 1, musical_config.max_line_length) + if(length(newline) > GLOB.musical_config.max_line_length) + newline = copytext(newline, 1, GLOB.musical_config.max_line_length) src.song.lines.Add(newline) if("deleteline") @@ -85,8 +85,8 @@ return if(!content) return - if(length(content) > musical_config.max_line_length) - content = copytext(content, 1, musical_config.max_line_length) + if(length(content) > GLOB.musical_config.max_line_length) + content = copytext(content, 1, GLOB.musical_config.max_line_length) src.song.lines[num] = content if ("help") diff --git a/code/modules/synthesized_instruments/sound_player.dm b/code/modules/synthesized_instruments/sound_player.dm index 196524702bb..bfce2636958 100644 --- a/code/modules/synthesized_instruments/sound_player.dm +++ b/code/modules/synthesized_instruments/sound_player.dm @@ -23,8 +23,8 @@ /datum/sound_player/New(datum/real_instrument/where, datum/instrument/what) src.song = new (src, what) src.actual_instrument = where - src.echo = musical_config.echo_default.Copy() - src.env = musical_config.env_default.Copy() + src.echo = GLOB.musical_config.echo_default.Copy() + src.env = GLOB.musical_config.env_default.Copy() GLOB.instrument_synchronizer.register_global(src, .proc/check_wait) /datum/sound_player/Destroy() @@ -65,8 +65,8 @@ /datum/sound_player/proc/apply_modifications(sound/what, note_num, which_line, which_note) // You don't need to override this what.volume = volume what.falloff = falloff - if (musical_config.env_settings_available) - what.environment = musical_config.is_custom_env(src.virtual_environment_selected) ? src.env : src.virtual_environment_selected + if (GLOB.musical_config.env_settings_available) + what.environment = GLOB.musical_config.is_custom_env(src.virtual_environment_selected) ? src.env : src.virtual_environment_selected if (src.apply_echo) what.echo = src.echo return diff --git a/code/modules/synthesized_instruments/usage_info.dm b/code/modules/synthesized_instruments/usage_info.dm index 9f718331a4d..308bad2ba0b 100644 --- a/code/modules/synthesized_instruments/usage_info.dm +++ b/code/modules/synthesized_instruments/usage_info.dm @@ -11,10 +11,10 @@ /datum/nano_module/usage_info/ui_interact(mob/user, ui_key = "usage_info", datum/nanoui/ui = null, force_open = 0) var/static/list/data = list() data.Cut() - data["channels_left"] = sound_channels.available_channels.stack.len + data["channels_left"] = GLOB.sound_channels.available_channels.stack.len data["events_active"] = src.player.event_manager.events.len - data["max_channels"] = sound_channels.channel_ceiling - data["max_events"] = musical_config.max_events + data["max_channels"] = GLOB.sound_channels.channel_ceiling + data["max_events"] = GLOB.musical_config.max_events ui = SSnanoui.try_update_ui(user, src, ui_key, ui, data, force_open) if (!ui) diff --git a/code/modules/tgui/states/not_incapacitated.dm b/code/modules/tgui/states/not_incapacitated.dm index 49ba2460151..309a85d578a 100644 --- a/code/modules/tgui/states/not_incapacitated.dm +++ b/code/modules/tgui/states/not_incapacitated.dm @@ -17,7 +17,7 @@ GLOBAL_DATUM_INIT(not_incapacitated_state, /datum/ui_state/not_incapacitated_sta * 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/physical.dm b/code/modules/tgui/states/physical.dm index 216b39281d1..b559758f720 100644 --- a/code/modules/tgui/states/physical.dm +++ b/code/modules/tgui/states/physical.dm @@ -35,7 +35,7 @@ GLOBAL_DATUM_INIT(physical_state, /datum/ui_state/physical, new) * Short-circuits the default state to only check physical distance, being in view doesn't matter */ -var/global/datum/ui_state/physical_obscured_state/physical_obscured_state = new +GLOBAL_DATUM_INIT(physical_obscured_state, /datum/ui_state/physical_obscured_state, new) /datum/ui_state/physical_obscured_state/can_use_topic(src_object, mob/user) . = user.shared_ui_interaction(src_object) diff --git a/code/modules/ventcrawl/ventcrawl.dm b/code/modules/ventcrawl/ventcrawl.dm index f70dea89149..3ccf0c44b7b 100644 --- a/code/modules/ventcrawl/ventcrawl.dm +++ b/code/modules/ventcrawl/ventcrawl.dm @@ -1,10 +1,10 @@ -var/list/ventcrawl_machinery = list( +GLOBAL_LIST_INIT(ventcrawl_machinery, list( /obj/machinery/atmospherics/unary/vent_pump, /obj/machinery/atmospherics/unary/vent_scrubber - ) + )) -// Vent crawling whitelisted items, whoo -var/global/list/can_enter_vent_with = list( +/// Vent crawling whitelisted items, whoo +GLOBAL_LIST_INIT(can_enter_vent_with, list( /obj/item/device/mmi, /obj/item/implant, /obj/item/device/radio/borg, @@ -13,7 +13,7 @@ var/global/list/can_enter_vent_with = list( /mob/living/simple_animal/borer, /mob/living/simple_animal/rat, /mob/living/carbon/human - ) + )) /mob/living/var/list/icon/pipes_shown = list() /mob/living/var/last_played_vent @@ -30,7 +30,7 @@ var/global/list/can_enter_vent_with = list( return TRUE /mob/living/proc/is_allowed_vent_crawl_item(var/obj/item/carried_item) - if(is_type_in_list(carried_item, can_enter_vent_with)) + if(is_type_in_list(carried_item, GLOB.can_enter_vent_with)) return !get_inventory_slot(carried_item) /mob/living/carbon/is_allowed_vent_crawl_item(var/obj/item/carried_item) @@ -59,7 +59,7 @@ var/global/list/can_enter_vent_with = list( return TRUE /obj/machinery/atmospherics/AltClick(mob/living/user) - if(is_type_in_list(src, ventcrawl_machinery) && user.can_ventcrawl()) + if(is_type_in_list(src, GLOB.ventcrawl_machinery) && user.can_ventcrawl()) user.handle_ventcrawl(src) return 1 return ..() @@ -71,7 +71,7 @@ var/global/list/can_enter_vent_with = list( var/atom/pipe var/list/pipes = list() for(var/obj/machinery/atmospherics/unary/U in range(1)) - if(is_type_in_list(U,ventcrawl_machinery) && Adjacent(U)) + if(is_type_in_list(U,GLOB.ventcrawl_machinery) && Adjacent(U)) pipes |= U if(!pipes || !pipes.len) to_chat(usr, SPAN_NOTICE("There are no pipes that you can ventcrawl into within range!")) @@ -134,7 +134,7 @@ var/global/list/can_enter_vent_with = list( if(clicked_on) if (Adjacent(clicked_on)) vent_found = clicked_on - if(!is_type_in_list(vent_found, ventcrawl_machinery) || !vent_found.can_crawl_through()) + if(!is_type_in_list(vent_found, GLOB.ventcrawl_machinery) || !vent_found.can_crawl_through()) vent_found = null else to_chat(src, SPAN_WARNING("Stand next to the selected vent!")) @@ -142,7 +142,7 @@ var/global/list/can_enter_vent_with = list( if(!vent_found && isnull(clicked_on)) 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 || !vent_found.can_crawl_through()) diff --git a/code/modules/ventcrawl/ventcrawl_atmospherics.dm b/code/modules/ventcrawl/ventcrawl_atmospherics.dm index ec879507cff..5afbc099793 100644 --- a/code/modules/ventcrawl/ventcrawl_atmospherics.dm +++ b/code/modules/ventcrawl/ventcrawl_atmospherics.dm @@ -32,7 +32,7 @@ /obj/machinery/atmospherics/proc/ventcrawl_to(var/mob/living/user, var/obj/machinery/atmospherics/target_move, var/direction) if(target_move) - if(is_type_in_list(target_move, ventcrawl_machinery) && target_move.can_crawl_through()) + if(is_type_in_list(target_move, GLOB.ventcrawl_machinery) && target_move.can_crawl_through()) var/obj/machinery/atmospherics/unary/UA = target_move if(UA.is_welded()) user.visible_message(SPAN_WARNING("You hear something banging on \the [target_move.name]!"), SPAN_NOTICE("You can't escape from a welded vent.")) @@ -55,7 +55,7 @@ user.next_play_vent = world.time+30 playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3) else - if((direction & initialize_directions) || is_type_in_list(src, ventcrawl_machinery) && src.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) && src.can_crawl_through()) //if we move in a way the pipe can connect, but doesn't - or we're in a vent user.remove_ventcrawl() user.forceMove(check_neighbor_density(get_turf(src.loc), direction) ? src.loc : get_step(src, direction)) user.sight &= ~(SEE_TURFS|BLIND) diff --git a/code/modules/world_api/api_command.dm b/code/modules/world_api/api_command.dm index 1c73ee236a6..362a720a8cb 100644 --- a/code/modules/world_api/api_command.dm +++ b/code/modules/world_api/api_command.dm @@ -71,8 +71,8 @@ LOG_DEBUG("API: Throttling bypassed - IP [addr] is whitelisted.") return FALSE - var/last_time = world_api_rate_limit[addr] - world_api_rate_limit[addr] = REALTIMEOFDAY + var/last_time = GLOB.world_api_rate_limit[addr] + GLOB.world_api_rate_limit[addr] = REALTIMEOFDAY if (last_time != null && abs(last_time - REALTIMEOFDAY) < GLOB.config.api_rate_limit) return TRUE diff --git a/code/modules/world_api/commands/admin.dm b/code/modules/world_api/commands/admin.dm index d5b58d42f0e..af59a1ee2a1 100644 --- a/code/modules/world_api/commands/admin.dm +++ b/code/modules/world_api/commands/admin.dm @@ -37,7 +37,7 @@ if (G.client) P = G.client.prefs else if (G.ckey) - P = preferences_datums[G.ckey] + P = GLOB.preferences_datums[G.ckey] else statuscode = 500 response = "Something went wrong, couldn't find the target's preferences datum" diff --git a/code/modules/world_api/commands/cciaa.dm b/code/modules/world_api/commands/cciaa.dm index 438ac3efd64..7c8e6951326 100644 --- a/code/modules/world_api/commands/cciaa.dm +++ b/code/modules/world_api/commands/cciaa.dm @@ -6,7 +6,7 @@ /datum/topic_command/get_faxmachines/run_command(queryparams) var/list/faxlocations = list() - for (var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for (var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) faxlocations.Add(F.department) statuscode = 200 @@ -26,9 +26,9 @@ var/list/faxes = list() switch (queryparams["faxtype"]) if ("received") - faxes = arrived_faxes + faxes = GLOB.arrived_faxes if ("sent") - faxes = sent_faxes + faxes = GLOB.sent_faxes if (!faxes || !faxes.len) statuscode = 404 @@ -60,9 +60,9 @@ var/list/faxes = list() switch (queryparams["faxtype"]) if ("received") - faxes = arrived_faxes + faxes = GLOB.arrived_faxes if ("sent") - faxes = sent_faxes + faxes = GLOB.sent_faxes if (!faxes || !faxes.len) statuscode = 500 @@ -207,7 +207,7 @@ var/notifyresult = 1 //Send the fax - for (var/obj/machinery/photocopier/faxmachine/F in allfaxes) + for (var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if (F.department in targetlist) sendresult = send_fax(F, faxtitle, faxbody, senderkey, stamptext) if (sendresult == 1) @@ -256,7 +256,7 @@ if(F.receivefax(P)) log_and_message_admins("[senderkey] sent a fax message to the [F.department] fax machine via the api. (JMP)") - sent_faxes += P + GLOB.sent_faxes += P return TRUE else qdel(P) diff --git a/code/modules/world_api/commands/misc.dm b/code/modules/world_api/commands/misc.dm index a35968f9b03..3f9799bd783 100644 --- a/code/modules/world_api/commands/misc.dm +++ b/code/modules/world_api/commands/misc.dm @@ -181,12 +181,12 @@ ) /datum/topic_command/auth_client/run_command(queryparams) - if(!(queryparams["clienttoken"] in unauthed)) + if(!(queryparams["clienttoken"] in GLOB.unauthed)) statuscode = 404 response = "Client with such token is not found." return TRUE - var/mob/abstract/unauthed/una = unauthed[queryparams["clienttoken"]] + var/mob/abstract/unauthed/una = GLOB.unauthed[queryparams["clienttoken"]] if(!istype(una) || !una.client) statuscode = 500 response = "Somethnig went horribly wrong." @@ -217,12 +217,12 @@ ) /datum/topic_command/get_auth_client_ip/run_command(queryparams) - if(!(queryparams["clienttoken"] in unauthed)) + if(!(queryparams["clienttoken"] in GLOB.unauthed)) statuscode = 404 response = "Unauthed client with such token is not found." return TRUE - var/mob/abstract/unauthed/una = unauthed[queryparams["clienttoken"]] + var/mob/abstract/unauthed/una = GLOB.unauthed[queryparams["clienttoken"]] if(!istype(una) || !una.client) statuscode = 500 diff --git a/code/modules/world_api/commands/server_query.dm b/code/modules/world_api/commands/server_query.dm index a3da9dec300..c0a61b404af 100644 --- a/code/modules/world_api/commands/server_query.dm +++ b/code/modules/world_api/commands/server_query.dm @@ -16,7 +16,7 @@ s["roundduration"] = get_round_duration_formatted() s["gameid"] = GLOB.round_id s["game_state"] = SSticker ? SSticker.current_state : 0 - s["transferring"] = evacuation_controller?.is_evacuating() + s["transferring"] = GLOB.evacuation_controller?.is_evacuating() s["players"] = GLOB.clients.len s["staff"] = GLOB.staff.len diff --git a/code/names.dm b/code/names.dm index 6003d7be800..cc46134d8c7 100644 --- a/code/names.dm +++ b/code/names.dm @@ -1,35 +1,7 @@ -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/verbs = file2list("config/names/verbs.txt") -var/list/adjectives = file2list("config/names/adjectives.txt") - -//loaded on startup because of " -//would include in rsc if ' was used - -var/list/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" -) -var/list/nato_phonetic_letters = list( - "Alfa", "Bravo", "Charlie", "Delta", "Echo", "Foxtrot", "Golf", - "Hotel", "India", "Juliett", "Kilo", "Lima", "Mike", "November", - "Oscar", "Papa", "Quebec", "Romeo", "Sierra", "Tango", "Uniform", - "Victor", "Whiskey", "X-ray", "Yankee", "Zulu" -) - /proc/generate_planet_name() return pick( - "[capitalize(pick(last_names))]-[pick(greek_letters)]", - "[capitalize(pick(last_names))]-[pick(nato_phonetic_letters)]") + "[capitalize(pick(GLOB.last_names))]-[pick(GLOB.greek_letters)]", + "[capitalize(pick(GLOB.last_names))]-[pick(GLOB.nato_phonetic_letters)]") /proc/generate_planet_type() return pick("terrestial planet", "ice planet", "dwarf planet", "desert planet", "ocean planet", "lava planet", "gas giant", "forest planet") diff --git a/code/unit_tests/map_tests.dm b/code/unit_tests/map_tests.dm index fbe59fdb2e5..0942473f8f5 100644 --- a/code/unit_tests/map_tests.dm +++ b/code/unit_tests/map_tests.dm @@ -38,22 +38,22 @@ for(var/area/A in typecache_filter_list_reverse(get_sorted_areas(), exempt_areas)) if(is_station_level(A.z)) area_test_count++ - var/bad_msg = "[ascii_red]--------------- [A.name] ([A.type])" + var/bad_msg = TEST_OUTPUT_RED("--------------- [A.name] ([A.type])") if(!A.apc && !is_type_in_typecache(A, exempt_from_apc)) - TEST_FAIL("[bad_msg] lacks an APC.[ascii_reset]") + TEST_FAIL(TEST_OUTPUT_RED("[bad_msg] lacks an APC.")) bad_apc++ if(!A.air_scrub_info.len && !is_type_in_typecache(A, exempt_from_atmos)) - TEST_FAIL("[bad_msg] lacks an air scrubber.[ascii_reset]") + TEST_FAIL(TEST_OUTPUT_RED("[bad_msg] lacks an air scrubber.")) bad_airs++ if(!A.air_vent_info.len && !is_type_in_typecache(A, exempt_from_atmos)) - TEST_FAIL("[bad_msg] lacks an air vent.[ascii_reset]") + TEST_FAIL(TEST_OUTPUT_RED("[bad_msg] lacks an air vent.")) bad_airv++ if(!(locate(/obj/machinery/firealarm) in A) && !is_type_in_typecache(A, exempt_from_fire)) - TEST_FAIL("[bad_msg] lacks a fire alarm.[ascii_reset]") + TEST_FAIL(TEST_OUTPUT_RED("[bad_msg] lacks a fire alarm.")) bad_fire++ if(bad_apc) @@ -91,7 +91,7 @@ cable_turfs |= get_turf(C) for(T in cable_turfs) - var/bad_msg = "[ascii_red]--------------- [T.name] \[[T.x] / [T.y] / [T.z]\]" + var/bad_msg = TEST_OUTPUT_RED("--------------- [T.name] \[[T.x] / [T.y] / [T.z]\]") dirs_checked.Cut() for(C in T) wire_test_count++ diff --git a/code/unit_tests/mob_tests.dm b/code/unit_tests/mob_tests.dm index 41a04d88035..f0db8ff4095 100644 --- a/code/unit_tests/mob_tests.dm +++ b/code/unit_tests/mob_tests.dm @@ -538,10 +538,10 @@ if(!valid_states.len) return 1 - for(var/i=1, i<=robot_modules.len, i++) - var/bad_msg = "[ascii_red]--------------- [robot_modules[i]]" - if(!(lowertext(robot_modules[i]) in valid_states)) - TEST_FAIL("[bad_msg] does not contain a valid icon state in [icon_file][ascii_reset]") + for(var/i=1, i<=GLOB.robot_modules.len, i++) + var/bad_msg = "--------------- [GLOB.robot_modules[i]]" + if(!(lowertext(GLOB.robot_modules[i]) in valid_states)) + TEST_FAIL(TEST_OUTPUT_RED(("[bad_msg] does not contain a valid icon state in [icon_file]"))) failed=1 if(failed) diff --git a/code/unit_tests/recipe_tests.dm b/code/unit_tests/recipe_tests.dm index b5cd09122b2..b832fb28841 100755 --- a/code/unit_tests/recipe_tests.dm +++ b/code/unit_tests/recipe_tests.dm @@ -10,7 +10,7 @@ /datum/unit_test/research_design_cost/start_test() var/tested_count = 0 var/error_count = 0 - for(var/datum/design/D in designs) + for(var/datum/design/D in GLOB.designs) if(ispath(D.build_path, /obj/item)) var/obj/item/I = D.Fabricate() if(I.matter && D.materials && I.recyclable) // non-recyclable items can't be exploited diff --git a/code/unit_tests/ss_test.dm b/code/unit_tests/ss_test.dm index 22063990de9..f4a566593d1 100644 --- a/code/unit_tests/ss_test.dm +++ b/code/unit_tests/ss_test.dm @@ -166,14 +166,14 @@ SUBSYSTEM_DEF(unit_tests) TEST_GROUP_OPEN("[test.name]") if (test.map_path && SSatlas.current_map && SSatlas.current_map.path != test.map_path) - test.pass("[ascii_red]Check Disabled: This test is not allowed to run on this map.", __FILE__, __LINE__) + test.pass(TEST_OUTPUT_GREEN("Check Disabled: This test is not allowed to run on this map."), __FILE__, __LINE__) TEST_GROUP_CLOSE("[test.name]") if (MC_TICK_CHECK) return continue if (test.disabled) - test.pass("[ascii_red]Check Disabled: [test.why_disabled]", __FILE__, __LINE__) + test.pass(TEST_OUTPUT_RED("Check Disabled: [test.why_disabled]"), __FILE__, __LINE__) TEST_GROUP_CLOSE("[test.name]") if (MC_TICK_CHECK) return @@ -192,9 +192,9 @@ SUBSYSTEM_DEF(unit_tests) if (test.async) async_tests += test - total_unit_tests++ + GLOB.total_unit_tests++ - if(unit_tests_failures && SSunit_tests_config.fail_fast) + if(GLOB.unit_tests_failures && SSunit_tests_config.fail_fast) SSunit_tests_config.UT.fail("**** Fail fast is enabled and an unit test failed! Aborting... ****", __FILE__, __LINE__) handle_tests_ending(TRUE) break @@ -242,11 +242,11 @@ SUBSYSTEM_DEF(unit_tests) handle_async(resumed) if (4) // Finalization. - if(all_unit_tests_passed) - SSunit_tests_config.UT.pass("**** All Unit Tests Passed \[[total_unit_tests]\] ****", __FILE__, __LINE__) + if(GLOB.all_unit_tests_passed) + SSunit_tests_config.UT.pass("**** All Unit Tests Passed \[[GLOB.total_unit_tests]\] ****", __FILE__, __LINE__) handle_tests_ending(FALSE) else - SSunit_tests_config.UT.fail("**** \[[unit_tests_failures]\] Errors Encountered! Read the logs above! ****", __FILE__, __LINE__) + SSunit_tests_config.UT.fail("**** \[[GLOB.unit_tests_failures]\] Errors Encountered! Read the logs above! ****", __FILE__, __LINE__) handle_tests_ending(TRUE) /datum/controller/subsystem/unit_tests/proc/handle_tests_ending(is_failure = FALSE) diff --git a/code/unit_tests/unit_test.dm b/code/unit_tests/unit_test.dm index 6197c463241..7b43a71833b 100644 --- a/code/unit_tests/unit_test.dm +++ b/code/unit_tests/unit_test.dm @@ -25,17 +25,9 @@ */ -var/all_unit_tests_passed = 1 -var/unit_tests_failures = 0 -var/total_unit_tests = 0 - -// For console out put in Linux/Bash makes the output green or red. -// Should probably only be used for unit tests/Travis since some special folks use winders to host servers. -var/ascii_esc = ascii2text(27) -var/ascii_red = "[ascii_esc]\[31m" -var/ascii_green = "[ascii_esc]\[32m" -var/ascii_yellow = "[ascii_esc]\[33m" -var/ascii_reset = "[ascii_esc]\[0m" +GLOBAL_VAR_INIT(all_unit_tests_passed, TRUE) +GLOBAL_VAR_INIT(unit_tests_failures, 0) +GLOBAL_VAR_INIT(total_unit_tests, 0) // We list these here so we can remove them from the for loop running this. @@ -75,11 +67,11 @@ ABSTRACT_TYPE(/datum/unit_test) if(LOG_UNIT_TEST_DEBUG) severity = "\[\[ DEBUG \]\] " if(LOG_UNIT_TEST_INFORMATION) - severity = "[ascii_green] *** NOTICE *** [ascii_reset] " + severity = TEST_OUTPUT_GREEN(" *** NOTICE *** ") if(LOG_UNIT_TEST_WARNING) - severity = "[ascii_yellow] === WARNING === [ascii_reset] " + severity = TEST_OUTPUT_YELLOW(" === WARNING === ") if(LOG_UNIT_TEST_ERROR) - severity = "[ascii_red] !!! FAILURE !!! [ascii_reset] " + severity = TEST_OUTPUT_RED(" !!! FAILURE !!! ") #else // We are running off Travis, which means github (or someone fucked up very badly) @@ -122,8 +114,8 @@ ABSTRACT_TYPE(/datum/unit_test) SHOULD_CALL_PARENT(TRUE) SHOULD_NOT_SLEEP(TRUE) - all_unit_tests_passed = FALSE - unit_tests_failures++ + GLOB.all_unit_tests_passed = FALSE + GLOB.unit_tests_failures++ reported = TRUE //If we're running in manual mode, raise an exception so we can see it in VSC directly @@ -136,7 +128,7 @@ ABSTRACT_TYPE(/datum/unit_test) /datum/unit_test/proc/pass(var/message, var/file, var/line) reported = 1 - log_unit_test(LOG_UNIT_TEST_INFORMATION, "[ascii_green][message][ascii_reset]", file, line, title = "SUCCESS: [name]") + log_unit_test(LOG_UNIT_TEST_INFORMATION, TEST_OUTPUT_GREEN("[message]"), file, line, title = "SUCCESS: [name]") return UNIT_TEST_PASSED diff --git a/html/changelogs/example - Copia.yml b/html/changelogs/example - Copia.yml new file mode 100644 index 00000000000..d4e8fc131e3 --- /dev/null +++ b/html/changelogs/example - Copia.yml @@ -0,0 +1,59 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - server: "Removed away_mission deprecated system, made initialization a little faster." + - server: "Made global uplink datum a GLOB." diff --git a/html/changelogs/fluffyghost-moreglobs.yml b/html/changelogs/fluffyghost-moreglobs.yml new file mode 100644 index 00000000000..dd24a4273ac --- /dev/null +++ b/html/changelogs/fluffyghost-moreglobs.yml @@ -0,0 +1,61 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - refactor: "Turned a ton of unmanaged globals into managed globals." + - refactor: "Refactored some UT output." + - rscdel: "Removed some unused things, including vars." + - server: "Added a test to ensure people don't keep adding new unmanaged vars." diff --git a/maps/away/away_site/cult_base/cult_base_ghostroles.dm b/maps/away/away_site/cult_base/cult_base_ghostroles.dm index 2bffb1b8f96..30ba8c787cc 100644 --- a/maps/away/away_site/cult_base/cult_base_ghostroles.dm +++ b/maps/away/away_site/cult_base/cult_base_ghostroles.dm @@ -230,7 +230,7 @@ // make into a cultist if(human.mind) - cult.add_antagonist(human.mind, do_not_equip=TRUE) + GLOB.cult.add_antagonist(human.mind, do_not_equip=TRUE) // add blood if(prob(75)) diff --git a/maps/away_sites_testing/away_sites_testing.dm b/maps/away_sites_testing/away_sites_testing.dm index d6ea954f28f..a6a7969cd25 100644 --- a/maps/away_sites_testing/away_sites_testing.dm +++ b/maps/away_sites_testing/away_sites_testing.dm @@ -62,7 +62,7 @@ // fin - testing("[ascii_green]LOADING AWAY SITE:[ascii_reset] Spawning [away_site] on Z [english_list(GetConnectedZlevels(world.maxz))]") + testing("LOADING AWAY SITE: Spawning [away_site] on Z [english_list(GetConnectedZlevels(world.maxz))]") #else @@ -81,5 +81,5 @@ exoplanet_theme.generate_map(z_index, 1, 1, 254, 254, marker_turf_type) // fin - testing("[ascii_green]LOADING AWAY SITE:[ascii_reset] Spawning [away_site] on Z [english_list(GetConnectedZlevels(world.maxz))]") + testing("LOADING AWAY SITE: Spawning [away_site] on Z [english_list(GetConnectedZlevels(world.maxz))]") #endif diff --git a/maps/exoplanet_testing/exoplanet_testing.dm b/maps/exoplanet_testing/exoplanet_testing.dm index 162268e4e34..98538a313ea 100644 --- a/maps/exoplanet_testing/exoplanet_testing.dm +++ b/maps/exoplanet_testing/exoplanet_testing.dm @@ -70,8 +70,8 @@ for(var/datum/map_template/ruin/exoplanet/ruin as anything in all_ruins) types_fail_list += ruin.type - SSunit_tests_config.UT.fail("**** [ascii_red]FAILED SPAWNING RUINS:[ascii_reset] [sanity_count > 5 ? "EXCEEDED SANITY COUNT" : "NO VALID PLANETS"] \ - for ruins [english_list(types_fail_list)] ****", __FILE__, __LINE__) + SSunit_tests_config.UT.fail(TEST_OUTPUT_RED("**** FAILED SPAWNING RUINS: [sanity_count > 5 ? "EXCEEDED SANITY COUNT" : "NO VALID PLANETS"] \ + for ruins [english_list(types_fail_list)] ****"), __FILE__, __LINE__) break /datum/map/exoplanet_testing/proc/build_exoplanets_for_testing(list/ruins_to_test = list(), list/exoplanet_types = subtypesof(/obj/effect/overmap/visitable/sector/exoplanet)) @@ -108,7 +108,7 @@ if(new_planet.ruin_planet_type & R.planet_types) ruins_to_spawn |= R - testing("[ascii_green]LOADING EXOPLANET:[ascii_reset] Spawning [new_planet.name] on Z [english_list(GetConnectedZlevels(world.maxz))]") + testing(TEST_OUTPUT_GREEN("LOADING EXOPLANET: Spawning [new_planet.name] on Z [english_list(GetConnectedZlevels(world.maxz))]")) testing("With ruins: [english_list(ruins_to_spawn)]") new_planet.build_level_for_testing(ruins_to_spawn) diff --git a/tools/Redirector/Configurations.dm b/tools/Redirector/Configurations.dm deleted file mode 100644 index 022a1e5d4a3..00000000000 --- a/tools/Redirector/Configurations.dm +++ /dev/null @@ -1,53 +0,0 @@ -/* - Written by contributor Doohl for the /tg/station Open Source project, hosted on Google Code. - (2012) - */ - -var/list/config_stream = list() -var/list/servers = list() -var/list/servernames = list() -var/list/adminfiles = list() -var/list/adminkeys = list() - -/proc/gen_configs() - - config_stream = dd_file2list("config.txt") - - var/server_gen = 0 // if the stream is looking for servers - var/admin_gen = 0 // if the stream is looking for admins - for(var/line in config_stream) - - if(line == "\[SERVERS\]") - server_gen = 1 - if(admin_gen) - admin_gen = 0 - - else if(line == "\[ADMINS\]") - admin_gen = 1 - if(server_gen) - server_gen = 0 - - else - if(findtext(line, ".") && !findtext(line, "##")) - if(server_gen) - var/filterline = replacetext(line, " ", "") - var/serverlink = copytext(filterline, findtext( filterline, ")") + 1) - servers.Add(serverlink) - servernames.Add( copytext(line, findtext(line, "("), findtext(line, ")") + 1)) - - else if(admin_gen) - adminfiles.Add(line) - to_world(line) - - - // Generate the list of admins now - - for(var/file in adminfiles) - var/admin_config_stream = dd_file2list(file) - - for(var/line in admin_config_stream) - - var/akey = copytext(line, 1, findtext(line, " ")) - adminkeys.Add(akey) - - diff --git a/tools/Redirector/Redirect_Tgstation.dmb b/tools/Redirector/Redirect_Tgstation.dmb deleted file mode 100644 index 278e723b896..00000000000 Binary files a/tools/Redirector/Redirect_Tgstation.dmb and /dev/null differ diff --git a/tools/Redirector/Redirect_Tgstation.dme b/tools/Redirector/Redirect_Tgstation.dme deleted file mode 100644 index f7d4229bf97..00000000000 --- a/tools/Redirector/Redirect_Tgstation.dme +++ /dev/null @@ -1,21 +0,0 @@ -// DM Environment file for Redirect_Tgstation.dme. -// All manual changes should be made outside the BEGIN_ and END_ blocks. -// New source code should be placed in .dm files: choose File/New --> Code File. - -// BEGIN_INTERNALS -// END_INTERNALS - -// BEGIN_FILE_DIR -#define FILE_DIR . -// END_FILE_DIR - -// BEGIN_PREFERENCES -// END_PREFERENCES - -// BEGIN_INCLUDE -#include "Configurations.dm" -#include "Redirector.dm" -#include "textprocs.dm" -#include "skin.dmf" -// END_INCLUDE - diff --git a/tools/Redirector/Redirector.dm b/tools/Redirector/Redirector.dm deleted file mode 100644 index 38390e87db3..00000000000 --- a/tools/Redirector/Redirector.dm +++ /dev/null @@ -1,87 +0,0 @@ -/* - Written by contributor Doohl for the /tg/station Open Source project, hosted on Google Code. - (2012) - */ - -/* TODO: work on server selection for detected admins */ - - -#define ADMINS 1 -#define PLAYERS 0 - -var/player_weight = 1 // players are more likely to join a server with less players -var/admin_weight = 5 // admins are more likely to join a server with less admins - -var/player_substr = "players=" // search for this substring to locate # of players -var/admin_substr = "admins=" // search for this to locate # of admins - -world - name = "TGstation Redirector" - - New() - ..() - gen_configs() - -/datum/server - var/players = 0 - var/admins = 0 - var/weight = 0 // lower weight is good; highet weight is bad - - var/link = "" - -/mob/LateLogin() - ..() - - var/list/weights = list() - var/list/servers = list() - for(var/x in global.servers) - - to_world("[x] [servernames[ global.servers.Find(x) ]]") - - var/info = world.Export("[x]?status") - var/datum/server/S = new() - S.players = extract(info, PLAYERS) - S.admins = extract(info, ADMINS) - - S.weight += player_weight * S.players - S.link = x - - to_world(S.players) - to_world(S.admins) - - weights.Add(S.weight) - servers.Add(S) - - var/lowest = min(weights) - var/serverlink - for(var/datum/server/S in servers) - if(S.weight == lowest) - serverlink = S.link - - send_link(src, serverlink) - -/proc/extract(var/data, var/type = PLAYERS) - - var/nextpos = 0 - - if(type == PLAYERS) - - nextpos = findtextEx(data, player_substr) - nextpos += length(player_substr) - - else - - nextpos = findtextEx(data, admin_substr) - nextpos += length(admin_substr) - - var/returnval = "" - - for(var/i = 1, i <= 10, i++) - - var/interval = copytext(data, nextpos + (i-1), nextpos + i) - if(interval == "&") - break - else - returnval += interval - - return returnval diff --git a/tools/Redirector/config.txt b/tools/Redirector/config.txt deleted file mode 100644 index 4cf2d6bd79f..00000000000 --- a/tools/Redirector/config.txt +++ /dev/null @@ -1,12 +0,0 @@ -[SERVERS] -## Simply enter a list of servers to poll. Be sure to specify a server name in parentheses. - -(Sibyl #1) byond://game.nanotrasen.com:1337 - -(Sibyl #2) byond://game.nanotrasen.com:2337 - - -[ADMINS] -## Specify some standard Windows filepaths (you may use relative paths) for admin txt lists to poll. - -C:\SS13\config\admins.txt diff --git a/tools/Redirector/skin.dmf b/tools/Redirector/skin.dmf deleted file mode 100644 index 2a3e8a734c4..00000000000 --- a/tools/Redirector/skin.dmf +++ /dev/null @@ -1,149 +0,0 @@ -macro "macro" - elem - name = "North+REP" - command = ".north" - is-disabled = false - elem - name = "South+REP" - command = ".south" - is-disabled = false - elem - name = "East+REP" - command = ".east" - is-disabled = false - elem - name = "West+REP" - command = ".west" - is-disabled = false - elem - name = "Northeast+REP" - command = ".northeast" - is-disabled = false - elem - name = "Northwest+REP" - command = ".northwest" - is-disabled = false - elem - name = "Southeast+REP" - command = ".southeast" - is-disabled = false - elem - name = "Southwest+REP" - command = ".southwest" - is-disabled = false - elem - name = "Center+REP" - command = ".center" - is-disabled = false - - -menu "menu" - elem - name = "&Quit" - command = ".quit" - category = "&File" - is-checked = false - can-check = false - group = "" - is-disabled = false - saved-params = "is-checked" - - -window "window" - elem "window" - type = MAIN - pos = 281,0 - size = 594x231 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #000000 - background-color = #000000 - is-visible = false - is-disabled = false - is-transparent = false - is-default = true - border = none - drop-zone = false - right-click = false - saved-params = "pos;size;is-minimized;is-maximized" - on-size = "" - title = "" - titlebar = true - statusbar = false - can-close = true - can-minimize = true - can-resize = true - is-pane = false - is-minimized = false - is-maximized = false - can-scroll = none - icon = "" - image = "" - image-mode = stretch - keep-aspect = false - transparent-color = none - alpha = 255 - macro = "macro" - menu = "" - on-close = "" - elem "servers" - type = GRID - pos = 8,8 - size = 576x152 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #ffffff - background-color = #000000 - is-visible = true - is-disabled = false - is-transparent = false - is-default = false - border = none - drop-zone = true - right-click = false - saved-params = "" - on-size = "" - cells = 1x1 - current-cell = 1,1 - show-lines = none - small-icons = true - show-names = true - enable-http-images = false - link-color = #0000ff - visited-color = #ff00ff - line-color = #c0c0c0 - style = "" - is-list = false - elem "output1" - type = OUTPUT - pos = 8,168 - size = 576x56 - anchor1 = none - anchor2 = none - font-family = "" - font-size = 0 - font-style = "" - text-color = #ffffff - background-color = #000000 - is-visible = true - is-disabled = false - is-transparent = false - is-default = true - border = none - drop-zone = false - right-click = false - saved-params = "max-lines" - on-size = "" - link-color = #0000ff - visited-color = #ff00ff - style = "" - enable-http-images = false - max-lines = 1000 - image = "" - diff --git a/tools/Redirector/textprocs.dm b/tools/Redirector/textprocs.dm deleted file mode 100644 index 94e1d07603a..00000000000 --- a/tools/Redirector/textprocs.dm +++ /dev/null @@ -1,150 +0,0 @@ -/* - Written by contributor Doohl for the /tg/station Open Source project, hosted on Google Code. - (2012) - - NOTE: The below functions are part of BYOND user Deadron's "TextHandling" library. - [ http://www.byond.com/developer/Deadron/TextHandling ] - */ - - -proc - /////////////////// - // Reading files // - /////////////////// - dd_file2list(file_path, separator = "\n") - var/file - if (isfile(file_path)) - file = file_path - else - file = file(file_path) - return dd_text2list(file2text(file), separator) - - - //////////////////// - // Replacing text // - //////////////////// - dd_replacetext(text, search_string, replacement_string) - // A nice way to do this is to split the text into an array based on the search_string, - // then put it back together into text using replacement_string as the new separator. - var/list/textList = dd_text2list(text, search_string) - return dd_list2text(textList, replacement_string) - - - dd_replaceText(text, search_string, replacement_string) - var/list/textList = dd_text2List(text, search_string) - return dd_list2text(textList, replacement_string) - - - ///////////////////// - // Prefix checking // - ///////////////////// - dd_hasprefix(text, prefix) - var/start = 1 - var/end = length(prefix) + 1 - return findtext(text, prefix, start, end) - - dd_hasPrefix(text, prefix) - var/start = 1 - var/end = length(prefix) + 1 - return findtextEx(text, prefix, start, end) - - - ///////////////////// - // Suffix checking // - ///////////////////// - dd_hassuffix(text, suffix) - var/start = length(text) - length(suffix) - if (start) return findtext(text, suffix, start) - - dd_hasSuffix(text, suffix) - var/start = length(text) - length(suffix) - if (start) return findtextEx(text, suffix, start) - - ///////////////////////////// - // Turning text into lists // - ///////////////////////////// - dd_text2list(text, separator) - var/textlength = length(text) - var/separatorlength = length(separator) - var/list/textList = new /list() - var/searchPosition = 1 - var/findPosition = 1 - var/buggyText - while (1) // Loop forever. - findPosition = findtext(text, separator, searchPosition, 0) - buggyText = copytext(text, searchPosition, findPosition) // Everything from searchPosition to findPosition goes into a list element. - textList += "[buggyText]" // Working around weird problem where "text" != "text" after this copytext(). - - searchPosition = findPosition + separatorlength // Skip over separator. - if (findPosition == 0) // Didn't find anything at end of string so stop here. - return textList - else - if (searchPosition > textlength) // Found separator at very end of string. - textList += "" // So add empty element. - return textList - - dd_text2List(text, separator) - var/textlength = length(text) - var/separatorlength = length(separator) - var/list/textList = new /list() - var/searchPosition = 1 - var/findPosition = 1 - var/buggyText - while (1) // Loop forever. - findPosition = findtextEx(text, separator, searchPosition, 0) - buggyText = copytext(text, searchPosition, findPosition) // Everything from searchPosition to findPosition goes into a list element. - textList += "[buggyText]" // Working around weird problem where "text" != "text" after this copytext(). - - searchPosition = findPosition + separatorlength // Skip over separator. - if (findPosition == 0) // Didn't find anything at end of string so stop here. - return textList - else - if (searchPosition > textlength) // Found separator at very end of string. - textList += "" // So add empty element. - return textList - - dd_list2text(list/the_list, separator) - var/total = the_list.len - if (total == 0) // Nothing to work with. - return - - var/newText = "[the_list[1]]" // Treats any object/number as text also. - var/count - for (count = 2, count <= total, count++) - if (separator) newText += separator - newText += "[the_list[count]]" - return newText - - dd_centertext(message, length) - var/new_message = message - var/size = length(message) - if (size == length) - return new_message - if (size > length) - return copytext(new_message, 1, length + 1) - - // Need to pad text to center it. - var/delta = length - size - if (delta == 1) - // Add one space after it. - return new_message + " " - - // Is this an odd number? If so, add extra space to front. - if (delta % 2) - new_message = " " + new_message - delta-- - - // Divide delta in 2, add those spaces to both ends. - delta = delta / 2 - var/spaces = "" - for (var/count = 1, count <= delta, count++) - spaces += " " - return spaces + new_message + spaces - - dd_limittext(message, length) - // Truncates text to limit if necessary. - var/size = length(message) - if (size <= length) - return message - else - return copytext(message, 1, length + 1) diff --git a/tools/ci/check_grep.sh b/tools/ci/check_grep.sh index c5e629646fe..dd020c2206a 100755 --- a/tools/ci/check_grep.sh +++ b/tools/ci/check_grep.sh @@ -194,6 +194,21 @@ else echo "PASS: All proc signatures are respected in code" >> code_error.log fi +############################################################## +# Use GLOB for anything new, no new unmanaged global vars +############################################################## +echo "Verifying no new unmanaged globals are being added" >> code_error.log + +UNMANAGED_GLOBAL_VARS_REGEXP='^/*var/' +UNMANAGED_GLOBAL_VARS_COUNT=`grep -r -o --include \*.dm -P --regexp=$UNMANAGED_GLOBAL_VARS_REGEXP | wc -l` +if [[ $UNMANAGED_GLOBAL_VARS_COUNT -ne 180 ]]; then # THE COUNT CAN ONLY BE DECREASED, NEVER INCREASED + ERROR_COUNT=$(($ERROR_COUNT+1)) + echo "FAIL: New unmanaged global vars, found $UNMANAGED_GLOBAL_VARS_COUNT of them! Use GLOB or update the count ONLY IF YOU ARE REMOVING THEM!" >> code_error.log + grep -r --include \*.dm -P --regexp=$UNMANAGED_GLOBAL_VARS_REGEXP >> code_error.log +else + echo "PASS: No new unmanaged globals are being added" >> code_error.log +fi + ####################################### # Output the result of the checks