This is the code as it is now if you dont have it or havnt seen it. Sorry for adding all of it but idk what parts are needed and what arnt.
obj/sd_px_projectile
icon_state = "proj"
layer = 10
Click()
spawn(2)
if(usr.secondary != type)
usr.bullettype = type
usr << "[src] selected."
DblClick()
usr.secondary = type
usr << "[src] selected as secondary."
Hit(atom/A)
//world << "[src] hit [A] ([A.x], [A.y])."
var/obj/O = new()
O.icon = 'demo.dmi'
O.icon_state = "[icon_state]_hit"
O.layer = A.layer + A.overlays.len/100
O.pixel_x = rand(-3,3)
O.pixel_y = rand(-3,3)
A.overlays += O
del(src)
New()
. = ..()
suffix = "speed:[speed] range:[range] delay:[delay]"
/*****************************************************************
Custom projectiles
*****************************************************************/
longrange
range = 50
icon_state = "long"
grenade
cx = 8
cy = 8
icon_state = "ball"
Hit(A)
A = TurfOf(A)
if(A) loc = A
Terminate() // Terminate() handles explosion
Terminate()
// explode in a 3x3 grid centered on loc
var/turf/T
var/obj/O = new()
O.icon = 'demo.dmi'
O.icon_state = "[icon_state]_hit"
O.layer = FLY_LAYER
/* limit explosion by density
You'll probably want a much more robust system.
This is just a hack for this demo. */
var/list
L = orange(1,src)
swapped = list()
for(T in L)
if(T.density)
T.opacity = 1
swapped += T
T = get_step(src,dir)
L = L - (L - view(2,T))
for(T in swapped)
T.opacity = 0
for(var/atom/A in L)
if(isarea(A) || isobj(A)) continue
O.layer = A.layer + A.overlays.len/100
O.pixel_x = rand(-3,3)
O.pixel_y = rand(-3,3)
A.overlays += O
del(src)
Edit: It may look rude to others now, but at the time you had posted two other posts in which you did something similar to this, and people gave you links to guides and articles. This was the 3rd post. Also, coming back with this 'rebuttal' so long after this post was finished is simply a waste of the Top forum section space.