code:
//#define TESTING //By using the testing("message") proc you can create debug-feedback for people with this
								//uncommented, but not visible in the release version)

//#define DATUMVAR_DEBUGGING_MODE //Enables the ability to cache datum vars and retrieve later for debugging which vars changed.

// Comment this out if you are debugging problems that might be obscured by custom error handling in world/Error
#ifdef DEBUG
#define USE_CUSTOM_ERROR_HANDLER
#endif

#ifdef TESTING
#define DATUMVAR_DEBUGGING_MODE

///Used to find the sources of harddels, quite laggy, don't be surpised if it freezes your client for a good while
//#define REFERENCE_TRACKING
#ifdef REFERENCE_TRACKING

///Should we be logging our findings or not
#define REFERENCE_TRACKING_LOG

///Used for doing dry runs of the reference finder, to test for feature completeness
//#define REFERENCE_TRACKING_DEBUG

///Run a lookup on things hard deleting by default.
//#define GC_FAILURE_HARD_LOOKUP
#ifdef GC_FAILURE_HARD_LOOKUP
#define FIND_REF_NO_CHECK_TICK
#endif //ifdef GC_FAILURE_HARD_LOOKUP

#endif //ifdef REFERENCE_TRACKING

/*
* Enables debug messages for every single reaction step. This is 1 message per 0.5s for a SINGLE reaction. Useful for tracking down bugs/asking me for help in the main reaction handiler (equilibrium.dm).
*
* * Requires TESTING to be defined to work.
*/
//#define REAGENTS_TESTING

#define VISUALIZE_ACTIVE_TURFS //Highlights atmos active turfs in green
#define TRACK_MAX_SHARE //Allows max share tracking, for use in the atmos debugging ui
#endif //ifdef TESTING

//#define UNIT_TESTS //If this is uncommented, we do a single run though of the game setup and tear down process with unit tests in between

#ifndef PRELOAD_RSC //set to:
#define PRELOAD_RSC 2 // 0 to allow using external resources or on-demand behaviour;
#endif // 1 to use the default behaviour;
								// 2 for preloading absolutely everything;

#ifdef LOWMEMORYMODE
#define FORCE_MAP "_maps/runtimestation.json"
#endif

//Update this whenever you need to take advantage of more recent byond features
#define MIN_COMPILER_VERSION 514
#define MIN_COMPILER_BUILD 1556
#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM)
//Don't forget to update this part
#error Your version of BYOND is too out-of-date to compile this project. Go to https://secure.byond.com/download and update.
#error You need version 514.1556 or higher
#endif

//Additional code for the above flags.
#ifdef TESTING
#warn compiling in TESTING mode. testing() debug messages will be visible.
#endif

#ifdef CIBUILDING
#define UNIT_TESTS
#endif

#ifdef CITESTING
#define TESTING
#endif

#if defined(UNIT_TESTS)
//Hard del testing defines
#define REFERENCE_TRACKING
#define REFERENCE_TRACKING_DEBUG
#define FIND_REF_NO_CHECK_TICK
#endif

#ifdef TGS
// TGS performs its own build of dm.exe, but includes a prepended TGS define.
#define CBT
#endif

// A reasonable number of maximum overlays an object needs
// If you think you need more, rethink it
#define MAX_ATOM_OVERLAYS 100

#if !defined(CBT) && !defined(SPACEMAN_DMM)
#warn Building with Dream Maker is no longer supported and will result in errors.
#warn In order to build, run BUILD.bat in the root directory.
#warn Consider switching to VSCode editor instead, where you can press Ctrl+Shift+B to build.
#endif


code:
//Datum used to init Auxtools debugging as early as possible
//Datum gets created in master.dm because for whatever reason global code in there gets runs first
//In case we ever figure out how to manipulate global init order please move the datum creation into this file
/datum/debugger

/datum/debugger/New()
		enable_debugger()

/datum/debugger/proc/enable_debugger()
	var/dll = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
	if (dll)
		call(dll, "auxtools_init")()
		enable_debugging()

repo_name: AnalWerewolf/sundown

license: mit


code:
GLOBAL_LIST_EMPTY(stickybanadminexemptions) //stores a list of ckeys exempted from a stickyban (workaround for a bug)
GLOBAL_LIST_EMPTY(stickybanadmintexts) //stores the entire stickyban list temporarily
GLOBAL_VAR(stickbanadminexemptiontimerid) //stores the timerid of the callback that restores all stickybans after an admin joins

/proc/init_smites()
	var/list/smites = list()
	for (var/_smite_path in subtypesof(/datum/smite))
		var/datum/smite/smite_path = _smite_path
		smites[initial(smite_path.name)] = smite_path
	return smites

GLOBAL_LIST_INIT_TYPED(smites, /datum/smite, init_smites())

GLOBAL_VAR_INIT(admin_notice, "") // Admin notice that all clients see when joining the server


code:
GLOBAL_LIST_INIT(bitfields, generate_bitfields())

/// Specifies a bitfield for smarter debugging
/datum/bitfield
	/// The variable name that contains the bitfield
	var/variable

	/// An associative list of the readable flag and its true value
	var/list/flags

/// Turns /datum/bitfield subtypes into a list for use in debugging
/proc/generate_bitfields()
	var/list/bitfields = list()
	for (var/_bitfield in subtypesof(/datum/bitfield))
		var/datum/bitfield/bitfield = new _bitfield
		bitfields[bitfield.variable] = bitfield.flags
	return bitfields

DEFINE_BITFIELD(admin_flags, list(
	"ADMIN" = R_ADMIN,
	"AUTOLOGIN" = R_AUTOADMIN,
	"BAN" = R_BAN,
	"BUILDMODE" = R_BUILD,
	"DBRANKS" = R_DBRANKS,
	"DEBUG" = R_DEBUG,
	"FUN" = R_FUN,
	"PERMISSIONS" = R_PERMISSIONS,
	"POLL" = R_POLL,
	"POSSESS" = R_POSSESS,
	"SERVER" = R_SERVER,
	"SOUNDS" = R_SOUND,
	"SPAWN" = R_SPAWN,
	"STEALTH" = R_STEALTH,
	"VAREDIT" = R_VAREDIT,
))

DEFINE_BITFIELD(appearance_flags, list(
	"KEEP_APART" = KEEP_APART,
	"KEEP_TOGETHER" = KEEP_TOGETHER,
	"LONG_GLIDE" = LONG_GLIDE,
	"NO_CLIENT_COLOR" = NO_CLIENT_COLOR,
	"PIXEL_SCALE" = PIXEL_SCALE,
	"PLANE_MASTER" = PLANE_MASTER,
	"RESET_ALPHA" = RESET_ALPHA,
	"RESET_COLOR" = RESET_COLOR,
	"RESET_TRANSFORM" = RESET_TRANSFORM,
	"TILE_BOUND" = TILE_BOUND,
	"PASS_MOUSE" = PASS_MOUSE,
	"TILE_MOVER" = TILE_MOVER,
))

DEFINE_BITFIELD(area_flags, list(
	"ABDUCTOR_PROOF" = ABDUCTOR_PROOF,
	"BLOBS_ALLOWED" = BLOBS_ALLOWED,
	"BLOCK_SUICIDE" = BLOCK_SUICIDE,
	"CULT_PERMITTED" = CULT_PERMITTED,
	"FLORA_ALLOWED" = FLORA_ALLOWED,
	"HIDDEN_AREA" = HIDDEN_AREA,
	"MEGAFAUNA_SPAWN_ALLOWED" = MEGAFAUNA_SPAWN_ALLOWED,
	"MOB_SPAWN_ALLOWED" = MOB_SPAWN_ALLOWED,
	"NO_ALERTS" = NO_ALERTS,
	"NOTELEPORT" = NOTELEPORT,
	"CAVES_ALLOWED" = CAVES_ALLOWED,
	"UNIQUE_AREA" = UNIQUE_AREA,
	"VALID_TERRITORY" = VALID_TERRITORY,
	"XENOBIOLOGY_COMPATIBLE" = XENOBIOLOGY_COMPATIBLE,
	"NO_ALERTS" = NO_ALERTS,
	"AREA_USES_STARLIGHT" = AREA_USES_STARLIGHT,
	"PERSISTENT_ENGRAVINGS" = PERSISTENT_ENGRAVINGS,
))

DEFINE_BITFIELD(turf_flags, list(
	"NO_LAVA_GEN" = NO_LAVA_GEN,
	"NO_RUINS" = NO_RUINS,
	"NOJAUNT" = NOJAUNT,
	"UNUSED_RESERVATION_TURF" = UNUSED_RESERVATION_TURF,
))

DEFINE_BITFIELD(car_traits, list(
	"CAN_KIDNAP" = CAN_KIDNAP,
))

DEFINE_BITFIELD(clothing_flags, list(
	"ANTI_TINFOIL_MANEUVER" = ANTI_TINFOIL_MANEUVER,
	"BLOCKS_SHOVE_KNOCKDOWN" = BLOCKS_SHOVE_KNOCKDOWN,
	"BLOCKS_SPEECH" = BLOCKS_SPEECH,
	"BLOCK_GAS_SMOKE_EFFECT" = BLOCK_GAS_SMOKE_EFFECT,
	"GAS_FILTERING" = GAS_FILTERING,
	"LAVAPROTECT" = LAVAPROTECT,
	"MASKINTERNALS" = MASKINTERNALS,
	"NOSLIP" = NOSLIP,
	"SCAN_REAGENTS" = SCAN_REAGENTS,
	"SNUG_FIT" = SNUG_FIT,
	"STOPSPRESSUREDAMAGE" = STOPSPRESSUREDAMAGE,
	"THICKMATERIAL" = THICKMATERIAL,
	"VOICEBOX_DISABLED" = VOICEBOX_DISABLED,
	"VOICEBOX_TOGGLABLE" = VOICEBOX_TOGGLABLE,
))

DEFINE_BITFIELD(datum_flags, list(
	"DF_ISPROCESSING" = DF_ISPROCESSING,
	"DF_VAR_EDITED" = DF_VAR_EDITED,
	"DF_USE_TAG" = DF_USE_TAG,
))

DEFINE_BITFIELD(disease_flags, list(
	"CAN_CARRY" = CAN_CARRY,
	"CAN_RESIST" = CAN_RESIST,
	"CURABLE" = CURABLE,
))

DEFINE_BITFIELD(flags_1, list(
	"ADMIN_SPAWNED_1" = ADMIN_SPAWNED_1,
	"ALLOW_DARK_PAINTS_1" = ALLOW_DARK_PAINTS_1,
	"ATMOS_IS_PROCESSING_1" = ATMOS_IS_PROCESSING_1,
	"CAN_BE_DIRTY_1" = CAN_BE_DIRTY_1,
	"CONDUCT_1" = CONDUCT_1,
	"HOLOGRAM_1" = HOLOGRAM_1,
	"INITIALIZED_1" = INITIALIZED_1,
	"IS_ONTOP_1" = IS_ONTOP_1,
	"IS_SPINNING_1" = IS_SPINNING_1,
	"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
	"NODECONSTRUCT_1" = NODECONSTRUCT_1,
	"ON_BORDER_1" = ON_BORDER_1,
	"OVERLAY_QUEUED_1" = OVERLAY_QUEUED_1,
	"PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1,
	"PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1,
	"RAD_NO_CONTAMINATE_1" = RAD_NO_CONTAMINATE_1,
	"RAD_PROTECT_CONTENTS_1" = RAD_PROTECT_CONTENTS_1,
	"SHOCKED_1" = SHOCKED_1,
	"SUPERMATTER_IGNORES_1" = SUPERMATTER_IGNORES_1,
	"UNPAINTABLE_1" = UNPAINTABLE_1,
	"IS_PLAYER_COLORABLE_1" = IS_PLAYER_COLORABLE_1,
))

DEFINE_BITFIELD(flags_ricochet, list(
	"RICOCHET_HARD" = RICOCHET_HARD,
	"RICOCHET_SHINY" = RICOCHET_SHINY,
))

DEFINE_BITFIELD(interaction_flags_atom, list(
	"INTERACT_ATOM_ATTACK_HAND" = INTERACT_ATOM_ATTACK_HAND,
	"INTERACT_ATOM_CHECK_GRAB" = INTERACT_ATOM_CHECK_GRAB,
	"INTERACT_ATOM_IGNORE_INCAPACITATED" = INTERACT_ATOM_IGNORE_INCAPACITATED,
	"INTERACT_ATOM_IGNORE_RESTRAINED" = INTERACT_ATOM_IGNORE_RESTRAINED,
	"INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND" = INTERACT_ATOM_NO_FINGERPRINT_ATTACK_HAND,
	"INTERACT_ATOM_NO_FINGERPRINT_INTERACT" = INTERACT_ATOM_NO_FINGERPRINT_INTERACT,
	"INTERACT_ATOM_REQUIRES_ANCHORED" = INTERACT_ATOM_REQUIRES_ANCHORED,
	"INTERACT_ATOM_REQUIRES_DEXTERITY" = INTERACT_ATOM_REQUIRES_DEXTERITY,
	"INTERACT_ATOM_UI_INTERACT" = INTERACT_ATOM_UI_INTERACT,
))

DEFINE_BITFIELD(interaction_flags_machine, list(
	"INTERACT_MACHINE_ALLOW_SILICON" = INTERACT_MACHINE_ALLOW_SILICON,
	"INTERACT_MACHINE_OFFLINE" = INTERACT_MACHINE_OFFLINE,
	"INTERACT_MACHINE_OPEN" = INTERACT_MACHINE_OPEN,
	"INTERACT_MACHINE_OPEN_SILICON" = INTERACT_MACHINE_OPEN_SILICON,
	"INTERACT_MACHINE_REQUIRES_SIGHT" = INTERACT_MACHINE_REQUIRES_SIGHT,
	"INTERACT_MACHINE_REQUIRES_SILICON" = INTERACT_MACHINE_REQUIRES_SILICON,
	"INTERACT_MACHINE_SET_MACHINE" = INTERACT_MACHINE_SET_MACHINE,
	"INTERACT_MACHINE_WIRES_IF_OPEN" = INTERACT_MACHINE_WIRES_IF_OPEN,
))

DEFINE_BITFIELD(interaction_flags_item, list(
	"INTERACT_ITEM_ATTACK_HAND_PICKUP" = INTERACT_ITEM_ATTACK_HAND_PICKUP,
))

DEFINE_BITFIELD(item_flags, list(
	"ABSTRACT" = ABSTRACT,
	"BEING_REMOVED" = BEING_REMOVED,
	"DROPDEL" = DROPDEL,
	"EXAMINE_SKIP" = EXAMINE_SKIP,
	"FORCE_STRING_OVERRIDE" = FORCE_STRING_OVERRIDE,
	"HAND_ITEM" = HAND_ITEM,
	"IN_INVENTORY" = IN_INVENTORY,
	"IN_STORAGE" = IN_STORAGE,
	"IMMUTABLE_SLOW" = IMMUTABLE_SLOW,
	"NEEDS_PERMIT" = NEEDS_PERMIT,
	"NOBLUDGEON" = NOBLUDGEON,
	"NO_MAT_REDEMPTION" = NO_MAT_REDEMPTION,
	"SLOWS_WHILE_IN_HAND" = SLOWS_WHILE_IN_HAND,
	"SURGICAL_TOOL" = SURGICAL_TOOL,
	"XENOMORPH_HOLDABLE" = XENOMORPH_HOLDABLE,
	"NO_PIXEL_RANDOM_DROP" = NO_PIXEL_RANDOM_DROP,
))

