diff --git a/code/datums/elements/earhealing.dm b/code/datums/elements/earhealing.dm index 6d748f7e28e..9ec7cdff06e 100644 --- a/code/datums/elements/earhealing.dm +++ b/code/datums/elements/earhealing.dm @@ -2,25 +2,23 @@ element_flags = ELEMENT_DETACH var/list/user_by_item = list() -/datum/element/earhealing/New() - START_PROCESSING(SSdcs, src) - /datum/element/earhealing/Attach(datum/target) . = ..() if(!isitem(target)) return ELEMENT_INCOMPATIBLE - RegisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), .proc/equippedChanged) + RegisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), .proc/on_equip) /datum/element/earhealing/Detach(datum/target) . = ..() UnregisterSignal(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED)) user_by_item -= target -/datum/element/earhealing/proc/equippedChanged(datum/source, mob/living/carbon/user, slot) +/datum/element/earhealing/proc/on_equip(datum/source, mob/living/carbon/user, slot) SIGNAL_HANDLER if(slot == ITEM_SLOT_EARS && istype(user)) + START_PROCESSING(SSdcs, src) user_by_item[source] = user else user_by_item -= source @@ -29,8 +27,8 @@ for(var/i in user_by_item) var/mob/living/carbon/user = user_by_item[i] var/obj/item/organ/internal/ears/ears = user.getorganslot(ORGAN_SLOT_EARS) - if(!ears || HAS_TRAIT_NOT_FROM(user, TRAIT_DEAF, EAR_DAMAGE)) + if(!ears || !ears.damage || ears.organ_flags & ORGAN_FAILING) continue ears.deaf = max(ears.deaf - 0.25 * delta_time, (ears.damage < ears.maxHealth ? 0 : 1)) // Do not clear deafness if our ears are too damaged - ears.applyOrganDamage(-0.025 * delta_time, 0) + ears.applyOrganDamage(-0.025 * delta_time) CHECK_TICK diff --git a/code/datums/status_effects/debuffs/debuffs.dm b/code/datums/status_effects/debuffs/debuffs.dm index 8f963106f17..020cec3eab7 100644 --- a/code/datums/status_effects/debuffs/debuffs.dm +++ b/code/datums/status_effects/debuffs/debuffs.dm @@ -193,8 +193,8 @@ if(HAS_TRAIT_FROM(owner, TRAIT_BLIND, BLINDFOLD_TRAIT) || is_sleeping_in_darkness) healing += 0.1 - // sleeping with earmuffs helps blockout the noise as well - if(HAS_TRAIT_FROM(src, TRAIT_DEAF, CLOTHING_TRAIT)) + // sleeping in silence is always better + if(HAS_TRAIT(src, TRAIT_DEAF)) healing += 0.1 // check for beds diff --git a/code/game/machinery/hypnochair.dm b/code/game/machinery/hypnochair.dm index bdf6e1d1ea0..d67ac576198 100644 --- a/code/game/machinery/hypnochair.dm +++ b/code/game/machinery/hypnochair.dm @@ -149,7 +149,7 @@ victim = null return victim.cure_blind("hypnochair") - REMOVE_TRAIT(victim, TRAIT_DEAF, "hypnochair") + REMOVE_TRAIT(victim, TRAIT_DEAF, HYPNOCHAIR_TRAIT) if(!(victim.get_eye_protection() > 0)) var/time_diff = world.time - start_time switch(time_diff) diff --git a/code/modules/antagonists/heretic/items/heretic_necks.dm b/code/modules/antagonists/heretic/items/heretic_necks.dm index 30e939576f1..8b2cece62f2 100644 --- a/code/modules/antagonists/heretic/items/heretic_necks.dm +++ b/code/modules/antagonists/heretic/items/heretic_necks.dm @@ -30,12 +30,12 @@ if(!ishuman(user) || !IS_HERETIC_OR_MONSTER(user)) return - ADD_TRAIT(user, heretic_only_trait, "[CLOTHING_TRAIT] [REF(src)]") + ADD_TRAIT(user, heretic_only_trait, "[CLOTHING_TRAIT]_[REF(src)]") user.update_sight() /obj/item/clothing/neck/eldritch_amulet/dropped(mob/user) . = ..() - REMOVE_TRAIT(user, heretic_only_trait, "[CLOTHING_TRAIT] [REF(src)]") + REMOVE_TRAIT(user, heretic_only_trait, "[CLOTHING_TRAIT]_[REF(src)]") user.update_sight() /obj/item/clothing/neck/eldritch_amulet/piercing diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index c53a9f0b517..78b7edbfe7c 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -239,7 +239,7 @@ return UnregisterSignal(user, COMSIG_MOVABLE_MOVED) for(var/trait in clothing_traits) - REMOVE_TRAIT(user, trait, "[CLOTHING_TRAIT] [REF(src)]") + REMOVE_TRAIT(user, trait, "[CLOTHING_TRAIT]_[REF(src)]") if(LAZYLEN(user_vars_remembered)) @@ -257,7 +257,7 @@ if(iscarbon(user) && LAZYLEN(zones_disabled)) RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/bristle, override = TRUE) for(var/trait in clothing_traits) - ADD_TRAIT(user, trait, "[CLOTHING_TRAIT] [REF(src)]") + ADD_TRAIT(user, trait, "[CLOTHING_TRAIT]_[REF(src)]") if (LAZYLEN(user_vars_to_edit)) for(var/variable in user_vars_to_edit) if(variable in user.vars) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index 3cecdb6350c..f11e8238092 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -442,7 +442,7 @@ brute_loss = 30*(2 - round(bomb_armor*0.01, 0.05)) burn_loss = brute_loss //damage gets reduced from 120 to up to 60 combined brute+burn damage_clothes(200 - bomb_armor, BRUTE, BOMB) - if (ears && !HAS_TRAIT_FROM(src, TRAIT_DEAF, CLOTHING_TRAIT)) + if (ears && !HAS_TRAIT_FROM_ONLY(src, TRAIT_DEAF, EAR_DAMAGE)) ears.adjustEarDamage(30, 120) Unconscious(20) //short amount of time for follow up attacks against elusive enemies like wizards Knockdown(200 - (bomb_armor * 1.6)) //between ~4 and ~20 seconds of knockdown depending on bomb armor @@ -452,7 +452,7 @@ if(bomb_armor) brute_loss = 15*(2 - round(bomb_armor*0.01, 0.05)) damage_clothes(max(50 - bomb_armor, 0), BRUTE, BOMB) - if (ears && !HAS_TRAIT_FROM(src, TRAIT_DEAF, CLOTHING_TRAIT)) + if (ears && !HAS_TRAIT_FROM_ONLY(src, TRAIT_DEAF, EAR_DAMAGE)) ears.adjustEarDamage(15,60) Knockdown(160 - (bomb_armor * 1.6)) //100 bomb armor will prevent knockdown altogether diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm index be5894ba393..286045d8123 100644 --- a/code/modules/mob/living/simple_animal/bot/honkbot.dm +++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm @@ -68,7 +68,7 @@ current_target.set_timed_status_effect(40 SECONDS, /datum/status_effect/speech/stutter) var/obj/item/organ/internal/ears/target_ears = current_target.getorganslot(ORGAN_SLOT_EARS) - if(target_ears && !HAS_TRAIT_FROM(current_target, TRAIT_DEAF, CLOTHING_TRAIT)) + if(target_ears && !HAS_TRAIT(current_target, TRAIT_DEAF)) target_ears.adjustEarDamage(0, 5) //far less damage than the H.O.N.K. current_target.set_timed_status_effect(100 SECONDS, /datum/status_effect/jitter, only_if_higher = TRUE) current_target.Paralyze(6 SECONDS)