/tg/ Station 13 - Modules - TypesVar Details - Proc Details

(global)

Vars

DebuggerStonedMC
FailsafeFailsafe
SSacidThe subsystem used to tick /datum/component/acid instances.
SSai_behaviorsThe subsystem used to tick /datum/ai_behavior instances. Handling the individual actions an AI can take like punching someone in the fucking NUTS
SSai_controllersThe subsystem used to tick /datum/ai_controllers instances. Handling the re-checking of plans.
SSai_movementThe subsystem used to tick /datum/ai_movement instances. Handling the movement of individual AI instances
SSambienceThe subsystem used to play ambience to users every now and then, makes them real excited.
SSaura_healingThe subsystem used to tick /datum/component/aura_healing instances.
SSclock_componentThe subsystem used to tick /datum/component/acid instances.
SSdiscord
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.
SSeigenstatesSubsystem used to teleport people to a linked web of itterative entries. If one entry is deleted, the 2 around it will forge a link instead.
SSfluids
SSfoamThe subsystem responsible for processing foam propagation and effects.
SSid_accessNon-processing subsystem that holds various procs and data structures to manage ID cards, trims and access.
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
SSmouse_enteredDefers MouseEntered inputs to only apply to the most recently hovered over atom in the tick
SSmove_managerActs as a namespace for movement packet/type related procs
SSpoints_of_interestSubsystem for managing all POIs.
SSsinguloprocessVery rare subsystem, provides any active singularities with the timings and seclusion they need to succeed
SSsmokeThe subsystem responsible for processing smoke propagation and effects.
SSspatial_grid
SSspeech_controllerverb_manager subsystem just for handling say's
SStguitgui subsystem
SStimer
SSverb_managerSSverb_manager, a subsystem that runs every tick and runs through its entire queue without yielding like SSinput. this exists because of how the byond tick works and where user inputted verbs are put within it.
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
SSwiremod_compositeThis subsystem is to handle creating and storing composite templates that are used to create composite datatypes for integrated circuits

Procs

