diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 351216b8bf8..3253f272d0e 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -10,7 +10,7 @@ var/last_bumped = 0 var/pass_flags = 0 var/throwpass = 0 - var/germ_level = 0 // The higher the germ level, the more germ on the atom. + var/germ_level = GERM_LEVEL_AMBIENT // The higher the germ level, the more germ on the atom. ///Chemistry. var/datum/reagents/reagents = null diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0e6d130a568..441af0673d3 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1,3 +1,10 @@ +/mob/living/carbon/Life() + ..() + + // Increase germ_level regularly + if(germ_level < GERM_LEVEL_AMBIENT) //if you're just standing there, you shouldn't get more germs beyond an ambient level + germ_level++ //increase by 1 per second + /mob/living/carbon/Move(NewLoc, direct) . = ..() if(.) @@ -7,6 +14,10 @@ src.nutrition -= HUNGER_FACTOR/10 if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360) src.bodytemperature += 2 + + // Moving around increases germ_level faster + if(germ_level < GERM_LEVEL_MOVE_CAP && prob(1)) + germ_level++ /mob/living/carbon/relaymove(var/mob/user, direction) if(user in src.stomach_contents) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 9cc0e22dfc8..ad2bd377db8 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -284,8 +284,8 @@ var/this_wound_desc = W.desc if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]" else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]" - if(W.germ_level > 1000) this_wound_desc = "badly infected [this_wound_desc]" - else if(W.germ_level > 100) this_wound_desc = "lightly infected [this_wound_desc]" + if(W.germ_level > GANGREN_LEVEL_TWO) this_wound_desc = "badly infected [this_wound_desc]" + else if(W.germ_level > 330) this_wound_desc = "lightly infected [this_wound_desc]" if(this_wound_desc in wound_descriptors) wound_descriptors[this_wound_desc] += W.amount continue diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 2640f85819e..c7cbbf5965f 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1215,14 +1215,11 @@ if(druggy) druggy = max(druggy-1, 0) -/* - // Increase germ_level regularly - if(prob(40)) - germ_level += 1 + // If you're dirty, your gloves will become dirty, too. if(gloves && germ_level > gloves.germ_level && prob(10)) gloves.germ_level += 1 -*/ + return 1 proc/handle_regular_hud_updates() diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 953676585b2..13823602b76 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -72,12 +72,18 @@ if(E.status & ORGAN_BROKEN && !(E.status & ORGAN_SPLINTED) ) broken = 1 + if (!lying && world.time - l_move_time < 15) //Moving around with fractured ribs won't do you any good - if (broken && E.internal_organs && prob(15)) - if (!lying && world.time - l_move_time < 15) + if (broken && E.internal_organs && prob(15)) var/datum/organ/internal/I = pick(E.internal_organs) custom_pain("You feel broken bones moving in your [E.display_name]!", 1) I.take_damage(rand(3,5)) + + //Moving makes open wounds get infected much faster + if (E.wounds.len) + for(var/datum/wound/W in E.wounds) + if (W.can_infect()) + W.germ_level += 1 //Special effects for limbs. if(E.name in list("l_hand","l_arm","r_hand","r_arm")) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index acd9efcb659..992bf8ed7f1 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -295,7 +295,10 @@ This function completely restores a damaged organ to perfect condition. if(last_dam != brute_dam + burn_dam) // Process when we are fully healed up. last_dam = brute_dam + burn_dam return 1 - last_dam = brute_dam + burn_dam + else + last_dam = brute_dam + burn_dam + if(germ_level > GANGREN_LEVEL_ONE) + return 1 return 0 /datum/organ/external/process() @@ -331,31 +334,34 @@ This function completely restores a damaged organ to perfect condition. return //Updating germ levels. Handles organ germ levels and necrosis. -#define GANGREN_LEVEL_ONE 100 -#define GANGREN_LEVEL_TWO 1000 -#define GANGREN_LEVEL_TERMINAL 2500 -#define GERM_TRANSFER_AMOUNT germ_level/500 +//#define GERM_TRANSFER_AMOUNT germ_level/500 /datum/organ/external/proc/update_germs() - if(status & ORGAN_ROBOT|ORGAN_DESTROYED) //Robotic limbs shouldn't be infected, nor should nonexistant limbs. + if(status & (ORGAN_ROBOT|ORGAN_DESTROYED)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs. germ_level = 0 return - if(germ_level > 0 && owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs + if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs //Syncing germ levels with external wounds for(var/datum/wound/W in wounds) - if(!W.bandaged && !W.salved) - 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++ - - if(germ_level > GANGREN_LEVEL_ONE && prob(round(germ_level/100))) - germ_level++ - owner.adjustToxLoss(1) + //Open wounds can become infected + if (owner.germ_level > W.germ_level && W.can_infect()) + W.germ_level++ + + //Infected wounds raise the organ's germ level + 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++ if(germ_level > GANGREN_LEVEL_TWO) germ_level++ owner.adjustToxLoss(1) + + else if(germ_level > GANGREN_LEVEL_ONE && prob(round(germ_level/10))) //aiming for a light infection to become serious after 40 minutes, standing still + germ_level += 1 + owner.adjustToxLoss(1) + + /* if(germ_level > GANGREN_LEVEL_TERMINAL) if (!(status & ORGAN_DEAD)) diff --git a/code/setup.dm b/code/setup.dm index 3c190f1e2ad..9cb3645c795 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -765,4 +765,12 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse //Shuttle moving status #define SHUTTLE_IDLE 0 #define SHUTTLE_WARMUP 1 -#define SHUTTLE_INTRANSIT 2 \ No newline at end of file +#define SHUTTLE_INTRANSIT 2 + +//Germs and infection +//These numbers have been calculated so that an untreated cut will become a serious infection after 50 minutes. +#define GERM_LEVEL_AMBIENT 120 //maximum germ level you can reach by standing still +#define GERM_LEVEL_MOVE_CAP 300 //maximum germ level you can reach by running around +#define GANGREN_LEVEL_ONE 50 +#define GANGREN_LEVEL_TWO 1000 +#define GANGREN_LEVEL_TERMINAL 2500