Infection code improvement WIP

This commit is contained in:
Arokha Sieyes
2017-02-27 16:27:34 -05:00
parent 8d82920e52
commit 9ef7496545
12 changed files with 238 additions and 48 deletions
+13
View File
@@ -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)
+16 -3
View File
@@ -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
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
+15 -1
View File
@@ -5,4 +5,18 @@
icon_state = "heart-on"
organ_tag = O_HEART
parent_organ = BP_TORSO
dead_icon = "heart-off"
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)
+16 -5
View File
@@ -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)
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"
+15 -12
View File
@@ -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 << "<span class='danger'>Your skin itches.</span>"
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
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
+14 -5
View File
@@ -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()
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
+13 -1
View File
@@ -47,4 +47,16 @@
if(dead_icon)
dead_icon = "[initial(dead_icon)]_assisted"
// Brain is defined in brain.dm
// 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