mob
verb
Attack()
if(src.attacking == 0)
if(src.weapontype == "bow")
var/obj/fx/arrow/a = new(src.loc)
a.shooter = src
walk(a,src.dir,1)
src.attacking = 1
src.movement = 0
sleep(7)
src.attacking = 0
src.movement = 1
return
obj/fx/arrow
icon = 'fx.dmi'
icon_state = "arrow"
layer = 50
density = 1
var/mob/shooter
New()
world << "[src.shooter] is shooter" // debug , nothing is the owner
spawn(30)
del src
Bump(atom/O)
if(istype(O,/obj/fx/arrow))
loc = O.loc
return
if(istype(O,/turf/water))
O.density = 0
sleep(5)
O.density = 1
return
if(ismob(O))
if(O == shooter) // player shot a player
return
// shooter.arrow(M) // ATTTTTAAAAAACKKKKK
walk(src,0)
Problem description:
What I am doing is creating an arrow and just making it walk watever direction the shooter is facing. But for some reason, when I try the debug, nothing is set as shooter and
im pretty sure 'a.shooter = src' should be doing that. What is wrong?