From 80ca798d4f56c355a17c07957764ba943b5261f3 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Wed, 8 Nov 2023 20:34:57 -0800 Subject: [PATCH] Fix imaginary friend ears and icons (#4863) # About the pull request This PR changes the imaginary friend ability to an orbit ability. The reasoning for this is because if you have ghost ears set to only hear nearby, merging would place you in the mob's contents so not in range to hear anything. This PR also fixes the hide ability not actually updating its icon state. # Explain why it's good for the game Imaginary friends need to be able to hear who they are helping. # Testing Photographs and Procedure
Screenshots & Videos https://youtu.be/95TtYocF2XQ
# Changelog :cl: Drathek fix: Fixed imaginary friend merge ability preventing hearing if ghost ears are set to only nearby. fix: Fixed imaginary friend hide ability not updating its icons. /:cl: --- code/modules/mob/camera/imaginary_friend.dm | 45 ++++++++++++++------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/camera/imaginary_friend.dm b/code/modules/mob/camera/imaginary_friend.dm index 5d205dd17e4f..0be51ede324a 100644 --- a/code/modules/mob/camera/imaginary_friend.dm +++ b/code/modules/mob/camera/imaginary_friend.dm @@ -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) @@ -29,7 +29,7 @@ /mob/camera/imaginary_friend/Login() . = ..() setup_friend() - show() + update_image() /mob/camera/imaginary_friend/Logout() . = ..() @@ -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) @@ -81,7 +81,7 @@ return out_icon /// makes the friend update their icon and appear to themselves and, if not hidden, the owner -/mob/camera/imaginary_friend/proc/show() +/mob/camera/imaginary_friend/proc/update_image() if(!client) return @@ -100,7 +100,6 @@ client.images |= current_image - /mob/camera/imaginary_friend/Destroy() if(owner) owner.client?.images.Remove(friend_image) @@ -141,7 +140,7 @@ return name = client.prefs.real_name friend_image = get_flat_human_icon(null, outfit_choice, client.prefs) - show() + update_image() /mob/camera/imaginary_friend/verb/toggle_hud() set category = "Imaginary Friend" @@ -236,16 +235,27 @@ /mob/camera/imaginary_friend/forceMove(atom/destination) dir = get_dir(get_turf(src), destination) loc = destination - show() + 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() @@ -265,13 +275,14 @@ 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() + /datum/action/innate/imaginary_hide name = "Hide" action_icon_state = "hidemob" @@ -280,13 +291,17 @@ var/mob/camera/imaginary_friend/friend = owner if(friend.hidden) friend.hidden = FALSE - friend.show() + friend.update_image() name = "Hide" action_icon_state = "hidemob" update_button_icon() else friend.hidden = TRUE - friend.show() + friend.update_image() name = "Show" action_icon_state = "unhidemob" update_button_icon() + +/datum/action/innate/imaginary_hide/update_button_icon() + button.overlays.Cut() + button.overlays += image('icons/mob/hud/actions.dmi', button, action_icon_state)