Stethoscope Examine Quality of Life (#13856)

This commit is contained in:
VisVirific
2022-05-22 19:12:43 +02:00
committed by GitHub
parent 9a940adfa1
commit c0afca460f
4 changed files with 82 additions and 10 deletions
@@ -207,14 +207,17 @@
/obj/item/clothing/accessory/stethoscope
name = "stethoscope"
desc = "An outdated medical apparatus for listening to the sounds of the human body. It also makes you look like you know what you're doing."
desc_info = "Click on the UI action button toggle between the examination modes. Automatic will use the stethoscope on the person you're \
examining when adjacent to them, automatically using it on the selected body part. Manual will make it so you don't automatically use it via examine."
icon_state = "stethoscope"
item_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand_medical.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_medical.dmi',
)
flippable = 1
var/auto_examine = FALSE
/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/living/user)
/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/user)
if(ishuman(M) && isliving(user))
if(user.a_intent == I_HELP)
var/obj/item/organ/organ = M.get_organ(user.zone_sel.selecting)
@@ -224,6 +227,38 @@
return
return ..(M,user)
/obj/item/clothing/accessory/stethoscope/attack_self(mob/user)
toggle_examine()
/obj/item/clothing/accessory/stethoscope/on_attached(obj/item/clothing/S, mob/user)
..()
has_suit.verbs += /obj/item/clothing/accessory/stethoscope/verb/toggle_examine
/obj/item/clothing/accessory/stethoscope/on_removed(mob/user)
if(has_suit)
has_suit.verbs -= /obj/item/clothing/accessory/stethoscope/verb/toggle_examine
..()
/obj/item/clothing/accessory/stethoscope/proc/mode_switch(mob/user)
auto_examine = !auto_examine
to_chat(user, SPAN_NOTICE("\The [src]'s Examination Mode is now [auto_examine ? "Automatic" : "Manual"]."))
/obj/item/clothing/accessory/stethoscope/verb/toggle_examine()
set name = "Toggle Examination Mode"
set category = "Object"
set src in usr
if(!ishuman(usr))
return
if(usr.incapacitated())
return
var/obj/item/clothing/accessory/stethoscope/stet = get_accessory(/obj/item/clothing/accessory/stethoscope)
if(!stet)
return
stet.mode_switch(usr)
//Religious items
/obj/item/clothing/accessory/rosary
name = "rosary"
@@ -14,6 +14,27 @@
skipitems |= C.flags_inv
return skipitems
/mob/living/carbon/human/proc/examine_pulse(mob/user)
if(user.stat || user.incapacitated() || !ishuman(user))
return
var/mob/living/carbon/human/H = user
if(H.has_stethoscope_active())
var/obj/item/organ/organ = src.get_organ(user.zone_sel.selecting)
if(organ)
user.visible_message("<b>[user]</b> checks [src] with a stethoscope.", "You check [src] with the stethoscope on your person.")
to_chat(user, SPAN_NOTICE("You place the stethoscope against [src]'s [organ.name]. You hear <b>[english_list(organ.listen())]</b>."))
else
to_chat(user, SPAN_WARNING("[src] is missing that limb!"))
else if(src.stat && !(src.species.flags & NO_BLOOD))
user.visible_message("<b>[user]</b> checks [src]'s pulse.", "You check [src]'s pulse.")
if(do_mob(user, src, 15))
if(pulse() == PULSE_NONE || (status_flags & FAKEDEATH))
to_chat(user, "<span class='deadsay'>[get_pronoun("He")] [get_pronoun("has")] no pulse.</span>")
else
to_chat(user, "<span class='deadsay'>[get_pronoun("He")] [get_pronoun("has")] a pulse!</span>")
/mob/living/carbon/human/examine(mob/user)
var/skipbody = get_covered_body_parts()
var/skipbody_thick = get_covered_body_parts(TRUE)
@@ -223,18 +244,11 @@
var/distance = get_dist(user,src)
if(istype(user, /mob/abstract/observer) || user.stat == 2) // ghosts can see anything
distance = 1
if (src.stat && !(src.species.flags & NO_BLOOD)) // No point checking pulse of a species that doesn't have one.
if(src.stat && !(src.species.flags & NO_BLOOD)) // No point checking pulse of a species that doesn't have one.
msg += "<span class='warning'>[get_pronoun("He")] [get_pronoun("is")]n't responding to anything around [get_pronoun("him")] and seems to be unconscious.</span>\n"
if((stat == DEAD || is_asystole() || src.losebreath) && distance <= 3 || (status_flags & FAKEDEATH))
msg += "<span class='warning'>[get_pronoun("He")] [get_pronoun("does")] not appear to be breathing.</span>\n"
if(istype(user, /mob/living/carbon/human) && !user.stat && Adjacent(user))
spawn (0)
user.visible_message("<b>[user]</b> checks [src]'s pulse.", "You check [src]'s pulse.")
if (do_mob(user, src, 15))
if(pulse() == PULSE_NONE || (status_flags & FAKEDEATH))
to_chat(user, "<span class='deadsay'>[get_pronoun("He")] [get_pronoun("has")] no pulse.</span>")
else
to_chat(user, "<span class='deadsay'>[get_pronoun("He")] [get_pronoun("has")] a pulse!</span>")
else if (src.stat)
msg += SPAN_WARNING("[get_pronoun("He")] [get_pronoun("is")] not responding to anything around [get_pronoun("him")].\n")
@@ -389,6 +403,8 @@
msg += "\n[get_pronoun("He")] [pose]"
to_chat(user, msg.Join())
if(Adjacent(user))
INVOKE_ASYNC(src, .proc/examine_pulse, user)
//Helper procedure. Called by /mob/living/carbon/human/examine() and /mob/living/carbon/human/Topic() to determine HUD access to security and medical records.
/proc/hasHUD(mob/M, hudtype)
@@ -220,6 +220,21 @@
return TRUE
return FALSE
/mob/living/carbon/human/proc/has_stethoscope_active()
var/obj/item/clothing/under/uniform = w_uniform
var/obj/item/clothing/suit/suit = wear_suit
if(suit)
var/obj/item/clothing/accessory/stethoscope/stet = locate() in suit.accessories
if(stet)
if(stet.auto_examine)
return TRUE
if(uniform)
var/obj/item/clothing/accessory/stethoscope/stet = locate() in uniform.accessories
if(stet)
if(stet.auto_examine)
return TRUE
return FALSE
/mob/living/carbon/human/proc/is_submerged()
if(lying && istype(loc, /turf/simulated/floor/beach/water)) // replace this when we port fluids
return TRUE
+6
View File
@@ -0,0 +1,6 @@
author: Vrow
delete-after: True
changes:
- rscadd: "Added a toggleable verb for Stethoscopes between Manual and Automatic usage. Automatic usage means you'll use the stethoscope automatically on the selected body part when examining someone adjacent to you. Manual means the automatic examine doesn't happen."