Alien weed regeneration now mends broken bones

Also, weed regeneration is reduced unless xenos are resting.
This commit is contained in:
mwerezak
2014-12-28 01:22:26 -05:00
parent 6f5f92247a
commit fe348726f2
2 changed files with 36 additions and 6 deletions
@@ -86,17 +86,38 @@
if(!environment) return
if(environment.gas["phoron"] > 0 || locate(/obj/effect/alien/weeds) in T)
if(H.health >= H.maxHealth - H.getCloneLoss())
if(!regenerate(H))
var/datum/organ/internal/xenos/plasmavessel/P = H.internal_organs_by_name["plasma vessel"]
P.stored_plasma += weeds_plasma_rate
P.stored_plasma = min(max(P.stored_plasma,0),P.max_plasma)
else
H.adjustBruteLoss(-weeds_heal_rate)
H.adjustFireLoss(-weeds_heal_rate)
H.adjustOxyLoss(-weeds_heal_rate)
H.adjustToxLoss(-weeds_heal_rate)
..()
/datum/species/xenos/proc/regenerate(var/mob/living/carbon/human/H)
var/heal_rate = weeds_heal_rate
var/mend_prob = 10
if (!H.resting)
heal_rate = weeds_heal_rate / 3
mend_prob = 1
//first heal damages
if (H.getBruteLoss() || H.getFireLoss() || H.getOxyLoss() || H.getToxLoss())
H.adjustBruteLoss(-heal_rate)
H.adjustFireLoss(-heal_rate)
H.adjustOxyLoss(-heal_rate)
H.adjustToxLoss(-heal_rate)
if (prob(5))
H << "\green You feel a soothing sensation come over you..."
return 1
//next mend broken bones, approx 10 ticks each
for(var/datum/organ/external/E in H.bad_external_organs)
if (E.status & ORGAN_BROKEN)
if (prob(mend_prob))
if (E.mend_fracture())
H << "\green You feel something mend itself inside your [E.display_name]."
return 1
return 0
/datum/species/xenos/handle_login_special(var/mob/living/carbon/human/H)
H.AddInfectionImages()
+9
View File
@@ -764,6 +764,15 @@ Note that amputating the affected organ does in fact remove the infection from t
suit.supporting_limbs |= src
return
/datum/organ/external/proc/mend_fracture()
if(status & ORGAN_ROBOT)
return 0 //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if(brute_dam > min_broken_damage * config.organ_health_multiplier)
return 0 //will just immediately fracture again
status &= ~ORGAN_BROKEN
return 1
/datum/organ/external/proc/robotize()
src.status &= ~ORGAN_BROKEN
src.status &= ~ORGAN_BLEEDING