From 44cc7159c468e59a1abd24aa978f9bc3df5c945d Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 11 Aug 2014 20:01:13 -0400 Subject: [PATCH 1/3] Fixes a few issues with get_wound_type() Fixes damage causing "healing" wound types that can't bleed. Fixes flesh wounds not bleeding the instant they heal any damage. --- code/modules/organs/organ_external.dm | 20 ++++++++++---------- code/modules/organs/wound.dm | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index d1bf4f170de..c46c5a85fe8 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -266,22 +266,22 @@ This function completely restores a damaged organ to perfect condition. wounds += W /datum/organ/external/proc/get_wound_type(var/type = CUT, var/damage) - //if you look a the names in the wound's stages list for each wound type you will see the logic behind these values + //if you look a the names in the wound's stages list for each wound type you will see the logic behind these values. switch(type) if(CUT) - if (damage <= 5) return /datum/wound/cut/small - if (damage <= 15) return /datum/wound/cut/deep - if (damage <= 25) return /datum/wound/cut/flesh - if (damage <= 50) return /datum/wound/cut/gaping - if (damage <= 60) return /datum/wound/cut/gaping_big + if (damage < 15) return /datum/wound/cut/small + if (damage < 25) return /datum/wound/cut/deep + if (damage < 50) return /datum/wound/cut/flesh + if (damage < 60) return /datum/wound/cut/gaping + if (damage < 70) return /datum/wound/cut/gaping_big return /datum/wound/cut/massive if(BRUISE) return /datum/wound/bruise if(BURN) - if (damage <= 5) return /datum/wound/burn/moderate - if (damage <= 15) return /datum/wound/burn/large - if (damage <= 30) return /datum/wound/burn/severe - if (damage <= 40) return /datum/wound/burn/deep + if (damage < 15) return /datum/wound/burn/moderate + if (damage < 30) return /datum/wound/burn/large + if (damage < 40) return /datum/wound/burn/severe + if (damage < 50) return /datum/wound/burn/deep return /datum/wound/burn/carbonised /**************************************************** diff --git a/code/modules/organs/wound.dm b/code/modules/organs/wound.dm index d20fc0dbfb4..25fda282f0b 100644 --- a/code/modules/organs/wound.dm +++ b/code/modules/organs/wound.dm @@ -220,7 +220,7 @@ damage_type = CUT /datum/wound/cut/flesh - max_bleeding_stage = 3 + max_bleeding_stage = 4 stages = list("ugly ripped flesh wound" = 35, "ugly flesh wound" = 30, "flesh wound" = 25, "blood soaked clot" = 15, "large scab" = 5, "fresh skin" = 0) damage_type = CUT @@ -268,6 +268,7 @@ datum/wound/cut/massive stages = list("carbonised area" = 50, "treated carbonised area" = 20, "massive burn scar" = 0) damage_type = BURN +/** INTERNAL BLEEDING **/ /datum/wound/internal_bleeding internal = 1 stages = list("severed vein" = 30, "cut vein" = 20, "damaged vein" = 10, "bruised vein" = 5) From ca9fc4169da4b564307eb2e61722a2a3116f36ed Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 11 Aug 2014 21:50:38 -0400 Subject: [PATCH 2/3] Fixes infection fever causing burn damage --- code/modules/organs/organ_external.dm | 26 +++--------------- code/modules/organs/wound.dm | 38 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index c46c5a85fe8..6f7e728dc06 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -265,25 +265,6 @@ This function completely restores a damaged organ to perfect condition. if(W) wounds += W -/datum/organ/external/proc/get_wound_type(var/type = CUT, var/damage) - //if you look a the names in the wound's stages list for each wound type you will see the logic behind these values. - switch(type) - if(CUT) - if (damage < 15) return /datum/wound/cut/small - if (damage < 25) return /datum/wound/cut/deep - if (damage < 50) return /datum/wound/cut/flesh - if (damage < 60) return /datum/wound/cut/gaping - if (damage < 70) return /datum/wound/cut/gaping_big - return /datum/wound/cut/massive - if(BRUISE) - return /datum/wound/bruise - if(BURN) - if (damage < 15) return /datum/wound/burn/moderate - if (damage < 30) return /datum/wound/burn/large - if (damage < 40) return /datum/wound/burn/severe - if (damage < 50) return /datum/wound/burn/deep - return /datum/wound/burn/carbonised - /**************************************************** PROCESSING & UPDATING ****************************************************/ @@ -394,10 +375,9 @@ Note that amputating the affected organ does in fact remove the infection from t if(germ_level >= INFECTION_LEVEL_ONE) //having an infection raises your body temperature - var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 1)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature - if (fever_temperature > owner.bodytemperature) - //need to make sure we raise temperature fast enough to get around environmental cooling preventing us from reaching fever_temperature - owner.bodytemperature += (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1 + var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature + //need to make sure we raise temperature fast enough to get around environmental cooling preventing us from reaching fever_temperature + owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature) if(prob(round(germ_level/10))) if (antibiotics < 5) diff --git a/code/modules/organs/wound.dm b/code/modules/organs/wound.dm index 25fda282f0b..63fc2283ba6 100644 --- a/code/modules/organs/wound.dm +++ b/code/modules/organs/wound.dm @@ -207,6 +207,44 @@ return (damage_type == BRUISE && wound_damage() >= 20 || damage_type == CUT && wound_damage() >= 5) +/** WOUND DEFINITIONS **/ + +//Note that the MINIMUM damage before a wound can be applied should correspond to +//the damage amount for the stage with the same name as the wound. +//e.g. /datum/wound/cut/deep should only be applied for 15 damage and up, +//because in it's stages list, "deep cut" = 15. +/proc/get_wound_type(var/type = CUT, var/damage) + switch(type) + if(CUT) + switch(damage) + if(70 to INFINITY) + return /datum/wound/cut/massive + if(60 to 70) + return /datum/wound/cut/gaping_big + if(50 to 60) + return /datum/wound/cut/gaping + if(25 to 50) + return /datum/wound/cut/flesh + if(15 to 25) + return /datum/wound/cut/deep + if(0 to 15) + return /datum/wound/cut/small + if(BRUISE) + return /datum/wound/bruise + if(BURN) + switch(damage) + if(50 to INFINITY) + return /datum/wound/burn/carbonised + if(40 to 50) + return /datum/wound/burn/deep + if(30 to 40) + return /datum/wound/burn/severe + if(15 to 30) + return /datum/wound/burn/large + if(0 to 15) + return /datum/wound/burn/moderate + return null //no wound + /** CUTS **/ /datum/wound/cut/small // link wound descriptions to amounts of damage From 0b0380ae149a5bb7e178fdcdab25fefa281a8c09 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Wed, 13 Aug 2014 17:01:31 -0400 Subject: [PATCH 3/3] Fixes burn description saying it is salved when not --- code/modules/mob/living/carbon/human/examine.dm | 1 + code/modules/organs/wound.dm | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index e10c35efa7a..2a9850171e7 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -280,6 +280,7 @@ for(var/datum/wound/W in temp.wounds) if(W.internal && !temp.open) continue // can't see internal wounds var/this_wound_desc = W.desc + if(W.damage_type == BURN && W.salved) this_wound_desc = "salved [this_wound_desc]" 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 > 600) this_wound_desc = "badly infected [this_wound_desc]" diff --git a/code/modules/organs/wound.dm b/code/modules/organs/wound.dm index 63fc2283ba6..4e66dbf8bbb 100644 --- a/code/modules/organs/wound.dm +++ b/code/modules/organs/wound.dm @@ -7,7 +7,7 @@ var/current_stage = 0 // description of the wound - var/desc = "" + var/desc = "wound" //default in case something borks // amount of damage this wound causes var/damage = 0 @@ -287,23 +287,23 @@ datum/wound/cut/massive /** BURNS **/ /datum/wound/burn/moderate - stages = list("ripped burn" = 10, "moderate burn" = 5, "moderate salved burn" = 2, "fresh skin" = 0) + stages = list("ripped burn" = 10, "moderate burn" = 5, "healing moderate burn" = 2, "fresh skin" = 0) damage_type = BURN /datum/wound/burn/large - stages = list("ripped large burn" = 20, "large burn" = 15, "large salved burn" = 5, "fresh skin" = 0) + stages = list("ripped large burn" = 20, "large burn" = 15, "healing large burn" = 5, "fresh skin" = 0) damage_type = BURN /datum/wound/burn/severe - stages = list("ripped severe burn" = 35, "severe burn" = 30, "severe salved burn" = 10, "burn scar" = 0) + stages = list("ripped severe burn" = 35, "severe burn" = 30, "healing severe burn" = 10, "burn scar" = 0) damage_type = BURN /datum/wound/burn/deep - stages = list("ripped deep burn" = 45, "deep burn" = 40, "deep salved burn" = 15, "large burn scar" = 0) + stages = list("ripped deep burn" = 45, "deep burn" = 40, "healing deep burn" = 15, "large burn scar" = 0) damage_type = BURN /datum/wound/burn/carbonised - stages = list("carbonised area" = 50, "treated carbonised area" = 20, "massive burn scar" = 0) + stages = list("carbonised area" = 50, "healing carbonised area" = 20, "massive burn scar" = 0) damage_type = BURN /** INTERNAL BLEEDING **/