DEFINE_BITFIELD(machine_stat, list(
	"BROKEN" = BROKEN,
	"EMPED" = EMPED,
	"MAINT" = MAINT,
	"NOPOWER" = NOPOWER,
))

DEFINE_BITFIELD(mat_container_flags, list(
	"MATCONTAINER_EXAMINE" = MATCONTAINER_EXAMINE,
	"MATCONTAINER_NO_INSERT" = MATCONTAINER_NO_INSERT,
	"MATCONTAINER_ANY_INTENT" = MATCONTAINER_ANY_INTENT,
	"MATCONTAINER_SILENT" = MATCONTAINER_SILENT,
	"BREAKDOWN_ALLOYS" = BREAKDOWN_ALLOYS,
))

DEFINE_BITFIELD(internal_damage, list(
	"MECHA_INT_FIRE" = MECHA_INT_FIRE,
	"MECHA_INT_TEMP_CONTROL" = MECHA_INT_TEMP_CONTROL,
	"MECHA_INT_TANK_BREACH" = MECHA_INT_TANK_BREACH,
	"MECHA_INT_CONTROL_LOST" = MECHA_INT_CONTROL_LOST,
))

DEFINE_BITFIELD(mecha_flags, list(
	"ADDING_ACCESS_POSSIBLE" = ADDING_ACCESS_POSSIBLE,
	"ADDING_MAINT_ACCESS_POSSIBLE" = ADDING_MAINT_ACCESS_POSSIBLE,
	"CANSTRAFE" = CANSTRAFE,
	"LIGHTS_ON" = LIGHTS_ON,
	"SILICON_PILOT" = SILICON_PILOT,
	"IS_ENCLOSED" = IS_ENCLOSED,
	"HAS_LIGHTS" = HAS_LIGHTS,
))

DEFINE_BITFIELD(mob_biotypes, list(
	"MOB_BEAST" = MOB_BEAST,
	"MOB_BUG" = MOB_BUG,
	"MOB_EPIC" = MOB_EPIC,
	"MOB_HUMANOID" = MOB_HUMANOID,
	"MOB_MINERAL" = MOB_MINERAL,
	"MOB_ORGANIC" = MOB_ORGANIC,
	"MOB_REPTILE" = MOB_REPTILE,
	"MOB_ROBOTIC" = MOB_ROBOTIC,
	"MOB_SPIRIT" = MOB_SPIRIT,
	"MOB_UNDEAD" = MOB_UNDEAD,
	"MOB_PLANT" = MOB_PLANT
))

DEFINE_BITFIELD(mobility_flags, list(
	"MOVE" = MOBILITY_MOVE,
	"PICKUP" = MOBILITY_PICKUP,
	"PULL" = MOBILITY_PULL,
	"STAND" = MOBILITY_STAND,
	"STORAGE" = MOBILITY_STORAGE,
	"UI" = MOBILITY_UI,
	"USE" = MOBILITY_USE,
))

DEFINE_BITFIELD(movement_type, list(
	"FLOATING" = FLOATING,
	"FLYING" = FLYING,
	"GROUND" = GROUND,
	"PHASING" = PHASING,
	"VENTCRAWLING" = VENTCRAWLING,
))

DEFINE_BITFIELD(obj_flags, list(
	"BEING_SHOCKED" = BEING_SHOCKED,
	"BLOCK_Z_IN_DOWN" = BLOCK_Z_IN_DOWN,
	"BLOCK_Z_IN_UP" = BLOCK_Z_IN_UP,
	"BLOCK_Z_OUT_DOWN" = BLOCK_Z_OUT_DOWN,
	"BLOCK_Z_OUT_UP" = BLOCK_Z_OUT_UP,
	"CAN_BE_HIT" = CAN_BE_HIT,
	"DANGEROUS_POSSESSION" = DANGEROUS_POSSESSION,
	"EMAGGED" = EMAGGED,
	"FROZEN" = FROZEN,
	"IN_USE" = IN_USE,
	"NO_BUILD" = NO_BUILD,
	"ON_BLUEPRINTS" = ON_BLUEPRINTS,
	"UNIQUE_RENAME" = UNIQUE_RENAME,
	"USES_TGUI" = USES_TGUI,
))

DEFINE_BITFIELD(pass_flags, list(
	"LETPASSTHROW" = LETPASSTHROW,
	"PASSBLOB" = PASSBLOB,
	"PASSCLOSEDTURF" = PASSCLOSEDTURF,
	"PASSGLASS" = PASSGLASS,
	"PASSGRILLE" = PASSGRILLE,
	"PASSMOB" = PASSMOB,
	"PASSTABLE" = PASSTABLE,
))

DEFINE_BITFIELD(resistance_flags, list(
	"LAVA_PROOF" = LAVA_PROOF,
	"FIRE_PROOF" = FIRE_PROOF,
	"FLAMMABLE" = FLAMMABLE,
	"ON_FIRE" = ON_FIRE,
	"UNACIDABLE" = UNACIDABLE,
	"ACID_PROOF" = ACID_PROOF,
	"INDESTRUCTIBLE" = INDESTRUCTIBLE,
	"FREEZE_PROOF" = FREEZE_PROOF
))

DEFINE_BITFIELD(sight, list(
	"BLIND" = BLIND,
	"SEE_BLACKNESS" = SEE_BLACKNESS,
	"SEE_INFRA" = SEE_INFRA,
	"SEE_MOBS" = SEE_MOBS,
	"SEE_OBJS" = SEE_OBJS,
	"SEE_PIXELS" = SEE_PIXELS,
	"SEE_SELF" = SEE_SELF,
	"SEE_THRU" = SEE_THRU,
	"SEE_TURFS" = SEE_TURFS,
))

DEFINE_BITFIELD(vis_flags, list(
	"VIS_HIDE" = VIS_HIDE,
	"VIS_INHERIT_DIR" = VIS_INHERIT_DIR,
	"VIS_INHERIT_ICON" = VIS_INHERIT_ICON,
	"VIS_INHERIT_ICON_STATE" = VIS_INHERIT_ICON_STATE,
	"VIS_INHERIT_ID" = VIS_INHERIT_ID,
	"VIS_INHERIT_LAYER" = VIS_INHERIT_LAYER,
	"VIS_INHERIT_PLANE" = VIS_INHERIT_PLANE,
	"VIS_UNDERLAY" = VIS_UNDERLAY,
))

DEFINE_BITFIELD(zap_flags, list(
	"ZAP_ALLOW_DUPLICATES" = ZAP_ALLOW_DUPLICATES,
	"ZAP_MACHINE_EXPLOSIVE" = ZAP_MACHINE_EXPLOSIVE,
	"ZAP_MOB_DAMAGE" = ZAP_MOB_DAMAGE,
	"ZAP_MOB_STUN" = ZAP_MOB_STUN,
	"ZAP_OBJ_DAMAGE" = ZAP_OBJ_DAMAGE,
	"ZAP_GENERATES_POWER" = ZAP_GENERATES_POWER,
))

DEFINE_BITFIELD(chemical_flags, list(
	"REAGENT_DEAD_PROCESS" = REAGENT_DEAD_PROCESS,
	"REAGENT_DONOTSPLIT" = REAGENT_DONOTSPLIT,
	"REAGENT_INVISIBLE" = REAGENT_INVISIBLE,
	"REAGENT_SNEAKYNAME" = REAGENT_SNEAKYNAME,
	"REAGENT_SPLITRETAINVOL" = REAGENT_SPLITRETAINVOL,
	"REAGENT_CAN_BE_SYNTHESIZED" = REAGENT_CAN_BE_SYNTHESIZED,
))

DEFINE_BITFIELD(reaction_flags, list(
	"REACTION_CLEAR_IMPURE"  = REACTION_CLEAR_IMPURE,
	"REACTION_CLEAR_INVERSE" = REACTION_CLEAR_INVERSE,
	"REACTION_CLEAR_RETAIN" = REACTION_CLEAR_RETAIN,
	"REACTION_INSTANT" = REACTION_INSTANT,
	"REACTION_HEAT_ARBITARY" = REACTION_HEAT_ARBITARY,
	"REACTION_COMPETITIVE" = REACTION_COMPETITIVE,
	"REACTION_PH_VOL_CONSTANT" = REACTION_PH_VOL_CONSTANT,
	"REACTION_REAL_TIME_SPLIT" = REACTION_REAL_TIME_SPLIT,
))


code:
GLOBAL_REAL(config, /datum/controller/configuration)

GLOBAL_DATUM(revdata, /datum/getrev)

GLOBAL_VAR(host)
GLOBAL_VAR(station_name)
GLOBAL_VAR_INIT(game_version, "/tg/Station 13")
GLOBAL_VAR_INIT(changelog_hash, "")
GLOBAL_VAR_INIT(hub_visibility, FALSE)

GLOBAL_VAR_INIT(ooc_allowed, TRUE) // used with admin verbs to disable ooc - not a config option apparently
GLOBAL_VAR_INIT(dooc_allowed, TRUE)
GLOBAL_VAR_INIT(enter_allowed, TRUE)
GLOBAL_VAR_INIT(shuttle_frozen, FALSE)
GLOBAL_VAR_INIT(shuttle_left, FALSE)
GLOBAL_VAR_INIT(tinted_weldhelh, TRUE)

// Debug is used exactly once (in living.dm) but is commented out in a lot of places.  It is not set anywhere and only checked.
// Debug2 is used in conjunction with a lot of admin verbs and therefore is actually legit.
GLOBAL_VAR_INIT(Debug, FALSE) // global debug switch
GLOBAL_VAR_INIT(Debug2, FALSE)

//This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage
//Protecting these because the proper way to edit them is with the config/secrets
GLOBAL_VAR_INIT(MAX_EX_DEVESTATION_RANGE, 3)
GLOBAL_PROTECT(MAX_EX_DEVESTATION_RANGE)
GLOBAL_VAR_INIT(MAX_EX_HEAVY_RANGE, 7)
GLOBAL_PROTECT(MAX_EX_HEAVY_RANGE)
GLOBAL_VAR_INIT(MAX_EX_LIGHT_RANGE, 14)
GLOBAL_PROTECT(MAX_EX_LIGHT_RANGE)
GLOBAL_VAR_INIT(MAX_EX_FLASH_RANGE, 14)
GLOBAL_PROTECT(MAX_EX_FLASH_RANGE)
GLOBAL_VAR_INIT(MAX_EX_FLAME_RANGE, 14)
GLOBAL_PROTECT(MAX_EX_FLAME_RANGE)
GLOBAL_VAR_INIT(DYN_EX_SCALE, 0.5)


code:
GLOBAL_VAR(common_report) //Contains common part of roundend report
GLOBAL_VAR(survivor_report) //Contains shared survivor report for roundend report (part of personal report)

GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name
GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report

//TODO clear this one up too
GLOBAL_DATUM(cult_narsie, /obj/narsie)

///We want reality_smash_tracker to exist only once and be accessible from anywhere.
GLOBAL_DATUM_INIT(reality_smash_track, /datum/reality_smash_tracker, new)


code:
//faster than having to constantly loop for them
GLOBAL_LIST_EMPTY_TYPED(all_mutations, /datum/mutation/human) //type = initialized mutation
GLOBAL_LIST_EMPTY(full_sequences) //type = correct sequence
GLOBAL_LIST_EMPTY(bad_mutations) //bad initialized mutations
GLOBAL_LIST_EMPTY(good_mutations) //good initialized mutations
GLOBAL_LIST_EMPTY(not_good_mutations) //neutral initialized mutations
GLOBAL_LIST_EMPTY(alias_mutations) //alias = type

GLOBAL_LIST_EMPTY(mutation_recipes)


code:
GLOBAL_LIST_INIT(generic_ambience,list(
	'sound/ambience/ambigen1.ogg', 'sound/ambience/ambigen3.ogg',
	'sound/ambience/ambigen4.ogg', 'sound/ambience/ambigen5.ogg',
	'sound/ambience/ambigen6.ogg', 'sound/ambience/ambigen7.ogg',
	'sound/ambience/ambigen8.ogg', 'sound/ambience/ambigen9.ogg',
	'sound/ambience/ambigen10.ogg', 'sound/ambience/ambigen11.ogg',
	'sound/ambience/ambigen12.ogg', 'sound/ambience/ambigen14.ogg',
	'sound/ambience/ambigen15.ogg'))

GLOBAL_LIST_INIT(holy_ambience,list(
	'sound/ambience/ambicha1.ogg', 'sound/ambience/ambicha2.ogg',
	'sound/ambience/ambicha3.ogg', 'sound/ambience/ambicha4.ogg',
	'sound/ambience/ambiholy.ogg', 'sound/ambience/ambiholy2.ogg',
	'sound/ambience/ambiholy3.ogg'))

GLOBAL_LIST_INIT(danger_ambience,list(
	'sound/ambience/ambidanger.ogg', 'sound/ambience/ambidanger2.ogg'))

GLOBAL_LIST_INIT(ruins_ambience,list(
	'sound/ambience/ambimine.ogg', 'sound/ambience/ambicave.ogg',
	'sound/ambience/ambiruin.ogg', 'sound/ambience/ambiruin2.ogg',
	'sound/ambience/ambiruin3.ogg', 'sound/ambience/ambiruin4.ogg',
	'sound/ambience/ambiruin5.ogg', 'sound/ambience/ambiruin6.ogg',
	'sound/ambience/ambiruin7.ogg', 'sound/ambience/ambidanger.ogg',
	'sound/ambience/ambidanger2.ogg', 'sound/ambience/ambitech3.ogg',
	'sound/ambience/ambimystery.ogg', 'sound/ambience/ambimaint1.ogg'))

GLOBAL_LIST_INIT(engi_ambience,list(
	'sound/ambience/ambisin1.ogg', 'sound/ambience/ambisin2.ogg',
	'sound/ambience/ambisin3.ogg', 'sound/ambience/ambisin4.ogg',
	'sound/ambience/ambiatmos.ogg', 'sound/ambience/ambiatmos2.ogg',
	'sound/ambience/ambitech.ogg', 'sound/ambience/ambitech2.ogg',
	'sound/ambience/ambitech3.ogg'))

GLOBAL_LIST_INIT(mining_ambience,list(
	'sound/ambience/ambimine.ogg', 'sound/ambience/ambicave.ogg',
	'sound/ambience/ambiruin.ogg', 'sound/ambience/ambiruin2.ogg',
	'sound/ambience/ambiruin3.ogg', 'sound/ambience/ambiruin4.ogg',
	'sound/ambience/ambiruin5.ogg', 'sound/ambience/ambiruin6.ogg',
	'sound/ambience/ambiruin7.ogg', 'sound/ambience/ambidanger.ogg',
	'sound/ambience/ambidanger2.ogg', 'sound/ambience/ambimaint1.ogg',
	'sound/ambience/ambilava1.ogg', 'sound/ambience/ambilava2.ogg',
	'sound/ambience/ambilava3.ogg'))

