Bump(mob/M)
call(/mob/proc/dmg)(M,src.dice,src.wtype)
del src
dmg(mob/M,dice,wtype)
var/dmg = 0
if(istype(usr,/mob/player))
if(wtype == "melee")
dmg = roll(dice,8) + usr.str
else if(wtype == "spell")
dmg = roll(dice,8) + usr.int
else
dmg = roll(dice,8)
M.hp = M.hp - dmg
usr << "You did \blue[dmg] dmg!"
M << "You've been hit for \red[dmg] dmg!"
if (M.hp <= 0)
del M
So I have a function which shoots out a projectile based on the weapon you are using. Each weapon has a dice variable which the dmg() proc uses.
For some reason when an enemy uses this projectile function Bump() and dmg() works fine, yet when a player uses it the damage isn't calculated. I've done some tests and it seems that all the variables that are needed are being passed through Bump() yet I never get any results.
Please ask if you need to see more code. I tried to post as little as possible for simplicity.
Usually, projectile interaction goes like this: