Merge pull request #5962 from mwerezak/wound-fixes

Wound and infection fever fix
This commit is contained in:
Chinsky
2014-08-14 07:55:17 +04:00
3 changed files with 50 additions and 30 deletions

View File

@@ -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]"

View File

@@ -268,25 +268,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 <= 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
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
return /datum/wound/burn/carbonised
/****************************************************
PROCESSING & UPDATING
****************************************************/
@@ -397,10 +378,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)

View File

@@ -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
@@ -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
@@ -220,7 +258,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
@@ -249,25 +287,26 @@ 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 **/
/datum/wound/internal_bleeding
internal = 1
stages = list("severed vein" = 30, "cut vein" = 20, "damaged vein" = 10, "bruised vein" = 5)