GUIDreturns a GUID like identifier (using a mostly made up record format) guids are not on their own suitable for access or security tokens, as most of their bits are predictable. (But may make a nice salt to one)
GetBestWeaponReturns either the best weapon from the given choices or null if held weapons are better
GetTgsStealthKeyGets TGS's stealth key, generates one if none is found
GibberishTurn text into complete gibberish!
HandleUserlessProcCallHandles a userless proccall, used by circuits.
HandleUserlessSDQLHandles a userless sdql, used by circuits and tgs.
HeapPathWeightCompareTODO: Macro this to reduce proc overhead
IsEdiblereturns if something can be consumed, drink or food
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 && istype(thing, /datum) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]")
RoundDiagBarDiagnostic HUDs!
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.
______qdel_list_wrapperthe underscores are to encourage people not to use this directly.
__lua_awakenDequeues the task at the front of the sleep queue and resumes it
__lua_callCalls a lua function
__lua_get_globalsGet the variables within a state's environment. Values not convertible to DM values are substituted for their types as text
__lua_get_tasksGet a list of all tasks currently in progress within a state
__lua_new_stateCreates a new lua state.
__lua_resumeRemoves the task at the specified index from the yield table and resumes it
__lua_set_datum_proc_call_wrapperSets a global proc to call in place of just outright calling a given proc on a datum
__lua_set_execution_limitSets the maximum amount of time a lua chunk or function can execute without sleeping or yielding. Chunks/functions that exceed this duration will produce an error.
__lua_set_global_proc_call_wrapperSets a global proc to call in place of just outright calling a given global proc
__lua_set_print_wrapperSets a global proc as a wrapper for lua's print function
__lua_set_set_var_wrapperSets a global proc to call in place of just outright setting a datum's var to a given value
_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.
_animate_filterAuxtools REALLY doesn't know how to handle filters as values; when passed as arguments to auxtools-called procs, they aren't simply treated as nulls - they don't even count towards the length of args. For example, calling some_proc([a filter], foo, bar) from auxtools is equivalent to calling some_proc(foo, bar). Thus, we can't use _animate directly on filters. Use this to perform animation steps on a filter. Consecutive steps on the same filter can be achieved by calling _animate with no target.
_contentsFor some reason, an atom's contents are a kind of list that auxtools can't work with as a list This proc returns a copy of contents that is an ordinary list
_pick_listAllow me to explain for some reason, if pick() is passed arglist(args) directly and args contains only one list it considers it to be a list of lists this means something like _pick(list) would fail need to do this instead
_queue_verbqueue a callback for the given verb/verblike proc and any given arguments to the specified verb subsystem, so that they process in the next tick. intended to only work with verbs or verblike procs called directly from client input, use as part of TRY_QUEUE_VERB() and co.
above_neckWould this zone be above the neck
actionspeed_data_null_checkChecks if a action speed modifier is valid and not missing any data
active_free_borgsSilicon Mob Procs
add_memory_in_rangeAdds a memory to people that can see this happening, only use this for impactful or rare events to reduce overhead.
admin_ticket_logUse this proc when an admin takes action that may be related to an open ticket on what what can be a client, ckey, or mob player_message: If the message should be shown in the player ticket panel, fill this out log_in_blackbox: Whether or not this message with the blackbox system. If disabled, this message should be logged with a different proc call
adminscrubRuns STRIP_HTML_SIMPLE and byond's sanitization proc.
alone_in_areaChecks if the mob provided (must_be_alone) is alone in an area
announce_arrivalSend a message in common radio when a player arrives
anyprobchances are 1:value. anyprob(1) will always return true
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
atmos_handbooks_initAutomatically populates gas_handbook and reaction_handbook. They are formatted lists containing information regarding gases and reactions they participate in. Structure can be found in TS form at AtmosHandbook.tsx
atmos_scanOutputs a message to the user describing the target's gasmixes.
avoid_assoc_duplicate_keystakes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input
baseturfs_string_listA wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues
begin_the_endBegins the process of ending the round via cult narsie win Consists of later called procs (in order of called):
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)
body_zone2cover_flagsFor finding out what body parts a body zone covers, the inverse of the below basically
border_diamond_range_turfsReturns the list of turfs around the outside of a center based on RANGE_TURFS()
build_exploration_site_ui_dataHelper proc for exploration site listings in ui.
build_medicine_reagentsJust grab every craftable medicine you can think off
calculate_projectile_angle_and_pixel_offsetsCalculates the pixel offsets and angle that a projectile should be launched at.
call_emergency_meetingIf the announcer overrides alert messages, use that message. Summon the crew for an emergency meeting
callback_on_everyone_on_zInvokes a callback on every living mob on the provided z level.
callback_selectRuns a list of callbacks asyncronously, returning only when all have finished
can_seeStep-towards method of determining whether one atom can see another. Similar to viewers() note: this is a line of sight algorithm, view() does not do any sort of raycasting and cannot be emulated by it accurately
center_imageCenter's an image. Requires: The Image The x dimension of the icon file used in the image The y dimension of the icon file used in the image eg: center_image(image_to_center, 32,32) eg2: center_image(image_to_center, 96,96)
chatter_speakWe're going to take a list that dictates the pace of speech, and a sentence fragment to say Then say() that fragment at that pace You can pass in a starting delay to wait before speaking the next sound
cheap_hypotenuseCalculate the hypotenuse cheaply (this should be in maths.dm)
check_asay_linksChecks a given message to see if any of the words are something we want to treat specially, as detailed below.
check_target_facingsReturns the direction that the initiator and the target are facing
check_wall_itemCheck if there is already a wall item on the turf loc floor_loc = floor tile in front of the wall dir_toward_wall = direction from the floor tile in front of the wall towards the wall check_external = truthy if we should be checking against items coming out of the wall, rather than visually on top of the wall.
check_zoneConvert a PRECISE ZONE into the BODY_ZONE
chem_splashThe basic chemical bomb proc. Combines a set of reagent holders into one holder and reacts it. If there are any reagents left over it spreads them across the surrounding environment. The maximum volume of the holder is temporarily adjusted to allow for reactions which increase total volume to work at full effectiveness. The maximum volume of the holder is then reset to its original value.
circle_rangeReturns all atoms present in a circle around the center
circle_range_turfsReturns a list of turfs around a center based on RANGE_TURFS()
circle_viewReturns all atoms present in a circle around the center but uses view() instead of range() (Currently not used)
circle_view_turfsReturns a list of turfs around a center based on view()
cmp_bodypart_by_body_part_ascOrders bodyparts by their body_part value, ascending.
cmp_crafting_req_prioritySorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
cmp_heretic_knowledgeOrders heretic knowledge by priority
cmp_port_order_ascOrders by integrated circuit weight
collect_fish_propertiesAwful workaround around initial(x.list_variable) not being a thing while trying to keep some semblance of being structured
color_to_full_rgba_matrixConverts RGB shorthands into RGBA matrices complete of constants rows (ergo a 20 keys list in byond).
compare_listcompare two lists, returns TRUE if they are the same
considered_afkChecks if a player is considered AFK
considered_aliveReturns true if the mob that a player is controlling is alive
considered_exiledExiled check
construct_phobia_regexCreates a regular expression to match against the given phobia Capture group 2 = the scary word Capture group 3 = an optional suffix on the scary word
convert_integer_to_wordsTakes an integer up to 999,999,999 and returns it in words. Works with negative numbers and 0.
convert_ph_to_readable_colorConverts the pH into a tgui readable color - i.e. white and black text is readable over it. This is NOT the colourwheel for pHes however.
count_by_typereturn the amount of items of the same type inside a list
create_atmos_zoneCreate an atmos zone (Think ZAS), similiar to [proc/detect_room] but it ignores walls and turfs which are non-[atmos_can_pass]
create_mafia_gameCreates the global datum for playing mafia games, destroys the last if that's required and returns the new.
create_random_puzzgridReturns a random puzzgrid from config. If config is empty, or no valid puzzgrids can be found in time, will return null.
create_separatist_nation
create_strippable_listCreates an assoc list of keys to /datum/strippable_item
cult_ending_helperSelects cinematic to play as part of the cult end depending on the outcome then ends the round afterward called either when narsie eats everyone, or when [/proc/begin_the_end()] reaches it's conclusion
cut_relative_directionTakes a screen_loc string and cut out any directions like NORTH or SOUTH
day_of_monthReturns the day (mon, tues, wen...) in number format, 1 (monday) - 7 (sunday) from the passed in date (year, month, day) All inputs are expected indexed at 1
debug_variableGet displayed variable in VV variable list
deep_compare_listCompares 2 lists, returns TRUE if they are the same
deep_copy_listCopies a list, and all lists inside it recusively Does not copy any other reference type
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
deltimerDelete a timer
deprecise_zoneTakes a zone and returns it's "parent" zone, if it has one.
disambiguate_clientTakes an argument which could be either a ckey, /client, or IRC marker, and returns a client if possible Returns [EXTERNAL_PM_USER] if an IRC marker is detected Otherwise returns null
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_after_mobTimed action involving at least one mob user and a list of targets. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once.
do_mobTimed action involving two mobs, the user and the target. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once.
do_smokeA helper proc used to spawn small puffs of smoke.
dviewVersion of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).
dyn_explosionUsing default dyn_ex scale:
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.
emoji_parsePay the owner Make alerts Log the event
end_cooldownCallback called by a timer to end an associative-list-indexed cooldown.
ending_helperHelper to set the round to end asap. Current usage Cult round end code
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)
explosionMakes a given atom explode.
findTrueKeyTakes a stealthed ckey as input, returns the true key it represents
find_obstruction_free_locationFind an obstruction free turf that's within the range of the center. Can also condition on if it is of a certain area type.
find_reagentReturns reagent datum from typepath
find_recordReturns datum/data/record
findnameFind if the message has the real name of any user mob in the mob_list
finish_equip_mobA utility function for /datum/strippable_items to finish equipping an item to a mob.
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
flash_colorFlash a color on the client
flatten_listFlattens a keyed list into a list of it's contents
flick_overlayAdd an image to a list of clients and calls a proc to remove it after a duration
flick_overlay_staticFlickers an overlay on an atom
flick_overlay_viewwrapper for flick_overlay(), flicks to everyone who can see the target atom
flop_animationThis animation should be applied to actual parent atom instead of vc_object.
format_frequencyFormat frequency by moving the decimal.
format_textProperly format a string of text by using replacetext()
gas_mixture_parser
generateStealthCkeyHands back a stealth ckey to use, guarenteed to be unique
generate_and_hash_rsc_filegenerates a filename for a given asset. like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension) used so that certain asset files dont have to be hashed twice
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_autowiki_outputWhen the AUTOWIKI define is enabled, will generate an output file for tools/autowiki/autowiki.js to consume. Autowiki code intentionally still exists even without the define, to ensure developers notice when they break it immediately, rather than until CI or worse, call time. Returns a string of the autowiki output file
generate_bitfieldsTurns /datum/bitfield subtypes into a list for use in debugging
generate_chemwiki_lineGenerate the big list of reagent based reactions. style='background-color:#FFEE88;'|{{anchor|Synthetic-derived growth factor}}Synthetic-derived growth factorâ®
generate_cult_rune_typesReturns an associated list of rune types. [rune.cultist_name] = [typepath]
generate_generator_indexCreates generator__id => type map.
generate_icon_alpha_maskHelper proc to generate a cutout alpha mask out of an icon.
generate_items_insideCreates new items inside an atom based on a list
generate_left_leg_maskThe proc that handles generating left leg masks at runtime. It basically creates an icon that are all white on all dirs except WEST, where there's a cutout of the left leg that needed to be masked.
generate_selectable_speciesGenerates species available to choose in character setup at roundstart
getReturns the atom type in the specified loc
getFlatIconCreate a single /icon from a given /atom or /image.
get_active_player_countGet active players who are playing in the round
get_adjacent_areasReturns a list of all areas that are adjacent to the center atom's area, clear the list of nulls at the end.
get_adjacent_open_turfsReturns a list with all the adjacent open turfs. Clears the list of nulls in the end.
get_airlock_overlayOverlay cache. Why isn't this just in /obj/machinery/door/airlock? Because its used just a tiny bit in door_assembly.dm Refactored so you don't have to make a null copy of airlock to get to the damn thing Someone, for the love of god, profile this. Is there a reason to cache mutable_appearance if so, why are we JUST doing the airlocks when we can put this in mutable_appearance.dm for everything
get_allowed_instrument_idsGet all non admin_only instruments as a list of text ids.
get_angleCalculate the angle between two movables and the west|east coordinate
get_angle_rawAngle between two arbitrary points and horizontal line same as /proc/get_angle
get_area_nameReturns the name of the area the atom is in
get_areas_in_rangeReturns a list with the names of the areas around a center at a certain distance Returns the local area if no distance is indicated Returns an empty list if the center is null
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_cached_actionspeed_modifierGrabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!
get_cached_movespeed_modifierGrabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!
get_cardinal_dirGet the cardinal direction between two atoms
get_chem_idReturns reagent datum from reagent name string
get_closest_atomReturns the closest atom of a specific type in a list from a source
get_dist_euclidianReturns the distance between two atoms
get_distributionThis is a pretty complicated algorithm, but it's one I'm rather proud of.
get_edge_target_turfReturns the turf located at the map edge in the specified direction relative to target_atom used for mass driver
get_element_by_varreturn first thing in L which has var/varname == value this is typecaste as list/L, but you could actually feed it an atom instead. completely safe to use
get_flat_existing_human_iconA simpler version of get_flat_human_icon() that uses an existing human as a base to create the icon. Does not feature caching yet, since I could not think of a good way to cache them without having a possibility of using the cached version when we don't want to, so only use this proc if you just need this flat icon generated once.
get_hearLike view but bypasses luminosity check
get_hearers_in_LOSReturns a list of movable atoms that are hearing sensitive in view_radius and line of sight to source the majority of the work is passed off to the spatial grid if view_radius > 0 because view() isnt a raycasting algorithm, this does not hold symmetry to it. something in view might not be hearable with this. if you want that use get_hearers_in_view() - however thats significantly more expensive
get_hearers_in_viewreturns every hearaing movable in view to the turf of source not taking into account lighting useful when you need to maintain always being able to hear something if a sound is emitted from it and you can see it (and youre in range). otherwise this is just a more expensive version of get_hearers_in_LOS()
get_icon_dmi_pathgiven an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path. a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc, but stringifying rsc references returns a dmi file path ONLY if that icon represents a completely unchanged dmi file from when the game was compiled. so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns ""
get_lineGet a list of turfs in a line from starting_atom to ending_atom.
get_mob_by_ckeyreturns a mob type controlled by a specified ckey
get_mob_by_keyReturn the mob type that is being controlled by a ckey
get_mob_or_brainmobReturns the occupant mob or brain from a specified input
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_officer_departmentsReturns the distribution of splitting the given security officers into departments. Return value is an assoc list of candidate => SEC_DEPT_*.
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_path_by_slotReturns a generic path of the object based on the slot
get_path_toThis file contains the stuff you need for using JPS (Jump Point Search) pathing, an alternative to A* that skips over large numbers of uninteresting tiles resulting in much quicker pathfinding solutions. Mind that diagonals cost the same as cardinal moves currently, so paths may look a bit strange, but should still be optimal.
get_pixel_anglefor getting the angle when animating something's pixel_x and pixel_y
get_pixel_distanceFinds the distance between two atoms, in pixels centered = FALSE counts from turf edge to edge centered = TRUE counts from turf center to turf center of course mathematically this is just adding world.icon_size on again
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_drinkGets a random drink excluding the blocked type
get_random_foodGet a random food item exluding the blocked ones
get_random_jumpskirtReturns a random, acceptable jumpskirt typepath
get_random_jumpsuitReturns a random, acceptable jumpsuit typepath
get_random_reagent_idReturns a random reagent object minus blacklisted reagents
get_random_station_turfReturns a random turf on the station
get_ranged_target_turf_directGet ranged target turf, but with direct targets as opposed to directions
get_reagent_type_from_product_stringReturns a list of chemical_reaction datums that have the input STRING as a product
get_recipe_from_reagent_productTakes a type in and returns a list of associated recipes
get_round_default_lawsetA getter that sets up the round default if it has not been yet.
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_storage_locsReturns a list of the parents of all storage components that contain the target item
get_teleport_locReturns location. Returns null if no location was found.
get_temp_change_amountUsed to get the amount of change between two body temperatures
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
give_admin_popupTries to give the target an admin popup. If it fails, will send the error to the passed admin.
goonchem_vortexMagical move-wooney that happens sometimes.
honkerblastUnleashes a honkerblast similar to the honkmech weapon, but with more granular control.
htmlrendertextPerform a whitespace cleanup on the text, similar to what HTML renderers do
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)
icon2htmlthe dmi file path we attempt to return if the given object argument is associated with a stringifiable icon if successful, this looks like "icons/path/to/dmi_file.dmi" but they pass both isicon() and isfile() checks. theyre the easiest case since stringifying them gives us the path we want generate an asset for the given icon or the icon of the given appearance for [thing], and send it to any clients in target. Arguments:
icon_existsChecks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.
inLineOfSightCalculate if two atoms are in sight, returns TRUE or FALSE
init_chemical_reagent_listInitialises all /datum/reagent into a list indexed by reagent id
init_crafting_recipesInits the crafting recipe list, sorting crafting recipe requirements in the process.
init_fishing_configurationsThese are shared between their spots
init_hotspot_reactionsReturns reactions which will contribute to a hotspot's size.
init_keybindingsCreates and sorts all the keybinding datums
init_subtypes_w_path_keysFunctions like init_subtypes, but uses the subtype's path as a key for easy access
initialize_starting_knowledgeReturns a list of all heretic knowledge TYPEPATHS that have route set to PATH_START.
int_to_wordsTakes a 1, 2 or 3 digit number and returns it in words. Don't call this directly, use convert_integer_to_words() instead.
invert_HTML_colourInverts the colour of an HTML string
ion_numPicks a string of symbols to display as the law number for hacked or ion laws is at the start to prevent us from changing say modes via get_message_mode()
isAdminGhostAIIs the passed in mob an admin ghost WITH AI INTERACT enabled
isAdminObserverIs the passed in mob a ghost with admin powers, doesn't check for AI interact like isAdminGhost() used to
is_color_darkGiven a color in the format of "#RRGGBB", will return if the color is dark.
is_convertable_to_cultReturns whether the given mob is convertable to the blood cult
is_guest_keyReturns whether or not a player is a guest using their ckey as an input
is_ic_filteredGiven a text, will return what word is on the IC filter, with the reason. Returns null if the message is OK.
is_ic_filtered_for_pdasGiven a text, will return what word is on the IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK.
is_infiltrator_docked_at_centcomReturns whether or not syndicate operatives escaped.
is_ooc_filteredGiven a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK.
is_path_in_listChecks for specific paths in a list.
is_safe_turfChecks if a given turf is a "safe" location
is_soft_ic_filteredGiven a text, will return what word is on the soft IC filter, with the reason. Returns null if the message is OK.
is_soft_ic_filtered_for_pdasGiven a text, will return what word is on the soft IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK.
is_soft_ooc_filteredGiven a text, will return that word is on the soft OOC filter, with the reason. Returns null if the message is OK.
is_source_facing_targetCompare source's dir, the clockwise dir of source and the anticlockwise dir of source To the opposite dir of the dir returned by get_dir(target,source) If one of them is a match, then source is facing target
is_special_characterReturns TRUE if the game has started and we're either an AI with a 0th law, or we're someone with a special role/antag datum
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
is_valid_dmi_filegiven a text string, returns whether it is a valid dmi icons folder path
is_valid_srcCheck if a datum has not been deleted and is a valid source
is_valid_z_level
ishumanbasicReturns if the given target is a human. Like, a REAL human. Not a moth, not a felinid (which are human subtypes), but a human.
iso_to_weekdayReturns an integer in ISO format 1 (Monday) - 7 (Sunday) as a string day
isvineimmuneUsed to determine whether the mob is immune to actions by the vine. Use cases: Stops vine from attacking itself, other plants.
item_heal_roboticHeal a robotic body part on a mob
join_admin_ranksTakes a list of rank names and joins them with +
json_deserialize_datumConvert a list of json to datum
json_serialize_datumConvert a datum into a json blob
kvpify_listConverts a list into a list of assoc lists of the form ("key" = key, "value" = value) so that list keys that are themselves lists can be fully json-encoded
lavaland_equipment_pressure_checkCheck if the turf pressure allows specialized equipment to work
lawid_to_typereturns the law datum with the lawid in question, law boards and law datums should share this id.
lightningboltthis is the actual bolt effect and damage, made into its own proc because it is used elsewhere
list_clear_nullsRemoves any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise
living_player_countReturns the amount of currently living players
load_default_map_configProc that simply loads the default map config, which should always be functional.
load_mapShortcut function to parse a map and apply it to the world.
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:
load_poll_dataLoads all current and future server polls and their options to store both as datums.
log_accessLogging for changes to ID card access
log_atmosLogs the contents of the gasmix to the game log, prefixed by text
log_attackGeneric attack logging
log_bomberLogging for bombs detonating
log_changeling_powerLogging for changeling powers purchased
log_chatLogging for chatting on modular computer channels
log_combatLog a combat message in the attack log
log_configLogging for config errors Rarely gets called; just here in case the config breaks.
log_directed_talkHelper for logging of messages with only one sender and receiver (i.e. mind links)
log_dsayLogging for DeachatSay (DSAY) messages
log_dynamicLogging for dynamic procs
log_emoteLogging for emotes
log_filterLogs to the filter log with the given message, match, and scope
log_gameLogging for generic/unsorted game messages
log_heretic_knowledgeLogging for heretic powers learned
log_job_debugLogging for job slot changes
log_luaLogging for lua scripting
log_manifestLogging for player manifest (ckey, name, job, special role, roundstart/latejoin)
log_mappingLogging for mapping errors
log_mechaLogging for mech actions
log_oocLogging for messages sent in OOC
log_paperLogging for writing made on paper
log_pdaLogging for PDA messages sent
log_perfLogging for game performance
log_prayerLogging for prayed messages
log_qdelLogging for hard deletes
log_query_debugLogging for SQL errors
log_researchPuts the text into the research html file, not log. See [INVESTIGATE_RESEARCH] for [/atom/proc/investigate_log]
log_sayLogging for generic spoken messages
log_shuttleLogging for shuttle actions
log_speech_indicatorsLogging for speech indicators.
log_spellbookLogging for wizard powers learned
log_sqlLogging for DB errors
log_suspicious_loginWrites to a special log file if the log_suspicious_login config flag is set, which is intended to contain all logins that failed under suspicious circumstances.
log_telecommsLogging for speech taking place over comms, as well as tcomms equipment
log_tguiAppends a tgui-related log entry. All arguments are optional.
log_toolLogging for tool usage
log_topicLogging for world/Topic
log_traitorLogging for traitor objectives
log_virusLogging for the creation and contraction of viruses
log_whisperLogging for whispered messages
log_worldLog to both DD and the logfile.
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_associativeMake a normal list an associative one
make_bodyUses stripped down and bastardized code from respawn character
make_datum_references_listsInitial Building
make_into_clownHelper proc that handles making someone into a clown after a bananium nuke goes off.
make_tupleReturns the name of the mathematical tuple of same length as the number arg (rounded down).
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_syndicateUsed by communications consoles to message the Syndicate
message_to_htmlMessage-related procs
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
move_elementMove a single element from position from_index within a list, to position to_index All elements in the range [1,to_index) before the move will be before the pivot afterwards All elements in the range [to_index, L.len+1) before the move will be after the pivot afterwards In other words, it's as if the range [from_index,to_index) have been rotated using a <<< operation common to other languages. from_index and to_index must be in the range [1,L.len+1] This will preserve associations ~Carnie
move_rangeMove elements [from_index,from_index+len) to [to_index-len, to_index) Same as moveElement but for ranges of elements This will preserve associations ~Carnie
movespeed_data_null_checkChecks if a move speed modifier is valid and not missing any data
mutable_appearanceHelper similar to image()
narsie_apocalypseThird crew last second win check and flufftext for [/proc/begin_the_end()]
narsie_end_begin_checkFirst crew last second win check and flufftext for [/proc/begin_the_end()]
narsie_end_second_checkSecond crew last second win check and flufftext for [/proc/begin_the_end()]
narsie_last_second_winCalled only if the crew managed to destroy narsie at the very last second for [/proc/begin_the_end()]
narsie_start_destroy_stationsecurity level and shuttle lockdowns for [/proc/begin_the_end()]
next_list_itemReturns the next item in a list
nuke_gibHelper proc that handles gibbing someone who has been nuked.
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
parse_zoneReturn a string for the specified body zone. Should be used for parsing non-instantiated bodyparts, otherwise use /obj/item/bodypart/var/plaintext_zone
passA do nothing proc
peekReturns the top (last) element from the list, does not remove it from the list. Stack functionality.
pick_closest_pathReturns a chosen path that is the closest to a list of matches
pick_n_takePick 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.
pick_weighted_lawsetreturns a law datum based off of config. will never roll asimov as the weighted datum if the station has a unique AI.
piglatin_sentenceruns piglatin_word() proc on each word in a sentence. preserves caps and punctuation
piglatin_wordtakes "word", and returns it piglatinized.
play_cinematicPlays a cinematic, duh. Can be to a select few people, or everyone.
play_fov_effectPlays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness
playsoundplaysound is a proc used to play a 3D sound in a specific range. This uses SOUND_RANGE + extra_range to determine that.
podspawnOne proc for easy spawning of pods in the code to drop off items before whizzling (please don't proc call this in game, it will destroy you)
poll_candidatesCalls the show_candidate_poll_window() to all eligible ghosts
poll_candidates_for_mobReturns a list of ghosts that are eligible to take over and wish to be considered for a mob.
poll_candidates_for_mobsReturns a list of ghosts that are eligible to take over and wish to be considered for a mob.
poll_ghost_candidatesWrapper to send all ghosts the poll to ask them if they want to be considered for a mob.
poll_holidayTakes a holiday datum, a starting month, ending month, max amount of days to test in, and min/max year as input Returns a list in the form list("yyyy/m/d", ...) representing all days the holiday runs on in the tested range
popReturns the top(last) element from the list and removes it from the list (typical stack function)
populate_editable_sign_typesThis proc populates GLOBAL_LIST_EMPTY(editable_sign_types)
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.
power_failDisable power in the station APCs
previous_list_itemReturns the previous item in a list
print_holidayDoes the same as /proc/poll_holiday, but prints the output to admins instead of returning it
print_security_recordStandardized printed records. SPRs. Like SATs but for bad guys who probably didn't actually finish school. Input the records and out comes a paper.
process_teleport_locsGenerate a list of turfs you can teleport to from the areas list
propagate_networkremove the old powernet and replace it with a new one throughout the network.
qdelShould be treated as a replacement for the 'del' keyword.
ran_zoneReturn the zone or randomly, another valid zone
random_bounty
random_capital_letterhandles thousands
random_colourReturns a random color picked from a list, has 2 modes (0 and 1), mode 1 doesn't pick white, black or gray
random_fish_typeReturns random fish, using random_case_rarity probabilities.
random_nukecodeReturns a string for a random nuke code
random_stepForces the atom to take a step in a random direction
ranks_from_rank_nameConverts a rank name (such as "Coder+Moth") into a list of /datum/admin_rank
rcd_result_with_memoryProduces a new RCD result from the given one if it can be calculated that the RCD should speed up with the remembered form.
rcd_scanGlobal proc that generates RCD hologram in a range.
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_list_resolveReturns a list with all weakrefs resolved
recursive_list_resolve_elementHelper for /proc/recursive_list_resolve
recursive_loc_checkRecursively checks if an item is inside a given type, even through layers of storage. Returns the atom if it finds it.
recursive_organ_check
refify_listReturns a copy of the list where any element that is a datum or the world is converted into a ref
reject_bad_chattextThe procedure to check the text of the entered text on ntnrc_client.dm
reject_bad_nameFilters out undesirable characters from names.
reject_bad_textReturns the text if properly formatted, or null else.
remove_image_from_clientRemoves an image from a client's .images. Useful as a callback.
remove_images_from_clientsLike remove_image_from_client, but will remove the image from a list of clients
remove_nulls_from_listremove all nulls from a list
remove_verbhandles removing verb and sending it to browser to update, use this for removing verbs
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.
return_atmos_handbooksFinal product is a numbered list, this one is assoc just so we can generate the "reactions" entry easily. Returns an assoc list of the gas handbook and the reaction handbook. For UIs, simply do data += return_atmos_handbooks() to use.
return_unused_frequencyreturns a random unused frequency between MIN_FREE_FREQ & MAX_FREE_FREQ if free = TRUE, and MIN_FREQ & MAX_FREQ if FALSE
reverse_rangereplaces reverseList ~Carnie
rustg_get_versionGets the version of rust_g
sanitizeRuns byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
sanitize_colorMakes sure the input color is text with a # at the start followed by 6 hexadecimal characters. Examples: "#ff1234", "#A38321", COLOR_GREEN_GRAY
sanitize_css_class_nameRemoves all non-alphanumerics from the text, keep in mind this can lead to id conflicts
sanitize_filepathSanitizes the name of each node in the path.
sanitize_frequencyEnsure the frequency is within bounds of what it should be sending/receiving at
sanitize_namereturns nothing with an alert instead of the message if it contains something in the ic filter, and sanitizes normally if the name is fine. It returns nothing so it backs out of the input the same way as if you had entered nothing.
scramble_message_replace_charsSlightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML!
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?)
screen_textReturn an object with a new maptext (not currently in use)
seedifyFinds and extracts seeds from an object
send2chatSends a message to TGS chat channels.
send2otherserverSends a message to a set of cross-communications-enabled servers using world topic calls
send_tip_of_the_roundSends a round tip to a target. If selected_tip is null, a random tip will be sent instead (5% chance of it being silly). Tips that starts with the @ character won't be html encoded. That's necessary for any tip containing markup tags, just make sure they don't also have html characters like <, > and ' which will be garbled.
send_to_playing_playerssends a whatever to all playing players; use instead of to_chat(world, where needed)
serialize_antag_nameSerializes an antag name to be used for preferences UI
setup_mod_themesGlobal proc that sets up all MOD themes as singletons in a list and returns it.
setup_round_default_lawsfirst called when something wants round default laws for the first time in a round, considers config returns a law datum that GLOB._round_default_lawset will be set to.
shake_cameraShake the camera of the person viewing the mob SO REAL! Takes the mob to shake, the time span to shake for, and the amount of tiles we're allowed to shake by in tiles Duration isn't taken as a strict limit, since we don't trust our coders to not make things feel shitty. So it's more like a soft cap.
show_candidate_poll_windowShow the poll window to the candidate mobs
shuffleRandomize: Return the list in a random order
shuffle_inplacesame as shuffle, but returns nothing and acts on list in place
simple_network_name_fixNetwork name should be all caps and no punctuation except for _ and . between domains This does a quick an dirty fix to a network name to make sure it works
siunitFormats a number to human readable form with the appropriate SI unit.
siunit_pressure
slice_off_turfsReturns a slice of a list of turfs, defined by the ones that are inside the inner/outer angle's bounds
sort_keyfor sorting clients or mobs by ckey
sort_listsort any value in a list
sort_mobsOrders mobs by type then by name. Accepts optional arg to sort a custom list, otherwise copies GLOB.mob_list.
sort_namesuses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead
sort_recordSpecifically for record datums in a list.
special_list_filterReturns a list with items filtered from a list that can call callback
spiral_rangesimilar function to range(), but with no limitations on the distance; will search spiralling outwards from the center
spiral_range_turfssimilar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs)
spread_reagentsExposes all accessible atoms within some distance of an epicenter to some reagents. Does not clear the source reagent holder; that must be done manually if it is desired.
stack_tracegives us the stack trace from CRASH() without ending the current proc.
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.
stripped_inputUsed to get a properly sanitized input. Returns null if cancel is pressed.
stripped_multiline_inputUsed to get a properly sanitized input in a larger box. Works very similarly to stripped_input.
swap_rangeMove elements from [from_index, from_index+len) to [to_index, to_index+len) Move any elements being overwritten by the move to the now-empty elements, preserving order Note: if the two ranges overlap, only the destination order will be preserved fully, since some elements will be within both ranges ~Carnie
techweb_item_boost_checkReturns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list()
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.
tgui_TopicMiddleware for /client/Topic.
tgui_input_listCreates a TGUI input list window and returns the user's response.
tgui_input_numberCreates a TGUI window with a number input. Returns the user's response as num | null.
tgui_input_textCreates a TGUI window with a text input. Returns the user's response.
time_to_twelve_hourConverts a time expressed in deciseconds (like world.time) to the 12-hour time format. the format arg is the format passed down to time2text() (e.g. "hh:mm" is hours and minutes but not seconds). the timezone is the time value offset from the local time. It's to be applied outside time2text() to get the AM/PM right.
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.
tool_behaviour_namereturns an ic name of the tool needed Arguments:
truncateTruncate a string to the given length
try_move_adjacentTries to move an atom to an adjacent turf, return TRUE if successful
typecache_filter_listreturns a new list with only atoms that are in the typecache list
typecache_filter_list_reversereturn a new list with atoms that are not in the typecache list
typecache_filter_multi_list_exclusionsimilar to typecache_filter_list and typecache_filter_list_reverse but it supports an inclusion list and and exclusion list
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.
unformat_frequencyOpposite of format, returns as a number
unique_listReturn a list with no duplicate entries
unique_list_in_placesame as unique_list, but returns nothing and acts on list in place (also handles associated values properly)
urangeultra range (no limitations on distance, faster than range for distances > 8); including areas drastically decreases performance
url2htmlloaderReturn html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
valid_window_locationChecks whether the target turf is in a valid state to accept a directional window or other directional pseudo-dense object such as railings.
view_to_pixelsTakes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)
voice_of_godVOICE OF GOD
weakrefify_listReturns a copy of the list where any element that is a datum is converted into a weakref
weekday_to_isoReturns a string day as an integer in ISO format 1 (Monday) - 7 (Sunday)
weight_class_to_textReturns a string based on the weight class define used as argument
wendigo_slamSlams the ground around the source throwing back enemies caught nearby, delay is for the radius increase
window_flashFlash the window of a player
woundscanDisplays wounds with extended information on their status vs medscanners
zebra_typecacheofLike typesof() or subtypesof(), but returns a typecache instead of a list. This time it also uses the associated values given by the input list for the values of the subtypes.

