Goonstation 13 - Modules - TypesDefine Details

# _std/macros/dir.dm is_cardinal returns true if a direction is cardinal Given an angle, matches it to the closest direction and returns it. Returns the vector magnitude of an x value and a y value Transforms a supplied vector x & y to a direction Transforms a given angle to a cardinal/ordinal direction Transforms a cardinal/ordinal direction to an angle Checks if an angle is between two other angles Transforms a given angle to vec2 in a list 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 BYOND's default get_step_rand() is not actually uniformly random (heavily biased towards dir). This is a replacement that is actually uniformly random. Returns a tile in a random cardinal direction

## Define Details

### #define angle2dir (X) Given an angle, matches it to the closest direction and returns it.

### #define get_step_rand_cardinal (O) Returns a tile in a random cardinal direction

### #define get_step_truly_rand (O) BYOND's default get_step_rand() is not actually uniformly random (heavily biased towards dir). This is a replacement that is actually uniformly random.

### #define is_cardinal (DIR) returns true if a direction is cardinal

### #define turn_needed (dir_from, dir_to) 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