(global)

Vars | |
Failsafe | Failsafe |
---|---|
Master | StonedMC |
SSacid | The subsystem used to tick /datum/component/acid instances. |
SSai_behaviors | The subsystem used to tick /datum/ai_behavior instances. Handling the individual actions an AI can take like punching someone in the fucking NUTS |
SSai_controllers | The subsystem used to tick /datum/ai_controllers instances. Handling the re-checking of plans. |
SSai_movement | The subsystem used to tick /datum/ai_movement instances. Handling the movement of individual AI instances |
SSambience | The subsystem used to play ambience to users every now and then, makes them real excited. |
SSclock_component | The subsystem used to tick /datum/component/acid instances. |
SSdiscord | |
SSeigenstates | Subsystem used to teleport people to a linked web of itterative entries. If one entry is deleted, the 2 around it will forge a link instead. |
SSid_access | Non-processing subsystem that holds various procs and data structures to manage ID cards, trims and access. |
SSlag_switch | The subsystem for controlling drastic performance enhancements aimed at reducing server load for a smoother albeit slightly duller gaming experience |
SSreagents | Cached list of possible quirks |
SSrunechat | |
SStgui | tgui subsystem |
SStime_track | The reference to the end of round sound that we have chosen. |
SStimer | |
Procs | |
Gibberish | Turn text into complete gibberish! |
HeapPathWeightCompare | TODO: Macro this to reduce proc overhead |
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. |
_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 |
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_keybinding | Adds an instanced keybinding to the global tracker |
add_verb | handles adding verbs and updating the stat panel browser |
arm_up_new_crew | signal proc to give guns to new crewmembers |
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): |
build_chemical_reagent_list | These are used in the reagents subsystem init() and the reagent_id_typos.dm |
build_exploration_site_ui_data | Helper proc for exploration site listings in ui. |
build_medicine_reagents | Just grab every craftable medicine you can think off |
call_emergency_meeting | If the announcer overrides alert messages, use that message. Summon the crew for an emergency meeting |
callback_select | Runs a list of callbacks asyncronously, returning only when all have finished |
checkCardDatums | Checks the global card list for cards that don't override all the default values of the card datum |
checkCardDistribution | Used to test open a large amount of cardpacks |
checkCardpacks | Checks the passed type list for missing raritys, or raritys out of bounds |
check_zone | Convert a PRECISE ZONE into the BODY_ZONE |
clearCards | Empty the rarity cache so we can safely add new cards |
cmp_crafting_req_priority | Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes |
color_to_full_rgba_matrix | Converts RGB shorthands into RGBA matrices complete of constants rows (ergo a 20 keys list in byond). |
considered_exiled | Exiled check |
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. |
create_mafia_game | Creates the global datum for playing mafia games, destroys the last if that's required and returns the new. |
create_strippable_list | Creates an assoc list of keys to /datum/strippable_item |
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 it's conclusion |
cultslur | Makes you talk like you got cult stunned, which is slurring but with some dark messages |
debug_variable | Get displayed variable in VV variable list |
default_ui_state | The sane defaults for a UI such as a computer or a machine. |
deltimer | Delete a timer |
derpspeech | Convert a message to derpy speak |
do_after | Timed action involving one mob user. Target is optional. |
do_after_mob | Timed action involving at least one mob user and a list of targets. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once. |
do_mob | Timed action involving two mobs, the user and the target. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once. |
emissive_appearance | Produces a mutable appearance glued to the EMISSIVE_PLANE dyed to be the EMISSIVE_COLOR. |
end_cooldown | Callback called by a timer to end an associative-list-indexed cooldown. |
ending_helper | Helper to set the round to end asap. Current usage Cult round end code |
explosion | Makes a given atom explode. |
find_reagent | Returns reagent datum from typepath |
find_record | Returns datum/data/record |
findname | Find if the message has the real name of any user mob in the mob_list |
finish_unequip_mob | A utility function for /datum/strippable_item s to finish unequipping an item from a mob. |
firing_squad | firing_squad is a proc for the :B:erforate smite to shoot each individual bullet at them, so that we can add actual delays without sleep() nonsense |
first_day_of_month | Returns the first day of the given year and month in number format, from 1 (monday) - 7 (sunday). |
flop_animation | This animation should be applied to actual parent atom instead of vc_object. |
format_frequency | Format frequency by moving the decimal. |
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_chemwiki_line | Generate the big list of reagent based reactions. style='background-color:#FFEE88;'|{{anchor|Synthetic-derived growth factor}}Synthetic-derived growth factorâ® |
generate_fish | Automatically generates object of given base path from the behaviour type in loc |
generate_generator_index | Creates generator__id => type map. |
generate_selectable_species | Generates species available to choose in character setup at roundstart |
getFlatIcon | Create a single /icon from a given /atom or /image. |
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_allowed_instrument_ids | Get all non admin_only instruments as a list of text ids. |
get_bbox_of_atoms | Get a bounding box of a list of atoms. |
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_chem_id | Returns reagent datum from reagent name string |
get_distribution | This is a pretty complicated algorithm, but it's one I'm rather proud of. |
get_hearers_in_view | Returns a list of hearers in view(view_radius) from source (ignoring luminosity). uses important_recursive_contentsRECURSIVE_CONTENTS_HEARING_SENSITIVE |
get_officer_departments | Returns the distribution of splitting the given security officers into departments. Return value is an assoc list of candidate => SEC_DEPT_*. |
get_path_to | This file contains the stuff you need for using JPS (Jump Point Search) pathing, an alternative to A* that skips over large numbers of uninteresting tiles resulting in much quicker pathfinding solutions. Mind that diagonals cost the same as cardinal moves currently, so paths may look a bit strange, but should still be optimal. |
get_powernet_info_from_source | Extracts the powernet and cell of the provided power source |
get_random_reagent_id | Returns a random reagent object minus blacklisted reagents |
get_ranged_target_turf_direct | Get ranged target turf, but with direct targets as opposed to directions |
get_reagent_type_from_product_string | Returns a list of chemical_reaction datums that have the input STRING as a product |
get_recipe_from_reagent_product | Takes a type in and returns a list of associated recipes |
get_temp_change_amount | Used to get the amount of change between two body temperatures |
getleftblocks | DNA HELPER-PROCS |
getline | Get a list of turfs in a line from M to N . |
goonchem_vortex | Magical move-wooney that happens sometimes. |
hex2rgb | Converts "#RRGGBB" to list(0xRR, 0xGG, 0xBB) |
htmlrendertext | Perform a whitespace cleanup on the text, similar to what HTML renderers do |
icon2base64 | Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64) |
init_crafting_recipes | Inits the crafting recipe list, sorting crafting recipe requirements in the process. |
init_keybindings | Creates and sorts all the keybinding datums |
init_subtypes_w_path_keys | Functions like init_subtypes, but uses the subtype's path as a key for easy access |
ionnum | is at the start to prevent us from changing say modes via get_message_mode() |
isAdminGhostAI | Is the passed in mob an admin ghost WITH AI INTERACT enabled |
isAdminObserver | Is the passed in mob a ghost with admin powers, doesn't check for AI interact like isAdminGhost() used to |
is_convertable_to_cult | Returns whether the given mob is convertable to the blood cult |
is_special_character | Returns TRUE if the game has started and we're either an AI with a 0th law, or we're someone with a special role/antag datum |
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 |
loadAllCardFiles | Loads all the card files |
loadCardFile | Loads the contents of a json file into our global card list |
load_adventures | Loads all adventures from DB |
load_map | Shortcut function to parse a map and apply it to the world. |
load_poll_data | Loads all current and future server polls and their options to store both as datums. |
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_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 |
magic_up_new_crew | signal proc to give magic to new crewmembers |
make_datum_references_lists | Initial Building |
make_tuple | Returns the name of the mathematical tuple of same length as the number arg (rounded down). |
md5asfile | Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results. |
md5filepath | Returns the md5 of a file at a given path. |
message_centcom | Used by communications consoles to message CentCom |
message_syndicate | Used by communications consoles to message the Syndicate |
message_to_html | Message-related procs |
movespeed_data_null_check | Checks if a move speed modifier is valid and not missing any data |
mutable_appearance | Helper similar to image() |
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()] |
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 |
pick_n_take | Pick a random element from the list and remove it from the list. |
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) |
populate_editable_sign_types | This proc populates GLOBAL_LIST_EMPTY(editable_sign_types) |
printAllCards | Prints all the cards names |
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. |
ran_zone | Return the zone or randomly, another valid zone |
random_bounty | |
random_fish_type | Returns random fish, using random_case_rarity probabilities. |
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. |
recursive_organ_check | |
reject_bad_name | Filters out undesirable characters from names. |
reloadAllCardFiles | Reloads all card files |
remove_image_from_client | Removes an image from a client's .images . Useful as a callback. |
remove_verb | handles removing verb and sending it to browser to update, use this for removing verbs |
reset_cooldown | Proc used by stoppable timers to end a cooldown before the time has ran out. |
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 |
rustg_get_version | Gets the version of rust_g |
sanitize_css_class_name | Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts |
sanitize_frequency | Ensure the frequency is within bounds of what it should be sending/receiving at |
sanitize_name | returns nothing with an alert instead of the message if it contains something in the ic filter, and sanitizes normally if the name is fine. It returns nothing so it backs out of the input the same way as if you had entered nothing. |
sanitize_ooccolor | Makes sure the input color is text with a # at the start followed by 6 hexadecimal characters. Examples: "#ff1234", "#A38321", COLOR_GREEN_GRAY |
scramble_message_replace_chars | Slightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML! |
seedify | Finds and extracts seeds from an object |
send2adminchat | Sends a message to TGS admin chat channels. |
send2chat | Sends a message to TGS chat channels. |
send2otherserver | Sends a message to a set of cross-communications-enabled servers using world topic calls |
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. |
simple_network_name_fix | Network name should be all caps and no punctuation except for _ and . between domains This does a quick an dirty fix to a network name to make sure it works |
siunit | Formats a number to human readable form with the appropriate SI unit. |
siunit_pressure | |
slur | Makes you speak like you're drunk |
stars | Convert random parts of a passed in message to stars |
start_unequip_mob | A utility function for /datum/strippable_item s to start unequipping an item from a mob. |
status_bar_set_text | Set status bar text for the provided target . |
string_list | Caches lists with non-numeric stringify-able values (text or typepath). |
stripped_input | Used to get a properly sanitized input, of max_length no_trim is self explanatory but it prevents the input from being trimed if you intend to parse newlines or whitespace. |
stutter | Adds stuttering to the message passed in |
syndies_escaped | Returns whether or not syndicate operatives escaped. |
techweb_item_boost_check | Returns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list() |
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 | Creates an asynchronous TGUI input list 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. |
tool_behaviour_name | returns an ic name of the tool needed Arguments: |
truncate | Truncate a string to the given length |
typecacheof | Like typesof() or subtypesof(), but returns a typecache instead of a list |
ui_status_only_living | Returns a UI status such that the dead will be able to watch, but not interact. |
ui_status_silicon_has_access | Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled. |
ui_status_user_has_free_hands | Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch. |
ui_status_user_is_abled | Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive. |
ui_status_user_is_adjacent | Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living ] check for finer observer interactions. |
ui_status_user_is_advanced_tool_user | Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch. |
ui_status_user_is_conscious_and_lying_down | Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise. |
ui_status_user_strictly_adjacent | Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise. |
unformat_frequency | Opposite of format, returns as a number |
url2htmlloader | Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn. |
valid_window_location | Checks whether the target turf is in a valid state to accept a directional window or other directional pseudo-dense object such as railings. |
voice_of_god | VOICE OF GOD |
weekday_to_iso | Returns a string day as an integer in ISO format 1 (Monday) - 7 (Sunday) |
wendigo_slam | Slams the ground around the source throwing back enemies caught nearby, delay is for the radius increase |
woundscan | Displays wounds with extended information on their status vs medscanners |
zone2body_parts_covered | For finding out what body parts a body zone covers, the inverse of the below basically |
Var Details
Failsafe

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

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

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

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

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

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

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

