From d1c11c3a0a3d09cf16f05bceeee776c9bbdea3f9 Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Sat, 7 Dec 2013 03:53:10 -0500 Subject: [PATCH] First iteration of corpse decay --- code/modules/awaymissions/corpse.dm | 2 +- .../mob/living/carbon/human/examine.dm | 9 ++++++- .../mob/living/carbon/human/human_defines.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 26 +++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm index e14f42197d6..6ce3fa8fd0f 100644 --- a/code/modules/awaymissions/corpse.dm +++ b/code/modules/awaymissions/corpse.dm @@ -29,7 +29,7 @@ createCorpse() /obj/effect/landmark/corpse/proc/createCorpse() //Creates a mob and checks for gear in each slot before attempting to equip it. - var/mob/living/carbon/human/M = new /mob/living/carbon/human (src.loc) + var/mob/living/carbon/human/human/M = new /mob/living/carbon/human/human (src.loc) M.dna.mutantrace = mutantrace M.real_name = src.name M.death(1) //Kills the new mob diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 46a58f79a65..d82c10847ce 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -393,7 +393,14 @@ msg += "[src] has \a [implant] sticking out of their flesh!\n" if(digitalcamo) msg += "[t_He] [t_is] repulsively uncanny!\n" - + if(decaylevel == 1) + msg += "[t_He] [t_is] starting to smell.\n" + if(decaylevel == 2) + msg += "[t_He] [t_is] bloated and smells disgusting.\n" + if(decaylevel == 3) + msg += "[t_He] [t_is] rotting and blackened, the skin sloughing off. The smell is indescribably foul.\n" + if(decaylevel == 4) + msg += "[t_He] [t_is] mostly dessicated now, with only bones remaining of what used to be a person.\n" if(hasHUD(usr,"security")) var/perpname = "wot" diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 482766ab563..65aa5adbf9f 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -55,5 +55,5 @@ var/mob/remoteview_target = null var/meatleft = 3 //For chef item - + var/decaylevel = 0 // For rotting bodies var/slime_color = "blue" //For slime people this defines their color, it's blue by default to pay tribute to the old icons \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 9d60fc92bcf..e75381dd986 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -102,6 +102,9 @@ handle_medical_side_effects() + if(stat == DEAD) + handle_decay() + handle_stasis_bag() //Handle temperature/pressure differences between body and environment @@ -1556,6 +1559,29 @@ return temp + proc/handle_decay() + var/decaytime = world.time - timeofdeath + + if(decaytime <= 6000) //10 minutes for decaylevel1 -- stinky + return + + if(decaytime > 6000 <= 12000)//20 minutes for decaylevel2 -- bloated and very stinky + decaylevel = 1 + + if(decaytime > 12000 <= 18000)//30 minutes for decaylevel3 -- rotting and gross + decaylevel = 2 + + if(decaytime > 18000 <= 27000)//45 minutes for decaylevel4 -- skeleton + decaylevel = 3 + if(decaytime > 27000) + decaylevel = 4 + return + + for(var/mob/living/carbon/human/H in range(decaylevel, src)) + if(prob(5)) + if(airborne_can_reach(get_turf(src), get_turf(H))) + H << "You smell something foul..." + H.vomit() #undef HUMAN_MAX_OXYLOSS #undef HUMAN_CRIT_MAX_OXYLOSS