The following code compiles correctly and mostly works, except that it doesn't cancel the rest of the verb.
mob/verb/fire()
usr.AmmoCheck()
fireprojectile(/obj/projectile/arrow,src)
usr.Ammunition -= 1
mob/verb/LAW()
usr.LAWCheck()
fireprojectile(/obj/projectile/law,src)
usr.LAWs -= 1
mob/verb/Shotgun()
usr.ShellCheck()
fireprojectile(/obj/projectile/Shotgun,src)
usr.ShotgunShells -= 1
mob
proc
AmmoCheck()
if(usr.Ammunition <= 0)
usr << "You are out of ammo!"
return 1
ShellCheck()
if(usr.ShotgunShells <= 0)
usr << "You are out of shotgun shells!"
return 1
mob/proc/LAWCheck()
if(usr.LAWs <= 0)
usr << "You are out!"
return 1
ID:149079
Jul 10 2002, 8:38 am
|
|
I'm assuming that it still fires even when you have no ammunition? This is because you didn't insert an if() statement that checks if the AmmoCheck() returned '1'.
Try this: