/(global)
Vars | |
Failsafe | Failsafe |
---|---|
Master | StonedMC |
SSaccessories | subsystem that just holds lists of sprite accessories for accession in generating said sprites. A sprite accessory is something that we add to a human sprite to make them look different. This is hair, facial hair, underwear, mutant bits, etc. |
SSacid | The subsystem used to tick /datum/component/acid instances. |
SSai_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 |
SSai_controllers | The subsystem used to tick /datum/ai_controllers instances. Handling the re-checking of plans. |
SSai_movement | The subsystem used to tick /datum/ai_movement instances. Handling the movement of individual AI instances |
SSambience | The subsystem used to play ambience to users every now and then, makes them real excited. |
SSarea_contents | Responsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed |
SSasset_loading | Allows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init |
SSaura | The subsystem used to tick auras (/datum/component/aura_healing and /datum/component/damage_aura). |
SSban_cache | Subsystem that batches a ban cache list for clients on initialize This way we don't need to do ban checks in series later in the code |
SSburning | The subsystem used to tick /datum/component/burning instances. |
SScliff_falling | Subsystem to handle falling of off cliffs |
SSclock_component | The subsystem used to tick /datum/component/acid instances. |
SSdigital_clock | The subsystem used to tick digital clocks |
SSdiscord | |
SSearly_assets | Initializes any assets that need to be loaded ASAP. This houses preference menu assets, since they can be loaded at any time, most dangerously before the atoms SS initializes. Thus, we want it to fail consistently in CI as if it would've if a player opened it up early. |
SSescape_menu | Subsystem for controlling anything related to the escape menu |
SSfishing | subsystem for the fishing minigame processing. |
SSfluids | |
SSfoam | The subsystem responsible for processing foam propagation and effects. |
SShyperspace_drift | This subsystem handles the hyperspace shuttle pull movement loops |
SSid_access | Non-processing subsystem that holds various procs and data structures to manage ID cards, trims and access. |
SSinit_profiler | Subsystem exists so we can separately log init time costs from the costs of general operation Hopefully this makes sorting out what causes problems when easier |
SSlag_switch | The subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience |
SSlibrary | Manages library data, loading bookselves, etc |
SSlooting | Queues image generation for search objects without icons |
SSmouse_entered | Defers MouseEntered inputs to only apply to the most recently hovered over atom in the tick |
SSnewtonian_movement | The subsystem is intended to tick things related to space/newtonian movement, such as constant sources of inertia |
SSpathfinder | Queues and manages JPS pathfinding steps |
SSpoints_of_interest | Subsystem for managing all POIs. |
SSradioactive_nebula | Controls making objects irradiated when Radioactive Nebula is in effect. |
SSsinguloprocess | Very rare subsystem, provides any active singularities with the timings and seclusion they need to succeed |
SSsmoke | The subsystem responsible for processing smoke propagation and effects. |
SSspatial_grid | |
SSspeech_controller | verb_manager subsystem just for handling say's |
SStgui | tgui subsystem |
SStimer | |
SStutorials | Namespace for housing code relating to giving contextual tutorials to users. |
SSunplanned_controllers | Handles making mobs perform lightweight "idle" behaviors such as wandering around when they have nothing planned |
SSverb_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. |
SSwardrobe | This subsystem strives to make loading large amounts of select objects as smooth at execution as possible It preloads a set of types to store, and caches them until requested Doesn't catch everything mind, this is intentional. There's many types that expect to either A: Not sit in a list for 2 hours, or B: have extra context passed into them, or for their parent to be their location You should absolutely not spam this system, it will break things in new and wonderful ways S close enough for government work though. Fuck you goonstation |
SSweather | Used for all kinds of weather, ex. lavaland ash storms. |
SSwiremod_composite | This subsystem is to handle creating and storing composite templates that are used to create composite datatypes for integrated circuits |
Procs | |
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) |
GetBestWeapon | Returns either the best weapon from the given choices or null if held weapons are better |
GetTgsStealthKey | Gets TGS's stealth key, generates one if none is found |
Gibberish | Turn text into complete gibberish! |
HandleUserlessProcCall | Handles a userless proccall, used by circuits. |
HandleUserlessSDQL | Handles a userless sdql, used by circuits and tgs. |
IsEdible | returns 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 && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : text_ref(thing)) |
RoundDiagBar | Diagnostic HUDs! |
WEAKREF | Creates a weakref to the given input. See /datum/weakref's documentation for more information. |
WrapAdminProcCall | Wrapper for proccalls where the datum is flagged as vareditted |
___TraitAdd | DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. |
___TraitRemove | DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. |
______qdel_list_wrapper | the underscores are to encourage people not to use this directly. |
__check_serialization_semver | Checks if the actual semver is equal or later than the wanted semver Must be passed as TEXT; you're probably looking for CHECK_SERIALIZATION_SEMVER, look right above |
_add_memory_in_range | Unless you need to use this for an explicit reason, use the add_memory_in_range macro wrapper. |
_addtimer | Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information. |
_alert_drones | Broadcast a message to all drones in a faction |
_animate_filter | 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. |
_export_loop | The main bit responsible for selling the item. Shared by export_single_item() and export_item_and_contents() |
_malf_ai_undo_lockdown | For Lockdown malf AI ability. Opens all doors on the station. |
_pick_list | 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 |
_queue_verb | 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. |
_save_map | Hey bud don't call this directly, it exists so we can invoke async and prevent the buildmode datum being qdel'd from halting this proc |
_stack_trace | gives us the stack trace from CRASH() without ending the current proc. Do not call directly, use the stack_trace macro instead. |
above_neck | Would this zone be above the neck |
actionspeed_data_null_check | Checks if a action speed modifier is valid and not missing any data |
active_free_borgs | Silicon Mob Procs |
add_image_to_client | Adds an image to a client's .images . Useful as a callback. |
add_image_to_clients | Like add_image_to_client, but will add the image from a list of clients |
add_keybinding | Adds an instanced keybinding to the global tracker |
add_lua_editor_variants | Given a list and a list of its variant hints, appends variants that aren't explicitly required by dreamluau, but are required by the lua editor tgui. |
add_messenger | Registers an NTMessenger instance to the list of pda_messengers. |
add_sabotage_machine | Marks a machine as a possible traitor sabotage target |
add_to_signaler_investigate_log | Used to add a text log to the signaler investigation log. Do not add to the list directly; if the list is too large it can cause lag when an admin tries to view it. |
add_verb | handles adding verbs and updating the stat panel browser |
admin_ticket_log | 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 |
adminscrub | Runs STRIP_HTML_SIMPLE and byond's sanitization proc. |
alert_to_permissions_elevation_attempt | Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc. |
alone_in_area | Checks if the mob provided (must_be_alone) is alone in an area |
amount2sheet | Turns material amount into the number of sheets, returning FALSE if the number is less than SHEET_MATERIAL_AMOUNT |
announce_arrival | Send a message in common radio when a player arrives |
anyprob | chances are 1:value. anyprob(1) will always return true |
apply_dynamic_human_appearance | This exists to apply the icons async, as that cannot be done in Initialize because of possible sleeps. |
apply_matrix_to_color | Applies a color filter to a hex/RGB list color |
armor_to_protection_class | Rounds armor_value down to the nearest 10, divides it by 10 and then converts it to Roman numerals. |
armor_to_protection_name | Returns the client readable name of an armor type |
assert_sorted | Runtimes if the passed in list is not sorted |
assign_random_name | Generate a name devices |
assoc_to_keys | Turns an associative list into a flat list of keys |
assoc_to_keys_features | Turns an associative list into a flat list of keys, but for sprite accessories, respecting the locked variable |
assoc_value_sum | Gets the total amount of everything in the associative list. |
at_least | Takes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold |
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 |
atmos_scan | Outputs a message to the user describing the target's gasmixes. |
avoid_assoc_duplicate_keys | 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 |
baseturfs_string_list | A wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues |
begin_the_end | Begins the process of ending the round via cult narsie win Consists of later called procs (in order of called): |
bit_count | counts the number of bits in Byond's 16-bit width field, in constant time and memory! |
bitfield_to_list | Converts a bitfield to a list of numbers (or words if a wordlist is provided) |
blend_cutoff_colors | Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments |
blend_screen_color | Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker |
body_zone2cover_flags | For finding out what body parts a body zone covers, the inverse of the below basically |
border_diamond_range_turfs | Returns the list of turfs around the outside of a center based on RANGE_TURFS() |
build_chemical_reactions_lists | Chemical Reactions - Initialises all /datum/chemical_reaction into a list It is filtered into multiple lists within a list. For example: chemical_reactions_list_reactant_index/datum/reagent/toxin/plasma is a list of all reactions relating to plasma For chemical reaction list product index - indexes reactions based off the product reagent type - see get_recipe_from_reagent_product() in helpers For chemical reactions list lookup list - creates a bit list of info passed to the UI. This is saved to reduce lag from new windows opening, since it's a lot of data. |
build_exploration_site_ui_data | Helper proc for exploration site listings in ui. |
build_medicine_reagents | Just grab every craftable medicine you can think off |
build_name2reagentlist | Builds map of reagent name to its datum path |
build_planeed_apperance_queue | Takes a list of mutable appearances Returns a list in the form: 1 - a list of all mutable appearances that would need to be updated to change planes in the event of a z layer change, alnongside the commands required to properly track parents to update 2 - a list of all parents that will require updating |
calculate_light_offset | Returns a list of x and y offsets to apply to our visual lighting position |
calculate_projectile_angle_and_pixel_offsets | Calculates the pixel offsets and angle that a projectile should be launched at. |
calculate_tgm_header_index | Generates a key matching our index |
callback_on_everyone_on_z | Invokes a callback on every living mob on the provided z level. |
callback_select | Runs a list of callbacks asyncronously, returning only when all have finished |
camera_sort | Sorts the list of cameras by their c_tag to display to players. |
can_see | 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 |
censor_ic_filter_for_pdas | Given a pda message, will replace any match in the message with grawlixs. |
center_image | 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) |
chatter_speak | 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 |
check_asay_links | Checks a given message to see if any of the words are something we want to treat specially, as detailed below. |
check_behind | Checks to see if atom/source is behind atom/target |
check_gases | A simple helped proc that checks if the contents of a list of gases are within acceptable terms. |
check_holidays | Checks that the passed holiday is located in the global holidays list. |
check_pda_message_against_filter | Checks a PDA message against the IC/Soft IC filter. Returns TRUE if the message should be sent. Notifies the user passed in arguments if the message matched either filter. |
check_target_facings | Returns the direction that the initiator and the target are facing |
check_teleport_valid | Validates that the teleport being attempted is valid or not |
check_topdown_validity | Checks if a passed in MA or atom is allowed to have its current plane/layer matchup |
check_wall_item | 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. |
check_zone | Convert a PRECISE ZONE into the BODY_ZONE |
chem_splash | 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. |
circle_range | Returns all atoms present in a circle around the center |
circle_range_turfs | Returns a list of turfs around a center based on RANGE_TURFS() |
circle_view | Returns all atoms present in a circle around the center but uses view() instead of range() (Currently not used) |
circle_view_turfs | Returns a list of turfs around a center based on view() |
cleanup_ghosts | Gives a farewell message and deletes the ghosts produced by a ghost portal structure. |
cmp_assoc_list_name | Passed a list of assoc lists, sorts them by the list's "name" keys. |
cmp_autowiki_fish_sources_content | Sort the autowiki fish entries by their weight. However, duds always come first. |
cmp_bodypart_by_body_part_asc | Orders bodyparts by their body_part value, ascending. |
cmp_crafting_req_priority | Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes |
cmp_fish_fluid | Orders fish types following this order (freshwater -> saltwater -> anadromous -> sulphuric water -> any water -> air) If both share the same required fluid type, they'll be ordered by name instead. |
cmp_heretic_knowledge | Orders heretic knowledge by priority |
cmp_mob_health | Orders mobs by health |
cmp_port_order_asc | Orders by integrated circuit weight |
cmp_rped_sort | Sorts stock parts based on tier |
cmp_uplink_category_desc | Orders by uplink category weight |
color_to_full_rgba_matrix | Converts RGB shorthands into RGBA matrices complete of constants rows (ergo a 20 keys list in byond). if return_identity_on_fail is true, stack_trace is called instead of CRASH, and an identity is returned. |
colorize_string | Gets a color for a name, will return the same color for a given string consistently within a round.atom |
compare_list | compare two lists, returns TRUE if they are the same |
considered_afk | Checks if a player is considered AFK |
considered_alive | Checks if the passed mind has a mob that is "alive" |
considered_escaped | Checks if the passed mind is considered "escaped". |
considered_exiled | Exiled check |
construct_phobia_regex | 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 |
convert_integer_to_words | Takes an integer up to 999,999,999 and returns it in words. Works with negative numbers and 0. |
convert_ph_to_readable_color | 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. |
coords2turf | Converts a list of coordinates, or an assosciative list if passed, into a turf by calling locate(x, y, z) based on the values in the list |
count_by_type | return the amount of items of the same type inside a list |
create_announcement_div | Inserts a span styled message into an alert box div |
create_atmos_zone | Create an atmos zone (Think ZAS), similiar to [proc/detect_room] but it ignores walls and turfs which are non-[atmos_can_pass] |
create_basketball_game | Creates the global datum for playing basketball games, destroys the last if that's required and returns the new. |
create_ctf_game | Creates a CTF game with the provided team ID then returns a reference to the new controller. If a controller already exists provides a reference to it. |
create_delusion | Helper to give the passed mob the ability to create a delusion hallucination (even a custom one). Returns a list of arguments - pass these to _cause_hallucination to cause the desired hallucination |
create_glass_styles | Constructs a nested list of glass style singletons |
create_mafia_game | Creates the global datum for playing mafia games, destroys the last if that's required and returns the new. |
create_ooc_announcement_div | Inserts a span styled message into an OOC alert style div |
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 | |
create_strippable_list | Creates an assoc list of keys to /datum/strippable_item |
create_uplink_sales | Selects a set number of unique items from the uplink, and deducts a percentage discount from them |
cult_ending_helper | 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 its conclusion |
cure_curse_of_babel | Mainly so admin triggered tower of babel can be undone |
cut_relative_direction | Takes a screen_loc string and cut out any directions like NORTH or SOUTH |
day_of_month | 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 |
debug_hallucination_weighted_list | Debug proc for getting the total weight of the random_hallucination_weighted_list |
debug_variable | Get displayed variable in VV variable list |
deep_compare_list | Compares 2 lists, returns TRUE if they are the same |
deep_copy_list | Copies a list, and all lists inside it recusively Does not copy any other reference type |
default_ui_state | The sane defaults for a UI such as a computer or a machine. |
delete_all_SS_and_recreate_master | Delete all existing SS to basically start over |
delta_to_angle | Calculate the angle produced by a pair of x and y deltas |
deltimer | Delete a timer |
deprecise_zone | Takes a zone and returns its "parent" zone, if it has one. |
diagonally_blocked | check if 2 diagonal turfs are blocked by dense objects |
diff_appearances | Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays |
dir2offset | Returns a list(x, y), being the change in position required to step in the passed in direction |
dir_to_all_junctions | Takes a direction, turns it into all the junctions that contain it |
disambiguate_client | 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 |
disease_air_spread_walk | Helper for checking if there is an air path between two turfs |
diseasescan | Checks the individual for any diseases that are visible to the scanner, and displays the diseases in the attacked to the attacker. |
dispatch_announcement_to_players | Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
should_play_sound can also be a callback, if you want to only play the sound to specific players. |
display_corners | Makes all lighting corners visible, debug to aid in understanding |
display_energy | Format an energy value in prefixed joules. Arguments |
display_power | *Format a power value in prefixed watts. |
doPortalSpawn | Spawns a portal storm that spawns in sentient/non sentient mobs portal_appearance is a list in the form (turf's plane offset + 1) -> appearance to use |
do_after | Timed action involving one mob user. Target is optional. |
do_chem_smoke | Helper to quickly create a cloud of reagent smoke |
do_smoke | A helper proc used to spawn small puffs of smoke. |
do_sweep | Sweep objects in the direction we're facing towards our direction Arguments |
dump_in_space | Dump a movable in a random valid spacetile |
duplicate_object | |
dview | 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). |
dyn_explosion | Using default dyn_ex scale: |
emissive_appearance | Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR. |
emissive_blocker | Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR. |
end_cooldown | Callback called by a timer to end an associative-list-indexed cooldown. |
end_message_delay | Simply resets the message delay and the recent messages list, to ensure that
recent messages can be sent again. Is called on a one second timer after a
delay is set, from /obj/machinery/telecomms/broadcaster/receive_information() |
ending_helper | Helper to set the round to end asap. Current usage Cult round end code |
endswith | Returns TRUE if the input_text ends with the ending |
energy_to_power | Converts the joule to the watt, assuming SSmachines tick rate. Arguments |
english_list | Returns a list in plain english as a string |
expand_three_digit_color | Given a 3 character color (no hash), converts it into #RRGGBB (with hash) |
expand_weights | Takes a weighted list (see above) and expands it into raw entries This eats more memory, but saves time when actually picking from it |
explosion | Makes a given atom explode. |
export_single_item | It works like export_item_and_contents(), however it ignores the contents. Meaning only exported_atom will be valued. |
failed_narsie_summon | Summon failed, time to work backwards |
fast_split_stack | Splits a stack. we don't use /obj/item/stack/proc/split_stack because Byond complains that should only be called asynchronously. This proc is also more faster because it doesn't deal with mobs, copying evidences or refreshing atom storages Has special internal uses for e.g. by the material container & RPED |
fill_holidays | Fills the holidays list if applicable, or leaves it an empty list. |
fill_with_ones | Given a list, return a copy where values without defined weights are given weight 1. For example, fill_with_ones(list(A, B=2, C)) = list(A=1, B=2, C=1) Useful for weighted random choices (loot tables, syllables in languages, etc.) |
filter_appearance_recursive | Recursively applies a filter to a passed in static appearance, returns the modified appearance |
filter_name_ic | Helper proc to check if a name is valid for the IC filter |
findTrueKey | Takes a stealthed ckey as input, returns the true key it represents |
find_functional_ntnet_relay | Checks whether NTNet is available by ensuring at least one relay exists and is operational. |
find_maintenance_spawn | Finds us a generic maintenance spawn location. |
find_obstruction_free_location | 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. |
find_reagent | Returns reagent datum from typepath |
find_record | Returns the first record in the list that matches the name |
find_space_spawn | Finds us a generic spawn location in space. |
findname | Find if the message has the real name of any user mob in the mob_list |
finish_equip_mob | A utility function for /datum/strippable_item s to finish equipping an item to a mob. |
finish_unequip_mob | A utility function for /datum/strippable_item s to finish unequipping an item from a mob. |
fire_curse_hand | Torment the target with a frightening hand |
firing_squad | firing_squad is a proc for the :B:erforate smite to shoot each individual bullet at them, so that we can add actual delays without sleep() nonsense |
flash_color | Flash a color on the passed mob |
flatten_list | Flattens a keyed list into a list of its contents |
flick_overlay_global | Add an image to a list of clients and calls a proc to remove it after a duration |
format_frequency | Format frequency by moving the decimal. |
format_text | Properly format a string of text by using replacetext() |
full_capitalize | Returns a string with the first letter of each word capitialized |
gas_mixture_parser | |
gather_z_level_information | Returns all necessary z-level information. Argument append_grid allows the user to see a table showing all of the z-level linkages, which is only visible and useful in-game. |
generateStealthCkey | Hands back a stealth ckey to use, guarenteed to be unique |
generate_adjacent_directions | Encodes connectivity between border objects Returns a list accessable by a border object's dir, the direction between it and a target, and a target Said list will return the direction the two objects connect, if any exists (if the target isn't a border object and the direction is fine, return the inverse of the direction in use) |
generate_and_hash_rsc_file | 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 don't have to be hashed twice |
generate_asset_name | Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.) |
generate_autowiki_output | Returns a string of the autowiki output file |
generate_bitfields | Turns /datum/bitfield subtypes into a list for use in debugging |
generate_changeling_meteor | Receives a mob candidate, transforms them into a changeling, and hurls them at the station inside of a changeling meteor |
generate_chemwiki_line | Generate the big list of reagent based reactions. style='background-color:#FFEE88;'|{{anchor|Synthetic-derived growth factor}}Synthetic-derived growth factor▮ |
generate_cult_rune_types | Returns an associated list of rune types. [rune.cultist_name] = [typepath] |
generate_generator_index | Creates generator__id => type map. |
generate_hallucination_weighted_list | Generates the global weighted list of random hallucinations. |
generate_icon_alpha_mask | Helper proc to generate a cutout alpha mask out of an icon. |
generate_items_inside | Creates new items inside an atom based on a list |
generate_lazy_template_map | Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance. |
generate_map_list_from_directory | Returns a list of all maps to be found in the directory that is passed in. |
generate_quirk_constant_data | Constructs [GLOB.all_quirk_constant_data] by iterating through a typecache of pregen data, ignoring abstract types, and instantiating the rest. |
generate_random_name | Generate a random name based off of one of the roundstart languages |
generate_random_name_species_based | Generate a random name based off of a species This will pick a name from the species language, and avoid picking common if there are alternatives |
generate_reagents_taste_message | Returns what this reagents in our given list taste like |
generate_selectable_species_and_languages | Generates species available to choose in character setup at roundstart |
generate_space_underlay | Generates a space underlay for a turf This provides proper lighting support alongside just looking nice Accepts the appearance to make "spaceish", and the turf we're doing this for |
generate_unique_announcement_header | Proc that just generates a custom header based on variables fed into priority_announce()
Will return a string. |
generate_wound_series_collection | Generates [wound_series_collections] by iterating through all pregen_data. Refer to the mentioned list for documentation |
generate_wound_static_data | Constructs [GLOB.all_wound_pregen_data] by iterating through a typecache of pregen data, ignoring abstract types, and instantiating the rest. |
get | Returns the atom type in the specified loc |
getFlatIcon | Create a single /icon from a given /atom or /image. |
get_active_player_count | Get active players who are playing in the round |
get_adjacent_areas | Returns 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_areas | Returns a list with all the adjacent areas by getting the adjacent open turfs |
get_adjacent_open_turfs | Returns a list with all the adjacent open turfs. Clears the list of nulls in the end. |
get_airlock_overlay | 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 |
get_all_slots | Get all possible organ slots by checking every organ, and then store it and give it whenever needed |
get_allowed_instrument_ids | Get all non admin_only instruments as a list of text ids. |
get_angle | Calculate the angle between two movables and the west|east coordinate |
get_angle_raw | Angle between two arbitrary points and horizontal line same as /proc/get_angle |
get_antag_minds | Returns MINDS of the assigned antags of given type/subtypes Supplying no antag type grants all minds with antag datums |
get_area_name | Returns the name of the area the atom is in |
get_areas_in_range | 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 |
get_armor_by_type | Gets an armor type datum using the given type by formatting it into the expected datum tag |
get_atom_on_turf | Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. |
get_bbox_of_atoms | Get a bounding box of a list of atoms. |
get_blueprint_data | get_blueprint_data Gets a list of turfs around a central turf and gets the blueprint data in a list Args: |
get_cached_actionspeed_modifier | Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO! |
get_cached_movespeed_modifier | Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO! |
get_camera_list | get_camera_list |
get_cardinal_dir | Get the cardinal direction between two atoms |
get_chasm_category | Returns a key to store, remove and access fallen mobs depending on the z-level. This stops rescuing people from places that are waaaaaaaay too far-fetched. |
get_chat_toggles | Get the given client's chat toggle prefs. |
get_chem_id | Returns reagent datum from reagent name string |
get_closest_atom | Returns the closest atom of a specific type in a list from a source |
get_consistent_feature_entry | Takes in an accessory list and returns the first entry from that list, ensuring that we dont return SPRITE_ACCESSORY_NONE in the process. |
get_corresponding_wound_type | Searches through all wounds for any of proper type, series, and biostate, and then returns a single one via pickweight. Is able to discern between, say, a flesh slash wound, and a metallic slash wound, and will return the respective one for the provided limb. |
get_ctf_voting_controller | Returns the existing /datum/ctf_voting_controller for the given ID, or makes one |
get_dist_euclidean | Returns the distance between two atoms |
get_dummy_savefile | Gets a dummy savefile for usage in icon generation. Savefiles generated from this proc will be empty. |
get_dynamic_human_appearance | Creates a human with the given parameters and returns an appearance of it |
get_edge_target_turf | Returns the turf located at the map edge in the specified direction relative to target_atom used for mass driver |
get_element_by_var | 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 |
get_first_open_turf_in_area | Iterates over all turfs in the target area and returns the first non-dense one |
get_flat_existing_human_icon | 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 and handle the caching yourself if you need to access that icon multiple times, or refactor this proc to feature caching of icons. |
get_flat_human_icon | |
get_general_adminwho_information | Proc that gathers adminwho information for a general player, which will only give information if an admin isn't AFK, and handles potential fakekeying. Will return a list of strings. |
get_hear | Like view but bypasses luminosity check |
get_hearers_in_LOS | 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 |
get_hearers_in_range | The exact same as get_hearers_in_view, but not limited by visibility. Does no filtering for traits, line of sight, or any other such criteria. Filtering is intended to be done by whatever calls this function. |
get_hearers_in_view | 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(). |
get_icon_dimensions | Returns a list containing the width and height of an icon file |
get_icon_dmi_path | 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 "" |
get_line | Get a list of turfs in a line from starting_atom to ending_atom . |
get_linked_admin_name | Proc that will return the applicable display name, linkified or not, based on the input client reference. |
get_linked_z_angle | Gets the angle between two linked z-levels. Returns an angle (in degrees) if the z-levels are crosslinked/neighbors, or null if they are not. |
get_list_of_admins | Proc that returns a list of cliented admins. Remember that this list can contain nulls! Also, will return null if we don't have any admins. |
get_messenger_name | Get the display name of a messenger instance |
get_messengers_sorted_by_job | Gets all messengers, sorted by their job |
get_messengers_sorted_by_name | Gets all messengers, sorted by their name |
get_mob_by_ckey | returns a mob type controlled by a specified ckey |
get_mob_by_key | Return the mob type that is being controlled by a ckey |
get_mob_or_brainmob | Returns the occupant mob or brain from a specified input |
get_most_experienced | From a list of players (minds, mobs or clients), finds the one with the highest playtime (either from a specific role or overall living) and returns it. |
get_nested_locs | Returns a list of all locations (except the area) the movable is within. |
get_officer_departments | Returns the distribution of splitting the given security officers into departments. Return value is an assoc list of candidate => SEC_DEPT_*. |
get_offset_target_turf | returns turf relative to target_atom offset in dx and dy tiles, bound to map limits |
get_open_turf_in_dir | Returns the open turf next to the center in a specific direction |
get_path_by_slot | Returns a generic path of the object based on the slot |
get_path_to | 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. It will yield until a path is returned, using magic |
get_perceived_radiation_danger | Gets the perceived "danger" of radiation pulse, given the threshold to the target. Returns a RADIATION_DANGER_* define, see code/__DEFINES/radiation.dm |
get_perimeter | Get a list of turfs in a perimeter given the center_atom and radius .
Automatically rounds down decimals and does not accept values less than positive 1 as they don't play well with it.
Is efficient on large circles but ugly on small ones
Uses Jesko`s method to the midpoint circle Algorithm. |
get_pixel_angle | for getting the angle when animating something's pixel_x and pixel_y |
get_pixel_distance | 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 |
get_player_client | Returns a client from a mob, mind or client |
get_powernet_info_from_source | Extracts the powernet and cell of the provided power source |
get_preferences_in_priority_order | Returns a flat list of preferences in order of their priority |
get_rand_frequency | get a random frequency. |
get_rand_frequency_low_range | get_rand_frequency but lower range. |
get_random_coin | Gets a random coin excluding the blocked type and including extra coins which aren't pathed like coins. |
get_random_drink | Gets a random drink excluding the blocked type |
get_random_drink_id | Returns a random reagent consumable ethanol object minus blacklisted reagents |
get_random_food | Get a random food item exluding the blocked ones |
get_random_jumpskirt | Returns a random, acceptable jumpskirt typepath |
get_random_jumpsuit | Returns a random, acceptable jumpsuit typepath |
get_random_reagent_id | Returns a random reagent object, with the option to blacklist reagents. |
get_random_station_turf | Returns a random turf on the station |
get_random_valid_hallucination_subtype | Gets a random subtype of the passed hallucination type that has a random_hallucination_weight > 0. If no subtype is passed, it will get any random hallucination subtype that is not abstract and has weight > 0. This can be used instead of picking from the global weighted list to just get a random valid hallucination. |
get_ranged_target_turf_direct | Get ranged target turf, but with direct targets as opposed to directions |
get_reagent_type_from_product_string | Returns a list of chemical_reaction datums that have the input STRING as a product |
get_recipe_from_reagent_product | Takes a type in and returns a list of associated recipes |
get_round_default_lawset | A getter that sets up the round default if it has not been yet. |
get_safe_random_station_turf | Returns a random turf on the station, excludes dense turfs (like walls) and areas that have valid_territory set to FALSE |
get_selectable_species | Gets a list of all species id's available to choose in roundstart. |
get_sensitive_adminwho_information | Proc that gathers adminwho information for admins, which will contain information on if the admin is AFK, readied to join, etc. Only arg is a list of clients to use. Will return a list of strings. |
get_sfx | Used to convert a SFX define into a .ogg so we can add some variance to sounds. If soundin is already a .ogg, we simply return it |
get_size_in_tiles | Returns the size of the sprite in tiles. Takes the icon size and divides it by the world icon size (default 32). This gives the size of the sprite in tiles. |
get_small_overlay | Fikou's fix for making toast alerts look nice - resets offsets, transforms to fit |
get_sorted_areas | Returns a sorted version of GLOB.areas, by name |
get_swarm_path_to | POTENTIALLY cheaper version of get_path_to This proc generates a path map for the end atom's turf, which allows us to cheaply do pathing operations "at" it Generation is significantly SLOWER then get_path_to, but if many things are/might be pathing at something then it is much faster Runs the risk of returning an suboptimal or INVALID PATH if the delay between map creation and use is too long |
get_teleport_loc | Returns location. Returns null if no location was found. |
get_temp_change_amount | Used to get the amount of change between two body temperatures |
get_turf_pixel | Lets the turf this atom's ICON appears to inhabit it takes into account: Pixel_x/y Matrix x/y NOTE: if your atom has non-standard bounds then this proc will handle it, but: if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked this may seem bad, but you're at least as close to the center of the atom as possible, better than byond's default loc being all the way off) if the bounds are odd, the true middle turf of the atom is returned |
get_valid_screen_location | Returns a valid location to place a screen object without overflowing the viewport |
get_visual_offset | Returns how visually "off" the atom is from its source turf as a list of x, y (in pixel steps) it takes into account: Pixel_x/y Matrix x/y Icon width/height |
give_admin_popup | Tries to give the target an admin popup. If it fails, will send the error to the passed admin. |
give_escape_menu_details | Provides a singleton for the escape menu details screen. |
give_escape_menu_title | Provides a singleton for the escape menu details screen. |
goonchem_vortex | Magical move-wooney that happens sometimes. |
grawlix | Generate a grawlix string of length of the text argument. |
greatest_common_factor | Takes a list of numbers as input, returns the highest value that is cleanly divides them all Note: this implementation is expensive as heck for large numbers, I only use it because most of my usecase Is < 10 ints |
hallucination_pulse | Emits a hallucinating pulse around the passed atom. Affects everyone in the passed radius except for those with TRAIT_MADNESS_IMMUNE. This affects blind players. |
haunt_outburst | Takes a given area and chance, applying the haunted_item component to objects in the area. |
healthscan | healthscan returns a list of everything a health scan should give to a player. Examples of where this is used is Health Analyzer and the Physical Scanner tablet app. Args: user - The person with the scanner target - The person being scanned mode - Uses SCANNER_CONDENSED or SCANNER_VERBOSE to decide whether to give a list of all individual limb damage advanced - Whether it will give more advanced details, such as husk source. tochat - Whether to immediately post the result into the chat of the user, otherwise it will return the results. |
honkerblast | Unleashes a honkerblast similar to the honkmech weapon, but with more granular control. |
hsv2rgb | Converts a list storing hsva into an rgb color |
htmlrendertext | Perform a whitespace cleanup on the text, similar to what HTML renderers do |
icon2base64 | Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64) |
icon2html | 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_exists | Checks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE. |
inLineOfSight | Calculate if two atoms are in sight, returns TRUE or FALSE |
init_chemical_reagent_list | Initialises all /datum/reagent into a list indexed by reagent id |
init_crafting_recipes | Inits crafting recipe lists |
init_crafting_recipes_atoms | Inits atoms used in crafting recipes |
init_export | Makes sure the exports list is populated and that the report isn't null. |
init_gas_id_to_canister | Returns a map of canister id to its type path |
init_hotspot_reactions | Returns reactions which will contribute to a hotspot's size. |
init_keybindings | Creates and sorts all the keybinding datums |
init_language_holder_prototypes | Inits the global list of language holder prototypes. |
init_loadout_categories | Inits the global list of loadout category singletons Also inits loadout item singletons |
init_pirate_gangs | initializes the pirate gangs glob list, adding all subtypes that can roll today. |
init_subtypes_w_path_keys | Functions like init_subtypes, but uses the subtype's path as a key for easy access |
init_surgeries | //Initial Building///// |
initialize_starting_knowledge | Returns a list of all heretic knowledge TYPEPATHS that have route set to PATH_START. |
int_to_words | Takes 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_colour | Inverts the colour of an HTML string |
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() |
isAdminGhostAI | Returns TRUE/FALSE on whether the mob is an Admin Ghost AI. This requires this snowflake check because AI interact gives the access to the mob's client, rather than the mob like everyone else, and we keep it that way so they can't accidentally give someone Admin AI access. |
isAdminObserver | Is the passed in mob a ghost with admin powers, doesn't check for AI interact like isAdminGhost() used to |
is_admin | Returns if the given client is an admin, REGARDLESS of if they're deadminned or not. |
is_banned_from | Checks client ban cache or, if it doesn't exist, queries the DB ban table to see if the player's ckey is banned from at least one of the provided roles. |
is_color_dark | Given a color in the format of "#RRGGBB", will return if the color is dark. |
is_convertable_to_cult | Returns whether the given mob is convertable to the blood cult |
is_ctf_target | Proc that identifies if something is a valid target for CTF related checks, checks if an object is a ctf barrier or has ctf component if they are a player. |
is_guest_key | Returns whether or not a player is a guest using their ckey as an input |
is_ic_filtered | Given 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_pdas | 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. |
is_infiltrator_docked_at_syndiebase | Returns whether or not syndicate operatives escaped. |
is_matching_bait | Helper proc that checks if a bait matches identifier from fav/disliked bait list |
is_on_a_planet | Checks if the passed non-area atom is on a "planet". |
is_ooc_filtered | Given a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK. |
is_path_in_list | Checks for specific paths in a list. |
is_safe_turf | Checks if a given turf is a "safe" location |
is_soft_ic_filtered | Given 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_pdas | 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. |
is_soft_ooc_filtered | Given 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_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 |
is_special_character | 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 If allow_fake_antags is set to FALSE, Valentines, ERTs, and any such roles with FLAG_FAKE_ANTAG won't pass. |
is_type_in_list | Checks for specific types in a list. |
is_type_on_turf | Checks whether or not a particular typepath or subtype of it is present on a turf |
is_valid_dmi_file | given a text string, returns whether it is a valid dmi icons folder path |
is_valid_src | Check if a datum has not been deleted and is a valid source |
is_valid_z_level | |
is_within_radio_jammer_range | Checks if a given atom is in range of a radio jammer, returns TRUE if it is. |
ishumanbasic | 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. |
iso_to_weekday | Returns an integer in ISO format 1 (Monday) - 7 (Sunday) as a string day |
isolate_light | Hides all the lights around a source temporarially, for the sake of figuring out how bad a light bleeds (Except for turf lights, because they're a part of the "scene" and rarely modified) |
isvineimmune | Used to determine whether the mob is immune to actions by the vine. Use cases: Stops vine from attacking itself, other plants. |
join_admin_ranks | Takes a list of rank names and joins them with + |
json_deserialize_datum | Convert a list of json to datum |
json_serialize_datum | Convert a datum into a json blob |
kvpify_list | 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 and that unique objects with the same string representation do not produce duplicate keys that are clobbered by the standard JavaScript JSON.parse function |
lavaland_equipment_pressure_check | Check if the turf pressure allows specialized equipment to work |
lawid_to_type | returns the law datum with the lawid in question, law boards and law datums should share this id. |
level_announce | Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message. |
library_updated | Increments every time WE update the library db table, causes all existing consoles to repull when they next check |
lightningbolt | this is the actual bolt effect and damage, made into its own proc because it is used elsewhere |
list_clear_empty_weakrefs | Removes any empty weakrefs from the list Returns TRUE if the list had empty refs, FALSE otherwise |
list_clear_nulls | Removes any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise |
living_player_count | Returns the amount of currently living players |
load_admin_ranks | Loads admin ranks. Return a list containing the backup data if they were loaded from the database backup json |
load_admins | (Re)Loads the admin list. returns TRUE if database admins had to be loaded from the backup json |
load_adventures | Loads all adventures from DB |
load_default_map_config | Proc that simply loads the default map config, which should always be functional. |
load_map | Helper and recommened way to load a map file |
load_map_config | Proc handling the loading of map configs. Will return the default map config using /proc/load_default_map_config if the loading of said file fails for any reason whatsoever, so we always have a working map for the server to run. Arguments: |
load_poll_data | Loads all current and future server polls and their options to store both as datums. |
loadout_list_to_datums | Takes a list of paths (such as a loadout list) and returns a list of their singleton loadout item datums |
log_access | Logging for logging in & out of the game, with error messages. |
log_admin | General logging for admin actions |
log_admin_circuit | Logging for admin actions on or with circuits |
log_admin_private | General logging for admin actions |
log_adminsay | Logging for AdminSay (ASAY) messages |
log_asset | Logging for loading and caching assets |
log_atmos | Logs the contents of the gasmix to the game log, prefixed by text |
log_attack | Generic attack logging |
log_bomber | Logging for bombs detonating |
log_changeling_power | Logging for changeling powers purchased |
log_chat | Logging for chatting on modular computer channels |
log_combat | Log a combat message in the attack log |
log_comment | Logging for newscaster comments |
log_config | Logging for config errors Rarely gets called; just here in case the config breaks. |
log_directed_talk | Helper for logging of messages with only one sender and receiver (i.e. mind links) |
log_dsay | Logging for DeachatSay (DSAY) messages |
log_dynamic | Logging for dynamic procs |
log_emote | Logging for emotes |
log_filter | Logs to the filter log with the given message, match, and scope |
log_game | Logging for generic/unsorted game messages |
log_heretic_knowledge | Logging for heretic powers learned |
log_internet_request | Logging for music requests |
log_job_debug | Logging for job slot changes |
log_lua | Logging for lua scripting |
log_malf_upgrades | Logging for upgrades purchased by a malfunctioning (or combat upgraded) AI |
log_manifest | Logging for player manifest (ckey, name, job, special role, roundstart/latejoin) |
log_mapping | Logging for mapping errors |
log_mecha | Logging for mech actions |
log_ooc | Logging for messages sent in OOC |
log_paper | Logging for writing made on paper |
log_pda | Logging for PDA messages sent |
log_perf | Logging for game performance |
log_played_names | Adds the new names to the player's played_names list on their /datum/player_details for use of admins.
ckey should be their ckey, and data should be an associative list with the keys being the names they played under and the values being the unique mob ID tied to that name. |
log_prayer | Logging for prayed messages |
log_qdel | Logging for hard deletes |
log_radio_emote | Logging for emotes sent over the radio |
log_research | Puts the text into the research html file, not log. See [INVESTIGATE_RESEARCH] for [/atom/proc/investigate_log] |
log_say | Logging for generic spoken messages |
log_shuttle | Logging for shuttle actions |
log_speech_indicators | Logging for speech indicators. |
log_spellbook | Logging for wizard powers learned |
log_spy | Logs bounties completed by spies and their rewards |
log_sql | Logging for DB errors |
log_suspicious_login | 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. |
log_telecomms | Logging for speech taking place over comms, as well as tcomms equipment |
log_tgui | Appends a tgui-related log entry. All arguments are optional. |
log_tool | Logging for tool usage |
log_topic | Logging for world/Topic |
log_traitor | Logging for traitor objectives |
log_transport | Logging for transport (tram/elevator) actions |
log_uplink | Logging for items purchased from a traitor uplink |
log_virus | Logging for the creation and contraction of viruses |
log_vote | Logging for OOC votes |
log_whisper | Logging for whispered messages |
log_world | Log to both DD and the logfile. |
log_wound | log_wound() is for when someone is attacked and suffers a wound. Note that this only captures wounds from damage, so smites/forced wounds aren't logged, as well as demotions like cuts scabbing over |
los_check | Line of sight check! Spawns a dummy object and then iterates through each turf to see if it's blocked by something not handled by pass_args. Contains a mid_los_check, meant to be overriden by subtypes. args: |
make_associative | Make a normal list an associative one |
make_body | Uses stripped down and bastardized code from respawn character |
make_datum_reference_lists | Legacy procs that really should be replaced with proper _INIT macros |
make_into_clown | Helper proc that handles making someone into a clown after a bananium nuke goes off. |
make_tuple | Returns the name of the mathematical tuple of same length as the number arg (rounded down). |
material_insertion_animation | Creates a mutable appearance with the material color applied for its insertion animation into an autolathe or techfab Arguments |
md5asfile | Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results. |
md5filepath | Returns the md5 of a file at a given path. |
message_centcom | Used by communications consoles to message CentCom |
message_syndicate | Used by communications consoles to message the Syndicate |
message_to_html | Message-related procs |
minor_announce | Sends a minor annoucement to players. Minor announcements are large text, with the title in red and message in white. Only mobs that can hear can see the announcements. |
mobs_in_area_type | Takes: list of area types Returns: all mobs that are in an area type |
mouse_angle_from_client | Returns an angle in degrees relative to the position of the mouse and that of the client eye. |
move_element | 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 |
move_range | 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 |
movespeed_data_null_check | Checks if a move speed modifier is valid and not missing any data |
mutable_appearance | |
narsie_apocalypse | Third crew last second win check and flufftext for [/proc/begin_the_end()] |
narsie_end_begin_check | First crew last second win check and flufftext for [/proc/begin_the_end()] |
narsie_end_second_check | Second crew last second win check and flufftext for [/proc/begin_the_end()] |
narsie_last_second_win | Called only if the crew managed to destroy narsie at the very last second for [/proc/begin_the_end()] |
narsie_start_destroy_station | security level and shuttle lockdowns for [/proc/begin_the_end()] |
next_list_item | Returns the next item in a list |
notify_ghosts | Fancy notifications for ghosts |
nuke_gib | Helper proc that handles gibbing someone who has been nuked. |
nuke_request | Used by communications consoles to request the nuclear launch codes |
objectify | "Turns" people into objects. Really, we just add them to the contents of the item. |
offer_control | Offer control of the passed in mob to dead player |
offset_to_screen_loc | Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope |
overlays2text | Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get |
parse_caught_click_modifiers | Returns a turf based on text inputs, original turf and viewing client |
parse_slot_flags | Returns a list of strings for a given slot flag. |
parse_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 |
partially_block_emissives | Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate |
pass | A do nothing proc |
path_map_passalong | We generate a path for the passed in callbacks, and then pipe it over |
pathfinding_finished | Uses funny pass by reference bullshit to take the output created by pathfinding, and insert it into a return list We'll be able to use this return list to tell a sleeping proc to continue execution |
pathwalk | Takes a directory and returns every file within every sub directory. If extensions_filter is provided then only files that end in that extension are given back. If extensions_filter is a list, any file that matches at least one entry is given back. |
peek | Returns the top (last) element from the list, does not remove it from the list. Stack functionality. |
permissive_sanitize_name | Much more permissive version of reject_bad_name(). Returns a trimmed string or null if the name is invalid. Allows most characters except for IC chat prohibited words. |
pick_closest_path | Returns a chosen path that is the closest to a list of matches |
pick_n_take | Pick a random element from the list and remove it from the list. |
pick_weight | Picks a random element from a list based on a weighting system. For example, given the following list: A = 6, B = 3, C = 1, D = 0 A would have a 60% chance of being picked, B would have a 30% chance of being picked, C would have a 10% chance of being picked, and D would have a 0% chance of being picked. You should only pass integers in. |
pick_weight_recursive | Like pick_weight, but allowing for nested lists. |
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. |
piglatin_sentence | runs piglatin_word() proc on each word in a sentence. preserves caps and punctuation |
piglatin_word | takes "word", and returns it piglatinized. |
pixel_offset_turf | Takes a turf, and a list of x and y pixel offsets and returns the turf that the offset position best lands in |
play_cinematic | Plays a cinematic, duh. Can be to a select few people, or everyone. |
play_fov_effect | Plays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness |
playsound | playsound is a proc used to play a 3D sound in a specific range. This uses SOUND_RANGE + extra_range to determine that. |
podspawn | 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) |
poll_cultists_for_leader | Polls all Cultists on whether the person putting themselves forward should be made the Cult Leader, if they can actually be such. |
poll_holiday | 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 |
pop | Returns the top(last) element from the list and removes it from the list (typical stack function) |
populate_editable_sign_types | This proc populates GLOBAL_LIST_EMPTY(editable_sign_types) |
power_fail | Disable power in the station APCs |
power_failure | Causes a power failure across the station. |
power_restore | Restores power to all rooms on the station. |
power_restore_quick | A quicker version of /proc/power_restore that only handles recharging SMESs. |
power_to_energy | Converts the watt to the joule, assuming SSmachines tick rate. |
prefix_zeros_to_number | Returns a text string containing N prefixed with a series of zeros with length equal to max_zeros minus log(10, N), rounded down. |
prepare_explosion_turfs | Returns a list of turfs in X range from the epicenter Returns in a unique order, spiraling outwards This is done to ensure our progressive cache of blast resistance is always valid This is quite fast |
prepare_infuser_entries | Global proc that sets up each /datum/infuser_entry sub-type as singleton instances in a list, and returns it. |
prepare_lua_editor_list | Intermediate step for preparing lists to be passed into the lua editor tgui. Resolves weakrefs, converts some values without a standard textual representation to text, and can handle self-referential lists and potential duplicate output keys. |
pretty_string_from_reagent_list | Input a reagent_list, outputs pretty readable text! Default output will be formatted as |
previous_list_item | Returns the previous item in a list |
print_holiday | Does the same as /proc/poll_holiday, but prints the output to admins instead of returning it |
print_language_list | Helper proc to print a list of languages in a human readable format |
priority_announce | Make a big red text announcement to |
process_teleport_locs | Generate a list of turfs you can teleport to from the areas list |
propagate_network | remove the old powernet and replace it with a new one throughout the network. |
qdel | Should be treated as a replacement for the 'del' keyword. |
radiation_pulse | Sends out a pulse of radiation, eminating from the source. Radiation is performed by collecting all radiatables within the max range (0 means source only, 1 means adjacent, etc), then makes their way towards them. A number, starting at 1, is multiplied by the insulation amounts of whatever is in the way (for example, walls lowering it down). If this number hits equal or below the threshold, then the target can no longer be irradiated. If the number is above the threshold, then the chance is the chance that the target will be irradiated. As a consumer, this means that max_range going up usually means you want to lower the threshold too, as well as the other way around. If max_range is high, but threshold is too high, then it usually won't reach the source at the max range in time. If max_range is low, but threshold is too low, then it basically guarantees everyone nearby, even if there's walls and such in the way, can be irradiated. You can also pass in a minimum exposure time. If this is set, then this radiation pulse will not irradiate the source unless they have been around any radioactive source for that period of time. The chance to get irradiated diminishes over range, and from objects that block radiation. Assuming there is nothing in the way, the chance will determine what the chance is to get irradiated from half of max_range. Example: If chance is equal to 30%, and max_range is equal to 8, then the chance for a thing to get irradiated is 30% if they are 4 turfs away from the pulse source. |
ran_zone | Return the zone or randomly, another valid zone |
random_bounty | |
random_colour | Returns a random color picked from a list, has 2 modes (0 and 1), mode 1 doesn't pick white, black or gray |
random_fish_type | Returns random fish, using random_case_rarity probabilities. |
random_nukecode | Returns a string for a random nuke code |
random_step | Forces the atom to take a step in a random direction |
randomize_human | Fully randomizes everything about a human, including DNA and name. |
randomize_human_normie | Randomizes a human, but produces someone who looks exceedingly average (by most standards). |
ranks_from_rank_name | Converts a rank name (such as "Coder+Moth") into a list of /datum/admin_rank |
rcd_result_with_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. |
rcd_scan | Global proc that generates RCD hologram in a range. |
read_sheet | Debug proc, for when lighting sheets fuck up Accepts the sheet (2 or 3 (multiz) dimensional list of lighting values at some offset) alongside x and y delta values and the sheet's "offset", which is the amount required to ensure everything indexes at 1 Optionally, you can pass similar values for multiz stuff |
realize_appearance_queue | Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected |
reciprocal_add | Takes two values x and y, and returns 1/((1/x) + y) Useful for providing an additive modifier to a value that is used as a divisor |
recover_all_SS_and_recreate_master | Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars |
recursive_list_resolve | Returns a list with all weakrefs resolved |
recursive_list_resolve_element | Helper for recursive_list_resolve() |
recursive_loc_check | Recursively checks if an item is inside a given type/atom, even through layers of storage. Returns the atom if it finds it. |
reject_bad_chattext | The procedure to check the text of the entered text on ntnrc_client.dm |
reject_bad_name | Filters out undesirable characters from names. |
reject_bad_text | Returns the text if properly formatted, or null else. |
relay_to_list_and_observers | Sends a message to everyone within the list, as well as all observers. |
remove_clunky_diagonals | Processes a path (list of turfs), removes any diagonal moves that would lead to a weird bump |
remove_diagonals | Processes a path (list of turfs), removes any diagonal moves |
remove_image_from_client | Removes an image from a client's .images . Useful as a callback. |
remove_image_from_clients | Like remove_image_from_client, but will remove the image from a list of clients |
remove_messenger | Unregisters an NTMessenger instance from the pda_messengers table. |
remove_non_dm_variants | Given a list and a list of its variant hints, removes any list key/values that are represent lua values that could not be directly converted to DM. |
remove_verb | handles removing verb and sending it to browser to update, use this for removing verbs |
rename_area | rename_area Renames an area to the given new name, updating all machines' names and firedoors to properly ensure alarms and machines are named correctly at all times. Args: |
replace_icon_legs | Modifies a sprite to replace the legs with a new version |
request_station_colors | Called by decals if they can be colored, to see if we got some cool colors for them. Only takes the first station trait |
request_z_pillar | Returns a z pillar to insert turfs into |
reset_cooldown | Proc used by stoppable timers to end a cooldown before the time has ran out. |
reset_religious_sect | Removes any existing religious sect from chaplains, allowing another to be selected |
resolve_ai_icon_sync | A form of resolve_ai_icon that is guaranteed to never sleep. Not always accurate, but always synchronous. |
retrieve_ban_cache | Gets the ban cache of the passed in client If the cache has not been generated, we start off a query If we still have a query going for this request, we just sleep until it's received back |
return_atmos_handbooks | Returns an assoc list of the gas handbook and the reaction handbook. For UIs, simply do data += return_atmos_handbooks() to use. |
return_generator_args | returns the arguments given to a generator and manually extracts them from the internal byond object returns: |
return_unused_frequency | returns a random unused frequency between MIN_FREE_FREQ & MAX_FREE_FREQ if free = TRUE, and MIN_FREQ & MAX_FREQ if FALSE |
reverse_angle | 180s an angle |
reverse_range | replaces reverseList ~Carnie |
rgb2hsv | Converts an rgb color into a list storing hsva Exists because it's useful to have a guaranteed alpha value |
rustg_get_version | Gets the version of rust_g |
rustg_git_commit_date | Returns the date of the given revision using the provided format. Defaults to returning %F which is YYYY-MM-DD. |
rustg_git_commit_date_head | Returns the formatted datetime string of HEAD using the provided format. Defaults to returning %F which is YYYY-MM-DD. This is different to rustg_git_commit_date because it only needs the logs directory. |
rustg_sound_length | Provided a static RSC file path or a raw text file path, returns the duration of the file in deciseconds as a float. |
rustg_unix_timestamp | Returns the timestamp as a string |
safe_read_pref | Safely read a given preference datum from a given client. |
sanitize | Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character. |
sanitize_color | Makes 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_name | Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts |
sanitize_filepath | Sanitizes the name of each node in the path. |
sanitize_frequency | Ensure the frequency is within bounds of what it should be sending/receiving at |
sanitize_name | 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. |
scramble_message_replace_chars | Slightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML! |
screen_loc_to_offset | Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc |
screen_loc_to_turf | Almost identical to the params_to_turf(), but unused (remove?) |
screen_text | Return an object with a new maptext (not currently in use) |
seedRuins | Loads the ruins for a given z level. @param z_levels The z levels to load ruins on. @param budget The budget to spend on ruins. Compare against the cost of the ruins in /datum/map_template/ruin. @param whitelist A list of areas to allow ruins to be placed in. @param potentialRuins A list of ruins to choose from. @param clear_below Whether to clear the area below the ruin. Used for multiz ruins. @param mineral_budget The budget to spend on ruins that spawn ore vents. Map templates with vents have that defined by mineral_cost. @param mineral_budget_update What type of ore distribution should spawn from ruins picked by this cave generator? This list is copied from ores_spawned.dm into SSore_generation.ore_vent_minerals. @param ruin_type The type of ruins that are spawning (ZTRAIT_SPACE_RUINS, ZTRAIT_ICE_RUINS, ZTRAIT_LAVA_RUINS, etc.) |
seedify | Finds and extracts seeds from an object |
select_hallucination_type | Helper to give the passed mob the ability to select a hallucination from the list of all hallucination subtypes. |
semver_to_list | Converts a semver string into a list of numbers |
send2adminchat | Asynchronously sends a message to TGS admin chat channels. |
send2chat | Asynchronously sends a message to TGS chat channels. |
send2otherserver | Sends a message to a set of cross-communications-enabled servers using world topic calls |
send_exported_map | A procedure for saving DMM text to a file and then sending it to the user. Arguments: |
send_fax_to_area | Sends a fax to a fax machine in an area! fax_area is a type, where all subtypes are also queried. If multiple machines, one is randomly picked If force is TRUE, we send a droppod with a fax machine and fax the message to that fax machine |
send_ooc_announcement | Sends a div formatted chat box announcement |
send_supply_pod_to_area | Easily send a supplypod to an area |
send_tip_of_the_round | 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. |
send_to_observers | Sends a message to all dead and observing players, if a source is provided a follow link will be attached. |
send_to_playing_players | sends a whatever to all playing players; use instead of to_chat(world, where needed) |
serialize_antag_name | Serializes an antag name to be used for preferences UI |
set_area_machinery_title | Renames all machines in a defined area from the old title to the new title. Used when renaming an area to ensure that all machiens are labeled the new area's machine. Args: |
set_dynamic_human_appearance | This proc gets an argument of a target and runs |
set_network_broadcast_status | Sets the camera network status on all entertainment monitors. A way to force a network to a status if you are unsure of the current state. |
set_new_religious_sect | Sets a new religious sect used by all chaplains int he round |
setupExports | Called when the global exports_list is empty, and sets it up. |
setup_mod_themes | Global proc that sets up all MOD themes as singletons in a list and returns it. |
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. |
shake_camera | 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. |
sheet2amount | Turns number of sheets into material amount, returning FALSE if the number is <= 0 |
should_visual_organ_apply_to | Some sanity checks, but mostly to check if the person has their preference/dna set to load |
shuffle | Randomize: Return the list in a random order |
shuffle_inplace | same as shuffle, but returns nothing and acts on list in place |
siunit | Formats a number to human readable form with the appropriate SI unit. |
siunit_isolated | Formats a number into a list representing the si unit. Access the coefficient with [SI_COEFFICIENT], and access the unit with [SI_UNIT]. |
siunit_pressure | |
slice_off_turfs | Returns a slice of a list of turfs, defined by the ones that are inside the inner/outer angle's bounds |
sm_gas_data | Return a list info of the SM gases. Can only run after init_sm_gas |
sortInsert | |
sortMerge | |
sortTim | |
sort_key | for sorting clients or mobs by ckey |
sort_list | sort any value in a list |
sort_mobs | Orders mobs by type then by name. Accepts optional arg to sort a custom list, otherwise copies GLOB.mob_list. |
sort_names | uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead |
sort_record | Specifically for record datums in a list. |
spanning_screen_loc | Returns a screen_loc format for a tiling screen objects from start and end positions. Start should be bottom left corner, and end top right corner. |
special_list_filter | Returns a list with items filtered from a list that can call callback |
spiral_range | similar function to range(), but with no limitations on the distance; will search spiralling outwards from the center |
spiral_range_turfs | similar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs) |
split_color | Given a color in the format of "#RRGGBB" or "#RRGGBBAA", gives back a 4 entry list with the number values of each |
split_materials_uniformly | divides a list of materials uniformly among all contents of the target_object recursively Used to set materials of printed items with their design cost by taking into consideration their already existing materials e.g. if 12 iron is to be divided uniformly among 2 objects A, B who's current iron contents are 3 & 7 Then first we normalize those values i.e. find their weights to decide who gets an higher share of iron total_sum = 3 + 7 = 10, A = 3/10 = 0.3, B = 7/10 = 0.7 Then we finally multiply those weights with the user value of 12 we get A = 0.3 * 12 = 3.6, B = 0.7 * 12 = 8.4 i.e. 3.6 + 8.4 = 12!! Off course we round the values so we don't have to deal with floating point materials so the actual value ends being less but that's not an issue Arguments |
spread_reagents | 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. |
stars | Convert random parts of a passed in message to stars |
start_broadcasting_network | Adds a camera network to all entertainment monitors. |
start_poll_cultists_for_leader | Start the poll for Cult Leaeder. |
start_unequip_mob | A utility function for /datum/strippable_item s to start unequipping an item from a mob. |
started_narsie_summon | When narsie begins to be summoned, slowly dim the saturation of parallax and starlight |
starts_with_any | Returns TRUE if the input_text starts with any of the beginnings |
stifled | For when you're only able to speak a limited amount of words phrase - the string to convert definitive_limit - the amount of words to limit the phrase to, optional |
stop_broadcasting_network | Removes a camera network from all entertainment monitors. |
stoplag | returns the number of ticks slept |
string_list | Caches lists with non-numeric stringify-able values (text or typepath). |
strip_appearance_underlays | Strips all underlays on a different plane from an appearance. Returns the stripped appearance. |
strip_html | Runs STRIP_HTML_SIMPLE and sanitize. |
strip_html_full | Runs STRIP_HTML_FULL and sanitize. |
stripped_input | Used to get a properly sanitized input. Returns null if cancel is pressed. |
stripped_multiline_input | Used to get a properly sanitized input in a larger box. Works very similarly to stripped_input. |
summon_events | Triggers Summon Events from [user]. If Summon Events has already been triggered, speeds up the event timer. |
summon_ghosts | Triggers Summon Ghosts from [user]. |
summon_guns | Triggers Summon Guns from [user]. Can optionally be passed [survivor_probability], to set the chance of creating survivalists. If Summon Guns has already been triggered, gives out guns to everyone again. |
summon_magic | Triggers Summon Magic from [user]. Can optionally be passed [survivor_probability], to set the chance of creating survivalists. If Summon Magic has already been triggered, gives out magic to everyone again. |
swap_range | 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 |
techweb_item_unlock_check | Returns an associative list of techweb node datums with values of the nodes it unlocks. |
test_whiteship_sizes | Helper proc that tests to ensure all whiteship templates can spawn at their docking port, and logs their sizes This should be a unit test, but too much of our other code breaks during shuttle movement, so not yet, not yet. |
tgalert | DEPRECATED: USE tgui_alert(...) INSTEAD |
tgm_encode | Takes a constant, encodes it into a TGM valid string |
tgui_Topic | Middleware for /client/Topic. |
tgui_alert | Creates a TGUI alert window and returns the user's response. |
tgui_input_checkboxes | |
tgui_input_keycombo | Creates a TGUI window with a key input. Returns the user's response as a full key with modifiers, eg ShiftK. |
tgui_input_list | Creates a TGUI input list window and returns the user's response. |
tgui_input_number | Creates a TGUI window with a number input. Returns the user's response as num | null. |
tgui_input_text | Creates a TGUI window with a text input. Returns the user's response. |
time_to_twelve_hour | 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. |
timeleft | Get the remaining deciseconds on a timer |
to_chat | Sends the message to the recipient (target). |
to_chat_immediate | Circumvents the message queue and sends the message to the recipient (target) as soon as possible. |
toggle_id_ctf | Proc that handles toggling and unloading CTF. |
tool_behaviour_name | returns an ic name of the tool needed Arguments: |
truncate | Truncate a string to the given length |
try_move_adjacent | Tries to move an atom to an adjacent turf, return TRUE if successful |
turf_peel | Behaves like the orange() proc, but only looks in the outer range of the function (The "peel" of the orange). This is useful for things like checking if a mob is in a certain range, but not within a smaller range. |
type_english_list | Returns a list of atom types in plain english as a string of each type name |
typecache_filter_list | returns a new list with only atoms that are in the typecache list |
typecache_filter_list_reverse | return a new list with atoms that are not in the typecache list |
typecache_filter_multi_list_exclusion | similar to typecache_filter_list and typecache_filter_list_reverse but it supports an inclusion list and and exclusion list |
typecacheof | Like typesof() or subtypesof(), but returns a typecache instead of a list. |
ui_status_only_living | Returns a UI status such that the dead will be able to watch, but not interact. |
ui_status_silicon_has_access | Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled. |
ui_status_user_has_free_hands | Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch. |
ui_status_user_is_abled | Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive. |
ui_status_user_is_adjacent | Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living ] check for finer observer interactions. |
ui_status_user_is_advanced_tool_user | Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch. |
ui_status_user_is_conscious_and_lying_down | Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise. |
ui_status_user_strictly_adjacent | Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise. |
unformat_frequency | Opposite of format, returns as a number |
unique_list | Return a list with no duplicate entries |
unique_list_in_place | same as unique_list, but returns nothing and acts on list in place (also handles associated values properly) |
unvalidated_client_error | Proc that just logs whenever an uninitialized client tries to do something before they have fully gone through New().
Intended to be used in conjunction with the VALIDATE_CLIENT_INITIALIZATION() macro, but can be dropped anywhere when we look at the fully_created var on /client. |
update_all_security_huds | Updates the visual security huds on all mobs in GLOB.human_list |
update_matching_security_huds | Updates the visual security huds on all mobs in GLOB.human_list that match the name passed to it. |
updatetimedelay | Update the delay on an existing LOOPING timer Will come into effect on the next process |
urange | ultra range (no limitations on distance, faster than range for distances > 8); including areas drastically decreases performance |
url2htmlloader | Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn. |
valid_build_direction | Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings. |
view_to_pixels | Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height) |
visible_hallucination_pulse | Emits a hallucinating pulse around the passed atom. Affects everyone in the passed radius who can view the center, except for those with TRAIT_MADNESS_IMMUNE, or those who are blind. |
weakrefify_list | Returns a copy of the list where any element that is a datum is converted into a weakref |
wear_digi_version | Modifies a sprite to conform to digitigrade body shapes |
wear_female_version | Modifies a sprite slightly to conform to female body shapes |
web_sound | Takes an input from either proc/play_web_sound or the request manager and runs it through yt-dlp and prompts the user before playing it to the server. |
weekday_to_iso | Returns a string day as an integer in ISO format 1 (Monday) - 7 (Sunday) |
weight_class_to_text | Returns a string based on the weight class define used as argument |
window_flash | Flash the window of a player |
woundscan | Displays wounds with extended information on their status vs medscanners |
write_map | Procedure for converting a coordinate-selected part of the map into text for the .dmi format |
zebra_typecacheof | 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. |
Var Details
Failsafe
Failsafe
Pretty much pokes the MC to make sure it's still alive.
Master
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
SSaccessories
subsystem that just holds lists of sprite accessories for accession in generating said sprites. A sprite accessory is something that we add to a human sprite to make them look different. This is hair, facial hair, underwear, mutant bits, etc.
SSacid
The subsystem used to tick /datum/component/acid instances.
SSai_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
SSai_controllers
The subsystem used to tick /datum/ai_controllers instances. Handling the re-checking of plans.
SSai_movement
The subsystem used to tick /datum/ai_movement instances. Handling the movement of individual AI instances
SSambience
The subsystem used to play ambience to users every now and then, makes them real excited.
SSarea_contents
Responsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed
SSasset_loading
Allows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init
SSaura
The subsystem used to tick auras (/datum/component/aura_healing and /datum/component/damage_aura).
SSban_cache
Subsystem that batches a ban cache list for clients on initialize This way we don't need to do ban checks in series later in the code
SSburning
The subsystem used to tick /datum/component/burning instances.
SScliff_falling
Subsystem to handle falling of off cliffs
SSclock_component
The subsystem used to tick /datum/component/acid instances.
SSdigital_clock
The subsystem used to tick digital clocks
SSdiscord
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:
- The file is loaded and the discord IDs are extracted
- A ping is sent to the discord with the IDs of people who wished to be notified
- The file is emptied
MIDROUND:
- Someone usees the notify verb, it adds their discord ID to the list.
- On fire, it will write that to the disk, as long as conditions above are correct
END ROUND:
- The file is force-saved, incase it hasn't fired at end round
This is an absolute clusterfuck, but its my clusterfuck -aa07
SSearly_assets
Initializes any assets that need to be loaded ASAP. This houses preference menu assets, since they can be loaded at any time, most dangerously before the atoms SS initializes. Thus, we want it to fail consistently in CI as if it would've if a player opened it up early.
SSescape_menu
Subsystem for controlling anything related to the escape menu
SSfishing
subsystem for the fishing minigame processing.
SSfluids
Fluid Subsystem
A subsystem that processes the propagation and effects of a particular fluid.
Both fluid spread and effect processing are handled through a carousel system. Fluids being spread and fluids being processed are organized into buckets. Each fresh (non-resumed) fire one bucket of each is selected to be processed. These selected buckets are then fully processed. The next fresh fire selects the next bucket in each set for processing. If this would walk off the end of a carousel list we wrap back to the first element. This effectively makes each set a circular list, hence a carousel.
SSfoam
The subsystem responsible for processing foam propagation and effects.
SShyperspace_drift
This subsystem handles the hyperspace shuttle pull movement loops
SSid_access
Non-processing subsystem that holds various procs and data structures to manage ID cards, trims and access.
SSinit_profiler
Subsystem exists so we can separately log init time costs from the costs of general operation Hopefully this makes sorting out what causes problems when easier
SSlag_switch
The subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience
SSlibrary
Manages library data, loading bookselves, etc
SSlooting
Queues image generation for search objects without icons
SSmouse_entered
Defers MouseEntered inputs to only apply to the most recently hovered over atom in the tick
SSnewtonian_movement
The subsystem is intended to tick things related to space/newtonian movement, such as constant sources of inertia
SSpathfinder
Queues and manages JPS pathfinding steps
SSpoints_of_interest
Subsystem for managing all POIs.
SSradioactive_nebula
Controls making objects irradiated when Radioactive Nebula is in effect.
SSsinguloprocess
Very rare subsystem, provides any active singularities with the timings and seclusion they need to succeed
SSsmoke
The subsystem responsible for processing smoke propagation and effects.
SSspatial_grid
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
SSspeech_controller
verb_manager subsystem just for handling say's
SStgui
tgui subsystem
Contains all tgui state and subsystem code.
SStimer
Timer Subsystem
Handles creation, callbacks, and destruction of timed events.
It is important to understand the buckets used in the timer subsystem are just a series of doubly-linked lists. The object at a given index in bucket_list is a /datum/timedevent, the head of a list, which has prev and next references for the respective elements in that bucket's list.
SStutorials
Namespace for housing code relating to giving contextual tutorials to users.
SSunplanned_controllers
Handles making mobs perform lightweight "idle" behaviors such as wandering around when they have nothing planned
SSverb_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 allotted 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 allotted 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 isn't 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 aren't riddled with minor hangs over and over again.
SSwardrobe
This subsystem strives to make loading large amounts of select objects as smooth at execution as possible It preloads a set of types to store, and caches them until requested Doesn't catch everything mind, this is intentional. There's many types that expect to either A: Not sit in a list for 2 hours, or B: have extra context passed into them, or for their parent to be their location You should absolutely not spam this system, it will break things in new and wonderful ways S close enough for government work though. Fuck you goonstation
SSweather
Used for all kinds of weather, ex. lavaland ash storms.
SSwiremod_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
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)
GetBestWeapon
Returns either the best weapon from the given choices or null if held weapons are better
GetTgsStealthKey
Gets TGS's stealth key, generates one if none is found
Gibberish
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.
HandleUserlessProcCall
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
HandleUserlessSDQL
Handles a userless sdql, used by circuits and tgs.
Arguments:
- user - a string used to identify the user
- query_text - the query text
IsEdible
returns 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 && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : text_ref(thing))
RoundDiagBar
Diagnostic HUDs!
WEAKREF
Creates a weakref to the given input. See /datum/weakref's documentation for more information.
WrapAdminProcCall
Wrapper for proccalls where the datum is flagged as vareditted
___TraitAdd
DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
___TraitRemove
DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
______qdel_list_wrapper
the underscores are to encourage people not to use this directly.
__check_serialization_semver
Checks if the actual semver is equal or later than the wanted semver Must be passed as TEXT; you're probably looking for CHECK_SERIALIZATION_SEMVER, look right above
_add_memory_in_range
Unless you need to use this for an explicit reason, use the add_memory_in_range macro wrapper.
_addtimer
Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.
Arguments:
- 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
_alert_drones
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_atom]
_animate_filter
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.
_export_loop
The main bit responsible for selling the item. Shared by export_single_item() and export_item_and_contents()
_malf_ai_undo_lockdown
For Lockdown malf AI ability. Opens all doors on the station.
_pick_list
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
_queue_verb
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.
_save_map
Hey bud don't call this directly, it exists so we can invoke async and prevent the buildmode datum being qdel'd from halting this proc
_stack_trace
gives us the stack trace from CRASH() without ending the current proc. Do not call directly, use the stack_trace macro instead.
above_neck
Would this zone be above the neck
actionspeed_data_null_check
Checks if a action speed modifier is valid and not missing any data
active_free_borgs
Silicon Mob Procs
add_image_to_client
Adds an image to a client's .images
. Useful as a callback.
add_image_to_clients
Like add_image_to_client, but will add the image from a list of clients
add_keybinding
Adds an instanced keybinding to the global tracker
add_lua_editor_variants
Given a list and a list of its variant hints, appends variants that aren't explicitly required by dreamluau, but are required by the lua editor tgui.
add_messenger
Registers an NTMessenger instance to the list of pda_messengers.
add_sabotage_machine
Marks a machine as a possible traitor sabotage target
add_to_signaler_investigate_log
Used to add a text log to the signaler investigation log. Do not add to the list directly; if the list is too large it can cause lag when an admin tries to view it.
add_verb
handles adding verbs and updating the stat panel browser
pass the verb type path to this instead of adding it directly to verbs so the statpanel can update Arguments:
- 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
admin_ticket_log
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
adminscrub
Runs STRIP_HTML_SIMPLE and byond's sanitization proc.
alert_to_permissions_elevation_attempt
Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc.
alone_in_area
Checks if the mob provided (must_be_alone) is alone in an area
amount2sheet
Turns material amount into the number of sheets, returning FALSE if the number is less than SHEET_MATERIAL_AMOUNT
Arguments:
- amt: amount to convert
announce_arrival
Send a message in common radio when a player arrives
anyprob
chances are 1:value. anyprob(1) will always return true
apply_dynamic_human_appearance
This exists to apply the icons async, as that cannot be done in Initialize because of possible sleeps.
apply_matrix_to_color
Applies a color filter to a hex/RGB list color
armor_to_protection_class
Rounds armor_value down to the nearest 10, divides it by 10 and then converts it to Roman numerals.
Arguments:
- armor_value - Number we're converting
armor_to_protection_name
Returns the client readable name of an armor type
Arguments:
- armor_type - The type to convert
assert_sorted
Runtimes if the passed in list is not sorted
assign_random_name
Generate a name devices
Creates a randomly generated tag or name for devices or anything really it keeps track of a special list that makes sure no name is used more than once
args:
- len (int)(Optional) Default=5 The length of the name
- prefix (string)(Optional) static text in front of the random name
- postfix (string)(Optional) static text in back of the random name Returns (string) The generated name
assoc_to_keys
Turns an associative list into a flat list of keys
assoc_to_keys_features
Turns an associative list into a flat list of keys, but for sprite accessories, respecting the locked variable
assoc_value_sum
Gets the total amount of everything in the associative list.
at_least
Takes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold
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
atmos_scan
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.
avoid_assoc_duplicate_keys
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
baseturfs_string_list
A wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues
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()]
bit_count
counts the number of bits in Byond's 16-bit width field, in constant time and memory!
bitfield_to_list
Converts a bitfield to a list of numbers (or words if a wordlist is provided)
blend_cutoff_colors
Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments
blend_screen_color
Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker
body_zone2cover_flags
For finding out what body parts a body zone covers, the inverse of the below basically
border_diamond_range_turfs
Returns the list of turfs around the outside of a center based on RANGE_TURFS()
build_chemical_reactions_lists
Chemical Reactions - Initialises all /datum/chemical_reaction into a list It is filtered into multiple lists within a list. For example: chemical_reactions_list_reactant_index/datum/reagent/toxin/plasma is a list of all reactions relating to plasma For chemical reaction list product index - indexes reactions based off the product reagent type - see get_recipe_from_reagent_product() in helpers For chemical reactions list lookup list - creates a bit list of info passed to the UI. This is saved to reduce lag from new windows opening, since it's a lot of data.
build_exploration_site_ui_data
Helper proc for exploration site listings in ui.
build_medicine_reagents
Just grab every craftable medicine you can think off
build_name2reagentlist
Builds map of reagent name to its datum path
build_planeed_apperance_queue
Takes a list of mutable appearances Returns a list in the form: 1 - a list of all mutable appearances that would need to be updated to change planes in the event of a z layer change, alnongside the commands required to properly track parents to update 2 - a list of all parents that will require updating
calculate_light_offset
Returns a list of x and y offsets to apply to our visual lighting position
calculate_projectile_angle_and_pixel_offsets
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.
calculate_tgm_header_index
Generates a key matching our index
callback_on_everyone_on_z
Invokes a callback on every living mob on the provided z level.
callback_select
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
camera_sort
Sorts the list of cameras by their c_tag to display to players.
can_see
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
censor_ic_filter_for_pdas
Given a pda message, will replace any match in the message with grawlixs.
center_image
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)
chatter_speak
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
check_asay_links
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
- Admin pings, like @adminckey. Pings the admin in question, text is not clickable
- Datum refs, like @0x2001169 or @mob_23. Clicking on the link opens up the VV for that datum
- 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
check_behind
Checks to see if atom/source
is behind atom/target
check_gases
A simple helped proc that checks if the contents of a list of gases are within acceptable terms.
Arguments:
- gases: The list of gases which contents are being checked
- gases to check: An associated list of gas types and acceptable boundaries in moles. e.g. /datum/gas/oxygen = list(16, 30)
-
- if the assoc list is null, then it'll be considered a safe gas and won't return FALSE.
- extraneous_gas_limit: If a gas not in gases is found, this is the limit above which the proc will return FALSE.
check_holidays
Checks that the passed holiday is located in the global holidays list.
Returns a holiday datum, or null if it's not that holiday.
check_pda_message_against_filter
Checks a PDA message against the IC/Soft IC filter. Returns TRUE if the message should be sent. Notifies the user passed in arguments if the message matched either filter.
check_target_facings
Returns the direction that the initiator and the target are facing
check_teleport_valid
Validates that the teleport being attempted is valid or not
check_topdown_validity
Checks if a passed in MA or atom is allowed to have its current plane/layer matchup
check_wall_item
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.
check_zone
Convert a PRECISE ZONE into the BODY_ZONE
chem_splash
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.
- adminlog: Whether to alert the admins that this has occured.
circle_range
Returns all atoms present in a circle around the center
circle_range_turfs
Returns a list of turfs around a center based on RANGE_TURFS()
circle_view
Returns all atoms present in a circle around the center but uses view() instead of range() (Currently not used)
circle_view_turfs
Returns a list of turfs around a center based on view()
cleanup_ghosts
Gives a farewell message and deletes the ghosts produced by a ghost portal structure.
Handles cleanup of all ghost mobs spawned a ghost portal. Iterates through the list and calls qdel on its contents, gives a short message, and leaves behind some goop. Stored as a global, as it is called immediately after the portal deletes itself.
- delete_list - The list of entities to be deleted by this proc.
cmp_assoc_list_name
Passed a list of assoc lists, sorts them by the list's "name" keys.
cmp_autowiki_fish_sources_content
Sort the autowiki fish entries by their weight. However, duds always come first.
cmp_bodypart_by_body_part_asc
Orders bodyparts by their body_part value, ascending.
cmp_crafting_req_priority
Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
Prioritises /datum/reagent to ensure reagent requirements are always processed first when crafting. This prevents any reagent_containers from being consumed before the reagents they contain, which can lead to runtimes and item duplication when it happens.
cmp_fish_fluid
Orders fish types following this order (freshwater -> saltwater -> anadromous -> sulphuric water -> any water -> air) If both share the same required fluid type, they'll be ordered by name instead.
cmp_heretic_knowledge
Orders heretic knowledge by priority
cmp_mob_health
Orders mobs by health
cmp_port_order_asc
Orders by integrated circuit weight
cmp_rped_sort
Sorts stock parts based on tier
cmp_uplink_category_desc
Orders by uplink category weight
color_to_full_rgba_matrix
Converts RGB shorthands into RGBA matrices complete of constants rows (ergo a 20 keys list in byond). if return_identity_on_fail is true, stack_trace is called instead of CRASH, and an identity is returned.
colorize_string
Gets a color for a name, will return the same color for a given string consistently within a round.atom
Note that this proc aims to produce pastel-ish colors using the HSL colorspace. These seem to be favorable for displaying on the map.
Arguments:
- name - The name to generate a color for
- sat_shift - A value between 0 and 1 that will be multiplied against the saturation
- lum_shift - A value between 0 and 1 that will be multiplied against the luminescence
compare_list
compare two lists, returns TRUE if they are the same
considered_afk
Checks if a player is considered AFK
considered_alive
Checks if the passed mind has a mob that is "alive"
- player_mind - who to check for alive status
- enforce_human - if TRUE, the checks fails if the mind's mob is a silicon, brain, or infectious zombie.
Returns TRUE if they're alive, FALSE otherwise
considered_escaped
Checks if the passed mind is considered "escaped".
Escaped mobs are used to check certain antag objectives / results.
Escaped includes minds with alive, non-exiled mobs generally.
Returns TRUE if they're a free person, or FALSE if they failed
considered_exiled
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.
construct_phobia_regex
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
convert_integer_to_words
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".
convert_ph_to_readable_color
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.
coords2turf
Converts a list of coordinates, or an assosciative list if passed, into a turf by calling locate(x, y, z) based on the values in the list
count_by_type
return the amount of items of the same type inside a list
create_announcement_div
Inserts a span styled message into an alert box div
Arguments
- message - required, the message contents
- color - optional, set a div color other than default
create_atmos_zone
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
create_basketball_game
Creates the global datum for playing basketball games, destroys the last if that's required and returns the new.
create_ctf_game
Creates a CTF game with the provided team ID then returns a reference to the new controller. If a controller already exists provides a reference to it.
create_delusion
Helper to give the passed mob the ability to create a delusion hallucination (even a custom one). Returns a list of arguments - pass these to _cause_hallucination to cause the desired hallucination
create_glass_styles
Constructs a nested list of glass style singletons
List format:
- list(glasses = list(beer = style datum, vodka = style datum), shot glasses = list(vodka = different style datum))
Where
- "glasses" and "shotglasses" are item typepaths
- "beer" and "vodka" are reagent typepaths
- "style datum" is a glass style singleton datum
Returns the list.
create_mafia_game
Creates the global datum for playing mafia games, destroys the last if that's required and returns the new.
create_ooc_announcement_div
Inserts a span styled message into an OOC alert style div
Arguments
- message - required, the message contents
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
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.
create_strippable_list
Creates an assoc list of keys to /datum/strippable_item
create_uplink_sales
Selects a set number of unique items from the uplink, and deducts a percentage discount from them
cult_ending_helper
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 its conclusion
cure_curse_of_babel
Mainly so admin triggered tower of babel can be undone
cut_relative_direction
Takes a screen_loc string and cut out any directions like NORTH or SOUTH
day_of_month
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
debug_hallucination_weighted_list
Debug proc for getting the total weight of the random_hallucination_weighted_list
debug_variable
Get displayed variable in VV variable list
deep_compare_list
Compares 2 lists, returns TRUE if they are the same
deep_copy_list
Copies a list, and all lists inside it recusively Does not copy any other reference type
default_ui_state
The sane defaults for a UI such as a computer or a machine.
delete_all_SS_and_recreate_master
Delete all existing SS to basically start over
delta_to_angle
Calculate the angle produced by a pair of x and y deltas
deltimer
Delete a timer
Arguments:
- id a timerid or a /datum/timedevent
deprecise_zone
Takes a zone and returns its "parent" zone, if it has one.
diagonally_blocked
check if 2 diagonal turfs are blocked by dense objects
diff_appearances
Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays
dir2offset
Returns a list(x, y), being the change in position required to step in the passed in direction
dir_to_all_junctions
Takes a direction, turns it into all the junctions that contain it
disambiguate_client
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
disease_air_spread_walk
Helper for checking if there is an air path between two turfs
diseasescan
Checks the individual for any diseases that are visible to the scanner, and displays the diseases in the attacked to the attacker.
dispatch_announcement_to_players
Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
should_play_sound
can also be a callback, if you want to only play the sound to specific players.
display_corners
Makes all lighting corners visible, debug to aid in understanding
display_energy
Format an energy value in prefixed joules. Arguments
- units - the value t convert
display_power
*Format a power value in prefixed watts.
- Converts from energy if convert is true.
- Args:
-
- power: The value of power to format.
-
- convert: Whether to convert this from joules.
-
- datum/controller/subsystem/scheduler: used in the conversion
- Returns: The string containing the formatted power.
doPortalSpawn
Spawns a portal storm that spawns in sentient/non sentient mobs portal_appearance is a list in the form (turf's plane offset + 1) -> appearance to use
do_after
Timed action involving one mob user. Target is optional.
Checks that user
does not move, change hands, get stunned, etc. for the
given delay
. Returns TRUE
on success or FALSE
on failure.
@param {mob} user - The mob performing the action.
@param {number} delay - The time in deciseconds. Use the SECONDS define for readability. 1 SECONDS
is 10 deciseconds.
@param {atom} target - The target of the action. This is where the progressbar will display.
@param {flag} timed_action_flags - Flags to control the behavior of the timed action.
@param {boolean} progress - Whether to display a progress bar / cogbar.
@param {datum/callback} extra_checks - Additional checks to perform before the action is executed.
@param {string} interaction_key - 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.
@param {number} max_interact_count - The maximum amount of interactions allowed.
@param {boolean} hidden - By default, any action 1 second or longer shows a cog over the user while it is in progress. If hidden is set to TRUE, the cog will not be shown.
do_chem_smoke
Helper to quickly create a cloud of reagent smoke
do_smoke
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.
do_sweep
Sweep objects in the direction we're facing towards our direction Arguments
- broomer - The object being used for brooming
- user - The person who is brooming
- target - The object or tile that's target of a broom click or being moved into
- sweep_dir - The directions in which we sweep objects
dump_in_space
Dump a movable in a random valid spacetile
duplicate_object
duplicate_object
Makes a copy of an item and transfers most vars over, barring GLOB.duplicate_forbidden_vars Args: original - Atom being duplicated spawning_location - Turf where the duplicated atom will be spawned at.
dview
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).
dyn_explosion
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.
- adminlog: Whether to log the explosion/report it to the administration.
- 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.
emissive_appearance
Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR.
emissive_blocker
Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR.
end_cooldown
Callback called by a timer to end an associative-list-indexed cooldown.
Arguments:
- source - datum storing the cooldown
- index - string index storing the cooldown on the cooldowns associative list
This sends a signal reporting the cooldown end.
end_message_delay
Simply resets the message delay and the recent messages list, to ensure that
recent messages can be sent again. Is called on a one second timer after a
delay is set, from /obj/machinery/telecomms/broadcaster/receive_information()
ending_helper
Helper to set the round to end asap. Current usage Cult round end code
endswith
Returns TRUE if the input_text ends with the ending
energy_to_power
Converts the joule to the watt, assuming SSmachines tick rate. Arguments
- joules - the value in joules to convert
- datum/controller/subsystem/scheduler - the subsystem whos wait time is used in the conversion
english_list
Returns a list in plain english as a string
expand_three_digit_color
Given a 3 character color (no hash), converts it into #RRGGBB (with hash)
expand_weights
Takes a weighted list (see above) and expands it into raw entries This eats more memory, but saves time when actually picking from it
explosion
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.
- adminlog: Whether to log the explosion/report it to the administration.
- 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.
- protect_epicenter: Whether to leave the epicenter turf unaffected by the explosion
- explosion_cause: [Optional] The atom that caused the explosion, when different to the origin. Used for logging.
- explosion_direction: The angle in which the explosion is pointed (for directional explosions.)
- explosion_arc: The angle of the arc covered by a directional explosion (if 360 the explosion is non-directional.)
export_single_item
It works like export_item_and_contents(), however it ignores the contents. Meaning only exported_atom
will be valued.
failed_narsie_summon
Summon failed, time to work backwards
fast_split_stack
Splits a stack. we don't use /obj/item/stack/proc/split_stack because Byond complains that should only be called asynchronously. This proc is also more faster because it doesn't deal with mobs, copying evidences or refreshing atom storages Has special internal uses for e.g. by the material container & RPED
Arguments:
- target: the stack to split
- [amount]: amount to split by
fill_holidays
Fills the holidays list if applicable, or leaves it an empty list.
fill_with_ones
Given a list, return a copy where values without defined weights are given weight 1. For example, fill_with_ones(list(A, B=2, C)) = list(A=1, B=2, C=1) Useful for weighted random choices (loot tables, syllables in languages, etc.)
filter_appearance_recursive
Recursively applies a filter to a passed in static appearance, returns the modified appearance
filter_name_ic
Helper proc to check if a name is valid for the IC filter
findTrueKey
Takes a stealthed ckey as input, returns the true key it represents
find_functional_ntnet_relay
Checks whether NTNet is available by ensuring at least one relay exists and is operational.
find_maintenance_spawn
Finds us a generic maintenance spawn location.
Goes through the list of the generic mainteance landmark locations, checking for atmos safety if required, and returns a valid turf. Returns MAP_ERROR if no valid locations are present. Returns nothing and alerts admins if no valid points are found. Keep this in mind when using this helper.
find_obstruction_free_location
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.
find_reagent
Returns reagent datum from typepath
find_record
Returns the first record in the list that matches the name
If locked_only is TRUE, locked records will be checked
If locked_only is FALSE, crew records will be checked
If no record is found, returns null
find_space_spawn
Finds us a generic spawn location in space.
Goes through the list of the space carp spawn locations, picks from the list, and returns that turf. Returns MAP_ERROR if no landmarks are found.
findname
Find if the message has the real name of any user mob in the mob_list
finish_equip_mob
A utility function for /datum/strippable_item
s to finish equipping an item to a mob.
finish_unequip_mob
A utility function for /datum/strippable_item
s to finish unequipping an item from a mob.
fire_curse_hand
Torment the target with a frightening hand
firing_squad
firing_squad is a proc for the :B:erforate smite to shoot each individual bullet at them, so that we can add actual delays without sleep() nonsense
Hilariously, if you drag someone away mid smite, the bullets will still chase after them from the original spot, possibly hitting other people. Too funny to fix imo
Arguments:
- 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
flash_color
Flash a color on the passed mob
flatten_list
Flattens a keyed list into a list of its contents
flick_overlay_global
Add an image to a list of clients and calls a proc to remove it after a duration
format_frequency
Format frequency by moving the decimal.
format_text
Properly format a string of text by using replacetext()
full_capitalize
Returns a string with the first letter of each word capitialized
gas_mixture_parser
- A simple rudimentary gasmix to information list converter. Can be used for UIs.
- Args:
-
- gasmix: /datum/gas_mixture
-
- 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.
gather_z_level_information
Returns all necessary z-level information. Argument append_grid
allows the user to see a table showing all of the z-level linkages, which is only visible and useful in-game.
generateStealthCkey
Hands back a stealth ckey to use, guarenteed to be unique
generate_adjacent_directions
Encodes connectivity between border objects Returns a list accessable by a border object's dir, the direction between it and a target, and a target Said list will return the direction the two objects connect, if any exists (if the target isn't a border object and the direction is fine, return the inverse of the direction in use)
generate_and_hash_rsc_file
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 don't have to be hashed twice
generate_asset_name
Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)
generate_autowiki_output
Returns a string of the autowiki output file
generate_bitfields
Turns /datum/bitfield subtypes into a list for use in debugging
generate_changeling_meteor
Receives a mob candidate, transforms them into a changeling, and hurls them at the station inside of a changeling meteor
Takes a given candidate and turns them into a changeling, generates a changeling meteor, and throws it at the station. Returns the changeling generated by the event, NOT the meteor. This is so that it plays nicely with the dynamic ruleset while still being usable in the ghost_role event as well.
Arguments:
- candidate - The mob (player) to be transformed into a changeling and meteored.
generate_chemwiki_line
Generate the big list of reagent based reactions. style='background-color:#FFEE88;'|{{anchor|Synthetic-derived growth factor}}Synthetic-derived growth factor▮
generate_cult_rune_types
Returns an associated list of rune types. [rune.cultist_name] = [typepath]
generate_generator_index
Creates generator__id => type map.
generate_hallucination_weighted_list
Generates the global weighted list of random hallucinations.
generate_icon_alpha_mask
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.
generate_items_inside
Creates new items inside an atom based on a list
generate_lazy_template_map
Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.
Screams if more than one key exists, loudly.
generate_map_list_from_directory
Returns a list of all maps to be found in the directory that is passed in.
generate_quirk_constant_data
Constructs [GLOB.all_quirk_constant_data] by iterating through a typecache of pregen data, ignoring abstract types, and instantiating the rest.
generate_random_name
Generate a random name based off of one of the roundstart languages
- gender - What gender to pick from. Picks between male, female if not provided.
- unique - If the name should be unique, IE, avoid picking names that mobs already have.
- list/language_weights - A list of language weights to pick from. If not provided, it will default to a list of roundstart languages, with common being the most likely.
generate_random_name_species_based
Generate a random name based off of a species This will pick a name from the species language, and avoid picking common if there are alternatives
- gender - What gender to pick from. Picks between male, female if not provided.
- unique - If the name should be unique, IE, avoid picking names that mobs already have.
- datum/species/species_type - The species to pick from
- include_all - Makes the generated name a mix of all the languages the species can speak rather than just one of them Does this on a per-name basis, IE "Lizard first name, uncommon last name".
generate_reagents_taste_message
Returns what this reagents in our given list taste like
Arguments:
- list/reagent_list - List of reagents to taste.
- mob/living/taster - Who is doing the tasting. Some mobs can pick up specific flavours.
- minimum_percent - The lower the minimum percent, the more sensitive the message is.
- weight_modifier - Value to multiply each reagent's taste weight with.
generate_selectable_species_and_languages
Generates species available to choose in character setup at roundstart
This proc generates which species are available to pick from in character setup. If there are no available roundstart species, defaults to human.
generate_space_underlay
Generates a space underlay for a turf This provides proper lighting support alongside just looking nice Accepts the appearance to make "spaceish", and the turf we're doing this for
generate_unique_announcement_header
Proc that just generates a custom header based on variables fed into priority_announce()
Will return a string.
generate_wound_series_collection
Generates [wound_series_collections] by iterating through all pregen_data. Refer to the mentioned list for documentation
generate_wound_static_data
Constructs [GLOB.all_wound_pregen_data] by iterating through a typecache of pregen data, ignoring abstract types, and instantiating the rest.
get
Returns the atom type in the specified loc
getFlatIcon
Create a single /icon from a given /atom or /image.
Very low-performance. Should usually only be used for HTML, where BYOND's appearance system (overlays/underlays, etc.) is not available.
Only the first argument is required.
get_active_player_count
Get active players who are playing in the round
get_adjacent_areas
Returns 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_areas
Returns a list with all the adjacent areas by getting the adjacent open turfs
get_adjacent_open_turfs
Returns a list with all the adjacent open turfs. Clears the list of nulls in the end.
get_airlock_overlay
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
get_all_slots
Get all possible organ slots by checking every organ, and then store it and give it whenever needed
get_allowed_instrument_ids
Get all non admin_only instruments as a list of text ids.
get_angle
Calculate the angle between two movables and the west|east coordinate
get_angle_raw
Angle between two arbitrary points and horizontal line same as /proc/get_angle
get_antag_minds
Returns MINDS of the assigned antags of given type/subtypes Supplying no antag type grants all minds with antag datums
get_area_name
Returns the name of the area the atom is in
get_areas_in_range
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
get_armor_by_type
Gets an armor type datum using the given type by formatting it into the expected datum tag
get_atom_on_turf
Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
Arguments
- 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).
get_bbox_of_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)
get_blueprint_data
get_blueprint_data Gets a list of turfs around a central turf and gets the blueprint data in a list Args:
- central_turf: The center turf we're getting data from.
- viewsize: The viewsize we're getting the turfs around central_turf of.
get_cached_actionspeed_modifier
Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!
get_cached_movespeed_modifier
Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!
get_camera_list
get_camera_list
Builds a list of all available cameras that can be seen to networks_available Args: networks_available - List of networks that we use to see which cameras are visible to it.
get_cardinal_dir
Get the cardinal direction between two atoms
get_chasm_category
Returns a key to store, remove and access fallen mobs depending on the z-level. This stops rescuing people from places that are waaaaaaaay too far-fetched.
get_chat_toggles
Get the given client's chat toggle prefs.
Getter function for prefs.chat_toggles which guards against null client and null prefs. The client object is fickle and can go null at times, so use this instead of directly accessing the var if you want to ensure no runtimes.
returns client.prefs.chat_toggles or FALSE if something went wrong.
Arguments:
- client/prefs_holder - the client to get the chat_toggles pref from.
get_chem_id
Returns reagent datum from reagent name string
get_closest_atom
Returns the closest atom of a specific type in a list from a source
get_consistent_feature_entry
Takes in an accessory list and returns the first entry from that list, ensuring that we dont return SPRITE_ACCESSORY_NONE in the process.
get_corresponding_wound_type
Searches through all wounds for any of proper type, series, and biostate, and then returns a single one via pickweight. Is able to discern between, say, a flesh slash wound, and a metallic slash wound, and will return the respective one for the provided limb.
The severity_max and severity_pick_mode args mostly exist in case you want a wound in a series that may not have your ideal severity wound, as it lets you essentially set a "fallback", where if your ideal wound doesnt exist, it'll still return something, trying to get closest to your ideal severity.
Generally speaking, if you want a critical/severe/moderate wound, you should set severity_min to WOUND_SEVERITY_MODERATE, severity_max to your ideal wound, and severity_pick_mode to WOUND_PICK_HIGHEST_SEVERITY - UNLESS you for some reason want the LOWEST severity, in which case you should set severity_max to the highest wound you're willing to tolerate, and severity_pick_mode to WOUND_PICK_LOWEST_SEVERITY.
Args:
- list/wounding_types: A list of wounding_types. Only wounds that accept these wound types will be considered.
- obj/item/bodypart/part: The limb we are considering. Extremely important for biostates.
- severity_min: The minimum wound severity we will search for.
- severity_max = severity_min: The maximum wound severity we will search for.
- severity_pick_mode = WOUND_PICK_HIGHEST_SEVERITY: The "pick mode" we will use when considering multiple wounds of acceptable severity. See the above defines.
- random_roll = TRUE: If this is considered a "random" consideration. If true, only wounds that can be randomly generated will be considered.
- duplicates_allowed = FALSE: If exact duplicates of a given wound on part are tolerated. Useful for simply getting a path and not instantiating.
- care_about_existing_wounds = TRUE: If we iterate over wounds to see if any are above or at a given wounds severity, and disregard it if any are. Useful for simply getting a path and not instantiating.
Returns: A randomly picked wound typepath meeting all the above criteria and being applicable to the part's biotype - or null if there were none.
get_ctf_voting_controller
Returns the existing /datum/ctf_voting_controller for the given ID, or makes one
get_dist_euclidean
Returns the distance between two atoms
get_dummy_savefile
Gets a dummy savefile for usage in icon generation. Savefiles generated from this proc will be empty.
get_dynamic_human_appearance
Creates a human with the given parameters and returns an appearance of it
get_edge_target_turf
Returns the turf located at the map edge in the specified direction relative to target_atom used for mass driver
get_element_by_var
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
get_first_open_turf_in_area
Iterates over all turfs in the target area and returns the first non-dense one
get_flat_existing_human_icon
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 and handle the caching yourself if you need to access that icon multiple times, or refactor this proc to feature caching of icons.
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.
get_flat_human_icon
If you already have a human and need to get its flat icon, call get_flat_existing_human_icon()
instead.
For creating consistent icons for human looking simple animals.
get_general_adminwho_information
Proc that gathers adminwho information for a general player, which will only give information if an admin isn't AFK, and handles potential fakekeying. Will return a list of strings.
get_hear
Like view but bypasses luminosity check
get_hearers_in_LOS
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
get_hearers_in_range
The exact same as get_hearers_in_view, but not limited by visibility. Does no filtering for traits, line of sight, or any other such criteria. Filtering is intended to be done by whatever calls this function.
This function exists to allow for mobs to hear speech without line of sight, if such a thing is needed.
- 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
get_hearers_in_view
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
get_icon_dimensions
Returns a list containing the width and height of an icon file
get_icon_dmi_path
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 ""
get_line
Get a list of turfs in a line from starting_atom
to ending_atom
.
Uses the ultra-fast Bresenham Line-Drawing Algorithm.
get_linked_admin_name
Proc that will return the applicable display name, linkified or not, based on the input client reference.
get_linked_z_angle
Gets the angle between two linked z-levels. Returns an angle (in degrees) if the z-levels are crosslinked/neighbors, or null if they are not.
Arguments:
- start: The starting Z level. Can either be a numeric z-level, or a /datum/space_level.
- end: The destination Z level. Can either be a numeric z-level, or a /datum/space_level.
get_list_of_admins
Proc that returns a list of cliented admins. Remember that this list can contain nulls! Also, will return null if we don't have any admins.
get_messenger_name
Get the display name of a messenger instance
get_messengers_sorted_by_job
Gets all messengers, sorted by their job
get_messengers_sorted_by_name
Gets all messengers, sorted by their name
get_mob_by_ckey
returns a mob type controlled by a specified ckey
get_mob_by_key
Return the mob type that is being controlled by a ckey
get_mob_or_brainmob
Returns the occupant mob or brain from a specified input
get_most_experienced
From a list of players (minds, mobs or clients), finds the one with the highest playtime (either from a specific role or overall living) and returns it.
get_nested_locs
Returns a list of all locations (except the area) the movable is within.
get_officer_departments
Returns the distribution of splitting the given security officers into departments. Return value is an assoc list of candidate => SEC_DEPT_*.
get_offset_target_turf
returns turf relative to target_atom offset in dx and dy tiles, bound to map limits
get_open_turf_in_dir
Returns the open turf next to the center in a specific direction
get_path_by_slot
Returns a generic path of the object based on the slot
get_path_to
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. It will yield until a path is returned, using magic
Arguments:
- requester: 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.
- access: A list representing what access we have and what doors we can open.
- simulated_only: Whether we consider tur fs 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_handling: defines how we handle diagonal moves. see __DEFINES/path.dm
get_perceived_radiation_danger
Gets the perceived "danger" of radiation pulse, given the threshold to the target. Returns a RADIATION_DANGER_* define, see code/__DEFINES/radiation.dm
get_perimeter
Get a list of turfs in a perimeter given the center_atom
and radius
.
Automatically rounds down decimals and does not accept values less than positive 1 as they don't play well with it.
Is efficient on large circles but ugly on small ones
Uses Jesko`s method to the midpoint circle Algorithm.
get_pixel_angle
for getting the angle when animating something's pixel_x and pixel_y
get_pixel_distance
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
get_player_client
Returns a client from a mob, mind or client
get_powernet_info_from_source
Extracts the powernet and cell of the provided power source
get_preferences_in_priority_order
Returns a flat list of preferences in order of their priority
get_rand_frequency
get a random frequency.
get_rand_frequency_low_range
get_rand_frequency but lower range.
get_random_coin
Gets a random coin excluding the blocked type and including extra coins which aren't pathed like coins.
get_random_drink
Gets a random drink excluding the blocked type
get_random_drink_id
Returns a random reagent consumable ethanol object minus blacklisted reagents
get_random_food
Get a random food item exluding the blocked ones
get_random_jumpskirt
Returns a random, acceptable jumpskirt typepath
get_random_jumpsuit
Returns a random, acceptable jumpsuit typepath
get_random_reagent_id
Returns a random reagent object, with the option to blacklist reagents.
get_random_station_turf
Returns a random turf on the station
get_random_valid_hallucination_subtype
Gets a random subtype of the passed hallucination type that has a random_hallucination_weight > 0. If no subtype is passed, it will get any random hallucination subtype that is not abstract and has weight > 0. This can be used instead of picking from the global weighted list to just get a random valid hallucination.
get_ranged_target_turf_direct
Get ranged target turf, but with direct targets as opposed to directions
Starts at atom starting_atom and gets the exact angle between starting_atom and target Moves from starting_atom with that angle, Range amount of times, until it stops, bound to map size Arguments:
- 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
get_reagent_type_from_product_string
Returns a list of chemical_reaction datums that have the input STRING as a product
get_recipe_from_reagent_product
Takes a type in and returns a list of associated recipes
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.
get_safe_random_station_turf
Returns a random turf on the station, excludes dense turfs (like walls) and areas that have valid_territory set to FALSE
get_selectable_species
Gets a list of all species id's available to choose in roundstart.
get_sensitive_adminwho_information
Proc that gathers adminwho information for admins, which will contain information on if the admin is AFK, readied to join, etc. Only arg is a list of clients to use. Will return a list of strings.
get_sfx
Used to convert a SFX define into a .ogg so we can add some variance to sounds. If soundin is already a .ogg, we simply return it
get_size_in_tiles
Returns the size of the sprite in tiles. Takes the icon size and divides it by the world icon size (default 32). This gives the size of the sprite in tiles.
@return size of the sprite in tiles
get_small_overlay
Fikou's fix for making toast alerts look nice - resets offsets, transforms to fit
get_sorted_areas
Returns a sorted version of GLOB.areas, by name
get_swarm_path_to
POTENTIALLY cheaper version of get_path_to This proc generates a path map for the end atom's turf, which allows us to cheaply do pathing operations "at" it Generation is significantly SLOWER then get_path_to, but if many things are/might be pathing at something then it is much faster Runs the risk of returning an suboptimal or INVALID PATH if the delay between map creation and use is too long
If no path was found, returns an empty list, which is important for bots like medibots who expect an empty list rather than nothing. It will yield until a path is returned, using magic
Arguments:
- requester: 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.
- age: How old a path map can be before we'll avoid reusing it. Use the defines found in code/__DEFINES/path.dm, values larger then MAP_REUSE_SLOWEST will be discarded
- access: A list representing what access we have and what doors we can open.
- simulated_only: Whether we consider tur fs 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.
get_teleport_loc
Returns location. Returns null if no location was found.
get_temp_change_amount
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 difference between two temperatures
- change_rate (optional)(Default: 0.06) The rate of range multiplier
get_turf_pixel
Lets the turf this atom's ICON appears to inhabit it takes into account: Pixel_x/y Matrix x/y NOTE: if your atom has non-standard bounds then this proc will handle it, but: if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked this may seem bad, but you're at least as close to the center of the atom as possible, better than byond's default loc being all the way off) if the bounds are odd, the true middle turf of the atom is returned
get_valid_screen_location
Returns a valid location to place a screen object without overflowing the viewport
- 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
get_visual_offset
Returns how visually "off" the atom is from its source turf as a list of x, y (in pixel steps) it takes into account: Pixel_x/y Matrix x/y Icon width/height
give_admin_popup
Tries to give the target an admin popup. If it fails, will send the error to the passed admin.
give_escape_menu_details
Provides a singleton for the escape menu details screen.
give_escape_menu_title
Provides a singleton for the escape menu details screen.
goonchem_vortex
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.
grawlix
Generate a grawlix string of length of the text argument.
greatest_common_factor
Takes a list of numbers as input, returns the highest value that is cleanly divides them all Note: this implementation is expensive as heck for large numbers, I only use it because most of my usecase Is < 10 ints
hallucination_pulse
Emits a hallucinating pulse around the passed atom. Affects everyone in the passed radius except for those with TRAIT_MADNESS_IMMUNE. This affects blind players.
center - required, the center of the pulse radius - the radius around that the pulse reaches hallucination_duration - how much hallucination is added by the pulse. reduced based on distance to the center. hallucination_max_duration - a cap on how much hallucination can be added optional_messages - optional list of messages passed. Those affected by pulses will be given one of the messages in said list.
haunt_outburst
Takes a given area and chance, applying the haunted_item component to objects in the area.
Takes an epicenter, and within the range around it, runs a haunt_chance percent chance of applying the haunted_item component to nearby objects.
- epicenter - The center of the outburst area.
- range - The range of the outburst, centered around the epicenter.
- haunt_chance - The percent chance that an object caught in the epicenter will be haunted.
- duration - How long the haunting will remain for.
healthscan
healthscan returns a list of everything a health scan should give to a player. Examples of where this is used is Health Analyzer and the Physical Scanner tablet app. Args: user - The person with the scanner target - The person being scanned mode - Uses SCANNER_CONDENSED or SCANNER_VERBOSE to decide whether to give a list of all individual limb damage advanced - Whether it will give more advanced details, such as husk source. tochat - Whether to immediately post the result into the chat of the user, otherwise it will return the results.
honkerblast
Unleashes a honkerblast similar to the honkmech weapon, but with more granular control.
hsv2rgb
Converts a list storing hsva into an rgb color
htmlrendertext
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"
icon2base64
Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)
icon2html
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
icon_exists
Checks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.
inLineOfSight
Calculate if two atoms are in sight, returns TRUE or FALSE
init_chemical_reagent_list
Initialises all /datum/reagent into a list indexed by reagent id
init_crafting_recipes
Inits crafting recipe lists
init_crafting_recipes_atoms
Inits atoms used in crafting recipes
init_export
Makes sure the exports list is populated and that the report isn't null.
init_gas_id_to_canister
Returns a map of canister id to its type path
init_hotspot_reactions
Returns reactions which will contribute to a hotspot's size.
init_keybindings
Creates and sorts all the keybinding datums
init_language_holder_prototypes
Inits the global list of language holder prototypes.
init_loadout_categories
Inits the global list of loadout category singletons Also inits loadout item singletons
init_pirate_gangs
initializes the pirate gangs glob list, adding all subtypes that can roll today.
init_subtypes_w_path_keys
Functions like init_subtypes, but uses the subtype's path as a key for easy access
init_surgeries
//Initial Building/////
Inits GLOB.surgeries
initialize_starting_knowledge
Returns a list of all heretic knowledge TYPEPATHS that have route set to PATH_START.
int_to_words
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".
invert_HTML_colour
Inverts the colour of an HTML string
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()
isAdminGhostAI
Returns TRUE/FALSE on whether the mob is an Admin Ghost AI. This requires this snowflake check because AI interact gives the access to the mob's client, rather than the mob like everyone else, and we keep it that way so they can't accidentally give someone Admin AI access.
isAdminObserver
Is the passed in mob a ghost with admin powers, doesn't check for AI interact like isAdminGhost() used to
is_admin
Returns if the given client is an admin, REGARDLESS of if they're deadminned or not.
is_banned_from
Checks client ban cache or, if it doesn't exist, queries the DB ban table to see if the player's ckey is banned from at least one of the provided roles.
Returns TRUE if the player matches with one or more role bans. Returns FALSE if the player doesn't match with any role bans. Possible errors states also return FALSE.
Args:
- player_key - Either key or ckey of the player you want to check for role bans.
- roles - Accepts either a single role string, or a list of role strings.
is_color_dark
Given a color in the format of "#RRGGBB", will return if the color is dark.
is_convertable_to_cult
Returns whether the given mob is convertable to the blood cult
is_ctf_target
Proc that identifies if something is a valid target for CTF related checks, checks if an object is a ctf barrier or has ctf component if they are a player.
is_guest_key
Returns whether or not a player is a guest using their ckey as an input
is_ic_filtered
Given 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_pdas
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.
is_infiltrator_docked_at_syndiebase
Returns whether or not syndicate operatives escaped.
is_matching_bait
Helper proc that checks if a bait matches identifier from fav/disliked bait list
is_on_a_planet
Checks if the passed non-area atom is on a "planet".
A planet is defined as anything with planetary atmos that has gravity, with some hardcoded exceptions.
- Nullspace counts as "not a planet", so you may want to check that separately.
- The mining z-level (Lavaland) is always considered a planet.
- The station z-level is considered a planet if the map config says so.
- Central Command is always not a planet.
- Syndicate recon outpost is always on a planet.
Returns TRUE if we are on a planet. Returns FALSE if we are not in a planet, or otherwise, "in space".
is_ooc_filtered
Given a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK.
is_path_in_list
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.
is_safe_turf
Checks if a given turf is a "safe" location
is_soft_ic_filtered
Given 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_pdas
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.
is_soft_ooc_filtered
Given 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_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
is_special_character
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 If allow_fake_antags is set to FALSE, Valentines, ERTs, and any such roles with FLAG_FAKE_ANTAG won't pass.
is_type_in_list
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.
is_type_on_turf
Checks whether or not a particular typepath or subtype of it is present on a turf
Returns the first instance located if an instance of the desired type or a subtype of it is found Returns null 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
is_valid_dmi_file
given a text string, returns whether it is a valid dmi icons folder path
is_valid_src
Check if a datum has not been deleted and is a valid source
is_valid_z_level
- 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.
is_within_radio_jammer_range
Checks if a given atom is in range of a radio jammer, returns TRUE if it is.
ishumanbasic
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.
iso_to_weekday
Returns an integer in ISO format 1 (Monday) - 7 (Sunday) as a string day
isolate_light
Hides all the lights around a source temporarially, for the sake of figuring out how bad a light bleeds (Except for turf lights, because they're a part of the "scene" and rarely modified)
isvineimmune
Used to determine whether the mob is immune to actions by the vine. Use cases: Stops vine from attacking itself, other plants.
join_admin_ranks
Takes a list of rank names and joins them with +
json_deserialize_datum
Convert a list of json to datum
json_serialize_datum
Convert a datum into a json blob
kvpify_list
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 and that unique objects with the same string representation do not produce duplicate keys that are clobbered by the standard JavaScript JSON.parse function
lavaland_equipment_pressure_check
Check if the turf pressure allows specialized equipment to work
lawid_to_type
returns the law datum with the lawid in question, law boards and law datums should share this id.
level_announce
Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.
library_updated
Increments every time WE update the library db table, causes all existing consoles to repull when they next check
lightningbolt
this is the actual bolt effect and damage, made into its own proc because it is used elsewhere
list_clear_empty_weakrefs
Removes any empty weakrefs from the list Returns TRUE if the list had empty refs, FALSE otherwise
list_clear_nulls
Removes any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise
living_player_count
Returns the amount of currently living players
load_admin_ranks
Loads admin ranks. Return a list containing the backup data if they were loaded from the database backup json
load_admins
(Re)Loads the admin list. returns TRUE if database admins had to be loaded from the backup json
load_adventures
Loads all adventures from DB
load_default_map_config
Proc that simply loads the default map config, which should always be functional.
load_map
Helper and recommened way to load a map file
- dmm_file: The path to the map file
- x_offset: The x offset to load the map at
- y_offset: The y offset to load the map at
- z_offset: The z offset to load the map at
- crop_map: If true, the map will be cropped to the world bounds
- measure_only: If true, the map will not be loaded, but the bounds will be calculated
- no_changeturf: If true, the map will not call /turf/AfterChange
- x_lower: The minimum x coordinate to load
- x_upper: The maximum x coordinate to load
- y_lower: The minimum y coordinate to load
- y_upper: The maximum y coordinate to load
- z_lower: The minimum z coordinate to load
- z_upper: The maximum z coordinate to load
- place_on_top: Whether to use /turf/proc/PlaceOnTop rather than /turf/proc/ChangeTurf
- new_z: If true, a new z level will be created for the map
load_map_config
Proc handling the loading of map configs. Will return the default map config using /proc/load_default_map_config if the loading of said file fails for any reason whatsoever, so we always have a working map for the server to run. Arguments:
- 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.
load_poll_data
Loads all current and future server polls and their options to store both as datums.
loadout_list_to_datums
Takes a list of paths (such as a loadout list) and returns a list of their singleton loadout item datums
loadout_list - the list being checked
Returns a list of singleton datums
log_access
Logging for logging in & out of the game, with error messages.
log_admin
General logging for admin actions
log_admin_circuit
Logging for admin actions on or with circuits
log_admin_private
General logging for admin actions
log_adminsay
Logging for AdminSay (ASAY) messages
log_asset
Logging for loading and caching assets
log_atmos
Logs the contents of the gasmix to the game log, prefixed by text
log_attack
Generic attack logging
log_bomber
Logging for bombs detonating
log_changeling_power
Logging for changeling powers purchased
log_chat
Logging for chatting on modular computer channels
log_combat
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
log_comment
Logging for newscaster comments
log_config
Logging for config errors Rarely gets called; just here in case the config breaks.
log_directed_talk
Helper for logging of messages with only one sender and receiver (i.e. mind links)
log_dsay
Logging for DeachatSay (DSAY) messages
log_dynamic
Logging for dynamic procs
log_emote
Logging for emotes
log_filter
Logs to the filter log with the given message, match, and scope
log_game
Logging for generic/unsorted game messages
log_heretic_knowledge
Logging for heretic powers learned
log_internet_request
Logging for music requests
log_job_debug
Logging for job slot changes
log_lua
Logging for lua scripting
log_malf_upgrades
Logging for upgrades purchased by a malfunctioning (or combat upgraded) AI
log_manifest
Logging for player manifest (ckey, name, job, special role, roundstart/latejoin)
log_mapping
Logging for mapping errors
log_mecha
Logging for mech actions
log_ooc
Logging for messages sent in OOC
log_paper
Logging for writing made on paper
log_pda
Logging for PDA messages sent
log_perf
Logging for game performance
log_played_names
Adds the new names to the player's played_names list on their /datum/player_details for use of admins.
ckey
should be their ckey, and data
should be an associative list with the keys being the names they played under and the values being the unique mob ID tied to that name.
log_prayer
Logging for prayed messages
log_qdel
Logging for hard deletes
log_radio_emote
Logging for emotes sent over the radio
log_research
Puts the text into the research html file, not log. See [INVESTIGATE_RESEARCH] for [/atom/proc/investigate_log]
log_say
Logging for generic spoken messages
log_shuttle
Logging for shuttle actions
log_speech_indicators
Logging for speech indicators.
log_spellbook
Logging for wizard powers learned
log_spy
Logs bounties completed by spies and their rewards
log_sql
Logging for DB errors
log_suspicious_login
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.
log_telecomms
Logging for speech taking place over comms, as well as tcomms equipment
log_tgui
Appends a tgui-related log entry. All arguments are optional.
log_tool
Logging for tool usage
log_topic
Logging for world/Topic
log_traitor
Logging for traitor objectives
log_transport
Logging for transport (tram/elevator) actions
log_uplink
Logging for items purchased from a traitor uplink
log_virus
Logging for the creation and contraction of viruses
log_vote
Logging for OOC votes
log_whisper
Logging for whispered messages
log_world
Log to both DD and the logfile.
log_wound
log_wound() is for when someone is attacked and suffers a wound. Note that this only captures wounds from damage, so smites/forced wounds aren't logged, as well as demotions like cuts scabbing over
Note that this has no info on the attack that dealt the wound: information about where damage came from isn't passed to the bodypart's damaged proc. When in doubt, check the attack log for attacks at that same time TODO later: Add logging for healed wounds, though that will require some rewriting of healing code to prevent admin heals from spamming the logs. Not high priority
Arguments:
- 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
los_check
Line of sight check! Spawns a dummy object and then iterates through each turf to see if it's blocked by something not handled by pass_args. Contains a mid_los_check, meant to be overriden by subtypes. args:
- user = Origin to start at.
- target = End point.
- pass_args = pass_flags given to dummy object to allow it to ignore certain types of blockades.
make_associative
Make a normal list an associative one
make_body
Uses stripped down and bastardized code from respawn character
make_datum_reference_lists
Legacy procs that really should be replaced with proper _INIT macros
make_into_clown
Helper proc that handles making someone into a clown after a bananium nuke goes off.
make_tuple
Returns the name of the mathematical tuple of same length as the number arg (rounded down).
material_insertion_animation
Creates a mutable appearance with the material color applied for its insertion animation into an autolathe or techfab Arguments
- material - the material used to generate the overlay
md5asfile
Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
md5filepath
Returns the md5 of a file at a given path.
message_centcom
Used by communications consoles to message CentCom
message_syndicate
Used by communications consoles to message the Syndicate
message_to_html
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.
Copyright (c) 2020 Aleksej Komarov SPDX-License-Identifier: MIT
minor_announce
Sends a minor annoucement to players. Minor announcements are large text, with the title in red and message in white. Only mobs that can hear can see the announcements.
message - the message contents of the announcement. title - the title of the announcement, which is often "who sent it". alert - whether this announcement is an alert, or just a notice. Only changes the sound that is played by default. html_encode - if TRUE, we will html encode our title and message before sending it, to prevent player input abuse. players - optional, a list mobs to send the announcement to. If unset, sends to all palyers. sound_override - optional, use the passed sound file instead of the default notice sounds. should_play_sound - Whether the notice sound should be played or not. This can also be a callback, if you only want mobs to hear the sound based off of specific criteria. color_override - optional, use the passed color instead of the default notice color.
mobs_in_area_type
Takes: list of area types Returns: all mobs that are in an area type
mouse_angle_from_client
Returns an angle in degrees relative to the position of the mouse and that of the client eye.
move_element
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
move_range
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
movespeed_data_null_check
Checks if a move speed modifier is valid and not missing any data
mutable_appearance
-
Helper similar to image()
-
icon - Our appearance's icon
-
icon_state - Our appearance's icon state
-
layer - Our appearance's layer
-
atom/offset_spokesman - An atom to use as reference for the z position of this appearance.
-
Only required if a plane is passed in. If this is not passed in we accept offset_const as a substitute
-
plane - The plane to use for the appearance. If this is not FLOAT_PLANE we require context for the offset to use
-
alpha - Our appearance's alpha
-
appearance_flags - Our appearance's appearance_flags
-
offset_const - A constant to offset our plane by, so it renders on the right "z layer"
narsie_apocalypse
Third crew last second win check and flufftext for [/proc/begin_the_end()]
narsie_end_begin_check
First crew last second win check and flufftext for [/proc/begin_the_end()]
narsie_end_second_check
Second crew last second win check and flufftext for [/proc/begin_the_end()]
narsie_last_second_win
Called only if the crew managed to destroy narsie at the very last second for [/proc/begin_the_end()]
narsie_start_destroy_station
security level and shuttle lockdowns for [/proc/begin_the_end()]
next_list_item
Returns the next item in a list
notify_ghosts
Fancy notifications for ghosts
The kitchen sink of notification procs
Arguments:
- message: The message displayed in chat.
- source: The source of the notification. This is required for an icon
- header: The title text to display on the icon tooltip.
- alert_overlay: Optional. Create a custom overlay if you want, otherwise it will use the source
- click_interact: If true, adds a link + clicking the icon will attack_ghost the source
- custom_link: Optional. If you want to add a custom link to the chat notification
- ghost_sound: sound to play
- ignore_key: Ignore keys if they're in the GLOB.poll_ignore list
- notify_volume: How loud the sound should be to spook the user
nuke_gib
Helper proc that handles gibbing someone who has been nuked.
nuke_request
Used by communications consoles to request the nuclear launch codes
objectify
"Turns" people into objects. Really, we just add them to the contents of the item.
offer_control
Offer control of the passed in mob to dead player
Automatic logging and uses poll_candidates_for_mob, how convenient
offset_to_screen_loc
Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope
overlays2text
Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get
parse_caught_click_modifiers
Returns a turf based on text inputs, original turf and viewing client
parse_slot_flags
Returns a list of strings for a given slot flag.
parse_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
partially_block_emissives
Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate
pass
A do nothing proc
path_map_passalong
We generate a path for the passed in callbacks, and then pipe it over
pathfinding_finished
Uses funny pass by reference bullshit to take the output created by pathfinding, and insert it into a return list We'll be able to use this return list to tell a sleeping proc to continue execution
pathwalk
Takes a directory and returns every file within every sub directory. If extensions_filter is provided then only files that end in that extension are given back. If extensions_filter is a list, any file that matches at least one entry is given back.
peek
Returns the top (last) element from the list, does not remove it from the list. Stack functionality.
permissive_sanitize_name
Much more permissive version of reject_bad_name(). Returns a trimmed string or null if the name is invalid. Allows most characters except for IC chat prohibited words.
pick_closest_path
Returns a chosen path that is the closest to a list of matches
pick_n_take
Pick a random element from the list and remove it from the list.
pick_weight
Picks a random element from a list based on a weighting system. For example, given the following list: A = 6, B = 3, C = 1, D = 0 A would have a 60% chance of being picked, B would have a 30% chance of being picked, C would have a 10% chance of being picked, and D would have a 0% chance of being picked. You should only pass integers in.
pick_weight_recursive
Like pick_weight, but allowing for nested lists.
For example, given the following list: list(A = 1, list(B = 1, C = 1)) A would have a 50% chance of being picked, and list(B, C) would have a 50% chance of being picked. If list(B, C) was picked, B and C would then each have a 50% chance of being picked. So the final probabilities would be 50% for A, 25% for B, and 25% for C.
Weights should be integers. Entries without weights are assigned weight 1 (so unweighted lists can be used as well)
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.
piglatin_sentence
runs piglatin_word()
proc on each word in a sentence. preserves caps and punctuation
piglatin_word
takes "word", and returns it piglatinized.
pixel_offset_turf
Takes a turf, and a list of x and y pixel offsets and returns the turf that the offset position best lands in
play_cinematic
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.
play_fov_effect
Plays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness
playsound
playsound is a proc used to play a 3D sound in a specific range. This uses SOUND_RANGE + extra_range to determine that.
Arguments:
- 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.
podspawn
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.
poll_cultists_for_leader
Polls all Cultists on whether the person putting themselves forward should be made the Cult Leader, if they can actually be such.
poll_holiday
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
pop
Returns the top(last) element from the list and removes it from the list (typical stack function)
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.
power_fail
Disable power in the station APCs
power_failure
Causes a power failure across the station.
All SMESs and APCs will be fully drained, and all areas will power down.
The drain is permanent (that is, it won't automatically come back after some time like the grid check event), but the crew themselves can return power via the engine, solars, or other means of creating power.
power_restore
Restores power to all rooms on the station.
Magically fills ALL APCs and SMESs to capacity, and restores power to depowered areas.
power_restore_quick
A quicker version of /proc/power_restore that only handles recharging SMESs.
This will also repower an entire station - it is not instantaneous like power restore, but it is faster performance-wise as it only handles SMES units.
Great as a less magical / more IC way to return power to a sapped station.
power_to_energy
Converts the watt to the joule, assuming SSmachines tick rate.
-
Arguments
-
joules - the value in joules to convert
-
datum/controller/subsystem/scheduler - the subsystem whos wait time is used in the conversion
prefix_zeros_to_number
Returns a text string containing N prefixed with a series of zeros with length equal to max_zeros minus log(10, N), rounded down.
prepare_explosion_turfs
Returns a list of turfs in X range from the epicenter Returns in a unique order, spiraling outwards This is done to ensure our progressive cache of blast resistance is always valid This is quite fast
prepare_infuser_entries
Global proc that sets up each /datum/infuser_entry sub-type as singleton instances in a list, and returns it.
prepare_lua_editor_list
Intermediate step for preparing lists to be passed into the lua editor tgui. Resolves weakrefs, converts some values without a standard textual representation to text, and can handle self-referential lists and potential duplicate output keys.
pretty_string_from_reagent_list
Input a reagent_list, outputs pretty readable text! Default output will be formatted as
-
water, 5 | silicon, 6 | soup, 4 | space lube, 8
-
names_only will remove the amount displays, showing
-
water | silicon | soup | space lube
-
join_text will alter the text between reagents
-
setting to ", " will result in
-
water, 5, silicon, 6, soup, 4, space lube, 8
-
final_and should be combined with the above. will format as
-
water, 5, silicon, 6, soup, 4, and space lube, 8
-
capitalize_names will result in
-
Water, 5 | Silicon, 6 | Soup, 4 | Space lube, 8
-
- use (reagents.reagent_list, names_only, join_text = ", ", final_and, capitalize_names) for the formatting
-
- Water, Silicon, Soup, and Space Lube
previous_list_item
Returns the previous item in a list
print_holiday
Does the same as /proc/poll_holiday, but prints the output to admins instead of returning it
print_language_list
Helper proc to print a list of languages in a human readable format
priority_announce
Make a big red text announcement to
Formatted like:
" Message from sender "
" Title "
" Text "
Arguments
- text - required, the text to announce
- title - optional, the title of the announcement.
- sound - optional, the sound played accompanying the announcement
- type - optional, the type of the announcement, for some "preset" announcement templates. See __DEFINES/announcements.dm
- sender_override - optional, modifies the sender of the announcement
- has_important_message - is this message critical to the game (and should not be overridden by station traits), or not
- players - a list of all players to send the message to. defaults to all players (not including new players)
- encode_title - if TRUE, the title will be HTML encoded
- encode_text - if TRUE, the text will be HTML encoded
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
propagate_network
remove the old powernet and replace it with a new one throughout the network.
qdel
Should be treated as a replacement for the 'del' keyword.
Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
radiation_pulse
Sends out a pulse of radiation, eminating from the source. Radiation is performed by collecting all radiatables within the max range (0 means source only, 1 means adjacent, etc), then makes their way towards them. A number, starting at 1, is multiplied by the insulation amounts of whatever is in the way (for example, walls lowering it down). If this number hits equal or below the threshold, then the target can no longer be irradiated. If the number is above the threshold, then the chance is the chance that the target will be irradiated. As a consumer, this means that max_range going up usually means you want to lower the threshold too, as well as the other way around. If max_range is high, but threshold is too high, then it usually won't reach the source at the max range in time. If max_range is low, but threshold is too low, then it basically guarantees everyone nearby, even if there's walls and such in the way, can be irradiated. You can also pass in a minimum exposure time. If this is set, then this radiation pulse will not irradiate the source unless they have been around any radioactive source for that period of time. The chance to get irradiated diminishes over range, and from objects that block radiation. Assuming there is nothing in the way, the chance will determine what the chance is to get irradiated from half of max_range. Example: If chance is equal to 30%, and max_range is equal to 8, then the chance for a thing to get irradiated is 30% if they are 4 turfs away from the pulse source.
ran_zone
Return the zone or randomly, another valid zone
probability controls the chance it chooses the passed in zone, or another random zone defaults to 80
random_bounty
-
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.
random_colour
Returns a random color picked from a list, has 2 modes (0 and 1), mode 1 doesn't pick white, black or gray
random_fish_type
Returns random fish, using random_case_rarity probabilities.
random_nukecode
Returns a string for a random nuke code
random_step
Forces the atom to take a step in a random direction
randomize_human
Fully randomizes everything about a human, including DNA and name.
randomize_human_normie
Randomizes a human, but produces someone who looks exceedingly average (by most standards).
(IE, no wacky hair styles / colors)
ranks_from_rank_name
Converts a rank name (such as "Coder+Moth") into a list of /datum/admin_rank
rcd_result_with_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.
rcd_scan
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
- fade_time - The time for RCD holograms to fade
read_sheet
Debug proc, for when lighting sheets fuck up Accepts the sheet (2 or 3 (multiz) dimensional list of lighting values at some offset) alongside x and y delta values and the sheet's "offset", which is the amount required to ensure everything indexes at 1 Optionally, you can pass similar values for multiz stuff
realize_appearance_queue
Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected
reciprocal_add
Takes two values x and y, and returns 1/((1/x) + y) Useful for providing an additive modifier to a value that is used as a divisor
recover_all_SS_and_recreate_master
Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars
recursive_list_resolve
Returns a list with all weakrefs resolved
recursive_list_resolve_element
Helper for recursive_list_resolve()
recursive_loc_check
Recursively checks if an item is inside a given type/atom, even through layers of storage. Returns the atom if it finds it.
reject_bad_chattext
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.
reject_bad_name
Filters out undesirable characters from names.
- strict - return null immediately 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.
reject_bad_text
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).
relay_to_list_and_observers
Sends a message to everyone within the list, as well as all observers.
remove_clunky_diagonals
Processes a path (list of turfs), removes any diagonal moves that would lead to a weird bump
path - The path to process down pass_info - Holds all the info about what this path attempt can go through simulated_only - If we are not allowed to pass space turfs avoid - A turf to be avoided
remove_diagonals
Processes a path (list of turfs), removes any diagonal moves
path - The path to process down pass_info - Holds all the info about what this path attempt can go through simulated_only - If we are not allowed to pass space turfs avoid - A turf to be avoided
remove_image_from_client
Removes an image from a client's .images
. Useful as a callback.
remove_image_from_clients
Like remove_image_from_client, but will remove the image from a list of clients
remove_messenger
Unregisters an NTMessenger instance from the pda_messengers table.
remove_non_dm_variants
Given a list and a list of its variant hints, removes any list key/values that are represent lua values that could not be directly converted to DM.
remove_verb
handles removing verb and sending it to browser to update, use this for removing verbs
pass the verb type path to this instead of removing it from verbs so the statpanel can update Arguments:
- 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
rename_area
rename_area Renames an area to the given new name, updating all machines' names and firedoors to properly ensure alarms and machines are named correctly at all times. Args:
- area_to_rename: The area that's being renamed.
- new_name: The name we're changing said area to.
replace_icon_legs
Modifies a sprite to replace the legs with a new version
request_station_colors
Called by decals if they can be colored, to see if we got some cool colors for them. Only takes the first station trait
request_z_pillar
Returns a z pillar to insert turfs into
reset_cooldown
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.
reset_religious_sect
Removes any existing religious sect from chaplains, allowing another to be selected
resolve_ai_icon_sync
A form of resolve_ai_icon that is guaranteed to never sleep. Not always accurate, but always synchronous.
retrieve_ban_cache
Gets the ban cache of the passed in client If the cache has not been generated, we start off a query If we still have a query going for this request, we just sleep until it's received back
return_atmos_handbooks
Returns an assoc list of the gas handbook and the reaction handbook. For UIs, simply do data += return_atmos_handbooks() to use.
return_generator_args
returns the arguments given to a generator and manually extracts them from the internal byond object returns:
- flat list of strings for args given to the generator.
- Note: this means things like "list(1,2,3)" will need to be processed
return_unused_frequency
returns a random unused frequency between MIN_FREE_FREQ & MAX_FREE_FREQ if free = TRUE, and MIN_FREQ & MAX_FREQ if FALSE
reverse_angle
180s an angle
reverse_range
replaces reverseList ~Carnie
rgb2hsv
Converts an rgb color into a list storing hsva Exists because it's useful to have a guaranteed alpha value
rustg_get_version
Gets the version of rust_g
rustg_git_commit_date
Returns the date of the given revision using the provided format. Defaults to returning %F which is YYYY-MM-DD.
rustg_git_commit_date_head
Returns the formatted datetime string of HEAD using the provided format. Defaults to returning %F which is YYYY-MM-DD. This is different to rustg_git_commit_date because it only needs the logs directory.
rustg_sound_length
Provided a static RSC file path or a raw text file path, returns the duration of the file in deciseconds as a float.
rustg_unix_timestamp
Returns the timestamp as a string
safe_read_pref
Safely read a given preference datum from a given client.
Reads the given preference datum from the given client, and guards against null client and null prefs. The client object is fickle and can go null at times, so use this instead of read_preference() if you want to ensure no runtimes.
returns client.prefs.read_preference(prefs_to_read) or FALSE if something went wrong.
Arguments:
- client/prefs_holder - the client to read the pref from
- datum/preference/pref_to_read - the type of preference datum to read.
sanitize
Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
sanitize_color
Makes 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_name
Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts
sanitize_filepath
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.
sanitize_frequency
Ensure the frequency is within bounds of what it should be sending/receiving at
sanitize_name
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.
scramble_message_replace_chars
Slightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML!
screen_loc_to_offset
Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc
screen_loc_to_turf
Almost identical to the params_to_turf(), but unused (remove?)
screen_text
Return an object with a new maptext (not currently in use)
seedRuins
Loads the ruins for a given z level. @param z_levels The z levels to load ruins on. @param budget The budget to spend on ruins. Compare against the cost of the ruins in /datum/map_template/ruin. @param whitelist A list of areas to allow ruins to be placed in. @param potentialRuins A list of ruins to choose from. @param clear_below Whether to clear the area below the ruin. Used for multiz ruins. @param mineral_budget The budget to spend on ruins that spawn ore vents. Map templates with vents have that defined by mineral_cost. @param mineral_budget_update What type of ore distribution should spawn from ruins picked by this cave generator? This list is copied from ores_spawned.dm into SSore_generation.ore_vent_minerals. @param ruin_type The type of ruins that are spawning (ZTRAIT_SPACE_RUINS, ZTRAIT_ICE_RUINS, ZTRAIT_LAVA_RUINS, etc.)
seedify
Finds and extracts seeds from an object
Checks if the object is such that creates a seed when extracted. Used by seed extractors or posably anything that would create seeds in some way. The seeds are dropped either at the extractor, if it exists, or where the original object was and it qdel's the object
Arguments:
- 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
select_hallucination_type
Helper to give the passed mob the ability to select a hallucination from the list of all hallucination subtypes.
semver_to_list
Converts a semver string into a list of numbers
send2adminchat
Asynchronously sends a message to TGS admin chat channels.
category - The category of the mssage. message - The message to send.
send2chat
Asynchronously sends a message to TGS chat channels.
message - The /datum/tgs_message_content 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.
send2otherserver
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
send_exported_map
A procedure for saving DMM text to a file and then sending it to the user. Arguments:
- user - a user which get map
- name - name of file + .dmm
- map - text with DMM format
send_fax_to_area
Sends a fax to a fax machine in an area! fax_area is a type, where all subtypes are also queried. If multiple machines, one is randomly picked If force is TRUE, we send a droppod with a fax machine and fax the message to that fax machine
send_ooc_announcement
Sends a div formatted chat box announcement
Formatted like:
" Server Announcement " (or sender_override)
" Title "
" Text "
Arguments
- text - required, the text to announce
- title - optional, the title of the announcement.
- players - optional, a list of all players to send the message to. defaults to the entire world
- play_sound - if TRUE, play a sound with the announcement (based on player option)
- sound_override - optional, override the default announcement sound
- sender_override - optional, modifies the sender of the announcement
- encode_title - if TRUE, the title will be HTML encoded (escaped)
- encode_text - if TRUE, the text will be HTML encoded (escaped)
send_supply_pod_to_area
Easily send a supplypod to an area
send_tip_of_the_round
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.
send_to_observers
Sends a message to all dead and observing players, if a source is provided a follow link will be attached.
send_to_playing_players
sends a whatever to all playing players; use instead of to_chat(world, where needed)
serialize_antag_name
Serializes an antag name to be used for preferences UI
set_area_machinery_title
Renames all machines in a defined area from the old title to the new title. Used when renaming an area to ensure that all machiens are labeled the new area's machine. Args:
- area_renaming: The area being renamed, which we'll check turfs from to rename machines in.
- title: The new name of the area that we're swapping into.
- oldtitle: The old name of the area that we're replacing text from.
set_dynamic_human_appearance
This proc gets an argument of a target and runs
set_network_broadcast_status
Sets the camera network status on all entertainment monitors. A way to force a network to a status if you are unsure of the current state.
- camera_net - The camera network ID to set on the monitors.
- is_show_active - Whether the show is active or not.
- announcement - Optional, what announcement to make. Note this announcement will be made regardless of the current state of the show: This means if it's currently on and you set it to on, the announcement will still be made. Likewise, there's no way to differentiate off -> on and on -> off, unless you handle that yourself.
set_new_religious_sect
Sets a new religious sect used by all chaplains int he round
setupExports
Called when the global exports_list is empty, and sets it up.
setup_mod_themes
Global proc that sets up all MOD themes as singletons in a list and returns it.
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.
shake_camera
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.
sheet2amount
Turns number of sheets into material amount, returning FALSE if the number is <= 0
Arguments:
- amt: amount to convert
should_visual_organ_apply_to
Some sanity checks, but mostly to check if the person has their preference/dna set to load
shuffle
Randomize: Return the list in a random order
shuffle_inplace
same as shuffle, but returns nothing and acts on list in place
siunit
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
siunit_isolated
Formats a number into a list representing the si unit. Access the coefficient with [SI_COEFFICIENT], and access the unit with [SI_UNIT].
Supports SI exponents between 1e-15 to 1e15, but properly handles numbers outside that range as well. 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. Returns: [SI_COEFFICIENT = si unit coefficient, SI_UNIT = prefixed si unit.]
siunit_pressure
- 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()
slice_off_turfs
Returns a slice of a list of turfs, defined by the ones that are inside the inner/outer angle's bounds
sm_gas_data
Return a list info of the SM gases. Can only run after init_sm_gas
sortInsert
Insertion Sort
Simple sorting algorithm that builds the final sorted list one item at a time.
@see
- https://en.wikipedia.org/wiki/Insertion_sort
sortMerge
Merge Sort
Divide and conquer sorting algorithm.
@see
- https://en.wikipedia.org/wiki/Merge_sort
sortTim
Tim Sort
Hybrid sorting algorithm derived from merge sort and insertion sort.
Sorts in place. You might not need to get the return value.
@see https://en.wikipedia.org/wiki/Timsort
@param {list} to_sort - The list to sort.
@param {proc} cmp - The comparison proc to use. Default: Numeric ascending.
@param {boolean} associative - Whether the list is associative. Default: FALSE.
@param {int} fromIndex - The index to start sorting from. Default: 1.
@param {int} toIndex - The index to stop sorting at. Default: 0.
sort_key
for sorting clients or mobs by ckey
sort_list
sort any value in a list
sort_mobs
Orders mobs by type then by name. Accepts optional arg to sort a custom list, otherwise copies GLOB.mob_list.
sort_names
uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead
sort_record
Specifically for record datums in a list.
spanning_screen_loc
Returns a screen_loc format for a tiling screen objects from start and end positions. Start should be bottom left corner, and end top right corner.
special_list_filter
Returns a list with items filtered from a list that can call callback
spiral_range
similar function to range(), but with no limitations on the distance; will search spiralling outwards from the center
spiral_range_turfs
similar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs)
split_color
Given a color in the format of "#RRGGBB" or "#RRGGBBAA", gives back a 4 entry list with the number values of each
split_materials_uniformly
divides a list of materials uniformly among all contents of the target_object recursively Used to set materials of printed items with their design cost by taking into consideration their already existing materials e.g. if 12 iron is to be divided uniformly among 2 objects A, B who's current iron contents are 3 & 7 Then first we normalize those values i.e. find their weights to decide who gets an higher share of iron total_sum = 3 + 7 = 10, A = 3/10 = 0.3, B = 7/10 = 0.7 Then we finally multiply those weights with the user value of 12 we get A = 0.3 * 12 = 3.6, B = 0.7 * 12 = 8.4 i.e. 3.6 + 8.4 = 12!! Off course we round the values so we don't have to deal with floating point materials so the actual value ends being less but that's not an issue Arguments
- [custom_materials][list] - the list of materials to set for the object
- multiplier - multiplier passed to set_custom_materials
- target_object - the target object who's custom materials we are trying to modify
spread_reagents
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.
- spread_range: The range in which to spread the reagents. Will not go over 20
stars
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
start_broadcasting_network
Adds a camera network to all entertainment monitors.
- camera_net - The camera network ID to add to the monitors.
- announcement - Optional, what announcement to make when the show starts.
start_poll_cultists_for_leader
Start the poll for Cult Leaeder.
start_unequip_mob
A utility function for /datum/strippable_item
s to start unequipping an item from a mob.
started_narsie_summon
When narsie begins to be summoned, slowly dim the saturation of parallax and starlight
starts_with_any
Returns TRUE if the input_text starts with any of the beginnings
stifled
For when you're only able to speak a limited amount of words phrase - the string to convert definitive_limit - the amount of words to limit the phrase to, optional
stop_broadcasting_network
Removes a camera network from all entertainment monitors.
- camera_net - The camera network ID to remove from the monitors.
- announcement - Optional, what announcement to make when the show ends.
stoplag
returns the number of ticks slept
string_list
Caches lists with non-numeric stringify-able values (text or typepath).
strip_appearance_underlays
Strips all underlays on a different plane from an appearance. Returns the stripped appearance.
strip_html
Runs STRIP_HTML_SIMPLE and sanitize.
strip_html_full
Runs STRIP_HTML_FULL and sanitize.
stripped_input
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.
stripped_multiline_input
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.
summon_events
Triggers Summon Events from [user]. If Summon Events has already been triggered, speeds up the event timer.
summon_ghosts
Triggers Summon Ghosts from [user].
summon_guns
Triggers Summon Guns from [user]. Can optionally be passed [survivor_probability], to set the chance of creating survivalists. If Summon Guns has already been triggered, gives out guns to everyone again.
summon_magic
Triggers Summon Magic from [user]. Can optionally be passed [survivor_probability], to set the chance of creating survivalists. If Summon Magic has already been triggered, gives out magic to everyone again.
swap_range
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
techweb_item_unlock_check
Returns an associative list of techweb node datums with values of the nodes it unlocks.
test_whiteship_sizes
Helper proc that tests to ensure all whiteship templates can spawn at their docking port, and logs their sizes This should be a unit test, but too much of our other code breaks during shuttle movement, so not yet, not yet.
tgalert
DEPRECATED: USE tgui_alert(...) INSTEAD
Designed as a drop in replacement for alert(); functions the same. (outside of needing User specified) Arguments:
- 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.
tgm_encode
Takes a constant, encodes it into a TGM valid string
tgui_Topic
Middleware for /client/Topic.
return bool If TRUE, prevents propagation of the topic call.
tgui_alert
Creates a TGUI alert window and returns the user's response.
This proc should be used to create alerts that the caller will wait for a response from. Arguments:
- 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.
tgui_input_checkboxes
tgui_input_checkbox
Opens a window with a list of checkboxes and returns a list of selected choices.
user - The mob to display the window to message - The message inside the window title - The title of the window list/items - The list of items to display min_checked - The minimum number of checkboxes that must be checked (defaults to 1) max_checked - The maximum number of checkboxes that can be checked (optional) timeout - The timeout for the input (optional)
tgui_input_keycombo
Creates a TGUI window with a key input. Returns the user's response as a full key with modifiers, eg ShiftK.
This proc should be used to create windows for key entry that the caller will wait for a response from. If tgui fancy chat is turned off: Will return a normal input.
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) key, shown as a placeholder.
tgui_input_list
Creates a TGUI input list window and returns the user's response.
This proc should be used to create alerts that the caller will wait for a response from. Arguments:
- 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.
tgui_input_number
Creates a TGUI window with a number input. Returns the user's response as num | null.
This proc should be used to create windows for number entry that the caller will wait for a response from. If tgui fancy chat is turned off: Will return a normal input. If a max or min value is specified, will validate the input inside the UI and ui_act.
Arguments:
- 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.
tgui_input_text
Creates a TGUI window with a text input. Returns the user's response.
This proc should be used to create windows for text entry that the caller will wait for a response from. If tgui fancy chat is turned off: Will return a normal input. If max_length is specified, will return stripped_multiline_input.
Arguments:
- 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.
time_to_twelve_hour
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.
timeleft
Get the remaining deciseconds on a timer
Arguments:
- id a timerid or a /datum/timedevent
to_chat
Sends the message to the recipient (target).
Recommended way to write to_chat calls:
to_chat(client,
type = MESSAGE_TYPE_INFO,
html = "You have found <strong>[object]</strong>")
to_chat_immediate
Circumvents the message queue and sends the message to the recipient (target) as soon as possible.
toggle_id_ctf
Proc that handles toggling and unloading CTF.
tool_behaviour_name
returns an ic name of the tool needed Arguments:
- tool_behaviour: the tool described!
truncate
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
try_move_adjacent
Tries to move an atom to an adjacent turf, return TRUE if successful
turf_peel
Behaves like the orange() proc, but only looks in the outer range of the function (The "peel" of the orange). This is useful for things like checking if a mob is in a certain range, but not within a smaller range.
@params outer_range - The outer range of the cicle to pull from. @params inner_range - The inner range of the circle to NOT pull from. @params center - The center of the circle to pull from, can be an atom (we'll apply get_turf() to it within circle_x_turfs procs.) @params view_based - If TRUE, we'll use circle_view_turfs instead of circle_range_turfs procs.
type_english_list
Returns a list of atom types in plain english as a string of each type name
typecache_filter_list
returns a new list with only atoms that are in the typecache list
typecache_filter_list_reverse
return a new list with atoms that are not in the typecache list
typecache_filter_multi_list_exclusion
similar to typecache_filter_list and typecache_filter_list_reverse but it supports an inclusion list and and exclusion list
typecacheof
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.
ui_status_only_living
Returns a UI status such that the dead will be able to watch, but not interact.
ui_status_silicon_has_access
Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.
ui_status_user_has_free_hands
Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.
ui_status_user_is_abled
Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacent
Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living
] check for finer observer interactions.
ui_status_user_is_advanced_tool_user
Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_is_conscious_and_lying_down
Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacent
Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
unformat_frequency
Opposite of format, returns as a number
unique_list
Return a list with no duplicate entries
unique_list_in_place
same as unique_list, but returns nothing and acts on list in place (also handles associated values properly)
unvalidated_client_error
Proc that just logs whenever an uninitialized client tries to do something before they have fully gone through New().
Intended to be used in conjunction with the VALIDATE_CLIENT_INITIALIZATION()
macro, but can be dropped anywhere when we look at the fully_created
var on /client.
update_all_security_huds
Updates the visual security huds on all mobs in GLOB.human_list
update_matching_security_huds
Updates the visual security huds on all mobs in GLOB.human_list that match the name passed to it.
updatetimedelay
Update the delay on an existing LOOPING timer Will come into effect on the next process
Arguments:
- id a timerid or a /datum/timedevent
- new_wait the new wait to give this looping timer
urange
ultra range (no limitations on distance, faster than range for distances > 8); including areas drastically decreases performance
url2htmlloader
Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
valid_build_direction
Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings.
Returns FALSE if the target turf cannot accept a directional construction. Returns TRUE otherwise.
Arguments:
- dest_turf - The destination turf to check for existing directional constructions
- 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.
view_to_pixels
Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)
visible_hallucination_pulse
Emits a hallucinating pulse around the passed atom. Affects everyone in the passed radius who can view the center, except for those with TRAIT_MADNESS_IMMUNE, or those who are blind.
center - required, the center of the pulse radius - the radius around that the pulse reaches hallucination_duration - how much hallucination is added by the pulse. reduced based on distance to the center. hallucination_max_duration - a cap on how much hallucination can be added optional_messages - optional list of messages passed. Those affected by pulses will be given one of the messages in said list.
weakrefify_list
Returns a copy of the list where any element that is a datum is converted into a weakref
wear_digi_version
Modifies a sprite to conform to digitigrade body shapes
wear_female_version
Modifies a sprite slightly to conform to female body shapes
web_sound
Takes an input from either proc/play_web_sound or the request manager and runs it through yt-dlp and prompts the user before playing it to the server.
weekday_to_iso
Returns a string day as an integer in ISO format 1 (Monday) - 7 (Sunday)
weight_class_to_text
Returns a string based on the weight class define used as argument
window_flash
Flash the window of a player
woundscan
Displays wounds with extended information on their status vs medscanners
write_map
Procedure for converting a coordinate-selected part of the map into text for the .dmi format
zebra_typecacheof
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.