From d89950487a95a65bdc6ebb7ddf0120cbbd2857c3 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Thu, 27 Jun 2013 08:47:15 -0700 Subject: [PATCH] Added a clot timer to wounds. If a wound is smaller than 30 damage, it will stop bleeding after seconds. More damage increases the counter. --- code/modules/organs/organ_external.dm | 1 + code/modules/organs/wound.dm | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 77f966baf4c..a96e8cb1b26 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -365,6 +365,7 @@ burn_dam += W.damage if(!(status & ORGAN_ROBOT) && W.bleeding()) + W.bleed_timer-- status |= ORGAN_BLEEDING clamped |= W.clamped diff --git a/code/modules/organs/wound.dm b/code/modules/organs/wound.dm index 1d1f61ec918..3df9e206c9c 100644 --- a/code/modules/organs/wound.dm +++ b/code/modules/organs/wound.dm @@ -13,7 +13,8 @@ // amount of damage this wound causes var/damage = 0 - + // ticks of bleeding left. + var/bleed_timer = 0 // amount of damage the current wound type requires(less means we need to apply the next healing stage) var/min_damage = 0 @@ -71,6 +72,8 @@ // this is more robust to changes to the list max_bleeding_stage = src.desc_list.len - max_bleeding_stage + bleed_timer += damage + // returns 1 if there's a next stage, 0 otherwise proc/next_stage() if(current_stage + 1 > src.desc_list.len) @@ -136,6 +139,7 @@ // opens the wound again proc/open_wound(damage) src.damage += damage + bleed_timer += damage while(src.current_stage > 1 && src.damage_list[current_stage-1] <= src.damage) src.current_stage-- @@ -145,7 +149,7 @@ proc/bleeding() // internal wounds don't bleed in the sense of this function - return (!(bandaged||clamped) && (damage_type == BRUISE && damage >= 20 || damage_type == CUT && damage >= 10) && current_stage <= max_bleeding_stage && !src.internal) + return ((damage > 30 || bleed_timer > 0) && !(bandaged||clamped) && (damage_type == BRUISE && damage >= 20 || damage_type == CUT && damage >= 5) && current_stage <= max_bleeding_stage && !src.internal) /** CUTS **/ /datum/wound/cut/small