Makes minor wounds harder to infect

This commit is contained in:
mwerezak
2014-07-07 17:19:13 -04:00
parent a4c9f31b49
commit 5764d95808
2 changed files with 19 additions and 10 deletions

View File

@@ -455,7 +455,7 @@ Note that amputating the affected organ does in fact remove the infection from t
// let the GC handle the deletion of the wound // let the GC handle the deletion of the wound
// Internal wounds get worse over time. Low temperatures (cryo) stop them. // Internal wounds get worse over time. Low temperatures (cryo) stop them.
if(W.internal && !W.is_treated() && owner.bodytemperature >= 170) if(W.internal && !W.can_autoheal() && owner.bodytemperature >= 170)
var/bicardose = owner.reagents.get_reagent_amount("bicaridine") var/bicardose = owner.reagents.get_reagent_amount("bicaridine")
var/inaprovaline = owner.reagents.get_reagent_amount("inaprovaline") var/inaprovaline = owner.reagents.get_reagent_amount("inaprovaline")
if(!bicardose || !inaprovaline) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, and also stop bleeding if(!bicardose || !inaprovaline) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, and also stop bleeding
@@ -472,7 +472,7 @@ Note that amputating the affected organ does in fact remove the infection from t
var/heal_amt = 0 var/heal_amt = 0
// if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round. // if damage >= 50 AFTER treatment then it's probably too severe to heal within the timeframe of a round.
if (W.is_treated() && W.wound_damage() < 50) if (W.can_autoheal() && W.wound_damage() < 50)
heal_amt += 0.5 heal_amt += 0.5
//we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime //we only update wounds once in [wound_update_accuracy] ticks so have to emulate realtime

View File

@@ -85,24 +85,25 @@
proc/wound_damage() proc/wound_damage()
return src.damage / src.amount return src.damage / src.amount
// checks whether the wound has been appropriately treated proc/can_autoheal()
// always returns 1 for wounds that are too minor to need treatment
proc/is_treated()
if(src.wound_damage() <= autoheal_cutoff) if(src.wound_damage() <= autoheal_cutoff)
return 1 return 1
return is_treated()
// checks whether the wound has been appropriately treated
proc/is_treated()
if(damage_type == BRUISE || damage_type == CUT) if(damage_type == BRUISE || damage_type == CUT)
return bandaged return bandaged
else if(damage_type == BURN) else if(damage_type == BURN)
return salved return salved
// Checks whether other other can be merged into src. // Checks whether other other can be merged into src.
proc/can_merge(var/datum/wound/other) proc/can_merge(var/datum/wound/other)
if (other.type != src.type) return 0 if (other.type != src.type) return 0
if (other.current_stage != src.current_stage) return 0 if (other.current_stage != src.current_stage) return 0
if (other.damage_type != src.damage_type) return 0 if (other.damage_type != src.damage_type) return 0
if (!(other.is_treated()) != !(src.is_treated())) return 0 if (!(other.can_autoheal()) != !(src.can_autoheal())) return 0
if (!(other.bandaged) != !(src.bandaged)) return 0 if (!(other.bandaged) != !(src.bandaged)) return 0
if (!(other.clamped) != !(src.clamped)) return 0 if (!(other.clamped) != !(src.clamped)) return 0
if (!(other.salved) != !(src.salved)) return 0 if (!(other.salved) != !(src.salved)) return 0
@@ -120,20 +121,28 @@
// checks if wound is considered open for external infections // checks if wound is considered open for external infections
// untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger // untreated cuts (and bleeding bruises) and burns are possibly infectable, chance higher if wound is bigger
proc/infection_check() proc/infection_check()
if (is_treated() && damage < 10) if (damage < 10) //small cuts, tiny bruises, and moderate burns shouldn't be infectable.
return 0
if (is_treated() && damage < 25) //anything less than a flesh wound (or equivalent) isn't infectable if treated properly
return 0 return 0
if (disinfected) if (disinfected)
germ_level = 0 //reset this, just in case
return 0 return 0
if (damage_type == BRUISE && !bleeding()) //bruises only infectable if bleeding
return 0
var/dam_coef = round(damage/10) var/dam_coef = round(damage/10)
switch (damage_type) switch (damage_type)
if (BRUISE) if (BRUISE)
return prob(dam_coef*5) && bleeding() //bruises only infectable if bleeding return prob(dam_coef*5)
if (BURN) if (BURN)
return prob(dam_coef*10) return prob(dam_coef*10)
if (CUT) if (CUT)
return prob(dam_coef*20) return prob(dam_coef*20)
return 0 return 0
// heal the given amount of damage, and if the given amount of damage was more // heal the given amount of damage, and if the given amount of damage was more
// than what needed to be healed, return how much heal was left // than what needed to be healed, return how much heal was left
// set @heals_internal to also heal internal organ damage // set @heals_internal to also heal internal organ damage