GLOBAL_LIST_INIT(medical_ambience,list('sound/ambience/ambinice.ogg'))

GLOBAL_LIST_INIT(spooky_ambience,list(
	'sound/ambience/ambimo1.ogg', 'sound/ambience/ambimo2.ogg',
	'sound/ambience/ambiruin7.ogg', 'sound/ambience/ambiruin6.ogg',
	'sound/ambience/ambiodd.ogg', 'sound/ambience/ambimystery.ogg'))

GLOBAL_LIST_INIT(space_ambience,list(
	'sound/ambience/ambispace.ogg', 'sound/ambience/ambispace2.ogg', 'sound/ambience/title2.ogg',
	'sound/ambience/ambispace3.ogg', 'sound/ambience/ambiatmos.ogg'))

GLOBAL_LIST_INIT(maint_ambience,list(
	'sound/ambience/ambimaint1.ogg', 'sound/ambience/ambimaint2.ogg',
	'sound/ambience/ambimaint3.ogg', 'sound/ambience/ambimaint4.ogg',
	'sound/ambience/ambimaint5.ogg', 'sound/voice/lowHiss2.ogg',
	'sound/voice/lowHiss3.ogg', 'sound/voice/lowHiss4.ogg',
	'sound/ambience/ambitech2.ogg'))

GLOBAL_LIST_INIT(away_ambience,list(
	'sound/ambience/ambitech.ogg', 'sound/ambience/ambitech2.ogg',
	'sound/ambience/ambiruin.ogg', 'sound/ambience/ambiruin2.ogg',
	'sound/ambience/ambiruin3.ogg', 'sound/ambience/ambiruin4.ogg',
	'sound/ambience/ambiruin5.ogg', 'sound/ambience/ambiruin6.ogg',
	'sound/ambience/ambiruin7.ogg', 'sound/ambience/ambidanger.ogg',
	'sound/ambience/ambidanger2.ogg', 'sound/ambience/ambimaint.ogg',
	'sound/ambience/ambiatmos.ogg', 'sound/ambience/ambiatmos2.ogg',
	'sound/ambience/ambiodd.ogg'))

GLOBAL_LIST_INIT(reebe_ambience,list('sound/ambience/ambireebe1.ogg', 'sound/ambience/ambireebe2.ogg', 'sound/ambience/ambireebe3.ogg'))

GLOBAL_LIST_INIT(creepy_ambience,list(
	'sound/effects/ghost.ogg', 'sound/effects/ghost2.ogg',
	'sound/effects/heart_beat.ogg', 'sound/effects/screech.ogg',
	'sound/hallucinations/behind_you1.ogg', 'sound/hallucinations/behind_you2.ogg',
	'sound/hallucinations/far_noise.ogg', 'sound/hallucinations/growl1.ogg',
	'sound/hallucinations/growl2.ogg', 'sound/hallucinations/growl3.ogg',
	'sound/hallucinations/im_here1.ogg', 'sound/hallucinations/im_here2.ogg',
	'sound/hallucinations/i_see_you1.ogg', 'sound/hallucinations/i_see_you2.ogg',
	'sound/hallucinations/look_up1.ogg', 'sound/hallucinations/look_up2.ogg',
	'sound/hallucinations/over_here1.ogg', 'sound/hallucinations/over_here2.ogg',
	'sound/hallucinations/over_here3.ogg', 'sound/hallucinations/turn_around1.ogg',
	'sound/hallucinations/turn_around2.ogg', 'sound/hallucinations/veryfar_noise.ogg',
	'sound/hallucinations/wail.ogg'))

GLOBAL_LIST_INIT(ambience_assoc,list(
	AMBIENCE_GENERIC = GLOB.generic_ambience,
	AMBIENCE_HOLY = GLOB.holy_ambience,
	AMBIENCE_DANGER = GLOB.danger_ambience,
	AMBIENCE_RUINS = GLOB.ruins_ambience,
	AMBIENCE_ENGI = GLOB.engi_ambience,
	AMBIENCE_MINING = GLOB.mining_ambience,
	AMBIENCE_MEDICAL = GLOB.medical_ambience,
	AMBIENCE_SPOOKY = GLOB.spooky_ambience,
	AMBIENCE_SPACE = GLOB.space_ambience,
	AMBIENCE_MAINT = GLOB.maint_ambience,
	AMBIENCE_AWAY = GLOB.away_ambience,
	AMBIENCE_REEBE = GLOB.reebe_ambience,
	AMBIENCE_CREEPY = GLOB.creepy_ambience))


code: GLOBAL_LIST_INIT(contrast_colors, list(COLOR_RED, COLOR_VIOLET, COLOR_DARK_CYAN, COLOR_TAN_ORANGE, COLOR_BLACK))


code:
//Preferences stuff
	//Hairstyles
GLOBAL_LIST_EMPTY(hairstyles_list) //stores /datum/sprite_accessory/hair indexed by name
GLOBAL_LIST_EMPTY(hairstyles_male_list) //stores only hair names
GLOBAL_LIST_EMPTY(hairstyles_female_list) //stores only hair names
GLOBAL_LIST_EMPTY(facial_hairstyles_list) //stores /datum/sprite_accessory/facial_hair indexed by name
GLOBAL_LIST_EMPTY(facial_hairstyles_male_list) //stores only hair names
GLOBAL_LIST_EMPTY(facial_hairstyles_female_list) //stores only hair names
GLOBAL_LIST_EMPTY(hair_gradients_list) //stores /datum/sprite_accessory/hair_gradient indexed by name
	//Underwear
GLOBAL_LIST_EMPTY(underwear_list) //stores /datum/sprite_accessory/underwear indexed by name
GLOBAL_LIST_EMPTY(underwear_m) //stores only underwear name
GLOBAL_LIST_EMPTY(underwear_f) //stores only underwear name
	//Undershirts
GLOBAL_LIST_EMPTY(undershirt_list) //stores /datum/sprite_accessory/undershirt indexed by name
GLOBAL_LIST_EMPTY(undershirt_m)  //stores only undershirt name
GLOBAL_LIST_EMPTY(undershirt_f)  //stores only undershirt name
	//Socks
GLOBAL_LIST_EMPTY(socks_list) //stores /datum/sprite_accessory/socks indexed by name
	//Lizard Bits (all datum lists indexed by name)
GLOBAL_LIST_EMPTY(body_markings_list)
GLOBAL_LIST_EMPTY(tails_list_lizard)
GLOBAL_LIST_EMPTY(animated_tails_list_lizard)
GLOBAL_LIST_EMPTY(snouts_list)
GLOBAL_LIST_EMPTY(horns_list)
GLOBAL_LIST_EMPTY(frills_list)
GLOBAL_LIST_EMPTY(spines_list)
GLOBAL_LIST_EMPTY(legs_list)
GLOBAL_LIST_EMPTY(animated_spines_list)

	//Mutant Human bits
GLOBAL_LIST_EMPTY(tails_list_human)
GLOBAL_LIST_EMPTY(animated_tails_list_human)
GLOBAL_LIST_EMPTY(ears_list)
GLOBAL_LIST_EMPTY(wings_list)
GLOBAL_LIST_EMPTY(wings_open_list)
GLOBAL_LIST_EMPTY(moth_wings_list)
GLOBAL_LIST_EMPTY(moth_antennae_list)
GLOBAL_LIST_EMPTY(moth_markings_list)
GLOBAL_LIST_EMPTY(caps_list)
GLOBAL_LIST_EMPTY(tails_list_monkey)

GLOBAL_LIST_INIT(color_list_ethereal, list(
	"Red" = "#ff4d4d",
	"Faint Red" = "#ffb3b3",
	"Dark Red" = "#9c3030",
	"Orange" = "#ffa64d",
	"Burnt Orange" = "#cc4400",
	"Bright Yellow" = "#ffff99",
	"Dull Yellow" = "#fbdf56",
	"Faint Green" = "#ddff99",
	"Green" = "#97ee63",
	"Seafoam Green" = "#00fa9a",
	"Dark Green" = "#37835b",
	"Cyan Blue" = "#00ffff",
	"Faint Blue" = "#b3d9ff",
	"Blue" = "#3399ff",
	"Dark Blue" = "#6666ff",
	"Purple" = "#ee82ee",
	"Dark Fuschia" = "#cc0066",
	"Pink" = "#ff99cc",
	"White" = "#f2f2f2",))

GLOBAL_LIST_INIT(ghost_forms_with_directions_list, list(
	"ghost",
	"ghostian",
	"ghostian2",
	"ghostking",
	"ghost_red",
	"ghost_black",
	"ghost_blue",
	"ghost_yellow",
	"ghost_green",
	"ghost_pink",
	"ghost_cyan",
	"ghost_dblue",
	"ghost_dred",
	"ghost_dgreen",
	"ghost_dcyan",
	"ghost_grey",
	"ghost_dyellow",
	"ghost_dpink",
	"skeleghost",
	"ghost_purpleswirl",
	"ghost_rainbow",
	"ghost_fire",
	"ghost_funkypurp",
	"ghost_pinksherbert",
	"ghost_blazeit",
	"ghost_mellow",
	"ghost_camo",
	"catghost")) //stores the ghost forms that support directional sprites

GLOBAL_LIST_INIT(ghost_forms_with_accessories_list, list(
	"ghost",
	"ghost_red",
	"ghost_black",
	"ghost_blue",
	"ghost_yellow",
	"ghost_green",
	"ghost_pink",
	"ghost_cyan",
	"ghost_dblue",
	"ghost_dred",
	"ghost_dgreen",
	"ghost_dcyan",
	"ghost_grey",
	"ghost_dyellow",
	"ghost_dpink",
	"skeleghost",
	"ghost_purpleswirl",
	"ghost_rainbow",
	"ghost_fire",
	"ghost_funkypurp",
	"ghost_pinksherbert",
	"ghost_blazeit",
	"ghost_mellow",
	"ghost_camo",))
	//stores the ghost forms that support hair and other such things

GLOBAL_LIST_INIT(ai_core_display_screens, sort_list(list(
	":thinking:",
	"Alien",
	"Angel",
	"Banned",
	"Bliss",
	"Blue",
	"Clown",
	"Database",
	"Dorf",
	"Firewall",
	"Fuzzy",
	"Gentoo",
	"Glitchman",
	"Gondola",
	"Goon",
	"Hades",
	"HAL 9000",
	"Heartline",
	"Helios",
	"House",
	"Inverted",
	"Matrix",
	"Monochrome",
	"Murica",
	"Nanotrasen",
	"Not Malf",
	"Portrait",
	"President",
	"Random",
	"Rainbow",
	"Red",
	"Red October",
	"Static",
	"Syndicat Meow",
	"Text",
	"Too Deep",
	"Triumvirate",
	"Triumvirate-M",
	"Weird")))

/// A form of resolve_ai_icon that is guaranteed to never sleep.
/// Not always accurate, but always synchronous.
/proc/resolve_ai_icon_sync(input)
	SHOULD_NOT_SLEEP(TRUE)

	if(!input || !(input in GLOB.ai_core_display_screens))
		return "ai"
	else
		if(input == "Random")
			input = pick(GLOB.ai_core_display_screens - "Random")
		return "ai-[lowertext(input)]"

/proc/resolve_ai_icon(input)
	if (input == "Portrait")
		var/datum/portrait_picker/tgui = new(usr)//create the datum
		tgui.ui_interact(usr)//datum has a tgui component, here we open the window
		return "ai-portrait" //just take this until they decide

	return resolve_ai_icon_sync(input)

GLOBAL_LIST_INIT(security_depts_prefs, sort_list(list(
	SEC_DEPT_NONE,
	SEC_DEPT_ENGINEERING,
	SEC_DEPT_MEDICAL,
	SEC_DEPT_SCIENCE,
	SEC_DEPT_SUPPLY,
)))

	//Backpacks
#define GBACKPACK "Grey Backpack"
#define GSATCHEL "Grey Satchel"
#define GDUFFELBAG "Grey Duffel Bag"
#define LSATCHEL "Leather Satchel"
#define DBACKPACK "Department Backpack"
#define DSATCHEL "Department Satchel"
#define DDUFFELBAG "Department Duffel Bag"
GLOBAL_LIST_INIT(backpacklist, list(DBACKPACK, DSATCHEL, DDUFFELBAG, GBACKPACK, GSATCHEL, GDUFFELBAG, LSATCHEL))

	//Suit/Skirt
#define PREF_SUIT "Jumpsuit"
#define PREF_SKIRT "Jumpskirt"

//Uplink spawn loc
#define UPLINK_PDA "PDA"
#define UPLINK_RADIO "Radio"
#define UPLINK_PEN "Pen" //like a real spy!
#define UPLINK_IMPLANT "Implant"

	//Female Uniforms
GLOBAL_LIST_EMPTY(female_clothing_icons)

GLOBAL_LIST_INIT(scarySounds, list('sound/weapons/thudswoosh.ogg','sound/weapons/taser.ogg','sound/weapons/armbomb.ogg','sound/voice/hiss1.ogg','sound/voice/hiss2.ogg','sound/voice/hiss3.ogg','sound/voice/hiss4.ogg','sound/voice/hiss5.ogg','sound/voice/hiss6.ogg','sound/effects/glassbr1.ogg','sound/effects/glassbr2.ogg','sound/effects/glassbr3.ogg','sound/items/welder.ogg','sound/items/welder2.ogg','sound/machines/airlock.ogg','sound/effects/clownstep1.ogg','sound/effects/clownstep2.ogg'))

// Reference list for disposal sort junctions. Set the sortType variable on disposal sort junctions to
// the index of the sort department that you want. For example, sortType set to 2 will reroute all packages
// tagged for the Cargo Bay.

/* List of sortType codes for mapping reference
0 Waste
1 Disposals - All unwrapped items and untagged parcels get picked up by a junction with this sortType. Usually leads to the recycler.
2 Cargo Bay
3 QM Office
4 Engineering
5 CE Office
6 Atmospherics
7 Security
8 HoS Office
9 Medbay
10 CMO Office
11 Chemistry
12 Research
13 RD Office
14 Robotics
15 HoP Office
16 Library
17 Chapel
18 Theatre
19 Bar
20 Kitchen
21 Hydroponics
22 Janitor
23 Genetics
24 Experimentor Lab
25 Ordnance
26 Dormitories
27 Virology
28 Xenobiology
29 Law Office
30 Detective's Office
*/

//The whole system for the sorttype var is determined based on the order of this list,
//disposals must always be 1, since anything that's untagged will automatically go to disposals, or sorttype = 1 --Superxpdude

//If you don't want to fuck up disposals, add to this list, and don't change the order.
//If you insist on changing the order, you'll have to change every sort junction to reflect the new order. --Pete

GLOBAL_LIST_INIT(TAGGERLOCATIONS, list("Disposals",
	"Cargo Bay", "QM Office", "Engineering", "CE Office",
	"Atmospherics", "Security", "HoS Office", "Medbay",
	"CMO Office", "Chemistry", "Research", "RD Office",
	"Robotics", "HoP Office", "Library", "Chapel", "Theatre",
	"Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics",
	"Experimentor Lab", "Ordnance", "Dormitories", "Virology",
	"Xenobiology", "Law Office","Detective's Office"))

