ID:175316
 
I need help modifying this code in order to enable taking points off for friendly fire and so that I can actually give points to someone for doing something other than wasting ammunition. As far as I can tell, this is what I need for this. NOTE: I am using ShadowDarke's projectile system.

proc
fireprojectile(Type, mob/Who)
/*
Type = the type of projectile
Who = who fired/threw the projectile
*/

var/obj/projectile/S = new Type(Who.loc) // make a new projectile where the mob is
if(!istype(S,/obj/projectile)) // make sure they are
world.log << "Invalid projectile:[Type]"
return
S.dir = Who.dir // projectile faces same dir as the mob
S.who = Who
S.missileloop()



obj
projectile
density = 1
layer = FLY_LAYER
var
mob/who // the mob that fires the projectile
damage = 1 // how much damage the projectile causes
mrange = 10 // how far the projectile can go
delay = 0 // number of ticks between movements




proc
missileloop()
walk(src,dir, 0) // T = space the
if(--mrange > 0) // decriment range
spawn(delay) missileloop()
else
endmissile()

endmissile()
/* This proc is called when the missile stops moving.
Override it for missiles that have special effects
like explosions or leaving items where they land.
*/

del(src)


Bump(O)
if(ismob(O))
// damage proc
var/headshot = rand(1,3)
if(headshot == 1)
O:HP -= 10
O:DeathCheck()
if(headshot == 2)
O:HP -= 50
O:DeathCheck()
if(headshot == 3)
O:HP -= 100
O:DeathCheck()
endmissile() // we hit something, so the missile stops


var/tk

mob
var
Experience = 0
Rank = "Newbie"
kills
list/shooters


Sorry if it's a bit long, but this question requires as much of the code as possible.