code/__HELPERS/unsorted.dm

NAMEOF | NAMEOF: Compile time checked variable name to string conversion evaluates to a string equal to "X", but compile errors if X isn't a var on datum. datum may be null, but it does need to be a typed var. |
---|---|
NAMEOF_STATIC | NAMEOF that actually works in static definitions because src::type requires src to be defined |
/proc/angle_to_dir | Returns one of the 8 directions based on an angle |
/proc/angle_to_cardinal_dir | Returns one of the 4 cardinal directions based on an angle |
/proc/get_between_angles | returns degrees between two angles |
/proc/LinkBlocked | Returns true if the path from A to B is blocked. Checks both paths where the direction is diagonal |
/proc/DirBlocked | Checks if moving in a direction is blocked |
/proc/TurfBlockedNonWindow | Returns true if any object on a turf is both dense and not a window |
/proc/get_closest_atom | Returns the closest atom of a specific type in a list from a source |
/proc/closest_cardinal_dir | If given a diagonal dir, return a corresponding cardinal dir. East/west preferred |
/proc/params2screenpixel | Converts a screen loc param to a x,y coordinate pixel on the screen |
/proc/weight_class_to_text | Returns a string based on the weight class define used as argument. |
/proc/weight_class_data | Returns an assoc list of WEIGHT CLASS TEXT = DESCRIPTION based on the arg you provide. Used by examine tags for giving each weight class a special description. |
/proc/semver_to_list | Converts a semver string into a list of numbers |
/proc/get_atom_on_turf | Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. |
/proc/get_sorted_areas | Returns a sorted version of GLOB.areas, by name |
/proc/dview | Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant). |
/proc/getpois | Returns a list of all items of interest with their name |
/proc/LeftAndRightOfDir | Returns the left and right dir of the input dir, used for AI stutter step while attacking |
/proc/get_areas | Takes: Area type as text string or as typepath OR an instance of the area. Returns: A list of all areas of that type in the world. |
/proc/get_nested_locs | Returns a list of all locations (except the area) the movable is within. |
/proc/generate_cone | Generates a cone shape. Any other checks should be handled with the resulting list. Can work with up to 359 degrees Variables: center - where the cone begins, or center of a circle drawn with this max_row_count - how many rows are checked starting_row - from how far should the turfs start getting included in the cone. -1 required to include center turf due to byond cone_width - big the angle of the cone is cone_direction - at what angle should the cone be made, relative to the game board's orientation blocked - whether the cone should take into consideration obstacles |
/proc/check_path | Draws a line between two atoms, then checks if the path is blocked Returns the last turf in the list it can successfully path to |
/proc/turf_block_check | Return TRUE if we have a block, return FALSE otherwise |
/proc/get_forward_square | Returns a rectangle of turfs in front of the center. |
Define Details
NAMEOF
NAMEOF: Compile time checked variable name to string conversion evaluates to a string equal to "X", but compile errors if X isn't a var on datum. datum may be null, but it does need to be a typed var.
NAMEOF_STATIC
NAMEOF that actually works in static definitions because src::type requires src to be defined