When NPC's attack the player freezes, and can do any verb but cannot move, the code i use is :
proc
Attack(mob/M)
var/damage = powerlevel
M.TakeDamage(src, damage)
TakeDamage(mob/attacker, damage)
if (istype(src, /mob/other))
usr << "No..."
else
if(src.npp == 1|null)
src.powerlevel += 0
if(src.npp == 0)
src.powerlevel -= attacker.strength
src.Die()
attacker.powerlevel += rand(0,1)
attacker.random = rand(1,3)
if(src.powerlevel >= 1)
if(attacker.random == 1)
view(6) << "[attacker.name] punches [src] in the face."
if(attacker.random == 2)
view(6) << "[attacker.name] kicks [src]."
if(attacker.random == 3)
view(6) << "[attacker.name] stumbles and misses [src]."
ID:175405
Apr 26 2003, 2:19 pm
|
|