Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _maps/_basemap.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it.
#define LOWMEMORYMODE //uncomment this to load centcom and runtime station and thats it.

#include "map_files\generic\CentCom.dmm"

Expand Down
16 changes: 16 additions & 0 deletions code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,19 @@
#define G_MALE 1
#define G_FEMALE 2
#define G_PLURAL 3

// Defines for used in creating "perks" for the species preference pages.
/// A key that designates UI icon displayed on the perk.
#define SPECIES_PERK_ICON "ui_icon"
/// A key that designates the name of the perk.
#define SPECIES_PERK_NAME "name"
/// A key that designates the description of the perk.
#define SPECIES_PERK_DESC "description"
/// A key that designates what type of perk it is (see below).
#define SPECIES_PERK_TYPE "perk_type"

// The possible types each perk can be.
// Positive perks are shown in green, negative in red, and neutral in grey.
#define SPECIES_POSITIVE_PERK "positive"
#define SPECIES_NEGATIVE_PERK "negative"
#define SPECIES_NEUTRAL_PERK "neutral"
3 changes: 3 additions & 0 deletions code/__DEFINES/antagonists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
#define BLOB_RANDOM_PLACEMENT 1


/// The dimensions of the antagonist preview icon. Will be scaled to this size.
#define ANTAGONIST_PREVIEW_ICON_SIZE 96

/// How many telecrystals a normal traitor starts with
#define TELECRYSTALS_DEFAULT 20
/// How many telecrystals mapper/admin only "precharged" uplink implant
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/colors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define COLOR_ALMOST_BLACK "#333333"
#define COLOR_BLACK "#000000"
#define COLOR_RED "#FF0000"
#define COLOR_MOSTLY_PURE_RED "#FF3300"
#define COLOR_RED_LIGHT "#FF3333"
#define COLOR_MAROON "#800000"
#define COLOR_YELLOW "#FFFF00"
Expand Down Expand Up @@ -43,6 +44,7 @@
#define COLOR_PALE_RED_GRAY "#D59998"
#define COLOR_PALE_PURPLE_GRAY "#CBB1CA"
#define COLOR_PURPLE_GRAY "#AE8CA8"
#define COLOR_VIBRANT_LIME "#00FF00"

//Color defines used by the assembly detailer.
#define COLOR_ASSEMBLY_BLACK "#545454"
Expand All @@ -60,3 +62,6 @@
#define COLOR_ASSEMBLY_LBLUE "#5D99BE"
#define COLOR_ASSEMBLY_BLUE "#38559E"
#define COLOR_ASSEMBLY_PURPLE "#6F6192"

/// The default color for admin say, used as a fallback when the preference is not enabled
#define DEFAULT_ASAY_COLOR COLOR_MOSTLY_PURE_RED
19 changes: 19 additions & 0 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,25 @@
#define MICE (1<<19) //disliked/liked by anything that dislikes/likes any of RAW, MEAT, or GROSS, except felinids
#define NUTS (1<<20)

/// A list of food type names, in order of their flags
#define FOOD_FLAGS list( \
"MEAT", \
"VEGETABLES", \
"RAW", \
"JUNKFOOD", \
"GRAIN", \
"FRUIT", \
"DAIRY", \
"FRIED", \
"ALCOHOL", \
"SUGAR", \
"GROSS", \
"TOXIC", \
"PINEAPPLE", \
"BREAKFAST", \
"CLOTH", \
)

#define DRINK_NICE 1
#define DRINK_GOOD 2
#define DRINK_VERYGOOD 3
Expand Down
21 changes: 21 additions & 0 deletions code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,27 @@
#define JOB_DISPLAY_ORDER_CLERK 39
#define JOB_DISPLAY_ORDER_CHAPLAIN 40

