Yogstation 13 - Modules - TypesVar Details - Proc Details

(global)

Vars

DebuggerStonedMC
FailsafeFailsafe
SSachievements
SSambienceThe subsystem used to play ambience to users every now and then, makes them real excited.
SSarea_contentsResponsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed
SSasset_loadingAllows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init
SSearly_assetsInitializes any assets that need to be loaded ASAP. This houses preference menu assets, since they can be loaded at any time, most dangerously before the atoms SS initializes. Thus, we want it to fail consistently in CI as if it would've if a player opened it up early.
SSfluids
SSfoamThe subsystem responsible for processing foam propagation and effects.
SSinit_profilerSubsystem exists so we can separately log init time costs from the costs of general operation Hopefully this makes sorting out what causes problems when easier
SSlag_switchThe subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience
SSrunechat
SSsmokeThe subsystem responsible for processing smoke propagation and effects.
SStguitgui subsystem
SStimer
SSwardrobeThis subsystem strives to make loading large amounts of select objects as smooth at execution as possible It preloads a set of types to store, and caches them until requested Doesn't catch everything mind, this is intentional. There's many types that expect to either A: Not sit in a list for 2 hours, or B: have extra context passed into them, or for their parent to be their location You should absolutely not spam this system, it will break things in new and wonderful ways S close enough for government work though. Fuck you goonstation
SSweatherUsed for all kinds of weather, ex. lavaland ash storms.

Procs

