[MIRROR] Heavily reworks and resprites first aid analyzers. [MDB IGNORE] (#22293)

* Heavily reworks and resprites first aid analyzers.

* Update _bodyparts.dm

Merge pt 1

* Update health_analyzer.dm

Merge pt 2

* Fixing some merge conflicts

* Run UpdatePaths

---------

Co-authored-by: carlarctg <53100513+carlarctg@users.noreply.github.com>
Co-authored-by: Bloop <vinylspiders@gmail.com>
This commit is contained in:
SkyratBot
2023-07-12 12:28:03 +00:00
committed by GitHub
co-authored by carlarctg Bloop
parent fdd1ec15ad
commit 0629bd5128
22 changed files with 255 additions and 77 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

@@ -4,6 +4,8 @@
#define SCANMODE_COUNT 2 // Update this to be the number of scan modes if you add more
#define SCANNER_CONDENSED 0
#define SCANNER_VERBOSE 1
// Not updating above count because you're not meant to switch to this mode.
#define SCANNER_NO_MODE -1
/obj/item/healthanalyzer
name = "health analyzer"
@@ -72,6 +74,7 @@
user.visible_message(span_notice("[user] analyzes [M]'s vitals."))
balloon_alert(user, "analyzing vitals")
playsound(user.loc, 'sound/items/healthanalyzer.ogg', 50)
switch (scanmode)
if (SCANMODE_HEALTH)
@@ -483,6 +486,9 @@
if(!user.can_perform_action(src, NEED_LITERACY|NEED_LIGHT) || user.is_blind())
return
if(mode == SCANNER_NO_MODE)
return
mode = !mode
to_chat(user, mode == SCANNER_VERBOSE ? "The scanner now shows specific limb damage." : "The scanner no longer shows limb damage.")
@@ -492,18 +498,29 @@
desc = "A hand-held body scanner able to distinguish vital signs of the subject with high accuracy."
advanced = TRUE
#define AID_EMOTION_NEUTRAL "neutral"
#define AID_EMOTION_HAPPY "happy"
#define AID_EMOTION_WARN "cautious"
#define AID_EMOTION_ANGRY "angery"
#define AID_EMOTION_SAD "sad"
/// Displays wounds with extended information on their status vs medscanners
/proc/woundscan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/wound/scanner)
/proc/woundscan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/simple/scanner)
if(!istype(patient) || user.incapacitated())
return
var/render_list = ""
for(var/i in patient.get_wounded_bodyparts())
var/obj/item/bodypart/wounded_part = i
var/advised
for(var/limb in patient.get_wounded_bodyparts())
var/obj/item/bodypart/wounded_part = limb
render_list += "<span class='alert ml-1'><b>Warning: Physical trauma[LAZYLEN(wounded_part.wounds) > 1? "s" : ""] detected in [wounded_part.name]</b>"
for(var/k in wounded_part.wounds)
var/datum/wound/W = k
render_list += "<div class='ml-2'>[W.get_scanner_description()]</div>\n"
for(var/limb_wound in wounded_part.wounds)
var/datum/wound/current_wound = limb_wound
render_list += "<div class='ml-2'>[current_wound.get_scanner_description()]</div>\n"
ADD_TRAIT(current_wound, TRAIT_WOUND_SCANNED, ANALYZER_TRAIT)
if(!advised)
to_chat(user, span_notice("You notice how bright holo-images appear over your [(length(wounded_part.wounds) || length(patient.get_wounded_bodyparts()) ) > 1 ? "various wounds" : "wound"]. They seem to be filled with helpful information, this should make treatment easier!"))
advised = TRUE
render_list += "</span>"
if(render_list == "")
@@ -511,38 +528,57 @@
// Only emit the cheerful scanner message if this scan came from a scanner
playsound(scanner, 'sound/machines/ping.ogg', 50, FALSE)
to_chat(user, span_notice("\The [scanner] makes a happy ping and briefly displays a smiley face with several exclamation points! It's really excited to report that [patient] has no wounds!"))
scanner.show_emotion(AID_EMOTION_HAPPY)
else
to_chat(user, "<span class='notice ml-1'>No wounds detected in subject.</span>")
else
to_chat(user, examine_block(jointext(render_list, "")), type = MESSAGE_TYPE_INFO)
scanner.show_emotion(AID_EMOTION_WARN)
playsound(scanner, 'sound/machines/twobeep.ogg', 50, FALSE)
/obj/item/healthanalyzer/wound
name = "first aid analyzer"
icon_state = "adv_spectrometer"
desc = "A prototype MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds, but offers no further insight into the patient's health. You hope the final version is less annoying to read!"
/obj/item/healthanalyzer/simple
name = "wound analyzer"
icon_state = "first_aid"
desc = "A helpful, child-proofed, and most importantly, extremely cheap MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds. While it might not sound very informative for it to be able to tell you if you have a gaping hole in your body or not, it applies a temporary holoimage near the wound with information that is guaranteed to double the efficacy and speed of treatment."
mode = SCANNER_NO_MODE
// Cooldown for when the analyzer will allow you to ask it for encouragement. Don't get greedy!
var/next_encouragement
var/greedy
// The analyzer's current emotion. Affects the sprite overlays and if it's going to prick you for being greedy or not.
var/emotion = AID_EMOTION_NEUTRAL
// Encouragements to play when attack_selfing
var/list/encouragements = list("briefly displays a happy face, gazing emptily at you", "briefly displays a spinning cartoon heart", "displays an encouraging message about eating healthy and exercising", \
"reminds you that everyone is doing their best", "displays a message wishing you well", "displays a sincere thank-you for your interest in first-aid", "formally absolves you of all your sins")
// How often one can ask for encouragement
var/patience = 10 SECONDS
/obj/item/healthanalyzer/wound/attack_self(mob/user)
/obj/item/healthanalyzer/simple/attack_self(mob/user)
if(next_encouragement < world.time)
playsound(src, 'sound/machines/ping.ogg', 50, FALSE)
var/list/encouragements = list("briefly displays a happy face, gazing emptily at you", "briefly displays a spinning cartoon heart", "displays an encouraging message about eating healthy and exercising", \
"reminds you that everyone is doing their best", "displays a message wishing you well", "displays a sincere thank-you for your interest in first-aid", "formally absolves you of all your sins")
to_chat(user, span_notice("\The [src] makes a happy ping and [pick(encouragements)]!"))
next_encouragement = world.time + 10 SECONDS
greedy = FALSE
else if(!greedy)
to_chat(user, span_warning("\The [src] displays an eerily high-definition frowny face, chastizing you for asking it for too much encouragement."))
greedy = TRUE
show_emotion(AID_EMOTION_HAPPY)
else if(emotion != AID_EMOTION_ANGRY)
greed_warning(user)
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
if(isliving(user))
var/mob/living/L = user
to_chat(L, span_warning("\The [src] makes a disappointed buzz and pricks your finger for being greedy. Ow!"))
L.adjustBruteLoss(4)
L.dropItemToGround(src)
violence(user)
/obj/item/healthanalyzer/wound/attack(mob/living/carbon/patient, mob/living/carbon/human/user)
/obj/item/healthanalyzer/simple/proc/greed_warning(mob/user)
to_chat(user, span_warning("\The [src] displays an eerily high-definition frowny face, chastizing you for asking it for too much encouragement."))
show_emotion(AID_EMOTION_ANGRY)
/obj/item/healthanalyzer/simple/proc/violence(mob/user)
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
if(isliving(user))
var/mob/living/L = user
to_chat(L, span_warning("\The [src] makes a disappointed buzz and pricks your finger for being greedy. Ow!"))
flick(icon_state + "_pinprick", src)
L.adjustBruteLoss(4)
L.dropItemToGround(src)
show_emotion(AID_EMOTION_HAPPY)
/obj/item/healthanalyzer/simple/attack(mob/living/carbon/patient, mob/living/carbon/human/user)
if(!user.can_read(src)) //SKYRAT EDIT: Blind People Can Analyze Again
return
@@ -551,23 +587,67 @@
if(!istype(patient))
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
to_chat(user, span_notice("\The [src] makes a sad buzz and briefly displays a frowny face, indicating it can't scan [patient]."))
to_chat(user, span_notice("\The [src] makes a sad buzz and briefly displays an unhappy face, indicating it can't scan [patient]."))
show_emotion(AI_EMOTION_SAD)
return
woundscan(user, patient, src)
flick(icon_state + "_pinprick", src)
/obj/item/healthanalyzer/disease
/obj/item/healthanalyzer/simple/update_overlays()
. = ..()
switch(emotion)
if(AID_EMOTION_HAPPY)
. += mutable_appearance(icon, "+no_wounds")
if(AID_EMOTION_WARN)
. += mutable_appearance(icon, "+wound_warn")
if(AID_EMOTION_ANGRY)
. += mutable_appearance(icon, "+angry")
if(AID_EMOTION_SAD)
. += mutable_appearance(icon, "+fail_scan")
/// Sets a new emotion display on the scanner, and resets back to neutral in a moment
/obj/item/healthanalyzer/simple/proc/show_emotion(new_emotion)
emotion = new_emotion
update_appearance(UPDATE_OVERLAYS)
if (emotion != AID_EMOTION_NEUTRAL)
addtimer(CALLBACK(src, PROC_REF(reset_emotions), AID_EMOTION_NEUTRAL), 2 SECONDS)
// Resets visible emotion back to neutral
/obj/item/healthanalyzer/simple/proc/reset_emotions()
emotion = AID_EMOTION_NEUTRAL
update_appearance(UPDATE_OVERLAYS)
/obj/item/healthanalyzer/simple/miner
name = "mining wound analyzer"
icon_state = "miner_aid"
desc = "A helpful, child-proofed, and most importantly, extremely cheap MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds. While it might not sound very informative for it to be able to tell you if you have a gaping hole in your body or not, it applies a temporary holoimage near the wound with information that is guaranteed to double the efficacy and speed of treatment. This one has a cool aesthetic antenna that doesn't actually do anything!"
/obj/item/healthanalyzer/simple/disease
name = "disease state analyzer"
icon_state = "adv_spectrometer"
desc = "A disease status analyzer to determine the state of an infection to encourage responsible medication consumption."
/obj/item/healthanalyzer/disease/attack_self(mob/user)
playsound(src, 'sound/machines/ping.ogg', 50, FALSE)
var/list/encouragements = list("encourages you to take your medication", "briefly displays a spinning cartoon heart", "reasures you about your condition", \
desc = "Another of MeLo-Tech's dubiously useful medsci scanners, the disease analyzer is a pretty rare find these days - NT found out that giving their hospitals the lowest-common-denominator pandemic equipment resulted in too much financial loss of life to be profitable. There's rumours that the inbuilt AI is jealous of the first aid analyzer's success."
icon_state = "disease_aid"
mode = SCANNER_NO_MODE
encouragements = list("encourages you to take your medication", "briefly displays a spinning cartoon heart", "reasures you about your condition", \
"reminds you that everyone is doing their best", "displays a message wishing you well", "displays a message saying how proud it is that you're taking care of yourself", "formally absolves you of all your sins")
to_chat(user, span_notice("\The [src] makes a happy ping and [pick(encouragements)]!"))
patience = 20 SECONDS
/obj/item/healthanalyzer/disease/attack(mob/living/carbon/patient, mob/living/carbon/human/user)
/obj/item/healthanalyzer/simple/disease/greed_warning(mob/user)
to_chat(user, span_warning("\The [src] displays an eerily high-definition frowny face, chastizing you for asking it for too much encouragement."))
show_emotion(AID_EMOTION_ANGRY)
/obj/item/healthanalyzer/simple/disease/violence(mob/user)
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
if(isliving(user))
var/mob/living/L = user
to_chat(L, span_warning("\The [src] makes a disappointed buzz and pricks your finger for being greedy. Ow!"))
flick(icon_state + "_pinprick", src)
L.adjustBruteLoss(1)
L.reagents.add_reagent(/datum/reagent/toxin, rand(1, 3))
L.dropItemToGround(src)
show_emotion(AID_EMOTION_ANGRY)
/obj/item/healthanalyzer/simple/disease/attack(mob/living/carbon/patient, mob/living/carbon/human/user)
if(!user.can_read(src) || user.is_blind())
return
@@ -577,11 +657,30 @@
if(!istype(user))
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
to_chat(user, span_notice("\The [src] makes a sad buzz and briefly displays a frowny face, indicating it can't scan [patient]."))
emotion = AID_EMOTION_SAD
update_appearance(UPDATE_OVERLAYS)
return
diseasescan(user, patient, src)
diseasescan(user, patient, src) // this updates emotion
update_appearance(UPDATE_OVERLAYS)
flick(icon_state + "_pinprick", src)
/obj/item/healthanalyzer/simple/disease/update_overlays()
. = ..()
switch(emotion)
if(AID_EMOTION_HAPPY)
. += mutable_appearance(icon, "+not_infected")
if(AID_EMOTION_WARN)
. += mutable_appearance(icon, "+infected")
if(AID_EMOTION_ANGRY)
. += mutable_appearance(icon, "+rancurous")
if(AID_EMOTION_SAD)
. += mutable_appearance(icon, "+unknown_scan")
if(emotion != AID_EMOTION_NEUTRAL)
addtimer(CALLBACK(src, PROC_REF(reset_emotions)), 4 SECONDS) // longer on purpose
//Checks the individual for any diseases that are visible to the scanner, and displays the diseases in the attacked to the attacker.
/proc/diseasescan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/wound/scanner)
/proc/diseasescan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/simple/scanner)
if(!istype(patient) || user.incapacitated())
return
@@ -593,14 +692,23 @@
</span>"
if(!length(render))
// Only emit the cheerful scanner message if this scan came from a scanner
playsound(scanner, 'sound/machines/ping.ogg', 50, FALSE)
to_chat(user, span_notice("The patient has no diseases."))
to_chat(user, span_notice("\The [scanner] makes a happy ping and briefly displays a smiley face with several exclamation points! It's really excited to report that [patient] has no diseases!"))
scanner.emotion = AID_EMOTION_HAPPY
else
to_chat(user, span_notice(render.Join("")))
scanner.emotion = AID_EMOTION_WARN
playsound(scanner, 'sound/machines/twobeep.ogg', 50, FALSE)
#undef SCANMODE_HEALTH
#undef SCANMODE_WOUND
#undef SCANMODE_COUNT
#undef SCANNER_CONDENSED
#undef SCANNER_VERBOSE
#undef SCANNER_NO_MODE
#undef AID_EMOTION_NEUTRAL
#undef AID_EMOTION_HAPPY
#undef AID_EMOTION_WARN
#undef AID_EMOTION_ANGRY
#undef AID_EMOTION_SAD
@@ -27,6 +27,7 @@
if (!HAS_TRAIT(target, TRAIT_GENELESS) && !HAS_TRAIT(target, TRAIT_BADDNA))
user.visible_message(span_notice("[user] analyzes [target]'s genetic sequence."))
balloon_alert(user, "sequence analyzed")
playsound(user.loc, 'sound/items/healthanalyzer.ogg', 50) // close enough
gene_scan(target, user)
else
user.visible_message(span_notice("[user] fails to analyze [target]'s genetic sequence."), span_warning("[target] has no readable genetic sequence!"))
@@ -2,7 +2,7 @@
name = "slime scanner"
desc = "A device that analyzes a slime's internal composition and measures its stats."
icon = 'icons/obj/device.dmi'
icon_state = "adv_spectrometer"
icon_state = "slime_scanner"
inhand_icon_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
+16 -4
View File
@@ -146,6 +146,9 @@
// gauze is only relevant for wounds, which are handled in the wounds themselves
/obj/item/stack/medical/gauze/try_heal(mob/living/patient, mob/user, silent)
var/treatment_delay = (user == patient ? self_delay : other_delay)
var/obj/item/bodypart/limb = patient.get_bodypart(check_zone(user.zone_selected))
if(!limb)
patient.balloon_alert(user, "missing limb!")
@@ -155,8 +158,9 @@
return
var/gauzeable_wound = FALSE
var/datum/wound/woundies
for(var/i in limb.wounds)
var/datum/wound/woundies = i
woundies = i
if(woundies.wound_flags & ACCEPTS_GAUZE)
gauzeable_wound = TRUE
break
@@ -167,7 +171,7 @@
//SKYRAT EDIT CHANGE BEGIN - MEDICAL
/*
if(limb.current_gauze && (limb.current_gauze.absorption_capacity * 1.2 > absorption_capacity)) // ignore if our new wrap is < 20% better than the current one, so someone doesn't bandage it 5 times in a row
patient.balloon_alert(user, "already bandaged!")
patient.balloon_alert(user, pick("already bandaged!", "bandage is clean!")) // good enough
return
*/
if(limb.current_gauze)
@@ -175,8 +179,16 @@
return
//SKYRAT EDIT CHANGE END
user.visible_message(span_warning("[user] begins wrapping the wounds on [patient]'s [limb.plaintext_zone] with [src]..."), span_warning("You begin wrapping the wounds on [user == patient ? "your" : "[patient]'s"] [limb.plaintext_zone] with [src]..."))
if(!do_after(user, (user == patient ? self_delay : other_delay), target=patient))
if(HAS_TRAIT(woundies, TRAIT_WOUND_SCANNED))
treatment_delay *= 0.5
if(user == patient)
to_chat(user, span_notice("You keep in mind the indications from the holo-image about your injury, and expertly begin wrapping your wounds with [src]."))
else
user.visible_message(span_warning("[user] begins expertly wrapping the wounds on [patient]'s [limb.plaintext_zone] with [src]..."), span_warning("You begin quickly wrapping the wounds on [patient]'s [limb.plaintext_zone] with [src], keeping the holo-image indications in mind..."))
else
user.visible_message(span_warning("[user] begins wrapping the wounds on [patient]'s [limb.plaintext_zone] with [src]..."), span_warning("You begin wrapping the wounds on [user == patient ? "your" : "[patient]'s"] [limb.plaintext_zone] with [src]..."))
if(!do_after(user, treatment_delay, target = patient))
return
user.visible_message("<span class='infoplain'><span class='green'>[user] applies [src] to [patient]'s [limb.plaintext_zone].</span></span>", "<span class='infoplain'><span class='green'>You bandage the wounds on [user == patient ? "your" : "[patient]'s"] [limb.plaintext_zone].</span></span>")
@@ -73,6 +73,7 @@
/obj/item/storage/box/survival/mining/PopulateContents()
..()
new /obj/item/crowbar/red(src)
new /obj/item/healthanalyzer/simple/miner(src)
// Engineer survival box
/obj/item/storage/box/survival/engineer
+9 -4
View File
@@ -42,6 +42,7 @@
/obj/item/stack/medical/suture = 2,
/obj/item/stack/medical/mesh = 2,
/obj/item/reagent_containers/hypospray/medipen = 1,
/obj/item/healthanalyzer/simple = 1,
)
generate_items_inside(items_inside,src)
@@ -54,7 +55,7 @@
if(empty)
return
var/static/items_inside = list(
/obj/item/healthanalyzer/wound = 1,
/obj/item/healthanalyzer/simple = 1,
/obj/item/stack/medical/gauze = 1,
/obj/item/stack/medical/splint = 1, //SKYRAT EDIT ADDITION - MEDICAL
/obj/item/stack/medical/suture/emergency = 1,
@@ -200,10 +201,12 @@
if(empty)
return
var/static/items_inside = list(
/obj/item/storage/pill_bottle/multiver/less = 1,
/obj/item/storage/pill_bottle/multiver/less = 1,
/obj/item/reagent_containers/syringe/syriniver = 3,
/obj/item/storage/pill_bottle/potassiodide = 1,
/obj/item/reagent_containers/hypospray/medipen/penacid = 1)
/obj/item/reagent_containers/hypospray/medipen/penacid = 1,
/obj/item/healthanalyzer/simple/disease = 1,
)
generate_items_inside(items_inside,src)
/obj/item/storage/medkit/o2
@@ -246,7 +249,9 @@
/obj/item/stack/medical/gauze = 1,
/obj/item/stack/medical/splint = 1, //SKYRAT EDIT ADDITION - MEDICAL
/obj/item/storage/pill_bottle/probital = 1,
/obj/item/reagent_containers/hypospray/medipen/salacid = 1)
/obj/item/reagent_containers/hypospray/medipen/salacid = 1,
/obj/item/healthanalyzer/simple = 1,
)
generate_items_inside(items_inside,src)
/obj/item/storage/medkit/advanced