ID:157135
 
How do i make it so where if a player did something that prevent any damage done to him until it over? For example, if a player use kaiten while the player is in kaiten he/she cant take any damage.

While(usr.Kaiten)
for(M in oview(1))
step_away(M,usr)
src.damage = 0
You'll have to do it in the receive damage proc or something similar, make it so while(target.whatever) {damage=0} after you calculate the damage for others of course.
Or you could just skip the calculation and save cpu, up to you.
mob
proc/take_damage(var/amount, var/mob/attacker)
if(I_CAN_TAKE_DAMAGE)
hp -= amount
deathcheck(attacker)