AStarPathfinding for bots
GibberishTurn text into complete gibberish!
IsAdminGhostIs the passed in mob an admin ghost
KillEveryoneOnZLevelKills any mob on the z-level, assuming they're not in a freezer
REF\ref behaviour got changed in 512 so this is necesary to replicate old behaviour. If it ever becomes necesary to get a more performant REF(), this lies here in wait #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : text_ref(thing))
WEAKREFCreates a weakref to the given input. See /datum/weakref's documentation for more information.
WrapAdminProcCallWrapper for proccalls where the datum is flagged as vareditted
___TraitAddDO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
___TraitRemoveDO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
_addtimerCreate a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.
_addtimer_hereFor legacy procs using addtimer in callbacks. Don't use this.
above_neckWould this zone be above the neck
add_image_to_clientAdds an image to a client's .images. Useful as a callback.
add_image_to_clientsLike add_image_to_client, but will add the image from a list of clients
add_keybindingAdds an instanced keybinding to the global tracker
add_verbhandles adding verbs and updating the stat panel browser
adminscrubRuns STRIP_HTML_SIMPLE and byond's sanitization proc.
anyprobchances are 1:value. anyprob(1) will always return true
assert_sortedRuntimes if the passed in list is not sorted
assign_random_nameGenerate a name devices
assoc_to_keysTurns an associative list into a flat list of keys
at_leastTakes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold
baseturfs_string_listA wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues
bit_countcounts the number of bits in Byond's 16-bit width field, in constant time and memory!
bitfield_to_listConverts a bitfield to a list of numbers (or words if a wordlist is provided)
blend_cutoff_colorsUsed to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments
blend_screen_colorBlends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker
body_zone2cover_flagsFor finding out what body parts a body zone covers, the inverse of the below basically
build_planeed_apperance_queueTakes a list of mutable appearances Returns a list in the form: 1 - a list of all mutable appearances that would need to be updated to change planes in the event of a z layer change, alnongside the commands required to properly track parents to update 2 - a list of all parents that will require updating
calculate_light_offsetReturns a list of x and y offsets to apply to our visual lighting position
callback_selectRuns a list of callbacks asyncronously, returning only when all have finished
camera_sortSorts the list of cameras by their c_tag to display to players.
check_teleport_validValidates that the teleport being attempted is valid or not
check_zoneConvert a PRECISE ZONE into the BODY_ZONE
circle_range_turfsReturns a list of turfs around a center based on RANGE_TURFS()
clearlistEmpties the list by setting the length to 0. Hopefully the elements get garbage collected
cmp_crafting_req_prioritySorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
completed_bounty_countSubtype Gens
create_delusionHelper to give the passed mob the ability to create a delusion hallucination (even a custom one). Returns a list of arguments - pass these to _cause_hallucination to cause the desired hallucination
create_strippable_listCreates an assoc list of keys to /datum/strippable_item
cultslurMakes you talk like you got cult stunned, which is slurring but with some dark messages
cut_relative_directionTakes a screen_loc string and cut out any directions like NORTH or SOUTH
debug_hallucination_weighted_listDebug proc for getting the total weight of the random_hallucination_weighted_list
debug_variableGet displayed variable in VV variable list
deep_compare_listCompares 2 lists, returns TRUE if they are the same
default_ui_stateThe sane defaults for a UI such as a computer or a machine.
delete_all_SS_and_recreate_masterDelete all existing SS to basically start over
delta_to_angleCalculate the angle produced by a pair of x and y deltas
deltimerDelete a timer
derpspeechConvert a message to derpy speak
diff_appearancesTakes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays
dir_to_all_junctionsTakes a direction, turns it into all the junctions that contain it
dispatch_announcement_to_playersProc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
display_cornersMakes all lighting corners visible, debug to aid in understanding
display_energyFormat an energy value measured in Power Cell units.
display_joulesFormat an energy value in J, kJ, MJ, or GJ. 1W = 1J/s.
display_powerFormat a power value in W, kW, MW, or GW.
do_afterTimed action involving one mob user. Target is optional.
do_smokeA helper proc used to spawn small puffs of smoke.
do_teleportTeleport an atom
dump_in_spaceDump a movable in a random valid spacetile
duplicate_object
emissive_appearanceProduces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR.
emissive_blockerProduces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR.
end_cooldownCallback called by a timer to end an associative-list-indexed cooldown.
english_listReturns a list in plain english as a string
expand_three_digit_colorGiven a 3 character color (no hash), converts it into #RRGGBB (with hash)
expand_weightsTakes a weighted list (see above) and expands it into raw entries This eats more memory, but saves time when actually picking from it
fill_with_onesGiven a list, return a copy where values without defined weights are given weight 1. For example, fill_with_ones(list(A, B=2, C)) = list(A=1, B=2, C=1) Useful for weighted random choices (loot tables, syllables in languages, etc.)
find_exposed_wiresList of areas where satchels should not be placed.
find_functional_ntnet_relayChecks whether NTNet is available by ensuring at least one relay exists and is operational.
find_recordFind a datum record from a list
find_safe_turfFinds a safe turf on a given Z level
findnameFind if the message has the real name of any user mob in the mob_list
finish_unequip_mobA utility function for /datum/strippable_items to finish unequipping an item from a mob.
firing_squadfiring_squad is a proc for the :B:erforate smite to shoot each individual bullet at them, so that we can add actual delays without sleep() nonsense
flick_overlay_globalAdd an image to a list of clients and calls a proc to remove it after a duration
generate_adjacent_directionsEncodes connectivity between border objects Returns a list accessable by a border object's dir, the direction between it and a target, and a target Said list will return the direction the two objects connect, if any exists (if the target isn't a border object and the direction is fine, return the inverse of the direction in use)
generate_asset_nameGenerate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)
generate_bitfieldsTurns /datum/bitfield subtypes into a list for use in debugging
generate_hallucination_weighted_listGenerates the global weighted list of random hallucinations.
generate_lazy_template_mapIterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.
generate_map_list_from_directoryReturns a list of all maps to be found in the directory that is passed in.
generate_selectable_speciesGenerates species available to choose in character setup at roundstart
generate_space_underlayGenerates a space underlay for a turf This provides proper lighting support alongside just looking nice Accepts the appearance to make "spaceish", and the turf we're doing this for
generate_unique_announcement_headerProc that just generates a custom header based on variables fed into priority_announce() Will return a string.
getFlatIconCreate a single /icon from a given /atom or /image.
get_access_descGets teh description for an access
get_adjacent_open_turfsReturns a list with all the adjacent open turfs. Clears the list of nulls in the end.
get_all_accessesGets all station access
get_all_centcom_accessGets all centcom accesses
get_all_centcom_jobsGets all centcom jobs
get_all_job_iconsGets all jobs with hud icons
get_all_jobsGets all jobs
get_all_syndicate_accessGets all syndicate access
get_all_task_force_jobsGets all task for jobs
get_allowed_instrument_idsGet all non admin_only instruments as a list of text ids.
get_angleCalculate the angle between two atoms and the west|east coordinate
get_angle_rawAngle between two arbitrary points and horizontal line same as /proc/get_angle
get_atom_on_turfReturns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
get_bbox_of_atomsGet a bounding box of a list of atoms.
get_camera_listget_camera_list
get_centcom_accessGet access for centcom job
get_centcom_access_descGet descriptions for centcom accesses
get_debug_accessEvery access in the game, temp solution
get_edge_target_turfReturns the turf located at the map edge in the specified direction relative to target_atom used for mass driver
get_ert_accessGets access for ERT
get_first_open_turf_in_areaIterates over all turfs in the target area and returns the first non-dense one
get_icon_dimensionsReturns a list containing the width and height of an icon file
get_lineGet a list of turfs in a line from starting_atom to ending_atom.
get_most_experiencedFrom a list of players (minds, mobs or clients), finds the one with the highest playtime (either from a specific role or overall living) and returns it.
get_nested_locsReturns a list of all locations (except the area) the movable is within.
get_offset_target_turfreturns turf relative to target_atom offset in dx and dy tiles, bound to map limits
get_open_turf_in_dirReturns the open turf next to the center in a specific direction
get_pixel_anglefor getting the angle when animating something's pixel_x and pixel_y
get_player_clientReturns a client from a mob, mind or client
get_powernet_info_from_sourceExtracts the powernet and cell of the provided power source
get_preferences_in_priority_orderReturns a flat list of preferences in order of their priority
get_random_safe_chemList of chems deemed "safer" for random generation, used by scrubber_overflow.dm and chem_spill.dm
get_random_station_turfReturns a random turf on the station
get_random_valid_hallucination_subtypeGets a random subtype of the passed hallucination type that has a random_hallucination_weight > 0. If no subtype is passed, it will get any random hallucination subtype that is not abstract and has weight > 0. This can be used instead of picking from the global weighted list to just get a random valid hallucination.
get_random_valid_voiceReturns a voice datum that is valid for the input species
get_ranged_target_turf_directGet ranged target turf, but with direct targets as opposed to directions
get_region_accessesGets access from region ID - Overlap between departments for the sake of ID Console and door remote grouping
get_region_accesses_nameGets the name from region ID
get_safe_random_station_turfReturns a random turf on the station, excludes dense turfs (like walls) and areas that have valid_territory set to FALSE
get_selectable_speciesGets a list of all species available to choose in roundstart.
get_sorted_areasReturns a sorted version of GLOB.areas, by name
get_teleport_locReturns location. Returns null if no location was found.
get_turf_pixelLets the turf this atom's ICON appears to inhabit it takes into account: Pixel_x/y Matrix x/y NOTE: if your atom has non-standard bounds then this proc will handle it, but: if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off) if the bounds are odd, the true middle turf of the atom is returned
get_valid_screen_locationReturns a valid location to place a screen object without overflowing the viewport
get_visual_offsetReturns how visually "off" the atom is from its source turf as a list of x, y (in pixel steps) it takes into account: Pixel_x/y Matrix x/y Icon width/height
getnewidReturn a unique ID
greatest_common_factorTakes a list of numbers as input, returns the highest value that is cleanly divides them all Note: this implementation is expensive as heck for large numbers, I only use it because most of my usecase Is < 10 ints
icon2base64Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)
icon_existsChecks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.
init_crafting_recipesInits crafting recipe lists.
init_crafting_recipes_atomsInits atoms used in crafting recipes.
init_keybindingsCreates and sorts all the keybinding datums
is_blindChecks if passed through item is blind
is_color_darkGiven a color in the format of "#RRGGBB", will return if the color is dark.
is_special_characterIs this mob special to the gamemode?
is_string_in_listChecks for a string in a list
is_type_in_listChecks for specific types in a list
is_type_on_turfChecks whether or not a particular typepath or subtype of it is present on a turf
isemptylistChecks if the list is empty
item_heal_roboticHeal a robotic body part on a mob
json_deserialize_datumConvert a list of json to datum
json_serialize_datumConvert a datum into a json blob
level_announceSends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.
listgetindexReturns list element or null. Should prevent "index out of bounds" error.
lizard_nameNAMEOF that actually works in static definitions because src::type requires src to be defined
load_default_map_configProc that simply loads the default map config, which should always be functional.
load_mapHelper and recommened way to load a map file
load_map_configProc handling the loading of map configs. Will return the default map config using /proc/load_default_map_config if the loading of said file fails for any reason whatsoever, so we always have a working map for the server to run. Arguments:
log_combatLog a combat message in the attack log
log_directed_talkHelper for logging of messages with only one sender and receiver
log_shuttleLogging for shuttle actions
log_spellbookLogging for wizard powers learned
log_tguiAppends a tgui-related log entry. All arguments are optional.
log_woundlog_wound() is for when someone is attacked and suffers a wound. Note that this only captures wounds from damage, so smites/forced wounds aren't logged, as well as demotions like cuts scabbing over
make_datum_references_listsInitial Building
make_tupleReturns the name of the mathematical tuple of same length as the number arg (rounded down).
mass_purrbationturn everyone into catgirls. Technically not girls specifically but you get the point.
mass_remove_purrbationturn all catgirls back
md5asfileSave file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
md5filepathReturns the md5 of a file at a given path.
message_centcomUsed by communications consoles to message CentCom
message_redphone_syndicateUsed by the red phone to message the Syndicate Specifies CENTCOM/SYNDICATE: to indicate both receive the message
message_syndicateUsed by communications consoles to message the Syndicate
message_to_htmlMessage-related procs
mfa_resetReset MFA, clear sessions and login credentials
minor_announceSends a minor annoucement to players. Minor announcements are large text, with the title in red and message in white. Only mobs that can hear can see the announcements.
mobs_in_area_typeTakes: list of area types Returns: all mobs that are in an area type
movespeed_data_null_checkChecks if a move speed modifier is valid and not missing any data
mutable_appearance
next_list_itemReturns the next item in a list
non_zero_minfor now, we'll treat all non-ascii characters like symbols even though most are letters
notify_ghostsFancy notifications for ghosts
nuke_requestUsed by communications consoles to request the nuclear launch codes
offer_controlOffer control of the passed in mob to dead player
offset_to_screen_locTakes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope
overlays2textConverts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get
parse_caught_click_modifiersReturns a turf based on text inputs, original turf and viewing client
partially_block_emissivesTakes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate
pick_n_takePick a random element from the list and remove it from the list.
pick_n_take_weightedPick a random element from the list and remove it from the list.
pick_weightPicks a random element from a list based on a weighting system. For example, given the following list: A = 6, B = 3, C = 1, D = 0 A would have a 60% chance of being picked, B would have a 30% chance of being picked, C would have a 10% chance of being picked, and D would have a 0% chance of being picked. You should only pass integers in.
pickpocket_storage_itemLike pickpocketing pockets, but takes out a random item from a storage item
pixel_offset_turfTakes a turf, and a list of x and y pixel offsets and returns the turf that the offset position best lands in
pollCandidatesPoll all in the group for a candidate
pollCandidatesForMobPoll ghosts to take control of a mob
pollCandidatesForMobsPoll ghosts to take control of a mob
pollGhostCandidatesPoll all ghosts for looking for a candidate
pollMentorCandidatesForMobPoll mentor ghosts to take control of a mob
pollMentorGhostCandidatesPoll all mentor ghosts for looking for a candidate
popReturns the top(last) element from the list and removes it from the list (typical stack function)
popleftReturns the bottom(first) element from the list and removes it from the list (typical stack function)
possible_values_for_sprite_accessory_listTakes an assoc list of names to /datum/sprite_accessory and returns a value fit for /datum/preference/init_possible_values()
possible_values_for_sprite_accessory_list_for_body_partTakes an assoc list of names to /datum/sprite_accessory and returns a value fit for /datum/preference/init_possible_values() Different from possible_values_for_sprite_accessory_list in that it takes a list of layers such as BEHIND, FRONT, and ADJ. It also takes a "body part name", such as body_markings, moth_wings, etc They are expected to be in order from lowest to top.
previous_list_itemReturns the previous item in a list
print_command_reportIf the announcer overrides alert messages, use that message.
priority_announceMake a big red text announcement to
process_teleport_locsGenerate a list of turfs you can teleport to from the areas list
purrbation_applyturns our poor spaceman into a CATGIRL. Point and laugh.
purrbation_removereturn the degenerates to their original form
purrbation_toggleused to transmogrificate spacemen into or from catboys/girls. Arguments H = target spaceman and silent = TRUE/FALSE whether or not we alert them to their transformation with cute flavortext
qdelShould be treated as a replacement for the 'del' keyword.
ran_zoneReturn the zone or randomly, another valid zone
read_sheetDebug proc, for when lighting sheets fuck up Accepts the sheet (2 or 3 (multiz) dimensional list of lighting values at some offset) alongside x and y delta values and the sheet's "offset", which is the amount required to ensure everything indexes at 1 Optionally, you can pass similar values for multiz stuff
realize_appearance_queueTakes a list of appearnces, makes them mutable so they can be properly vv'd and inspected
recover_all_SS_and_recreate_masterRecreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars
recursive_organ_check
removeNullsFromListremove all nulls from a list
remove_image_from_clientRemoves an image from a client's .images. Useful as a callback.
remove_image_from_clientsLike remove_image_from_client, but will remove the image from a list of clients
remove_strings_from_listRemoves a string from a list
remove_verbhandles removing verb and sending it to browser to update, use this for removing verbs
request_station_colorsCalled by decals if they can be colored, to see if we got some cool colors for them. Only takes the first station trait
request_z_pillarReturns a z pillar to insert turfs into
require_area_resortA list of all machinery tied to an area along with the area itself. key=area name,value=list(area,list of machinery) we use this to keep track of what areas are affected by the blueprints & what machinery of these areas needs to be reconfigured accordingly
reset_cooldownProc used by stoppable timers to end a cooldown before the time has ran out.
resolve_ai_icon_syncA form of resolve_ai_icon that is guaranteed to never sleep. Not always accurate, but always synchronous.
rustg_get_versionGets the version of rust_g
safepickReturn either pick(list) or null if list is not of type /list or is empty
sanitizeRuns byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
sanitize_css_class_nameRemoves all non-alphanumerics from the text, keep in mind this can lead to id conflicts
sanitize_hexcolorSanitize_Hexcolor takes in a color in hexcode as a string, be it shorthand hex as 3 characters, or full-sized 6 digit hex, with or without a leading # you can pass it a full hexcode with leading #, such as "#FFFFFF", and with the default arguments you will get exactly that color back, because it accounts for leading # signs and ignores them, then later in the function will either readd one, or won't depending on what you want.
screen_loc_to_offsetTakes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc
screen_loc_to_turfAlmost identical to the params_to_turf(), but unused (remove?)
seedRuinsLoads the ruins for a given z level. @param z_levels The z levels to load ruins on. @param budget The budget to spend on ruins. Compare against the cost of the ruins in /datum/map_template/ruin. @param whitelist A list of areas to allow ruins to be placed in. @param potentialRuins A list of ruins to choose from. @param clear_below Whether to clear the area below the ruin. Used for multiz ruins.
seedifyFinds and extracts seeds from an object
select_hallucination_typeHelper to give the passed mob the ability to select a hallucination from the list of all hallucination subtypes.
send_to_observersSends a message to all dead and observing players, if a source is provided a follow link will be attached.
serialize_antag_nameSerializes an antag name to be used for preferences UI
shake_cameraShake the camera of the person viewing the mob SO REAL!
shuffleRandomize: Return the list in a random order
shuffle_inplaceSame as shuffle, but returns nothing and acts on list in place
slurMakes you speak like you're drunk
sortKeySort a list by CKEY
sortRecordSort datum records in a list
sort_listsort any value in a list
sort_namesuses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead
spiral_range_turfssimilar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs)
starsConvert random parts of a passed in message to stars
start_unequip_mobA utility function for /datum/strippable_items to start unequipping an item from a mob.
stoplagreturns the number of ticks slept
string_listCaches lists with non-numeric stringify-able values (text or typepath).
strip_htmlRuns STRIP_HTML_SIMPLE and sanitize.
strip_html_fullRuns STRIP_HTML_FULL and sanitize.
stutterAdds stuttering to the message passed in
tele_play_specialsPlays the effects/sound set in do_teleport
test_whiteship_sizesHelper proc that tests to ensure all whiteship templates can spawn at their docking port, and logs their sizes This should be a unit test, but too much of our other code breaks during shuttle movement, so not yet, not yet.
tgalertDEPRECATED: USE tgui_alert(...) INSTEAD
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_checkboxes
tgui_input_listCreates a TGUI input list window and returns the user's response.
tgui_input_list_asyncClient does NOT have tgui_input on: Returns regular input Creates an asynchronous TGUI input list window with an associated callback.
tgui_input_numberCreates a TGUI window with a number input. Returns the user's response as num | null.
tgui_input_number_asyncClient does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI number input window with an associated callback.
tgui_input_textCreates a TGUI window with a text input. Returns the user's response.
tgui_input_text_asyncClient does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI text input window with an associated callback.
timeleftGet the remaining deciseconds on a timer
to_chatSends the message to the recipient (target).
to_chat_immediateCircumvents the message queue and sends the message to the recipient (target) as soon as possible.
typecache_filter_listreturns a new list with only atoms that are in typecache L
typecache_filter_list_reversereturns a new list with only atoms that are not in typecache L
typecacheofLike typesof() or subtypesof(), but returns a typecache instead of a list
ui_status_only_livingReturns a UI status such that the dead will be able to watch, but not interact.
ui_status_silicon_has_accessReturns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.
ui_status_user_has_free_handsReturns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.
ui_status_user_is_abledReturns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacentReturns a UI status such that users adjacent to source will be able to interact, far away users will be able to see, and anyone farther won't see anything. Dead users will receive updates no matter what, though you likely want to add a [ui_status_only_living] check for finer observer interactions.
ui_status_user_is_advanced_tool_userReturns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_is_conscious_and_lying_downReturns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacentReturn UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
uniqueListReturns a list without duplicate entrys
updatetimedelayUpdate the delay on an existing LOOPING timer Will come into effect on the next process
url2htmlloaderReturn html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
valid_build_directionChecks whether the target turf is in a valid state to accept a directional construction such as windows or railings.
view_to_pixelsTakes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)
visible_hallucination_pulseEmits a hallucinating pulse around the passed atom. Affects everyone in the passed radius who can view the center, except for those with TRAIT_MADNESS_IMMUNE, or those who are blind.
voice_of_godVOICE OF GOD
webhook_send_msayMENTORS
webhook_send_ticket_newDiscord Tickets
woundscanDisplays wounds with extended information on their status vs medscanners

