ID:141158
 
Code:
mob/verb/Attack()
for(var/mob/m in get_step(usr,usr.dir))//this will do all the mob's infront of you when you attack
m.hp -= rand(1,10)


Problem description:



Is there anyway to make m.hp -= rand(1,10) be a random percentage of your current hp? Like it will deal 15%-45% of your current hp?

mob/verb/Attack()
for(var/mob/m in get_step(usr,usr.dir))//this will do all the mob's infront of you when you attack
m.hp -= round(m.hp*0.45)//does 45% of his current hp
In response to Flame48
Would like to point out that you will never (okay: it's possible, but only due to rounding after a very large number of hits) kill something this way.