Goonstation 13 - Modules - Types

code/procs/helpers.dm

/proc/s_es Returns the plural based on a number provided.
/proc/isUpper Returns true if the char you feed it is uppercase.
/proc/getLineMatrix Returns the line matrix from a start atom to an end atom, used in creating line objects
/proc/showLine Creates and shows a line object. Line object has an "affected" var that contains the cross tiles.
/proc/get_angle Returns the angle between two given atoms
/proc/tidy_net_data Cleans up data passed in from network packets for display so it doesn't mess with formatting
/proc/separate_radio_prefix_and_message Given a message, returns a list containing the radio prefix and the message, so that the message can be manipulated seperately in various functions.
/proc/angle2text Returns the given degree converted to a text string in the form of a direction
/proc/IsGuestKey Returns true if the given key is a guest key
/proc/sanitize_frequency Returns f, ensured that it's a valid frequency
/proc/get_adjacent_floor Returns the turf facing the fab for cardinal directions (which should also be the user's turf), but for diagonals it returns a neighbouring turf depending on where you click Just in case you're attacking a corner diagonally. (made initially for lamp manufacturers, probably behaves funky above range 1)
/proc/is_hex Returns true if given value is a hex value
/proc/o_clock_time Returns the current timeofday in o'clock format
/proc/formatTimeText Returns time input as mm:ss
/proc/formattedShiftTime Returns shift time as a string in hh:mm format. Call with TRUE to get time in hh:mm:ss format.
/proc/eligible_dead_player_list Returns a list of eligible dead players that COULD choose to respawn or whatever
/proc/dead_player_list Returns a list of eligible dead players to be respawned as an antagonist or whatever (Convair880). Text messages: 1: alert | 2: alert (chatbox) | 3: alert acknowledged (chatbox) | 4: no longer eligible (chatbox) | 5: waited too long (chatbox) for_antag indicates that we are polling for an antag role and so should exclude antag-banned players
/proc/prioritize_dead_players Returns a randomized list of minds with players who joined as observer at the back
/proc/log_respawn_event Logs a player respawning as something from a respawn event, noting if they joined the round as an observer or not Note: should be called BEFORE they are transferred to the new body
/proc/whois Looks up a player based on a string. Searches a shit load of things whoa. Returns a list of mob refs.
/proc/ckey_to_mob A universal ckey -> mob reference lookup proc, adapted from whois() (Convair880).
/proc/ckey_to_mob_maybe_disconnected Given a ckey finds a mob with that ckey even if they are not in the game.
/proc/whodead Finds whoever's dead.
/proc/random_hex Returns random hex value of length given
/proc/hex2color_name Given hex color, returns string name of nearest named color
/proc/sonic_attack_environmental_effect Given center turf/atom, range, and list of things to smash, will damage said objects within range of center. Used for sonic grenades and similar. Avoiding C&P Code.
/proc/get_hud_style Returns hud style preferences of given client/mob
/proc/get_all_mobs_in Returns list of all mobs within an atom. Not cheap! (unlike ur mum)
/proc/get_standard_skintone Given user, will proompt user to select skin color from list (or custom) and returns skin tone after blending
/proc/blend_skintone Blends given rgb values with old human mob skin color (#ffca95) to return a new rgb value
/proc/getRole Returns a string based on the current job and antag role of the mob e.g. "Staff Assistant [Traitor]"
/proc/isadmin Returns true if given mob/client/mind is an admin
/proc/gradientText Returns span with a color gradient between two given colors of given message
/proc/radioGarbleText Returns given text replaced by nonsense chars, excepting HTML tags, on a 40% or given % basis
/proc/illiterateGarbleText Returns given text replaced entirely by nonsense chars
/proc/getTimeInSecondsSinceTime Returns the time in seconds since a given timestamp
/proc/getIconSize Handles the two states icon_size can be in: basic number, or string in WxH format
/proc/getClientFromCkey Finds a client by ckey, throws exception if not found
/proc/check_whitelist Removes non-whitelisted reagents from the reagents of TA
/proc/in_cone_of_vision This proc checks if one atom is in the cone of vision of another one.
/proc/time_to_text Returns the passed decisecond-format time in the form of a text string
/proc/can_act Returns true if not incapicitated and unhandcuffed (by default)
/proc/is_incapacitated Returns true if the given mob is incapacitated
/proc/get_all_character_setup_ringtones sets up the list of ringtones players can select through character setup
/proc/connectdirs_to_byonddirs converts get_connected_directions_bitflag() diagonal bits to byond direction flags
/proc/do_hud_offset_thing adjusts a screen_loc to account for non-32px-width sprites, so they get centered in a HUD slot
/proc/log_object For logs- returns the thing's name and type. Handles nulls and non-datums fine, might do something weird for savefiles, clients, etc
/proc/identify_object For runtime logs- returns the above plus ref
/proc/random_split Returns amount evenly distributed random integers that sum to sum
/proc/total_density Returns the sum of densities of all atoms in the given turf including the turf itself
/proc/total_cross Checks if Cross succeeds for the turf and all atoms in it
/proc/find_client Find a client based on ckey