Adds Deafened Feedback, enhances looping sounds further

Adds deafened ear ring that plays any time you're deafened, and fades back in once you can hear again.

Example of deafened feedback [here](https://streamable.com/8s8vlu). 

Worry not, if you're deafened via mutation or other, you'll simply go deaf, and only hear the fade-in once you regain hearing. 

It will also only play **once** when you are deafened. Further deafening effects while you are already deaf will not force you to hear it again.
This commit is contained in:
Rykka Stormheart
2023-03-03 04:08:08 -08:00
parent 2bbcc296f4
commit 640a73cb06
33 changed files with 127 additions and 16 deletions

View File

@@ -331,7 +331,7 @@
/obj/item/weapon/gun/magnetic/fuelrod/proc/blitzed(var/turf/T, var/mob/living/carbon/M, var/max_range, var/banglet) // Added a new proc called 'bang' that takes a location and a person to be banged.
to_chat(M, "<span class='danger'>BANG</span>") // Called during the loop that bangs people in lockers/containers and when banging
playsound(src, 'sound/effects/bang.ogg', 50, 1, 30) // people in normal view. Could theroetically be called during other explosions.
//Checking for protections
var/eye_safety = 0
@@ -365,17 +365,20 @@
else
M.ear_damage += rand(0, 5)
M.ear_deaf = max(M.ear_deaf,15)
M.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness
else if(get_dist(M, T) <= round(max_range * 0.5 * bang_effectiveness))
if(!ear_safety)
M.Confuse(8)
M.ear_damage += rand(0, 3)
M.ear_deaf = max(M.ear_deaf,10)
M.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness
else if(!ear_safety && get_dist(M, T) <= (max_range * 0.7 * bang_effectiveness))
M.Confuse(4)
M.ear_damage += rand(0, 1)
M.ear_deaf = max(M.ear_deaf,5)
M.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness
//This really should be in mob not every check
if(ishuman(M))

View File

@@ -256,11 +256,13 @@
M.Weaken(2)
M.ear_damage += rand(1, 10)
M.ear_deaf = max(M.ear_deaf,15)
M.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness
if (M.ear_damage >= 15)
to_chat(M, "<span class='danger'>Your ears start to ring badly!</span>")
if (prob(M.ear_damage - 5))
to_chat(M, "<span class='danger'>You can't hear anything!</span>")
M.sdisabilities |= DEAF
M.deaf_loop.start() // CHOMPStation Add: Ear Ringing/Deafness
else
if (M.ear_damage >= 5)
to_chat(M, "<span class='danger'>Your ears start to ring!</span>")