Var Details

Debugger

StonedMC

Designed to properly split up a given tick among subsystems Note: if you read parts of this code and think "why is it doing it that way" Odds are, there is a reason

Failsafe

Failsafe

Pretty much pokes the MC to make sure it's still alive.

SSachievements

Achievements Subsystem

Subsystem used for keeping track of which achievements exist, who has them, and unlocking new ones.

The subsystem is the midpoint between the game and the database, intended to make it as easy as possible to add new achievements

and functionalities. Admin calling any of the functions in this subsystem isn't a good idea, nor is varediting it unnecessarily, as it really is intended to be 100% code-side. Also relevant: /datum/achievement and /datum/achievement_browser

For usage in code: use /datum/controller/subsystem/achievements/proc/has_achievement to check if they have an achievement, and /datum/controller/subsystem/achievements/proc/unlock_achievement to unlock it

SSambience

The subsystem used to play ambience to users every now and then, makes them real excited.

SSarea_contents

Responsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed

SSasset_loading

Allows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init

SSearly_assets

Initializes any assets that need to be loaded ASAP. This houses preference menu assets, since they can be loaded at any time, most dangerously before the atoms SS initializes. Thus, we want it to fail consistently in CI as if it would've if a player opened it up early.

SSfluids

Fluid Subsystem

