Skip to content

Commit

Permalink
Change merge to orbit (fixes issue where ghost ears can't hear the ou…
Browse files Browse the repository at this point in the history
…tside the world if set to only hear nearby)
  • Loading branch information
Drulikar committed Nov 7, 2023
1 parent c553126 commit 2d2c819
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions code/modules/mob/camera/imaginary_friend.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
var/hidden = FALSE
var/mob/living/owner

var/datum/action/innate/imaginary_join/join
var/datum/action/innate/imaginary_orbit/orbit
var/datum/action/innate/imaginary_hide/hide

var/list/outfit_choices = list(/datum/equipment_preset/uscm_ship/sea)
Expand Down Expand Up @@ -47,8 +47,8 @@

mouse_opacity = MOUSE_OPACITY_TRANSPARENT

join = new
join.give_to(src)
orbit = new
orbit.give_to(src)
hide = new
hide.give_to(src)

Expand Down Expand Up @@ -236,15 +236,26 @@
dir = get_dir(get_turf(src), destination)
loc = destination
update_image()
orbiting?.end_orbit(src)

/mob/camera/imaginary_friend/stop_orbit(datum/component/orbiter/orbits)
. = ..()
// pixel_y = -2
animate(src, pixel_y = 0, time = 10, loop = -1)

/// returns the friend to the owner
/mob/camera/imaginary_friend/proc/recall()
if(QDELETED(owner))
deactivate()
return FALSE
if(loc == owner)
if(orbit_target == owner)
orbiting?.end_orbit(src)
return FALSE
forceMove(owner)
if(!hidden)
hide.action_activate()
dir = SOUTH
update_image()
orbit(owner)

/// logs the imaginary friend's removal, ghosts them and cleans up the friend
/mob/camera/imaginary_friend/proc/deactivate()
Expand All @@ -264,11 +275,11 @@
ghost.mind.original = aghosted_original_mob
return ghost

/datum/action/innate/imaginary_join
name = "Join"
/datum/action/innate/imaginary_orbit
name = "Orbit"
action_icon_state = "joinmob"

/datum/action/innate/imaginary_join/action_activate()
/datum/action/innate/imaginary_orbit/action_activate()
var/mob/camera/imaginary_friend/friend = owner
friend.recall()

Expand Down

0 comments on commit 2d2c819

Please sign in to comment.