diff --git a/code/datums/diseases/advance/symptoms/vomit.dm b/code/datums/diseases/advance/symptoms/vomit.dm index 1f62065ef99..a793b34589a 100644 --- a/code/datums/diseases/advance/symptoms/vomit.dm +++ b/code/datums/diseases/advance/symptoms/vomit.dm @@ -31,7 +31,7 @@ Bonus /datum/symptom/vomit/Activate(var/datum/disease/advance/A) ..() if(prob(SYMPTOM_ACTIVATION_PROB / 2)) - var/mob/living/M = A.affected_mob + var/mob/living/carbon/M = A.affected_mob switch(A.stage) if(1, 2, 3, 4) M << "[pick("You feel nauseous.", "You feel like you're going to throw up!")]" @@ -40,16 +40,8 @@ Bonus return -/datum/symptom/vomit/proc/Vomit(var/mob/living/M) - - M.visible_message("[M] vomits on the floor!") - - M.nutrition -= 20 - M.adjustToxLoss(-3) - - var/turf/pos = get_turf(M) - pos.add_vomit_floor(M) - playsound(pos, 'sound/effects/splat.ogg', 50, 1) +/datum/symptom/vomit/proc/Vomit(var/mob/living/carbon/M) + M.vomit()//This function is in mob_helpers /* ////////////////////////////////////// diff --git a/code/datums/diseases/appendicitis.dm b/code/datums/diseases/appendicitis.dm index 37a2adecb6f..10942d6a4b3 100644 --- a/code/datums/diseases/appendicitis.dm +++ b/code/datums/diseases/appendicitis.dm @@ -33,13 +33,8 @@ affected_mob.adjustToxLoss(1) if(stage > 2) if(prob(1)) - if (affected_mob.nutrition > 100) - 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) - affected_mob.adjustToxLoss(3) + var/mob/living/carbon/human/H = affected_mob + H.delayed_vomit() if(stage > 3) if(prob(1) && ishuman(affected_mob)) var/mob/living/carbon/human/H = affected_mob diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index e3b6f36bc93..c7b2da7ec3c 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -751,7 +751,7 @@ xylophone=0 return -/mob/living/carbon/human/proc/vomit() +/mob/living/carbon/human/proc/delayed_vomit() if(species.flags & IS_SYNTHETIC) return //Machines don't throw up. @@ -762,17 +762,7 @@ 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) + vomit()//Vomit function is in mob helpers 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 19e13fe4306..8d7dfac05ef 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1459,8 +1459,8 @@ proc/handle_random_events() // Puke if toxloss is too high if(!stat) - if (getToxLoss() >= 45 && nutrition > 20) - vomit() + if (getToxLoss() >= 45) + delayed_vomit() //0.1% chance of playing a scary sound to someone who's in complete darkness if(isturf(loc) && rand(1,1000) == 1) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 3e3a3d1b96a..997c78c5519 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -690,4 +690,31 @@ proc/is_blind(A) return 0 return 1 +/mob/living/carbon/proc/vomit() + var/canVomit = 0 + var/mob/living/carbon/human/H + if (istype(src, /mob/living/carbon/human)) + H = src + if (H.ingested.total_volume > 0) + canVomit = 1 + + if (nutrition > 150) + canVomit = 1 + + if(canVomit) + Stun(4) + src.visible_message("[src] vomits!","You vomit!") + 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 + if (istype(src, /mob/living/carbon/human)) + ingested.trans_to_turf(location,30)//Vomiting empties the stomach, transferring 30u reagents to the floor where you vomited + else + src.visible_message("[src] retches, attempting to vomit!","You gag and collapse as you feel the urge to vomit, but there's nothing in your stomach!") + Weaken(4) + #undef SAFE_PERP diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index 49c28b605c0..554ba04ae9a 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -112,7 +112,7 @@ owner << "\red Your skin itches." if (germ_level > INFECTION_LEVEL_TWO) if(prob(1)) - spawn owner.vomit() + spawn owner.delayed_vomit() if(owner.life_tick % PROCESS_ACCURACY == 0) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm index 59462ac0518..bf05039efeb 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm @@ -506,3 +506,24 @@ if(dose > 10) M.make_dizzy(5) M.make_jittery(5) + +/datum/reagent/ipecac + name = "Ipecac" + id = "ipecac" + description = "A simple emetic, Induces vomiting in the patient, emptying stomach contents" + reagent_state = LIQUID + color = "#280f0b" + overdose = REAGENTS_OVERDOSE + scannable = 1 + + +/datum/reagent/ipecac/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) + if (prob(10+dose)) + M << pick("You feel nauseous", "Ugghh....", "Your stomach churns uncomfortably", "You feel like you're about to throw up", "You feel queasy","You feel pressure in your abdomen") + + if (prob(dose)) + M.vomit() + + +/datum/reagent/ipecac/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) + M.adjustToxLoss(2 * removed) //If you inject it you're doing it wrong \ No newline at end of file diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index b545a631997..3f0e7fa7936 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -274,6 +274,13 @@ required_reagents = list("oxygen" = 1, "anti_toxin" = 1, "carbon" = 1) result_amount = 3 +/datum/chemical_reaction/ipecac + name = "Ipecac" + id = "ipecac" + result = "ipecac" + required_reagents = list("hydrogen" = 1, "anti_toxin" = 1, "ethanol" = 1) + result_amount = 3 + /datum/chemical_reaction/soporific name = "Soporific" id = "stoxin" diff --git a/html/changelogs/Nanako-PR-365.yml b/html/changelogs/Nanako-PR-365.yml new file mode 100644 index 00000000000..6f52a185ce7 --- /dev/null +++ b/html/changelogs/Nanako-PR-365.yml @@ -0,0 +1,39 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Nanako + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - tweak: "All sources of vomiting now work the same way" + - rscadd: "Vomiting now removes 30u of reagents from your stomach and splashes them on the floor" + - tweak: "Vomiting now doesn't work if your stomach is empty" + - rscadd: "Added Ipecac, an emetic medicine to induce vomiting when given orally. Made from dylovene, ethanol and hydrogen 1:1:1"