Toxins suppress natural liver healing rate. (#13420)

This commit is contained in:
mikomyazaki
2022-04-08 16:42:06 +02:00
committed by GitHub
parent 79372075e8
commit 17ec460cc5
4 changed files with 26 additions and 14 deletions
+9 -5
View File
@@ -139,8 +139,12 @@
tick_surge_damage() //Yes, this is intentional.
/obj/item/organ/internal/proc/handle_regeneration()
if(!damage || BP_IS_ROBOTIC(src) || !istype(owner) || owner.chem_effects[CE_TOXIN] || (toxin_type in owner.chem_effects) || owner.is_asystole())
return
var/repair_modifier = owner.chem_effects[CE_ORGANREPAIR] || 0.1
if(damage < repair_modifier*max_damage)
heal_damage(repair_modifier)
SHOULD_CALL_PARENT(TRUE)
if(damage && !BP_IS_ROBOTIC(src) && istype(owner))
if(!owner.is_asystole())
if(!(owner.chem_effects[CE_TOXIN] || (toxin_type in owner.chem_effects)))
var/repair_modifier = owner.chem_effects[CE_ORGANREPAIR] || 0.1
if(damage < repair_modifier*max_damage)
heal_damage(repair_modifier)
return TRUE // regeneration is allowed
return FALSE // regeneration is prevented
+9 -9
View File
@@ -47,13 +47,6 @@
if(owner.intoxication > 0)
owner.adjustToxLoss(0.5 * max(2 - filter_effect, 0))
// Heal a bit if needed and we're not busy. This allows recovery from low amounts of toxloss.
if(!owner.total_radiation && damage > 0)
if(damage < min_broken_damage)
heal_damage(0.2)
if(damage < min_bruised_damage)
heal_damage(0.3)
var/filter_strength = INTOX_FILTER_HEALTHY
if(is_bruised())
filter_strength = INTOX_FILTER_BRUISED
@@ -76,6 +69,13 @@
if(is_damaged())
owner.adjustToxLoss(owner.chem_effects[toxin_type] * 0.1 * PROCESS_ACCURACY) // as actual organ damage is handled elsewhere
//We got it covered in Process with more detailed thing
/obj/item/organ/internal/liver/handle_regeneration()
return
if(..())
testing("Liver regenerating!")
if(!owner.total_radiation && damage > 0)
if(damage < min_broken_damage)
heal_damage(0.2)
if(damage < min_bruised_damage)
heal_damage(0.3)
return TRUE
return FALSE