mob
verb
Attack()
set category="Combat"
for(var/mob/E in get_step(usr,usr.dir))
if(E.NPC==0)
E.HP-= (usr.Str) - (E.Def)
view()<<"[usr] attacks [E] for [usr.Str] HP!"
if(E.player==1)
if(E.HP<=0)
E<<"<I><small>You died!"
E.HP=E.MHP
E.FP=E.MFP
E.loc=locate(2,2,1)
E.credits-=E.credits
E.credits=0
usr.Exp=E.Expg
E.PK=0
LvlCheck(usr)
return
Problem description: The problem is that when you get attacked if your defence is higher than the enemys strength you will gain health instead of not losing any, but if anyone knows how to can they explain to me how to make the defence only subtract a set percent of the damage
Like:
Your Str = 10
Enemy Str = 20
Enemy HP -= (Your Str)-(Enemy Str)
Enemy HP -= 10-20
Enemy HP -= -10 // - and - = +
that's why there should be damage check
Check out this code
PS. I don't get why did you make deathproc in attack verb, that way you have to add that lines for every attack. Can't you simply write DeathCheck proc?