mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 16:47:13 +01:00
Merge pull request #11712 from MrStonedOne/patch-37
Ghost follow is now an orbit!
This commit is contained in:
@@ -1423,11 +1423,16 @@ B --><-- A
|
|||||||
/atom/movable/proc/orbit(atom/A, radius = 10, clockwise = 1, angle_increment = 15)
|
/atom/movable/proc/orbit(atom/A, radius = 10, clockwise = 1, angle_increment = 15)
|
||||||
if(!istype(A))
|
if(!istype(A))
|
||||||
return
|
return
|
||||||
|
if (orbiting)
|
||||||
|
stop_orbit()
|
||||||
|
sleep(1) //sadly this is the only way to ensure the original orbit proc stops and resets the atom's transform.
|
||||||
|
if (orbiting || !istype(A)) //post sleep re-check
|
||||||
|
return
|
||||||
orbiting = A
|
orbiting = A
|
||||||
var/angle = 0
|
var/angle = 0
|
||||||
var/matrix/initial_transform = matrix(transform)
|
var/matrix/initial_transform = matrix(transform)
|
||||||
spawn
|
spawn
|
||||||
while(orbiting)
|
while(orbiting && orbiting.loc)
|
||||||
loc = orbiting.loc
|
loc = orbiting.loc
|
||||||
|
|
||||||
angle += angle_increment
|
angle += angle_increment
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
|||||||
|
|
||||||
|
|
||||||
/mob/dead/observer/Move(NewLoc, direct)
|
/mob/dead/observer/Move(NewLoc, direct)
|
||||||
|
if (orbiting)
|
||||||
|
stop_orbit()
|
||||||
if(NewLoc)
|
if(NewLoc)
|
||||||
loc = NewLoc
|
loc = NewLoc
|
||||||
for(var/obj/effect/step_trigger/S in NewLoc)
|
for(var/obj/effect/step_trigger/S in NewLoc)
|
||||||
@@ -200,8 +202,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
|||||||
|
|
||||||
/mob/dead/observer/verb/follow()
|
/mob/dead/observer/verb/follow()
|
||||||
set category = "Ghost"
|
set category = "Ghost"
|
||||||
set name = "Follow" // "Haunt"
|
set name = "Orbit" // "Haunt"
|
||||||
set desc = "Follow and haunt a mob."
|
set desc = "Follow and orbit a mob."
|
||||||
|
|
||||||
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
|
||||||
@@ -211,22 +213,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
|||||||
// This is the ghost's follow verb with an argument
|
// This is the ghost's follow verb with an argument
|
||||||
/mob/dead/observer/proc/ManualFollow(atom/movable/target)
|
/mob/dead/observer/proc/ManualFollow(atom/movable/target)
|
||||||
if(target && target != src)
|
if(target && target != src)
|
||||||
if(following && following == target)
|
if(orbiting && orbiting == target)
|
||||||
return
|
return
|
||||||
following = target
|
src << "<span class='notice'>Now orbiting [target].</span>"
|
||||||
src << "<span class='notice'>Now following [target].</span>"
|
orbit(target,24,0)
|
||||||
spawn(0)
|
|
||||||
var/turf/pos = get_turf(src)
|
|
||||||
while(loc == pos && target && following == target && client)
|
|
||||||
var/turf/T = get_turf(target)
|
|
||||||
if(!T)
|
|
||||||
break
|
|
||||||
// To stop the ghost flickering.
|
|
||||||
if(loc != T)
|
|
||||||
loc = T
|
|
||||||
pos = loc
|
|
||||||
sleep(15)
|
|
||||||
if (target == following) 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
|
||||||
@@ -377,4 +367,4 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
|||||||
if(istype(target) && (target != src))
|
if(istype(target) && (target != src))
|
||||||
ManualFollow(target)
|
ManualFollow(target)
|
||||||
if(href_list["reenter"])
|
if(href_list["reenter"])
|
||||||
reenter_corpse()
|
reenter_corpse()
|
||||||
|
|||||||
Reference in New Issue
Block a user