Files
Bubberstation/code/modules/clothing/ears/_ears.dm
SkyratBot aa95977eb8 [MIRROR] Refactors a common pattern, clothing traits (#2787)
* Refactors a common pattern, clothing traits (#56233)

A common pattern is clothing that gives a certain trait when equipped in
the correct slot, for example, mesons making you immune to supermatter
madness, or the bartender's beer goggles giving them the ability to
"booze slide".

Now, instead of implementing essentially the same logic on equip and
dropped, it is now supported at the clothing level with the
`clothing_traits` lazylist.

* Refactors a common pattern, clothing traits

Co-authored-by: coiax <yellowbounder@gmail.com>
2021-01-19 22:07:29 +00:00

25 lines
710 B
Plaintext

//Ears: currently only used for headsets and earmuffs
/obj/item/clothing/ears
name = "ears"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
slot_flags = ITEM_SLOT_EARS
resistance_flags = NONE
/obj/item/clothing/ears/earmuffs
name = "earmuffs"
desc = "Protects your hearing from loud noises, and quiet ones as well."
icon_state = "earmuffs"
inhand_icon_state = "earmuffs"
clothing_traits = list(TRAIT_DEAF)
strip_delay = 15
equip_delay_other = 25
resistance_flags = FLAMMABLE
custom_price = PAYCHECK_HARD * 1.5
/obj/item/clothing/ears/earmuffs/ComponentInitialize()
. = ..()
AddElement(/datum/element/earhealing)
AddComponent(/datum/component/wearertargeting/earprotection, list(ITEM_SLOT_EARS))