Merge pull request #7622 from VOREStation/aro-vitals

Port Bay vitals monitors
This commit is contained in:
Aronai Sieyes
2020-05-04 16:49:52 -04:00
committed by GitHub
7 changed files with 158 additions and 1 deletions
+146
View File
@@ -0,0 +1,146 @@
/obj/item/weapon/circuitboard/machine/vitals_monitor
name = "circuit board (vitals monitor)"
build_path = /obj/machinery/vitals_monitor
board_type = new /datum/frame/frame_types/machine
origin_tech = list(TECH_DATA = 3, TECH_BIO = 4, TECH_ENGINEERING = 2)
req_components = list(
/obj/item/weapon/stock_parts/console_screen = 1,
/obj/item/weapon/cell/high = 1
)
/obj/machinery/vitals_monitor
name = "vitals monitor"
desc = "A bulky yet mobile machine, showing some odd graphs."
icon = 'icons/obj/heartmonitor.dmi'
icon_state = "base"
anchored = FALSE
power_channel = EQUIP
idle_power_usage = 10
active_power_usage = 100
var/mob/living/carbon/human/victim
var/beep = TRUE
/obj/machinery/vitals_monitor/Initialize()
. = ..()
default_apply_parts()
/obj/machinery/vitals_monitor/Destroy()
victim = null
. = ..()
/obj/machinery/vitals_monitor/examine(mob/user)
. = ..()
if(victim)
if(stat & NOPOWER)
. += "<span class='notice'>It's unpowered.</span>"
return
. += "<span class='notice'>Vitals of [victim]:</span>"
. += "<span class='notice'>Pulse: [victim.get_pulse(GETPULSE_TOOL)]</span>"
var/brain_activity = "none"
var/breathing = "none"
if(victim.stat != DEAD && !(victim.status_flags & FAKEDEATH))
var/obj/item/organ/internal/brain/brain = victim.internal_organs_by_name[O_BRAIN]
if(istype(brain))
if(victim.getBrainLoss())
brain_activity = "anomalous"
else if(victim.stat == UNCONSCIOUS)
brain_activity = "weak"
else
brain_activity = "normal"
var/obj/item/organ/internal/lungs/lungs = victim.internal_organs_by_name[O_LUNGS]
if(istype(lungs))
var/oxyloss = victim.getOxyLoss()
if(oxyloss > 50)
breathing = "erratic"
else if(oxyloss > 10)
breathing = "shallow"
else
breathing = "normal"
. += "<span class='notice'>Brain activity: [brain_activity]</span>"
. += "<span class='notice'>Breathing: [breathing]</span>"
/obj/machinery/vitals_monitor/process()
if(QDELETED(victim))
victim = null
if(victim && !Adjacent(victim))
victim = null
update_use_power(USE_POWER_IDLE)
if(victim)
update_icon()
if(beep && victim && victim.pulse)
playsound(src, 'sound/machines/quiet_beep.ogg')
/obj/machinery/vitals_monitor/MouseDrop(over_object, src_location, over_location)
if(!CanMouseDrop(over_object))
return
if(victim)
victim = null
update_use_power(USE_POWER_IDLE)
else if(ishuman(over_object))
victim = over_object
update_use_power(USE_POWER_ACTIVE)
visible_message("<span class='notice'>\The [src] is now showing data for [victim].</span>")
/obj/machinery/vitals_monitor/update_icon()
cut_overlays()
if(stat & NOPOWER)
return
add_overlay("screen")
if(!victim)
return
switch(victim.pulse)
if(PULSE_NONE)
add_overlay("pulse_flatline")
add_overlay("pulse_warning")
if(PULSE_SLOW, PULSE_NORM,)
add_overlay("pulse_normal")
if(PULSE_FAST, PULSE_2FAST)
add_overlay("pulse_veryfast")
if(PULSE_THREADY)
add_overlay("pulse_thready")
add_overlay("pulse_warning")
var/obj/item/organ/internal/brain/brain = victim.internal_organs_by_name[O_BRAIN]
if(istype(brain) && victim.stat != DEAD && !(victim.status_flags & FAKEDEATH))
if(victim.getBrainLoss())
add_overlay("brain_verybad")
add_overlay("brain_warning")
else if(victim.stat == UNCONSCIOUS)
add_overlay("brain_bad")
else
add_overlay("brain_ok")
else
add_overlay("brain_warning")
var/obj/item/organ/internal/lungs/lungs = victim.internal_organs_by_name[O_LUNGS]
if(istype(lungs) && victim.stat != DEAD && !(victim.status_flags & FAKEDEATH))
var/oxyloss = victim.getOxyLoss()
if(oxyloss > 50)
add_overlay("breathing_shallow")
add_overlay("breathing_warning")
else if(oxyloss > 10)
add_overlay("breathing_shallow")
else
add_overlay("breathing_normal")
else
add_overlay("breathing_warning")
/obj/machinery/vitals_monitor/verb/toggle_beep()
set name = "Toggle Monitor Beeping"
set category = "Object"
set src in view(1)
var/mob/user = usr
if(!istype(user))
return
if(CanInteract(user, physical_state))
beep = !beep
to_chat(user, "<span class='notice'>You turn the sound on \the [src] [beep ? "on" : "off"].</span>")
@@ -160,4 +160,11 @@
id = "adv_rtg"
req_tech = list(TECH_DATA = 5, TECH_POWER = 5, TECH_PHORON = 5, TECH_ENGINEERING = 5)
build_path = /obj/item/weapon/circuitboard/machine/rtg/advanced
sort_string = "HAAE"
sort_string = "HAAE"
/datum/design/circuit/rtg
name = "vitals monitor"
id = "vitals"
req_tech = list(TECH_DATA = 3, TECH_BIO = 4, TECH_ENGINEERING = 2)
build_path = /obj/item/weapon/circuitboard/machine/vitals_monitor
sort_string = "HAAF"
Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

+1
View File
@@ -23006,6 +23006,7 @@
icon_state = "extinguisher_closed";
pixel_x = -30
},
/obj/machinery/vitals_monitor,
/turf/simulated/floor/tiled/white,
/area/tether/surfacebase/medical/storage)
"aQR" = (
+2
View File
@@ -21723,6 +21723,7 @@
/obj/effect/floor_decal/corner/paleblue/bordercorner2{
dir = 1
},
/obj/machinery/vitals_monitor,
/turf/simulated/floor/tiled/white,
/area/medical/sleeper)
"aHr" = (
@@ -22407,6 +22408,7 @@
/obj/effect/floor_decal/corner/paleblue/border{
dir = 4
},
/obj/machinery/vitals_monitor,
/turf/simulated/floor/tiled/white,
/area/medical/sleeper)
"aIm" = (
Binary file not shown.
+1
View File
@@ -813,6 +813,7 @@
#include "code\game\machinery\turret_control.dm"
#include "code\game\machinery\vending.dm"
#include "code\game\machinery\vending_vr.dm"
#include "code\game\machinery\vitals_monitor.dm"
#include "code\game\machinery\wall_frames.dm"
#include "code\game\machinery\washing_machine.dm"
#include "code\game\machinery\wishgranter.dm"