#define DEPARTMENT_UNASSIGNED "No department assigned"
#define DEPARTMENT_BITFLAG_SECURITY (1<<0)
#define DEPARTMENT_SECURITY "Security"
#define DEPARTMENT_BITFLAG_COMMAND (1<<1)
#define DEPARTMENT_COMMAND "Command"
#define DEPARTMENT_BITFLAG_SERVICE (1<<2)
#define DEPARTMENT_SERVICE "Service"
#define DEPARTMENT_BITFLAG_CARGO (1<<3)
#define DEPARTMENT_CARGO "Cargo"
#define DEPARTMENT_BITFLAG_ENGINEERING (1<<4)
#define DEPARTMENT_ENGINEERING "Engineering"
#define DEPARTMENT_BITFLAG_SCIENCE (1<<5)
#define DEPARTMENT_SCIENCE "Science"
#define DEPARTMENT_BITFLAG_MEDICAL (1<<6)
#define DEPARTMENT_MEDICAL "Medical"
#define DEPARTMENT_BITFLAG_SILICON (1<<7)
#define DEPARTMENT_SILICON "Silicon"
#define DEPARTMENT_BITFLAG_ASSISTANT (1<<8)
#define DEPARTMENT_ASSISTANT "Assistant"
#define DEPARTMENT_BITFLAG_CAPTAIN (1<<9)
#define DEPARTMENT_CAPTAIN "Captain"

/proc/find_job(target)
//Get the job from the mind
Expand Down
51 changes: 51 additions & 0 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,54 @@
#define JP_LOW 1
#define JP_MEDIUM 2
#define JP_HIGH 3


//recommened client FPS
#define RECOMMENDED_FPS 100


// randomise_appearance_prefs() and randomize_human_appearance() proc flags
#define RANDOMIZE_SPECIES (1<<0)
#define RANDOMIZE_NAME (1<<1)


//randomised elements
#define RANDOM_ANTAG_ONLY 1
#define RANDOM_DISABLED 2
#define RANDOM_ENABLED 3


// Values for /datum/preference/savefile_identifier
/// This preference is character specific.
#define PREFERENCE_CHARACTER "character"
/// This preference is account specific.
#define PREFERENCE_PLAYER "player"

// Values for /datum/preferences/current_tab
/// Open the character preference window
#define PREFERENCE_TAB_CHARACTER_PREFERENCES 0

/// Open the game preferences window
#define PREFERENCE_TAB_GAME_PREFERENCES 1

/// Open the keybindings window
#define PREFERENCE_TAB_KEYBINDINGS 2

/// These will be shown in the character sidebar, but at the bottom.
#define PREFERENCE_CATEGORY_FEATURES "features"

/// Any preferences that will show to the sides of the character in the setup menu.
#define PREFERENCE_CATEGORY_CLOTHING "clothing"

/// Preferences that will be put into the 3rd list, and are not contextual.
#define PREFERENCE_CATEGORY_NON_CONTEXTUAL "non_contextual"

/// Will be put under the game preferences window.
#define PREFERENCE_CATEGORY_GAME_PREFERENCES "game_preferences"

/// These will show in the list to the right of the character preview.
#define PREFERENCE_CATEGORY_SECONDARY_FEATURES "secondary_features"

/// These are preferences that are supplementary for main features,
/// such as hair color being affixed to hair.
#define PREFERENCE_CATEGORY_SUPPLEMENTAL_FEATURES "supplemental_features"
9 changes: 6 additions & 3 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@
#define INIT_ORDER_MATERIALS 76
#define INIT_ORDER_RESEARCH 75
#define INIT_ORDER_STATION 74
#define INIT_ORDER_QUIRKS 73
#define INIT_ORDER_EVENTS 70
#define INIT_ORDER_MAPPING 65
#define INIT_ORDER_JOBS 60
#define INIT_ORDER_QUIRKS 55
#define INIT_ORDER_TICKER 50
#define INIT_ORDER_EARLY_ASSETS 48
#define INIT_ORDER_NETWORKS 45
#define INIT_ORDER_ECONOMY 40
#define INIT_ORDER_OUTPUTS 35
Expand All @@ -148,7 +149,8 @@
#define INIT_ORDER_TIMER 1
#define INIT_ORDER_DEFAULT 0
#define INIT_ORDER_AIR -1
#define INIT_ORDER_PERSISTENCE -2 //before assets because some assets take data from SSPersistence
#define INIT_ORDER_PERSISTENCE -2
#define INIT_ORDER_PERSISTENT_PAINTINGS -3 // Assets relies on this
#define INIT_ORDER_ASSETS -4
#define INIT_ORDER_ICON_SMOOTHING -5
#define INIT_ORDER_OVERLAY -6
Expand All @@ -160,7 +162,7 @@
#define INIT_ORDER_PATH -50
#define INIT_ORDER_DISCORD -60
#define INIT_ORDER_EXPLOSIONS -69
#define INIT_ORDER_STATPANELS -98
#define INIT_ORDER_STATPANELS -98
#define INIT_ORDER_DEMO -99 // To avoid a bunch of changes related to initialization being written, do this last
#define INIT_ORDER_CHAT -100 //Should be last to ensure chat remains smooth during init.

