(global)
Vars | |
Debugger | StonedMC |
---|---|
Failsafe | Failsafe |
SSachievements | |
SSambience | The subsystem used to play ambience to users every now and then, makes them real excited. |
SSarea_contents | Responsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed |
SSasset_loading | Allows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init |
SSearly_assets | Initializes any assets that need to be loaded ASAP. This houses preference menu assets, since they can be loaded at any time, most dangerously before the atoms SS initializes. Thus, we want it to fail consistently in CI as if it would've if a player opened it up early. |
SSfluids | |
SSfoam | The subsystem responsible for processing foam propagation and effects. |
SSinit_profiler | Subsystem exists so we can separately log init time costs from the costs of general operation Hopefully this makes sorting out what causes problems when easier |
SSlag_switch | The subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience |
SSrunechat | |
SSsmoke | The subsystem responsible for processing smoke propagation and effects. |
SStgui | tgui subsystem |
SStimer | |
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 |
Procs | |
AStar | Pathfinding for bots |
Gibberish | Turn text into complete gibberish! |
IsAdminGhost | Is the passed in mob an admin ghost |
KillEveryoneOnZLevel | Kills any mob on the z-level, assuming they're not in a freezer |
REF | \ref behaviour got changed in 512 so this is necesary to replicate old behaviour. If it ever becomes necesary to get a more performant REF(), this lies here in wait #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : text_ref(thing)) |
WEAKREF | Creates a weakref to the given input. See /datum/weakref's documentation for more information. |
WrapAdminProcCall | Wrapper for proccalls where the datum is flagged as vareditted |
___TraitAdd | DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. |
___TraitRemove | DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. |
_addtimer | Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information. |
_addtimer_here | For legacy procs using addtimer in callbacks. Don't use this. |
above_neck | Would this zone be above the neck |
add_image_to_client | Adds an image to a client's .images . Useful as a callback. |
add_image_to_clients | Like add_image_to_client, but will add the image from a list of clients |
add_keybinding | Adds an instanced keybinding to the global tracker |
add_verb | handles adding verbs and updating the stat panel browser |
adminscrub | Runs STRIP_HTML_SIMPLE and byond's sanitization proc. |
anyprob | chances are 1:value. anyprob(1) will always return true |
assert_sorted | Runtimes if the passed in list is not sorted |
assign_random_name | Generate a name devices |
assoc_to_keys | Turns an associative list into a flat list of keys |
at_least | Takes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold |
baseturfs_string_list | A wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues |
bit_count | counts the number of bits in Byond's 16-bit width field, in constant time and memory! |
bitfield_to_list | Converts a bitfield to a list of numbers (or words if a wordlist is provided) |
blend_cutoff_colors | Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments |
blend_screen_color | Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker |
body_zone2cover_flags | For finding out what body parts a body zone covers, the inverse of the below basically |
build_planeed_apperance_queue | Takes a list of mutable appearances Returns a list in the form: 1 - a list of all mutable appearances that would need to be updated to change planes in the event of a z layer change, alnongside the commands required to properly track parents to update 2 - a list of all parents that will require updating |
calculate_light_offset | Returns a list of x and y offsets to apply to our visual lighting position |
callback_select | Runs a list of callbacks asyncronously, returning only when all have finished |
camera_sort | Sorts the list of cameras by their c_tag to display to players. |
check_holidays | Checks that the passed holiday is located in the global holidays list. |
check_teleport_valid | Validates that the teleport being attempted is valid or not |
check_zone | Convert a PRECISE ZONE into the BODY_ZONE |
circle_range_turfs | Returns a list of turfs around a center based on RANGE_TURFS() |
clearlist | Empties the list by setting the length to 0. Hopefully the elements get garbage collected |
cmp_crafting_req_priority | Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes |
completed_bounty_count | Subtype Gens |
create_delusion | Helper to give the passed mob the ability to create a delusion hallucination (even a custom one). Returns a list of arguments - pass these to _cause_hallucination to cause the desired hallucination |
cultslur | Makes you talk like you got cult stunned, which is slurring but with some dark messages |
cut_relative_direction | Takes a screen_loc string and cut out any directions like NORTH or SOUTH |
debug_hallucination_weighted_list | Debug proc for getting the total weight of the random_hallucination_weighted_list |
debug_variable | Get displayed variable in VV variable list |
deep_compare_list | Compares 2 lists, returns TRUE if they are the same |
default_ui_state | The sane defaults for a UI such as a computer or a machine. |
delete_all_SS_and_recreate_master | Delete all existing SS to basically start over |
delta_to_angle | Calculate the angle produced by a pair of x and y deltas |
deltimer | Delete a timer |
derpspeech | Convert a message to derpy speak |
diff_appearances | Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays |
dir_to_all_junctions | Takes a direction, turns it into all the junctions that contain it |
dispatch_announcement_to_players | Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg. |
display_corners | Makes all lighting corners visible, debug to aid in understanding |
display_energy | Format an energy value measured in Power Cell units. |
display_joules | Format an energy value in J, kJ, MJ, or GJ. 1W = 1J/s. |
display_power | Format a power value in W, kW, MW, or GW. |
do_after | Timed action involving one mob user. Target is optional. |
do_smoke | A helper proc used to spawn small puffs of smoke. |
do_teleport | Teleport an atom |
dump_in_space | Dump a movable in a random valid spacetile |
duplicate_object | |
emissive_appearance | Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR. |
emissive_blocker | Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR. |
end_cooldown | Callback called by a timer to end an associative-list-indexed cooldown. |
english_list | Returns a list in plain english as a string |
expand_three_digit_color | Given a 3 character color (no hash), converts it into #RRGGBB (with hash) |
expand_weights | Takes a weighted list (see above) and expands it into raw entries This eats more memory, but saves time when actually picking from it |
fill_holidays | Fills the holidays list if applicable, or leaves it an empty list. |
find_exposed_wires | List of areas where satchels should not be placed. |
find_functional_ntnet_relay | Checks whether NTNet is available by ensuring at least one relay exists and is operational. |
find_record | Find a datum record from a list |
find_safe_turf | Finds a safe turf on a given Z level |
findname | Find if the message has the real name of any user mob in the mob_list |
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 |
flick_overlay_global | Add an image to a list of clients and calls a proc to remove it after a duration |
generate_adjacent_directions | Encodes connectivity between border objects Returns a list accessable by a border object's dir, the direction between it and a target, and a target Said list will return the direction the two objects connect, if any exists (if the target isn't a border object and the direction is fine, return the inverse of the direction in use) |
generate_asset_name | Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.) |
generate_bitfields | Turns /datum/bitfield subtypes into a list for use in debugging |
generate_hallucination_weighted_list | Generates the global weighted list of random hallucinations. |
generate_lazy_template_map | Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance. |
generate_map_list_from_directory | Returns a list of all maps to be found in the directory that is passed in. |
generate_selectable_species | Generates species available to choose in character setup at roundstart |
generate_space_underlay | Generates a space underlay for a turf This provides proper lighting support alongside just looking nice Accepts the appearance to make "spaceish", and the turf we're doing this for |
generate_unique_announcement_header | Proc that just generates a custom header based on variables fed into priority_announce()
Will return a string. |
getFlatIcon | Create a single /icon from a given /atom or /image. |
get_access_desc | Gets teh description for an access |
get_adjacent_open_turfs | Returns a list with all the adjacent open turfs. Clears the list of nulls in the end. |
get_all_accesses | Gets all station access |
get_all_centcom_access | Gets all centcom accesses |
get_all_centcom_jobs | Gets all centcom jobs |
get_all_job_icons | Gets all jobs with hud icons |
get_all_jobs | Gets all jobs |
get_all_syndicate_access | Gets all syndicate access |
get_all_task_force_jobs | Gets all task for jobs |
get_allowed_instrument_ids | Get all non admin_only instruments as a list of text ids. |
get_angle | Calculate the angle between two atoms and the west|east coordinate |
get_angle_raw | Angle between two arbitrary points and horizontal line same as /proc/get_angle |
get_atom_on_turf | Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. |
get_bbox_of_atoms | Get a bounding box of a list of atoms. |
get_camera_list | get_camera_list |
get_centcom_access | Get access for centcom job |
get_centcom_access_desc | Get descriptions for centcom accesses |
get_debug_access | Gets all accesses between 1 and 500 |
get_edge_target_turf | Returns the turf located at the map edge in the specified direction relative to target_atom used for mass driver |
get_ert_access | Gets access for ERT |
get_first_open_turf_in_area | Iterates over all turfs in the target area and returns the first non-dense one |
get_icon_dimensions | Returns a list containing the width and height of an icon file |
get_line | Get a list of turfs in a line from starting_atom to ending_atom . |
get_nested_locs | Returns a list of all locations (except the area) the movable is within. |
get_offset_target_turf | returns turf relative to target_atom offset in dx and dy tiles, bound to map limits |
get_open_turf_in_dir | Returns the open turf next to the center in a specific direction |
get_pixel_angle | for getting the angle when animating something's pixel_x and pixel_y |
get_powernet_info_from_source | Extracts the powernet and cell of the provided power source |
get_preferences_in_priority_order | Returns a flat list of preferences in order of their priority |
get_random_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_region_accesses | Gets access from region ID |
get_region_accesses_name | Gets the name from region ID |
get_safe_random_station_turf | Returns a random turf on the station, excludes dense turfs (like walls) and areas that have valid_territory set to FALSE |
get_selectable_species | Gets a list of all species available to choose in roundstart. |
get_sorted_areas | Returns a sorted version of GLOB.areas, by name |
get_teleport_loc | Returns location. Returns null if no location was found. |
get_turf_pixel | Lets the turf this atom's ICON appears to inhabit it takes into account: Pixel_x/y Matrix x/y NOTE: if your atom has non-standard bounds then this proc will handle it, but: if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off) if the bounds are odd, the true middle turf of the atom is returned |
get_valid_screen_location | Returns a valid location to place a screen object without overflowing the viewport |
get_visual_offset | Returns how visually "off" the atom is from its source turf as a list of x, y (in pixel steps) it takes into account: Pixel_x/y Matrix x/y Icon width/height |
getnewid | Return a unique ID |
greatest_common_factor | Takes a list of numbers as input, returns the highest value that is cleanly divides them all Note: this implementation is expensive as heck for large numbers, I only use it because most of my usecase Is < 10 ints |
icon2base64 | Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64) |
icon_exists | Checks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE. |
init_crafting_recipes | Inits crafting recipe lists. |
init_crafting_recipes_atoms | Inits atoms used in crafting recipes. |
init_keybindings | Creates and sorts all the keybinding datums |
is_blind | Checks if passed through item is blind |
is_color_dark | Given a color in the format of "#RRGGBB", will return if the color is dark. |
is_special_character | Is this mob special to the gamemode? |
is_string_in_list | Checks for a string in a list |
is_type_in_list | Checks for specific types in a list |
is_type_on_turf | Checks whether or not a particular typepath or subtype of it is present on a turf |
isemptylist | Checks if the list is empty |
item_heal_robotic | Heal a robotic body part on a mob |
json_deserialize_datum | Convert a list of json to datum |
json_serialize_datum | Convert a datum into a json blob |
level_announce | Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message. |
listgetindex | Returns list element or null. Should prevent "index out of bounds" error. |
lizard_name | NAMEOF that actually works in static definitions because src::type requires src to be defined |
load_default_map_config | Proc that simply loads the default map config, which should always be functional. |
load_map | Helper and recommened way to load a map file |
load_map_config | Proc handling the loading of map configs. Will return the default map config using /proc/load_default_map_config if the loading of said file fails for any reason whatsoever, so we always have a working map for the server to run. Arguments: |
log_combat | Log a combat message in the attack log |
log_directed_talk | Helper for logging of messages with only one sender and receiver |
log_shuttle | Logging for shuttle actions |
log_spellbook | Logging for wizard powers learned |
log_tgui | Appends a tgui-related log entry. All arguments are optional. |
log_wound | log_wound() is for when someone is attacked and suffers a wound. Note that this only captures wounds from damage, so smites/forced wounds aren't logged, as well as demotions like cuts scabbing over |
make_datum_references_lists | Initial Building |
make_tuple | Returns the name of the mathematical tuple of same length as the number arg (rounded down). |
mass_purrbation | turn everyone into catgirls. Technically not girls specifically but you get the point. |
mass_remove_purrbation | turn all catgirls back |
md5asfile | Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results. |
md5filepath | Returns the md5 of a file at a given path. |
message_centcom | Used by communications consoles to message CentCom |
message_redphone_syndicate | Used by the red phone to message the Syndicate Specifies CENTCOM/SYNDICATE: to indicate both receive the message |
message_syndicate | Used by communications consoles to message the Syndicate |
message_to_html | Message-related procs |
mfa_reset | Reset MFA, clear sessions and login credentials |
minor_announce | Sends a minor annoucement to players. Minor announcements are large text, with the title in red and message in white. Only mobs that can hear can see the announcements. |
mobs_in_area_type | Takes: list of area types Returns: all mobs that are in an area type |
movespeed_data_null_check | Checks if a move speed modifier is valid and not missing any data |
mutable_appearance | |
next_list_item | Returns the next item in a list |
non_zero_min | for now, we'll treat all non-ascii characters like symbols even though most are letters |
notify_ghosts | Fancy notifications for ghosts |
nuke_request | Used by communications consoles to request the nuclear launch codes |
offer_control | Offer control of the passed in mob to dead player |
offset_to_screen_loc | Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope |
overlays2text | Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get |
parse_caught_click_modifiers | Returns a turf based on text inputs, original turf and viewing client |
partially_block_emissives | Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate |
pick_n_take | Pick a random element from the list and remove it from the list. |
pick_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. |
pixel_offset_turf | Takes a turf, and a list of x and y pixel offsets and returns the turf that the offset position best lands in |
pollCandidates | Poll all in the group for a candidate |
pollCandidatesForMob | Poll ghosts to take control of a mob |
pollCandidatesForMobs | Poll ghosts to take control of a mob |
pollGhostCandidates | Poll all ghosts for looking for a candidate |
pollMentorCandidatesForMob | Poll mentor ghosts to take control of a mob |
pollMentorGhostCandidates | Poll all mentor ghosts for looking for a candidate |
pop | Returns the top(last) element from the list and removes it from the list (typical stack function) |
popleft | Returns the bottom(first) element from the list and removes it from the list (typical stack function) |
possible_values_for_sprite_accessory_list | Takes an assoc list of names to /datum/sprite_accessory and returns a value
fit for /datum/preference/init_possible_values() |
possible_values_for_sprite_accessory_list_for_body_part | Takes an assoc list of names to /datum/sprite_accessory and returns a value
fit for /datum/preference/init_possible_values()
Different from possible_values_for_sprite_accessory_list in that it takes a list of layers
such as BEHIND, FRONT, and ADJ.
It also takes a "body part name", such as body_markings, moth_wings, etc
They are expected to be in order from lowest to top. |
previous_list_item | Returns the previous item in a list |
print_command_report | If the announcer overrides alert messages, use that message. |
priority_announce | Make a big red text announcement to |
process_teleport_locs | Generate a list of turfs you can teleport to from the areas list |
purrbation_apply | turns our poor spaceman into a CATGIRL. Point and laugh. |
purrbation_remove | return the degenerates to their original form |
purrbation_toggle | used to transmogrificate spacemen into or from catboys/girls. Arguments H = target spaceman and silent = TRUE/FALSE whether or not we alert them to their transformation with cute flavortext |
qdel | Should be treated as a replacement for the 'del' keyword. |
ran_zone | Return the zone or randomly, another valid zone |
read_sheet | Debug proc, for when lighting sheets fuck up Accepts the sheet (2 or 3 (multiz) dimensional list of lighting values at some offset) alongside x and y delta values and the sheet's "offset", which is the amount required to ensure everything indexes at 1 Optionally, you can pass similar values for multiz stuff |
realize_appearance_queue | Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected |
recover_all_SS_and_recreate_master | Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars |
recursive_organ_check | |
removeNullsFromList | remove all nulls from a list |
remove_image_from_client | Removes an image from a client's .images . Useful as a callback. |
remove_image_from_clients | Like remove_image_from_client, but will remove the image from a list of clients |
remove_strings_from_list | Removes a string from a list |
remove_verb | handles removing verb and sending it to browser to update, use this for removing verbs |
request_station_colors | Called by decals if they can be colored, to see if we got some cool colors for them. Only takes the first station trait |
request_z_pillar | Returns a z pillar to insert turfs into |
require_area_resort | A list of all machinery tied to an area along with the area itself. key=area name,value=list(area,list of machinery) we use this to keep track of what areas are affected by the blueprints & what machinery of these areas needs to be reconfigured accordingly |
reset_cooldown | Proc used by stoppable timers to end a cooldown before the time has ran out. |
resolve_ai_icon_sync | A form of resolve_ai_icon that is guaranteed to never sleep. Not always accurate, but always synchronous. |
rustg_get_version | Gets the version of rust_g |
safepick | Return either pick(list) or null if list is not of type /list or is empty |
sanitize | Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character. |
sanitize_css_class_name | Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts |
sanitize_hexcolor | Sanitize_Hexcolor takes in a color in hexcode as a string, be it shorthand hex as 3 characters, or full-sized 6 digit hex, with or without a leading # you can pass it a full hexcode with leading #, such as "#FFFFFF", and with the default arguments you will get exactly that color back, because it accounts for leading # signs and ignores them, then later in the function will either readd one, or won't depending on what you want. |
screen_loc_to_offset | Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc |
screen_loc_to_turf | Almost identical to the params_to_turf(), but unused (remove?) |
seedRuins | Loads the ruins for a given z level. @param z_levels The z levels to load ruins on. @param budget The budget to spend on ruins. Compare against the cost of the ruins in /datum/map_template/ruin. @param whitelist A list of areas to allow ruins to be placed in. @param potentialRuins A list of ruins to choose from. @param clear_below Whether to clear the area below the ruin. Used for multiz ruins. |
seedify | Finds and extracts seeds from an object |
select_hallucination_type | Helper to give the passed mob the ability to select a hallucination from the list of all hallucination subtypes. |
serialize_antag_name | Serializes an antag name to be used for preferences UI |
shake_camera | Shake the camera of the person viewing the mob SO REAL! |
shuffle | Randomize: Return the list in a random order |
shuffle_inplace | Same as shuffle, but returns nothing and acts on list in place |
slur | Makes you speak like you're drunk |
sortKey | Sort a list by CKEY |
sortRecord | Sort datum records in a list |
sort_list | sort any value in a list |
sort_names | uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead |
spiral_range_turfs | similar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs) |
stars | Convert random parts of a passed in message to stars |
stoplag | returns the number of ticks slept |
string_list | Caches lists with non-numeric stringify-able values (text or typepath). |
strip_html | Runs STRIP_HTML_SIMPLE and sanitize. |
strip_html_full | Runs STRIP_HTML_FULL and sanitize. |
stutter | Adds stuttering to the message passed in |
tele_play_specials | Plays the effects/sound set in do_teleport |
telecomms_check | Write shitty code comments Checks to see if 'mob_checking''s machine is a traffic control computer they can access. |
test_whiteship_sizes | Helper proc that tests to ensure all whiteship templates can spawn at their docking port, and logs their sizes This should be a unit test, but too much of our other code breaks during shuttle movement, so not yet, not yet. |
tgalert | DEPRECATED: USE tgui_alert(...) INSTEAD |
tgui_Topic | Middleware for /client/Topic. |
tgui_alert | Creates a TGUI alert window and returns the user's response. |
tgui_alert_async | Creates an asynchronous TGUI alert window with an associated callback. |
tgui_input_list | Creates a TGUI input list window and returns the user's response. |
tgui_input_list_async | Client does NOT have tgui_input on: Returns regular input Creates an asynchronous TGUI input list window with an associated callback. |
tgui_input_number | Creates a TGUI window with a number input. Returns the user's response as num | null. |
tgui_input_number_async | Client does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI number input window with an associated callback. |
tgui_input_text | Creates a TGUI window with a text input. Returns the user's response. |
tgui_input_text_async | Client does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI text input window with an associated callback. |
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. |
typecache_filter_list | returns a new list with only atoms that are in typecache L |
typecache_filter_list_reverse | returns a new list with only atoms that are not in typecache L |
typecacheof | Like typesof() or subtypesof(), but returns a typecache instead of a list |
ui_status_only_living | Returns a UI status such that the dead will be able to watch, but not interact. |
ui_status_silicon_has_access | Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled. |
ui_status_user_has_free_hands | Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch. |
ui_status_user_is_abled | Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive. |
ui_status_user_is_adjacent | Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living ] check for finer observer interactions. |
ui_status_user_is_advanced_tool_user | Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch. |
ui_status_user_is_conscious_and_lying_down | Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise. |
ui_status_user_strictly_adjacent | Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise. |
uniqueList | Returns a list without duplicate entrys |
updatetimedelay | Update the delay on an existing LOOPING timer Will come into effect on the next process |
url2htmlloader | Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn. |
valid_build_direction | Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings. |
view_to_pixels | Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height) |
visible_hallucination_pulse | Emits a hallucinating pulse around the passed atom. Affects everyone in the passed radius who can view the center, except for those with TRAIT_MADNESS_IMMUNE, or those who are blind. |
voice_of_god | VOICE OF GOD |
webhook_send_msay | MENTORS |
webhook_send_ticket_new | Discord Tickets |
woundscan | Displays wounds with extended information on their status vs medscanners |
Var Details
Debugger
StonedMC
Designed to properly split up a given tick among subsystems Note: if you read parts of this code and think "why is it doing it that way" Odds are, there is a reason
Failsafe
Failsafe
Pretty much pokes the MC to make sure it's still alive.
SSachievements
Subsystem used for keeping track of which achievements exist, who has them, and unlocking new ones.
The subsystem is the midpoint between the game and the database, intended to make it as easy as possible to add new achievements
and functionalities. Admin calling any of the functions in this subsystem isn't a good idea, nor is varediting it unnecessarily, as it really is intended to be 100% code-side. Also relevant: /datum/achievement and /datum/achievement_browser
For usage in code: use /datum/controller/subsystem/achievements/proc/has_achievement to check if they have an achievement, and /datum/controller/subsystem/achievements/proc/unlock_achievement to unlock it
SSambience
The subsystem used to play ambience to users every now and then, makes them real excited.
SSarea_contents
Responsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed
SSasset_loading
Allows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init
SSearly_assets
Initializes any assets that need to be loaded ASAP. This houses preference menu assets, since they can be loaded at any time, most dangerously before the atoms SS initializes. Thus, we want it to fail consistently in CI as if it would've if a player opened it up early.
SSfluids
A subsystem that processes the propagation and effects of a particular fluid.
Both fluid spread and effect processing are handled through a carousel system. Fluids being spread and fluids being processed are organized into buckets. Each fresh (non-resumed) fire one bucket of each is selected to be processed. These selected buckets are then fully processed. The next fresh fire selects the next bucket in each set for processing. If this would walk off the end of a carousel list we wrap back to the first element. This effectively makes each set a circular list, hence a carousel.
SSfoam
The subsystem responsible for processing foam propagation and effects.
SSinit_profiler
Subsystem exists so we can separately log init time costs from the costs of general operation Hopefully this makes sorting out what causes problems when easier
SSlag_switch
The subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience
SSrunechat
Maintains a timer-like system to handle destruction of runechat messages. Much of this code is modeled after or adapted from the timer subsystem.
Note that this has the same structure for storing and queueing messages as the timer subsystem does for handling timers: the bucket_list is a list of chatmessage datums, each of which are the head of a circularly linked list. Any given index in bucket_list could be null, representing an empty bucket.
SSsmoke
The subsystem responsible for processing smoke propagation and effects.
SStgui
tgui subsystem
Contains all tgui state and subsystem code.
SStimer
Handles creation, callbacks, and destruction of timed events.
It is important to understand the buckets used in the timer subsystem are just a series of doubly-linked lists. The object at a given index in bucket_list is a /datum/timedevent, the head of a list, which has prev and next references for the respective elements in that bucket's list.
SSwardrobe
This subsystem strives to make loading large amounts of select objects as smooth at execution as possible It preloads a set of types to store, and caches them until requested Doesn't catch everything mind, this is intentional. There's many types that expect to either A: Not sit in a list for 2 hours, or B: have extra context passed into them, or for their parent to be their location You should absolutely not spam this system, it will break things in new and wonderful ways S close enough for government work though. Fuck you goonstation
Proc Details
AStar
Pathfinding for bots
Gibberish
Turn text into complete gibberish!
text is the inputted message, and any value higher than 70 for chance will cause letters to be replaced instead of added
IsAdminGhost
Is the passed in mob an admin ghost
KillEveryoneOnZLevel
Kills any mob on the z-level, assuming they're not in a freezer
Arguments:
- z - the z-level to kill people on
REF
\ref behaviour got changed in 512 so this is necesary to replicate old behaviour. If it ever becomes necesary to get a more performant REF(), this lies here in wait #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : text_ref(thing))
WEAKREF
Creates a weakref to the given input. See /datum/weakref's documentation for more information.
WrapAdminProcCall
Wrapper for proccalls where the datum is flagged as vareditted
___TraitAdd
DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
___TraitRemove
DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
_addtimer
Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.
Arguments:
- 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
_addtimer_here
For legacy procs using addtimer in callbacks. Don't use this.
above_neck
Would this zone be above the neck
add_image_to_client
Adds an image to a client's .images
. Useful as a callback.
add_image_to_clients
Like add_image_to_client, but will add the image from a list of clients
add_keybinding
Adds an instanced keybinding to the global tracker
add_verb
handles adding verbs and updating the stat panel browser
pass the verb type path to this instead of adding it directly to verbs so the statpanel can update Arguments:
- 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
adminscrub
Runs STRIP_HTML_SIMPLE and byond's sanitization proc.
anyprob
chances are 1:value. anyprob(1) will always return true
assert_sorted
Runtimes if the passed in list is not sorted
assign_random_name
Generate a name devices
Creates a randomly generated tag or name for devices or anything really it keeps track of a special list that makes sure no name is used more than once
args:
- 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
at_least
Takes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold
baseturfs_string_list
A wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues
bit_count
counts the number of bits in Byond's 16-bit width field, in constant time and memory!
bitfield_to_list
Converts a bitfield to a list of numbers (or words if a wordlist is provided)
blend_cutoff_colors
Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments
blend_screen_color
Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker
body_zone2cover_flags
For finding out what body parts a body zone covers, the inverse of the below basically
build_planeed_apperance_queue
Takes a list of mutable appearances Returns a list in the form: 1 - a list of all mutable appearances that would need to be updated to change planes in the event of a z layer change, alnongside the commands required to properly track parents to update 2 - a list of all parents that will require updating
calculate_light_offset
Returns a list of x and y offsets to apply to our visual lighting position
callback_select
Runs a list of callbacks asyncronously, returning only when all have finished
Callbacks can be repeated, to call it multiple times
Arguments:
- list/callbacks the list of callbacks to be called
- list/callback_args the list of lists of arguments to pass into each callback
- savereturns Optionally save and return the list of returned values from each of the callbacks
- resolution The number of byond ticks between each time you check if all callbacks are complete
camera_sort
Sorts the list of cameras by their c_tag to display to players.
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_teleport_valid
Validates that the teleport being attempted is valid or not
check_zone
Convert a PRECISE ZONE into the BODY_ZONE
circle_range_turfs
Returns a list of turfs around a center based on RANGE_TURFS()
clearlist
Empties the list by setting the length to 0. Hopefully the elements get garbage collected
cmp_crafting_req_priority
Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
Prioritises /datum/reagent to ensure reagent requirements are always processed first when crafting. This prevents any reagent_containers from being consumed before the reagents they contain, which can lead to runtimes and item duplication when it happens.
completed_bounty_count
Subtype Gens
Strict Type Gens
Dynamic Gens
Cutoff for Non-Low Priority Bounties
Progression Gens
Low Priority Gens
create_delusion
Helper to give the passed mob the ability to create a delusion hallucination (even a custom one). Returns a list of arguments - pass these to _cause_hallucination to cause the desired hallucination
cultslur
Makes you talk like you got cult stunned, which is slurring but with some dark messages
cut_relative_direction
Takes a screen_loc string and cut out any directions like NORTH or SOUTH
debug_hallucination_weighted_list
Debug proc for getting the total weight of the random_hallucination_weighted_list
debug_variable
Get displayed variable in VV variable list
deep_compare_list
Compares 2 lists, returns TRUE if they are the same
default_ui_state
The sane defaults for a UI such as a computer or a machine.
delete_all_SS_and_recreate_master
Delete all existing SS to basically start over
delta_to_angle
Calculate the angle produced by a pair of x and y deltas
deltimer
Delete a timer
Arguments:
- id a timerid or a /datum/timedevent
derpspeech
Convert a message to derpy speak
diff_appearances
Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays
dir_to_all_junctions
Takes a direction, turns it into all the junctions that contain it
dispatch_announcement_to_players
Proc that just dispatches the announcement to our applicable audience. Only the announcement is a mandatory arg.
display_corners
Makes all lighting corners visible, debug to aid in understanding
display_energy
Format an energy value measured in Power Cell units.
display_joules
Format an energy value in J, kJ, MJ, or GJ. 1W = 1J/s.
display_power
Format a power value in W, kW, MW, or GW.
do_after
Timed action involving one mob user. Target is optional.
Checks that user
does not move, change hands, get stunned, etc. for the
given delay
. Returns TRUE
on success or FALSE
on failure.
Interaction_key is the assoc key under which the do_after is capped, with max_interact_count being the cap. Interaction key will default to target if not set.
do_smoke
A helper proc used to spawn small puffs of smoke.
Arguments:
- range: The amount of smoke to produce as number of steps from origin covered.
- amount: The amount of smoke to produce as the total desired coverage area. Autofilled from the range arg if not set.
- location: Where to produce the smoke cloud.
- smoke_type: The smoke typepath to spawn.
do_teleport
Teleport an atom
Teleports a atom to a destination along with being able to randomly teleport them You can also control the effects, such as sound, and sparks Arguments:
- teleatom - The atom to teleport
- destination - Destination of the atom
- percision - How precise is the teleport, 0(default) is the most precise
- effectin - effect to spawn before teleportation
- effectout - effect to show right after teleportation
- asoundin - soundfile to play before teleportation
- asoundout - soundfile to play after teleportation
- forceMove - if false, teleport will use Move() proc (dense objects will prevent teleportation)
- no_effects - disable the default effectin/effectout of sparks
- forced - whether or not to ignore no_teleport
dump_in_space
Dump a movable in a random valid spacetile
duplicate_object
Makes a copy of an item and transfers most vars over, barring GLOB.duplicate_forbidden_vars Args: original - Atom being duplicated sameloc - If true, places in the same loc as the original spawning_location - Turf where the duplicated atom will be spawned at. nerf - If true, only deals stamina damage holoitem - Sets up the item for holodecking
emissive_appearance
Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR.
emissive_blocker
Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR.
end_cooldown
Callback called by a timer to end an associative-list-indexed cooldown.
Arguments:
- source - datum storing the cooldown
- index - string index storing the cooldown on the cooldowns associative list
This sends a signal reporting the cooldown end.
english_list
Returns a list in plain english as a string
expand_three_digit_color
Given a 3 character color (no hash), converts it into #RRGGBB (with hash)
expand_weights
Takes a weighted list (see above) and expands it into raw entries This eats more memory, but saves time when actually picking from it
fill_holidays
Fills the holidays list if applicable, or leaves it an empty list.
find_exposed_wires
List of areas where satchels should not be placed.
find_functional_ntnet_relay
Checks whether NTNet is available by ensuring at least one relay exists and is operational.
find_record
Find a datum record from a list
find_safe_turf
Finds a safe turf on a given Z level
Finds a safe turf on a given Z level and has safety checks Arguments:
- zlevel - Z-level to check for a safe turf
- zlevels - list of z-levels to check for a safe turf
- extended_safety_checks - check for lava
findname
Find if the message has the real name of any user mob in the mob_list
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
flick_overlay_global
Add an image to a list of clients and calls a proc to remove it after a duration
generate_adjacent_directions
Encodes connectivity between border objects Returns a list accessable by a border object's dir, the direction between it and a target, and a target Said list will return the direction the two objects connect, if any exists (if the target isn't a border object and the direction is fine, return the inverse of the direction in use)
generate_asset_name
Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)
generate_bitfields
Turns /datum/bitfield subtypes into a list for use in debugging
generate_hallucination_weighted_list
Generates the global weighted list of random hallucinations.
generate_lazy_template_map
Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.
Screams if more than one key exists, loudly.
generate_map_list_from_directory
Returns a list of all maps to be found in the directory that is passed in.
generate_selectable_species
Generates species available to choose in character setup at roundstart
This proc generates which species are available to pick from in character setup. If there are no available roundstart species, defaults to human.
generate_space_underlay
Generates a space underlay for a turf This provides proper lighting support alongside just looking nice Accepts the appearance to make "spaceish", and the turf we're doing this for
generate_unique_announcement_header
Proc that just generates a custom header based on variables fed into priority_announce()
Will return a string.
getFlatIcon
Create a single /icon from a given /atom or /image.
Very low-performance. Should usually only be used for HTML, where BYOND's appearance system (overlays/underlays, etc.) is not available.
Only the first argument is required.
get_access_desc
Gets teh description for an access
get_adjacent_open_turfs
Returns a list with all the adjacent open turfs. Clears the list of nulls in the end.
get_all_accesses
Gets all station access
get_all_centcom_access
Gets all centcom accesses
get_all_centcom_jobs
Gets all centcom jobs
get_all_job_icons
Gets all jobs with hud icons
get_all_jobs
Gets all jobs
get_all_syndicate_access
Gets all syndicate access
get_all_task_force_jobs
Gets all task for jobs
get_allowed_instrument_ids
Get all non admin_only instruments as a list of text ids.
get_angle
Calculate the angle between two atoms and the west|east coordinate
get_angle_raw
Angle between two arbitrary points and horizontal line same as /proc/get_angle
get_atom_on_turf
Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
Arguments
- something_in_turf - a movable within the turf, somewhere.
- stop_type - optional - stops looking if stop_type is found in the turf, returning that type (if found).
get_bbox_of_atoms
Get a bounding box of a list of atoms.
Arguments:
- atoms - List of atoms. Can accept output of view() and range() procs.
Returns: list(x1, y1, x2, y2)
get_camera_list
get_camera_list
Builds a list of all available cameras that can be seen to networks_available Args: networks_available - List of networks that we use to see which cameras are visible to it.
get_centcom_access
Get access for centcom job
get_centcom_access_desc
Get descriptions for centcom accesses
get_debug_access
Gets all accesses between 1 and 500
get_edge_target_turf
Returns the turf located at the map edge in the specified direction relative to target_atom used for mass driver
get_ert_access
Gets access for ERT
get_first_open_turf_in_area
Iterates over all turfs in the target area and returns the first non-dense one
get_icon_dimensions
Returns a list containing the width and height of an icon file
get_line
Get a list of turfs in a line from starting_atom
to ending_atom
.
Uses the ultra-fast Bresenham Line-Drawing Algorithm.
get_nested_locs
Returns a list of all locations (except the area) the movable is within.
get_offset_target_turf
returns turf relative to target_atom offset in dx and dy tiles, bound to map limits
get_open_turf_in_dir
Returns the open turf next to the center in a specific direction
get_pixel_angle
for getting the angle when animating something's pixel_x and pixel_y
get_powernet_info_from_source
Extracts the powernet and cell of the provided power source
get_preferences_in_priority_order
Returns a flat list of preferences in order of their priority
get_random_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_region_accesses
Gets access from region ID
get_region_accesses_name
Gets the name from region ID
get_safe_random_station_turf
Returns a random turf on the station, excludes dense turfs (like walls) and areas that have valid_territory set to FALSE
get_selectable_species
Gets a list of all species available to choose in roundstart.
get_sorted_areas
Returns a sorted version of GLOB.areas, by name
get_teleport_loc
Returns location. Returns null if no location was found.
get_turf_pixel
Lets the turf this atom's ICON appears to inhabit it takes into account: Pixel_x/y Matrix x/y NOTE: if your atom has non-standard bounds then this proc will handle it, but: if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off) if the bounds are odd, the true middle turf of the atom is returned
get_valid_screen_location
Returns a valid location to place a screen object without overflowing the viewport
- target: The target location as a purely number based screen_loc string "+-left-offset:+-pixel,+-bottom-offset:+-pixel"
- target_offset: The amount we want to offset the target location by. We explictly don't care about direction here, we will try all 4
- view: The view variable of the client we're doing this for. We use this to get the size of the screen
Returns a screen loc representing the valid location
get_visual_offset
Returns how visually "off" the atom is from its source turf as a list of x, y (in pixel steps) it takes into account: Pixel_x/y Matrix x/y Icon width/height
getnewid
Return a unique ID
greatest_common_factor
Takes a list of numbers as input, returns the highest value that is cleanly divides them all Note: this implementation is expensive as heck for large numbers, I only use it because most of my usecase Is < 10 ints
icon2base64
Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)
icon_exists
Checks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.
init_crafting_recipes
Inits crafting recipe lists.
init_crafting_recipes_atoms
Inits atoms used in crafting recipes.
init_keybindings
Creates and sorts all the keybinding datums
is_blind
Checks if passed through item is blind
is_color_dark
Given a color in the format of "#RRGGBB", will return if the color is dark.
is_special_character
Is this mob special to the gamemode?
returns 1 for special characters and 2 for heroes of gamemode
is_string_in_list
Checks for a string in a list
is_type_in_list
Checks for specific types in a list
is_type_on_turf
Checks whether or not a particular typepath or subtype of it is present on a turf
Returns TRUE if an instance of the desired type or a subtype of it is found Returns FALSE if the type is not found, or if no turf is supplied
Arguments:
- location - The turf to be checked for the desired type
- type_to_find - The typepath whose presence you are checking for
isemptylist
Checks if the list is empty
item_heal_robotic
Heal a robotic body part on a mob
json_deserialize_datum
Convert a list of json to datum
json_serialize_datum
Convert a datum into a json blob
level_announce
Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.
listgetindex
Returns list element or null. Should prevent "index out of bounds" error.
lizard_name
NAMEOF that actually works in static definitions because src::type requires src to be defined
load_default_map_config
Proc that simply loads the default map config, which should always be functional.
load_map
Helper and recommened way to load a map file
- 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.
log_combat
Log a combat message in the attack log
1 argument is the actor performing the action 2 argument is the target of the action 3 is a verb describing the action (e.g. punched, throwed, kicked, etc.) 4 is a tool with which the action was made (usually an item) 5 is any additional text, which will be appended to the rest of the log line
log_directed_talk
Helper for logging of messages with only one sender and receiver
log_shuttle
Logging for shuttle actions
log_spellbook
Logging for wizard powers learned
log_tgui
Appends a tgui-related log entry. All arguments are optional.
log_wound
log_wound() is for when someone is attacked and suffers a wound. Note that this only captures wounds from damage, so smites/forced wounds aren't logged, as well as demotions like cuts scabbing over
Note that this has no info on the attack that dealt the wound: information about where damage came from isn't passed to the bodypart's damaged proc. When in doubt, check the attack log for attacks at that same time TODO later: Add logging for healed wounds, though that will require some rewriting of healing code to prevent admin heals from spamming the logs. Not high priority
Arguments:
- victim- The guy who got wounded
- suffered_wound- The wound, already applied, that we're logging. It has to already be attached so we can get the limb from it
- dealt_damage- How much damage is associated with the attack that dealt with this wound.
- dealt_wound_bonus- The wound_bonus, if one was specified, of the wounding attack
- dealt_bare_wound_bonus- The bare_wound_bonus, if one was specified and applied, of the wounding attack. Not shown if armor was present
- base_roll- Base wounding ability of an attack is a random number from 1 to (dealt_damage ** WOUND_DAMAGE_EXPONENT). This is the number that was rolled in there, before mods
make_datum_references_lists
Initial Building
make_tuple
Returns the name of the mathematical tuple of same length as the number arg (rounded down).
mass_purrbation
turn everyone into catgirls. Technically not girls specifically but you get the point.
mass_remove_purrbation
turn all catgirls back
md5asfile
Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
md5filepath
Returns the md5 of a file at a given path.
message_centcom
Used by communications consoles to message CentCom
message_redphone_syndicate
Used by the red phone to message the Syndicate Specifies CENTCOM/SYNDICATE: to indicate both receive the message
message_syndicate
Used by communications consoles to message the Syndicate
message_to_html
Message-related procs
Message format (/list):
- 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
mfa_reset
Reset MFA, clear sessions and login credentials
minor_announce
Sends a minor annoucement to players. Minor announcements are large text, with the title in red and message in white. Only mobs that can hear can see the announcements.
message - the message contents of the announcement. title - the title of the announcement, which is often "who sent it". alert - whether this announcement is an alert, or just a notice. Only changes the sound that is played by default. html_encode - if TRUE, we will html encode our title and message before sending it, to prevent player input abuse. players - optional, a list mobs to send the announcement to. If unset, sends to all palyers. sound_override - optional, use the passed sound file instead of the default notice sounds. should_play_sound - Whether the notice sound should be played or not. color_override - optional, use the passed color instead of the default notice color.
mobs_in_area_type
Takes: list of area types Returns: all mobs that are in an area type
movespeed_data_null_check
Checks if a move speed modifier is valid and not missing any data
mutable_appearance
-
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"
next_list_item
Returns the next item in a list
non_zero_min
for now, we'll treat all non-ascii characters like symbols even though most are letters
notify_ghosts
Fancy notifications for ghosts
The kitchen sink of notification procs
Arguments:
- message
- ghost_sound sound to play
- enter_link Href link to enter the ghost role being notified for
- source The source of the notification
- alert_overlay The alert overlay to show in the alert message
- action What action to take upon the ghost interacting with the notification, defaults to NOTIFY_JUMP
- flashwindow Flash the byond client window
- ignore_key Ignore keys if they're in the GLOB.poll_ignore list
- header The header of the notifiaction
- notify_suiciders If it should notify suiciders (who do not qualify for many ghost roles)
- notify_volume How loud the sound should be to spook the user
nuke_request
Used by communications consoles to request the nuclear launch codes
offer_control
Offer control of the passed in mob to dead player
Automatic logging and uses pollCandidatesForMob, how convenient
offset_to_screen_loc
Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope
overlays2text
Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get
parse_caught_click_modifiers
Returns a turf based on text inputs, original turf and viewing client
partially_block_emissives
Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate
pick_n_take
Pick a random element from the list and remove it from the list.
pick_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.
pixel_offset_turf
Takes a turf, and a list of x and y pixel offsets and returns the turf that the offset position best lands in
pollCandidates
Poll all in the group for a candidate
Poll group for question returns people who voted yes in a list Arguments:
- Question: String, what do you want to ask them
- jobbanType: List, Which roles/jobs to exclude from being asked
- gametypeCheck: Datum, Check if they have the time required for that role
- be_special_flag: Bool, Only notify ghosts with special antag on
- poll_time: Integer, How long to poll for in deciseconds(0.1s)
- ignore_category: Define, ignore_category: People with this category(defined in poll_ignore.dm) turned off dont get the message
- flashwindow: Bool, Flash their window to grab their attention
- group: List, Group of people to poll. list of datum/minds
pollCandidatesForMob
Poll ghosts to take control of a mob
Poll ghosts for mob control returns people who voted yes in a list Arguments:
- Question: String, what do you want to ask them
- jobbanType: List, Which roles/jobs to exclude from being asked
- gametypeCheck: Datum, Check if they have the time required for that role
- be_special_flag: Bool, Only notify ghosts with special antag on
- poll_time: Integer, How long to poll for in deciseconds(0.1s)
- M: Mob, /mob to offer
- ignore_category: Unknown
pollCandidatesForMobs
Poll ghosts to take control of a mob
Poll ghosts for mob control returns people who voted yes in a list Arguments:
- Question: String, what do you want to ask them
- jobbanType: List, Which roles/jobs to exclude from being asked
- gametypeCheck: Datum, Check if they have the time required for that role
- be_special_flag: Bool, Only notify ghosts with special antag on
- poll_time: Integer, How long to poll for in deciseconds(0.1s)
- mobs: List, list of mobs to offer up
- ignore_category: Unknown
pollGhostCandidates
Poll all ghosts for looking for a candidate
Poll all ghosts a question returns people who voted yes in a list Arguments:
- Question: String, what do you want to ask them
- jobbanType: List, Which roles/jobs to exclude from being asked
- gametypeCheck: Datum, Check if they have the time required for that role
- be_special_flag: Bool, Only notify ghosts with special antag on
- poll_time: Integer, How long to poll for in deciseconds(0.1s)
- ignore_category: Define, ignore_category: People with this category(defined in poll_ignore.dm) turned off dont get the message
- flashwindow: Bool, Flash their window to grab their attention
pollMentorCandidatesForMob
Poll mentor ghosts to take control of a mob
Poll mentor ghosts for mob control returns people who voted yes in a list Arguments:
- Question: String, what do you want to ask them
- jobbanType: List, Which roles/jobs to exclude from being asked
- gametypeCheck: Datum, Check if they have the time required for that role
- be_special_flag: Bool, Only notify ghosts with special antag on
- poll_time: Integer, How long to poll for in deciseconds(0.1s)
- M: Mob, /mob to offer
- ignore_category: Unknown
pollMentorGhostCandidates
Poll all mentor ghosts for looking for a candidate
Poll all mentor ghosts a question returns people who voted yes in a list Arguments:
- Question: String, what do you want to ask them
- jobbanType: List, Which roles/jobs to exclude from being asked
- gametypeCheck: Datum, Check if they have the time required for that role
- be_special_flag: Bool, Only notify ghosts with special antag on
- poll_time: Integer, How long to poll for in deciseconds(0.1s)
- ignore_category: Define, ignore_category: People with this category(defined in poll_ignore.dm) turned off dont get the message
- flashwindow: Bool, Flash their window to grab their attention
pop
Returns the top(last) element from the list and removes it from the list (typical stack function)
popleft
Returns the bottom(first) element from the list and removes it from the list (typical stack function)
possible_values_for_sprite_accessory_list
Takes an assoc list of names to /datum/sprite_accessory and returns a value
fit for /datum/preference/init_possible_values()
possible_values_for_sprite_accessory_list_for_body_part
Takes an assoc list of names to /datum/sprite_accessory and returns a value
fit for /datum/preference/init_possible_values()
Different from possible_values_for_sprite_accessory_list
in that it takes a list of layers
such as BEHIND, FRONT, and ADJ.
It also takes a "body part name", such as body_markings, moth_wings, etc
They are expected to be in order from lowest to top.
previous_list_item
Returns the previous item in a list
print_command_report
If the announcer overrides alert messages, use that message.
priority_announce
Make a big red text announcement to
Formatted like:
" Message from sender "
" Title "
" Text "
Arguments
- text - required, the text to announce
- title - optional, the title of the announcement.
- sound - optional, the sound played accompanying the announcement
- type - optional, the type of the announcement, for some "preset" announcement templates. See __DEFINES/announcements.dm
- sender_override - optional, modifies the sender of the announcement
- has_important_message - is this message critical to the game (and should not be overridden by station traits), or not
- players - a list of all players to send the message to. defaults to all players (not including new players)
- encode_title - if TRUE, the title will be HTML encoded
- encode_text - if TRUE, the text will be HTML encoded
process_teleport_locs
Generate a list of turfs you can teleport to from the areas list
Includes areas if they're not a shuttle or not not teleport or have no contents
The chosen turf is the first item in the areas contents that is a station level
The returned list of turfs is sorted by name
purrbation_apply
turns our poor spaceman into a CATGIRL. Point and laugh.
purrbation_remove
return the degenerates to their original form
purrbation_toggle
used to transmogrificate spacemen into or from catboys/girls. Arguments H = target spaceman and silent = TRUE/FALSE whether or not we alert them to their transformation with cute flavortext
qdel
Should be treated as a replacement for the 'del' keyword.
Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
ran_zone
Return the zone or randomly, another valid zone
probability controls the chance it chooses the passed in zone, or another random zone defaults to 80
read_sheet
Debug proc, for when lighting sheets fuck up Accepts the sheet (2 or 3 (multiz) dimensional list of lighting values at some offset) alongside x and y delta values and the sheet's "offset", which is the amount required to ensure everything indexes at 1 Optionally, you can pass similar values for multiz stuff
realize_appearance_queue
Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected
recover_all_SS_and_recreate_master
Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars
recursive_organ_check
- recursive_organ_check
- inputs: O (object to start with)
- outputs:
- description: A pseudo-recursive loop based off of the recursive mob check, this check looks for any organs held
-
within 'O', toggling their frozen flag. This check excludes items held within other safe organ
-
storage units, so that only the lowest level of container dictates whether we do or don't decompose
removeNullsFromList
remove all nulls from a list
remove_image_from_client
Removes an image from a client's .images
. Useful as a callback.
remove_image_from_clients
Like remove_image_from_client, but will remove the image from a list of clients
remove_strings_from_list
Removes a string from a list
remove_verb
handles removing verb and sending it to browser to update, use this for removing verbs
pass the verb type path to this instead of removing it from verbs so the statpanel can update Arguments:
- 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
request_station_colors
Called by decals if they can be colored, to see if we got some cool colors for them. Only takes the first station trait
request_z_pillar
Returns a z pillar to insert turfs into
require_area_resort
A list of all machinery tied to an area along with the area itself. key=area name,value=list(area,list of machinery) we use this to keep track of what areas are affected by the blueprints & what machinery of these areas needs to be reconfigured accordingly
reset_cooldown
Proc used by stoppable timers to end a cooldown before the time has ran out.
Arguments:
- 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.
resolve_ai_icon_sync
A form of resolve_ai_icon that is guaranteed to never sleep. Not always accurate, but always synchronous.
rustg_get_version
Gets the version of rust_g
safepick
Return either pick(list) or null if list is not of type /list or is empty
sanitize
Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
sanitize_css_class_name
Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts
sanitize_hexcolor
Sanitize_Hexcolor takes in a color in hexcode as a string, be it shorthand hex as 3 characters, or full-sized 6 digit hex, with or without a leading # you can pass it a full hexcode with leading #, such as "#FFFFFF", and with the default arguments you will get exactly that color back, because it accounts for leading # signs and ignores them, then later in the function will either readd one, or won't depending on what you want.
Full hexcolors will just be validated, shorthand hex of 3 characters can be cleanly converted up to full hex with a leading # no problem.
With default arguments:
- "FFF" -> "#FFFFFF"
- "#FFFFFF" -> "#FFFFFF"
converting down to short, with or without the # is doable by setting the desired format to the length you want and specifying the crunch to true for adding a # or false to not
screen_loc_to_offset
Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc
screen_loc_to_turf
Almost identical to the params_to_turf(), but unused (remove?)
seedRuins
Loads the ruins for a given z level. @param z_levels The z levels to load ruins on. @param budget The budget to spend on ruins. Compare against the cost of the ruins in /datum/map_template/ruin. @param whitelist A list of areas to allow ruins to be placed in. @param potentialRuins A list of ruins to choose from. @param clear_below Whether to clear the area below the ruin. Used for multiz ruins.
seedify
Finds and extracts seeds from an object
Checks if the object is such that creates a seed when extracted. Used by seed extractors or posably anything that would create seeds in some way. The seeds are dropped either at the extractor, if it exists, or where the original object was and it qdel's the object
Arguments:
- 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.
serialize_antag_name
Serializes an antag name to be used for preferences UI
shake_camera
Shake the camera of the person viewing the mob SO REAL!
shuffle
Randomize: Return the list in a random order
shuffle_inplace
Same as shuffle, but returns nothing and acts on list in place
slur
Makes you speak like you're drunk
sortKey
Sort a list by CKEY
sortRecord
Sort datum records in a list
sort_list
sort any value in a list
sort_names
uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead
spiral_range_turfs
similar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs)
stars
Convert random parts of a passed in message to stars
- n - the string to convert
- pr - probability any character gets changed
This proc is dangerously laggy, avoid it or die
stoplag
returns the number of ticks slept
string_list
Caches lists with non-numeric stringify-able values (text or typepath).
strip_html
Runs STRIP_HTML_SIMPLE and sanitize.
strip_html_full
Runs STRIP_HTML_FULL and sanitize.
stutter
Adds stuttering to the message passed in
tele_play_specials
Plays the effects/sound set in do_teleport
Plays the effects/sound set in do_teleport Arguments:
- teleatom - used to check if they exist
- location - location of the effect/sound to play
- effect - effect to spawn
- sound - sound to play
telecomms_check
Write shitty code comments Checks to see if 'mob_checking''s machine is a traffic control computer they can access.
test_whiteship_sizes
Helper proc that tests to ensure all whiteship templates can spawn at their docking port, and logs their sizes This should be a unit test, but too much of our other code breaks during shuttle movement, so not yet, not yet.
tgalert
DEPRECATED: USE tgui_alert(...) INSTEAD
Designed as a drop in replacement for alert(); functions the same. (outside of needing User specified) Arguments:
- User - The user to show the alert to.
- Message - The textual body of the alert.
- Title - The title of the alert's window.
- Button1 - The first button option.
- Button2 - The second button option.
- Button3 - The third button option.
- StealFocus - Boolean operator controlling if the alert will steal the user's window focus.
- Timeout - The timeout of the window, after which no responses will be valid.
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_alert_async
Creates an asynchronous TGUI alert window with an associated callback.
This proc should be used to create alerts that invoke a callback with the user's chosen option. Arguments:
- 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.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the alert, after which the modal will close and qdel itself. Disabled by default, can be set to seconds otherwise.
- autofocus - The bool that controls if this alert should grab window focus.
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.
- buttons - The options that can be chosen by the user, each string is assigned a button on the UI.
- timeout - The timeout of the input box, after which the input box will close and qdel itself. Set to zero for no timeout.
tgui_input_list_async
Client does NOT have tgui_input on: Returns regular input Creates an asynchronous TGUI input list window with an associated callback.
This proc should be used to create inputs that invoke a callback with the user's chosen option. Arguments:
- 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.
- buttons - The options that can be chosen by the user, each string is assigned a button on the UI.
- callback - The callback to be invoked when a choice is made.
- 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_number_async
Client does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI number input window with an associated callback.
This proc should be used to create numboxes that invoke a callback with the user's entry.
Arguments:
- user - The user to show the numbox to.
- message - The content of the numbox, shown in the body of the TGUI window.
- title - The title of the numbox 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.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the numbox, after which the modal will close and qdel itself. Disabled by default, can be set to seconds otherwise.
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 textbox to.
- message - The content of the textbox, shown in the body of the TGUI window.
- title - The title of the textbox 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.
- multiline - Bool that determines if the input box is much larger. Good for large messages, laws, etc.
- timeout - The timeout of the textbox, after which the modal will close and qdel itself. Set to zero for no timeout.
tgui_input_text_async
Client does NOT have tgui_fancy on: Returns regular input Creates an asynchronous TGUI text input window with an associated callback.
This proc should be used to create textboxes that invoke a callback with the user's entry. Arguments:
- user - The user to show the textbox to.
- message - The content of the textbox, shown in the body of the TGUI window.
- title - The title of the textbox 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.
- multiline - Bool that determines if the input box is much larger. Good for large messages, laws, etc.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the textbox, after which the modal will close and qdel itself. Disabled by default, can be set to seconds otherwise.
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.
typecache_filter_list
returns a new list with only atoms that are in typecache L
typecache_filter_list_reverse
returns a new list with only atoms that are not in typecache L
typecacheof
Like typesof() or subtypesof(), but returns a typecache instead of a list
ui_status_only_living
Returns a UI status such that the dead will be able to watch, but not interact.
ui_status_silicon_has_access
Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.
ui_status_user_has_free_hands
Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.
ui_status_user_is_abled
Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacent
Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living
] check for finer observer interactions.
ui_status_user_is_advanced_tool_user
Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_is_conscious_and_lying_down
Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacent
Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
uniqueList
Returns a list without duplicate entrys
updatetimedelay
Update the delay on an existing LOOPING timer Will come into effect on the next process
Arguments:
- id a timerid or a /datum/timedevent
- new_wait the new wait to give this looping timer
url2htmlloader
Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
valid_build_direction
Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings.
Returns FALSE if the target turf cannot accept a directional construction. Returns TRUE otherwise.
Arguments:
- dest_turf - The destination turf to check for existing directional constructions
- test_dir - The prospective dir of some atom you'd like to put on this turf.
- is_fulltile - Whether the thing you're attempting to move to this turf takes up the entire tile or whether it supports multiple movable atoms on its tile.
view_to_pixels
Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)
visible_hallucination_pulse
Emits a hallucinating pulse around the passed atom. Affects everyone in the passed radius who can view the center, except for those with TRAIT_MADNESS_IMMUNE, or those who are blind.
center - required, the center of the pulse radius - the radius around that the pulse reaches hallucination_duration - how much hallucination is added by the pulse. reduced based on distance to the center. hallucination_max_duration - a cap on how much hallucination can be added optional_messages - optional list of messages passed. Those affected by pulses will be given one of the messages in said list.
voice_of_god
VOICE OF GOD
webhook_send_msay
MENTORS
webhook_send_ticket_new
Discord Tickets
woundscan
Displays wounds with extended information on their status vs medscanners