Var Details

var Debugger – /static/datum/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

var Failsafe – /static/datum/controller/failsafe

Failsafe

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

var SSacid – /static/datum/controller/subsystem/processing/acid

The subsystem used to tick /datum/component/acid instances.

var SSai_behaviors – /static/datum/controller/subsystem/processing/ai_behaviors

The subsystem used to tick /datum/ai_behavior instances. Handling the individual actions an AI can take like punching someone in the fucking NUTS

var SSai_controllers – /static/datum/controller/subsystem/ai_controllers

The subsystem used to tick /datum/ai_controllers instances. Handling the re-checking of plans.

var SSai_movement – /static/datum/controller/subsystem/movement/ai_movement

The subsystem used to tick /datum/ai_movement instances. Handling the movement of individual AI instances

var SSambience – /static/datum/controller/subsystem/ambience

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

var SSaura_healing – /static/datum/controller/subsystem/processing/aura_healing

The subsystem used to tick /datum/component/aura_healing instances.

var SSclock_component – /static/datum/controller/subsystem/processing/clock_component

The subsystem used to tick /datum/component/acid instances.

Discord Subsystem

This subsystem handles some integrations with discord

NOTES:

• There is a DB table to track ckeys and associated discord IDs. (discord_link)
• This system REQUIRES TGS for notifying users at end of the round
• The SS uses fire() instead of just pure shutdown, so people can be notified if it comes back after a crash, where the SS wasn't properly shutdown
• It only writes to the disk every 5 minutes, and it won't write to disk if the file is the same as it was the last time it was written. This is to save on disk writes
• The system is kept per-server (EG: Terry will not notify people who pressed notify on Sybil), but the accounts are between servers so you dont have to relink on each server.

HOW NOTIFYING WORKS

ROUNDSTART:

1. The file is loaded and the discord IDs are extracted
2. A ping is sent to the discord with the IDs of people who wished to be notified
3. The file is emptied

MIDROUND:

1. Someone usees the notify verb, it adds their discord ID to the list.
2. On fire, it will write that to the disk, as long as conditions above are correct

END ROUND:

1. The file is force-saved, incase it hasn't fired at end round

This is an absolute clusterfuck, but its my clusterfuck -aa07

var SSearly_assets – /static/datum/controller/subsystem/early_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.

var SSeigenstates – /static/datum/controller/subsystem/eigenstates

Subsystem used to teleport people to a linked web of itterative entries. If one entry is deleted, the 2 around it will forge a link instead.

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.

var SSfoam – /static/datum/controller/subsystem/fluids/foam

The subsystem responsible for processing foam propagation and effects.

var SSid_access – /static/datum/controller/subsystem/id_access

Non-processing subsystem that holds various procs and data structures to manage ID cards, trims and access.

var SSinit_profiler – /static/datum/controller/subsystem/init_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

var SSlag_switch – /static/datum/controller/subsystem/lag_switch

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

var SSmouse_entered – /static/datum/controller/subsystem/mouse_entered

Defers MouseEntered inputs to only apply to the most recently hovered over atom in the tick

var SSmove_manager – /static/datum/controller/subsystem/move_manager

Acts as a namespace for movement packet/type related procs

Exists to provide an in code implementation of movement looping Replaces things like walk() or walk_to(), among others

Because we're doing things in engine, we have a lot more control over how different operations are performed We also get more say in when things happen, so we can subject movements to the whims of the master controller Rather then using a fuck ton of cpu just moving mobs or meteors

The goal is to keep the loops themselves reasonably barebone, and implement more advanced behavior and control via the signals

This may be bypassed in cases where snowflakes are nessesary, or where performance is important. S not a hard and fast thing

Every atom can have a movement packet, which contains information and behavior about currently active loops, and queuing info Loops control how movement actually happens. So there's a "move in this direction" loop, a "move randomly" loop

You can find the logic for this control in this file

Specifics of how different loops operate can be found in the movement_types.dm file, alongside the add to loop helper procs that use them

var SSpoints_of_interest – /static/datum/controller/subsystem/points_of_interest

Subsystem for managing all POIs.

var SSsinguloprocess – /static/datum/controller/subsystem/processing/singuloprocess

Very rare subsystem, provides any active singularities with the timings and seclusion they need to succeed

var SSsmoke – /static/datum/controller/subsystem/fluids/smoke

The subsystem responsible for processing smoke propagation and effects.

Spatial Grid

a gamewide grid of spatial_grid_cell datums, each "covering" SPATIAL_GRID_CELLSIZE ^ 2 turfs. each spatial_grid_cell datum stores information about what is inside its covered area, so that searches through that area dont have to literally search through all turfs themselves to know what is within it since view() calls are expensive, and so is iterating through stuff you dont want. this allows you to only go through lists of what you want very cheaply.

you can also register to objects entering and leaving a spatial cell, this allows you to do things like stay idle until a player enters, so you wont have to use expensive view() calls or iteratite over the global list of players and call get_dist() on every one. which is fineish for a few things, but is k * n operations for k objects iterating through n players.

currently this system is only designed for searching for relatively uncommon things, small subsets of /atom/movable. dont add stupid shit to the cells please, keep the information that the cells store to things that need to be searched for often

The system currently implements two different "classes" of spatial type

The first exists to support important_recursive_contents. So if a client is inside a locker and the locker crosses a boundary, you'll still get a signal from the spatial grid. These types are SPATIAL_GRID_CONTENTS_TYPE_HEARING and SPATIAL_GRID_CONTENTS_TYPE_CLIENTS

The second pattern is more paired down, and supports more wide use. Rather then the object and anything the object is in being sensitive, it's limited to just the object itself Currently only SPATIAL_GRID_CONTENTS_TYPE_ATMOS uses this pattern. This is because it's far more common, and so worth optimizing

var SSspeech_controller – /static/datum/controller/subsystem/verb_manager/speech_controller

verb_manager subsystem just for handling say's

var SStgui – /static/datum/controller/subsystem/tgui

tgui subsystem

Contains all tgui state and subsystem code.

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.

var SSverb_manager – /static/datum/controller/subsystem/verb_manager

SSverb_manager, a subsystem that runs every tick and runs through its entire queue without yielding like SSinput. this exists because of how the byond tick works and where user inputted verbs are put within it.

see TICK_ORDER.md for more info on how the byond tick is structured.

The way the MC allots its time is via TICK_LIMIT_RUNNING, it simply subtracts the cost of SendMaps (MAPTICK_LAST_INTERNAL_TICK_USAGE) plus TICK_BYOND_RESERVE from the tick and uses up to that amount of time (minus the percentage of the tick used by the time it executes subsystems) on subsystems running cool things like atmospherics or Life or SSInput or whatever.

Without this subsystem, verbs are likely to cause overtime if the MC uses all of the time it has alloted for itself in the tick, and SendMaps uses as much as its expected to, and an expensive verb ends up executing that tick. This is because the MC is completely blind to the cost of verbs, it can't account for it at all. The only chance for verbs to not cause overtime in a tick where the MC used as much of the tick as it alloted itself and where SendMaps costed as much as it was expected to is if the verb(s) take less than TICK_BYOND_RESERVE percent of the tick, which isnt much. Not to mention if SendMaps takes more than 30% of the tick and the MC forces itself to take at least 70% of the normal tick duration which causes ticks to naturally overrun even in the absence of verbs.

With this subsystem, the MC can account for the cost of verbs and thus stop major overruns of ticks. This means that the most important subsystems like SSinput can start at the same time they were supposed to, leading to a smoother experience for the player since ticks arent riddled with minor hangs over and over again.

var SSwardrobe – /static/datum/controller/subsystem/wardrobe

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

var SSwiremod_composite – /static/datum/controller/subsystem/wiremod_composite

This subsystem is to handle creating and storing composite templates that are used to create composite datatypes for integrated circuits

See: https://en.wikipedia.org/wiki/Composite_data_type

Proc Details

proc GUID()

returns a GUID like identifier (using a mostly made up record format) guids are not on their own suitable for access or security tokens, as most of their bits are predictable. (But may make a nice salt to one)

proc GetBestWeapon(/datum/ai_controller/controller, /list/choices, /list/held_weapons)

Returns either the best weapon from the given choices or null if held weapons are better

proc GetTgsStealthKey()

Gets TGS's stealth key, generates one if none is found

proc Gibberish(text, replace_characters, chance)

Turn text into complete gibberish!

text is the inputted message, replace_characters will cause original letters to be replaced and chance are the odds that a character gets modified.

proc HandleUserlessProcCall(user, /datum/target, procname, /list/arguments)

Handles a userless proccall, used by circuits.

Arguments:

• user - a string used to identify the user
• target - the target to proccall on
• proc - the proc to call
• arguments - any arguments

proc HandleUserlessSDQL(user, query_text)

Handles a userless sdql, used by circuits and tgs.

Arguments:

• user - a string used to identify the user
• query_text - the query text

proc HeapPathWeightCompare(/datum/jps_node/a, /datum/jps_node/b)

TODO: Macro this to reduce proc overhead

proc IsEdible(/obj/item/thing)

returns if something can be consumed, drink or food

proc REF(input)

\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 && istype(thing, /datum) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]")

Diagnostic HUDs!

proc WEAKREF(/datum/input)

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

Wrapper for proccalls where the datum is flagged as vareditted

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

proc ___TraitRemove(target, trait, source)

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

proc ______qdel_list_wrapper(/list/L)

the underscores are to encourage people not to use this directly.

proc __lua_awaken(state)

Dequeues the task at the front of the sleep queue and resumes it

required state text a pointer to the state in which to resume a task

return list|text|null a list of lua return information, an error message if the state is corrupted, or null if the sleep queue is empty

Lua return information is formatted as followed:

• ["status"]: How the chunk or function stopped code execution
• "sleeping": The chunk or function called dm.sleep, placing it in the sleep queue. Items in the sleep queue can be resumed using /proc/__lua_awaken
• "yielded": The chunk or function called coroutine.yield, placing it in the yield table. Items in the yield table can can be resumed by passing their index to /proc/__lua_resume
• "finished": The chunk or function finished
• "errored": The chunk or function produced an error
• "bad return": The chunk or function yielded or finished, but its return value could not be converted to DM values
• ["param"]: Depends on status.
• "sleeping": null
• "yielded" or "finished": The return/yield value(s)
• "errored" or "bad return": The error message
• ["yield_index"]: The index in the yield table where the chunk or function is located, for calls to __lua_resume
• ["name"]: The name of the chunk or function, for logging

proc __lua_call(state, function, arguments)

Calls a lua function

required state text a pointer to the state in which to call the function required function text the name of the function to call optional arguments list arguments to pass to the function

return list|text a list of lua return information or an error message if the state was corrupted

Lua return information is formatted as followed:

• ["status"]: How the chunk or function stopped code execution
• "sleeping": The chunk or function called dm.sleep, placing it in the sleep queue. Items in the sleep queue can be resumed using /proc/__lua_awaken
• "yielded": The chunk or function called coroutine.yield, placing it in the yield table. Items in the yield table can can be resumed by passing their index to /proc/__lua_resume
• "finished": The chunk or function finished
• "errored": The chunk or function produced an error
• "bad return": The chunk or function yielded or finished, but its return value could not be converted to DM values
• ["param"]: Depends on status.
• "sleeping": null
• "yielded" or "finished": The return/yield value(s)
• "errored" or "bad return": The error message
• ["yield_index"]: The index in the yield table where the chunk or function is located, for calls to __lua_resume
• ["name"]: The name of the chunk or function, for logging

proc __lua_get_globals(state)

Get the variables within a state's environment. Values not convertible to DM values are substituted for their types as text

required state text a pointer to the state to get the variables from

return list the variables of the state's environment

Get a list of all tasks currently in progress within a state

required state text a pointer to the state to get the tasks from

return list a list of the state's tasks, formatted as follows:

