ID:269992
 
Okay, I want to code shrapnel that shoots out from hull tiles that are destroyed. They can shoot out in straight lines if that's the easiest to do, and need to damage mobs when they are hit with it. I looked up for explosions and etc but they just create objs with animation in a certain radius of tiles and then delete, so that wasn't what I was looking for. This is the hull deletion code:

var/hull = pick(walls)
for(var/obj/Misc/hull/wall in oview(hull,2))
del(wall)
del(hull)


Thanks.
Uh, if I understand what you're saying, you want a projectile that'll shoot other projectiles when it hits. You can do something like this:

obj/projectile
density = 1
shrapnel
Bump(atom/A)
if(ismob(A))
// damage A
del(src)
canister
Bump(atom/A)
for(var/obj/Misc/hull/W in oview(src, 2))
del(W)
for(var/i in list(1,2,4,8))
var/obj/projectile/shrapnel/S = new (src.loc)
walk(S, i, 1)
..()


Just create the canister class, then fire it!

~~> Unknown Person
In response to Unknown Person
Thanks for your help by the way. I have a few questions though, this is what I edited your code to:
    shrapnel
icon_state="shrapnel"
Bump(atom/A)
del(src)
canister
icon_state="canister"
Bump(atom/A)
var/sloc=src.loc
for(var/obj/Misc/hull/W in oview(src,2))//I'm taking this part out though
del(W)//I didn't explain the whole situation well, but this part was good for testing
for(var/i in list(NORTH,SOUTH,EAST,WEST,NORTHEAST,NORTHWEST,SOUTHWEST,SOUTHEAST))
var/obj/Misc/projectile/shrapnel/S = new (src.loc)
walk(S,i,1)
sleep(1)
for(var/obj/Misc/projectile/shrapnel/S in world)if(S.loc==sloc)
del(S)
..()


I'm not familar with how to change mob vars (like hp) in a Bump() situation like that, do I have to make a proc and call that? For some reason when I put i with every direction, there would be one shrapnel piece that would stay in the original location of the canister; I made that for loop to fix that, or is there a better way?
In response to Justin Knight
Bump.