A subsystem that processes the propagation and effects of a particular fluid.

Both fluid spread and effect processing are handled through a carousel system. Fluids being spread and fluids being processed are organized into buckets. Each fresh (non-resumed) fire one bucket of each is selected to be processed. These selected buckets are then fully processed. The next fresh fire selects the next bucket in each set for processing. If this would walk off the end of a carousel list we wrap back to the first element. This effectively makes each set a circular list, hence a carousel.

SSfoam

The subsystem responsible for processing foam propagation and effects.

SSinit_profiler

Subsystem exists so we can separately log init time costs from the costs of general operation Hopefully this makes sorting out what causes problems when easier

SSlag_switch

The subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience

SSrunechat

Runechat Subsystem

Maintains a timer-like system to handle destruction of runechat messages. Much of this code is modeled after or adapted from the timer subsystem.

Note that this has the same structure for storing and queueing messages as the timer subsystem does for handling timers: the bucket_list is a list of chatmessage datums, each of which are the head of a circularly linked list. Any given index in bucket_list could be null, representing an empty bucket.

SSsmoke

The subsystem responsible for processing smoke propagation and effects.

SStgui

tgui subsystem

Contains all tgui state and subsystem code.

SStimer

Timer Subsystem

Handles creation, callbacks, and destruction of timed events.

It is important to understand the buckets used in the timer subsystem are just a series of doubly-linked lists. The object at a given index in bucket_list is a /datum/timedevent, the head of a list, which has prev and next references for the respective elements in that bucket's list.

SSwardrobe

This subsystem strives to make loading large amounts of select objects as smooth at execution as possible It preloads a set of types to store, and caches them until requested Doesn't catch everything mind, this is intentional. There's many types that expect to either A: Not sit in a list for 2 hours, or B: have extra context passed into them, or for their parent to be their location You should absolutely not spam this system, it will break things in new and wonderful ways S close enough for government work though. Fuck you goonstation

SSweather

Used for all kinds of weather, ex. lavaland ash storms.

Proc Details

AStar

Pathfinding for bots

Gibberish

Turn text into complete gibberish!

text is the inputted message, and any value higher than 70 for chance will cause letters to be replaced instead of added

IsAdminGhost

Is the passed in mob an admin ghost

KillEveryoneOnZLevel

Kills any mob on the z-level, assuming they're not in a freezer

Arguments:

REF

\ref behaviour got changed in 512 so this is necesary to replicate old behaviour. If it ever becomes necesary to get a more performant REF(), this lies here in wait #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : text_ref(thing))

WEAKREF

Creates a weakref to the given input. See /datum/weakref's documentation for more information.

WrapAdminProcCall

Wrapper for proccalls where the datum is flagged as vareditted

___TraitAdd

DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.

___TraitRemove

DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.

_addtimer

Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.

Arguments:

_addtimer_here

For legacy procs using addtimer in callbacks. Don't use this.

above_neck

Would this zone be above the neck

add_image_to_client

Adds an image to a client's .images. Useful as a callback.

add_image_to_clients

Like add_image_to_client, but will add the image from a list of clients

add_keybinding

Adds an instanced keybinding to the global tracker

