(global)

Vars | |
Failsafe | Failsafe |
---|---|
Master | StonedMC |
SSambience | The subsystem used to play ambience to users every now and then, makes them real excited. |
SScleanup | |
SSpersistent_data | |
SSrunechat | |
SStgui | tgui subsystem |
SStimer | |
Procs | |
HTTPGet | HTTP Get (Powered by RUSTG) |
MakeAPICall | Internal API Caller |
RoundDiagBar | Diagnostic HUDs! |
add_attack_logs | Creates attack (old and new) logs for the user and defense logs for the target. Will message admins depending on the custom_level, user and target. |
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. |
bang | Creates a flashing effect that blinds and deafens mobs within range |
broadcast_message | Message Broadcast Proc |
check_active_security_force | |
client2rankcolour | Proc to generate a "rank colour" from a client |
deltimer | Delete a timer |
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. |
empulse | Will cause an EMP on the given epicenter. This proc can sleep depending on the affected objects. So assume it sleeps! |
fire_flash_log | Flashfire is a proc used to log fire causing chemical reactions. |
get_all_linked_levels_zpos | Proc to get a list of all the linked-together Z-Levels |
get_allowed_instrument_ids | Get all non admin_only instruments as a list of text ids. |
get_antag_type_strings_list | A proc that return an array of capitalized strings containing name of the antag types they are |
get_antag_type_truncated_plaintext_string | A proc that return a string containing all the singled out antags . Empty string if not antag |
get_atoms_of_type | Returns a list of atoms in a location of a given type. Can be refined to look for pixel-shift. |
get_bbox_of_atoms | Get a bounding box of a list of atoms. |
get_channel_name | Returns the clean name of an audio channel. |
get_rad_contents | A special GetAllContents that doesn't search past things with rad insulation Components which return COMPONENT_BLOCK_RADIATION prevent further searching into that object's contents. The object itself will get returned still. The ignore list makes those objects never return at all |
get_valid_vent_spawns | Returns a list of vents that can be used as a potential spawn if they meet the criteria set by the arguments |
getline | Gets the turfs which are between the two given atoms. Including their positions Only works for atoms on the same Z level which is not 0. So an atom located in a non turf won't work Arguments: |
goonchem_vortex | Throws or pulls objects to/from a chem reaction |
is_bad_connection | Connection checker |
is_special_character | ADMIN HELPER PROCS A proc that return whether the mob is a "Special Character" aka Antagonist |
is_type_in_UID_list | If the list L contains a datum UID who's type matches D 's type, returns the UID of that datum in the list. Otherwise returns null. |
locateUID | Locates a datum based off of the UID |
makeDatumRefLists | Initial Building |
make_associative | A proc for turning a list into an associative list. |
message_adminTicket | |
message_mentorTicket | |
pick_multiple_unique | Picks multiple unique elements from the suplied list. If the given list has a length less than the amount given then it will return a list with an equal amount |
random_body_accessory | Returns a random body accessory for a given species name. Can be null based on is_optional argument. |
rustg_get_version | Gets the version of rust_g |
setupcult | . |
shake_camera | Shake the camera of the person viewing the mob SO REAL! |
start_watch | Returns "watch handle" (really just a timestamp :V) |
stop_watch | Returns number of seconds elapsed. @param wh number The "Watch Handle" from start_watch(). (timestamp) |
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
SSambience

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

Cleanup Subsystem
For now, all it does is periodically clean the supplied global lists of any null values they may contain.
Why is this important?
Sometimes, these lists can gain nulls due to errors.
For example, when a dead player trasitions from the dead_mob_list
to the alive_mob_list
, a null value may get stuck in the dead mob list.
This can cause issues when other code tries to do things with the values in the list, but are instead met with null values.
These problems are incredibly hard to track down and fix, so this subsystem is a solution to that.
SSpersistent_data

Persistent Data Subsystem
Provides a centralised handler for persistent data reading and writing. The subsystem does not do any actual spawning itself, as this focuses on objects and mobs Should anything that is turf persistence related added in, that can be chucked into this SS Its quite a simple subsystem. For now, anyways.
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. Made by Bobbahbrown of /tg/station13
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.
AA Note: One of the primary reasons for this is because each chatmessage has a timer attached to it, which is extra load on the GC At 150 population, the GC literally cannot keep up with processing 368,000 runechats and 368,000 extra timers in a 1 hour 30 minute round This also makes performance profiling a lot easier.
SStgui