• name: The name of the task
• status: Whether the task is sleeping or yielding
• index: The index of the task in the sleep queue or yield table, whichever is applicable

required state text a pointer to the state in which to kill a task required info list the task info

Loads a chunk of lua source code and executes it

required state text a pointer to the state in which to execute the code required script text the lua source code to execute optional name text a name to give to the chunk

return list|text a list of lua return information or an error message if the state was corrupted

Lua return information is formatted as followed:

• ["status"]: How the chunk or function stopped code execution
• "sleeping": The chunk or function called dm.sleep, placing it in the sleep queue. Items in the sleep queue can be resumed using /proc/__lua_awaken
• "yielded": The chunk or function called coroutine.yield, placing it in the yield table. Items in the yield table can can be resumed by passing their index to /proc/__lua_resume
• "finished": The chunk or function finished
• "errored": The chunk or function produced an error
• "bad return": The chunk or function yielded or finished, but its return value could not be converted to DM values
• ["param"]: Depends on status.
• "sleeping": null
• "yielded" or "finished": The return/yield value(s)
• "errored" or "bad return": The error message
• ["yield_index"]: The index in the yield table where the chunk or function is located, for calls to __lua_resume
• ["name"]: The name of the chunk or function, for logging

proc __lua_new_state()

Creates a new lua state.

return text a pointer to the created state.

proc __lua_resume(state, index, arguments)

Removes the task at the specified index from the yield table and resumes it

required state text a pointer to the state in which to resume a task required index number the index in the yield table of the task to resume optional arguments list the arguments to resume the task with

return list|text|null a list of lua return information, an error message if the state is corrupted, or null if there is no task at the specified index

Lua return information is formatted as followed:

• ["status"]: How the chunk or function stopped code execution
• "sleeping": The chunk or function called dm.sleep, placing it in the sleep queue. Items in the sleep queue can be resumed using /proc/__lua_awaken
• "yielded": The chunk or function called coroutine.yield, placing it in the yield table. Items in the yield table can can be resumed by passing their index to /proc/__lua_resume
• "finished": The chunk or function finished
• "errored": The chunk or function produced an error
• "bad return": The chunk or function yielded or finished, but its return value could not be converted to DM values
• ["param"]: Depends on status.
• "sleeping": null
• "yielded" or "finished": The return/yield value(s)
• "errored" or "bad return": The error message
• ["yield_index"]: The index in the yield table where the chunk or function is located, for calls to __lua_resume
• ["name"]: The name of the chunk or function, for logging

proc __lua_set_datum_proc_call_wrapper(wrapper)

Sets a global proc to call in place of just outright calling a given proc on a datum

The proc will be called with the arguments (datum/thing_to_call, proc_to_call, list/arguments)

required wrapper text the name of the proc to use as the wrapper

proc __lua_set_execution_limit(limit)

Sets the maximum amount of time a lua chunk or function can execute without sleeping or yielding. Chunks/functions that exceed this duration will produce an error.

required limit number the execution limit, in milliseconds

proc __lua_set_global_proc_call_wrapper(wrapper)

Sets a global proc to call in place of just outright calling a given global proc

The proc will be called with the arguments (proc_to_call, list/arguments)

required wrapper text the name of the proc to use as the wrapper

proc __lua_set_print_wrapper(wrapper)

Sets a global proc as a wrapper for lua's print function

The proc will be called with the arguments (state_id, list/arguments)

required wrapper text the name of the proc to use as the wrapper

proc __lua_set_set_var_wrapper(wrapper)

Sets a global proc to call in place of just outright setting a datum's var to a given value

The proc will be called with the arguments (datum/datum_to_modify, var_name, value)

required wrapper text the name of the proc to use as the wrapper

proc _addtimer(/datum/callback/callback, wait, flags, /datum/controller/subsystem/timer/timer_subsystem, file, line)

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:

• callback the callback to call on timer finish
• wait deciseconds to run the timer for
• flags flags for this timer, see: code__DEFINES\subsystems.dm
• timer_subsystem the subsystem to insert this timer into

Broadcast a message to all drones in a faction

Arguments:

• msg - The message to send
• dead_can_hear - Boolean that determines if ghosts can hear the message (FALSE by default)
• source - /atom source that created the message
• faction_checked_mob - /mob/living to determine faction matches from
• exact_faction_match - Passed to /mob/proc/faction_check_mob

proc _animate_filter(/atom/target, filter_index, set_vars, time, loop, easing, flags)

Auxtools REALLY doesn't know how to handle filters as values; when passed as arguments to auxtools-called procs, they aren't simply treated as nulls - they don't even count towards the length of args. For example, calling some_proc([a filter], foo, bar) from auxtools is equivalent to calling some_proc(foo, bar). Thus, we can't use _animate directly on filters. Use this to perform animation steps on a filter. Consecutive steps on the same filter can be achieved by calling _animate with no target.

proc _contents(/atom/thing)

For some reason, an atom's contents are a kind of list that auxtools can't work with as a list This proc returns a copy of contents that is an ordinary list

proc _pick_list(/list/pick_from)

Allow me to explain for some reason, if pick() is passed arglist(args) directly and args contains only one list it considers it to be a list of lists this means something like _pick(list) would fail need to do this instead

I hate this timeline

proc _queue_verb(/datum/callback/verb_callback/incoming_callback, tick_check, /datum/controller/subsystem/verb_manager/subsystem_to_use, ...)

queue a callback for the given verb/verblike proc and any given arguments to the specified verb subsystem, so that they process in the next tick. intended to only work with verbs or verblike procs called directly from client input, use as part of TRY_QUEUE_VERB() and co.

returns TRUE if the queuing was successful, FALSE otherwise.

proc above_neck(zone)

Would this zone be above the neck

proc actionspeed_data_null_check(/datum/actionspeed_modifier/M)

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

proc active_free_borgs()

Silicon Mob Procs

Adds an instanced keybinding to the global tracker

proc add_memory_in_range(/atom/source, range, memory_type, extra_info, story_value, memory_flags, protagonist_memory_flags)

Adds a memory to people that can see this happening, only use this for impactful or rare events to reduce overhead.

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:

• target - Who the verb is being added to, client or mob typepath
• verb - typepath to a verb, or a list of verbs, supports lists of lists

Use this proc when an admin takes action that may be related to an open ticket on what what can be a client, ckey, or mob player_message: If the message should be shown in the player ticket panel, fill this out log_in_blackbox: Whether or not this message with the blackbox system. If disabled, this message should be logged with a different proc call

Runs STRIP_HTML_SIMPLE and byond's sanitization proc.

proc alone_in_area(/area/the_area, /mob/must_be_alone, check_type)

Checks if the mob provided (must_be_alone) is alone in an area

proc announce_arrival(/mob/living/carbon/human/character, rank)

Send a message in common radio when a player arrives

proc anyprob(value)

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

proc assoc_to_keys(/list/input)

Turns an associative list into a flat list of keys

proc at_least(new_value, threshold)

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

proc atmos_handbooks_init()

Automatically populates gas_handbook and reaction_handbook. They are formatted lists containing information regarding gases and reactions they participate in. Structure can be found in TS form at AtmosHandbook.tsx

proc atmos_scan(/mob/user, /atom/target, silent)

Outputs a message to the user describing the target's gasmixes.

Gets called by analyzer_act, which in turn is called by tool_act. Also used in other chat-based gas scans.

proc avoid_assoc_duplicate_keys(input_key, /list/used_key_list)

takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input

proc baseturfs_string_list(/list/values, /turf/baseturf_holder)

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

proc begin_the_end()

Begins the process of ending the round via cult narsie win Consists of later called procs (in order of called):

• [/proc/narsie_end_begin_check()]
• [/proc/narsie_end_second_check()]
• [/proc/narsie_start_destroy_station()]
• [/proc/narsie_apocalypse()]
• [/proc/narsie_last_second_win()]
• [/proc/cult_ending_helper()]

proc bit_count(bit_field)

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

proc bitfield_to_list(bitfield, /list/wordlist)

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

proc body_zone2cover_flags(def_zone)

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

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

proc build_exploration_site_ui_data()

Helper proc for exploration site listings in ui.

proc build_medicine_reagents()

Just grab every craftable medicine you can think off

proc calculate_projectile_angle_and_pixel_offsets(/atom/source, /atom/target, modifiers)

Calculates the pixel offsets and angle that a projectile should be launched at.

Arguments:

• source: The thing that the projectile is being shot from.
• target: (Optional) The thing that the projectile is being shot at.
• If this is not provided the source atom must be a mob with a client.
• modifiers: A list of click parameters used to modify the shot angle.

proc call_emergency_meeting(/mob/living/user, /area/button_zone)

If the announcer overrides alert messages, use that message. Summon the crew for an emergency meeting

Teleports the crew to a specified area, and tells everyone (via an announcement) who called the meeting. Should only be used during april fools! Arguments:

• user - Mob who called the meeting
• button_zone - Area where the meeting was called and where everyone will get teleported to

proc callback_on_everyone_on_z(/list/z_levels, /datum/callback/to_do, /atom/optional_source)

Invokes a callback on every living mob on the provided z level.

proc callback_select(/list/callbacks, /list/callback_args, savereturns, resolution)

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

Callbacks can be repeated, to call it multiple times

Arguments:

• list/callbacks the list of callbacks to be called
• list/callback_args the list of lists of arguments to pass into each callback
• savereturns Optionally save and return the list of returned values from each of the callbacks
• resolution The number of byond ticks between each time you check if all callbacks are complete

proc can_see(/atom/source, /atom/target, length)

Step-towards method of determining whether one atom can see another. Similar to viewers() note: this is a line of sight algorithm, view() does not do any sort of raycasting and cannot be emulated by it accurately

proc center_image(/image/image_to_center, x_dimension, y_dimension)

Center's an image. Requires: The Image The x dimension of the icon file used in the image The y dimension of the icon file used in the image eg: center_image(image_to_center, 32,32) eg2: center_image(image_to_center, 96,96)

proc chatter_speak(/atom/speaker, /list/letter_count, phomeme, extra_delay)

We're going to take a list that dictates the pace of speech, and a sentence fragment to say Then say() that fragment at that pace You can pass in a starting delay to wait before speaking the next sound

proc cheap_hypotenuse(Ax, Ay, Bx, By)

Calculate the hypotenuse cheaply (this should be in maths.dm)

Checks a given message to see if any of the words are something we want to treat specially, as detailed below.

There are 3 cases where a word is something we want to act on

2. Datum refs, like @0x2001169 or @mob_23. Clicking on the link opens up the VV for that datum
3. Ticket refs, like #3. Displays the status and ahelper in the link, clicking on it brings up the ticket panel for it. Returns a list being used as a tuple. Index ASAY_LINK_NEW_MESSAGE_INDEX contains the new message text (with clickable links and such) while index ASAY_LINK_PINGED_ADMINS_INDEX contains a list of pinged admin clients, if there are any.

Arguments:

• msg - the message being scanned

proc check_target_facings(/mob/living/initiator, /mob/living/target)

Returns the direction that the initiator and the target are facing

proc check_wall_item(floor_loc, dir_toward_wall, check_external)

Check if there is already a wall item on the turf loc floor_loc = floor tile in front of the wall dir_toward_wall = direction from the floor tile in front of the wall towards the wall check_external = truthy if we should be checking against items coming out of the wall, rather than visually on top of the wall.

proc check_zone(zone)

Convert a PRECISE ZONE into the BODY_ZONE

proc chem_splash(/turf/epicenter, /datum/reagents/holder, affected_range, /list/datum/reagents/reactants, extra_heat, threatscale, adminlog)

The basic chemical bomb proc. Combines a set of reagent holders into one holder and reacts it. If there are any reagents left over it spreads them across the surrounding environment. The maximum volume of the holder is temporarily adjusted to allow for reactions which increase total volume to work at full effectiveness. The maximum volume of the holder is then reset to its original value.

Arguments:

• epicenter: The epicenter of the splash if some of the reagents aren't consumed.
• holder: The holder to combine all of the reagents into. A temporary one is created if this is null.
• [reactants][/list/datum/reagents]: The set of reagent holders to combine.
• extra_heat: Some amount to heat the combined reagents by before reacting them.
• threatscale: A multiplier for the reagent quantities involved.

Returns all atoms present in a circle around the center

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

Returns all atoms present in a circle around the center but uses view() instead of range() (Currently not used)

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

proc cmp_bodypart_by_body_part_asc(/obj/item/bodypart/limb_one, /obj/item/bodypart/limb_two)

Orders bodyparts by their body_part value, ascending.

proc cmp_crafting_req_priority(A, B)

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.

proc cmp_heretic_knowledge(/datum/heretic_knowledge/knowledge_a, /datum/heretic_knowledge/knowledge_b)

Orders heretic knowledge by priority

proc cmp_port_order_asc(/datum/port/compare1, /datum/port/compare2)

Orders by integrated circuit weight

proc collect_fish_properties()

Awful workaround around initial(x.list_variable) not being a thing while trying to keep some semblance of being structured

proc color_to_full_rgba_matrix(color)

Converts RGB shorthands into RGBA matrices complete of constants rows (ergo a 20 keys list in byond).

proc compare_list(/list/l, /list/d)

compare two lists, returns TRUE if they are the same

proc considered_afk(/datum/mind/player_mind)

Checks if a player is considered AFK

proc considered_alive(/datum/mind/player_mind, enforce_human)

Returns true if the mob that a player is controlling is alive

proc considered_exiled(/datum/mind/player_mind)

Exiled check

Checks if the current body of the mind has an exile implant and is currently in an away mission. Returns FALSE if any of those conditions aren't met.

proc construct_phobia_regex(/list/name)

Creates a regular expression to match against the given phobia Capture group 2 = the scary word Capture group 3 = an optional suffix on the scary word

proc convert_integer_to_words(number, capitalise)

Takes an integer up to 999,999,999 and returns it in words. Works with negative numbers and 0.

Arguments:

• number - Integer up to 999,999,999 to convert.
• capitalise - Whether the number it returns should be capitalised or not, e.g. "Eighty Million" vs. "eighty million".

Converts the pH into a tgui readable color - i.e. white and black text is readable over it. This is NOT the colourwheel for pHes however.

proc count_by_type(/list/inserted_list, type)

return the amount of items of the same type inside a list

proc create_atmos_zone(/turf/source, range)

Create an atmos zone (Think ZAS), similiar to [proc/detect_room] but it ignores walls and turfs which are non-[atmos_can_pass]

Arguments source - the turf which to find all connected atmos turfs range - the max range to check

Returns a list of turfs, which is an area of isolated atmos

proc create_mafia_game()

Creates the global datum for playing mafia games, destroys the last if that's required and returns the new.

proc create_random_puzzgrid()

Returns a random puzzgrid from config. If config is empty, or no valid puzzgrids can be found in time, will return null.

create_separatist_nation()

Helper called to create the separatist antagonist via making a department independent from the station.

• Arguments:
• department: which department to revolt. if null, will pick a random non-independent department. starts as a type, then turns into the reference to the singleton.
• announcement: whether to tell the station a department has gone independent.
• dangerous: whether this nation will have objectives to attack other independent departments, requires more than one nation to exist obviously
• message_admins: whether this will admin log how the nation creation went. Errors are still put in runtime log either way.

Returns nothing.

proc create_strippable_list(types)

Creates an assoc list of keys to /datum/strippable_item

proc cult_ending_helper(ending_type)

Selects cinematic to play as part of the cult end depending on the outcome then ends the round afterward called either when narsie eats everyone, or when [/proc/begin_the_end()] reaches it's conclusion

proc cut_relative_direction(fragment)

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

proc day_of_month(year, month, day)

Returns the day (mon, tues, wen...) in number format, 1 (monday) - 7 (sunday) from the passed in date (year, month, day) All inputs are expected indexed at 1

proc debug_variable(name, value, level, /datum/D, sanitize)

Get displayed variable in VV variable list

proc deep_compare_list(/list/list_1, /list/list_2)

Compares 2 lists, returns TRUE if they are the same

proc deep_copy_list(/list/inserted_list)

Copies a list, and all lists inside it recusively Does not copy any other reference type

proc default_ui_state(/mob/user, /atom/source)

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

