Adds ghost_follow_link and AI eye following

This commit is contained in:
Krausus
2015-05-23 08:54:13 -04:00
parent bff89fa125
commit f5be679752
5 changed files with 19 additions and 26 deletions
+13 -20
View File
@@ -499,6 +499,17 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return ..()
/proc/ghost_follow_link(var/atom/target, var/atom/ghost=src)
if(!target) return
if(isAI(target)) // AI core/eye follow links
var/mob/living/silicon/ai/A = target
. = "<a href='byond://?src=\ref[ghost];follow=\ref[A]'>core</a>"
if(A.client && A.eyeobj) // No point following clientless AI eyes
. += "|<a href='byond://?src=\ref[ghost];follow=\ref[A.eyeobj]'>eye</a>"
return
else
return "<a href='byond://?src=\ref[ghost];follow=\ref[target]'>follow</a>"
//BEGIN TELEPORT HREF CODE
/mob/dead/observer/Topic(href, href_list)
if(usr != src)
@@ -512,26 +523,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if (href_list["follow"])
var/atom/target = locate(href_list["follow"])
var/mob/A = usr;
A << "You are now following [target]"
//var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
if(target && target != usr)
following = target
spawn(0)
var/turf/pos = get_turf(A)
while(A.loc == pos)
var/turf/T = get_turf(target)
if(!T)
break
if(following != target)
break
if(!client)
break
A.loc = T
pos = A.loc
sleep(15)
following = null
if(target)
ManualFollow(target)
if (href_list["jump"])
var/mob/target = locate(href_list["jump"])