From 95181d96a8935095ecff839e1ec503a2a614d2ce Mon Sep 17 00:00:00 2001 From: cib Date: Mon, 12 Nov 2012 13:17:11 +0100 Subject: [PATCH] Several fixes to germs. --- code/WorkInProgress/surgery.dm | 2 +- code/datums/organs/organ_external.dm | 14 +++++++++++++- code/datums/organs/wound.dm | 4 +++- code/modules/mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 7 ++++--- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/code/WorkInProgress/surgery.dm b/code/WorkInProgress/surgery.dm index 992dd30b9a..a3ca9f42ec 100644 --- a/code/WorkInProgress/surgery.dm +++ b/code/WorkInProgress/surgery.dm @@ -134,7 +134,7 @@ proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("\blue [user] clamps bleeders in [target]'s [affected.display_name] with \the [tool].", \ "\blue You clamp bleeders in [target]'s [affected.display_name] with \the [tool].") - affected.bandage() + affected.clamp() affected.status &= ~ORGAN_BLEEDING spread_germs_to_organ(affected, user) diff --git a/code/datums/organs/organ_external.dm b/code/datums/organs/organ_external.dm index b67f3a07ef..cf29a5dea6 100644 --- a/code/datums/organs/organ_external.dm +++ b/code/datums/organs/organ_external.dm @@ -203,6 +203,10 @@ if(W.germ_level > 1000) owner.adjustToxLoss(1 * wound_update_accuracy) + // Salving also helps against infection + if(W.germ_level > 0 && W.salved && prob(2)) + W.germ_level = 0 + // sync the organ's damage with its wounds src.update_damages() @@ -214,6 +218,14 @@ W.bandaged = 1 return rval + proc/clamp() + var/rval = 0 + for(var/datum/wound/W in wounds) + if(W.internal) continue + rval |= !W.clamped + W.clamped = 1 + return rval + proc/salve() var/rval = 0 for(var/datum/wound/W in wounds) @@ -254,7 +266,7 @@ if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT)) src.fracture() if(germ_level > 0) - for(var/datum/wound/W in wounds) if(!W.bandaged) + for(var/datum/wound/W in wounds) if(!W.bandaged && !W.salved) W.germ_level = max(W.germ_level, germ_level) return diff --git a/code/datums/organs/wound.dm b/code/datums/organs/wound.dm index d52c37e7dc..b5baf346da 100644 --- a/code/datums/organs/wound.dm +++ b/code/datums/organs/wound.dm @@ -25,6 +25,8 @@ // is the wound bandaged? var/tmp/bandaged = 0 + // Similar to bandaged, but works differently + var/tmp/clamped = 0 // is the wound salved? var/tmp/salved = 0 // is the wound disinfected? @@ -127,7 +129,7 @@ proc/bleeding() // internal wounds don't bleed in the sense of this function - return (!bandaged && (damage_type == BRUISE && damage >= 20 || damage_type == CUT) && current_stage <= max_bleeding_stage && !src.internal) + return (!(bandaged||clamped) && (damage_type == BRUISE && damage >= 20 || damage_type == CUT) && current_stage <= max_bleeding_stage && !src.internal) /** CUTS **/ /datum/wound/cut diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 2fe10e7762..362d8d0918 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -281,7 +281,7 @@ if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]" else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]" if(W.germ_level > 1000) this_wound_desc = "badly infected [this_wound_desc]" - else if(W.germ_level > 100) this_wound_desc = "infected [this_wound_desc]" + else if(W.germ_level > 100) this_wound_desc = "lightly infected [this_wound_desc]" if(this_wound_desc in wound_descriptors) wound_descriptors[this_wound_desc] += W.amount continue diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index f2821a6708..101606f804 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1167,10 +1167,11 @@ if(druggy) druggy = max(druggy-1, 0) - // Increase germ_level by 1 on each life tick - germ_level += 1 + // Increase germ_level regularly + if(prob(40)) + germ_level += 1 // If you're dirty, your gloves will become dirty, too. - if(gloves && germ_level > gloves.germ_level && prob(30)) + if(gloves && germ_level > gloves.germ_level && prob(10)) gloves.germ_level += 1 return 1