From a7060641bb0165a7531a3cee007989d9e95741ee Mon Sep 17 00:00:00 2001 From: san7890 Date: Mon, 11 Sep 2023 15:39:16 -0600 Subject: [PATCH] Converts `vomit()` to use bitflags (#78191) ## About The Pull Request Having seven trillion boolean arguments isn't kino nor poggerchampion, let's adjust it so we use a define flag-based system that works really nice. I also cleaned up a lot of jank and stuff that simply just never was meant to work. We also had sprites for nanite vomit, but this was completely unused! Since we still have an interaction where you're meant to throw up nanites, I added that it so it could be leveraged. Neato. ## Why It's Good For The Game Much easier to pass in the right args or special args to a high-profile proc. ## Changelog :cl: image: When you throw up nanites, your vomit should now be appropriately nanite-colored. /:cl: Let me know if I glonked anything. --------- Co-authored-by: Jacquerel --- code/__DEFINES/mobs.dm | 22 +++++--- code/datums/brain_damage/mild.dm | 2 +- .../datums/diseases/advance/symptoms/vomit.dm | 16 ++++-- code/datums/diseases/chronic_illness.dm | 4 +- .../diseases/death_sandwich_poisoning.dm | 2 +- code/datums/diseases/heart_failure.dm | 2 +- code/datums/diseases/parasitic_infection.dm | 2 +- code/datums/diseases/tuberculosis.dm | 2 +- code/datums/dna.dm | 2 +- .../quirks/negative_quirks/negative_quirks.dm | 2 +- code/datums/status_effects/debuffs/choke.dm | 2 +- code/datums/status_effects/debuffs/drunk.dm | 2 +- code/datums/voice_of_god_command.dm | 2 +- .../dna_infuser/organ_sets/fly_organs.dm | 2 +- code/game/machinery/pipe/construction.dm | 2 +- .../objects/effects/decals/cleanable/misc.dm | 14 ++++++ code/game/objects/items.dm | 2 +- code/game/objects/items/toys.dm | 2 +- code/game/objects/structures/toiletbong.dm | 2 +- code/game/turfs/turf.dm | 29 ++++------- .../abductor/equipment/glands/heal.dm | 18 ++++--- .../abductor/equipment/glands/plasma.dm | 2 +- .../abductor/equipment/glands/slime.dm | 2 +- .../antagonists/changeling/powers/panacea.dm | 2 +- .../heretic/status_effects/debuffs.dm | 2 +- .../antagonists/wizard/equipment/artefact.dm | 2 +- code/modules/mob/emote.dm | 2 +- .../regal_rat/regal_rat_actions.dm | 4 +- code/modules/mob/living/carbon/carbon.dm | 50 +++++++++++++------ .../mob/living/carbon/human/_species.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 21 ++++---- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/mob/living/carbon/life.dm | 4 +- .../reagents/drinks/alcohol_reagents.dm | 2 +- .../chemistry/reagents/drug_reagents.dm | 2 +- .../chemistry/reagents/food_reagents.dm | 2 +- .../chemistry/reagents/medicine_reagents.dm | 4 +- .../chemistry/reagents/other_reagents.dm | 7 ++- .../chemistry/reagents/toxin_reagents.dm | 9 +++- .../reagents/chemistry/recipes/others.dm | 2 +- code/modules/religion/rites.dm | 2 +- .../xenobiology/crossbreeding/consuming.dm | 2 +- .../organs/internal/appendix/_appendix.dm | 2 +- .../surgery/organs/internal/liver/_liver.dm | 8 +-- .../surgery/organs/internal/lungs/_lungs.dm | 4 +- .../organs/internal/stomach/_stomach.dm | 8 +-- 46 files changed, 171 insertions(+), 111 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index bd9f43c488d..3a32b6a6543 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -856,12 +856,22 @@ GLOBAL_LIST_INIT(layers_to_offset, list( /// Get the client from the var #define CLIENT_FROM_VAR(I) (ismob(I) ? I:client : (istype(I, /client) ? I : (istype(I, /datum/mind) ? I:current?:client : null))) -/// The mob will vomit a green color -#define VOMIT_TOXIC 1 -/// The mob will vomit a purple color -#define VOMIT_PURPLE 2 -/// The mob will vomit a nebula color -#define VOMIT_NEBULA 3 +// Various flags for carbon mob vomiting +/// Flag which makes a message send about the vomiting. +#define MOB_VOMIT_MESSAGE (1<<0) +/// Flag which makes the mob get stunned upon vomiting. +#define MOB_VOMIT_STUN (1<<1) +/// Flag which makes the mob incur damage upon vomiting. +#define MOB_VOMIT_HARM (1<<2) +/// Flag which makes the mob vomit blood +#define MOB_VOMIT_BLOOD (1<<3) +/// Flag which will make the proc skip certain checks when it comes to forcing a vomit. +#define MOB_VOMIT_FORCE (1<<4) + +/// The default "vomit" color green, which will ultinately give you might typically expect to happen when you vomit. +#define VOMIT_CATEGORY_DEFAULT (MOB_VOMIT_MESSAGE | MOB_VOMIT_STUN | MOB_VOMIT_HARM) +/// The green vomit you've all come to know and love, but with a little extra "spice" (blood) +#define VOMIT_CATEGORY_BLOOD (VOMIT_CATEGORY_DEFAULT | MOB_VOMIT_BLOOD) /// Possible value of [/atom/movable/buckle_lying]. If set to a different (positive-or-zero) value than this, the buckling thing will force a lying angle on the buckled. #define NO_BUCKLE_LYING -1 diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm index 83a62653795..c3d06976ed5 100644 --- a/code/datums/brain_damage/mild.dm +++ b/code/datums/brain_damage/mild.dm @@ -89,7 +89,7 @@ if(SPT_PROB(2.5, seconds_per_tick)) switch(rand(1,11)) if(1) - owner.vomit() + owner.vomit(VOMIT_CATEGORY_DEFAULT) if(2,3) owner.adjust_dizzy(20 SECONDS) if(4,5) diff --git a/code/datums/diseases/advance/symptoms/vomit.dm b/code/datums/diseases/advance/symptoms/vomit.dm index 72558f69ba9..ee695ffd5bc 100644 --- a/code/datums/diseases/advance/symptoms/vomit.dm +++ b/code/datums/diseases/advance/symptoms/vomit.dm @@ -53,11 +53,21 @@ and your disease can spread via people walking on vomit. else vomit(M) -/datum/symptom/vomit/proc/vomit(mob/living/carbon/M) +/datum/symptom/vomit/proc/vomit(mob/living/carbon/vomiter) + var/deductable_nutrition = 0 + var/constructed_flags = (MOB_VOMIT_MESSAGE | MOB_VOMIT_HARM) + var/type_of_vomit = /obj/effect/decal/cleanable/vomit/toxic if(vomit_nebula) - M.vomit(lost_nutrition = 10, blood = vomit_blood, vomit_type = VOMIT_NEBULA, stun = FALSE, distance = proj_vomit) + type_of_vomit = /obj/effect/decal/cleanable/vomit/nebula + deductable_nutrition = 10 else - M.vomit(lost_nutrition = 20, blood = vomit_blood, distance = proj_vomit) + constructed_flags |= MOB_VOMIT_STUN + deductable_nutrition = 20 + + if(vomit_blood) + constructed_flags |= MOB_VOMIT_BLOOD + + vomiter.vomit(vomit_flags = constructed_flags, vomit_type = type_of_vomit, lost_nutrition = deductable_nutrition, distance = proj_vomit) /datum/symptom/vomit/nebula name = "Nebula Vomiting" diff --git a/code/datums/diseases/chronic_illness.dm b/code/datums/diseases/chronic_illness.dm index f3c2285cd7e..77c162d6d85 100644 --- a/code/datums/diseases/chronic_illness.dm +++ b/code/datums/diseases/chronic_illness.dm @@ -34,7 +34,7 @@ if(SPT_PROB(0.5, seconds_per_tick)) to_chat(affected_mob, span_danger("You feel a very sharp pain in your chest!")) if(prob(45)) - affected_mob.vomit(20,TRUE) + affected_mob.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 20) if(SPT_PROB(0.5, seconds_per_tick)) to_chat(affected_mob, span_userdanger("[pick("You feel your heart slowing...", "You relax and slow your heartbeat.")]")) affected_mob.adjustStaminaLoss(70, FALSE) @@ -49,7 +49,7 @@ if(SPT_PROB(1, seconds_per_tick)) to_chat(affected_mob, span_danger("You feel a gruesome pain in your chest!")) if(prob(75)) - affected_mob.vomit(45,TRUE) + affected_mob.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 45) if(SPT_PROB(1, seconds_per_tick)) affected_mob.adjustStaminaLoss(100, FALSE) affected_mob.visible_message(span_warning("[affected_mob] collapses!")) diff --git a/code/datums/diseases/death_sandwich_poisoning.dm b/code/datums/diseases/death_sandwich_poisoning.dm index 5d52ac7281c..f865f4fb5be 100644 --- a/code/datums/diseases/death_sandwich_poisoning.dm +++ b/code/datums/diseases/death_sandwich_poisoning.dm @@ -47,7 +47,7 @@ if(SPT_PROB(10, seconds_per_tick)) affected_mob.emote("gasp") if(SPT_PROB(2.5, seconds_per_tick)) - affected_mob.vomit(20, TRUE) + affected_mob.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 20) if(SPT_PROB(2.5, seconds_per_tick)) to_chat(affected_mob, span_danger("Your body feels hot!")) if(prob(60)) diff --git a/code/datums/diseases/heart_failure.dm b/code/datums/diseases/heart_failure.dm index 1a4f05bfb8a..45d4e6672fb 100644 --- a/code/datums/diseases/heart_failure.dm +++ b/code/datums/diseases/heart_failure.dm @@ -48,7 +48,7 @@ if(SPT_PROB(1.5, seconds_per_tick)) to_chat(affected_mob, span_danger("You feel a sharp pain in your chest!")) if(prob(25)) - affected_mob.vomit(95) + affected_mob.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 95) affected_mob.emote("cough") affected_mob.Paralyze(40) affected_mob.losebreath += 4 diff --git a/code/datums/diseases/parasitic_infection.dm b/code/datums/diseases/parasitic_infection.dm index 8eb7f9f2b19..64bb59f01fd 100644 --- a/code/datums/diseases/parasitic_infection.dm +++ b/code/datums/diseases/parasitic_infection.dm @@ -41,7 +41,7 @@ affected_mob.adjust_nutrition(-12) else to_chat(affected_mob, span_warning("You feel much, MUCH lighter!")) - affected_mob.vomit(20, TRUE) + affected_mob.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 20) // disease code already checks if the liver exists otherwise it is cured var/obj/item/organ/internal/liver/affected_liver = affected_mob.get_organ_slot(ORGAN_SLOT_LIVER) affected_liver.Remove(affected_mob) diff --git a/code/datums/diseases/tuberculosis.dm b/code/datums/diseases/tuberculosis.dm index 16ce69fc181..dd75ea7cc62 100644 --- a/code/datums/diseases/tuberculosis.dm +++ b/code/datums/diseases/tuberculosis.dm @@ -51,7 +51,7 @@ to_chat(affected_mob, span_userdanger("You feel your mind relax and your thoughts drift!")) affected_mob.adjust_confusion_up_to(8 SECONDS, 100 SECONDS) if(SPT_PROB(5, seconds_per_tick)) - affected_mob.vomit(20) + affected_mob.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 20) if(SPT_PROB(1.5, seconds_per_tick)) to_chat(affected_mob, span_warning("[pick("Your stomach silently rumbles...", "Your stomach seizes up and falls limp, muscles dead and lifeless.", "You could eat a crayon")]")) affected_mob.overeatduration = max(affected_mob.overeatduration - (200 SECONDS), 0) diff --git a/code/datums/dna.dm b/code/datums/dna.dm index dc16d18e77c..3634be227a6 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -855,7 +855,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) var/list/elligible_organs = list() for(var/obj/item/organ/internal/internal_organ in organs) //make sure we dont get an implant or cavity item elligible_organs += internal_organ - vomit(20, TRUE) + vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 10) if(elligible_organs.len) var/obj/item/organ/O = pick(elligible_organs) O.Remove(src) diff --git a/code/datums/quirks/negative_quirks/negative_quirks.dm b/code/datums/quirks/negative_quirks/negative_quirks.dm index 0be78405adb..82a33a6a8f9 100644 --- a/code/datums/quirks/negative_quirks/negative_quirks.dm +++ b/code/datums/quirks/negative_quirks/negative_quirks.dm @@ -1308,7 +1308,7 @@ carbon_quirk_holder.adjustToxLoss(3 * seconds_per_tick) carbon_quirk_holder.reagents.add_reagent(/datum/reagent/toxin/histamine, 3 * seconds_per_tick) if(SPT_PROB(10, seconds_per_tick)) - carbon_quirk_holder.vomit() + carbon_quirk_holder.vomit(VOMIT_CATEGORY_DEFAULT) carbon_quirk_holder.adjustOrganLoss(pick(ORGAN_SLOT_BRAIN,ORGAN_SLOT_APPENDIX,ORGAN_SLOT_LUNGS,ORGAN_SLOT_HEART,ORGAN_SLOT_LIVER,ORGAN_SLOT_STOMACH),10) /datum/quirk/bad_touch diff --git a/code/datums/status_effects/debuffs/choke.dm b/code/datums/status_effects/debuffs/choke.dm index 253c471150d..c16b946aa02 100644 --- a/code/datums/status_effects/debuffs/choke.dm +++ b/code/datums/status_effects/debuffs/choke.dm @@ -110,7 +110,7 @@ if(choking_on && iscarbon(owner)) var/mob/living/carbon/carbon_owner = owner // This will yeet the thing we're choking on out of us - carbon_owner.vomit(lost_nutrition = 20, force = TRUE, distance = 2) + carbon_owner.vomit(vomit_flags = (VOMIT_CATEGORY_DEFAULT | MOB_VOMIT_FORCE), lost_nutrition = 20, distance = 2) /datum/status_effect/choke/proc/on_vomit(mob/source, distance, force) SIGNAL_HANDLER diff --git a/code/datums/status_effects/debuffs/drunk.dm b/code/datums/status_effects/debuffs/drunk.dm index ee3fa0fa124..9b59b8e499f 100644 --- a/code/datums/status_effects/debuffs/drunk.dm +++ b/code/datums/status_effects/debuffs/drunk.dm @@ -166,7 +166,7 @@ owner.adjust_confusion(15 SECONDS) if(iscarbon(owner)) var/mob/living/carbon/carbon_owner = owner - carbon_owner.vomit() // Vomiting clears toxloss - consider this a blessing + carbon_owner.vomit(VOMIT_CATEGORY_DEFAULT) // Vomiting clears toxloss - consider this a blessing // Over 71, we will constantly have blurry eyes if(drunk_value >= 71) diff --git a/code/datums/voice_of_god_command.dm b/code/datums/voice_of_god_command.dm index f1ce13f9fa5..1be31c33d2a 100644 --- a/code/datums/voice_of_god_command.dm +++ b/code/datums/voice_of_god_command.dm @@ -144,7 +144,7 @@ GLOBAL_LIST_INIT(voice_of_god_commands, init_voice_of_god_commands()) /datum/voice_of_god_command/vomit/execute(list/listeners, mob/living/user, power_multiplier = 1, message) for(var/mob/living/carbon/target in listeners) - target.vomit(10 * power_multiplier, distance = power_multiplier, stun = FALSE) + target.vomit(vomit_flags = (MOB_VOMIT_MESSAGE | MOB_VOMIT_HARM), lost_nutrition = (power_multiplier * 10), distance = power_multiplier) /// This command silences the listeners. Thrice as effective is the user is a mime or curator. /datum/voice_of_god_command/silence diff --git a/code/game/machinery/dna_infuser/organ_sets/fly_organs.dm b/code/game/machinery/dna_infuser/organ_sets/fly_organs.dm index 1b915b22653..257831472d6 100644 --- a/code/game/machinery/dna_infuser/organ_sets/fly_organs.dm +++ b/code/game/machinery/dna_infuser/organ_sets/fly_organs.dm @@ -106,7 +106,7 @@ var/mob/living/carbon/body = owner ASSERT(istype(body)) // we do not lose any nutrition as a fly when vomiting out food - body.vomit(lost_nutrition = 0, stun = FALSE, distance = 2, force = TRUE, purge_ratio = 0.67) + body.vomit(vomit_flags = (MOB_VOMIT_MESSAGE | MOB_VOMIT_FORCE | MOB_VOMIT_HARM), lost_nutrition = 0, distance = 2, purge_ratio = 0.67) playsound(get_turf(owner), 'sound/effects/splat.ogg', 50, TRUE) body.visible_message( span_danger("[body] vomits on the floor!"), diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 79b421fa8de..fc646a3483e 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -338,7 +338,7 @@ Buildable meters if(iscarbon(user)) var/mob/living/carbon/C = user for(var/i in 1 to 20) - C.vomit(0, TRUE, FALSE, 4, FALSE) + C.vomit(vomit_flags = (MOB_VOMIT_BLOOD | MOB_VOMIT_HARM), lost_nutrition = 0, distance = 4) if(prob(20)) C.spew_organ() sleep(0.5 SECONDS) diff --git a/code/game/objects/effects/decals/cleanable/misc.dm b/code/game/objects/effects/decals/cleanable/misc.dm index 61306e4eceb..6a519650d10 100644 --- a/code/game/objects/effects/decals/cleanable/misc.dm +++ b/code/game/objects/effects/decals/cleanable/misc.dm @@ -174,6 +174,20 @@ reagents.trans_to(H, reagents.total_volume, transferred_by = user, methods = INGEST) qdel(src) +/obj/effect/decal/cleanable/vomit/toxic // this has a more toned-down color palette, which may be why it's used as the default in so many spots + icon_state = "vomittox_1" + random_icon_states = list("vomittox_1", "vomittox_2", "vomittox_3", "vomittox_4") + +/obj/effect/decal/cleanable/vomit/purple // ourple + icon_state = "vomitpurp_1" + random_icon_states = list("vomitpurp_1", "vomitpurp_2", "vomitpurp_3", "vomitpurp_4") + +/obj/effect/decal/cleanable/vomit/nanites + name = "nanite-infested vomit" + desc = "Gosh, you can see something moving in there." + icon_state = "vomitnanite_1" + random_icon_states = list("vomitnanite_1", "vomitnanite_2", "vomitnanite_3", "vomitnanite_4") + /obj/effect/decal/cleanable/vomit/nebula name = "nebula vomit" desc = "Gosh, how... beautiful." diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 97b5236ca06..2fae85953da 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1318,7 +1318,7 @@ // victim's chest (for cavity implanting the item) var/obj/item/bodypart/chest/victim_cavity = victim.get_bodypart(BODY_ZONE_CHEST) if(victim_cavity.cavity_item) - victim.vomit(5, FALSE, FALSE, distance = 0) + victim.vomit(vomit_flags = (MOB_VOMIT_MESSAGE | MOB_VOMIT_HARM), lost_nutrition = 5, distance = 0) forceMove(drop_location()) to_chat(victim, span_warning("You vomit up a [name]! [source_item? "Was that in \the [source_item]?" : ""]")) else diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 2eef8cc116e..c7f93c6ea68 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -285,7 +285,7 @@ var/obj/item/bodypart/chest/CH = user.get_bodypart(BODY_ZONE_CHEST) if(CH.cavity_item) // if he's (un)bright enough to have a round and full belly... user.visible_message(span_danger("[user] regurgitates [src]!")) // I swear i dont have a fetish - user.vomit(100, TRUE, distance = 0) + user.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 100, distance = 0) user.adjustOxyLoss(120) user.dropItemToGround(src) // incase the crit state doesn't drop the singulo to the floor user.set_suicide(FALSE) diff --git a/code/game/objects/structures/toiletbong.dm b/code/game/objects/structures/toiletbong.dm index cb8d9830512..45ce79f9c32 100644 --- a/code/game/objects/structures/toiletbong.dm +++ b/code/game/objects/structures/toiletbong.dm @@ -53,7 +53,7 @@ to_chat(user, span_userdanger("There was something disgusting in the pipes!")) user.visible_message(span_danger("[user] spits out a mouse.")) user.adjust_disgust(50) - user.vomit(10) + user.vomit(VOMIT_CATEGORY_DEFAULT) var/mob/living/spawned_mob = new /mob/living/basic/mouse(get_turf(user)) spawned_mob.faction |= "[REF(user)]" if(prob(50)) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 8c42bae1897..3d18dee3050 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -637,26 +637,19 @@ GLOBAL_LIST_EMPTY(station_turfs) /turf/AllowDrop() return TRUE -/turf/proc/add_vomit_floor(mob/living/M, vomit_type = VOMIT_TOXIC, purge_ratio = 0.1) +/turf/proc/add_vomit_floor(mob/living/vomiter, vomit_type = /obj/effect/decal/cleanable/vomit, vomit_flags, purge_ratio = 0.1) + var/obj/effect/decal/cleanable/vomit/throw_up = new vomit_type (src, vomiter.get_static_viruses()) - var/obj/effect/decal/cleanable/vomit/vomit - if (vomit_type == VOMIT_NEBULA) - vomit = new /obj/effect/decal/cleanable/vomit/nebula(src, M.get_static_viruses()) - else - vomit = new /obj/effect/decal/cleanable/vomit(src, M.get_static_viruses()) - - //if the vomit combined, apply toxicity and reagents to the old vomit - if (QDELETED(vomit)) - vomit = locate() in src - if(!vomit) + // if the vomit combined, apply toxicity and reagents to the old vomit + if (QDELETED(throw_up)) + throw_up = locate() in src + if(isnull(throw_up)) return - // Apply the proper icon set based on vomit type - if(vomit_type == VOMIT_PURPLE) - vomit.icon_state = "vomitpurp_[pick(1,4)]" - else if (vomit_type == VOMIT_TOXIC) - vomit.icon_state = "vomittox_[pick(1,4)]" - if (purge_ratio && iscarbon(M)) - clear_reagents_to_vomit_pool(M, vomit, purge_ratio) + + if(!iscarbon(vomiter) || (purge_ratio == 0)) + return + + clear_reagents_to_vomit_pool(vomiter, throw_up, purge_ratio) /proc/clear_reagents_to_vomit_pool(mob/living/carbon/M, obj/effect/decal/cleanable/vomit/V, purge_ratio = 0.1) var/obj/item/organ/internal/stomach/belly = M.get_organ_slot(ORGAN_SLOT_STOMACH) diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index a8e01a45eee..3d3ce928364 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -1,3 +1,5 @@ +#define REJECTION_VOMIT_FLAGS (MOB_VOMIT_BLOOD | MOB_VOMIT_STUN | MOB_VOMIT_FORCE) + /obj/item/organ/internal/heart/gland/heal abductor_hint = "organic replicator. Forcibly ejects damaged and robotic organs from the abductee and regenerates them. Additionally, forcibly removes reagents (via vomit) from the abductee if they have moderate toxin damage or poison within the bloodstream, and regenerates blood to a healthy threshold if too low. The abductee will also reject implants such as mindshields." cooldown_low = 200 @@ -78,19 +80,19 @@ /obj/item/organ/internal/heart/gland/heal/proc/reject_implant(obj/item/implant/implant) owner.visible_message(span_warning("[owner] vomits up a tiny mangled implant!"), span_userdanger("You suddenly vomit up a tiny mangled implant!")) - owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) + owner.vomit(REJECTION_VOMIT_FLAGS, lost_nutrition = 0) implant.removed(owner) qdel(implant) /obj/item/organ/internal/heart/gland/heal/proc/reject_cyberimp(obj/item/organ/internal/cyberimp/implant) owner.visible_message(span_warning("[owner] vomits up his [implant.name]!"), span_userdanger("You suddenly vomit up your [implant.name]!")) - owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) + owner.vomit(REJECTION_VOMIT_FLAGS, lost_nutrition = 0) implant.Remove(owner) implant.forceMove(owner.drop_location()) /obj/item/organ/internal/heart/gland/heal/proc/replace_appendix(obj/item/organ/internal/appendix/appendix) if(appendix) - owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) + owner.vomit(REJECTION_VOMIT_FLAGS, lost_nutrition = 0) appendix.Remove(owner) appendix.forceMove(owner.drop_location()) owner.visible_message(span_warning("[owner] vomits up his [appendix.name]!"), span_userdanger("You suddenly vomit up your [appendix.name]!")) @@ -106,7 +108,7 @@ /obj/item/organ/internal/heart/gland/heal/proc/replace_liver(obj/item/organ/internal/liver/liver) if(liver) owner.visible_message(span_warning("[owner] vomits up his [liver.name]!"), span_userdanger("You suddenly vomit up your [liver.name]!")) - owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) + owner.vomit(REJECTION_VOMIT_FLAGS, lost_nutrition = 0) liver.Remove(owner) liver.forceMove(owner.drop_location()) else @@ -121,7 +123,7 @@ /obj/item/organ/internal/heart/gland/heal/proc/replace_lungs(obj/item/organ/internal/lungs/lungs) if(lungs) owner.visible_message(span_warning("[owner] vomits up his [lungs.name]!"), span_userdanger("You suddenly vomit up your [lungs.name]!")) - owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) + owner.vomit(REJECTION_VOMIT_FLAGS, lost_nutrition = 0) lungs.Remove(owner) lungs.forceMove(owner.drop_location()) else @@ -136,7 +138,7 @@ /obj/item/organ/internal/heart/gland/heal/proc/replace_stomach(obj/item/organ/internal/stomach/stomach) if(stomach) owner.visible_message(span_warning("[owner] vomits up his [stomach.name]!"), span_userdanger("You suddenly vomit up your [stomach.name]!")) - owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) + owner.vomit(REJECTION_VOMIT_FLAGS, lost_nutrition = 0) stomach.Remove(owner) stomach.forceMove(owner.drop_location()) else @@ -190,7 +192,7 @@ /obj/item/organ/internal/heart/gland/heal/proc/keep_replacing_blood() var/keep_going = FALSE - owner.vomit(0, TRUE, FALSE, 3, FALSE, FALSE, FALSE, TRUE) + owner.vomit(vomit_flags = (MOB_VOMIT_BLOOD | MOB_VOMIT_FORCE), lost_nutrition = 0, distance = 3) owner.Stun(15) owner.adjustToxLoss(-15, TRUE, TRUE) @@ -226,3 +228,5 @@ var/obj/item/bodypart/chest/new_chest = new(null) new_chest.replace_limb(owner, TRUE) qdel(chest) + +#undef REJECTION_VOMIT_FLAGS diff --git a/code/modules/antagonists/abductor/equipment/glands/plasma.dm b/code/modules/antagonists/abductor/equipment/glands/plasma.dm index c167dd8a329..0d709579cc8 100644 --- a/code/modules/antagonists/abductor/equipment/glands/plasma.dm +++ b/code/modules/antagonists/abductor/equipment/glands/plasma.dm @@ -19,4 +19,4 @@ var/turf/open/T = get_turf(owner) if(istype(T)) T.atmos_spawn_air("[GAS_PLASMA]=50;[TURF_TEMPERATURE(T20C)]") - owner.vomit() + owner.vomit(VOMIT_CATEGORY_DEFAULT) diff --git a/code/modules/antagonists/abductor/equipment/glands/slime.dm b/code/modules/antagonists/abductor/equipment/glands/slime.dm index e3c966e3b6c..faebce9fc87 100644 --- a/code/modules/antagonists/abductor/equipment/glands/slime.dm +++ b/code/modules/antagonists/abductor/equipment/glands/slime.dm @@ -19,7 +19,7 @@ /obj/item/organ/internal/heart/gland/slime/activate() to_chat(owner, span_warning("You feel nauseated!")) - owner.vomit(20) + owner.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 20) var/mob/living/simple_animal/slime/Slime = new(get_turf(owner), "grey") Slime.set_friends(list(owner)) diff --git a/code/modules/antagonists/changeling/powers/panacea.dm b/code/modules/antagonists/changeling/powers/panacea.dm index 5c3bcd6da77..034248e1a55 100644 --- a/code/modules/antagonists/changeling/powers/panacea.dm +++ b/code/modules/antagonists/changeling/powers/panacea.dm @@ -23,7 +23,7 @@ O.Remove(user) if(iscarbon(user)) var/mob/living/carbon/C = user - C.vomit(0) + C.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 0) O.forceMove(get_turf(user)) user.reagents.add_reagent(/datum/reagent/medicine/mutadone, 10) diff --git a/code/modules/antagonists/heretic/status_effects/debuffs.dm b/code/modules/antagonists/heretic/status_effects/debuffs.dm index 3c7715111be..55c5af3aa08 100644 --- a/code/modules/antagonists/heretic/status_effects/debuffs.dm +++ b/code/modules/antagonists/heretic/status_effects/debuffs.dm @@ -110,7 +110,7 @@ var/chance = rand(0, 100) switch(chance) if(0 to 10) - human_owner.vomit() + human_owner.vomit(VOMIT_CATEGORY_DEFAULT) if(20 to 30) human_owner.set_timed_status_effect(100 SECONDS, /datum/status_effect/dizziness, only_if_higher = TRUE) human_owner.set_timed_status_effect(100 SECONDS, /datum/status_effect/jitter, only_if_higher = TRUE) diff --git a/code/modules/antagonists/wizard/equipment/artefact.dm b/code/modules/antagonists/wizard/equipment/artefact.dm index fc15d0b014b..39d9605c3ef 100644 --- a/code/modules/antagonists/wizard/equipment/artefact.dm +++ b/code/modules/antagonists/wizard/equipment/artefact.dm @@ -150,7 +150,7 @@ /obj/tear_in_reality/proc/deranged(mob/living/carbon/C) if(!C || C.stat == DEAD) return - C.vomit(0, TRUE, TRUE, 3, TRUE) + C.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 0, distance = 3) C.spew_organ(3, 2) C.investigate_log("has died from using telekinesis on a tear in reality.", INVESTIGATE_DEATHS) C.death() diff --git a/code/modules/mob/emote.dm b/code/modules/mob/emote.dm index ff2e414dd70..0e5856d452e 100644 --- a/code/modules/mob/emote.dm +++ b/code/modules/mob/emote.dm @@ -117,7 +117,7 @@ return if(user.get_timed_status_effect_duration(/datum/status_effect/confusion) > BEYBLADE_PUKE_THRESHOLD) - user.vomit(BEYBLADE_PUKE_NUTRIENT_LOSS, distance = 0) + user.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = BEYBLADE_PUKE_NUTRIENT_LOSS, distance = 0) return if(prob(BEYBLADE_DIZZINESS_PROBABILITY)) diff --git a/code/modules/mob/living/basic/space_fauna/regal_rat/regal_rat_actions.dm b/code/modules/mob/living/basic/space_fauna/regal_rat/regal_rat_actions.dm index e423b5ff852..1c36ed151a7 100644 --- a/code/modules/mob/living/basic/space_fauna/regal_rat/regal_rat_actions.dm +++ b/code/modules/mob/living/basic/space_fauna/regal_rat/regal_rat_actions.dm @@ -232,7 +232,7 @@ if (istype(victim) && !(FACTION_RAT in victim.faction)) to_chat(victim, span_userdanger("With this last sip, you feel your body convulsing horribly from the contents you've ingested. As you contemplate your actions, you sense an awakened kinship with rat-kind and their newly risen leader!")) victim.faction |= FACTION_RAT - victim.vomit() + victim.vomit(VOMIT_CATEGORY_DEFAULT) metabolization_rate = 10 * REAGENTS_METABOLISM /datum/reagent/rat_spit/on_mob_life(mob/living/carbon/C) @@ -243,7 +243,7 @@ to_chat(C, span_warning("That food does not sit up well!")) C.adjust_disgust(5) else if(prob(5)) - C.vomit() + C.vomit(VOMIT_CATEGORY_DEFAULT) return ..() /datum/pet_command/protect_owner/glockroach diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 1281587c610..f6237471a9f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -408,29 +408,44 @@ return 0 return ..() -/mob/living/carbon/proc/vomit(lost_nutrition = 10, blood = FALSE, stun = TRUE, distance = 1, message = TRUE, vomit_type = VOMIT_TOXIC, harm = TRUE, force = FALSE, purge_ratio = 0.1) +/// Proc that compels the mob to throw up. Returns TRUE if the mob actually threw up. +/mob/living/carbon/proc/vomit(vomit_flags = VOMIT_CATEGORY_DEFAULT, vomit_type = /obj/effect/decal/cleanable/vomit/toxic, lost_nutrition = 10, distance = 1, purge_ratio = 0.1) + var/force = (vomit_flags & MOB_VOMIT_FORCE) if((HAS_TRAIT(src, TRAIT_NOHUNGER) || HAS_TRAIT(src, TRAIT_TOXINLOVER)) && !force) return TRUE SEND_SIGNAL(src, COMSIG_CARBON_VOMITED, distance, force) + + // cache some stuff that we'll need later (at least multiple times) var/starting_dir = dir - if(nutrition < 100 && !blood && !force) + var/message = (vomit_flags & MOB_VOMIT_MESSAGE) + var/stun = (vomit_flags & MOB_VOMIT_STUN) + var/blood = (vomit_flags & MOB_VOMIT_BLOOD) + + if(!force && !blood && (nutrition < 100)) if(message) - visible_message(span_warning("[src] dry heaves!"), \ - span_userdanger("You try to throw up, but there's nothing in your stomach!")) + visible_message( + span_warning("[src] dry heaves!"), + span_userdanger("You try to throw up, but there's nothing in your stomach!"), + ) if(stun) Stun(20 SECONDS) return TRUE if(is_mouth_covered()) //make this add a blood/vomit overlay later it'll be hilarious if(message) - visible_message(span_danger("[src] throws up all over [p_them()]self!"), \ - span_userdanger("You throw up all over yourself!")) + visible_message( + span_danger("[src] throws up all over [p_them()]self!"), + span_userdanger("You throw up all over yourself!"), + ) add_mood_event("vomit", /datum/mood_event/vomitself) distance = 0 else if(message) - visible_message(span_danger("[src] throws up!"), span_userdanger("You throw up!")) + visible_message( + span_danger("[src] throws up!"), + span_userdanger("You throw up!"), + ) if(!isflyperson(src)) add_mood_event("vomit", /datum/mood_event/vomit) @@ -438,23 +453,26 @@ Stun(8 SECONDS) playsound(get_turf(src), 'sound/effects/splat.ogg', 50, TRUE) - var/turf/T = get_turf(src) + + var/turf/location = get_turf(src) if(!blood) adjust_nutrition(-lost_nutrition) adjustToxLoss(-3) - for(var/i=0 to distance) + for(var/i = 0 to distance) if(blood) - if(T) - add_splatter_floor(T) - if(harm) + if(location) + add_splatter_floor(location) + if(vomit_flags & MOB_VOMIT_HARM) adjustBruteLoss(3) else - if(T) - T.add_vomit_floor(src, vomit_type, purge_ratio) //toxic barf looks different || call purge when doing detoxicfication to pump more chems out of the stomach. - T = get_step(T, starting_dir) - if (T?.is_blocked_turf()) + if(location) + location.add_vomit_floor(src, vomit_type, vomit_flags, purge_ratio) // call purge when doing detoxicfication to pump more chems out of the stomach. + + location = get_step(location, starting_dir) + if (location?.is_blocked_turf()) break + return TRUE /** diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index 5a6c630a30c..0e96011bd84 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -1063,7 +1063,7 @@ GLOBAL_LIST_EMPTY(features_by_species) to_chat(source, span_danger("You feel weak.")) if(time_since_irradiated > RAD_MOB_VOMIT && SPT_PROB(RAD_MOB_VOMIT_PROB, seconds_per_tick)) - source.vomit(10, TRUE) + source.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 10) if(time_since_irradiated > RAD_MOB_MUTATE && SPT_PROB(RAD_MOB_MUTATE_PROB, seconds_per_tick)) to_chat(source, span_danger("You mutate!")) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 4ce8a4b486b..f80a6f6dc6e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -697,15 +697,18 @@ return ..() -/mob/living/carbon/human/vomit(lost_nutrition = 10, blood = FALSE, stun = TRUE, distance = 1, message = TRUE, vomit_type = VOMIT_TOXIC, harm = TRUE, force = FALSE, purge_ratio = 0.1) - if(blood && HAS_TRAIT(src, TRAIT_NOBLOOD) && !HAS_TRAIT(src, TRAIT_TOXINLOVER)) - if(message) - visible_message(span_warning("[src] dry heaves!"), \ - span_userdanger("You try to throw up, but there's nothing in your stomach!")) - if(stun) - Stun(20 SECONDS) - return 1 - ..() +/mob/living/carbon/human/vomit(vomit_flags = VOMIT_CATEGORY_DEFAULT, vomit_type = /obj/effect/decal/cleanable/vomit/toxic, lost_nutrition = 10, distance = 1, purge_ratio = 0.1) + if(!((vomit_flags & MOB_VOMIT_BLOOD) && HAS_TRAIT(src, TRAIT_NOBLOOD) && !HAS_TRAIT(src, TRAIT_TOXINLOVER))) + return ..() + + if(vomit_flags & MOB_VOMIT_MESSAGE) + visible_message( + span_warning("[src] dry heaves!"), + span_userdanger("You try to throw up, but there's nothing in your stomach!"), + ) + if(vomit_flags & MOB_VOMIT_STUN) + Stun(20 SECONDS) + return TRUE /mob/living/carbon/human/vv_edit_var(var_name, var_value) if(var_name == NAMEOF(src, mob_height)) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index c468d9b750c..c91fc7d6638 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -279,7 +279,7 @@ lastpuke += SPT_PROB(30, seconds_per_tick) if(lastpuke >= 50) // about 25 second delay I guess // This is actually closer to 150 seconds - vomit(20) + vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 20) lastpuke = 0 diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index eb1591b7197..33ad9a3e613 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -339,13 +339,13 @@ if(prob(5)) to_chat(src, span_warning("The stench of rotting carcasses is unbearable!")) add_mood_event("smell", /datum/mood_event/disgust/nauseating_stench) - vomit() + vomit(VOMIT_CATEGORY_DEFAULT) if(30 to INFINITY) //Higher chance to vomit. Let the horror start if(prob(25)) to_chat(src, span_warning("The stench of rotting carcasses is unbearable!")) add_mood_event("smell", /datum/mood_event/disgust/nauseating_stench) - vomit() + vomit(VOMIT_CATEGORY_DEFAULT) else clear_mood_event("smell") diff --git a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm index ac8d89edc69..b3d19ff9ee5 100644 --- a/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm @@ -2143,7 +2143,7 @@ if(SPT_PROB(5, seconds_per_tick)) stored_teleports += rand(2, 6) if(prob(70)) - drinker.vomit(vomit_type = VOMIT_PURPLE) + drinker.vomit(vomit_flags = VOMIT_CATEGORY_DEFAULT, vomit_type = /obj/effect/decal/cleanable/vomit/purple) return ..() /datum/reagent/consumable/ethanol/planet_cracker diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index f9c78ddd5cb..b6a2d852ee9 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -432,7 +432,7 @@ carbie.adjustToxLoss(1 * REM * seconds_per_tick, required_biotype = affected_biotype) if(SPT_PROB(5, seconds_per_tick)) carbie.adjustToxLoss(5, required_biotype = affected_biotype) - carbie.vomit() + carbie.vomit(VOMIT_CATEGORY_DEFAULT) /datum/reagent/drug/maint/tar name = "Maintenance Tar" diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 67b24f2bfb3..c6b8f1ab75d 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -444,7 +444,7 @@ if(prob(10)) victim.set_dizzy_if_lower(2 SECONDS) if(prob(5)) - victim.vomit() + victim.vomit(VOMIT_CATEGORY_DEFAULT) /datum/reagent/consumable/condensedcapsaicin/on_mob_life(mob/living/carbon/M, seconds_per_tick, times_fired) if(!holder.has_reagent(/datum/reagent/consumable/milk)) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 0265bfab41c..e9d03dcc465 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -1232,7 +1232,7 @@ /datum/reagent/medicine/syndicate_nanites/overdose_process(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) //wtb flavortext messages that hint that you're vomitting up robots if(SPT_PROB(13, seconds_per_tick)) affected_mob.reagents.remove_reagent(type, metabolization_rate*15) // ~5 units at a rate of 0.4 but i wanted a nice number in code - affected_mob.vomit(20) // nanite safety protocols make your body expel them to prevent harmies + affected_mob.vomit(vomit_flags = VOMIT_CATEGORY_DEFAULT, vomit_type = /obj/effect/decal/cleanable/vomit/nanites, lost_nutrition = 20) // nanite safety protocols make your body expel them to prevent harmies ..() . = TRUE @@ -1543,7 +1543,7 @@ /datum/reagent/medicine/metafactor/overdose_process(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) if(SPT_PROB(13, seconds_per_tick)) - affected_mob.vomit() + affected_mob.vomit(VOMIT_CATEGORY_DEFAULT) ..() /datum/reagent/medicine/silibinin diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 12bc5dcc4ee..bbe42d34d40 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -2582,7 +2582,10 @@ if(yuck_cycles % YUCK_PUKE_CYCLES == 0) if(yuck_cycles >= YUCK_PUKE_CYCLES * YUCK_PUKES_TO_STUN) holder.remove_reagent(type, 5) - affected_mob.vomit(rand(14, 26), stun = yuck_cycles >= YUCK_PUKE_CYCLES * YUCK_PUKES_TO_STUN) + var/passable_flags = (MOB_VOMIT_MESSAGE | MOB_VOMIT_HARM) + if(yuck_cycles >= (YUCK_PUKE_CYCLES * YUCK_PUKES_TO_STUN)) + passable_flags |= MOB_VOMIT_STUN + affected_mob.vomit(vomit_flags = passable_flags, lost_nutrition = rand(14, 26)) if(holder) return ..() #undef YUCK_PUKE_CYCLES @@ -2827,7 +2830,7 @@ if(SPT_PROB(15, seconds_per_tick)) victim.emote("scream") if(SPT_PROB(2, seconds_per_tick)) // Stuns, but purges ants. - victim.vomit(rand(5,10), FALSE, TRUE, 1, TRUE, FALSE, purge_ratio = 1) + victim.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = rand(5,10), purge_ratio = 1) return ..() /datum/reagent/ants/on_mob_end_metabolize(mob/living/living_anthill) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index a9735cd7e75..e8561660510 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -936,7 +936,12 @@ /datum/reagent/toxin/spewium/on_mob_life(mob/living/carbon/affected_mob, seconds_per_tick, times_fired) .=..() if(current_cycle >= 11 && SPT_PROB(min(30, current_cycle), seconds_per_tick)) - affected_mob.vomit(10, prob(10), prob(50), rand(0,4), TRUE) + var/constructed_flags = (MOB_VOMIT_MESSAGE | MOB_VOMIT_HARM) + if(prob(10)) + constructed_flags |= MOB_VOMIT_BLOOD + if(prob(50)) + constructed_flags |= MOB_VOMIT_STUN + affected_mob.vomit(vomit_flags = constructed_flags, distance = rand(0,4)) for(var/datum/reagent/toxin/R in affected_mob.reagents.reagent_list) if(R != src) affected_mob.reagents.remove_reagent(R.type,1) @@ -945,7 +950,7 @@ . = ..() if(current_cycle >= 33 && SPT_PROB(7.5, seconds_per_tick)) affected_mob.spew_organ() - affected_mob.vomit(0, TRUE, TRUE, 4) + affected_mob.vomit(VOMIT_CATEGORY_BLOOD, lost_nutrition = 0, distance = 4) to_chat(affected_mob, span_userdanger("You feel something lumpy come up as you vomit.")) /datum/reagent/toxin/curare diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index 5fd92a74af0..6118a240685 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -586,7 +586,7 @@ if(ismonkey(M)) M.gib() else - M.vomit(blood = TRUE, stun = TRUE) //not having a redo of itching powder (hopefully) + M.vomit(VOMIT_CATEGORY_BLOOD) new /mob/living/carbon/human/species/monkey(location, TRUE) //water electrolysis diff --git a/code/modules/religion/rites.dm b/code/modules/religion/rites.dm index c7e38145349..d907191c33d 100644 --- a/code/modules/religion/rites.dm +++ b/code/modules/religion/rites.dm @@ -221,7 +221,7 @@ user.add_mood_event("maint_adaptation", /datum/mood_event/maintenance_adaptation) if(iscarbon(user)) var/mob/living/carbon/vomitorium = user - vomitorium.vomit() + vomitorium.vomit(VOMIT_CATEGORY_DEFAULT) var/datum/dna/dna = vomitorium.has_dna() dna?.add_mutation(/datum/mutation/human/stimmed) //some fluff mutations dna?.add_mutation(/datum/mutation/human/strong) diff --git a/code/modules/research/xenobiology/crossbreeding/consuming.dm b/code/modules/research/xenobiology/crossbreeding/consuming.dm index 43bfd2dbe8a..007bacf8bb7 100644 --- a/code/modules/research/xenobiology/crossbreeding/consuming.dm +++ b/code/modules/research/xenobiology/crossbreeding/consuming.dm @@ -355,7 +355,7 @@ Consuming extracts: /obj/item/slime_cookie/green/do_effect(mob/living/M, mob/user) if(ishuman(M)) var/mob/living/carbon/human/H = M - H.vomit(25) + H.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 25) M.reagents.remove_all() /obj/item/slimecross/consuming/pink diff --git a/code/modules/surgery/organs/internal/appendix/_appendix.dm b/code/modules/surgery/organs/internal/appendix/_appendix.dm index 835d7e62bed..a52479c10a7 100644 --- a/code/modules/surgery/organs/internal/appendix/_appendix.dm +++ b/code/modules/surgery/organs/internal/appendix/_appendix.dm @@ -65,7 +65,7 @@ organ_owner.adjustToxLoss(1, updating_health = TRUE, forced = TRUE) if(3) if(SPT_PROB(0.5, seconds_per_tick)) - organ_owner.vomit(95) + organ_owner.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = 95) organ_owner.adjustOrganLoss(ORGAN_SLOT_APPENDIX, 15) diff --git a/code/modules/surgery/organs/internal/liver/_liver.dm b/code/modules/surgery/organs/internal/liver/_liver.dm index 3b58a650b1a..afeb8decde4 100755 --- a/code/modules/surgery/organs/internal/liver/_liver.dm +++ b/code/modules/surgery/organs/internal/liver/_liver.dm @@ -172,18 +172,18 @@ to_chat(owner, span_userdanger("You feel stabbing pain in your abdomen!")) if(2) to_chat(owner, span_userdanger("You feel a burning sensation in your gut!")) - owner.vomit() + owner.vomit(VOMIT_CATEGORY_DEFAULT) if(3) to_chat(owner, span_userdanger("You feel painful acid in your throat!")) - owner.vomit(blood = TRUE) + owner.vomit(VOMIT_CATEGORY_BLOOD) if(4) to_chat(owner, span_userdanger("Overwhelming pain knocks you out!")) - owner.vomit(blood = TRUE, distance = rand(1,2)) + owner.vomit(VOMIT_CATEGORY_BLOOD, distance = rand(1,2)) owner.emote("Scream") owner.AdjustUnconscious(2.5 SECONDS) if(5) to_chat(owner, span_userdanger("You feel as if your guts are about to melt!")) - owner.vomit(blood = TRUE,distance = rand(1,3)) + owner.vomit(VOMIT_CATEGORY_BLOOD, distance = rand(1,3)) owner.emote("Scream") owner.AdjustUnconscious(5 SECONDS) diff --git a/code/modules/surgery/organs/internal/lungs/_lungs.dm b/code/modules/surgery/organs/internal/lungs/_lungs.dm index ba66721433f..5e4e0648067 100644 --- a/code/modules/surgery/organs/internal/lungs/_lungs.dm +++ b/code/modules/surgery/organs/internal/lungs/_lungs.dm @@ -481,13 +481,13 @@ if(prob(5)) to_chat(breather, span_warning("The stench of rotting carcasses is unbearable!")) breather.add_mood_event("smell", /datum/mood_event/disgust/nauseating_stench) - breather.vomit() + breather.vomit(VOMIT_CATEGORY_DEFAULT) if(30 to INFINITY) //Higher chance to vomit. Let the horror start if(prob(15)) to_chat(breather, span_warning("The stench of rotting carcasses is unbearable!")) breather.add_mood_event("smell", /datum/mood_event/disgust/nauseating_stench) - breather.vomit() + breather.vomit(VOMIT_CATEGORY_DEFAULT) else breather.clear_mood_event("smell") // In a full miasma atmosphere with 101.34 pKa, about 10 disgust per breath, is pretty low compared to threshholds diff --git a/code/modules/surgery/organs/internal/stomach/_stomach.dm b/code/modules/surgery/organs/internal/stomach/_stomach.dm index c05200be189..c817e7209db 100644 --- a/code/modules/surgery/organs/internal/stomach/_stomach.dm +++ b/code/modules/surgery/organs/internal/stomach/_stomach.dm @@ -110,13 +110,13 @@ //The stomach is damage has nutriment but low on theshhold, lo prob of vomit if(SPT_PROB(0.0125 * damage * nutri_vol * nutri_vol, seconds_per_tick)) - body.vomit(damage) + body.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = damage) to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down all that food!")) return // the change of vomit is now high if(damage > high_threshold && SPT_PROB(0.05 * damage * nutri_vol * nutri_vol, seconds_per_tick)) - body.vomit(damage) + body.vomit(VOMIT_CATEGORY_DEFAULT, lost_nutrition = damage) to_chat(body, span_warning("Your stomach reels in pain as you're incapable of holding down all that food!")) /obj/item/organ/internal/stomach/proc/handle_hunger(mob/living/carbon/human/human, seconds_per_tick, times_fired) @@ -233,7 +233,7 @@ if(SPT_PROB(pukeprob, seconds_per_tick)) //iT hAndLeS mOrE ThaN PukInG disgusted.adjust_confusion(2.5 SECONDS) disgusted.adjust_stutter(2 SECONDS) - disgusted.vomit(10, distance = 0, vomit_type = NONE) + disgusted.vomit(VOMIT_CATEGORY_DEFAULT, distance = 0) disgusted.set_dizzy_if_lower(10 SECONDS) if(disgust >= DISGUST_LEVEL_DISGUSTED) if(SPT_PROB(13, seconds_per_tick)) @@ -299,7 +299,7 @@ if(. & EMP_PROTECT_SELF) return if(!COOLDOWN_FINISHED(src, severe_cooldown)) //So we cant just spam emp to kill people. - owner.vomit(stun = FALSE) + owner.vomit(vomit_flags = (MOB_VOMIT_MESSAGE | MOB_VOMIT_HARM)) COOLDOWN_START(src, severe_cooldown, 10 SECONDS) if(prob(emp_vulnerability/severity)) //Chance of permanent effects organ_flags |= ORGAN_EMP //Starts organ faliure - gonna need replacing soon.