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.