Earmuff Things (#10759)

This commit is contained in:
Geeves
2020-12-19 15:02:32 +02:00
committed by GitHub
parent 20b552b4ce
commit b1ac5a6027
16 changed files with 101 additions and 41 deletions
@@ -256,4 +256,7 @@
return species.icon_x_offset
/mob/living/carbon/human/get_standard_pixel_y()
return species.icon_y_offset
return species.icon_y_offset
/mob/living/carbon/human/proc/protected_from_sound()
return (l_ear?.item_flags & SOUNDPROTECTION) || (r_ear?.item_flags & SOUNDPROTECTION) || (head?.item_flags & SOUNDPROTECTION)
@@ -787,11 +787,8 @@ mob/living/carbon/human/proc/change_monitor()
var/list/victims = list()
for (var/mob/living/carbon/human/T in hearers(2, src))
if (T == src)
continue
if (istype(T) && (T:l_ear || T:r_ear) && istype((T:l_ear || T:r_ear), /obj/item/clothing/ears/earmuffs))
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>")
@@ -232,8 +232,8 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_l_ear)
src.l_ear = W
if(l_ear.slot_flags & SLOT_TWOEARS)
var/obj/item/clothing/ears/offear/O = new(W)
O.forceMove(src)
var/obj/item/clothing/ears/offear/O = new /obj/item/clothing/ears/offear(src)
O.copy_ear(W)
src.r_ear = O
O.layer = SCREEN_LAYER+0.01
W.equipped(src, slot)
@@ -241,8 +241,8 @@ This saves us from having to call add_fingerprint() any time something is put in
if(slot_r_ear)
src.r_ear = W
if(r_ear.slot_flags & SLOT_TWOEARS)
var/obj/item/clothing/ears/offear/O = new(W)
O.forceMove(src)
var/obj/item/clothing/ears/offear/O = new /obj/item/clothing/ears/offear(src)
O.copy_ear(W)
src.l_ear = O
O.layer = SCREEN_LAYER+0.01
W.equipped(src, slot)
+2 -2
View File
@@ -1292,9 +1292,9 @@
if(ear_deaf <= 1 && (sdisabilities & DEAF) && has_hearing_aid())
setEarDamage(-1, max(ear_deaf-1, 0))
if(istype(l_ear, /obj/item/clothing/ears/earmuffs) || istype(r_ear, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster
if(protected_from_sound()) // resting your ears make them heal faster
adjustEarDamage(-0.15, 0)
setEarDamage(-1, max(ear_deaf, 1))
setEarDamage(-1)
else if(ear_damage < HEARING_DAMAGE_SLOW_HEAL) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
adjustEarDamage(-0.05, 0)
@@ -7,6 +7,8 @@
return FALSE
var/obj/item/target_slot = get_equipped_item(text2num(slot_to_strip))
if(istype(target_slot, /obj/item/clothing/ears/offear))
target_slot = (l_ear == target_slot ? r_ear : l_ear)
switch(slot_to_strip)
// Handle things that are part of this interface but not removing/replacing a given item.
@@ -88,6 +90,9 @@
if(stripping)
admin_attack_log(user, src, "Attempted to remove \a [target_slot]", "Target of an attempt to remove \a [target_slot].", "attempted to remove \a [target_slot] from")
if((l_ear == target_slot || r_ear == target_slot) && (target_slot.slot_flags & SLOT_TWOEARS))
var/obj/item/clothing/ears/OE = (l_ear == target_slot ? r_ear : l_ear)
qdel(OE)
unEquip(target_slot)
else if(user.unEquip(held))
equip_to_slot_if_possible(held, text2num(slot_to_strip), 0, 1, 1)