mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-30 03:03:16 +00:00
Silly little addition, does not affect gameplay at all. Liver, lungs, kidneys, heart, and eyes now have flavor text that shows up when you examine them.
81 lines
2.4 KiB
Plaintext
81 lines
2.4 KiB
Plaintext
/obj/item/organ/internal/liver
|
|
name = "liver"
|
|
desc = "If it stops working, should it be called the die-er?"
|
|
icon_state = "liver"
|
|
organ_tag = BP_LIVER
|
|
parent_organ = BP_GROIN
|
|
robotic_name = "toxin filter"
|
|
toxin_type = CE_HEPATOTOXIC
|
|
min_bruised_damage = 25
|
|
min_broken_damage = 55
|
|
|
|
max_damage = 70
|
|
relative_size = 60
|
|
|
|
/obj/item/organ/internal/liver/process()
|
|
|
|
..()
|
|
|
|
if(!owner)
|
|
return
|
|
|
|
if (germ_level > INFECTION_LEVEL_ONE)
|
|
owner.notify_message(SPAN_WARNING("Your skin itches."), 2 MINUTES)
|
|
if (germ_level > INFECTION_LEVEL_TWO)
|
|
if(prob(1))
|
|
spawn owner.delayed_vomit()
|
|
|
|
//Detox can heal small amounts of damage
|
|
if (damage < max_damage && !owner.chem_effects[CE_TOXIN])
|
|
heal_damage(0.3 * owner.chem_effects[CE_ANTITOXIN])
|
|
|
|
// Get the effectiveness of the liver.
|
|
var/filter_effect = 3
|
|
if(is_bruised())
|
|
filter_effect -= 1
|
|
if(is_broken())
|
|
filter_effect -= 2
|
|
// Robotic organs filter better but don't get benefits from dylovene for filtering.
|
|
if(BP_IS_ROBOTIC(src))
|
|
filter_effect += 1
|
|
if(getToxLoss() >= 60) //Too many toxins to process. Abort, abort.
|
|
filter_effect -= 2
|
|
else if(owner.chem_effects[CE_ANTITOXIN])
|
|
filter_effect += 1
|
|
|
|
if(filter_effect < 2) //Trouble. You're not filtering well.
|
|
if(owner.intoxication > 0)
|
|
owner.adjustToxLoss(0.5 * max(2 - filter_effect, 0))
|
|
|
|
var/filter_strength = INTOX_FILTER_HEALTHY
|
|
if(is_bruised())
|
|
filter_strength = INTOX_FILTER_BRUISED
|
|
if(is_broken())
|
|
filter_strength = INTOX_FILTER_DAMAGED
|
|
if(BP_IS_ROBOTIC(src))
|
|
filter_strength *= 1.1
|
|
|
|
if (owner.intoxication > 0)
|
|
var/bac = owner.get_blood_alcohol()
|
|
var/res = owner.species ? owner.species.ethanol_resistance : 1
|
|
if(bac >= INTOX_BLACKOUT * res) //Excessive blood alcohol, difficult to filter
|
|
owner.intoxication -= min(owner.intoxication, filter_strength/2)
|
|
else
|
|
owner.intoxication -= min(owner.intoxication, filter_strength)
|
|
if(!owner.intoxication)
|
|
owner.handle_intoxication()
|
|
|
|
if(toxin_type in owner.chem_effects)
|
|
if(is_damaged())
|
|
owner.adjustToxLoss(owner.chem_effects[toxin_type] * 0.1 * PROCESS_ACCURACY) // as actual organ damage is handled elsewhere
|
|
|
|
/obj/item/organ/internal/liver/handle_regeneration()
|
|
if(..())
|
|
if(!owner.total_radiation && damage > 0 && !(owner.get_blood_alcohol() > INTOX_BLACKOUT))
|
|
if(damage < min_broken_damage)
|
|
heal_damage(0.2)
|
|
if(damage < min_bruised_damage)
|
|
heal_damage(0.3)
|
|
return TRUE
|
|
return FALSE
|