Ghost health/cyborg analyzer

This commit is contained in:
SteelSlayer
2019-08-17 10:00:05 -04:00
parent 43d50e9681
commit 3e7156e263
5 changed files with 37 additions and 5 deletions
+8
View File
@@ -58,6 +58,14 @@
/atom/proc/attack_ghost(mob/user as mob)
return
// health + cyborg analyzer for ghosts
/mob/living/attack_ghost(mob/dead/observer/user)
if(user.client && user.health_scan)
if(issilicon(src) || ismachine(src))
robot_healthscan(user, src)
else if(ishuman(src))
healthscan(user, src, 1, TRUE)
// ---------------------------------------
// And here are some good things for free:
// Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu
+6 -2
View File
@@ -135,8 +135,13 @@ REAGENT SCANNER
user.show_message("<span class='notice'>Key: Suffocation/Toxin/Burns/Brute</span>", 1)
user.show_message("<span class='notice'>Body Temperature: ???</span>", 1)
return
user.visible_message("<span class='notice'>[user] has analyzed [M]'s vitals.</span>","<span class='notice'> You have analyzed [M]'s vitals.</span>")
user.visible_message("<span class='notice'>[user] has analyzed [M]'s vitals.</span>","<span class='notice'> You have analyzed [M]'s vitals.</span>")
healthscan(user, M, mode, upgraded)
add_fingerprint(user)
proc/healthscan(mob/user, mob/living/M, mode = 1, upgraded = FALSE)
if(!ishuman(M) || M.isSynthetic())
//these sensors are designed for organic life
user.show_message("<span class='notice'>Analyzing Results for ERROR:\n\t Overall Status: ERROR</span>")
@@ -271,7 +276,6 @@ REAGENT SCANNER
user.show_message("<span class='warning'>Subject's genes are showing minor signs of instability.</span>")
else
user.show_message("<span class='notice'>Subject's genes are stable.</span>")
add_fingerprint(user)
/obj/item/healthanalyzer/verb/toggle_mode()
@@ -29,6 +29,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
var/seedarkness = TRUE
var/data_hud_seen = FALSE //this should one of the defines in __DEFINES/hud.dm
var/ghost_orbit = GHOST_ORBIT_CIRCLE
var/health_scan = FALSE //does the ghost have health scanner mode on? by default it should be off
/mob/dead/observer/New(var/mob/body=null, var/flags=1)
set_invisibility(GLOB.observer_default_invisibility)
@@ -537,6 +538,19 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set hidden = 1
to_chat(src, "<span class='warning'>You are dead! You have no mind to store memory!</span>")
/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, "<span class='notice'>Health scan disabled.</span>")
health_scan = FALSE
else
to_chat(src, "<span class='notice'>Health scan enabled.</span>")
health_scan = TRUE
/mob/dead/observer/verb/analyze_air()
set name = "Analyze Air"
set category = "Ghost"
@@ -235,6 +235,12 @@
to_chat(user, "<span class='notice'>Body Temperature: ???</span>")
return
user.visible_message("<span class='notice'>[user] has analyzed [M]'s components.</span>","<span class='notice'>You have analyzed [M]'s components.</span>")
robot_healthscan(user, M)
add_fingerprint(user)
proc/robot_healthscan(mob/user, mob/living/M)
var/scan_type
if(istype(M, /mob/living/silicon/robot))
scan_type = "robot"
@@ -244,7 +250,7 @@
to_chat(user, "<span class='warning'>You can't analyze non-robotic things!</span>")
return
user.visible_message("<span class='notice'>[user] has analyzed [M]'s components.</span>","<span class='notice'>You have analyzed [M]'s components.</span>")
switch(scan_type)
if("robot")
var/BU = M.getFireLoss() > 50 ? "<b>[M.getFireLoss()]</b>" : M.getFireLoss()
@@ -308,5 +314,3 @@
to_chat(user, "<span class='notice'>Internal Fluid Level:[H.blood_volume]/[H.max_blood]</span>")
if(H.bleed_rate)
to_chat(user, "<span class='warning'>Warning:External component leak detected!</span>")
src.add_fingerprint(user)
@@ -885,6 +885,8 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/attack_ghost(mob/user)
if(wiresexposed)
wires.Interact(user)
else
..() //this calls the /mob/living/attack_ghost proc for the ghost health/cyborg analyzer
/mob/living/silicon/robot/proc/allowed(obj/item/I)
var/obj/dummy = new /obj(null) // Create a dummy object to check access on as to avoid having to snowflake check_access on every mob