Goonstation 13 - Modules - TypesVar Details - Proc Details

(global)

Vars

RARITY_COLORGlobal static list of rarity color associations
Z4_ACTIVECentcom / Earth Stuff Contents: Areas: Main Area Outside Offices Lobby Lounge Garden Power Supply
action_namesUsed to translate internal action names to human-readable names.
action_verbsUsed for literal input of actions
all_valid_random_right_armsNumber of tiles where it should try to make a splatter
area_list_is_up_to_dateThe station_areas list is up to date. If something changes an area, make sure to set this to 0
biomesAll possible biomes in assoc list as type || instance
by_catcontains lists of objects indexed by a category string based on START_TRACKING_CAT / STOP_TRACKING_CAT
by_typecontains lists of objects indexed by their type based on START_TRACKING / STOP_TRACKING
cached_colorspaint cans
chessboard
ehjaxEHJAX - Like ajax but for ~byond~ A framework for browser popups to interact with the byond server, async (client-side)
fishing_spotsinitialised on world/New(), associative list with the format (fishing_atom_type = /datum/fishing_spot)
ircbotProcs for handling ircbot connectivity and data transfer
is_blank_string_regexReturns true if given string is just space characters The explicitly defined entries are various blank unicode characters that don't get included as white space by \s
key_namesUsed to translate bitflags of hotkeys into human-readable names
keybind_stylesThis file is intended to hold all data pertaining to keybind_style datums and related functionality
light_update_queueList of items that want to be deleted
material_category_namesMaterial category names as displayed in fabricators see match_material_pattern() for exact definitions
named_color_cacheglobal cache of all named colors once fetched with a color rgba
named_colorsglobal list of all named colors
opt_inactiveEXPERIMENTAL STUFF
oven_recipesCOOKING RECODE
phrase_logThis system keeps a logged list of player-created phrases of various categories. The lists are cross-round. Useful for stuff like hallucinations etc. If the number of phrases in a category exceeds src.max_length random phrases get thrown out to reduce the size when saving. Currently logged categories: say - people talking whisper - people whispering pda - pda messages deadsay - ghosts talking ailaw - custom AI laws record - custom radio station record names emote - custom emotes prayer - prayers name-X - player chosen name for X where X is from the set {blob, ai, cyborg, clown, mime, wizard, ...} vehicle - vehicle names (via a bottle of Champagne) sing - people singing pill - custom pill name bottle - custom obttle name voice-mimic - voices used by the changeling mimic voice ability voice-radiostation - voices used by the radio station voice synthesizer telepathy - messages sent through the telepathy genetics ability bot-X - custom bot name, X is from the set {camera, fire, guard, med, sec} (I bet you didn't even know you could rename bots with a pen, huh) name-bee - custom bee / bee larva name name-critter - custom critter name (you can rename those with a pen too, whoa) seed - custom botany seed name
portable_machineryRemote parent
sb_tricksTypes of sounds: AMBIENCE_LOOPING, AMBIENCE_FX_1, and AMBIENCE_FX_2 Holds the associated sound channel we want Determines if we are repeating or not Should the sound set the wait var? pool of precached sounds
special_admin_observing_verbsproc/possess, client/proc/generate_poster, client/proc/addpathogens, client/proc/debug_check_possible_reactions, client/proc/dbg_itemspecial, client/proc/dbg_objectprop,
station_areasAll the accessible areas on the station in one convenient place
statusGroupLimitsSimple global list of groupname : amount, that tells the system how many effects of a group we can have active at most. See exclusiveGroup. Buffs above the max will not be applied.
tgui_admin_statetgui state: admin_state
tgui_always_statetgui state: always_state
tgui_broken_statetgui state: broken
tgui_conscious_statetgui state: conscious_state
tgui_contained_statetgui state: contained_state
tgui_deep_inventory_statetgui state: deep_inventory_state
tgui_default_statetgui state: default_state
tgui_hands_statetgui state: hands_state
tgui_human_adjacent_statetgui state: human_adjacent_state
tgui_inventory_statetgui state: inventory_state
tgui_not_incapacitated_statetgui state: not_incapacitated_state
tgui_not_incapacitated_turf_statetgui state: not_incapacitated_turf_state
tgui_notcontained_statetgui state: notcontained_state
tgui_observer_statetgui state: observer_state
tgui_physical_obscured_statetgui state: physical_obscured_state
tgui_physical_statetgui state: physical_state
tgui_processtgui process
tgui_self_statetgui state: self_state
tgui_z_statetgui state: z_state
the_automatoncogwerks spooky automaton thing that kinda just sits there being weird and ominous
triggerVarsThis contains the names of the trigger lists on materials. Required for copying materials. Remember to keep this updated if you add new triggers.
vcs_revisionOPTIONS TO GO FAST PROFILING OPTIONS DEBUGGING TOGGLES MAP OVERRIDES Unit Test Framework HOLIDAYS AND OTHER SUCH TOGGLES
waterflow_enabledFluid Object

Procs

AuxSortLTpivot
ClearBadsmokeRefsSMOKE SYSTEMS
FindPromotionCandidatesCOMMAND PROMOTIONS
GetRandomPerimeterTurfReturns a turf at the edge of a squared circle of specified radius around a thing
IsGuestKeyReturns true if the given key is a guest key
SortListpivot
add_coloradds a named color to the global list given name and RGB color
affine_color_mapping_matrixThe same thing as [proc/color_mapping_matrix] but with 4 mapped colors. The first color is used as the origin in the affine transform.
angle2textReturns the given degree converted to a text string in the form of a direction
angle_to_dirTransforms a given angle to a cardinal/ordinal direction
angle_to_vectorTransforms a given angle to vec2 in a list
applyCableMaterialsYes hello apparently we need a proc for this because theres a million types of different wires and cables.
ass_explosion_limb_successFirst try to sever their butt If that didn't work, try severing a limb or tail Dont want your tail removed? Keep all your limbs intact! Returns 0 if it cant be severed like this, 1 if it always gets severed, or 2 if it sometimes gets severed
ass_explosion_messageReturns if the limb is not ass-severable, and a message to the owner about why not returns some flufftext as to why their limb didnt come off. Or came off anyway.
attack_particleobj/attackby(var/obj/item/I as obj, mob/user as mob)
attenuate_for_locationreturns 0 to 1 based on air pressure in turf
bash_explodeBASH explode: Splits a string into string pieces the same way BASH handles this.
blend_skintoneBlends given rgb values with old human mob skin color (#ffca95) to return a new rgb value
borkborkbork_parse!!! !!!
can_actReturns true if not incapicitated and unhandcuffed (by default)
change_ghost_invisibilityChanges ghost invisibility for the round.
checkTurfPassableReturns false if there is a dense atom on the turf, unless a custom hueristic is passed.
check_whitelistRemoves non-whitelisted reagents from the reagents of TA
checktraitorADMIN HELPER PROCS
color_mapping_matrixTakes two lists, inp=list(i1, i2, i3), out=(o1, o2, o3). Creates a color matrix which maps color i1 to o2, i2 to o2, i3 to o3. (Ignores alpha values.) Keep the i1, i2, i3 vectors linearly independent. The colors can be either be color hex strings or lists as returned from hex_to_rgb_list. You need to supply all arguments. If you don't care about the third just set i3 = o3 to something linearly independent of i1 and i2.
concrete_typesoftypesof() but only for concrete (not abstract) types, it caches the result so you don't need to worry about doing that manually so subsequent calls on the same type will be very fast.
copyMaterialReturns a copy of a given material.
create_named_colorscalled at world startup populates the color list
csoundSoundcache NEVER use these sounds for modifying. This should only be used for sounds that are played unaltered to the user. @param text name the name of the sound that will be returned @return sound
dead_player_listReturns a list of eligible dead players to be respawned as an antagonist or whatever (Convair880). Text messages: 1: alert | 2: alert (chatbox) | 3: alert acknowledged (chatbox) | 4: no longer eligible (chatbox) | 5: waited too long (chatbox)
dir_to_angleTransforms a cardinal/ordinal direction to an angle
doAssetParseCDN PROCS FOR LIVE SERVERS
english_listGiven a list, returns a text string representation of the list's contents.
filter_is_character_setup_ringtonetype filter for ringtones that're suposed to be selectable at roundstart
filtered_concrete_typesofThe same thing but now you can filter the types using a proc. Also cached. The filter proc takes a type and should return 1 if we want to include it and 0 otherwise. That proc should also be pure (always return the same thing for the same arguments) because of the caching. If you want to use non-pure proc do the filtering manually yourself and don't use this. Note that the first call to filtered_concrete_typesof with a given type and filter will be (possibly a lot) slower than doing it manually. The benefit of this proc only shows itself for future calls which are very fast due to caching.
find_ghost_by_keyfind a ghost mob (or a ghost respawned as critter in vr/afterlife bar)
find_playerreturns a reference to a player datum based on the ckey you put into it
flockBasedGarbleTextReturns given text replaced by nonsense but its based off of a modifier + flock's garblyness
gas_text_colorEnables debug overlay which counts process_cell() calls per turf (viewable through info-overlays) Enables debug overlay which counts all atmos operations per turf (viewable through info-overlays) Puts a list of turfs which get processed a lot into global.hotly_processed_turf for debugging Returns the color of a given gas ID.
getClientFromCkeyFinds a client by ckey, throws exception if not found
getFusedMaterialMerges two materials and returns result as new material.
getFusedTriggersFuses two material trigger lists.
getIconSizeHandles the two states icon_size can be in: basic number, or string in WxH format
getInterpolatedNameMerges two material names into one.
getItemIconGenerates item icons for manufacturers and other things, used in UI dialogs. Sends to client if needed.
getLineMatrixReturns the line matrix from a start atom to an end atom, used in creating line objects
getMatFailStringReturns a string for when a material fail or breaks depending on its material flags.
getMatFlagStringTranslates a material flag into a string.
getMaterialReturns one of the base materials by id.
getOreQualityName*** MISC ***
getQualityNameSimply returns a string for a given quality. Used as prefix for objects.
getRoleReturns a string based on the current job and antag role of the mob e.g. "Staff Assistant [Traitor]"
getTimeInSecondsSinceTimeReturns the time in seconds since a given timestamp
get_adjacent_floorReturns the turf facing the fab for cardinal directions (which should also be the user's turf), but for diagonals it returns a neighbouring turf depending on where you click Just in case you're attacking a corner diagonally. (made initially for lamp manufacturers, probably behaves funky above range 1)
get_alive_antags_percentagereturns a decimal representing the percentage of alive crew that are also antags
get_all_accesses/ Heads of staff / Security / Medical / Science Engineering / Civilian Other or gimmick
get_all_character_setup_ringtonessets up the list of ringtones players can select through character setup
get_all_mobs_inReturns list of all mobs within an atom. Not cheap! (unlike ur mum)
get_angleReturns the angle between two given atoms
get_assetsReturns either the already-created asset or creates a new one and returns it
get_dead_crew_percentagereturns a decimal representing the percentage of dead crew (non-observers) to all crew
get_hud_styleReturns hud style preferences of given client/mob
get_image_groupReturns the client image group for a given "key" argument. If one doesn't yet exist, creates it.
get_nearest_colorreturns the name of the color nearest to the given color RGB
get_nearest_color_datumreturns the named_color datum that is nearest to the given color RGB
get_singletonGets the instance of a singleton type (or a non-singleton type if you decide to use it on one).
get_standard_skintoneGiven user, will proompt user to select skin color from list (or custom) and returns skin tone after blending
get_type_typeinfoRetrieves the typeinfo datum for a given type.
gradientTextReturns span with a color gradient between two given colors of given message
handleTriggerGenerationsIncreases generations on material triggers and handles removal if over the generation cap.
hasParentMaterialSearches the parent materials of the given material, up to a given generation, for an id.
hex2color_nameGiven hex color, returns string name of nearest named color
hsv_transform_color_matrixGenerates a color matrix which performs an approximation of the HSV-space transform. Hue is in degrees and is applied additively. Saturation is in a 0-1 range and is applied multiplicatively. Value is in a 0-1 range and is applied multiplicatively.
illiterateGarbleTextReturns given text replaced entirely by nonsense chars
in_cone_of_visionThis proc checks if one atom is in the cone of vision of another one.
in_interact_rangeFor interacting with stuff.
initialise_fishing_spotsrun on world/New(), clears global.fishing_spots (if it exists) and fills it with the format (fishing_atom_type = /datum/fishing_spot)
initialize_biomesInitialize all biomes, assoc as type || instance
isUpperReturns true if the char you feed it is uppercase.
isVowelReturns true if the given string has a vowel
is_hexReturns true if given value is a hex value
is_incapacitatedReturns true if the given mob is incapacitated
isadminReturns true if given mob/client/mind is an admin
jobban_isbannedCan be provided with a mob, a raw cache list, or a ckey. Prefer providing a cache if you can't use a mob, as that reduces API load.
lerpLinear interpolation
log_tguiAppends a tgui-related log entry. All arguments are optional.
make_fake_explosionobj/item/tank/plasma = 2
make_playerreturns a reference to a player datum, but it tries to make a new one if it cant an already existing one (this is how it persists between connections)
matchesMaterialRecipeChecks if a material matches a recipe and returns the recipe if a match is found. returns null if nothing matches it.
maximal_subtypeReturns the maximal subtype (i.e. the most subby) in a list of given types
mult_color_matrixTakes two 20-length lists, turns them into 5x4 matrices, multiplies them together, and returns a 20-length list
normalize_color_to_matrixTakes a possible value of the color var and returns a length 20 color matrix doing the same thing. Available inputs: null, "#rgb", "#rrggbb", "#rgba", "#rrggbbaa", all forms of color matrices
o_clock_timeReturns the current timeofday in o'clock format
placeAllPrefabs
playsound_globalPlays a sound to some clients without caring about its source location and stuff. target can be either a list of clients or a list of mobs or world or an area or a z-level number.
predecessor_path_in_listFind predecessor of a type
qdelqdel
radioGarbleTextReturns given text replaced by nonsense chars, on a 40% or given % basis
random_emojiGenerates a random Unicode emoji that will look ok in the chat
random_hexReturns random hex value of length given
resourceGENERIC HELPERS FOR BOTH SYSTEMS
round_start_dataFOR EXPORTING DATA TO A SERVER
s_esReturns the plural based on a number provided.
sanitize_frequencyReturns f, ensured that it's a valid frequency
sendItemIconsSends all of the item icons to a client. Kinda gross, but whatever.
sendItemIconsToAllSends all item icons to all clients. Used at world startup to preload things.
send_assetsSends the list of asset files to client if they're needed
separate_radio_prefix_and_messageGiven a message, returns a list containing the radio prefix and the message, so that the message can be manipulated seperately in various functions.
showLineCreates and shows a line object. Line object has an "affected" var that contains the cross tiles.
showadminlistShows the calling client admins.txt
smilify!!! !!!
sonic_attack_environmental_effectGiven center turf/atom, range, and list of things to smash, will damage said objects within range of center. Used for sonic grenades and similar. Avoiding C&P Code.
soviet_parse!!! !!! !!! !!!
statlog_ticketFOR LOGGING TO STATS FILE
stripTextMacrosRemoves the special data inserted via use of \improper etc in strings
test_disposal_systemClothing properties stuff
tgui_TopicMiddleware for /client/Topic.
tgui_alertCreates a TGUI alert window and returns the user's response.
tgui_alert_asyncCreates an asynchronous TGUI alert window with an associated callback.
tgui_input_listCreates a TGUI input list window and returns the user's response.
tgui_input_list_asyncCreates an asynchronous TGUI input list window with an associated callback.
time_to_textReturns the passed decisecond-format time in the form of a text string
tomatogibsYou will appear adjacent to Hastur.
ucfirstUppercases first letter
ucfirstsUppercases first letter of every word
uwutalkuwutalk
vector_magnitudeReturns the vector magnitude of an x value and a y value
vector_to_dirTransforms a supplied vector x & y to a direction
whodeadFinds whoever's dead.
whoisLooks up a player based on a string. Searches a shit load of things ~whoa~. Returns a list of mob refs.
whois_ckey_to_mob_referenceA universal ckey -> mob reference lookup proc, adapted from whois() (Convair880).

Var Details

RARITY_COLOR

Global static list of rarity color associations

Z4_ACTIVE

Centcom / Earth Stuff Contents: Areas: Main Area Outside Offices Lobby Lounge Garden Power Supply

Turfs: Outside Concrete & Grass

action_names

Used to translate internal action names to human-readable names.

action_verbs

Used for literal input of actions

all_valid_random_right_arms

Number of tiles where it should try to make a splatter

area_list_is_up_to_date

The station_areas list is up to date. If something changes an area, make sure to set this to 0

biomes

All possible biomes in assoc list as type || instance

by_cat

contains lists of objects indexed by a category string based on START_TRACKING_CAT / STOP_TRACKING_CAT

by_type

contains lists of objects indexed by their type based on START_TRACKING / STOP_TRACKING

cached_colors

paint cans

chessboard


|\ |\ |\ |\ ___ \ |\ __\ |\ |\ _ \ _ |\ __ |\ |_ \ ___ \ |\ __ \ |\ ____\ |\ \ / __ |_ \
\ \ _
|\ \ \\ \ \ /|\ \ _|
\ \ _
|\ \ \_
\ \ \ \ |\ \ \ _
||
\ _\ \ /|\ \ |\ \ \ \ _|
\ \ _
|
|/|\ ||\ /
\ \ \ \ \ __ \ \ _|/\ _
_ \ _____ \ \ \|__| \ \ \ __ \ _____ \ \ \ \ \ \ _|/\ \ _ \ \ ___ \ _____ |/ \ \ \ |\ \
\ \ _\ \ \ \ \ \ _|\ ||\ \||\ \ \ \ \ \ \ \ \ \ ||\ \ \ \ \ \ \ _|\ \ \ \ | __||\ \||\ \ \ \ \ _\ \
\ _
__\ _\ _\ _____\ \ ___\ \ _\ \ _\ _\ ___\ \ \ _\ \ _\ _\ |___\ \ _\ \ \ _|_\
|
____||||||_______|_\_|| ||||||_\ || |_||||||_\\ ||||
|
|| || ||___|


|\ _|\ __ |\ __ |\ \ / /|\ __ |\ |\ |\ |\ |_ _\ / ___ |\ __ |\ __ |\ ____\ |\ \ |\ |\ __ |\ __ |\ ____\
\ \ _
|\ \ |\ \ \ |\ \ \ / / | \ |\ \ \ \ \ _
|\ \ \\ |
\ _| /__/|_/ /\ \ |\ \ \ |\ \ \ _| \ \ \ \ \ \ \ |\ \ \ |\ \ \ _|
\ \ \ \ \ \\ \ \ \ \ / / \ \ _ \ \ \ \ \ \ \ __ \ \ \ \ ||// / /\ \ \\ \ \ \\ \ \ _ \ \ \ \ \ \ \ __ \ \ _ \ \ \
\ \ _
\ \ \\ \ \ _
|/ / / \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ ___ / /_/__\ \ \\ \ \ \\ \ \ ___ \ \ \ |__\ \ \ \ \ \ \ \ \ \ _
\ _\ _\ _\ __/ / / \ _\ \ _\ ______\ _\ _\ \ _\\\ _\ _\ _\\ _________\ _\ _\ _\ \ ______
|||||||_/ / |||||__||_______||||| |||||||||||||__________||||||||||____| ||/

ehjax

EHJAX - Like ajax but for ~byond~ A framework for browser popups to interact with the byond server, async (client-side)

fishing_spots

initialised on world/New(), associative list with the format (fishing_atom_type = /datum/fishing_spot)

ircbot

Procs for handling ircbot connectivity and data transfer

is_blank_string_regex

Returns true if given string is just space characters The explicitly defined entries are various blank unicode characters that don't get included as white space by \s

key_names

Used to translate bitflags of hotkeys into human-readable names

keybind_styles

This file is intended to hold all data pertaining to keybind_style datums and related functionality

To add a new keybind: Add it in the right keybind_style below. Then, you need to update action_names to allow the menu to translate into human-readable format. Depending on what you're adding, you might need to update action_verbs as well. Global list holding all of the keybind style datums

light_update_queue

List of items that want to be deleted

material_category_names

Material category names as displayed in fabricators see match_material_pattern() for exact definitions

named_color_cache

global cache of all named colors once fetched with a color rgba

named_colors

global list of all named colors

opt_inactive

EXPERIMENTAL STUFF

oven_recipes

COOKING RECODE

phrase_log

This system keeps a logged list of player-created phrases of various categories. The lists are cross-round. Useful for stuff like hallucinations etc. If the number of phrases in a category exceeds src.max_length random phrases get thrown out to reduce the size when saving. Currently logged categories: say - people talking whisper - people whispering pda - pda messages deadsay - ghosts talking ailaw - custom AI laws record - custom radio station record names emote - custom emotes prayer - prayers name-X - player chosen name for X where X is from the set {blob, ai, cyborg, clown, mime, wizard, ...} vehicle - vehicle names (via a bottle of Champagne) sing - people singing pill - custom pill name bottle - custom obttle name voice-mimic - voices used by the changeling mimic voice ability voice-radiostation - voices used by the radio station voice synthesizer telepathy - messages sent through the telepathy genetics ability bot-X - custom bot name, X is from the set {camera, fire, guard, med, sec} (I bet you didn't even know you could rename bots with a pen, huh) name-bee - custom bee / bee larva name name-critter - custom critter name (you can rename those with a pen too, whoa) seed - custom botany seed name

portable_machinery

Remote parent

sb_tricks

Types of sounds: AMBIENCE_LOOPING, AMBIENCE_FX_1, and AMBIENCE_FX_2 Holds the associated sound channel we want Determines if we are repeating or not Should the sound set the wait var? pool of precached sounds

special_admin_observing_verbs

proc/possess, client/proc/generate_poster, client/proc/addpathogens, client/proc/debug_check_possible_reactions, client/proc/dbg_itemspecial, client/proc/dbg_objectprop,

station_areas

All the accessible areas on the station in one convenient place

statusGroupLimits

Simple global list of groupname : amount, that tells the system how many effects of a group we can have active at most. See exclusiveGroup. Buffs above the max will not be applied.

tgui_admin_state

tgui state: admin_state

Checks that the user is an admin, end-of-story.

tgui_always_state

tgui state: always_state

Always grants the user UI_INTERACTIVE. Period.

tgui_broken_state

tgui state: broken

Only checks if an object is not broken, can depend on obj type

tgui_conscious_state

tgui state: conscious_state

Only checks if the user is conscious.

tgui_contained_state

tgui state: contained_state

Checks that the user is inside the src_object.

tgui_deep_inventory_state

tgui state: deep_inventory_state

Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory.

tgui_default_state

tgui state: default_state

Checks a number of things -- mostly physical distance for humans and view for robots.

tgui_hands_state

tgui state: hands_state

Checks that the src_object is in the user's hands.

tgui_human_adjacent_state

tgui state: human_adjacent_state

In addition to default checks, only allows interaction for a human adjacent user.

tgui_inventory_state

tgui state: inventory_state

Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.

tgui_not_incapacitated_state

tgui state: not_incapacitated_state

Checks that the user isn't incapacitated

tgui_not_incapacitated_turf_state

tgui state: not_incapacitated_turf_state

Checks that the user isn't incapacitated and that their loc is a turf

tgui_notcontained_state

tgui state: notcontained_state

Checks that the user is not inside src_object, and then makes the default checks.

tgui_observer_state

tgui state: observer_state

Checks that the user is an observer/ghost.

tgui_physical_obscured_state

tgui state: physical_obscured_state

Short-circuits the default state to only check physical distance, being in view doesn't matter

tgui_physical_state

tgui state: physical_state

Short-circuits the default state to only check physical distance.

tgui_process

tgui process

Contains a bit of the tgui process code. Copyright (c) 2020 Aleksej Komarov & ZeWaka (minor porting changes) SPDX-License-Identifier: MIT

tgui_self_state

tgui state: self_state

Only checks that the user and src_object are the same.

tgui_z_state

tgui state: z_state

Only checks that the Z-level of the user and src_object are the same.

the_automaton

cogwerks spooky automaton thing that kinda just sits there being weird and ominous

triggerVars

This contains the names of the trigger lists on materials. Required for copying materials. Remember to keep this updated if you add new triggers.

vcs_revision

OPTIONS TO GO FAST PROFILING OPTIONS DEBUGGING TOGGLES MAP OVERRIDES Unit Test Framework HOLIDAYS AND OTHER SUCH TOGGLES

waterflow_enabled

Fluid Object

Proc Details

AuxSortLT

pivot

ClearBadsmokeRefs

SMOKE SYSTEMS

FindPromotionCandidates

COMMAND PROMOTIONS

GetRandomPerimeterTurf

Returns a turf at the edge of a squared circle of specified radius around a thing

IsGuestKey

Returns true if the given key is a guest key

SortList

pivot

add_color

adds a named color to the global list given name and RGB color

affine_color_mapping_matrix

The same thing as [proc/color_mapping_matrix] but with 4 mapped colors. The first color is used as the origin in the affine transform.

angle2text

Returns the given degree converted to a text string in the form of a direction

angle_to_dir

Transforms a given angle to a cardinal/ordinal direction

angle_to_vector

Transforms a given angle to vec2 in a list

applyCableMaterials

Yes hello apparently we need a proc for this because theres a million types of different wires and cables.

ass_explosion_limb_success

First try to sever their butt If that didn't work, try severing a limb or tail Dont want your tail removed? Keep all your limbs intact! Returns 0 if it cant be severed like this, 1 if it always gets severed, or 2 if it sometimes gets severed

ass_explosion_message

Returns if the limb is not ass-severable, and a message to the owner about why not returns some flufftext as to why their limb didnt come off. Or came off anyway.

attack_particle

obj/attackby(var/obj/item/I as obj, mob/user as mob)

attenuate_for_location

returns 0 to 1 based on air pressure in turf

bash_explode

BASH explode: Splits a string into string pieces the same way BASH handles this.

blend_skintone

Blends given rgb values with old human mob skin color (#ffca95) to return a new rgb value

borkborkbork_parse

!!! !!!

can_act

Returns true if not incapicitated and unhandcuffed (by default)

change_ghost_invisibility

Changes ghost invisibility for the round.

checkTurfPassable

Returns false if there is a dense atom on the turf, unless a custom hueristic is passed.

check_whitelist

Removes non-whitelisted reagents from the reagents of TA

checktraitor

ADMIN HELPER PROCS

color_mapping_matrix

Takes two lists, inp=list(i1, i2, i3), out=(o1, o2, o3). Creates a color matrix which maps color i1 to o2, i2 to o2, i3 to o3. (Ignores alpha values.) Keep the i1, i2, i3 vectors linearly independent. The colors can be either be color hex strings or lists as returned from hex_to_rgb_list. You need to supply all arguments. If you don't care about the third just set i3 = o3 to something linearly independent of i1 and i2.

concrete_typesof

typesof() but only for concrete (not abstract) types, it caches the result so you don't need to worry about doing that manually so subsequent calls on the same type will be very fast.

just don't modify the result of the call directly OKAY: var/list/hats = concrete_typesof(/obj/item/clothing/head) - /obj/item/clothing/head/hosberet

ALSO OKAY:

var/list/hats = concrete_typesof(/obj/item/clothing/head).Copy()
hats -= /obj/item/clothing/head/hosberet

NOT OKAY:

var/list/hats = concrete_typesof(/obj/item/clothing/head)
hats -= /obj/item/clothing/head/hosberet

copyMaterial

Returns a copy of a given material.

create_named_colors

called at world startup populates the color list

csound

Soundcache NEVER use these sounds for modifying. This should only be used for sounds that are played unaltered to the user. @param text name the name of the sound that will be returned @return sound

dead_player_list

Returns a list of eligible dead players to be respawned as an antagonist or whatever (Convair880). Text messages: 1: alert | 2: alert (chatbox) | 3: alert acknowledged (chatbox) | 4: no longer eligible (chatbox) | 5: waited too long (chatbox)

dir_to_angle

Transforms a cardinal/ordinal direction to an angle

doAssetParse

CDN PROCS FOR LIVE SERVERS

PROCS FOR LOCAL SERVER FALLBACK

english_list

Given a list, returns a text string representation of the list's contents.

filter_is_character_setup_ringtone

type filter for ringtones that're suposed to be selectable at roundstart

filtered_concrete_typesof

The same thing but now you can filter the types using a proc. Also cached. The filter proc takes a type and should return 1 if we want to include it and 0 otherwise. That proc should also be pure (always return the same thing for the same arguments) because of the caching. If you want to use non-pure proc do the filtering manually yourself and don't use this. Note that the first call to filtered_concrete_typesof with a given type and filter will be (possibly a lot) slower than doing it manually. The benefit of this proc only shows itself for future calls which are very fast due to caching.

Example:

proc/filter_is_syndicate(type)
	var/obj/fake_instance = type
	return initial(fake_instance.is_syndicate)

var/syndie_thing_type = pick(filtered_concrete_typesof(/obj/item, /proc/filter_is_syndicate))

find_ghost_by_key

find a ghost mob (or a ghost respawned as critter in vr/afterlife bar)

find_player

returns a reference to a player datum based on the ckey you put into it

flockBasedGarbleText

Returns given text replaced by nonsense but its based off of a modifier + flock's garblyness

gas_text_color

Enables debug overlay which counts process_cell() calls per turf (viewable through info-overlays) Enables debug overlay which counts all atmos operations per turf (viewable through info-overlays) Puts a list of turfs which get processed a lot into global.hotly_processed_turf for debugging Returns the color of a given gas ID.

This is used only in the gas mixer computer as of now.

getClientFromCkey

Finds a client by ckey, throws exception if not found

getFusedMaterial

Merges two materials and returns result as new material.

getFusedTriggers

Fuses two material trigger lists.

getIconSize

Handles the two states icon_size can be in: basic number, or string in WxH format

getInterpolatedName

Merges two material names into one.

getItemIcon

Generates item icons for manufacturers and other things, used in UI dialogs. Sends to client if needed.

getLineMatrix

Returns the line matrix from a start atom to an end atom, used in creating line objects

getMatFailString

Returns a string for when a material fail or breaks depending on its material flags.

getMatFlagString

Translates a material flag into a string.

getMaterial

Returns one of the base materials by id.

getOreQualityName

*** MISC ***

getQualityName

Simply returns a string for a given quality. Used as prefix for objects.

getRole

Returns a string based on the current job and antag role of the mob e.g. "Staff Assistant [Traitor]"

getTimeInSecondsSinceTime

Returns the time in seconds since a given timestamp

get_adjacent_floor

Returns the turf facing the fab for cardinal directions (which should also be the user's turf), but for diagonals it returns a neighbouring turf depending on where you click Just in case you're attacking a corner diagonally. (made initially for lamp manufacturers, probably behaves funky above range 1)

get_alive_antags_percentage

returns a decimal representing the percentage of alive crew that are also antags

get_all_accesses

/ Heads of staff / Security / Medical / Science Engineering / Civilian Other or gimmick

get_all_character_setup_ringtones

sets up the list of ringtones players can select through character setup

get_all_mobs_in

Returns list of all mobs within an atom. Not cheap! (unlike ur mum)

get_angle

Returns the angle between two given atoms

get_assets

Returns either the already-created asset or creates a new one and returns it

get_dead_crew_percentage

returns a decimal representing the percentage of dead crew (non-observers) to all crew

get_hud_style

Returns hud style preferences of given client/mob

get_image_group

Returns the client image group for a given "key" argument. If one doesn't yet exist, creates it.

get_nearest_color

returns the name of the color nearest to the given color RGB

get_nearest_color_datum

returns the named_color datum that is nearest to the given color RGB

get_singleton

Gets the instance of a singleton type (or a non-singleton type if you decide to use it on one).

get_standard_skintone

Given user, will proompt user to select skin color from list (or custom) and returns skin tone after blending

get_type_typeinfo

Retrieves the typeinfo datum for a given type.

Example:

for(var/type in types)
	var/typeinfo/atom/typeinfo = get_type_typeinfo(type)
	if(!typeinfo.admin_spawnable)
		continue
	valid_types += type

gradientText

Returns span with a color gradient between two given colors of given message

handleTriggerGenerations

Increases generations on material triggers and handles removal if over the generation cap.

hasParentMaterial

Searches the parent materials of the given material, up to a given generation, for an id.

Useful if you want to figure out if a given material was used in the making of another material.

Keep in mind that this can be expensive so use it only when you have to.

hex2color_name

Given hex color, returns string name of nearest named color

hsv_transform_color_matrix

Generates a color matrix which performs an approximation of the HSV-space transform. Hue is in degrees and is applied additively. Saturation is in a 0-1 range and is applied multiplicatively. Value is in a 0-1 range and is applied multiplicatively.

illiterateGarbleText

Returns given text replaced entirely by nonsense chars

in_cone_of_vision

This proc checks if one atom is in the cone of vision of another one.

It uses the following map grid for the check, where each point is an integer coordinate and the seer is at point X: ```

POV ->	X * * *


```

A '*' represents a point that is within X's FOV

in_interact_range

For interacting with stuff.

initialise_fishing_spots

run on world/New(), clears global.fishing_spots (if it exists) and fills it with the format (fishing_atom_type = /datum/fishing_spot)

initialize_biomes

Initialize all biomes, assoc as type || instance

isUpper

Returns true if the char you feed it is uppercase.

isVowel

Returns true if the given string has a vowel

is_hex

Returns true if given value is a hex value

is_incapacitated

Returns true if the given mob is incapacitated

isadmin

Returns true if given mob/client/mind is an admin

jobban_isbanned

Can be provided with a mob, a raw cache list, or a ckey. Prefer providing a cache if you can't use a mob, as that reduces API load.

lerp

Linear interpolation

log_tgui

Appends a tgui-related log entry. All arguments are optional.

make_fake_explosion

obj/item/tank/plasma = 2

make_player

returns a reference to a player datum, but it tries to make a new one if it cant an already existing one (this is how it persists between connections)

matchesMaterialRecipe

Checks if a material matches a recipe and returns the recipe if a match is found. returns null if nothing matches it.

maximal_subtype

Returns the maximal subtype (i.e. the most subby) in a list of given types

mult_color_matrix

Takes two 20-length lists, turns them into 5x4 matrices, multiplies them together, and returns a 20-length list

normalize_color_to_matrix

Takes a possible value of the color var and returns a length 20 color matrix doing the same thing. Available inputs: null, "#rgb", "#rrggbb", "#rgba", "#rrggbbaa", all forms of color matrices

o_clock_time

Returns the current timeofday in o'clock format

placeAllPrefabs

playsound_global

Plays a sound to some clients without caring about its source location and stuff. target can be either a list of clients or a list of mobs or world or an area or a z-level number.

predecessor_path_in_list

Find predecessor of a type

qdel

qdel

queues a var for deletion by the delete queue processor. if used on /world, /list, /client, or /savefile, it just skips the queue.

radioGarbleText

Returns given text replaced by nonsense chars, on a 40% or given % basis

random_emoji

Generates a random Unicode emoji that will look ok in the chat

random_hex

Returns random hex value of length given

resource

GENERIC HELPERS FOR BOTH SYSTEMS

round_start_data

FOR EXPORTING DATA TO A SERVER

s_es

Returns the plural based on a number provided.

@param number the number to base the judgement off of @param es set this to true if your item's plural ends in "es" @return the plural suffix based on numbers

sanitize_frequency

Returns f, ensured that it's a valid frequency

sendItemIcons

Sends all of the item icons to a client. Kinda gross, but whatever.

sendItemIconsToAll

Sends all item icons to all clients. Used at world startup to preload things.

send_assets

Sends the list of asset files to client if they're needed

separate_radio_prefix_and_message

Given a message, returns a list containing the radio prefix and the message, so that the message can be manipulated seperately in various functions.

showLine

Creates and shows a line object. Line object has an "affected" var that contains the cross tiles.

showadminlist

Shows the calling client admins.txt

smilify

!!! !!!

sonic_attack_environmental_effect

Given center turf/atom, range, and list of things to smash, will damage said objects within range of center. Used for sonic grenades and similar. Avoiding C&P Code.

soviet_parse

!!! !!! !!! !!!

statlog_ticket

FOR LOGGING TO STATS FILE

stripTextMacros

Removes the special data inserted via use of \improper etc in strings

test_disposal_system

Clothing properties stuff

tgui_Topic

Middleware for /client/Topic.

return bool If TRUE, prevents propagation of the topic call.

tgui_alert

Creates a TGUI alert window and returns the user's response.

This proc should be used to create alerts that the caller will wait for a response from. Arguments:

tgui_alert_async

Creates an asynchronous TGUI alert window with an associated callback.

This proc should be used to create alerts that invoke a callback with the user's chosen option. Arguments:

tgui_input_list

Creates a TGUI input list window and returns the user's response.

This proc should be used to create alerts that the caller will wait for a response from. Arguments:

tgui_input_list_async

Creates an asynchronous TGUI input list window with an associated callback.

This proc should be used to create inputs that invoke a callback with the user's chosen option. Arguments:

time_to_text

Returns the passed decisecond-format time in the form of a text string

tomatogibs

You will appear adjacent to Hastur.

ucfirst

Uppercases first letter

ucfirsts

Uppercases first letter of every word

uwutalk

uwutalk

owo-talk version 2. Nyo it's sewious!

vector_magnitude

Returns the vector magnitude of an x value and a y value

vector_to_dir

Transforms a supplied vector x & y to a direction

whodead

Finds whoever's dead.

whois

Looks up a player based on a string. Searches a shit load of things ~whoa~. Returns a list of mob refs.

whois_ckey_to_mob_reference

A universal ckey -> mob reference lookup proc, adapted from whois() (Convair880).