Skip to content

Commit

Permalink
bugfix: Germs Growth Physiology Based (ss220-space#5790)
Browse files Browse the repository at this point in the history
Germs Growth Physiology Based
  • Loading branch information
Gottfrei authored Aug 23, 2024
1 parent 46e5705 commit 18f7139
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 19 deletions.
9 changes: 5 additions & 4 deletions code/datums/diseases/appendicitis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
if(!ruptured && (A.germ_level >= INFECTION_LEVEL_THREE || A.is_dead()))
rupture(H, A)

var/germs_mod = H.dna.species.germs_growth_mod * H.physiology.germs_growth_mod
switch(stage)
if(2)
if(A.germ_level < INFECTION_LEVEL_ONE)
A.germ_level = INFECTION_LEVEL_ONE
A.germ_level += rand(1, 4) * H.dna.species.germs_growth_rate
A.germ_level += rand(1, 4) * germs_mod

if(prob(2))
H.vomit()
Expand All @@ -49,7 +50,7 @@
if(3)
if(A.germ_level < INFECTION_LEVEL_ONE)
A.germ_level = INFECTION_LEVEL_ONE
A.germ_level += rand(2, 6) * H.dna.species.germs_growth_rate
A.germ_level += rand(2, 6) * germs_mod

if(prob(10))
A.internal_receive_damage(1, silent = prob(45))
Expand All @@ -70,7 +71,7 @@

if(A.germ_level < INFECTION_LEVEL_TWO)
A.germ_level = INFECTION_LEVEL_TWO
A.germ_level += rand(4, 10) * H.dna.species.germs_growth_rate
A.germ_level += rand(4, 10) * germs_mod

if(prob(10))
A.internal_receive_damage(2)
Expand All @@ -90,7 +91,7 @@
if(5)
if(A.germ_level < INFECTION_LEVEL_TWO)
A.germ_level = INFECTION_LEVEL_TWO
A.germ_level += rand(6, 12) * H.dna.species.germs_growth_rate
A.germ_level += rand(6, 12) * germs_mod

H.adjustToxLoss(0.5)
if(H.IsSlowed())
Expand Down
5 changes: 3 additions & 2 deletions code/datums/diseases/viruses/advance/symptoms/toxification.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Toxification syndrome
var/mob/living/carbon/human/H = A.affected_mob
if(istype(H))
germs_multiplier = 6 + sqrtor0(25 + A.totalTransmittable()) //~~10 on average
H.dna.species.germs_growth_rate *= germs_multiplier
H.physiology.germs_growth_mod *= germs_multiplier

/datum/symptom/infection/Activate(datum/disease/virus/advance/A)
..()
Expand All @@ -47,4 +47,5 @@ Toxification syndrome
/datum/symptom/infection/End(datum/disease/virus/advance/A)
var/mob/living/carbon/human/H = A.affected_mob
if(germs_multiplier)
H.dna.species.germs_growth_rate /= germs_multiplier
H.physiology.germs_growth_mod /= germs_multiplier

2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/physiology.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

/// Resistance to shocks
var/siemens_coeff = 1
/// How quickly germs are growing
var/germs_growth_mod = 1

/// Multiplier applied to all incapacitating effects (knockdown, stun, weaken, immobilized)
var/stun_mod = 1
Expand Down
7 changes: 4 additions & 3 deletions code/modules/mob/living/carbon/human/species/_species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@

var/digestion_ratio = 1 //How quickly the species digests/absorbs reagents.
var/taste_sensitivity = TASTE_SENSITIVITY_NORMAL //the most widely used factor; humans use a different one
var/germs_growth_rate = 1 //How quickly germs are growing.

var/hunger_icon = 'icons/mob/screen_hunger.dmi'
var/hunger_type
var/hunger_level

var/siemens_coeff = 1 //base electrocution coefficient

var/hazard_high_pressure = HAZARD_HIGH_PRESSURE // Dangerously high pressure.
var/warning_high_pressure = WARNING_HIGH_PRESSURE // High pressure warning.
var/warning_low_pressure = WARNING_LOW_PRESSURE // Low pressure warning.
Expand Down Expand Up @@ -98,6 +95,10 @@
var/heatmod = 1
/// Damage multiplier for being in a cold environment
var/coldmod = 1
/// Base electrocution coefficient
var/siemens_coeff = 1
/// How quickly germs are growing
var/germs_growth_mod = 1
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/// Maximum health of this species
Expand Down
9 changes: 7 additions & 2 deletions code/modules/surgery/organs/organ.dm
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,15 @@
if(germ_level > 0 && germ_level < INFECTION_LEVEL_ONE / 2 && prob(30))
germ_level--

if(!ishuman(owner))
return

var/germs_amount = 1 * (owner.dna.species.germs_growth_mod * owner.physiology.germs_growth_mod)

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(prob(round(germ_level / 6)))
germ_level += owner?.dna.species.germs_growth_rate
germ_level += germs_amount

if(germ_level >= INFECTION_LEVEL_ONE)
var/fever_temperature = (owner.dna.species.heat_level_1 - owner.dna.species.body_temperature - 5) * min(germ_level / INFECTION_LEVEL_TWO, 1) + owner.dna.species.body_temperature
Expand All @@ -259,7 +264,7 @@
var/obj/item/organ/external/parent = owner.get_organ(parent_organ_zone)
//spread germs
if(parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE * 2 || prob(30)))
parent.germ_level += owner?.dna.species.germs_growth_rate
parent.germ_level += germs_amount


