diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index c395e3b7143..f49d8f76dfb 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -311,11 +311,11 @@ open = "Open:" switch (e.germ_level) if (150 to 500) - infection = "Infection - Minor:" + infection = "Light Infection:" if (500 to INFECTION_LEVEL_TWO) - infection = "Infection - Severe:" + infection = "Serious Infection:" if (INFECTION_LEVEL_TWO to INFINITY) - infection = "Infection - Septic:" + infection = "Septic:" var/unknown_body = 0 for(var/I in e.implants) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a32724357e2..5ef87cd1e21 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -316,9 +316,6 @@ if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return if(species && (species.flags & NO_BREATHE || species.flags & IS_SYNTHETIC)) return - var/datum/organ/internal/lungs/L = internal_organs["lungs"] - L.process() - var/datum/gas_mixture/environment = loc.return_air() var/datum/gas_mixture/breath @@ -1077,12 +1074,6 @@ if(!(species.flags & IS_SYNTHETIC)) handle_trace_chems() - var/datum/organ/internal/liver/liver = internal_organs["liver"] - liver.process() - - var/datum/organ/internal/eyes/eyes = internal_organs["eyes"] - eyes.process() - updatehealth() return //TODO: DEFERRED diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index fb2a8ccfe12..50c0a7dedfd 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -65,19 +65,10 @@ else E.process() number_wounds += E.number_wounds - //Robotic limb malfunctions - var/malfunction = 0 - if (E.status & ORGAN_ROBOT && prob(E.brute_dam + E.burn_dam)) - malfunction = 1 - - //Broken limbs hurt too - var/broken = 0 - 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 (E.is_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)) @@ -88,36 +79,13 @@ if (W.infection_check()) W.germ_level += 1 - //Special effects for limbs. - if(E.name in list("l_hand","l_arm","r_hand","r_arm")) - var/obj/item/c_hand //Getting what's in this hand - var/hand - if(E.name == "l_hand" || E.name == "l_arm") - c_hand = l_hand - hand = "left hand" - if(E.name == "r_hand" || E.name == "r_arm") - c_hand = r_hand - hand = "right hand" - if (c_hand) - - if(broken) - u_equip(c_hand) - var/emote_scream = pick("screams in pain and", "let's out a sharp hiss and", "cries out and") - emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : emote_scream ] drops what they were holding in their [hand]!") - if(malfunction) - u_equip(c_hand) - emote("me", 1, "drops what they were holding, their [hand] malfunctioning!") - var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() - spark_system.set_up(5, 0, src) - spark_system.attach(src) - spark_system.start() - spawn(10) - del(spark_system) - - else if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying) + if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying) if (!E.is_usable() || malfunction || (broken && !(E.status & ORGAN_SPLINTED))) leg_tally-- // let it fail even if just foot&leg + for(var/datum/organ/internal/I in internal_organs) + I.process() + // standing is poor if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5)) if(species && species.flags & NO_PAIN) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 9c8bed00ab5..711987871a9 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -328,6 +328,7 @@ This function completely restores a damaged organ to perfect condition. if(!(status & ORGAN_BROKEN)) perma_injury = 0 + //Infections update_germs() return @@ -352,23 +353,22 @@ This function completely restores a damaged organ to perfect condition. germ_level++ var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin") - if (antibiotics > 5) + if (germ_level > 0 && antibiotics > 5) if (prob(4*antibiotics)) germ_level-- if(germ_level > INFECTION_LEVEL_ONE) //having an infection raises your body temperature var/temperature_increase = (owner.species.heat_level_1 - owner.species.body_temperature - 1)* min(germ_level/INFECTION_LEVEL_TWO, 1) - owner.bodytemperature += temperature_increase + if (owner.bodytemperature < temperature_increase) + owner.bodytemperature++ if(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 > INFECTION_LEVEL_TWO && antibiotics < 30) //overdosing is necessary to stop severe infections germ_level++ owner.adjustToxLoss(1) - - /* if(germ_level > GANGREN_LEVEL_TERMINAL) if (!(status & ORGAN_DEAD)) @@ -713,6 +713,36 @@ This function completely restores a damaged organ to perfect condition. /datum/organ/external/proc/is_usable() return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) +/datum/organ/external/proc/is_broken() + return ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)) + +/datum/organ/external/proc/is_malfunctioning() + return ((status & ORGAN_ROBOT) && prob(E.brute_dam + E.burn_dam)) + +//for arms and hands +/datum/organ/external/proc/process_grasp(var/obj/item/c_hand, var/hand_name) + if (!c_hand) + return + + if(is_broken()) + owner.u_equip(c_hand) + var/emote_scream = pick("screams in pain and", "lets out a sharp cry and", "cries out and") + owner.emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : emote_scream ] drops what they were holding in their [hand_name]!") + if(is_malfunctioning()) + owner.u_equip(c_hand) + owner.emote("me", 1, "drops what they were holding, their [hand_name] malfunctioning!") + var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread() + spark_system.set_up(5, 0, src) + spark_system.attach(src) + spark_system.start() + spawn(10) + del(spark_system) + +//legs +//returns 1 if this organ can support standing +/datum/organ/external/proc/can_support_standing() + if (!E.is_usable() || malfunction || (broken && !(E.status & ORGAN_SPLINTED))) + /**************************************************** ORGAN DEFINES ****************************************************/ @@ -741,6 +771,10 @@ This function completely restores a damaged organ to perfect condition. max_damage = 50 min_broken_damage = 20 body_part = ARM_LEFT + + process() + ..() + process_grasp(owner.l_hand, "left hand") /datum/organ/external/l_leg name = "l_leg" @@ -758,6 +792,10 @@ This function completely restores a damaged organ to perfect condition. max_damage = 50 min_broken_damage = 20 body_part = ARM_RIGHT + + process() + ..() + process_grasp(owner.r_hand, "right hand") /datum/organ/external/r_leg name = "r_leg" @@ -793,6 +831,10 @@ This function completely restores a damaged organ to perfect condition. max_damage = 30 min_broken_damage = 15 body_part = HAND_RIGHT + + process() + ..() + process_grasp(owner.r_hand, "right hand") /datum/organ/external/l_hand name = "l_hand" @@ -801,6 +843,10 @@ This function completely restores a damaged organ to perfect condition. max_damage = 30 min_broken_damage = 15 body_part = HAND_LEFT + + process() + ..() + process_grasp(owner.l_hand, "left hand") /datum/organ/external/head name = "head" diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index bb1ce19ad2e..e5fd53725e2 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -10,6 +10,7 @@ var/min_broken_damage = 30 var/parent_organ = "chest" var/robotic = 0 //For being a robot + var/germ_level = 0 /datum/organ/internal/proc/rejuvenate() damage=0 @@ -40,7 +41,6 @@ if (!silent) owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1) - /datum/organ/internal/proc/emp_act(severity) switch(robotic) if(0) @@ -96,7 +96,7 @@ owner.drip(10) if(prob(4)) spawn owner.emote("me", 1, "gasps for air!") - owner.losebreath += 5 + owner.losebreath += 15 /datum/organ/internal/liver name = "liver"