Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix imaginary friend ears and icons #4863

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 30 additions & 15 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 All @@ -29,7 +29,7 @@
/mob/camera/imaginary_friend/Login()
. = ..()
setup_friend()
show()
update_image()

/mob/camera/imaginary_friend/Logout()
. = ..()
Expand All @@ -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 @@ -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

Expand All @@ -100,7 +100,6 @@

client.images |= current_image


/mob/camera/imaginary_friend/Destroy()
if(owner)
owner.client?.images.Remove(friend_image)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand All @@ -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"
Expand All @@ -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)