Files
Bubberstation/code/modules/surgery/organs/ears.dm
coiax 1a64abe7a7 Add inacusiate to syndicate medical borgs (#55823)
Giving syndicate medical cyborgs access to the ear healing chemical
allos them to heal one of the most crippling problems that can afflict
an op; being unable to communicate effectively (through ear damage).
Being unable to communicate because they are a bad player is uncurable
through in-game methods however.
2020-12-31 17:09:09 -08:00

124 lines
4.3 KiB
Plaintext

/obj/item/organ/ears
name = "ears"
icon_state = "ears"
desc = "There are three parts to the ear. Inner, middle and outer. Only one of these parts should be normally visible."
zone = BODY_ZONE_HEAD
slot = ORGAN_SLOT_EARS
gender = PLURAL
healing_factor = STANDARD_ORGAN_HEALING
decay_factor = STANDARD_ORGAN_DECAY
low_threshold_passed = "<span class='info'>Your ears begin to resonate with an internal ring sometimes.</span>"
now_failing = "<span class='warning'>You are unable to hear at all!</span>"
now_fixed = "<span class='info'>Noise slowly begins filling your ears once more.</span>"
low_threshold_cleared = "<span class='info'>The ringing in your ears has died down.</span>"
// `deaf` measures "ticks" of deafness. While > 0, the person is unable
// to hear anything.
var/deaf = 0
// `damage` in this case measures long term damage to the ears, if too high,
// the person will not have either `deaf` or `ear_damage` decrease
// without external aid (earmuffs, drugs)
//Resistance against loud noises
var/bang_protect = 0
// Multiplier for both long term and short term ear damage
var/damage_multiplier = 1
/obj/item/organ/ears/on_life()
// only inform when things got worse, needs to happen before we heal
if((damage > low_threshold && prev_damage < low_threshold) || (damage > high_threshold && prev_damage < high_threshold))
to_chat(owner, "<span class='warning'>The ringing in your ears grows louder, blocking out any external noises for a moment.</span>")
. = ..()
// if we have non-damage related deafness like mutations, quirks or clothing (earmuffs), don't bother processing here. Ear healing from earmuffs or chems happen elsewhere
if(HAS_TRAIT_NOT_FROM(owner, TRAIT_DEAF, EAR_DAMAGE))
return
if((damage < maxHealth) && (organ_flags & ORGAN_FAILING)) //ear damage can be repaired from the failing condition
organ_flags &= ~ORGAN_FAILING
if((organ_flags & ORGAN_FAILING))
deaf = max(deaf, 1) // if we're failing we always have at least 1 deaf stack (and thus deafness)
else // only clear deaf stacks if we're not failing
deaf = max(deaf - 1, 0)
if((damage > low_threshold) && prob(damage / 30))
adjustEarDamage(0, 4)
SEND_SOUND(owner, sound('sound/weapons/flash_ring.ogg'))
if(deaf)
ADD_TRAIT(owner, TRAIT_DEAF, EAR_DAMAGE)
else
REMOVE_TRAIT(owner, TRAIT_DEAF, EAR_DAMAGE)
/obj/item/organ/ears/proc/adjustEarDamage(ddmg, ddeaf)
damage = max(damage + (ddmg*damage_multiplier), 0)
deaf = max(deaf + (ddeaf*damage_multiplier), 0)
/obj/item/organ/ears/invincible
damage_multiplier = 0
/obj/item/organ/ears/cat
name = "cat ears"
icon = 'icons/obj/clothing/hats.dmi'
icon_state = "kitty"
damage_multiplier = 2
/obj/item/organ/ears/cat/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
..()
if(istype(H))
color = H.hair_color
H.dna.features["ears"] = H.dna.species.mutant_bodyparts["ears"] = "Cat"
H.update_body()
/obj/item/organ/ears/cat/Remove(mob/living/carbon/human/H, special = 0)
..()
if(istype(H))
color = H.hair_color
H.dna.features["ears"] = "None"
H.dna.species.mutant_bodyparts -= "ears"
H.update_body()
/obj/item/organ/ears/penguin
name = "penguin ears"
desc = "The source of a penguin's happy feet."
/obj/item/organ/ears/penguin/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
. = ..()
if(istype(H))
to_chat(H, "<span class='notice'>You suddenly feel like you've lost your balance.</span>")
H.AddElement(/datum/element/waddling)
/obj/item/organ/ears/penguin/Remove(mob/living/carbon/human/H, special = 0)
. = ..()
if(istype(H))
to_chat(H, "<span class='notice'>Your sense of balance comes back to you.</span>")
H.RemoveElement(/datum/element/waddling)
/obj/item/organ/ears/bronze
name = "tin ears"
desc = "The robust ears of a bronze golem. "
damage_multiplier = 0.1 //STRONK
bang_protect = 1 //Fear me weaklings.
/obj/item/organ/ears/cybernetic
name = "cybernetic ears"
icon_state = "ears-c"
desc = "A basic cybernetic organ designed to mimic the operation of ears."
damage_multiplier = 0.9
organ_flags = ORGAN_SYNTHETIC
/obj/item/organ/ears/cybernetic/upgraded
name = "upgraded cybernetic ears"
icon_state = "ears-c-u"
desc = "An advanced cybernetic ear, surpassing the performance of organic ears."
damage_multiplier = 0.5
/obj/item/organ/ears/cybernetic/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
return
damage += 40/severity