ID:2415853
 
Code:
mob/verb


snowball_toss(mob/M)

set hidden = 1

if(!M) return

world << "Throwing Snowball at [M.name]..."

var/obj/SNOWBALL/S = new
S.s_target = M

switch(usr.dir)
if(NORTH)
S.Move(locate(usr.x,usr.y+1,usr.z))
if(SOUTH)
S.Move(locate(usr.x,usr.y-1,usr.z))
if(EAST)
S.Move(locate(usr.x+1,usr.y,usr.z))
if(WEST)
S.Move(locate(usr.x-1,usr.y,usr.z))

walk_to(S,M,0,0,0)

return

obj

SNOWBALL
icon = 'items_obj.dmi'
icon_state = "SBALL"
density = 0
layer = M_LAYER+10
mouse_opacity = 0
var/mob/s_target
New()
world << "SNOWBALL CREATED!"
spawn(500)
world << "SNOWBALL TIMEOUT!"
del src

Cross(atom/movable/O)
if(!s_target)
world << "NO TARGET!"
del src
world << "Target [s_target.name]"
world << "Crossing [O.name]!"

if(O == s_target)
world << "Hit Target!"
src.icon_state = "SBALL_HIT"
spawn(30) del src


Problem description:

So I'm trying to make a simple little snowball toy function in my game, but I'm not used to making a proc like this.

It's suppose to spawn the snowball object infront of the user, have it travel to the target, change its icon state to an animation of the snowball falling apart, and then delete itself.

What I'm seeing in my game from the above code though is...

The snowball spawns where its suppose to.
It travels to the target correctly.
The snowball reaches the target but just hovers over them and doesn't trigger the Cross() proc.

With the above code and the outputs provided, the only output I get is...

Throwing Snowball at TARGET_NAME...
SNOWBALL CREATED!

until the timeout function triggers and deletes it.

I've also noticed that if I run this more than once, the 2 snowballs dont seem to be able to pass each other despite having density = 0. Likewise, if I set my own density to 0, I'm unable to walk through them.

So I feel like I'm definitely doing something wrong with this proc here. Anyone happen to have any idea what?
Bro, Cross is passive

Bump()

- Or

Check every step what is under the ball

- And

Do more action after the hit