Orbits are now a subsystem (#20632)

* Sleepless perfect orbits #MOGA
We bind to Moved() and use datums and lists to track the orbits, no more sleeps, no more delay.

* Adds some null checks to orbit checks

* Forget to set orbiting.
Also sets orbiters before orbiting, to avoid edge cases of deleting a list then recreating it.

* Improves orbit, adds subsystem for orbits.
Most orbit loc changes will happen on move, subsystem runs every 2 ticks to make up for when that isn't the case.
This commit is contained in:
Kyle Spier-Swenson
2016-09-24 19:52:49 +12:00
committed by oranges
parent fa5c08442d
commit f71dc2c9a3
7 changed files with 199 additions and 75 deletions
+7 -6
View File
@@ -383,7 +383,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
var/orbitsize = (I.Width()+I.Height())*0.5
orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25)
if(orbiting != target)
if(orbiting && orbiting.orbiting != target)
src << "<span class='notice'>Now orbiting [target].</span>"
var/rot_seg
@@ -403,13 +403,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
orbit(target,orbitsize, FALSE, 20, rot_seg)
/mob/dead/observer/orbit()
setDir(2 )//reset dir so the right directional sprites show up
setDir(2)//reset dir so the right directional sprites show up
..()
/mob/dead/observer/stop_orbit()
..()
//restart our floating animation after orbit is done.
sleep 2 //orbit sets up a 2ds animation when it finishes, so we wait for that to end
if (!orbiting) //make sure another orbit hasn't started
pixel_y = 0
animate(src, pixel_y = 2, time = 10, loop = -1)
pixel_y = 0
animate(src, pixel_y = 2, time = 10, loop = -1)
/mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak
set category = "Ghost"