Expand Down Expand Up @@ -188,6 +190,7 @@
#define FIRE_PRIORITY_PARALLAX 65
#define FIRE_PRIORITY_INSTRUMENTS 80
#define FIRE_PRIORITY_MOBS 100
#define FIRE_PRIORITY_ASSETS 105
#define FIRE_PRIORITY_TGUI 110
#define FIRE_PRIORITY_TICKER 200
#define FIRE_PRIORITY_ATMOS_ADJACENCY 300
Expand Down
9 changes: 5 additions & 4 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -698,11 +698,12 @@
else
L1[key] = other_value

/proc/assoc_list_strip_value(list/input)
var/list/ret = list()
/// Turns an associative list into a flat list of keys
/proc/assoc_to_keys(list/input)
var/list/keys = list()
for(var/key in input)
ret += key
return ret
keys += key
return keys

/proc/compare_list(list/l,list/d)
if(!islist(l) || !islist(d))
Expand Down
18 changes: 18 additions & 0 deletions code/__HELPERS/colors.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// Given a color in the format of "#RRGGBB", will return if the color
/// is dark.
/proc/is_color_dark(color, threshold = 25)
var/hsl = rgb2num(color, COLORSPACE_HSL)
return hsl[3] < threshold

/// Given a 3 character color (no hash), converts it into #RRGGBB (with hash)
/proc/expand_three_digit_color(color)
if (length_char(color) != 3)
CRASH("Invalid 3 digit color: [color]")

var/final_color = "#"

for (var/digit = 1 to 3)
final_color += copytext(color, digit, digit + 1)
final_color += copytext(color, digit, digit + 1)

return final_color
19 changes: 17 additions & 2 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
/proc/random_skin_tone()
return pick(GLOB.skin_tones)

