mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 04:17:33 +01:00
Vitals Monitor (#11769)
This commit is contained in:
@@ -224,6 +224,7 @@
|
||||
var/base_state = "standard"
|
||||
var/item_bedpath = /obj/item/roller
|
||||
var/obj/item/reagent_containers/beaker
|
||||
var/obj/item/vitals_monitor/vitals
|
||||
var/iv_attached = 0
|
||||
var/iv_stand = TRUE
|
||||
var/patient_shift = 9 //How much are mobs moved up when they are buckled_to.
|
||||
@@ -234,8 +235,15 @@
|
||||
..()
|
||||
LAZYADD(can_buckle, /obj/structure/closet/body_bag)
|
||||
|
||||
/obj/structure/bed/roller/Destroy()
|
||||
QDEL_NULL(beaker)
|
||||
vitals.bed = null
|
||||
QDEL_NULL(vitals)
|
||||
return ..()
|
||||
|
||||
/obj/structure/bed/roller/update_icon()
|
||||
overlays.Cut()
|
||||
cut_overlays()
|
||||
vis_contents = list()
|
||||
if(density)
|
||||
icon_state = "[base_state]_up"
|
||||
else
|
||||
@@ -245,18 +253,31 @@
|
||||
var/percentage = round((beaker.reagents.total_volume / beaker.volume) * 100, 25)
|
||||
var/image/filling = image(icon, "iv_filling[percentage]")
|
||||
filling.color = beaker.reagents.get_color()
|
||||
iv.overlays += filling
|
||||
iv.add_overlay(filling)
|
||||
if(percentage < 25)
|
||||
iv.overlays += image(icon, "light_low")
|
||||
iv.add_overlay(image(icon, "light_low"))
|
||||
if(density)
|
||||
iv.pixel_y = 6
|
||||
overlays += iv
|
||||
add_overlay(iv)
|
||||
if(vitals)
|
||||
vitals.update_monitor()
|
||||
vis_contents += vitals
|
||||
if(bag_strap && istype(buckled, /obj/structure/closet/body_bag))
|
||||
LAZYADD(buckled.overlays, image(icon, bag_strap))
|
||||
|
||||
/obj/structure/bed/roller/attackby(obj/item/I, mob/user)
|
||||
if(iswrench(I) || istype(I, /obj/item/stack) || iswirecutter(I))
|
||||
return 1
|
||||
if(istype(I, /obj/item/vitals_monitor))
|
||||
if(vitals)
|
||||
to_chat(user, SPAN_WARNING("\The [src] already has a vitals monitor attached!"))
|
||||
return
|
||||
to_chat(user, SPAN_NOTICE("You attach \the [I] to \the [src]."))
|
||||
user.drop_from_inventory(I, src)
|
||||
vitals = I
|
||||
vitals.bed = src
|
||||
update_icon()
|
||||
return
|
||||
if(iv_stand && !beaker && (istype(I, /obj/item/reagent_containers/glass/beaker) || istype(I, /obj/item/reagent_containers/blood)))
|
||||
if(!user.unEquip(I, target = src))
|
||||
return
|
||||
@@ -295,6 +316,14 @@
|
||||
beaker = null
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bed/roller/proc/remove_vitals(mob/user)
|
||||
to_chat(user, SPAN_NOTICE("You detach \the [vitals] from \the [src]."))
|
||||
vitals.bed = null
|
||||
vitals.update_monitor()
|
||||
user.put_in_hands(vitals)
|
||||
vitals = null
|
||||
update_icon()
|
||||
|
||||
/obj/structure/bed/roller/proc/attach_iv(mob/living/carbon/human/target, mob/user)
|
||||
if(!beaker)
|
||||
return
|
||||
@@ -329,6 +358,9 @@
|
||||
if(beaker)
|
||||
remove_beaker(usr)
|
||||
return
|
||||
if(vitals)
|
||||
remove_vitals(usr)
|
||||
return
|
||||
if(buckled)
|
||||
return
|
||||
collapse()
|
||||
|
||||
Reference in New Issue
Block a user