proc delete_all_SS_and_recreate_master()

Delete all existing SS to basically start over

proc deltimer(id, /datum/controller/subsystem/timer/timer_subsystem)

Delete a timer

Arguments:

• id a timerid or a /datum/timedevent

proc deprecise_zone(precise_zone)

Takes a zone and returns it's "parent" zone, if it has one.

proc disambiguate_client(whom)

Takes an argument which could be either a ckey, /client, or IRC marker, and returns a client if possible Returns [EXTERNAL_PM_USER] if an IRC marker is detected Otherwise returns null

proc display_energy(units)

Format an energy value measured in Power Cell units.

proc display_joules(units)

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

proc display_power(powerused)

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

proc do_after(/mob/user, delay, /atom/target, timed_action_flags, progress, /datum/callback/extra_checks, interaction_key, max_interact_count)

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.

proc do_after_mob(/mob/user, /list/targets, time, timed_action_flags, progress, /datum/callback/extra_checks, interaction_key, max_interact_count)

Timed action involving at least one mob user and a list of targets. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once.

proc do_mob(/mob/user, /mob/target, time, timed_action_flags, progress, /datum/callback/extra_checks, interaction_key, max_interact_count)

Timed action involving two mobs, the user and the target. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once.

proc do_smoke(range, amount, /atom/holder, location, smoke_type, log)

A helper proc used to spawn small puffs of smoke.

Arguments:

• range: The amount of smoke to produce as number of steps from origin covered.
• amount: The amount of smoke to produce as the total desired coverage area. Autofilled from the range arg if not set.
• location: Where to produce the smoke cloud.
• smoke_type: The smoke typepath to spawn.

proc dview(range, center, invis_flags)

Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).

proc dyn_explosion(/turf/epicenter, power, flame_range, flash_range, adminlog, ignorecap, silent, smoke, /atom/explosion_cause)

Using default dyn_ex scale:

100 explosion power is a (5, 10, 20) explosion. 75 explosion power is a (4, 8, 17) explosion. 50 explosion power is a (3, 7, 14) explosion. 25 explosion power is a (2, 5, 10) explosion. 10 explosion power is a (1, 3, 6) explosion. 5 explosion power is a (0, 1, 3) explosion. 1 explosion power is a (0, 0, 1) explosion.

Arguments:

• epicenter: Turf the explosion is centered at.
• power - Dyn explosion power. See reference above.
• flame_range: Flame range. Equal to the equivalent of the light impact range multiplied by this value.
• flash_range: The range at which the explosion flashes people. Equal to the equivalent of the light impact range multiplied by this value.
• ignorecap: Whether to ignore the relevant bombcap. Defaults to FALSE.
• flame_range: The range at which the explosion should produce hotspots.
• silent: Whether to generate/execute sound effects.
• smoke: Whether to generate a smoke cloud provided the explosion is powerful enough to warrant it.
• explosion_cause: [Optional] The atom that caused the explosion, when different to the origin. Used for logging.

proc emissive_appearance(icon, icon_state, layer, alpha, appearance_flags)

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

proc emissive_blocker(icon, icon_state, layer, alpha, appearance_flags)

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

proc emoji_parse(text)

Pay the owner Make alerts Log the event

proc end_cooldown(/datum/source, index)

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

Arguments:

• source - datum storing the cooldown
• index - string index storing the cooldown on the cooldowns associative list

This sends a signal reporting the cooldown end.

proc ending_helper()

Helper to set the round to end asap. Current usage Cult round end code

proc english_list(/list/input, nothing_text, and_text, comma_text, final_comma_text)

Returns a list in plain english as a string

proc expand_three_digit_color(color)

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

proc explosion(/atom/origin, devastation_range, heavy_impact_range, light_impact_range, flame_range, flash_range, adminlog, ignorecap, silent, smoke, /atom/explosion_cause)

Makes a given atom explode.

Arguments:

• origin: The atom that's exploding.
• devastation_range: The range at which the effects of the explosion are at their strongest.
• heavy_impact_range: The range at which the effects of the explosion are relatively severe.
• light_impact_range: The range at which the effects of the explosion are relatively weak.
• flash_range: The range at which the explosion flashes people.
• ignorecap: Whether to ignore the relevant bombcap. Defaults to FALSE.
• flame_range: The range at which the explosion should produce hotspots.
• silent: Whether to generate/execute sound effects.
• smoke: Whether to generate a smoke cloud provided the explosion is powerful enough to warrant it.
• explosion_cause: [Optional] The atom that caused the explosion, when different to the origin. Used for logging.

proc findTrueKey(stealth_key)

Takes a stealthed ckey as input, returns the true key it represents

proc find_obstruction_free_location(range, /atom/center, /area/specific_area)

Find an obstruction free turf that's within the range of the center. Can also condition on if it is of a certain area type.

proc find_reagent(input)

Returns reagent datum from typepath

proc find_record(field, value, /list/inserted_list)

Returns datum/data/record

proc findname(msg)

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

proc finish_equip_mob(/obj/item/item, /mob/source, /mob/user)

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

proc finish_unequip_mob(/obj/item/item, /mob/source, /mob/user)

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

proc firing_squad(/mob/living/carbon/target, /turf/source_turf, body_zone, wound_bonus, damage)

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:

• target- guy we're shooting obviously
• source_turf- where the bullet begins, preferably on a turf next to the target
• body_zone- which bodypart we're aiming for, if there is one there
• wound_bonus- the wounding power we're assigning to the bullet, since we don't care about the base one
• damage- the damage we're assigning to the bullet, since we don't care about the base one

proc flash_color(mob_or_client, flash_color, flash_time)

Flash a color on the client

proc flatten_list(/list/key_list)

Flattens a keyed list into a list of it's contents

proc flick_overlay(/image/image_to_show, /list/show_to, duration)

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

proc flick_overlay_static(overlay_image, /atom/source, duration)

Flickers an overlay on an atom

proc flick_overlay_view(/image/image_to_show, /atom/target, duration)

wrapper for flick_overlay(), flicks to everyone who can see the target atom

proc flop_animation(/atom/movable/animation_target)

This animation should be applied to actual parent atom instead of vc_object.

proc format_frequency(frequency)

Format frequency by moving the decimal.

proc format_text(text)

Properly format a string of text by using replacetext()

proc gas_mixture_parser(/datum/gas_mixture/gasmix, name)

• A simple rudimentary gasmix to information list converter. Can be used for UIs.
• Args:
• name: String used to name the list, optional.
• Returns: A list parsed_gasmixes with the following structure:
• parsed_gasmixes Value: Assoc List Desc: The thing we return
• -- Key: name Value: String Desc: Gasmix Name
• -- Key: temperature Value: Number Desc: Temperature in kelvins
• -- Key: volume Value: Number Desc: Volume in liters
• -- Key: pressure Value: Number Desc: Pressure in kPa
• -- Key: ref Value: String Desc: The reference for the instantiated gasmix.
• -- Key: gases Value: Numbered list Desc: List of gasses in our gasmix
• --- Key: 1 Value: String Desc: gas id var from the gas
• --- Key: 2 Value: String Desc: Human readable gas name.
• --- Key: 3 Value: Number Desc: Mol amount of the gas.
• -- Key: gases Value: Numbered list Desc: Assoc list of reactions that occur inside.
• --- Key: 1 Value: String Desc: reaction id var from the gas.
• --- Key: 2 Value: String Desc: Human readable reaction name.
• --- Key: 3 Value: Number Desc: The number associated with the reaction.
• Returned list should always be filled with keys even if value are nulls.

proc generateStealthCkey()

Hands back a stealth ckey to use, guarenteed to be unique

proc generate_and_hash_rsc_file(file, dmi_file_path)

generates a filename for a given asset. like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension) used so that certain asset files dont have to be hashed twice

proc generate_asset_name(file)

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

proc generate_autowiki_output()

When the AUTOWIKI define is enabled, will generate an output file for tools/autowiki/autowiki.js to consume. Autowiki code intentionally still exists even without the define, to ensure developers notice when they break it immediately, rather than until CI or worse, call time. Returns a string of the autowiki output file

proc generate_bitfields()

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

proc generate_chemwiki_line(/datum/reagent/reagent, /datum/chemical_reaction/reaction)

Generate the big list of reagent based reactions. style='background-color:#FFEE88;'|{{anchor|Synthetic-derived growth factor}}Synthetic-derived growth factorâ®

proc generate_cult_rune_types()

Returns an associated list of rune types. [rune.cultist_name] = [typepath]

proc generate_generator_index()

Creates generator__id => type map.

Helper proc to generate a cutout alpha mask out of an icon.

Why is it a helper if it's so simple?

Because BYOND's documentation is hot garbage and I don't trust anyone to actually figure this out on their own without sinking countless hours into it. Yes, it's that simple, now enjoy.

But why not use filters?

Filters do not allow for masks that are not the exact same on every dir. An example of a need for that can be found in [/proc/generate_left_leg_mask()].

Arguments:

• icon_to_mask - The icon file you want to generate an alpha mask out of.
• icon_state_to_mask - The specific icon_state you want to generate an alpha mask out of.

Returns an /icon that is the alpha mask of the provided icon and icon_state.

proc generate_items_inside(/list/items_list, where_to)

Creates new items inside an atom based on a list

The proc that handles generating left leg masks at runtime. It basically creates an icon that are all white on all dirs except WEST, where there's a cutout of the left leg that needed to be masked.

It does /not/ cache the mask itself, and as such, the caching must be done manually (which it is, look up in update_body_parts()).

Arguments:

• image/left_leg_image - image of the left leg that we need to create a mask out of.

Returns the generated left leg mask as an /icon, or null if no left_leg_image is provided.

proc 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.

proc get(/atom/loc, type)

Returns the atom type in the specified loc

proc getFlatIcon(/image/appearance, defdir, deficon, defstate, defblend, start, no_anim)

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.

proc get_active_player_count(alive_check, afk_check, human_check)

Get active players who are playing in the round

Returns a list of all areas that are adjacent to the center atom's area, clear the list of nulls at the end.

Returns a list with all the adjacent areas by getting the adjacent open turfs

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

proc get_airlock_overlay(icon_state, icon_file, em_block)

Overlay cache. Why isn't this just in /obj/machinery/door/airlock? Because its used just a tiny bit in door_assembly.dm Refactored so you don't have to make a null copy of airlock to get to the damn thing Someone, for the love of god, profile this. Is there a reason to cache mutable_appearance if so, why are we JUST doing the airlocks when we can put this in mutable_appearance.dm for everything

proc get_allowed_instrument_ids()

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

proc get_angle(/atom/movable/start, /atom/movable/end)

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

proc get_angle_raw(start_x, start_y, start_pixel_x, start_pixel_y, end_x, end_y, end_pixel_x, end_pixel_y)

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

proc get_area_name(/atom/checked_atom, format_text)

Returns the name of the area the atom is in

proc get_areas_in_range(distance, /atom/center)

Returns a list with the names of the areas around a center at a certain distance Returns the local area if no distance is indicated Returns an empty list if the center is null

proc get_atom_on_turf(/atom/movable/something_in_turf, stop_type)

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

• something_in_turf - a movable within the turf, somewhere.
• stop_type - optional - stops looking if stop_type is found in the turf, returning that type (if found).

proc get_bbox_of_atoms(/list/atoms)

Get a bounding box of a list of atoms.

Arguments:

• atoms - List of atoms. Can accept output of view() and range() procs.

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

proc get_cached_actionspeed_modifier(modtype)

Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!

proc get_cached_movespeed_modifier(modtype)

Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!

proc get_cardinal_dir(/atom/start, /atom/end)

Get the cardinal direction between two atoms

proc get_chem_id(chem_name)

Returns reagent datum from reagent name string

proc get_closest_atom(type, /list/atom_list, source)

Returns the closest atom of a specific type in a list from a source

proc get_dist_euclidian(/atom/first_location, /atom/second_location)

Returns the distance between two atoms

proc get_distribution(candidates, departments)

This is a pretty complicated algorithm, but it's one I'm rather proud of.

This is the function that is responsible for taking the list of preferences, and spitting out what to put them in.

However, it should, wherever possible, prevent solo departments. That means that if there's one medical officer, and one engineering officer, that they should be put onto the same department (either medical or engineering).

The first step is to get the "distribution". This describes how many officers should be in each department, no matter what they are. This is handled in get_distribution. Examples of inputs/outputs are: get_distribution(1, 4) => [1] get_distribution(2, 4) => [2] get_distribution(3, 4) => [3] # If this returned [2, 1], then we'd get a loner. get_distribution(4, 4) => [2, 2] # We have enough to put into a separate group

Once this distribution is received, the next step is to figure out where to put everyone.

If all members have no preference, just make one an unused department (from the departments argument). Then, call ourselves again.

Order the groups from most populated to least.

If the top group has enough officers who actually want that department, then we give it to them. If there are any leftovers (for example, if 3 officers want medical, but we only want 2), then we update those to have no preference instead.

If the top group does NOT have enough officers, then we kill the least popular group by setting them all to have no preference.

Anyone in the most popular group will be removed from the list, and the final tally will be updated. In the case of not having enough officers, this is a no-op, as there won't be any in the most popular group yet.

If there are any candidates left, then we call the algorithm again, but for everyone who hasn't been selected yet. We take the results from that run, and put them in the correct order.

As an example, let's assume we have the following preferences: [engineer, medical, medical, medical, medical, cargo]

The distribution of this is [2, 2, 2], meaning there will be 3 departments chosen and they will have 2 each. We order from most popular to least popular and get:

• medical: 4
• engineer: 1
• cargo: 1

We need 2 to fill the first group. There are enough medical staff to do it. Thus, we take the first 2 medical staff and update the output, making it now: [engineer, medical, medical, ?, ?, cargo].

The remaining two want-to-be-medical officers are now updated to act as no preference. We run the algorithm again. This time, are candidates are [engineer, none, none, cargo]. The distribution of this is [2, 2]. The frequency is:

• engineer: 1
• cargo: 1
• no preference: 2

We need 2 to fill the engineering group, but only have one who wants to do it. We have enough no preferences for it, making our result: [engineer, engineer, none, cargo]. We run the algorithm again, but this time with: [none, cargo]. Frequency is:

• cargo: 1
• no preference: 1 Enough to fill cargo, etc, and we get [cargo, cargo].

These are all then compounded into one list.

In the case that all are no preference, it will pop the last department, and use that. For example, if departments is [engi, medical, cargo], and we have the preferences: [none, none, none]... Then we will just give them all cargo.

One of the most important parts of this algorithm is IT IS DETERMINISTIC. That means that this proc is 100% testable. Instead, to get random results, the preferences and departments are shuffled before the proc is ever called.

proc get_edge_target_turf(/atom/target_atom, direction)

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

proc get_element_by_var(/list/inserted_list, varname, value)

return first thing in L which has var/varname == value this is typecaste as list/L, but you could actually feed it an atom instead. completely safe to use

proc get_flat_existing_human_icon(/mob/living/carbon/human/existing_human, directions_to_output)

A simpler version of get_flat_human_icon() that uses an existing human as a base to create the icon. Does not feature caching yet, since I could not think of a good way to cache them without having a possibility of using the cached version when we don't want to, so only use this proc if you just need this flat icon generated once.

Arguments:

• existing_human - The human we want to get a flat icon out of.
• directions_to_output - The directions of the resulting flat icon, defaults to all cardinal directions.

proc get_hear(range, /atom/source)

Like view but bypasses luminosity check

Returns a list of movable atoms that are hearing sensitive in view_radius and line of sight to source the majority of the work is passed off to the spatial grid if view_radius > 0 because view() isnt a raycasting algorithm, this does not hold symmetry to it. something in view might not be hearable with this. if you want that use get_hearers_in_view() - however thats significantly more expensive

• view_radius - what radius search circle we are using, worse performance as this increases but not as much as it used to
• source - object at the center of our search area. everything in get_turf(source) is guaranteed to be part of the search area

returns every hearaing movable in view to the turf of source not taking into account lighting useful when you need to maintain always being able to hear something if a sound is emitted from it and you can see it (and youre in range). otherwise this is just a more expensive version of get_hearers_in_LOS()

