ID:2693609
 
(See the best response by Kaiochao.)
Code:
mob
proc
Fearsome_Lash(dist=3)
if(src.attacking == 0)
var/list/l
switch(src.dir)
if(NORTH)
l = bounds(src,0,TILE_HEIGHT,0,(dist - 1) * TILE_HEIGHT)
if(SOUTH)
l = bounds(src,0,dist * -TILE_HEIGHT,0,(dist - 1) * TILE_HEIGHT)
if(EAST)
l = bounds(src,TILE_WIDTH,0,(dist - 1) * TILE_WIDTH,0)
if(WEST)
l = bounds(src, dist * -TILE_WIDTH,0,(dist - 1) * TILE_WIDTH,0)
for(var/mob/M in l)
src<<"[M.name]"

for(var/turf/T in l)
new /obj/Effects/Lash(T.loc)


Problem description: I'm unable to figure out how to properly create instances of a new obj at specific. I'm able to identify which turfs I would like the obj(effect) to appear on, but I'm unsure how to feed that information into the new() proc properly. Completely new to DM so I may be going about this entirely the wrong way. Any help on this would be greatly appreciated.

Best response
The loc of movable atoms on the map is a turf, with every tile coordinate on the map having exactly one turf.
The loc of a turf is an area, which can cover multiple turfs.

Just need to change that T.loc to T.
In response to Kaiochao
Thank you for your time, this is exactly what I needed.
Instead of using a switch() for dir, you should take advantage of the fact that it uses bitflags.

var/dx=0,dy=0,dw=0,dh=0
if(dir & (NORTH|SOUTH))
dh = (dist - 1) * TILE_HEIGHT
dy = (dir & NORTH) ? TILE_HEIGHT : -dist*TILE_HEIGHT
if(dir & (EAST|WEST))
dw = (dist - 1) * TILE_WIDTH
dx = (dir & EAST) ? TILE_WIDTH : -dist*TILE_WIDTH
l = bounds(src, dx, dy, dw, dh)