Greetings everyone! Another small supplemental library from Bravo1! whoo!
NOTE: This library is meant to be used with the get_ procs library!
This library adds the functionality of field of view to mobs, with some simple (yet lengthy) procs.
fov=90 this is the default field of view, and all atoms have it in case you're not looking to use this just for mobs.
inFOV(atom/a) - returns true if the given atom (a) is within the fov of src. nfov can be used in place of src's fov.
FOVlist(dist,nfov) - returns a list of all atoms at the given distance (dist) in tileswithin the FOV of the atom calling it.
nfov is a number that can be used in place of the FOV of the atom calling the proc.
inFOV_mobs(mob/a) - returns true if the given mon (a) is within the fov of src. Much more accurate than inFOV() but only works for mobs.
Once again, nfov can be used in place of src's fov.
FOVlist_mobs(dist,nfov) - the same as FOV() however it has a few key differences. dist is done in pixels instead of tiles and is then converted so that a circular range (instead of BYONDs square range) can
be used for distance. This also uses bound_dist to find the distance to the mobs, and get_angle_step to procure a more accurate angle between src and the mobs it's checking.
This will return a list of only the mobs in the given FOV and can only be called by mobs as a result. Once again, nfov can be used instead of the src mob's regular fov.
Once again! NOTE: this library requires my get_ procs library. go download it too. It's cool.
1/11/2013: Updated library to include a demo.
1/10/2013: Updated how inFOV works to be much more efficient, as well as removed the need for inFOV_mobs by checking to see if both src and the target are both mobs, then switching to get_angle_step() if they are.
1/10/2013: Added in inFOV() and inFOV_mobs by request. FOV() and FOV() mobs changed to FOVlist() and FOVlist_mobs()