diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index eeee82a1ec4..492f80b8657 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -21,13 +21,23 @@ BREATH ANALYZER matter = list(DEFAULT_WALL_MATERIAL = 200) origin_tech = list(TECH_MAGNET = 1, TECH_BIO = 1) var/mode = 1 + var/last_scan = 0 + var/sound_scan = FALSE /obj/item/device/healthanalyzer/attack(mob/living/M, mob/living/user) - health_scan_mob(M, user, mode) + sound_scan = FALSE + if(last_scan <= world.time - 20) //Spam limiter. + last_scan = world.time + sound_scan = TRUE + health_scan_mob(M, user, mode, sound_scan = sound_scan) add_fingerprint(user) /obj/item/device/healthanalyzer/attack_self(mob/user) - health_scan_mob(user, user, mode) + sound_scan = FALSE + if(last_scan <= world.time - 20) //Spam limiter. + last_scan = world.time + sound_scan = TRUE + health_scan_mob(user, user, mode, sound_scan = sound_scan) add_fingerprint(user) /proc/get_wound_severity(var/damage_ratio, var/uppercase = FALSE) //Used for ratios. @@ -72,12 +82,13 @@ BREATH ANALYZER output = capitalize(output) return output -/proc/health_scan_mob(var/mob/M, var/mob/living/user, var/show_limb_damage = TRUE, var/just_scan = FALSE) +/proc/health_scan_mob(var/mob/M, var/mob/living/user, var/show_limb_damage = TRUE, var/just_scan = FALSE, var/sound_scan) if(!just_scan) if (((user.is_clumsy()) || (DUMB in user.mutations)) && prob(50)) user.visible_message("[user] runs the scanner over the floor.", "You run the scanner over the floor.", "You hear metal repeatedly clunking against the floor.") - to_chat(user, "Scan results for the floor:") - to_chat(user, "Overall Status: Healthy") + to_chat(user, "Scan results for the ERROR:") + if(sound_scan) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25) return if(!usr.IsAdvancedToolUser()) @@ -88,12 +99,16 @@ BREATH ANALYZER if(!istype(M, /mob/living/carbon/human)) to_chat(user, "This scanner is designed for humanoid patients only.") + if(sound_scan) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25) return var/mob/living/carbon/human/H = M if(H.isSynthetic() && !H.isFBP()) to_chat(user, "This scanner is designed for organic humanoid patients only.") + if(sound_scan) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25) return . = list() @@ -115,8 +130,25 @@ BREATH ANALYZER . += "[b]Scan results for \the [H]:[endb]" // Brain activity. - var/brain_result = H.get_brain_status() - dat += "Brain activity: [brain_result]." + var/brain_status = H.get_brain_status() + dat += "Brain activity: [brain_status]." + var/brain_result = H.get_brain_result() + + if(sound_scan) + switch(brain_result) + if(0) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_dead.ogg', 25) + if(-1) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25) + else + if(brain_result <= 25) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_critical.ogg', 25) + else if(brain_result <= 50) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_danger.ogg', 25) + else if(brain_result <= 90) + playsound(user.loc, 'sound/items/healthscanner/healthscanner_used.ogg', 25) + else + playsound(user.loc, 'sound/items/healthscanner/healthscanner_stable.ogg', 25) if(H.stat == DEAD || H.status_flags & FAKEDEATH) dat += "[b]Time of Death:[endb] [worldtime2text(H.timeofdeath)]" @@ -593,15 +625,19 @@ BREATH ANALYZER if(H.stat == DEAD || H.losebreath || !H.breathing) to_chat(user,"Alert: No breathing detected.") + playsound(user.loc, 'sound/items/healthscanner/healthscanner_dead.ogg', 25) return switch(H.getOxyLoss()) if(0 to 25) to_chat(user,"Subject oxygen levels nominal.") + playsound(user.loc, 'sound/items/healthscanner/healthscanner_stable.ogg', 25) if(25 to 50) to_chat(user,"Subject oxygen levels abnormal.") + playsound(user.loc, 'sound/items/healthscanner/healthscanner_danger.ogg', 25) if(50 to INFINITY) to_chat(user,"Severe oxygen deprivation detected.") + playsound(user.loc, 'sound/items/healthscanner/healthscanner_critical.ogg', 25) var/obj/item/organ/internal/L = H.internal_organs_by_name[BP_LUNGS] if(istype(L)) diff --git a/html/changelogs/wezzy_healthanalsounds.yml b/html/changelogs/wezzy_healthanalsounds.yml new file mode 100644 index 00000000000..48e8239c6db --- /dev/null +++ b/html/changelogs/wezzy_healthanalsounds.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Wowzewow (Wezzy), Identity Crisis + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - soundadd: "Adds new health analyzer sounds." diff --git a/sound/items/healthscanner/healthscanner_critical.ogg b/sound/items/healthscanner/healthscanner_critical.ogg new file mode 100644 index 00000000000..e06781a1d22 Binary files /dev/null and b/sound/items/healthscanner/healthscanner_critical.ogg differ diff --git a/sound/items/healthscanner/healthscanner_danger.ogg b/sound/items/healthscanner/healthscanner_danger.ogg new file mode 100644 index 00000000000..87be22669f6 Binary files /dev/null and b/sound/items/healthscanner/healthscanner_danger.ogg differ diff --git a/sound/items/healthscanner/healthscanner_dead.ogg b/sound/items/healthscanner/healthscanner_dead.ogg new file mode 100644 index 00000000000..759cc0a2058 Binary files /dev/null and b/sound/items/healthscanner/healthscanner_dead.ogg differ diff --git a/sound/items/healthscanner/healthscanner_stable.ogg b/sound/items/healthscanner/healthscanner_stable.ogg new file mode 100644 index 00000000000..27232fbaf4b Binary files /dev/null and b/sound/items/healthscanner/healthscanner_stable.ogg differ diff --git a/sound/items/healthscanner/healthscanner_used.ogg b/sound/items/healthscanner/healthscanner_used.ogg new file mode 100644 index 00000000000..3630c7813bd Binary files /dev/null and b/sound/items/healthscanner/healthscanner_used.ogg differ