diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 963b4809af8..0d8a96d7f3e 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -47,13 +47,15 @@ /obj/structure/bed/mechanics_hints() . = list() . += ..() - . += "Click and drag yourself (or anyone) to this to buckle in." + . += "Click-drag yourself (or anyone) to this to buckle in." . += "Click on this with an empty hand to undo the buckles." . += "Anyone with restraints, such as handcuffs, will not be able to unbuckle themselves. They must use the Resist button, or verb, to break free of \ the buckles instead." . += "To unbuckle people as a stationbound, click the bed with an empty gripper." if(held_item) - . += "Click and drag this onto yourself to pick it up." + . += "Click-drag this onto yourself to pick it up, remove an attached item, or to change the IV flow rate." + . += "Vitals monitors, blood bags, beakers, bottles, and medical scans can be attached by clicking this with the object in your active hand." + . += "ALT+click this to lock or unlock it in place." /obj/structure/bed/assembly_hints() . = list() @@ -378,10 +380,18 @@ held_item = /obj/item/roller var/obj/item/reagent_containers/beaker var/obj/item/vitals_monitor/vitals + var/obj/item/paper/medscan var/iv_attached = 0 var/iv_stand = TRUE var/iv_transfer_rate = 4 //Same as max for regular IV drips + var/iv_transfer_rate_lowerlimit = 0.001 + var/iv_transfer_rate_upperlimit = 4 var/has_iv_light = TRUE + var/medscan_view_distance = 2 + var/scan_pixel_offset_y = -7 + var/scan_pixel_offset_x = 0 + var/iv_pixel_offset_y = 7 + var/iv_pixel_offset_x = 0 //Items that can be attached to an IV var/list/accepted_containers = list( /obj/item/reagent_containers/blood, @@ -397,6 +407,7 @@ /obj/structure/bed/roller/Destroy() QDEL_NULL(beaker) QDEL_NULL(vitals) + QDEL_NULL(medscan) return ..() /obj/structure/bed/roller/update_icon() @@ -418,7 +429,7 @@ if(percentage < 25) iv.AddOverlays(image(icon, "light_low")) if(density) - iv.pixel_y = 7 + iv.pixel_y = iv_pixel_offset_y AddOverlays(iv) if(has_iv_light) var/image/light = image(icon, "iv[iv_attached]_l") @@ -426,6 +437,17 @@ if(vitals) vitals.update_monitor() add_vis_contents(vitals) + if(medscan) + var/image/scan = image(icon, "holder_medscan") + if(!density) + scan.pixel_y = scan_pixel_offset_y + AddOverlays(scan) + +/obj/structure/bed/roller/feedback_hints(mob/user, distance, show_extended) + if(medscan && distance<=medscan_view_distance) + var/obj/item/paper/H = medscan + H.show_content(usr) + .=..() /obj/structure/bed/roller/attackby(obj/item/attacking_item, mob/user) if(iswrench(attacking_item) || istype(attacking_item, /obj/item/stack) || iswirecutter(attacking_item)) @@ -447,6 +469,15 @@ beaker = attacking_item update_icon() return 1 + if(istype(attacking_item, /obj/item/paper/medscan)) + if(medscan) + to_chat(user, SPAN_WARNING("\The [src] already has a medical scan attached!")) + return + to_chat(user, SPAN_NOTICE("You attach \the [attacking_item] to \the [src].")) + user.drop_from_inventory(attacking_item, src) + medscan = attacking_item + update_icon() + return 1 ..() /obj/structure/bed/roller/attack_hand(mob/living/user) @@ -495,6 +526,12 @@ vitals = null update_icon() +/obj/structure/bed/roller/proc/remove_paper(mob/user) + to_chat(user, SPAN_NOTICE("You detach \the [medscan] from \the [src].")) + user.put_in_hands(medscan) + medscan = null + update_icon() + /obj/structure/bed/roller/proc/attach_iv(mob/living/carbon/human/target, mob/user) if(!beaker) return @@ -526,16 +563,64 @@ if(user_buckle(over, user)) attach_iv(buckled, user) return - if(beaker) - remove_beaker(user) - return - if(vitals) - remove_vitals(user) - return if(buckled) - to_chat(user, SPAN_WARNING("\The [buckled] is on \the [src]. Remove them first.")) + var/list/options = list( + "Transfer Rate" = image('icons/mob/screen/radial.dmi', "radial_transrate"), + "Remove Container" = image('icons/mob/screen/radial.dmi', "iv_beaker"), + "Remove Vitals Monitor" = image('icons/mob/screen/radial.dmi', "vitals_monitor"), + "Remove Scan" = image('icons/mob/screen/radial.dmi', "med_scan")) + var/chosen_action = show_radial_menu(user, src, options, require_near = TRUE, radius = 42, tooltips = TRUE) + if(!chosen_action) + return + switch(chosen_action) + if("Transfer Rate") + transfer_rate() + if("Remove Container") + if(!beaker) + to_chat(user, SPAN_NOTICE("There is no reagent container to remove.")) + return + remove_beaker(user) + return + if("Remove Vitals Monitor") + if(!vitals) + to_chat(user, SPAN_NOTICE("There is no vitals monitor to remove.")) + return + remove_vitals(user) + return + if("Remove Scan") + if(!medscan) + to_chat(user, SPAN_NOTICE("There is no medical scan to remove.")) + return + remove_paper(user) + return + if(!buckled) + if(medscan) + remove_paper(user) + if(vitals) + remove_vitals(user) + if(beaker) + remove_beaker(user) + collapse() + +/obj/structure/bed/roller/verb/transfer_rate() + set category = "Object.IV Drip" + set name = "Set Transfer Rate" + set src in view(1) + + if(use_check_and_message(usr)) return - collapse() + set_rate: + var/amount = tgui_input_number(usr, "Set the IV drip's transfer rate.", "IV Drip", iv_transfer_rate, iv_transfer_rate_upperlimit, iv_transfer_rate_lowerlimit, round_value = FALSE) + if(!amount) + return + if ((0.001 > amount || amount > 4) && amount != 0) + to_chat(usr, SPAN_WARNING("Entered value must be between 0.001 and 4.")) + goto set_rate + if (iv_transfer_rate == 0) + iv_transfer_rate = REM + return + iv_transfer_rate = amount + to_chat(usr, SPAN_NOTICE("Transfer rate set to [src.iv_transfer_rate] u/sec.")) /obj/structure/bed/roller/Move() . = ..() diff --git a/html/changelogs/CatsinHD - RollerbedScans.yml b/html/changelogs/CatsinHD - RollerbedScans.yml new file mode 100644 index 00000000000..0f9b78dda49 --- /dev/null +++ b/html/changelogs/CatsinHD - RollerbedScans.yml @@ -0,0 +1,59 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: CatsinHD + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Medical scans can be attached to rollerbeds." + - qol: "Rollerbeds now use a radial menu for detaching vitals monitors, IVs, medical scans, and changing IV transfer rate." diff --git a/icons/mob/screen/radial.dmi b/icons/mob/screen/radial.dmi index d9c2f218ad7..c44f09d2032 100644 Binary files a/icons/mob/screen/radial.dmi and b/icons/mob/screen/radial.dmi differ diff --git a/icons/obj/rollerbed.dmi b/icons/obj/rollerbed.dmi index 8123e652a50..740b749b6e1 100644 Binary files a/icons/obj/rollerbed.dmi and b/icons/obj/rollerbed.dmi differ