/(global) 
Vars | |
| Debugger | The debugger instance. This is a GLOBAL_REAL because it initializes before the MC or GLOB. Really only used to check to see if the debugger is enabled or not, and to separate debugger-related code into its own thing. |
|---|---|
| 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_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). |
| SSautomapper | The AUTOMAPPER |
| 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 |
| SSblood_drying | Blood Drying SS Used as a low priority background system to handling the drying of blood on the ground (basically just handles reducing their bloodiness value over time) |
| SSburning | The subsystem used to tick /datum/component/burning instances. |
| SScameras | Manages the security cameras and camera chunks |
| SScharacter_preview | Starts character preview drawings, and rebuilds preview mobs in turn when many change at once. |
| SScliff_falling | Subsystem to handle falling of off cliffs |
| SSclock_component | The subsystem used to tick /datum/component/acid instances. |
| SScustom_sprite_work | Keeps the custom sprite editors cheap for the server, whatever a window sends. |
| SScyborg_layout_saves | Saves cyborg layout accounts in tick time other subsystems leave over. |
| SSdigital_clock | The subsystem used to tick digital clocks |
| SSdirt | Makes the masks mess is drawn with, a piece at a time, in the tick time other subsystems leave over, and keeps the newest of them. |
| 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. |
| SSgarment_fitting | Makes the garment fits bodies wait for, a piece at a time, in the tick time other subsystems leave over. |
| SSgraffiti | The graffiti on the current map: the art and placements its file keeps, which of them show this round, and the sheet files they show from. |
| 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 |
| SSlow_priority_ai_controllers | Plans background controllers that are active when unwatched but not critical |
| 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 |
| SSsymphony | Safety net for revokes we never heard about. |
| SStgui | tgui subsystem |
| SSticket_ping | Pings admins every (time chosen in config) for all open tickets/OPFOR applications |
| SStimer | |
| SSturrets | The subsystem used for portable turrets, as they're relatively more intensive compared to most other machines, so we don't want them hogging tick usage from everything else. |
| SStutorials | Namespace for housing code relating to giving contextual tutorials to users. |
| 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 |
| Tracy | The byond-tracy instance. This is a GLOBAL_REAL because it is the VERY FIRST THING to initialize, even before the MC or GLOB. |
| _bitfield_bot_access_flags | bitfield, used by basic bots, for our access flags |
| _bitfield_bot_cover_flags | bitfield, used by simple bots, for our access flags |
| _bitfield_covered_slots | Mob covered flags |
| _bitfield_flags_inv | Item obscured flags |
| _bitfield_no_equip_flags | Inventory slots that can be blacklisted by a species from being equipped into |
| _bitfield_obscured_slots | Mob obscured flags |
| _bitfield_transparent_protection | Item coverage flags |
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. |
| ISOtime | returns timestamp in a sql and a not-quite-compliant ISO 8601 friendly format. Do not use for SQL, use NOW() instead |
| 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)) |
| RangedReachCheck | Called by IsReachableBy() to check for ranged reaches. |
| 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. |
| aas_config_announce | Announces the provided message with the provided variables and config entry type. Only aas_config_entry_type and variables_map are mandatory. Other args are optional. |
| 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_girder_wall_recipe | Adds a new /datum/girder_wall_recipe instance to the given recipe list from the given recipe arguments. |
| 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_minimap_blip | Create a minimap blip on the z-level in question, object is optional, and will tie the blip to the object in question, and will clean up itself if the object in question is deleted |
| add_personality_mood_to_viewers | Iterates over all mobs that can see the passed movable and adds specific mood events to them based on their personalities. |
| add_recipes_to_sublist | Add a list of recipes to an existing recipe sublist. |
| add_startup_message | Adds a startup message to the splashscreen. |
| 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. |
| adult_items_gated_types | Each adult items family's top types, one line per family. The adult_items_kill_switch unit test checks every
concrete subtype. |
| ai_eye_turf_in_view | AI can also see emotes! |
| ai_toggle_hiding | Shared logic for actually flipping a mob's hidden state. Used by both the explicit toggle_hiding leaf and the random_hiding decision leaf. |
| alert_sound_to_playing | This is quite franlky the most important proc relating to global sounds, it uses area definition to play sounds depending on your location, and respects the players announcement volume. Generally if you're sending an announcement you want to use priority_announce. |
| alert_to_permissions_elevation_attempt | Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc. |
| all_junctions_of_dir | Takes a direction, turns it into all the junctions that it lines up with |
| 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_active_reta_grants_to_card | Applies any currently active RETA grants to a newly created/spawned ID card This should be called when ID cards are created, spawned, or have their trim changed |
| apply_cyborg_customization | Preference application is separate from model selection, hardware, laws and names. |
| apply_dynamic_human_appearance | This exists to apply the icons async, as that cannot be done in Initialize because of possible sleeps. |
| apply_icon_mask | A simple helper proc to apply a mask to an icon Arguments: |
| apply_matrix_to_color | Applies a color filter to a hex/RGB list color |
| apply_message_emphasis | Replaces player chat emphasis characters with the corresponding HTML tags in the input string. |
| 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 |
| assemble_body_markings_from_set | Builds a new collection wearing a marking set: each of its markings on every zone the marking claims, in the set's order. |
| 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_to_values | Turns an associative list into a flat list of values |
| 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. |
| augment_paint_matrix | Returns a recolourable finish's colour matrix for one of its packed states: numeric and 4x4, rows red, green, blue, alpha, as Nova's naga tail builds its (constrict.dm). Never rows of colour strings, which map_colors_inferred() can't flatten for the drawn character preview. Each is built once and kept, by colours, state and alpha, until AUGMENT_PAINT_MATRIX_CACHE_SIZE are kept; then the cache is emptied before the next is added, since a player can apply colours without end. A matrix is cheap to build again, and a limb keeps the one it was given. |
| autopunct_bare | Ensures sentences end in appropriate punctuation (a period if none exist) and that all whitespace-bounded 'i' characters are capitalized. If the sentence ends in chat-flavored markdown for bolds, italics or underscores and does not have a preceding period, exclamation mark or other flavored sentence terminator, add a period. (e.g: 'Borgs are rogue' becomes 'Borgs are rogue.', '+BORGS ARE ROGUE+ becomes '+BORGS ARE ROGUE+.', '+Borgs are rogue~+' is untouched.) |
| 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_color | Blend two colors using the normal blend mode of the CSS compositing algorithm |
| 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 |
| blend_weighted_lists | |
| body_marking_collection_from_list | The tolerant loader for the nested shape preferences.json stores: zone -> (marking name -> list(color, emissive)). |
| body_marking_colors_old_set_names | What each of the seven species that had a randomiser of its own could pick, as those get_random_body_markings() overrides were written before get_random_marking_sets() replaced them: a forced set, a fixed list to pick from, or the sets meant for any species or for this one. Kept here, and nowhere in the game, as the reference. |
| body_marking_colors_scanned_set | The marking set factory as it was before it read each marking's affected_bodyparts: every member against every zone's marking list, in GLOB.body_markings_per_limb order. Colours come from seed_color(), the only colour source there is now, so comparing the two compares which entries land on which zones, in what order. |
| body_marking_compat_full | Saved marking maps exactly as preferences.json holds them, written out by hand so no loader or serializer change can regenerate them. Every zone wears the fixture's markings (body_marking_fixture.dm), each of which claims all eight zones, in an order no zone list or marking list sorts into, with glow mixed. |
| body_marking_compat_round_trip | Loads a saved marking map the way a character load does and writes it back the way a save does. |
| body_marking_entries_cache_key | Returns a string standing for a list of entries, in order, with their colours and glow. |
| body_marking_entries_copy | Copies a list of entries into new ones, as deep_copy_list() copied the nested shape. |
| body_marking_entries_from_list | Builds new entries for one zone from its nested shape: marking name -> list(color, emissive). |
| body_marking_entries_to_list | Rebuilds one zone's nested shape from its entries: marking name -> list(color, emissive). |
| body_marking_rename_retired | Renames retired marking names in the nested shape preferences.json stores, zone by zone and in place, by GLOB.body_marking_renames. A zone holding a retired name and the name it became wears the same art twice, so it keeps one entry: the later one, which drew on top, in its place and colour, glowing if either glowed, as the lower one's glow showed through a top one that didn't glow. A zone with nothing to rename is left as it is. |
| body_marking_set_types_for_species | Returns the body marking sets meant for any species or for this one, the "None" set included. |
| body_marking_sheet_size | Returns the size of a body marking sheet as "[width]x[height]", read once per sheet. moth_markings.dmi is 45x34, every other sheet 32x32. Null for an icon built at runtime, whose text names no file ("/icon" for every one), so a content key could not tell two apart. |
| body_marking_sheets_blend | Returns whether markings on two sheets can blend into one icon: sheets of one size, and never an icon built at runtime. |
| body_markings_of_zone_for_species | The body markings a zone offers a species: all of them with mismatched parts, otherwise those meant for any species or this one. |
| 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() |
| bug_report_blank | Whether a field counts as empty, by the same rule as the reporting service. |
| bug_report_bridge_origin | Returns the configured bridge address when it's a loopback one on this machine, the only kind we ever talk to, otherwise null |
| bug_report_budget | Spends one of a ckey's hourly allowances, mirroring the reporting service's own caps. |
| bug_report_budget_fill | Spends what's left of a ckey's hourly allowance of one kind, for when the reporting service says it's all used. |
| bug_report_cleanup_temporary | Removes staged screenshot files a day old or more, at most once an hour. |
| bug_report_context_snapshot | Freezes what the game looked like for a report, as plain values the bridge stores as they are. |
| bug_report_image_name | Whether a file name is one of the image types the reporting service decodes |
| bug_report_temporary_path | A fresh generated path for a staged screenshot file, sweeping old ones now and then |
| bug_report_uses_left | Counts what's left of a ckey's hourly allowance of one kind, forgetting uses over an hour old. |
| bug_reports_enabled | Whether reports go to the reporting bridge, which only ever means the one on this machine |
| 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_mutant_part | Factory helper proc for creating and returning a new mutant_bodypart datum. |
| build_name2neurowarelist | Same as build_name2reagentlist() but contains only neuroware reagents. |
| build_name2neurowarelist_safe | Same as build_name2neurowarelist() but omits aphrodisiacs. |
| 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 |
| bulge_adaptive | bulge_v4.adaptive(cloth, finish, toned = TRUE): the five kinds f, h, H, s, d as lists of three channels. |
| bulge_blank_tile | A transparent 32x32 tile in one direction, loaded once; copy it with icon() before drawing on it. |
| bulge_clearance | Where a skirt's shaft shows through the cloth: the anatomy clearance mask (a /datum/bulge_sheet_state) for an identity, or null when the family has none there. Named as the skirt's shape without its legs, in skirt_clearance.dmi: a clearance is the same on plain and digitigrade legs. With a clearance the anatomy is drawn behind the skirt and, inside the mask, above its cloth; an empty mask shows none of it above. |
| bulge_clipped_icon | Returns a sprite kept only inside a shape's pixels (what a cover draws over itself, kept to a look's cloth): the sprite's frames times the template's union mask (bulge_template_masks()), as one registered icon whose state "" faces all four ways. The image drawing it keeps the sprite's own colour. Cached on the template by sprite and state; null when the state is missing or not 32x32, or the template has no pixels. |
| bulge_cover_family | The family a cover garment bulges with, or null. |
| bulge_cover_layer | The layer a cover garment is drawn at: an underclothes accessory's own, else its drawn appearance's. |
| bulge_cover_printed | Whether a cover garment's own print carries onto its bulge. |
| bulge_cover_slot | The overlays_standing slot a cover garment is drawn in, or null. |
| bulge_cut_cover_flap | Returns the cover garment with a flap cut away: its sprite with every pixel of the flap made transparent (the lifted part of a revealing skirt's hem), as one registered icon whose state "" faces all four ways; nothing is cut facing north. One flap serves every garment with that hem. Cached like a patch; null when the sprite is not a 32x32 resource or has no such state. |
| bulge_cut_cover_patch | Returns a loincloth with its lifted flap cut away: its sprite kept only where the cut's keep mask (bulge_patch_keep()) is opaque, as one registered icon whose state "" faces all four ways. Only the mask's alpha is used, so the wearer's own garment pixels stay. Cached like a patch; null when the sprite is not a 32x32 resource or has no such state. |
| bulge_cut_for | The cut a cover of family is drawn with under a hard penis of this identity: a revealing skirt's flap (a
/datum/bulge_print_template) or a loincloth's derived cut (a /datum/bulge_sheet_state); null when it is drawn whole. |
| bulge_cut_sprite | A sprite cut by a flap (/datum/bulge_print_template) or by a loincloth's derived cut (/datum/bulge_sheet_state), or null. |
| bulge_decode_template | Decodes a sheet state into a print template, once per sheet and state: each pixel facing south, east and west with
its kind, read from its fixed grey (a kind map), or as cloth (a mask, when mask). North is never read: it is empty
in every template sheet. A state saved with one direction is read facing south every way, as getFlatIcon() treats
one. The template's key names its sheet and state, so no two sheets can share a cached template. |
| bulge_derive_cut | Cuts a cover by a keep mask (see bulge_cut_cover_flap() and bulge_cut_cover_patch()), uncached: the sprite times the keep mask. |
| bulge_derive_drape | Derives a loincloth's drape, as bulge_drape_name() names it, by the approved rule: facing east the flap's top edge follows the penis from its hinge, up to BULGE_DRAPE_REACH columns, then the rest of the flap hangs past the tip or, from a penis reaching further, drops over its side; facing west the same, mirrored; facing south the flap's top and hem rows where the loincloth's own sprite has cloth. Kept for the round, by its name, with the decoded templates; pixels in the order bulge_decode_template() reads a sheet. Arguments as bulge_drape_name(). |
| bulge_derive_large | Derives a shape past small_cap from the penis and testicle sprites by the approved rule, in whole numbers: the cloth
the bulge pushes out, as a kind map, or with mask the anatomy it leaves bare, as a white mask (null where it covers
the whole penis). Pixels facing south, east and west, in the order bulge_decode_template() reads a sheet, as the
sheet states it replaced held them; facing east and west, every penis shape but the human one takes amendments to
that rule (see below), and its mask is what the amended cloth leaves bare. The kind map is kept for the round, by its
name, with the decoded templates; the mask is not (bulge_exposed() keeps the tile drawn from it). Arguments as
bulge_large_name(): owner is the family whose shapes past small_cap these are. |
| bulge_derive_print_patch | Derives a printed patch (see bulge_print_patch()), uncached. |
| bulge_drape | The drape a hard loincloth hangs over the penis, as a kind map derived the first time (bulge_derive_drape()), or null where it has none. |
| bulge_drape_name | The name of a loincloth's drape: "[drapes][penis shape][sprite size]", "_untoned" as bulge_large_name(), and "_flat" from the family's flat_tip_from on a shape that grows past size 4. |
| bulge_drawn_leaf | The drawn sprite of a worn appearance: the appearance itself, or the first child of the KEEP_TOGETHER root build_worn_icon() nests separate overlays under. Null when it draws none. |
| bulge_drawn_root | The first visible appearance of a drawn slot (a slot holds one, or a list with emissive roots beside them). |
| bulge_exposed | The anatomy a bulge past the family's small_cap leaves bare, as a white mask (a /datum/bulge_sheet_state): the derived state of the bulge_shape() of the same identity, its tile drawn from the pixels bulge_derive_large() derives for it. Null where nothing shows, the shape covering the whole penis. Arguments as bulge_shape(). |
| bulge_family_size | The size a family draws a bulge of size at: its own up to its cap for the form, the cap past it; 0 for none. |
| bulge_flap | The flap a revealing skirt cuts away from its cover when hard, as a decoded mask (a /datum/bulge_print_template, every pixel cloth) for bulge_cut_cover_flap(), or null when the family cuts none. Named as the skirt's hard shape, in skirt_flaps.dmi. |
| bulge_flap_keep | A flap's keep mask: opaque white over the whole 32x32 tile in all four directions except the flap's own pixels, which are transparent. Built once per flap (GLOB.bulge_flap_keeps), so a cut costs one multiply. |
| bulge_four_way | A sprite's state as an icon with four directions, frame 1: a state with one direction is its south view every way, as getFlatIcon() treats one. Null when the state is missing or not 32x32. |
| bulge_hcy_raw | bulge_v4._hcy_raw: HCY to unclamped RGB fractions. |
| bulge_hcy_to_rgb | bulge_v4.hcy_to_rgb: drops chroma by bisection until the colour fits, then rounds half to even. |
| bulge_held_size | What the underwear under a look's cover (bulge_restraint()) leaves of the look. Underwear always takes precedence: it holds the penis in, unless its own look would show some of it at this size and arousal, the anatomy its exposed mask leaves bare (briefs from size 5, long johns' tip hard from size 5) or a loincloth's drape when hard. bulge_resolve() and bulge_wanted_cut() both decide by it, so a cover is drawn cut only for a look that shows the penis through it. |
| bulge_hue_numerator | A colour's hue in sixths of a turn times its chroma, in [0, 6 * chroma): the hue as an exact fraction over chroma. |
| bulge_is_accessory | Whether a child of a uniform's drawn sprite is one of its accessories (get_accessory_overlays()): drawn in the accessory's worn state, whichever file the wearer's species draws it from. |
| bulge_large_name | The name of a shape past small_cap: "[shapes][form][size][legs][penis shape]", "_untoned" for a shape whose untoned sprites have shapes of their own, drawn without skin tones; the size as bulge_large_size(). Legs are digitigrade only where the family has digitigrade versions of that form. |
| bulge_large_size | The size whose shape a bulge past small_cap draws: past size 6, a penis whose sprite has stopped growing (its size affix cap, with skin tones when toned) keeps size 6's shape. |
| bulge_loincloth_cut | The cut a hard loincloth takes under its drape (a derived /datum/bulge_sheet_state named "[drapes]cut[hem]", whose keep mask says what of the garment stays inside the cut window), or null. The cut follows the drape: at the lowest row its drape reaches facing south, or, for a drape that stays above the hem rows there (a tentacle's stub), the family's lifted_hem. Its keep mask (bulge_patch_keep()) is cut from the loincloth's own sprite as the approved previews cut it: facing south the flap's columns below the hem go, facing east and west the flap's two columns from its hinge row down, facing north nothing. Arguments as bulge_drape(). |
| bulge_mask_shows | Whether a mask shows anything. A skirt's anatomy clearance can be empty (the shaft shows behind the skirt and none of it above), and anatomy masked by an empty one would be a fully transparent icon, derived and sent for nothing. Read once per state, from its frames facing south, east and west (north is empty in every template sheet); a derived mask has no sheet, and always shows something (bulge_exposed()). |
| bulge_mask_tile | A mask placed on the 32x32 tile, in all four directions: transparent outside the mask. Built once per state
(GLOB.bulge_mask_tiles), kept on the server and never sent: drawn from pixels when given (a derived mask's pixels
as a template, as bulge_derive_large() derives them and bulge_exposed() passes them before it returns the mask), else
from the mask's sheet. |
| bulge_masked_icon | Returns anatomy restricted to a mask: an icon state's frames kept only where a white mask is opaque (the bare part of a penis past a family's small_cap, or what of it shows above a skirt), as one registered icon whose state "" faces all four ways. The image drawing it keeps the anatomy's own colour, so one masked copy serves every colouring. Cached by its inputs; null when the state is missing or not 32x32. |
| bulge_memo_list | The slots list memo[first], created on first use with slots empty slots. |
| bulge_memo_slots | The slots list memo[first][second], created on first use with slots empty slots. |
| bulge_mirror | value folded into first..last as between two mirrors, the ends not repeated, so alternating stripes keep
alternating across the fold. |
| bulge_nearest_run | The index in runs (flat ascending (first, last) pairs) of the run nearest value; the first of equals. |
| bulge_over_signature | What a worn cover draws over its own sprite (overlays, from bulge_over_overlays()), as one string: each overlay
after the first on the float plane. Null for none. An icon built at run time (mess baked on the cover) has no name of
its own, so it goes in by reference, after DIRT_PRIVATE_KEY: each one is new, so the look's key, the chest's, keeps
its images on the wearer rather than in tg's shared limb_icon_cache (limb_icons_for()). |
| bulge_palette_exception | The palettes this float32 port computes one off in a channel from the approved values (computed in float64), with the approved palette to use instead: 71 channels in 38 (colour, finish) pairs, all where float64 lands on the other side of a half (#afafaf's shade is exactly 136.5). Found by sweeping every colour the approved palettes were made for, the 4,096-colour grid of multiples of 17 and 760 garment colours, natively against them; every other one of their 218,520 channels the float32 computation gives exactly. A change to the arithmetic above needs that sweep again. Null when the computation stands. |
| bulge_palette_text | A GAGS palette as one string, as its producer joins a list; null for anything that is no palette. |
| bulge_patch_keep | A loincloth cut's keep mask: opaque white over the whole 32x32 tile in all four directions, except the pixels the cut
takes away. Built once per cut (GLOB.bulge_patch_keeps) from erased, those pixels facing south, north, east and west
(lists of indices, row * 32 + column + 1 from the top left), which bulge_loincloth_cut() derives and passes before it
returns the cut; asked for again, without erased, it is the one built then. |
| bulge_penis_state | The state of a penis shape's sprite a shape past small_cap is derived from, as the approved previews chose it: drawn
in front, hard or half hard, skin-toned where the sprite has that and the shape is drawn toned, at sprite_size or
the largest smaller size the sprite has. Null where it has none. |
| bulge_print_colour | The colour of a patch pixel (rgb() text) from the garment pixel the rule chose (GetPixel() text): the pixel itself for cloth, or the pixel under the kind's translucent white or black. A partly transparent garment pixel gives its colour; patches are opaque. |
| bulge_print_patch | Returns the printed patch for a garment sprite under a bulge template: one registered icon whose state "" faces south, east and west (north stays empty), drawn over the garment where the bulge pushes it out. Derived the first time and cached; null when the sprite has no print to carry, or is not a 32x32 resource. |
| bulge_printed_patch | A printed garment's precoloured patch past its family's small_cap (a /datum/bulge_sheet_state, drawn as it is), or null when its prints there are derived or it has none: the patch drawn for the penis shape's profile where the sheet has one (the human penis's name with the shape's icon state appended, and "_untoned" after it first for a shape drawn without skin tones whose untoned sprites draw differently), else the human penis's. None for a penis shape that draws the family's small_cap shape there (bulge_shape_size(): the tentacles, a shape past its print_cap), which keeps that shape's print. Arguments as bulge_shape(); with no penis shape, the human penis's. |
| bulge_register_icon | Registers an icon built at run time in the resource cache, as tg's derived icons are. The GetPixel() makes BYOND finish its deferred icon operations first, as GAGS does before it caches an icon. |
| bulge_rgb_to_hcy | bulge_v4.rgb_to_hcy: colorsys hue in degrees, chroma and Rec. 601 luma in 0-100, from 0-255 channels. |
| bulge_round_half_even | Python's round(): a half goes to the even neighbour. |
| bulge_shape | The shape a garment of family bulges with, as a kind map (a /datum/bulge_print_template), or null where the family
has none. Decoded the first time, or past small_cap derived (bulge_derive_large()); then a few list reads. |
| bulge_shape_owner | The family whose shape, anatomy clearance or flap a family draws at a size up to its small_cap: itself, or the
family it names by design for that form (half_shapes_of, hard_shapes_of), except at the hard sizes in own_sizes,
the family's own of that kind (own_shape_sizes, own_clearance_sizes or own_flap_sizes). |
| bulge_shape_size | The size whose shape a family draws for a bulge of size on a penis shape: bulge_family_size(), except that past the
family's small_cap, where shapes follow the penis shape, a shape with none of its own (bulge_hyper FALSE, the
tentacles) draws the family's small_cap shape, as any other shape draws at that size, and so does a shape past its
print_cap (Nondescript (Alt), Tapered (Alt) and Hemi (Alt)); 0 for none. |
| bulge_shape_where | Where a family's shape for an identity is (see bulge_shape()), or null when the family has none there. Where the family has a precoloured printed patch (bulge_printed_patch()), the patch is drawn instead: no shape (the look shows the anatomy the shape of large_shapes_of leaves bare, under the patch: bulge_resolve()). The sheet is chosen by the garment's own family (a skirt reads skirt_shapes.dmi whichever family owns the shape), and a family named by half_shapes_of, hard_shapes_of or large_shapes_of is followed one level only: it must own its shapes. Past small_cap the shape has no sheet: the derived state named as bulge_large_name() names it. |
| bulge_sheet_state | The one /datum/bulge_sheet_state for a sheet's state, or null when the sheet has no such state; with no sheet
(icon_file null), the one for the derived state of that name. |
| bulge_size | The bulge size, 1 to 8, of a penis this long in inches: past 36 inches the penis sprite's own size thresholds (penis/get_sprite_size_string()) carry on, at 37, 49, 57 and 65 inches. |
| bulge_size_for_length | Bulges: a covered penis, at least half hard, draws the cloth it pushes out over the garment covering it. |
| bulge_sprite_pixels | One direction of a sprite the shapes past small_cap are derived from, frame 1, read once and kept for the round (as
many as the sprites have states and directions): its opaque pixels row by row from the top, as flat (index,
luminance) pairs. The index is row * 32 + column + 1, rows and columns from 0 at the top left; the luminance is that
of the pixel tinted with the skin tone, in thousandths, plus one. A penis or testicle sprite is read inside the window
those draw in (BULGE_SPRITE_*), a loincloth's (whole) all of it. Null where it has no opaque pixel, or no such state. |
| bulge_sprite_size | The size affix, 1 to 7, the game draws a penis this long with (penis/get_sprite_size_string()), within cap. |
| bulge_template_masks | Derives the white masks an adaptive bulge of a template draws (see /datum/bulge_print_template/var/mask_cloth), once per template: one registered icon per kind it has pixels of, and one of all its kinds together. Their state "" faces all four ways; north stays empty. The palette is the client's tint on them, so a recolour derives nothing. |
| bulge_toward | bulge_v4.toward: turns a hue toward a target by at most amount degrees. |
| bulge_two_prints | Whether two pixels (GetPixel() text) are different colours of a print (red and yellow, red and white) rather than one colour lighter or darker (black and its shine): one has chroma 30 or more and the other not, or both do and their hues are 25 degrees or more apart. Hues are compared as exact fractions, never as floating point; so a hue difference of exactly 25 degrees counts as two prints here, where the preview's colorsys floats may land a hair below 25 and call it one (no approved garment comes near a tie: the smallest margin in the corpus is 1.87 degrees). |
| bulge_white_tile | A white 32x32 tile in one direction, loaded once; copy it with icon() before drawing on it. |
| 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 |
| can_be_headrev | Checks if someone is valid to be a headrev |
| can_hear_radio_tts | Checks if the passed mob can hear radio TTS |
| 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 |
| capitalize | Returns a string with the first word of the string capitalized. |
| capitalize_word | Capitalizes the first symbol in a passed string. Unsafe when used with BYOND string macros, use capitalize() instead! |
| censor_ic_filter_for_pdas | Given a pda message, will replace any match in the message with grawlixs. |
| center_image | Center's an image. Only run this on float overlays and not physical 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) |
| character_preview_animation | A look's animation, for a walk: its facings' patches, as one iconforge recipe, and the steps the page shows them in.
flats is each facing's flat icon, stamped whether one flat walked facing UP serves them all (see
uni_icon_facings_json()), and width and height the canvas they share. |
| character_preview_drawing_under_way | Whether iconforge is drawing a character preview now, which letting go of what it keeps would spoil. tg's asset loader asks too, as it lets go on every fire once its queue has emptied. A drawing whose proc was killed stops counting after CHARACTER_PREVIEW_JOB_TIMEOUT. |
| character_preview_effects | What the page draws over the character preview's drawing, because a flatten leaves it out: the rows tg's height filters move, and the mob's transform (body size). Takes the drawing's frame height and how far its tile sits above the frame's bottom (the "y" the page gets). Returns the page's keys for them, left out when the mob has neither: |
| character_preview_flat_box | A flat icon's canvas, list(x1, y1, width, height): where its lower left pixel sits, counted from the flattened look's own (1, 1), and its size. A grown canvas says so itself; any other is its icon's, at (1, 1). |
| character_preview_glow | A look's glow, flattened facing dir onto box, its drawing's canvas as list(x1, y1, width, height) from the look's
own lower left pixel, or null when nothing in it glows. always draws it whatever it holds, blank if nothing, for a
facing whose drawing's other facings glow. |
| character_preview_glow_test_body | A preview body from preferences: lit is a lizard with emissive eyes and a glowing chest marking. |
| character_preview_glow_test_lit_pixels | How many of a glow's pixels light what is under them: red (blooming) or green, through any blockers. |
| character_preview_map_pixel_move | How one displacement map pixel moves its row: -1, 0 or 1 as character_preview_map_rows() has them, or null when it moves it sideways or by part of a pixel. |
| character_preview_map_rows | How a displacement map moves each of its rows, from the bottom: -1 when a row shows the row below, 1 the row above, 0 itself. FALSE for a map that isn't a tile wide, or whose rows don't each move whole and as one. tg's heights use a handful of shared maps, so each is read once. |
| character_preview_rows | The runs of frame rows that the mob's displacement filters move, as character_preview_effects() gives them, or null if there are none or one moves more than whole rows. Filters run in the order tg keeps them, each map centred on the tile and then moved by its own offset. |
| character_preview_turns_itself | Whether something redraws a mob when it turns, so each facing of it has to be walked on its own. |
| character_preview_walk | A look's facings as iconforge recipes, on one canvas that grows to fit parts that reach past the mob's tile, like big ears and wings: list("recipes" = facing -> recipe, "height" = canvas rows, "x" and "y" = how far the canvas reaches left of and below the tile). |
| chastity_flavour | Sends optional server-owned flavour text. A checkout without private config sends no message. |
| 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_atom_crushable | Can this atom be curshed by the vending machine Arguments |
| check_behind | Checks to see if atom/source is behind atom/target |
| 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_whitelist | Checks whether someone's whitelisted or not.
Will return FALSE if the whitelist hasn't been loaded yet (which shouldn't normally happen). |
| 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() |
| claim_nova_import_prompt | One non-yielding claim enforces both cooldowns; persistent clients survive reconnects. |
| cleanup_expired_reta_grant | Cleans up an expired RETA grant from the active grants registry |
| cleanup_ghosts | Gives a farewell message and deletes the ghosts produced by a ghost portal structure. |
| cleanup_overmind_blobs | Clean up blob references after overmind is destroyed - called asynchronously to avoid blocking Destroy() |
| clear_owned_masked_leg_icons | Release owned metadata when the existing masked-leg cache is explicitly cleared. |
| clear_status_display_biohazard | Clear specific emergency types |
| clear_status_display_emergency | Clear a specific emergency type from status displays emergency_type: The specific type to clear ("biohazard", "lockdown", "radiation", etc.) If emergency_type is null, clears ALL emergencies |
| clip_pubic_hair | Returns pubic hair clipped to the bare skin under a baring underwear: each of its pixels is kept only where the body is drawn, the chest and legs, and outside the underwear's span in its row, from the underwear's leftmost pixel there to its rightmost, each direction on its own. The hair's colour is the overlay's, so it's left out: made once a round for each hair state, underwear sprite and body, a cached resource. |
| clockwork_say | Causes the mob or movable in question to speak a message; it assumes that the message is already translated to ratvar speech using text2ratvar() |
| 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_camera_ctag_asc | Orders cameras by their c_tag ascending |
| cmp_client_colours | Sorts client colors based on their priority |
| cmp_crafting_req_priority | Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes |
| cmp_custom_sprite_region_layer | Orders custom_sprite_region_map()'s images by layer, lowest first. sort_list() is stable, so region order holds within a layer. |
| cmp_dirt_parts_drawn | Sorts parts lowest drawn first: the higher layer number draws under. |
| cmp_dirt_underclothes_drawn | Sorts underclothes from dirt_underclothes_sprites() lowest first: the higher layer number draws under. |
| 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_preview_region_cost | Orders regions by what all their patches would take, cheapest first. |
| cmp_rped_sort | Sorts stock parts based on tier |
| cmp_species_family_order | Sorts species family types by sort_order, lowest first. |
| cmp_uplink_category_desc | Orders by uplink category weight |
| cmp_vending_prices | Orders vending products by their price |
| 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. |
| color_transform | Constructs a transformer, with optional color multiply pre-added. |
| 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 |
| condo_flat_render | Flattens a loaded room to a clean top-down icon: floors then objects, no lighting or parallax planes (those are what turn the picture into garbage). |
| condo_force_areas | Moves every reserved tile into a fresh /area/misc/condo so the room links up correctly. |
| condo_preview_asset_name | Asset name for an interior from its map path (".../alleyway.dmm" -> "condo_alleyway.png"). |
| condo_sanitize_lamp_color | A valid "#rrggbb" lamp color or "" (default) - never trusts a raw client string. |
| condo_skip_turf | TRUE for turfs we don't want in the picture: the empty space around the room and the yellow cordon tiles the maps use as a boundary. |
| condo_validate_custom_map | Loads the template once into a temp reservation to confirm it loads + has a condo door, fixes its areas in the process, then frees it. Returns TRUE if it's usable. |
| 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 |
| copy_appearance_filter_overlays | Copies the passed /appearance, returns a /mutable_appearance |
| cosmic_trail_based_on_passive | If we are a cosmic heretic, this will return the appropriate effect trail based on our passive level. returns the default trail otherwise |
| count_by_type | return the amount of items of the same type inside a list |
| cracker_reactions_list | Global proc to build up the list of co2 cracker reactions |
| 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_cosmic_field | Creates a cosmic field at a given loc |
| 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_girder_wall_recipes | Returns a list of newly created /datum/girder_wall_recipe instances from the given wall type lists. |
| 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_books | Create a random book or books. |
| 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 |
| credits_to_spacecash | Takes an amount of credit and returns a list of space cash typepaths that are equivalent to that amount. For example, if you passed 450 credits, it would return a list with a c200, another c200, and a c50 space cash stack typepath. You can then use the list to new() all the types provided if you wanted to give a player that amount in space cash. |
| 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 |
| custom_hair_appendage_name | An appendage name as saved: tags, stray angle brackets, backslashes and control characters removed, spaces collapsed, at most CUSTOM_SPRITE_MAX_APPENDAGE_NAME characters. Null when nothing is left. |
| custom_hair_appendage_views | An appendage's painted views, re-encoded canonically. Unreadable and empty views are left out. |
| custom_hair_appendages_export | Appendages in export form: every view and emission setting spelled out, keyed as saved. Null without any. |
| custom_hair_appendages_validate | A drawing's appendages as they are saved, keyed "1", "2", "3" in order, or null when none are left. |
| custom_hair_appendages_validate_strict | Strictly validates a style file's appendages, as custom_style_validate_drawing() does its views. Nothing is salvaged, and messages never repeat uploaded text. |
| custom_hair_try_on_image | The hat a try-on puts on the preview: its worn sprite on the head layer, placed as the body places head items. |
| custom_hair_try_on_mask_rows | Where a try-on hat's hair mask keeps and trims paint on the hair canvas: per view, height rows,
top row first, of eight hex digits. Each digit is four pixels, the leftmost in its high bit: set
where the mask keeps paint, clear where it trims. That's a quarter of a character a pixel, and the
window sends these with every rebuild. The mask is lowered by the hairstyle's y_offset and
carried upward as its top row, as it is on the paint itself. Cached. |
| custom_hair_try_on_ui_data | The window's Try on hats for a hair canvas height tall, drawn lift off the tile, over a
hairstyle lifted y_offset. The window crops its "Hats that cover it" chips from the front
views itself: BYOND exports an icon smaller than a tile padded out to 32 by 32. |
| custom_hair_try_on_views | A try-on hat as the hair canvas shows it, per view: its worn sprite placed against paint drawn lift = list(x, z) off the tile. Data URLs, cached. |
| custom_limb_markings_validate | Zone drawings keep the existing codec; discard unknown zones and independently copy each valid drawing. |
| custom_marking_partner | The other half of an arm/hand pair, which share one limb, or null. |
| custom_marking_zone_limb | The bodypart that carries a marking zone's paint. |
| custom_marking_zone_overlay_type | The overlay identity for a marking zone, so zone, hand and taur paint on one bodypart stay independent. |
| custom_marking_zone_width | A zone's own drawing width: the taur spans the wide canvas, everything else the body's 32 pixels. |
| custom_sprite_all_views | The drawing's own view list, then each appendage's: live references, so writes change the drawing. |
| custom_sprite_appearance_drawing | Appearance copies honor the master preference without changing saved layer settings, appendages' included. |
| custom_sprite_append_mask | Adds paint's glow mask (glowing) or blocker mask to overlays for the facings whose emissive setting matches,
placed like visible. Adds nothing when no facing matches. Dropped heads and limbs face South. |
| custom_sprite_apply_region_results | Puts every region's drawing and base markings on a body, then redraws it once. |
| custom_sprite_apply_round_style | Changes a live body's round appearance for one drawing target. |
| custom_sprite_apply_round_styles | Changes a live body's round appearance for several drawings, redrawing it once. |
| custom_sprite_background_tiles | Nova's character preview backgrounds as tiles for the custom editors' background swatches. |
| custom_sprite_blank_icon | A blank in every editable direction, including bald hairstyles without an icon state. Insert() alone leaves an empty icon reporting 0x0, so seed its dimensions from the blank. |
| custom_sprite_body_draw_mask | Row strings keep the wire payload small and test the same silhouette used by rendering. wrist gives a hand its wrist band. |
| custom_sprite_body_draw_mask_key | What custom_sprite_body_draw_mask() draws a zone's silhouette from, as text: the canvas, the zone, and the icons and states of the limbs that draw it. The same key draws the same mask, so it stands for the mask's rows in other keys. |
| custom_sprite_body_silhouette | Compose geometry in the canvas frame without stretching or changing the body's origin. wrist gives a hand its wrist band. |
| custom_sprite_boxes_recipe | A blank tile with these iconforge transforms applied in order, such as DrawBox boxes, as a recipe, or null for none. |
| custom_sprite_cache_put | Keep runtime caches bounded. Callers treat cached icons/lists as immutable. |
| custom_sprite_canvas_bounds | Full canvas for hair and facial hair; per-view locks are applied separately. |
| custom_sprite_canvas_code | A palette index as digits characters of CUSTOM_SPRITE_INDEX_ALPHABET, most significant first. |
| custom_sprite_color | A colour as #rrggbb lowercase, or null when the text isn't exactly that. |
| custom_sprite_compat_sidecar | A whole account sidecar as the branch wrote it, one slot with every key, and what loading it must give back. |
| custom_sprite_compat_v1 | Old-format drawings as the branch's own writer stored them, built without any codec proc so a codec change can't regenerate them. v1, two colours: pixel (0,0) is colour 1 and (1,0) colour 2 in the Front view; 1,022 empty pixels follow (68 runs of 15 and one of 2). |
| custom_sprite_compat_v1_legacy_emissive | v1 as an even older save wrote it: one emissive flag for every view, an explicit filter, a solid Front view (68 runs of 15 and one of 4). |
| custom_sprite_compat_v2 | v2, all 63 colours in the Front view's first row, a solid Back view of colour 63, per-view emission. |
| custom_sprite_compat_v3 | v3, the 64-wide taur zone, one colour everywhere in the Front view (136 runs of 15 and one of 8). |
| custom_sprite_compat_v4 | v4, a tall hair canvas: first and last Front pixels are colour 1; Back is solid colour 2. |
| custom_sprite_compose_regions | Builds the whole-body canvas from each region's saved drawing. |
| custom_sprite_cover_char | The mark that names looks[index] in cover rows: 1 to 9, then a to z. |
| custom_sprite_cover_labels | The looks' labels in mark order, for the window's tooltip. |
| custom_sprite_cover_looks | The looks that can hide paint: the hair, every mutant part drawn on the body, each piece of
underwear and, given a wearer, each item they have on. Each look carries its images, offset
the way get_limb_icon() draws them, the highest layer it draws on and a label for the window;
worn items are also marked worn. Looks come lowest layer first, so stamping them in order
leaves the topmost part at each pixel. Parts behind the body, hidden parts, the taur body (which
carries its own paint) and emissive images are left out. key, when given, collects what each
look is drawn from and where it lands, so rows flattened from these looks can be cached by geometry. |
| custom_sprite_cover_rows | One view of the cover looks as rows of marks: "0" where nothing covers, else the mark of the
topmost look (custom_sprite_cover_char(N) for looks[N]). Only images drawn after above_layer
count, so the same looks serve body paint and hand paint. bounds (0-based, inclusive x0, y0,
x1, y1) limits the pixel reads to the drawable box; outside it is clear. With cache_key (from
custom_sprite_cover_looks), the same look reuses its rows across rebuilds and editors. |
| custom_sprite_cover_worn | Which looks, in mark order, are worn items (1) rather than parts of the body (0), for the window's tooltip. |
| custom_sprite_covered_positions | Where a region's paint in one view sits under a different limb or outside every region. |
| custom_sprite_decode_grid | Reject before expanding, and stop at the supported pixel count even for hostile runs. |
| custom_sprite_direction_signature | One view's pixels as color text, so two drawings compare by what they show, not palette order. Appendages' pixels in that view follow the hair's. |
| custom_sprite_directional_mask | Include explicit blank frames: a missing facing would fall back to the South mask. |
| custom_sprite_draw_recipes | Draws recipes with iconforge, a picture each, on the main thread: a few tenths of a millisecond per picture,
where getFlatIcon() takes several for one view of a body. Each PNG goes to publish, a data URL of it when
there's none. Returns view -> what publish made of it. |
| custom_sprite_drawing_pixels | One drawing's pixels as colors, row-major from the top left. |
| custom_sprite_emissive_mask | Reuse the visible paint's placement; shared worn/bodypart preparation owns pose transforms. |
| custom_sprite_emissive_settings | Older drawings used one boolean; each view now owns its own saved choice. |
| custom_sprite_encode_grid | Each run is a hex length (1-f), followed by one palette-index character. Coordinates are row-major from the top left, matching SpriteEditor. |
| custom_sprite_extend_up | A copy of a 32-row icon grown to height rows, its top row repeated upward, so hair masks and gradients carry on over tall paint. |
| custom_sprite_flat_icon | Clip in body coordinates before flattening can expand a wide or offset overlay's origin. A tall
canvas reaches above the tile, and shift_x and shift_z move the whole window the way a lifted
hairstyle moves the paint drawn over it. |
| custom_sprite_forget_pictures | Deletes the pictures kept under a name, and under any name it begins. |
| custom_sprite_grid_args_valid | Grids are 32 rows of 32 or 64 pixels, or CUSTOM_SPRITE_TALL_HEIGHT rows of 32, indexing a palette of 1 to CUSTOM_SPRITE_MAX_COLORS colors. |
| custom_sprite_hair_canvas_height | The hair canvas a base look asks for: tall for custom hair over the tall bald base, otherwise 32 rows. |
| custom_sprite_hair_cover_key | The look the head's hair images were built from: those icons are generated at runtime and can't be keyed by path. |
| custom_sprite_hair_lift | Where a body's hair, and custom hair painted over it, are drawn from the tile, as list(x, z) pixels.
A hairstyle drawn above the head, such as Afro (Huge), lifts both, as the species' hair offset does.
style names a hairstyle other than the body's own. |
| custom_sprite_hand_silhouette | A hand's own pixels plus, with wrist, a short band of the arm just above them, so hand paint can't climb the arm. |
| custom_sprite_hash | Content identity of a whole drawing, "empty" for none. |
| custom_sprite_height | Tall hair drawings are version 4; every other drawing is 32 rows. |
| custom_sprite_history_jump | Clamps an undo or redo step count to what a window can ask for. Anything else passes through for the history to refuse. |
| custom_sprite_hydrate | Paints a drawing into a workspace's frames, centred on a wider canvas and at the bottom of a taller one. |
| custom_sprite_icon_bounds | Inclusive bounds in the editor's top-left coordinate system. |
| custom_sprite_icon_rows | Each view of a 32-row icon as row strings from the top, width characters each: "0" where it's
clear and "1" where it has a pixel. With ids (colour -> region character) a pixel reads as its
colour's region instead, and a blend as the region custom_sprite_region_fallback() finds in ordered. |
| custom_sprite_index_values | CUSTOM_SPRITE_INDEX_ALPHABET character -> its palette index. "0" is transparent. |
| custom_sprite_insert_marking_icons | Adds each zone's native marking once to the same cached sheet used by hair preferences. |
| custom_sprite_lifted_hair_test_top | The topmost painted pixel of a hairstyle's front view, as list(x, y) counted from the bottom left. |
| custom_sprite_limb_appearance | A body without its hair, so nothing hanging off the head covers the limb being drawn on. |
| custom_sprite_limb_state | Raw limb geometry, using exactly the state selection in get_limb_icon(). |
| custom_sprite_live_package | The recipient's live style for one target. Hair includes the whitelisted base hair look. |
| custom_sprite_live_package_from | The live form of an applied package: emission follows the body's current permission. |
| custom_sprite_live_packages | The recipient's live look for every drawing a salon target covers, by style key. |
| custom_sprite_marking_icons | Immutable per-zone marking classes, shared by character setup and tattoo editors. |
| custom_sprite_mask_bounds | Each view's paintable area padded by one pixel, from row-string masks. |
| custom_sprite_mask_pixels | The pixels a compact stroke mask of size characters marks, or null when it is another size, which custom_sprite_mask_points() refuses unread, or a character isn't in the alphabet. |
| custom_sprite_mask_points | A stroke's points from its compact mask: CUSTOM_SPRITE_INDEX_ALPHABET characters, six canvas
pixels each, row-major from the top left, lowest bit first. A whole view fits in one short string,
so a long stroke reaches the server as one message instead of a point list tgui splits into many.
With allowed, the mask's six-pixel slots in the same layout, each character is cut down to the
pixels its slot allows as it is read, which checks the points for a canvas that paints only those. |
| custom_sprite_mask_tables | Reads compact stroke masks by character code, which text2ascii() takes far faster than copytext() cuts a character. |
| custom_sprite_merge_cover_rows | One view's cover rows with each pixel judged against the layer its own region's paint draws on. |
| custom_sprite_native_marking_icons | Full-size mirror sprite classes for markings whose sheet is larger than a tile. The ordinary 32x32 markings reuse their picker sprite. Kept beside the picker in the same preferences asset, so hovering requests no drawing. |
| custom_sprite_obstructing_overlay | Whether a bodypart overlay hangs over the limb's paint: every mutant part except the taur body, which carries its own paint, and a moth chest's extra arms. |
| custom_sprite_packages_hash | One content hash for a set of packages, so a change to any of them shows. |
| custom_sprite_paint_icon | Called by debounced previews and appearance rendering, never by the per-stroke UI payload. Throwaway drawings skip the cache. |
| custom_sprite_palette_colors | The colours a saved or uploaded palette offers, canonical and lowercase. |
| custom_sprite_picture_icon | A drawn PNG as a native icon, for reading its pixels. |
| custom_sprite_picture_path | Where custom_sprite_draw_recipes() keeps the picture of one view drawn under a name; size is "[width]x[height]". |
| custom_sprite_picture_url | A drawn PNG as the data URL a window shows. |
| custom_sprite_pixel_hash | Tint and emissive settings affect appearances, not the drawing's raw pixels. |
| custom_sprite_pixels_drawing | Encodes one region's pixels as a canonical, literal-color drawing. |
| custom_sprite_placement_key | Where an image lands when flattened: its offsets and layer. Its art is keyed separately. |
| custom_sprite_present_regions | The marking regions this body can be painted on right now, in draw order. |
| custom_sprite_preview_appearance | A body's look with worn overlays added, captured so its views can be flattened one at a time. |
| custom_sprite_preview_height | The rows a body's pictures need: taller while its hair drawing reaches above the head, and taller
again for a hairstyle drawn above it, such as Afro (Huge). style names a hairstyle other than
the body's own. |
| custom_sprite_preview_width | The canvas width a body's previews are flattened at: a taur organ widens it. |
| custom_sprite_private_view | One region's pixels in one view, copied on first write, since decoded pixels may be shared with the caller's cache. |
| custom_sprite_region_color | Region N's ID color. Regions paint nothing else, so a pixel of this color is unambiguous. |
| custom_sprite_region_fallback | The region that dominates one blended pixel, as its region character. |
| custom_sprite_region_id_drawing | A solid drawing of region N's ID color across one editing mask, or null when the mask is empty. |
| custom_sprite_region_map | Which region owns each canvas pixel, in every view. |
| custom_sprite_region_mask | The paintable mask of a region map: every pixel an unlocked region owns. locked holds region characters. |
| custom_sprite_region_owner | The region owning a canvas pixel (0-based), or null. |
| custom_sprite_region_pixel | One region's color at a canvas pixel, or null. |
| custom_sprite_region_position | Where a canvas pixel falls in one region's own drawing, which may be narrower than the canvas. 0 when outside it. |
| custom_sprite_region_signature | A cheap fingerprint of one marking zone's live look: its paint's hash and its native markings. |
| custom_sprite_region_visible | What the game shows at a canvas pixel: its owner's paint, with a hand's paint over its arm's. |
| custom_sprite_render_views | Front, Back, Right and Left data URLs of a captured look, without flipping any view, from one walk. Each
picture's PNG goes through the callback when one is given, in GLOB.cardinals order, and is kept under name
when one is given; see custom_sprite_draw_recipes(). |
| custom_sprite_reopen_test_drawing | A version 1 drawing with one pixel painted at x, y in its Front view. |
| custom_sprite_resize_drawing | Fits canonical paint to a larger canvas: centered on a wide one, at the bottom of a tall one, so it keeps its place on the body. Refuses shrinking, so no paint can be lost. |
| custom_sprite_run_text | One index character repeated run times (1-15), cut from a string built once per character. |
| custom_sprite_salon_changes | Region labels a set of packages changes, in body order. Hair packages name none. |
| custom_sprite_salon_choose_draft | Asks which retained draft to reopen. Sleeps on the prompt. |
| custom_sprite_salon_claim_request | Claims the recipient's single incoming prompt and the pair's request cooldown. |
| custom_sprite_salon_draft_key | Where an artist keeps their draft for one drawing target on one person. |
| custom_sprite_salon_dummy | Builds a private preview body from a live body's current appearance. |
| custom_sprite_salon_export_live | Sends a player their own live look for a salon target: one file for hair, a whole-body file for a tattoo. |
| custom_sprite_salon_keys | Style keys a salon target covers: the hair target itself, or every marking zone. |
| custom_sprite_salon_label | What salon work on a target is called. A zone names where a tattoo is; without one it's the whole body's. |
| custom_sprite_salon_open_draft | Reopens a retained draft for its artist, rebinding the artist's body and tool. |
| custom_sprite_salon_previous | Style key -> a copy of the look each of a target's drawings had before its last salon change, for those that have one. keys limits it. |
| custom_sprite_salon_request | Asks a recipient to start custom work, then opens the artist's editor. Sleeps on prompts. |
| custom_sprite_salon_request_restore | Asks a recipient to restore the looks they had before their last salon change. Sleeps. |
| custom_sprite_salon_restore_choices | What Restore previous offers for several previous looks: the whole body, then each region by name. Label -> style keys. |
| custom_sprite_salon_restore_problem | Why an artist can't start restoring previous looks, or null. keys limits which looks count. |
| custom_sprite_salon_resume | Resumes a retained draft from a tool's self-use action. Sleeps only when asking which one. |
| custom_sprite_salon_session | The artist's retained draft for one drawing target on one person, or null. |
| custom_sprite_salon_sessions_for | Every draft this artist has, newest last. |
| custom_sprite_salon_sessions_for_tool | The drafts this tool can resume. |
| custom_sprite_salon_start_problem | Returns why an artist can't start work on a recipient, or null when they can. |
| custom_sprite_salon_start_restore | Shows the recipient previous looks to restore, in the mirror. keys limits them to the chosen ones. |
| custom_sprite_salon_target_problem | Why a drawing target can't be worked on. Markings without a zone mean the whole body. Addresses the recipient when they're doing the work. |
| custom_sprite_salon_tool_menu | Offers new custom work or restoration of the previous round style, then starts the request. Sleeps. |
| custom_sprite_sample_hair_palette | Bake effective hair color into source shades; gradients already supply their own RGB. |
| custom_sprite_sample_palette | Sample the most frequent opaque shades from all four authored directions. |
| custom_sprite_self_mirror | Whether someone can see the parts of themselves they can't look at directly. |
| custom_sprite_shade | A sampled shade multiplied by a colour's channels, exactly as painted hair shades have always been built. Not custom_sprite_tint_color(): that rounds as the window does, and recolours match paint by these exact values. |
| custom_sprite_sidecar_path | The drawing sidecar beside a preferences.json path, or null when the path has no directory. |
| custom_sprite_silhouette | White RGB and original alpha: multiplying by this clips without darkening the paint. |
| custom_sprite_split_regions | Splits the canvas back into each region's drawing, changing only what was edited. |
| custom_sprite_tall_hair_test_drawing | A 32 by 48 hair drawing with one pixel painted, in every view. Rows count down from the top. |
| custom_sprite_tall_hair_test_short_drawing | A 32 by 32 hair drawing painted in every view, once in its top row and once in its bottom row. |
| custom_sprite_taur_overlay | The taur organ owns its visible body; its two leg placeholders have no paintable pixels. |
| custom_sprite_taur_paint_test_drawing | A 64 by 32 taur-zone drawing painted solid in one color, in every view. |
| custom_sprite_taur_silhouette | Native taur geometry in its centered 64 by 32 frame, shared by editing and rendering. |
| custom_sprite_test_canvas_mismatch | Returns where the window's canvas, as an update encodes it, differs from the drawing: the first pixel of a view it carries that doesn't decode to the pixel there, or null when every one does, as a whole encode would. |
| custom_sprite_test_close_pixel | Whether two GetPixel() results are the same colour to within the rounding iconforge and BYOND's icon procs differ by. |
| custom_sprite_test_drawing | A version 1 drawing painted solid with palette index shade in every view. |
| custom_sprite_test_front_drawing | A drawing with one painted pixel, in the Front view only. |
| custom_sprite_test_hidden_pixel | A pixel a region's own mask covers but a different limb owns on the canvas, as list(direction, x, y), or null. |
| custom_sprite_test_lit_pixels | Pixels of a picture that light what is under them on the emissive plane, red or green, as list("x,y"). |
| custom_sprite_test_open_region_pixel | The middle of a region's pixels in a view that nothing drawn over the body covers, as list(x, y), or null. |
| custom_sprite_test_paint_region | Paints one pixel a region owns with the first color the canvas offers. |
| custom_sprite_test_paintable_point | The first pixel this draft may paint in one view. |
| custom_sprite_test_pool_colors | Saves up to count distinct colors across the body's regions in the Front view, a few per region, and returns how many it placed. |
| custom_sprite_test_region_drawing | A drawing with the same pixels in every view. Points are list(x, y, "#rrggbb"). |
| custom_sprite_test_region_fixture | Chest owns x 0-3, the left arm 4-7 and the left hand 8-9 on the first row. |
| custom_sprite_test_region_pixel | The first canvas pixel a region owns in one view, as list(x, y), or null. |
| custom_sprite_test_region_rows | A region map whose first row is first_row (padded with "0") in every view; every other row is empty. |
| custom_sprite_test_region_seam | A front-view pixel of upper right above a pixel of lower, as list(x, y) of the upper one, or null. |
| custom_sprite_test_region_workspace | A region workspace over two regions on the first row: "1" at x 0-3, "2" at x 4-7. |
| custom_sprite_test_remove_sidecar | Deletes a sidecar's primary, backup and staging files. |
| custom_sprite_test_same_pixels | Whether two icons have the same pixels in every cardinal view of their 32 by 32 area. |
| custom_sprite_test_selection_placement | The compact placement the selection tool sends for a temporary picture or a final drop. |
| custom_sprite_test_taur | The real external organ path, including its hidden leg slots and matrixed sprite layers. |
| custom_sprite_test_wide_drawing | A version 3 taur-zone drawing whose every row is row (64 indexes), solid colour 1 by default. |
| custom_sprite_tint_color | Match the Custom palette's frontend multiplication and nearest-integer channel rounding. |
| custom_sprite_transaction_pixels | How many pixels a stroke or placement touches, from what the window sent, before any validation. |
| custom_sprite_underwear_looks | Each piece of underwear the body shows, as a look of its own: underwear, bra, undershirt and socks. |
| custom_sprite_validate | Reconstruct a bounded, canonical payload. Missing directions are ordinary empty canvases. Only hair passes allow_appendages; other drawings lose any. |
| custom_sprite_version | Wide canvases are version 3 and tall ones version 4. Otherwise version 1 holds up to 15 colors and version 2 the rest. |
| custom_sprite_view_recipes | A look in custom_sprite_flat_icon()'s window, facing each of the editors' views, from one universal icon walk: view -> iconforge recipe. custom_sprite_draw_recipes() draws them. |
| custom_sprite_width | The format owns the canvas dimensions; legacy drawings always remain 32 by 32. |
| custom_sprite_worn_looks | What the wearer has on, a look for each worn item, labelled by its name. Held items are left out. |
| custom_sprite_worn_overlays | This body's worn clothing overlays, in layer order. Held items are left out. |
| custom_sprite_zone_covered | Returns whether worn clothing covers a marking zone. |
| custom_sprites_after_import | Imports replace the character identities, so an old slot's drawings cannot carry across. |
| custom_style_apply_base_markings | Change only this limb/hand's native markings and its DNA snapshot. The caller redraws the body. |
| custom_style_apply_hair_context | Applies a whitelisted hair look to a live or preview body. |
| custom_style_body_export_text | Whole-body export: every region's drawing and base markings in one file. |
| custom_style_copy_markings | Copy record arrays without deep_copy_list() turning their list values into associative keys. |
| custom_style_copy_package | Canonical packages own every drawing, native context and marking record they carry. |
| custom_style_copy_previous | Keep each previous package's native record array independent and JSON-serializable. |
| custom_style_emissive_problem | Why a drawing's or appendage's emission settings are refused, finishing "The drawing's ...", or null when they're fine or absent. |
| custom_style_export_drawing | A drawing in export form: all four views and their emission settings, or null for empty art. |
| custom_style_export_text | The export format always includes all four views and their emission settings. |
| custom_style_file_label | The download name for a package: custom-hair-style, custom-facial-hair-style, custom-tattoo- |
| custom_style_gradient_key | The gradient key a head target stores under. |
| custom_style_hair_accessories | The accessory list a head target draws on. |
| custom_style_hair_color_map | Maps painted hair shades from one base hair look to another. |
| custom_style_hair_gradients | The gradient list a head target draws from. |
| custom_style_hair_preference_types | Every preference a head target's base look is saved in: its fields, plus head hair's opacity toggle. |
| custom_style_hair_shades | The hairstyle's shades tinted by a hair look's color, in sampling order and without merging. Palettes dedupe these; recolors need the positions to line up between two looks. |
| custom_style_hair_slot_data | Returns an updated copy of a character's save data, or null when that slot has no data. |
| custom_style_hair_target | Whether a drawing target is head hair or facial hair. |
| custom_style_has_emission | Whether any view of a drawing glows. |
| custom_style_key | The key a style is stored under: the target, or markings:zone. |
| custom_style_live_hair_context | A body's live base look for a head target, read from its head when it has one. |
| custom_style_marking_conflict | Returns the marking a region's rows already wear that keeps another off it: one of its exclusion group. The preview and saving set a region through set_zone_from_list(), which drops the second marking of a group, so the editor refuses it first. |
| custom_style_marking_data | Convert validated records back into the native marking renderer's ordered map. |
| custom_style_marking_entries | Ordered, portable records for native markings: a limb's or a collection zone's entries, or a zone's saved nested shape. |
| custom_style_markings_slot_data | Copy a character's saved native markings and replace exactly the selected zone, including Clear. |
| custom_style_matches | Compare a legacy drawing-only package with the base markings it would preserve. |
| custom_style_normal_color | A colour as the preference writer stores it, black when invalid. |
| custom_style_normal_opacity | Keep explicit opacity, including fully opaque hair on naturally translucent species. |
| custom_style_package | A canonical package that owns copies of its drawing, hair look and markings. |
| custom_style_package_hash | Content identity for proposals, rotations and unchanged checks. |
| custom_style_paint_outside | Returns the first view with paint outside the destination's allowed pixels. |
| custom_style_parse | Parses an uploaded style file into a package. |
| custom_style_previous_validate | Previous styles are trusted disk data, but still pass the strict package validator. |
| custom_style_read_file | A file's text, or null when it's missing or larger than max_bytes. |
| custom_style_receive | Asks a player for a style file and parses it. This sleeps while the file dialog is open. |
| custom_style_recolor_drawing | Rewrites literal-color paint through a color map, keeping every pixel where it is. |
| custom_style_rewrite_markings | Rewrites a limb's native marking records. Markings are stored by name, so one limb can't wear the same marking twice, and their order is kept. |
| custom_style_send | Sends one package to a client as a downloaded file. |
| custom_style_send_body | Sends a whole-body style to a client as a downloaded file. |
| custom_style_send_text | Sends export text to a client as a downloaded file. |
| custom_style_spawned_slot_problem | Returns why a body's style can't be saved to the selected character slot, or null when it can. |
| custom_style_test_cleanup | Deletes the preference and sidecar files a test wrote to folder. |
| custom_style_test_export | The export text of a package holding drawing for target and zone. |
| custom_style_test_facial_style | The name of the first facial hairstyle that has a sprite. |
| custom_style_test_folder | A fresh temporary folder for one test's preference and sidecar files. |
| custom_style_test_hair | A complete base hair look for packages. |
| custom_style_test_markings | Two distinct native markings make order, independent field types and duplicate checks observable. |
| custom_style_test_sidecar | A sidecar store whose last verified contents match the file written for a save test. |
| custom_style_test_spaces | count spaces, the same text as repeat_string(count, " ") but built by doubling: appending one character at a time makes a 160 KiB file take most of a minute. |
| custom_style_test_two_color_drawing | Two colors, split evenly, so a recolor can be checked on both the palette and the pixels. |
| custom_style_transfer_begin | Claims the account's single transfer slot and starts the relevant cooldown. |
| custom_style_transfer_end | Releases the account's transfer slot. |
| custom_style_unknown_key | Returns the first unsupported key, or null when every key is allowed. |
| custom_style_validate_body | Strictly validates a whole-body style: one region package per zone it contains. |
| custom_style_validate_drawing | Strictly validates one drawing. Unlike custom_sprite_validate(), nothing is salvaged. |
| custom_style_validate_hair | Strictly validates the whitelisted base hair look carried by hair styles. |
| custom_style_validate_markings | Strictly validates the ordered native markings for one supported limb. A name a marking merge retired validates as the marking that draws it now (GLOB.body_marking_renames), as a save's migration renames it. Stored data (trusted) leaves out, and logs, a marking its limb no longer offers, where an upload is refused. |
| custom_style_validate_package | Validates a package's structure: one drawing target, plus its optional native context. |
| cut_relative_direction | Takes a screen_loc string and cut out any directions like NORTH or SOUTH |
| cyborg_accessory_color_channels | Returns the color channels an accessory's art uses at this size and arousal state, by channel number |
| cyborg_accessory_effective_size | Returns the requested size when the accessory has art for it, or else the first size it has |
| cyborg_accessory_metadata | Returns what the editor shows for a part's sprite - its color channels and its sizes, with a thumbnail of each unless include_icons is off |
| cyborg_accessory_render | Returns a part's colored art as an icon and its base64, or null when it has none. Cached, up to 128 images and 2 MiB |
| cyborg_accessory_size_values | Returns the sizes an accessory has art for, cached by slot and choice. The caller gets its own copy |
| cyborg_animation_anchor | Returns the still frame a chassis's parts are placed against in this direction and pose, or null when it has no authored animation |
| cyborg_animation_frames | Authored anchor data is generated offline; runtime never scans marker pixels. |
| cyborg_animation_map | One pixel per native frame, encoding a literal anchor translation after part transforms. Only catalog descriptors reach this cache; player colors and placement are not cache keys. |
| cyborg_appearance_model_id | Display names and mutable icon states are deliberately not identities. |
| cyborg_appearance_models | Appearance previews/defaults also support bodies obtained through antagonist roles. |
| cyborg_body_visuals_visible | Rendering and examine share this - death, a disguise or being tipped over hide the parts, lockdown and stuns do not. A redraw passes the chassis's catalog entry it already has |
| cyborg_build_appearance | Generates only the changed appearance, never creates organs or reads preferences. Returns null when no part shows |
| cyborg_canonical_model_id | Canonicalize stored IDs too, so old variant defaults remain usable. |
| cyborg_customization_after_import | Imports replace every character, so the old layouts go and the uploaded ones take their place. |
| cyborg_direct_accessories | The silicon-only accessories of a slot by name, null for a slot without any - these donor sheets never enter human accessory selection |
| cyborg_direct_accessory_render | Returns a silicon-only accessory's colored art as an icon and its base64, or null when it has none. Keeps the last 32 |
| cyborg_dynamic_accessory_has_size | Whether a genital accessory has art at this size, in any layer or color channel |
| cyborg_dynamic_accessory_suffix | Native icon operations and bounded immutable outputs replace donor per-pixel loops. Reuses Meridian accessories: no physical organ or bodypart overlay is constructed. |
| cyborg_effective_base_size | Returns the body size a chassis can show for the requested one, 1 when it isn't eligible. Small chassis never shrink and wide or tall ones stop at 1.6 |
| cyborg_identity_import_sanitize_slot | Import-only migration of donor identity keys. Layouts are read separately into the sidecar. |
| cyborg_identity_lore | Returns the character's silicon model lore, or the fallback when it has none |
| cyborg_identity_model | Only cyborgs use the new fields; AI and other silicon preferences retain their behavior. |
| cyborg_identity_text | Reads the silicon-specific text first without copying a human field into it. |
| cyborg_interaction_participant | Deliberately small interaction capability surface for cyborgs. Visual anatomy does not grant organs, hands, toy handling, vore, or any lewd interaction. Whether a mob can take part in the interaction menu - humans and cyborgs |
| cyborg_layout_account_full_message | What the editor says while saving a character would take the account past CYBORG_LAYOUT_MAX_SIDECAR_BYTES. |
| cyborg_layout_action | |
| cyborg_layout_apply_placement | |
| cyborg_layout_choices | Old presets inherit character choices; newer presets carry their selected parts. |
| cyborg_layout_codec_element | Element index of a decoded list, or null past its end. |
| cyborg_layout_codec_parse | A save text's JSON, or null when the text is not a save of this format. |
| cyborg_layout_codec_trim | Drops unset trailing elements, which decoding reads as unset. |
| cyborg_layout_codec_trim_text | Drops unset trailing elements from a list of element texts, as cyborg_layout_codec_trim() does before encoding. |
| cyborg_layout_copy_encoded | A deep copy of a layout whose parts keep the save text of the parts they copy. A part without text in encoded_parts
is encoded here, once for it and its copy. |
| cyborg_layout_decode | The normalized tree for a save text, or null when the text is not a save of this format. |
| cyborg_layout_decode_advanced | Returns a part's overrides by key from their flat pairs, skipping key indices we don't know |
| cyborg_layout_decode_for_body | What a body takes from a save text: its active layout and one model default, as cyborg_layout_decode() gives them, without decoding the rest. Null when the text is not a save of this format. |
| cyborg_layout_decode_override | Returns an override from its header and values, with its arousal states unless it is one |
| cyborg_layout_decode_part | Returns a part's fields from its mask and values, or null for an untouched part |
| cyborg_layout_decode_slots | Returns an encoded layout's parts by slot. Untouched parts are left out, for normalizing to fill in |
| cyborg_layout_default | Returns a new layout tree with default parts and no presets or model defaults |
| cyborg_layout_default_entry | Returns a new part entry with every field at its default |
| cyborg_layout_default_slots | Returns a new layout with every part slot at its defaults |
| cyborg_layout_default_sprite_size | Returns the sprite size a slot's parts start at |
| cyborg_layout_edit_position | Materialize just the edited view group, preserving legacy fallback elsewhere. |
| cyborg_layout_encode | The save text for a character slot, built from the save text of each part. |
| cyborg_layout_encode_advanced | Returns a part's overrides as flat key index and override pairs, or null when it has none |
| cyborg_layout_encode_entry | A preset or model default as save text: its name or chassis, its layout, and its chassis or linked preset.
A layout found in cached_parts keeps its text, and its parts' texts for copies of it; see cyborg_layout_encode().
Presets and defaults are only ever replaced whole, so most saves find all but one of them there. |
| cyborg_layout_encode_override | An arousal state writes every field it has: there each one overrides its pose, whatever the value. |
| cyborg_layout_encode_part | Fields are read the way cyborg_layout_normalize_entry() reads them, so leaving one out decodes to the same value. |
| cyborg_layout_encode_slots | A layout's parts as save text, in cyborg_layout_supported_slots() order. See cyborg_layout_encode() for the caches. |
| cyborg_layout_from_stored | The editable tree for whatever a slot holds: save text, an older nested tree, or nothing. |
| cyborg_layout_import_is_future | Whether a stored or uploaded slot comes from a newer build. It is kept as it is and never rewritten. |
| cyborg_layout_normalize | A layout tree in its canonical form, or the default tree when raw is not one. |
| cyborg_layout_normalize_advanced | Returns a part's overrides in canonical form. An import also expands donor pose-wide entries to each direction |
| cyborg_layout_normalize_advanced_entry | Returns one override with only the fields it sets, bounded, or null when it sets none. Arousal states can't nest, so they pass allow_arousal FALSE |
| cyborg_layout_normalize_entry | Returns a part entry in canonical form, every field bounded and filled in, or the slot's defaults when raw isn't a list |
| cyborg_layout_normalize_slots | Returns a layout with every part slot normalized, defaults filling the missing ones |
| cyborg_layout_number | Returns a number clamped to its range and rounded to its step, or the default when it isn't one. Text numbers are read too |
| cyborg_layout_override_fields | Override fields in header bit order, with what the editor fills a new override with. |
| cyborg_layout_sidecar_path | The cyborg layout sidecar beside a preferences.json path, or null when the path has no directory. |
| cyborg_layout_slot_full_message | What the editor says while a character's setups are past CYBORG_LAYOUT_MAX_SLOT_BYTES. |
| cyborg_layout_sprite_size | Returns a sprite size clamped to the allowed range, or the slot's default when it isn't a number |
| cyborg_layout_supported_advanced_keys | Save texts store overrides by their place here, so only append. |
| cyborg_layout_supported_slots | Save texts store parts by their place here, so only append. Every caller shares the list, so none may change it |
| cyborg_layout_text_is_future | Whether a save text comes from a newer format. Every format starts with its version, so this needs no decode. |
| cyborg_layouts_from_import | Layouts carried by an uploaded preferences file, keyed by character slot. Read before pass one sanitation. |
| cyborg_message_interaction_act | Uses only authored non-lewd messages. It never invokes the human effects path. |
| cyborg_message_interaction_allowed | Whether actor may use an interaction on target when a cyborg is one of them - a cyborg only cheers, a human may also beckon and pat |
| cyborg_message_interaction_contract_is_safe | Whether an interaction is a plain non-lewd message with no parts, effects, sounds or requirements beyond a free hand |
| cyborg_mirror_placement | Whether a part's placement is mirrored - a wide chassis facing west, unless the part opts out |
| cyborg_model_catalog | Cached descriptors contain resources and copied lists only; temporary models have no host. |
| cyborg_model_legacy_id | Donor keys are accepted only when exactly one current descriptor matches. |
| cyborg_occlusion_mask | Returns a chassis's occlusion mask - its family's mask icon and the state its poses add their suffix to - or null when it has none |
| cyborg_part_capability | Returns whether a part slot is configured, turned on and showing on the borg right now |
| cyborg_part_sprite_direction | Returns the direction of a part's art - a wide chassis facing north may reuse its south art |
| cyborg_preferences_for | GET_CLIENT can resolve to a real /client or the unit-test client interface. |
| cyborg_preview_animation | A bounded frame sequence for the visible model only. No periodic server UI updates. |
| cyborg_preview_body | Body previews use immutable resources, never world mobs. A bounded FIFO caches PNGs. |
| cyborg_preview_layers | Returns the editor preview's part layers without their art, placed as the live renderer places them. |
| cyborg_preview_reference | Existing one-tile mannequin artwork, fixed at normal body scale in the frontend. |
| cyborg_resolve_placement | Pure geometry shared by creator/live rendering. Input has already been normalized. |
| cyborg_runtime_actor_is_owner | The runtime backend shares this actor/slot gate with its self-management UI. |
| cyborg_selectable_models | Normal in-round selection stays restricted to its existing departments. |
| cyborg_sprite_preferences | Part slot -> the preference that holds its sprite. Every caller shares the list, so none may change it |
| cyborg_test_run_queued_save | Runs the save SScyborg_layout_saves would run for store on its next fire. Returns FALSE while none is due. |
| cyborg_visual_anatomy_examine_lines | These descriptions mirror already-rendered visual layers. They do not imply an organ or interaction capability. |
| cyborg_visuals_allowed | Whether or not these preferences allow cyborg parts at all - the server config, the ERP master toggle and the genitals toggle |
| 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 |
| deep_copy_list_alt | A version of deep_copy_list that actually supports associative list nesting: list(list(list("a" = "b"))) will actually copy correctly. |
| 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 |
| deliver_meridian_theme_art | Hands a client its MeridianOS theme's art: the files first, waiting for them to arrive, then their stylesheet to its open windows and its lobby, which load it as they hear of it. For the lobby as it starts and for a theme picked while windows are open; a window that opens later gets the art with its other assets (/datum/tgui/send_assets()). |
| 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. |
| derive_body_marking_species | Gives every marking in a marking set the species of its sets: the union of their recommended_species, or any species when one of them names none. A marking in no set keeps the species it declares. Runs once both lists are built, so a set and its markings never disagree about who may wear them. Only choices and validation read the result, never loading or drawing. |
| determine_drafted_knowledge | Each heretic has a few drafted knowledges within their heretic knowledge tree. This is not during the knowledge tree creation because we want to know what path our heretic picks so we filter out dupe knowledges. Also generates shop knowledges as their validation is shared. Modifies shop_list and final_draft that are provided in the arguments. |
| 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 |
| dirt_add_run | Adds one run to a role's in one direction. |
| dirt_aim_bounds | Returns how far past its zone's heights a streak may end, for the zones whose streaks stay in them: list(zone = h). Off target they read as a U, bars or socks. You should NEVER modify it. |
| dirt_aim_inset | Returns how many pixels a clamped streak end's or a capped drip's bound moves in: odd on one side of a pair, 0 or 2 on the other, so the sides keep to different rows. It stays under the room the streak or drip starts with inside its bound, so a streak never shrinks to nothing and a drip never runs up. Without the room an odd one moves 1 px out where that's allowed (the knee); elsewhere it stays on the bound. |
| dirt_aim_inside | Returns a streak's end pulled back along the streak until its height lies between two bounds: list(theta, h). The streak keeps its own taper. |
| dirt_aim_zones | Returns each aim zone's areas, where its shots land: list(zone = list(list(limb, lowest theta, highest theta, lowest h, highest h), ...)). You should NEVER modify it. |
| dirt_baked_icon | Returns runs baked into one four-direction RGBA icon on a blank state, registered in the resource cache as bulge_register_icon() registers an icon built at run time, or null when they draw nothing. Each run is one DrawBox() in its role's tint colour, at the tint's alpha times the run's level, rounded to 8 bits. |
| dirt_body_parts | Returns the parts a body draws that take mess, lowest drawn first: the pecs guide if its chest takes one, then each genital drawn (dirt_part_drawn()). |
| dirt_body_parts_key | Returns a body's parts as one line of text, with what they're drawn for and at what layers, to tell when a change to them may shape its mess otherwise. |
| dirt_build_template_now | Builds a dirt template at once, for tests and for anything that can't wait for a subsystem. |
| dirt_cleanup | Returns a mask cleaned up: a lone film pixel goes, a lone core softens to body, and a pixel whose role none of its neighbours share takes the role three of them share. Flecks stay. |
| dirt_container_over | Returns a container of a baked mess image just over a genital's or a taur body's images: at the layer and offsets of the last sprite among them, the one drawn over the others, kept together. It isn't nested in that sprite: the sprite is coloured, which its overlays would take, and a filter on it doesn't reach them. |
| dirt_cover_fades | Returns how near a mask's pixels lie to what's worn over them, where they fade out: alist(index = 1 beside it, or 2 one pixel further), for the pixels drawn that it leaves bare. Steps are up, down and across. |
| dirt_cover_layers | Returns the overlays_standing slots whose sprites cover skin mess, so it fades out beside them: the underclothes and the garments. You should NEVER modify it. |
| dirt_cover_sprites | Returns the sprites a body draws over its skin, from what it wears: list(list(icon, icon state), ...), in dirt_cover_layers() order. |
| dirt_covering_thickness | Returns how thick a covering feature lies on a pixel: film at most on the outline, and in profile broken by noise on the outline and beside it, to nothing, haze or film. Highlights aren't broken. |
| dirt_despeckle | Returns a mask without lone pixels, which read harshly: a lone film or haze pixel goes, and a lone body or core pixel becomes film with a haze ring where the surface reaches. A film or haze hole with three dark neighbours fills with body: it read as a chip or a scar. Glints and flecks are highlights and stay. |
| dirt_drawn_indexes | Returns the indexes of a mask's drawn pixels, in row-major order. |
| dirt_drawn_roles | Returns the roles runs are drawn in, one to a pixel, in the order they're baked: haze is film at half (dirt_role_runs()). You should NEVER modify it. |
| dirt_eye_reads | Returns what a body's eyes and its human head are drawn from as dirt_zone_sources_match() reads them against zone sources: list(the head, its limb_id, whether it draws eyes, the eyes, their sheet, their state). |
| dirt_eyes_unchanged | Returns whether a body's eyes and its human head are drawn from what they were when dirt_eye_reads() read them, read as it reads them without making a list. |
| dirt_footprint | Returns the pixels features draw on in one view before the raster's cleanups, as alist(index = TRUE): where any of them lies thick enough for film. A feature hidden in profile is left out there. |
| dirt_footprint_touches | Returns whether any of a footprint's pixels lies within DIRT_RUN_GAP px of another's, in both axes: no skin between. |
| dirt_fresh_variant | Returns a variant of a zone's mess none of some splats on that zone has, at random, or any once they have them all. |
| dirt_human_zone_pixels | Returns a zone's pixels on the plain human template, facing the way that shows it (dirt_zone_facing()): the body pixels whose limb, angle and height lie in one of the zone's aim areas (dirt_aim_zones()). Null until SSdirt has built that direction of the template in the background (/datum/controller/subsystem/dirt/proc/human_surface()). Each zone is read once a round. You should NEVER modify the list it returns. |
| dirt_index_range | Returns list(1, 2, ... count), made once for each count. You should NEVER modify it. |
| dirt_level_shows | Returns whether a level shows anything new on the body over level 1's shot: a pixel the kept runs and drops draw that level 1's doesn't, beside either. A lone one would go. |
| dirt_lobe_rasterise | Returns mess following a rounded part's form (breasts, pecs, the butt, testicles, the vulva), from the
"lobe:aimed_ |
| dirt_lobe_row_at | Returns the row a fraction of the way down a lobe, 0 its top and 1 its bottom, not rounded. |
| dirt_lobe_shape | Returns a lobe's shape: list(its indexes, TRUE on each of its pixels, alist(row = list(leftmost column, rightmost column)), its rows from the top). |
| dirt_lobes | Returns a rounded part's lobes, each a list of indexes in row-major order: each side of DIRT_PART_MIDLINE where the view shows both (front or back, the vulva excepted), else the whole part. A lobe under 4 px holds none. |
| dirt_lower_zones | Returns the zones below the waist: the groin, the thighs and the butt. You should NEVER modify it. |
| dirt_mask_directions | Returns the directions a mask is made in, in the order its pieces go. You should NEVER modify it. |
| dirt_measure_metrics | Returns alist(limb = list(degrees per pixel, h per pixel)), measured from the plain human template facing south, then facing east for a limb the south view lacks. A limb's diameter is its median row width; its length, its rows. |
| dirt_merge | Returns masks merged into one: on each pixel the thickest wins, by role rank and then thickness, and the first mask keeps a full tie. All the splats on one surface make one mask this way, oldest first. A splat below the top level leaves out each of its pieces that comes within DIRT_RUN_GAP px of an earlier splat's: piled on, splats filled into one sheet. A top-level splat keeps everything: it covers. |
| dirt_merge_with_parts | Returns a surface's splats in one direction merged with the parts drawn under and over it. Each splat leaves out the pixels of the rounded parts on its zone (dirt_part_rounded()): straight streaks carried onto a breast read as blocks. Then each part drawn under the surface takes each splat on its zone in its own pixels (dirt_part_field()), merged in after the splats and keeping every piece, as a top-level splat does. A part drawn over the surface takes its share on itself, so its field isn't drawn here. |
| dirt_mess_amount_levels | Returns how many levels a shot's amount adds where it lands: 1 for a normal shot, 2 for a heavy one, and straight to DIRT_MESS_MAX_LEVEL for a huge one. |
| dirt_mess_baked_image | Returns an image of a surface's baked mess, drawn as it is: its colours and alpha are in its pixels (dirt_baked_icon()). |
| dirt_mess_carriers | Returns the carriers of a person's mess: their own, then each worn item's. |
| dirt_mess_entry | Returns a zone's entry in a shot's list of where to aim: "On their chest". |
| dirt_mess_evict | Takes a person's oldest splats off until they carry DIRT_MESS_MAX_SPLATS at most, counting their skin, their parts and their worn items. It draws nothing: the caller draws each carrier it returns, and each part. |
| dirt_mess_garment | Returns the worn item a shot at a zone lands on, or null for the skin: the outermost of the head, mask, suit and uniform slots whose body_parts_covered includes the zone's part (the chest for the chest, stomach and back; the groin for the groin and butt; the legs for the thighs). The face is covered when the mouth is, by the item covering it. Underclothes never count: they aren't items. Through a wall portal only the uniform counts, while it's drawn: the relay copies it and no suit (lower_body_only()), so a coat over the lower body leaves the shot to what the relay shows under it. A skirt the relay leaves out (wall_relay_skips_uniform()) leaves it to the underclothes or the skin. |
| dirt_mess_inset_image | Returns an image drawing cloth's baked mess over a garment, kept to the garment's own pixels by BLEND_INSET_OVERLAY inside the worn KEEP_TOGETHER wrapper build_worn_icon() makes. It floats, and on a garment drawn on the body's own tile it isn't offset, so the bulge redraws it over its cloth too (bulge_over_cloth()). |
| dirt_mess_land | Puts a mess on a person where a shot was aimed (dirt_mess_place()), when the portal shows a zone that lands. |
| dirt_mess_landable | Returns whether dirt_mess_land() lands a shot at a zone: the zones dirt_mess_zones() lists, and DIRT_ZONE_COCK, which dirt_mess_regions() offers through a one-part portal and which lands on the penis alone. |
| dirt_mess_place | Puts a mess where a shot at a zone lands on a person (dirt_mess_surface()) as /datum/component/dirtiness/proc/add_mess() does, and on each part drawn over that surface which the zone reaches (dirt_body_parts()), a splat of the same variant in its own slot. A back shot on a taur also puts one in its taur body's slot (dirt_taur_takes_pools()), unless a taur suit takes it, whose own splat draws the pools. DIRT_ZONE_COCK lands on the penis alone, while it draws its front image. Then it takes the oldest splats off past DIRT_MESS_MAX_SPLATS, and only then draws each garment that changed and the person, once, so the masks asked for are the ones kept. |
| dirt_mess_regions | Returns the zones a shot on a person can aim at, in dirt_mess_zones() order. |
| dirt_mess_role_tints | Returns the mess's tints, indexed by DIRT_ROLE_* define, each list(colour, alpha from 0 to 1), as dirt_baked_icon() takes them. Pearl white, translucent where thin and near opaque where thick, a light grey underside that sets drops apart on pale skin, and a white highlight. Haze is the film's colour at half its alpha, drawn as film at half coverage. You should NEVER modify it. |
| dirt_mess_splat_rasterise | Returns mess aimed at a taur body's back in one direction, from the "splat:aimed_back:taur: |
| dirt_mess_surface | Returns the carrier a shot at a zone lands on, and the underclothes it lands on: list(/datum/component/dirtiness, a DIRT_UNDERCLOTHES_* define or null). The outermost garment over the zone takes it (dirt_mess_garment()), else the underclothes that cover it, held by the person, else the skin. |
| dirt_mess_zones | Returns the zones a shot can be aimed at on a person, in the order they're offered: face, chest, stomach, back, groin, thighs, butt. You should NEVER modify it. |
| dirt_metric | Returns how far one pixel reaches on a limb: list(degrees round it, h along it). It's measured once, as the reference generator measures it, and serves every body, so marks keep one size whatever the body and the direction. |
| dirt_metric_directions | Returns the directions dirt_measure_metrics() reads, the only ones its template needs. You should NEVER modify it. |
| dirt_metric_sources | Returns the plain human template's sprites, which dirt_metric() is measured from: no eyes, no mouth guard. You should NEVER modify it. |
| dirt_neighbour_table | Returns each pixel's neighbours on a canvas, in the order the reference generator visits them: right, left, below, above, those off the canvas left out. Built once per canvas size. You should NEVER modify it. |
| dirt_noise_hash | Returns a lattice point's noise value, from 0 to 1 in steps of 1/255. |
| dirt_packed_thicknesses | Returns the thicknesses packed so far, indexed by their code + 1 (dirt_thickness_code()). You should NEVER modify it. |
| dirt_parity_case_block | Returns a corpus case as the text the reference generator writes for it: "case |
| dirt_parity_facing_parts | Returns the parts a body case places under or over its surface in one facing: each entry of its "under_parts" or "over_parts" is a part's name, placed so in every facing, or "name@NE", placed so in the facings it names. |
| dirt_parity_number_text | Returns a number, or a list of numbers joined by single spaces, as the reference writes them: whole numbers in full, never in scientific notation. |
| dirt_parity_parts | Returns corpus parts as the game reads a genital: each a /datum/dirt_part_source of its states, every layer's together, its sheet loaded from its path. |
| dirt_parity_random_lines | Returns a random case's lines: one per integer call, in order, all from one stream. |
| dirt_parity_surface_lines | Returns one direction of a surface as three grids, one line per row, one after the other: |
| dirt_parity_taur | Returns a corpus taur kind as the game reads a taur body (/datum/dirt_taur_source): each layer's states, its sheet loaded from its path. |
| dirt_parity_taur_lines | Returns what each pixel of a taur canvas shows as one grid, one line per row, one glyph per pixel: "B" the taur body's behind layer, "A" its adjacent layer, "r" the rider, "U" its front under clothes layer, "F" its front layer, "O" its front over layer, "." none. |
| dirt_parity_template | Returns a corpus template, built as the game builds a body's the first time it's asked for and shared after that. |
| dirt_parity_zone_sources | Returns a corpus template as the zone sources dirt_zone_sources() gives a body: each zone's sheet, loaded from its path, and state, the eyes' sheet and states, and whether the head is a human's. |
| dirt_part_body_level | Returns the level of a splat's mess on the body where parts take a share of it: down by 2 where a penis, testicles or vulva does, else by 1 where any part does, never under 1. A part takes a share in a direction where it has pixels. The top level stays: the body keeps its glaze, still off the rounded parts' pixels, and the parts draw theirs at DIRT_PART_MAX_LEVEL. |
| dirt_part_drawn | Returns the source a genital is drawn as now, its organ slot filled in and each state's layer read from its image, or null while it draws none: hidden (dirt_shown()), a device drawn in its place, a bulge look drawn for it, no sprite in the layers mess reads it from (a taur's penis draws only behind the body), or a kind that takes no share. |
| dirt_part_field | Returns one splat's mess on a part's pixels, which keeps every piece where it merges with others: lobes on a rounded part, a bead behind the tip on the penis. Its fields have levels 1 to DIRT_PART_MAX_LEVEL, so a splat past it draws at it. A field rests on its arguments alone, and every mask its splat is on draws it again, so the newest DIRT_PART_FIELDS are kept, packed. |
| dirt_part_fringe | Lays a part's translucent fringe: film on each of the part's pixels beside its solid mess, up, down or across, that holds none yet. |
| dirt_part_index | Returns a pixel's index on a 32x32 canvas, or null off it. |
| dirt_part_kind | Returns what a genital is drawn as for mess: a DIRT_PART_* define, or null for one that takes no share (the anus, the womb). The breasts organ is pecs when it's built from a pecs accessory. |
| dirt_part_layers | Returns the layers mess reads a kind of genital from, as the reference generator draws it (its own parts take every one): the butt's front and back (ADJ) images, every other kind's front image alone. You should NEVER modify it. |
| dirt_part_own | Returns the pixels a part takes its share on in one direction, as indexes in row-major order: its own. The pecs guide keeps to where the chest shows. The vulva, too small for a lobe of its own, also takes the ring of visible pixels round them (the body's, and the parts') when it lies on skin, but never on cloth. |
| dirt_part_rasterise | Returns mess on a part too small to round, the penis: a bead just behind its tip (its pixel farthest from where it
joins the body) with a highlight and a grey underside, the tip itself translucent (over the whole end it read as a
white cap); at levels 2 and 3 a run back from the tip and a drop or two along the part; a translucent fringe inside
it. Drawn from the "part:aimed_ |
| dirt_part_rounded | Returns whether a kind of part is rounded, so its mess follows its form in lobes (dirt_lobe_rasterise()) and the body's own mess leaves its pixels out: every kind but the penis, which takes a bead behind its tip. |
| dirt_part_source_of | Returns a genital's images as a part source, every layer's colour layers' states together with the layer each draws at, or null when none draws a sprite. Emissives and texture holders are left out. |
| dirt_part_zone | Returns the zone whose shots a kind of part takes a share of: the chest for breasts and pecs, the butt for the butt, the groin for the rest. |
| dirt_parts_key | Returns parts' keys as one line of text, to key masks by: each with where it draws against a surface in each direction, when one is given. |
| dirt_pecs_guide | Returns the source of the plain pecs' shape a human chest without breasts takes mess in, an undrawn guide (Muscular pecs and breasts are the breasts organ, drawn), or null for any other chest. You should NEVER modify it. |
| dirt_perm_table | Returns the table the noise hashes lattice points through: 0 to 255, shuffled by the "dirt:perm" stream. |
| dirt_pieces_near | Returns TRUE on each pixel of a mask's pieces, 8-connected, that come within DIRT_RUN_GAP px of a taken pixel. |
| dirt_pixel_span | Returns how many degrees a pixel of a row spans: the turn to the pixels beside it in the row, or a limb's own at least. |
| dirt_pixel_zones | Returns the zones a template pixel's flags name (DIRT_PIXEL_ZONE()), each keyed to its own place: zones[place] is a zone and zones[zone] its place. They're the zones dirt_zone_owners() gives pixels, those of dirt_zone_draw_order(). A pixel holds its zone in 4 bits, 0 for none, so there are 15 at most. You should NEVER modify it. |
| dirt_pixels_from_drawn | Returns a mask made again from its drawn pixels. |
| dirt_pool_clear | Returns whether a pool's columns keep more than 2 px from every column of the pools kept before it. |
| dirt_pool_draw | Draws a role on a pool pixel of the taur body, where the role drawn there doesn't outrank it: never off the taur body's pixels. |
| dirt_pool_put | Lays a solid role on a pool pixel, noting it as the drop or pool's own if nothing was laid there before. |
| dirt_portal_shows | Returns whether a portal shows the part of its occupant a zone lies on: through a one-part portal only DIRT_ZONE_COCK, through a wall the groin and the butt (its relay draws no legs), and anything with no portal. |
| dirt_ragged_edges | Breaks a covering mask's flat edges, and returns it: no top or bottom edge runs flat along one row for more than 2 px. Cut level, a sheet read as clipped at a region, an apron, a back patch, a bib. At irregular spots along a flat stretch, film runs on 1 to 3 px below a bottom edge, or rises 1 px over a top edge. It only adds film, on bare skin or haze of the chest and the legs, so what's under it and the highlights stay. What's solid is read before anything is added, so the mask is changed where it is. |
| dirt_ragged_free | Returns whether a covering mask's flat edge may run on over a pixel: bare skin or haze on the surface, where the chest or a leg shows. |
| dirt_rasterise_aimed | Returns mess aimed at a zone, drawn on one direction of a body: levels 1 to level, each from the deposit's same
draws, merged by role rank with the later level winning a tie, then despeckled. A highlight, once drawn, stays: a
later run beside it folded it in. The top level then breaks its flat edges, and keeps every pixel of level 3 as it
was drawn, at its role or a darker one. |
| dirt_rasterise_level | Returns one level of a deposit drawn on one direction of a body. The first feature, in list order, to lie thickest on a pixel picks its role. Nothing goes on an eye, the pixels beside it or a human mouth, and an eye's diagonals take film at most. Cloth draws its rim a role lighter, so a garment keeps its outline, though a contact point keeps its tone. Then bare legs streak, lone pixels go, and on skin nothing smaller than 2 px stays. |
| dirt_role_ranks | Returns each role's rank, indexed by its DIRT_ROLE_* define: where masks or levels meet, the higher rank keeps the pixel. You should NEVER modify it. |
| dirt_role_runs | Adds a mask's horizontal runs in one direction to each role's: list(icon y, first icon x, last icon x, level). A run is a role's pixels side by side in one row at one level, how much of each pixel it covers out of 255: DIRT_MASK_SOLID, or DIRT_MASK_HALF for haze, drawn as film. A pixel beside what's worn over it keeps a share of its level: its fade ring over DIRT_FADE_RINGS + 1. |
| dirt_runs_apart | Returns a level's features with the runs and drops this view leaves out taken out, and its run plan with them. In the plan's order, each run or drop stays only if it keeps DIRT_RUN_GAP px of skin from level 1's shot and from every one kept before it: side by side they filled into a sheet. The two hung from level 1's shot and drop always stay. Then each kept run's carry-on stays where it keeps as clear, and level 2's carry-on from the first drop where level 2 shows nothing new in the zone's main facing. The plan holds the top run level's set, so every level keeps the same ones. |
| dirt_runs_key | Returns an MD5 of what runs draw, the same for runs that draw the same pixels: each role's runs in each direction, in a fixed order, with their levels. |
| dirt_shown_runs | Returns a surface's runs, as dirt_role_runs() lays them: alist(DIRT_ROLE_* define = alist(direction = runs)). |
| dirt_skin_besides | Returns the body zones whose sprites a limb skin mess draws on checks besides its own (ready_skin_masks()): for the chest the arms, which bring their hands and which no limb skin mess draws on draws (the chest checks the eyes too); for the rest none. You should NEVER modify it. |
| dirt_skin_rules | Makes a mask as skin takes goo, and returns it: no pixel without a neighbour, since a lone body dot reads as a mole and nothing smaller than 2 px stays. Goo keeps its core: flattened, it read as body paint. |
| dirt_skin_streaks | Streaks bare legs in a mask rather than coating them, and returns it: a solid coat up a bare shin reads as boots. Body pixels more than 2.5 px up a leg mostly thin to film, in clumps about a limb wide. Each pixel is judged on its own, so the mask is changed where it is. |
| dirt_skin_zones | Returns the body zones of the limbs skin mess draws on: the head, the chest and the legs, where aimed mess lands. You should NEVER modify it. |
| dirt_slot_layer | Returns the layer a worn slot's garment draws at, which its mess lies on, against which parts draw over or under it. |
| dirt_slot_redraw | Returns what to draw again on a body for an item in a slot: a DIRT_REDRAW_* flag, or NONE. |
| dirt_split_parts | Returns parts split by where they draw against a surface in one direction: list(those under it, whose share is drawn in its masks, those over it, whose share is drawn on themselves). |
| dirt_spread_noise | Returns two octaves of value noise, stretched back out to cover 0 to 1 (summed noise bunches round 0.5). |
| dirt_sprite_facings | Returns the directions a sprite has pixels in, any opacity counting, as SOUTH, NORTH, EAST and WEST flags: none for a sprite that isn't 32x32. A direction dirt_sprite_pixels() holds is taken from it; any other is read only as far as its first pixel. Parts' layers are worked out from these whenever a body with mess is drawn, so they're kept for far more sprites than whole reads are, in SSdirt.sprite_facings. |
| dirt_sprite_key | Returns text naming a sprite's icon: a file's path, or the reference of an icon made at run time, whose text is empty or its type. |
| dirt_sprite_pixels | Returns the pixels a sprite covers in one direction, any opacity counting, as indexes in row-major order on a canvas
width across and 32 tall: none for a sprite of another size. Templates and outfits share sprites (every human head,
its eyes, a jumpsuit), so each sprite's direction is read once and kept in SSdirt.sprite_reads, the least lately read
dropped first. You should NEVER modify the list it returns. |
| dirt_sprite_read_key | Returns the key dirt_sprite_pixels() keeps a sprite's direction under. |
| dirt_sprite_shows | Returns whether a 32x32 sprite has a pixel in one direction, any opacity counting, reading only as far as its first. Rows go from the middle down, then up from it: parts lie in the canvas's middle and lower rows. |
| dirt_sprite_zone_pixels | Returns which of a zone's pixels a sprite covers, read at those pixels only, facing the way that shows the zone. Kept for each sprite and zone, the oldest dropped past DIRT_COVERAGE_READS. A sprite that isn't 32x32 covers none. You should NEVER modify the list it returns. |
| dirt_sprites_key | Returns sprites as one line of text, to key masks by and to tell outfits apart. |
| dirt_surface_parts | Returns the parts a surface's splats reach, lowest drawn first: those on a zone one of the splats is on. Where each draws against the surface is worked out in each direction (/datum/dirt_part_source/proc/under()). |
| dirt_surface_rows | Returns a surface's pixels grouped by limb and row, so a feature is weighed only on the rows it can reach: alist(limb = list(list(row, lowest h, highest h, indexes), ...)), rows from the top. Built once for each surface. You should NEVER modify it. |
| dirt_taur_back_region | Returns the pixels of a taur body mess aimed at its back reaches in one direction: a band 3 px deep under the back line the view shows. None facing south (the band there is the rider's waist, which read as underwear); facing north, the columns whose top lies within 2 px below the back's middle height; in profile, the columns whose top lies within 1 px of it, less the 30% at the far end (a white tuft at the tail) and the 2 beside the rider's waist (the groin). |
| dirt_taur_blank | Returns a 64x32 blank, for masks on the taur canvas. You should NEVER modify it. |
| dirt_taur_fitted | Returns whether a garment is drawn on its wearer's taur body as a taur suit: a sprite spanning the 64x32 taur canvas, the body's own tile in its middle, which takes the taur body's pools. |
| dirt_taur_owners | Returns what each pixel of the taur canvas shows in one direction: the EXTERNAL_* layer of the taur body drawn last over it, DIRT_TAUR_RIDER where the rider (the body, 16 px in) is drawn over the taur body, or null, as dirt_taur_stack() stacks them. |
| dirt_taur_pools | Returns a back shot's pools on a taur body in one direction: dirt_mess_splat_rasterise() on the pixels the taur body shows, keeping clear of the rider's mess there. |
| dirt_taur_source | Returns a person's taur body as mess reads it, drawn or hidden (a taur suit hides it), or null without one. |
| dirt_taur_stack | Returns what a taur canvas shows, lowest first, as the reference stacks a taur under its rider: the taur body's behind and adjacent layers, the rider, then its front layers. You should NEVER modify it. |
| dirt_taur_takes_pools | Returns whether a back shot on a person also lands along their taur body's back: they have a taur body of a kind with a back (dirt_read_source(): not Big Legs), it draws now, and the surface the shot lands on isn't a garment drawn over the whole taur canvas (a taur suit), which takes the pools itself (/datum/component/dirtiness/proc/ready_taur_cloth_masks()). |
| dirt_template_key | Returns the key of the template zone sources build: an MD5 of every sprite they name, in draw order, the eyes and whether the head is a human's. Bodies drawn from the same sprites share it. |
| dirt_thickness_code | Returns the code a thickness packs as in /datum/dirt_pixels/proc/drawn(), from 0: its place among the thicknesses packed so far this round. A mask's thicknesses come from a handful of values. |
| dirt_underclothes_by_rules | Returns which underclothes a shot at a zone lands on before the human template is built: the topmost piece covering it by the rules underclothes follow elsewhere, or null. Underwear covers the groin and butt, an undershirt or bra the chest, and an undershirt the stomach and back too. A piece also covers what it hides (dirt_underclothes_hides()). |
| dirt_underclothes_hides | Returns whether the underclothes rules say a piece hides a zone outright: an undershirt that hides the groin (a corset, a leotard) the groin and butt, underwear that hides the breasts (a one-piece swimsuit) the chest. |
| dirt_underclothes_key | Returns the key a person's mess on one piece of underclothes is kept under: the slot and the accessory, so it stays with that piece while it's off. |
| dirt_underclothes_on | Returns which underclothes a shot at a zone lands on, or null for the skin. Each piece is judged by its sprite against the zone's pixels on the plain human template (dirt_human_zone_pixels()), so every body is judged on the human shape and nothing waits on its own template. |
| dirt_underclothes_sprites | Returns a body's underclothes as drawn, lowest first: list(list(DIRT_UNDERCLOTHES_* define, icon, icon state, accessory name), ...). Each is drawn as get_underwear_overlays() draws it, fitted to the body, a revealing loincloth with its flap cut away while the bulge cuts it (bulge_cut_worn()), and they stack by their accessories' layers, then in that proc's order. |
| dirt_underclothes_worn | Returns the underclothes a body draws, each its own surface: alist(DIRT_UNDERCLOTHES_* define = its /datum/sprite_accessory/clothing), as get_underwear_overlays() picks them. |
| dirt_value_noise | Returns smooth value noise from 0 to 1: the four lattice points round a sample, blended with a smoothstep. Each point is dirt_noise_hash()'s, its chain's seed steps taken once and each column's step once, for the four. |
| dirt_worn_shift | Returns where a worn garment's wrapper has its wearer's own tile, as list(pixels right, pixels up): build_worn_icon() centres the wrapper on the garment's worn dimensions, then moves it by its worn offsets, so masks drawn on the body go back by both. list(0, 0) for a 32x32 garment without offsets; list(16, 0) for a 64x32 taur suit, moved 16 px left. |
| dirt_zone_cover_flags | Returns the body_parts_covered flag each zone below the face lies under: list(zone = flag). You should NEVER modify it. |
| dirt_zone_draw_order | Returns the zones a body's limb sprites come from, in the order the body draws them: get_all_limbs() order, which for every carbon is its species' bodypart_overrides sorted by body_part (/datum/species/New()), so the chest, the head, the legs and the arms, each hand straight after its arm. Zone sources are alists, which keep no order, so they're always read in this one. |
| dirt_zone_facing | Returns the direction a zone is judged from, the one that shows it: north for the back and butt, south for the rest. |
| dirt_zone_layer | Returns the layer of the surface a shot at a zone would land on: the garment's over it, DIRT_UNDERCLOTHES_LAYER where underclothes take it, else DIRT_SKIN_LAYER. |
| dirt_zone_limbs | Returns the limb each zone's pixels lie on: list(zone = DIRT_LIMB_* define). An arm runs on into its hand. You should NEVER modify it. |
| dirt_zone_owners | Returns the zone each pixel shows in one direction, as the body draws its limb images: a list of one zone or null per pixel. The images draw the lowest layer first and in draw order within a layer, and the last one drawn over a pixel owns it: the legs' lower halves (BODYPARTS_LOW_LAYER), then the limbs and the legs' upper halves (BODYPARTS_LAYER), then the hands (BODYPARTS_HIGH_LAYER). handle_masking() splits each leg between its halves with leg_masks.dmi, so the far leg goes under everything in profile. |
| dirt_zone_pixels | Returns each drawn zone's sprite pixels in one direction: list(zone = indexes from dirt_sprite_pixels()), zones in draw order. |
| dirt_zone_sources | Returns the sprites a body's dirt template is built from, as get_limb_icon() draws them: alist(zone = list(icon file, icon state)) for each drawn limb and each hand, "eyes" = list(icon file, left state, right state) when the head draws eyes, and "human_head" = whether the head is a human's. Stumps, invisible limbs and a taur's hidden legs draw no sprite of their own, so they're left out. |
| dirt_zone_sources_drawable | Returns whether every limb sprite zone sources name is in its sheet. The eyes aren't checked: a missing eye state draws no eye, so the face is left unguarded as the body shows it. |
| dirt_zone_sources_match | Returns whether a body draws the sprites zone sources name, as dirt_zone_sources() reads them, without building them: the sheet and state of each limb in some zones and of its hand, the eyes, and whether the head is a human's. Skin mess asks it only when what a limb is drawn from has changed since it last matched (skin_reads); a worn garment's mess, a taur body's or taur suit's pools and the vulva's ring of skin ask it on every draw. |
| dirt_zone_underclothes | Returns the kinds of underclothes that belong on each zone, in the order they take a tied shot there: list(zone = list of DIRT_UNDERCLOTHES_* defines). You should NEVER modify 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. |
| do_admin_sparks | Creates non-interactive rainbow sparks at the given source location |
| do_after | Timed action involving one mob user. Target is optional. |
| do_chem_smoke | Helper to quickly create a cloud of reagent smoke reagent_type can accept a list of reagents, optionally as a key-value pair with values overriding reagent_volume if not null |
| do_foam | Proc to quickly spawn foam reagent_type can accept a list of reagents, optionally as a key-value pair with values overriding reagent_volume if not null |
| do_portal_spawn | 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_salon_work | A do_after() for the finishing touches that plays the tool's work sound, and the tattoo machine's hum, until it ends either way. |
| 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 |
| drawn_appearances | Returns every appearance drawn in an overlay layer, each before what it holds. |
| drawn_underclothes | Returns the appearance a test human's only underclothes are drawn as. Their layer also holds what their worn emissives are drawn with (prepare_worn_emissive_overlays()), which has no sprite. |
| drawn_worn_sprite | Returns the sprite a test human's worn item is drawn as in one of its overlay layers: the first appearance drawn there with an icon. The layer also holds what the item's emissives are drawn with (prepare_worn_emissive_overlays()). |
| drop_hair_trimmings | Drops a pile of hair cuttings, coloured from the hair that was just cut off. |
| ducting_layer_check | Finds a duct or plumbing machinery located at the destination |
| dump_in_space | Dump a movable in a random valid spacetile |
| dump_stack | Returns an ordered list of all our parent procs, highest to deepest. |
| 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. |
| emissive_branch_lit | Whether an emissive-plane branch glows anywhere. An emissive's colour is a matrix whose constant row turns it red
(blooming) or green; BYOND keeps a blocker's, which only multiplies, as plain black. inherited is the colour the
branch takes from above it. |
| emissive_branches | What of a look glows in the dark, for the pages that show it with the lights off. |
| emissive_branches_lit | Whether any of emissive_branches() glows, rather than only blocking. |
| emissive_holder | emissive_branches() of look in a holder that get_flat_uni_icon() draws as the emissive plane holds them, placed as
they are on the look: its layer and facing, and a blank tile of its own at the look's lower left, where the look's
own icon is. Null when there are none. |
| emissive_tri_bool_list | Returns a cached emissive boolean list for mutant bodyparts. You should NEVER modify these lists, always use Copy() if you have to. |
| 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 |
| engaged_role_play_check | Checks if a player meets certain conditions to exclude them from event selection. Returns FALSE if the player is considered ineligible for the event |
| 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 |
| female_cut_over_pecs | Returns the female cut a garment gets on wearer, as wear_female_version() takes its flags: flags themselves, unless the
wearer has pecs, which keep the torso out of it. Then only the lower body is shaped: FEMALE_UNIFORM_LOWER_ONLY where the cut
would take in the crotch, or null, no cut at all, where it would shape only the torso. Pecs of any shape count, whether
they show or not. |
| female_lower_cut_mask | Returns the mask a FEMALE_UNIFORM_LOWER_ONLY cut is drawn through: masking_helpers.dmi's full cut, less the pixels its torso-only cut shares with it, so it shapes the lower body alone. Made with each new cut, which wear_female_version() caches. |
| fill_grid_from_icon | Copies the pixel colors from the passed in icon I to the 2d list grid |
| 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_chain_step | Keeps the steps in the correct order. Arguments: |
| 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_last_punctuation | Find what punctuation is at the end of the input, returns it. Ignores emphasis (|, +, _) |
| find_maintenance_spawn | Finds us a generic maintenance spawn location. |
| find_mod_theme | Simple proc to search through mod_themes global to return a theme |
| 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_record | Returns the first record in the list that matches the name |
| find_safe_turf | Attempts to find a "safe" floor turf within some given z-levels |
| find_space_spawn | Finds us a generic spawn location in space. |
| find_vent_spawns | Finds us all suitable vent spawn locations on the station. |
| 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_items to finish equipping an item to a mob. |
| finish_unequip_mob | A utility function for /datum/strippable_items 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 |
| first_name | Find the first name of a mob from a passed string with regex |
| fit_garment_frames | Fits a garment's state in place: each direction, and each animation frame, is fitted on its own (fit_garment_view()), the front views last (GARMENT_FIT_PIECE_VIEW()). |
| fit_garment_view | Fits one view of a garment's state in place, one direction's animation frame (/datum/garment_fit_view), and draws it back over the state's own when the fit changes it. A state's views are numbered direction by direction (S, N, E, W), and frame by frame within each. Its arms' sleeves are judged from its frame's front view (garment_front_sleeves()), which must still be the garment's own: fit the front views last. |
| flash_color | Flash a color on the passed mob |
| flick_overlay_global | Add an image to a list of clients and calls a proc to remove it after a duration |
| force_apc_arcing | Set all APCs to start (or stop) arcing |
| forced_throw_vortex | Magical move-wooney but it always throws you that happens sometimes, adapted from goonchem_vortex |
| 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 |
| gags_to_universal_icon | Converts a GAGS atom to a universal icon by generating blend operations. |
| garment_colour_hue | Returns a colour's hue as the sleeve modes judge it (garment_sleeve_mode()), in whole degrees from 0 to 359, or -1 for a
grey: one whose channels spread less than percent percent of its brightest one, black included. |
| garment_colours_kin | Whether a shaded sleeve may step a pixel from colour source to the darker colour, keeping to source's family. A
colour is lit when its brightest channel is at least SLEEVE_LIT_MIN, and dark otherwise. It may when: |
| garment_fit_cache_slot | Returns the list a garment fit is cached in, under its own last key, by the keys before it, making each level as it goes. |
| garment_fit_templates | Returns the limb templates garments are fitted with, read from fitting/fit_templates.json the first time they're asked for: SSgarment_fitting reads them as the server starts. The file is compiled into the resource file, so a server has it wherever it runs. |
| garment_fit_upper_core | Returns the upper third, by rows, of a limb template's baseline pixels: on an arm, what a sleeve covers and a strap over the shoulder doesn't. The sleeve test reads it (/datum/garment_fit_view/proc/apply_bands(), garment_front_sleeves()). |
| garment_frame_count | Returns how many animation frames a garment's state has, counted from its front view, up to GARMENT_FIT_MAX_FRAMES. |
| garment_front_sleeves | Returns which of a garment's fitted arms it has a sleeve over, judged from its front view, where the arms show whole: fitted arm -> whether the garment covers at least half of the upper third of the arm's baseline pixels there. A short sleeve covers the upper arm and counts, where a strap over the shoulder covers a pixel or two of it. Every view's fit uses it (/datum/garment_fit_view/proc/apply_bands()). Null when no arm is fitted. |
| garment_metadata | Returns fitting/garment_metadata.json's sheets, by path, read the first time they're asked for: SSgarment_fitting reads them as the server starts. See garment_sheet_metadata(). |
| garment_near_grey | Whether a colour is a near-grey: its channels spread less than twice SLEEVE_GREY_PERCENT percent of its brightest one, black included. A greyscale garment's own faintly blue shading falls either side of the grey line, but is near-grey. |
| garment_pec_flex | Returns a pec flex's templates, as garment_pec_templates() holds them under flexes: its frame delays, and its shapes,
each shape's templates by view on each of its frames. Null for a sheet that isn't a pec flex's, like a jiggle's, or none. |
| garment_pec_templates | Returns the templates tops are fitted to pecs with, read from fitting/pec_templates.json and fitting/pec_flex_templates.json the first time they're asked for, as the limb templates are. |
| garment_sheet_metadata | Returns what garment fitting knows of a sheet without reading its pixels, from fitting/garment_metadata.json: sleeves, its
states whose own sleeves pick shaded sleeves -> TRUE, and colours, for each state whose fits read whole views, those views'
colours as fit_garment_view() takes them, or null for a view read from its pixels. Null for a sheet it doesn't know, like a
generated icon, or one that changed after the file was written: those are read from their pixels. |
| garment_sleeve_mode | Returns the mode a worn garment is fitted in when it doesn't set its own, picked from its sleeves in its front view. |
| 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_clockcult_scriptures | Generate all scriptures in a global assoc of name:ref. Only needs to be done once |
| generate_cult_rune_types | Returns an associated list of rune types. [rune.cultist_name] = [typepath] |
| generate_customizable_races | Generates races available to choose in character setup at roundstart, yet not playable on the station. |
| generate_filter_immune_string | Generates a static string appended to the venom milker's description, detailing which reagents available to the venom quirk will not be transformed into /datum/reagent/generic_milked_venom. |
| generate_generator_index | Creates generator__id => type map. |
| generate_hallucination_weighted_list | Generates the global weighted list of random hallucinations. |
| generate_heretic_starting_knowledge | Modifies the 2 lists provided in the arguments and sets it up so the heretic can actually start researching stuff. Specifically generates the tier 1-4 knowledges + start ones for each path as well for the preview (should probably be moved to use the actual list of per-path researches) Importantly, this adds HKT_NEXT's for the starting knowledges so the heretic's next researches are considered valid |
| generate_holiday_races | Every species with a holiday of its own that the roundstart races config doesn't already allow: id -> holiday. |
| 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_milkable_venom_list | Generates a static list of /datum/reagent that will not be transformed into /datum/reagent/generic_milked_venom upon being milked by a venom milker. |
| generate_number_strings | Generates and returns a list of both arabic and roman numerals for 1 through 99 |
| 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 the reagents in our given list taste like |
| generate_seed_data_from | Returns a list of seed data generated from the given seeds. Filling the "name", "icon" and "icon_state" fields of the data is the caller's responsibility. |
| 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_taur_clothing | Proc to generate a taur variation of clothes, with the intent of caching them. It is meant for suits and uniforms at the moment, to cut out the bottom half so that it doesn't look too out of place. |
| 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. |
| genital_option_label | Reverse lookup: the label whose define matches the current value, or null. |
| get | Returns the atom type in the specified loc |
| getFlatIcon | Create a single /icon from a given /atom or /image. |
| get_abstract_branch_descendants | Returns a list of concrete types under abstract sub-branches of root |
| get_abstract_types | Returns a list of all abstract typepaths for all datums |
| get_active_player_count | Counts active players who are playing in the round |
| get_active_player_list | 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_adjacent_turfs | Returns a list of all turfs that are adjacent to the center atom's turf, clear the list of nulls at 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_antag_flags | Returns a list of all antag flags that are available to the player |
| 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_announcement_system | Returns a random announcement system that is operational, has the specified config entry, signal can reach source and radio supports any channel in list. All args are optional. |
| get_anomaly_protection | Calculates mob effect protection returns NO_ANOMALY_PROTECTION if not human, returns calculated protection otherwise higher returning number means less protection |
| 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_blood_type | Returns the blood_type datum that corresponds to the string id key in GLOB.blood_types |
| 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_bulge_palette | The adaptive palette of a cloth colour in a finish (BULGE_FINISH_*): five "#rrggbb" strings, cloth, light, highlight, shade and deep shade, or null for no colour. One shared list per (colour, finish): never change it. |
| 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_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_color_from_blood_list | Returns the hex color string, or a color matrix, of a given blood_type datum given an assoc list of blood_DNA e.g. ("Unknown Blood Type", "*X") |
| 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_customizable_races | Gets a list of all customizable races on roundstart. |
| get_decoration_color_from_pattern | Proc to return colors for recoloring atoms based on a pattern and the position of the atom. Primarily used by holidays |
| get_display_icon_for | Gets the relevant universal icon for an atom, when displayed in TGUI. (see: icon_state_preview) Supports GAGS items and colored items. |
| 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_emote_sound_from_list | Gets an emote sound from a specific list of sounds. Supports lists and genders. Used by emote datums for default sounds, and tongues, masks etc. for overrides. |
| 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_flat_uni_icon | getFlatIcon for /datum/universal_icons Still fairly slow for complex appearances due to filesystem operations. Try to avoid using it grow: the canvas fits every overlay, nested ones where they really are; see flat_x1. |
| get_frozenwake_puzzle_area | Proc used to check if get_area returns the frozenwake puzzle area. |
| get_garment_fit | Returns the garment fit to these muscle sizes and pecs, made the first time it's asked for. |
| 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_hear_turfs | get_hear that only gets turfs so we can use as_anything |
| 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_looc_range | |
| get_hearers_in_radio_ranges | Returns a list of mobs who are in hearing range of every radio in the list of radios given |
| get_hearers_in_radio_ranges_track_radios | Returns a list of mobs who can hear any of the radios given in the given radio list, indexed by the radio. More expensive than get_hearers_in_radio_ranges() |
| 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_holiday_races | Species that are roundstart races only during a holiday, as an assoc list of id to holiday. |
| get_icon_dimensions | Returns a list containing the width and height of an icon file |
| get_icon_dimensions_pure | Returns a list containing the width and height of an icon file, without using rustg for pure function calls |
| 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_job_hud_icon | Returns the (isolated) security HUD icon for the given job. |
| 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_linked_z_levels_in_range | Gets all connected z-levels within a given manhattan distance of center. |
| get_liquid_color_factor | Returns the LIQUID_COLOR_FACTOR_* that a pool of this LIQUID_SURFACE_* class scales its mix colour by. |
| get_liquid_reagent_look | Returns what liquids read off a reagent type, worked out once per type. |
| get_liquid_surface | Returns the surface a pool of these reagents draws. |
| 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_loc_from_mousepos | Converts mouse-pos control coordinates to a specific turf location on the map. |
| get_lone_liquid_color | Returns the colour of a pool holding only one reagent type, at any volume above 0, worked out once per type. |
| get_matching_bitflags | Returns null if no such field exists, a list of all matching flags by name otherwise |
| get_messenger_name | Get the display name of a messenger instance |
| get_minimap_blips_in_area | Returns minimap blips matching a tag that are within distance tiles of target_turf on the same z-level. |
| get_minimap_for_z | Gets the /datum/minimap for a Z-level - generating it if it hasn't been yet. |
| get_mob_admin_traits | Returns only traits that apply to mobs |
| 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. If playtime tracking is disabled, just returns the first player in the list. |
| get_nested_locs | Returns a list of all locations (except the area) the movable is within. |
| get_officer_department | Returns the department a new officer should go to: the least populated one, favoring their preference on ties. |
| 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_protean_chest_component | Gets the protean chest component from a mob. Returns null if not protean. |
| get_protean_modsuit | -- Helper procs -- Gets the protean modsuit from a mob's chest component. Returns null if not protean or no modsuit. |
| 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_food | Get a random food item exluding the blocked ones |
| get_random_hallucination | Select a random hallucination from the hallucination pool |
| get_random_jumpskirt | Returns a random, acceptable jumpskirt typepath |
| get_random_jumpsuit | Returns a random, acceptable jumpsuit typepath |
| get_random_manual | Gets a random manuel book type excluding certain banned books |
| get_random_neuroware | Returns a random neuroware reagent type. Excludes aphrodisiac reagents. |
| 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_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_safe_random_station_turf_equal_weight | Returns a random department of areas to pass into get_safe_random_station_turf() for more equal spawning. |
| get_sane_item_types | Used for random item gen to try and generate a list of types that arent weird parent types and similar |
| 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_species_page_ids | Every species the species page offers, as an assoc list of id to TRUE. |
| get_species_page_renders | Draws every species on the species page facing each way, without uniform and then in it, as list("body" = entries, "uniform" = entries) in insert_icon()'s entry format. Both sheets take their half from the one drawing, and later callers wait for the first to finish. |
| 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_synthesizable_reagent_subtypes | Returns a list of all subtypes of base_type reagent that can be synthesized. If none qualify, returns an empty list — caller should handle fallback. |
| 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_bitflags | Returns an associative list of bitflag name -> number for all valid bitflags in the passed in field |
| get_valid_screen_location | Returns a valid location to place a screen object without overflowing the viewport |
| get_valid_teleport_turf | Check for turfs within range of the center turf and perform simple checks to see which is a valid teleportation target. If so, add it to a list to pick the final destination from at the end. |
| 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 |
| get_vox_glove_color | Gloves have no leg/foot sample point. Use their most common visible source color. |
| give_admin_popup | Tries to give the target an admin popup. If it fails, will send the error to the passed admin. |
| give_feline_taur | Makes a human a feline taur, the taur whose tail is drawn separately, and returns its taur body. |
| goonchem_vortex | Magical move-wooney that happens sometimes. |
| graffiti_anchor_for | Returns where graffiti painted on a turf lives across rounds: a station anchor, the turf's coordinates and area, and
its graffiti_surface_kind() as its surface. |
| graffiti_anchor_resolve | Returns the turf an anchor names this round, when it is still the kind of surface the graffiti was painted on. |
| graffiti_anchor_waits | Whether an anchor that doesn't resolve is only waiting, so the round isn't counted as a miss: no system has registered a resolver for its kind this round. |
| graffiti_art_decode | Decodes an art, such as one read from a map file, when it can be drawn: a one- or two-tile width, a palette of 1 to GRAFFITI_FLAT_MAX_COLORS colours, and a grid and glow mask that both cover every pixel. |
| graffiti_art_glow_kind | Returns which of an art's painted pixels glow, which decides its emissive overlays. |
| graffiti_art_hash | Returns an art's content identity, which tiles showing the same art share. |
| graffiti_art_icon | Returns an art drawn as an icon, which every tile showing that art shares. Its paint shows at its real alpha (graffiti_drawn_colors()). |
| graffiti_art_pixels | Counts an art's painted pixels. |
| graffiti_blank_icon | Returns a new transparent icon one or two tiles wide. |
| graffiti_blend | Blends a colour over another as placed graffiti shows them, in their real alphas: GRAFFITI_ALPHA_CEILING for opaque paint and its own for translucent paint. The standard "over" operator gives the alpha and the colour, and an alpha that reaches the ceiling is stored opaque. |
| graffiti_clean_text | Cleans player text for a piece's name, description or layer names, so that cleaning it again changes nothing. |
| graffiti_clip_record | Returns a decoded art or layer with paint left only where a poster takes it. |
| graffiti_color | Returns a colour in its canonical graffiti form: lowercase #rrggbb when its alpha reaches GRAFFITI_ALPHA_CEILING,
the alpha placed graffiti draws opaque paint at, and #rrggbbaa below it, raised to GRAFFITI_ALPHA_FLOOR when lower.
So a stored colour's real alpha is the ceiling when it has seven characters, and its own alpha when it has nine. |
| graffiti_copy_piece | Returns a copy of a canonical piece that shares no list with it, such as one to hand on from a library, which keeps its own. deep_copy_list() would turn the list of layers into an associative list. |
| graffiti_credit_painter | Marks graffiti as a painter's work as they finish a piece on it: their hidden print, and once only the art element, which every piece stacked on a tile, or sprayed over a poster, shares. |
| graffiti_decode_flat | Decodes a flat art grid that graffiti_encode_flat() wrote. Hostile input is refused before anything is
expanded, and decoding stops at pixel_count whatever the runs claim. |
| graffiti_default_palette | Returns the colours the graffiti editor offers before a piece has its own: black and Endesga-32's greys, hues, browns and skin tones, a few pastels, then neons for glow layers. |
| graffiti_draw_icon | Draws pixels on a new icon as horizontal runs, one DrawBox() for each run of one colour. |
| graffiti_drawn_colors | Returns colours as placed graffiti draws them, in their real alphas: opaque ones at GRAFFITI_ALPHA_CEILING, so the surface shows through, and translucent ones at their own, which is below it. None draws above the ceiling. |
| graffiti_drop_loose_paint | Drops for good the paint a stopping piece has placed, both halves of a two-tile one, when a tile of it offers no surface now, as a pane loosened under it leaves one: a loose pane drops the piece in progress whole. Graffiti finished there stays. |
| graffiti_editor_for | Opens a graffiti editor for a player, ending any editor they already have. A surface session shakes the can. |
| graffiti_editor_test_begin | Points the graffiti registry and libraries at the scratch directory, with the test account's library empty. |
| graffiti_editor_test_end | Ends the test account's graffiti editor, takes the test ckey back off its painter, and puts the registry, the library directory and the account's library and cooldowns back. |
| graffiti_editor_test_painter | Puts a painter for the test account beside a wall, holding an uncapped spray can. |
| graffiti_editor_test_paste | Returns a one-pixel green paste on the bottom layer's top row, as the editor's window sends pasted paint it drops. |
| graffiti_editor_test_stroke | Returns a one-pixel pencil stroke on the bottom layer's top row, as the editor's window sends it. |
| graffiti_emissive_overlays | Returns the overlays that light an art's glowing paint on the emissive plane and let its other paint block the glow of whatever lies beneath it. |
| graffiti_encode_flat | Encodes palette indices as a flat art grid. |
| graffiti_encode_piece | Returns a canonical piece as the text Export writes, format and version first. |
| graffiti_export | Sends a saved piece to a player as a downloaded file. custom_style_send_text() claims the account's transfer slot and export cooldown, which custom styles share. |
| graffiti_file_key | Returns text made safe to name a file or directory with. |
| graffiti_flat_codes | Returns the characters a flat grid writes, built once, so encoding looks each run's characters up instead of cutting text and calling custom_sprite_canvas_code() for every run, and the glow of art that glows nowhere at each width. |
| graffiti_flatten | Flattens a piece's layers into one art, or only as much of them as a paint job has revealed. |
| graffiti_flatten_records | Flattens decoded layers into one art, or only as much of them as a paint job has revealed. Nothing is encoded or decoded on the way, so it is graffiti_flatten() for layers already decoded. |
| graffiti_glow_icon | Returns an art's glow mask: white wherever its paint glows, as opaque as the paint is drawn there. |
| graffiti_import | Lets a player import a graffiti piece file into their library as a new piece. This sleeps while the file dialog is open. |
| graffiti_json_decode | Decodes a graffiti file's JSON, such as a piece's or a map's, as hostile input, without validating what it holds. |
| graffiti_layer_records | Decodes a piece's layers for graffiti_merge_arts(), each against the piece's whole palette, glowing on every pixel or on none. A paint job keeps its piece's records, so its steps never decode the layers again. |
| graffiti_library | Returns an account's library, loading it from its file when it isn't loaded, as on first use or after it unloaded. |
| graffiti_library_check | Returns a piece in the canonical form a library keeps, or why a library can't keep it. |
| graffiti_library_delete | Deletes an account's library, file and all, as an admin purge does. A library still held elsewhere is emptied and can't write its file back. |
| graffiti_library_flush | Writes the library changes the write pacing still holds back, as the round ends or the world stops. |
| graffiti_library_paced | Paces an account's next graffiti library write by the one just made: a player's waits GRAFFITI_LIBRARY_WRITE_PACE times as long as it took, and at least a second, and a change the server makes is held back as long. |
| graffiti_library_path | Returns where an account's library file lives, in a directory named by the ckey's first character. |
| graffiti_library_test_reset | Points the graffiti library directory at root, then forgets the test account's library and its write pacing and
deletes the scratch directory, so a test starts and ends with no library files. |
| graffiti_library_unload | Unloads an account's library as its owner disconnects, unless something still holds it: an editor session or a paint job of the account's, a write the pacing holds back, or an import or export under way. An editor or paint job that ends, and a held write once made, ask again while the owner is away; an import or export doesn't, so its library waits for the owner's next disconnect or the reboot. graffiti_library() loads it again when it is next wanted, under a newer revision. |
| graffiti_library_write_due | Whether a player may write their graffiti library now, starting a second's wait if so. Each write rewrites and checks the whole file, so the account's saves, imports and exports share the wait, which is kept beside its style transfer cooldowns, and each write lengthens it by its cost (graffiti_library_paced()). |
| graffiti_library_write_wait | Returns how long until an account's graffiti library may be written again. |
| graffiti_merge_arts | Merges arts of one width into one, bottom to top. |
| graffiti_merge_fingerprint | Returns a fingerprint of what merging gives: the alpha ceiling and the hash of one fixed merge of opaque and translucent paint, glowing and not, made once. The map file keeps it beside its stack cache, so a cache written before merges changed is set aside rather than show stacks under keys today's merges wouldn't give. |
| graffiti_new_sheet | Returns a new sprite sheet for icons of one width. BYOND can't remove a state, so the blank's own transparent state, "", stays beside the states added to it. |
| graffiti_palette_pack | Packs canonical colours into one string of nine-character #rrggbbaa entries, the form placed art keeps
its palette in. |
| graffiti_palette_unpack | Unpacks a palette graffiti_palette_pack() wrote. Only its lowercase spelling is read, so an art has one packed form and one hash. |
| graffiti_poster_look | Returns what a poster offers graffiti, read from its icon pixel by pixel: the pixels it shows, which alone take paint, and the poster itself as an art, for the editor's window to draw beneath the canvas. Kept for each icon and state; a poster drawn at runtime, as a wanted poster is, is read each time. |
| graffiti_poster_test_stroke | Returns a one-pixel pencil stroke on the bottom layer, as the editor's window sends it. |
| graffiti_receive | Asks a player for a graffiti piece file and decodes it. This sleeps while the file dialog is open. |
| graffiti_register_anchor_resolver | Lets a system that loads its own spaces, such as condos, place graffiti in them: its anchors are resolved through
callback, called with the anchor and returning a turf or null. |
| graffiti_registry_release | Takes the graffiti of one unloading space off its tiles and keeps it dormant, still in the map file. Call it before the space's turfs change: a decal whose turf stops taking graffiti first loses its graffiti for good. |
| graffiti_registry_test_begin | Empties the graffiti registry and points it at a scratch map file, with its sheets in the scratch directory too. |
| graffiti_registry_test_end | Empties the graffiti registry, takes the test room down (graffiti_test_room()), puts the registry's test settings back and deletes the scratch directory. The registry points at the current map's own file again but stays frozen, so nothing the rest of a test round does is written over it. |
| graffiti_release_merges | Lets the decals of a piece's tiles go of their merges once its painter stops painting there (release_merges()). |
| graffiti_resume_anchor | Returns the anchor a stopped piece resumes on: its left tile's, with the kind of surface its paint went on, which a window fastened over floor paint since doesn't change. |
| graffiti_resume_placements | Returns the placements a stopped paint job or freehand session left on a surface, to resume them there: those with its placement id on the tile and, for a two-tile piece, on the tile to its right. They resume only on the same map and the same tile, and only while every tile that showed paint still shows it. |
| graffiti_resume_tile | Returns the tile a stopped paint job or freehand session left its paint on, the only one it resumes on: the left tile of the placements with its placement id that still show on this map. |
| graffiti_reveal_bounds | Returns how much of a piece shows once a paint job has revealed some of its strips, as graffiti_flatten() takes it. |
| graffiti_reveal_units | Returns how a paint job reveals a piece: in strips GRAFFITI_REVEAL_STRIP pixels wide, left to right across each layer in turn, from the bottom layer up. |
| graffiti_shake | Plays a spray can's shake, as a freehand session or a paint job starts. |
| graffiti_sheet_add | Adds an icon to a sprite sheet as a state of its own, replacing any state of that name. |
| graffiti_sheet_path | Returns where one of a map's sprite sheet files lives. |
| graffiti_split_wide | Splits a wide art into the arts of its two tiles. |
| graffiti_spray | Plays the spray sound where paint lands, at most once a clip, however often a sprayer paints. |
| graffiti_static_station | Whether a turf is the station as the map built it, the only place graffiti goes: a station level's turf in a station area, neither a shuttle's nor the holodeck's, and outside every map template loaded on the station this round, such as a random room. Other levels, bitrunning and reserved space, ruins and the like take none. A system that loads spaces of its own, such as condos, registers an anchor resolver for them instead (graffiti_register_anchor_resolver()). |
| graffiti_station_levels | Returns the station levels in ascending order. |
| graffiti_station_ordinal | Returns where a z level falls among the station levels, which anchors keep instead of the z level itself. |
| graffiti_station_z | Returns the station level at an anchor's ordinal. |
| graffiti_surface_full | Whether adding a piece would exceed the tile's stack. Resuming a piece already there needs no new slot. |
| graffiti_surface_kind | Returns the kind of surface a turf offers graffiti: a wall, the glass of a full-tile window fastened down on it, or a floor with ground. A loose full-tile window still covers its floor, and a directional window changes nothing. |
| graffiti_surface_ok | Whether a turf takes graffiti: a wall, a floor with ground, or a full-tile window fastened down on it, on the static station (graffiti_static_station()). |
| graffiti_test_art | Returns a one-tile art with one or two red pixels. |
| graffiti_test_cameras | Counts the cameras on the station levels. |
| graffiti_test_chunk_turfs | Returns tiles of the test room (graffiti_test_room()) that take graffiti under a station anchor, all in one of the 16-tile chunks build_sheets() packs together, the same ones every call. |
| graffiti_test_counts_match | Whether a graffiti workspace's colour counts hold what its layers do, read pixel by pixel. |
| graffiti_test_dense_art | Returns a one-tile art painted on every pixel, no two neighbours alike, from forty colours, every other pixel glowing, so its composite and glow mask take as many runs as a tile's art can. The same index gives the same art. |
| graffiti_test_floors | Returns floors of the test room (graffiti_test_room()), where graffiti gets a station anchor. |
| graffiti_test_golden_piece | Returns a fixed piece for the flattened-bytes test: an opaque red base on rows 1-30, a translucent green glowing layer on rows 9-16 and a translucent white unlit one on rows 13-20, so it blends translucent over opaque and translucent over translucent, and its glow is mixed. |
| graffiti_test_index_problem | Compares the registry's index of each account's placements with a scan of the placements themselves. |
| graffiti_test_mounted | Whether anything wall-mounted is on a wall or on the turfs beside it, where it may hang from the wall. |
| graffiti_test_piece | A raw piece as Export writes it: an opaque and a translucent pixel at the top left of an unlit layer, under a glowing layer with one translucent pixel at the bottom right. |
| graffiti_test_placement | Finds a placement by its id. |
| graffiti_test_room | Returns the room the graffiti tests paint in, built the first time a test asks and taken down by graffiti_registry_test_end(): walls round floors, with a row of GRAFFITI_TEST_ROOM_ROW walls across them, built on empty space of a station level and moved into a station area, so its every tile takes graffiti under a station anchor. No map is relied on to have such walls, as the unit test map, runtimestation_minimal, is all space. The room sits inside one of the 16-tile chunks build_sheets() packs together. |
| graffiti_test_room_end | Takes the graffiti test room down, if a test put it up: deletes all a test left in it, then turns it back into the space of the space area it was. |
| graffiti_test_walls | Returns walls side by side, west to east, in the test room (graffiti_test_room()), each between two floors so that turning one into a floor opens no room to space, and with nothing wall-mounted on it or around it. The same walls come back every call. |
| graffiti_tile_decal | Returns the custom graffiti decal of the surface a turf offers now. |
| graffiti_trim_wide | Narrows a two-tile piece to one tile when no layer paints its right tile, as a wide canvas left blank there saves. |
| graffiti_unix_time | Returns the current unix time in whole seconds, as the ten-digit text libraries store and sort. BYOND numbers can't hold it exactly. |
| graffiti_unlit_glow | Returns the glow of art that glows nowhere, as graffiti_encode_flat() writes it and decoded, which graffiti_flat_codes() makes once for each width, so decoded arts that glow nowhere share one list. |
| graffiti_validate_piece | Strictly validates a library piece, as Export writes it and Import reads it. Nothing is salvaged, and messages never repeat uploaded text. |
| graffiti_wide_ok | Whether a two-tile piece fits with its left half on a turf: the turf and the one to its east both take graffiti, on the static station, and are of one kind, both walls, both floors or both windows, which draw their graffiti differently. |
| graffiti_window_of | Returns the full-tile window fastened down on a turf, whose glass takes graffiti. Directional windows never do. |
| 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. |
| has_blood_flag | Checks if any of the passed blood types have certain blood flags |
| 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. |
| hidden_slots_to_inventory_slots | Convers HIDEX to ITEM_SLOT_X, should be phased out in favor of using latter everywhere later |
| holosynth_drop_unkept_items | Drops everything the holosynth has equipped except items in the slots they get to keep (ID + pockets). |
| 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 |
| husk_toned_sheet | Returns an icon sheet toned the way a husk is drawn. |
| 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 whether a given icon state exists in a given icon file. If file and state both exist,
this will return TRUE - otherwise, it will return FALSE. |
| icon_exists_or_scream | Functions the same as /proc/icon_exists(), but with the addition of a stack trace if the
specified file or state doesn't exist. |
| icon_metadata | Returns rustg-parsed metadata for an icon, universal icon, or DMI file, using cached values where possible Returns null if passed object is not a filepath or icon with a valid DMI file |
| icon_states_fast | Cached, rustg-based alternative to icon_states() |
| icon_transformer_from_list | Reverse operation of /datum/icon_transformer/to_list() |
| iconforge_drawn | A drawing is done: a character preview's, or share of one for a smaller picture, like the custom sprite editors'.
iconforge keeps every image it makes until it is told to let them go, and a look is hardly ever drawn twice, so what
it keeps only grows, by 80 to 330 KB a look. Every CHARACTER_PREVIEW_CLEANUP_EVERY looks' worth it lets go, once no
character preview is under way: one under way would come out empty. Until then new previews wait, for a tick or
two, and the last preview under way lets go when it is done. Spritesheets being made let go themselves once they
are done, so it waits for them to finish. |
| inLineOfSight | Calculate if two atoms are in sight, returns TRUE or FALSE |
| init_Exports | Called when the global exports_list is empty, and sets it up. |
| init_blood_types | Initializes the list of blood type singletons |
| 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_discountable_packs | Caled when the global discount pack list is initialized |
| init_fitness_definition_sheets | Returns GLOB.fitness_definition_sheets. |
| init_fitness_limb_families | Returns GLOB.fitness_limb_families, built from the size subtypes. |
| init_fitness_limb_sheets | Returns GLOB.fitness_limb_sheets. Sheets are files, so it is built here rather than written as a list literal. |
| 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_main_girder_wall_recipes | Initializes the main, false and tram wall types using three lists of wall types. |
| init_material_girder_wall_recipes | Initializes the normal and false girder material wall recipes using two lists of material wall types. |
| init_pirate_gangs | initializes the pirate gangs glob list, adding all subtypes that can roll today. |
| init_plant_traits | Inits GLOB.plant_traits |
| init_random_ship_events | Initializes the random ship events glob list, adding all subtypes that can roll this shift. |
| init_subtypes | Creates every subtype of prototype (excluding prototype and abstract types) and adds it to list L. If no list/L is provided, one is created. |
| init_subtypes_w_path_keys | Functions like init_subtypes, but uses the subtype's path as a key for easy access If no list/L is provided, one is created. |
| 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_color_dark_with_saturation | Given a color in the format of "#RRGGBB", will return if the color is dark. Value is mixed with Saturation and Brightness from HSV. |
| 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_factual_sprite_accessory | This will check if SSaccessories.sprite_accessories[mutant_part]?[part_name] is associated with sprite accessory with factual TRUE. |
| is_file_type | Verifys wether a string or file ends with a given file type |
| is_file_type_in_list | Verifys wether a string or file ends with a given file type. |
| 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_mononym | Find whitespace or dashes in the passed string with regex and returns TRUE if found |
| is_mutation_restricted_for_quirks | Helper proc to check if a mutation is restricted by any of the given quirk names Returns TRUE if the mutation is restricted (not allowed), FALSE otherwise |
| is_mutation_restricted_for_species | Helper proc to check if a mutation is restricted for a given species Returns TRUE if the mutation is restricted (not allowed), FALSE otherwise |
| 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_plain_bodypart_mask | Whether a bodypart appearance is a standard glow/blocker sprite that can move into a shared emissive boundary. Inset husk blood, other composite effects and prepared boundaries keep their own roots. |
| is_plain_bodypart_sprite | Whether a bodypart appearance draws the same nested in an unshifted holder as it does on the mob: floating, default blending, and not reaching past its parent with KEEP_APART or RESET_* flags. Iconless holders such as inner ears and MOD textures qualify; their contents are unchanged. |
| is_safe_turf | Checks to see if a given turf is a "safe" location. Being safe requires the following to be true: |
| 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_symphony_whitelisted | Admission check: allow access when enforcement is disabled; deny on a database failure. Use symphony_whitelist_lookup() when the caller must distinguish a denial from an outage. |
| 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_uppercase | Checks if the passed string is all uppercase, ignoring punctuation and numbers and symbols |
| 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_wire_tool | Is the passed item a tool that would interact with wires? |
| 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 |
| keep_hairstyle | Writes a hairstyle to the character slot this body spawned from, and saves it to disk. |
| 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 |
| language_understanding_sample | A sample line in a language, as heard by someone who follows this much of it. Kept, so a level's sample stays put. |
| last_name | Find the last name of a mob from a passed string with regex |
| 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 |
| list_holy_successors | Create a list of the holy successors mobs from GLOB.holy_successors weakref list |
| 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. |
| load_whitelist | Loads the whitelist. Tries to load it from the database if enabled, otherwise will load it
from the legacy whitelist.txt file as normal. |
| load_whitelist_legacy | Loads the whitelist with the legacy way of loading it (from the whitelist.txt file). |
| 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_blood_worm | Logs blood worm events like entering/leaving a host. |
| log_bomber | Logging for bombs detonating |
| log_borer_evolution | Logging for borer evolutions |
| 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_creator | This logs character creator changes in debug.log |
| 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_law_change | Adds something to the law change log |
| 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_minimap_drawing | Logging for drawing on minimap |
| 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/persistent_client 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_player_image_creation | Log the creation of an image by a player |
| 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_reta | Request Emergency Temporary Access - RETA System Provides temporary department access when Requests Console emergency calls are made. Helper function for RETA-specific logging |
| 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_subtle | This logs subtle emotes in game.log |
| log_subtler | This logs subtler emotes in game.log, if the conflig flag in config\nova\config_nova.txt is true. |
| 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_tts | Logging for TTS |
| 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: |
| lowercase_title | Ensures text does not start with capital letters. |
| make_associative | Make a normal list an associative one |
| make_body | Uses stripped down and bastardized code from respawn character |
| make_datum_reference_lists | //Initial Building///// |
| make_into_clown | Helper proc that handles making someone into a clown after a bananium nuke goes off. |
| make_knowledge_id | ID's are not unique, the same knowledge with the same type in the same shop will always have the same ID. |
| make_mutable_appearance_directional | Takes an input mutable appearance, returns a copy of it with the hidden flag flipped to avoid inheriting dir from what it's drawn on This inheriting thing is handled by a hidden flag on the /image (MAs are subtypes of /image) |
| make_tuple | Returns the name of the mathematical tuple of same length as the number arg (rounded down). |
| marking_fur_colors | Returns the three mutant colours a marking can follow, as a body's DNA features hold them: what a new marking, a preset or a colour reset gives it. |
| markings_baseline_fill | Builds the fixture's marking map in the nested shape a savefile holds: zone -> (marking name -> list(color, emissive)). |
| markings_baseline_is_glowing | Tells a glowing emissive appearance from an emissive blocker, which shares its plane. |
| markings_baseline_marking_colors | One fixed colour per fixture marking, so no signature ever depends on a mutant colour roll. |
| markings_baseline_marking_names | Fixtures the body marking tests share: the markings a test body wears and their colours, the standard and merge fills, a rendered icon's pixel signature and the emissive glow check. Their names come from the before/after baselines the markings datumisation was measured with. The markings the fixture wears. Each one claims all eight marking zones and ships art for every one of them plus both leg shapes, so no case falls back to a sheet's default frame and hides a difference. Named explicitly rather than read out of GLOB.body_markings_per_limb, whose order can change. |
| markings_baseline_signature | Reduces a rendered icon to one comparison key. |
| markings_merge_fixture_color | The one colour every marking of the merge fixture wears. |
| markings_merge_fixture_fill | Builds the merge fixture's marking map, in the same nested shape as markings_baseline_fill(): the same three markings on every zone, all in one colour and all glowing. Each zone's markings then run together in colour and in glow, which the standard fixture, three colours with one glow per zone, never does. Its tests draw a zone's same-coloured markings, and its glows, as one. |
| 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. https://www.byond.com/forum/post/2611357 |
| merge_body_marking_run | Draws a run of markings, or of glows, with its first appearance as drawn into the output list, a dropped limb's image of it included: that appearance takes the run's blended icon and keeps its own colour, alpha, layer, plane, flags and facing, so it draws what the run's appearances drew one on another. |
| meridian_theme_art | Returns the art asset a MeridianOS theme draws with outside tgui's bundle, or null for a theme whose art is all in it. |
| 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 |
| metal_transmute | Change the material type of an object or turf, but with visuals and effects related to the material |
| 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. |
| mix_colors_by_volume | Returns the volume-weighted RGB mean of a colour to volume list, as "#rrggbb" with alpha ignored, or null when it holds no volume. |
| mix_liquid_color | Returns the volume-weighted RGB mean of a reagent type to volume list, as "#rrggbb". |
| mix_opacity_from_reagent_list | Returns the volume-weighted liquid_opacity of a reagent type to volume list, from 0 (clear) to 1 (opaque). |
| mob_only_listeners | A filter to be applied to get_hearers_in_x, that removes any non-mob hearers, converting them to their relevant mob if one exists (such as dullahan heads). Modifies input list. |
| mobs_in_area_type | Takes: list of area types Returns: all mobs that are in an area type |
| modular_persistence_account_key | Normalizes an admitted or cryo account key, including aghost's prefix. An absent key has no save identity. |
| 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_all_banned_players | Notifies all banned players about their ban and gives them a link to appeal from the config. If it was a server ban, it also kicks them. |
| 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 |
| offer_to_keep_hairstyle | Asks the freshly cut recipient whether to keep the style beyond this round. |
| 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 |
| onclose | Registers the on-close verb for a browse window (client/verb/windowclose) this will be called when the close-button of a window is pressed. |
| 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 |
| painting_pixels_from_icon | The painting store's pixel string: every pixel of the drawing, row by row, as the canvas grid writes them. |
| painting_store_failure | Build the common failure envelope used by the DM transaction queue and native calls. |
| params2screenpixel | Converts a screen loc param to a x,y coordinate pixel on the screen. |
| 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. |
| phase_filter | Cool filter that I'm using for some of this :))) |
| pick_closest_path | Returns a chosen path that is the closest to a list of matches |
| pick_holy_successor | Chooses a valid holy successor from GLOB.holy_successor weakref list and sets things up for them to be the new high priest |
| pick_n | Picks n items from a list. The same index will not be chosen more than once. e.g. pick_n(list_of_stuff, 10) would return a list of 10 items from the list, chosen randomly. |
| pick_n_take | Pick a random element from the list and remove it from the list. |
| pick_recursive | Similar to pick_weight_recursive, except without the weight part, meaning it should hopefully not take up as much computing power for things that don't +need+ weights. |
| 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_weight_take | |
| 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. |
| playsound_if_pref | playsound_if_pref is similar to playsound but it doesn't play for ghosts, and checks for prefs.
This is useful if we have something like the organic interface content, which everyone may not want to hear. |
| playsoundtoken | Creates a soundtoken datum (a sound that updates for movement). allowed_listeners is an optional list of mobs that are the only ones that can hear this sound ever. sound_length is an optional length of the sound. Things like TTS need to pass this since we can't dynamically grab the length in that case. |
| 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_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) |
| populate_interaction_instances | Global loading procs |
| populate_reta_job_trims | Populates the job trims list for RETA system |
| populate_rtd_datums | Lazy-initialize the datum field on all the designs |
| populate_virtual_areas | Constructs the list of virtual areas |
| power_fail | Disables power in most station APCs temporarily |
| 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. |
| prefs_import_admin_backup | Staff backups are retained until explicitly removed; never overwrite a numbered backup after a gap. |
| prefs_import_backup | Player backups rotate independently of retained staff/legacy backups. |
| prefs_import_clean_assoc_paths | We just guarantee the shape, the owning loaders resolve them. |
| prefs_import_clean_loadout | The UI encodes and caps these, the load path doesn't, so we redo it here. |
| prefs_import_clean_loadout_presets | loadout_lists is preset -> path -> details, so unwrap a level first. |
| prefs_import_clean_text_list | Lists consumed as text/type names by raw loaders must not carry numeric indexes or nested collections. |
| prefs_import_invalidate_cache | After successful replacement, old UI/disconnect callbacks must only write to memory. |
| prefs_import_pass1 | Pass 1. Retains character migration inputs. Player imports may only replace player-owned root fields. Supplying local_player_data enables the player allowlist; staff may still restore a complete backup. |
| prefs_import_player_root | Registered preferences plus raw player settings and inputs still used by supported migrations. |
| prefs_import_prevalidate | Structural checks. Returns an error string, or null if it's fine. |
| prefs_import_read_upload | Shared upload validation. Policy-specific metadata filtering happens after this succeeds. Returns an error, or the decoded tree and byte count; never logs uploaded JSON or decoder exceptions. |
| prefs_import_replace | Write and verify the candidate before touching the destination. Returns an error, or null on success. |
| prefs_import_strip_empty_keys | Pass 1 and native migrations produce unique path keys; copy only to remove empty keys, preserving shared lists. |
| prefs_import_strip_empty_loadout_keys | Migration leaves null keys behind, and sanitize_loadout_list stack_traces on them. |
| prefs_import_tree_too_deep | Check depth iteratively so a deeply nested upload cannot overflow the call stack. |
| prepare_bodypart_overlays | Prepares the final bodypart or hair slot, where direct glow/blocker masks already have their centering and height adjustments. Each mask moves inside a neutral emissive boundary so rotation does not depend on icon size; masks sharing a plane and layer share one boundary. Plain visible sprites sharing a layer share one holder. Only the mob's top-level overlays count toward MAX_ATOM_OVERLAYS, and a matrixed accessory otherwise spends a sprite and a mask per colour slot on every layer it draws. |
| 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 |
| preview_animated_leaves | The animated icon states a flat icon draws, and where: list(list(leaf, x, y), ...), with the leaf's lower left pixel at (x, y) of the flat's own canvas. In a walk's recipes only crops move what is already drawn; an animated leaf that anything else would move is left out, and drawn still. |
| preview_animation_difference | White where two icons, each split by preview_animation_split(), differ, and black where they don't. |
| preview_animation_fewer_steps | The same steps, with only keep after the first: dropped evenly, each kept one shown for the time of those after it. |
| preview_animation_frames_at | What frame each of a region's leaves shows time ms into its animation: leaf number -> frame. |
| preview_animation_mark_frames | Marks animated leaves in a detached to_list() recipe, using their source identities to keep shared leaves on the same track. The source tree and its transformer lists remain untouched. |
| preview_animation_reading | A reading of an animated icon state, or null for one that is drawn still without reading it. |
| preview_animation_split | An icon as two opaque icons that differ wherever it does: its colours, and its alpha in grey. Uses up source. |
| preview_animation_steps | A region's animation as steps, list(list(start, ms), ...): from the start, each time any of its leaves shows something new, when, and for how long, in ms. The leaves start together and come round together once all their loops have, or at CHARACTER_PREVIEW_ANIMATION_MAX_PERIOD. The first step is every leaf's first frame, the facing as drawn; see preview_animation_frames_at() for the others. |
| preview_animation_tokens | A recipe marked for patches, split where each fills in its own numbers: the pieces between, and in place of each number a code for it: 0 for the facing's dir, a leaf's number for its frame, and -1 to -4 for the crop's x1, y1, x2 and y2. |
| preview_animation_track | One leaf's frames in a facing, as the steps of preview_animation_steps() read them: list("leaf" = its number, "frames" = each frame it shows in turn, "starts" = when each starts, in ms, "shows" = whether each looks different from the one before it, the first from the last, "cycle" = how long they take in all). |
| preview_state_animated | Whether an icon state has more than one frame, from its file's metadata, remembered by file and state. |
| previous_list_item | Returns the previous item in a list |
| print_command_report | Print a report to all the communications consoles, and optionally send an announcement to players about it. This is used for the roundstart report, but can also be used for other reports in the future. |
| 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_chat_color | Converts a given color to comply within a smaller subset of colors to be used in runechat. If a color is outside the min/max saturation or lum, it will be set at the nearest value that passes validation. |
| 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_human_blood_type | Returns one of the human blood types at random, weighted by their rarity |
| 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 |
| ratvar2text | Reverts ravarian styling and rot13 in text. |
| 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 |
| reagent_explode | Generic explosions/failures |
| 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 |
| recoil_camera | Helper proc for a similar function to shake_camera, expect this one kicks the camera back at an opposite angle rather then skake_camera's irratic jittering. |
| 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 |
| recurse | Exists to trigger infinite recursion runtimes in testing |
| 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. |
| reebe_station_warning | Tells the station that there's a clockie portal, along with making it usable by all |
| refresh_jukebox_songs | Recache the songs from config then force replace all the songs. |
| 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_erp_things | If the "Remove ERP Interaction" config is disabled, remove ERP things from various lists |
| remove_faded_filters | Removes filters once they've faded out, skipping any that were replaced in the meantime |
| 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_synth_defib_trauma | Global timer proc used in defib.dm. Removes the temporary trauma caused by being defibbed as a synth. |
| 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: |
| render_species_facings | Adds a render of the dummy facing each way to entries, in the page's turning order. |
| replace_icon_legs | Cuts the legs (y 1-11) off a worn icon and staples new_legs on. |
| 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_religion | It's time to kill GLOB Reset religion to its default state so the new chaplain becomes high priest and can change the sect, armor, weapon type, etc Also handles the selection of a holy successor from existing crew if multiple chaplains are on station. |
| 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. |
| reta_find_and_grant_access | Finds eligible responders and grants them temporary access |
| reta_get_user_department | Gets the department string for a user based on their job |
| reta_get_user_department_by_name | Gets the standardized department string from a console department name |
| reta_init_config | Initialize RETA config values |
| reta_on_cooldown | Checks if an origin department is on cooldown for calling a target department |
| reta_push_ui_updates | Pushes UI updates to all consoles in the same origin department |
| reta_set_cooldown | Sets a cooldown for an origin department calling a target department |
| reta_track_call | Tracks recent emergency calls for multiple department analysis |
| 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_escape_shuttle | Docks the emergency shuttle back to the station and resets its state |
| 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_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 |
| round_blood_for_hud | A helper for getting the appropriate icon state for the blood hud. |
| round_timestamp | Returns timestamp since the round started, AKA Pay Time (PT) |
| 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. |
| sample_fabric_colour | The cloth colour of a worn sprite, as the approved previews sample it: every opaque pixel of rows 21-24, columns 12-18 facing south (GetPixel() x 13-19, y 11-8), tinted (each tint rounds half to even), stable-sorted by Rec. 601 luma; the upper median. Cached by file, state, tints and source revision; a sprite that is neither a file nor text is sampled without being cached. Null when nothing opaque is there. |
| sanitize | Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character. |
| sanitize_alt_job_titles | Keep only entries whose job title and alternative title are text. get_alt_job_title() handles job validation; SSjob may not be initialized while preferences load. |
| sanitize_augment_colors | Returns colors lowercased when it is four "#rrggbb" colours run together, else null. It runs only as a save loads and on
the editor's actions, so its regex is made each time rather than kept. |
| 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_language_understanding | Saved levels read back: known language types only, each snapped to a step and kept within range. Null if none. |
| 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. |
| scale_liquid_color | Returns a mixed pool colour scaled by its surface class's LIQUID_COLOR_FACTOR_*, as "#rrggbb". |
| 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.) @param immediate_load If TRUE, loads the placed ruins' maps in right away instead of leaving them queued in SSmapping.reserved_ruins for terrain generation to run first. Only safe to use outside of the roundstart mapping init sequence, once terrain generation has already finished. |
| 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_clock_message | Send sent_message to all other clock cultists and ghosts from the user |
| send_department_ooc | Validates and sends a message to a departmental OOC channel. |
| 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_status_display_alert | Send an emergency alert signal to all status displays alert_type: The picture state to display ("biohazard", "lockdown", "radiation", etc.) |
| send_status_display_biohazard_alert | Send a biohazard alert signal to all status displays |
| send_status_display_lockdown_alert | Send a lockdown alert signal to all status displays |
| send_status_display_radiation_alert | Send a radiation alert signal to all status displays |
| 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 |
| server_timestamp | Returns UTC timestamp with the specifified format, with optionally deciseconds or optional IC time (year offset), AKA Nanotrasen Standard Time (NST) |
| 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 |
| set_owned_masked_leg_icons | Publish or evict a finalized masked-leg pair and its exact native dimensions together. The caller must finish icon mutation before publishing. Existing cache entries are immutable. Retain the replacement before releasing the old pair, including when they share icons. Raw cache writes/removals must use this proc so metadata does not outlive its owning cache. |
| set_protean_modsuit | Sets the protean modsuit on a mob's chest component. Returns TRUE on success. |
| setup_clockwork_research | Returns a list of every initialized clockwork research datum |
| 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 |
| sheets_from_value | Convert a raw material amount into "SHEET_MATERIAL_AMOUNT", or "* N", with rounding rules. |
| should_border_obj_smooth | Helper proc for smoothing border objects. Return this from smoothing_allowed() to get the desired effect Indexes into some global lists that encode direction bullshit |
| should_have_space_before_emote | Returns a boolean based on whether or not the string contains a comma or an apostrophe, to be used for emotes to decide whether or not to have a space between the name of the user and the emote. |
| 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 acts on list in place, and returns same list |
| silent_alert | Sends a silent alert message to certain crew members' PDAs |
| 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 |
| snap_language_understanding | A level snapped to a whole step, between the least allowed and all of it. |
| 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. |
| spawn_random_ship | Spawns the random ship proper, with the follow-up effects, if you've set any up. |
| spawn_reebe | Spawn reebe with the appropriate fanfare after sacrificing a blood cultist |
| special_list_filter | Returns a list with items filtered from a list that can call callback |
| species_family_id | The id the species page knows a family by: the last part of its typepath. |
| species_has_fitness_limbs | Returns whether a species' own limbs have fitness subtypes, which is when its characters get a muscle size and definition. |
| species_page_height | A dummy's flat render with the rows its height filters move moved in it, as the game draws them, so a species shorter or taller than average stands as high on the page as in the round. A flatten leaves filters out. |
| 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_worn_emissive_branches | Return the emissive-only tree, or null if nothing changed. visible_resultWORN_EMISSIVE_VISIBLE_RESULT receives the visible tree (null for a moved mask leaf). The caller reuses this single return slot throughout the traversal; each node consumes its child's result immediately. Unchanged branches retain their original appearances and allocate no lists. Nested cross-plane masks escape the mob's KEEP_TOGETHER group. Moving the plane boundary to a sibling root lets BYOND inherit the mob transform normally, without baking a pose into the cache. Only floating equipment masks are moved; absolute-layer effects and other planes retain their behavior. |
| 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_unequip_mob | A utility function for /datum/strippable_items 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. |
| strip_outer_punctuation | Removes all punctuation sequences from the beginning and the end of the input string. Includes emphasis (|, +, _) and whitespace. Anything punctuation in the middle of the input will be maintained. |
| 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 |
| symphony_address_allowed | TRUE if a topic from this sender is allowed to run. |
| symphony_ago | How long ago a stamp was. DisplayTimeText already says "right now", and "right now ago" reads wrong. |
| symphony_apply_discord_admins | Runs after load_admins() clears and rebuilds local/SQL holders, which take precedence. |
| symphony_ban_minutes | Ban length in minutes, 0 being permanent. |
| symphony_bannable_roles | Shared by the panel's role list and ban validation. |
| symphony_discord_admin_sync_enabled | Discord admin grants require both the module and admin sync flags. |
| symphony_enforce_kick | Recheck a revoke after its grace period, then return the player to the lobby. A failed query leaves them in the round; the periodic sweep retries when the database recovers. |
| symphony_has_ingame_role | Query a linked account for an in-game role grant. Returns TRUE/FALSE, or null when the database cannot answer. Unlinked accounts return FALSE. |
| symphony_holds_whitelist_role | Check a current role entitlement, bypassing the admission cache. Unlike admission, perks and imports require an enabled module and a confirmed grant. |
| symphony_ingame_role_ckeys | Return role holders as ckey -> TRUE, an empty list for no holders, or null on query failure. |
| symphony_invalidate_whitelist_cache | Invalidate one account immediately after a role change. |
| symphony_note_panel | Remember who called, so the status verb can compare the two halves. |
| symphony_request_community_ban | Queue propagation of an existing local ban to the other servers. |
| symphony_resolve_role | The ban cache is case sensitive, so match the caller's text to the stored title. |
| symphony_revoke | Announce a revoke, block pending admission, and schedule enforcement after the grace period. |
| symphony_seed_whitelist_cache | Cache a confirmed TRUE/FALSE result from a notification or bulk query. Advancing the epoch prevents an older in-flight query from overwriting this answer. |
| symphony_validate_ready_players | May sleep. Display and signal handlers must continue to use the cache-only gate. |
| symphony_version_verdict | Which half is behind, if either. needs/wants are what the panel asked for. |
| symphony_whitelist_cache_peek | Return cached TRUE/FALSE, or null for a miss. Never queries or sleeps. |
| symphony_whitelist_lookup | Return a cached whitelist answer, querying on a miss. May sleep. Database failures return null and are never cached; FALSE is a confirmed denial. Use symphony_whitelist_cache_peek() in display and signal handlers that cannot sleep. |
| symphony_write_ban_note | World topics have no usr, which create_message() requires, so insert the note directly. |
| techweb_point_display_generic | Helper proc to turn an associative list of points into a more human readable format. |
| 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. |
| text2ratvar | Takes english and applies ratvarian styling rules (and rot13) to it. |
| tg_alert | 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_color_picker | Creates a TGUI color picker 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_blooper | Globally toggles bloopers on/off |
| toggle_department_ooc | Enables or disables a channel and notifies its listeners when the state changes. |
| toggle_id_ctf | Proc that handles toggling and unloading CTF. |
| tool_behaviour_name | returns an ic name of the tool needed Arguments: |
| trim | Returns a string with reserved characters and spaces before the first word and after the last word removed. |
| 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_inside | Return UI_INTERACTIVE if the user is inside the target atom, whether they can see it or not. Return UI_CLOSE otherwise. |
| 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 |
| uni_icon_facings_json | Turns a flat icon walked with get_flat_uni_icon(target, UP) into its recipe for each facing, as iconforge entry JSON: facing name -> recipe. |
| 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) |
| unpack_garment_colours | Returns a view's colours, colour -> how many of its pixels have it, from the "rrggbb:count,..." form garment_sheet_metadata() holds them in. |
| 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. |
| updateToolTip | Updates a user's tooltip to show new title/contents. |
| update_all_doors_reta_lights | Updates RETA lighting for all doors in the game |
| 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. |
| valid_direct_subtypesof | Like valid_subtypesof(), but excludes concrete descendants of abstract sub-branches |
| valid_direct_typesof | Like valid_typesof(), but excludes concrete descendants of abstract sub-branches |
| valid_painting_id | Accept only the lowercase 32-character hexadecimal identities used for painting paths. |
| valid_subtypesof | Like subtypesof, but automatically excludes abstract typepaths |
| valid_typesof | Like typesof, but automatically excludes abstract typepaths |
| validate_suppression_status | Check if the delam suppression setup is valid on the map |
| 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_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 |
| world_topic_log_parameters | Redact the decoded credential, covering every parameter encoding accepted by authentication. |
| worn_frame_delays | Returns an animated worn state's frame delays, read from its sheet, or null when the sheet isn't a file on disk, like a generated icon, or has no such state. |
| 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
Debugger 
The debugger instance. This is a GLOBAL_REAL because it initializes before the MC or GLOB. Really only used to check to see if the debugger is enabled or not, and to separate debugger-related code into its own thing.
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_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).
SSautomapper 
The AUTOMAPPER
This is a subsystem designed to make modular mapping far easier.
It does two things: Loads maps from an automapper config and loads area spawn datums for simpler items.
The benefits? We no longer need to have _nova maps and can have a more unique feeling map experience as each time, it can be different.
Please note, this uses some black magic to interject the templates mid world load to prevent mass runtimes down the line.
LIMITED SUPPORT FOR NON-STATION LEVELS(until someone adds a better Z level handling system for this)
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
SSblood_drying 
Blood Drying SS Used as a low priority background system to handling the drying of blood on the ground (basically just handles reducing their bloodiness value over time)
SSburning 
The subsystem used to tick /datum/component/burning instances.
SScameras 
Manages the security cameras and camera chunks
SScharacter_preview 
Starts character preview drawings, and rebuilds preview mobs in turn when many change at once.
Rebuilding the preferences preview mob applies every preference to it: 10 to 40 ms that can't be split. tg rebuilds it inside every action that changes it, twice in some, and many players changing their characters at once ran every tick over, which every player on the server felt.
With character setup open, a change only marks the mob stale and asks the window for a drawing, which rebuilds it first, once for everything an action changed. This starts the drawing in its next fire, in the tick time other subsystems leave over, and the drawing rebuilds the mob then and there if nothing waits ahead of it and the rebuild fits in what is left of the tick, as it nearly always does; one that doesn't fit still goes then while such rebuilds stay within CHARACTER_PREVIEW_OVERRUN_BUDGET. Otherwise the mob waits its turn in the queue, which the fires that follow work through. Changes that come while it waits go into the one rebuild, and the page shows its loader once the wait is long enough to see. Without a window, the mob is rebuilt at once, as tg does.
SScliff_falling 
Subsystem to handle falling of off cliffs
SSclock_component 
The subsystem used to tick /datum/component/acid instances.
SScustom_sprite_work 
Keeps the custom sprite editors cheap for the server, whatever a window sends.
Window actions only change the draft and note what needs drawing. Views, previews and resource rebuilds are drawn afterwards by SScustom_sprite_work, once for a burst of actions, in tick time other subsystems leave over, so no window can hold up a tick however fast it sends actions. The work that costs tens of milliseconds a time, resource rebuilds, new editors and previews of a previous saved style, is paced per player across all their editors by /datum/custom_sprite_pace, and across players by the subsystem: what such work runs past the ends of ticks stays within CUSTOM_SPRITE_OVERRUN_BUDGET.
SScyborg_layout_saves 
Saves cyborg layout accounts in tick time other subsystems leave over.
Editor actions and their debounce only change the draft and ask for a save. Here the draft is encoded into its character and the account's file written, once per account in the order they asked, with whatever the draft holds by then. An account writes at most once per CYBORG_LAYOUT_SAVE_SPACING, and all saves together take at most CYBORG_SAVE_BUDGET ms of each second: a save can't be split, so what one runs over comes out of the next. It only fires while accounts are waiting.
SSdigital_clock 
The subsystem used to tick digital clocks
SSdirt 
Makes the masks mess is drawn with, a piece at a time, in the tick time other subsystems leave over, and keeps the newest of them.
Masks asked for that aren't made yet are queued here (masks_for()), behind the template of the body they're drawn on
if that isn't built yet (template_for()), and behind the plain human template, queued at init, which every mark is
sized by (dirt_metric()) and underclothes are judged on. Each fire works through the queue in order until the tick
runs short. Finished masks go in masks, and each body that drew without them meanwhile, if it's still around, is
drawn again at the end of the fire (redraw_dirt()). Masks asked for again while they wait are the same job, which
only notes another body to draw again. A job that fails is cached as failed, and isn't queued again while that's
kept.
DIRT_MASKS_DEFERRED turns the queue on: without it every mask is made as it's asked for.
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.
SSgarment_fitting 
Makes the garment fits bodies wait for, a piece at a time, in the tick time other subsystems leave over.
A garment drawn on a body fitted in a way no garment like it has been yet is drawn as it is, and its fit queued here (/datum/garment_fit_job/proc/start()). Each fire works through the queue in order, one view of one direction's frame at a time, until the tick runs short. A finished fit goes in the cache it was queued for, and each body that drew the garment meanwhile, if it's still around, has that slot drawn again at the end of the fire, once however many of its fits finished. A fit asked for again while it waits is the same fit, which only notes another body to draw again.
GARMENT_FITS_DEFERRED turns the queue off, and a dummy never uses it: every fit is then made as its garment is drawn.
It reads the fitting's templates and sheet metadata as the server starts, so no fit in a round pays for reading them.
SSgraffiti 
The graffiti on the current map: the art and placements its file keeps, which of them show this round, and the sheet files they show from.
Each placement is kept as one JSON string, json_encode() of list("anchor", "art" = its art's hash, "ckey", "who",
"at", "pid", "half", "miss"), and read with unpack(). A piece's name and description stay in its painter's library. A
placement that lasts only this round has a null anchor, "round_only" and its turf's "x", "y" and "z".
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
SSlow_priority_ai_controllers 
Plans background controllers that are active when unwatched but not critical
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
SSsymphony 
Safety net for revokes we never heard about.
SStgui 
tgui subsystem
Contains all tgui state and subsystem code.
SSticket_ping 
Pings admins every (time chosen in config) for all open tickets/OPFOR applications
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.
SSturrets 
The subsystem used for portable turrets, as they're relatively more intensive compared to most other machines, so we don't want them hogging tick usage from everything else.
SStutorials 
Namespace for housing code relating to giving contextual tutorials to users.
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
Tracy 
The byond-tracy instance. This is a GLOBAL_REAL because it is the VERY FIRST THING to initialize, even before the MC or GLOB.
_bitfield_bot_access_flags 
bitfield, used by basic bots, for our access flags
_bitfield_bot_cover_flags 
bitfield, used by simple bots, for our access flags
_bitfield_covered_slots 
Mob covered flags
_bitfield_flags_inv 
Item obscured flags
_bitfield_no_equip_flags 
Inventory slots that can be blacklisted by a species from being equipped into
_bitfield_obscured_slots 
Mob obscured flags
_bitfield_transparent_protection 
Item coverage flags
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
ISOtime
returns timestamp in a sql and a not-quite-compliant ISO 8601 friendly format. Do not use for SQL, use NOW() instead
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))
RangedReachCheck
Called by IsReachableBy() to check for ranged reaches.
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 (
FALSEby 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.
aas_config_announce
Announces the provided message with the provided variables and config entry type. Only aas_config_entry_type and variables_map are mandatory. Other args are optional.
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_girder_wall_recipe
Adds a new /datum/girder_wall_recipe instance to the given recipe list from the given recipe arguments.
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_minimap_blip
Create a minimap blip on the z-level in question, object is optional, and will tie the blip to the object in question, and will clean up itself if the object in question is deleted
add_personality_mood_to_viewers
Iterates over all mobs that can see the passed movable and adds specific mood events to them based on their personalities.
- source: The source of the mood event, usually the mob doing something
- mood_key: String source for the mood event
- personality_to_mood: A list mapping personality types to mood event types. Example: list(/datum/personality/chill = /datum/mood_event/chill_guy)
- range: The range in which to check for viewers. Default is view range.
- additional args may be supplied to pass into the mood event constructor.
add_recipes_to_sublist
Add a list of recipes to an existing recipe sublist.
Arguments:
- stack_recipes - the existing list of stack recipes.
- recipe_list_title - the title for the recipe list we're adding to
- appent_recipes - Add these recipes to the given recipe list.
add_startup_message
Adds a startup message to the splashscreen.
Arguments:
- msg - the message to show users.
- warning - optional: TRUE to indicate this is an error/warning
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.
adult_items_gated_types
Each adult items family's top types, one line per family. The adult_items_kill_switch unit test checks every
concrete subtype.
ai_eye_turf_in_view
AI can also see emotes!
ai_toggle_hiding
Shared logic for actually flipping a mob's hidden state. Used by both the explicit toggle_hiding leaf and the random_hiding decision leaf.
alert_sound_to_playing
This is quite franlky the most important proc relating to global sounds, it uses area definition to play sounds depending on your location, and respects the players announcement volume. Generally if you're sending an announcement you want to use priority_announce.
alert_to_permissions_elevation_attempt
Sends a message in the event that someone attempts to elevate their permissions through invoking a certain proc.
all_junctions_of_dir
Takes a direction, turns it into all the junctions that it lines up with
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_active_reta_grants_to_card
Applies any currently active RETA grants to a newly created/spawned ID card This should be called when ID cards are created, spawned, or have their trim changed
apply_cyborg_customization
Preference application is separate from model selection, hardware, laws and names.
apply_dynamic_human_appearance
This exists to apply the icons async, as that cannot be done in Initialize because of possible sleeps.
apply_icon_mask
A simple helper proc to apply a mask to an icon Arguments:
- base_icon - the icon which the proc will apply the mask on
- mask_to_use - the mask to use from code__DEFINES\icon_masks.dm
- replacement - an icon to overlay after the masking
apply_matrix_to_color
Applies a color filter to a hex/RGB list color
apply_message_emphasis
Replaces player chat emphasis characters with the corresponding HTML tags in the input string.
You do NOT (and SHOULD not) need to use on anything that isn't direct user input, as this is designed solely to transform user input. Just put in the HTML tags yourself.
Returns the transformed input, which may have no change if no emphasis characters are present.
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
assemble_body_markings_from_set
Builds a new collection wearing a marking set: each of its markings on every zone the marking claims, in the set's order.
A marking's zones come in GLOB.body_markings_per_limb order, as scanning those lists for its name gave them, and each marking starts in the colour its color_mode seeds. A member sharing an exclusion group with an earlier member stays off the zones that one took.
Arguments:
- marking_set: the set to wear. A member no marking is registered under adds nothing.
- features: the character's features, where markings following a mutant colour read it.
- species: the character's species.
Returns:
- /datum/body_marking_collection: always a new collection.
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_to_values
Turns an associative list into a flat list of values
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.
augment_paint_matrix
Returns a recolourable finish's colour matrix for one of its packed states: numeric and 4x4, rows red, green, blue, alpha, as Nova's naga tail builds its (constrict.dm). Never rows of colour strings, which map_colors_inferred() can't flatten for the drawn character preview. Each is built once and kept, by colours, state and alpha, until AUGMENT_PAINT_MATRIX_CACHE_SIZE are kept; then the cache is emptied before the next is added, since a player can apply colours without end. A matrix is cheap to build again, and a limb keeps the one it was given.
The red, green and blue rows are the colours each packed channel draws in: paint, accent and frame for the _paint state, lights and the two untinted shines for the _glow state. A channel's shade scales its colour, so a pixel packed at half red draws half the paint colour.
Arguments:
- colors: The colour string, paint, accent, frame, lights.
- glow: FALSE for the _paint state (paint, accent, frame), TRUE for the _glow state (lights and the two shines).
- alpha: The limb's alpha, which the matrix carries.
Returns:
- list: 16 numbers. It's shared: read it or hand it to a color var, never edit it.
autopunct_bare
Ensures sentences end in appropriate punctuation (a period if none exist) and that all whitespace-bounded 'i' characters are capitalized. If the sentence ends in chat-flavored markdown for bolds, italics or underscores and does not have a preceding period, exclamation mark or other flavored sentence terminator, add a period. (e.g: 'Borgs are rogue' becomes 'Borgs are rogue.', '+BORGS ARE ROGUE+ becomes '+BORGS ARE ROGUE+.', '+Borgs are rogue~+' is untouched.)
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_color
Blend two colors using the normal blend mode of the CSS compositing algorithm
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
blend_weighted_lists
- Takes in two weighted lists and outputs a third list containing the elements of both inputs with their weights blended according to a given proportion.
- Not exact and may have rounding errors, will round to nearest 1/1000.
body_marking_collection_from_list
The tolerant loader for the nested shape preferences.json stores: zone -> (marking name -> list(color, emissive)).
A marking stored as a bare colour, the legacy shape, loads as that colour without glow; a missing colour or glow reads as sanitize_hexcolor()'s default and 0, and extra fields are ignored. Zones outside GLOB.marking_zones, zones that aren't lists and names missing from GLOB.body_markings are dropped. Anything that isn't a list, null included, loads as no markings. Nothing else is checked: markings of one exclusion group load side by side, and a zone may hold more than MAXIMUM_MARKINGS_PER_LIMB, as saved.
Arguments:
- raw: the decoded "body_markings" value.
Returns:
- /datum/body_marking_collection: always a new collection.
body_marking_colors_old_set_names
What each of the seven species that had a randomiser of its own could pick, as those get_random_body_markings() overrides were written before get_random_marking_sets() replaced them: a forced set, a fixed list to pick from, or the sets meant for any species or for this one. Kept here, and nowhere in the game, as the reference.
Arguments:
- species: one of the seven species' prototypes.
Returns:
- list: set names in the order the override picked from.
body_marking_colors_scanned_set
The marking set factory as it was before it read each marking's affected_bodyparts: every member against every zone's marking list, in GLOB.body_markings_per_limb order. Colours come from seed_color(), the only colour source there is now, so comparing the two compares which entries land on which zones, in what order.
Arguments:
- marking_set: the set to wear.
- features: the features its markings seed from.
- species: the species wearing it.
body_marking_compat_full
Saved marking maps exactly as preferences.json holds them, written out by hand so no loader or serializer change can regenerate them. Every zone wears the fixture's markings (body_marking_fixture.dm), each of which claims all eight zones, in an order no zone list or marking list sorts into, with glow mixed.
body_marking_compat_round_trip
Loads a saved marking map the way a character load does and writes it back the way a save does.
body_marking_entries_cache_key
Returns a string standing for a list of entries, in order, with their colours and glow.
A collection's cache_key_for_zone() and a limb holding entries of its own both build their strings here, so the same markings give the same string either way.
Arguments:
- zone_entries: the entries, in order.
Returns:
- string: each entry's cache_key() joined by "-", or "" for none.
body_marking_entries_copy
Copies a list of entries into new ones, as deep_copy_list() copied the nested shape.
Arguments:
- zone_entries: the entries to copy.
Returns:
- list: new entries in the same order, or null when there are none.
body_marking_entries_from_list
Builds new entries for one zone from its nested shape: marking name -> list(color, emissive).
Arguments:
- zone: the zone the entries sit on.
- raw_zone: the zone's markings, read as body_marking_collection_from_list() documents.
Returns:
- list: new entries in the zone's order, or null when none load.
body_marking_entries_to_list
Rebuilds one zone's nested shape from its entries: marking name -> list(color, emissive).
Arguments:
- zone_entries: the entries, in order.
Returns:
- list: a new list, empty when there are no entries.
body_marking_rename_retired
Renames retired marking names in the nested shape preferences.json stores, zone by zone and in place, by GLOB.body_marking_renames. A zone holding a retired name and the name it became wears the same art twice, so it keeps one entry: the later one, which drew on top, in its place and colour, glowing if either glowed, as the lower one's glow showed through a top one that didn't glow. A zone with nothing to rename is left as it is.
Arguments:
- raw: the decoded "body_markings" value. Anything that isn't a list is left alone, as is a zone that isn't one.
Returns:
- number: how many entries were renamed.
body_marking_set_types_for_species
Returns the body marking sets meant for any species or for this one, the "None" set included.
Arguments:
- species_id: the species' id.
Returns:
- list: a new list of /datum/body_marking_set typepaths in GLOB.body_marking_sets_by_type order, or null for none.
body_marking_sheet_size
Returns the size of a body marking sheet as "[width]x[height]", read once per sheet. moth_markings.dmi is 45x34, every other sheet 32x32. Null for an icon built at runtime, whose text names no file ("/icon" for every one), so a content key could not tell two apart.
Arguments:
- sheet: a body marking's icon.
body_marking_sheets_blend
Returns whether markings on two sheets can blend into one icon: sheets of one size, and never an icon built at runtime.
Arguments:
- sheet, other_sheet: two body markings' icons.
body_markings_of_zone_for_species
The body markings a zone offers a species: all of them with mismatched parts, otherwise those meant for any species or this one.
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()
bug_report_blank
Whether a field counts as empty, by the same rule as the reporting service.
Only Unicode's whitespace and the zero width no-break space count as nothing, and steps that are only their numbers count as nothing too. We don't use trimtext(), it also takes the zero width space. Arguments:
- text - what the reporter wrote
- numbered - whether it's the steps, which arrive as numbered lines
bug_report_bridge_origin
Returns the configured bridge address when it's a loopback one on this machine, the only kind we ever talk to, otherwise null
bug_report_budget
Spends one of a ckey's hourly allowances, mirroring the reporting service's own caps.
Returns 0 when there was one to spend, otherwise how long until one frees up. They live for the round, so a reconnect doesn't refill them. Arguments:
- ckey - whose allowance
- kind - accepted, submits, drafts, uploads, captures or saves
- spend - FALSE to only check
bug_report_budget_fill
Spends what's left of a ckey's hourly allowance of one kind, for when the reporting service says it's all used.
Arguments:
- ckey - whose allowance
- kind - uploads or captures
bug_report_cleanup_temporary
Removes staged screenshot files a day old or more, at most once an hour.
DreamDaemon processes can overlap on one data folder, and a day is longer than any capture or upload lives, so only files that old go. A file we can't date stays for an operator to look at. Finished requests delete their own files at once. Arguments:
- force - sweep even if we swept within the hour
bug_report_context_snapshot
Freezes what the game looked like for a report, as plain values the bridge stores as they are.
Nothing here can yield, so the round, mob and build are the ones the reporter saw. Arguments:
- incident_mob - the reporter's mob, which can be null
- incident_ckey - the reporter's ckey
- session_id - the reporting connection's session
- client_version - the reporter's BYOND version
- client_build - the reporter's BYOND build
bug_report_image_name
Whether a file name is one of the image types the reporting service decodes
bug_report_temporary_path
A fresh generated path for a staged screenshot file, sweeping old ones now and then
bug_report_uses_left
Counts what's left of a ckey's hourly allowance of one kind, forgetting uses over an hour old.
Arguments:
- ckey - whose allowance
- kind - accepted, submits, drafts, uploads, captures or saves
bug_reports_enabled
Whether reports go to the reporting bridge, which only ever means the one on this machine
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_mutant_part
Factory helper proc for creating and returning a new mutant_bodypart datum.
Arguments:
- name: The sprite accessory name for the mutant bodypart.
- colors: Optional list of colors or color string for the bodypart.
- emissive_list: Optional emissive tri-boolean list for the bodypart.
Returns:
- /datum/mutant_bodypart: A newly created mutant bodypart datum.
build_name2neurowarelist
Same as build_name2reagentlist() but contains only neuroware reagents.
build_name2neurowarelist_safe
Same as build_name2neurowarelist() but omits aphrodisiacs.
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
bulge_adaptive
bulge_v4.adaptive(cloth, finish, toned = TRUE): the five kinds f, h, H, s, d as lists of three channels.
Arguments:
- fin_lift, fin_chroma, fin_shift: the finish (cloth 1/1.4/1, denim 0.75/0.75/0, leather 0.55/1/0).
bulge_blank_tile
A transparent 32x32 tile in one direction, loaded once; copy it with icon() before drawing on it.
bulge_clearance
Where a skirt's shaft shows through the cloth: the anatomy clearance mask (a /datum/bulge_sheet_state) for an identity, or null when the family has none there. Named as the skirt's shape without its legs, in skirt_clearance.dmi: a clearance is the same on plain and digitigrade legs. With a clearance the anatomy is drawn behind the skirt and, inside the mask, above its cloth; an empty mask shows none of it above.
bulge_clipped_icon
Returns a sprite kept only inside a shape's pixels (what a cover draws over itself, kept to a look's cloth): the sprite's frames times the template's union mask (bulge_template_masks()), as one registered icon whose state "" faces all four ways. The image drawing it keeps the sprite's own colour. Cached on the template by sprite and state; null when the state is missing or not 32x32, or the template has no pixels.
Arguments:
- sprite, state - the overlay's icon (a resource file) and state, as the cover draws it.
- template - the look's shape, its masks derived.
bulge_cover_family
The family a cover garment bulges with, or null.
bulge_cover_layer
The layer a cover garment is drawn at: an underclothes accessory's own, else its drawn appearance's.
bulge_cover_printed
Whether a cover garment's own print carries onto its bulge.
bulge_cover_slot
The overlays_standing slot a cover garment is drawn in, or null.
bulge_cut_cover_flap
Returns the cover garment with a flap cut away: its sprite with every pixel of the flap made transparent (the lifted part of a revealing skirt's hem), as one registered icon whose state "" faces all four ways; nothing is cut facing north. One flap serves every garment with that hem. Cached like a patch; null when the sprite is not a 32x32 resource or has no such state.
Arguments:
- sprite, state - the cover's worn icon (a resource file) and state, as its appearance draws them.
- flap - the flap, from bulge_flap().
bulge_cut_cover_patch
Returns a loincloth with its lifted flap cut away: its sprite kept only where the cut's keep mask (bulge_patch_keep()) is opaque, as one registered icon whose state "" faces all four ways. Only the mask's alpha is used, so the wearer's own garment pixels stay. Cached like a patch; null when the sprite is not a 32x32 resource or has no such state.
Arguments:
- sprite, state - the cover's worn icon (a resource file) and state, as its appearance draws them.
- cut - the cut, from bulge_loincloth_cut().
bulge_cut_for
The cut a cover of family is drawn with under a hard penis of this identity: a revealing skirt's flap (a
/datum/bulge_print_template) or a loincloth's derived cut (a /datum/bulge_sheet_state); null when it is drawn whole.
bulge_cut_sprite
A sprite cut by a flap (/datum/bulge_print_template) or by a loincloth's derived cut (/datum/bulge_sheet_state), or null.
bulge_decode_template
Decodes a sheet state into a print template, once per sheet and state: each pixel facing south, east and west with
its kind, read from its fixed grey (a kind map), or as cloth (a mask, when mask). North is never read: it is empty
in every template sheet. A state saved with one direction is read facing south every way, as getFlatIcon() treats
one. The template's key names its sheet and state, so no two sheets can share a cached template.
bulge_derive_cut
Cuts a cover by a keep mask (see bulge_cut_cover_flap() and bulge_cut_cover_patch()), uncached: the sprite times the keep mask.
bulge_derive_drape
Derives a loincloth's drape, as bulge_drape_name() names it, by the approved rule: facing east the flap's top edge follows the penis from its hinge, up to BULGE_DRAPE_REACH columns, then the rest of the flap hangs past the tip or, from a penis reaching further, drops over its side; facing west the same, mirrored; facing south the flap's top and hem rows where the loincloth's own sprite has cloth. Kept for the round, by its name, with the decoded templates; pixels in the order bulge_decode_template() reads a sheet. Arguments as bulge_drape_name().
bulge_derive_large
Derives a shape past small_cap from the penis and testicle sprites by the approved rule, in whole numbers: the cloth
the bulge pushes out, as a kind map, or with mask the anatomy it leaves bare, as a white mask (null where it covers
the whole penis). Pixels facing south, east and west, in the order bulge_decode_template() reads a sheet, as the
sheet states it replaced held them; facing east and west, every penis shape but the human one takes amendments to
that rule (see below), and its mask is what the amended cloth leaves bare. The kind map is kept for the round, by its
name, with the decoded templates; the mask is not (bulge_exposed() keeps the tile drawn from it). Arguments as
bulge_large_name(): owner is the family whose shapes past small_cap these are.
bulge_derive_print_patch
Derives a printed patch (see bulge_print_patch()), uncached.
bulge_drape
The drape a hard loincloth hangs over the penis, as a kind map derived the first time (bulge_derive_drape()), or null where it has none.
Arguments (positional):
- family - the loincloth's family typepath.
- size - the bulge size, 1 to 8.
- sprite_size - the size of the penis sprite as the game draws it (its size affix, 1 to 7).
- shape - the penis shape's sprite accessory typepath.
- toned - whether the penis is drawn with skin tones.
bulge_drape_name
The name of a loincloth's drape: "[drapes][penis shape][sprite size]", "_untoned" as bulge_large_name(), and "_flat" from the family's flat_tip_from on a shape that grows past size 4.
bulge_drawn_leaf
The drawn sprite of a worn appearance: the appearance itself, or the first child of the KEEP_TOGETHER root build_worn_icon() nests separate overlays under. Null when it draws none.
bulge_drawn_root
The first visible appearance of a drawn slot (a slot holds one, or a list with emissive roots beside them).
bulge_exposed
The anatomy a bulge past the family's small_cap leaves bare, as a white mask (a /datum/bulge_sheet_state): the derived state of the bulge_shape() of the same identity, its tile drawn from the pixels bulge_derive_large() derives for it. Null where nothing shows, the shape covering the whole penis. Arguments as bulge_shape().
bulge_family_size
The size a family draws a bulge of size at: its own up to its cap for the form, the cap past it; 0 for none.
bulge_flap
The flap a revealing skirt cuts away from its cover when hard, as a decoded mask (a /datum/bulge_print_template, every pixel cloth) for bulge_cut_cover_flap(), or null when the family cuts none. Named as the skirt's hard shape, in skirt_flaps.dmi.
bulge_flap_keep
A flap's keep mask: opaque white over the whole 32x32 tile in all four directions except the flap's own pixels, which are transparent. Built once per flap (GLOB.bulge_flap_keeps), so a cut costs one multiply.
bulge_four_way
A sprite's state as an icon with four directions, frame 1: a state with one direction is its south view every way, as getFlatIcon() treats one. Null when the state is missing or not 32x32.
bulge_hcy_raw
bulge_v4._hcy_raw: HCY to unclamped RGB fractions.
bulge_hcy_to_rgb
bulge_v4.hcy_to_rgb: drops chroma by bisection until the colour fits, then rounds half to even.
bulge_held_size
What the underwear under a look's cover (bulge_restraint()) leaves of the look. Underwear always takes precedence: it holds the penis in, unless its own look would show some of it at this size and arousal, the anatomy its exposed mask leaves bare (briefs from size 5, long johns' tip hard from size 5) or a loincloth's drape when hard. bulge_resolve() and bulge_wanted_cut() both decide by it, so a cover is drawn cut only for a look that shows the penis through it.
Arguments:
- restraint: The underwear.
- hard, size, digi, shape, toned: The look's identity, as bulge_shape() takes it.
Returns:
- null: The underwear lets the penis out, and the cover's look is what it would be without it.
- 0: It holds the penis in completely (/datum/bulge_family/none: the chastity sprites, groin plating): no look.
- 1 to 8: It holds the penis in at this size, its family's cap for the arousal where the bulge is bigger: the cover draws its own shape at it, and none of the penis (no exposed anatomy, clearance, drape or cut).
bulge_hue_numerator
A colour's hue in sixths of a turn times its chroma, in [0, 6 * chroma): the hue as an exact fraction over chroma.
bulge_is_accessory
Whether a child of a uniform's drawn sprite is one of its accessories (get_accessory_overlays()): drawn in the accessory's worn state, whichever file the wearer's species draws it from.
bulge_large_name
The name of a shape past small_cap: "[shapes][form][size][legs][penis shape]", "_untoned" for a shape whose untoned sprites have shapes of their own, drawn without skin tones; the size as bulge_large_size(). Legs are digitigrade only where the family has digitigrade versions of that form.
bulge_large_size
The size whose shape a bulge past small_cap draws: past size 6, a penis whose sprite has stopped growing (its size affix cap, with skin tones when toned) keeps size 6's shape.
bulge_loincloth_cut
The cut a hard loincloth takes under its drape (a derived /datum/bulge_sheet_state named "[drapes]cut[hem]", whose keep mask says what of the garment stays inside the cut window), or null. The cut follows the drape: at the lowest row its drape reaches facing south, or, for a drape that stays above the hem rows there (a tentacle's stub), the family's lifted_hem. Its keep mask (bulge_patch_keep()) is cut from the loincloth's own sprite as the approved previews cut it: facing south the flap's columns below the hem go, facing east and west the flap's two columns from its hinge row down, facing north nothing. Arguments as bulge_drape().
bulge_mask_shows
Whether a mask shows anything. A skirt's anatomy clearance can be empty (the shaft shows behind the skirt and none of it above), and anatomy masked by an empty one would be a fully transparent icon, derived and sent for nothing. Read once per state, from its frames facing south, east and west (north is empty in every template sheet); a derived mask has no sheet, and always shows something (bulge_exposed()).
bulge_mask_tile
A mask placed on the 32x32 tile, in all four directions: transparent outside the mask. Built once per state
(GLOB.bulge_mask_tiles), kept on the server and never sent: drawn from pixels when given (a derived mask's pixels
as a template, as bulge_derive_large() derives them and bulge_exposed() passes them before it returns the mask), else
from the mask's sheet.
bulge_masked_icon
Returns anatomy restricted to a mask: an icon state's frames kept only where a white mask is opaque (the bare part of a penis past a family's small_cap, or what of it shows above a skirt), as one registered icon whose state "" faces all four ways. The image drawing it keeps the anatomy's own colour, so one masked copy serves every colouring. Cached by its inputs; null when the state is missing or not 32x32.
Arguments:
- sprite, state - the anatomy's icon and state, as the penis overlay draws them.
- mask - the mask, from bulge_exposed() or bulge_clearance().
bulge_memo_list
The slots list memo[first], created on first use with slots empty slots.
bulge_memo_slots
The slots list memo[first][second], created on first use with slots empty slots.
bulge_mirror
value folded into first..last as between two mirrors, the ends not repeated, so alternating stripes keep
alternating across the fold.
bulge_nearest_run
The index in runs (flat ascending (first, last) pairs) of the run nearest value; the first of equals.
bulge_over_signature
What a worn cover draws over its own sprite (overlays, from bulge_over_overlays()), as one string: each overlay
after the first on the float plane. Null for none. An icon built at run time (mess baked on the cover) has no name of
its own, so it goes in by reference, after DIRT_PRIVATE_KEY: each one is new, so the look's key, the chest's, keeps
its images on the wearer rather than in tg's shared limb_icon_cache (limb_icons_for()).
bulge_palette_exception
The palettes this float32 port computes one off in a channel from the approved values (computed in float64), with the approved palette to use instead: 71 channels in 38 (colour, finish) pairs, all where float64 lands on the other side of a half (#afafaf's shade is exactly 136.5). Found by sweeping every colour the approved palettes were made for, the 4,096-colour grid of multiples of 17 and 760 garment colours, natively against them; every other one of their 218,520 channels the float32 computation gives exactly. A change to the arithmetic above needs that sweep again. Null when the computation stands.
bulge_palette_text
A GAGS palette as one string, as its producer joins a list; null for anything that is no palette.
bulge_patch_keep
A loincloth cut's keep mask: opaque white over the whole 32x32 tile in all four directions, except the pixels the cut
takes away. Built once per cut (GLOB.bulge_patch_keeps) from erased, those pixels facing south, north, east and west
(lists of indices, row * 32 + column + 1 from the top left), which bulge_loincloth_cut() derives and passes before it
returns the cut; asked for again, without erased, it is the one built then.
bulge_penis_state
The state of a penis shape's sprite a shape past small_cap is derived from, as the approved previews chose it: drawn
in front, hard or half hard, skin-toned where the sprite has that and the shape is drawn toned, at sprite_size or
the largest smaller size the sprite has. Null where it has none.
bulge_print_colour
The colour of a patch pixel (rgb() text) from the garment pixel the rule chose (GetPixel() text): the pixel itself for cloth, or the pixel under the kind's translucent white or black. A partly transparent garment pixel gives its colour; patches are opaque.
bulge_print_patch
Returns the printed patch for a garment sprite under a bulge template: one registered icon whose state "" faces south, east and west (north stays empty), drawn over the garment where the bulge pushes it out. Derived the first time and cached; null when the sprite has no print to carry, or is not a 32x32 resource.
Arguments:
- sprite - the worn icon as the garment's appearance holds it (a resource file, never an /icon object).
- state - its icon state.
- template - the bulge shape, from bulge_shape().
- colour - the colour the garment is drawn in ("#rrggbb"), or null: the print is read from the sprite as tinted, so the patch matches the garment drawn around it. The patch itself is drawn untinted.
bulge_printed_patch
A printed garment's precoloured patch past its family's small_cap (a /datum/bulge_sheet_state, drawn as it is), or null when its prints there are derived or it has none: the patch drawn for the penis shape's profile where the sheet has one (the human penis's name with the shape's icon state appended, and "_untoned" after it first for a shape drawn without skin tones whose untoned sprites draw differently), else the human penis's. None for a penis shape that draws the family's small_cap shape there (bulge_shape_size(): the tentacles, a shape past its print_cap), which keeps that shape's print. Arguments as bulge_shape(); with no penis shape, the human penis's.
bulge_register_icon
Registers an icon built at run time in the resource cache, as tg's derived icons are. The GetPixel() makes BYOND finish its deferred icon operations first, as GAGS does before it caches an icon.
bulge_rgb_to_hcy
bulge_v4.rgb_to_hcy: colorsys hue in degrees, chroma and Rec. 601 luma in 0-100, from 0-255 channels.
bulge_round_half_even
Python's round(): a half goes to the even neighbour.
bulge_shape
The shape a garment of family bulges with, as a kind map (a /datum/bulge_print_template), or null where the family
has none. Decoded the first time, or past small_cap derived (bulge_derive_large()); then a few list reads.
Arguments (positional; every one a scalar or a typepath):
- family - the garment's family typepath (its bulge_family).
- hard - TRUE when fully hard, FALSE when half hard.
- size - the bulge size, a whole number from 1 to 8; past the family's cap for the form, the cap's shape is drawn.
- digi - TRUE on digitigrade legs.
- shape - the penis shape's sprite accessory typepath; it matters past the family's small_cap.
- toned - whether the penis is drawn with skin tones (the organ's uses_skintones); it matters past small_cap.
bulge_shape_owner
The family whose shape, anatomy clearance or flap a family draws at a size up to its small_cap: itself, or the
family it names by design for that form (half_shapes_of, hard_shapes_of), except at the hard sizes in own_sizes,
the family's own of that kind (own_shape_sizes, own_clearance_sizes or own_flap_sizes).
bulge_shape_size
The size whose shape a family draws for a bulge of size on a penis shape: bulge_family_size(), except that past the
family's small_cap, where shapes follow the penis shape, a shape with none of its own (bulge_hyper FALSE, the
tentacles) draws the family's small_cap shape, as any other shape draws at that size, and so does a shape past its
print_cap (Nondescript (Alt), Tapered (Alt) and Hemi (Alt)); 0 for none.
bulge_shape_where
Where a family's shape for an identity is (see bulge_shape()), or null when the family has none there. Where the family has a precoloured printed patch (bulge_printed_patch()), the patch is drawn instead: no shape (the look shows the anatomy the shape of large_shapes_of leaves bare, under the patch: bulge_resolve()). The sheet is chosen by the garment's own family (a skirt reads skirt_shapes.dmi whichever family owns the shape), and a family named by half_shapes_of, hard_shapes_of or large_shapes_of is followed one level only: it must own its shapes. Past small_cap the shape has no sheet: the derived state named as bulge_large_name() names it.
bulge_sheet_state
The one /datum/bulge_sheet_state for a sheet's state, or null when the sheet has no such state; with no sheet
(icon_file null), the one for the derived state of that name.
bulge_size
The bulge size, 1 to 8, of a penis this long in inches: past 36 inches the penis sprite's own size thresholds (penis/get_sprite_size_string()) carry on, at 37, 49, 57 and 65 inches.
bulge_size_for_length
Bulges: a covered penis, at least half hard, draws the cloth it pushes out over the garment covering it.
One renderer, on the penis's own bodypart overlay. A body update asks the overlay whether it draws (can_draw_on_bodypart()); a covered penis then resolves its look (look.dm) and keeps it, memoised by the scalars it was resolved from, so an update that changed none of them compares a few vars and reuses the look. The look's key stands in for the penis's own render key, so the chest's limb icon cache holds a drawn bulge like any other limb image, and its images are built only when that key changes (get_overlay()).
What a look draws, at the cover's layer: just above the cover, and, for anatomy shown behind it, just below (BULGE_ABOVE_COVER, BULGE_BEHIND_COVER), whatever layer the penis itself is set to draw at.
- A printed garment: one patch derived from the cover's drawn sprite (print_derivation.dm), its emissive blocker.
- Any other garment: the shape's kinds as white masks tinted with the adaptive palette, and one emissive blocker.
- The heart boxers past size 4: their precoloured patch, over the bare part of the penis the shape it stands in for leaves bare.
- A hard loincloth: its drape over the penis, which shows through the cover cut away under it (cut_cover.dm).
- A revealing or curtain skirt: the penis behind the skirt, and over the cloth inside the skirt's clearance.
- Past a family's small_cap: the bare part of the penis, inside the exposed mask, over the cloth.
- What the cover draws over its own sprite (its blood, its dirt), over the cloth too, kept to the cloth's pixels.
- Over underwear that holds the penis in (look.dm, bulge_held_size()): the cover's own shape at the size the underwear holds it to, and none of the penis, nor a cut; nothing at all over a chastity sprite. Anatomy is the penis overlay's own images (and the testicles' behind a cover), restricted by masks where it shows over the cloth; it keeps their colours, emissives, skin textures and LIMB_OVERLAY_* flags. The cloth is clothing: it is drawn without LIMB_OVERLAY_TEXTURED, so the textures a limb draws its skin with leave it alone, and carries BULGE_CLOTH_NAME. The bulge size, 1 to 4, of a penis this long in inches.
bulge_sprite_pixels
One direction of a sprite the shapes past small_cap are derived from, frame 1, read once and kept for the round (as
many as the sprites have states and directions): its opaque pixels row by row from the top, as flat (index,
luminance) pairs. The index is row * 32 + column + 1, rows and columns from 0 at the top left; the luminance is that
of the pixel tinted with the skin tone, in thousandths, plus one. A penis or testicle sprite is read inside the window
those draw in (BULGE_SPRITE_*), a loincloth's (whole) all of it. Null where it has no opaque pixel, or no such state.
bulge_sprite_size
The size affix, 1 to 7, the game draws a penis this long with (penis/get_sprite_size_string()), within cap.
bulge_template_masks
Derives the white masks an adaptive bulge of a template draws (see /datum/bulge_print_template/var/mask_cloth), once per template: one registered icon per kind it has pixels of, and one of all its kinds together. Their state "" faces all four ways; north stays empty. The palette is the client's tint on them, so a recolour derives nothing.
bulge_toward
bulge_v4.toward: turns a hue toward a target by at most amount degrees.
bulge_two_prints
Whether two pixels (GetPixel() text) are different colours of a print (red and yellow, red and white) rather than one colour lighter or darker (black and its shine): one has chroma 30 or more and the other not, or both do and their hues are 25 degrees or more apart. Hues are compared as exact fractions, never as floating point; so a hue difference of exactly 25 degrees counts as two prints here, where the preview's colorsys floats may land a hair below 25 and call it one (no approved garment comes near a tie: the smallest margin in the corpus is 1.87 degrees).
bulge_white_tile
A white 32x32 tile in one direction, loaded once; copy it with icon() before drawing on it.
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
can_be_headrev
Checks if someone is valid to be a headrev
can_hear_radio_tts
Checks if the passed mob can hear radio TTS
- hearer - The mob to check if they can hear radio TTS
- radio_frequency - The frequency of the radio TTS message
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
capitalize
Returns a string with the first word of the string capitalized.
capitalize_word
Capitalizes the first symbol in a passed string. Unsafe when used with BYOND string macros, use capitalize() instead!
censor_ic_filter_for_pdas
Given a pda message, will replace any match in the message with grawlixs.
center_image
Center's an image. Only run this on float overlays and not physical 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)
character_preview_animation
A look's animation, for a walk: its facings' patches, as one iconforge recipe, and the steps the page shows them in.
flats is each facing's flat icon, stamped whether one flat walked facing UP serves them all (see
uni_icon_facings_json()), and width and height the canvas they share.
What moves in a facing is split into regions: leaves whose boxes overlap move together, on one timeline, and apart each keeps its own, so a quick flap and a slow flick don't make one long animation between them. Every patch is the whole look at a step, drawn by iconforge and cropped to its region; they go side by side, top aligned, into one image, "moving".
Returns null when nothing moves; otherwise list("json" = the "moving" iconforge entry, in pieces that join into "moving":recipe, "facings" = facing -> list(list("box" = list(x, y, width, height) of the region, from the canvas's top left, "steps" = list(list(the patch's left edge in "moving", or -1 for the facing as drawn, ms shown), ...)), ...)). Either way, "pending" = TRUE if a state it shows waits to be read, so it moves only in a later drawing.
character_preview_drawing_under_way
Whether iconforge is drawing a character preview now, which letting go of what it keeps would spoil. tg's asset loader asks too, as it lets go on every fire once its queue has emptied. A drawing whose proc was killed stops counting after CHARACTER_PREVIEW_JOB_TIMEOUT.
character_preview_effects
What the page draws over the character preview's drawing, because a flatten leaves it out: the rows tg's height filters move, and the mob's transform (body size). Takes the drawing's frame height and how far its tile sits above the frame's bottom (the "y" the page gets). Returns the page's keys for them, left out when the mob has neither:
- "rows": runs of the tile's columns, each list(first frame row, rows, first source row), counting rows from the frame's top; a source row of -1 leaves the run empty.
- "transform": list(a, b, c, d, e, f), the mob's matrix about its tile's centre with y upwards.
The page applies both to the drawing it already has, so a new height or body size needs no new drawing.
character_preview_flat_box
A flat icon's canvas, list(x1, y1, width, height): where its lower left pixel sits, counted from the flattened look's own (1, 1), and its size. A grown canvas says so itself; any other is its icon's, at (1, 1).
character_preview_glow
A look's glow, flattened facing dir onto box, its drawing's canvas as list(x1, y1, width, height) from the look's
own lower left pixel, or null when nothing in it glows. always draws it whatever it holds, blank if nothing, for a
facing whose drawing's other facings glow.
character_preview_glow_test_body
A preview body from preferences: lit is a lizard with emissive eyes and a glowing chest marking.
character_preview_glow_test_lit_pixels
How many of a glow's pixels light what is under them: red (blooming) or green, through any blockers.
character_preview_map_pixel_move
How one displacement map pixel moves its row: -1, 0 or 1 as character_preview_map_rows() has them, or null when it moves it sideways or by part of a pixel.
character_preview_map_rows
How a displacement map moves each of its rows, from the bottom: -1 when a row shows the row below, 1 the row above, 0 itself. FALSE for a map that isn't a tile wide, or whose rows don't each move whole and as one. tg's heights use a handful of shared maps, so each is read once.
character_preview_rows
The runs of frame rows that the mob's displacement filters move, as character_preview_effects() gives them, or null if there are none or one moves more than whole rows. Filters run in the order tg keeps them, each map centred on the tile and then moved by its own offset.
character_preview_turns_itself
Whether something redraws a mob when it turns, so each facing of it has to be walked on its own.
character_preview_walk
A look's facings as iconforge recipes, on one canvas that grows to fit parts that reach past the mob's tile, like big ears and wings: list("recipes" = facing -> recipe, "height" = canvas rows, "x" and "y" = how far the canvas reaches left of and below the tile).
One walk serves all four facings, stamped with each; see uni_icon_facings_json(). A mob something redraws when it turns, like a head whose worn feature offsets move glasses and hats to the side it faces (golems, Teshari), is turned and walked once per facing instead, each walk cropped to the canvas that fits all four.
With glow, a look with something that glows also gets "glow_recipes": each facing's glow on the same canvas; see
character_preview_glow(). A look with nothing that glows draws no more than it would without.
With animate, a look with something animated also gets "animation": its patches and their steps; see
character_preview_animation().
chastity_flavour
Sends optional server-owned flavour text. A checkout without private config sends no message.
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_atom_crushable
Can this atom be curshed by the vending machine Arguments
- atom/atom_target - the atom we are checking for
check_behind
Checks to see if atom/source is behind atom/target
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_whitelist
Checks whether someone's whitelisted or not.
Will return FALSE if the whitelist hasn't been loaded yet (which shouldn't normally happen).
Returns TRUE if they are, null or FALSE if not.
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()
claim_nova_import_prompt
One non-yielding claim enforces both cooldowns; persistent clients survive reconnects.
cleanup_expired_reta_grant
Cleans up an expired RETA grant from the active grants registry
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.
cleanup_overmind_blobs
Clean up blob references after overmind is destroyed - called asynchronously to avoid blocking Destroy()
clear_owned_masked_leg_icons
Release owned metadata when the existing masked-leg cache is explicitly cleared.
clear_status_display_biohazard
Clear specific emergency types
clear_status_display_emergency
Clear a specific emergency type from status displays emergency_type: The specific type to clear ("biohazard", "lockdown", "radiation", etc.) If emergency_type is null, clears ALL emergencies
clip_pubic_hair
Returns pubic hair clipped to the bare skin under a baring underwear: each of its pixels is kept only where the body is drawn, the chest and legs, and outside the underwear's span in its row, from the underwear's leftmost pixel there to its rightmost, each direction on its own. The hair's colour is the overlay's, so it's left out: made once a round for each hair state, underwear sprite and body, a cached resource.
All of it is icon operations on the four directions at once. A row's span is the pixels with underwear at or left of them, and at or right of them: each found by spreading the underwear's pixels right, or left, by 1, 2, 4, 8 and 16.
Arguments:
- hair_icon, icon_state: The hair's sheet and state.
- parts: What it's clipped to, from /datum/bodypart_overlay/mutant/body_hair/pubes/proc/pubic_hair_clip().
clockwork_say
Causes the mob or movable in question to speak a message; it assumes that the message is already translated to ratvar speech using text2ratvar()
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_camera_ctag_asc
Orders cameras by their c_tag ascending
cmp_client_colours
Sorts client colors based on their priority
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_custom_sprite_region_layer
Orders custom_sprite_region_map()'s images by layer, lowest first. sort_list() is stable, so region order holds within a layer.
cmp_dirt_parts_drawn
Sorts parts lowest drawn first: the higher layer number draws under.
cmp_dirt_underclothes_drawn
Sorts underclothes from dirt_underclothes_sprites() lowest first: the higher layer number draws under.
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_preview_region_cost
Orders regions by what all their patches would take, cheapest first.
cmp_rped_sort
Sorts stock parts based on tier
cmp_species_family_order
Sorts species family types by sort_order, lowest first.
cmp_uplink_category_desc
Orders by uplink category weight
cmp_vending_prices
Orders vending products by their price
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.
color_transform
Constructs a transformer, with optional color multiply pre-added.
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
condo_flat_render
Flattens a loaded room to a clean top-down icon: floors then objects, no lighting or parallax planes (those are what turn the picture into garbage).
condo_force_areas
Moves every reserved tile into a fresh /area/misc/condo so the room links up correctly.
condo_preview_asset_name
Asset name for an interior from its map path (".../alleyway.dmm" -> "condo_alleyway.png").
condo_sanitize_lamp_color
A valid "#rrggbb" lamp color or "" (default) - never trusts a raw client string.
condo_skip_turf
TRUE for turfs we don't want in the picture: the empty space around the room and the yellow cordon tiles the maps use as a boundary.
condo_validate_custom_map
Loads the template once into a temp reservation to confirm it loads + has a condo door, fixes its areas in the process, then frees it. Returns TRUE if it's usable.
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
copy_appearance_filter_overlays
Copies the passed /appearance, returns a /mutable_appearance
Filters out certain overlays from the copy, depending on their planes Prevents stuff like lighting from being copied to the new appearance
cosmic_trail_based_on_passive
If we are a cosmic heretic, this will return the appropriate effect trail based on our passive level. returns the default trail otherwise
count_by_type
return the amount of items of the same type inside a list
cracker_reactions_list
Global proc to build up the list of co2 cracker reactions
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_cosmic_field
Creates a cosmic field at a given loc
- Args:
loc: Where the cosmic field is created- Optional
creator: Checks if the passed mob has a cosmic passive. Upgrades the cosmic field based on their passive level - Optional
type: Makes a specific type of cosmic field if we don't want the default
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_girder_wall_recipes
Returns a list of newly created /datum/girder_wall_recipe instances from the given wall type lists.
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_books
Create a random book or books.
- amount: How many books to create.
- location: Where to create the books.
- fail_loud: If TRUE, will create a book with an error message if the database fails.
- category: The category of books to pick from. If null or BOOK_CATEGORY_RANDOM, will pick from any category on a per-book basis.
- existing_book: If set, will use this book object instead of creating a new one. Note passing any amount above 1 with an existing_book will still only create one book.
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
credits_to_spacecash
Takes an amount of credit and returns a list of space cash typepaths that are equivalent to that amount. For example, if you passed 450 credits, it would return a list with a c200, another c200, and a c50 space cash stack typepath. You can then use the list to new() all the types provided if you wanted to give a player that amount in space cash.
- amount - the amount of credits to convert to space cash. If you provide a decimal, rounds down to the nearest whole number.
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
custom_hair_appendage_name
An appendage name as saved: tags, stray angle brackets, backslashes and control characters removed, spaces collapsed, at most CUSTOM_SPRITE_MAX_APPENDAGE_NAME characters. Null when nothing is left.
custom_hair_appendage_views
An appendage's painted views, re-encoded canonically. Unreadable and empty views are left out.
custom_hair_appendages_export
Appendages in export form: every view and emission setting spelled out, keyed as saved. Null without any.
custom_hair_appendages_validate
A drawing's appendages as they are saved, keyed "1", "2", "3" in order, or null when none are left.
The keys are strings so deep_copy_list() copies each record instead of turning it into a key. An entry that isn't a record, attaches at an unknown zone, sits neither under nor over hats or has no paint is dropped on its own, and a missing or unusable name becomes "Appendage N". Entries past CUSTOM_SPRITE_MAX_APPENDAGES are dropped.
custom_hair_appendages_validate_strict
Strictly validates a style file's appendages, as custom_style_validate_drawing() does its views. Nothing is salvaged, and messages never repeat uploaded text.
Arguments:
- raw_appendages: The decoded "appendages" object, keyed "1", "2", "3" in order.
- legacy: Accepts stored styles, where empty views and emission settings may be absent.
Returns list("appendages" = canonical appendages) or list("error" = message).
custom_hair_try_on_image
The hat a try-on puts on the preview: its worn sprite on the head layer, placed as the body places head items.
custom_hair_try_on_mask_rows
Where a try-on hat's hair mask keeps and trims paint on the hair canvas: per view, height rows,
top row first, of eight hex digits. Each digit is four pixels, the leftmost in its high bit: set
where the mask keeps paint, clear where it trims. That's a quarter of a character a pixel, and the
window sends these with every rebuild. The mask is lowered by the hairstyle's y_offset and
carried upward as its top row, as it is on the paint itself. Cached.
custom_hair_try_on_ui_data
The window's Try on hats for a hair canvas height tall, drawn lift off the tile, over a
hairstyle lifted y_offset. The window crops its "Hats that cover it" chips from the front
views itself: BYOND exports an icon smaller than a tile padded out to 32 by 32.
custom_hair_try_on_views
A try-on hat as the hair canvas shows it, per view: its worn sprite placed against paint drawn lift = list(x, z) off the tile. Data URLs, cached.
custom_limb_markings_validate
Zone drawings keep the existing codec; discard unknown zones and independently copy each valid drawing.
custom_marking_partner
The other half of an arm/hand pair, which share one limb, or null.
custom_marking_zone_limb
The bodypart that carries a marking zone's paint.
custom_marking_zone_overlay_type
The overlay identity for a marking zone, so zone, hand and taur paint on one bodypart stay independent.
custom_marking_zone_width
A zone's own drawing width: the taur spans the wide canvas, everything else the body's 32 pixels.
custom_sprite_all_views
The drawing's own view list, then each appendage's: live references, so writes change the drawing.
custom_sprite_appearance_drawing
Appearance copies honor the master preference without changing saved layer settings, appendages' included.
custom_sprite_append_mask
Adds paint's glow mask (glowing) or blocker mask to overlays for the facings whose emissive setting matches,
placed like visible. Adds nothing when no facing matches. Dropped heads and limbs face South.
custom_sprite_apply_region_results
Puts every region's drawing and base markings on a body, then redraws it once.
custom_sprite_apply_round_style
Changes a live body's round appearance for one drawing target.
DNA keeps the edit for regenerated limbs; attached donor parts retain their other snapshots. Normal redraws preserve native markings, skin and the unedited custom layers.
custom_sprite_apply_round_styles
Changes a live body's round appearance for several drawings, redrawing it once.
Tattoo regions go on together through custom_sprite_apply_region_results(); a hair target redraws only the hair.
custom_sprite_background_tiles
Nova's character preview backgrounds as tiles for the custom editors' background swatches.
custom_sprite_blank_icon
A blank in every editable direction, including bald hairstyles without an icon state. Insert() alone leaves an empty icon reporting 0x0, so seed its dimensions from the blank.
custom_sprite_body_draw_mask
Row strings keep the wire payload small and test the same silhouette used by rendering. wrist gives a hand its wrist band.
custom_sprite_body_draw_mask_key
What custom_sprite_body_draw_mask() draws a zone's silhouette from, as text: the canvas, the zone, and the icons and states of the limbs that draw it. The same key draws the same mask, so it stands for the mask's rows in other keys.
custom_sprite_body_silhouette
Compose geometry in the canvas frame without stretching or changing the body's origin. wrist gives a hand its wrist band.
custom_sprite_boxes_recipe
A blank tile with these iconforge transforms applied in order, such as DrawBox boxes, as a recipe, or null for none.
custom_sprite_cache_put
Keep runtime caches bounded. Callers treat cached icons/lists as immutable.
custom_sprite_canvas_bounds
Full canvas for hair and facial hair; per-view locks are applied separately.
custom_sprite_canvas_code
A palette index as digits characters of CUSTOM_SPRITE_INDEX_ALPHABET, most significant first.
custom_sprite_color
A colour as #rrggbb lowercase, or null when the text isn't exactly that.
custom_sprite_compat_sidecar
A whole account sidecar as the branch wrote it, one slot with every key, and what loading it must give back.
custom_sprite_compat_v1
Old-format drawings as the branch's own writer stored them, built without any codec proc so a codec change can't regenerate them. v1, two colours: pixel (0,0) is colour 1 and (1,0) colour 2 in the Front view; 1,022 empty pixels follow (68 runs of 15 and one of 2).
custom_sprite_compat_v1_legacy_emissive
v1 as an even older save wrote it: one emissive flag for every view, an explicit filter, a solid Front view (68 runs of 15 and one of 4).
custom_sprite_compat_v2
v2, all 63 colours in the Front view's first row, a solid Back view of colour 63, per-view emission.
custom_sprite_compat_v3
v3, the 64-wide taur zone, one colour everywhere in the Front view (136 runs of 15 and one of 8).
custom_sprite_compat_v4
v4, a tall hair canvas: first and last Front pixels are colour 1; Back is solid colour 2.
custom_sprite_compose_regions
Builds the whole-body canvas from each region's saved drawing.
Each pixel shows its owner's paint. An arm and its hand share one limb and hand paint draws above arm paint, so at a pixel either of them owns the hand's paint wins and the arm's shows where the hand has none. Paint hidden under a different limb isn't shown, as in game.
Arguments:
- drawings: zone -> saved drawing, or null.
- region_map, zones: From custom_sprite_region_map().
- width: The canvas width.
Returns direction -> 32 rows of width "#rrggbbaa" colors, the workspace frame format.
custom_sprite_cover_char
The mark that names looks[index] in cover rows: 1 to 9, then a to z.
custom_sprite_cover_labels
The looks' labels in mark order, for the window's tooltip.
custom_sprite_cover_looks
The looks that can hide paint: the hair, every mutant part drawn on the body, each piece of
underwear and, given a wearer, each item they have on. Each look carries its images, offset
the way get_limb_icon() draws them, the highest layer it draws on and a label for the window;
worn items are also marked worn. Looks come lowest layer first, so stamping them in order
leaves the topmost part at each pixel. Parts behind the body, hidden parts, the taur body (which
carries its own paint) and emissive images are left out. key, when given, collects what each
look is drawn from and where it lands, so rows flattened from these looks can be cached by geometry.
custom_sprite_cover_rows
One view of the cover looks as rows of marks: "0" where nothing covers, else the mark of the
topmost look (custom_sprite_cover_char(N) for looks[N]). Only images drawn after above_layer
count, so the same looks serve body paint and hand paint. bounds (0-based, inclusive x0, y0,
x1, y1) limits the pixel reads to the drawable box; outside it is clear. With cache_key (from
custom_sprite_cover_looks), the same look reuses its rows across rebuilds and editors.
custom_sprite_cover_worn
Which looks, in mark order, are worn items (1) rather than parts of the body (0), for the window's tooltip.
custom_sprite_covered_positions
Where a region's paint in one view sits under a different limb or outside every region.
The canvas never shows paint there. Pixels its arm/hand partner owns aren't included, since the canvas shows their paint.
Returns positions in colors, a region's pixels in one view, that hold covered paint.
custom_sprite_decode_grid
Reject before expanding, and stop at the supported pixel count even for hostile runs.
custom_sprite_direction_signature
One view's pixels as color text, so two drawings compare by what they show, not palette order. Appendages' pixels in that view follow the hair's.
custom_sprite_directional_mask
Include explicit blank frames: a missing facing would fall back to the South mask.
custom_sprite_draw_recipes
Draws recipes with iconforge, a picture each, on the main thread: a few tenths of a millisecond per picture,
where getFlatIcon() takes several for one view of a body. Each PNG goes to publish, a data URL of it when
there's none. Returns view -> what publish made of it.
With a name, the files are kept where custom_sprite_picture_path() says, each drawing under the name
overwriting the last: making and deleting a file costs more than drawing the picture. Their owner deletes them
with custom_sprite_forget_pictures(). Without one, each file is deleted once published.
custom_sprite_drawing_pixels
One drawing's pixels as colors, row-major from the top left.
An explicit tint is baked in, so the colors are what the game shows. A drawing of the wrong width for its zone, or no drawing at all, reads as empty.
Returns direction -> list of width * 32 entries: "#rrggbb", or null for transparent.
custom_sprite_emissive_mask
Reuse the visible paint's placement; shared worn/bodypart preparation owns pose transforms.
custom_sprite_emissive_settings
Older drawings used one boolean; each view now owns its own saved choice.
custom_sprite_encode_grid
Each run is a hex length (1-f), followed by one palette-index character. Coordinates are row-major from the top left, matching SpriteEditor.
custom_sprite_extend_up
A copy of a 32-row icon grown to height rows, its top row repeated upward, so hair masks and gradients carry on over tall paint.
custom_sprite_flat_icon
Clip in body coordinates before flattening can expand a wide or offset overlay's origin. A tall
canvas reaches above the tile, and shift_x and shift_z move the whole window the way a lifted
hairstyle moves the paint drawn over it.
custom_sprite_forget_pictures
Deletes the pictures kept under a name, and under any name it begins.
custom_sprite_grid_args_valid
Grids are 32 rows of 32 or 64 pixels, or CUSTOM_SPRITE_TALL_HEIGHT rows of 32, indexing a palette of 1 to CUSTOM_SPRITE_MAX_COLORS colors.
custom_sprite_hair_canvas_height
The hair canvas a base look asks for: tall for custom hair over the tall bald base, otherwise 32 rows.
custom_sprite_hair_cover_key
The look the head's hair images were built from: those icons are generated at runtime and can't be keyed by path.
custom_sprite_hair_lift
Where a body's hair, and custom hair painted over it, are drawn from the tile, as list(x, z) pixels.
A hairstyle drawn above the head, such as Afro (Huge), lifts both, as the species' hair offset does.
style names a hairstyle other than the body's own.
custom_sprite_hand_silhouette
A hand's own pixels plus, with wrist, a short band of the arm just above them, so hand paint can't climb the arm.
custom_sprite_hash
Content identity of a whole drawing, "empty" for none.
custom_sprite_height
Tall hair drawings are version 4; every other drawing is 32 rows.
custom_sprite_history_jump
Clamps an undo or redo step count to what a window can ask for. Anything else passes through for the history to refuse.
custom_sprite_hydrate
Paints a drawing into a workspace's frames, centred on a wider canvas and at the bottom of a taller one.
custom_sprite_icon_bounds
Inclusive bounds in the editor's top-left coordinate system.
custom_sprite_icon_rows
Each view of a 32-row icon as row strings from the top, width characters each: "0" where it's
clear and "1" where it has a pixel. With ids (colour -> region character) a pixel reads as its
colour's region instead, and a blend as the region custom_sprite_region_fallback() finds in ordered.
custom_sprite_index_values
CUSTOM_SPRITE_INDEX_ALPHABET character -> its palette index. "0" is transparent.
custom_sprite_insert_marking_icons
Adds each zone's native marking once to the same cached sheet used by hair preferences.
custom_sprite_lifted_hair_test_top
The topmost painted pixel of a hairstyle's front view, as list(x, y) counted from the bottom left.
custom_sprite_limb_appearance
A body without its hair, so nothing hanging off the head covers the limb being drawn on.
A copied appearance holds appearances, not the images they were built from, so subtracting the mob's own hair overlays silently does nothing. Dropping the layer through the mob and putting it straight back does, and nothing else reads the body in between.
custom_sprite_limb_state
Raw limb geometry, using exactly the state selection in get_limb_icon().
custom_sprite_live_package
The recipient's live style for one target. Hair includes the whitelisted base hair look.
custom_sprite_live_package_from
The live form of an applied package: emission follows the body's current permission.
custom_sprite_live_packages
The recipient's live look for every drawing a salon target covers, by style key.
Markings cover every zone, including ones this body lacks right now, so a limb attached later is still told apart from the one work started on.
custom_sprite_marking_icons
Immutable per-zone marking classes, shared by character setup and tattoo editors.
custom_sprite_mask_bounds
Each view's paintable area padded by one pixel, from row-string masks.
custom_sprite_mask_pixels
The pixels a compact stroke mask of size characters marks, or null when it is another size, which custom_sprite_mask_points() refuses unread, or a character isn't in the alphabet.
custom_sprite_mask_points
A stroke's points from its compact mask: CUSTOM_SPRITE_INDEX_ALPHABET characters, six canvas
pixels each, row-major from the top left, lowest bit first. A whole view fits in one short string,
so a long stroke reaches the server as one message instead of a point list tgui splits into many.
With allowed, the mask's six-pixel slots in the same layout, each character is cut down to the
pixels its slot allows as it is read, which checks the points for a canvas that paints only those.
Returns list(list(x, y), ...), or null when the mask isn't exactly this canvas's size.
custom_sprite_mask_tables
Reads compact stroke masks by character code, which text2ascii() takes far faster than copytext() cuts a character.
Returns:
- list: For codes 0 to 127, at code + 1, the six pixels' bits of that character, or null outside CUSTOM_SPRITE_INDEX_ALPHABET; then, at code + 1, how many of them are set; then, at bits + 1, which offsets are set.
custom_sprite_merge_cover_rows
One view's cover rows with each pixel judged against the layer its own region's paint draws on.
Body paint sits at BODYPARTS_LAYER and takes body_rows; hand paint sits at the hand's aux layer
and takes high_rows; taur paint rides the taur's own top layers and is never covered. Pixels no
region owns stay clear. Without a region map the body rows stand as they are.
custom_sprite_native_marking_icons
Full-size mirror sprite classes for markings whose sheet is larger than a tile. The ordinary 32x32 markings reuse their picker sprite. Kept beside the picker in the same preferences asset, so hovering requests no drawing.
custom_sprite_obstructing_overlay
Whether a bodypart overlay hangs over the limb's paint: every mutant part except the taur body, which carries its own paint, and a moth chest's extra arms.
custom_sprite_packages_hash
One content hash for a set of packages, so a change to any of them shows.
custom_sprite_paint_icon
Called by debounced previews and appearance rendering, never by the per-stroke UI payload. Throwaway drawings skip the cache.
custom_sprite_palette_colors
The colours a saved or uploaded palette offers, canonical and lowercase.
Returns null when an entry isn't a colour or repeats one. With strict, an entry that carries a
value (the palette written as an object rather than an array) is refused as well, as uploads and
the account palette are; stored drawings stay lenient about it, as they always have.
custom_sprite_picture_icon
A drawn PNG as a native icon, for reading its pixels.
custom_sprite_picture_path
Where custom_sprite_draw_recipes() keeps the picture of one view drawn under a name; size is "[width]x[height]".
custom_sprite_picture_url
A drawn PNG as the data URL a window shows.
custom_sprite_pixel_hash
Tint and emissive settings affect appearances, not the drawing's raw pixels.
custom_sprite_pixels_drawing
Encodes one region's pixels as a canonical, literal-color drawing.
Returns list("drawing" = drawing, or null when nothing is painted), or list("error" = text) when the region would need more than CUSTOM_SPRITE_MAX_COLORS colors.
custom_sprite_placement_key
Where an image lands when flattened: its offsets and layer. Its art is keyed separately.
custom_sprite_present_regions
The marking regions this body can be painted on right now, in draw order.
Limbs follow the body's own render order (get_all_limbs(), as update_body_parts() draws them).
Each hand comes straight after its arm, because hand paint draws above arm paint on that limb.
A visible taur comes last; its native layers sort it in front of or behind the rest when the
map is composed. Missing limbs, stumps and invisible taur legs have no region, and a hand only
exists through its arm.
custom_sprite_preview_appearance
A body's look with worn overlays added, captured so its views can be flattened one at a time.
custom_sprite_preview_height
The rows a body's pictures need: taller while its hair drawing reaches above the head, and taller
again for a hairstyle drawn above it, such as Afro (Huge). style names a hairstyle other than
the body's own.
custom_sprite_preview_width
The canvas width a body's previews are flattened at: a taur organ widens it.
custom_sprite_private_view
One region's pixels in one view, copied on first write, since decoded pixels may be shared with the caller's cache.
custom_sprite_region_color
Region N's ID color. Regions paint nothing else, so a pixel of this color is unambiguous.
The colors sit on a circle, so a blend of two regions at an antialiased edge falls inside it and never reads as a third region.
custom_sprite_region_fallback
The region that dominates one blended pixel, as its region character.
Images composite from the top down, so each one's share of the pixel is its alpha times what the images above it left showing. A tie goes to the higher image.
custom_sprite_region_id_drawing
A solid drawing of region N's ID color across one editing mask, or null when the mask is empty.
custom_sprite_region_map
Which region owns each canvas pixel, in every view.
Every region's pixels are filled with its ID color and pushed through its real overlay type, so the hand/arm layering, the leg split and the taur's native layers all apply as they do in game. A hand counts only its own pixels: its drawing may also paint the arm rows just above it, but those stay the arm's, so the arm's region runs its whole length. The images are composed in draw order (by layer, then region order) and the result is read once per view. A blended edge pixel goes to the region that dominates it. Maps are cached by the geometry that produced them.
Arguments:
- body: The body whose limbs and taur organ define the regions.
- zones: The regions to map, from custom_sprite_present_regions().
- width: The canvas width, 32 or CUSTOM_SPRITE_TAUR_WIDTH.
Returns direction -> 32 row strings of width characters: "0" for no region, "N" for zones[N].
custom_sprite_region_mask
The paintable mask of a region map: every pixel an unlocked region owns. locked holds region characters.
custom_sprite_region_owner
The region owning a canvas pixel (0-based), or null.
custom_sprite_region_pixel
One region's color at a canvas pixel, or null.
custom_sprite_region_position
Where a canvas pixel falls in one region's own drawing, which may be narrower than the canvas. 0 when outside it.
custom_sprite_region_signature
A cheap fingerprint of one marking zone's live look: its paint's hash and its native markings.
Looks with the same fingerprint have the same package hash, so a matching fingerprint spares the full comparison.
custom_sprite_region_visible
What the game shows at a canvas pixel: its owner's paint, with a hand's paint over its arm's.
custom_sprite_render_views
Front, Back, Right and Left data URLs of a captured look, without flipping any view, from one walk. Each
picture's PNG goes through the callback when one is given, in GLOB.cardinals order, and is kept under name
when one is given; see custom_sprite_draw_recipes().
custom_sprite_reopen_test_drawing
A version 1 drawing with one pixel painted at x, y in its Front view.
custom_sprite_resize_drawing
Fits canonical paint to a larger canvas: centered on a wide one, at the bottom of a tall one, so it keeps its place on the body. Refuses shrinking, so no paint can be lost.
custom_sprite_run_text
One index character repeated run times (1-15), cut from a string built once per character.
custom_sprite_salon_changes
Region labels a set of packages changes, in body order. Hair packages name none.
custom_sprite_salon_choose_draft
Asks which retained draft to reopen. Sleeps on the prompt.
custom_sprite_salon_claim_request
Claims the recipient's single incoming prompt and the pair's request cooldown.
custom_sprite_salon_draft_key
Where an artist keeps their draft for one drawing target on one person.
custom_sprite_salon_dummy
Builds a private preview body from a live body's current appearance.
This deliberately avoids generate_dummy_lookalike(), which reapplies saved preferences and can undo round changes. Only appearance data is copied: no inventory, mind, quirks or effects. Replaced and missing limbs follow the source body.
custom_sprite_salon_export_live
Sends a player their own live look for a salon target: one file for hair, a whole-body file for a tattoo.
custom_sprite_salon_keys
Style keys a salon target covers: the hair target itself, or every marking zone.
custom_sprite_salon_label
What salon work on a target is called. A zone names where a tattoo is; without one it's the whole body's.
custom_sprite_salon_open_draft
Reopens a retained draft for its artist, rebinding the artist's body and tool.
custom_sprite_salon_previous
Style key -> a copy of the look each of a target's drawings had before its last salon change, for those that have one. keys limits it.
custom_sprite_salon_request
Asks a recipient to start custom work, then opens the artist's editor. Sleeps on prompts.
Call through INVOKE_ASYNC from item interactions. Every condition is checked again after each prompt, because either player may have moved, changed bodies or disconnected meanwhile.
custom_sprite_salon_request_restore
Asks a recipient to restore the looks they had before their last salon change. Sleeps.
Restoration uses the same preview, consent and timed application as new work, but has no draft. A tattoo with more than one region to restore asks whether to restore the whole body or one region.
custom_sprite_salon_restore_choices
What Restore previous offers for several previous looks: the whole body, then each region by name. Label -> style keys.
custom_sprite_salon_restore_problem
Why an artist can't start restoring previous looks, or null. keys limits which looks count.
custom_sprite_salon_resume
Resumes a retained draft from a tool's self-use action. Sleeps only when asking which one.
Returns TRUE when this tool had something to resume.
custom_sprite_salon_session
The artist's retained draft for one drawing target on one person, or null.
custom_sprite_salon_sessions_for
Every draft this artist has, newest last.
custom_sprite_salon_sessions_for_tool
The drafts this tool can resume.
custom_sprite_salon_start_problem
Returns why an artist can't start work on a recipient, or null when they can.
Starting requires two distinct connected players, a supported human recipient, adjacency and the right tool in hand. The drawing target must exist and be reachable; for a tattoo, some part of the body.
custom_sprite_salon_start_restore
Shows the recipient previous looks to restore, in the mirror. keys limits them to the chosen ones.
Regions that can't be worked on right now, such as covered ones, are left out and named, as long as something is left to restore.
custom_sprite_salon_target_problem
Why a drawing target can't be worked on. Markings without a zone mean the whole body. Addresses the recipient when they're doing the work.
custom_sprite_salon_tool_menu
Offers new custom work or restoration of the previous round style, then starts the request. Sleeps.
Arguments:
- tool: The scissors or tattoo machine in the artist's hand.
- target: "hair", "facial_hair" or "markings". Markings cover the whole body.
custom_sprite_sample_hair_palette
Bake effective hair color into source shades; gradients already supply their own RGB.
custom_sprite_sample_palette
Sample the most frequent opaque shades from all four authored directions.
custom_sprite_self_mirror
Whether someone can see the parts of themselves they can't look at directly.
A hand mirror you're holding, or a mounted mirror you're standing by.
custom_sprite_shade
A sampled shade multiplied by a colour's channels, exactly as painted hair shades have always been built. Not custom_sprite_tint_color(): that rounds as the window does, and recolours match paint by these exact values.
custom_sprite_sidecar_path
The drawing sidecar beside a preferences.json path, or null when the path has no directory.
custom_sprite_silhouette
White RGB and original alpha: multiplying by this clips without darkening the paint.
custom_sprite_split_regions
Splits the canvas back into each region's drawing, changing only what was edited.
A pixel is edited when the canvas differs from the baseline. An edited pixel goes to its owner, and leaves the owner's arm/hand partner so the old paint can't show through. Every other pixel, including stranded paint and paint hidden under a different limb, keeps its saved value, except in views where Clear, an import or a restoration replaced the region outright.
Arguments:
- frames: direction -> the canvas now.
- baseline: direction -> the canvas when the draft opened or was last saved.
- drawings: zone -> saved drawing, or null.
- region_map, zones, width: The map the canvas was built with.
- decoded: Optional zone -> custom_sprite_drawing_pixels() of
drawings, reused read-only. - resets: Optional zone -> views ("2" -> TRUE) replaced outright, where covered paint goes too.
Returns zone -> list("drawing" = drawing or null, "changed" = TRUE/FALSE, "error" = text or
null) for every zone in zones and drawings. Unchanged zones return their saved drawing.
custom_sprite_tall_hair_test_drawing
A 32 by 48 hair drawing with one pixel painted, in every view. Rows count down from the top.
custom_sprite_tall_hair_test_short_drawing
A 32 by 32 hair drawing painted in every view, once in its top row and once in its bottom row.
custom_sprite_taur_overlay
The taur organ owns its visible body; its two leg placeholders have no paintable pixels.
custom_sprite_taur_paint_test_drawing
A 64 by 32 taur-zone drawing painted solid in one color, in every view.
custom_sprite_taur_silhouette
Native taur geometry in its centered 64 by 32 frame, shared by editing and rendering.
custom_sprite_test_canvas_mismatch
Returns where the window's canvas, as an update encodes it, differs from the drawing: the first pixel of a view it carries that doesn't decode to the pixel there, or null when every one does, as a whole encode would.
Arguments:
- workspace: The workspace.
custom_sprite_test_close_pixel
Whether two GetPixel() results are the same colour to within the rounding iconforge and BYOND's icon procs differ by.
custom_sprite_test_drawing
A version 1 drawing painted solid with palette index shade in every view.
custom_sprite_test_front_drawing
A drawing with one painted pixel, in the Front view only.
custom_sprite_test_hidden_pixel
A pixel a region's own mask covers but a different limb owns on the canvas, as list(direction, x, y), or null.
custom_sprite_test_lit_pixels
Pixels of a picture that light what is under them on the emissive plane, red or green, as list("x,y").
custom_sprite_test_open_region_pixel
The middle of a region's pixels in a view that nothing drawn over the body covers, as list(x, y), or null.
custom_sprite_test_paint_region
Paints one pixel a region owns with the first color the canvas offers.
custom_sprite_test_paintable_point
The first pixel this draft may paint in one view.
custom_sprite_test_pool_colors
Saves up to count distinct colors across the body's regions in the Front view, a few per region, and returns how many it placed.
custom_sprite_test_region_drawing
A drawing with the same pixels in every view. Points are list(x, y, "#rrggbb").
custom_sprite_test_region_fixture
Chest owns x 0-3, the left arm 4-7 and the left hand 8-9 on the first row.
custom_sprite_test_region_pixel
The first canvas pixel a region owns in one view, as list(x, y), or null.
custom_sprite_test_region_rows
A region map whose first row is first_row (padded with "0") in every view; every other row is empty.
custom_sprite_test_region_seam
A front-view pixel of upper right above a pixel of lower, as list(x, y) of the upper one, or null.
custom_sprite_test_region_workspace
A region workspace over two regions on the first row: "1" at x 0-3, "2" at x 4-7.
custom_sprite_test_remove_sidecar
Deletes a sidecar's primary, backup and staging files.
custom_sprite_test_same_pixels
Whether two icons have the same pixels in every cardinal view of their 32 by 32 area.
custom_sprite_test_selection_placement
The compact placement the selection tool sends for a temporary picture or a final drop.
custom_sprite_test_taur
The real external organ path, including its hidden leg slots and matrixed sprite layers.
custom_sprite_test_wide_drawing
A version 3 taur-zone drawing whose every row is row (64 indexes), solid colour 1 by default.
custom_sprite_tint_color
Match the Custom palette's frontend multiplication and nearest-integer channel rounding.
custom_sprite_transaction_pixels
How many pixels a stroke or placement touches, from what the window sent, before any validation.
custom_sprite_underwear_looks
Each piece of underwear the body shows, as a look of its own: underwear, bra, undershirt and socks.
custom_sprite_validate
Reconstruct a bounded, canonical payload. Missing directions are ordinary empty canvases. Only hair passes allow_appendages; other drawings lose any.
custom_sprite_version
Wide canvases are version 3 and tall ones version 4. Otherwise version 1 holds up to 15 colors and version 2 the rest.
custom_sprite_view_recipes
A look in custom_sprite_flat_icon()'s window, facing each of the editors' views, from one universal icon walk: view -> iconforge recipe. custom_sprite_draw_recipes() draws them.
custom_sprite_width
The format owns the canvas dimensions; legacy drawings always remain 32 by 32.
custom_sprite_worn_looks
What the wearer has on, a look for each worn item, labelled by its name. Held items are left out.
custom_sprite_worn_overlays
This body's worn clothing overlays, in layer order. Held items are left out.
custom_sprite_zone_covered
Returns whether worn clothing covers a marking zone.
This reads the same worn coverage flags as other clothing checks, but per zone: a rolled-up jumpsuit exposes the arms, and gloves only cover the hands rather than the whole arm.
custom_sprites_after_import
Imports replace the character identities, so an old slot's drawings cannot carry across.
custom_style_apply_base_markings
Change only this limb/hand's native markings and its DNA snapshot. The caller redraws the body.
custom_style_apply_hair_context
Applies a whitelisted hair look to a live or preview body.
custom_style_body_export_text
Whole-body export: every region's drawing and base markings in one file.
custom_style_copy_markings
Copy record arrays without deep_copy_list() turning their list values into associative keys.
custom_style_copy_package
Canonical packages own every drawing, native context and marking record they carry.
custom_style_copy_previous
Keep each previous package's native record array independent and JSON-serializable.
custom_style_emissive_problem
Why a drawing's or appendage's emission settings are refused, finishing "The drawing's ...", or null when they're fine or absent.
custom_style_export_drawing
A drawing in export form: all four views and their emission settings, or null for empty art.
custom_style_export_text
The export format always includes all four views and their emission settings.
custom_style_file_label
The download name for a package: custom-hair-style, custom-facial-hair-style, custom-tattoo-
custom_style_gradient_key
The gradient key a head target stores under.
custom_style_hair_accessories
The accessory list a head target draws on.
custom_style_hair_color_map
Maps painted hair shades from one base hair look to another.
Only a recolor of the same hairstyle maps: different hairstyles have their own shades, so their paint keeps the colors it was drawn with. Shades that collapse onto one color under the old look are ambiguous and left alone, as are the account's saved custom colors.
Returns list(old color = new color), or null when nothing should move.
custom_style_hair_gradients
The gradient list a head target draws from.
custom_style_hair_preference_types
Every preference a head target's base look is saved in: its fields, plus head hair's opacity toggle.
custom_style_hair_shades
The hairstyle's shades tinted by a hair look's color, in sampling order and without merging. Palettes dedupe these; recolors need the positions to line up between two looks.
custom_style_hair_slot_data
Returns an updated copy of a character's save data, or null when that slot has no data.
custom_style_hair_target
Whether a drawing target is head hair or facial hair.
custom_style_has_emission
Whether any view of a drawing glows.
custom_style_key
The key a style is stored under: the target, or markings:zone.
custom_style_live_hair_context
A body's live base look for a head target, read from its head when it has one.
custom_style_marking_conflict
Returns the marking a region's rows already wear that keeps another off it: one of its exclusion group. The preview and saving set a region through set_zone_from_list(), which drops the second marking of a group, so the editor refuses it first.
Arguments:
- entries: the region's marking records, in order.
- name: the marking that would go on.
- ignore_index: the row that marking would replace, or is itself, whose own marking doesn't count.
Returns:
- text: the name of the marking in the way, or null.
custom_style_marking_data
Convert validated records back into the native marking renderer's ordered map.
custom_style_marking_entries
Ordered, portable records for native markings: a limb's or a collection zone's entries, or a zone's saved nested shape.
custom_style_markings_slot_data
Copy a character's saved native markings and replace exactly the selected zone, including Clear.
custom_style_matches
Compare a legacy drawing-only package with the base markings it would preserve.
custom_style_normal_color
A colour as the preference writer stores it, black when invalid.
custom_style_normal_opacity
Keep explicit opacity, including fully opaque hair on naturally translucent species.
custom_style_package
A canonical package that owns copies of its drawing, hair look and markings.
custom_style_package_hash
Content identity for proposals, rotations and unchanged checks.
custom_style_paint_outside
Returns the first view with paint outside the destination's allowed pixels.
Arguments:
- bounds: Direction -> inclusive editor bounds, or null for the whole canvas.
- mask: Direction -> row strings, or null for no silhouette restriction.
Returns:
- null: Every painted pixel is allowed.
- text: The label of the first offending view.
custom_style_parse
Parses an uploaded style file into a package.
Envelopes must match the export format exactly. Strictly valid legacy drawing-only files are
also accepted; they return legacy so the open editor can supply its own target and hair look.
Returns:
- list("package" = package, "legacy" = TRUE/FALSE)
- list("body" = zone -> package, "legacy" = FALSE): A whole-body style.
- list("error" = message): Safe to show the player. Never includes uploaded content.
custom_style_previous_validate
Previous styles are trusted disk data, but still pass the strict package validator.
custom_style_read_file
A file's text, or null when it's missing or larger than max_bytes.
custom_style_receive
Asks a player for a style file and parses it. This sleeps while the file dialog is open.
The byte size is checked before the file is read. BYOND has already received the upload by then, so this limit protects parsing, not the transfer itself. Callers must recheck ownership, slot, session and draft revision after this returns.
Returns:
- null: The player cancelled.
- list("package", "legacy", "bytes"), list("body", "legacy", "bytes") or list("error", "bytes"): See custom_style_parse(). An error before a file was chosen or read has no "bytes".
custom_style_recolor_drawing
Rewrites literal-color paint through a color map, keeping every pixel where it is.
Legacy no-tint paint already follows native hair coloring, so its raw shades must not change. Entries that collide after mapping are merged into one palette slot, so a recolor can shrink the palette but never reorders or moves paint.
Returns:
- list: The recolored drawing.
- The original drawing: Nothing in the palette changed.
- null: The drawing could not be decoded.
custom_style_rewrite_markings
Rewrites a limb's native marking records. Markings are stored by name, so one limb can't wear the same marking twice, and their order is kept.
Arguments:
- entries: Ordered records.
- index: Which marking to act on, or null when adding.
- name: The marking to use, or null to remove the one at
index. - color: A new color, or null to keep the marking's current one.
Returns the new ordered records, or null when there's no marking at index.
custom_style_send
Sends one package to a client as a downloaded file.
custom_style_send_body
Sends a whole-body style to a client as a downloaded file.
custom_style_send_text
Sends export text to a client as a downloaded file.
The temporary file uses a fixed directory and a server-generated name; nothing from the contents becomes a path. It is removed on every exit path.
Returns:
- null: The download was sent.
- text: Why it wasn't.
custom_style_spawned_slot_problem
Returns why a body's style can't be saved to the selected character slot, or null when it can.
Without these checks a save could land on whichever character happens to be selected in character setup instead of the one this body spawned as.
custom_style_test_cleanup
Deletes the preference and sidecar files a test wrote to folder.
custom_style_test_export
The export text of a package holding drawing for target and zone.
custom_style_test_facial_style
The name of the first facial hairstyle that has a sprite.
custom_style_test_folder
A fresh temporary folder for one test's preference and sidecar files.
custom_style_test_hair
A complete base hair look for packages.
custom_style_test_markings
Two distinct native markings make order, independent field types and duplicate checks observable.
custom_style_test_sidecar
A sidecar store whose last verified contents match the file written for a save test.
custom_style_test_spaces
count spaces, the same text as repeat_string(count, " ") but built by doubling: appending one character at a time makes a 160 KiB file take most of a minute.
custom_style_test_two_color_drawing
Two colors, split evenly, so a recolor can be checked on both the palette and the pixels.
custom_style_transfer_begin
Claims the account's single transfer slot and starts the relevant cooldown.
Failed and cancelled attempts consume the cooldown too, so repeated rejected uploads cannot be used to keep the server parsing files.
Returns:
- null: The caller owns the transfer and must call custom_style_transfer_end().
- text: Why the transfer can't start.
custom_style_transfer_end
Releases the account's transfer slot.
custom_style_unknown_key
Returns the first unsupported key, or null when every key is allowed.
custom_style_validate_body
Strictly validates a whole-body style: one region package per zone it contains.
Returns list("body" = zone -> canonical package) or list("error" = message).
custom_style_validate_drawing
Strictly validates one drawing. Unlike custom_sprite_validate(), nothing is salvaged.
Arguments:
- raw: The decoded drawing object.
- legacy: Accepts old drawing-only files and stored drawings, where tint, emission and empty directions may be absent.
- allow_appendages: Hair styles may carry appendages; any other drawing with them is refused.
Returns:
- list("drawing" = canonical drawing): Valid paint in at least one direction or appendage.
- list("error" = message): Anything malformed, including a drawing with no paint. Empty art must be written as an explicit null drawing, so invalid data can never become Clear.
custom_style_validate_hair
Strictly validates the whitelisted base hair look carried by hair styles.
Registered names and value ranges are checked here. Destination-specific rules, such as a character's species, emissive permission or opacity access, are checked by the destination.
Returns:
- list("hair" = canonical context): A complete, valid base look.
- list("error" = message): Anything missing, unknown, locked or out of range.
custom_style_validate_markings
Strictly validates the ordered native markings for one supported limb. A name a marking merge retired validates as the marking that draws it now (GLOB.body_marking_renames), as a save's migration renames it. Stored data (trusted) leaves out, and logs, a marking its limb no longer offers, where an upload is refused.
custom_style_validate_package
Validates a package's structure: one drawing target, plus its optional native context.
Packages are the server's canonical style shape, used by transfers, runtime restoration and previous saved styles: list("target", "zone", "drawing", "hair", optional "markings"). A null drawing is valid empty art; absent markings preserve the destination's native markings.
Arguments:
- raw: The decoded package.
- trusted: Stored data rather than an upload. Its drawing may predate per-view emission settings, and a marking its limb no longer offers is left out of it rather than refusing it.
Returns:
- list("package" = canonical package)
- list("error" = message)
cut_relative_direction
Takes a screen_loc string and cut out any directions like NORTH or SOUTH
cyborg_accessory_color_channels
Returns the color channels an accessory's art uses at this size and arousal state, by channel number
cyborg_accessory_effective_size
Returns the requested size when the accessory has art for it, or else the first size it has
cyborg_accessory_metadata
Returns what the editor shows for a part's sprite - its color channels and its sizes, with a thumbnail of each unless include_icons is off
cyborg_accessory_render
Returns a part's colored art as an icon and its base64, or null when it has none. Cached, up to 128 images and 2 MiB
cyborg_accessory_size_values
Returns the sizes an accessory has art for, cached by slot and choice. The caller gets its own copy
cyborg_animation_anchor
Returns the still frame a chassis's parts are placed against in this direction and pose, or null when it has no authored animation
cyborg_animation_frames
Authored anchor data is generated offline; runtime never scans marker pixels.
cyborg_animation_map
One pixel per native frame, encoding a literal anchor translation after part transforms. Only catalog descriptors reach this cache; player colors and placement are not cache keys.
cyborg_appearance_model_id
Display names and mutable icon states are deliberately not identities.
cyborg_appearance_models
Appearance previews/defaults also support bodies obtained through antagonist roles.
cyborg_body_visuals_visible
Rendering and examine share this - death, a disguise or being tipped over hide the parts, lockdown and stuns do not. A redraw passes the chassis's catalog entry it already has
cyborg_build_appearance
Generates only the changed appearance, never creates organs or reads preferences. Returns null when no part shows
cyborg_canonical_model_id
Canonicalize stored IDs too, so old variant defaults remain usable.
cyborg_customization_after_import
Imports replace every character, so the old layouts go and the uploaded ones take their place.
cyborg_direct_accessories
The silicon-only accessories of a slot by name, null for a slot without any - these donor sheets never enter human accessory selection
cyborg_direct_accessory_render
Returns a silicon-only accessory's colored art as an icon and its base64, or null when it has none. Keeps the last 32
cyborg_dynamic_accessory_has_size
Whether a genital accessory has art at this size, in any layer or color channel
cyborg_dynamic_accessory_suffix
Native icon operations and bounded immutable outputs replace donor per-pixel loops. Reuses Meridian accessories: no physical organ or bodypart overlay is constructed.
cyborg_effective_base_size
Returns the body size a chassis can show for the requested one, 1 when it isn't eligible. Small chassis never shrink and wide or tall ones stop at 1.6
cyborg_identity_import_sanitize_slot
Import-only migration of donor identity keys. Layouts are read separately into the sidecar.
cyborg_identity_lore
Returns the character's silicon model lore, or the fallback when it has none
cyborg_identity_model
Only cyborgs use the new fields; AI and other silicon preferences retain their behavior.
cyborg_identity_text
Reads the silicon-specific text first without copying a human field into it.
cyborg_interaction_participant
Deliberately small interaction capability surface for cyborgs. Visual anatomy does not grant organs, hands, toy handling, vore, or any lewd interaction. Whether a mob can take part in the interaction menu - humans and cyborgs
cyborg_layout_account_full_message
What the editor says while saving a character would take the account past CYBORG_LAYOUT_MAX_SIDECAR_BYTES.
cyborg_layout_action
- Creator action protocol; the middleware owns slot and actor checks.
- The result takes over draft ownership. Unchanged branches may be shared with
- the old draft; mutation copies its branch, and saved/body snapshots stay deep copies.
- With
encoded_parts(see cyborg_layout_encode()), layouts it copies keep their parts' save text.
cyborg_layout_apply_placement
- Applies a bounded edit to owned canonical data only after validating every field.
- First pose edits materialize the old frontend's effective direction entry. A pose
- entry replaces its direction fallback as a whole; arousal values remain sparse.
cyborg_layout_choices
Old presets inherit character choices; newer presets carry their selected parts.
cyborg_layout_codec_element
Element index of a decoded list, or null past its end.
cyborg_layout_codec_parse
A save text's JSON, or null when the text is not a save of this format.
cyborg_layout_codec_trim
Drops unset trailing elements, which decoding reads as unset.
cyborg_layout_codec_trim_text
Drops unset trailing elements from a list of element texts, as cyborg_layout_codec_trim() does before encoding.
cyborg_layout_copy_encoded
A deep copy of a layout whose parts keep the save text of the parts they copy. A part without text in encoded_parts
is encoded here, once for it and its copy.
cyborg_layout_decode
The normalized tree for a save text, or null when the text is not a save of this format.
cyborg_layout_decode_advanced
Returns a part's overrides by key from their flat pairs, skipping key indices we don't know
cyborg_layout_decode_for_body
What a body takes from a save text: its active layout and one model default, as cyborg_layout_decode() gives them, without decoding the rest. Null when the text is not a save of this format.
Arguments:
- text - the slot's save text
- model_id - optional, the chassis whose default to decode
- with_active - whether to decode the active layout too
cyborg_layout_decode_override
Returns an override from its header and values, with its arousal states unless it is one
cyborg_layout_decode_part
Returns a part's fields from its mask and values, or null for an untouched part
cyborg_layout_decode_slots
Returns an encoded layout's parts by slot. Untouched parts are left out, for normalizing to fill in
cyborg_layout_default
Returns a new layout tree with default parts and no presets or model defaults
cyborg_layout_default_entry
Returns a new part entry with every field at its default
cyborg_layout_default_slots
Returns a new layout with every part slot at its defaults
cyborg_layout_default_sprite_size
Returns the sprite size a slot's parts start at
cyborg_layout_edit_position
Materialize just the edited view group, preserving legacy fallback elsewhere.
cyborg_layout_encode
The save text for a character slot, built from the save text of each part.
Arguments:
- layout - the slot's layout tree
- cached_parts - optional, the kept_parts of an earlier encode: a part or a preset's or model default's layout found there with its text is not encoded again. Only pass it when every list it holds is unchanged since, as copy-on-write edits leave them.
- kept_parts - optional, an empty list that is filled with the active layout's parts and every other layout, with their text, for the next encode
cyborg_layout_encode_advanced
Returns a part's overrides as flat key index and override pairs, or null when it has none
cyborg_layout_encode_entry
A preset or model default as save text: its name or chassis, its layout, and its chassis or linked preset.
A layout found in cached_parts keeps its text, and its parts' texts for copies of it; see cyborg_layout_encode().
Presets and defaults are only ever replaced whole, so most saves find all but one of them there.
cyborg_layout_encode_override
An arousal state writes every field it has: there each one overrides its pose, whatever the value.
cyborg_layout_encode_part
Fields are read the way cyborg_layout_normalize_entry() reads them, so leaving one out decodes to the same value.
cyborg_layout_encode_slots
A layout's parts as save text, in cyborg_layout_supported_slots() order. See cyborg_layout_encode() for the caches.
cyborg_layout_from_stored
The editable tree for whatever a slot holds: save text, an older nested tree, or nothing.
cyborg_layout_import_is_future
Whether a stored or uploaded slot comes from a newer build. It is kept as it is and never rewritten.
cyborg_layout_normalize
A layout tree in its canonical form, or the default tree when raw is not one.
Arguments:
- raw - the tree to normalize
- normalize_model_defaults - whether to keep model defaults at all
- allow_legacy_aliases - whether model ids from older builds are mapped to today's
- only_model_default - optional, a model id: only that default is normalized, the others kept are left as TRUE, for callers that read just that one
cyborg_layout_normalize_advanced
Returns a part's overrides in canonical form. An import also expands donor pose-wide entries to each direction
cyborg_layout_normalize_advanced_entry
Returns one override with only the fields it sets, bounded, or null when it sets none. Arousal states can't nest, so they pass allow_arousal FALSE
cyborg_layout_normalize_entry
Returns a part entry in canonical form, every field bounded and filled in, or the slot's defaults when raw isn't a list
cyborg_layout_normalize_slots
Returns a layout with every part slot normalized, defaults filling the missing ones
cyborg_layout_number
Returns a number clamped to its range and rounded to its step, or the default when it isn't one. Text numbers are read too
cyborg_layout_override_fields
Override fields in header bit order, with what the editor fills a new override with.
cyborg_layout_sidecar_path
The cyborg layout sidecar beside a preferences.json path, or null when the path has no directory.
cyborg_layout_slot_full_message
What the editor says while a character's setups are past CYBORG_LAYOUT_MAX_SLOT_BYTES.
cyborg_layout_sprite_size
Returns a sprite size clamped to the allowed range, or the slot's default when it isn't a number
cyborg_layout_supported_advanced_keys
Save texts store overrides by their place here, so only append.
cyborg_layout_supported_slots
Save texts store parts by their place here, so only append. Every caller shares the list, so none may change it
cyborg_layout_text_is_future
Whether a save text comes from a newer format. Every format starts with its version, so this needs no decode.
cyborg_layouts_from_import
Layouts carried by an uploaded preferences file, keyed by character slot. Read before pass one sanitation.
cyborg_message_interaction_act
Uses only authored non-lewd messages. It never invokes the human effects path.
cyborg_message_interaction_allowed
Whether actor may use an interaction on target when a cyborg is one of them - a cyborg only cheers, a human may also beckon and pat
cyborg_message_interaction_contract_is_safe
Whether an interaction is a plain non-lewd message with no parts, effects, sounds or requirements beyond a free hand
cyborg_mirror_placement
Whether a part's placement is mirrored - a wide chassis facing west, unless the part opts out
cyborg_model_catalog
Cached descriptors contain resources and copied lists only; temporary models have no host.
cyborg_model_legacy_id
Donor keys are accepted only when exactly one current descriptor matches.
cyborg_occlusion_mask
Returns a chassis's occlusion mask - its family's mask icon and the state its poses add their suffix to - or null when it has none
cyborg_part_capability
Returns whether a part slot is configured, turned on and showing on the borg right now
cyborg_part_sprite_direction
Returns the direction of a part's art - a wide chassis facing north may reuse its south art
cyborg_preferences_for
GET_CLIENT can resolve to a real /client or the unit-test client interface.
cyborg_preview_animation
A bounded frame sequence for the visible model only. No periodic server UI updates.
cyborg_preview_body
Body previews use immutable resources, never world mobs. A bounded FIFO caches PNGs.
cyborg_preview_layers
Returns the editor preview's part layers without their art, placed as the live renderer places them.
Every part shows, all in one arousal state. The window has the art in its resources already.
Arguments:
- preferences - the character's preferences, for its part sprites
- descriptor - the chassis's catalog entry
- layout - the layout to show
- direction - the direction the preview faces
- pose - the pose the preview shows
- arousal_state - the arousal state every part shows in
- use_saved_choices - whether a part's own saved sprite wins over the preference, as in a model default
- cached_icons - optional, the editor's images of each part by slot, used instead of rendering them
cyborg_preview_reference
Existing one-tile mannequin artwork, fixed at normal body scale in the frontend.
cyborg_resolve_placement
Pure geometry shared by creator/live rendering. Input has already been normalized.
cyborg_runtime_actor_is_owner
The runtime backend shares this actor/slot gate with its self-management UI.
cyborg_selectable_models
Normal in-round selection stays restricted to its existing departments.
cyborg_sprite_preferences
Part slot -> the preference that holds its sprite. Every caller shares the list, so none may change it
cyborg_test_run_queued_save
Runs the save SScyborg_layout_saves would run for store on its next fire. Returns FALSE while none is due.
cyborg_visual_anatomy_examine_lines
These descriptions mirror already-rendered visual layers. They do not imply an organ or interaction capability.
cyborg_visuals_allowed
Whether or not these preferences allow cyborg parts at all - the server config, the ERP master toggle and the genitals toggle
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
deep_copy_list_alt
A version of deep_copy_list that actually supports associative list nesting: list(list(list("a" = "b"))) will actually copy correctly.
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
deliver_meridian_theme_art
Hands a client its MeridianOS theme's art: the files first, waiting for them to arrive, then their stylesheet to its open windows and its lobby, which load it as they hear of it. For the lobby as it starts and for a theme picked while windows are open; a window that opens later gets the art with its other assets (/datum/tgui/send_assets()).
Arguments:
- client: The client to send to.
- theme: Its MeridianOS theme ID.
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.
derive_body_marking_species
Gives every marking in a marking set the species of its sets: the union of their recommended_species, or any species when one of them names none. A marking in no set keeps the species it declares. Runs once both lists are built, so a set and its markings never disagree about who may wear them. Only choices and validation read the result, never loading or drawing.
determine_drafted_knowledge
Each heretic has a few drafted knowledges within their heretic knowledge tree. This is not during the knowledge tree creation because we want to know what path our heretic picks so we filter out dupe knowledges. Also generates shop knowledges as their validation is shared. Modifies shop_list and final_draft that are provided in the arguments.
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
dirt_add_run
Adds one run to a role's in one direction.
Arguments:
- runs: alist(DIRT_ROLE_* define = alist(direction = runs)).
- role: The role.
- direction: The direction.
- run: list(icon y, first icon x, last icon x, level).
dirt_aim_bounds
Returns how far past its zone's heights a streak may end, for the zones whose streaks stay in them: list(zone = h). Off target they read as a U, bars or socks. You should NEVER modify it.
dirt_aim_inset
Returns how many pixels a clamped streak end's or a capped drip's bound moves in: odd on one side of a pair, 0 or 2 on the other, so the sides keep to different rows. It stays under the room the streak or drip starts with inside its bound, so a streak never shrinks to nothing and a drip never runs up. Without the room an odd one moves 1 px out where that's allowed (the knee); elsewhere it stays on the bound.
Arguments:
- seed: The streak's seed, which picks 0 or 2 on the even side.
- odd: Whether it's on the odd side.
- room: How far inside its bound the streak or drip starts, in pixels.
- below: Whether the bound may move out instead.
dirt_aim_inside
Returns a streak's end pulled back along the streak until its height lies between two bounds: list(theta, h). The streak keeps its own taper.
A pulled-back end sits on its bound exactly. Summed back from the scale, it would miss the bound by a rounding now and then, and the glint 0.3 px over a bound such as 0.02 falls midway between two rows, where a rounding picks one.
Arguments:
- start_theta, start_along: Where the streak starts.
- end_theta, end_along: Where it would end.
- low, high: The bounds its end's height must keep inside.
dirt_aim_zones
Returns each aim zone's areas, where its shots land: list(zone = list(list(limb, lowest theta, highest theta, lowest h, highest h), ...)). You should NEVER modify it.
dirt_baked_icon
Returns runs baked into one four-direction RGBA icon on a blank state, registered in the resource cache as bulge_register_icon() registers an icon built at run time, or null when they draw nothing. Each run is one DrawBox() in its role's tint colour, at the tint's alpha times the run's level, rounded to 8 bits.
Arguments:
- runs: From dirt_shown_runs().
- blank: A blank of the icon's size, or null for 32x32.
- tints: Each role's list(colour, alpha from 0 to 1), indexed by DIRT_ROLE_* define (dirt_mess_role_tints()).
dirt_body_parts
Returns the parts a body draws that take mess, lowest drawn first: the pecs guide if its chest takes one, then each genital drawn (dirt_part_drawn()).
Arguments:
- body: The body.
dirt_body_parts_key
Returns a body's parts as one line of text, with what they're drawn for and at what layers, to tell when a change to them may shape its mess otherwise.
Arguments:
- parts: The body's parts, from dirt_body_parts().
dirt_build_template_now
Builds a dirt template at once, for tests and for anything that can't wait for a subsystem.
Arguments:
- zone_sources: The sprites to build it from, as dirt_zone_sources() returns them.
- directions: The directions to build, or null for every one.
Returns:
- /datum/dirt_template: The template.
- null: A limb names a state its sheet lacks.
dirt_cleanup
Returns a mask cleaned up: a lone film pixel goes, a lone core softens to body, and a pixel whose role none of its neighbours share takes the role three of them share. Flecks stay.
Arguments:
- drawn: The mask.
dirt_container_over
Returns a container of a baked mess image just over a genital's or a taur body's images: at the layer and offsets of the last sprite among them, the one drawn over the others, kept together. It isn't nested in that sprite: the sprite is coloured, which its overlays would take, and a filter on it doesn't reach them.
Arguments:
- images: The images, as get_overlay() returns them.
- baked: The baked icon, as /datum/dirt_masks holds it.
Returns null when none of the images is a sprite.
dirt_cover_fades
Returns how near a mask's pixels lie to what's worn over them, where they fade out: alist(index = 1 beside it, or 2 one pixel further), for the pixels drawn that it leaves bare. Steps are up, down and across.
Arguments:
- pixel_map: The mask.
- covered: Which pixels are worn over, a list of TRUE or null per pixel.
dirt_cover_layers
Returns the overlays_standing slots whose sprites cover skin mess, so it fades out beside them: the underclothes and the garments. You should NEVER modify it.
dirt_cover_sprites
Returns the sprites a body draws over its skin, from what it wears: list(list(icon, icon state), ...), in dirt_cover_layers() order.
Arguments:
- body: The body.
dirt_covering_thickness
Returns how thick a covering feature lies on a pixel: film at most on the outline, and in profile broken by noise on the outline and beside it, to nothing, haze or film. Highlights aren't broken.
Arguments:
- feature: The covering feature.
- thickness: How thick it lies there.
- index: The pixel.
- flags: The pixel's flags, its outline marked (/datum/dirt_surface/proc/outline()), and in profile its band too (/datum/dirt_surface/proc/outline_band()).
- in_profile: Whether the view faces east or west, the only views the band breaks.
- width: The canvas's width.
dirt_despeckle
Returns a mask without lone pixels, which read harshly: a lone film or haze pixel goes, and a lone body or core pixel becomes film with a haze ring where the surface reaches. A film or haze hole with three dark neighbours fills with body: it read as a chip or a scar. Glints and flecks are highlights and stay.
Arguments:
- drawn: The mask.
- surface: The surface it's drawn on.
dirt_drawn_indexes
Returns the indexes of a mask's drawn pixels, in row-major order.
Arguments:
- drawn: From /datum/dirt_pixels/proc/drawn().
dirt_drawn_roles
Returns the roles runs are drawn in, one to a pixel, in the order they're baked: haze is film at half (dirt_role_runs()). You should NEVER modify it.
dirt_eye_reads
Returns what a body's eyes and its human head are drawn from as dirt_zone_sources_match() reads them against zone sources: list(the head, its limb_id, whether it draws eyes, the eyes, their sheet, their state).
Arguments:
- body: The person.
- zone_sources: The sprites, as dirt_zone_sources() returns them.
dirt_eyes_unchanged
Returns whether a body's eyes and its human head are drawn from what they were when dirt_eye_reads() read them, read as it reads them without making a list.
Arguments:
- body: The person.
- zone_sources: The sprites, as dirt_zone_sources() returns them.
- reads: What dirt_eye_reads() returned.
dirt_footprint
Returns the pixels features draw on in one view before the raster's cleanups, as alist(index = TRUE): where any of them lies thick enough for film. A feature hidden in profile is left out there.
Arguments:
- features: The features, bound to the view.
- surface: The view's surface.
- surface_rows: Its pixels by limb and row, from dirt_surface_rows().
dirt_footprint_touches
Returns whether any of a footprint's pixels lies within DIRT_RUN_GAP px of another's, in both axes: no skin between.
Arguments:
- pixels: The footprint, alist(index = TRUE).
- taken: The other, alist(index = TRUE).
- width, height: The canvas's size.
- excluded: Footprints whose pixels count as not taken, or null.
dirt_fresh_variant
Returns a variant of a zone's mess none of some splats on that zone has, at random, or any once they have them all.
Arguments:
- splats: The splats, or null.
- zone: A DIRT_ZONE_* define.
dirt_human_zone_pixels
Returns a zone's pixels on the plain human template, facing the way that shows it (dirt_zone_facing()): the body pixels whose limb, angle and height lie in one of the zone's aim areas (dirt_aim_zones()). Null until SSdirt has built that direction of the template in the background (/datum/controller/subsystem/dirt/proc/human_surface()). Each zone is read once a round. You should NEVER modify the list it returns.
Arguments:
- zone: A DIRT_ZONE_* define.
dirt_index_range
Returns list(1, 2, ... count), made once for each count. You should NEVER modify it.
Arguments:
- count: How many.
dirt_level_shows
Returns whether a level shows anything new on the body over level 1's shot: a pixel the kept runs and drops draw that level 1's doesn't, beside either. A lone one would go.
Arguments:
- always: Level 1's shot, and whatever else is always drawn but the covering, from dirt_runs_apart().
- features: The level's features but its plan.
- kept: The runs and drops kept.
- surface: The view's surface.
- surface_rows: Its pixels by limb and row, from dirt_surface_rows().
dirt_lobe_rasterise
Returns mess following a rounded part's form (breasts, pecs, the butt, testicles, the vulva), from the
"lobe:aimed_
Arguments:
- own: The part's pixels, as indexes in row-major order.
- zone: The splat's DIRT_ZONE_* define.
- kind: A DIRT_PART_* define.
- level: 1 to DIRT_PART_MAX_LEVEL.
- variant: 0 to DIRT_MESS_VARIANTS - 1.
- direction: The direction.
dirt_lobe_row_at
Returns the row a fraction of the way down a lobe, 0 its top and 1 its bottom, not rounded.
Arguments:
- shape: The lobe's shape, from dirt_lobe_shape().
- fraction: How far down.
dirt_lobe_shape
Returns a lobe's shape: list(its indexes, TRUE on each of its pixels, alist(row = list(leftmost column, rightmost column)), its rows from the top).
Arguments:
- indexes: The lobe's pixels, in row-major order.
dirt_lobes
Returns a rounded part's lobes, each a list of indexes in row-major order: each side of DIRT_PART_MIDLINE where the view shows both (front or back, the vulva excepted), else the whole part. A lobe under 4 px holds none.
Arguments:
- own: The part's pixels.
- direction: The direction.
- kind: A DIRT_PART_* define.
dirt_lower_zones
Returns the zones below the waist: the groin, the thighs and the butt. You should NEVER modify it.
dirt_mask_directions
Returns the directions a mask is made in, in the order its pieces go. You should NEVER modify it.
dirt_measure_metrics
Returns alist(limb = list(degrees per pixel, h per pixel)), measured from the plain human template facing south, then facing east for a limb the south view lacks. A limb's diameter is its median row width; its length, its rows.
Arguments:
- human: The template built from dirt_metric_sources(), facing at least dirt_metric_directions().
dirt_merge
Returns masks merged into one: on each pixel the thickest wins, by role rank and then thickness, and the first mask keeps a full tie. All the splats on one surface make one mask this way, oldest first. A splat below the top level leaves out each of its pieces that comes within DIRT_RUN_GAP px of an earlier splat's: piled on, splats filled into one sheet. A top-level splat keeps everything: it covers.
Arguments:
- pixel_maps: The masks, all one size, at least one.
dirt_merge_with_parts
Returns a surface's splats in one direction merged with the parts drawn under and over it. Each splat leaves out the pixels of the rounded parts on its zone (dirt_part_rounded()): straight streaks carried onto a breast read as blocks. Then each part drawn under the surface takes each splat on its zone in its own pixels (dirt_part_field()), merged in after the splats and keeping every piece, as a top-level splat does. A part drawn over the surface takes its share on itself, so its field isn't drawn here.
Arguments:
- pixel_maps: Each splat's raster in this direction, at its level here (dirt_part_body_level()), each its own copy: the rounded parts' pixels are taken out of it.
- splats: The splats, in the same order.
- under_parts: The parts drawn under the surface in this direction, each a /datum/dirt_part_source, lowest first.
- over_parts: The parts drawn over it in this direction (dirt_split_parts()).
- owns: alist(source = its pixels in this direction, from dirt_part_own()).
- direction: The direction.
dirt_mess_amount_levels
Returns how many levels a shot's amount adds where it lands: 1 for a normal shot, 2 for a heavy one, and straight to DIRT_MESS_MAX_LEVEL for a huge one.
Arguments:
- amount: The fluid the shot spends, in units.
dirt_mess_baked_image
Returns an image of a surface's baked mess, drawn as it is: its colours and alpha are in its pixels (dirt_baked_icon()).
Arguments:
- baked: The baked icon, as /datum/dirt_masks holds it.
dirt_mess_carriers
Returns the carriers of a person's mess: their own, then each worn item's.
Arguments:
- target: The person.
dirt_mess_entry
Returns a zone's entry in a shot's list of where to aim: "On their chest".
Arguments:
- zone: A DIRT_ZONE_* define.
- their: The person's possessive pronoun, as the shooter knows them.
dirt_mess_evict
Takes a person's oldest splats off until they carry DIRT_MESS_MAX_SPLATS at most, counting their skin, their parts and their worn items. It draws nothing: the caller draws each carrier it returns, and each part.
Arguments:
- target: The person.
Returns what it took splats off: list(carrier = list of what of it changed, ORGAN_SLOT_* defines or null for its own surface).
dirt_mess_garment
Returns the worn item a shot at a zone lands on, or null for the skin: the outermost of the head, mask, suit and uniform slots whose body_parts_covered includes the zone's part (the chest for the chest, stomach and back; the groin for the groin and butt; the legs for the thighs). The face is covered when the mouth is, by the item covering it. Underclothes never count: they aren't items. Through a wall portal only the uniform counts, while it's drawn: the relay copies it and no suit (lower_body_only()), so a coat over the lower body leaves the shot to what the relay shows under it. A skirt the relay leaves out (wall_relay_skips_uniform()) leaves it to the underclothes or the skin.
Arguments:
- target: The person.
- zone: A DIRT_ZONE_* define.
- portal_view: A DIRT_PORTAL_* define, what a portal shows of the target.
dirt_mess_inset_image
Returns an image drawing cloth's baked mess over a garment, kept to the garment's own pixels by BLEND_INSET_OVERLAY inside the worn KEEP_TOGETHER wrapper build_worn_icon() makes. It floats, and on a garment drawn on the body's own tile it isn't offset, so the bulge redraws it over its cloth too (bulge_over_cloth()).
Arguments:
- baked: The baked icon, as /datum/dirt_masks holds a cloth's.
- shift_x, shift_y: Pixels right and up in the wrapper: dirt_worn_shift() for the body's 32x32 masks, DIRT_TAUR_INSET less to the right for pools on the 64x32 taur canvas round it.
dirt_mess_land
Puts a mess on a person where a shot was aimed (dirt_mess_place()), when the portal shows a zone that lands.
Arguments:
- target: The person.
- zone: A DIRT_ZONE_* define, from dirt_mess_zones() or DIRT_ZONE_COCK.
- portal_view: A DIRT_PORTAL_* define, what a portal shows of the target: a zone it doesn't show takes nothing, and through a wall only what the relay draws takes the shot.
- levels: How many levels it adds, from dirt_mess_amount_levels().
Returns whether anything was deposited.
dirt_mess_landable
Returns whether dirt_mess_land() lands a shot at a zone: the zones dirt_mess_zones() lists, and DIRT_ZONE_COCK, which dirt_mess_regions() offers through a one-part portal and which lands on the penis alone.
Arguments:
- zone: A DIRT_ZONE_* define.
dirt_mess_place
Puts a mess where a shot at a zone lands on a person (dirt_mess_surface()) as /datum/component/dirtiness/proc/add_mess() does, and on each part drawn over that surface which the zone reaches (dirt_body_parts()), a splat of the same variant in its own slot. A back shot on a taur also puts one in its taur body's slot (dirt_taur_takes_pools()), unless a taur suit takes it, whose own splat draws the pools. DIRT_ZONE_COCK lands on the penis alone, while it draws its front image. Then it takes the oldest splats off past DIRT_MESS_MAX_SPLATS, and only then draws each garment that changed and the person, once, so the masks asked for are the ones kept.
Arguments:
- target: The person.
- zone: A DIRT_ZONE_* define.
- levels: How many levels it adds, or the level of a new splat when a variant is given.
- variant: 0 to DIRT_MESS_VARIANTS - 1 for a new splat with that variant, or null to land as a shot does.
- portal_view: A DIRT_PORTAL_* define, what a portal shows of the target: through a wall only what its relay draws takes the shot (dirt_mess_garment()).
Returns the splat it started, or the one it raised when it started none, or null when it landed nowhere.
dirt_mess_regions
Returns the zones a shot on a person can aim at, in dirt_mess_zones() order.
- A zone is offered when a limb its shots land on (dirt_aim_zones()) is drawn. A monkey gets none: the zones are laid out on a human's. Kobolds, a monkey's kin in shape, get theirs: mess draws on them.
- A taur gets none below the waist: its legs are hidden, and its groin is the join with the taur body.
- Through a portal, only what it shows (dirt_portal_shows()): the groin and the butt, or DIRT_ZONE_COCK alone while the person's penis draws its front image (dirt_part_drawn()).
Arguments:
- target: The person.
- portal_view: A DIRT_PORTAL_* define, what a portal shows of the target.
dirt_mess_role_tints
Returns the mess's tints, indexed by DIRT_ROLE_* define, each list(colour, alpha from 0 to 1), as dirt_baked_icon() takes them. Pearl white, translucent where thin and near opaque where thick, a light grey underside that sets drops apart on pale skin, and a white highlight. Haze is the film's colour at half its alpha, drawn as film at half coverage. You should NEVER modify it.
dirt_mess_splat_rasterise
Returns mess aimed at a taur body's back in one direction, from the "splat:aimed_back:taur:
Arguments:
- mask_pixels: The taur body's pixels, as indexes in row-major order on the taur canvas.
- level: The splat's level: past DIRT_TAUR_MAX_LEVEL it draws at that one.
- variant: The splat's variant.
- direction: The direction.
- avoid: The rider's mess pixels on the taur canvas, as indexes.
dirt_mess_surface
Returns the carrier a shot at a zone lands on, and the underclothes it lands on: list(/datum/component/dirtiness, a DIRT_UNDERCLOTHES_* define or null). The outermost garment over the zone takes it (dirt_mess_garment()), else the underclothes that cover it, held by the person, else the skin.
Arguments:
- target: The person.
- zone: A DIRT_ZONE_* define.
- portal_view: A DIRT_PORTAL_* define, what a portal shows of the target.
dirt_mess_zones
Returns the zones a shot can be aimed at on a person, in the order they're offered: face, chest, stomach, back, groin, thighs, butt. You should NEVER modify it.
dirt_metric
Returns how far one pixel reaches on a limb: list(degrees round it, h along it). It's measured once, as the reference generator measures it, and serves every body, so marks keep one size whatever the body and the direction.
SSdirt measures it before any mask job it queues reads it (/datum/dirt_template_job/metric). Anything else that draws mess, such as the parity manifest, has it measured on the spot.
Arguments:
- limb: A DIRT_LIMB_* define.
dirt_metric_directions
Returns the directions dirt_measure_metrics() reads, the only ones its template needs. You should NEVER modify it.
dirt_metric_sources
Returns the plain human template's sprites, which dirt_metric() is measured from: no eyes, no mouth guard. You should NEVER modify it.
dirt_neighbour_table
Returns each pixel's neighbours on a canvas, in the order the reference generator visits them: right, left, below, above, those off the canvas left out. Built once per canvas size. You should NEVER modify it.
Arguments:
- width: Pixels across.
- height: Pixels down.
dirt_noise_hash
Returns a lattice point's noise value, from 0 to 1 in steps of 1/255.
The seed's low byte, its next byte and then the point's coordinates are chained through the permutation table. DIRT_MODULO keeps every index in range when a coordinate is negative.
Arguments:
- cell_x, cell_y: The lattice point, whole numbers of either sign.
- seed: The noise field's seed, a whole number.
dirt_packed_thicknesses
Returns the thicknesses packed so far, indexed by their code + 1 (dirt_thickness_code()). You should NEVER modify it.
dirt_parity_case_block
Returns a corpus case as the text the reference generator writes for it: "case
- random: one /datum/dirt_random stream per case, and one line per integer call. shuffle and sample write the list joined by single spaces; random, uniform and gauss spend their draws and write nothing.
- noise: round(hash * 255) per lattice point, list(x, y, seed).
- surface: the case's template built as the game builds a body's, and for each of S, N, E and W, "dir
" and its three grids (dirt_parity_surface_lines()). - body: mess on the case's template: for each direction, "dir
" and one grid of roles, the case's splats each drawn by dirt_rasterise_aimed() on its "surface" (skin or cloth), packed and unpacked as a cached raster is (/datum/dirt_pixels/proc/drawn(), dirt_pixels_from_drawn()), then merged by dirt_merge(). Its "under_parts" and "over_parts", parts by name in the corpus's "parts", lowest drawn first, "name@N" only in the facings it names (dirt_parity_facing_parts()), shape it as they shape a surface's masks: each splat drawn at its level there (dirt_part_body_level()), then merged with them by dirt_merge_with_parts(). - part: one splat's mess on the case's part (dirt_part_field()), on its pixels as its "surface" takes it
(dirt_part_own()), on the case's template: for each direction, "dir
" and one grid of roles. - taur_surface: a taur kind in the corpus's "taurs" under its rider, the case's template: for each direction,
"dir
" and one grid, 64 across, of what each pixel shows (dirt_taur_owners(), dirt_parity_taur_lines()). - taur: a back shot's pools on a taur kind (dirt_taur_pools()), keeping clear of the shot on the rider's cloth and
skin, packed and unpacked as cached pools are: for each direction, "dir
" and one grid of roles, 64 across.
Arguments:
- case_data: One entry of the corpus's "cases".
- corpus: The whole corpus, for the templates, parts and taurs a case names.
- templates: The templates built so far, by name, shared across cases.
Returns:
- text: The case's text.
- null: The case's kind isn't one built here.
dirt_parity_facing_parts
Returns the parts a body case places under or over its surface in one facing: each entry of its "under_parts" or "over_parts" is a part's name, placed so in every facing, or "name@NE", placed so in the facings it names.
Arguments:
- entries: The case's "under_parts" or "over_parts", or null.
- letter: The facing: S, N, E or W.
- by_name: alist(name = /datum/dirt_part_source).
dirt_parity_number_text
Returns a number, or a list of numbers joined by single spaces, as the reference writes them: whole numbers in full, never in scientific notation.
Arguments:
- value: A number, or a list of numbers.
dirt_parity_parts
Returns corpus parts as the game reads a genital: each a /datum/dirt_part_source of its states, every layer's together, its sheet loaded from its path.
Arguments:
- names: Names in the corpus's "parts", or null.
- corpus: The whole corpus.
dirt_parity_random_lines
Returns a random case's lines: one per integer call, in order, all from one stream.
Arguments:
- case_data: One random entry of the corpus's "cases": its "seed", and its "calls", each a list of the call's name and its arguments.
Crashes:
- On a call this proc doesn't know.
dirt_parity_surface_lines
Returns one direction of a surface as three grids, one line per row, one after the other:
- limbs: the limb each pixel maps to, by DIRT_LIMB_* code: H head, T torso, A right arm, a left arm, L right leg, l left leg, or "." for none.
- rim: "#" the rim, "o" the interior (the body's pixels off the rim), "." neither.
- guards: "E" an eye or its sides, "m" the mouth, "e" an eye's diagonal, "." none.
Arguments:
- surface: The surface.
dirt_parity_taur
Returns a corpus taur kind as the game reads a taur body (/datum/dirt_taur_source): each layer's states, its sheet loaded from its path.
Arguments:
- taur: One entry of the corpus's "taurs".
dirt_parity_taur_lines
Returns what each pixel of a taur canvas shows as one grid, one line per row, one glyph per pixel: "B" the taur body's behind layer, "A" its adjacent layer, "r" the rider, "U" its front under clothes layer, "F" its front layer, "O" its front over layer, "." none.
Arguments:
- owners: What each pixel shows, from dirt_taur_owners().
dirt_parity_template
Returns a corpus template, built as the game builds a body's the first time it's asked for and shared after that.
Arguments:
- name: The template's name in the corpus's "templates".
- corpus: The whole corpus.
- templates: The templates built so far, by name. A new one is added to it.
dirt_parity_zone_sources
Returns a corpus template as the zone sources dirt_zone_sources() gives a body: each zone's sheet, loaded from its path, and state, the eyes' sheet and states, and whether the head is a human's.
Arguments:
- template: One entry of the corpus's "templates".
dirt_part_body_level
Returns the level of a splat's mess on the body where parts take a share of it: down by 2 where a penis, testicles or vulva does, else by 1 where any part does, never under 1. A part takes a share in a direction where it has pixels. The top level stays: the body keeps its glaze, still off the rounded parts' pixels, and the parts draw theirs at DIRT_PART_MAX_LEVEL.
Arguments:
- splat: The splat.
- sources: The parts, each a /datum/dirt_part_source.
- owns: alist(source = its pixels in this direction, from dirt_part_own()).
dirt_part_drawn
Returns the source a genital is drawn as now, its organ slot filled in and each state's layer read from its image, or null while it draws none: hidden (dirt_shown()), a device drawn in its place, a bulge look drawn for it, no sprite in the layers mess reads it from (a taur's penis draws only behind the body), or a kind that takes no share.
Arguments:
- part: The genital.
- owner: Its owner.
dirt_part_field
Returns one splat's mess on a part's pixels, which keeps every piece where it merges with others: lobes on a rounded part, a bead behind the tip on the penis. Its fields have levels 1 to DIRT_PART_MAX_LEVEL, so a splat past it draws at it. A field rests on its arguments alone, and every mask its splat is on draws it again, so the newest DIRT_PART_FIELDS are kept, packed.
Arguments:
- kind: The part's DIRT_PART_* define.
- own: Its pixels in this direction, from dirt_part_own().
- zone: The splat's DIRT_ZONE_* define.
- level: The splat's level.
- variant: The splat's variant.
- direction: The direction.
dirt_part_fringe
Lays a part's translucent fringe: film on each of the part's pixels beside its solid mess, up, down or across, that holds none yet.
Arguments:
- drawn: The part's mess so far, added to.
- solid: Each pixel's solid role, or null.
- inside: TRUE on each of the part's pixels.
dirt_part_index
Returns a pixel's index on a 32x32 canvas, or null off it.
Arguments:
- column, row: The pixel, from the left and from the top, from 0.
dirt_part_kind
Returns what a genital is drawn as for mess: a DIRT_PART_* define, or null for one that takes no share (the anus, the womb). The breasts organ is pecs when it's built from a pecs accessory.
Arguments:
- part: The genital.
dirt_part_layers
Returns the layers mess reads a kind of genital from, as the reference generator draws it (its own parts take every one): the butt's front and back (ADJ) images, every other kind's front image alone. You should NEVER modify it.
Arguments:
- kind: A DIRT_PART_* define.
dirt_part_own
Returns the pixels a part takes its share on in one direction, as indexes in row-major order: its own. The pecs guide keeps to where the chest shows. The vulva, too small for a lobe of its own, also takes the ring of visible pixels round them (the body's, and the parts') when it lies on skin, but never on cloth.
Arguments:
- source: The part.
- direction: The direction.
- template: The body's template, or null when the part needs none: neither the guide nor the vulva on skin.
- sources: Every part drawn with it, itself included, whose pixels count as visible round the vulva.
- surface_kind: DIRT_SURFACE_SKIN or DIRT_SURFACE_CLOTH, what the part's share lies on.
dirt_part_rasterise
Returns mess on a part too small to round, the penis: a bead just behind its tip (its pixel farthest from where it
joins the body) with a highlight and a grey underside, the tip itself translucent (over the whole end it read as a
white cap); at levels 2 and 3 a run back from the tip and a drop or two along the part; a translucent fringe inside
it. Drawn from the "part:aimed_
Arguments:
- own: The part's pixels, as indexes in row-major order. Fewer than three take nothing: clothing can leave a part all but hidden.
- zone: The splat's DIRT_ZONE_* define.
- level: 1 to DIRT_PART_MAX_LEVEL.
- variant: 0 to DIRT_MESS_VARIANTS - 1.
dirt_part_rounded
Returns whether a kind of part is rounded, so its mess follows its form in lobes (dirt_lobe_rasterise()) and the body's own mess leaves its pixels out: every kind but the penis, which takes a bead behind its tip.
Arguments:
- kind: A DIRT_PART_* define.
dirt_part_source_of
Returns a genital's images as a part source, every layer's colour layers' states together with the layer each draws at, or null when none draws a sprite. Emissives and texture holders are left out.
Arguments:
- kind: The genital's DIRT_PART_* define.
- images: Its images in the layers mess reads it from (dirt_part_images()).
dirt_part_zone
Returns the zone whose shots a kind of part takes a share of: the chest for breasts and pecs, the butt for the butt, the groin for the rest.
Arguments:
- kind: A DIRT_PART_* define.
dirt_parts_key
Returns parts' keys as one line of text, to key masks by: each with where it draws against a surface in each direction, when one is given.
Arguments:
- sources: /datum/dirt_part_source, or null.
- surface_layer: The surface's layer, or null.
dirt_pecs_guide
Returns the source of the plain pecs' shape a human chest without breasts takes mess in, an undrawn guide (Muscular pecs and breasts are the breasts organ, drawn), or null for any other chest. You should NEVER modify it.
Arguments:
- body: The body.
dirt_perm_table
Returns the table the noise hashes lattice points through: 0 to 255, shuffled by the "dirt:perm" stream.
The table is built on the first call and shared after that. You should NEVER modify it.
dirt_pieces_near
Returns TRUE on each pixel of a mask's pieces, 8-connected, that come within DIRT_RUN_GAP px of a taken pixel.
Arguments:
- pixel_map: The mask.
- taken: alist(index = TRUE), the pixels taken.
dirt_pixel_span
Returns how many degrees a pixel of a row spans: the turn to the pixels beside it in the row, or a limb's own at least.
Arguments:
- line: The row's pixel indexes, side by side.
- pixel: The pixel's index.
- theta_of: The surface's thetas.
- least: The limb's degrees per pixel.
dirt_pixel_zones
Returns the zones a template pixel's flags name (DIRT_PIXEL_ZONE()), each keyed to its own place: zones[place] is a zone and zones[zone] its place. They're the zones dirt_zone_owners() gives pixels, those of dirt_zone_draw_order(). A pixel holds its zone in 4 bits, 0 for none, so there are 15 at most. You should NEVER modify it.
dirt_pixels_from_drawn
Returns a mask made again from its drawn pixels.
Arguments:
- drawn: From /datum/dirt_pixels/proc/drawn().
- width: Pixels across.
- height: Pixels down.
dirt_pool_clear
Returns whether a pool's columns keep more than 2 px from every column of the pools kept before it.
Arguments:
- columns: The pool's columns.
- pools: The pools kept, each a list of columns.
dirt_pool_draw
Draws a role on a pool pixel of the taur body, where the role drawn there doesn't outrank it: never off the taur body's pixels.
Arguments:
- drawn: The pools, drawn on.
- inside: TRUE on each of the taur body's pixels.
- ranks: dirt_role_ranks().
- key: The pixel's DIRT_POOL_KEY().
- role: A DIRT_ROLE_* define.
- thickness: How thick it lies.
dirt_pool_put
Lays a solid role on a pool pixel, noting it as the drop or pool's own if nothing was laid there before.
Arguments:
- solid: alist(DIRT_POOL_KEY() = DIRT_ROLE_*), added to.
- part: The keys the drop or pool being laid added, added to.
- key: The pixel's DIRT_POOL_KEY().
- role: A DIRT_ROLE_* define.
dirt_portal_shows
Returns whether a portal shows the part of its occupant a zone lies on: through a one-part portal only DIRT_ZONE_COCK, through a wall the groin and the butt (its relay draws no legs), and anything with no portal.
Arguments:
- zone: A DIRT_ZONE_* define.
- portal_view: A DIRT_PORTAL_* define.
dirt_ragged_edges
Breaks a covering mask's flat edges, and returns it: no top or bottom edge runs flat along one row for more than 2 px. Cut level, a sheet read as clipped at a region, an apron, a back patch, a bib. At irregular spots along a flat stretch, film runs on 1 to 3 px below a bottom edge, or rises 1 px over a top edge. It only adds film, on bare skin or haze of the chest and the legs, so what's under it and the highlights stay. What's solid is read before anything is added, so the mask is changed where it is.
Arguments:
- drawn: The mask, changed.
- surface: The surface it's drawn on.
- seed: The noise's seed, a whole number.
dirt_ragged_free
Returns whether a covering mask's flat edge may run on over a pixel: bare skin or haze on the surface, where the chest or a leg shows.
Arguments:
- surface: The surface.
- roles: The mask's roles so far.
- column, row: The pixel.
dirt_rasterise_aimed
Returns mess aimed at a zone, drawn on one direction of a body: levels 1 to level, each from the deposit's same
draws, merged by role rank with the later level winning a tie, then despeckled. A highlight, once drawn, stays: a
later run beside it folded it in. The top level then breaks its flat edges, and keeps every pixel of level 3 as it
was drawn, at its role or a darker one.
Arguments:
- zone: A DIRT_ZONE_* define, not DIRT_ZONE_COCK.
- level: 1 to DIRT_MESS_MAX_LEVEL.
- variant: 0 to DIRT_MESS_VARIANTS - 1.
- surface_kind: DIRT_SURFACE_SKIN or DIRT_SURFACE_CLOTH.
- surface: The direction's surface.
dirt_rasterise_level
Returns one level of a deposit drawn on one direction of a body. The first feature, in list order, to lie thickest on a pixel picks its role. Nothing goes on an eye, the pixels beside it or a human mouth, and an eye's diagonals take film at most. Cloth draws its rim a role lighter, so a garment keeps its outline, though a contact point keeps its tone. Then bare legs streak, lone pixels go, and on skin nothing smaller than 2 px stays.
A covering feature, the top level's, thins to film on the outline: cut there, a coat read as a garment. In profile it also breaks with noise on the outline and the pixels beside it, where whole it ran the torso's height as one band; highlights stay whole.
Arguments:
- features: The level's features, from a cause, bound to the view.
- surface_kind: DIRT_SURFACE_SKIN or DIRT_SURFACE_CLOTH.
- surface: The direction's surface.
- surface_rows: The surface's pixels by limb and row, from dirt_surface_rows().
dirt_role_ranks
Returns each role's rank, indexed by its DIRT_ROLE_* define: where masks or levels meet, the higher rank keeps the pixel. You should NEVER modify it.
dirt_role_runs
Adds a mask's horizontal runs in one direction to each role's: list(icon y, first icon x, last icon x, level). A run is a role's pixels side by side in one row at one level, how much of each pixel it covers out of 255: DIRT_MASK_SOLID, or DIRT_MASK_HALF for haze, drawn as film. A pixel beside what's worn over it keeps a share of its level: its fade ring over DIRT_FADE_RINGS + 1.
Arguments:
- pixel_map: The mask.
- indexes: The pixels to draw, in row-major order.
- direction: The direction it's seen from.
- runs: alist(DIRT_ROLE_* define = alist(direction = runs)), added to.
- fades: dirt_cover_fades() in this direction, or null.
dirt_runs_apart
Returns a level's features with the runs and drops this view leaves out taken out, and its run plan with them. In the plan's order, each run or drop stays only if it keeps DIRT_RUN_GAP px of skin from level 1's shot and from every one kept before it: side by side they filled into a sheet. The two hung from level 1's shot and drop always stay. Then each kept run's carry-on stays where it keeps as clear, and level 2's carry-on from the first drop where level 2 shows nothing new in the zone's main facing. The plan holds the top run level's set, so every level keeps the same ones.
Arguments:
- features: The level's features, bound to the view.
- surface: The view's surface.
- surface_rows: Its pixels by limb and row, from dirt_surface_rows().
dirt_runs_key
Returns an MD5 of what runs draw, the same for runs that draw the same pixels: each role's runs in each direction, in a fixed order, with their levels.
Arguments:
- runs: From dirt_shown_runs().
dirt_shown_runs
Returns a surface's runs, as dirt_role_runs() lays them: alist(DIRT_ROLE_* define = alist(direction = runs)).
Arguments:
- merged: alist(direction = /datum/dirt_pixels), the surface's mess in each direction.
- shown: alist(direction = indexes): only these pixels are drawn, or null for the whole canvas.
- fades: alist(direction = dirt_cover_fades()): pixels drawn fainter beside what's worn over them, or null.
dirt_skin_besides
Returns the body zones whose sprites a limb skin mess draws on checks besides its own (ready_skin_masks()): for the chest the arms, which bring their hands and which no limb skin mess draws on draws (the chest checks the eyes too); for the rest none. You should NEVER modify it.
Arguments:
- zone: The limb's body zone.
dirt_skin_rules
Makes a mask as skin takes goo, and returns it: no pixel without a neighbour, since a lone body dot reads as a mole and nothing smaller than 2 px stays. Goo keeps its core: flattened, it read as body paint.
The reference drops lone body pixels, then every group of pixels smaller than two. Neither step leaves a new lone pixel, so together they drop exactly the pixels with no neighbour. A pixel dropped had none, so dropping it where it is leaves every other pixel's neighbours as they were.
Arguments:
- drawn: The mask, changed.
dirt_skin_streaks
Streaks bare legs in a mask rather than coating them, and returns it: a solid coat up a bare shin reads as boots. Body pixels more than 2.5 px up a leg mostly thin to film, in clumps about a limb wide. Each pixel is judged on its own, so the mask is changed where it is.
Arguments:
- drawn: The mask, changed.
- surface: The surface it's drawn on.
dirt_skin_zones
Returns the body zones of the limbs skin mess draws on: the head, the chest and the legs, where aimed mess lands. You should NEVER modify it.
dirt_slot_layer
Returns the layer a worn slot's garment draws at, which its mess lies on, against which parts draw over or under it.
Arguments:
- slot: An ITEM_SLOT_* flag.
dirt_slot_redraw
Returns what to draw again on a body for an item in a slot: a DIRT_REDRAW_* flag, or NONE.
Arguments:
- slot: An ITEM_SLOT_* flag.
dirt_split_parts
Returns parts split by where they draw against a surface in one direction: list(those under it, whose share is drawn in its masks, those over it, whose share is drawn on themselves).
Arguments:
- parts: /datum/dirt_part_source, lowest drawn first.
- surface_layer: The surface's layer.
- direction: The direction.
dirt_spread_noise
Returns two octaves of value noise, stretched back out to cover 0 to 1 (summed noise bunches round 0.5).
The second octave is half the scale, on the seed plus 97.
Arguments:
- sample_x, sample_y: Where to sample, in pixels.
- seed: The noise field's seed, a whole number.
- scale: The first octave's lattice spacing, in pixels.
dirt_sprite_facings
Returns the directions a sprite has pixels in, any opacity counting, as SOUTH, NORTH, EAST and WEST flags: none for a sprite that isn't 32x32. A direction dirt_sprite_pixels() holds is taken from it; any other is read only as far as its first pixel. Parts' layers are worked out from these whenever a body with mess is drawn, so they're kept for far more sprites than whole reads are, in SSdirt.sprite_facings.
Arguments:
- sheet: The sprite's icon file, or an icon made at run time.
- state: Its icon state.
dirt_sprite_key
Returns text naming a sprite's icon: a file's path, or the reference of an icon made at run time, whose text is empty or its type.
Arguments:
- sheet: An icon file, or an icon made at run time.
dirt_sprite_pixels
Returns the pixels a sprite covers in one direction, any opacity counting, as indexes in row-major order on a canvas
width across and 32 tall: none for a sprite of another size. Templates and outfits share sprites (every human head,
its eyes, a jumpsuit), so each sprite's direction is read once and kept in SSdirt.sprite_reads, the least lately read
dropped first. You should NEVER modify the list it returns.
Arguments:
- sheet: The sprite's icon file, or an icon made at run time.
- state: Its icon state.
- direction: The direction to read.
- width: The sprite's width: 32, or DIRT_TAUR_WIDTH for a taur body's.
dirt_sprite_read_key
Returns the key dirt_sprite_pixels() keeps a sprite's direction under.
Arguments:
- sheet, state, direction, width: As dirt_sprite_pixels()'s.
dirt_sprite_shows
Returns whether a 32x32 sprite has a pixel in one direction, any opacity counting, reading only as far as its first. Rows go from the middle down, then up from it: parts lie in the canvas's middle and lower rows.
Arguments:
- sprite: The sprite, a whole state.
- direction: The direction.
dirt_sprite_zone_pixels
Returns which of a zone's pixels a sprite covers, read at those pixels only, facing the way that shows the zone. Kept for each sprite and zone, the oldest dropped past DIRT_COVERAGE_READS. A sprite that isn't 32x32 covers none. You should NEVER modify the list it returns.
Arguments:
- sheet: The sprite's icon file, or an icon made at run time.
- state: Its icon state.
- zone: A DIRT_ZONE_* define.
- zone_pixels: The zone's pixels, from dirt_human_zone_pixels().
dirt_sprites_key
Returns sprites as one line of text, to key masks by and to tell outfits apart.
Arguments:
- sprites: list(list(icon, icon state), ...), or null.
dirt_surface_parts
Returns the parts a surface's splats reach, lowest drawn first: those on a zone one of the splats is on. Where each draws against the surface is worked out in each direction (/datum/dirt_part_source/proc/under()).
Arguments:
- parts: The body's parts, from dirt_body_parts().
- splats: The surface's /datum/dirt_splat.
dirt_surface_rows
Returns a surface's pixels grouped by limb and row, so a feature is weighed only on the rows it can reach: alist(limb = list(list(row, lowest h, highest h, indexes), ...)), rows from the top. Built once for each surface. You should NEVER modify it.
Arguments:
- surface: The surface.
dirt_taur_back_region
Returns the pixels of a taur body mess aimed at its back reaches in one direction: a band 3 px deep under the back line the view shows. None facing south (the band there is the rider's waist, which read as underwear); facing north, the columns whose top lies within 2 px below the back's middle height; in profile, the columns whose top lies within 1 px of it, less the 30% at the far end (a white tuft at the tail) and the 2 beside the rider's waist (the groin).
Arguments:
- mask_pixels: The taur body's pixels, as indexes in row-major order on the taur canvas.
- direction: The direction.
dirt_taur_blank
Returns a 64x32 blank, for masks on the taur canvas. You should NEVER modify it.
dirt_taur_fitted
Returns whether a garment is drawn on its wearer's taur body as a taur suit: a sprite spanning the 64x32 taur canvas, the body's own tile in its middle, which takes the taur body's pools.
Arguments:
- garment: The worn item.
- wearer: Who wears it.
dirt_taur_owners
Returns what each pixel of the taur canvas shows in one direction: the EXTERNAL_* layer of the taur body drawn last over it, DIRT_TAUR_RIDER where the rider (the body, 16 px in) is drawn over the taur body, or null, as dirt_taur_stack() stacks them.
Arguments:
- source: The taur body.
- rider: The rider's surface in that direction, the template of the body drawn on the taur.
- direction: The direction.
dirt_taur_pools
Returns a back shot's pools on a taur body in one direction: dirt_mess_splat_rasterise() on the pixels the taur body shows, keeping clear of the rider's mess there.
Arguments:
- owners: What each pixel of the taur canvas shows, from dirt_taur_owners().
- rider_mess: The same shot on the rider's back, on cloth and on skin, each /datum/dirt_pixels/proc/drawn() of it. Either may lie where the rider is, so the pools keep clear of both.
- level: The splat's level.
- variant: The splat's variant.
- direction: The direction.
dirt_taur_source
Returns a person's taur body as mess reads it, drawn or hidden (a taur suit hides it), or null without one.
Arguments:
- body: The person.
dirt_taur_stack
Returns what a taur canvas shows, lowest first, as the reference stacks a taur under its rider: the taur body's behind and adjacent layers, the rider, then its front layers. You should NEVER modify it.
dirt_taur_takes_pools
Returns whether a back shot on a person also lands along their taur body's back: they have a taur body of a kind with a back (dirt_read_source(): not Big Legs), it draws now, and the surface the shot lands on isn't a garment drawn over the whole taur canvas (a taur suit), which takes the pools itself (/datum/component/dirtiness/proc/ready_taur_cloth_masks()).
Arguments:
- target: The person.
- carrier: The carrier the shot lands on: theirs, or a garment's.
dirt_template_key
Returns the key of the template zone sources build: an MD5 of every sprite they name, in draw order, the eyes and whether the head is a human's. Bodies drawn from the same sprites share it.
Arguments:
- zone_sources: The sprites, as dirt_zone_sources() returns them.
dirt_thickness_code
Returns the code a thickness packs as in /datum/dirt_pixels/proc/drawn(), from 0: its place among the thicknesses packed so far this round. A mask's thicknesses come from a handful of values.
Arguments:
- thickness: The thickness.
Crashes:
- Past 16 thicknesses, which a code can't hold.
dirt_underclothes_by_rules
Returns which underclothes a shot at a zone lands on before the human template is built: the topmost piece covering it by the rules underclothes follow elsewhere, or null. Underwear covers the groin and butt, an undershirt or bra the chest, and an undershirt the stomach and back too. A piece also covers what it hides (dirt_underclothes_hides()).
Arguments:
- target: The person.
- drawn: Their underclothes, from dirt_underclothes_sprites().
- zone: A DIRT_ZONE_* define.
dirt_underclothes_hides
Returns whether the underclothes rules say a piece hides a zone outright: an undershirt that hides the groin (a corset, a leotard) the groin and butt, underwear that hides the breasts (a one-piece swimsuit) the chest.
Arguments:
- accessory: The piece's accessory.
- piece: Its DIRT_UNDERCLOTHES_* define.
- zone: A DIRT_ZONE_* define.
dirt_underclothes_key
Returns the key a person's mess on one piece of underclothes is kept under: the slot and the accessory, so it stays with that piece while it's off.
Arguments:
- piece: A DIRT_UNDERCLOTHES_* define.
- name: The accessory's name.
dirt_underclothes_on
Returns which underclothes a shot at a zone lands on, or null for the skin. Each piece is judged by its sprite against the zone's pixels on the plain human template (dirt_human_zone_pixels()), so every body is judged on the human shape and nothing waits on its own template.
- The pieces with a pixel in the zone take the shot when together they cover at least half of it.
- The one that shows the most of the zone takes it: its pixels there less those the pieces above it draw over. Ties go to the kind that belongs on the zone (dirt_zone_underclothes()), then to the topmost. So a shirt hem over the waistband doesn't take a groin shot from the underwear, and a corset does.
- Until the human template is built that far, the rules judge instead (dirt_underclothes_by_rules()).
Arguments:
- target: The person.
- zone: A DIRT_ZONE_* define.
dirt_underclothes_sprites
Returns a body's underclothes as drawn, lowest first: list(list(DIRT_UNDERCLOTHES_* define, icon, icon state, accessory name), ...). Each is drawn as get_underwear_overlays() draws it, fitted to the body, a revealing loincloth with its flap cut away while the bulge cuts it (bulge_cut_worn()), and they stack by their accessories' layers, then in that proc's order.
Arguments:
- body: The body.
dirt_underclothes_worn
Returns the underclothes a body draws, each its own surface: alist(DIRT_UNDERCLOTHES_* define = its /datum/sprite_accessory/clothing), as get_underwear_overlays() picks them.
Arguments:
- body: The body.
dirt_value_noise
Returns smooth value noise from 0 to 1: the four lattice points round a sample, blended with a smoothstep. Each point is dirt_noise_hash()'s, its chain's seed steps taken once and each column's step once, for the four.
Arguments:
- sample_x, sample_y: Where to sample, in pixels.
- seed: The noise field's seed, a whole number.
- scale: The lattice's spacing, in pixels.
dirt_worn_shift
Returns where a worn garment's wrapper has its wearer's own tile, as list(pixels right, pixels up): build_worn_icon() centres the wrapper on the garment's worn dimensions, then moves it by its worn offsets, so masks drawn on the body go back by both. list(0, 0) for a 32x32 garment without offsets; list(16, 0) for a 64x32 taur suit, moved 16 px left.
Arguments:
- garment: The worn item.
dirt_zone_cover_flags
Returns the body_parts_covered flag each zone below the face lies under: list(zone = flag). You should NEVER modify it.
dirt_zone_draw_order
Returns the zones a body's limb sprites come from, in the order the body draws them: get_all_limbs() order, which for every carbon is its species' bodypart_overrides sorted by body_part (/datum/species/New()), so the chest, the head, the legs and the arms, each hand straight after its arm. Zone sources are alists, which keep no order, so they're always read in this one.
dirt_zone_facing
Returns the direction a zone is judged from, the one that shows it: north for the back and butt, south for the rest.
Arguments:
- zone: A DIRT_ZONE_* define.
dirt_zone_layer
Returns the layer of the surface a shot at a zone would land on: the garment's over it, DIRT_UNDERCLOTHES_LAYER where underclothes take it, else DIRT_SKIN_LAYER.
Arguments:
- body: The body.
- zone: A DIRT_ZONE_* define.
dirt_zone_limbs
Returns the limb each zone's pixels lie on: list(zone = DIRT_LIMB_* define). An arm runs on into its hand. You should NEVER modify it.
dirt_zone_owners
Returns the zone each pixel shows in one direction, as the body draws its limb images: a list of one zone or null per pixel. The images draw the lowest layer first and in draw order within a layer, and the last one drawn over a pixel owns it: the legs' lower halves (BODYPARTS_LOW_LAYER), then the limbs and the legs' upper halves (BODYPARTS_LAYER), then the hands (BODYPARTS_HIGH_LAYER). handle_masking() splits each leg between its halves with leg_masks.dmi, so the far leg goes under everything in profile.
Arguments:
- masks: Each drawn zone's sprite pixels, from dirt_zone_pixels().
- direction: The direction they're seen from.
dirt_zone_pixels
Returns each drawn zone's sprite pixels in one direction: list(zone = indexes from dirt_sprite_pixels()), zones in draw order.
Arguments:
- zone_sources: The sprites, as dirt_zone_sources() returns them.
- direction: The direction to read.
dirt_zone_sources
Returns the sprites a body's dirt template is built from, as get_limb_icon() draws them: alist(zone = list(icon file, icon state)) for each drawn limb and each hand, "eyes" = list(icon file, left state, right state) when the head draws eyes, and "human_head" = whether the head is a human's. Stumps, invisible limbs and a taur's hidden legs draw no sprite of their own, so they're left out.
Arguments:
- body: The body.
dirt_zone_sources_drawable
Returns whether every limb sprite zone sources name is in its sheet. The eyes aren't checked: a missing eye state draws no eye, so the face is left unguarded as the body shows it.
Arguments:
- zone_sources: The sprites, as dirt_zone_sources() returns them.
dirt_zone_sources_match
Returns whether a body draws the sprites zone sources name, as dirt_zone_sources() reads them, without building them: the sheet and state of each limb in some zones and of its hand, the eyes, and whether the head is a human's. Skin mess asks it only when what a limb is drawn from has changed since it last matched (skin_reads); a worn garment's mess, a taur body's or taur suit's pools and the vulva's ring of skin ask it on every draw.
Arguments:
- body: The body.
- zone_sources: The sprites, as dirt_zone_sources() returns them.
- zones: The body zones whose limbs to check: every one, or those a caller doesn't check otherwise.
dirt_zone_underclothes
Returns the kinds of underclothes that belong on each zone, in the order they take a tied shot there: list(zone = list of DIRT_UNDERCLOTHES_* defines). You should NEVER modify 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.
do_admin_sparks
Creates non-interactive rainbow sparks at the given source location
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.
- user - The mob performing the action.
- delay - The time in deciseconds. Use the SECONDS define for readability.
1 SECONDSis 10 deciseconds. - target - The target of the action. This is where the progressbar will display.
- timed_action_flags - Flags to control the behavior of the timed action.
- show_progress - Whether to display a progress bar / cogbar.
- extra_checks - Additional checks to perform before the action is executed.
- 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.
- max_interact_count - The maximum amount of interactions allowed.
- cog_icon - The icon file of the cog. Default: 'icons/effects/progressbar.dmi'
- cog_iconstate - The icon state of the cog. Default: "Cog"
- bar_override - Mob which should see the bar instead of the user
do_chem_smoke
Helper to quickly create a cloud of reagent smoke reagent_type can accept a list of reagents, optionally as a key-value pair with values overriding reagent_volume if not null
do_foam
Proc to quickly spawn foam reagent_type can accept a list of reagents, optionally as a key-value pair with values overriding reagent_volume if not null
do_portal_spawn
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_salon_work
A do_after() for the finishing touches that plays the tool's work sound, and the tattoo machine's hum, until it ends either way.
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 - Typepath for the effect system to use
- effect_type: The smoke typepath to spawn.
- log: Should the system log the smoke spawned?
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
drawn_appearances
Returns every appearance drawn in an overlay layer, each before what it holds.
Arguments:
- appearances: The layer's cached appearance, or list of them.
drawn_underclothes
Returns the appearance a test human's only underclothes are drawn as. Their layer also holds what their worn emissives are drawn with (prepare_worn_emissive_overlays()), which has no sprite.
Arguments:
- wearer: The test human.
drawn_worn_sprite
Returns the sprite a test human's worn item is drawn as in one of its overlay layers: the first appearance drawn there with an icon. The layer also holds what the item's emissives are drawn with (prepare_worn_emissive_overlays()).
Arguments:
- wearer: The test human.
- layer: The overlay layer, as UNIFORM_LAYER.
drop_hair_trimmings
Drops a pile of hair cuttings, coloured from the hair that was just cut off.
- target_turf - where the pile lands. Does nothing if null.
- shorn - whoever got cut. A missing head just falls back to black.
- pile_size - 1 a light trim, 2 a restyle, 3 the whole lot coming off.
- facial - the cuttings came off a beard rather than a scalp.
- hairstyle - the style the hair came off, which decides whether the pile falls in curls. Defaults to whatever the mob is wearing now, so callers that restyle first should pass the old name.
ducting_layer_check
Finds a duct or plumbing machinery located at the destination
Arguments
- atom/destination - the target loc we are checking for
- ducting_layer - the ducting layer to check for. pass -ve value when you are checking for overlapping machines
dump_in_space
Dump a movable in a random valid spacetile
dump_stack
Returns an ordered list of all our parent procs, highest to deepest.
introspection like this is mostly useful for debugging, if you have another use I suspect you are just creating god's strongest footgun and should rethink things
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.
The easy formula for defaults is sqrt(power * 2) * (0.25 | 0.5 | 1)
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.
- 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.
emissive_branch_lit
Whether an emissive-plane branch glows anywhere. An emissive's colour is a matrix whose constant row turns it red
(blooming) or green; BYOND keeps a blocker's, which only multiplies, as plain black. inherited is the colour the
branch takes from above it.
emissive_branches
What of a look glows in the dark, for the pages that show it with the lights off.
The game lights a glowing pixel through its emissive plane: every emissive overlay and every blocker over one sits there, at the layer of what it belongs to, so a blocker drawn later hides the glow under it. An emissive's colour turns it red when it blooms and green when it doesn't; a blocker's turns it black. Flattening a look's emissive overlays alone, as the plane holds them, gives that mask: get_flat_uni_icon() leaves them out of the look itself, as they are on another plane. The worn-emissive grouping puts every emissive and blocker of a mob at its top level.
A look's own emissive overlays and underlays, the glowing and the blocking, layered in (low, high], as list(overlays, underlays), each null when there are none. Underlays come only with the lowest layers, as a slice of the look takes them.
emissive_branches_lit
Whether any of emissive_branches() glows, rather than only blocking.
emissive_holder
emissive_branches() of look in a holder that get_flat_uni_icon() draws as the emissive plane holds them, placed as
they are on the look: its layer and facing, and a blank tile of its own at the look's lower left, where the look's
own icon is. Null when there are none.
emissive_tri_bool_list
Returns a cached emissive boolean list for mutant bodyparts. You should NEVER modify these lists, always use Copy() if you have to.
This proc takes exactly three boolean-like values (0 or 1) representing whether the primary, secondary, and tertiary color channels are emissive.
To reduce memory churn and repeated list allocations, all possible permutations (2³ = 8 total) are cached globally and reused.
The returned list should be treated as immutable. Modifying the returned list will affect all users of that permutation.
Arguments:
- arg1: Whether the primary color channel is emissive (0 or 1)
- arg2: Whether the secondary color channel is emissive (0 or 1)
- arg3: Whether the tertiary color channel is emissive (0 or 1)
Returns:
- A list of length 3 containing the emissive flags, shared from cache.
Crashes:
- If called with anything other than exactly three arguments.
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
engaged_role_play_check
Checks if a player meets certain conditions to exclude them from event selection. Returns FALSE if the player is considered ineligible for the event
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
female_cut_over_pecs
Returns the female cut a garment gets on wearer, as wear_female_version() takes its flags: flags themselves, unless the
wearer has pecs, which keep the torso out of it. Then only the lower body is shaped: FEMALE_UNIFORM_LOWER_ONLY where the cut
would take in the crotch, or null, no cut at all, where it would shape only the torso. Pecs of any shape count, whether
they show or not.
Arguments:
- wearer: Who the garment is drawn on, if anyone.
- flags: The cut's flags as the garment would get them on this body without pecs.
- bodyshape: The body shape wear_female_version() is given with them, which keeps a cut other than FEMALE_UNIFORM_FULL off digitigrade legs.
female_lower_cut_mask
Returns the mask a FEMALE_UNIFORM_LOWER_ONLY cut is drawn through: masking_helpers.dmi's full cut, less the pixels its torso-only cut shares with it, so it shapes the lower body alone. Made with each new cut, which wear_female_version() caches.
fill_grid_from_icon
Copies the pixel colors from the passed in icon I to the 2d list grid
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_chain_step
Keeps the steps in the correct order. Arguments:
- params - the parameters you want this step to animate to
- duration - the time it takes to animate this step
- easing - the type of easing this step has
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_last_punctuation
Find what punctuation is at the end of the input, returns it. Ignores emphasis (|, +, _)
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_mod_theme
Simple proc to search through mod_themes global to return a theme
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_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_safe_turf
Attempts to find a "safe" floor turf within some given z-levels
- zlevel_or_levels: The list of z-levels we are searching though. You can supply just a number and it will be turned into a list.
- extended_safety_checks: Will do some additional checks to make sure the destination is safe, see /proc/is_safe_turf.
- dense_atoms: Will additionally check to see if the turf has any dense obstructions, like machines or structures.
Returns a safe floor turf, BUT there is a chance of it being null if an extremely large portion of a z-level is unsafe or blocked.
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.
find_vent_spawns
Finds us all suitable vent spawn locations on the station.
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_items to finish equipping an item to a mob.
finish_unequip_mob
A utility function for /datum/strippable_items 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
first_name
Find the first name of a mob from a passed string with regex
fit_garment_frames
Fits a garment's state in place: each direction, and each animation frame, is fitted on its own (fit_garment_view()), the front views last (GARMENT_FIT_PIECE_VIEW()).
Arguments:
- garment: The garment's state, a 32x32 /icon with four directions, named "". Changed in place.
- mode: How the garment is fitted, a GARMENT_FIT_* define.
- fit: What it is fitted to.
- delays: An animated state's frame delays, from its sheet, or null for a state of one frame.
- view_colours: Each view's colours, as fit_garment_view() takes them, by view, or null to read them from the pixels.
- straight: Whether the garment hangs straight over pecs drawn under it (fit_garment_view()).
- bare: Whether the garment leaves the near forearm bare in its side views at the arm's own width (fit_garment_view()).
Returns:
- The /icon passed in, fitted: some view changed.
- null: The fit changes no view, and the garment is drawn as it is.
fit_garment_view
Fits one view of a garment's state in place, one direction's animation frame (/datum/garment_fit_view), and draws it back over the state's own when the fit changes it. A state's views are numbered direction by direction (S, N, E, W), and frame by frame within each. Its arms' sleeves are judged from its frame's front view (garment_front_sleeves()), which must still be the garment's own: fit the front views last.
Arguments:
- garment: The garment's state, a 32x32 /icon with four directions, named "". Changed in place.
- view: Which view, from 1 to 4 times the state's frames.
- mode: How the garment is fitted, a GARMENT_FIT_* define.
- fit: What it is fitted to.
- delays: An animated state's frame delays, from its sheet, or null for a state of one frame. Every frame keeps its delay: without one, Insert() gives a frame of the first direction a neighbouring frame's delay.
- colours: The view's colours and how many pixels have each, packed as garment_sheet_metadata() holds them, for a view of a static sheet's own state; or null, to read them from its pixels.
- straight: Whether the garment hangs straight over pecs drawn under it, its chest panel left as drawn (/datum/sprite_accessory/clothing/proc/hangs_straight_over_pecs()).
- bare: Whether the garment leaves the near forearm bare in its side views at the arm's own width (/datum/sprite_accessory/clothing/proc/bares_near_forearm()).
Returns whether the view changed.
flash_color
Flash a color on the passed mob
flick_overlay_global
Add an image to a list of clients and calls a proc to remove it after a duration
force_apc_arcing
Set all APCs to start (or stop) arcing
forced_throw_vortex
Magical move-wooney but it always throws you that happens sometimes, adapted from goonchem_vortex
Simulates a vortex that moves nearby movable atoms towards or away from the turf T. Range also determines the strength of the effect. Always throws. Parameters decide how hard it throws. Arguments:
- T - turf where it happens
- is_pulling - true if throwing things away from the starting turf
- range - range.
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
gags_to_universal_icon
Converts a GAGS atom to a universal icon by generating blend operations.
garment_colour_hue
Returns a colour's hue as the sleeve modes judge it (garment_sleeve_mode()), in whole degrees from 0 to 359, or -1 for a
grey: one whose channels spread less than percent percent of its brightest one, black included.
Arguments:
- channels: The colour's red, green and blue, from rgb2num().
- percent: The grey line. 0 gives a colour's cast, its hue however slight, and only equal channels are grey.
garment_colours_kin
Whether a shaded sleeve may step a pixel from colour source to the darker colour, keeping to source's family. A
colour is lit when its brightest channel is at least SLEEVE_LIT_MIN, and dark otherwise. It may when:
colouris a charcoal or a black, a dark near-grey (garment_near_grey()): every colour darkens into one;- both are dark: outlines and shadows shading among themselves;
- both are near-greys: one grey ramp, across the grey line;
colouris a hue, not a near-grey, andsourceis a hue or a charcoal or a black, their casts (their hues however slight, garment_colour_hue()) within SLEEVE_MAX_HUE_SPREAD degrees of each other: so a grey never steps into a hue, while a blue-cast charcoal may step into navy.
Arguments:
- source: The pixel's colour, without alpha.
- colour: The darker colour, without alpha.
garment_fit_cache_slot
Returns the list a garment fit is cached in, under its own last key, by the keys before it, making each level as it goes.
Arguments:
- cache: The cache.
- ...: The keys before the last, outermost first.
garment_fit_templates
Returns the limb templates garments are fitted with, read from fitting/fit_templates.json the first time they're asked for: SSgarment_fitting reads them as the server starts. The file is compiled into the resource file, so a server has it wherever it runs.
limbs holds, for each limb, muscle size and view ("S", "N", "E" or "W"), the rows its outline grew in as bands (y, step
back into the limb, new edge, old edge, distance, and whether the row is one an arm grew into above its old top, which only
a sleeve is fitted over), its baseline pixels as core, the upper third of those by rows as upper_core, made here for the
sleeve test, and its fitted pixels' skin tones as tones. The limbs are the arms and legs by zone, a digitigrade body's
legs, "r_leg_digi" and "l_leg_digi", and "chest_m", a male chest's glutes in the side views at the sizes where they reach
past today's, which has bands alone. A leg in a side view grows toward both its front and its back.
garment_fit_upper_core
Returns the upper third, by rows, of a limb template's baseline pixels: on an arm, what a sleeve covers and a strap over the shoulder doesn't. The sleeve test reads it (/datum/garment_fit_view/proc/apply_bands(), garment_front_sleeves()).
Arguments:
- core: The template's baseline pixels, as x, y pairs.
garment_frame_count
Returns how many animation frames a garment's state has, counted from its front view, up to GARMENT_FIT_MAX_FRAMES.
Arguments:
- garment: The garment's state, an /icon named "".
garment_front_sleeves
Returns which of a garment's fitted arms it has a sleeve over, judged from its front view, where the arms show whole: fitted arm -> whether the garment covers at least half of the upper third of the arm's baseline pixels there. A short sleeve covers the upper arm and counts, where a strap over the shoulder covers a pixel or two of it. Every view's fit uses it (/datum/garment_fit_view/proc/apply_bands()). Null when no arm is fitted.
Arguments:
- garment: The garment's state, a 32x32 /icon with four directions, named "", its front views as the garment draws them.
- frame: The animation frame.
- sizes: Template limb -> muscle size, as /datum/garment_fit has them.
garment_metadata
Returns fitting/garment_metadata.json's sheets, by path, read the first time they're asked for: SSgarment_fitting reads them as the server starts. See garment_sheet_metadata().
garment_near_grey
Whether a colour is a near-grey: its channels spread less than twice SLEEVE_GREY_PERCENT percent of its brightest one, black included. A greyscale garment's own faintly blue shading falls either side of the grey line, but is near-grey.
Arguments:
- channels: The colour's red, green and blue, from rgb2num().
garment_pec_flex
Returns a pec flex's templates, as garment_pec_templates() holds them under flexes: its frame delays, and its shapes,
each shape's templates by view on each of its frames. Null for a sheet that isn't a pec flex's, like a jiggle's, or none.
Arguments:
- sheet: The sheet a chest animates from (/datum/bodypart_overlay/mutant/genital/breasts/var/animation_icon).
garment_pec_templates
Returns the templates tops are fitted to pecs with, read from fitting/pec_templates.json and fitting/pec_flex_templates.json the first time they're asked for, as the limb templates are.
centre is the chest's centre column and chest the chest's own outline, per view and row, as its outermost x on each side.
shapes holds, for each pec shape and view: in front and back views, the pec's outermost x on each side per row as rows
(null where it has none) and its pixels as pixels, also kept by FIT_INDEX() as mask; in side views, its bulge past the
body's front as bands, in the limb templates' form; in the front view, the pixels its smile shades as smile, for pecs
with and without nipples. flexes holds, for each pec flex by its sheet's path, the flex's frame delays and, for each
shape, its templates of the same form on each frame of the flex as shapes (garment_pec_flex()).
garment_sheet_metadata
Returns what garment fitting knows of a sheet without reading its pixels, from fitting/garment_metadata.json: sleeves, its
states whose own sleeves pick shaded sleeves -> TRUE, and colours, for each state whose fits read whole views, those views'
colours as fit_garment_view() takes them, or null for a view read from its pixels. Null for a sheet it doesn't know, like a
generated icon, or one that changed after the file was written: those are read from their pixels.
A sheet is checked against its hash the first time it's asked about each round.
Arguments:
- sheet: The sheet.
garment_sleeve_mode
Returns the mode a worn garment is fitted in when it doesn't set its own, picked from its sleeves in its front view.
The sleeves are the garment's pixels over the baseline arms (both arms' template core). Their lit colours count, where the
brightest channel is at least SLEEVE_LIT_MIN; darker ones are outlines and shadows. Plain sleeves, fitted with the arms'
shading (GARMENT_FIT_SHADED_SLEEVES), are greys only, up to SLEEVE_MAX_COLOURS of them, or one hue: up to SLEEVE_MAX_COLOURS
hued colours within SLEEVE_MAX_HUE_SPREAD degrees of each other, and at most SLEEVE_MAX_GREYS_WITH_HUE grey. Anything else,
and a garment with no sleeves or only dark ones, is fitted solid.
Arguments:
- front: The garment's front view, as it's drawn: the first frame's, when it's animated.
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_clockcult_scriptures
Generate all scriptures in a global assoc of name:ref. Only needs to be done once
generate_cult_rune_types
Returns an associated list of rune types. [rune.cultist_name] = [typepath]
generate_customizable_races
Generates races available to choose in character setup at roundstart, yet not playable on the station.
This proc generates which species are available to pick from in character setup.
generate_filter_immune_string
Generates a static string appended to the venom milker's description, detailing which reagents available to the venom quirk will not be transformed into /datum/reagent/generic_milked_venom.
Ran once, then never again.
generate_generator_index
Creates generator__id => type map.
generate_hallucination_weighted_list
Generates the global weighted list of random hallucinations.
generate_heretic_starting_knowledge
Modifies the 2 lists provided in the arguments and sets it up so the heretic can actually start researching stuff. Specifically generates the tier 1-4 knowledges + start ones for each path as well for the preview (should probably be moved to use the actual list of per-path researches) Importantly, this adds HKT_NEXT's for the starting knowledges so the heretic's next researches are considered valid
generate_holiday_races
Every species with a holiday of its own that the roundstart races config doesn't already allow: id -> holiday.
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_milkable_venom_list
Generates a static list of /datum/reagent that will not be transformed into /datum/reagent/generic_milked_venom upon being milked by a venom milker.
Ran once, then never again.
generate_number_strings
Generates and returns a list of both arabic and roman numerals for 1 through 99
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 the 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.
- detection_threshold_percent - The minimum relative percentage a flavor must reach to be tasted.
generate_seed_data_from
Returns a list of seed data generated from the given seeds. Filling the "name", "icon" and "icon_state" fields of the data is the caller's responsibility.
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_taur_clothing
Proc to generate a taur variation of clothes, with the intent of caching them. It is meant for suits and uniforms at the moment, to cut out the bottom half so that it doesn't look too out of place.
Arguments:
- index - The index at which the icon will be stored. Overwrites existing icons if there was one, do your checks before calling this proc.
- icon_to_process (/icon) - The icon we want to run through the process of masking off the bottom part of.
- icon_state - The icon_state of the icon we're being given, to obtain a proper icon object.
Add a taur_type here if you ever want to add different cropping options, for whatever reason.
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.
genital_option_label
Reverse lookup: the label whose define matches the current value, or null.
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. clip_bounds fixes the output rectangle in appearance coordinates, including nested offsets. grow: the canvas fits every overlay, nested ones where they really are; grown_origin, list(1, 1), gets where it starts.
get_abstract_branch_descendants
Returns a list of concrete types under abstract sub-branches of root
get_abstract_types
Returns a list of all abstract typepaths for all datums
get_active_player_count
Counts active players who are playing in the round
get_active_player_list
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_adjacent_turfs
Returns a list of all turfs that are adjacent to the center atom's turf, clear the list of nulls at 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_antag_flags
Returns a list of all antag flags that are available to the player
So this includes stuff like traitor, wizard, fugitive, but does not include wizard apprentice or hypnotized
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_announcement_system
Returns a random announcement system that is operational, has the specified config entry, signal can reach source and radio supports any channel in list. All args are optional.
get_anomaly_protection
Calculates mob effect protection returns NO_ANOMALY_PROTECTION if not human, returns calculated protection otherwise higher returning number means less protection
Arguments:
- human_mob - human, who we will check for bio protection
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 - stops looking if stop_type is found in the turf, returning that type (if found).
- return_any - if set to TRUE, will return last movable found even if its not of the passed type
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_blood_type
Returns the blood_type datum that corresponds to the string id key in GLOB.blood_types
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_bulge_palette
The adaptive palette of a cloth colour in a finish (BULGE_FINISH_*): five "#rrggbb" strings, cloth, light, highlight, shade and deep shade, or null for no colour. One shared list per (colour, finish): never change it.
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_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_color_from_blood_list
Returns the hex color string, or a color matrix, of a given blood_type datum given an assoc list of blood_DNA e.g. ("Unknown Blood Type", "*X")
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:
- wounding_type: Wounding type wounds of which we should be searching for
- 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_customizable_races
Gets a list of all customizable races on roundstart.
get_decoration_color_from_pattern
Proc to return colors for recoloring atoms based on a pattern and the position of the atom. Primarily used by holidays
get_display_icon_for
Gets the relevant universal icon for an atom, when displayed in TGUI. (see: icon_state_preview) Supports GAGS items and colored items.
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_emote_sound_from_list
Gets an emote sound from a specific list of sounds. Supports lists and genders. Used by emote datums for default sounds, and tongues, masks etc. for overrides.
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. grow: getFlatIcon() grows the canvas to show what reaches past the tile, for previews of one direction.
get_flat_uni_icon
getFlatIcon for /datum/universal_icons Still fairly slow for complex appearances due to filesystem operations. Try to avoid using it grow: the canvas fits every overlay, nested ones where they really are; see flat_x1.
get_frozenwake_puzzle_area
Proc used to check if get_area returns the frozenwake puzzle area.
get_garment_fit
Returns the garment fit to these muscle sizes and pecs, made the first time it's asked for.
Arguments:
- sizes: Template limb -> muscle size, as /datum/garment_fit has them, or null for no limb above the Normal size.
- pec_shape: The shape of pecs drawn under the garment, as /datum/garment_fit has it, or null.
- pec_nipples: Whether those pecs draw nipples.
- pec_flex: The sheet those pecs flex from, as /datum/garment_fit has it, or null.
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_hear_turfs
get_hear that only gets turfs so we can use as_anything
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_looc_range
- Get all hearers in range, ignores walls and such. Code stolen from
/proc/get_hearers_in_view() - Much faster and less expensive than range()
get_hearers_in_radio_ranges
Returns a list of mobs who are in hearing range of every radio in the list of radios given
get_hearers_in_radio_ranges_track_radios
Returns a list of mobs who can hear any of the radios given in the given radio list, indexed by the radio. More expensive than get_hearers_in_radio_ranges()
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
- contents_type - the type of contents we want to be looking for. defaults to hearing sensitive
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
- contents_type - the type of contents we want to be looking for. defaults to hearing sensitive
get_holiday_races
Species that are roundstart races only during a holiday, as an assoc list of id to holiday.
Character setup offers them all year. Joining is still gated by check_roundstart_eligible(), since jobs refuse species missing from the roundstart races.
get_icon_dimensions
Returns a list containing the width and height of an icon file
get_icon_dimensions_pure
Returns a list containing the width and height of an icon file, without using rustg for pure function calls
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_job_hud_icon
Returns the (isolated) security HUD icon for the given job.
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_linked_z_levels_in_range
Gets all connected z-levels within a given manhattan distance of center.
Arguments:
- center: The starting Z level. Can either be a numeric z-level, or a [/datun/space_level].
- dist: The maximum distance to search.
get_liquid_color_factor
Returns the LIQUID_COLOR_FACTOR_* that a pool of this LIQUID_SURFACE_* class scales its mix colour by.
get_liquid_reagent_look
Returns what liquids read off a reagent type, worked out once per type.
Arguments:
- reagent_type: A /datum/reagent type.
get_liquid_surface
Returns the surface a pool of these reagents draws.
The pool takes the LIQUID_SURFACE_* class holding the most volume, ties going to the lower define, and the liquid_surface_detail of that class's largest reagent.
Arguments:
- reagent_list: Reagent type to volume.
Returns:
- list(class, detail). A list with no volume gives LIQUID_SURFACE_CLEAR and no detail.
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_loc_from_mousepos
Converts mouse-pos control coordinates to a specific turf location on the map.
Handles the conversion between control-space mouse coordinates and screen-space map coordinates, accounting for various BYOND quirks and display scaling factors.
@param mousepos_x The x-coordinate of the mouse click (in control pixels, top-left origin) @param mousepos_y The y-coordinate of the mouse click (in control pixels, top-left origin) @param sizex x control width of the map @param sizey y control width of the map @param viewing_client The client whose view perspective to use for the conversion
@return The turf at the calculated map position, or the closest one if out of bounds, as well as the residual x and y map offsets
Important Notes:
- This WILL be incorrect when client pixel_wxyz is animating, and it WILL be incorrect if the user is gliding, because we don't have a good way to compensate this on the serverside. Yay!!!
- Mouse coordinates originate from the top-left corner because we can't have consistency in this engine
- Coordinate systems are inconsistent between control pixels and screen pixels
- Something on the byond side (icon size likely? needs debugging) affects the control pixels
- This uses the ratios between them rather than absolute values for reliable results
- For absolute value comparisons, dividing by 2 may work as a temporary hack, but using ratios (as implemented in the proc) is the recommended approach
get_lone_liquid_color
Returns the colour of a pool holding only one reagent type, at any volume above 0, worked out once per type.
Any volume mixes to the reagent's own colour, so this is what scale_liquid_color(mix_liquid_color()) gives for it.
Arguments:
- reagent_type: A /datum/reagent type.
get_matching_bitflags
Returns null if no such field exists, a list of all matching flags by name otherwise
get_messenger_name
Get the display name of a messenger instance
get_minimap_blips_in_area
Returns minimap blips matching a tag that are within distance tiles of target_turf on the same z-level.
get_minimap_for_z
Gets the /datum/minimap for a Z-level - generating it if it hasn't been yet.
get_mob_admin_traits
Returns only traits that apply to mobs
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. If playtime tracking is disabled, just returns the first player in the list.
get_nested_locs
Returns a list of all locations (except the area) the movable is within.
get_officer_department
Returns the department a new officer should go to: the least populated one, favoring their preference on ties.
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_protean_chest_component
Gets the protean chest component from a mob. Returns null if not protean.
get_protean_modsuit
-- Helper procs -- Gets the protean modsuit from a mob's chest component. Returns null if not protean or no modsuit.
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_food
Get a random food item exluding the blocked ones
get_random_hallucination
Select a random hallucination from the hallucination pool
- tier - the tier of hallucination to select from
- strict - if true, only select from the passed tier. If false, select from the passed tier and all tiers below it.
get_random_jumpskirt
Returns a random, acceptable jumpskirt typepath
get_random_jumpsuit
Returns a random, acceptable jumpsuit typepath
get_random_manual
Gets a random manuel book type excluding certain banned books
get_random_neuroware
Returns a random neuroware reagent type. Excludes aphrodisiac reagents.
get_random_reagent_id
Returns a random reagent object, with the option to blacklist reagents.
- randomization_flags - Flags to filter the reagents by. Default is REAGENT_SPAWN_RANDOM_PRODUCERS.
- blacklist - Optional, a list of reagent typepaths to exclude from the random selection. Subtypes of the listed reagents are not explicitly included. If not provided, defaults to an empty list.
- whitelist - Optional, a list of reagent typepaths to include in the random selection. Subtypes of the listed reagents are not explicitly included. If not provided, defaults to all reagent subtypes.
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_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_safe_random_station_turf_equal_weight
Returns a random department of areas to pass into get_safe_random_station_turf() for more equal spawning.
get_sane_item_types
Used for random item gen to try and generate a list of types that arent weird parent types and similar
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_species_page_ids
Every species the species page offers, as an assoc list of id to TRUE.
get_species_page_renders
Draws every species on the species page facing each way, without uniform and then in it, as list("body" = entries, "uniform" = entries) in insert_icon()'s entry format. Both sheets take their half from the one drawing, and later callers wait for the first to finish.
This never loads a sheet itself: loading one can realize it, which would call back in here.
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_synthesizable_reagent_subtypes
Returns a list of all subtypes of base_type reagent that can be synthesized. If none qualify, returns an empty list — caller should handle fallback.
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_bitflags
Returns an associative list of bitflag name -> number for all valid bitflags in the passed in field
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_valid_teleport_turf
Check for turfs within range of the center turf and perform simple checks to see which is a valid teleportation target. If so, add it to a list to pick the final destination from at the end.
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
get_vox_glove_color
Gloves have no leg/foot sample point. Use their most common visible source color.
give_admin_popup
Tries to give the target an admin popup. If it fails, will send the error to the passed admin.
give_feline_taur
Makes a human a feline taur, the taur whose tail is drawn separately, and returns its taur body.
Arguments:
- taur: The human to change. It must not have a taur body yet.
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.
graffiti_anchor_for
Returns where graffiti painted on a turf lives across rounds: a station anchor, the turf's coordinates and area, and
its graffiti_surface_kind() as its surface.
Arguments:
- tile: The turf.
Returns:
- list: The anchor.
- null: The turf isn't the static station (graffiti_static_station()), or the map is an admin-loaded custom one, whose graffiti lasts this round only.
graffiti_anchor_resolve
Returns the turf an anchor names this round, when it is still the kind of surface the graffiti was painted on.
A station anchor needs its turf to be in the same area as before and still the static station (graffiti_static_station()). Other kinds go through their registered resolver.
Arguments:
- anchor: The anchor, as SSgraffiti.check_anchor() returns it.
Returns:
- turf: The turf.
- null: It doesn't resolve, or the turf isn't the kind of surface the anchor records.
graffiti_anchor_waits
Whether an anchor that doesn't resolve is only waiting, so the round isn't counted as a miss: no system has registered a resolver for its kind this round.
Arguments:
- anchor: The anchor.
Returns:
- TRUE/FALSE
graffiti_art_decode
Decodes an art, such as one read from a map file, when it can be drawn: a one- or two-tile width, a palette of 1 to GRAFFITI_FLAT_MAX_COLORS colours, and a grid and glow mask that both cover every pixel.
Arguments:
- art: The art.
Returns:
- list: list(palette, indices, glow): its canonical colours, then one palette index and one glow bit per pixel, row by row from the top left. Art that glows nowhere has graffiti_unlit_glow()'s glow. Never change them.
- null: It can't be drawn.
graffiti_art_glow_kind
Returns which of an art's painted pixels glow, which decides its emissive overlays.
Arguments:
- art: The art.
- decoded: The art's graffiti_art_decode(), when the caller has it.
Returns:
- GRAFFITI_GLOW_NONE: None of them, or there is no art or it can't be decoded.
- GRAFFITI_GLOW_ALL: Every one.
- GRAFFITI_GLOW_MIXED: Some.
graffiti_art_hash
Returns an art's content identity, which tiles showing the same art share.
Arguments:
- art: The art.
Returns:
- text: An md5 of the width, palette, grid and glow.
graffiti_art_icon
Returns an art drawn as an icon, which every tile showing that art shares. Its paint shows at its real alpha (graffiti_drawn_colors()).
Icons are cached by graffiti_art_hash() in SSgraffiti.art_icons, up to GRAFFITI_ICON_CACHE of them, the oldest going first. A placement's art the map no longer uses goes at once (SSgraffiti's release_art()); the composite of a stack of several pieces, which no placement names, only ages out. Never change one.
Arguments:
- art: The art.
- key: The art's graffiti_art_hash(), when the caller has it.
- use_cache: Whether to take the icon from the cache and keep it there. A sprite sheet takes icons drawn without it: once about twenty icons inserted into a sheet are still held elsewhere, as the cache holds them, BYOND refuses every further Insert() into that sheet ("bad icon operation").
- decoded: The art's graffiti_art_decode(), when the caller has it.
Returns:
- icon: The art in one state, "".
- null: There is no art, or it can't be decoded.
graffiti_art_pixels
Counts an art's painted pixels.
Arguments:
- art: The art.
Returns:
- number: Pixels with a colour, 0 when the art can't be decoded.
graffiti_blank_icon
Returns a new transparent icon one or two tiles wide.
The files call their one state "nothing", but icon() names the state it takes "", the state an atom shows by default.
Arguments:
- width: GRAFFITI_WIDTH or GRAFFITI_WIDE_WIDTH.
Returns:
- icon: GRAFFITI_HEIGHT rows of
widthtransparent pixels in one state, "".
graffiti_blend
Blends a colour over another as placed graffiti shows them, in their real alphas: GRAFFITI_ALPHA_CEILING for opaque paint and its own for translucent paint. The standard "over" operator gives the alpha and the colour, and an alpha that reaches the ceiling is stored opaque.
Arguments:
- under: The canonical colour beneath.
- over: The canonical colour on top.
Returns:
- text: The canonical blend.
graffiti_clean_text
Cleans player text for a piece's name, description or layer names, so that cleaning it again changes nothing.
Entities are decoded first so escaped text isn't escaped twice, and the text is cut to max_length
characters before it is escaped so the cut can't split an entity.
Arguments:
- text: The player's text.
- max_length: Most characters kept.
Returns:
- text: The trimmed, escaped text, "" when nothing is left. Callers supply their own default.
graffiti_clip_record
Returns a decoded art or layer with paint left only where a poster takes it.
Arguments:
- decoded: Its graffiti_art_decode() record, one tile wide.
- outside: graffiti_poster_look()'s "outside": the pixels that take no paint.
Returns:
- list: A new record sharing the colours and glow, or
decodeditself when it paints none of those pixels.
graffiti_color
Returns a colour in its canonical graffiti form: lowercase #rrggbb when its alpha reaches GRAFFITI_ALPHA_CEILING,
the alpha placed graffiti draws opaque paint at, and #rrggbbaa below it, raised to GRAFFITI_ALPHA_FLOOR when lower.
So a stored colour's real alpha is the ceiling when it has seven characters, and its own alpha when it has nine.
sanitize_hexcolor() can't widen six digits to eight, and it answers bad input with #00000000 rather
than the null default, so opaque input is padded to eight digits first and the sanitized text must match
the input exactly.
Arguments:
- color:
#rrggbbor#rrggbbaatext, in either case.
Returns:
- text: The canonical colour.
- null: Anything else, or an alpha of 0, which paints nothing.
graffiti_copy_piece
Returns a copy of a canonical piece that shares no list with it, such as one to hand on from a library, which keeps its own. deep_copy_list() would turn the list of layers into an associative list.
Arguments:
- piece: The piece.
Returns:
- list: The copy.
graffiti_credit_painter
Marks graffiti as a painter's work as they finish a piece on it: their hidden print, and once only the art element, which every piece stacked on a tile, or sprayed over a poster, shares.
Arguments:
- art: The decal or poster the piece is on.
- user: The painter.
graffiti_decode_flat
Decodes a flat art grid that graffiti_encode_flat() wrote. Hostile input is refused before anything is
expanded, and decoding stops at pixel_count whatever the runs claim.
Arguments:
- encoded: The grid.
- palette_size: How many colours its indices may reach.
- pixel_count: How many pixels it must cover, at most a wide canvas.
Returns:
- list:
pixel_countpalette indices, 0 where transparent. - null: The prefix doesn't fit the palette size, a run is malformed, an index is past the palette, or the runs cover another number of pixels.
graffiti_default_palette
Returns the colours the graffiti editor offers before a piece has its own: black and Endesga-32's greys, hues, browns and skin tones, a few pastels, then neons for glow layers.
Returns:
- list: The colours, made once. Never change it.
graffiti_draw_icon
Draws pixels on a new icon as horizontal runs, one DrawBox() for each run of one colour.
Arguments:
- indices: One entry per pixel, row by row from the top left: the position of its colour in
colors, 0 where nothing is drawn. - colors: The colours. DrawBox() writes their alpha as given.
- width: GRAFFITI_WIDTH or GRAFFITI_WIDE_WIDTH.
Returns:
- icon: The pixels in one state, "".
graffiti_drawn_colors
Returns colours as placed graffiti draws them, in their real alphas: opaque ones at GRAFFITI_ALPHA_CEILING, so the surface shows through, and translucent ones at their own, which is below it. None draws above the ceiling.
Arguments:
- palette: Canonical colours, as graffiti_color() returns them.
Returns:
- list: The colours as
#rrggbbaa, in the same order.
graffiti_drop_loose_paint
Drops for good the paint a stopping piece has placed, both halves of a two-tile one, when a tile of it offers no surface now, as a pane loosened under it leaves one: a loose pane drops the piece in progress whole. Graffiti finished there stays.
Arguments:
- tile: The piece's left tile.
- width: The piece's width.
- placements: Its placements, packed, the left one then the right one, either null.
Returns:
- TRUE/FALSE: Whether a tile of the piece offers no surface, which leaves the piece nothing to resume.
graffiti_editor_for
Opens a graffiti editor for a player, ending any editor they already have. A surface session shakes the can.
Arguments:
- user: The player.
- piece: The canonical piece to open, a copy the editor may keep, or null for a blank piece.
- piece_id: The library piece it is, or null.
- can: The spray can it is opened from, or null.
- surface: The wall, floor or window tile to paint live, or a poster's tile, or null for a studio session.
- poster: The poster to paint live, on
surface, or null.
Returns:
- /datum/custom_sprite_editor/graffiti: The editor, without its window yet.
graffiti_editor_test_begin
Points the graffiti registry and libraries at the scratch directory, with the test account's library empty.
graffiti_editor_test_end
Ends the test account's graffiti editor, takes the test ckey back off its painter, and puts the registry, the library directory and the account's library and cooldowns back.
graffiti_editor_test_painter
Puts a painter for the test account beside a wall, holding an uncapped spray can.
Arguments:
- test: The test, which owns the painter and the can.
- wall: The wall to paint.
Returns:
- list: The painter, whose ckey is the test account's, then the can.
graffiti_editor_test_paste
Returns a one-pixel green paste on the bottom layer's top row, as the editor's window sends pasted paint it drops.
Arguments:
- column: The pixel's column.
Returns:
- list: The spriteEditorCommand action's params.
graffiti_editor_test_stroke
Returns a one-pixel pencil stroke on the bottom layer's top row, as the editor's window sends it.
Arguments:
- column: The pixel's column.
Returns:
- list: The spriteEditorCommand action's params.
graffiti_emissive_overlays
Returns the overlays that light an art's glowing paint on the emissive plane and let its other paint block the glow of whatever lies beneath it.
Paint that doesn't glow gets a blocker of the visible icon, and paint that all glows an emissive of it.
Mixed paint gets the blocker with an emissive of the glow mask just above it. They take the layer of
location, a decal's own, over the glass on a window, moved onto the emissive plane as emissive_appearance()
moves a floor plane layer.
Arguments:
- kind: The art's graffiti_art_glow_kind().
- location: The atom the overlays go on, whose plane offset and layer they take.
- visible: The art's icon, as graffiti_art_icon() draws it, or the sheet holding it.
- mask: The art's glow mask, as graffiti_glow_icon() draws it, or the sheet holding it. Only mixed paint uses it.
- icon_state: The art's state in
visible, "" for a drawn icon. - mask_state: The mask's state in
mask, "" for a drawn icon.
Returns:
- list: The mutable appearances, bottom first.
graffiti_encode_flat
Encodes palette indices as a flat art grid.
A grid is g1 or g2, the number of characters each index takes, then runs: a hex length (1-f) and
the run's index in CUSTOM_SPRITE_INDEX_ALPHABET characters, most significant first. Index 0 is
transparent. Palettes of up to GRAFFITI_MAX_COLORS colours take one character; larger ones, which only
merged art reaches, take two.
Arguments:
- indices: One palette index per pixel, row by row from the top left.
- palette_size: How many colours the indices can reach. 0 allows only transparent pixels.
Returns:
- text: The grid.
- null: The palette size is out of range, or an index isn't a number from 0 to
palette_size.
graffiti_encode_piece
Returns a canonical piece as the text Export writes, format and version first.
Arguments:
- piece: A canonical piece.
Returns:
- text: The piece's JSON.
graffiti_export
Sends a saved piece to a player as a downloaded file. custom_style_send_text() claims the account's transfer slot and export cooldown, which custom styles share.
Arguments:
- user: The player.
- id: The piece's id.
Returns:
- null: The file was sent.
- text: Why it wasn't, safe to show the player.
graffiti_file_key
Returns text made safe to name a file or directory with.
Arguments:
- text: The text, such as a map's name.
Returns:
- text: The text in lowercase, with
_for every character other than a letter or a digit.
graffiti_flat_codes
Returns the characters a flat grid writes, built once, so encoding looks each run's characters up instead of cutting text and calling custom_sprite_canvas_code() for every run, and the glow of art that glows nowhere at each width.
Returns:
- list: The run length characters for 1 to 15, the index digit characters for 0 to 63, then graffiti_unlit_glow() for GRAFFITI_WIDTH and for GRAFFITI_WIDE_WIDTH.
graffiti_flatten
Flattens a piece's layers into one art, or only as much of them as a paint job has revealed.
Arguments:
- piece: A canonical piece.
- upto_layer: The layer being revealed: every layer below it shows fully and none above it. 0 shows the whole piece.
- upto_x: How many columns of
upto_layershow, counted from the left.
Returns:
- list: The art, as graffiti_merge_arts() returns it.
graffiti_flatten_records
Flattens decoded layers into one art, or only as much of them as a paint job has revealed. Nothing is encoded or decoded on the way, so it is graffiti_flatten() for layers already decoded.
Arguments:
- records: Each layer's graffiti_art_decode() record, bottom first, as graffiti_layer_records() or a graffiti workspace's layer_records() make them. A null record is left out.
- width: The layers' width.
- upto_layer: The layer being revealed: every layer below it shows fully and none above it. 0 shows them all.
- upto_x: How many columns of
upto_layershow, counted from the left. - decoded_out: When given, filled with the art's graffiti_art_decode(), from the merge itself.
Returns:
- list: The art, as graffiti_merge_arts() returns it.
graffiti_glow_icon
Returns an art's glow mask: white wherever its paint glows, as opaque as the paint is drawn there.
Masks are cached by graffiti_art_hash() in SSgraffiti.glow_icons, as graffiti_art_icon() caches its icons. Never change one.
Arguments:
- art: The art.
- key: The art's graffiti_art_hash(), when the caller has it.
- use_cache: Whether to take the mask from the cache and keep it there. A sprite sheet takes masks drawn without it, as graffiti_art_icon() explains.
- decoded: The art's graffiti_art_decode(), when the caller has it.
Returns:
- icon: The mask in one state, "".
- null: No paint glows, there is no art, or it can't be decoded.
graffiti_import
Lets a player import a graffiti piece file into their library as a new piece. This sleeps while the file dialog is open.
Arguments:
- user: The player.
Returns:
- null: The piece was imported, or the player cancelled.
- text: Why it wasn't imported, safe to show the player.
graffiti_json_decode
Decodes a graffiti file's JSON, such as a piece's or a map's, as hostile input, without validating what it holds.
json_decode() makes lists of JSON arrays and objects alike, so the text itself must open an object.
Arguments:
- text: The file's text.
- limit: Its size limit in bytes.
Returns:
- list: The decoded JSON object.
- text: Why it can't be decoded, safe to show the player.
graffiti_layer_records
Decodes a piece's layers for graffiti_merge_arts(), each against the piece's whole palette, glowing on every pixel or on none. A paint job keeps its piece's records, so its steps never decode the layers again.
Arguments:
- piece: A canonical piece.
- count: How many layers from the bottom, or 0 for every layer.
Returns:
- list: A graffiti_art_decode() record for each layer, bottom first: the piece's palette, the layer's palette index for each pixel, and its glow on every pixel. Null for a layer whose grid can't be decoded. Never change them.
graffiti_library
Returns an account's library, loading it from its file when it isn't loaded, as on first use or after it unloaded.
Arguments:
- ckey: The account's ckey.
Returns:
- /datum/graffiti_library: The library, kept in SSgraffiti.libraries.
- null: The ckey can't name a library file.
graffiti_library_check
Returns a piece in the canonical form a library keeps, or why a library can't keep it.
The piece is read back from the text Export would write for it, so it is held to that text's size and validated
as an import is, with the format and version Export writes and without keys Export leaves out.
Arguments:
- piece: The piece, such as the editor serializes it or a library file holds it.
Returns:
- list: The canonical piece, as graffiti_validate_piece() returns it.
- text: Why it was refused, safe to show the player.
graffiti_library_delete
Deletes an account's library, file and all, as an admin purge does. A library still held elsewhere is emptied and can't write its file back.
Arguments:
- ckey: The account's ckey.
graffiti_library_flush
Writes the library changes the write pacing still holds back, as the round ends or the world stops.
graffiti_library_paced
Paces an account's next graffiti library write by the one just made: a player's waits GRAFFITI_LIBRARY_WRITE_PACE times as long as it took, and at least a second, and a change the server makes is held back as long.
Arguments:
- ckey: The account's ckey.
- cost: How long the write took, in milliseconds.
graffiti_library_path
Returns where an account's library file lives, in a directory named by the ckey's first character.
Arguments:
- ckey: The account's ckey.
Returns:
- text: The file's path under SSgraffiti.library_root.
- null: The ckey is empty or has a character other than a lowercase letter, digit, underscore or @, so it can't name a file.
graffiti_library_test_reset
Points the graffiti library directory at root, then forgets the test account's library and its write pacing and
deletes the scratch directory, so a test starts and ends with no library files.
Arguments:
- root: The directory library files go under.
graffiti_library_unload
Unloads an account's library as its owner disconnects, unless something still holds it: an editor session or a paint job of the account's, a write the pacing holds back, or an import or export under way. An editor or paint job that ends, and a held write once made, ask again while the owner is away; an import or export doesn't, so its library waits for the owner's next disconnect or the reboot. graffiti_library() loads it again when it is next wanted, under a newer revision.
Arguments:
- ckey: The account's ckey.
graffiti_library_write_due
Whether a player may write their graffiti library now, starting a second's wait if so. Each write rewrites and checks the whole file, so the account's saves, imports and exports share the wait, which is kept beside its style transfer cooldowns, and each write lengthens it by its cost (graffiti_library_paced()).
Arguments:
- ckey: The account's ckey.
Returns:
- TRUE/FALSE
graffiti_library_write_wait
Returns how long until an account's graffiti library may be written again.
Arguments:
- ckey: The account's ckey.
Returns:
- number: The time left, 0 or less once a write is due.
graffiti_merge_arts
Merges arts of one width into one, bottom to top.
An opaque pixel replaces what is beneath it, a translucent one blends over it (graffiti_blend()), and a fully transparent one leaves it alone. A pixel glows when the topmost art that paints it glows there. The merged palette holds only the colours the result shows, in the order its pixels first use them, so arts that look alike merge to the same art. Arts that aren't lists, have another width or can't be decoded are left out.
Arguments:
- arts: The arts, bottom first.
- width: The width of every art.
- owner_out: When given, filled with one entry per pixel: the position in
artsof the art whose paint is topmost there, 0 where nothing is painted. - decoded: When given, each art's graffiti_art_decode() in the same order, so none is decoded again. A null entry is decoded here.
- decoded_out: When given, filled with the merged art's graffiti_art_decode(), from the merge itself.
Returns:
- list: The merged art. With nothing painted, its palette is empty.
- null: The result needs more than GRAFFITI_FLAT_MAX_COLORS colours.
graffiti_merge_fingerprint
Returns a fingerprint of what merging gives: the alpha ceiling and the hash of one fixed merge of opaque and translucent paint, glowing and not, made once. The map file keeps it beside its stack cache, so a cache written before merges changed is set aside rather than show stacks under keys today's merges wouldn't give.
Returns:
- text: The fingerprint.
graffiti_new_sheet
Returns a new sprite sheet for icons of one width. BYOND can't remove a state, so the blank's own transparent state, "", stays beside the states added to it.
Arguments:
- width: GRAFFITI_WIDTH or GRAFFITI_WIDE_WIDTH.
Returns:
- icon: The sheet.
graffiti_palette_pack
Packs canonical colours into one string of nine-character #rrggbbaa entries, the form placed art keeps
its palette in.
Arguments:
- palette: Canonical colours, as graffiti_color() returns them.
Returns:
- text: The packed palette. Opaque colours gain
ff.
graffiti_palette_unpack
Unpacks a palette graffiti_palette_pack() wrote. Only its lowercase spelling is read, so an art has one packed form and one hash.
Arguments:
- packed: Nine-character
#rrggbbaaentries.
Returns:
- list: The canonical colours in order, empty for an empty string.
- null: The length isn't a multiple of nine, or an entry isn't a lowercase colour.
graffiti_poster_look
Returns what a poster offers graffiti, read from its icon pixel by pixel: the pixels it shows, which alone take paint, and the poster itself as an art, for the editor's window to draw beneath the canvas. Kept for each icon and state; a poster drawn at runtime, as a wanted poster is, is read each time.
Arguments:
- poster: The poster.
Returns:
- list: "mask" and "bounds", the editor's draw mask and bounds for its one view; "mask_bits", the mask as a compact
stroke mask's slots (custom_sprite_mask_points()'s
allowed); "outside", the position of each pixel that takes no paint, row by row from the top left; "art" and "decoded", the poster as an art. - null: The poster shows no pixels.
graffiti_poster_test_stroke
Returns a one-pixel pencil stroke on the bottom layer, as the editor's window sends it.
Arguments:
- column: The pixel's column.
- row: Its row, from the top.
Returns:
- list: The spriteEditorCommand action's params.
graffiti_receive
Asks a player for a graffiti piece file and decodes it. This sleeps while the file dialog is open.
The account's transfer slot and import cooldown, which custom styles share, are claimed first and the slot is released on every path. The byte size is checked before the file is read.
Arguments:
- user: The player.
Returns:
- list: The decoded JSON, not yet validated.
- text: Why there is nothing to import, safe to show the player.
- null: The player cancelled.
graffiti_register_anchor_resolver
Lets a system that loads its own spaces, such as condos, place graffiti in them: its anchors are resolved through
callback, called with the anchor and returning a turf or null.
Arguments:
- kind: The anchor kind, such as GRAFFITI_ANCHOR_RESERVED.
- callback: The callback.
graffiti_registry_release
Takes the graffiti of one unloading space off its tiles and keeps it dormant, still in the map file. Call it before the space's turfs change: a decal whose turf stops taking graffiti first loses its graffiti for good.
Arguments:
- kind: The anchor kind.
- key: The space's key in its anchors: their
owner.
graffiti_registry_test_begin
Empties the graffiti registry and points it at a scratch map file, with its sheets in the scratch directory too.
Arguments:
- path: The scratch map file, under data/graffiti_test/.
graffiti_registry_test_end
Empties the graffiti registry, takes the test room down (graffiti_test_room()), puts the registry's test settings back and deletes the scratch directory. The registry points at the current map's own file again but stays frozen, so nothing the rest of a test round does is written over it.
Arguments:
- keep_room: Whether the test room stays up.
graffiti_release_merges
Lets the decals of a piece's tiles go of their merges once its painter stops painting there (release_merges()).
Arguments:
- left_tile: The piece's left tile.
- width: The piece's width.
graffiti_resume_anchor
Returns the anchor a stopped piece resumes on: its left tile's, with the kind of surface its paint went on, which a window fastened over floor paint since doesn't change.
Arguments:
- tile: The piece's left tile.
- packed: One of the piece's placements, packed as SSgraffiti keeps it: the right one when the left tile has no paint.
Returns:
- list: The anchor.
- null: Graffiti on the tile lasts this round only, or the tile offers no surface now, as under a loosened pane.
graffiti_resume_placements
Returns the placements a stopped paint job or freehand session left on a surface, to resume them there: those with its placement id on the tile and, for a two-tile piece, on the tile to its right. They resume only on the same map and the same tile, and only while every tile that showed paint still shows it.
Arguments:
- resume: The Unfinished slot's resume data.
- tile: The tile clicked.
- arts: The art the piece showed on each of its tiles, left first.
Returns:
- list: The left tile's placement, packed, or null, then the right tile's, or null. One of them is set.
- null: The resume data is for another map, tile or width, or paint it left is gone.
graffiti_resume_tile
Returns the tile a stopped paint job or freehand session left its paint on, the only one it resumes on: the left tile of the placements with its placement id that still show on this map.
Arguments:
- resume: The Unfinished slot's resume data, or null.
- ckey: The account that painted it.
Returns:
- turf: The piece's left tile.
- null: No paint of it shows here, so it resumes nowhere.
graffiti_reveal_bounds
Returns how much of a piece shows once a paint job has revealed some of its strips, as graffiti_flatten() takes it.
Arguments:
- piece: A canonical piece.
- progress: Strips revealed.
Returns:
- list: The layer being revealed, every layer below it showing whole, then how many of its columns show from the left. Both are 0 when nothing is revealed, which graffiti_flatten() would take for the whole piece.
graffiti_reveal_units
Returns how a paint job reveals a piece: in strips GRAFFITI_REVEAL_STRIP pixels wide, left to right across each layer in turn, from the bottom layer up.
Arguments:
- piece: A canonical piece.
Returns:
- list: "strips_per_layer", and "total", the strips in the whole piece.
graffiti_shake
Plays a spray can's shake, as a freehand session or a paint job starts.
Arguments:
- user: Who shakes the can.
graffiti_sheet_add
Adds an icon to a sprite sheet as a state of its own, replacing any state of that name.
Arguments:
- sheet: The sheet, from graffiti_new_sheet() at the icon's width.
- new_icon: The icon, as graffiti_art_icon() or graffiti_glow_icon() draws it without their caches, held nowhere else once it is in.
- state_name: The state's name.
graffiti_sheet_path
Returns where one of a map's sprite sheet files lives.
Arguments:
- map_name: The map's name.
- hash: The sheet's hash, from the stack keys it holds and GRAFFITI_ALPHA_CEILING.
- root: The directory every map's sheets go under.
Returns:
- text: The file's path, in the map's own directory under
root.
graffiti_split_wide
Splits a wide art into the arts of its two tiles.
Each half keeps only the colours it shows, in the order its pixels first use them, and glows only where it is painted, as graffiti_merge_arts() would leave it. So a half hashes the same as a one-tile art that looks the same, and two halves that look alike share one hash.
Arguments:
- art: A GRAFFITI_WIDE_WIDTH art.
- decoded: The art's graffiti_art_decode(), when the caller has it.
- decoded_out: When given, filled with each half's graffiti_art_decode(), left first.
Returns:
- list: The left tile's art, then the right one's, each GRAFFITI_WIDTH wide.
- null: The art isn't wide or can't be decoded.
graffiti_spray
Plays the spray sound where paint lands, at most once a clip, however often a sprayer paints.
The sprayer, such as a freehand session or a paint job, keeps the time in its own spray_cooldown, which it passes
in and stores again from the return value.
Arguments:
- at: Where the paint lands.
- cooldown: The sprayer's spray_cooldown: when the last spray sound it played ends.
Returns:
- number: The sprayer's spray_cooldown from now on.
graffiti_static_station
Whether a turf is the station as the map built it, the only place graffiti goes: a station level's turf in a station area, neither a shuttle's nor the holodeck's, and outside every map template loaded on the station this round, such as a random room. Other levels, bitrunning and reserved space, ruins and the like take none. A system that loads spaces of its own, such as condos, registers an anchor resolver for them instead (graffiti_register_anchor_resolver()).
Arguments:
- tile: The turf.
Returns:
- TRUE/FALSE
graffiti_station_levels
Returns the station levels in ascending order.
Returns:
- list: The z levels.
graffiti_station_ordinal
Returns where a z level falls among the station levels, which anchors keep instead of the z level itself.
Arguments:
- z_level: The z level.
Returns:
- number: Its position among the station levels in ascending order, 0 when it isn't one.
graffiti_station_z
Returns the station level at an anchor's ordinal.
Arguments:
- index: The ordinal, a position among the station levels in ascending order.
Returns:
- number: The z level, 0 when no station level is at that position.
graffiti_surface_full
Whether adding a piece would exceed the tile's stack. Resuming a piece already there needs no new slot.
graffiti_surface_kind
Returns the kind of surface a turf offers graffiti: a wall, the glass of a full-tile window fastened down on it, or a floor with ground. A loose full-tile window still covers its floor, and a directional window changes nothing.
Arguments:
- tile: The turf.
Returns:
- GRAFFITI_KIND_WALL, GRAFFITI_KIND_WINDOW or GRAFFITI_KIND_FLOOR
- null: The turf takes no graffiti.
graffiti_surface_ok
Whether a turf takes graffiti: a wall, a floor with ground, or a full-tile window fastened down on it, on the static station (graffiti_static_station()).
Arguments:
- tile: The turf.
Returns:
- TRUE/FALSE
graffiti_test_art
Returns a one-tile art with one or two red pixels.
Arguments:
- pixel: A painted pixel that doesn't glow, counted row by row from the top left.
- lit: A painted pixel that glows, or 0 for none.
Returns:
- list: The art.
graffiti_test_cameras
Counts the cameras on the station levels.
Returns:
- number: The cameras.
graffiti_test_chunk_turfs
Returns tiles of the test room (graffiti_test_room()) that take graffiti under a station anchor, all in one of the 16-tile chunks build_sheets() packs together, the same ones every call.
Arguments:
- count: How many.
Returns:
- list:
countturfs of the first chunk that has that many, or an empty list when none has.
graffiti_test_counts_match
Whether a graffiti workspace's colour counts hold what its layers do, read pixel by pixel.
Arguments:
- workspace: The workspace.
Returns:
- TRUE/FALSE
graffiti_test_dense_art
Returns a one-tile art painted on every pixel, no two neighbours alike, from forty colours, every other pixel glowing, so its composite and glow mask take as many runs as a tile's art can. The same index gives the same art.
Arguments:
- index: Which art.
Returns:
- list: The art.
graffiti_test_floors
Returns floors of the test room (graffiti_test_room()), where graffiti gets a station anchor.
Arguments:
- count: How many floors.
Returns:
- list: Up to
countfloors, the same ones every call.
graffiti_test_golden_piece
Returns a fixed piece for the flattened-bytes test: an opaque red base on rows 1-30, a translucent green glowing layer on rows 9-16 and a translucent white unlit one on rows 13-20, so it blends translucent over opaque and translucent over translucent, and its glow is mixed.
Returns:
- list: The piece, as graffiti_validate_piece() returns one.
graffiti_test_index_problem
Compares the registry's index of each account's placements with a scan of the placements themselves.
Returns:
- text: What differs.
- null: Nothing does: every placement is indexed with the fields admin search, admin deletion and saving read, under
its account with its art counted, and each account's placements are in the order its caps evict them, oldest first,
then as
placementsorders them.
graffiti_test_mounted
Whether anything wall-mounted is on a wall or on the turfs beside it, where it may hang from the wall.
Arguments:
- wall: The wall.
Returns:
- TRUE/FALSE
graffiti_test_piece
A raw piece as Export writes it: an opaque and a translucent pixel at the top left of an unlit layer, under a glowing layer with one translucent pixel at the bottom right.
graffiti_test_placement
Finds a placement by its id.
Arguments:
- pid: The placement's id.
- where: Packed placements to look through, such as SSgraffiti.dormant.
Returns:
- list: The unpacked placement.
- null: None of them has that id.
graffiti_test_room
Returns the room the graffiti tests paint in, built the first time a test asks and taken down by graffiti_registry_test_end(): walls round floors, with a row of GRAFFITI_TEST_ROOM_ROW walls across them, built on empty space of a station level and moved into a station area, so its every tile takes graffiti under a station anchor. No map is relied on to have such walls, as the unit test map, runtimestation_minimal, is all space. The room sits inside one of the 16-tile chunks build_sheets() packs together.
Returns:
- list: The room's turfs, from the south-west corner, west to east, then row by row north.
- null: No station level has empty space for it.
graffiti_test_room_end
Takes the graffiti test room down, if a test put it up: deletes all a test left in it, then turns it back into the space of the space area it was.
graffiti_test_walls
Returns walls side by side, west to east, in the test room (graffiti_test_room()), each between two floors so that turning one into a floor opens no room to space, and with nothing wall-mounted on it or around it. The same walls come back every call.
Arguments:
- count: How many walls, up to GRAFFITI_TEST_ROOM_ROW.
Returns:
- list: The walls.
- null: There aren't that many, or no room.
graffiti_tile_decal
Returns the custom graffiti decal of the surface a turf offers now.
Arguments:
- tile: The turf.
- create: Whether to make the decal when that surface has none.
Returns:
- /obj/effect/decal/cleanable/crayon/custom: The decal.
- null: The turf takes no graffiti, or its surface has no decal and none could be made.
graffiti_trim_wide
Narrows a two-tile piece to one tile when no layer paints its right tile, as a wide canvas left blank there saves.
Arguments:
- piece: A canonical piece. It is never changed.
- grids: Its layers' grids decoded, as graffiti_validate_piece() has them, or null to decode them here.
Returns:
- list: A new piece GRAFFITI_WIDTH wide, each layer's grid cut to its left columns.
- list:
pieceitself, when it is one tile wide, paints its right tile or can't be decoded.
graffiti_unix_time
Returns the current unix time in whole seconds, as the ten-digit text libraries store and sort. BYOND numbers can't hold it exactly.
Returns:
- text: The seconds.
graffiti_unlit_glow
Returns the glow of art that glows nowhere, as graffiti_encode_flat() writes it and decoded, which graffiti_flat_codes() makes once for each width, so decoded arts that glow nowhere share one list.
Arguments:
- width: GRAFFITI_WIDTH or GRAFFITI_WIDE_WIDTH.
Returns:
- list: The encoded glow, then its pixels, all 0. Never change them.
graffiti_validate_piece
Strictly validates a library piece, as Export writes it and Import reads it. Nothing is salvaged, and messages never repeat uploaded text.
The id, created and updated keys the library keeps beside a piece are allowed and ignored. Names
and the description are cleaned rather than refused.
Arguments:
- raw: The decoded piece.
Returns:
- list: The canonical piece:
name,description,width,paletteandlayers, each layer aname,glowand re-encodedgrid. Its colours are graffiti_color()'s, and a two-tile piece that paints nothing on its right tile comes back one tile wide (graffiti_trim_wide()). - text: Why the piece was refused, safe to show the player.
graffiti_wide_ok
Whether a two-tile piece fits with its left half on a turf: the turf and the one to its east both take graffiti, on the static station, and are of one kind, both walls, both floors or both windows, which draw their graffiti differently.
Arguments:
- tile: The left tile.
Returns:
- TRUE/FALSE
graffiti_window_of
Returns the full-tile window fastened down on a turf, whose glass takes graffiti. Directional windows never do.
Arguments:
- tile: The turf.
Returns:
- /obj/structure/window: The window.
- null: No anchored full-tile window is on the turf.
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.
has_blood_flag
Checks if any of the passed blood types have certain blood flags
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.
hidden_slots_to_inventory_slots
Convers HIDEX to ITEM_SLOT_X, should be phased out in favor of using latter everywhere later
holosynth_drop_unkept_items
Drops everything the holosynth has equipped except items in the slots they get to keep (ID + pockets).
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"
husk_toned_sheet
Returns an icon sheet toned the way a husk is drawn.
Toning works on the whole sheet, every state in it, so a sheet from a file is toned once and its copy kept, one per file: as bounded as the icon files are. A runtime icon or an /icon datum could hold any pixels and is toned afresh every time.
Arguments:
- sheet - The icon to tone: a file, a runtime icon in the resource cache or an /icon datum.
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 whether a given icon state exists in a given icon file. If file and state both exist,
this will return TRUE - otherwise, it will return FALSE.
If you want a stack trace to be output when the given state/file doesn't exist, use
/proc/icon_exists_or_scream().
icon_exists_or_scream
Functions the same as /proc/icon_exists(), but with the addition of a stack trace if the
specified file or state doesn't exist.
Stack traces will only be output once for each file.
icon_metadata
Returns rustg-parsed metadata for an icon, universal icon, or DMI file, using cached values where possible Returns null if passed object is not a filepath or icon with a valid DMI file
icon_states_fast
Cached, rustg-based alternative to icon_states()
icon_transformer_from_list
Reverse operation of /datum/icon_transformer/to_list()
iconforge_drawn
A drawing is done: a character preview's, or share of one for a smaller picture, like the custom sprite editors'.
iconforge keeps every image it makes until it is told to let them go, and a look is hardly ever drawn twice, so what
it keeps only grows, by 80 to 330 KB a look. Every CHARACTER_PREVIEW_CLEANUP_EVERY looks' worth it lets go, once no
character preview is under way: one under way would come out empty. Until then new previews wait, for a tick or
two, and the last preview under way lets go when it is done. Spritesheets being made let go themselves once they
are done, so it waits for them to finish.
inLineOfSight
Calculate if two atoms are in sight, returns TRUE or FALSE
init_Exports
Called when the global exports_list is empty, and sets it up.
init_blood_types
Initializes the list of blood type singletons
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_discountable_packs
Caled when the global discount pack list is initialized
init_fitness_definition_sheets
Returns GLOB.fitness_definition_sheets.
init_fitness_limb_families
Returns GLOB.fitness_limb_families, built from the size subtypes.
init_fitness_limb_sheets
Returns GLOB.fitness_limb_sheets. Sheets are files, so it is built here rather than written as a list literal.
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_main_girder_wall_recipes
Initializes the main, false and tram wall types using three lists of wall types.
init_material_girder_wall_recipes
Initializes the normal and false girder material wall recipes using two lists of material wall types.
init_pirate_gangs
initializes the pirate gangs glob list, adding all subtypes that can roll today.
init_plant_traits
Inits GLOB.plant_traits
init_random_ship_events
Initializes the random ship events glob list, adding all subtypes that can roll this shift.
init_subtypes
Creates every subtype of prototype (excluding prototype and abstract types) and adds it to list L. If no list/L is provided, one is created.
init_subtypes_w_path_keys
Functions like init_subtypes, but uses the subtype's path as a key for easy access If no list/L is provided, one is created.
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_color_dark_with_saturation
Given a color in the format of "#RRGGBB", will return if the color is dark. Value is mixed with Saturation and Brightness from HSV.
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_factual_sprite_accessory
This will check if SSaccessories.sprite_accessories[mutant_part]?[part_name] is associated with sprite accessory with factual TRUE.
is_file_type
Verifys wether a string or file ends with a given file type
this does not at all check the actual type of the file, a user could just rename it
Arguments:
- file - A string or file. No checks for if this file ACCTALLY exists
- file_type - A string to check against [e.g. "ogg"]
is_file_type_in_list
Verifys wether a string or file ends with a given file type.
this does not at all check the actual type of the file, a user could just rename it
Arguments:
- file - A string or file. No checks for if this file ACCTALLY exists
- file_types - A list of strings to check against [e.g. list("ogg" = TRUE, "mp3" = TRUE)]
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_mononym
Find whitespace or dashes in the passed string with regex and returns TRUE if found
is_mutation_restricted_for_quirks
Helper proc to check if a mutation is restricted by any of the given quirk names Returns TRUE if the mutation is restricted (not allowed), FALSE otherwise
is_mutation_restricted_for_species
Helper proc to check if a mutation is restricted for a given species Returns TRUE if the mutation is restricted (not allowed), FALSE otherwise
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_plain_bodypart_mask
Whether a bodypart appearance is a standard glow/blocker sprite that can move into a shared emissive boundary. Inset husk blood, other composite effects and prepared boundaries keep their own roots.
is_plain_bodypart_sprite
Whether a bodypart appearance draws the same nested in an unshifted holder as it does on the mob: floating, default blending, and not reaching past its parent with KEEP_APART or RESET_* flags. Iconless holders such as inner ears and MOD textures qualify; their contents are unchanged.
is_safe_turf
Checks to see if a given turf is a "safe" location. Being safe requires the following to be true:
- Must be a floor
- Must have air, and that air must have [breathable bounds][/proc/check_gases] for humans
- Must have goldilocks temperature
- Must have safe pressure
Optionally:
- extended_safety_checks: Will make additional checks for turfs that technically pass all previous requirements but still may not be safe
- dense_atoms: Must be unobstructed (no blocking objects such as machines, structures or mobs)
- no_teleport: Must not have [NOTELEPORT][/area/var/area_flag]
Returns TRUE if all conditions pass, FALSE otherwise.
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_symphony_whitelisted
Admission check: allow access when enforcement is disabled; deny on a database failure. Use symphony_whitelist_lookup() when the caller must distinguish a denial from an outage.
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 (closest to our type) in the list instead of just returning true when a match is found.
- return_first_match: If zebra is true, this will return the first match found, instead of the value of closest type
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_uppercase
Checks if the passed string is all uppercase, ignoring punctuation and numbers and symbols
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_wire_tool
Is the passed item a tool that would interact with wires?
Arguments:
- tool - The item to check.
- check_secured - If TRUE, and the item ends up being an assembly, we will only return TRUE if the assembly is not secured. "Secured" is used to indicate an assembly that may have a use outside of wire interactions, so we don't want to falsely identify it as a wire tool in some contexts.
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
keep_hairstyle
Writes a hairstyle to the character slot this body spawned from, and saves it to disk.
Returns a player-facing problem, or null once saved.
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
language_understanding_sample
A sample line in a language, as heard by someone who follows this much of it. Kept, so a level's sample stays put.
last_name
Find the last name of a mob from a passed string with regex
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
list_holy_successors
Create a list of the holy successors mobs from GLOB.holy_successors weakref list
Returns the list of valid holy successors
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.
load_whitelist
Loads the whitelist. Tries to load it from the database if enabled, otherwise will load it
from the legacy whitelist.txt file as normal.
load_whitelist_legacy
Loads the whitelist with the legacy way of loading it (from the whitelist.txt file).
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_blood_worm
Logs blood worm events like entering/leaving a host.
log_bomber
Logging for bombs detonating
log_borer_evolution
Logging for borer evolutions
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_creator
This logs character creator changes in debug.log
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_law_change
Adds something to the law change log
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_minimap_drawing
Logging for drawing on minimap
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/persistent_client 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_player_image_creation
Log the creation of an image by a player
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_reta
Request Emergency Temporary Access - RETA System Provides temporary department access when Requests Console emergency calls are made. Helper function for RETA-specific logging
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_subtle
This logs subtle emotes in game.log
log_subtler
This logs subtler emotes in game.log, if the conflig flag in config\nova\config_nova.txt is true.
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_tts
Logging for TTS
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_exposed_wound_bonus- The exposed_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.
lowercase_title
Ensures text does not start with capital letters.
make_associative
Make a normal list an associative one
make_body
Uses stripped down and bastardized code from respawn character
make_datum_reference_lists
//Initial Building/////
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_knowledge_id
ID's are not unique, the same knowledge with the same type in the same shop will always have the same ID.
make_mutable_appearance_directional
Takes an input mutable appearance, returns a copy of it with the hidden flag flipped to avoid inheriting dir from what it's drawn on This inheriting thing is handled by a hidden flag on the /image (MAs are subtypes of /image)
make_tuple
Returns the name of the mathematical tuple of same length as the number arg (rounded down).
marking_fur_colors
Returns the three mutant colours a marking can follow, as a body's DNA features hold them: what a new marking, a preset or a colour reset gives it.
Returns:
- list: three "#rrggbb" colours, or null without features.
markings_baseline_fill
Builds the fixture's marking map in the nested shape a savefile holds: zone -> (marking name -> list(color, emissive)).
Every zone in GLOB.marking_zones receives all three fixture markings. Only the second one emits, so a test covers both the plain and the emissive branch of append_base_marking_overlays(). Callers load it through body_marking_collection_from_list(), the way a saved character's markings arrive, and replace the whole collection with it, so a species randomiser that already seeded a zone cannot leave a stray entry behind.
Returns a new list.
markings_baseline_is_glowing
Tells a glowing emissive appearance from an emissive blocker, which shares its plane.
Every emissive colour matrix writes its glow into the constant row, and a blocker leaves that row at zero (see _EMISSIVE_COLOR() and _EM_BLOCK_COLOR()).
Arguments:
- overlay: an appearance already known to sit on the emissive plane.
Returns TRUE when the appearance glows.
markings_baseline_marking_colors
One fixed colour per fixture marking, so no signature ever depends on a mutant colour roll.
markings_baseline_marking_names
Fixtures the body marking tests share: the markings a test body wears and their colours, the standard and merge fills, a rendered icon's pixel signature and the emissive glow check. Their names come from the before/after baselines the markings datumisation was measured with. The markings the fixture wears. Each one claims all eight marking zones and ships art for every one of them plus both leg shapes, so no case falls back to a sheet's default frame and hides a difference. Named explicitly rather than read out of GLOB.body_markings_per_limb, whose order can change.
markings_baseline_signature
Reduces a rendered icon to one comparison key.
Every pixel of every cardinal folds into a single md5, so a colour-only change is caught where difference().getbbox() would miss it. The canvas size travels with the hash so a later run can never silently compare a differently sized render.
Arguments:
- canvas: the icon to reduce, normally from get_flat_icon_for_all_directions().
Returns a list holding the hash and the canvas shape.
markings_merge_fixture_color
The one colour every marking of the merge fixture wears.
markings_merge_fixture_fill
Builds the merge fixture's marking map, in the same nested shape as markings_baseline_fill(): the same three markings on every zone, all in one colour and all glowing. Each zone's markings then run together in colour and in glow, which the standard fixture, three colours with one glow per zone, never does. Its tests draw a zone's same-coloured markings, and its glows, as one.
Returns a new list.
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. https://www.byond.com/forum/post/2611357
merge_body_marking_run
Draws a run of markings, or of glows, with its first appearance as drawn into the output list, a dropped limb's image of it included: that appearance takes the run's blended icon and keeps its own colour, alpha, layer, plane, flags and facing, so it draws what the run's appearances drew one on another.
The blended icon holds the run's states blended uncoloured, in order, on a canvas of their sheets' size in all four cardinals. Its key, the parts joined by "|", is colour-free, so every body drawing the same states shares it, in any colour and husked or not. Built on a cache miss, into a bounded cache. The blend sits under a state named by the key as well. An appearance reads its runtime icon back as empty text, and the leg split keys its masked halves by that text and the appearance's state (handle_masking()), so only the state tells two runs apart there. The same content keys keep custom paint's own leg split safe (appearance.dm).
Arguments:
- first: the run's first appearance in the output list, built for this render.
- parts: the run's sheets and states, alternating, in drawing order. Its sheets share one size.
meridian_theme_art
Returns the art asset a MeridianOS theme draws with outside tgui's bundle, or null for a theme whose art is all in it.
Arguments:
- theme: A MeridianOS theme ID (the meridian_theme preference's value).
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
metal_transmute
Change the material type of an object or turf, but with visuals and effects related to the material
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.
mix_colors_by_volume
Returns the volume-weighted RGB mean of a colour to volume list, as "#rrggbb" with alpha ignored, or null when it holds no volume.
mix_liquid_color
Returns the volume-weighted RGB mean of a reagent type to volume list, as "#rrggbb".
Each reagent counts with its initial(color), alpha ignored: a pool's alpha comes from SSliquids.get_pool_alpha(). Liquids hold reagents by type, which can't tell blood types apart, so blood counts with blood_color when it is set.
Arguments:
- reagent_list: Reagent type to volume.
- blood_color: Colour of the blood in the list. Null draws blood in the blood reagent's own colour.
Returns:
- null: The list holds no volume.
mix_opacity_from_reagent_list
Returns the volume-weighted liquid_opacity of a reagent type to volume list, from 0 (clear) to 1 (opaque).
mob_only_listeners
A filter to be applied to get_hearers_in_x, that removes any non-mob hearers, converting them to their relevant mob if one exists (such as dullahan heads). Modifies input list.
mobs_in_area_type
Takes: list of area types Returns: all mobs that are in an area type
modular_persistence_account_key
Normalizes an admitted or cryo account key, including aghost's prefix. An absent key has no save identity.
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_all_banned_players
Notifies all banned players about their ban and gives them a link to appeal from the config. If it was a server ban, it also kicks them.
If the banned player's ckey has a linked client on the server, it notifies them of the ban details and kicks them if it was a server ban. If there is anyone else sharing the banned player's IP or CID, it notifies them of the ban details and kicks them if it was a server ban.
Builds the ban cache for every client impacted by the ban.
Arguments:
- banned_player_ckey - The ckey of the banned player.
- banned_player_ip - IP address of the banned player.
- banned_player_cid - CID of the banned player.
- banned_player_message - The message to show to only the specifically banned player.
- banned_other_message - The message to show to any other players who share the banned player's IP or CID.
- kick_banned_players - TRUE if we want to kick affected players, FALSE otherwise. This should generally only be TRUE for server bans.
- applies_to_admins - TRUE if this ban applies to admins and we may need to kick them, FALSE otherwise.
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
offer_to_keep_hairstyle
Asks the freshly cut recipient whether to keep the style beyond this round.
Sleeps on the prompt, so call it asynchronously and let the barber carry on. Says nothing when the style already matches what they spawn with.
- recipient - whose hair was cut, and who gets asked.
- hairstyle - the style that was just applied.
- facial - it was their facial hair that changed.
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
onclose
Registers the on-close verb for a browse window (client/verb/windowclose) this will be called when the close-button of a window is pressed.
This is usually only needed for devices that regularly update the browse window, e.g. canisters, timers, etc.
windowid should be the specified window name e.g. code is : user << browse(text, "window=fred") then use : onclose(user, "fred")
Optionally, specify the "source" parameter as the controlled atom (usually src) Otherwise, the user mob's machine var will be reset directly.
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
painting_pixels_from_icon
The painting store's pixel string: every pixel of the drawing, row by row, as the canvas grid writes them.
painting_store_failure
Build the common failure envelope used by the DM transaction queue and native calls.
params2screenpixel
Converts a screen loc param to a x,y coordinate pixel on the screen.
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.
phase_filter
Cool filter that I'm using for some of this :)))
pick_closest_path
Returns a chosen path that is the closest to a list of matches
pick_holy_successor
Chooses a valid holy successor from GLOB.holy_successor weakref list and sets things up for them to be the new high priest
Returns the chosen holy successor, or null if no valid successor
pick_n
Picks n items from a list. The same index will not be chosen more than once. e.g. pick_n(list_of_stuff, 10) would return a list of 10 items from the list, chosen randomly.
pick_n_take
Pick a random element from the list and remove it from the list.
pick_recursive
Similar to pick_weight_recursive, except without the weight part, meaning it should hopefully not take up as much computing power for things that don't +need+ weights.
-
- Able to handle cases such as:
- pick_recursive(list(a), list(b), list(c))
- pick_recursive(list(list(a), list(b)))
- pick_recursive(a, list(b), list(list(c), list(d)))
- pick_recusrive(list(a, b, c), d, e) Really any combination of lists & vars, as long as the passed lists aren't empty
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_weight_take
- Like pick_weight, but decreases the value of the picked element by 1
- For example, given the following list:
- A = 6, B = 3, C = 1, D = 0
- A would have a 60% chance of being picked, after which it would decrease by one and the new list would be
- A = 5, B = 3, C = 1, D = 0
- Tt would then have a 55.55...% to be picked, rinse and repeat
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.
- volume_preference - Optional: Will be checked to modify the volume of the sound for each listener.
- min_volume - minimum volume the sound can reach at max_range.
playsound_if_pref
playsound_if_pref is similar to playsound but it doesn't play for ghosts, and checks for prefs.
This is useful if we have something like the organic interface content, which everyone may not want to hear.
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). falloff_distance - Distance at which falloff begins. Sound is at peak volume (in regards to falloff) aslong as it is in this range. ignore_walls - Whether or not the sound can pass through walls. pref_to_check - the path of the pref that we want to check - defaults to /datum/preference/toggle/erp/sex_toy_sounds
playsoundtoken
Creates a soundtoken datum (a sound that updates for movement). allowed_listeners is an optional list of mobs that are the only ones that can hear this sound ever. sound_length is an optional length of the sound. Things like TTS need to pass this since we can't dynamically grab the length in that case.
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_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.
populate_interaction_instances
Global loading procs
populate_reta_job_trims
Populates the job trims list for RETA system
populate_rtd_datums
Lazy-initialize the datum field on all the designs
populate_virtual_areas
Constructs the list of virtual areas
power_fail
Disables power in most station APCs temporarily
- duration_min - the minimum duration of the power failure in seconds (not deciseconds)
- duration_max - the maximum duration of the power failure in seconds (not deciseconds)
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.
prefs_import_admin_backup
Staff backups are retained until explicitly removed; never overwrite a numbered backup after a gap.
prefs_import_backup
Player backups rotate independently of retained staff/legacy backups.
prefs_import_clean_assoc_paths
We just guarantee the shape, the owning loaders resolve them.
prefs_import_clean_loadout
The UI encodes and caps these, the load path doesn't, so we redo it here.
prefs_import_clean_loadout_presets
loadout_lists is preset -> path -> details, so unwrap a level first.
prefs_import_clean_text_list
Lists consumed as text/type names by raw loaders must not carry numeric indexes or nested collections.
prefs_import_invalidate_cache
After successful replacement, old UI/disconnect callbacks must only write to memory.
prefs_import_pass1
Pass 1. Retains character migration inputs. Player imports may only replace player-owned root fields. Supplying local_player_data enables the player allowlist; staff may still restore a complete backup.
prefs_import_player_root
Registered preferences plus raw player settings and inputs still used by supported migrations.
prefs_import_prevalidate
Structural checks. Returns an error string, or null if it's fine.
prefs_import_read_upload
Shared upload validation. Policy-specific metadata filtering happens after this succeeds. Returns an error, or the decoded tree and byte count; never logs uploaded JSON or decoder exceptions.
prefs_import_replace
Write and verify the candidate before touching the destination. Returns an error, or null on success.
prefs_import_strip_empty_keys
Pass 1 and native migrations produce unique path keys; copy only to remove empty keys, preserving shared lists.
prefs_import_strip_empty_loadout_keys
Migration leaves null keys behind, and sanitize_loadout_list stack_traces on them.
prefs_import_tree_too_deep
Check depth iteratively so a deeply nested upload cannot overflow the call stack.
prepare_bodypart_overlays
Prepares the final bodypart or hair slot, where direct glow/blocker masks already have their centering and height adjustments. Each mask moves inside a neutral emissive boundary so rotation does not depend on icon size; masks sharing a plane and layer share one boundary. Plain visible sprites sharing a layer share one holder. Only the mob's top-level overlays count toward MAX_ATOM_OVERLAYS, and a matrixed accessory otherwise spends a sprite and a mask per colour slot on every layer it draws.
Draw order is kept: an entry that cannot join stays in place, and later entries at its layer start a new boundary or holder. Shared limb-cache appearances are copied or nested, never modified. Prepared roots cannot join again and single sprites are not wrapped, so repeating the pass adds nothing.
Arguments:
- bodypart_overlays - the BODYPARTS_LAYER or HAIR_LAYER cache entry, a list or a single appearance
Returns a new list for the cache.
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
preview_animated_leaves
The animated icon states a flat icon draws, and where: list(list(leaf, x, y), ...), with the leaf's lower left pixel at (x, y) of the flat's own canvas. In a walk's recipes only crops move what is already drawn; an animated leaf that anything else would move is left out, and drawn still.
preview_animation_difference
White where two icons, each split by preview_animation_split(), differ, and black where they don't.
preview_animation_fewer_steps
The same steps, with only keep after the first: dropped evenly, each kept one shown for the time of those after it.
preview_animation_frames_at
What frame each of a region's leaves shows time ms into its animation: leaf number -> frame.
preview_animation_mark_frames
Marks animated leaves in a detached to_list() recipe, using their source identities to keep shared leaves on the same track. The source tree and its transformer lists remain untouched.
preview_animation_reading
A reading of an animated icon state, or null for one that is drawn still without reading it.
preview_animation_split
An icon as two opaque icons that differ wherever it does: its colours, and its alpha in grey. Uses up source.
preview_animation_steps
A region's animation as steps, list(list(start, ms), ...): from the start, each time any of its leaves shows something new, when, and for how long, in ms. The leaves start together and come round together once all their loops have, or at CHARACTER_PREVIEW_ANIMATION_MAX_PERIOD. The first step is every leaf's first frame, the facing as drawn; see preview_animation_frames_at() for the others.
preview_animation_tokens
A recipe marked for patches, split where each fills in its own numbers: the pieces between, and in place of each number a code for it: 0 for the facing's dir, a leaf's number for its frame, and -1 to -4 for the crop's x1, y1, x2 and y2.
preview_animation_track
One leaf's frames in a facing, as the steps of preview_animation_steps() read them: list("leaf" = its number, "frames" = each frame it shows in turn, "starts" = when each starts, in ms, "shows" = whether each looks different from the one before it, the first from the last, "cycle" = how long they take in all).
preview_state_animated
Whether an icon state has more than one frame, from its file's metadata, remembered by file and state.
previous_list_item
Returns the previous item in a list
print_command_report
Print a report to all the communications consoles, and optionally send an announcement to players about it. This is used for the roundstart report, but can also be used for other reports in the future.
- text - the text of the report to print
- title - the title of the report, which is also the name of the printed paper. If null, defaults to "Classified [command_name()] Update"
- announce - whether or not to send an announcement to players about the report being printed. Defaults to TRUE.
- contains_advanced_html - whether or not the text contains advanced HTML that should be rendered on the paper.
Advanced HTML (currently) only includes
tags, but may include other tags in the future. Do not allow player inputted reports to contain advanced HTML. Defaults to FALSE, which means only basic HTML will be rendered.
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_chat_color
Converts a given color to comply within a smaller subset of colors to be used in runechat. If a color is outside the min/max saturation or lum, it will be set at the nearest value that passes validation.
Arguments:
- color - The color to process
- 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
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.
-
- Category 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_human_blood_type
Returns one of the human blood types at random, weighted by their rarity
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
ratvar2text
Reverts ravarian styling and rot13 in text.
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
reagent_explode
Generic explosions/failures
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
recoil_camera
Helper proc for a similar function to shake_camera, expect this one kicks the camera back at an opposite angle rather then skake_camera's irratic jittering.
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
recurse
Exists to trigger infinite recursion runtimes in testing
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.
Arguments
- atom/movable/target - the atom whos loc we are checking for
- type - the location(typepath or solid atom) the target maybe stored in
reebe_station_warning
Tells the station that there's a clockie portal, along with making it usable by all
refresh_jukebox_songs
Recache the songs from config then force replace all the songs.
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.
- cap_at_start - capitalize the start of words. False is good for modular computer file names.
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_erp_things
If the "Remove ERP Interaction" config is disabled, remove ERP things from various lists
remove_faded_filters
Removes filters once they've faded out, skipping any that were replaced in the meantime
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_synth_defib_trauma
Global timer proc used in defib.dm. Removes the temporary trauma caused by being defibbed as a synth.
Args:
- obj/item/organ/brain/synth_brain: The brain with the trauma on it. Non-nullable.
- datum/brain_trauma/trauma: The trauma itself. Non-nullable.
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.
render_species_facings
Adds a render of the dummy facing each way to entries, in the page's turning order.
replace_icon_legs
Cuts the legs (y 1-11) off a worn icon and staples new_legs on.
Upstream replaced this with apply_icon_mask(LEGS_MASK), which only cuts y 1-9. The big legs and vox leg templates are drawn to replace all 11 rows, so the upstream cut leaves stray human thigh pixels around them.
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_religion
It's time to kill GLOB Reset religion to its default state so the new chaplain becomes high priest and can change the sect, armor, weapon type, etc Also handles the selection of a holy successor from existing crew if multiple chaplains are on station.
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.
reta_find_and_grant_access
Finds eligible responders and grants them temporary access
reta_get_user_department
Gets the department string for a user based on their job
reta_get_user_department_by_name
Gets the standardized department string from a console department name
reta_init_config
Initialize RETA config values
reta_on_cooldown
Checks if an origin department is on cooldown for calling a target department
reta_push_ui_updates
Pushes UI updates to all consoles in the same origin department
reta_set_cooldown
Sets a cooldown for an origin department calling a target department
reta_track_call
Tracks recent emergency calls for multiple department analysis
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_escape_shuttle
Docks the emergency shuttle back to the station and resets its state
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_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
round_blood_for_hud
A helper for getting the appropriate icon state for the blood hud.
round_timestamp
Returns timestamp since the round started, AKA Pay Time (PT)
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.
sample_fabric_colour
The cloth colour of a worn sprite, as the approved previews sample it: every opaque pixel of rows 21-24, columns 12-18 facing south (GetPixel() x 13-19, y 11-8), tinted (each tint rounds half to even), stable-sorted by Rec. 601 luma; the upper median. Cached by file, state, tints and source revision; a sprite that is neither a file nor text is sampled without being cached. Null when nothing opaque is there.
sanitize
Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
sanitize_alt_job_titles
Keep only entries whose job title and alternative title are text. get_alt_job_title() handles job validation; SSjob may not be initialized while preferences load.
sanitize_augment_colors
Returns colors lowercased when it is four "#rrggbb" colours run together, else null. It runs only as a save loads and on
the editor's actions, so its regex is made each time rather than kept.
Arguments:
- colors: Anything: a save's entry, an action's parameter.
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_language_understanding
Saved levels read back: known language types only, each snapped to a step and kept within range. Null if none.
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.
scale_liquid_color
Returns a mixed pool colour scaled by its surface class's LIQUID_COLOR_FACTOR_*, as "#rrggbb".
Arguments:
- mixed_color: The pool's reagent mix, from mix_liquid_color().
- surface_class: The pool's LIQUID_SURFACE_* class.
Returns:
- null: mixed_color is null (a mix with no volume).
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.) @param immediate_load If TRUE, loads the placed ruins' maps in right away instead of leaving them queued in SSmapping.reserved_ruins for terrain generation to run first. Only safe to use outside of the roundstart mapping init sequence, once terrain generation has already finished.
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_clock_message
Send sent_message to all other clock cultists and ghosts from the user
send_department_ooc
Validates and sends a message to a departmental OOC channel.
Applies channel access, OOC bans, mutes, and chat filters. Admins bypass membership, channel disables, and moderation mutes.
Arguments:
- sender - the client speaking
- channel_key - key into [GLOB.department_ooc_channels]
- msg - the raw, unsanitised message
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_status_display_alert
Send an emergency alert signal to all status displays alert_type: The picture state to display ("biohazard", "lockdown", "radiation", etc.)
send_status_display_biohazard_alert
Send a biohazard alert signal to all status displays
send_status_display_lockdown_alert
Send a lockdown alert signal to all status displays
send_status_display_radiation_alert
Send a radiation alert signal to all status displays
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
server_timestamp
Returns UTC timestamp with the specifified format, with optionally deciseconds or optional IC time (year offset), AKA Nanotrasen Standard Time (NST)
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
set_owned_masked_leg_icons
Publish or evict a finalized masked-leg pair and its exact native dimensions together. The caller must finish icon mutation before publishing. Existing cache entries are immutable. Retain the replacement before releasing the old pair, including when they share icons. Raw cache writes/removals must use this proc so metadata does not outlive its owning cache.
set_protean_modsuit
Sets the protean modsuit on a mob's chest component. Returns TRUE on success.
setup_clockwork_research
Returns a list of every initialized clockwork research datum
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
sheets_from_value
Convert a raw material amount into "SHEET_MATERIAL_AMOUNT", or "* N", with rounding rules.
should_border_obj_smooth
Helper proc for smoothing border objects. Return this from smoothing_allowed() to get the desired effect Indexes into some global lists that encode direction bullshit
should_have_space_before_emote
Returns a boolean based on whether or not the string contains a comma or an apostrophe, to be used for emotes to decide whether or not to have a space between the name of the user and the emote.
Requires the message to be HTML decoded beforehand. Not doing it here for performance reasons.
Returns TRUE if there should be a space, FALSE if there shouldn't.
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 acts on list in place, and returns same list
silent_alert
Sends a silent alert message to certain crew members' PDAs
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
snap_language_understanding
A level snapped to a whole step, between the least allowed and all of it.
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.
spawn_random_ship
Spawns the random ship proper, with the follow-up effects, if you've set any up.
spawn_reebe
Spawn reebe with the appropriate fanfare after sacrificing a blood cultist
special_list_filter
Returns a list with items filtered from a list that can call callback
species_family_id
The id the species page knows a family by: the last part of its typepath.
species_has_fitness_limbs
Returns whether a species' own limbs have fitness subtypes, which is when its characters get a muscle size and definition.
Arguments:
- species_type: The species' type.
species_page_height
A dummy's flat render with the rows its height filters move moved in it, as the game draws them, so a species shorter or taller than average stands as high on the page as in the round. A flatten leaves filters out.
Each run of rows the filters move, as character_preview_rows() gives them, is cleared and filled with the band of the flat render's rows it shows, if any. A render that isn't a tile, or whose filters move more than whole rows, is left as it is.
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_worn_emissive_branches
Return the emissive-only tree, or null if nothing changed. visible_resultWORN_EMISSIVE_VISIBLE_RESULT receives the visible tree (null for a moved mask leaf). The caller reuses this single return slot throughout the traversal; each node consumes its child's result immediately. Unchanged branches retain their original appearances and allocate no lists. Nested cross-plane masks escape the mob's KEEP_TOGETHER group. Moving the plane boundary to a sibling root lets BYOND inherit the mob transform normally, without baking a pose into the cache. Only floating equipment masks are moved; absolute-layer effects and other planes retain their behavior.
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_unequip_mob
A utility function for /datum/strippable_items 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.
strip_outer_punctuation
Removes all punctuation sequences from the beginning and the end of the input string. Includes emphasis (|, +, _) and whitespace. Anything punctuation in the middle of the input will be maintained.
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
symphony_address_allowed
TRUE if a topic from this sender is allowed to run.
symphony_ago
How long ago a stamp was. DisplayTimeText already says "right now", and "right now ago" reads wrong.
symphony_apply_discord_admins
Runs after load_admins() clears and rebuilds local/SQL holders, which take precedence.
symphony_ban_minutes
Ban length in minutes, 0 being permanent.
symphony_bannable_roles
Shared by the panel's role list and ban validation.
symphony_discord_admin_sync_enabled
Discord admin grants require both the module and admin sync flags.
symphony_enforce_kick
Recheck a revoke after its grace period, then return the player to the lobby. A failed query leaves them in the round; the periodic sweep retries when the database recovers.
symphony_has_ingame_role
Query a linked account for an in-game role grant. Returns TRUE/FALSE, or null when the database cannot answer. Unlinked accounts return FALSE.
symphony_holds_whitelist_role
Check a current role entitlement, bypassing the admission cache. Unlike admission, perks and imports require an enabled module and a confirmed grant.
symphony_ingame_role_ckeys
Return role holders as ckey -> TRUE, an empty list for no holders, or null on query failure.
symphony_invalidate_whitelist_cache
Invalidate one account immediately after a role change.
symphony_note_panel
Remember who called, so the status verb can compare the two halves.
symphony_request_community_ban
Queue propagation of an existing local ban to the other servers.
symphony_resolve_role
The ban cache is case sensitive, so match the caller's text to the stored title.
symphony_revoke
Announce a revoke, block pending admission, and schedule enforcement after the grace period.
symphony_seed_whitelist_cache
Cache a confirmed TRUE/FALSE result from a notification or bulk query. Advancing the epoch prevents an older in-flight query from overwriting this answer.
symphony_validate_ready_players
May sleep. Display and signal handlers must continue to use the cache-only gate.
symphony_version_verdict
Which half is behind, if either. needs/wants are what the panel asked for.
symphony_whitelist_cache_peek
Return cached TRUE/FALSE, or null for a miss. Never queries or sleeps.
symphony_whitelist_lookup
Return a cached whitelist answer, querying on a miss. May sleep. Database failures return null and are never cached; FALSE is a confirmed denial. Use symphony_whitelist_cache_peek() in display and signal handlers that cannot sleep.
symphony_write_ban_note
World topics have no usr, which create_message() requires, so insert the note directly.
techweb_point_display_generic
Helper proc to turn an associative list of points into a more human readable format.
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.
text2ratvar
Takes english and applies ratvarian styling rules (and rot13) to it.
tg_alert
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.
- button_1 - The first button option.
- button_2 - The second button option.
- button_3 - The third button option.
- steal_focus - 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_color_picker
Creates a TGUI color picker window and returns the user's response.
This proc should be used to create a color picker that the caller will wait for a response from. Arguments:
- user - The user to show the picker to.
- title - The of the picker modal, shown on the top of the TGUI window.
- timeout - The timeout of the picker, after which the modal will close and qdel itself. Set to zero for no timeout.
- autofocus - The bool that controls if this picker 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. By default is infinity.
- 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_blooper
Globally toggles bloopers on/off
toggle_department_ooc
Enables or disables a channel and notifies its listeners when the state changes.
Arguments:
- channel_key - key into [GLOB.department_ooc_channels]
- toggle - TRUE to enable, FALSE to disable, or null to toggle the current state
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!
trim
Returns a string with reserved characters and spaces before the first word and after the last word removed.
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. @params reject_dense - If TRUE, ignore picked turfs in this selection that have density.
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_inside
Return UI_INTERACTIVE if the user is inside the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
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
uni_icon_facings_json
Turns a flat icon walked with get_flat_uni_icon(target, UP) into its recipe for each facing, as iconforge entry JSON: facing name -> recipe.
Nothing in the walk depends on the facing except which frame each directional state shows, so one walk with UP standing in for the facing, with each facing written in afterwards, gives exactly what a walk per facing does, for a quarter of the walking. No mob overlay faces UP of its own accord. A mob that something redraws when it turns has to be turned and walked once per facing instead.
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)
unpack_garment_colours
Returns a view's colours, colour -> how many of its pixels have it, from the "rrggbb:count,..." form garment_sheet_metadata() holds them in.
Arguments:
- packed: The packed colours.
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.
updateToolTip
Updates a user's tooltip to show new title/contents.
update_all_doors_reta_lights
Updates RETA lighting for all doors in the game
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.
valid_direct_subtypesof
Like valid_subtypesof(), but excludes concrete descendants of abstract sub-branches
valid_direct_typesof
Like valid_typesof(), but excludes concrete descendants of abstract sub-branches
valid_painting_id
Accept only the lowercase 32-character hexadecimal identities used for painting paths.
valid_subtypesof
Like subtypesof, but automatically excludes abstract typepaths
valid_typesof
Like typesof, but automatically excludes abstract typepaths
validate_suppression_status
Check if the delam suppression setup is valid on the map
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_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
world_topic_log_parameters
Redact the decoded credential, covering every parameter encoding accepted by authentication.
worn_frame_delays
Returns an animated worn state's frame delays, read from its sheet, or null when the sheet isn't a file on disk, like a generated icon, or has no such state.
Arguments:
- sheet: The worn sheet.
- state: The state in it.
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.