ID:268227
 
Hello again. I really need to know how to do this:When a player fires a spell at someone, and the other player fires spell before the other players spell hits them, and both of there strengths are the same, how would I possibly make it so that both of the spells crash into eachtoher, and explode?

Non-PC
Non-PC wrote:
Hello again. I really need to know how to do this:When a player fires a spell at someone, and the other player fires spell before the other players spell hits them, and both of there strengths are the same, how would I possibly make it so that both of the spells crash into eachtoher, and explode?

Non-PC

I can't code the whole thing, but this is all I know up to:

mob/var/firing = 0
mob/verb/fire(mob/M in oview(5))
if(M.str == usr.str && M.firing == 1 && usr.firing == 1
)
icon_state = "explode"


In response to Kappa the Imp
Kappa the Imp wrote:
I can't code the whole thing, but this is all I know up to:
mob/var/firing = 0
mob/verb/fire(mob/M in oview(5))
if(M.str == usr.str && M.firing == 1 && usr.firing == 1
)
icon_state = "explode"

For future reference, there's absolutely no point in posting code that doesn't work and doesn't even answer the question.

  • Your closing parenthesis is on the wrong line.
  • You're comparing strength at fire time, not when projectiles collide as the question implied.
  • You're using ==1 to determine true/false values when you should just use the var itself.
  • You set the icon_state for src (which in this case is usr), not a projectile.
  • You never created a projectile.
  • You never set or reset the firing var.

    Lummox JR
In response to Lummox JR
Lummox JR wrote:
Kappa the Imp wrote:
I can't code the whole thing, but this is all I know up to:
mob/var/firing = 0
> mob/verb/fire(mob/M in oview(5))
> if(M.str == usr.str && M.firing == 1 && usr.firing == 1
> )
> icon_state = "explode"

For future reference, there's absolutely no point in posting code that doesn't work and doesn't even answer the question.

  • Your closing parenthesis is on the wrong line.
  • You're comparing strength at fire time, not when projectiles collide as the question implied.
  • You're using ==1 to determine true/false values when you should just use the var itself.
  • You set the icon_state for src (which in this case is usr), not a projectile.
  • You never created a projectile.
  • You never set or reset the firing var.

    Lummox JR

  • Lummox, can you please help me out then?