ID:268127
 

mob/var/control = null
mob/Guardian
icon = 'Guardian.dmi'
icon_state = "1"
Health = 100
Defense = 5
Strength = 5
var/Number
New()
Number = rand(1,50)
name = "Guardian [Number]"
GuardianAI()
var/mob/R = new /mob/GuardianHead
R.Move(usr.loc)
R.owner = usr
usr.control = R
..()
mob/var/owner
mob/GuardianHead
icon = 'Guardian.dmi'
icon_state = "2"
mob/GuardianHead
Move()
for(var/mob/GuardianHead/H in world)
for(var/mob/Guardian/M in world)
if(H.owner == M.name)
..()
H.layer = M.layer
if(usr.dir == EAST)
H.loc = locate(M.x+1,M.y,M.z)
H.dir = M.dir
if(usr.dir == WEST)
H.loc = locate(M.x+1,M.y+1,M.z)
H.dir = M.dir
if(usr.dir == NORTH)
H.loc = locate(M.x+1,M.y,M.z)
H.dir = M.dir
if(usr.dir == SOUTH)
H.loc = locate(M.x+1,M.,M.z)
H.dir = M.dir
return ..()
mob/Guardian/proc/GuardianAI()
if(src.client)
return 0
else
for(var/mob/M in oview(5,src))
if(M.client)
if(M == control)
walk_to(src,M,1,5)
GuardianAI()
return
if(get_dist(src,M) <= 5)//within 5 tiles
walk_to(src,M,1,5)//walk to the player
g_check_dist(src,M)//checks distance
break//stops the loop
else
continue
else
continue
mob/
proc/
g_check_dist(mob/attacker,mob/defender)
if(attacker.client)
return
else
if(get_dist(attacker,defender) <= 1)//if the monster is one tile away from the player
attacker.DataDrain(defender)//attack!
else
return

mob/proc/DataDrain(mob/M)
world<<"[M] screams violently as he is drained into the guardian!"
usr.Exp += M.Exp
M.Health = 0
M.Death()
M.Exp = rand(1,100)
M.Health = rand(1,100)
M.Defense = rand(1,100)
M.Strength = rand(1,100)

The guardian's (right) second half never appears..
No put usr in proc. Ungh.

Lummox JR
In response to Lummox JR
I think that should be the new message of the day.
Kasumi Tomonari wrote:
The guardian's (right) second half never appears..

Did you tell it to?