Ports a significant amount of the tg cybernetic organ code while making some additional changes to their power

This commit is contained in:
necromanceranne
2021-04-22 13:06:31 +10:00
parent 00db1679fc
commit 0f04bbb23b
11 changed files with 252 additions and 103 deletions
@@ -16,6 +16,7 @@
var/decay_factor = 0 //same as above but when without a living owner, set to 0 for generic organs
var/high_threshold = STANDARD_ORGAN_THRESHOLD * 0.45 //when severe organ damage occurs
var/low_threshold = STANDARD_ORGAN_THRESHOLD * 0.1 //when minor organ damage occurs
var/severe_cooldown //cooldown for severe effects, used for synthetic organ emp effects.
///Organ variables for determining what we alert the owner with when they pass/clear the damage thresholds
var/prev_damage = 0
@@ -153,6 +154,9 @@
/obj/item/organ/proc/on_life() //repair organ damage if the organ is not failing or synthetic
if(organ_flags & ORGAN_FAILING || !owner)
return FALSE
if(organ_flags & ORGAN_SYNTHETIC_EMP) //Synthetic organ has been emped, is now failing.
applyOrganDamage(maxHealth * decay_factor)
return
if(!is_cold() && damage)
///Damage decrements by a percent of its maxhealth
var/healing_amount = -(maxHealth * healing_factor)