• view_radius - what radius search circle we are using, worse performance as this increases
• source - object at the center of our search area. everything in get_turf(source) is guaranteed to be part of the search area

proc get_icon_dmi_path(/icon/icon)

given an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path. a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc, but stringifying rsc references returns a dmi file path ONLY if that icon represents a completely unchanged dmi file from when the game was compiled. so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns ""

proc get_line(/atom/starting_atom, /atom/ending_atom)

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

Uses the ultra-fast Bresenham Line-Drawing Algorithm.

proc get_mob_by_ckey(key)

returns a mob type controlled by a specified ckey

proc get_mob_by_key(key)

Return the mob type that is being controlled by a ckey

proc get_mob_or_brainmob(occupant)

Returns the occupant mob or brain from a specified input

proc get_most_experienced(/list/players, specific_role)

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.

proc get_nested_locs(/atom/movable/atom_on_location, include_turf)

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

proc get_officer_departments(/list/preferences, /list/departments)

Returns the distribution of splitting the given security officers into departments. Return value is an assoc list of candidate => SEC_DEPT_*.

proc get_offset_target_turf(/atom/target_atom, dx, dy)

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

proc get_open_turf_in_dir(/atom/center, dir)

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

proc get_path_by_slot(slot_id)

Returns a generic path of the object based on the slot

proc get_path_to(caller, end, max_distance, mintargetdist, id, simulated_only, /turf/exclude, skip_first, diagonal_safety)

This file contains the stuff you need for using JPS (Jump Point Search) pathing, an alternative to A* that skips over large numbers of uninteresting tiles resulting in much quicker pathfinding solutions. Mind that diagonals cost the same as cardinal moves currently, so paths may look a bit strange, but should still be optimal.

This is the proc you use whenever you want to have pathfinding more complex than "try stepping towards the thing". If no path was found, returns an empty list, which is important for bots like medibots who expect an empty list rather than nothing.

Arguments:

• caller: The movable atom that's trying to find the path
• end: What we're trying to path to. It doesn't matter if this is a turf or some other atom, we're gonna just path to the turf it's on anyway
• max_distance: The maximum number of steps we can take in a given path to search (default: 30, 0 = infinite)
• mintargetdistance: Minimum distance to the target before path returns, could be used to get near a target, but not right to it - for an AI mob with a gun, for example.
• id: An ID card representing what access we have and what doors we can open. Its location relative to the pathing atom is irrelevant
• simulated_only: Whether we consider turfs without atmos simulation (AKA do we want to ignore space)
• exclude: If we want to avoid a specific turf, like if we're a mulebot who already got blocked by some turf
• skip_first: Whether or not to delete the first item in the path. This would be done because the first item is the starting tile, which can break movement for some creatures.
• diagonal_safety: ensures diagonal moves won't use invalid midstep turfs by splitting them into two orthogonal moves if necessary

Gets the perceived "danger" of radiation pulse, given the threshold to the target. Returns a RADIATION_DANGER_* define, see code/__DEFINES/radiation.dm

proc get_pixel_angle(y, x)

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

proc get_pixel_distance(/atom/start, /atom/end, centered)

Finds the distance between two atoms, in pixels centered = FALSE counts from turf edge to edge centered = TRUE counts from turf center to turf center of course mathematically this is just adding world.icon_size on again

proc get_player_client(player)

Returns a client from a mob, mind or client

proc get_powernet_info_from_source(power_source)

Extracts the powernet and cell of the provided power source

proc get_preferences_in_priority_order()

Returns a flat list of preferences in order of their priority

proc get_random_drink()

Gets a random drink excluding the blocked type

proc get_random_food()

Get a random food item exluding the blocked ones

proc get_random_jumpskirt()

Returns a random, acceptable jumpskirt typepath

proc get_random_jumpsuit()

Returns a random, acceptable jumpsuit typepath

proc get_random_reagent_id()

Returns a random reagent object minus blacklisted reagents

proc get_random_station_turf()

Returns a random turf on the station

proc get_ranged_target_turf_direct(/atom/starting_atom, /atom/target, range, offset)

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:

• starting_atom - Initial Firer / Position
• target - Target to aim towards
• range - Distance of returned target turf from starting_atom
• offset - Angle offset, 180 input would make the returned target turf be in the opposite direction

proc get_reagent_type_from_product_string(string)

Returns a list of chemical_reaction datums that have the input STRING as a product

proc get_recipe_from_reagent_product(input_type)

Takes a type in and returns a list of associated recipes

proc get_round_default_lawset()

A getter that sets up the round default if it has not been yet.

round_default_lawset is what is considered the default for the round. Aka, new AI and other silicons would get this. You might recognize the fact that 99% of the time it is asimov.

This requires config, so it is generated at the first request to use this var.

proc get_safe_random_station_turf(/list/areas_to_pick_from)

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

proc get_selectable_species()

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

proc get_storage_locs(/obj/item/target)

Returns a list of the parents of all storage components that contain the target item

proc get_teleport_loc(/turf/location, /mob/target, distance, density_check, closed_turf_check, errorx, errory, eoffsetx, eoffsety)

Returns location. Returns null if no location was found.

proc get_temp_change_amount(temp_diff, change_rate)

Used to get the amount of change between two body temperatures

When passed the difference between two temperatures returns the amount of change to temperature to apply. The change rate should be kept at a low value tween 0.16 and 0.02 for optimal results. vars:

• temp_diff (required) The differance between two temperatures
• change_rate (optional)(Default: 0.06) The rate of range multiplyer

proc get_turf_pixel(/atom/checked_atom)

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

proc get_valid_screen_location(target_loc, target_offset, view)

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

• target: The target location as a purely number based screen_loc string "+-left-offset:+-pixel,+-bottom-offset:+-pixel"
• target_offset: The amount we want to offset the target location by. We explictly don't care about direction here, we will try all 4
• view: The view variable of the client we're doing this for. We use this to get the size of the screen

Returns a screen loc representing the valid location

Tries to give the target an admin popup. If it fails, will send the error to the passed admin.

proc goonchem_vortex(/turf/T, setting_type, range)

Magical move-wooney that happens sometimes.

Simulates a vortex that moves nearby movable atoms towards or away from the turf T. Range also determines the strength of the effect. High values cause nearby objects to be thrown. Arguments:

• T - turf where it happens
• setting_type - does it suck or does it blow?
• range - range.

proc honkerblast(/atom/origin, light_range, medium_range, heavy_range)

Unleashes a honkerblast similar to the honkmech weapon, but with more granular control.

proc htmlrendertext(t)

Perform a whitespace cleanup on the text, similar to what HTML renderers do

This is useful if you want to better predict how text is going to look like when displaying it to a user. HTML renderers collapse multiple whitespaces into one, trims prepending and appending spaces, among other things. This proc attempts to do the same thing. HTML5 defines whitespace pretty much exactly like regex defines the \s group, [ \t\r\n\f].

Arguments:

• t - The text to "render"

proc icon2base64(/icon/icon)

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)

proc icon2html(/atom/thing, /client/target, icon_state, dir, frame, moving, sourceonly, extra_classes)

the dmi file path we attempt to return if the given object argument is associated with a stringifiable icon if successful, this looks like "icons/path/to/dmi_file.dmi" but they pass both isicon() and isfile() checks. theyre the easiest case since stringifying them gives us the path we want generate an asset for the given icon or the icon of the given appearance for [thing], and send it to any clients in target. Arguments:

• thing - either a /icon object, or an object that has an appearance (atom, image, mutable_appearance).
• target - either a reference to or a list of references to /client's or mobs with clients
• icon_state - string to force a particular icon_state for the icon to be used
• dir - dir number to force a particular direction for the icon to be used
• frame - what frame of the icon_state's animation for the icon being used
• moving - whether or not to use a moving state for the given icon
• sourceonly - if TRUE, only generate the asset and send back the asset url, instead of tags that display the icon to players
• extra_clases - string of extra css classes to use when returning the icon string

proc icon_exists(file, state, scream)

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

proc inLineOfSight(X1, Y1, X2, Y2, Z, PX1, PY1, PX2, PY2)

Calculate if two atoms are in sight, returns TRUE or FALSE

proc init_chemical_reagent_list()

Initialises all /datum/reagent into a list indexed by reagent id

proc init_crafting_recipes(/list/crafting_recipes)

Inits the crafting recipe list, sorting crafting recipe requirements in the process.

proc init_fishing_configurations()

These are shared between their spots

proc init_hotspot_reactions()

Returns reactions which will contribute to a hotspot's size.

proc init_keybindings()

Creates and sorts all the keybinding datums

proc init_subtypes_w_path_keys(prototype, /list/L)

Functions like init_subtypes, but uses the subtype's path as a key for easy access

proc initialize_starting_knowledge()

Returns a list of all heretic knowledge TYPEPATHS that have route set to PATH_START.

proc int_to_words(number, carried_string, capitalise)

Takes a 1, 2 or 3 digit number and returns it in words. Don't call this directly, use convert_integer_to_words() instead.

Arguments:

• number - 1, 2 or 3 digit number to convert.
• carried_string - Text to append after number is converted to words, e.g. "million", as in "eighty million".
• capitalise - Whether the number it returns should be capitalised or not, e.g. "Eighty-Eight" vs. "eighty-eight".

proc invert_HTML_colour(HTMLstring)

Inverts the colour of an HTML string

proc ion_num()

Picks a string of symbols to display as the law number for hacked or ion laws is at the start to prevent us from changing say modes via get_message_mode()

Is the passed in mob an admin ghost WITH AI INTERACT enabled

Is the passed in mob a ghost with admin powers, doesn't check for AI interact like isAdminGhost() used to

Returns if the given client is an admin, REGARDLESS of if they're deadminned or not.

proc is_color_dark(color, threshold)

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

proc is_convertable_to_cult(/mob/living/M, /datum/team/cult/specific_cult)

Returns whether the given mob is convertable to the blood cult

proc is_guest_key(key)

Returns whether or not a player is a guest using their ckey as an input

proc is_ic_filtered(message)

Given a text, will return what word is on the IC filter, with the reason. Returns null if the message is OK.

proc is_ic_filtered_for_pdas(message)

Given a text, will return what word is on the IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK.

proc is_infiltrator_docked_at_centcom()

Returns whether or not syndicate operatives escaped.

proc is_ooc_filtered(message)

Given a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK.

proc is_path_in_list(path_to_check, /list/list_to_check, zebra)

Checks for specific paths in a list.

If using zebra mode the list should be an assoc list with truthy/falsey values. The check short circuits so earlier entries in the input list will take priority. Ergo, subpaths should come before parent paths. Notice that this is the opposite priority of /proc/typecacheof.

Arguments:

• path_to_check: A typepath to check.
• list_to_check: A list of typepaths to check the path_to_check against.
• zebra: Whether to use the value of the mathing path in the list instead of just returning true when a match is found.

proc is_safe_turf(/turf/random_location, extended_safety_checks, dense_atoms, no_teleport)

Checks if a given turf is a "safe" location

proc is_soft_ic_filtered(message)

Given a text, will return what word is on the soft IC filter, with the reason. Returns null if the message is OK.

proc is_soft_ic_filtered_for_pdas(message)

Given a text, will return what word is on the soft IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK.

proc is_soft_ooc_filtered(message)

Given a text, will return that word is on the soft OOC filter, with the reason. Returns null if the message is OK.

proc is_source_facing_target(/atom/source, /atom/target)

Compare source's dir, the clockwise dir of source and the anticlockwise dir of source To the opposite dir of the dir returned by get_dir(target,source) If one of them is a match, then source is facing target

proc is_special_character(/mob/M)

Returns TRUE if the game has started and we're either an AI with a 0th law, or we're someone with a special role/antag datum

proc is_type_in_list(/datum/type_to_check, /list/list_to_check, zebra)

Checks for specific types in a list.

If using zebra mode the list should be an assoc list with truthy/falsey values. The check short circuits so earlier entries in the input list will take priority. Ergo, subtypes should come before parent types. Notice that this is the opposite priority of /proc/typecacheof.

Arguments:

• type_to_check: An instance to check.
• list_to_check: A list of typepaths to check the type_to_check against.
• zebra: Whether to use the value of the matching type in the list instead of just returning true when a match is found.

proc is_type_on_turf(/turf/location, type_to_find)

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:

• location - The turf to be checked for the desired type
• type_to_find - The typepath whose presence you are checking for

proc is_valid_dmi_file(icon_path)

given a text string, returns whether it is a valid dmi icons folder path

proc is_valid_src(/datum/source_datum)

Check if a datum has not been deleted and is a valid source

proc is_valid_z_level(/turf/source_loc, /turf/checking_loc)

• is_valid_z_level

Checks if source_loc and checking_loc is both on the station, or on the same z level. This is because the station's several levels aren't considered the same z, so multi-z stations need this special case.

Args: source_loc - turf of the source we're comparing. checking_loc - turf we are comparing to source_loc.

returns TRUE if connection is valid, FALSE otherwise.

proc ishumanbasic(target)

Returns if the given target is a human. Like, a REAL human. Not a moth, not a felinid (which are human subtypes), but a human.

proc iso_to_weekday(ddd)

Returns an integer in ISO format 1 (Monday) - 7 (Sunday) as a string day

proc isvineimmune(/atom/target)

Used to determine whether the mob is immune to actions by the vine. Use cases: Stops vine from attacking itself, other plants.

proc item_heal_robotic(/mob/living/carbon/human/human, /mob/user, brute_heal, burn_heal)

Heal a robotic body part on a mob

Takes a list of rank names and joins them with +

proc json_deserialize_datum(/list/jsonlist, /list/options, target_type, strict_target_type)

Convert a list of json to datum

proc json_serialize_datum(/datum/D, /list/options)

Convert a datum into a json blob

proc kvpify_list(/list/target_list, depth)

Converts a list into a list of assoc lists of the form ("key" = key, "value" = value) so that list keys that are themselves lists can be fully json-encoded

proc lavaland_equipment_pressure_check(/turf/turf_to_check)

Check if the turf pressure allows specialized equipment to work

proc lawid_to_type(lawid)

returns the law datum with the lawid in question, law boards and law datums should share this id.

proc lightningbolt(/mob/living/user)

this is the actual bolt effect and damage, made into its own proc because it is used elsewhere

proc list_clear_nulls(/list/list_to_clear)

Removes any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise

proc living_player_count()

Returns the amount of currently living players

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

proc load_map(dmm_file, x_offset, y_offset, z_offset, cropMap, measureOnly, no_changeturf, x_lower, x_upper, y_lower, y_upper, placeOnTop)

Shortcut function to parse a map and apply it to the world.

• dmm_file: A .dmm file to load (Required).
• x_offset, y_offset, z_offset: Positions representign where to load the map (Optional).
• cropMap: When true, the map will be cropped to fit the existing world dimensions (Optional).
• measureOnly: When true, no changes will be made to the world (Optional).
• no_changeturf: When true, [/turf/proc/AfterChange] won't be called on loaded turfs
• x_lower, x_upper, y_lower, y_upper: Coordinates (relative to the map) to crop to (Optional).
• placeOnTop: Whether to use [/turf/proc/PlaceOnTop] rather than [/turf/proc/ChangeTurf] (Optional).

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:

• filename - Name of the config file for the map we want to load. The .json file extension is added during the proc, so do not specify filenames with the extension.
• directory - Name of the directory containing our .json - Must be in MAP_DIRECTORY_WHITELIST. We default this to MAP_DIRECTORY_MAPS as it will likely be the most common usecase. If no filename is set, we ignore this.
• error_if_missing - Bool that says whether failing to load the config for the map will be logged in log_world or not as it's passed to LoadConfig().

Returns the config for the map to load.

Loads all current and future server polls and their options to store both as datums.

proc log_access(text)

Logging for changes to ID card access

Logging for admin actions on or with circuits

proc log_atmos(text, /datum/gas_mixture/mix)

Logs the contents of the gasmix to the game log, prefixed by text

proc log_attack(text)

Generic attack logging

Logging for bombs detonating

proc log_changeling_power(text)

Logging for changeling powers purchased

proc log_chat(text)

Logging for chatting on modular computer channels

proc log_combat(/atom/user, /atom/target, what_done, /atom/object, addition)