add_verb

handles adding verbs and updating the stat panel browser

pass the verb type path to this instead of adding it directly to verbs so the statpanel can update Arguments:

adminscrub

Runs STRIP_HTML_SIMPLE and byond's sanitization proc.

anyprob

chances are 1:value. anyprob(1) will always return true

assert_sorted

Runtimes if the passed in list is not sorted

assign_random_name

Generate a name devices

Creates a randomly generated tag or name for devices or anything really it keeps track of a special list that makes sure no name is used more than once

args:

assoc_to_keys

Turns an associative list into a flat list of keys

at_least

Takes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold

baseturfs_string_list

A wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues

bit_count

counts the number of bits in Byond's 16-bit width field, in constant time and memory!

bitfield_to_list

Converts a bitfield to a list of numbers (or words if a wordlist is provided)

blend_cutoff_colors

Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments

blend_screen_color

Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker

body_zone2cover_flags

For finding out what body parts a body zone covers, the inverse of the below basically

build_planeed_apperance_queue

Takes a list of mutable appearances Returns a list in the form: 1 - a list of all mutable appearances that would need to be updated to change planes in the event of a z layer change, alnongside the commands required to properly track parents to update 2 - a list of all parents that will require updating

calculate_light_offset

Returns a list of x and y offsets to apply to our visual lighting position

callback_select

Runs a list of callbacks asyncronously, returning only when all have finished

Callbacks can be repeated, to call it multiple times

Arguments:

camera_sort

Sorts the list of cameras by their c_tag to display to players.

check_teleport_valid

Validates that the teleport being attempted is valid or not

check_zone

Convert a PRECISE ZONE into the BODY_ZONE

circle_range_turfs

Returns a list of turfs around a center based on RANGE_TURFS()

clearlist

Empties the list by setting the length to 0. Hopefully the elements get garbage collected

cmp_crafting_req_priority

Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes

Prioritises /datum/reagent to ensure reagent requirements are always processed first when crafting. This prevents any reagent_containers from being consumed before the reagents they contain, which can lead to runtimes and item duplication when it happens.

completed_bounty_count

Subtype Gens

Strict Type Gens

Dynamic Gens

Cutoff for Non-Low Priority Bounties

Progression Gens

Low Priority Gens

create_delusion

Helper to give the passed mob the ability to create a delusion hallucination (even a custom one). Returns a list of arguments - pass these to _cause_hallucination to cause the desired hallucination

create_strippable_list

Creates an assoc list of keys to /datum/strippable_item

cultslur

Makes you talk like you got cult stunned, which is slurring but with some dark messages

cut_relative_direction

Takes a screen_loc string and cut out any directions like NORTH or SOUTH

debug_hallucination_weighted_list

Debug proc for getting the total weight of the random_hallucination_weighted_list

debug_variable

Get displayed variable in VV variable list

deep_compare_list

Compares 2 lists, returns TRUE if they are the same

default_ui_state

The sane defaults for a UI such as a computer or a machine.

delete_all_SS_and_recreate_master

Delete all existing SS to basically start over

delta_to_angle

Calculate the angle produced by a pair of x and y deltas

deltimer

Delete a timer

Arguments:

derpspeech

Convert a message to derpy speak

diff_appearances

Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays

dir_to_all_junctions

Takes a direction, turns it into all the junctions that contain it

dispatch_announcement_to_players

Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.

display_corners

Makes all lighting corners visible, debug to aid in understanding

display_energy

Format an energy value measured in Power Cell units.

display_joules

Format an energy value in J, kJ, MJ, or GJ. 1W = 1J/s.

display_power

Format a power value in W, kW, MW, or GW.

do_after

Timed action involving one mob user. Target is optional.

Checks that user does not move, change hands, get stunned, etc. for the given delay. Returns TRUE on success or FALSE on failure. Interaction_key is the assoc key under which the do_after is capped, with max_interact_count being the cap. Interaction key will default to target if not set.

do_smoke

A helper proc used to spawn small puffs of smoke.

Arguments:

do_teleport

Teleport an atom

Teleports a atom to a destination along with being able to randomly teleport them You can also control the effects, such as sound, and sparks Arguments:

dump_in_space

Dump a movable in a random valid spacetile

duplicate_object

duplicate_object

Makes a copy of an item and transfers most vars over, barring GLOB.duplicate_forbidden_vars Args: original - Atom being duplicated sameloc - If true, places in the same loc as the original spawning_location - Turf where the duplicated atom will be spawned at. nerf - If true, only deals stamina damage holoitem - Sets up the item for holodecking

emissive_appearance

Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR.

emissive_blocker

Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR.

end_cooldown

Callback called by a timer to end an associative-list-indexed cooldown.

Arguments:

This sends a signal reporting the cooldown end.

english_list

Returns a list in plain english as a string

expand_three_digit_color

Given a 3 character color (no hash), converts it into #RRGGBB (with hash)

expand_weights

Takes a weighted list (see above) and expands it into raw entries This eats more memory, but saves time when actually picking from it

fill_with_ones

Given a list, return a copy where values without defined weights are given weight 1. For example, fill_with_ones(list(A, B=2, C)) = list(A=1, B=2, C=1) Useful for weighted random choices (loot tables, syllables in languages, etc.)

find_exposed_wires

List of areas where satchels should not be placed.

find_functional_ntnet_relay

Checks whether NTNet is available by ensuring at least one relay exists and is operational.

find_record

Find a datum record from a list

find_safe_turf

Finds a safe turf on a given Z level

Finds a safe turf on a given Z level and has safety checks Arguments:

findname

Find if the message has the real name of any user mob in the mob_list

finish_unequip_mob

A utility function for /datum/strippable_items to finish unequipping an item from a mob.

firing_squad

firing_squad is a proc for the :B:erforate smite to shoot each individual bullet at them, so that we can add actual delays without sleep() nonsense

Hilariously, if you drag someone away mid smite, the bullets will still chase after them from the original spot, possibly hitting other people. Too funny to fix imo

Arguments:

flick_overlay_global

Add an image to a list of clients and calls a proc to remove it after a duration

generate_adjacent_directions

Encodes connectivity between border objects Returns a list accessable by a border object's dir, the direction between it and a target, and a target Said list will return the direction the two objects connect, if any exists (if the target isn't a border object and the direction is fine, return the inverse of the direction in use)

generate_asset_name

Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)

generate_bitfields

Turns /datum/bitfield subtypes into a list for use in debugging

generate_hallucination_weighted_list

Generates the global weighted list of random hallucinations.

generate_lazy_template_map

Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.

Screams if more than one key exists, loudly.

generate_map_list_from_directory

Returns a list of all maps to be found in the directory that is passed in.

generate_selectable_species

Generates species available to choose in character setup at roundstart

This proc generates which species are available to pick from in character setup. If there are no available roundstart species, defaults to human.

generate_space_underlay

Generates a space underlay for a turf This provides proper lighting support alongside just looking nice Accepts the appearance to make "spaceish", and the turf we're doing this for

