_std/macros/dir.dm

is_cardinal | returns true if a direction is cardinal |
---|---|
angle2dir | Given an angle, matches it to the closest direction and returns it. |
/proc/vector_magnitude | Returns the vector magnitude of an x value and a y value |
/proc/vector_to_dir | Transforms a supplied vector x & y to a direction |
/proc/angle_to_dir | Transforms a given angle to a cardinal/ordinal direction |
/proc/dir_to_angle | Transforms a cardinal/ordinal direction to an angle |
/proc/angle_inbetween | Checks if an angle is between two other angles |
/proc/angle_to_vector | Transforms a given angle to vec2 in a list |
turn_needed | Calculates the angle you need to pass to the turn proc to get dir_to from dir_from turn(dir, turn_needed(dir, dir_to)) = dir_to |
get_step_truly_rand | BYOND's default get_step_rand() is not actually uniformly random (heavily biased towards dir). This is a replacement that is actually uniformly random. |
get_step_rand_cardinal | Returns a tile in a random cardinal direction |
Define Details
angle2dir
Given an angle, matches it to the closest direction and returns it.
get_step_rand_cardinal
Returns a tile in a random cardinal direction
get_step_truly_rand
BYOND's default get_step_rand() is not actually uniformly random (heavily biased towards dir). This is a replacement that is actually uniformly random.
is_cardinal
returns true if a direction is cardinal
turn_needed
Calculates the angle you need to pass to the turn proc to get dir_to from dir_from turn(dir, turn_needed(dir, dir_to)) = dir_to