diff --git a/code/game/objects/items/devices/healthanalyzer.dm b/code/game/objects/items/devices/healthanalyzer.dm index 20b4b88617b..d1efac5c2f2 100644 --- a/code/game/objects/items/devices/healthanalyzer.dm +++ b/code/game/objects/items/devices/healthanalyzer.dm @@ -77,36 +77,46 @@ var/mode = DETAILED_HEALTH_SCAN /// Is the health analyzer upgraded? Allows reagents in the body to be seen. var/advanced = FALSE + new_attack_chain = TRUE /obj/item/healthanalyzer/examine(mob/user) . = ..() . += SPAN_NOTICE("Use [src] in hand to toggle showing localised damage.") -/obj/item/healthanalyzer/attack_self__legacy__attackchain(mob/user) +/obj/item/healthanalyzer/activate_self(mob/user) + if(..()) + return ITEM_INTERACT_COMPLETE mode = !mode + add_fingerprint(user) switch(mode) if(DETAILED_HEALTH_SCAN) to_chat(user, SPAN_NOTICE("The scanner is now showing localised limb damage.")) if(SIMPLE_HEALTH_SCAN) to_chat(user, SPAN_NOTICE("The scanner is no longer showing localised limb damage.")) + return ITEM_INTERACT_COMPLETE -/obj/item/healthanalyzer/attack__legacy__attackchain(mob/living/M, mob/living/user) +/obj/item/healthanalyzer/interact_with_atom(atom/target, mob/living/user, list/modifiers) if((HAS_TRAIT(user, TRAIT_CLUMSY) || user.getBrainLoss() >= 60) && prob(50)) var/list/msgs = list() - user.visible_message(SPAN_WARNING("[user] analyzes the floor's vitals!"), SPAN_NOTICE("You stupidly try to analyze the floor's vitals!")) + user.visible_message( + SPAN_WARNING("[user] analyzes the floor's vitals!"), + SPAN_WARNING("You stupidly try to analyze the floor's vitals!") + ) msgs += SPAN_NOTICE("Analyzing results for The floor:\nOverall status: Healthy") msgs += SPAN_NOTICE("Key: Suffocation/Toxin/Burn/Brute") msgs += SPAN_NOTICE("Damage specifics: 0 - 0 - 0 - 0") msgs += SPAN_NOTICE("Body temperature: ???") to_chat(user, chat_box_healthscan(msgs.Join("
"))) - return + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE user.visible_message( - SPAN_NOTICE("[user] analyzes [M]'s vitals."), - SPAN_NOTICE("You analyze [M]'s vitals.") + SPAN_NOTICE("[user] analyzes [target]'s vitals."), + SPAN_NOTICE("You analyze [target]'s vitals.") ) - healthscan(user, M, mode, advanced) + healthscan(user, target, mode, advanced) add_fingerprint(user) + return ITEM_INTERACT_COMPLETE // Used by the PDA medical scanner too. /proc/healthscan(mob/user, mob/living/M, mode = DETAILED_HEALTH_SCAN, advanced = FALSE) @@ -114,6 +124,17 @@ var/scanned_name = "[M]" + // These sensors are designed for organic life. + if(!ismob(M) || issilicon(M) || ismachineperson(M) || (HAS_TRAIT(user, TRAIT_MED_MACHINE_HALLUCINATING) && prob(5))) + msgs += SPAN_NOTICE("Analyzing Results for ERROR:\nOverall Status: ERROR") + msgs += "Key: [SPAN_HEALTHSCAN_OXY("Suffocation")]/Toxin/Burns/Brute" + msgs += "Damage Specifics: [SPAN_HEALTHSCAN_OXY("?")] - ? - ? - ?" + msgs += SPAN_NOTICE("Body Temperature: [ismob(M) ? M.bodytemperature-T0C : "ERROR"]°C ([ismob(M) ? M.bodytemperature*1.8-459.67 : "ERROR"]°F)") + msgs += SPAN_WARNING("Warning: Blood Level ERROR: --% --cl.Type: ERROR") + msgs += SPAN_NOTICE("Subject's pulse: -- bpm.") + to_chat(user, chat_box_healthscan(msgs.Join("
"))) + return ITEM_INTERACT_COMPLETE + var/probably_dead = (M.stat == DEAD) // show your own health, evil @@ -123,7 +144,7 @@ if(HAS_TRAIT(user, TRAIT_MED_MACHINE_HALLUCINATING) && prob(10) && IS_HORIZONTAL(M)) probably_dead = TRUE - if(isanimal_or_basicmob(M)) + if(!ishuman(M)) // No box here, keep it simple. if(probably_dead) to_chat(user, SPAN_NOTICE("Analyzing Results for [M]:\nOverall Status: Dead")) @@ -133,17 +154,6 @@ to_chat(user, "\t Damage Specifics: [M.maxHealth - M.health]") return - // These sensors are designed for organic life. - if(!ishuman(M) || ismachineperson(M) || (HAS_TRAIT(user, TRAIT_MED_MACHINE_HALLUCINATING) && prob(5))) - msgs += SPAN_NOTICE("Analyzing Results for ERROR:\nOverall Status: ERROR") - msgs += "Key: [SPAN_HEALTHSCAN_OXY("Suffocation")]/Toxin/Burns/Brute" - msgs += "Damage Specifics: [SPAN_HEALTHSCAN_OXY("?")] - ? - ? - ?" - msgs += SPAN_NOTICE("Body Temperature: [M.bodytemperature-T0C]°C ([M.bodytemperature*1.8-459.67]°F)") - msgs += SPAN_WARNING("Warning: Blood Level ERROR: --% --cl.
Type: ERROR") - msgs += SPAN_NOTICE("Subject's pulse: -- bpm.") - to_chat(user, chat_box_healthscan(msgs.Join("
"))) - return - var/mob/living/carbon/human/H = M var/fake_oxy = max(rand(1,40), H.getOxyLoss(), (300 - (H.getToxLoss() + H.getFireLoss() + H.getBruteLoss()))) var/OX = H.getOxyLoss() @@ -333,23 +343,25 @@ to_chat(user, chat_box_healthscan(msgs.Join("
"))) -/obj/item/healthanalyzer/attackby__legacy__attackchain(obj/item/I, mob/user, params) - if(!istype(I, /obj/item/healthupgrade)) +/obj/item/healthanalyzer/item_interaction(mob/user, obj/item/used, list/modifiers) + if(!istype(used, /obj/item/healthupgrade)) return ..() if(advanced) to_chat(user, SPAN_NOTICE("An upgrade is already installed on [src].")) - return + return ITEM_INTERACT_COMPLETE - if(!user.unequip(I)) + if(!user.unequip(used)) to_chat(user, SPAN_WARNING("[src] is stuck to your hand!")) - return + return ITEM_INTERACT_COMPLETE to_chat(user, SPAN_NOTICE("You install the upgrade on [src].")) icon_state = "health2" - playsound(loc, I.usesound, 50, TRUE) + playsound(loc, used.usesound, 50, TRUE) advanced = TRUE - qdel(I) + qdel(used) + add_fingerprint(user) + return ITEM_INTERACT_COMPLETE /obj/item/healthanalyzer/advanced name = "advanced health analyzer"