Log a combat message in the attack log

Arguments:

• atom/user - argument is the actor performing the action
• atom/target - argument is the target of the action
• what_done - is a verb describing the action (e.g. punched, throwed, kicked, etc.)
• atom/object - is a tool with which the action was made (usually an item)
• addition - is any additional text, which will be appended to the rest of the log line

proc log_config(text)

Logging for config errors Rarely gets called; just here in case the config breaks.

proc log_directed_talk(/atom/source, /atom/target, message, message_type, tag)

Helper for logging of messages with only one sender and receiver (i.e. mind links)

proc log_dsay(text)

Logging for DeachatSay (DSAY) messages

proc log_dynamic(text)

Logging for dynamic procs

proc log_emote(text)

Logging for emotes

proc log_filter(scope, message, filter_result)

Logs to the filter log with the given message, match, and scope

proc log_game(text)

Logging for generic/unsorted game messages

proc log_heretic_knowledge(text)

Logging for heretic powers learned

proc log_job_debug(text)

Logging for job slot changes

proc log_lua(text)

Logging for lua scripting

proc log_manifest(ckey, /datum/mind/mind, /mob/body, latejoin)

Logging for player manifest (ckey, name, job, special role, roundstart/latejoin)

proc log_mapping(text, skip_world_log)

Logging for mapping errors

proc log_mecha(text)

Logging for mech actions

proc log_ooc(text)

Logging for messages sent in OOC

proc log_paper(text)

Logging for writing made on paper

proc log_pda(text)

Logging for PDA messages sent

proc log_perf(/list/perf_info)

Logging for game performance

proc log_prayer(text)

Logging for prayed messages

proc log_qdel(text)

Logging for hard deletes

proc log_query_debug(text)

Logging for SQL errors

Logging for emotes sent over the radio

proc log_research(text)

Puts the text into the research html file, not log. See [INVESTIGATE_RESEARCH] for [/atom/proc/investigate_log]

proc log_say(text)

Logging for generic spoken messages

proc log_shuttle(text)

Logging for shuttle actions

proc log_speech_indicators(text)

Logging for speech indicators.

proc log_spellbook(text)

Logging for wizard powers learned

proc log_sql(text)

Logging for DB errors

Writes to a special log file if the log_suspicious_login config flag is set, which is intended to contain all logins that failed under suspicious circumstances.

Mirrors this log entry to log_access when access_log_mirror is TRUE, so this proc doesn't need to be used alongside log_access and can replace it where appropriate.

proc log_telecomms(text)

Logging for speech taking place over comms, as well as tcomms equipment

proc log_tgui(user, message, context, /datum/tgui_window/window, /datum/src_object)

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

proc log_tool(text, /mob/initiator)

Logging for tool usage

proc log_topic(text)

Logging for world/Topic

proc log_traitor(text)

Logging for traitor objectives

Logging for items purchased from a traitor uplink

proc log_virus(text)

Logging for the creation and contraction of viruses

proc log_whisper(text)

Logging for whispered messages

proc log_world(text)

Log to both DD and the logfile.

proc log_wound(/atom/victim, /datum/wound/suffered_wound, dealt_damage, dealt_wound_bonus, dealt_bare_wound_bonus, base_roll)

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:

• victim- The guy who got wounded
• suffered_wound- The wound, already applied, that we're logging. It has to already be attached so we can get the limb from it
• dealt_damage- How much damage is associated with the attack that dealt with this wound.
• dealt_wound_bonus- The wound_bonus, if one was specified, of the wounding attack
• dealt_bare_wound_bonus- The bare_wound_bonus, if one was specified and applied, of the wounding attack. Not shown if armor was present
• base_roll- Base wounding ability of an attack is a random number from 1 to (dealt_damage ** WOUND_DAMAGE_EXPONENT). This is the number that was rolled in there, before mods

proc make_associative(/list/flat_list)

Make a normal list an associative one

Uses stripped down and bastardized code from respawn character

Initial Building

proc make_into_clown(/mob/living/carbon/human/clowned_on)

Helper proc that handles making someone into a clown after a bananium nuke goes off.

proc make_tuple(number)

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

proc md5asfile(file)

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

proc md5filepath(path)

Returns the md5 of a file at a given path.

proc message_centcom(text, /mob/sender)

Used by communications consoles to message CentCom

proc message_syndicate(text, /mob/sender)

Used by communications consoles to message the Syndicate

proc message_to_html(message)

Message-related procs

Message format (/list):

• type - Message type, must be one of defines in code/__DEFINES/chat.dm
• text - Plain message text
• html - HTML message text
• Optional metadata, can be any key/value pair.

proc minor_announce(message, title, alert, html_encode, /list/players, sound_override)

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.

proc mobs_in_area_type(/list/area/checked_areas)

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

proc move_element(/list/inserted_list, from_index, to_index)

Move a single element from position from_index within a list, to position to_index All elements in the range [1,to_index) before the move will be before the pivot afterwards All elements in the range [to_index, L.len+1) before the move will be after the pivot afterwards In other words, it's as if the range [from_index,to_index) have been rotated using a <<< operation common to other languages. from_index and to_index must be in the range [1,L.len+1] This will preserve associations ~Carnie

proc move_range(/list/inserted_list, from_index, to_index, len)

Move elements [from_index,from_index+len) to [to_index-len, to_index) Same as moveElement but for ranges of elements This will preserve associations ~Carnie

proc movespeed_data_null_check(/datum/movespeed_modifier/M)

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

proc mutable_appearance(icon, icon_state, layer, plane, alpha, appearance_flags)

Helper similar to image()

proc narsie_apocalypse()

Third crew last second win check and flufftext for [/proc/begin_the_end()]

proc narsie_end_begin_check()

First crew last second win check and flufftext for [/proc/begin_the_end()]

proc narsie_end_second_check()

Second crew last second win check and flufftext for [/proc/begin_the_end()]

proc narsie_last_second_win()

Called only if the crew managed to destroy narsie at the very last second for [/proc/begin_the_end()]

proc narsie_start_destroy_station()

security level and shuttle lockdowns for [/proc/begin_the_end()]

proc next_list_item(item, /list/inserted_list)

Returns the next item in a list

The kitchen sink of notification procs

Arguments:

• message
• ghost_sound sound to play
• enter_link Href link to enter the ghost role being notified for
• source The source of the notification
• action What action to take upon the ghost interacting with the notification, defaults to NOTIFY_JUMP
• flashwindow Flash the byond client window
• ignore_key Ignore keys if they're in the GLOB.poll_ignore list
• notify_suiciders If it should notify suiciders (who do not qualify for many ghost roles)
• notify_volume How loud the sound should be to spook the user

proc nuke_gib(/mob/living/gibbed, /atom/source)

Helper proc that handles gibbing someone who has been nuked.

proc nuke_request(text, /mob/sender)

Used by communications consoles to request the nuclear launch codes

proc offer_control(/mob/M)

Offer control of the passed in mob to dead player

Automatic logging and uses poll_candidates_for_mob, how convenient

proc offset_to_screen_loc(x_offset, y_offset, view)

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

proc overlays2text(/list/overlays)

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

proc parse_caught_click_modifiers(/list/modifiers, /turf/origin, /client/viewing_client)

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

proc parse_zone(zone)

Return a string for the specified body zone. Should be used for parsing non-instantiated bodyparts, otherwise use /obj/item/bodypart/var/plaintext_zone

proc pass(...)

A do nothing proc

proc peek(/list/target_list)

Returns the top (last) element from the list, does not remove it from the list. Stack functionality.

proc pick_closest_path(value, /list/matches)

Returns a chosen path that is the closest to a list of matches

proc pick_n_take(/list/list_to_pick)

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

proc pick_weight(/list/list_to_pick)

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.

proc pick_weighted_lawset()

returns a law datum based off of config. will never roll asimov as the weighted datum if the station has a unique AI.

proc piglatin_sentence(text)

runs piglatin_word() proc on each word in a sentence. preserves caps and punctuation

proc piglatin_word(word)

takes "word", and returns it piglatinized.

proc play_cinematic(/datum/cinematic/cinematic_type, watchers, /datum/callback/special_callback)

Plays a cinematic, duh. Can be to a select few people, or everyone.

cinematic_type - datum typepath to what cinematic you wish to play. watchers - a list of all mobs you are playing the cinematic to. If world, the cinematical will play globally to all players. special_callback - optional callback to be invoked mid-cinematic.

proc play_fov_effect(/atom/center, range, icon_state, dir, ignore_self, angle, /list/override_list)

Plays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness

proc playsound(/atom/source, soundin, vol, vary, extrarange, falloff_exponent, frequency, channel, pressure_affected, ignore_walls, falloff_distance, use_reverb)

playsound is a proc used to play a 3D sound in a specific range. This uses SOUND_RANGE + extra_range to determine that.

source - Origin of sound. soundin - Either a file, or a string that can be used to get an SFX. vol - The volume of the sound, excluding falloff and pressure affection. vary - bool that determines if the sound changes pitch every time it plays. extrarange - modifier for sound range. This gets added on top of SOUND_RANGE. falloff_exponent - Rate of falloff for the audio. Higher means quicker drop to low volume. Should generally be over 1 to indicate a quick dive to 0 rather than a slow dive. frequency - playback speed of audio. channel - The channel the sound is played at. pressure_affected - Whether or not difference in pressure affects the sound (E.g. if you can hear in space). ignore_walls - Whether or not the sound can pass through walls. falloff_distance - Distance at which falloff begins. Sound is at peak volume (in regards to falloff) aslong as it is in this range.

proc podspawn(specifications)

