Changes how organ infections work

This commit is contained in:
Anewbe
2017-11-01 00:14:53 -05:00
parent 396fea0365
commit 08bcfded73
6 changed files with 39 additions and 28 deletions

View File

@@ -56,3 +56,4 @@
#define INFECTION_LEVEL_ONE 100 #define INFECTION_LEVEL_ONE 100
#define INFECTION_LEVEL_TWO 500 #define INFECTION_LEVEL_TWO 500
#define INFECTION_LEVEL_THREE 1000 #define INFECTION_LEVEL_THREE 1000
#define INFECTION_LEVEL_MAX 1500

View File

@@ -18,6 +18,8 @@
return 0 return 0
/obj/item/organ/internal/appendix/process() /obj/item/organ/internal/appendix/process()
..()
if(!inflamed || !owner) if(!inflamed || !owner)
return return

View File

@@ -44,21 +44,6 @@
tmp_owner.internal_organs_by_name[organ_tag] = new replace_path(tmp_owner, 1) tmp_owner.internal_organs_by_name[organ_tag] = new replace_path(tmp_owner, 1)
tmp_owner = null tmp_owner = null
/obj/item/organ/internal/pariah_brain
name = "brain remnants"
desc = "Did someone tread on this? It looks useless for cloning or cyborgification."
organ_tag = "brain"
parent_organ = BP_HEAD
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
vital = 1
/obj/item/organ/internal/brain/xeno
name = "thinkpan"
desc = "It looks kind of like an enormous wad of purple bubblegum."
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
/obj/item/organ/internal/brain/New() /obj/item/organ/internal/brain/New()
..() ..()
health = config.default_brain_health health = config.default_brain_health
@@ -127,6 +112,21 @@
target.key = brainmob.key target.key = brainmob.key
..() ..()
/obj/item/organ/internal/pariah_brain
name = "brain remnants"
desc = "Did someone tread on this? It looks useless for cloning or cyborgification."
organ_tag = "brain"
parent_organ = BP_HEAD
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
vital = 1
/obj/item/organ/internal/brain/xeno
name = "thinkpan"
desc = "It looks kind of like an enormous wad of purple bubblegum."
icon = 'icons/mob/alien.dmi'
icon_state = "chitin"
/obj/item/organ/internal/brain/slime /obj/item/organ/internal/brain/slime
name = "slime core" name = "slime core"
desc = "A complex, organic knot of jelly and crystalline particles." desc = "A complex, organic knot of jelly and crystalline particles."

View File

@@ -9,6 +9,7 @@
/obj/item/organ/internal/kidneys/process() /obj/item/organ/internal/kidneys/process()
..() ..()
if(!owner) return if(!owner) return
// Coffee is really bad for you with busted kidneys. // Coffee is really bad for you with busted kidneys.

View File

@@ -58,5 +58,7 @@
if (prob(3)) if (prob(3))
take_damage(1,silent=prob(30)) take_damage(1,silent=prob(30))
//if(. >= 3 && antibiotics < 30) //INFECTION_LEVEL_THREE, others are handled on each specific organ if(. >= 3 && antibiotics < 30) //INFECTION_LEVEL_THREE
//Nothing that generic internal organs do for this if (prob(50))
take_damage(1,silent=prob(15))

View File

@@ -91,6 +91,9 @@ var/list/organ_cache = list()
if(owner && vital) if(owner && vital)
owner.death() owner.death()
/obj/item/organ/proc/adjust_germ_level(var/amount) // Unless you're setting germ level directly to 0, use this proc instead
germ_level = Clamp(germ_level + amount, 0, INFECTION_LEVEL_MAX)
/obj/item/organ/process() /obj/item/organ/process()
if(loc != owner) if(loc != owner)
@@ -117,9 +120,9 @@ var/list/organ_cache = list()
if(config.organs_decay) damage += rand(1,3) if(config.organs_decay) damage += rand(1,3)
if(damage >= max_damage) if(damage >= max_damage)
damage = max_damage damage = max_damage
germ_level += rand(2,6) adjust_germ_level(rand(2,6))
if(germ_level >= INFECTION_LEVEL_TWO) if(germ_level >= INFECTION_LEVEL_TWO)
germ_level += rand(2,6) adjust_germ_level(rand(2,6))
if(germ_level >= INFECTION_LEVEL_THREE) if(germ_level >= INFECTION_LEVEL_THREE)
die() die()
@@ -158,12 +161,12 @@ var/list/organ_cache = list()
owner.adjustToxLoss(infection_damage) owner.adjustToxLoss(infection_damage)
if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE/2 && prob(30)) if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
germ_level-- adjust_germ_level(-1)
if (germ_level >= INFECTION_LEVEL_ONE/2) 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 //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))) if(antibiotics < 5 && prob(round(germ_level/6)))
germ_level++ adjust_germ_level(1)
if(germ_level >= INFECTION_LEVEL_ONE) if(germ_level >= INFECTION_LEVEL_ONE)
. = 1 //Organ qualifies for effect-specific processing . = 1 //Organ qualifies for effect-specific processing
@@ -179,7 +182,7 @@ var/list/organ_cache = list()
if (germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30) if (germ_level >= INFECTION_LEVEL_THREE && antibiotics < 30)
. = 3 //Organ qualifies for effect-specific processing . = 3 //Organ qualifies for effect-specific processing
germ_level++ //Germ_level increases without overdose of antibiotics adjust_germ_level(rand(5,10)) //Germ_level increases without overdose of antibiotics
/obj/item/organ/proc/handle_rejection() /obj/item/organ/proc/handle_rejection()
// Process unsuitable transplants. TODO: consider some kind of // Process unsuitable transplants. TODO: consider some kind of
@@ -193,13 +196,13 @@ var/list/organ_cache = list()
if(rejecting % 10 == 0) //Only fire every ten rejection ticks. if(rejecting % 10 == 0) //Only fire every ten rejection ticks.
switch(rejecting) switch(rejecting)
if(1 to 50) if(1 to 50)
germ_level++ adjust_germ_level(1)
if(51 to 200) if(51 to 200)
germ_level += rand(1,2) adjust_germ_level(rand(1,2))
if(201 to 500) if(201 to 500)
germ_level += rand(2,3) adjust_germ_level(rand(2,3))
if(501 to INFINITY) if(501 to INFINITY)
germ_level += rand(3,5) adjust_germ_level(rand(3,5))
owner.reagents.add_reagent("toxin", rand(1,2)) owner.reagents.add_reagent("toxin", rand(1,2))
/obj/item/organ/proc/receive_chem(chemical as obj) /obj/item/organ/proc/receive_chem(chemical as obj)
@@ -238,9 +241,11 @@ var/list/organ_cache = list()
if (germ_level < INFECTION_LEVEL_ONE) if (germ_level < INFECTION_LEVEL_ONE)
germ_level = 0 //cure instantly germ_level = 0 //cure instantly
else if (germ_level < INFECTION_LEVEL_TWO) else if (germ_level < INFECTION_LEVEL_TWO)
germ_level -= 6 //at germ_level == 500, this should cure the infection in a minute adjust_germ_level(-6) //at germ_level < 500, this should cure the infection in a minute
else if (germ_level < INFECTION_LEVEL_THREE)
adjust_germ_level(-2) //at germ_level < 1000, this will cure the infection in 5 minutes
else else
germ_level -= 2 //at germ_level == 1000, this will cure the infection in 5 minutes adjust_germ_level(-1) // You waited this long to get treated, you don't really deserve this organ
//Adds autopsy data for used_weapon. //Adds autopsy data for used_weapon.
/obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage) /obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage)