diff --git a/code/game/machinery/vitals_monitor.dm b/code/game/machinery/vitals_monitor.dm new file mode 100644 index 0000000000..610f21e6e7 --- /dev/null +++ b/code/game/machinery/vitals_monitor.dm @@ -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) + . += "It's unpowered." + return + . += "Vitals of [victim]:" + . += "Pulse: [victim.get_pulse(GETPULSE_TOOL)]" + + 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" + + . += "Brain activity: [brain_activity]" + . += "Breathing: [breathing]" + +/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("\The [src] is now showing data for [victim].") + +/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, "You turn the sound on \the [src] [beep ? "on" : "off"].") diff --git a/code/modules/research/designs/circuits/circuits_vr.dm b/code/modules/research/designs/circuits/circuits_vr.dm index 0dac20efaf..98d9c860bd 100644 --- a/code/modules/research/designs/circuits/circuits_vr.dm +++ b/code/modules/research/designs/circuits/circuits_vr.dm @@ -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" \ No newline at end of file + 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" diff --git a/icons/obj/heartmonitor.dmi b/icons/obj/heartmonitor.dmi new file mode 100644 index 0000000000..dcbdfa4f54 Binary files /dev/null and b/icons/obj/heartmonitor.dmi differ diff --git a/maps/tether/tether-02-surface2.dmm b/maps/tether/tether-02-surface2.dmm index e1b80cc840..07208a4295 100644 --- a/maps/tether/tether-02-surface2.dmm +++ b/maps/tether/tether-02-surface2.dmm @@ -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" = ( diff --git a/maps/tether/tether-07-station3.dmm b/maps/tether/tether-07-station3.dmm index af10bc0a98..d3d445eb13 100644 --- a/maps/tether/tether-07-station3.dmm +++ b/maps/tether/tether-07-station3.dmm @@ -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" = ( diff --git a/sound/machines/quiet_beep.ogg b/sound/machines/quiet_beep.ogg new file mode 100644 index 0000000000..332d409591 Binary files /dev/null and b/sound/machines/quiet_beep.ogg differ diff --git a/vorestation.dme b/vorestation.dme index d36d4ea081..4eef2efec0 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -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"