/tg/ Station 13 - Modules - Types

code/__HELPERS/turfs.dm

/proc/get_teleport_loc Returns location. Returns null if no location was found.
/proc/get_atom_on_turf Returns the 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. Optional arg 'type' to stop once it reaches a specific type instead of a turf.
/proc/get_nested_locs Returns a list of all locations (except the area) the movable is within.
/proc/get_edge_target_turf Returns the turf located at the map edge in the specified direction relative to target_atom used for mass driver
/proc/get_ranged_target_turf_direct Get ranged target turf, but with direct targets as opposed to directions
/proc/get_offset_target_turf returns turf relative to target_atom offset in dx and dy tiles, bound to map limits
/proc/get_turf_pixel Lets the turf this atom's ICON appears to inhabit it takes into account: Pixel_x/y Matrix x/y NOTE: if your atom has non-standard bounds then this proc will handle it, but: if the bounds are even, then there are an even amount of "middle" turfs, the one to the EAST, NORTH, or BOTH is picked this may seem bad, but you're atleast as close to the center of the atom as possible, better than byond's default loc being all the way off) if the bounds are odd, the true middle turf of the atom is returned
/proc/params_to_turf Returns a turf based on text inputs, original turf and viewing client
/proc/screen_loc_to_turf Almost identical to the params_to_turf(), but unused (remove?)
/proc/spiral_range_turfs similar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs)
/proc/get_random_station_turf Returns a random turf on the station
/proc/get_safe_random_station_turf Returns a random turf on the station, excludes dense turfs (like walls) and areas that have valid_territory set to FALSE
/proc/valid_window_location Checks whether the target turf is in a valid state to accept a directional window or other directional pseudo-dense object such as railings.