This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
icon_state = "health"
|
||||
custom_materials = list(/datum/material/iron=800, /datum/material/glass=200)
|
||||
attachable = TRUE
|
||||
secured = FALSE
|
||||
|
||||
var/scanning = FALSE
|
||||
var/health_scan
|
||||
@@ -12,7 +11,8 @@
|
||||
|
||||
/obj/item/assembly/health/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>Use a multitool to swap between \"detect death\" mode and \"detect critical state\" mode.</span>"
|
||||
. += "Use it in hand to turn it off/on and Alt-click to swap between \"detect death\" mode and \"detect critical state\" mode."
|
||||
. += "[src.scanning ? "The sensor is on and you can see [health_scan] displayed on the screen" : "The sensor is off"]."
|
||||
|
||||
/obj/item/assembly/health/activate()
|
||||
if(!..())
|
||||
@@ -30,14 +30,13 @@
|
||||
update_icon()
|
||||
return secured
|
||||
|
||||
/obj/item/assembly/health/multitool_act(mob/living/user, obj/item/I)
|
||||
/obj/item/assembly/health/AltClick(mob/living/user)
|
||||
if(alarm_health == HEALTH_THRESHOLD_CRIT)
|
||||
alarm_health = HEALTH_THRESHOLD_DEAD
|
||||
to_chat(user, "<span class='notice'>You toggle [src] to \"detect death\" mode.</span>")
|
||||
else
|
||||
alarm_health = HEALTH_THRESHOLD_CRIT
|
||||
to_chat(user, "<span class='notice'>You toggle [src] to \"detect critical state\" mode.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/health/process()
|
||||
if(!scanning || !secured)
|
||||
@@ -46,7 +45,6 @@
|
||||
var/atom/A = src
|
||||
if(connected && connected.holder)
|
||||
A = connected.holder
|
||||
|
||||
for(A, A && !ismob(A), A=A.loc);
|
||||
// like get_turf(), but for mobs.
|
||||
var/mob/living/M = A
|
||||
@@ -71,36 +69,7 @@
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
|
||||
/obj/item/assembly/health/ui_interact(mob/user as mob)//TODO: Change this to the wires thingy
|
||||
/obj/item/assembly/health/attack_self(mob/user)
|
||||
. = ..()
|
||||
if(!secured)
|
||||
user.show_message("<span class='warning'>The [name] is unsecured!</span>")
|
||||
return FALSE
|
||||
var/dat = "<TT><B>Health Sensor</B></TT>"
|
||||
dat += "<BR><A href='?src=[REF(src)];scanning=1'>[scanning?"On":"Off"]</A>"
|
||||
if(scanning && health_scan)
|
||||
dat += "<BR>Health: [health_scan]"
|
||||
user << browse(dat, "window=hscan")
|
||||
onclose(user, "hscan")
|
||||
|
||||
/obj/item/assembly/health/Topic(href, href_list)
|
||||
..()
|
||||
if(!ismob(usr))
|
||||
return
|
||||
|
||||
var/mob/user = usr
|
||||
|
||||
if(!user.canUseTopic(src))
|
||||
usr << browse(null, "window=hscan")
|
||||
onclose(usr, "hscan")
|
||||
return
|
||||
|
||||
if(href_list["scanning"])
|
||||
toggle_scan()
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=hscan")
|
||||
return
|
||||
|
||||
attack_self(user)
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You toggle [src] [src.scanning ? "off" : "on"].</span>")
|
||||
toggle_scan()
|
||||
|
||||
Reference in New Issue
Block a user