Adjusts the curing of infections

This commit is contained in:
mwerezak
2014-07-06 11:04:12 -04:00
parent f1f9641bb5
commit 267fe55430
3 changed files with 42 additions and 38 deletions

View File

@@ -17,6 +17,25 @@
/datum/organ/proc/get_icon()
return icon('icons/mob/human.dmi',"blank")
//Germs
/datum/organ/proc/get_cure_threshold()
//before reaching level three, the amount of spaceacillin required to cure infections scales between 5 and 30 units
var/germ_scale = max((germ_level - INFECTION_LEVEL_ONE)/(INFECTION_LEVEL_THREE - INFECTION_LEVEL_ONE), 0)
return min(5 + germ_scale*25, 30)
/datum/organ/proc/handle_antibiotics()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (antibiotics <= get_cure_threshold())
return
if (germ_level < INFECTION_LEVEL_ONE)
germ_level = 0 //cure instantly
else if (germ_level < INFECTION_LEVEL_TWO)
germ_level -= 6 //at germ_level == 500, this should cure the infection in a minute
else
germ_level -= 2 //at germ_level == 1000, this will cure the infection in 5 minutes
//Handles chem traces
/mob/living/carbon/human/proc/handle_trace_chems()
//New are added for reagents to random organs.

View File

@@ -379,21 +379,9 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
//** Handle the effects of infections
handle_germ_effects()
/datum/organ/external/proc/handle_antibiotics()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (antibiotics < 5) return
if (germ_level < INFECTION_LEVEL_TWO)
//If the infection has not reached level two then spaceacillin cures the infection instantly
germ_level = 0
else
//If it's a serious infection then it will take a bit of time. At INFECTION_LEVEL_THREE it should take around four minutes.
germ_level -= 2
/datum/organ/external/proc/handle_germ_effects()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
var/cure_threshold = get_cure_threshold()
if(germ_level >= INFECTION_LEVEL_ONE)
//having an infection raises your body temperature
@@ -403,13 +391,13 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i
owner.bodytemperature++
if(prob(round(germ_level/10)))
if (antibiotics < 5)
if (antibiotics < cure_threshold)
germ_level++
if (prob(5)) //adjust this to tweak how fast people take toxin damage from infections
owner.adjustToxLoss(1)
if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < 10) //having 10 units in your system will prevent infections from spreading
if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < cure_threshold - 5) //should start at around 8 units of spaceacillin
//spread the infection
for (var/datum/organ/internal/I in internal_organs)
if (I.germ_level < germ_level)

View File

@@ -41,31 +41,28 @@
germ_level = 0
return
//** Handle antibiotics and curing infections
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Handle antibiotics and curing infections
handle_antibiotics()
if (antibiotics > 5)
if (germ_level < INFECTION_LEVEL_ONE)
germ_level = 0 //cure instantly
else
germ_level -= 2
//** Handle the effects of infections
if (germ_level >= INFECTION_LEVEL_ONE/2)
//aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
if(antibiotics < 5 && prob(round(germ_level/6)))
germ_level++
if(prob(1))
take_damage(1,silent=0)
if (germ_level >= INFECTION_LEVEL_TWO)
var/datum/organ/external/parent = owner.get_organ(parent_organ)
//spread germs
if (antibiotics < 10 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
parent.germ_level++
//** Handle the effects of infections
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (prob(5)) //about once every 20 seconds
take_damage(1,silent=prob(30))
if (germ_level >= INFECTION_LEVEL_ONE/2)
//aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
if(antibiotics < 5 && prob(round(germ_level/6)))
germ_level++
if(prob(1))
take_damage(1,silent=0)
if (germ_level >= INFECTION_LEVEL_TWO)
var/datum/organ/external/parent = owner.get_organ(parent_organ)
//spread germs
if (antibiotics < get_cure_threshold() - 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
parent.germ_level++
if (prob(5)) //about once every 20 seconds
take_damage(1,silent=prob(30))
/datum/organ/internal/proc/take_damage(amount, var/silent=0)