Files
Paradise/code/_onclick/hud/ghost_hud.dm
Luc 23ad8a48fa Adds true observing -- letting you see what your target sees (#24855)
* bring it back now y'all

* adds a bunch of other changes

* pretty much works at this point

* grep

* Fixes some bugs, still chasing some down

* Add observers to recursive mob check, ensuring they can see messages from their orbitted atom

* tidy some things up

* resolve

* remove unnecessary checks

* Address todos, minor cleanups

* oh dear

* initial testing

* Fix some vulnerabilities (oops)

* Fix some other bugs from testing

* ci fixes

* Add some contingencies against clicking things you shouldn't

* fix some noted bugs

* Add observe to admin jump, improve messaging

* add a few more fixes that should mostly address some runtimes

* oh this wasn't really great

* one last thing

* Fix suit inventory problem

* Remove merge artifact

* Add some missing parens

* Prevents you from observing other ghosts, and should fix the getting stuck outside of your body issue.

* we love testing

* adds to player panel

* Fix more bugs with observers getting stuck outside of their body

* cleans up player panel, verb offerings

* shit

* Update code/_onclick/hud/alert.dm

welp

Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Fixes some targeting issues

* Fixes targeting on aobserve

* Fix some weird storage bugs

* clean up some doulbed up follow links

* Update code/modules/admin/player_panel.dm

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Adds some checks for ghost observe

* Remove mentor debug log

* ahhhhhhhhh that'll do it

* Cleans up some additional checks that were not quite what they should have been

* better logging, too

* mochi review

* one more thing

* Gets robot huds mostly working

* hopefully fix folks not getting observe

* Fix order of operations causing a runtime on qdeleting

* Remove some unnecessary stack traces

* Apply suggestions from code review

Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

* Fix bug with items in your inventory disappearing on changing HUD modes

* Fix some bugs with the observe verbs

* possibly fix nullspace issues

* funny review

* missed one

---------

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
2024-05-23 15:46:43 +00:00

134 lines
3.4 KiB
Plaintext

/atom/movable/screen/ghost
icon = 'icons/mob/screen_ghost.dmi'
/atom/movable/screen/ghost/orbit
name = "Orbit"
icon_state = "orbit"
/atom/movable/screen/ghost/orbit/Click()
var/mob/dead/observer/G = usr
G.follow()
/atom/movable/screen/ghost/reenter_corpse
name = "Re-enter corpse"
icon_state = "reenter_corpse"
/atom/movable/screen/ghost/reenter_corpse/Click()
var/mob/dead/observer/G = usr
G.reenter_corpse()
/atom/movable/screen/ghost/reenter_corpse/MouseEntered()
. = ..()
flick(icon_state + "_anim", src)
/atom/movable/screen/ghost/teleport
name = "Teleport"
icon_state = "teleport"
/atom/movable/screen/ghost/teleport/Click()
var/mob/dead/observer/G = usr
G.dead_tele()
/atom/movable/screen/ghost/respawn_list
name = "Ghost spawns"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "template"
/atom/movable/screen/ghost/respawn_list/Initialize(mapload)
. = ..()
update_hidden_state()
/atom/movable/screen/ghost/respawn_list/Click()
var/client/C = hud.mymob.client
hud.inventory_shown = !hud.inventory_shown
if(hud.inventory_shown)
C.screen += hud.toggleable_inventory
else
C.screen -= hud.toggleable_inventory
update_hidden_state()
/atom/movable/screen/ghost/respawn_list/proc/update_hidden_state()
var/matrix/M = matrix(transform)
M.Turn(-90)
overlays.Cut()
var/image/img = image('icons/mob/actions/actions.dmi', src, (hud && hud.inventory_shown) ? "hide" : "show")
img.transform = M
overlays += img
/atom/movable/screen/ghost/respawn_mob
name = "Mob spawners"
icon_state = "mob_spawner"
/atom/movable/screen/ghost/respawn_mob/Click()
var/mob/dead/observer/G = usr
G.open_spawners_menu()
/atom/movable/screen/ghost/respawn_pai
name = "Configure pAI"
icon_state = "pai"
/atom/movable/screen/ghost/respawn_pai/Click()
var/mob/dead/observer/G = usr
if(!GLOB.paiController.check_recruit(G))
to_chat(G, "<span class='warning'>You are not eligible to become a pAI.</span>")
return
GLOB.paiController.recruitWindow(G)
/datum/hud/ghost
inventory_shown = FALSE
/datum/hud/ghost/New(mob/owner)
..()
var/atom/movable/screen/using
using = new /atom/movable/screen/ghost/orbit()
using.screen_loc = ui_ghost_orbit
static_inventory += using
using = new /atom/movable/screen/ghost/reenter_corpse()
using.screen_loc = ui_ghost_reenter_corpse
static_inventory += using
using = new /atom/movable/screen/ghost/teleport()
using.screen_loc = ui_ghost_teleport
static_inventory += using
static_inventory += using
using = new /atom/movable/screen/ghost/respawn_list()
using.screen_loc = ui_ghost_respawn_list
static_inventory += using
using = new /atom/movable/screen/ghost/respawn_mob()
using.screen_loc = ui_ghost_respawn_mob
toggleable_inventory += using
using = new /atom/movable/screen/ghost/respawn_pai()
using.screen_loc = ui_ghost_respawn_pai
toggleable_inventory += using
for(var/atom/movable/screen/S in (static_inventory + toggleable_inventory))
S.hud = src
/datum/hud/ghost/show_hud(version = 0, mob/viewmob)
// don't show this HUD if observing; show the HUD of the observee
var/mob/dead/observer/O = mymob
if(istype(O) && O.mob_observed)
plane_masters_update()
return FALSE
. = ..()
if(!.)
return
var/mob/screenmob = viewmob || mymob
screenmob.client.screen += static_inventory
// We should only see observed mob alerts.
/datum/hud/ghost/reorganize_alerts(mob/viewmob)
var/mob/dead/observer/O = mymob
if(istype(O) && O.mob_observed)
return
return ..()