mob
verb
fireball()
set src in view()
set hidden = 1
if(!usr.targeting)
usr<<"Target an enemy to use this spell!"
return
else
var/mob/j = usr.Tgt
if(j in oview(usr,usr.client.view))
var/obj/fireball/K = new /obj/fireball
K.loc = usr.loc
walk_towards(K,j.loc)
for(var/mob/M in get_step(src,usr.dir))
if(M.enemy == 1)
var/damage=((round(usr.mdamage+(usr.int/4))-M.mdef))
if(damage>0)
M.hp-=damage
view() <<"[src.Name] hit [M] for [damage]!"
usr.DeathCheck(M)
else
view() <<"[M] absorbed the blow!"
else
usr<<"You cannot attack [M.Name]!"
usr.attacking = 1
spawn(usr.aspd*0.6)
usr.attacking=0
sleep(15)
del(K)
Problem description:
Projectile (fireball) starts and homes in on target mob. When the projectile gets there nothing happens. It hangs and then deletes itself when it times out.
I'm sure its something obvious, but I've been fiddling with it for a while and can't figure it out. Thank you :)