Raikyuu()
set category = "Ninjutsu"
if(src.chakra >= 20000)
src.chakra -= 20000
view() << "<font color=\"blue\">{[src.rank]}{[src.clan]}{[src.village]}<b>[src]</b> \[Say]: </font><font color=\"#005500\">Raikyuu!</font>"
view() << "[src] shoots a lightning strike!"
var/L = null
if(src.dir == NORTH)
L = locate(src.x, src.y-5,src.z)
if(src.dir == SOUTH)
L = locate(src.x, src.y+5,src.z)
if(src.dir == EAST)
L = locate(src.x+5, src.y,src.z)
if(src.dir == WEST)
L = locate(src.x-5, src.y,src.z)
var/obj/raikyuu/P = new(src.loc)
var/dst = get_dist(P,L)
do
step_towards(P,L)
dst = get_dist(P,L)
sleep(2)
while(dst > 1)
var/d = 2*src.ninjutsu_strength
for(var/mob/M in P.loc)
M.hp -= d
view() << "[M] lost [d] health!</b>"
deathcheck(M)
del(P)
else
src << "You don't have enough chakra!"
Problem description:
Whenever I shoot the lightning, the lightning always goes down, no matter what direction the player is facing.
Depending on the density of the projectile, you could use Bump() to make it damage others, and use Move() to check for people every time it moves.
This is another alternative I just thought of: