mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Made the follow verb less buggy.
Removed duplicated code.
This commit is contained in:
@@ -37,27 +37,6 @@
|
|||||||
// Not all of them require checking, see below
|
// Not all of them require checking, see below
|
||||||
A.attack_ghost(src)
|
A.attack_ghost(src)
|
||||||
|
|
||||||
// This is the ghost's follow verb with an argument
|
|
||||||
/mob/dead/observer/proc/ManualFollow(var/atom/target)
|
|
||||||
following = target
|
|
||||||
if(target)
|
|
||||||
src << "\blue Now following [target]"
|
|
||||||
spawn(0)
|
|
||||||
var/turf/pos = get_turf(src)
|
|
||||||
while(loc == pos && target && following == target)
|
|
||||||
|
|
||||||
var/turf/T = get_turf(target)
|
|
||||||
if(!T)
|
|
||||||
break
|
|
||||||
if(following != target)
|
|
||||||
break
|
|
||||||
if(!client)
|
|
||||||
break
|
|
||||||
loc = T
|
|
||||||
pos = loc
|
|
||||||
sleep(15)
|
|
||||||
following = null
|
|
||||||
|
|
||||||
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
|
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
|
||||||
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
|
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
|
||||||
if(user.client && user.client.inquisitive_ghost)
|
if(user.client && user.client.inquisitive_ghost)
|
||||||
|
|||||||
@@ -369,27 +369,30 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
|||||||
set name = "Follow" // "Haunt"
|
set name = "Follow" // "Haunt"
|
||||||
set desc = "Follow and haunt a mob."
|
set desc = "Follow and haunt a mob."
|
||||||
|
|
||||||
if(istype(usr, /mob/dead/observer))
|
var/list/mobs = getmobs()
|
||||||
var/list/mobs = getmobs()
|
var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs
|
||||||
var/input = input("Please, select a mob!", "Haunt", null, null) as null|anything in mobs
|
var/mob/target = mobs[input]
|
||||||
var/mob/target = mobs[input]
|
ManualFollow(target)
|
||||||
if(target && target != usr)
|
|
||||||
following = target
|
|
||||||
spawn(0)
|
|
||||||
var/turf/pos = get_turf(src)
|
|
||||||
while(src.loc == pos)
|
|
||||||
|
|
||||||
var/turf/T = get_turf(target)
|
// This is the ghost's follow verb with an argument
|
||||||
if(!T)
|
/mob/dead/observer/proc/ManualFollow(var/atom/movable/target)
|
||||||
break
|
if(target && target != src)
|
||||||
if(following != target)
|
if(following && following == target)
|
||||||
break
|
return
|
||||||
if(!client)
|
following = target
|
||||||
break
|
src << "\blue Now following [target]"
|
||||||
src.loc = T
|
spawn(0)
|
||||||
pos = src.loc
|
var/turf/pos = get_turf(src)
|
||||||
sleep(15)
|
while(loc == pos && target && following == target && client)
|
||||||
following = null
|
var/turf/T = get_turf(target)
|
||||||
|
if(!T)
|
||||||
|
break
|
||||||
|
// To stop the ghost flickering.
|
||||||
|
if(loc != T)
|
||||||
|
loc = T
|
||||||
|
pos = loc
|
||||||
|
sleep(15)
|
||||||
|
following = null
|
||||||
|
|
||||||
|
|
||||||
/mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak
|
/mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak
|
||||||
|
|||||||
Reference in New Issue
Block a user