mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Fixes #5532 and increases the time required for organs to become infected from wounds
Also removes the now unnecessary get_cure_threshold() proc, caps the rate at which an organ can receive germs from wounds, and makes germs spread from external to internal organs happen one organ at a time instead of all at once.
This commit is contained in:
@@ -18,16 +18,10 @@
|
||||
return icon('icons/mob/human.dmi',"blank")
|
||||
|
||||
//Germs
|
||||
/datum/organ/proc/get_cure_threshold()
|
||||
//before reaching level three, the amount of spaceacillin required to cure infections scales between 5 and 30 units
|
||||
//var/germ_scale = max((germ_level - INFECTION_LEVEL_ONE)/(INFECTION_LEVEL_THREE - INFECTION_LEVEL_ONE), 0)
|
||||
//return min(5 + germ_scale*25, 30)
|
||||
return 5 //Based on Hubble's suggestion
|
||||
|
||||
/datum/organ/proc/handle_antibiotics()
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if (antibiotics <= get_cure_threshold())
|
||||
if (antibiotics < 5)
|
||||
return
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE)
|
||||
|
||||
@@ -377,13 +377,18 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if (owner.germ_level > W.germ_level && W.infection_check())
|
||||
W.germ_level++
|
||||
|
||||
if (antibiotics < 5)
|
||||
for(var/datum/wound/W in wounds)
|
||||
//Infected wounds raise the organ's germ level
|
||||
if (W.germ_level > germ_level && antibiotics < 5) //Badly infected wounds raise internal germ levels
|
||||
if (W.germ_level > germ_level)
|
||||
germ_level++
|
||||
break //limit increase to a maximum of one per second
|
||||
|
||||
/datum/organ/external/proc/handle_germ_effects()
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
var/cure_threshold = get_cure_threshold()
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE & prob(60)) //this could be an else clause, but it looks cleaner this way
|
||||
germ_level-- //since germ_level increases at a rate of 1 per second with dirty wounds, prob(60) should give us about 5 minutes before level one.
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_ONE)
|
||||
//having an infection raises your body temperature
|
||||
@@ -393,17 +398,29 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
owner.bodytemperature++
|
||||
|
||||
if(prob(round(germ_level/10)))
|
||||
if (antibiotics < cure_threshold)
|
||||
if (antibiotics < 5)
|
||||
germ_level++
|
||||
|
||||
if (prob(3)) //adjust this to tweak how fast people take toxin damage from infections
|
||||
if (prob(5)) //adjust this to tweak how fast people take toxin damage from infections
|
||||
owner.adjustToxLoss(1)
|
||||
|
||||
if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < cure_threshold)
|
||||
if(germ_level >= INFECTION_LEVEL_TWO && antibiotics < 5)
|
||||
//spread the infection
|
||||
var/datum/organ/internal/target_organ //make internal organs become infected one at a time instead of all at once
|
||||
for (var/datum/organ/internal/I in internal_organs)
|
||||
if (I.germ_level > 0 && I.germ_level < min(germ_level, INFECTION_LEVEL_TWO)) //once the organ reaches whatever we can give it, or level two, switch to a different one
|
||||
if (!target_organ || I.germ_level > target_organ.germ_level) //choose the organ with the highest germ_level
|
||||
target_organ = I
|
||||
|
||||
if (!target_organ)
|
||||
//figure out which organs we can spread germs to and pick one at random
|
||||
var/list/candidate_organs = list()
|
||||
for (var/datum/organ/internal/I in internal_organs)
|
||||
if (I.germ_level < germ_level)
|
||||
I.germ_level++
|
||||
candidate_organs += I
|
||||
target_organ = pick(candidate_organs)
|
||||
|
||||
target_organ.germ_level++
|
||||
|
||||
if (children) //To child organs
|
||||
for (var/datum/organ/external/child in children)
|
||||
@@ -470,8 +487,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
// Salving also helps against infection
|
||||
if(W.germ_level > 0 && W.salved && prob(2))
|
||||
W.germ_level = 0
|
||||
W.disinfected = 1
|
||||
W.germ_level = 0
|
||||
|
||||
// sync the organ's damage with its wounds
|
||||
src.update_damages()
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
src.owner = H
|
||||
|
||||
/datum/organ/internal/process()
|
||||
|
||||
//Process infections
|
||||
if (!germ_level)
|
||||
return
|
||||
@@ -48,23 +47,23 @@
|
||||
//** Handle the effects of infections
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE/2 && prob(60))
|
||||
germ_level--
|
||||
|
||||
if (germ_level >= INFECTION_LEVEL_ONE/2)
|
||||
//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=prob(60))
|
||||
|
||||
if (germ_level >= INFECTION_LEVEL_TWO)
|
||||
var/datum/organ/external/parent = owner.get_organ(parent_organ)
|
||||
//spread germs
|
||||
if (antibiotics < get_cure_threshold() && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
|
||||
if (antibiotics < 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
|
||||
parent.germ_level++
|
||||
|
||||
if (prob(3)) //about once every 30 seconds
|
||||
take_damage(1,silent=prob(30))
|
||||
|
||||
|
||||
/datum/organ/internal/proc/take_damage(amount, var/silent=0)
|
||||
if(src.robotic == 2)
|
||||
src.damage += (amount * 0.8)
|
||||
@@ -124,6 +123,11 @@
|
||||
parent_organ = "chest"
|
||||
|
||||
process()
|
||||
..()
|
||||
if (germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(1))
|
||||
owner.emote("cough") //respitory tract infection
|
||||
|
||||
if(is_bruised())
|
||||
if(prob(2))
|
||||
spawn owner.emote("me", 1, "coughs up blood!")
|
||||
@@ -138,6 +142,14 @@
|
||||
var/process_accuracy = 10
|
||||
|
||||
process()
|
||||
..()
|
||||
if (germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(1))
|
||||
owner << "\red Your skin itches."
|
||||
if (germ_level > INFECTION_LEVEL_TWO)
|
||||
if(prob(1))
|
||||
spawn owner.vomit()
|
||||
|
||||
if(owner.life_tick % process_accuracy == 0)
|
||||
if(src.damage < 0)
|
||||
src.damage = 0
|
||||
@@ -180,6 +192,7 @@
|
||||
parent_organ = "head"
|
||||
|
||||
process() //Eye damage replaces the old eye_stat var.
|
||||
..()
|
||||
if(is_bruised())
|
||||
owner.eye_blurry = 20
|
||||
if(is_broken())
|
||||
|
||||
@@ -774,7 +774,7 @@ var/list/RESTRICTED_CAMERA_NETWORKS = list( //Those networks can only be accesse
|
||||
|
||||
#define INFECTION_LEVEL_ONE 100
|
||||
#define INFECTION_LEVEL_TWO 500
|
||||
#define INFECTION_LEVEL_THREE 1500
|
||||
#define INFECTION_LEVEL_THREE 1000
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user