The subsystem used to tick /datum/component/acid instances.
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
SSeigenstates

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

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

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

Cached list of possible quirks
SSrunechat

Runechat Subsystem
Maintains a timer-like system to handle destruction of runechat messages. Much of this code is modeled after or adapted from the timer subsystem.
Note that this has the same structure for storing and queueing messages as the timer subsystem does for handling timers: the bucket_list is a list of chatmessage datums, each of which are the head of a circularly linked list. Any given index in bucket_list could be null, representing an empty bucket.
SStgui

tgui subsystem
Contains all tgui state and subsystem code.
SStime_track

The reference to the end of round sound that we have chosen.
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.
Proc Details
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.
HeapPathWeightCompare
TODO: Macro this to reduce proc overhead
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.
_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
_alert_drones
Broadcast a message to all drones in a faction
Arguments:
- msg - The message to send
- dead_can_hear - Boolean that determines if ghosts can hear the message (
FALSE
by default) - source - /atom source that created the message
- faction_checked_mob - /mob/living to determine faction matches from
- exact_faction_match - Passed to /mob/proc/faction_check_mob
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_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
arm_up_new_crew
signal proc to give guns to new crewmembers
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()]
build_chemical_reagent_list
These are used in the reagents subsystem init() and the reagent_id_typos.dm
build_exploration_site_ui_data
Helper proc for exploration site listings in ui.
build_medicine_reagents
Just grab every craftable medicine you can think off
call_emergency_meeting
If the announcer overrides alert messages, use that message. Summon the crew for an emergency meeting
Teleports the crew to a specified area, and tells everyone (via an announcement) who called the meeting. Should only be used during april fools! Arguments:
- user - Mob who called the meeting
- button_zone - Area where the meeting was called and where everyone will get teleported to
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
checkCardDatums
Checks the global card list for cards that don't override all the default values of the card datum
checkCardDistribution
Used to test open a large amount of cardpacks
checkCardpacks
Checks the passed type list for missing raritys, or raritys out of bounds
check_zone
Convert a PRECISE ZONE into the BODY_ZONE
clearCards
Empty the rarity cache so we can safely add new cards
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.
color_to_full_rgba_matrix
Converts RGB shorthands into RGBA matrices complete of constants rows (ergo a 20 keys list in byond).
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.
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.
create_mafia_game
Creates the global datum for playing mafia games, destroys the last if that's required and returns the new.
create_strippable_list
Creates an assoc list of keys to /datum/strippable_item
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 it's conclusion
cultslur
Makes you talk like you got cult stunned, which is slurring but with some dark messages
debug_variable
Get displayed variable in VV variable list
default_ui_state
The sane defaults for a UI such as a computer or a machine.
deltimer
Delete a timer
Arguments:
- id a timerid or a /datum/timedevent
derpspeech
Convert a message to derpy speak
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_after_mob
Timed action involving at least one mob user and a list of targets. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once.
do_mob
Timed action involving two mobs, the user and the target. interaction_key is the assoc key under which the do_after is capped under, and the max interaction count is how many of this interaction you can do at once.
emissive_appearance
Produces a mutable appearance glued to the EMISSIVE_PLANE dyed to be the EMISSIVE_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.
ending_helper
Helper to set the round to end asap. Current usage Cult round end code
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.
find_reagent
Returns reagent datum from typepath
find_record
Returns datum/data/record
findname
Find if the message has the real name of any user mob in the mob_list
finish_unequip_mob
A utility function for /datum/strippable_item
s to finish unequipping an item from a mob.
firing_squad
firing_squad is a proc for the :B:erforate smite to shoot each individual bullet at them, so that we can add actual delays without sleep() nonsense
Hilariously, if you drag someone away mid smite, the bullets will still chase after them from the original spot, possibly hitting other people. Too funny to fix imo
Arguments:
- 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_day_of_month
Returns the first day of the given year and month in number format, from 1 (monday) - 7 (sunday).
flop_animation
This animation should be applied to actual parent atom instead of vc_object.
format_frequency
Format frequency by moving the decimal.
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_chemwiki_line
Generate the big list of reagent based reactions. style='background-color:#FFEE88;'|{{anchor|Synthetic-derived growth factor}}Synthetic-derived growth factorâ®
generate_fish
Automatically generates object of given base path from the behaviour type in loc
generate_generator_index
Creates generator__id => type map.
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.
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_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_allowed_instrument_ids
Get all non admin_only instruments as a list of text ids.
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_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_chem_id
Returns reagent datum from reagent name string
get_distribution
This is a pretty complicated algorithm, but it's one I'm rather proud of.
This is the function that is responsible for taking the list of preferences, and spitting out what to put them in.
However, it should, wherever possible, prevent solo departments. That means that if there's one medical officer, and one engineering officer, that they should be put onto the same department (either medical or engineering).
The first step is to get the "distribution". This describes how many officers
should be in each department, no matter what they are.
This is handled in get_distribution
. Examples of inputs/outputs are:
get_distribution(1, 4) => [1]
get_distribution(2, 4) => [2]
get_distribution(3, 4) => [3] # If this returned [2, 1], then we'd get a loner.
get_distribution(4, 4) => [2, 2] # We have enough to put into a separate group
Once this distribution is received, the next step is to figure out where to put everyone.
If all members have no preference, just make one an unused department (from the departments argument). Then, call ourselves again.
Order the groups from most populated to least.
If the top group has enough officers who actually want that department, then we give it to them. If there are any leftovers (for example, if 3 officers want medical, but we only want 2), then we update those to have no preference instead.
If the top group does NOT have enough officers, then we kill the least popular group by setting them all to have no preference.
Anyone in the most popular group will be removed from the list, and the final tally will be updated. In the case of not having enough officers, this is a no-op, as there won't be any in the most popular group yet.
If there are any candidates left, then we call the algorithm again, but for everyone who hasn't been selected yet. We take the results from that run, and put them in the correct order.
As an example, let's assume we have the following preferences: [engineer, medical, medical, medical, medical, cargo]
The distribution of this is [2, 2, 2], meaning there will be 3 departments chosen and they will have 2 each. We order from most popular to least popular and get:
- medical: 4
- engineer: 1
- cargo: 1
We need 2 to fill the first group. There are enough medical staff to do it. Thus, we take the first 2 medical staff and update the output, making it now: [engineer, medical, medical, ?, ?, cargo].
The remaining two want-to-be-medical officers are now updated to act as no preference. We run the algorithm again. This time, are candidates are [engineer, none, none, cargo]. The distribution of this is [2, 2]. The frequency is:
- engineer: 1
- cargo: 1
- no preference: 2
We need 2 to fill the engineering group, but only have one who wants to do it. We have enough no preferences for it, making our result: [engineer, engineer, none, cargo]. We run the algorithm again, but this time with: [none, cargo]. Frequency is:
- cargo: 1
- no preference: 1 Enough to fill cargo, etc, and we get [cargo, cargo].
These are all then compounded into one list.
In the case that all are no preference, it will pop the last department, and use that.
For example, if departments
is [engi, medical, cargo], and we have the preferences:
[none, none, none]...
Then we will just give them all cargo.
One of the most important parts of this algorithm is IT IS DETERMINISTIC. That means that this proc is 100% testable. Instead, to get random results, the preferences and departments are shuffled before the proc is ever called.
get_hearers_in_view
Returns a list of hearers in view(view_radius) from source (ignoring luminosity). uses important_recursive_contentsRECURSIVE_CONTENTS_HEARING_SENSITIVE
get_officer_departments
Returns the distribution of splitting the given security officers into departments. Return value is an assoc list of candidate => SEC_DEPT_*.
get_path_to
This file contains the stuff you need for using JPS (Jump Point Search) pathing, an alternative to A* that skips over large numbers of uninteresting tiles resulting in much quicker pathfinding solutions. Mind that diagonals cost the same as cardinal moves currently, so paths may look a bit strange, but should still be optimal.
This is the proc you use whenever you want to have pathfinding more complex than "try stepping towards the thing". If no path was found, returns an empty list, which is important for bots like medibots who expect an empty list rather than nothing.
Arguments:
- caller: The movable atom that's trying to find the path
- end: What we're trying to path to. It doesn't matter if this is a turf or some other atom, we're gonna just path to the turf it's on anyway
- max_distance: The maximum number of steps we can take in a given path to search (default: 30, 0 = infinite)
- mintargetdistance: Minimum distance to the target before path returns, could be used to get near a target, but not right to it - for an AI mob with a gun, for example.
- id: An ID card representing what access we have and what doors we can open. Its location relative to the pathing atom is irrelevant
- simulated_only: Whether we consider turfs without atmos simulation (AKA do we want to ignore space)
- exclude: If we want to avoid a specific turf, like if we're a mulebot who already got blocked by some turf
- skip_first: Whether or not to delete the first item in the path. This would be done because the first item is the starting tile, which can break movement for some creatures.
get_powernet_info_from_source
Extracts the powernet and cell of the provided power source
get_random_reagent_id
Returns a random reagent object minus blacklisted reagents
get_ranged_target_turf_direct
Get ranged target turf, but with direct targets as opposed to directions
Starts at atom A and gets the exact angle between A and target Moves from A with that angle, Range amount of times, until it stops, bound to map size Arguments:
- A - Initial Firer / Position
- target - Target to aim towards
- range - Distance of returned target turf from A
- offset - Angle offset, 180 input would make the returned target turf be in the opposite direction
get_reagent_type_from_product_string
Returns a list of chemical_reaction datums that have the input STRING as a product
get_recipe_from_reagent_product
Takes a type in and returns a list of associated recipes
get_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 differance between two temperatures
- change_rate (optional)(Default: 0.06) The rate of range multiplyer
getleftblocks
DNA HELPER-PROCS
getline
Get a list of turfs in a line from M
to N
.
Uses the ultra-fast Bresenham Line-Drawing Algorithm.
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.
hex2rgb
Converts "#RRGGBB" to list(0xRR, 0xGG, 0xBB)
htmlrendertext
Perform a whitespace cleanup on the text, similar to what HTML renderers do
This is useful if you want to better predict how text is going to look like when displaying it to a user.
HTML renderers collapse multiple whitespaces into one, trims prepending and appending spaces, among other things. This proc attempts to do the same thing.
HTML5 defines whitespace pretty much exactly like regex defines the \s
group, [ \t\r\n\f]
.
Arguments:
- t - The text to "render"
icon2base64
Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)
init_crafting_recipes
Inits the crafting recipe list, sorting crafting recipe requirements in the process.
init_keybindings
Creates and sorts all the keybinding datums
init_subtypes_w_path_keys
Functions like init_subtypes, but uses the subtype's path as a key for easy access
ionnum
is at the start to prevent us from changing say modes via get_message_mode()
isAdminGhostAI
Is the passed in mob an admin ghost WITH AI INTERACT enabled
isAdminObserver
Is the passed in mob a ghost with admin powers, doesn't check for AI interact like isAdminGhost() used to
is_convertable_to_cult
Returns whether the given mob is convertable to the blood cult
is_special_character
Returns TRUE if the game has started and we're either an AI with a 0th law, or we're someone with a special role/antag datum
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
loadAllCardFiles
Loads all the card files
loadCardFile
Loads the contents of a json file into our global card list
load_adventures
Loads all adventures from DB
load_map
Shortcut function to parse a map and apply it to the world.
dmm_file
: A .dmm file to load (Required).x_offset
,y_offset
,z_offset
: Positions representign where to load the map (Optional).cropMap
: When true, the map will be cropped to fit the existing world dimensions (Optional).measureOnly
: When true, no changes will be made to the world (Optional).no_changeturf
: When true, [/turf/proc/AfterChange] won't be called on loaded turfsx_lower
,x_upper
,y_lower
,y_upper
: Coordinates (relative to the map) to crop to (Optional).placeOnTop
: Whether to use [/turf/proc/PlaceOnTop] rather than [/turf/proc/ChangeTurf] (Optional).
load_poll_data
Loads all current and future server polls and their options to store both as datums.
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_directed_talk
Helper for logging of messages with only one sender and receiver
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
magic_up_new_crew
signal proc to give magic to new crewmembers
make_datum_references_lists
Initial Building
make_tuple
Returns the name of the mathematical tuple of same length as the number arg (rounded down).
md5asfile
Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
md5filepath
Returns the md5 of a file at a given path.
message_centcom
Used by communications consoles to message CentCom
message_syndicate
Used by communications consoles to message the Syndicate
message_to_html
Message-related procs
Message format (/list):
- type - Message type, must be one of defines in
code/__DEFINES/chat.dm
- text - Plain message text
- html - HTML message text
- Optional metadata, can be any key/value pair.
Copyright (c) 2020 Aleksej Komarov SPDX-License-Identifier: MIT
movespeed_data_null_check
Checks if a move speed modifier is valid and not missing any data
mutable_appearance
Helper similar to image()
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()]
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
pick_n_take
Pick a random element from the list and remove it from the list.
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.
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.
printAllCards
Prints all the cards names
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.
ran_zone
Return the zone or randomly, another valid zone
probability controls the chance it chooses the passed in zone, or another random zone defaults to 80
random_bounty
-
Returns a new bounty of random type, but does not add it to GLOB.bounties_list.
-
*Guided determines what specific catagory of bounty should be chosen.
random_fish_type
Returns random fish, using random_case_rarity probabilities.
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.
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
reject_bad_name
Filters out undesirable characters from names.
- strict - return null immidiately instead of filtering out
- allow_numbers - allows numbers and common special characters - used for silicon/other weird things names
reloadAllCardFiles
Reloads all card files
remove_image_from_client
Removes an image from a client's .images
. Useful as a callback.
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
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.
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
rustg_get_version
Gets the version of rust_g
sanitize_css_class_name
Removes all non-alphanumerics from the text, keep in mind this can lead to id conflicts
sanitize_frequency
Ensure the frequency is within bounds of what it should be sending/receiving at
sanitize_name
returns nothing with an alert instead of the message if it contains something in the ic filter, and sanitizes normally if the name is fine. It returns nothing so it backs out of the input the same way as if you had entered nothing.
sanitize_ooccolor
Makes sure the input color is text with a # at the start followed by 6 hexadecimal characters. Examples: "#ff1234", "#A38321", COLOR_GREEN_GRAY
scramble_message_replace_chars
Slightly expensive proc to scramble a message using equal probabilities of character replacement from a list. DOES NOT SUPPORT HTML!
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
send2adminchat
Sends a message to TGS admin chat channels.
category - The category of the mssage. message - The message to send.
send2chat
Sends a message to TGS chat channels.
message - The message to send. channel_tag - Required. If "", the message with be sent to all connected (Game-type for TGS3) channels. Otherwise, it will be sent to TGS4 channels with that tag (Delimited by ','s).
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
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.
simple_network_name_fix
Network name should be all caps and no punctuation except for _ and . between domains This does a quick an dirty fix to a network name to make sure it works
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_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()
slur
Makes you speak like you're drunk
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_unequip_mob
A utility function for /datum/strippable_item
s to start unequipping an item from a mob.
status_bar_set_text
Set status bar text for the provided target
.
Target can be either of /client
or /mob
.
string_list
Caches lists with non-numeric stringify-able values (text or typepath).
stripped_input
Used to get a properly sanitized input, of max_length no_trim is self explanatory but it prevents the input from being trimed if you intend to parse newlines or whitespace.
stutter
Adds stuttering to the message passed in
syndies_escaped
Returns whether or not syndicate operatives escaped.
techweb_item_boost_check
Returns an associative list of techweb node datums with values of the boost it gives. var/list/returned = list()
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
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.
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.
tool_behaviour_name
returns an ic name of the tool needed Arguments:
- tool_behaviour: the tool described!
truncate
Truncate a string to the given length
Will only truncate if the string is larger than the length and ignores unicode concerns
This exists soley because trim does other stuff too.
Arguments:
- text - String
- max_length - integer length to truncate at
typecacheof
Like typesof() or subtypesof(), but returns a typecache instead of a list
ui_status_only_living
Returns a UI status such that the dead will be able to watch, but not interact.
ui_status_silicon_has_access
Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.
ui_status_user_has_free_hands
Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.
ui_status_user_is_abled
Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacent
Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living
] check for finer observer interactions.
ui_status_user_is_advanced_tool_user
Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_is_conscious_and_lying_down
Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacent
Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
unformat_frequency
Opposite of format, returns as a number
url2htmlloader
Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
valid_window_location
Checks whether the target turf is in a valid state to accept a directional window or other directional pseudo-dense object such as railings.
Returns FALSE if the target turf cannot accept a directional window or railing. Returns TRUE otherwise.
Arguments:
- dest_turf - The destination turf to check for existing windows and railings
- test_dir - The prospective dir of some atom you'd like to put on this turf.
- is_fulltile - Whether the thing you're attempting to move to this turf takes up the entire tile or whether it supports multiple movable atoms on its tile.
voice_of_god
VOICE OF GOD
weekday_to_iso
Returns a string day as an integer in ISO format 1 (Monday) - 7 (Sunday)
wendigo_slam
Slams the ground around the source throwing back enemies caught nearby, delay is for the radius increase
woundscan
Displays wounds with extended information on their status vs medscanners
zone2body_parts_covered
For finding out what body parts a body zone covers, the inverse of the below basically