Files
Bubberstation/code/datums/elements/earhealing.dm
Tim e3d68c0236 Robotic organ and disease improvements (#76766)
## About The Pull Request

In the code description for the `ORGAN_ROBOTIC` flag, it says that
robotic organs are not supposed to decay or regenerate health. I went
and fixed this and added some more "robotic" behavior.

New changes for robotic organs:
- No longer heal damage passively
- No longer gain health from revival
- No longer heal in the smart organ fridge
- No longer heal from pluoxium
- Robotic ears no longer heal from ear healing items (earmuffs, etc.)
- Robotic eyes are immune to changeling blind stings
- Robotic eyes no longer heal from occuline

New changes for diseases:
- Some diseases now require an organ to work. A robotic organ will give
immunity to the disease symptom unless the disease has "Inorganic
Biology".
- The transmission methods for diseases require organs to work but
robotic organs are immune. (except inorganic biology) Airborne disease
transmission require lungs. Ingested (drunk or eaten) disease
transmission requires a stomach. Blood (inject or patch) disease
transmission requires a heart.
- Organs removed from a mob that is afflicted with a disease will be
infectious while handling or transplanting it. (again, robotic organs
are immune unless inorganic biology is present) Certain admin spawned or
special diseases are exempt from this transmission method.
- A stomach is required for nebula nausea, gastritium, carpellosis,
metabolic boost, vomit, weight loss, death sandwich poisoning,
- Lungs are required for choking, asphyxiation, cough, cold9, oxygen
restoration, sneezing, flu, cold, spanish flu, tuberculosis
- A liver is required for tissue hydration, plasma fixation, parasitic
infection
- Ears are required for deafness, sensory restoration
- A heart is required for toxolysis, heart failure
- Eyes are required for sensory restoration, hyphema
- A tongue is required for voice change, parrot possession, pierrot
throat
- Wizarditis no longer requires a head (wtf?) to function

## Why It's Good For The Game

Robotic organs should behave as intended. Not naturally healing (like
organic organs) was supposed to be their downside to counteract their
their ability to not decay upon death.

## Changelog

🆑
fix: Fix robotic organs to not gain health passively, from revival,
smart organ fridge, pluxium, occuline, and earmuffs.
add: Some diseases now require the appropriate internal organ to work. A
robotic organ will give immunity to the disease symptom unless the
disease has "Inorganic Biology".
add: Disease transmission methods now require an internal organ to be
successful. Robotic organs give immunity. (except inorganic biology)
Airborne disease transmission require lungs. Ingested (drunk or eaten)
disease transmission requires a stomach. Blood (inject or patch) disease
transmission requires a heart.
add: Organs removed from a mob that is afflicted with a disease will be
infectious while handling or transplanting it. (again, robotic organs
are immune unless inorganic biology is present) Certain admin spawned or
special diseases are exempt from this transmission method.
add: A stomach is required for nebula nausea, gastritium, carpellosis,
metabolic boost, vomit, weight loss, death sandwich poisoning
add: Lungs are required for choking, asphyxiation, cough, cold9, oxygen
restoration, sneezing, flu, cold, spanish flu, tuberculosis
add: A liver is required for tissue hydration, plasma fixation,
parasitic infection
add: Ears are required for deafness, sensory restoration
add: A heart is required for toxolysis, heart failure
add: Eyes are required for sensory restoration, hyphema
add: A tongue is required for voice change, pierrot throat
bal: Remove head requirement for wizarditis disease
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-07-21 11:55:29 +01:00

35 lines
1.2 KiB
Plaintext

/datum/element/earhealing
element_flags = ELEMENT_DETACH_ON_HOST_DESTROY
var/list/user_by_item = list()
/datum/element/earhealing/Attach(datum/target)
. = ..()
if(!isitem(target))
return ELEMENT_INCOMPATIBLE
RegisterSignals(target, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED), PROC_REF(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/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
/datum/element/earhealing/process(seconds_per_tick)
for(var/i in user_by_item)
var/mob/living/carbon/user = user_by_item[i]
var/obj/item/organ/internal/ears/ears = user.get_organ_slot(ORGAN_SLOT_EARS)
if(!ears || !ears.damage || (ears.organ_flags & ORGAN_FAILING) || IS_ROBOTIC_ORGAN(ears))
continue
ears.deaf = max(ears.deaf - 0.25 * seconds_per_tick, (ears.damage < ears.maxHealth ? 0 : 1)) // Do not clear deafness if our ears are too damaged
ears.apply_organ_damage(-0.025 * seconds_per_tick)
CHECK_TICK