From 771389f871e2d27da36770c0d24ce8db51f18c5c Mon Sep 17 00:00:00 2001 From: Chinsky Date: Wed, 31 Oct 2012 14:36:09 +0400 Subject: [PATCH] Added warning messages before vomiting. You have in total two warnings and to react now. --- code/datums/diseases/appendicitis.dm | 11 ++------- code/modules/mob/living/carbon/human/human.dm | 24 ++++++++++++++++++- code/modules/mob/living/carbon/human/life.dm | 18 +------------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm index c87d435e763..79374d24788 100644 --- a/code/datums/diseases/appendicitis.dm +++ b/code/datums/diseases/appendicitis.dm @@ -32,15 +32,8 @@ if(3) if(prob(1)) if (affected_mob.nutrition > 100) - affected_mob.Stun(rand(4,6)) - for(var/mob/O in viewers(world.view, affected_mob)) - O.show_message(text("\red [] throws up!", affected_mob), 1) - playsound(affected_mob.loc, 'sound/effects/splat.ogg', 50, 1) - var/turf/location = affected_mob.loc - if (istype(location, /turf/simulated)) - location.add_vomit_floor(affected_mob) - affected_mob.nutrition -= 95 - affected_mob.adjustToxLoss(-1) + var/mob/living/carbon/human/H = affected_mob + H.vomit() else affected_mob << "\red You gag as you want to throw up, but there's nothing in your stomach!" affected_mob.Weaken(10) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ff330fde1ba..0f74acea11f 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -805,4 +805,26 @@ xylophone = 1 spawn(1200) xylophone=0 - return \ No newline at end of file + return + +/mob/living/carbon/human/proc/vomit() + if(!lastpuke) + lastpuke = 1 + src << "You feel nauseous..." + spawn(150) //15 seconds until second warning + src << "You feel like you are about to throw up!" + spawn(100) //and you have 10 more for mad dash to the bucket + Stun(5) + + src.visible_message("[src] throws up!","You throw up!") + playsound(loc, 'sound/effects/splat.ogg', 50, 1) + + var/turf/location = loc + if (istype(location, /turf/simulated)) + location.add_vomit_floor(src, 1) + + nutrition -= 40 + adjustToxLoss(-3) + spawn(350) //wait 35 seconds before next volley + lastpuke = 0 + diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index f3a0bdebce9..2b622c495be 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1400,23 +1400,7 @@ // Puke if toxloss is too high if(!stat) if (getToxLoss() >= 45 && nutrition > 20) - lastpuke ++ - if(lastpuke >= 25) // about 25 second delay I guess - Stun(5) - - for(var/mob/O in viewers(world.view, src)) - O.show_message(text("\red [] throws up!", src), 1) - playsound(loc, 'sound/effects/splat.ogg', 50, 1) - - var/turf/location = loc - if (istype(location, /turf/simulated)) - location.add_vomit_floor(src, 1) - - nutrition -= 20 - adjustToxLoss(-3) - - // make it so you can only puke so fast - lastpuke = 0 + vomit() //0.1% chance of playing a scary sound to someone who's in complete darkness if(isturf(loc) && rand(1,1000) == 1)