GLOBAL_LIST_INIT(station_prefixes, world.file2list("strings/station_prefixes.txt"))

GLOBAL_LIST_INIT(station_names, world.file2list("strings/station_names.txt"))

GLOBAL_LIST_INIT(station_suffixes, world.file2list("strings/station_suffixes.txt"))

GLOBAL_LIST_INIT(greek_letters, world.file2list("strings/greek_letters.txt"))

GLOBAL_LIST_INIT(phonetic_alphabet, world.file2list("strings/phonetic_alphabet.txt"))

GLOBAL_LIST_INIT(numbers_as_words, world.file2list("strings/numbers_as_words.txt"))

GLOBAL_LIST_INIT(wisdoms, world.file2list("strings/wisdoms.txt"))

/proc/generate_number_strings()
	var/list/L[198]
	for(var/i in 1 to 99)
		L += "[i]"
		L += "\Roman[i]"
	return L

GLOBAL_LIST_INIT(station_numerals, greek_letters + phonetic_alphabet + numbers_as_words + generate_number_strings())

GLOBAL_LIST_INIT(admiral_messages, list("Do you know how expensive these stations are?","Stop wasting my time.","I was sleeping, thanks a lot.","Stand and fight you cowards!","You knew the risks coming in.","Stop being paranoid.","Whatever's broken just build a new one.","No.", "null","Error: No comment given.", "It's a good day to die!"))

GLOBAL_LIST_INIT(junkmail_messages, world.file2list("strings/junkmail.txt"))


code:
/// Creates and sorts all the keybinding datums
/proc/init_keybindings()
	for(var/KB in subtypesof(/datum/keybinding))
		var/datum/keybinding/keybinding = KB
		if(!initial(keybinding.keybind_signal) || !initial(keybinding.name))
			continue
		add_keybinding(new keybinding)
	init_emote_keybinds()

/// Adds an instanced keybinding to the global tracker
/proc/add_keybinding(datum/keybinding/instance)
	GLOB.keybindings_by_name[instance.name] = instance

	// Hotkey
	if(LAZYLEN(instance.hotkey_keys))
		for(var/bound_key in instance.hotkey_keys)
			if (bound_key == "Unbound")
				LAZYADD(GLOB.default_hotkeys[instance.name], list())
			else
				LAZYADD(GLOB.default_hotkeys[instance.name], list(bound_key))

/proc/init_emote_keybinds()
	for(var/i in subtypesof(/datum/emote))
		var/datum/emote/faketype = i
		if(!initial(faketype.key))
			continue
		var/datum/keybinding/emote/emote_kb = new
		emote_kb.link_to_emote(faketype)
		add_keybinding(emote_kb)


code:
//as of:10/28/2019:
//boxstation: ~153 loot items spawned
//metastation: ~183 loot items spawned
//deltastation: ~165 loot items spawned

//how to balance maint loot spawns:
// 1) Ensure each category has items of approximately the same power level
// 2) Tune weight of each category until average power of a maint loot spawn is acceptable
// 3) Mapping considerations - Loot value should scale with difficulty of acquisition, or an assistaint will run through collecting free gear with no risk

//goal of maint loot:
// 1) Provide random equipment to people who take effort to crawl maint
// 2) Create memorable moments with very rare, crazy items

//Loot tables

GLOBAL_LIST_INIT(trash_loot, list(//junk: useless, very easy to get, or ghetto chemistry items
	list(//trash
		/obj/item/trash/can = 1,
		/obj/item/trash/raisins = 1,
		/obj/item/trash/candy = 1,
		/obj/item/trash/cheesie = 1,
		/obj/item/trash/chips = 1,
		/obj/item/trash/popcorn = 1,
		/obj/item/trash/sosjerky = 1,
		/obj/item/trash/pistachios = 1,

		/obj/item/poster/random_contraband = 1,
		/obj/item/poster/random_official = 1,
		/obj/item/folder/yellow = 1,
		/obj/item/hand_labeler = 1,
		/obj/item/pen = 1,
		/obj/item/paper = 1,
		/obj/item/paper/crumpled = 1,
		/obj/item/photo/old = 1,
		/obj/item/disk/data = 1,
		/obj/item/stack/sheet/cardboard = 1,
		/obj/item/storage/box = 1,
		/obj/item/c_tube = 1,

		/obj/item/reagent_containers/food/drinks/drinkingglass = 1,
		/obj/item/coin/silver = 1,
		/obj/effect/decal/cleanable/ash = 1,
		/obj/item/cigbutt = 1,
		/obj/item/camera = 1,
		/obj/item/camera_film = 1,
		/obj/item/light/bulb = 1,
		/obj/item/light/tube = 1,
		/obj/item/food/urinalcake = 1,

		/obj/item/airlock_painter = 1,
		/obj/item/airlock_painter/decal = 1,
		/obj/item/rack_parts = 1,
		/obj/item/clothing/mask/breath = 1,
		/obj/item/shard = 1,

		/obj/item/reagent_containers/pill/maintenance/achievement = 1,
		/obj/item/toy/eightball = 1,
		) = 8,

	list(//tier 1 stock parts
		/obj/item/stock_parts/capacitor = 1,
		/obj/item/stock_parts/scanning_module = 1,
		/obj/item/stock_parts/manipulator = 1,
		/obj/item/stock_parts/micro_laser = 1,
		/obj/item/stock_parts/matter_bin = 1,
		) = 1,
	))

GLOBAL_LIST_INIT(common_loot, list( //common: basic items
	list(//tools
		/obj/item/screwdriver = 1,
		/obj/item/wirecutters = 1,
		/obj/item/wrench = 1,
		/obj/item/crowbar = 1,
		/obj/item/t_scanner = 1,
		/obj/item/geiger_counter = 1,
		/obj/item/analyzer = 1,
		/obj/item/mop = 1,
		/obj/item/pushbroom = 1,
		/obj/item/reagent_containers/glass/bucket = 1,
		/obj/item/toy/crayon/spraycan = 1,
		/obj/item/weldingtool = 1,
		) = 1,

	list(//equipment
		/obj/item/clothing/mask/gas = 1,
		/obj/item/radio/headset = 1,
		/obj/item/storage/backpack = 1,
		/obj/item/clothing/shoes/sneakers/black = 1,
		/obj/item/clothing/suit/hazardvest = 1,
		/obj/item/clothing/suit/toggle/labcoat = 1,
		/obj/item/clothing/under/color/grey = 1,
		/obj/item/clothing/gloves/color/fyellow = 1,
		/obj/effect/spawner/random/clothing/gloves = 1,
		/obj/item/storage/wallet/random = 1,
		/obj/item/clothing/glasses/science = 1,
		/obj/item/clothing/glasses/meson = 1,
		/obj/item/storage/belt/fannypack = 1,
		/obj/item/clothing/gloves/color/black = 1,
		) = 1,

	list(//construction and crafting
		/obj/item/stack/cable_coil = 1,
		/obj/item/stock_parts/cell = 1,
		/obj/item/stack/rods/twentyfive = 1,
		/obj/item/stack/sheet/iron/twenty = 1,
		/obj/item/stack/sheet/mineral/plasma = 1,
		/obj/item/sign = 1,

		//assemblies
		/obj/item/assembly/infra = 1,
		/obj/item/assembly/signaler = 1,
		/obj/item/assembly/mousetrap = 1,
		/obj/item/assembly/prox_sensor = 1,
		/obj/item/assembly/timer = 1,
		/obj/item/assembly/igniter = 1,
		/obj/item/assembly/health = 1,
		/obj/item/stack/package_wrap = 1,
		/obj/item/stack/wrapping_paper = 1,
		) = 1,

	list(//medical and chemicals
		/obj/item/stock_parts/cell/lead = 1,
		/obj/item/storage/fancy/cigarettes/dromedaryco = 1,
		/obj/item/grenade/chem_grenade/cleaner = 1,
		/obj/item/storage/box/matches = 1,
		/obj/item/reagent_containers/syringe = 1,
		/obj/item/reagent_containers/glass/beaker = 1,
		/obj/item/reagent_containers/glass/rag = 1,
		/obj/item/reagent_containers/hypospray/medipen/pumpup = 2,
		/obj/item/reagent_containers/glass/bottle/random_buffer = 2,
		/obj/item/lead_pipe = 1,
		) = 1,

	list(//food
		/obj/item/reagent_containers/food/drinks/bottle/beer = 1,
		/obj/item/reagent_containers/food/drinks/coffee = 1,
		) = 1,

	list(//misc
		/obj/item/radio/off = 1,
		/obj/item/extinguisher = 1,
		/obj/item/tank/internals/emergency_oxygen = 1,
		/obj/item/bodybag = 1,
		/obj/item/grenade/smokebomb = 1,
		/obj/item/stack/spacecash/c10 = 1,
		/obj/item/stack/sticky_tape = 1,

		//light sources
		/obj/item/flashlight = 1,
		/obj/effect/spawner/random/decoration/glowstick = 1,
		/obj/item/clothing/head/hardhat/red = 1,
		/obj/item/flashlight/flare = 1,
		) = 1,
	))

GLOBAL_LIST_INIT(uncommon_loot, list(//uncommon: useful items
	list(//tools
		/obj/item/weldingtool/largetank = 1,
		/obj/item/multitool = 1,
		/obj/item/hatchet = 1,
		/obj/item/roller = 1,
		/obj/item/restraints/legcuffs/bola = 1,
		/obj/item/restraints/handcuffs/cable = 1,
		/obj/item/spear = 1,
		/obj/item/grenade/iedcasing/spawned = 1,
		/obj/item/melee/baton/security/cattleprod = 1,
		/obj/item/pen/fountain = 1,
		) = 8,

	list(//equipment
		/obj/item/clothing/head/welding = 1,
		/obj/item/clothing/glasses/welding = 1,
		/obj/item/clothing/glasses/hud/health = 1,
		/obj/item/clothing/glasses/hud/diagnostic = 1,
		/obj/item/storage/belt/utility = 1,
		/obj/item/storage/belt/medical = 1,
		/obj/item/clothing/suit/armor/vest/old  = 1,
		/obj/item/clothing/head/helmet/old = 1,
		/obj/item/clothing/mask/muzzle = 1,
		/obj/item/clothing/ears/earmuffs = 1,
		/obj/item/clothing/gloves/tackler/offbrand = 1,
		/obj/item/clothing/glasses/salesman = 1,
		) = 8,

	list(//strange objects
		/obj/item/relic = 5,
		) = 8,

	list(//construction and crafting
		/obj/item/stock_parts/cell/high = 1,
		/obj/item/stack/sheet/mineral/wood/fifty = 1,
		/obj/item/beacon = 1,
		/obj/item/weaponcrafting/receiver = 1,
		/obj/item/paper/fluff/stations/soap = 1, //recipes count as crafting.
		/obj/item/plaque = 1,
		/obj/item/storage/box/clown = 1,
		/obj/item/seeds/kronkus = 1,
		/obj/item/seeds/odious_puffball = 1,
		) = 8,

	list(//medical and chemicals
		list(//basic healing items
			/obj/item/stack/medical/suture = 1,
			/obj/item/stack/medical/mesh = 1,
			/obj/item/stack/medical/gauze = 1,
			) = 1,
		list(//medical chems
			/obj/item/reagent_containers/glass/bottle/multiver = 1,
			/obj/item/reagent_containers/syringe/convermol = 1,
			/obj/item/reagent_containers/hypospray/medipen = 1,
			) = 1,
		list(//drinks
			/obj/item/reagent_containers/food/drinks/bottle/vodka = 1,
			/obj/item/reagent_containers/food/drinks/soda_cans/grey_bull = 1,
			/obj/item/reagent_containers/food/drinks/drinkingglass/filled/nuka_cola = 1,
			) = 1,
		list(//sprayers
			/obj/item/reagent_containers/spray = 1,
			/obj/item/watertank = 1,
			/obj/item/watertank/janitor = 1,
			) = 1,
		) = 8,

	list(//food
		/obj/item/food/canned/peaches/maint = 1,
		/obj/item/storage/box/gum/happiness = 1,
		/obj/item/storage/box/donkpockets = 1,
		list(//Donk Varieties
			/obj/item/storage/box/donkpockets/donkpocketspicy = 1,
			/obj/item/storage/box/donkpockets/donkpocketteriyaki = 1,
			/obj/item/storage/box/donkpockets/donkpocketpizza = 1,
			/obj/item/storage/box/donkpockets/donkpocketberry = 1,
			/obj/item/storage/box/donkpockets/donkpockethonk = 1,
			) = 1,
		/obj/item/food/monkeycube = 1,
		) = 8,

	list(//music
		/obj/item/instrument/violin = 5,
		/obj/item/instrument/banjo = 5,
		/obj/item/instrument/guitar = 5,
		/obj/item/instrument/eguitar = 5,
		/obj/item/instrument/glockenspiel = 5,
		/obj/item/instrument/accordion = 5,
		/obj/item/instrument/trumpet = 5,
		/obj/item/instrument/saxophone = 5,
		/obj/item/instrument/trombone = 5,
		/obj/item/instrument/recorder = 5,
		/obj/item/instrument/harmonica = 5,
		/obj/item/instrument/bikehorn = 2,
		/obj/item/instrument/violin/golden = 2,
		/obj/item/instrument/musicalmoth = 1,
		) = 2,

	list(//fakeout items, keep this list at low relative weight
		/obj/item/dice/d20 = 1, //To balance out the stealth die of fates in oddities
		/obj/item/clothing/shoes/jackboots = 1,
		) = 1,
))

GLOBAL_LIST_INIT(rarity_loot, list(//rare: really good items
	list(//tools
		/obj/item/weldingtool/hugetank = 1,
		/obj/item/knife/kitchen = 1,
		/obj/item/restraints/handcuffs = 1,
		/obj/item/shield/riot/buckler = 1,
		/obj/item/melee/baton/security/cattleprod/teleprod = 1,
		/obj/item/throwing_star = 1,
		/obj/item/pen/survival = 1,
		/obj/item/flashlight/flashdark = 1,
		/obj/item/assembly/flash/memorizer = 1,
		) = 1,

	list(//equipment
		/obj/item/clothing/glasses/hud/security = 1,
		/obj/item/clothing/glasses/sunglasses = 1,
		/obj/item/storage/belt/security = 1,
		/obj/item/storage/belt/military/assault = 1,
		/obj/item/clothing/gloves/color/yellow = 1,
		/obj/item/clothing/gloves/color/black = 1,
		/obj/item/clothing/gloves/tackler/combat = 1,
		/obj/item/clothing/head/helmet/justice = 1,
		) = 1,

	list(//paint
		/obj/item/paint/red = 1,
		/obj/item/paint/green = 1,
		/obj/item/paint/blue = 1,
		/obj/item/paint/yellow = 1,
		/obj/item/paint/violet = 1,
		/obj/item/paint/black = 1,
		/obj/item/paint/white = 1,
		/obj/item/paint/anycolor = 1,
		/obj/item/paint/paint_remover = 1,
		) = 1,

	list(//medical and chemicals
		list(//medkits
			/obj/item/storage/box/hug/medical = 1,
			/obj/item/storage/firstaid/regular = 1,
			/obj/item/storage/firstaid/emergency = 1,
			) = 1,
		list(//medical chems
			/obj/item/reagent_containers/hypospray/medipen/salacid = 1,
			/obj/item/reagent_containers/hypospray/medipen/oxandrolone = 1,
			/obj/item/reagent_containers/syringe/contraband/methamphetamine = 1,
			) = 1,
		) = 1,

	list(//misc
		/obj/item/disk/nuclear/fake = 1,
		/obj/item/book/granter/crafting_recipe/pipegun_prime = 1,
		/obj/item/book/granter/crafting_recipe/trash_cannon = 1,
		/obj/item/tattoo_kit = 1,
		/obj/item/skillchip/brainwashing = 1,
		) = 1,

))

