Makes your current position clearer while jaunting (#90173)

## About The Pull Request

I was fucking around testing the Voidwalker earlier for a different
issue and didn't like that I couldn't see myself while in space.
This PR makes it so that Voidwalkers and also any variant of Ethereal
Jaunt place an icon visible only to you at your current position (it's
like your _soul_) so that you can see where you are going.
Nobody else can see it.


![dreamseeker_qCXrCwHaUW](https://github.com/user-attachments/assets/3d6d1136-1658-4701-af78-057b2cfeb059)

![dreamseeker_hqH73zu66P](https://github.com/user-attachments/assets/4f620711-9a1a-4f8e-be3b-1c3367b9f9dc)



There are almost certainly some other sources of being invisible which
could use this so let me know if you are aware of one.
Although if you do that I may need to make my code more generic.

## Why It's Good For The Game

It's nice to be able to see where you are precisely rather than just it
being the centre of the screen

## Changelog

🆑
qol: It is now easier to see where you currently are while jaunting
/🆑
This commit is contained in:
Jacquerel
2025-03-23 20:00:23 +01:00
committed by GitHub
parent c370a1a0fa
commit ce669c3924
8 changed files with 93 additions and 8 deletions
+25 -6
View File
@@ -1,16 +1,22 @@
/obj/effect/dummy/phased_mob
name = "water"
name = "ethereal form"
anchored = TRUE
flags_1 = PREVENT_CONTENTS_EXPLOSION_1
resistance_flags = LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | SHUTTLE_CRUSH_PROOF
invisibility = INVISIBILITY_OBSERVER
movement_type = FLOATING
/// The movable which's jaunting in this dummy
/// The movable which is jaunting in this dummy
var/atom/movable/jaunter
/// The delay between moves while jaunted
var/movedelay = 0
/// The speed of movement while jaunted
var/movespeed = 0
/// Image we show to our jaunter so they can see where they are
var/image/position_indicator
/// Icon we draw our position indicator from
var/phased_mob_icon = 'icons/obj/weapons/guns/projectiles.dmi'
/// Icon state we use for our position indicator
var/phased_mob_icon_state = "ice_1"
/obj/effect/dummy/phased_mob/Initialize(mapload, atom/movable/jaunter)
. = ..()
@@ -21,13 +27,25 @@
/obj/effect/dummy/phased_mob/proc/set_jaunter(atom/movable/new_jaunter)
jaunter = new_jaunter
jaunter.forceMove(src)
if(ismob(jaunter))
var/mob/mob_jaunter = jaunter
RegisterSignal(mob_jaunter, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change))
mob_jaunter.reset_perspective(src)
if(!ismob(jaunter))
return
var/mob/mob_jaunter = jaunter
position_indicator = image(phased_mob_icon, src, phased_mob_icon_state, ABOVE_LIGHTING_PLANE)
position_indicator.appearance_flags |= RESET_ALPHA
SET_PLANE_EXPLICIT(position_indicator, ABOVE_LIGHTING_PLANE, src)
RegisterSignal(mob_jaunter, COMSIG_MOB_LOGIN, PROC_REF(show_client_image))
RegisterSignal(mob_jaunter, COMSIG_MOB_STATCHANGE, PROC_REF(on_stat_change))
mob_jaunter.reset_perspective(src)
show_client_image(mob_jaunter)
/// Displays our position indicator to a client
/obj/effect/dummy/phased_mob/proc/show_client_image(mob/show_to)
SIGNAL_HANDLER
show_to.client?.images |= position_indicator
/obj/effect/dummy/phased_mob/Destroy()
jaunter = null // If a mob was left in the jaunter on qdel, they'll be dumped into nullspace
position_indicator = null
return ..()
/// Removes [jaunter] from our phased mob
@@ -57,6 +75,7 @@
. = ..()
if(gone == jaunter)
UnregisterSignal(jaunter, COMSIG_MOB_STATCHANGE)
UnregisterSignal(jaunter, COMSIG_MOB_LOGIN)
SEND_SIGNAL(src, COMSIG_MOB_EJECTED_FROM_JAUNT, jaunter)
jaunter = null