/obj/item/organ/proc/rejuvenate()
Expand Down
10 changes: 6 additions & 4 deletions code/modules/surgery/organs/organ_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,8 @@ Note that amputating the affected organ does in fact remove the infection from t
if(germ_level < INFECTION_LEVEL_TWO)
return ..()

var/germs_amount = 1 * (owner.dna.species.germs_growth_mod * owner.physiology.germs_growth_mod)

if(germ_level >= INFECTION_LEVEL_TWO)
//spread the infection to internal organs
var/obj/item/organ/internal/target_organ = null //make internal organs become infected one at a time instead of all at once
Expand All @@ -590,19 +592,19 @@ Note that amputating the affected organ does in fact remove the infection from t
target_organ = safepick(candidate_organs)

if(target_organ)
target_organ.germ_level += owner.dna.species.germs_growth_rate
target_organ.germ_level += germs_amount

//spread the infection to child and parent organs
for(var/obj/item/organ/external/childpart as anything in children)
if(childpart.germ_level < germ_level && !childpart.is_robotic() && (childpart.germ_level < INFECTION_LEVEL_ONE * 2 || prob(30)))
childpart.germ_level += owner.dna.species.germs_growth_rate
childpart.germ_level += germs_amount

if(parent && parent.germ_level < germ_level && !parent.is_robotic() && (parent.germ_level < INFECTION_LEVEL_ONE * 2 || prob(30)))
parent.germ_level += owner.dna.species.germs_growth_rate
parent.germ_level += germs_amount

if(germ_level >= INFECTION_LEVEL_THREE)
necrotize()
germ_level += owner.dna.species.germs_growth_rate
germ_level += germs_amount
owner.adjustToxLoss(1)


Expand Down
10 changes: 6 additions & 4 deletions code/modules/surgery/organs/organ_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,12 @@

/obj/item/organ/internal/handle_germs()
..()
if(germ_level >= INFECTION_LEVEL_TWO)
if(prob(3 * owner.dna.species.germs_growth_rate))
// big message from every 1 damage is not good. If germs growth rate is big, it will spam the chat.
internal_receive_damage(1, silent = prob(30*owner.dna.species.germs_growth_rate))
if(!ishuman(owner))
return
var/germs_mod = owner.dna.species.germs_growth_mod * owner.physiology.germs_growth_mod
if(germ_level >= INFECTION_LEVEL_TWO && prob(3 * germs_mod))
// big message from every 1 damage is not good. If germs growth rate is big, it will spam the chat.
internal_receive_damage(1, silent = prob(30 * germs_mod))


/mob/living/carbon/human/proc/check_infections()
Expand Down

0 comments on commit 18f7139

Please sign in to comment.