GLOBAL_LIST_INIT(oddity_loot, list(//oddity: strange or crazy items
		/obj/effect/rune/teleport = 1,
		/obj/item/spear/grey_tide = 1,
		/obj/item/shadowcloak = 1,
		/obj/item/clothing/head/helmet/abductor = 1,
		/obj/item/dice/d20/fate/stealth/one_use = 1, //Looks like a d20, keep the d20 in the uncommon pool.
		/obj/item/dice/d20/fate/stealth/cursed = 1, //Only rolls 1
		/obj/item/clothing/shoes/jackboots/fast = 1,
		/obj/item/clothing/suit/armor/reactive/table = 1,
		/obj/item/storage/box/donkpockets/donkpocketgondola = 1,
		list(//music
			/obj/item/instrument/saxophone/spectral = 1,
			/obj/item/instrument/trumpet/spectral = 1,
			/obj/item/instrument/trombone/spectral = 1,
			) = 1,
	))

//Maintenance loot spawner pools
#define maint_trash_weight 4500
#define maint_common_weight 4500
#define maint_uncommon_weight 900
#define maint_rarity_weight 99
#define maint_oddity_weight 1 //1 out of 10,000 would give metastation (180 spawns) a 2 in 111 chance of spawning an oddity per round, similar to xeno egg
#define maint_holiday_weight 3500 // When holiday loot is enabled, it'll give every loot item a 25% chance of being a holiday item

//Loot pool used by default maintenance loot spawners
GLOBAL_LIST_INIT(maintenance_loot, list(
	GLOB.trash_loot = maint_trash_weight,
	GLOB.common_loot = maint_common_weight,
	GLOB.uncommon_loot = maint_uncommon_weight,
	GLOB.rarity_loot = maint_rarity_weight,
	GLOB.oddity_loot = maint_oddity_weight,
	))

GLOBAL_LIST_INIT(ratking_trash, list(//Garbage: used by the regal rat mob when spawning garbage.
			/obj/item/cigbutt,
			/obj/item/trash/cheesie,
			/obj/item/trash/candy,
			/obj/item/trash/chips,
			/obj/item/trash/pistachios,
			/obj/item/trash/popcorn,
			/obj/item/trash/raisins,
			/obj/item/trash/sosjerky,
			/obj/item/trash/syndi_cakes))

GLOBAL_LIST_INIT(ratking_coins, list(//Coins: Used by the regal rat mob when spawning coins.
			/obj/item/coin/iron,
			/obj/item/coin/silver,
			/obj/item/coin/plastic,
			/obj/item/coin/titanium))

// List of all maintenance loot spawners, for easy finding at roundstart.
GLOBAL_LIST_EMPTY(maintenance_loot_spawners)


code:
GLOBAL_LIST_INIT(cardinals, list(NORTH, SOUTH, EAST, WEST))
GLOBAL_LIST_INIT(cardinals_multiz, list(NORTH, SOUTH, EAST, WEST, UP, DOWN))
GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
GLOBAL_LIST_INIT(corners_multiz, list(UP|NORTHEAST, UP|NORTHWEST, UP|SOUTHEAST, UP|SOUTHWEST, DOWN|NORTHEAST, DOWN|NORTHWEST, DOWN|SOUTHEAST, DOWN|SOUTHWEST))
GLOBAL_LIST_INIT(diagonals_multiz, list(
	NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST,
	UP|NORTH, UP|SOUTH, UP|EAST, UP|WEST, UP|NORTHEAST, UP|NORTHWEST, UP|SOUTHEAST, UP|SOUTHWEST,
	DOWN|NORTH, DOWN|SOUTH, DOWN|EAST, DOWN|WEST, DOWN|NORTHEAST, DOWN|NORTHWEST, DOWN|SOUTHEAST, DOWN|SOUTHWEST))
GLOBAL_LIST_INIT(alldirs_multiz, list(
	NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST,
	UP, UP|NORTH, UP|SOUTH, UP|EAST, UP|WEST, UP|NORTHEAST, UP|NORTHWEST, UP|SOUTHEAST, UP|SOUTHWEST,
	DOWN, DOWN|NORTH, DOWN|SOUTH, DOWN|EAST, DOWN|WEST, DOWN|NORTHEAST, DOWN|NORTHWEST, DOWN|SOUTHEAST, DOWN|SOUTHWEST))
GLOBAL_LIST_INIT(alldirs, list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))

GLOBAL_LIST_EMPTY(landmarks_list) //list of all landmarks created
GLOBAL_LIST_EMPTY(start_landmarks_list) //list of all spawn points created
GLOBAL_LIST_EMPTY(department_security_spawns) //list of all department security spawns
GLOBAL_LIST_EMPTY(generic_event_spawns) //handles clockwork portal+eminence teleport destinations
GLOBAL_LIST_EMPTY(jobspawn_overrides) //These will take precedence over normal spawnpoints if created.

GLOBAL_LIST_EMPTY(wizardstart)
GLOBAL_LIST_EMPTY(nukeop_start)
GLOBAL_LIST_EMPTY(nukeop_leader_start)
GLOBAL_LIST_EMPTY(newplayer_start)
GLOBAL_LIST_EMPTY(prisonwarp) //admin prisoners go to these
GLOBAL_LIST_EMPTY(holdingfacility) //captured people go here (ninja energy net)
GLOBAL_LIST_EMPTY(xeno_spawn)//aliens, morphs and nightmares spawn at these
GLOBAL_LIST_EMPTY(tdome1)
GLOBAL_LIST_EMPTY(tdome2)
GLOBAL_LIST_EMPTY(tdomeobserve)
GLOBAL_LIST_EMPTY(tdomeadmin)
GLOBAL_LIST_EMPTY(prisonwarped) //list of players already warped
GLOBAL_LIST_EMPTY(blobstart) //stationloving objects, blobs, santa
GLOBAL_LIST_EMPTY(secequipment) //sec equipment lockers that scale with the number of sec players
GLOBAL_LIST_EMPTY(deathsquadspawn)
GLOBAL_LIST_EMPTY(emergencyresponseteamspawn)
GLOBAL_LIST_EMPTY(ruin_landmarks)
GLOBAL_LIST_EMPTY(bar_areas)

//away missions
GLOBAL_LIST_EMPTY(vr_spawnpoints)

	//used by jump-to-area etc. Updated by area/updateName()
GLOBAL_LIST_EMPTY(sortedAreas)
/// An association from typepath to area instance. Only includes areas with `unique` set.
GLOBAL_LIST_EMPTY_TYPED(areas_by_type, /area)

GLOBAL_LIST_EMPTY(all_abstract_markers)

/// Global list of megafauna spawns on cave gen
GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/megafauna/dragon = 4, /mob/living/simple_animal/hostile/megafauna/colossus = 2, /mob/living/simple_animal/hostile/megafauna/bubblegum = 6))


code:
GLOBAL_LIST_EMPTY(clients) //all clients
GLOBAL_LIST_EMPTY(admins) //all clients whom are admins
GLOBAL_PROTECT(admins)
GLOBAL_LIST_EMPTY(deadmins) //all ckeys who have used the de-admin verb.

GLOBAL_LIST_EMPTY(directory) //all ckeys with associated client
GLOBAL_LIST_EMPTY(stealthminID) //reference list with IDs that store ckeys, for stealthmins

GLOBAL_LIST_INIT(dangerous_turfs, typecacheof(list(
	/turf/open/lava,
	/turf/open/chasm,
	/turf/open/space,
	/turf/open/openspace)))

//Since it didn't really belong in any other category, I'm putting this here
//This is for procs to replace all the goddamn 'in world's that are chilling around the code

GLOBAL_LIST_EMPTY(player_list) //all mobs **with clients attached**.
GLOBAL_LIST_EMPTY(keyloop_list) //as above but can be limited to boost performance
GLOBAL_LIST_EMPTY(mob_list) //all mobs, including clientless
GLOBAL_LIST_EMPTY(mob_directory) //mob_id -> mob
GLOBAL_LIST_EMPTY(alive_mob_list) //all alive mobs, including clientless. Excludes /mob/dead/new_player
GLOBAL_LIST_EMPTY(suicided_mob_list) //contains a list of all mobs that suicided, including their associated ghosts.
GLOBAL_LIST_EMPTY(drones_list)
GLOBAL_LIST_EMPTY(dead_mob_list) //all dead mobs, including clientless. Excludes /mob/dead/new_player
GLOBAL_LIST_EMPTY(joined_player_list) //all ckeys that have joined the game at round-start or as a latejoin.
GLOBAL_LIST_EMPTY(new_player_list) //all /mob/dead/new_player, in theory all should have clients and those that don't are in the process of spawning and get deleted when done.
GLOBAL_LIST_EMPTY(pre_setup_antags) //minds that have been picked as antag by the gamemode. removed as antag datums are set.
GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs
GLOBAL_LIST_EMPTY(mob_living_list) //all instances of /mob/living and subtypes
GLOBAL_LIST_EMPTY(carbon_list) //all instances of /mob/living/carbon and subtypes, notably does not contain brains or simple animals
GLOBAL_LIST_EMPTY(human_list) //all instances of /mob/living/carbon/human and subtypes
GLOBAL_LIST_EMPTY(ai_list)
GLOBAL_LIST_EMPTY(pai_list)
GLOBAL_LIST_EMPTY(available_ai_shells)
GLOBAL_LIST_INIT(simple_animals, list(list(),list(),list(),list())) // One for each AI_* status define
GLOBAL_LIST_EMPTY(spidermobs) //all sentient spider mobs
GLOBAL_LIST_EMPTY(bots_list)
GLOBAL_LIST_EMPTY(aiEyes)
GLOBAL_LIST_EMPTY(suit_sensors_list) //all people with suit sensors on

/// All alive mobs with clients.
GLOBAL_LIST_EMPTY(alive_player_list)

/// All dead mobs with clients. Does not include observers.
GLOBAL_LIST_EMPTY(dead_player_list)

/// All alive antags with clients.
GLOBAL_LIST_EMPTY(current_living_antags)

/// All observers with clients that joined as observers.
GLOBAL_LIST_EMPTY(current_observers_list)

///underages who have been reported to security for trying to buy things they shouldn't, so they can't spam
GLOBAL_LIST_EMPTY(narcd_underages)

GLOBAL_LIST_EMPTY(language_datum_instances)
GLOBAL_LIST_EMPTY(all_languages)

GLOBAL_LIST_EMPTY(sentient_disease_instances)

GLOBAL_LIST_EMPTY(latejoin_ai_cores)

GLOBAL_LIST_EMPTY(mob_config_movespeed_type_lookup)

GLOBAL_LIST_EMPTY(emote_list)

GLOBAL_LIST_INIT(construct_radial_images, list(
	CONSTRUCT_JUGGERNAUT = image(icon = 'icons/mob/cult.dmi', icon_state = "juggernaut"),
	CONSTRUCT_WRAITH = image(icon = 'icons/mob/cult.dmi', icon_state = "wraith"),
	CONSTRUCT_ARTIFICER = image(icon = 'icons/mob/cult.dmi', icon_state = "artificer")
))

/proc/update_config_movespeed_type_lookup(update_mobs = TRUE)
	var/list/mob_types = list()
	var/list/entry_value = CONFIG_GET(keyed_list/multiplicative_movespeed)
	for(var/path in entry_value)
		var/value = entry_value[path]
		if(!value)
			continue
		for(var/subpath in typesof(path))
			mob_types[subpath] = value
	GLOB.mob_config_movespeed_type_lookup = mob_types
	if(update_mobs)
		update_mob_config_movespeeds()

/proc/update_mob_config_movespeeds()
	for(var/i in GLOB.mob_list)
		var/mob/M = i
		M.update_config_movespeed()

/proc/init_emote_list()
	. = list()
	for(var/path in subtypesof(/datum/emote))
		var/datum/emote/E = new path()
		if(E.key)
			if(!.[E.key])
				.[E.key] = list(E)
			else
				.[E.key] += E
		else if(E.message) //Assuming all non-base emotes have this
			stack_trace("Keyless emote: [E.type]")

		if(E.key_third_person) //This one is optional
			if(!.[E.key_third_person])
				.[E.key_third_person] = list(E)
			else
				.[E.key_third_person] |= E


code:
GLOBAL_LIST_INIT(ai_names, world.file2list("strings/names/ai.txt"))
GLOBAL_LIST_INIT(wizard_first, world.file2list("strings/names/wizardfirst.txt"))
GLOBAL_LIST_INIT(wizard_second, world.file2list("strings/names/wizardsecond.txt"))
GLOBAL_LIST_INIT(ninja_titles, world.file2list("strings/names/ninjatitle.txt"))
GLOBAL_LIST_INIT(ninja_names, world.file2list("strings/names/ninjaname.txt"))
GLOBAL_LIST_INIT(commando_names, world.file2list("strings/names/death_commando.txt"))
GLOBAL_LIST_INIT(first_names, world.file2list("strings/names/first.txt"))
GLOBAL_LIST_INIT(first_names_male, world.file2list("strings/names/first_male.txt"))
GLOBAL_LIST_INIT(first_names_female, world.file2list("strings/names/first_female.txt"))
GLOBAL_LIST_INIT(last_names, world.file2list("strings/names/last.txt"))
GLOBAL_LIST_INIT(lizard_names_male, world.file2list("strings/names/lizard_male.txt"))
GLOBAL_LIST_INIT(lizard_names_female, world.file2list("strings/names/lizard_female.txt"))
GLOBAL_LIST_INIT(clown_names, world.file2list("strings/names/clown.txt"))
GLOBAL_LIST_INIT(mime_names, world.file2list("strings/names/mime.txt"))
GLOBAL_LIST_INIT(religion_names, world.file2list("strings/names/religion.txt"))
GLOBAL_LIST_INIT(carp_names, world.file2list("strings/names/carp.txt"))
GLOBAL_LIST_INIT(golem_names, world.file2list("strings/names/golem.txt"))
GLOBAL_LIST_INIT(moth_first, world.file2list("strings/names/moth_first.txt"))
GLOBAL_LIST_INIT(moth_last, world.file2list("strings/names/moth_last.txt"))
GLOBAL_LIST_INIT(plasmaman_names, world.file2list("strings/names/plasmaman.txt"))
GLOBAL_LIST_INIT(ethereal_names, world.file2list("strings/names/ethereal.txt"))
GLOBAL_LIST_INIT(posibrain_names, world.file2list("strings/names/posibrain.txt"))
GLOBAL_LIST_INIT(nightmare_names, world.file2list("strings/names/nightmare.txt"))
GLOBAL_LIST_INIT(megacarp_first_names, world.file2list("strings/names/megacarp1.txt"))
GLOBAL_LIST_INIT(megacarp_last_names, world.file2list("strings/names/megacarp2.txt"))

