atom
Click()
usr.shoot(src) // Note who is usr and who is src
mob/proc/Shoot()
shoot()
mob
proc
shoot(mob/target)
var/obj/L = new/obj/bullet
if(src.fired == 0)
src.fired = 1
spawn(15)
src.fired = 0
L.dir = get_dir(src, target)
L.loc = src.loc
while(L)
step(L,L.dir)
var/turf/T = L.loc
if(T.density == 1)
del(L)
break
for(var/mob/M as mob in T)
if(M == src)
continue
src<<"You shot [M]!"
del(L)
sleep(1)
Problem description:Ok i just need 2 little help with my code.
1)I need to know how would i make a var to set it max range.Ex:If i was using a rifle it could only go for a max of 15 spaces,if i was using a gun it could only go for 7 spaces.
2)How would it make it shoot more then 8 directions.It does shoot 8 direction right now but how wold i amke it shoot more?If anyone would help me with thatit would be great.=)
Thanks in advance.