Having an infection raises your body temperature

Also the toxin damage taken during INFECTION_LEVEL_ONE is greatly
reduced.
Fixes robotic internal organs getting infections.
Fixes the organ_failure random event. Forgot to set the affected organ
as needing processing.
This commit is contained in:
mwerezak
2014-06-21 16:55:07 -04:00
parent b9fa433087
commit 1a57ed7355
3 changed files with 14 additions and 6 deletions

View File

@@ -39,5 +39,7 @@ datum/event/organ_failure/start()
O.germ_level = max(INFECTION_LEVEL_TWO, O.germ_level) O.germ_level = max(INFECTION_LEVEL_TWO, O.germ_level)
else else
O.germ_level = max(rand(INFECTION_LEVEL_ONE,INFECTION_LEVEL_ONE*2), O.germ_level) O.germ_level = max(rand(INFECTION_LEVEL_ONE,INFECTION_LEVEL_ONE*2), O.germ_level)
C.bad_external_organs |= O
severity-- severity--

View File

@@ -357,12 +357,14 @@ This function completely restores a damaged organ to perfect condition.
if(germ_level >= INFECTION_LEVEL_ONE) if(germ_level >= INFECTION_LEVEL_ONE)
//having an infection raises your body temperature //having an infection raises your body temperature
var/temperature_increase = (owner.species.heat_level_1 - owner.species.body_temperature - 1)* min(germ_level/INFECTION_LEVEL_THREE, 1) var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 1)* min(germ_level/INFECTION_LEVEL_THREE, 1) + owner.species.body_temperature
if (owner.bodytemperature < temperature_increase) if (owner.bodytemperature < fever_temperature)
//world << "fever: [owner.bodytemperature] < [fever_temperature], raising temperature."
owner.bodytemperature++ owner.bodytemperature++
if(prob(round(germ_level/10))) //aiming for a light infection to become serious after 40 minutes, standing still if(prob(round(germ_level/10))) //aiming for a light infection to become serious after 40 minutes, standing still
germ_level++ if (prob(5))
germ_level++
owner.adjustToxLoss(1) owner.adjustToxLoss(1)
if(germ_level >= INFECTION_LEVEL_TWO) if(germ_level >= INFECTION_LEVEL_TWO)

View File

@@ -37,18 +37,22 @@
if (!germ_level) if (!germ_level)
return return
if (robotic >= 2) //TODO make robotic internal and external organs separate types of organ instead of a flag
germ_level = 0
return
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (germ_level > 0 && antibiotics > 5) if (germ_level > 0 && antibiotics > 5)
if (prob(4*antibiotics)) germ_level-- if (prob(4*antibiotics)) germ_level--
if (antibiotics > 30) germ_level-- if (antibiotics > 30) germ_level--
if (germ_level >= INFECTION_LEVEL_ONE/2) if (germ_level >= INFECTION_LEVEL_ONE/2)
if(prob(round(germ_level/6))) //aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes if(prob(round(germ_level/6))) //aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
germ_level++ germ_level++
if(prob(1)) if(prob(1))
take_damage(1,silent=0) take_damage(1,silent=0)
if (germ_level >= INFECTION_LEVEL_TWO) if (germ_level >= INFECTION_LEVEL_TWO)
var/datum/organ/external/parent = owner.get_organ(parent_organ) var/datum/organ/external/parent = owner.get_organ(parent_organ)
if (parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) )) if (parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))