One proc for easy spawning of pods in the code to drop off items before whizzling (please don't proc call this in game, it will destroy you)

Arguments:

• specifications: special mods to the pod, see non var edit specifications for details on what you should fill this with Non var edit specifications:
• target = where you want the pod to drop
• path = a special specific pod path if you want, this can save you a lot of var edits
• style = style of the pod, defaults to the normal pod
• spawn = spawned path or a list of the paths spawned, what you're sending basically Returns the pod spawned, in case you want to spawn items yourself and modify them before putting them in.

proc poll_candidates(question, jobban_type, be_special_flag, poll_time, ignore_category, flashwindow, /list/group)

Calls the show_candidate_poll_window() to all eligible ghosts

proc poll_candidates_for_mob(question, jobban_type, be_special_flag, poll_time, /mob/target_mob, ignore_category)

Returns a list of ghosts that are eligible to take over and wish to be considered for a mob.

Arguments:

• question - question to show players as part of poll
• jobban_type - Type of jobban to use to filter out potential candidates.
• be_special_flag - Unknown/needs further documentation.
• poll_time - Length of time in deciseconds that the poll input box exists before closing.
• target_mob - The mob that is being polled for.
• ignore_category - Unknown/needs further documentation.

proc poll_candidates_for_mobs(question, jobban_type, be_special_flag, poll_time, /list/mobs, ignore_category)

Returns a list of ghosts that are eligible to take over and wish to be considered for a mob.

Arguments:

• question - question to show players as part of poll
• jobban_type - Type of jobban to use to filter out potential candidates.
• be_special_flag - Unknown/needs further documentation.
• poll_time - Length of time in deciseconds that the poll input box exists before closing.
• mobs - The list of mobs being polled for. This list is mutated and invalid mobs are removed from it before the proc returns.
• ignore_category - Unknown/needs further documentation.

proc poll_ghost_candidates(question, jobban_type, be_special_flag, poll_time, ignore_category, flashwindow)

Wrapper to send all ghosts the poll to ask them if they want to be considered for a mob.

proc poll_holiday(/datum/holiday/path, min_month, max_month, min_year, max_year, max_day)

Takes a holiday datum, a starting month, ending month, max amount of days to test in, and min/max year as input Returns a list in the form list("yyyy/m/d", ...) representing all days the holiday runs on in the tested range

proc pop(/list/L)

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

proc populate_editable_sign_types()

This proc populates GLOBAL_LIST_EMPTY(editable_sign_types)

The first time a pen is used on any sign, this populates GLOBAL_LIST_EMPTY(editable_sign_types), creating a global list of all the signs that you can set a sign backing to with a pen.

proc possible_values_for_sprite_accessory_list(/list/datum/sprite_accessory/sprite_accessories)

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

proc possible_values_for_sprite_accessory_list_for_body_part(/list/datum/sprite_accessory/sprite_accessories, body_part, /list/layers)

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.

proc power_fail(duration_min, duration_max)

Disable power in the station APCs

proc previous_list_item(item, /list/inserted_list)

Returns the previous item in a list

proc print_holiday(/datum/holiday/path, min_month, max_month, min_year, max_year, max_day)

Does the same as /proc/poll_holiday, but prints the output to admins instead of returning it

proc print_security_record(/datum/data/record/general_data, /datum/data/record/security, /atom/location)

Standardized printed records. SPRs. Like SATs but for bad guys who probably didn't actually finish school. Input the records and out comes a paper.

proc 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

proc propagate_network(/obj/structure/cable/C, /datum/powernet/PN, skip_assigned_powernets)

remove the old powernet and replace it with a new one throughout the network.

proc qdel(/datum/D, force, ...)

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.

proc ran_zone(zone, probability)

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

proc random_bounty(guided)

• Returns a new bounty of random type, but does not add it to GLOB.bounties_list.

• *Guided determines what specific catagory of bounty should be chosen.

proc random_capital_letter()

handles thousands

proc random_colour(mode)

Returns a random color picked from a list, has 2 modes (0 and 1), mode 1 doesn't pick white, black or gray

proc random_fish_type(case_fish_only, required_fluid)

Returns random fish, using random_case_rarity probabilities.

proc random_nukecode()

Returns a string for a random nuke code

proc random_step(/atom/movable/moving_atom, steps, chance)

Forces the atom to take a step in a random direction

proc ranks_from_rank_name(rank_name)

Converts a rank name (such as "Coder+Moth") into a list of /datum/admin_rank

proc rcd_result_with_memory(/list/defaults, /turf/place, expected_memory)

Produces a new RCD result from the given one if it can be calculated that the RCD should speed up with the remembered form.

Global proc that generates RCD hologram in a range.

Arguments:

• source - The atom the scans originate from
• scan_range - The range of turfs we grab from the source

proc 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

proc recursive_list_resolve(/list/list_to_resolve)

Returns a list with all weakrefs resolved

proc recursive_list_resolve_element(element)

Helper for /proc/recursive_list_resolve

proc recursive_loc_check(/atom/movable/target, type)

Recursively checks if an item is inside a given type, even through layers of storage. Returns the atom if it finds it.

proc recursive_organ_check(/atom/first_object)

• recursive_organ_check
• outputs:
• description: A pseudo-recursive loop based off of the recursive mob check, this check looks for any organs held
• within 'first_object', toggling their frozen flag. This check excludes items held within other safe organ
• storage units, so that only the lowest level of container dictates whether we do or don't decompose

proc refify_list(/list/target_list)

Returns a copy of the list where any element that is a datum or the world is converted into a ref

The procedure to check the text of the entered text on ntnrc_client.dm

This procedure is designed to check the text you type into the chat client. It checks for invalid characters and the size of the entered text.

proc reject_bad_name(t_in, allow_numbers, max_length, ascii_only, strict, cap_after_symbols)

Filters out undesirable characters from names.

• strict - return null immidiately instead of filtering out
• allow_numbers - allows numbers and common special characters - used for silicon/other weird things names
• cap_after_symbols - words like Bob's will be capitalized to Bob'S by default. False is good for titles.

Returns the text if properly formatted, or null else.

Things considered improper:

• Larger than max_length.
• Presence of non-ASCII characters if asci_only is set to TRUE.
• Only whitespaces, tabs and/or line breaks in the text.
• Presence of the <, >, \ and / characters.
• Presence of ASCII special control characters (horizontal tab and new line not included).

proc remove_image_from_client(/image/image_to_remove, /client/remove_from)

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

proc remove_images_from_clients(/image/image_to_remove, /list/show_to)

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

proc remove_nulls_from_list(/list/inserted_list)

remove all nulls from a list

proc remove_verb(/client/target, verb_or_list_to_remove)

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:

• target - Who the verb is being removed from, client or mob typepath
• verb - typepath to a verb, or a list of verbs, supports lists of lists

proc reset_cooldown(/datum/source, index)

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

Arguments:

• source - datum storing the cooldown
• index - string index storing the cooldown on the cooldowns associative list

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

proc resolve_ai_icon_sync(input)

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

proc return_atmos_handbooks()

Final product is a numbered list, this one is assoc just so we can generate the "reactions" entry easily. Returns an assoc list of the gas handbook and the reaction handbook. For UIs, simply do data += return_atmos_handbooks() to use.

proc return_unused_frequency(free)

returns a random unused frequency between MIN_FREE_FREQ & MAX_FREE_FREQ if free = TRUE, and MIN_FREQ & MAX_FREQ if FALSE

proc reverse_range(/list/inserted_list, start, end)

replaces reverseList ~Carnie

proc rustg_get_version()

Gets the version of rust_g

proc sanitize(text)

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

proc sanitize_color(color)

Makes sure the input color is text with a # at the start followed by 6 hexadecimal characters. Examples: "#ff1234", "#A38321", COLOR_GREEN_GRAY

proc sanitize_css_class_name(name)

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

proc sanitize_filepath(path)

Sanitizes the name of each node in the path.

Im case you are wondering when to use this proc and when to use SANITIZE_FILENAME,

You use SANITIZE_FILENAME to sanitize the name of a file [e.g. example.txt]

You use sanitize_filepath sanitize the path of a file [e.g. root/node/example.txt]

If you use SANITIZE_FILENAME to sanitize a file path things will break.

proc sanitize_frequency(frequency, free)

Ensure the frequency is within bounds of what it should be sending/receiving at

proc sanitize_name(target, allow_numbers, cap_after_symbols)

returns nothing with an alert instead of the message if it contains something in the ic filter, and sanitizes normally if the name is fine. It returns nothing so it backs out of the input the same way as if you had entered nothing.

proc scramble_message_replace_chars(original, replaceprob, /list/replacementchars, replace_letters_only, replace_whitespace)

Slightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML!

proc screen_loc_to_offset(screen_loc, view)

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

proc screen_loc_to_turf(text, /turf/origin, /client/C)

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

proc screen_text(/obj/object_to_change, maptext, screen_loc, maptext_height, maptext_width)

Return an object with a new maptext (not currently in use)

proc seedify(/obj/item/O, t_max, /obj/machinery/seed_extractor/extractor, /mob/living/user)

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:

• O - Object containing the seed, can be the loc of the dumping of seeds
• t_max - Amount of seed copies to dump, -1 is ranomized
• extractor - Seed Extractor, used as the dumping loc for the seeds and seed multiplier
• user - checks if we can remove the object from the inventory

Sends a message to TGS admin chat channels.

category - The category of the mssage. message - The message to send.

Sends a message to TGS chat channels.

message - The message to send. channel_tag - Required. If "", the message with be sent to all connected (Game-type for TGS3) channels. Otherwise, it will be sent to TGS4 channels with that tag (Delimited by ','s). admin_only - Determines if this communication can only be sent to admin only channels.

proc send2otherserver(source, msg, type, target_servers, /list/additional_data)

Sends a message to a set of cross-communications-enabled servers using world topic calls

Arguments:

• source - Who sent this message
• msg - The message body
• type - The type of message, becomes the topic command under the hood
• target_servers - A collection of servers to send the message to, defined in config
• additional_data - An (optional) associated list of extra parameters and data to send with this world topic call

proc send_tip_of_the_round(target, selected_tip)

Sends a round tip to a target. If selected_tip is null, a random tip will be sent instead (5% chance of it being silly). Tips that starts with the @ character won't be html encoded. That's necessary for any tip containing markup tags, just make sure they don't also have html characters like <, > and ' which will be garbled.

proc send_to_playing_players(thing)

sends a whatever to all playing players; use instead of to_chat(world, where needed)

proc serialize_antag_name(antag_name)

Serializes an antag name to be used for preferences UI

proc setup_mod_themes()

Global proc that sets up all MOD themes as singletons in a list and returns it.

proc setup_round_default_laws()

first called when something wants round default laws for the first time in a round, considers config returns a law datum that GLOB._round_default_lawset will be set to.

proc shake_camera(/mob/M, duration, strength)

Shake the camera of the person viewing the mob SO REAL! Takes the mob to shake, the time span to shake for, and the amount of tiles we're allowed to shake by in tiles Duration isn't taken as a strict limit, since we don't trust our coders to not make things feel shitty. So it's more like a soft cap.

proc show_candidate_poll_window(/mob/candidate_mob, poll_time, question, /list/candidates, ignore_category, time_passed, flashwindow)

Show the poll window to the candidate mobs

proc shuffle(/list/inserted_list)

Randomize: Return the list in a random order

proc shuffle_inplace(/list/inserted_list)

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

proc simple_network_name_fix(name)

Network name should be all caps and no punctuation except for _ and . between domains This does a quick an dirty fix to a network name to make sure it works

proc siunit(value, unit, maxdecimals)

Formats a number to human readable form with the appropriate SI unit.

Supports SI exponents between 1e-15 to 1e15, but properly handles numbers outside that range as well. Examples:

• siunit(1234, "Pa", 1) -> "1.2 kPa"

• siunit(0.5345, "A", 0) -> "535 mA"

• siunit(1000, "Pa", 4) -> "1 kPa" Arguments:

• value - The number to convert to text. Can be positive or negative.

• unit - The base unit of the number, such as "Pa" or "W".

• maxdecimals - Maximum amount of decimals to display for the final number. Defaults to 1.

• For pressure conversion, use proc/siunit_pressure() below

proc siunit_pressure(value_in_kpa, maxdecimals)

• The game code never uses Pa, but kPa, since 1 Pa is too small to reasonably handle
• Thus, to ensure correct conversion from any kPa in game code, this value needs to be multiplied by 10e3 to get Pa, which the siunit() proc expects
• Args:
• value_in_kpa - Value that should be converted to readable text in kPa
• maxdecimals - maximum number of decimals that are displayed, defaults to 1 in proc/siunit()

proc slice_off_turfs(/atom/center, /list/turf/turfs, inner_angle, outer_angle)

Returns a slice of a list of turfs, defined by the ones that are inside the inner/outer angle's bounds

proc sort_key(/list/ckey_list, order)

for sorting clients or mobs by ckey

proc sort_list(/list/list_to_sort, cmp)

sort any value in a list

proc sort_mobs()

Orders mobs by type then by name. Accepts optional arg to sort a custom list, otherwise copies GLOB.mob_list.

proc sort_names(/list/list_to_sort, order)

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

proc sort_record(/list/record_list, field, order)

Specifically for record datums in a list.

proc special_list_filter(/list/list_to_filter, /datum/callback/condition)

Returns a list with items filtered from a list that can call callback

proc spiral_range(dist, center, orange)

similar function to range(), but with no limitations on the distance; will search spiralling outwards from the center

proc spiral_range_turfs(dist, center, orange, /list/outlist, tick_checked)

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

Exposes all accessible atoms within some distance of an epicenter to some reagents. Does not clear the source reagent holder; that must be done manually if it is desired.

Arguments:

• source: The reagents to spread around.
• epicenter: The epicenter/source location of the reagent spread.

proc stack_trace(msg)

gives us the stack trace from CRASH() without ending the current proc.

proc stars(phrase, probability)

Convert random parts of a passed in message to stars

• phrase - the string to convert
• probability - probability any character gets changed

This proc is dangerously laggy, avoid it or die

proc start_unequip_mob(/obj/item/item, /mob/source, /mob/user, strip_delay)

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

proc stoplag(initial_delay)

returns the number of ticks slept

proc string_list(/list/values)

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

proc strip_html(text, limit)

Runs STRIP_HTML_SIMPLE and sanitize.

proc stripped_input(/mob/user, message, title, default, max_length, no_trim)

Used to get a properly sanitized input. Returns null if cancel is pressed.

Arguments

• user - Target of the input prompt.
• message - The text inside of the prompt.
• title - The window title of the prompt.
• max_length - If you intend to impose a length limit - default is 1024.
• no_trim - Prevents the input from being trimmed if you intend to parse newlines or whitespace.

proc stripped_multiline_input(/mob/user, message, title, default, max_length, no_trim)

Used to get a properly sanitized input in a larger box. Works very similarly to stripped_input.

Arguments

• user - Target of the input prompt.
• message - The text inside of the prompt.
• title - The window title of the prompt.
• max_length - If you intend to impose a length limit - default is 1024.
• no_trim - Prevents the input from being trimmed if you intend to parse newlines or whitespace.

proc swap_range(/list/inserted_list, from_index, to_index, len)

Move elements from [from_index, from_index+len) to [to_index, to_index+len) Move any elements being overwritten by the move to the now-empty elements, preserving order Note: if the two ranges overlap, only the destination order will be preserved fully, since some elements will be within both ranges ~Carnie

proc techweb_item_boost_check(/obj/item/I)

Returns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list()

proc 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.

proc tgalert(/mob/User, Message, Title, Button1, Button2, Button3, StealFocus, Timeout)

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

• User - The user to show the alert to.
• Message - The textual body of the alert.
• Title - The title of the alert's window.
• Button1 - The first button option.
• Button2 - The second button option.
• Button3 - The third button option.
• StealFocus - Boolean operator controlling if the alert will steal the user's window focus.
• Timeout - The timeout of the window, after which no responses will be valid.

proc tgui_Topic(href_list)

Middleware for /client/Topic.

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

proc tgui_alert(/mob/user, message, title, /list/buttons, timeout, autofocus)

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:

• user - The user to show the alert to.
• message - The content of the alert, shown in the body of the TGUI window.
• title - The of the alert modal, shown on the top of the TGUI window.
• buttons - The options that can be chosen by the user, each string is assigned a button on the UI.
• timeout - The timeout of the alert, after which the modal will close and qdel itself. Set to zero for no timeout.
• autofocus - The bool that controls if this alert should grab window focus.

proc tgui_input_list(/mob/user, message, title, /list/items, default, timeout)

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:

• user - The user to show the input box to.
• message - The content of the input box, shown in the body of the TGUI window.
• title - The title of the input box, shown on the top of the TGUI window.
• items - The options that can be chosen by the user, each string is assigned a button on the UI.
• default - If an option is already preselected on the UI. Current values, etc.
• timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout.

proc tgui_input_number(/mob/user, message, title, default, max_value, min_value, timeout, round_value)

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:

• user - The user to show the number input to.
• message - The content of the number input, shown in the body of the TGUI window.
• title - The title of the number input modal, shown on the top of the TGUI window.
• default - The default (or current) value, shown as a placeholder. Users can press refresh with this.
• max_value - Specifies a maximum value. If none is set, any number can be entered. Pressing "max" defaults to 1000.
• min_value - Specifies a minimum value. Often 0.
• timeout - The timeout of the number input, after which the modal will close and qdel itself. Set to zero for no timeout.
• round_value - whether the inputted number is rounded down into an integer.

proc tgui_input_text(/mob/user, message, title, default, max_length, multiline, encode, timeout)

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:

• user - The user to show the text input to.
• message - The content of the text input, shown in the body of the TGUI window.
• title - The title of the text input modal, shown on the top of the TGUI window.
• default - The default (or current) value, shown as a placeholder.
• max_length - Specifies a max length for input. MAX_MESSAGE_LEN is default (1024)
• multiline - Bool that determines if the input box is much larger. Good for large messages, laws, etc.
• encode - Toggling this determines if input is filtered via html_encode. Setting this to FALSE gives raw input.
• timeout - The timeout of the textbox, after which the modal will close and qdel itself. Set to zero for no timeout.

proc time_to_twelve_hour(time, format, timezone)

Converts a time expressed in deciseconds (like world.time) to the 12-hour time format. the format arg is the format passed down to time2text() (e.g. "hh:mm" is hours and minutes but not seconds). the timezone is the time value offset from the local time. It's to be applied outside time2text() to get the AM/PM right.

proc timeleft(id, /datum/controller/subsystem/timer/timer_subsystem)

Get the remaining deciseconds on a timer

Arguments:

• id a timerid or a /datum/timedevent

proc to_chat(target, html, type, text, avoid_highlighting, handle_whitespace, trailing_newline, confidential)

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>")


proc to_chat_immediate(target, html, type, text, avoid_highlighting, handle_whitespace, trailing_newline, confidential)

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

proc tool_behaviour_name(tool_behaviour)

returns an ic name of the tool needed Arguments:

• tool_behaviour: the tool described!

proc truncate(text, max_length)

Truncate a string to the given length

Will only truncate if the string is larger than the length and ignores unicode concerns

This exists soley because trim does other stuff too.

Arguments:

• text - String
• max_length - integer length to truncate at

Tries to move an atom to an adjacent turf, return TRUE if successful

proc typecache_filter_list(/list/atoms, /list/typecache)

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

proc typecache_filter_list_reverse(/list/atoms, /list/typecache)

return a new list with atoms that are not in the typecache list

proc typecache_filter_multi_list_exclusion(/list/atoms, /list/typecache_include, /list/typecache_exclude)

similar to typecache_filter_list and typecache_filter_list_reverse but it supports an inclusion list and and exclusion list

proc typecacheof(path, only_root_path, ignore_root_path)

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

Arguments:

• path: A typepath or list of typepaths.
• only_root_path: Whether the typecache should be specifically of the passed types.
• ignore_root_path: Whether to ignore the root path when caching subtypes.

proc ui_status_only_living(/mob/user, source)

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

proc ui_status_silicon_has_access(/mob/user, /atom/source)

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.

proc ui_status_user_has_free_hands(/mob/user, /atom/source)

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

proc ui_status_user_is_abled(/mob/user, /atom/source)

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.

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.

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

proc ui_status_user_is_conscious_and_lying_down(/mob/user)

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

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

proc unformat_frequency(frequency)

Opposite of format, returns as a number

proc unique_list(/list/inserted_list)

Return a list with no duplicate entries

proc unique_list_in_place(/list/inserted_list)

same as unique_list, but returns nothing and acts on list in place (also handles associated values properly)

proc urange(dist, /atom/center, orange, areas)

ultra range (no limitations on distance, faster than range for distances > 8); including areas drastically decreases performance

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

proc valid_window_location(/turf/dest_turf, test_dir, is_fulltile)

Checks whether the target turf is in a valid state to accept a directional window or other directional pseudo-dense object such as railings.

Returns FALSE if the target turf cannot accept a directional window or railing. Returns TRUE otherwise.

Arguments:

• dest_turf - The destination turf to check for existing windows and railings
• test_dir - The prospective dir of some atom you'd like to put on this turf.
• is_fulltile - Whether the thing you're attempting to move to this turf takes up the entire tile or whether it supports multiple movable atoms on its tile.

proc view_to_pixels(view)

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

VOICE OF GOD

proc weakrefify_list(/list/target_list)

Returns a copy of the list where any element that is a datum is converted into a weakref

proc weekday_to_iso(ddd)

Returns a string day as an integer in ISO format 1 (Monday) - 7 (Sunday)

proc weight_class_to_text(w_class)

Returns a string based on the weight class define used as argument

proc wendigo_slam(/atom/source, range, delay, throw_range)

Slams the ground around the source throwing back enemies caught nearby, delay is for the radius increase

proc window_flash(/client/flashed_client, ignorepref)

Flash the window of a player

proc woundscan(/mob/user, /mob/living/carbon/patient, /obj/item/healthanalyzer/wound/scanner)

Displays wounds with extended information on their status vs medscanners

proc zebra_typecacheof(path, single_value, only_root_path, ignore_root_path, clear_nulls)

Like typesof() or subtypesof(), but returns a typecache instead of a list. This time it also uses the associated values given by the input list for the values of the subtypes.

Latter values from the input list override earlier values. Thus subtypes should come after parent types in the input list. Notice that this is the opposite priority of /proc/is_type_in_list and /proc/is_path_in_list.

Arguments:

• path: A typepath or list of typepaths with associated values.
• single_value: The assoc value used if only a single path is passed as the first variable.
• only_root_path: Whether the typecache should be specifically of the passed types.
• ignore_root_path: Whether to ignore the root path when caching subtypes.
• clear_nulls: Whether to remove keys with null assoc values from the typecache after generating it.