diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 66c62c105463..ef6c74a052cd 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -11,6 +11,8 @@ var/mode = 1 // 1 is injecting, 0 is taking blood. var/obj/item/reagent_container/beaker = null var/datum/beam/current_beam + //make it so that IV doesn't require power to function. + use_power = USE_POWER_NONE /obj/structure/machinery/iv_drip/update_icon() if(attached) @@ -44,15 +46,6 @@ else if(!current_beam && attached && !QDELETED(src)) current_beam = beam(attached, "iv_tube") -/obj/structure/machinery/iv_drip/power_change() - . = ..() - if(stat & NOPOWER && attached) - visible_message("\The [src] retracts its IV tube and shuts down.") - attached.active_transfusions -= src - attached = null - update_beam() - update_icon() - /obj/structure/machinery/iv_drip/Destroy() attached?.active_transfusions -= src attached = null @@ -61,17 +54,18 @@ /obj/structure/machinery/iv_drip/MouseDrop(over_object, src_location, over_location) ..() - if(inoperable()) - visible_message("\The [src] is not powered.") - return if(ishuman(usr)) - var/mob/living/carbon/human/H = usr - if(H.stat || get_dist(H, src) > 1 || H.blinded || H.lying) + var/mob/living/carbon/human/user = usr + if(user.stat || get_dist(user, src) > 1 || user.blinded || user.lying) + return + + if(!skillcheck(user, SKILL_SURGERY, SKILL_SURGERY_NOVICE)) + to_chat(user, SPAN_WARNING("You don't know how to [attached ? "disconnect" : "connect"] this!")) return if(attached) - H.visible_message("[H] detaches \the [src] from \the [attached].", \ + user.visible_message("[user] detaches \the [src] from \the [attached].", \ "You detach \the [src] from \the [attached].") attached.active_transfusions -= src attached = null @@ -81,7 +75,7 @@ return if(in_range(src, usr) && iscarbon(over_object) && get_dist(over_object, src) <= 1) - H.visible_message("[H] attaches \the [src] to \the [over_object].", \ + user.visible_message("[user] attaches \the [src] to \the [over_object].", \ "You attach \the [src] to \the [over_object].") attached = over_object attached.active_transfusions += src @@ -89,27 +83,27 @@ update_icon() start_processing() - -/obj/structure/machinery/iv_drip/attackby(obj/item/W, mob/living/user) - if (istype(W, /obj/item/reagent_container)) +/obj/structure/machinery/iv_drip/attackby(obj/item/container, mob/living/user) + if (istype(container, /obj/item/reagent_container)) if(beaker) to_chat(user, SPAN_WARNING("There is already a reagent container loaded!")) return - if((!istype(W, /obj/item/reagent_container/blood) && !istype(W, /obj/item/reagent_container/glass)) || istype(W, /obj/item/reagent_container/glass/bucket)) + if((!istype(container, /obj/item/reagent_container/blood) && !istype(container, /obj/item/reagent_container/glass)) || istype(container, /obj/item/reagent_container/glass/bucket)) to_chat(user, SPAN_WARNING("That won't fit!")) return - if(user.drop_inv_item_to_loc(W, src)) - beaker = W + if(user.drop_inv_item_to_loc(container, src)) + beaker = container var/reagentnames = "" - for(var/datum/reagent/R in beaker.reagents.reagent_list) - reagentnames += ";[R.name]" + + for(var/datum/reagent/chem in beaker.reagents.reagent_list) + reagentnames += ";[chem.name]" log_admin("[key_name(user)] put a [beaker] into [src], containing [reagentnames] at ([src.loc.x],[src.loc.y],[src.loc.z]).") - to_chat(user, "You attach \the [W] to \the [src].") + to_chat(user, "You attach \the [container] to \the [src].") update_beam() update_icon() return @@ -152,20 +146,20 @@ if(prob(5)) visible_message("\The [src] pings.") return - var/mob/living/carbon/T = attached + var/mob/living/carbon/patient = attached - if(!istype(T)) + if(!istype(patient)) return - if(ishuman(T)) - var/mob/living/carbon/human/H = T - if(H.species && H.species.flags & NO_BLOOD) + if(ishuman(patient)) + var/mob/living/carbon/human/human_patient = patient + if(human_patient.species && human_patient.species.flags & NO_BLOOD) return // If the human is losing too much blood, beep. - if(T.blood_volume < BLOOD_VOLUME_SAFE) if(prob(5)) + if(patient.blood_volume < BLOOD_VOLUME_SAFE) if(prob(5)) visible_message("\The [src] beeps loudly.") - T.take_blood(beaker,amount) + patient.take_blood(beaker,amount) update_icon() /obj/structure/machinery/iv_drip/attack_hand(mob/user as mob) diff --git a/html/changelogs/AutoChangeLog-pr-4070.yml b/html/changelogs/AutoChangeLog-pr-4070.yml new file mode 100644 index 000000000000..ce07a7f0d64e --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4070.yml @@ -0,0 +1,5 @@ +author: "Huffie56" +delete-after: True +changes: + - rscadd: "Add a skill check to operate IV." + - bugfix: "Fix remove iv needing power to operate." \ No newline at end of file