From 3339d51615373f2ba252b48d80eb8006724a22b9 Mon Sep 17 00:00:00 2001 From: thgvr Date: Mon, 19 Feb 2024 22:03:01 -0800 Subject: [PATCH] more --- code/datums/beam.dm | 2 -- code/game/machinery/medical/_medical.dm | 34 +++++++++------------ code/game/machinery/medical/life_support.dm | 1 - 3 files changed, 15 insertions(+), 22 deletions(-) diff --git a/code/datums/beam.dm b/code/datums/beam.dm index 3044aacddfe7..8a876163f0e3 100644 --- a/code/datums/beam.dm +++ b/code/datums/beam.dm @@ -207,5 +207,3 @@ var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type, beam_color, emissive, override_origin_pixel_x, override_origin_pixel_y, override_target_pixel_x, override_target_pixel_y) INVOKE_ASYNC(newbeam, TYPE_PROC_REF(/datum/beam, Start)) return newbeam - - diff --git a/code/game/machinery/medical/_medical.dm b/code/game/machinery/medical/_medical.dm index 7356f705666c..6197d423a684 100644 --- a/code/game/machinery/medical/_medical.dm +++ b/code/game/machinery/medical/_medical.dm @@ -10,6 +10,8 @@ active_power_usage = 750 ///Whos is attached to the life support. var/mob/living/carbon/attached + ///Active beam currently connected to attached target + var/datum/beam/attached_beam = null /obj/machinery/medical/Initialize() . = ..() @@ -22,7 +24,13 @@ /obj/machinery/medical/MouseDrop(mob/living/target) . = ..() - if(!ishuman(usr) || !usr.canUseTopic(src, BE_CLOSE) || !isliving(target) || attached) + if(!ishuman(usr) || !usr.canUseTopic(src, BE_CLOSE) || !isliving(target)) + return + + if(attached) + usr.visible_message("[usr] deattaches [src] from [target].", "You deattach [src] from [target].") + clear_status() + attached = null return if(!target.has_dna()) @@ -31,23 +39,11 @@ if(Adjacent(target) && usr.Adjacent(target)) usr.visible_message(span_warning("[usr] attaches [src] to [target]."), span_notice("You attach [src] to [target].")) + attached_beam = src.Beam(target, icon_state = "blood", maxdistance = 1) add_fingerprint(usr) attached = target update_overlays() -/obj/machinery/medical/attack_hand(mob/user) - . = ..() - if(.) - return - if(!ishuman(user)) - return - if(attached) - visible_message(span_notice("[attached] is detached from [src].")) - attached = null - clear_status() - update_appearance() - return - /obj/machinery/medical/process() update_overlays() update_appearance() @@ -73,11 +69,11 @@ return /** - * Properly gets rid of status effects from the attached - * - * Internal function, you shouldn't be calling this from anywhere else. Gets rid of all the status effects, traits and other shit you might have - * put on the attached victim. Automatically updates overlays in case you have some, and changes power to idle power use. - */ + * Properly gets rid of status effects from the attached + * + * Internal function, you shouldn't be calling this from anywhere else. Gets rid of all the status effects, traits and other shit you might have + * put on the attached victim. Automatically updates overlays in case you have some, and changes power to idle power use. + */ /obj/machinery/medical/proc/clear_status() update_overlays() use_power = IDLE_POWER_USE diff --git a/code/game/machinery/medical/life_support.dm b/code/game/machinery/medical/life_support.dm index 3a72f9f1eb91..b8d367581c14 100644 --- a/code/game/machinery/medical/life_support.dm +++ b/code/game/machinery/medical/life_support.dm @@ -35,7 +35,6 @@ monitor_overlay= mutable_appearance(icon,"alive") . += monitor_overlay - /obj/machinery/medical/life_support/wrench_act(mob/living/user, obj/item/I) . = ..() active = anchored