ID:271833
 
how does one cheak to see if they are faceing a mob

this is to be used in attack verb
Lt. Pain wrote:
how does one cheak to see if they are faceing a mob

this is to be used in attack verb

...

mob/verb/Check_For_Mob()
for(var/mob/M in get_step(usr,usr.dir))
del(M)
In response to Poal
=D thanks its the easy things that trip me up >.>
In response to Poal
Poal wrote:
Lt. Pain wrote:
how does one cheak to see if they are faceing a mob

this is to be used in attack verb

...

> mob/verb/Check_For_Mob()
> for(var/mob/M in get_step(usr,usr.dir))
> del(M)
>


That will check for mobs in the turf in front of you, but it won't check to see if you are facing the mob (for ranged attacks, and the like).

if(usr.dir==get_dir(usr,targetMob)) // targetMob being the selected mob
return 1