mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
Deafness is now solely tracked by trait (#95029)
## About The Pull Request Deletes `can_hear`, replaces it with trait-checking deafness. The only two non-trait sources of deafness (hardcrit and lacking ears) were refactored into using the trait. ## Why It's Good For The Game Many places inconsistently check for the deaf trait rather than use can_hear which meant behavior was not consistent. Some code would treat "do we lack ears?" as being deaf, some would not. This unifies all the behavior so being deaf means you're deaf everywhere. It also means we can now easily react to gaining and losing deafness via signal, where before we could not react to it without hooking the trait, organ remove, AND stat change. Which no one did, of course, because who would ever think to do that? ## Changelog 🆑 Melbert refactor: Refactored how deafness is tracked. Please report any weird interactions with sounds, like messages or sfx being missing. fix: Lacking ears and being in hard crit now consistently treats you as "being deaf". This affects a few minor interactions like empath, the jukebox, and sleeping. /🆑
This commit is contained in:
@@ -48,11 +48,16 @@
|
||||
. = ..()
|
||||
if(temporary_deafness)
|
||||
on_deafened()
|
||||
REMOVE_TRAIT(organ_owner, TRAIT_DEAF, NO_EARS)
|
||||
|
||||
/obj/item/organ/ears/on_mob_remove(mob/living/carbon/organ_owner, special, movement_flags)
|
||||
. = ..()
|
||||
if(temporary_deafness)
|
||||
on_undeafened(organ_owner)
|
||||
// Do not apply with special flag, even if it would ultimately be redundant by new ears being hot-swapped in.
|
||||
// This is so we don't trip signal_addtrait when hot-swapping ears, which could cause inappropriate behavior like nuking sound effects.
|
||||
if(!special)
|
||||
ADD_TRAIT(organ_owner, TRAIT_DEAF, NO_EARS)
|
||||
|
||||
/obj/item/organ/ears/get_status_appendix(advanced, add_tooltips)
|
||||
if(owner.stat == DEAD || !HAS_TRAIT(owner, TRAIT_DEAF))
|
||||
|
||||
Reference in New Issue
Block a user