diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index f9ae22af113..46f6be8f2b8 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -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. diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b2090af49b8..f494269e098 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -381,21 +381,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 @@ -405,13 +393,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) diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 7e8e58932c1..4678d89c24d 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -42,31 +42,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 + var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - //** 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_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++ + 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)) + if (prob(5)) //about once every 20 seconds + take_damage(1,silent=prob(30)) /datum/organ/internal/proc/take_damage(amount, var/silent=0)