_std/macros/dist.dm
GET_DIST | Returns distance of two objects in tiles like get_dist but being inside another object doesn't break it and being on a different z-level returns INFINITY |
---|---|
BOUNDS_DIST | Returns 0 if A and B are on adjacent turfs, through any amount of nested objs/mobs. Otherwise returns bounds_dist. |
IN_RANGE | Returns if A is in range of B given range |
GET_MANHATTAN_DIST | Returns the manhattan distance between two turfs or movable objects |
GET_SQUARED_EUCLIDEAN_DIST | Returns the squared euclidean distance between two turfs or movable objects This is helpful in cases where the exact distance is not needed, so you can avoid the sqrt |
GET_EUCLIDEAN_DIST | Returns the euclidean distance between two turfs or movable objects |
IN_EUCLIDEAN_RANGE | Returns if A is in range of B given range using the euclidean metric |
Define Details
BOUNDS_DIST
Returns 0 if A and B are on adjacent turfs, through any amount of nested objs/mobs. Otherwise returns bounds_dist.
GET_DIST
Returns distance of two objects in tiles like get_dist but being inside another object doesn't break it and being on a different z-level returns INFINITY
GET_EUCLIDEAN_DIST
Returns the euclidean distance between two turfs or movable objects
GET_MANHATTAN_DIST
Returns the manhattan distance between two turfs or movable objects
GET_SQUARED_EUCLIDEAN_DIST
Returns the squared euclidean distance between two turfs or movable objects This is helpful in cases where the exact distance is not needed, so you can avoid the sqrt
IN_EUCLIDEAN_RANGE
Returns if A is in range of B given range using the euclidean metric
IN_RANGE
Returns if A is in range of B given range