mob
verb
Attack(mob/M in oview(usr.Cansee))
if(usr.CanAttack)
if(istype(M,/mob/))
while(M in oview(usr.Cansee)&&M in usr.TargetList)
var/damage = usr.Atk-M.Def+rand(-1,4)
var/CriticalDice = "2d12"
var/CriticalRoll = roll(CriticalDice)
var/Miss = usr.Spd - M.Spd
var/LuckyHit = (usr.Spd+usr.Lck+rand(0,5))-M.Spd
if(damage<=0)
damage = 0
if(Miss<=0)
if(LuckyHit>=1)
var/LuckyDamage = round(damage/rand(2,5))
viewers(usr)<<"[usr] got lucky! [LuckyDamage] damage!"
M.Hp-=LuckyDamage
if(M.Hp<=0)
del M
viewers(usr)<<"[M] was defeated by [usr]!"
break
else
sleep(usr.WaitAttack)
else
viewers(usr)<<"[usr] misses [M]!"
sleep(usr.WaitAttack)
else
if(CriticalRoll>=5)
viewers(usr)<<"[usr] landed a deadly blow!"
var/CriticalDamage = round(damage * rand(1.5,4))
M.Hp-=CriticalDamage
if(M.Hp<=0)
del M
viewers(usr)<<"[M] was defeated by [usr]!"
break
else
sleep(usr.WaitAttack)
else
viewers(usr)<<"[usr] hits [M] for [damage] damage!"
M.Hp-=damage
if(M.Hp<=0)
del M
viewers(usr)<<"[M] was defeated by [usr]!"
break
else
sleep(usr.WaitAttack)
else
return
Problem description:I decided to make my Attack Proc a verb, but it still doesn't work, even after I redid it. I know where the error lies, its right after the While() statement. What did I do wrong? Yes, before you ask, CanAttack is set to 1.
Have you added M into their Target list?