mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 01:23:41 +01:00
Merge pull request #1966 from Fox-McCloud/health-assembly
Health Assembly
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
/obj/item/device/assembly/health
|
||||
name = "health sensor"
|
||||
desc = "Used for scanning and monitoring health."
|
||||
icon_state = "health"
|
||||
materials = list(MAT_METAL=800, MAT_GLASS=200)
|
||||
origin_tech = "magnets=1;biotech=1"
|
||||
secured = 0
|
||||
|
||||
var/scanning = 0
|
||||
var/health_scan
|
||||
var/alarm_health = 0
|
||||
|
||||
|
||||
|
||||
/obj/item/device/assembly/health/activate()
|
||||
if(!..()) return 0//Cooldown check
|
||||
toggle_scan()
|
||||
return 0
|
||||
|
||||
/obj/item/device/assembly/health/toggle_secure()
|
||||
secured = !secured
|
||||
if(secured && scanning)
|
||||
processing_objects.Add(src)
|
||||
else
|
||||
scanning = 0
|
||||
processing_objects.Remove(src)
|
||||
update_icon()
|
||||
return secured
|
||||
|
||||
/obj/item/device/assembly/health/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/multitool))
|
||||
if(alarm_health == 0)
|
||||
alarm_health = -90
|
||||
user.show_message("You toggle [src] to \"detect death\" mode.")
|
||||
else
|
||||
alarm_health = 0
|
||||
user.show_message("You toggle [src] to \"detect critical state\" mode.")
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/device/assembly/health/process()
|
||||
if(!scanning || !secured)
|
||||
return
|
||||
|
||||
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
|
||||
|
||||
if(M)
|
||||
health_scan = M.health
|
||||
if(health_scan <= alarm_health)
|
||||
pulse()
|
||||
audible_message("\icon[src] *beep* *beep*", "*beep* *beep*")
|
||||
toggle_scan()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/device/assembly/health/proc/toggle_scan()
|
||||
if(!secured) return 0
|
||||
scanning = !scanning
|
||||
if(scanning)
|
||||
processing_objects.Add(src)
|
||||
else
|
||||
processing_objects.Remove(src)
|
||||
return
|
||||
|
||||
/obj/item/device/assembly/health/interact(mob/user as mob)//TODO: Change this to the wires thingy
|
||||
if(!secured)
|
||||
user.show_message("<span class='warning'>The [name] is unsecured!</span>")
|
||||
return 0
|
||||
var/dat = text("<TT><B>Health Sensor</B> <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")
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/assembly/health/Topic(href, href_list)
|
||||
..()
|
||||
if(!ismob(usr))
|
||||
return
|
||||
|
||||
var/mob/user = usr
|
||||
|
||||
if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
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
|
||||
@@ -244,6 +244,8 @@
|
||||
stat(null, eta_status)
|
||||
|
||||
if (client.statpanel == "Status")
|
||||
if(locate(/obj/item/device/assembly/health) in src)
|
||||
stat(null, "Health: [health]")
|
||||
if (internal)
|
||||
if (!internal.air_contents)
|
||||
qdel(internal)
|
||||
@@ -431,7 +433,7 @@
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
/mob/living/carbon/human/proc/is_loyalty_implanted()
|
||||
/mob/living/carbon/human/proc/is_loyalty_implanted()
|
||||
for(var/L in contents)
|
||||
if(istype(L, /obj/item/weapon/implant/loyalty))
|
||||
for(var/obj/item/organ/external/O in organs)
|
||||
@@ -694,7 +696,7 @@
|
||||
|
||||
// if looting pockets with gloves, do it quietly
|
||||
if(href_list["pockets"])
|
||||
if(isanimal(usr))
|
||||
if(isanimal(usr))
|
||||
return //animals cannot strip people
|
||||
|
||||
if(frozen)
|
||||
@@ -726,19 +728,19 @@
|
||||
// Update strip window
|
||||
if(usr.machine == src && in_range(src, usr))
|
||||
show_inv(usr)
|
||||
|
||||
|
||||
else if(!pickpocket)
|
||||
// Display a warning if the user mocks up
|
||||
src << "<span class='warning'>You feel your [pocket_side] pocket being fumbled with!</span>"
|
||||
|
||||
// if looting id with gloves, do it quietly - this allows pickpocket gloves to take/place id stealthily - Bone White
|
||||
if(href_list["item"])
|
||||
if(isanimal(usr))
|
||||
if(isanimal(usr))
|
||||
return //animals cannot strip people
|
||||
|
||||
|
||||
if(frozen)
|
||||
usr << "\red Do not attempt to strip frozen people."
|
||||
return
|
||||
return
|
||||
var/itemTarget = href_list["item"]
|
||||
if(itemTarget == "id")
|
||||
if(pickpocket)
|
||||
@@ -1158,7 +1160,7 @@
|
||||
if(!fail_msg)
|
||||
fail_msg = "There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"] to inject into."
|
||||
user << "<span class='alert'>[fail_msg]</span>"
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/check_has_mouth()
|
||||
// Todo, check stomach organ when implemented.
|
||||
var/obj/item/organ/external/head/H = get_organ("head")
|
||||
@@ -1170,7 +1172,7 @@
|
||||
if(stat==DEAD)return
|
||||
|
||||
if(!check_has_mouth())
|
||||
return
|
||||
return
|
||||
|
||||
if(!lastpuke)
|
||||
lastpuke = 1
|
||||
@@ -1517,16 +1519,16 @@
|
||||
|
||||
W.add_fingerprint(src)
|
||||
|
||||
// Allows IPC's to change their monitor display
|
||||
// Allows IPC's to change their monitor display
|
||||
/mob/living/carbon/human/proc/change_monitor()
|
||||
set category = "IC"
|
||||
set category = "IC"
|
||||
set name = "Change Monitor Display"
|
||||
set desc = "Change the display on your monitor."
|
||||
|
||||
|
||||
if(stat || paralysis || stunned || weakened)
|
||||
src << "<span class='warning'>You cannot change your monitor display in your current state.</span>"
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
var/list/hair = list()
|
||||
for(var/i in hair_styles_list)
|
||||
var/datum/sprite_accessory/hair/tmp_hair = hair_styles_list[i]
|
||||
@@ -1540,7 +1542,7 @@
|
||||
h_style = new_style
|
||||
|
||||
update_hair()
|
||||
|
||||
|
||||
//Putting a couple of procs here that I don't know where else to dump.
|
||||
//Mostly going to be used for Vox and Vox Armalis, but other human mobs might like them (for adminbuse).
|
||||
/mob/living/carbon/human/proc/leap()
|
||||
|
||||
@@ -162,6 +162,14 @@
|
||||
build_path = /obj/item/device/assembly/infra
|
||||
category = list("initial", "Miscellaneous")
|
||||
|
||||
/datum/design/health_sensor
|
||||
name = "Health sensor"
|
||||
id = "health_sensor"
|
||||
build_type = AUTOLATHE
|
||||
materials = list(MAT_METAL = 800, MAT_GLASS = 200)
|
||||
build_path = /obj/item/device/assembly/health
|
||||
category = list("initial", "Medical")
|
||||
|
||||
/datum/design/kitchen_knife
|
||||
name = "Kitchen knife"
|
||||
id = "kitchen_knife"
|
||||
|
||||
Reference in New Issue
Block a user