mob
TSO
name = "TSO (AI)"
Health = 150
maxHealth = 150
icon = 'TSO.dmi'
var/mob/Target
New()
..()
spawn(5)
src.Wander()
proc
Wander()
while(src)
sleep(5)
for(var/mob/Army/M in oview(10))
src.Target = M
break
if(src.Target)
//var/mob/Army/
if(src.Health<Target.Health)
var/Rand = rand(1,10)
if(Rand>=8)
step_away(src,Target)
sleep(1)
step_away(src,Target)
sleep(1)
step_away(src,Target)
else
step_towards(src,Target)
if(get_dist(src,Target) <= 1)
Target<<"[src] punched you for 20 damage."
Target.Health-=20
if(Target.Health<=0)
world<<"<font color = yellow>*[src] killed [Target]*"
usr.Kills+=1
Target.loc=locate(0,0,0)
if(Target.name =="TSO (AI)")
ai-=1
CheckIfGameOver()
else
step_towards(src,Target)
if(get_dist(src,Target) <= 1)
Target<<"[src] punched you for 20 damage."
Target.Health-=20
if(Target.Health<=0)
world<<"<font color = yellow>*[src] killed [Target]*"
usr.Kills+=1
Target.loc=locate(0,0,0)
if(Target.name =="TSO (AI)")
ai-=1
CheckIfGameOver()
else
step_rand(src)
Problem description:
The TSO AI always comes by me but never attacks. I need to make it attack me and I have tried a lot of things to get it to work. Maybe it is a typo or I am just doing it all wrong.
->Calus CoRPS<-