generate_unique_announcement_header

Proc that just generates a custom header based on variables fed into priority_announce() Will return a string.

getFlatIcon

Create a single /icon from a given /atom or /image.

Very low-performance. Should usually only be used for HTML, where BYOND's appearance system (overlays/underlays, etc.) is not available.

Only the first argument is required.

get_access_desc

Gets teh description for an access

get_adjacent_open_turfs

Returns a list with all the adjacent open turfs. Clears the list of nulls in the end.

get_all_accesses

Gets all station access

get_all_centcom_access

Gets all centcom accesses

get_all_centcom_jobs

Gets all centcom jobs

get_all_job_icons

Gets all jobs with hud icons

get_all_jobs

Gets all jobs

get_all_syndicate_access

Gets all syndicate access

get_all_task_force_jobs

Gets all task for jobs

get_allowed_instrument_ids

Get all non admin_only instruments as a list of text ids.

get_angle

Calculate the angle between two atoms and the west|east coordinate

get_angle_raw

Angle between two arbitrary points and horizontal line same as /proc/get_angle

get_atom_on_turf

Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.

Arguments

get_bbox_of_atoms

Get a bounding box of a list of atoms.

Arguments:

Returns: list(x1, y1, x2, y2)

get_camera_list

get_camera_list

Builds a list of all available cameras that can be seen to networks_available Args: networks_available - List of networks that we use to see which cameras are visible to it.

get_centcom_access

Get access for centcom job

get_centcom_access_desc

Get descriptions for centcom accesses

get_debug_access

Every access in the game, temp solution

get_edge_target_turf

Returns the turf located at the map edge in the specified direction relative to target_atom used for mass driver

get_ert_access

Gets access for ERT

get_first_open_turf_in_area

Iterates over all turfs in the target area and returns the first non-dense one

get_icon_dimensions

Returns a list containing the width and height of an icon file

get_line

Get a list of turfs in a line from starting_atom to ending_atom.

Uses the ultra-fast Bresenham Line-Drawing Algorithm.

get_most_experienced

From a list of players (minds, mobs or clients), finds the one with the highest playtime (either from a specific role or overall living) and returns it.

get_nested_locs

Returns a list of all locations (except the area) the movable is within.

get_offset_target_turf

returns turf relative to target_atom offset in dx and dy tiles, bound to map limits

get_open_turf_in_dir

Returns the open turf next to the center in a specific direction

get_pixel_angle

for getting the angle when animating something's pixel_x and pixel_y

get_player_client

Returns a client from a mob, mind or client

get_powernet_info_from_source

Extracts the powernet and cell of the provided power source

get_preferences_in_priority_order

Returns a flat list of preferences in order of their priority

get_random_safe_chem

List of chems deemed "safer" for random generation, used by scrubber_overflow.dm and chem_spill.dm

get_random_station_turf

Returns a random turf on the station

get_random_valid_hallucination_subtype

Gets a random subtype of the passed hallucination type that has a random_hallucination_weight > 0. If no subtype is passed, it will get any random hallucination subtype that is not abstract and has weight > 0. This can be used instead of picking from the global weighted list to just get a random valid hallucination.

get_random_valid_voice

Returns a voice datum that is valid for the input species

get_ranged_target_turf_direct

Get ranged target turf, but with direct targets as opposed to directions

Starts at atom starting_atom and gets the exact angle between starting_atom and target Moves from starting_atom with that angle, Range amount of times, until it stops, bound to map size Arguments:

get_region_accesses

Gets access from region ID - Overlap between departments for the sake of ID Console and door remote grouping

get_region_accesses_name

Gets the name from region ID

get_safe_random_station_turf

Returns a random turf on the station, excludes dense turfs (like walls) and areas that have valid_territory set to FALSE

get_selectable_species

Gets a list of all species available to choose in roundstart.

get_sorted_areas

Returns a sorted version of GLOB.areas, by name

get_teleport_loc

Returns location. Returns null if no location was found.

get_turf_pixel

Lets the turf this atom's ICON appears to inhabit it takes into account: Pixel_x/y Matrix x/y NOTE: if your atom has non-standard bounds then this proc will handle it, but: if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off) if the bounds are odd, the true middle turf of the atom is returned

get_valid_screen_location

Returns a valid location to place a screen object without overflowing the viewport

Returns a screen loc representing the valid location

get_visual_offset

Returns how visually "off" the atom is from its source turf as a list of x, y (in pixel steps) it takes into account: Pixel_x/y Matrix x/y Icon width/height

getnewid

Return a unique ID

greatest_common_factor

Takes a list of numbers as input, returns the highest value that is cleanly divides them all Note: this implementation is expensive as heck for large numbers, I only use it because most of my usecase Is < 10 ints

icon2base64

Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)

icon_exists

Checks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.

init_crafting_recipes

Inits crafting recipe lists.

init_crafting_recipes_atoms

Inits atoms used in crafting recipes.

init_keybindings

Creates and sorts all the keybinding datums

is_blind

Checks if passed through item is blind

is_color_dark

Given a color in the format of "#RRGGBB", will return if the color is dark.

is_special_character

Is this mob special to the gamemode?

returns 1 for special characters and 2 for heroes of gamemode

is_string_in_list

Checks for a string in a list

is_type_in_list

Checks for specific types in a list

is_type_on_turf

Checks whether or not a particular typepath or subtype of it is present on a turf

Returns TRUE if an instance of the desired type or a subtype of it is found Returns FALSE if the type is not found, or if no turf is supplied

Arguments:

isemptylist

Checks if the list is empty

item_heal_robotic

Heal a robotic body part on a mob

json_deserialize_datum

Convert a list of json to datum

json_serialize_datum

Convert a datum into a json blob

level_announce

Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.

listgetindex

Returns list element or null. Should prevent "index out of bounds" error.

lizard_name

NAMEOF that actually works in static definitions because src::type requires src to be defined

load_default_map_config

Proc that simply loads the default map config, which should always be functional.

load_map

Helper and recommened way to load a map file

load_map_config

Proc handling the loading of map configs. Will return the default map config using /proc/load_default_map_config if the loading of said file fails for any reason whatsoever, so we always have a working map for the server to run. Arguments:

Returns the config for the map to load.

log_combat

Log a combat message in the attack log

1 argument is the actor performing the action 2 argument is the target of the action 3 is a verb describing the action (e.g. punched, throwed, kicked, etc.) 4 is a tool with which the action was made (usually an item) 5 is any additional text, which will be appended to the rest of the log line

log_directed_talk

Helper for logging of messages with only one sender and receiver

log_shuttle

Logging for shuttle actions

log_spellbook

Logging for wizard powers learned

log_tgui

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

log_wound

log_wound() is for when someone is attacked and suffers a wound. Note that this only captures wounds from damage, so smites/forced wounds aren't logged, as well as demotions like cuts scabbing over

