diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index c4dd927c43b..f0f73032436 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -441,14 +441,13 @@ #define SHOCK_KNOCKDOWN (1<<7) /// Vomit defines -#define VOMIT_NUTRITION_LOSS 10 -#define VOMIT_STUN_TIME (8 SECONDS) -#define VOMIT_DISTANCE 0 +#define VOMIT_NUTRITION_LOSS 10 +#define VOMIT_STUN_TIME (8 SECONDS) +#define VOMIT_DISTANCE 0 +#define VOMIT_SAFE_NUTRITION 90 /// Vomit modes -#define VOMIT_TOXIN (1<<0) -#define VOMIT_BLOOD (1<<1) -#define VOMIT_BOTH (VOMIT_TOXIN|VOMIT_BLOOD) +#define VOMIT_BLOOD (1<<0) /// When reached - we'll apply status effect which will force carbon to vomit -#define TOX_VOMIT_THRESHOLD_REACHED(mob, toxloss) (mob.getToxLoss() >= toxloss) -#define TOX_VOMIT_REQUIRED_TOXLOSS 45 +#define TOX_VOMIT_THRESHOLD_REACHED(mob, toxloss) (mob.getToxLoss() >= toxloss) +#define TOX_VOMIT_REQUIRED_TOXLOSS 45 diff --git a/code/datums/components/eatable.dm b/code/datums/components/eatable.dm index 204f6280099..8db69214b43 100644 --- a/code/datums/components/eatable.dm +++ b/code/datums/components/eatable.dm @@ -9,7 +9,7 @@ /// integrity spend after bite var/integrity_bite // integrity spend after bite /// How much nutrition add - var/nutritional_value + var/nutritional_value /// Grab if help_intent was used var/is_only_grab_intent /// If true - your item can be eaten without special diet check. @@ -29,7 +29,7 @@ ) if(!isitem(parent)) return COMPONENT_INCOMPATIBLE - + src.current_bites = current_bites src.material_type = material_type src.max_bites = max_bites @@ -38,7 +38,7 @@ src.is_only_grab_intent = is_only_grab_intent src.is_always_eatable = is_always_eatable src.stack_use = stack_use - + /datum/component/eatable/RegisterWithParent() RegisterSignal(parent, COMSIG_ITEM_PRE_ATTACKBY, PROC_REF(pre_try_eat_item)) RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(on_examine)) @@ -53,7 +53,7 @@ if(!istype(human)) return - + if(material_type & human.dna.species.special_diet) examine_list += "Вкуснятина! [is_only_grab_intent ? "\nНужно аккуратно есть." : ""]" @@ -125,7 +125,7 @@ if (target != user) chat_message_to_target = "В ваш рот насильно запихивают [item.name]!" if(target.nutrition >= NUTRITION_LEVEL_FULL) - target.vomit(VOMIT_TOXIN, nutritional_value + 20) + target.vomit(nutritional_value + 20) target.adjustStaminaLoss(15) if(target != user) @@ -134,7 +134,7 @@ to_chat(target, span_notice("[chat_message_to_target]")) add_attack_logs(user, item, "Force Fed [target], item [item]") - + if(!isstack(item)) to_chat(user, span_notice("[chat_message_to_user]")) @@ -170,7 +170,7 @@ item.visible_message(span_warning("[user] пытается накормить [target], запихивая в рот [item.name].")) if(!do_after(user, target, 2 SECONDS, NONE)) return FALSE - + return TRUE /datum/component/eatable/proc/get_colour() diff --git a/code/datums/diseases/viruses/advance/symptoms/vomit.dm b/code/datums/diseases/viruses/advance/symptoms/vomit.dm index 392f38f4585..637f40301df 100644 --- a/code/datums/diseases/viruses/advance/symptoms/vomit.dm +++ b/code/datums/diseases/viruses/advance/symptoms/vomit.dm @@ -43,7 +43,7 @@ Bonus return /datum/symptom/vomit/proc/Vomit(mob/living/carbon/M) - M.vomit(VOMIT_TOXIN, 20) + M.vomit(20) /* ////////////////////////////////////// @@ -77,7 +77,7 @@ Bonus severity = 5 /datum/symptom/vomit/blood/Vomit(mob/living/carbon/M) - M.vomit(VOMIT_BLOOD) + M.vomit(0, VOMIT_BLOOD) /* @@ -106,4 +106,4 @@ Bonus level = 4 /datum/symptom/vomit/projectile/Vomit(mob/living/carbon/M) - M.vomit(VOMIT_TOXIN, 6, 8 SECONDS, 5, 1) + M.vomit(6, stun = 8 SECONDS, distance = 5) diff --git a/code/datums/diseases/viruses/cadaver.dm b/code/datums/diseases/viruses/cadaver.dm index a9e6ec8c8ea..3676a3c0566 100644 --- a/code/datums/diseases/viruses/cadaver.dm +++ b/code/datums/diseases/viruses/cadaver.dm @@ -22,13 +22,13 @@ switch(stage) if(2) if(prob(2)) - H.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS, 0.1 SECONDS) + H.vomit(stun = 0.1 SECONDS) if(prob(7)) H.adjust_bodytemperature(30, max_temp = H.dna.species.heat_level_1 + 10) to_chat(H, span_warning("You feel hot!")) if(3, 4) if(prob(3)) - H.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS, 0.1 SECONDS) + H.vomit(stun = 0.1 SECONDS) if(prob(7)) H.adjust_bodytemperature(30, max_temp = H.dna.species.heat_level_1 + 30) to_chat(H, span_warning("You feel very hot!")) diff --git a/code/datums/diseases/viruses/nuclefication.dm b/code/datums/diseases/viruses/nuclefication.dm index 4ce4dc2f416..e72d2c06910 100644 --- a/code/datums/diseases/viruses/nuclefication.dm +++ b/code/datums/diseases/viruses/nuclefication.dm @@ -34,7 +34,7 @@ stage_message++ to_chat(H, span_notice("You feel sick.")) if(prob(2)) - H.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + H.vomit() radiate(H) diff --git a/code/datums/diseases/viruses/tuberculosis.dm b/code/datums/diseases/viruses/tuberculosis.dm index 6ad85b49d93..29082113059 100644 --- a/code/datums/diseases/viruses/tuberculosis.dm +++ b/code/datums/diseases/viruses/tuberculosis.dm @@ -48,7 +48,7 @@ to_chat(H, span_userdanger("You feel your mind relax and your thoughts drift!")) H.AdjustConfused(16 SECONDS, bound_lower = 0, bound_upper = 200 SECONDS) if(prob(10)) - H.vomit(VOMIT_TOXIN, 20) + H.vomit(20) if(prob(3)) to_chat(H, span_warning("[pick("Your stomach silently rumbles...", "Your stomach seizes up and falls limp, muscles dead and lifeless.", "You could eat a crayon")]")) H.overeatduration = max(H.overeatduration - 100, 0) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 04baac541f5..616c1ea91d0 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -1013,7 +1013,7 @@ if(prob(pukeprob)) carbon.AdjustConfused(9 SECONDS) carbon.AdjustStuttering(3 SECONDS) - carbon.vomit(VOMIT_TOXIN, 15, 8 SECONDS, 0, FALSE) + carbon.vomit(15, stun = 8 SECONDS, message = FALSE) carbon.Dizzy(15 SECONDS) if(strength >= DISGUST_LEVEL_DISGUSTED) if(prob(25)) @@ -1253,7 +1253,7 @@ var/mob/living/carbon/carbon = owner puke_counter = initial(puke_counter) - if(!carbon.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS)) + if(!carbon.vomit()) return carbon.adjustToxLoss(-3) diff --git a/code/game/gamemodes/clockwork/clockwork_items.dm b/code/game/gamemodes/clockwork/clockwork_items.dm index 6804b3818d3..d4f8b5db9f3 100644 --- a/code/game/gamemodes/clockwork/clockwork_items.dm +++ b/code/game/gamemodes/clockwork/clockwork_items.dm @@ -642,7 +642,7 @@ user.visible_message("As [user] picks [src] up, it flickers off their arms!", "The buckler flicker off your arms, leaving only nausea!") if(iscarbon(user)) var/mob/living/carbon/C = user - C.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + C.vomit() C.Knockdown(10 SECONDS) else to_chat(user, "\"Did you like having head?\"") @@ -772,7 +772,7 @@ user.visible_message("As [user] picks [src] up, it flickers off their arms!", "The robe flicker off your arms, leaving only nausea!") if(iscarbon(user)) var/mob/living/carbon/C = user - C.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + C.vomit() C.Knockdown(10 SECONDS) else to_chat(user, "\"I think this armor is too hot for you to handle.\"") @@ -899,7 +899,7 @@ user.visible_message("As [user] puts [src] on, it flickers off their body!", "The curiass flickers off your body, leaving only nausea!") if(iscarbon(user)) var/mob/living/carbon/C = user - C.vomit(VOMIT_TOXIN, 20) + C.vomit(20) C.Knockdown(10 SECONDS) else to_chat(user, "\"I think this armor is too hot for you to handle.\"") @@ -1026,7 +1026,7 @@ user.visible_message("As [user] puts [src] on, it flickers off their arms!", "The gauntlets flicker off your arms, leaving only nausea!") if(iscarbon(user)) var/mob/living/carbon/C = user - C.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + C.vomit() C.Knockdown(10 SECONDS) else to_chat(user, "\"Did you like having arms?\"") @@ -1066,7 +1066,7 @@ user.visible_message("As [user] puts [src] on, it flickers off their feet!", "The treads flicker off your feet, leaving only nausea!") if(iscarbon(user)) var/mob/living/carbon/C = user - C.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + C.vomit() C.Knockdown(10 SECONDS) else to_chat(user, "\"Let's see if you can dance with these.\"") @@ -1113,7 +1113,7 @@ user.visible_message("As [user] puts [src] on, it flickers off their head!", "The helmet flickers off your head, leaving only nausea!") if(iscarbon(user)) var/mob/living/carbon/C = user - C.vomit(VOMIT_TOXIN, 20) + C.vomit(20) C.Knockdown(10 SECONDS) else to_chat(user, "\"Do you have a hole in your head? You're about to.\"") diff --git a/code/game/gamemodes/miniantags/abduction/gland.dm b/code/game/gamemodes/miniantags/abduction/gland.dm index f10072cfa0c..445466bfc48 100644 --- a/code/game/gamemodes/miniantags/abduction/gland.dm +++ b/code/game/gamemodes/miniantags/abduction/gland.dm @@ -134,7 +134,7 @@ /obj/item/organ/internal/heart/gland/slime/activate() to_chat(owner, "You feel nauseous!") - owner.vomit(VOMIT_TOXIN, 20) + owner.vomit(20) var/mob/living/simple_animal/slime/Slime = new(get_turf(owner), "grey") Slime.Friends = list(owner) @@ -348,4 +348,4 @@ var/turf/simulated/T = get_turf(owner) if(istype(T)) T.atmos_spawn_air(LINDA_SPAWN_TOXINS|LINDA_SPAWN_20C,50) - owner.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + owner.vomit() diff --git a/code/game/gamemodes/shadowling/shadowling_abilities.dm b/code/game/gamemodes/shadowling/shadowling_abilities.dm index 77479df2953..6418d850862 100644 --- a/code/game/gamemodes/shadowling/shadowling_abilities.dm +++ b/code/game/gamemodes/shadowling/shadowling_abilities.dm @@ -923,7 +923,7 @@ var/mob/living/carbon/human/target = targets[1] - target.vomit(VOMIT_BLOOD, stun = 8 SECONDS, distance = 1, message = FALSE) + target.vomit(0, VOMIT_BLOOD, distance = 2, message = FALSE) playsound(user.loc, 'sound/hallucinations/veryfar_noise.ogg', 50, TRUE) to_chat(user, "You instantly rearrange [target]'s memories, hyptonitizing [target.p_them()] into a thrall.") to_chat(target, "An agonizing spike of pain drives into your mind, and--") diff --git a/code/game/objects/items/decorations.dm b/code/game/objects/items/decorations.dm index 1061a04a736..6761d8b5a95 100644 --- a/code/game/objects/items/decorations.dm +++ b/code/game/objects/items/decorations.dm @@ -385,7 +385,7 @@ if(!.) return . victim.drop_from_active_hand() - victim.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + victim.vomit() INVOKE_ASYNC(victim, TYPE_PROC_REF(/mob, emote), "cough") diff --git a/code/modules/antagonists/changeling/powers/panacea.dm b/code/modules/antagonists/changeling/powers/panacea.dm index b150ae2f0f3..3e77f3f6343 100644 --- a/code/modules/antagonists/changeling/powers/panacea.dm +++ b/code/modules/antagonists/changeling/powers/panacea.dm @@ -21,7 +21,8 @@ borer.leave_host() if(iscarbon(user)) var/mob/living/carbon/c_user = user - c_user.vomit() + c_user.fakevomit() + c_user.Stun(VOMIT_STUN_TIME) if(iscarbon(user)) var/mob/living/carbon/c_user = user diff --git a/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm b/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm index 0b5c3c1a5de..3136eb36eec 100644 --- a/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm +++ b/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm @@ -409,7 +409,7 @@ var/obj/item/thing = organ_to_dissect.remove(target) qdel(thing) - target.vomit(VOMIT_BLOOD|VOMIT_TOXIN, 50, 0 SECONDS) + target.vomit(50, VOMIT_BLOOD, 0 SECONDS) if(target.has_pain()) target.emote("scream") @@ -688,7 +688,7 @@ if(iscarbon(victim)) var/mob/living/carbon/c_victim = victim - c_victim.vomit(VOMIT_BLOOD|VOMIT_TOXIN, 50, 0 SECONDS) + c_victim.vomit(50, VOMIT_BLOOD, 0 SECONDS) if(prob(10 + vampire.get_trophies(INTERNAL_ORGAN_LIVER) * 3)) new /obj/effect/temp_visual/cult/sparks(get_turf(victim)) diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm index 2f846c49064..f5e4e53df4b 100644 --- a/code/modules/mining/equipment/regenerative_core.dm +++ b/code/modules/mining/equipment/regenerative_core.dm @@ -234,14 +234,14 @@ if(prob(1)) SEND_SOUND(owner, sound(pick(spooky_sounds))) if(prob(2)) - owner.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + owner.vomit() if(4, 5) if(prob(2)) to_chat(owner, span_danger("Something flexes under your skin.")) if(prob(2)) SEND_SOUND(owner, sound(pick(spooky_sounds))) if(prob(3)) - owner.vomit(VOMIT_BLOOD) + owner.vomit(0, VOMIT_BLOOD) if(prob(50)) var/mob/living/simple_animal/hostile/asteroid/hivelordbrood/legion/child = new(owner.loc) child.faction = owner.faction.Copy() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 7316584dd9e..56aebb2e238 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -75,13 +75,13 @@ /mob/living/carbon/proc/vomit( - mode = VOMIT_TOXIN, - lost_nutrition = 0, - stun = VOMIT_STUN_TIME, - distance = 0, + lost_nutrition = VOMIT_NUTRITION_LOSS, + mode = NONE, + stun = VOMIT_STUN_TIME, + distance = 1, message = TRUE -) - if(ismachineperson(src)) //IPCs do not vomit particulates +) + if(ismachineperson(src)) // IPCs do not vomit particulates. return FALSE if(is_muzzled()) @@ -93,12 +93,9 @@ if(stun) Stun(stun) - if(!nutrition) - return FALSE - - if((nutrition < 100 || nutrition < lost_nutrition) && (!(mode & VOMIT_BLOOD))) + if((nutrition - VOMIT_SAFE_NUTRITION) < lost_nutrition && (!(mode & VOMIT_BLOOD))) if(message) - visible_message(span_warning("[src.name] сухо кашля[pluralize_ru(src.gender,"ет","ют")]!"), \ + visible_message(span_warning("[name] сухо кашля[pluralize_ru(gender,"ет","ют")]!"), \ span_userdanger("Вы пытаетесь проблеваться, но в вашем желудке пусто!")) if(stun) @@ -107,23 +104,27 @@ return FALSE if(message) - visible_message(span_danger("[src.name] блю[pluralize_ru(src.gender,"ет","ют")]!"), \ + visible_message(span_danger("[name] блю[pluralize_ru(gender,"ет","ют")]!"), \ span_userdanger("Вас вырвало!")) - playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1) + playsound(get_turf(src), 'sound/effects/splat.ogg', 50, TRUE) var/turf/turf = get_turf(src) if(!turf) return FALSE - for(var/i = 0 to distance) - if(mode & VOMIT_TOXIN) + var/max_nutriment_vomit_dist = 0 + if(lost_nutrition) + max_nutriment_vomit_dist = floor((nutrition - VOMIT_SAFE_NUTRITION) / lost_nutrition) + + for(var/i = 1 to distance) + if(max_nutriment_vomit_dist >= distance) turf.add_vomit_floor() adjust_nutrition(-lost_nutrition) if(stun) adjustToxLoss(-3) - + if(mode & VOMIT_BLOOD) add_splatter_floor(turf) @@ -137,6 +138,7 @@ return FALSE + /mob/living/carbon/gib() . = death(TRUE) if(!.) diff --git a/code/modules/reagents/chemistry/reagents/drugs.dm b/code/modules/reagents/chemistry/reagents/drugs.dm index 00d670a7ffe..e5ef68bffb7 100644 --- a/code/modules/reagents/chemistry/reagents/drugs.dm +++ b/code/modules/reagents/chemistry/reagents/drugs.dm @@ -790,7 +790,7 @@ M.emote(pick("laugh")) if(60 to 69) M.adjust_bodytemperature(rand(1, 5)) - M.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + M.vomit() update_flags |= M.adjustBrainLoss(rand(1, 5)) if(70 to 74) to_chat(M, "You are literally bursting with laughter") diff --git a/code/modules/reagents/chemistry/reagents/food.dm b/code/modules/reagents/chemistry/reagents/food.dm index 929d2d362fe..5af02464a3a 100644 --- a/code/modules/reagents/chemistry/reagents/food.dm +++ b/code/modules/reagents/chemistry/reagents/food.dm @@ -138,7 +138,7 @@ if(prob(3)) if(ishuman(M)) var/mob/living/carbon/human/H = M - H.vomit(VOMIT_TOXIN, VOMIT_NUTRITION_LOSS) + H.vomit() return ..() | update_flags diff --git a/code/modules/reagents/chemistry/reagents/medicine.dm b/code/modules/reagents/chemistry/reagents/medicine.dm index e3b9694cf56..045a8053fcd 100644 --- a/code/modules/reagents/chemistry/reagents/medicine.dm +++ b/code/modules/reagents/chemistry/reagents/medicine.dm @@ -1051,20 +1051,20 @@ var/update_flags = overdose_info[REAGENT_OVERDOSE_FLAGS] if(severity == 1) if(effect <= 2) - M.vomit(VOMIT_BLOOD, stun = 0 SECONDS) + M.vomit(0, VOMIT_BLOOD, 0 SECONDS) M.blood_volume = max(M.blood_volume - rand(5, 10), 0) else if(effect <= 4) - M.vomit(VOMIT_BLOOD, stun = 0 SECONDS) + M.vomit(0, VOMIT_BLOOD, 0 SECONDS) M.blood_volume = max(M.blood_volume - rand(1, 2), 0) else if(severity == 2) if(effect <= 2) M.visible_message("[M] is bleeding from [M.p_their()] very pores!") M.bleed(rand(10, 20)) else if(effect <= 4) - M.vomit(VOMIT_BLOOD, stun = 0 SECONDS) + M.vomit(0, VOMIT_BLOOD, 0 SECONDS) M.blood_volume = max(M.blood_volume - rand(5, 10), 0) else if(effect <= 8) - M.vomit(VOMIT_BLOOD, stun = 0 SECONDS) + M.vomit(0, VOMIT_BLOOD, 0 SECONDS) M.blood_volume = max(M.blood_volume - rand(1, 2), 0) return list(effect, update_flags) diff --git a/code/modules/reagents/chemistry/reagents/water.dm b/code/modules/reagents/chemistry/reagents/water.dm index f862fd369bb..37c54e46037 100644 --- a/code/modules/reagents/chemistry/reagents/water.dm +++ b/code/modules/reagents/chemistry/reagents/water.dm @@ -344,12 +344,12 @@ GLOBAL_LIST_INIT(diseases_carrier_reagents, list( vamp.bloodusable = max(vamp.bloodusable - 3,0) var/vomit_stun = (vamp.nullification == OLD_NULLIFICATION)? 8 SECONDS : FALSE if(vamp.bloodusable) - V.vomit(VOMIT_BLOOD, stun = vomit_stun) + V.vomit(0, VOMIT_BLOOD, vomit_stun) if(!vomit_stun) V.adjustBruteLoss(3) else holder.remove_reagent(id, volume) - V.vomit(stun = vomit_stun) + V.vomit(0, stun = vomit_stun) return else if(!vamp.bloodtotal && vamp.nullification == NEW_NULLIFICATION) diff --git a/code/modules/surgery/organs/blood.dm b/code/modules/surgery/organs/blood.dm index 903e3430efa..bc7b2659c91 100644 --- a/code/modules/surgery/organs/blood.dm +++ b/code/modules/surgery/organs/blood.dm @@ -119,7 +119,7 @@ // +2.5% chance per internal bleeding site that we'll cough up blood on a given tick. // Must be bleeding internally in more than one place to have a chance at this. if(amt >= 1 && prob(5 * amt)) - vomit(VOMIT_BLOOD, 10) + vomit(mode = VOMIT_BLOOD) /mob/living/carbon/human/bleed_internal(amt) diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index e04cba3c323..e82c771914b 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -231,7 +231,7 @@ GLOBAL_DATUM_INIT(multispin_words, /regex, regex("like a record baby")) //VOMIT else if((findtext(message, GLOB.vomit_words))) for(var/mob/living/carbon/C in listeners) - C.vomit(VOMIT_TOXIN, 10 * power_multiplier) + C.vomit(10 * power_multiplier) next_command = world.time + cooldown_stun //SILENCE