client/Center()
mob.shoot()
mob/verb/Shoot()
shoot()
mob
proc
shoot()
var/obj/H = new/obj/bullet
var/obj/I = new/obj/bullet
var/obj/J = new/obj/bullet
if(src.fired == 0 && clip > 0 && can_shoot == 1)
src.fired = 1
clip -= 1
spawn(1)
src.fired = 0
H.dir = src.dir
H.loc = src.loc
I.dir = src.dir
I.loc = src.loc
J.dir = src.dir
J.loc = src.loc
while(H)
step(H,H.dir)
var/turf/T = H.loc
if(T.density == 1)
del(H)
sleep(1)
while(I)
step(I,I.dir)
var/turf/T = I.loc
if(T.density == 1)
del(I)
sleep(1)
while(J)
step(J,J.dir)
var/turf/T = J.loc
if(T.density == 1)
del(J)
break
for(var/mob/M as mob in T)
if(M == src)
M.HP -= range_damage
usr << "You did [range_damage] damage!"
M.DeathCheck()
del(H)
sleep(1)
Problem description:
Ok i took my shoot and tried to adapt it to shoot 3 bullets everytime the user hits shoot. Obviously it doesn't work, i'm probably taking the wrong approach to this but i couldn't think of any other way. So can someone help me with this?
Also its not doing damage when the bullet hits an enemy. I think i should use Bump() for this but i'm not really sure how to implement that.
Note: Everything compiles and the game runs, but when i shoot it only shoots one bullet instead of three.