mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 22:42:26 +01:00
Adds sensitive hearing (#12151)
This commit is contained in:
@@ -17,8 +17,7 @@
|
||||
|
||||
f_loss += 60
|
||||
|
||||
ear_damage += 30
|
||||
ear_deaf += 120
|
||||
adjustEarDamage(30, 120, 0)
|
||||
|
||||
if(3.0)
|
||||
b_loss += 30
|
||||
|
||||
@@ -375,6 +375,9 @@
|
||||
|
||||
msg += "*---------*</span>"
|
||||
|
||||
if(src in intent_listener)
|
||||
msg += SPAN_NOTICE("\n[get_pronoun("He")] looks like [get_pronoun("he")] [get_pronoun("is")] listening intently to [get_pronoun("his")] surroundings.")
|
||||
|
||||
var/datum/vampire/V = get_antag_datum(MODE_VAMPIRE)
|
||||
if(V && (V.status & VAMP_DRAINING))
|
||||
var/obj/item/grab/G = get_active_hand()
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
name = real_name
|
||||
if(mind)
|
||||
mind.name = real_name
|
||||
if(get_hearing_sensitivity())
|
||||
verbs += /mob/living/carbon/human/proc/listening_close
|
||||
|
||||
// Randomize nutrition and hydration. Defines are in __defines/mobs.dm
|
||||
if(max_nutrition > 0)
|
||||
@@ -96,6 +98,7 @@
|
||||
|
||||
/mob/living/carbon/human/Destroy()
|
||||
human_mob_list -= src
|
||||
intent_listener -= src
|
||||
for(var/organ in organs)
|
||||
qdel(organ)
|
||||
organs = null
|
||||
@@ -247,16 +250,15 @@
|
||||
f_loss = 60
|
||||
|
||||
if (!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
|
||||
ear_damage += 30
|
||||
ear_deaf += 120
|
||||
adjustEarDamage(30, 120)
|
||||
|
||||
if (prob(70))
|
||||
Paralyse(10)
|
||||
|
||||
if(3.0)
|
||||
b_loss = 30
|
||||
if (!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
|
||||
ear_damage += 15
|
||||
ear_deaf += 60
|
||||
adjustEarDamage(15, 60)
|
||||
if (prob(50))
|
||||
Paralyse(10)
|
||||
|
||||
@@ -2077,3 +2079,50 @@
|
||||
var/obj/item/organ/internal/eyes/night/N = E
|
||||
if(N.night_vision )
|
||||
N.disable_night_vision()
|
||||
|
||||
/mob/living/carbon/human/adjustEarDamage(var/damage, var/deaf, var/ringing = FALSE)
|
||||
if (damage > 0)
|
||||
var/hearing_sensitivity = get_hearing_sensitivity()
|
||||
if (hearing_sensitivity)
|
||||
if (is_listening()) // if the person is listening in, the effect is way worse
|
||||
if (hearing_sensitivity == HEARING_VERY_SENSITIVE)
|
||||
damage *= 2
|
||||
else
|
||||
damage = round(damage *= 1.5, 1)
|
||||
stop_listening()
|
||||
else
|
||||
if (hearing_sensitivity == HEARING_VERY_SENSITIVE)
|
||||
damage = round(damage *= 1.4, 1)
|
||||
else
|
||||
damage = round(damage *= 1.2, 1)
|
||||
return ..()
|
||||
|
||||
// Intensity 1: mild, 2: hurts, 3: very painful, 4: extremely painful, 5: that's going to leave some damage
|
||||
// Sensitive_only: If yes, only those with sensitive hearing are affected
|
||||
// Listening_pain: Increases the intensity by the listed amount if the person is listening in
|
||||
/mob/living/carbon/human/proc/earpain(var/intensity, var/sensitive_only = FALSE, var/listening_pain = 0)
|
||||
if (ear_deaf)
|
||||
return
|
||||
if (sensitive_only && !get_hearing_sensitivity())
|
||||
return
|
||||
if (listening_pain && is_listening())
|
||||
intensity += listening_pain
|
||||
else if (sensitive_only)
|
||||
return
|
||||
|
||||
var/obj/item/organ/external/E = organs_by_name[BP_HEAD]
|
||||
switch (intensity)
|
||||
if (1)
|
||||
custom_pain("Your ears hurt a little.", 5, FALSE, E, 0)
|
||||
if (2)
|
||||
custom_pain("Your ears hurt!", 10, TRUE, E, 0)
|
||||
if (3)
|
||||
custom_pain("Your ears hurt badly!", 40, TRUE, E, 0)
|
||||
if (4)
|
||||
custom_pain("Your ears begin to ring faintly from the pain!", 70, TRUE, E, 0)
|
||||
adjustEarDamage(5, 0, FALSE)
|
||||
stop_listening()
|
||||
if (5)
|
||||
custom_pain("YOUR EARS ARE DEAFENED BY THE PAIN!", 110, TRUE, E, 1)
|
||||
adjustEarDamage(5, 5, FALSE)
|
||||
stop_listening()
|
||||
|
||||
@@ -309,6 +309,14 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/human/proc/get_hearing_sensitivity()
|
||||
return species.hearing_sensitivity
|
||||
|
||||
/mob/living/carbon/human/proc/is_listening()
|
||||
if(src in intent_listener)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/human/get_organ_name_from_zone(var/def_zone)
|
||||
var/obj/item/organ/external/E = organs_by_name[parse_zone(def_zone)]
|
||||
if(E)
|
||||
|
||||
@@ -606,6 +606,13 @@ mob/living/carbon/human/proc/change_monitor()
|
||||
|
||||
visible_message("<span class='danger'>\The [src] shrieks!</span>")
|
||||
playsound(src.loc, 'sound/species/revenant/grue_screech.ogg', 100, 1)
|
||||
for (var/mob/living/carbon/human/T in hearers(4, src) - src)
|
||||
if(T.protected_from_sound())
|
||||
continue
|
||||
if (T.get_hearing_sensitivity() == HEARING_VERY_SENSITIVE)
|
||||
earpain(2, TRUE, 1)
|
||||
else if (T in range(src, 2))
|
||||
earpain(1, TRUE, 1)
|
||||
|
||||
for(var/obj/machinery/light/L in range(7))
|
||||
L.broken()
|
||||
@@ -779,30 +786,38 @@ mob/living/carbon/human/proc/change_monitor()
|
||||
set desc = "Emit a powerful screech which stuns hearers in a two-tile radius."
|
||||
|
||||
if(last_special > world.time)
|
||||
to_chat(src, "<span class='danger'>You are too tired to screech!</span>")
|
||||
to_chat(src, SPAN_DANGER("You are too tired to screech!"))
|
||||
return
|
||||
|
||||
if(stat || paralysis || stunned || weakened)
|
||||
to_chat(src, "<span class='danger'>You cannot screech in your current state!</span>")
|
||||
to_chat(src, SPAN_DANGER("You cannot screech in your current state!"))
|
||||
return
|
||||
|
||||
last_special = world.time + 100
|
||||
|
||||
visible_message("<span class='danger'>[src.name] lets out an ear piercing shriek!</span>",
|
||||
"<span class='danger'>You let out an ear-shattering shriek!</span>",
|
||||
"<span class='danger'>You hear a painfully loud shriek!</span>")
|
||||
visible_message(SPAN_DANGER("[src.name] lets out an ear piercing shriek!"),
|
||||
SPAN_DANGER("You let out an ear-shattering shriek!"),
|
||||
SPAN_DANGER("You hear a painfully loud shriek!"))
|
||||
|
||||
playsound(loc, 'sound/voice/shriek1.ogg', 100, 1)
|
||||
|
||||
var/list/victims = list()
|
||||
|
||||
for (var/mob/living/carbon/human/T in hearers(4, src) - src)
|
||||
if(T.protected_from_sound())
|
||||
continue
|
||||
if (T.get_hearing_sensitivity() == HEARING_VERY_SENSITIVE)
|
||||
earpain(3, TRUE, 1)
|
||||
else if (T in range(src, 2))
|
||||
earpain(2, TRUE, 2)
|
||||
|
||||
for (var/mob/living/carbon/human/T in hearers(2, src) - src)
|
||||
if(T.protected_from_sound())
|
||||
continue
|
||||
|
||||
to_chat(T, "<span class='danger'>You hear an ear piercing shriek and feel your senses go dull!</span>")
|
||||
to_chat(T, SPAN_DANGER("You hear an ear piercing shriek and feel your senses go dull!"))
|
||||
T.Weaken(5)
|
||||
T.ear_deaf = 20
|
||||
T.adjustEarDamage(10, 20)
|
||||
T.stuttering = 20
|
||||
T.Stun(5)
|
||||
|
||||
@@ -1239,4 +1254,37 @@ mob/living/carbon/human/proc/change_monitor()
|
||||
if(stat == DEAD)
|
||||
to_chat(M, SPAN_WARNING("You can't name a corpse."))
|
||||
return FALSE
|
||||
return TRUE
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/human/proc/intent_listen(var/source,var/message)
|
||||
if(air_sound(src))
|
||||
if (is_listening() && (ear_deaf <= 0 || !ear_deaf))
|
||||
var/sound_dir = angle2text(Get_Angle(get_turf(src), get_turf(source)))
|
||||
to_chat(src, SPAN_WARNING(message + " from \the [sound_dir]."))
|
||||
|
||||
/mob/living/carbon/human/proc/listening_close()
|
||||
set category = "Abilities"
|
||||
set name = "Listen closely"
|
||||
|
||||
if (last_special > world.time)
|
||||
return
|
||||
|
||||
if (stat || paralysis || stunned || weakened)
|
||||
return
|
||||
|
||||
if (!is_listening())
|
||||
start_listening()
|
||||
else
|
||||
stop_listening()
|
||||
|
||||
last_special = world.time + 20
|
||||
|
||||
/mob/living/carbon/human/proc/start_listening()
|
||||
if (!is_listening())
|
||||
visible_message("<b>[src]</b> begins to listen intently.")
|
||||
intent_listener |= src
|
||||
|
||||
/mob/living/carbon/human/proc/stop_listening()
|
||||
if (is_listening())
|
||||
visible_message("<b>[src]</b> stops listening intently.")
|
||||
intent_listener -= src
|
||||
@@ -94,6 +94,7 @@
|
||||
var/break_cuffs = FALSE //used in resist.dm to check if they can break hand/leg cuffs
|
||||
var/natural_climbing = FALSE //If true, the species always succeeds at climbing.
|
||||
var/climb_coeff = 1.25 //The coefficient to the climbing speed of the individual = 60 SECONDS * climb_coeff
|
||||
|
||||
// Death vars.
|
||||
var/respawn_type = CREW
|
||||
var/meat_type = /obj/item/reagent_containers/food/snacks/meat/human
|
||||
@@ -208,6 +209,10 @@
|
||||
var/bp_base_systolic = 120
|
||||
var/bp_base_disatolic = 80
|
||||
|
||||
// Hearing sensitivity
|
||||
var/hearing_sensitivity = HEARING_NORMAL
|
||||
|
||||
// Eating & nutrition related stuff
|
||||
var/gluttonous = 0 // Can eat some mobs. Values can be GLUT_TINY, GLUT_SMALLER, GLUT_ANYTHING, GLUT_ITEM_TINY, GLUT_ITEM_NORMAL, GLUT_ITEM_ANYTHING, GLUT_PROJECTILE_VOMIT
|
||||
var/stomach_capacity = 5 // How much stuff they can stick in their stomach
|
||||
var/allowed_eat_types = TYPE_ORGANIC
|
||||
|
||||
@@ -48,8 +48,10 @@
|
||||
low_pulse = 50 // Default 40
|
||||
norm_pulse = 70 // Default 60
|
||||
fast_pulse = 100 // Default 90
|
||||
v_fast_pulse = 130// Default 120
|
||||
max_pulse = 170// Default 160
|
||||
v_fast_pulse = 130 // Default 120
|
||||
max_pulse = 170 // Default 160
|
||||
|
||||
hearing_sensitivity = HEARING_SENSITIVE // Default HEARING_NORMAL
|
||||
|
||||
blurb = "The Tajaran race is a species of feline-like bipeds hailing from the planet of Adhomai in the S'rendarr \
|
||||
system. They have been brought up into the space age by the Humans and Skrell, who alledgedly influenced their \
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
heat_level_2 = 390 //RaceDefault 380 Default 400
|
||||
heat_level_3 = 900 //RaceDefault 800 Default 1000
|
||||
|
||||
hearing_sensitivity = HEARING_VERY_SENSITIVE // Species default 1
|
||||
|
||||
default_h_style = "M'sai Ears"
|
||||
|
||||
|
||||
@@ -846,11 +846,24 @@ default behaviour is:
|
||||
..()
|
||||
|
||||
//damage/heal the mob ears and adjust the deaf amount
|
||||
/mob/living/adjustEarDamage(var/damage, var/deaf)
|
||||
/mob/living/adjustEarDamage(var/damage, var/deaf, var/ringing = FALSE)
|
||||
var/alreadydeaf = FALSE
|
||||
if (ear_deaf)
|
||||
alreadydeaf = TRUE
|
||||
|
||||
ear_damage = max(0, ear_damage + damage)
|
||||
ear_deaf = max(0, ear_deaf + deaf)
|
||||
|
||||
if (ringing && !alreadydeaf)
|
||||
if (ear_damage >= 5)
|
||||
if (ear_damage >= 15)
|
||||
to_chat(src, SPAN_DANGER("Your ears start to ring badly!"))
|
||||
else
|
||||
to_chat(src, SPAN_DANGER("Your ears start to ring!"))
|
||||
|
||||
|
||||
//pass a negative argument to skip one of the variable
|
||||
|
||||
/mob/living/setEarDamage(var/damage, var/deaf)
|
||||
if(damage >= 0)
|
||||
ear_damage = damage
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
announce_ghost_joinleave(player, 0, "They have taken control over a maintenance drone.")
|
||||
visible_message(SPAN_NOTICE("\The [src] churns and grinds as it lurches into motion, disgorging a shiny new drone after a few moments."))
|
||||
flick("h_lathe_leave", src)
|
||||
intent_message(MACHINE_SOUND)
|
||||
|
||||
time_last_drone = world.time
|
||||
if(player.mob?.mind)
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
// self_message (optional) is what the src mob sees e.g. "You do something!"
|
||||
// blind_message (optional) is what blind people will hear e.g. "You hear something!"
|
||||
|
||||
/mob/visible_message(var/message, var/self_message, var/blind_message, var/range = world.view, var/show_observers = TRUE)
|
||||
/mob/visible_message(var/message, var/self_message, var/blind_message, var/range = world.view, var/show_observers = TRUE, var/intent_message = null, var/intent_range = 7)
|
||||
var/list/messageturfs = list() //List of turfs we broadcast to.
|
||||
var/list/messagemobs = list() //List of living mobs nearby who can hear it, and distant ghosts who've chosen to hear it
|
||||
var/list/messageobjs = list() //list of objs nearby who can see it
|
||||
@@ -151,6 +151,9 @@
|
||||
var/obj/O = o
|
||||
O.see_emote(src, message)
|
||||
|
||||
if(intent_message)
|
||||
intent_message(intent_message, intent_range)
|
||||
|
||||
// Designed for mobs contained inside things, where a normal visible message wont actually be visible
|
||||
// Useful for visible actions by pAIs, and held mobs
|
||||
// Broadcaster is the place the action will be seen/heard from, mobs in sight of THAT will see the message. This is generally the object or mob that src is contained in
|
||||
|
||||
Reference in New Issue
Block a user