From d04b5cbeef3746e7dd931307f9514458ce84281a Mon Sep 17 00:00:00 2001 From: XDTM Date: Thu, 2 Nov 2017 14:45:41 +0100 Subject: [PATCH] Ghosts can now Health Scan (#31640) * Ghosts can now Health Scan * cyberbossing * Update observer.dm --- code/_onclick/observer.dm | 8 +++++++- code/game/objects/items/devices/scanners.dm | 4 ++-- code/modules/mob/dead/observer/observer.dm | 13 +++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 4e872d4386..025b7a0ff6 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -53,9 +53,15 @@ if(user.client) if(IsAdminGhost(user)) attack_ai(user) - if(user.client.prefs.inquisitive_ghost) + else if(user.client.prefs.inquisitive_ghost) user.examinate(src) +/mob/living/attack_ghost(mob/dead/observer/user) + if(user.client && user.health_scan) + healthscan(user, src, 1, TRUE) + return + ..() + // --------------------------------------- // And here are some good things for free: // Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index caf42fc68b..9a60d19e1f 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -106,8 +106,8 @@ MASS SPECTROMETER // Used by the PDA medical scanner too -/proc/healthscan(mob/living/user, mob/living/M, mode = 1, advanced = FALSE) - if(user.incapacitated() || user.eye_blind) +/proc/healthscan(mob/user, mob/living/M, mode = 1, advanced = FALSE) + if(isliving(user) && (user.incapacitated() || user.eye_blind)) return //Damage specifics var/oxy_loss = M.getOxyLoss() diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index f6b362e959..1ab823fd13 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -31,6 +31,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER) var/mob/observetarget = null //The target mob that the ghost is observing. Used as a reference in logout() var/ghost_hud_enabled = 1 //did this ghost disable the on-screen HUD? var/data_huds_on = 0 //Are data HUDs currently enabled? + var/health_scan = FALSE //Are health scans currently enabled? var/list/datahuds = list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC) //list of data HUDs shown to ghosts. var/ghost_orbit = GHOST_ORBIT_CIRCLE @@ -671,6 +672,18 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp to_chat(src, "Data HUDs enabled.") data_huds_on = 1 +/mob/dead/observer/verb/toggle_health_scan() + set name = "Toggle Health Scan" + set desc = "Toggles whether you health-scan living beings on click" + set category = "Ghost" + + if(health_scan) //remove old huds + to_chat(src, "Health scan disabled.") + health_scan = FALSE + else + to_chat(src, "Health scan enabled.") + health_scan = TRUE + /mob/dead/observer/verb/restore_ghost_appearance() set name = "Restore Ghost Character" set desc = "Sets your deadchat name and ghost appearance to your \