diff --git a/code/datums/components/earhealing.dm b/code/datums/components/earhealing.dm deleted file mode 100644 index bd3d57480d..0000000000 --- a/code/datums/components/earhealing.dm +++ /dev/null @@ -1,30 +0,0 @@ -// An item worn in the ear slot with this component will heal your ears each -// Life() tick, even if normally your ears would be too damaged to heal. - -/datum/component/earhealing - var/mob/living/carbon/wearer - -/datum/component/earhealing/Initialize() - if(!isitem(parent)) - return COMPONENT_INCOMPATIBLE - RegisterSignal(parent, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), .proc/equippedChanged) - -/datum/component/earhealing/proc/equippedChanged(datum/source, mob/living/carbon/user, slot) - if (slot == SLOT_EARS && istype(user)) - if (!wearer) - START_PROCESSING(SSobj, src) - wearer = user - else - if (wearer) - STOP_PROCESSING(SSobj, src) - wearer = null - -/datum/component/earhealing/process() - if (!wearer) - STOP_PROCESSING(SSobj, src) - return - if(!HAS_TRAIT(wearer, TRAIT_DEAF)) - var/obj/item/organ/ears/ears = wearer.getorganslot(ORGAN_SLOT_EARS) - if (ears) - ears.deaf = max(ears.deaf - 1, (ears.damage < ears.maxHealth ? 0 : 1)) // Do not clear deafness if our ears are too damaged - ears.damage = max(ears.damage - 0.1, 0) diff --git a/code/datums/components/earprotection.dm b/code/datums/components/earprotection.dm new file mode 100644 index 0000000000..9256c4310a --- /dev/null +++ b/code/datums/components/earprotection.dm @@ -0,0 +1,11 @@ +/datum/component/wearertargeting/earprotection + signals = list(COMSIG_CARBON_SOUNDBANG) + mobtype = /mob/living/carbon + proctype = .proc/reducebang + +/datum/component/wearertargeting/earprotection/Initialize(_valid_slots) + . = ..() + valid_slots = _valid_slots + +/datum/component/wearertargeting/earprotection/proc/reducebang(datum/source, list/reflist) + reflist[1]-- diff --git a/tgstation.dme b/tgstation.dme index f47c5bea71..4b5d36399a 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -356,7 +356,7 @@ #include "code\datums\components\chasm.dm" #include "code\datums\components\construction.dm" #include "code\datums\components\decal.dm" -#include "code\datums\components\earhealing.dm" +#include "code\datums\components\earprotection.dm" #include "code\datums\components\edit_complainer.dm" #include "code\datums\components\empprotection.dm" #include "code\datums\components\footstep.dm"