diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 3d28944af5..b5e0f9c5c0 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -478,6 +478,7 @@ var/splint = "" var/internal_bleeding = "" var/lung_ruptured = "" + var/o_dead = "" for(var/datum/wound/W in e.wounds) if(W.internal) internal_bleeding = "
Internal bleeding" break @@ -491,6 +492,8 @@ AN = "[e.broken_description]:" if(e.status & ORGAN_ROBOT) robot = "Prosthetic:" + if(e.status & ORGAN_DEAD) + o_dead = "Necrotic:" if(e.open) open = "Open:" switch (e.germ_level) @@ -507,7 +510,7 @@ if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400) infected = "Acute Infection++:" if (INFECTION_LEVEL_THREE to INFINITY) - infected = "Septic:" + infected = "Gangrene Detected:" var/unknown_body = 0 for(var/I in e.implants) @@ -521,19 +524,22 @@ if(!AN && !open && !infected & !imp) AN = "None:" if(!(e.status & ORGAN_DESTROYED)) - dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured]" + dat += "[e.name][e.burn_dam][e.brute_dam][robot][bled][AN][splint][open][infected][imp][internal_bleeding][lung_ruptured][o_dead]" else dat += "[e.name]--Not Found" dat += "" for(var/obj/item/organ/i in occupant.internal_organs) var/mech = "" + var/i_dead = "" if(i.status & ORGAN_ASSISTED) mech = "Assisted:" if(i.robotic >= ORGAN_ROBOT) mech = "Mechanical:" + if(i.status & ORGAN_DEAD) + i_dead = "Necrotic:" var/infection = "None" switch (i.germ_level) - if (1 to INFECTION_LEVEL_ONE + 200) + if (INFECTION_LEVEL_ONE to INFECTION_LEVEL_ONE + 200) infection = "Mild Infection:" if (INFECTION_LEVEL_ONE + 200 to INFECTION_LEVEL_ONE + 300) infection = "Mild Infection+:" @@ -543,11 +549,13 @@ infection = "Acute Infection:" if (INFECTION_LEVEL_TWO + 200 to INFECTION_LEVEL_TWO + 300) infection = "Acute Infection+:" - if (INFECTION_LEVEL_TWO + 300 to INFINITY) + if (INFECTION_LEVEL_TWO + 300 to INFECTION_LEVEL_TWO + 400) infection = "Acute Infection++:" + if (INFECTION_LEVEL_THREE to INFINITY) + infection = "Necrosis Detected:" dat += "" - dat += "[i.name]N/A[i.damage][infection]:[mech]" + dat += "[i.name]N/A[i.damage][infection]:[mech][i_dead]" dat += "" dat += "" if(occupant.sdisabilities & BLIND) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 4d405504a2..0338876627 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -17,6 +17,8 @@ var/damage_this_tick = getToxLoss() for(var/obj/item/organ/external/O in organs) damage_this_tick += O.burn_dam + O.brute_dam + if(O.germ_level) + damage_this_tick += 1 //Just tap it if we have germs so we can process those if(damage_this_tick > last_dam) . = TRUE diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index edc6f6e47f..6514092dfc 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -24,6 +24,19 @@ /obj/item/organ/internal/brain/digitize() replace_self_with(/obj/item/organ/internal/mmi_holder/robot) +/obj/item/organ/internal/brain/handle_germ_effects() + . = ..() //Up should return an infection level as an integer + if(!.) return + + //Bacterial meningitis (more of a spine thing but 'brain infection' isn't a common thing) + if (. >= 1) + if(prob(1)) + owner.custom_pain("Your neck aches, and feels very stiff!",0) + if (. >= 2) + if(prob(1)) + owner.custom_pain("Your feel very dizzy for a moment!",0) + owner.confused = max(owner.confused, 2) + /obj/item/organ/internal/brain/proc/replace_self_with(replace_path) var/mob/living/carbon/human/tmp_owner = owner qdel(src) diff --git a/code/modules/organs/internal/eyes.dm b/code/modules/organs/internal/eyes.dm index 064a668686..2a2b8305d3 100644 --- a/code/modules/organs/internal/eyes.dm +++ b/code/modules/organs/internal/eyes.dm @@ -67,9 +67,22 @@ /obj/item/organ/internal/eyes/process() //Eye damage replaces the old eye_stat var. ..() - if(!owner) - return + if(!owner) return + if(is_bruised()) owner.eye_blurry = 20 if(is_broken()) - owner.eye_blind = 20 \ No newline at end of file + owner.eye_blind = 20 + +/obj/item/organ/internal/eyes/handle_germ_effects() + . = ..() //Up should return an infection level as an integer + if(!.) return + + //Conjunctivitis + if (. >= 1) + if(prob(1)) + owner.custom_pain("The corners of your eyes itch! It's quite frustrating.",0) + if (. >= 2) + if(prob(1)) + owner.custom_pain("Your eyes are watering, making it harder to see clearly for a moment.",1) + owner.eye_blurry += 10 diff --git a/code/modules/organs/internal/heart.dm b/code/modules/organs/internal/heart.dm index 99b7386403..8ca68878e3 100644 --- a/code/modules/organs/internal/heart.dm +++ b/code/modules/organs/internal/heart.dm @@ -5,4 +5,18 @@ icon_state = "heart-on" organ_tag = O_HEART parent_organ = BP_TORSO - dead_icon = "heart-off" \ No newline at end of file + dead_icon = "heart-off" + + +/obj/item/organ/internal/heart/handle_germ_effects() + . = ..() //Up should return an infection level as an integer + if(!.) return + + //Endocarditis (very rare, usually for artificially implanted heart valves/pacemakers) + if (. >= 1) + if(prob(1)) + owner.custom_pain("Your chest feels uncomfortably tight!",0) + if (. >= 2) + if(prob(1)) + owner.custom_pain("A stabbing pain rolls through your chest!",1) + owner.apply_damage(damage = 25, damagetype = HALLOSS, def_zone = parent_organ) diff --git a/code/modules/organs/internal/kidneys.dm b/code/modules/organs/internal/kidneys.dm index 5d3875ccf5..a547a2539f 100644 --- a/code/modules/organs/internal/kidneys.dm +++ b/code/modules/organs/internal/kidneys.dm @@ -8,11 +8,8 @@ parent_organ = BP_GROIN /obj/item/organ/internal/kidneys/process() - ..() - - if(!owner) - return + if(!owner) return // Coffee is really bad for you with busted kidneys. // This should probably be expanded in some way, but fucked if I know @@ -22,4 +19,18 @@ if(is_bruised()) owner.adjustToxLoss(0.1 * PROCESS_ACCURACY) else if(is_broken()) - owner.adjustToxLoss(0.3 * PROCESS_ACCURACY) \ No newline at end of file + owner.adjustToxLoss(0.3 * PROCESS_ACCURACY) + +/obj/item/organ/internal/kidneys/handle_germ_effects() + . = ..() //Up should return an infection level as an integer + if(!.) return + + //Pyelonephritis + if (. >= 1) + if(prob(1)) + owner.custom_pain("There's a stabbing pain in your lower back!",1) + if (. >= 2) + if(prob(1)) + owner.custom_pain("You feel extremely tired, like you can't move!",1) + owner.m_intent = "walk" + owner.hud_used.move_intent.icon_state = "walking" diff --git a/code/modules/organs/internal/liver.dm b/code/modules/organs/internal/liver.dm index c3c2ef6eac..daa0a88f76 100644 --- a/code/modules/organs/internal/liver.dm +++ b/code/modules/organs/internal/liver.dm @@ -7,18 +7,8 @@ parent_organ = BP_GROIN /obj/item/organ/internal/liver/process() - ..() - - if(!owner) - return - - if (germ_level > INFECTION_LEVEL_ONE) - if(prob(1)) - owner << "Your skin itches." - if (germ_level > INFECTION_LEVEL_TWO) - if(prob(1)) - spawn owner.vomit() + if(!owner) return if(owner.life_tick % PROCESS_ACCURACY == 0) @@ -52,4 +42,17 @@ if(filter_effect < 3) owner.adjustToxLoss(owner.chem_effects[CE_ALCOHOL_TOXIC] * 0.1 * PROCESS_ACCURACY) else - take_damage(owner.chem_effects[CE_ALCOHOL_TOXIC] * 0.1 * PROCESS_ACCURACY, prob(1)) // Chance to warn them \ No newline at end of file + take_damage(owner.chem_effects[CE_ALCOHOL_TOXIC] * 0.1 * PROCESS_ACCURACY, prob(1)) // Chance to warn them + +/obj/item/organ/internal/liver/handle_germ_effects() + . = ..() //Up should return an infection level as an integer + if(!.) return + + //Pyogenic Abscess + if (. >= 1) + if(prob(1)) + owner.custom_pain("There's a sharp pain in your upper-right abdomen!",1) + if (. >= 2) + if(prob(1) && owner.getToxLoss() < owner.maxHealth*0.3) + //owner << "" //Toxins provide their own messages for pain + owner.adjustToxLoss(5) //Not realistic to PA but there are basically no 'real' liver infections diff --git a/code/modules/organs/internal/lungs.dm b/code/modules/organs/internal/lungs.dm index ab0b10ddf8..6e4c15f752 100644 --- a/code/modules/organs/internal/lungs.dm +++ b/code/modules/organs/internal/lungs.dm @@ -13,10 +13,6 @@ if(!owner) return - if (germ_level > INFECTION_LEVEL_ONE) - if(prob(5)) - owner.emote("cough") //respitory tract infection - if(is_bruised()) if(prob(4)) spawn owner.emote("me", 1, "coughs up blood!") @@ -29,4 +25,17 @@ var/obj/item/organ/external/parent = owner.get_organ(parent_organ) if(istype(parent)) owner.custom_pain("You feel a stabbing pain in your [parent.name]!", 1) - bruise() \ No newline at end of file + bruise() + +/obj/item/organ/internal/lungs/handle_germ_effects() + . = ..() //Up should return an infection level as an integer + if(!.) return + + //Bacterial pneumonia + if (. >= 1) + if(prob(5)) + owner.emote("cough") + if (. >= 2) + if(prob(1)) + owner.custom_pain("You suddenly feel short of breath and take a sharp, painful breath!",1) + owner.adjustOxyLoss(30) //Look it's hard to simulate low O2 perfusion okay diff --git a/code/modules/organs/internal/organ_internal.dm b/code/modules/organs/internal/organ_internal.dm index edfa5f70b7..a3fdc511fc 100644 --- a/code/modules/organs/internal/organ_internal.dm +++ b/code/modules/organs/internal/organ_internal.dm @@ -47,4 +47,16 @@ if(dead_icon) dead_icon = "[initial(dead_icon)]_assisted" -// Brain is defined in brain.dm \ No newline at end of file +// Brain is defined in brain.dm +/obj/item/organ/internal/handle_germ_effects() + . = ..() //Should be an interger value for infection level + if(!.) return + + var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") + + if(. >= 2 && antibiotics < 5) //INFECTION_LEVEL_TWO + if (prob(3)) + take_damage(1,silent=prob(30)) + + //if(. >= 3 && antibiotics < 30) //INFECTION_LEVEL_THREE, others are handled on each specific organ + //Nothing that generic internal organs do for this diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index ce4103268f..f25339d6ef 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -150,17 +150,22 @@ var/list/organ_cache = list() germ_level++ if(germ_level >= INFECTION_LEVEL_ONE) - var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature - owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature) + . = 1 //Organ qualifies for effect-specific processing + //var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature + //owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature) + var/fever_temperature = owner.species.heat_discomfort_level * 1.10 //Heat discomfort level plus 10% + if(owner.bodytemperature < fever_temperature) + owner.bodytemperature += (fever_temperature - owner.bodytemperature) / 10 //Tries to climb by 10% of the difference between fever and current if (germ_level >= INFECTION_LEVEL_TWO) - var/obj/item/organ/external/parent = owner.get_organ(parent_organ) - //spread germs - if (antibiotics < 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) )) - parent.germ_level++ + . = 2 //Organ qualifies for effect-specific processing + //No particular effect on the general 'organ' at 3 - if (prob(3)) //about once every 30 seconds - take_damage(1,silent=prob(30)) + if (germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) + . = 3 //Organ qualifies for effect-specific processing + germ_level++ //Germ_level increases without overdose of antibiotics + var/sepsis_severity = 1 + round((germ_level - INFECTION_LEVEL_THREE)/100,0.25) //1 Tox plus a little for going over INFECTION_LEVEL_THREE + owner.adjustToxLoss(sepsis_severity) /obj/item/organ/proc/handle_rejection() // Process unsuitable transplants. TODO: consider some kind of diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b5def772b5..7f755a4dff 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -622,13 +622,12 @@ Note that amputating the affected organ does in fact remove the infection from t break //limit increase to a maximum of one per second /obj/item/organ/external/handle_germ_effects() - - if(germ_level < INFECTION_LEVEL_TWO) - return ..() + . = ..() //May be null or an infection level, if null then no specific processing needed here + if(!.) return var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - if(germ_level >= INFECTION_LEVEL_TWO) + if(. >= 2 && antibiotics < 5) //INFECTION_LEVEL_TWO //spread the infection to internal organs var/obj/item/organ/target_organ = null //make internal organs become infected one at a time instead of all at once for (var/obj/item/organ/I in internal_organs) @@ -660,14 +659,13 @@ Note that amputating the affected organ does in fact remove the infection from t 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(. >= 3 && antibiotics < 30) //INFECTION_LEVEL_THREE if (!(status & ORGAN_DEAD)) status |= ORGAN_DEAD owner << "You can't feel your [name] anymore..." owner.update_body(1) - - germ_level++ - owner.adjustToxLoss(1) + for (var/obj/item/organ/external/child in children) + child.germ_level += 110 //Burst of infection from a parent organ becoming necrotic //Updating wounds. Handles wound natural I had some free spachealing, internal bleedings and infections /obj/item/organ/external/proc/update_wounds() diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index e84e39bc95..90567f2363 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -28,6 +28,19 @@ // Give them a new cell. owner.internal_organs_by_name["cell"] = new /obj/item/organ/internal/cell(owner,1) +/obj/item/organ/external/chest/handle_germ_effects() + . = ..() //Should return an infection level + if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. + + //Staph infection symptoms for CHEST + if (. >= 1) + if(prob(.)) + owner.custom_pain("Your [name] [pick("aches","itches","throbs")]!",0) + + if (. >= 2) + if(prob(.)) + owner.custom_pain("A jolt of pain surges through your [name]!",1) + /obj/item/organ/external/groin name = "lower body" organ_tag = BP_GROIN @@ -45,6 +58,19 @@ cannot_amputate = 1 organ_rel_size = 30 +/obj/item/organ/external/groin/handle_germ_effects() + . = ..() //Should return an infection level + if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. + + //Staph infection symptoms for GROIN + if (. >= 1) + if(prob(.)) + owner.custom_pain("Your [name] [pick("aches","itches","throbs")]!",0) + + if (. >= 2) + if(prob(.)) + owner.custom_pain("A jolt of pain surges through your [name]!",1) + /obj/item/organ/external/arm organ_tag = "l_arm" name = "left arm" @@ -60,6 +86,23 @@ force = 7 throwforce = 10 +/obj/item/organ/external/arm/handle_germ_effects() + . = ..() //Should return an infection level + if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. + + //Staph infection symptoms for ARM + if (. >= 1) + if(prob(.)) + owner.custom_pain("Your [name] [pick("aches","itches","throbs")]!",0) + + if (. >= 2) + if(prob(.)) + owner.custom_pain("A jolt of pain surges through your [name]!",1) + if(organ_tag == "l_arm") //Specific level 2 'feature + owner.drop_l_hand() + else if(organ_tag == "r_arm") + owner.drop_r_hand() + /obj/item/organ/external/arm/right organ_tag = "r_arm" name = "right arm" @@ -84,6 +127,20 @@ force = 10 throwforce = 12 +/obj/item/organ/external/leg/handle_germ_effects() + . = ..() //Should return an infection level + if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. + + //Staph infection symptoms for LEG + if (. >= 1) + if(prob(.)) + owner.custom_pain("Your [name] [pick("aches","itches","throbs")]!",0) + + if (. >= 2) + if(prob(.)) + owner.custom_pain("A jolt of pain surges through your [name]!",1) + owner.Weaken(5) + /obj/item/organ/external/leg/right organ_tag = "r_leg" name = "right leg" @@ -114,6 +171,20 @@ owner.drop_from_inventory(owner.shoes) ..() +/obj/item/organ/external/foot/handle_germ_effects() + . = ..() //Should return an infection level + if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. + + //Staph infection symptoms for FOOT + if (. >= 1) + if(prob(.)) + owner.custom_pain("Your [name] [pick("aches","itches","throbs")]!",0) + + if (. >= 2) + if(prob(.)) + owner.custom_pain("A jolt of pain surges through your [name]!",1) + owner.Weaken(5) + /obj/item/organ/external/foot/right organ_tag = "r_foot" name = "right foot" @@ -146,6 +217,23 @@ owner.drop_from_inventory(owner.gloves) ..() +/obj/item/organ/external/hand/handle_germ_effects() + . = ..() //Should return an infection level + if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. + + //Staph infection symptoms for HAND + if (. >= 1) + if(prob(.)) + owner.custom_pain("Your [name] [pick("aches","itches","throbs")]!",0) + + if (. >= 2) + if(prob(.)) + owner.custom_pain("A jolt of pain surges through your [name]!",1) + if(organ_tag == "l_hand") //Specific level 2 'feature + owner.drop_l_hand() + else if(organ_tag == "r_hand") + owner.drop_r_hand() + /obj/item/organ/external/hand/right organ_tag = "r_hand" name = "right hand" @@ -202,6 +290,20 @@ if (burn_dam > 40) disfigure("burn") +/obj/item/organ/external/head/handle_germ_effects() + . = ..() //Should return an infection level + if(!. || (status & ORGAN_DEAD)) return //If it's already above 2, it's become necrotic and we can just not worry about it. + + //Staph infection symptoms for HEAD + if (. >= 1) + if(prob(.)) + owner.custom_pain("Your [name] [pick("aches","itches","throbs")]!",0) + + if (. >= 2) + if(prob(.)) + owner.custom_pain("A jolt of pain surges through your [name]!",1) + owner.eye_blurry += 20 //Specific level 2 'feature + /obj/item/organ/external/head/skrell eye_icon = "skrell_eyes_s"