diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index d91a0b73a01..d460cfe642d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -364,7 +364,7 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i return if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs - //Syncing germ levels with external wounds + //** Syncing germ levels with external wounds for(var/datum/wound/W in wounds) //Open wounds can become infected if (owner.germ_level > W.germ_level && W.infection_check()) @@ -374,48 +374,67 @@ player's body, though, antitox and spaceacillin are easy enough to get I doubt i W.germ_level = max(W.germ_level, germ_level) //Wounds get all the germs if (W.germ_level > germ_level) //Badly infected wounds raise internal germ levels germ_level++ + + //** Handle antibiotics and curing infections + handle_antibiotics() - var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - if (germ_level > 0 && antibiotics > 5) - if (prob(4*antibiotics)) germ_level-- //the higher the germ level the more antibiotics you'll need. + //** Handle the effects of infections + handle_germ_effects() - 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_THREE, 1) + owner.species.body_temperature - if (owner.bodytemperature < fever_temperature) - //world << "fever: [owner.bodytemperature] < [fever_temperature], raising temperature." - owner.bodytemperature++ +/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 + - if(prob(round(germ_level/10))) +/datum/organ/external/proc/handle_germ_effects() + var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") + + 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_THREE, 1) + owner.species.body_temperature + if (owner.bodytemperature < fever_temperature) + //world << "fever: [owner.bodytemperature] < [fever_temperature], raising temperature." + owner.bodytemperature++ + + if(prob(round(germ_level/10))) + if (antibiotics < 5) germ_level++ - if (prob(5)) //adjust this to tweak how fast people take toxin damage from infections - owner.adjustToxLoss(1) + + if (prob(5)) //adjust this to tweak how fast people take toxin damage from infections + owner.adjustToxLoss(1) - if(germ_level >= INFECTION_LEVEL_TWO) - //spread the infection - for (var/datum/organ/internal/I in internal_organs) - if (I.germ_level < germ_level) - I.germ_level++ + if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < 10) //having 10 units in your system will prevent infections from spreading + //spread the infection + for (var/datum/organ/internal/I in internal_organs) + if (I.germ_level < germ_level) + I.germ_level++ - if (children) //To child organs - for (var/datum/organ/external/child in children) - if (child.germ_level < germ_level && !(child.status & ORGAN_ROBOT)) - if (child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30)) - child.germ_level++ + if (children) //To child organs + for (var/datum/organ/external/child in children) + if (child.germ_level < germ_level && !(child.status & ORGAN_ROBOT)) + if (child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30)) + child.germ_level++ - if (parent) - if (parent.germ_level < germ_level && !(parent.status & ORGAN_ROBOT)) - if (parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30)) - parent.germ_level++ + if (parent) + if (parent.germ_level < germ_level && !(parent.status & ORGAN_ROBOT)) + if (parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30)) + parent.germ_level++ - if(germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) //overdosing is necessary to stop severe infections - if (!(status & ORGAN_DEAD)) - status |= ORGAN_DEAD - owner << "You can't feel your [display_name] anymore..." - - germ_level++ - owner.adjustToxLoss(1) + if(germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) //overdosing is necessary to stop severe infections + if (!(status & ORGAN_DEAD)) + status |= ORGAN_DEAD + owner << "You can't feel your [display_name] anymore..." + germ_level++ + owner.adjustToxLoss(1) //Updating wounds. Handles wound natural I had some free spachealing, internal bleedings and infections /datum/organ/external/proc/update_wounds() diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 0cc7870ce60..6269d4471b4 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -42,21 +42,27 @@ germ_level = 0 return + //** Handle antibiotics and curing infections var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - if (germ_level > 0 && antibiotics > 5) - if (prob(4*antibiotics)) germ_level-- - if (antibiotics > 30) germ_level-- + 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) - if(prob(round(germ_level/6))) //aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes + //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) - if (parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) )) + //spread germs + if (antibiotics < 10 && 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