GLOBAL_LIST_INIT(verbs, world.file2list("strings/names/verbs.txt"))
GLOBAL_LIST_INIT(ing_verbs, world.file2list("strings/names/ing_verbs.txt"))
GLOBAL_LIST_INIT(martial_prefix, world.file2list("strings/names/martial_prefix.txt"))
GLOBAL_LIST_INIT(adverbs, world.file2list("strings/names/adverbs.txt"))
GLOBAL_LIST_INIT(adjectives, world.file2list("strings/names/adjectives.txt"))
GLOBAL_LIST_INIT(gross_adjectives,  world.file2list("strings/names/gross_adjectives.txt"))
GLOBAL_LIST_INIT(hive_names,  world.file2list("strings/names/hive_names.txt"))
GLOBAL_LIST_INIT(dream_strings, world.file2list("strings/dreamstrings.txt"))
//loaded on startup because of "
//would include in rsc if ' was used


code:
GLOBAL_LIST_EMPTY(cable_list)     //Index for all cables, so that powernets don't have to look through the entire world all the time
GLOBAL_LIST_EMPTY(portals)         //list of all /obj/effect/portal
GLOBAL_LIST_EMPTY(airlocks)         //list of all airlocks
GLOBAL_LIST_EMPTY(curtains) //list of all curtains
GLOBAL_LIST_EMPTY(mechas_list)         //list of all mechs. Used by hostile mobs target tracking.
GLOBAL_LIST_EMPTY(shuttle_caller_list)     //list of all communication consoles and AIs, for automatic shuttle calls when there are none.
GLOBAL_LIST_EMPTY(machines)         //NOTE: this is a list of ALL machines now. The processing machines list is SSmachine.processing !
GLOBAL_LIST_EMPTY(navigation_computers) //list of all /obj/machinery/computer/camera_advanced/shuttle_docker
GLOBAL_LIST_EMPTY(syndicate_shuttle_boards)         //important to keep track of for managing nukeops war declarations.
GLOBAL_LIST_EMPTY(navbeacons)     //list of all bot nagivation beacons, used for patrolling.
GLOBAL_LIST_EMPTY(teleportbeacons)         //list of all tracking beacons used by teleporters
GLOBAL_LIST_EMPTY(deliverybeacons)         //list of all MULEbot delivery beacons.
GLOBAL_LIST_EMPTY(deliverybeacontags)     //list of all tags associated with delivery beacons.
GLOBAL_LIST_EMPTY(wayfindingbeacons)     //list of all navigation beacons used by wayfinding pinpointers
GLOBAL_LIST_EMPTY(nuke_list)
GLOBAL_LIST_EMPTY(alarmdisplay)         //list of all machines or programs that can display station alerts
GLOBAL_LIST_EMPTY_TYPED(singularities, /datum/component/singularity) //list of all singularities on the station
GLOBAL_LIST_EMPTY(mechpad_list) //list of all /obj/machinery/mechpad

GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums indexed by their typepath. Use this for general lookup stuff
GLOBAL_LIST(chemical_reactions_list_reactant_index) //list of all /datum/chemical_reaction datums. Used during chemical reactions. Indexed by REACTANT types
GLOBAL_LIST(chemical_reactions_list_product_index) //list of all /datum/chemical_reaction datums. Used for the reaction lookup UI. Indexed by PRODUCT type
GLOBAL_LIST_INIT(chemical_reagents_list, init_chemical_reagent_list()) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff
GLOBAL_LIST(chemical_reactions_results_lookup_list) //List of all reactions with their associated product and result ids. Used for reaction lookups
GLOBAL_LIST(fake_reagent_blacklist) //List of all reagents that are parent types used to define a bunch of children - but aren't used themselves as anything.
GLOBAL_LIST_EMPTY(tech_list) //list of all /datum/tech datums indexed by id.
GLOBAL_LIST_EMPTY(surgeries_list) //list of all surgeries by name, associated with their path.
GLOBAL_LIST_EMPTY(crafting_recipes) //list of all table craft recipes
GLOBAL_LIST_EMPTY(rcd_list) //list of Rapid Construction Devices.
GLOBAL_LIST_EMPTY(apcs_list) //list of all Area Power Controller machines, separate from machines for powernet speeeeeeed.
GLOBAL_LIST_EMPTY(tracked_implants) //list of all current implants that are tracked to work out what sort of trek everyone is on. Sadly not on lavaworld not implemented...
GLOBAL_LIST_EMPTY(tracked_chem_implants) //list of implants the prisoner console can track and send inject commands too
GLOBAL_LIST_EMPTY(pinpointer_list) //list of all pinpointers. Used to change stuff they are pointing to all at once.
GLOBAL_LIST_EMPTY(zombie_infection_list) // A list of all zombie_infection organs, for any mass "animation"
GLOBAL_LIST_EMPTY(meteor_list) // List of all meteors.
GLOBAL_LIST_EMPTY(active_jammers)  // List of active radio jammers
GLOBAL_LIST_EMPTY(ladders)
GLOBAL_LIST_EMPTY(trophy_cases)
GLOBAL_LIST_EMPTY(experiment_handlers)
///This is a global list of all signs you can change an existing sign or new sign backing to, when using a pen on them.
GLOBAL_LIST_INIT(editable_sign_types, populate_editable_sign_types())

GLOBAL_LIST_EMPTY(wire_color_directory)
GLOBAL_LIST_EMPTY(wire_name_directory)

GLOBAL_LIST_EMPTY(ai_status_displays)

GLOBAL_LIST_EMPTY(mob_spawners)     // All mob_spawn objects
GLOBAL_LIST_EMPTY(alert_consoles) // Station alert consoles, /obj/machinery/computer/station_alert

GLOBAL_LIST_EMPTY(air_scrub_names) // Name list of all air scrubbers
GLOBAL_LIST_EMPTY(air_vent_names) // Name list of all air vents


code:
//Each lists stores ckeys for "Never for this round" option category

#define POLL_IGNORE_SENTIENCE_POTION "sentience_potion"
#define POLL_IGNORE_POSSESSED_BLADE "possessed_blade"
#define POLL_IGNORE_ALIEN_LARVA "alien_larva"
#define POLL_IGNORE_SYNDICATE "syndicate"
#define POLL_IGNORE_HOLOPARASITE "holoparasite"
#define POLL_IGNORE_POSIBRAIN "posibrain"
#define POLL_IGNORE_SPECTRAL_BLADE "spectral_blade"
#define POLL_IGNORE_CONSTRUCT "construct"
#define POLL_IGNORE_SPIDER "spider"
#define POLL_IGNORE_ASHWALKER "ashwalker"
#define POLL_IGNORE_GOLEM "golem"
#define POLL_IGNORE_SWARMER "swarmer"
#define POLL_IGNORE_DRONE "drone"
#define POLL_IGNORE_FUGITIVE "fugitive"
#define POLL_IGNORE_PYROSLIME "slime"
#define POLL_IGNORE_SHADE "shade"
#define POLL_IGNORE_IMAGINARYFRIEND "imaginary_friend"
#define POLL_IGNORE_SPLITPERSONALITY "split_personality"
#define POLL_IGNORE_CONTRACTOR_SUPPORT "contractor_support"
#define POLL_IGNORE_ACADEMY_WIZARD "academy_wizard"

GLOBAL_LIST_INIT(poll_ignore_desc, list(
	POLL_IGNORE_SENTIENCE_POTION = "Sentience potion",
	POLL_IGNORE_POSSESSED_BLADE = "Possessed blade",
	POLL_IGNORE_ALIEN_LARVA = "Xenomorph larva",
	POLL_IGNORE_SYNDICATE = "Syndicate",
	POLL_IGNORE_HOLOPARASITE = "Holoparasite",
	POLL_IGNORE_POSIBRAIN = "Positronic brain",
	POLL_IGNORE_SPECTRAL_BLADE = "Spectral blade",
	POLL_IGNORE_CONSTRUCT = "Construct",
	POLL_IGNORE_SPIDER = "Spiders",
	POLL_IGNORE_ASHWALKER = "Ashwalker eggs",
	POLL_IGNORE_GOLEM = "Golems",
	POLL_IGNORE_SWARMER = "Swarmer shells",
	POLL_IGNORE_DRONE = "Drone shells",
	POLL_IGNORE_FUGITIVE = "Fugitive Hunter",
	POLL_IGNORE_PYROSLIME = "Slime",
	POLL_IGNORE_SHADE = "Shade",
	POLL_IGNORE_IMAGINARYFRIEND = "Imaginary Friend",
	POLL_IGNORE_SPLITPERSONALITY = "Split Personality",
	POLL_IGNORE_CONTRACTOR_SUPPORT = "Contractor Support Unit",
	POLL_IGNORE_ACADEMY_WIZARD = "Academy Wizard Defender"
))
GLOBAL_LIST_INIT(poll_ignore, init_poll_ignore())

/proc/init_poll_ignore()
	. = list()
	for (var/k in GLOB.poll_ignore_desc)
		.[k] = list()


code:
///Lists related to quirk selection

///Types of glasses that can be selected at character selection with the Nearsighted quirk
GLOBAL_LIST_INIT(nearsighted_glasses, list("Regular","Thin","Circle","Hipster"))


code:
//please store common type caches here.
//type caches should only be stored here if used in mutiple places or likely to be used in mutiple places.

//Note: typecache can only replace istype if you know for sure the thing is at least a datum.

GLOBAL_LIST_INIT(typecache_mob, typecacheof(/mob))

GLOBAL_LIST_INIT(typecache_living, typecacheof(/mob/living))

GLOBAL_LIST_INIT(typecache_stack, typecacheof(/obj/item/stack))

GLOBAL_LIST_INIT(typecache_machine_or_structure, typecacheof(list(/obj/machinery, /obj/structure)))

/// A typecache listing structures that are considered to have surfaces that you can place items on that are higher than the floor. This, of course, should be restricted to /atom/movables. This is primarily used for food decomposition code.
GLOBAL_LIST_INIT(typecache_elevated_structures, typecacheof(list(/obj/structure/table,/obj/structure/rack,/obj/machinery/conveyor,/obj/structure/closet)))

/// A typecache of objects that player controlled, easily accessible, hostile mobs should not be able to attack
GLOBAL_LIST_INIT(typecache_general_bad_hostile_attack_targets, typecacheof(list(
	/obj/machinery/airalarm,
	/obj/machinery/atmospherics,
	/obj/machinery/power/apc,
)))

/// A typecache of objects that player controlled, easily accessible, hostile mobs should not be able to move around easily
GLOBAL_LIST_INIT(typecache_general_bad_things_to_easily_move, typecacheof(list(
	/obj/machinery/portable_atmospherics/canister,
	/obj/structure/reagent_dispensers,
)))


code:
/// The basic player-facing types that don't have any super special behaviour.
GLOBAL_LIST_INIT(wiremod_basic_types, list(
	PORT_TYPE_ANY,
	PORT_TYPE_STRING,
	PORT_TYPE_NUMBER,
	PORT_TYPE_SIGNAL,
	PORT_TYPE_TABLE,
	PORT_TYPE_ATOM,
))

/// The fundamental datatypes of the byond game engine.
GLOBAL_LIST_INIT(wiremod_fundamental_types, list(
	PORT_TYPE_ANY,
	PORT_TYPE_NUMBER,
	PORT_TYPE_ATOM,
	PORT_TYPE_DATUM,
	PORT_TYPE_LIST(PORT_TYPE_ANY),
	PORT_TYPE_STRING,
	PORT_TYPE_ASSOC_LIST(PORT_TYPE_ANY, PORT_TYPE_ANY),
))


code:
///These global lists exist to allow our element to have weight tables without having to be seperate instances.

///Assoc list of cell line define | assoc list of datum | cell_line
GLOBAL_LIST_INIT_TYPED(cell_line_tables, /list, list(
	CELL_LINE_TABLE_SLUDGE = list(
		/datum/micro_organism/cell_line/sholean_grapes = 2,
		/datum/micro_organism/cell_line/blobbernaut = 1,
		/datum/micro_organism/cell_line/slime = 2,
		/datum/micro_organism/cell_line/cow = 1,
		/datum/micro_organism/cell_line/mouse = 1,
		/datum/micro_organism/cell_line/chicken = 1,
		/datum/micro_organism/cell_line/cockroach = 2,
	),

	CELL_LINE_TABLE_MOIST = list(
		/datum/micro_organism/cell_line/gelatinous_cube = 2,
		/datum/micro_organism/cell_line/megacarp = 1,
		/datum/micro_organism/cell_line/slime = 2,
		/datum/micro_organism/cell_line/snake = 1,
		/datum/micro_organism/cell_line/carp = 1,
		/datum/micro_organism/cell_line/cockroach = 1),

	CELL_LINE_TABLE_BLOB = list(/datum/micro_organism/cell_line/blobbernaut = 1,
								/datum/micro_organism/cell_line/blob_spore = 1),

	CELL_LINE_TABLE_MOLD = list(
		/datum/micro_organism/cell_line/vat_beast = 2,
		/datum/micro_organism/cell_line/bear = 1,
		/datum/micro_organism/cell_line/slime = 1,
		/datum/micro_organism/cell_line/blob_spore = 1,
		/datum/micro_organism/cell_line/mouse = 2,
		/datum/micro_organism/cell_line/corgi = 1,
		/datum/micro_organism/cell_line/cockroach = 1,
		/datum/micro_organism/cell_line/cat = 1),

	CELL_LINE_TABLE_BEAR = list(/datum/micro_organism/cell_line/bear = 1),
	CELL_LINE_TABLE_BLOBBERNAUT = list(/datum/micro_organism/cell_line/blobbernaut = 1),
	CELL_LINE_TABLE_BLOBSPORE = list(/datum/micro_organism/cell_line/blob_spore = 1),
	CELL_LINE_TABLE_CARP = list(/datum/micro_organism/cell_line/carp = 1),
	CELL_LINE_TABLE_CAT = list(/datum/micro_organism/cell_line/cat = 1),
	CELL_LINE_TABLE_CHICKEN = list(/datum/micro_organism/cell_line/chicken = 1),
	CELL_LINE_TABLE_COCKROACH = list(/datum/micro_organism/cell_line/cockroach = 1),
	CELL_LINE_TABLE_CORGI = list(/datum/micro_organism/cell_line/corgi = 1),
	CELL_LINE_TABLE_COW = list(/datum/micro_organism/cell_line/cow = 1),
	CELL_LINE_TABLE_MOONICORN = list(/datum/micro_organism/cell_line/moonicorn = 1),
	CELL_LINE_TABLE_GELATINOUS = list(/datum/micro_organism/cell_line/gelatinous_cube = 1),
	CELL_LINE_TABLE_GRAPE = list(/datum/micro_organism/cell_line/sholean_grapes = 1),
	CELL_LINE_TABLE_MEGACARP = list(/datum/micro_organism/cell_line/megacarp = 1),
	CELL_LINE_TABLE_MOUSE = list(/datum/micro_organism/cell_line/mouse = 1),
	CELL_LINE_TABLE_PINE = list(/datum/micro_organism/cell_line/pine = 1),
	CELL_LINE_TABLE_PUG = list(/datum/micro_organism/cell_line/pug = 1),
	CELL_LINE_TABLE_SLIME = list(/datum/micro_organism/cell_line/slime = 1),
	CELL_LINE_TABLE_SNAKE = list(/datum/micro_organism/cell_line/snake = 1),
	CELL_LINE_TABLE_VATBEAST = list(/datum/micro_organism/cell_line/vat_beast = 1),
	CELL_LINE_TABLE_NETHER = list(/datum/micro_organism/cell_line/netherworld = 1),
	CELL_LINE_TABLE_CLOWN = list(
		/datum/micro_organism/cell_line/clown/bananaclown = 1,
		/datum/micro_organism/cell_line/clown/glutton = 1,
		/datum/micro_organism/cell_line/clown/longclown = 1),

	CELL_LINE_TABLE_GLUTTON = list(/datum/micro_organism/cell_line/clown/glutton = 1),
	CELL_LINE_TABLE_FROG = list(/datum/micro_organism/cell_line/frog = 1),
	CELL_LINE_TABLE_WALKING_MUSHROOM = list(/datum/micro_organism/cell_line/walking_mushroom = 1),
	CELL_LINE_TABLE_QUEEN_BEE = list(/datum/micro_organism/cell_line/queen_bee = 1),
	CELL_LINE_TABLE_LEAPER = list(/datum/micro_organism/cell_line/leaper = 1),
	CELL_LINE_TABLE_MEGA_ARACHNID = list(/datum/micro_organism/cell_line/mega_arachnid = 1),
	CELL_LINE_TABLE_ALGAE = list(
		/datum/micro_organism/cell_line/frog = 2,
		/datum/micro_organism/cell_line/snake = 1,
		/datum/micro_organism/cell_line/queen_bee = 1,
		/datum/micro_organism/cell_line/walking_mushroom = 2,
		/datum/micro_organism/cell_line/leaper = 2,
		/datum/micro_organism/cell_line/mega_arachnid = 1)
	))