Note that this has no info on the attack that dealt the wound: information about where damage came from isn't passed to the bodypart's damaged proc. When in doubt, check the attack log for attacks at that same time TODO later: Add logging for healed wounds, though that will require some rewriting of healing code to prevent admin heals from spamming the logs. Not high priority

Arguments:

make_datum_references_lists

Initial Building

make_tuple

Returns the name of the mathematical tuple of same length as the number arg (rounded down).

mass_purrbation

turn everyone into catgirls. Technically not girls specifically but you get the point.

mass_remove_purrbation

turn all catgirls back

md5asfile

Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.

md5filepath

Returns the md5 of a file at a given path.

message_centcom

Used by communications consoles to message CentCom

message_redphone_syndicate

Used by the red phone to message the Syndicate Specifies CENTCOM/SYNDICATE: to indicate both receive the message

message_syndicate

Used by communications consoles to message the Syndicate

message_to_html

Message-related procs

Message format (/list):

Copyright (c) 2020 Aleksej Komarov SPDX-License-Identifier: MIT

mfa_reset

Reset MFA, clear sessions and login credentials

minor_announce

Sends a minor annoucement to players. Minor announcements are large text, with the title in red and message in white. Only mobs that can hear can see the announcements.

message - the message contents of the announcement. title - the title of the announcement, which is often "who sent it". alert - whether this announcement is an alert, or just a notice. Only changes the sound that is played by default. html_encode - if TRUE, we will html encode our title and message before sending it, to prevent player input abuse. players - optional, a list mobs to send the announcement to. If unset, sends to all palyers. sound_override - optional, use the passed sound file instead of the default notice sounds. should_play_sound - Whether the notice sound should be played or not. color_override - optional, use the passed color instead of the default notice color.

mobs_in_area_type

Takes: list of area types Returns: all mobs that are in an area type

movespeed_data_null_check

Checks if a move speed modifier is valid and not missing any data

mutable_appearance

next_list_item

Returns the next item in a list

non_zero_min

for now, we'll treat all non-ascii characters like symbols even though most are letters

notify_ghosts

Fancy notifications for ghosts

The kitchen sink of notification procs

Arguments:

nuke_request

Used by communications consoles to request the nuclear launch codes

offer_control

Offer control of the passed in mob to dead player

Automatic logging and uses pollCandidatesForMob, how convenient

offset_to_screen_loc

Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope

overlays2text

Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get

parse_caught_click_modifiers

Returns a turf based on text inputs, original turf and viewing client

partially_block_emissives

Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate

pick_n_take

Pick a random element from the list and remove it from the list.

pick_n_take_weighted

Pick a random element from the list and remove it from the list.

pick_weight

Picks a random element from a list based on a weighting system. For example, given the following list: A = 6, B = 3, C = 1, D = 0 A would have a 60% chance of being picked, B would have a 30% chance of being picked, C would have a 10% chance of being picked, and D would have a 0% chance of being picked. You should only pass integers in.

pickpocket_storage_item

Like pickpocketing pockets, but takes out a random item from a storage item

pixel_offset_turf

Takes a turf, and a list of x and y pixel offsets and returns the turf that the offset position best lands in

pollCandidates

Poll all in the group for a candidate

Poll group for question returns people who voted yes in a list Arguments:

pollCandidatesForMob

Poll ghosts to take control of a mob

Poll ghosts for mob control returns people who voted yes in a list Arguments:

pollCandidatesForMobs

Poll ghosts to take control of a mob

Poll ghosts for mob control returns people who voted yes in a list Arguments:

pollGhostCandidates

Poll all ghosts for looking for a candidate

Poll all ghosts a question returns people who voted yes in a list Arguments:

pollMentorCandidatesForMob

Poll mentor ghosts to take control of a mob

Poll mentor ghosts for mob control returns people who voted yes in a list Arguments:

pollMentorGhostCandidates

Poll all mentor ghosts for looking for a candidate

Poll all mentor ghosts a question returns people who voted yes in a list Arguments:

pop

Returns the top(last) element from the list and removes it from the list (typical stack function)

popleft

Returns the bottom(first) element from the list and removes it from the list (typical stack function)

possible_values_for_sprite_accessory_list

Takes an assoc list of names to /datum/sprite_accessory and returns a value fit for /datum/preference/init_possible_values()

possible_values_for_sprite_accessory_list_for_body_part

Takes an assoc list of names to /datum/sprite_accessory and returns a value fit for /datum/preference/init_possible_values() Different from possible_values_for_sprite_accessory_list in that it takes a list of layers such as BEHIND, FRONT, and ADJ. It also takes a "body part name", such as body_markings, moth_wings, etc They are expected to be in order from lowest to top.

previous_list_item

Returns the previous item in a list

print_command_report

If the announcer overrides alert messages, use that message.

priority_announce

Make a big red text announcement to

Formatted like:

" Message from sender "

" Title "

" Text "

Arguments

process_teleport_locs

Generate a list of turfs you can teleport to from the areas list

Includes areas if they're not a shuttle or not not teleport or have no contents

The chosen turf is the first item in the areas contents that is a station level

The returned list of turfs is sorted by name

purrbation_apply

turns our poor spaceman into a CATGIRL. Point and laugh.

purrbation_remove

return the degenerates to their original form

purrbation_toggle

used to transmogrificate spacemen into or from catboys/girls. Arguments H = target spaceman and silent = TRUE/FALSE whether or not we alert them to their transformation with cute flavortext

qdel

Should be treated as a replacement for the 'del' keyword.

Datums passed to this will be given a chance to clean up references to allow the GC to collect them.

ran_zone

Return the zone or randomly, another valid zone

probability controls the chance it chooses the passed in zone, or another random zone defaults to 80

read_sheet

Debug proc, for when lighting sheets fuck up Accepts the sheet (2 or 3 (multiz) dimensional list of lighting values at some offset) alongside x and y delta values and the sheet's "offset", which is the amount required to ensure everything indexes at 1 Optionally, you can pass similar values for multiz stuff

realize_appearance_queue

Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected

recover_all_SS_and_recreate_master

Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars

recursive_organ_check

removeNullsFromList

remove all nulls from a list

remove_image_from_client

Removes an image from a client's .images. Useful as a callback.

remove_image_from_clients

Like remove_image_from_client, but will remove the image from a list of clients

remove_strings_from_list

Removes a string from a list

remove_verb

handles removing verb and sending it to browser to update, use this for removing verbs

pass the verb type path to this instead of removing it from verbs so the statpanel can update Arguments:

request_station_colors

Called by decals if they can be colored, to see if we got some cool colors for them. Only takes the first station trait

request_z_pillar

Returns a z pillar to insert turfs into

require_area_resort

A list of all machinery tied to an area along with the area itself. key=area name,value=list(area,list of machinery) we use this to keep track of what areas are affected by the blueprints & what machinery of these areas needs to be reconfigured accordingly

reset_cooldown

Proc used by stoppable timers to end a cooldown before the time has ran out.

Arguments:

