diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 2dfe36c1f7f..15d2bbc3237 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -415,4 +415,11 @@ #define CLEAN_MEDIUM 3 // Acceptable tools #define CLEAN_STRONG 4 // Industrial strength #define CLEAN_IMPRESSIVE 5 // Cleaning strong enough your granny would be proud -#define CLEAN_GOD 6 // Cleans things spotless down to the atomic structure \ No newline at end of file +#define CLEAN_GOD 6 // Cleans things spotless down to the atomic structure + +//Ghost orbit types: +#define GHOST_ORBIT_CIRCLE "circle" +#define GHOST_ORBIT_TRIANGLE "triangle" +#define GHOST_ORBIT_HEXAGON "hexagon" +#define GHOST_ORBIT_SQUARE "square" +#define GHOST_ORBIT_PENTAGON "pentagon" diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 17b1e201390..dfd4e1e3332 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -26,6 +26,7 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi var/ghostvision = 1 //is the ghost able to see things humans can't? var/seedarkness = 1 var/data_hud_seen = FALSE //this should one of the defines in __DEFINES/hud.dm + var/ghost_orbit = GHOST_ORBIT_CIRCLE /mob/dead/observer/New(var/mob/body=null, var/flags=1) sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF @@ -411,8 +412,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp /mob/dead/observer/verb/follow(input in getmobs()) set category = "Ghost" - set name = "Follow" // "Haunt" - set desc = "Follow and haunt a mob." + set name = "Orbit" // "Haunt" + set desc = "Follow and orbit a mob." var/target = getmobs()[input] if(!target) return @@ -429,22 +430,37 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp if(target != src) if(following && following == target) return + + var/icon/I = icon(target.icon,target.icon_state,target.dir) + + var/orbitsize = (I.Width()+I.Height())*0.5 + + if(orbitsize == 0) + orbitsize = 40 + + orbitsize -= (orbitsize/world.icon_size)*(world.icon_size*0.25) + + var/rot_seg + + switch(ghost_orbit) + if(GHOST_ORBIT_TRIANGLE) + rot_seg = 3 + if(GHOST_ORBIT_SQUARE) + rot_seg = 4 + if(GHOST_ORBIT_PENTAGON) + rot_seg = 5 + if(GHOST_ORBIT_HEXAGON) + rot_seg = 6 + else //Circular + rot_seg = 36 //360/10 bby, smooth enough aproximation of a circle + following = target to_chat(src, "Now following [target]") - if(ismob(target)) - forceMove(get_turf(target)) - var/mob/M = target - M.following_mobs += src - else - spawn(0) - while(target && following == target && client) - var/turf/T = get_turf(target) - if(!T) - break - // To stop the ghost flickering. - if(loc != T) - forceMove(T) - sleep(15) + orbit(target,orbitsize, FALSE, 20, rot_seg) + +/mob/dead/observer/orbit() + setDir(2)//reset dir so the right directional sprites show up + return ..() /mob/proc/update_following() . = get_turf(src) diff --git a/html/changelogs/AutoChangeLog-pr-11279.yml b/html/changelogs/AutoChangeLog-pr-11279.yml new file mode 100644 index 00000000000..11bdfb80538 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-11279.yml @@ -0,0 +1,4 @@ +author: "Arkatos" +delete-after: True +changes: + - tweak: "Ghosts now orbit around their followed targets"