tgui subsystem
Contains all tgui state and subsystem code.
SStimer

Timer Subsystem
Handles creation, callbacks, and destruction of timed events.
It is important to understand the buckets used in the timer subsystem are just a series of doubly-linked lists. The object at a given index in bucket_list is a /datum/timedevent, the head of a list, which has prev and next references for the respective elements in that bucket's list.
Proc Details
HTTPGet
HTTP Get (Powered by RUSTG)
This proc should be used as a replacement for [world.Export()] due to an underlying issue with it. See: https://www.byond.com/forum/post/2772166 The one thing you will need to be aware of is that this no longer wraps the response inside a "file", so anything that relies on a file2text() unwrap will need tweaking. RUST HTTP also has better support for HTTPS as well as weird quirks with modern webservers. Returns an assoc list that follows the standard [world.Export()] format (https://secure.byond.com/docs/ref/index.html#/world/proc/Export), with the above exception
Arguments:
- url - URL to GET
MakeAPICall
Internal API Caller
Makes calls to the internal Paradise API and returns a /datum/http_response.
Arguments:
- method - The relevant HTTP method to use
- path - The path of the API call. DO NOT USE A LEADING SLASH
- body - The request body, if applicable
RoundDiagBar
Diagnostic HUDs!
add_attack_logs
Creates attack (old and new) logs for the user and defense logs for the target. Will message admins depending on the custom_level, user and target.
custom_level will determine the log level set. Unless the target is SSD and there is a user doing it If custom_level is not set then the log level will be determined using the user and the target.
- Arguments:
- user - The thing doing it. Can be null
- target - The target of the attack
- what_done - What has happened
- custom_level - The log level override
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
bang
Creates a flashing effect that blinds and deafens mobs within range
Arguments:
- T - The turf to flash
- A - The flashing atom
- range - The range in tiles of the flash
- flash - Whether to flash (blind)
- bang - Whether to bang (deafen)
broadcast_message
Message Broadcast Proc
This big fat disaster is responsible for sending the message out to all headsets and radios on the station It is absolutely disgusting, but used to take about 20 arguments before I slimmed it down to just one Arguments:
- tcm - The tcomms message datum
check_active_security_force
- checks the security force on station and returns a list of numbers, of the form:
- total, active, dead, antag
- where active is defined as conscious (STAT = 0) and not an antag
client2rankcolour
Proc to generate a "rank colour" from a client
This takes the client and looks at various factors in order, such as patreon status, staff rank, and more Arguments:
- C - The client were looking up
deltimer
Delete a timer
Arguments:
- id a timerid or a /datum/timedevent
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.
empulse
Will cause an EMP on the given epicenter. This proc can sleep depending on the affected objects. So assume it sleeps!
epicenter - The center of the EMP. Can be an atom, as long as the given atom is on a turf (in)directly heavy_range - The max distance from the epicenter where objects will be get heavy EMPed light_range - The max distance from the epicenter where objects will get light EMPed log - Whether or not this action should be logged or not. Will use the cause if provided cause - The cause of the EMP. Used for the logging
fire_flash_log
Flashfire is a proc used to log fire causing chemical reactions.
Call this whenever you have a chemical reaction that makes fire flashes. Arguments:
- holder: the beaker that the reagent is in
- name: name of the reagent / reaction
get_all_linked_levels_zpos
Proc to get a list of all the linked-together Z-Levels
Returns a list of zlevel numbers which can be accessed from travelling space naturally
get_allowed_instrument_ids
Get all non admin_only instruments as a list of text ids.
get_antag_type_strings_list
A proc that return an array of capitalized strings containing name of the antag types they are
Arguments:
- M - the mob you're checking
get_antag_type_truncated_plaintext_string
A proc that return a string containing all the singled out antags . Empty string if not antag
Usually, you'd return a FALSE, but since this is consumed by javascript you're in for a world of hurt if you pass a byond FALSE which get converted into a fucking string anyway and pass for TRUE in check. Fuck. It always append "(May be other antag)" Arguments:
- M - the mob you're checking
get_atoms_of_type
Returns a list of atoms in a location of a given type. Can be refined to look for pixel-shift.
Arguments:
- loc - The atom to look in.
- type - The type to look for.
- check_shift - If true, will exclude atoms whose pixel_x/pixel_y do not match shift_x/shift_y.
- shift_x - If check_shift is true, atoms whose pixel_x is different to this will be excluded.
- shift_y - If check_shift is true, atoms whose pixel_y is different to this will be excluded.
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_channel_name
Returns the clean name of an audio channel.
Arguments:
- channel - The channel number.
get_rad_contents
A special GetAllContents that doesn't search past things with rad insulation Components which return COMPONENT_BLOCK_RADIATION prevent further searching into that object's contents. The object itself will get returned still. The ignore list makes those objects never return at all
get_valid_vent_spawns
Returns a list of vents that can be used as a potential spawn if they meet the criteria set by the arguments
Will not include parent-less vents to the returned list. Arguments:
- unwelded_only - Whether the list should only include vents that are unwelded
- exclude_mobs_nearby - Whether to exclude vents that are near living mobs
- min_network_size - The minimum length (non-inclusive) of the vent's parent network. A smaller number means vents in small networks (Security, Virology) will appear in the list
getline
Gets the turfs which are between the two given atoms. Including their positions Only works for atoms on the same Z level which is not 0. So an atom located in a non turf won't work Arguments:
- M - The source atom
- N - The target atom
goonchem_vortex
Throws or pulls objects to/from a chem reaction
Scales the amount of objects thrown with the volume, unless ignore_volume is TRUE
Arguments:
- T - The turf to use as the throw from/to point
- pull - Do we want to pull objects towards T (TRUE) or push them away from it (FALSE)
- volume - The volume of reagents. Used to scale the effect is ignore_volume = FALSE
- ignore_volume - Do we want to ignore the volume of reagents and just throw regardless
is_bad_connection
Connection checker
Checks the connection frequency against the intended frequency for the message NOTE: I barely know what on earth this does, but it works and it scares me Arguments:
- old_freq - Frequency of the connection
- new_freq - Frequency of the message
is_special_character
ADMIN HELPER PROCS A proc that return whether the mob is a "Special Character" aka Antagonist
Arguments:
- M - the mob you're checking
is_type_in_UID_list
If the list L
contains a datum UID who's type matches D
's type, returns the UID of that datum in the list. Otherwise returns null.
locateUID
Locates a datum based off of the UID
Replacement for locate() which takes a UID instead of a ref Returns the datum, if found
makeDatumRefLists
Initial Building
make_associative
A proc for turning a list into an associative list.
A simple proc for turning all things in a list into an associative list, instead Each item in the list will have an associative value of TRUE
Arguments:
- flat_list - the list that it passes to make associative
message_adminTicket
- Sends a message to the staff able to see admin tickets
- Arguments:
- msg - The message being send
- important - If the message is important. If TRUE it will ignore the CHAT_NO_TICKETLOGS preferences, send a sound and flash the window. Defaults to FALSE
message_mentorTicket
- Sends a message to the staff able to see mentor tickets
- Arguments:
- msg - The message being send
- important - If the message is important. If TRUE it will ignore the CHAT_NO_TICKETLOGS preferences, send a sound and flash the window. Defaults to FALSE
pick_multiple_unique
Picks multiple unique elements from the suplied list. If the given list has a length less than the amount given then it will return a list with an equal amount
Arguments:
- listfrom - The list where to pick from
- amount - The amount of elements it tries to pick.
random_body_accessory
Returns a random body accessory for a given species name. Can be null based on is_optional argument.
Arguments:
- species - The name of the species to filter valid body accessories.
- is_optional - Whether no body accessory (null) is an option.
rustg_get_version
Gets the version of rust_g
setupcult
.
shake_camera
Shake the camera of the person viewing the mob SO REAL!
start_watch
Returns "watch handle" (really just a timestamp :V)
stop_watch
Returns number of seconds elapsed. @param wh number The "Watch Handle" from start_watch(). (timestamp)