From bdffd60cc92abb0cd2e58a57196196f7931de180 Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 6 Aug 2012 15:21:03 -0700 Subject: [PATCH] Balanced out wound healing. --- code/modules/mob/living/carbon/human/life.dm | 9 +++++++++ code/modules/mob/organ/organ.dm | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 364a0a75a7f..20c6cb99a73 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -16,6 +16,9 @@ var/lyingcheck = 0 var/buckle_check = 0 + // total amount of wounds on mob, used to spread out healing and the like over all wounds + var/number_wounds = 0 + /mob/living/carbon/human/Life() set invisibility = 0 set background = 1 @@ -900,10 +903,15 @@ handle_organs() // take care of organ related updates, such as broken and missing limbs + // recalculate number of wounds + number_wounds = 0 + var/leg_tally = 2 for(var/name in organs) var/datum/organ/external/E = organs[name] E.process() + for(var/datum/wound/W in E.wounds) + number_wounds++ if(E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam)) if(E.name == "l_hand" || E.name == "l_arm") if(hand && equipped()) @@ -956,6 +964,7 @@ paralysis = 10 + handle_blood() // take care of blood and blood loss if(stat < 2) diff --git a/code/modules/mob/organ/organ.dm b/code/modules/mob/organ/organ.dm index fd5aa530231..84274b923c0 100644 --- a/code/modules/mob/organ/organ.dm +++ b/code/modules/mob/organ/organ.dm @@ -126,8 +126,9 @@ proc/open_wound() if(current_stage > 1) // e.g. current_stage is 2, then reset it to 0 and do next_stage(), bringing it to 1 - current_stage -= 2 + src.current_stage -= 2 next_stage() + src.damage = src.min_damage /** CUTS **/ /datum/wound/cut @@ -406,7 +407,8 @@ if(W.bandaged) amount++ if(W.salved) amount++ if(W.disinfected) amount++ - W.heal_damage(amount / 20) + // amount of healing is spread over all the wounds + W.heal_damage(amount / (owner.number_wounds+1)) proc/add_wound(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] @@ -595,7 +597,7 @@ var/size = min( max( 1, damage/10 ) , 6) // first check whether we can widen an existing wound - if(wounds.len > 0) + if(wounds.len > 0 && prob(5)) if((type == CUT || type == BRUISE) && damage >= 5) var/datum/wound/W = pick(wounds) if(W.started_healing())