GLOBAL_LIST_INIT(skin_tones, list(
GLOBAL_LIST_INIT(skin_tones, sortList(list(
"albino",
"caucasian1",
"caucasian2",
Expand All @@ -213,7 +213,22 @@ GLOBAL_LIST_INIT(skin_tones, list(
"indian",
"african1",
"african2"
))
)))

GLOBAL_LIST_INIT(skin_tone_names, list(
"african1" = "Medium brown",
"african2" = "Dark brown",
"albino" = "Albino",
"arab" = "Light brown",
"asian1" = "Ivory",
"asian2" = "Beige",
"caucasian1" = "Porcelain",
"caucasian2" = "Light peach",
"caucasian3" = "Peach",
"indian" = "Brown",
"latino" = "Light beige",
"mediterranean" = "Olive",
))

GLOBAL_LIST_EMPTY(species_list)

Expand Down
9 changes: 8 additions & 1 deletion code/__HELPERS/sanitize_values.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
return number
return default

/proc/sanitize_float(number, min=0, max=1, accuracy=1, default=0)
if(isnum(number))
number = round(number, accuracy)
if(min <= number && number <= max)
return number
return default

/proc/sanitize_text(text, default="")
if(istext(text))
return text
Expand Down Expand Up @@ -79,7 +86,7 @@

return crunch + .

/proc/sanitize_ooccolor(color)
/proc/sanitize_color(color)
if(length(color) != length_char(color))
CRASH("Invalid characters in color '[color]'")
var/list/HSL = rgb2hsl(hex2num(copytext(color, 2, 4)), hex2num(copytext(color, 4, 6)), hex2num(copytext(color, 6, 8)))
Expand Down
5 changes: 5 additions & 0 deletions code/__HELPERS/text.dm
Original file line number Diff line number Diff line change
Expand Up @@ -841,3 +841,8 @@ GLOBAL_LIST_INIT(binary, list("0","1"))

#define is_alpha(X) ((text2ascii(X) <= 122) && (text2ascii(X) >= 97))
#define is_digit(X) ((length(X) == 1) && (length(text2num(X)) == 1))

/// Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts
/proc/sanitize_css_class_name(name)
var/static/regex/regex = new(@"[^a-zA-Z0-9]","g")
return replacetext(name, regex, "")
3 changes: 3 additions & 0 deletions code/_globalvars/_regexes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//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_color, /regex, regex("^#\[0-9a-fA-F]{6}$"))
21 changes: 1 addition & 20 deletions code/_globalvars/lists/client.dm
Original file line number Diff line number Diff line change
@@ -1,21 +1,2 @@
GLOBAL_LIST_EMPTY(classic_keybinding_list_by_key)
GLOBAL_LIST_EMPTY(hotkey_keybinding_list_by_key)
GLOBAL_LIST_EMPTY(default_hotkeys)
GLOBAL_LIST_EMPTY(keybindings_by_name)

// This is a mapping from JS keys to Byond - ref: https://keycode.info/
GLOBAL_LIST_INIT(_kbMap, list(
"UP" = "North",
"RIGHT" = "East",
"DOWN" = "South",
"LEFT" = "West",
"INSERT" = "Insert",
"HOME" = "Northwest",
"PAGEUP" = "Northeast",
"DEL" = "Delete",
"END" = "Southwest",
"PAGEDOWN" = "Southeast",
"SPACEBAR" = "Space",
"ALT" = "Alt",
"SHIFT" = "Shift",
"CONTROL" = "Ctrl"
))
14 changes: 13 additions & 1 deletion code/_globalvars/lists/flavor_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ GLOBAL_LIST_INIT(ai_core_display_screens, list(
"Triumvirate-M",
"Weird"))

/proc/resolve_ai_icon(input)
/// 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
Expand All @@ -112,6 +116,14 @@ GLOBAL_LIST_INIT(ai_core_display_screens, list(
return "ai-portrait" //just take this until they decide
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, list(SEC_DEPT_RANDOM, SEC_DEPT_NONE, SEC_DEPT_ENGINEERING, SEC_DEPT_MEDICAL, SEC_DEPT_SCIENCE, SEC_DEPT_SUPPLY, SEC_DEPT_SERVICE))

GLOBAL_LIST_INIT(engineering_depts_prefs, list(ENG_DEPT_RANDOM, ENG_DEPT_NONE, ENG_DEPT_MEDICAL, ENG_DEPT_SCIENCE, ENG_DEPT_SUPPLY, ENG_DEPT_SERVICE))
Expand Down
10 changes: 4 additions & 6 deletions code/_globalvars/lists/keybindings.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
/proc/add_keybinding(datum/keybinding/instance)
GLOB.keybindings_by_name[instance.name] = instance

// Classic
if(LAZYLEN(instance.classic_keys))
for(var/bound_key in instance.classic_keys)
LAZYADD(GLOB.classic_keybinding_list_by_key[bound_key], list(instance.name))

// Hotkey
if(LAZYLEN(instance.hotkey_keys))
for(var/bound_key in instance.hotkey_keys)
LAZYADD(GLOB.hotkey_keybinding_list_by_key[bound_key], list(instance.name))
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))
Expand Down
2 changes: 0 additions & 2 deletions code/controllers/configuration/entries/game_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@
key_mode = KEY_MODE_TEXT
value_mode = VALUE_MODE_FLAG

/datum/config_entry/flag/join_with_mutant_humans //players can pick mutant bodyparts for humans before joining the game

/datum/config_entry/flag/no_intercept_report //Whether or not to send a communications intercept report roundstart. This may be overridden by gamemodes.

/datum/config_entry/number/arrivals_shuttle_dock_window //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station
Expand Down
Loading