///Assoc list of cell virus define | assoc list of datum | cell_virus
GLOBAL_LIST_INIT(cell_virus_tables, list(
	CELL_VIRUS_TABLE_GENERIC = list(/datum/micro_organism/virus = 1),
	CELL_VIRUS_TABLE_GENERIC_MOB = list(/datum/micro_organism/virus = 1)
	))

///List of all possible sample colors
GLOBAL_LIST_INIT(xeno_sample_colors, list(COLOR_SAMPLE_YELLOW, COLOR_SAMPLE_PURPLE, COLOR_SAMPLE_GREEN, COLOR_SAMPLE_BROWN, COLOR_SAMPLE_GRAY))


code:
GLOBAL_VAR(log_directory)
GLOBAL_PROTECT(log_directory)
GLOBAL_VAR(world_game_log)
GLOBAL_PROTECT(world_game_log)
/// Log associated with [/proc/log_suspicious_login()] - Intended to hold all logins that failed due to suspicious circumstances such as ban detection, CID randomisation etc.
GLOBAL_VAR(world_suspicious_login_log)
GLOBAL_PROTECT(world_suspicious_login_log)
GLOBAL_VAR(world_runtime_log)
GLOBAL_PROTECT(world_runtime_log)
GLOBAL_VAR(world_qdel_log)
GLOBAL_PROTECT(world_qdel_log)
GLOBAL_VAR(world_attack_log)
GLOBAL_PROTECT(world_attack_log)
GLOBAL_VAR(world_econ_log)
GLOBAL_PROTECT(world_econ_log)
GLOBAL_VAR(world_href_log)
GLOBAL_PROTECT(world_href_log)
GLOBAL_VAR(world_mob_tag_log)
GLOBAL_PROTECT(world_mob_tag_log)
GLOBAL_VAR(round_id)
GLOBAL_PROTECT(round_id)
GLOBAL_VAR(config_error_log)
GLOBAL_PROTECT(config_error_log)
GLOBAL_VAR(sql_error_log)
GLOBAL_PROTECT(sql_error_log)
GLOBAL_VAR(world_pda_log)
GLOBAL_PROTECT(world_pda_log)
GLOBAL_VAR(world_uplink_log)
GLOBAL_PROTECT(world_uplink_log)
GLOBAL_VAR(world_telecomms_log)
GLOBAL_PROTECT(world_telecomms_log)
GLOBAL_VAR(world_manifest_log)
GLOBAL_PROTECT(world_manifest_log)
GLOBAL_VAR(query_debug_log)
GLOBAL_PROTECT(query_debug_log)
GLOBAL_VAR(world_job_debug_log)
GLOBAL_PROTECT(world_job_debug_log)
GLOBAL_VAR(world_mecha_log)
GLOBAL_PROTECT(world_mecha_log)
GLOBAL_VAR(world_virus_log)
GLOBAL_PROTECT(world_virus_log)
GLOBAL_VAR(world_asset_log)
GLOBAL_PROTECT(world_asset_log)
GLOBAL_VAR(world_cloning_log)
GLOBAL_PROTECT(world_cloning_log)
GLOBAL_VAR(world_map_error_log)
GLOBAL_PROTECT(world_map_error_log)
GLOBAL_VAR(world_paper_log)
GLOBAL_PROTECT(world_paper_log)
GLOBAL_VAR(tgui_log)
GLOBAL_PROTECT(tgui_log)
GLOBAL_VAR(world_shuttle_log)
GLOBAL_PROTECT(world_shuttle_log)

GLOBAL_VAR(perf_log)
GLOBAL_PROTECT(perf_log)

GLOBAL_VAR(demo_log)
GLOBAL_PROTECT(demo_log)

GLOBAL_LIST_EMPTY(bombers)
GLOBAL_PROTECT(bombers)
GLOBAL_LIST_EMPTY(admin_log)
GLOBAL_PROTECT(admin_log)
GLOBAL_LIST_EMPTY(lastsignalers) //keeps last 100 signals here in format: "[src] used [REF(src)] @ location [src.loc]: [freq]/[code]"
GLOBAL_PROTECT(lastsignalers)
GLOBAL_LIST_EMPTY(lawchanges) //Stores who uploaded laws to which silicon-based lifeform, and what the law was
GLOBAL_PROTECT(lawchanges)

GLOBAL_LIST_EMPTY(combatlog)
GLOBAL_PROTECT(combatlog)
GLOBAL_LIST_EMPTY(IClog)
GLOBAL_PROTECT(IClog)
GLOBAL_LIST_EMPTY(OOClog)
GLOBAL_PROTECT(OOClog)
GLOBAL_LIST_EMPTY(adminlog)
GLOBAL_PROTECT(adminlog)

GLOBAL_LIST_EMPTY(active_turfs_startlist)

/////Picture logging
GLOBAL_VAR(picture_log_directory)
GLOBAL_PROTECT(picture_log_directory)

GLOBAL_VAR_INIT(picture_logging_id, 1)
GLOBAL_PROTECT(picture_logging_id)
GLOBAL_VAR(picture_logging_prefix)
GLOBAL_PROTECT(picture_logging_prefix)
/////


code:
//These are a bunch of regex datums for use /((any|every|no|some|head|foot)where(wolf)?\sand\s)+(\.[\.\s]+\s?where\?)?/i
GLOBAL_DATUM_INIT(is_http_protocol, /regex, regex("^https?://"))

GLOBAL_DATUM_INIT(is_website, /regex, regex("http|www.|\[a-z0-9_-]+.(com|org|net|mil|edu)+", "i"))
GLOBAL_DATUM_INIT(is_email, /regex, regex("\[a-z0-9_-]+@\[a-z0-9_-]+.\[a-z0-9_-]+", "i"))
GLOBAL_DATUM_INIT(is_alphanumeric, /regex, regex("\[a-z0-9]+", "i"))
GLOBAL_DATUM_INIT(is_punctuation, /regex, regex("\[.!?]+", "i"))
GLOBAL_DATUM_INIT(is_color, /regex, regex("^#\[0-9a-fA-F]{6}$"))

//finds text strings recognized as links on discord. Mainly used to stop embedding.
GLOBAL_DATUM_INIT(has_discord_embeddable_links, /regex, regex("(https?://\[^\\s|<\]{2,})"))

//All < and > characters
GLOBAL_DATUM_INIT(angular_brackets, /regex, regex(@"[<>]", "g"))

