ID:266375
 
mob/proc
npcattack1()
if(src.npcat==0)
return
if(src==usr)
spawn(src.warspeed+55)
src.npcattack1()
return
if(istype(src,/mob/Snowmonsters/IceAr))
for(var/mob/defender as mob in oview(6))
var/maxdamage = src.strength - (defender.defense) - (src.warspeed - defender.warspeed / 2)
var/damage = maxdamage
if(defender.invul==1)
usr <<"You cannot attack a new town!"
spawn(src.warspeed+35)
src.npcattack1()
return
else
if(!defender)
spawn(src.warspeed+35)
src.npcattack1()
return
else
if(defender.owner==src.owner)
spawn(src.warspeed+35)
src.npcattack1()
return
else
if(defender.typechar==src.typechar)
spawn(src.warspeed+35)
src.npcattack1()
return
else
if (damage <= 0)
defender << "The attack bounces harmlessly off you."
spawn(src.warspeed+35)
src.npcattack1()
return
else
if(defender.HP<=0)
spawn(src.warspeed+35)
src.npcattack1()
return
else
if(damage>0)
walk_rand(src.walkspeed)
defender << "You were Hit for [damage] damage!"
defender.HP -= damage
src.xp += 5
Levelup()
DeathCheck(defender)
spawn(src.warspeed+10)
src.npcattack1()
return
else
usr <<"Doh, nothing here!"
spawn(src.warspeed+35)
src.npcattack1()
return



I know it's probably one of those inefficiency in my coding problems again, but can someone look over and tell me what'swrong?


I did a test with it and everything worked fine when Itested it it displayed the usr<<"notes"
sigh I'm probably missing something simple, but I'm too tired to tell :)
note this also continues on down the list... if (istype( blah blah blah

I know I know I didn't split it up into procs and I ended up doing a crap load of typing... and made it 10x more confusing at that...

But I made the code awhile ago when I didn't know much about coding and now I'm going back and fixing it