From 6de04ee694dccd775e94dd847b0c9d613b20d8fc Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 16 Feb 2022 00:28:06 +0100 Subject: [PATCH] [MIRROR] Fixing ghost bobbing (for real this time) [MDB IGNORE] (#11526) * Fixing ghost bobbing (for real this time) (#64891) * Fixing ghost bobbing (for real this time) Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> --- code/__DEFINES/traits.dm | 2 ++ code/modules/mob/dead/observer/observer.dm | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 01b654b80c1..fb37a17ef09 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -767,6 +767,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define DRONE_SHY_TRAIT "drone_shy" /// Pacifism trait given by stabilized light pink extracts. #define STABILIZED_LIGHT_PINK_TRAIT "stabilized_light_pink" +/// Trait given to a ghost when they orbit something. +#define GHOST_ORBITING_TRAIT "ghost_orbiting" /** * Trait granted by [/mob/living/carbon/Initialize] and diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index b08901a0881..480e0dd067b 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -500,13 +500,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/orbit() setDir(2)//reset dir so the right directional sprites show up + ADD_TRAIT(src, TRAIT_NO_FLOATING_ANIM, GHOST_ORBITING_TRAIT) return ..() /mob/dead/observer/stop_orbit(datum/component/orbiter/orbits) . = ..() //restart our floating animation after orbit is done. pixel_y = base_pixel_y - animate(src, pixel_y = base_pixel_y + 2, time = 1 SECONDS, loop = -1) + REMOVE_TRAIT(src, TRAIT_NO_FLOATING_ANIM, GHOST_ORBITING_TRAIT) /mob/dead/observer/verb/jumptomob() //Moves the ghost instead of just changing the ghosts's eye -Nodrak set category = "Ghost"