//All characters forbidden by filenames: ", \, \n, \t, /, ?, %, *, :, |, <, >
GLOBAL_DATUM_INIT(filename_forbidden_chars, /regex, regex(@{""|[\\\n\t/?%*:|<>]"}, "g"))
// had to use the OR operator for quotes instead of putting them in the character class because it breaks the syntax highlighting otherwise.


code:
// All religion stuff
GLOBAL_VAR(religion)
GLOBAL_VAR(deity)
GLOBAL_DATUM(religious_sect, /datum/religion_sect)

//bible
GLOBAL_VAR(bible_name)
GLOBAL_VAR(bible_icon_state)
GLOBAL_VAR(bible_inhand_icon_state)

//gear
GLOBAL_VAR(holy_weapon_type)
GLOBAL_VAR(holy_armor_type)


code:
GLOBAL_DATUM(crew_manifest_tgui, /datum/crew_manifest)
GLOBAL_DATUM(changelog_tgui, /datum/changelog)


code:
/// The difference betwen midnight (of the host computer) and 0 world.ticks.
GLOBAL_VAR_INIT(timezoneOffset, 0)

GLOBAL_VAR_INIT(year, time2text(world.realtime,"YYYY"))
GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013???


code:
/*
	FUN ZONE OF ADMIN LISTINGS
	Try to keep this in sync with __DEFINES/traits.dm
	quirks have it's own panel so we don't need them here.
*/
GLOBAL_LIST_INIT(traits_by_type, list(
	/mob = list(
		//SEPTIC EDIT BEGIN
		"TRAIT_CAPITALIST_MOOD" = TRAIT_CAPITALIST_MOOD,
		"TRAIT_NOPAIN" = TRAIT_NOPAIN,
		"TRAIT_PAINLOVER" = TRAIT_PAINLOVER,
		"TRAIT_TRYINGTOSLEEP" = TRAIT_TRYINGTOSLEEP,
		"TRAIT_BLOODLOSSIMMUNE" = TRAIT_BLOODLOSSIMMUNE,
		"TRAIT_SPRINT_LOCKED" = TRAIT_SPRINT_LOCKED,
		"TRAIT_NO_HUSK" = TRAIT_NO_HUSK,
		"TRAIT_HIDING_MUTANTPARTS" = TRAIT_HIDING_MUTANTPARTS,
		"TRAIT_TYPINGINDICATOR" = TRAIT_TYPINGINDICATOR,
		"TRAIT_SSDINDICATOR" = TRAIT_SSDINDICATOR,
		"TRAIT_FRAGGOT" = TRAIT_FRAGGOT,
		"TRAIT_STUMBLE" = TRAIT_STUMBLE,
		"TRAIT_HOLDING_BREATH" = TRAIT_HOLDING_BREATH,
		"TRAIT_WATER_BREATHING" = TRAIT_WATER_BREATHING,
		"TRAIT_NO_PARRY" = TRAIT_NO_PARRY,
		"TRAIT_FRAGGOT" = TRAIT_FRAGGOT,
		"TRAIT_FLUORIDE_STARE" = TRAIT_FLUORIDE_STARE,
		//SEPTIC EDIT END
		"TRAIT_KNOCKEDOUT" = TRAIT_KNOCKEDOUT,
		"TRAIT_IMMOBILIZED" = TRAIT_IMMOBILIZED,
		"TRAIT_FLOORED" = TRAIT_FLOORED,
		"TRAIT_FORCED_STANDING" = TRAIT_FORCED_STANDING,
		"TRAIT_HANDS_BLOCKED" = TRAIT_HANDS_BLOCKED,
		"TRAIT_RESTRAINED" = TRAIT_RESTRAINED,
		"TRAIT_INCAPACITATED" = TRAIT_INCAPACITATED,
		"TRAIT_CRITICAL_CONDITION" = TRAIT_CRITICAL_CONDITION,
		"TRAIT_BLIND" = TRAIT_BLIND,
		"TRAIT_MUTE" = TRAIT_MUTE,
		"TRAIT_EMOTEMUTE " = TRAIT_EMOTEMUTE,
		"TRAIT_DEAF" = TRAIT_DEAF,
		"TRAIT_NEARSIGHT" = TRAIT_NEARSIGHT,
		"TRAIT_FAT" = TRAIT_FAT,
		"TRAIT_HUSK" = TRAIT_HUSK,
		"TRAIT_BADDNA" = TRAIT_BADDNA,
		"TRAIT_CLUMSY" = TRAIT_CLUMSY,
		"TRAIT_CHUNKYFINGERS" = TRAIT_CHUNKYFINGERS,
		"TRAIT_DUMB" = TRAIT_DUMB,
		"TRAIT_ADVANCEDTOOLUSER" = TRAIT_ADVANCEDTOOLUSER,
		"TRAIT_DISCOORDINATED_TOOL_USER" = TRAIT_DISCOORDINATED_TOOL_USER,
		"TRAIT_PACIFISM" = TRAIT_PACIFISM,
		"TRAIT_IGNORESLOWDOWN" = TRAIT_IGNORESLOWDOWN,
		"TRAIT_IGNOREDAMAGESLOWDOWN" = TRAIT_IGNOREDAMAGESLOWDOWN,
		"TRAIT_DEATHCOMA" = TRAIT_DEATHCOMA,
		"TRAIT_FAKEDEATH" = TRAIT_FAKEDEATH,
		"TRAIT_DISFIGURED" = TRAIT_DISFIGURED,
		"TRAIT_XENO_HOST" = TRAIT_XENO_HOST,
		"TRAIT_STUNIMMUNE" = TRAIT_STUNIMMUNE,
		"TRAIT_STUNRESISTANCE" = TRAIT_STUNRESISTANCE,
		"TRAIT_IWASBATONED" = TRAIT_IWASBATONED,
		"TRAIT_SLEEPIMMUNE" = TRAIT_SLEEPIMMUNE,
		"TRAIT_PUSHIMMUNE" = TRAIT_PUSHIMMUNE,
		"TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE,
		"TRAIT_TESLA_SHOCKIMMUNE" = TRAIT_TESLA_SHOCKIMMUNE,
		"TRAIT_STABLEHEART" = TRAIT_STABLEHEART,
		"TRAIT_STABLELIVER" = TRAIT_STABLELIVER,
		"TRAIT_RESISTHEAT" = TRAIT_RESISTHEAT,
		"TRAIT_RESISTHEATHANDS" = TRAIT_RESISTHEATHANDS,
		"TRAIT_RESISTCOLD" = TRAIT_RESISTCOLD,
		"TRAIT_RESISTHIGHPRESSURE" = TRAIT_RESISTHIGHPRESSURE,
		"TRAIT_RESISTLOWPRESSURE" = TRAIT_RESISTLOWPRESSURE,
		"TRAIT_BOMBIMMUNE" = TRAIT_BOMBIMMUNE,
		"TRAIT_RADIMMUNE" = TRAIT_RADIMMUNE,
		"TRAIT_GENELESS" = TRAIT_GENELESS,
		"TRAIT_VIRUSIMMUNE" = TRAIT_VIRUSIMMUNE,
		"TRAIT_PIERCEIMMUNE" = TRAIT_PIERCEIMMUNE,
		"TRAIT_NODISMEMBER" = TRAIT_NODISMEMBER,
		"TRAIT_NOFIRE" = TRAIT_NOFIRE,
		"TRAIT_NOGUNS" = TRAIT_NOGUNS,
		"TRAIT_NOHUNGER" = TRAIT_NOHUNGER,
		"TRAIT_NOMETABOLISM" = TRAIT_NOMETABOLISM,
		"TRAIT_NOCLONELOSS" = TRAIT_NOCLONELOSS,
		"TRAIT_TOXIMMUNE" = TRAIT_TOXIMMUNE,
		"TRAIT_EASYDISMEMBER" = TRAIT_EASYDISMEMBER,
		"TRAIT_LIMBATTACHMENT" = TRAIT_LIMBATTACHMENT,
		"TRAIT_NOLIMBDISABLE" = TRAIT_NOLIMBDISABLE,
		"TRAIT_EASILY_WOUNDED" = TRAIT_EASILY_WOUNDED,
		"TRAIT_HARDLY_WOUNDED" = TRAIT_HARDLY_WOUNDED,
		"TRAIT_NEVER_WOUNDED" = TRAIT_NEVER_WOUNDED,
		"TRAIT_TOXINLOVER" = TRAIT_TOXINLOVER,
		"TRAIT_NOBREATH" = TRAIT_NOBREATH,
		"TRAIT_ANTIMAGIC" = TRAIT_ANTIMAGIC,
		"TRAIT_HOLY" = TRAIT_HOLY,
		"TRAIT_DEPRESSION" = TRAIT_DEPRESSION,
		"TRAIT_JOLLY" = TRAIT_JOLLY,
		"TRAIT_NOCRITDAMAGE" = TRAIT_NOCRITDAMAGE,
		"TRAIT_NOSLIPWATER" = TRAIT_NOSLIPWATER,
		"TRAIT_NOSLIPALL" = TRAIT_NOSLIPALL,
		"TRAIT_NODEATH" = TRAIT_NODEATH,
		"TRAIT_NOHARDCRIT" = TRAIT_NOHARDCRIT,
		"TRAIT_NOSOFTCRIT" = TRAIT_NOSOFTCRIT,
		"TRAIT_MINDSHIELD" = TRAIT_MINDSHIELD,
		"TRAIT_DISSECTED" = TRAIT_DISSECTED,
		"TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE,
		"TRAIT_FEARLESS" = TRAIT_FEARLESS,
		"TRAIT_PARALYSIS_L_ARM" = TRAIT_PARALYSIS_L_ARM,
		"TRAIT_PARALYSIS_R_ARM" = TRAIT_PARALYSIS_R_ARM,
		"TRAIT_PARALYSIS_L_LEG" = TRAIT_PARALYSIS_L_LEG,
		"TRAIT_PARALYSIS_R_LEG" = TRAIT_PARALYSIS_R_LEG,
		"TRAIT_CANNOT_OPEN_PRESENTS" = TRAIT_CANNOT_OPEN_PRESENTS,
		"TRAIT_PRESENT_VISION" = TRAIT_PRESENT_VISION,
		"TRAIT_DISK_VERIFIER" = TRAIT_DISK_VERIFIER,
		"TRAIT_BYPASS_MEASURES" = TRAIT_BYPASS_MEASURES,
		"TRAIT_NOMOBSWAP" = TRAIT_NOMOBSWAP,
		"TRAIT_XRAY_VISION" = TRAIT_XRAY_VISION,
		"TRAIT_WEB_WEAVER" = TRAIT_WEB_WEAVER,
		"TRAIT_THERMAL_VISION" = TRAIT_THERMAL_VISION,
		"TRAIT_ABDUCTOR_TRAINING" = TRAIT_ABDUCTOR_TRAINING,
		"TRAIT_ABDUCTOR_SCIENTIST_TRAINING" = TRAIT_ABDUCTOR_SCIENTIST_TRAINING,
		"TRAIT_SURGEON" = TRAIT_SURGEON,
		"TRAIT_STRONG_GRABBER" = TRAIT_STRONG_GRABBER,
		"TRAIT_MAGIC_CHOKE" = TRAIT_MAGIC_CHOKE,
		"TRAIT_SOOTHED_THROAT" = TRAIT_SOOTHED_THROAT,
		"TRAIT_LAW_ENFORCEMENT_METABOLISM" = TRAIT_LAW_ENFORCEMENT_METABOLISM,
		"TRAIT_BOOZE_SLIDER" = TRAIT_BOOZE_SLIDER,
		"TRAIT_QUICK_CARRY" = TRAIT_QUICK_CARRY,
		"TRAIT_QUICKER_CARRY" = TRAIT_QUICKER_CARRY,
		"TRAIT_PLANT_SAFE" = TRAIT_PLANT_SAFE,
		"TRAIT_UNINTELLIGIBLE_SPEECH" = TRAIT_UNINTELLIGIBLE_SPEECH,
		"TRAIT_UNSTABLE" = TRAIT_UNSTABLE,
		"TRAIT_OIL_FRIED" = TRAIT_OIL_FRIED,
		"TRAIT_MEDICAL_HUD" = TRAIT_MEDICAL_HUD,
		"TRAIT_SECURITY_HUD" = TRAIT_SECURITY_HUD,
		"TRAIT_DIAGNOSTIC_HUD" = TRAIT_DIAGNOSTIC_HUD,
		"TRAIT_TRAIT_MEDIBOTCOMINGTHROUGH" = TRAIT_MEDIBOTCOMINGTHROUGH,
		"TRAIT_PASSTABLE" = TRAIT_PASSTABLE,
		"TRAIT_NOFLASH" = TRAIT_NOFLASH,
		"TRAIT_XENO_IMMUNE" = TRAIT_XENO_IMMUNE,
		"TRAIT_NAIVE" = TRAIT_NAIVE,
		"TRAIT_PRIMITIVE" = TRAIT_PRIMITIVE, //unable to use mechs. Given to Ash Walkers
		"TRAIT_GUNFLIP" = TRAIT_GUNFLIP,
		"TRAIT_SPECIAL_TRAUMA_BOOST" = TRAIT_SPECIAL_TRAUMA_BOOST,
		"TRAIT_BLOODCRAWL_EAT" = TRAIT_BLOODCRAWL_EAT,
		"TRAIT_SPACEWALK" = TRAIT_SPACEWALK,
		"TRAIT_GAMERGOD" = TRAIT_GAMERGOD,
		"TRAIT_GIANT" = TRAIT_GIANT,
		"TRAIT_DWARF" = TRAIT_DWARF,
		"TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS,
		"TRAIT_NICE_SHOT" = TRAIT_NICE_SHOT,
		"TRAIT_TUMOR_SUPPRESSION" = TRAIT_TUMOR_SUPPRESSED,
		"TRAIT_PERMANENTLY_ONFIRE" = TRAIT_PERMANENTLY_ONFIRE,
		"TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG,
		"TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE" = TRAIT_UNDERWATER_BASKETWEAVING_KNOWLEDGE,
		"TRAIT_WINE_TASTER" = TRAIT_WINE_TASTER,
		"TRAIT_BONSAI" = TRAIT_BONSAI,
		"TRAIT_LIGHTBULB_REMOVER" = TRAIT_LIGHTBULB_REMOVER,
		"TRAIT_KNOW_CYBORG_WIRES" = TRAIT_KNOW_CYBORG_WIRES,
		"TRAIT_KNOW_ENGI_WIRES" = TRAIT_KNOW_ENGI_WIRES,
		"TRAIT_ALCOHOL_TOLERANCE" = TRAIT_ALCOHOL_TOLERANCE,
		"TRAIT_AGEUSIA" = TRAIT_AGEUSIA,
		"TRAIT_HEAVY_SLEEPER" = TRAIT_HEAVY_SLEEPER,
		"TRAIT_NIGHT_VISION" = TRAIT_NIGHT_VISION,
		"TRAIT_LIGHT_STEP" = TRAIT_LIGHT_STEP,
		"TRAIT_SPIRITUAL" = TRAIT_SPIRITUAL,
		"TRAIT_CLOWN_ENJOYER" = TRAIT_CLOWN_ENJOYER,
		"TRAIT_MIME_FAN" = TRAIT_MIME_FAN,
		"TRAIT_VORACIOUS" = TRAIT_VORACIOUS,
		"TRAIT_SELF_AWARE" = TRAIT_SELF_AWARE,
		"TRAIT_FREERUNNING" = TRAIT_FREERUNNING,
		"TRAIT_SKITTISH" = TRAIT_SKITTISH,
		"TRAIT_POOR_AIM" = TRAIT_POOR_AIM,
		"TRAIT_PROSOPAGNOSIA" = TRAIT_PROSOPAGNOSIA,
		"TRAIT_TAGGER" = TRAIT_TAGGER,
		"TRAIT_PHOTOGRAPHER" = TRAIT_PHOTOGRAPHER,
		"TRAIT_MUSICIAN" = TRAIT_MUSICIAN,
		"TRAIT_LIGHT_DRINKER" = TRAIT_LIGHT_DRINKER,
		"TRAIT_EMPATH" = TRAIT_EMPATH,
		"TRAIT_FRIENDLY" = TRAIT_FRIENDLY,
		"TRAIT_GRABWEAKNESS" = TRAIT_GRABWEAKNESS,
		"TRAIT_SNOB" = TRAIT_SNOB,
		"TRAIT_BALD" = TRAIT_BALD,
		"TRAIT_BADTOUCH" = TRAIT_BADTOUCH,
		"TRAIT_NOBLEED" = TRAIT_NOBLEED,
		"TRAIT_KISS_OF_DEATH" = TRAIT_KISS_OF_DEATH,
		"TRAIT_ANXIOUS" = TRAIT_ANXIOUS,
		"TRAIT_WEAK_SOUL" = TRAIT_WEAK_SOUL,
		"TRAIT_INVISIBLE_MAN" = TRAIT_INVISIBLE_MAN,
		"TRAIT_HIDE_EXTERNAL_ORGANS" = TRAIT_HIDE_EXTERNAL_ORGANS,
		"TRAIT_UNNATURAL_RED_GLOWY_EYES" = TRAIT_UNNATURAL_RED_GLOWY_EYES,
		"TRAIT_BLOODSHOT_EYES" = TRAIT_BLOODSHOT_EYES,
		"TRAIT_SHIFTY_EYES" = TRAIT_SHIFTY_EYES,
	),
	/obj/item/bodypart = list(
		//SEPTIC EDIT BEGIN
		"TRAIT_ROTTEN" = TRAIT_ROTTEN,
		"TRAIT_DEFORMED" = TRAIT_DEFORMED,
		"TRAIT_NOPAIN" = TRAIT_NOPAIN,
		"TRAIT_NEVER_WOUNDED" = TRAIT_NEVER_WOUNDED,
		"TRAIT_EASILY_WOUNDED" = TRAIT_EASILY_WOUNDED,
		"TRAIT_HARDLY_WOUNDED" = TRAIT_HARDLY_WOUNDED,
		"TRAIT_EASYDISMEMBER" = TRAIT_EASYDISMEMBER,
		//SEPTIC EDIT END
		"TRAIT_PARALYSIS" = TRAIT_PARALYSIS,
		"TRAIT_PLASMABURNT" = TRAIT_PLASMABURNT,
		),
	/obj/item = list(
		"TRAIT_NODROP" = TRAIT_NODROP,
		"TRAIT_NO_STORAGE_INSERT" = TRAIT_NO_STORAGE_INSERT,
		"TRAIT_T_RAY_VISIBLE" = TRAIT_T_RAY_VISIBLE,
		"TRAIT_NO_TELEPORT" = TRAIT_NO_TELEPORT,
		"TRAIT_APC_SHOCKING" = TRAIT_APC_SHOCKING,
		"TRAIT_UNCATCHABLE" = TRAIT_UNCATCHABLE,
		),
	/atom = list(
		"TRAIT_KEEP_TOGETHER" = TRAIT_KEEP_TOGETHER,
		),
	/atom/movable = list(
		"TRAIT_MOVE_GROUND" = TRAIT_MOVE_GROUND,
		"TRAIT_MOVE_FLYING" = TRAIT_MOVE_FLYING,
		"TRAIT_MOVE_VENTCRAWLING" = TRAIT_MOVE_VENTCRAWLING,
		"TRAIT_MOVE_FLOATING" = TRAIT_MOVE_FLOATING,
		"TRAIT_MOVE_PHASING" = TRAIT_MOVE_PHASING,
		"TRAIT_LAVA_IMMUNE" = TRAIT_LAVA_IMMUNE,
		"TRAIT_ASHSTORM_IMMUNE" = TRAIT_ASHSTORM_IMMUNE,
		"TRAIT_SNOWSTORM_IMMUNE" = TRAIT_SNOWSTORM_IMMUNE,
		"TRAIT_VOIDSTORM_IMMUNE" = TRAIT_VOIDSTORM_IMMUNE,
		"TRAIT_WEATHER_IMMUNE" = TRAIT_WEATHER_IMMUNE,
		),
	/obj/item/card/id = list(
		"TRAIT_MAGNETIC_ID_CARD" = TRAIT_MAGNETIC_ID_CARD,
	),
))

/// value -> trait name, generated on use from trait_by_type global
GLOBAL_LIST(trait_name_map)

/proc/generate_trait_name_map()
	. = list()
	for(var/key in GLOB.traits_by_type)
		for(var/tname in GLOB.traits_by_type[key])
			var/val = GLOB.traits_by_type[key][tname]
			.[val] = tname

GLOBAL_LIST_INIT(movement_type_trait_to_flag, list(
	TRAIT_MOVE_GROUND = GROUND,
	TRAIT_MOVE_FLYING = FLYING,
	TRAIT_MOVE_VENTCRAWLING = VENTCRAWLING,
	TRAIT_MOVE_FLOATING = FLOATING,
	TRAIT_MOVE_PHASING = PHASING
	))

GLOBAL_LIST_INIT(movement_type_addtrait_signals, set_movement_type_addtrait_signals())
GLOBAL_LIST_INIT(movement_type_removetrait_signals, set_movement_type_removetrait_signals())

/proc/set_movement_type_addtrait_signals(signal_prefix)
	. = list()
	for(var/trait in GLOB.movement_type_trait_to_flag)
		. += SIGNAL_ADDTRAIT(trait)

/proc/set_movement_type_removetrait_signals(signal_prefix)
	. = list()
	for(var/trait in GLOB.movement_type_trait_to_flag)
		. += SIGNAL_REMOVETRAIT(trait)