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 += "
| Name | Weight | MinWeight | MaxWeight | OneShot | Enabled | CurrWeight | Remove | |||||||
| [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 += " | ||||||||||
| [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 += "||||||||||
| [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) "||||||||||
| [ckey] - [ban[2]] - (unban) | ||
"
@@ -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 = "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 commandAI-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 | ||