ID:1748436
 
(See the best response by FKI.)
Attack(var/mob/M in get_step(src, src.dir))


Is it possible to make it so the attack command will grab any object and mob (whichever is first) infront of the mob with JUST the Attack parameters? I know its possible to make a list when attack is used that only has obj/mobs infront of the mob when used, but I was wondering if it was possible to do from just the parameter.
I'm not quite sure what you're asking here.

Are you asking how to make it so the attack var attacks everything that is within a 1 tile radius of the user?

Not quite. How to make it so that it catches both objs and mobs infront of the character. ATM it only catches mobs.

So if a mob is infront of you, it will proc. If it a obj, or any other atom is, it won't proc. I'm just asking how to expand that to objs as well.
Best response
Attack(atom/movable/m in get_step(src, dir))


Attack(atom/movable/m as mob | obj in get_step(src, dir))


Something like the above should work. (The second example is redundant, as atom/movable will already return a mob or object; the main point of it is to show the different syntax you can use.)