This sends a signal reporting the cooldown end, passing the time left as an argument.

resolve_ai_icon_sync

A form of resolve_ai_icon that is guaranteed to never sleep. Not always accurate, but always synchronous.

rustg_get_version

Gets the version of rust_g

safepick

Return either pick(list) or null if list is not of type /list or is empty

sanitize

Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.

sanitize_css_class_name

Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts

sanitize_hexcolor

Sanitize_Hexcolor takes in a color in hexcode as a string, be it shorthand hex as 3 characters, or full-sized 6 digit hex, with or without a leading # you can pass it a full hexcode with leading #, such as "#FFFFFF", and with the default arguments you will get exactly that color back, because it accounts for leading # signs and ignores them, then later in the function will either readd one, or won't depending on what you want.

Full hexcolors will just be validated, shorthand hex of 3 characters can be cleanly converted up to full hex with a leading # no problem.

With default arguments:

converting down to short, with or without the # is doable by setting the desired format to the length you want and specifying the crunch to true for adding a # or false to not

screen_loc_to_offset

Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc

screen_loc_to_turf

Almost identical to the params_to_turf(), but unused (remove?)

seedRuins

Loads the ruins for a given z level. @param z_levels The z levels to load ruins on. @param budget The budget to spend on ruins. Compare against the cost of the ruins in /datum/map_template/ruin. @param whitelist A list of areas to allow ruins to be placed in. @param potentialRuins A list of ruins to choose from. @param clear_below Whether to clear the area below the ruin. Used for multiz ruins.

seedify

Finds and extracts seeds from an object

Checks if the object is such that creates a seed when extracted. Used by seed extractors or posably anything that would create seeds in some way. The seeds are dropped either at the extractor, if it exists, or where the original object was and it qdel's the object

Arguments:

select_hallucination_type

Helper to give the passed mob the ability to select a hallucination from the list of all hallucination subtypes.

send_to_observers

Sends a message to all dead and observing players, if a source is provided a follow link will be attached.

serialize_antag_name

Serializes an antag name to be used for preferences UI

shake_camera

Shake the camera of the person viewing the mob SO REAL!

shuffle

Randomize: Return the list in a random order

shuffle_inplace

Same as shuffle, but returns nothing and acts on list in place

slur

Makes you speak like you're drunk

sortKey

Sort a list by CKEY

sortRecord

Sort datum records in a list

sort_list

sort any value in a list

sort_names

uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead

spiral_range_turfs

similar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs)

stars

Convert random parts of a passed in message to stars

This proc is dangerously laggy, avoid it or die

start_unequip_mob

A utility function for /datum/strippable_items to start unequipping an item from a mob.

stoplag

returns the number of ticks slept

string_list

Caches lists with non-numeric stringify-able values (text or typepath).

strip_html

Runs STRIP_HTML_SIMPLE and sanitize.

strip_html_full

Runs STRIP_HTML_FULL and sanitize.

stutter

Adds stuttering to the message passed in

tele_play_specials

Plays the effects/sound set in do_teleport

Plays the effects/sound set in do_teleport Arguments:

test_whiteship_sizes

Helper proc that tests to ensure all whiteship templates can spawn at their docking port, and logs their sizes This should be a unit test, but too much of our other code breaks during shuttle movement, so not yet, not yet.

tgalert

DEPRECATED: USE tgui_alert(...) INSTEAD

Designed as a drop in replacement for alert(); functions the same. (outside of needing User specified) Arguments:

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_checkboxes

tgui_input_checkbox

Opens a window with a list of checkboxes and returns a list of selected choices.

user - The mob to display the window to message - The message inside the window title - The title of the window list/items - The list of items to display min_checked - The minimum number of checkboxes that must be checked (defaults to 1) max_checked - The maximum number of checkboxes that can be checked (optional) timeout - The timeout for the input (optional)

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

Client does NOT have tgui_input on: Returns regular input 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:

tgui_input_number

Creates a TGUI window with a number input. Returns the user's response as num | null.

This proc should be used to create windows for number entry that the caller will wait for a response from. If tgui fancy chat is turned off: Will return a normal input. If a max or min value is specified, will validate the input inside the UI and ui_act.

Arguments:

tgui_input_number_async

Client does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI number input window with an associated callback.

This proc should be used to create numboxes that invoke a callback with the user's entry.

Arguments:

tgui_input_text

Creates a TGUI window with a text input. Returns the user's response.

This proc should be used to create windows for text entry that the caller will wait for a response from. If tgui fancy chat is turned off: Will return a normal input. If max_length is specified, will return stripped_multiline_input.

Arguments:

tgui_input_text_async

Client does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI text input window with an associated callback.

This proc should be used to create textboxes that invoke a callback with the user's entry. Arguments:

timeleft

Get the remaining deciseconds on a timer

Arguments:

to_chat

Sends the message to the recipient (target).

Recommended way to write to_chat calls:

to_chat(client,
    type = MESSAGE_TYPE_INFO,
    html = "You have found <strong>[object]</strong>")

to_chat_immediate

Circumvents the message queue and sends the message to the recipient (target) as soon as possible.

typecache_filter_list

returns a new list with only atoms that are in typecache L

typecache_filter_list_reverse

returns a new list with only atoms that are not in typecache L

typecacheof

Like typesof() or subtypesof(), but returns a typecache instead of a list

ui_status_only_living

Returns a UI status such that the dead will be able to watch, but not interact.

ui_status_silicon_has_access

Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.

ui_status_user_has_free_hands

Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.

ui_status_user_is_abled

Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.

ui_status_user_is_adjacent

Returns a UI status such that users adjacent to source will be able to interact, far away users will be able to see, and anyone farther won't see anything. Dead users will receive updates no matter what, though you likely want to add a [ui_status_only_living] check for finer observer interactions.

ui_status_user_is_advanced_tool_user

Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.

ui_status_user_is_conscious_and_lying_down

Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.

ui_status_user_strictly_adjacent

Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.

uniqueList

Returns a list without duplicate entrys

updatetimedelay

Update the delay on an existing LOOPING timer Will come into effect on the next process

Arguments:

url2htmlloader

Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.

valid_build_direction

Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings.

Returns FALSE if the target turf cannot accept a directional construction. Returns TRUE otherwise.

Arguments:

view_to_pixels

Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)

visible_hallucination_pulse

Emits a hallucinating pulse around the passed atom. Affects everyone in the passed radius who can view the center, except for those with TRAIT_MADNESS_IMMUNE, or those who are blind.

center - required, the center of the pulse radius - the radius around that the pulse reaches hallucination_duration - how much hallucination is added by the pulse. reduced based on distance to the center. hallucination_max_duration - a cap on how much hallucination can be added optional_messages - optional list of messages passed. Those affected by pulses will be given one of the messages in said list.

voice_of_god

VOICE OF GOD

webhook_send_msay

MENTORS

webhook_send_ticket_new

Discord Tickets

woundscan

Displays wounds with extended information on their status vs medscanners