Goonstation 13 - Modules - Types

code/procs/helpers.dm

/proc/s_esReturns the plural based on a number provided.
/proc/isUpperReturns true if the char you feed it is uppercase.
/proc/getLineMatrixReturns the line matrix from a start atom to an end atom, used in creating line objects
/proc/showLineCreates and shows a line object. Line object has an "affected" var that contains the cross tiles.
/proc/get_angleReturns the angle between two given atoms
/proc/tidy_net_dataCleans up data passed in from network packets for display so it doesn't mess with formatting
/proc/add_zeroAdds zeroes to the beginning of a string until it reaches the desired length
/proc/pad_leadingAdds char ahead of text until it reaches length characters total
/proc/pad_trailingAdds char after text until it reaches length characters total
/proc/separate_radio_prefix_and_messageGiven a message, returns a list containing the radio prefix and the message, so that the message can be manipulated seperately in various functions.
/proc/angle2textReturns the given degree converted to a text string in the form of a direction
/proc/IsGuestKeyReturns true if the given key is a guest key
/proc/sanitize_frequencyReturns f, ensured that it's a valid frequency
/proc/get_adjacent_floorReturns 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_hexReturns true if given value is a hex value
/proc/get_top_ancestorGet the highest ancestor of this object in the tree that is an immediate child of a given ancestor.
/proc/o_clock_timeReturns the current timeofday in o'clock format
/proc/formatTimeTextReturns time input as mm:ss
/proc/formattedShiftTimeReturns shift time as a string in hh:mm format. Call with TRUE to get time in hh:mm:ss format.
/proc/eligible_dead_player_listReturns a list of eligible dead players that COULD choose to respawn or whatever
/proc/dead_player_listReturns 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_playersReturns a randomized list of minds with players who joined as observer at the back
/proc/log_respawn_eventLogs 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/whoisLooks up a player based on a string. Searches a shit load of things whoa. Returns a list of mob refs.
/proc/ckey_to_mobA universal ckey -> mob reference lookup proc, adapted from whois() (Convair880).
/proc/ckey_to_mob_maybe_disconnectedGiven a ckey finds a mob with that ckey even if they are not in the game.
/proc/whodeadFinds whoever's dead.
/proc/random_hexReturns random hex value of length given
/proc/dectalkdectalk SAYS its default volume is 5 but it seems to actually be more like 100
/proc/hex2color_nameGiven hex color, returns string name of nearest named color
/proc/sonic_attack_environmental_effectGiven 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_styleReturns hud style preferences of given client/mob
/proc/get_all_mobs_inReturns list of all mobs within an atom. Not cheap! (unlike ur mum)
/proc/get_standard_skintoneGiven user, will proompt user to select skin color from list (or custom) and returns skin tone after blending
/proc/blend_skintoneBlends given rgb values with old human mob skin color (#ffca95) to return a new rgb value
/proc/getRoleReturns a string based on the current job and antag role of the mob e.g. "Staff Assistant [Traitor]"
/proc/isadminReturns true if given mob/client/mind is an admin
/proc/gradientTextRepeat a gradient between two colors across text. Note: This is inaccurate because its a linear transformation, but human eyes do not perceive color this way.
/proc/radioGarbleTextReturns given text replaced by nonsense chars, excepting HTML tags, on a 40% or given % basis
/proc/illiterateGarbleTextReturns given text replaced entirely by nonsense chars
/proc/getTimeInSecondsSinceTimeReturns the time in seconds since a given timestamp
/proc/getIconSizeHandles the two states icon_size can be in: basic number, or string in WxH format
/proc/getClientFromCkeyFinds a client by ckey, throws exception if not found
/proc/check_whitelistRemoves non-whitelisted reagents from the reagents of TA
/proc/in_cone_of_visionThis proc checks if one atom is in the cone of vision of another one.
/proc/time_to_textReturns the passed decisecond-format time in the form of a text string
/proc/can_actReturns true if not incapicitated and unhandcuffed (by default)
/proc/is_incapacitatedReturns true if the given mob is incapacitated
/proc/get_all_character_setup_ringtonessets up the list of ringtones players can select through character setup
/proc/connectdirs_to_byonddirsconverts get_connected_directions_bitflag() diagonal bits to byond direction flags
/proc/do_hud_offset_thingadjusts a screen_loc to account for non-32px-width sprites, so they get centered in a HUD slot
/proc/log_objectFor logs- returns the thing's name and type. Handles nulls and non-datums fine, might do something weird for savefiles, clients, etc
/proc/identify_objectFor runtime logs- returns the above plus ref
/proc/random_splitReturns amount evenly distributed random integers that sum to sum
/proc/total_densityReturns the sum of densities of all atoms in the given turf including the turf itself
/proc/total_crossChecks if Cross succeeds for the turf and all atoms in it
/proc/find_clientFind a client based on ckey
/proc/get_random_station_storage_listReturn a list of station-level storage objects that are safe to spawn things into
/proc/findLastMatchreturns the position of the last matching needle in haystack, case sensitive
/proc/findLastMatchExreturns the position of the last matching needle in haystack, case insensitive
/proc/get_tgm_maxxreturns the maxx value of a TGM formatted map. Accepts either a map file or preread map text data
/proc/get_tgm_maxyreturns the maxy value of a TGM formatted map. Accepts either a map file or preread map text data
/proc/search_snippetReturns an html input and a script which allows to toggle elements of a certain class visible or hidden depending what filter the user types in the input.