From c8536907fc9e551e32e2cd87a603ce01689f2fb0 Mon Sep 17 00:00:00 2001 From: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Date: Thu, 26 Nov 2020 08:41:26 -0600 Subject: [PATCH] Accidental Consumption post-food refactor cleanup (#55152) Renames a bunch of vars to be more descriptive Removes old references to snacks Updates some code slightly --- code/datums/materials/basemats.dm | 98 +++++++++---------- code/game/objects/items.dm | 70 ++++++------- .../projectiles/ammunition/_ammunition.dm | 13 +-- .../reagents/reagent_containers/pill.dm | 9 +- .../reagents/reagent_containers/syringes.dm | 13 ++- 5 files changed, 91 insertions(+), 112 deletions(-) diff --git a/code/datums/materials/basemats.dm b/code/datums/materials/basemats.dm index 2b0c4edeb4e..7e0e6cc8baa 100644 --- a/code/datums/materials/basemats.dm +++ b/code/datums/materials/basemats.dm @@ -7,8 +7,8 @@ sheet_type = /obj/item/stack/sheet/metal value_per_unit = 0.0025 -/datum/material/iron/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) +/datum/material/iron/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) return TRUE ///Breaks extremely easily but is transparent. @@ -25,8 +25,8 @@ beauty_modifier = 0.05 armor_modifiers = list(MELEE = 0.2, BULLET = 0.2, LASER = 0, ENERGY = 1, BOMB = 0, BIO = 0.2, RAD = 0.2, FIRE = 1, ACID = 0.2) -/datum/material/glass/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5, sharpness = TRUE) //cronch +/datum/material/glass/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5, sharpness = TRUE) //cronch return TRUE /* @@ -44,8 +44,8 @@ Unless you know what you're doing, only use the first three numbers. They're in value_per_unit = 0.025 beauty_modifier = 0.075 -/datum/material/silver/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) +/datum/material/silver/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) return TRUE ///Slight force increase @@ -60,8 +60,8 @@ Unless you know what you're doing, only use the first three numbers. They're in beauty_modifier = 0.15 armor_modifiers = list(MELEE = 1.1, BULLET = 1.1, LASER = 1.15, ENERGY = 1.15, BOMB = 1, BIO = 1, RAD = 1, FIRE = 0.7, ACID = 1.1) -/datum/material/gold/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) +/datum/material/gold/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) return TRUE ///Has no special properties @@ -76,8 +76,8 @@ Unless you know what you're doing, only use the first three numbers. They're in beauty_modifier = 0.3 armor_modifiers = list(MELEE = 1.3, BULLET = 1.3, LASER = 0.6, ENERGY = 1, BOMB = 1.2, BIO = 1, RAD = 1, FIRE = 1, ACID = 1) -/datum/material/diamond/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(15, BRUTE, BODY_ZONE_HEAD, wound_bonus = 7) +/datum/material/diamond/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(15, BRUTE, BODY_ZONE_HEAD, wound_bonus = 7) return TRUE ///Is slightly radioactive @@ -99,9 +99,9 @@ Unless you know what you're doing, only use the first three numbers. They're in . = ..() qdel(source.GetComponent(/datum/component/radioactive)) -/datum/material/uranium/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.reagents.add_reagent(/datum/reagent/uranium, rand(4, 6)) - S?.reagents?.add_reagent(/datum/reagent/uranium, S.reagents.total_volume*(2/5)) +/datum/material/uranium/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.reagents.add_reagent(/datum/reagent/uranium, rand(4, 6)) + source_item?.reagents?.add_reagent(/datum/reagent/uranium, source_item.reagents.total_volume*(2/5)) return TRUE ///Adds firestacks on hit (Still needs support to turn into gas on destruction) @@ -127,9 +127,9 @@ Unless you know what you're doing, only use the first three numbers. They're in source.RemoveElement(/datum/element/firestacker, amount=1) qdel(source.GetComponent(/datum/component/explodable)) -/datum/material/plasma/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.reagents.add_reagent(/datum/reagent/toxin/plasma, rand(6, 8)) - S?.reagents?.add_reagent(/datum/reagent/toxin/plasma, S.reagents.total_volume*(2/5)) +/datum/material/plasma/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.reagents.add_reagent(/datum/reagent/toxin/plasma, rand(6, 8)) + source_item?.reagents?.add_reagent(/datum/reagent/toxin/plasma, source_item.reagents.total_volume*(2/5)) return TRUE ///Can cause bluespace effects on use. (Teleportation) (Not yet implemented) @@ -143,9 +143,9 @@ Unless you know what you're doing, only use the first three numbers. They're in sheet_type = /obj/item/stack/sheet/bluespace_crystal value_per_unit = 0.15 -/datum/material/bluespace/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.reagents.add_reagent(/datum/reagent/bluespace, rand(5, 8)) - S?.reagents?.add_reagent(/datum/reagent/bluespace, S.reagents.total_volume*(2/5)) +/datum/material/bluespace/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.reagents.add_reagent(/datum/reagent/bluespace, rand(5, 8)) + source_item?.reagents?.add_reagent(/datum/reagent/bluespace, source_item.reagents.total_volume*(2/5)) return TRUE ///Honks and slips @@ -169,9 +169,9 @@ Unless you know what you're doing, only use the first three numbers. They're in qdel(source.GetComponent(/datum/component/slippery)) qdel(source.GetComponent(/datum/component/squeak)) -/datum/material/bananium/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.reagents.add_reagent(/datum/reagent/consumable/banana, rand(8, 12)) - S?.reagents?.add_reagent(/datum/reagent/consumable/banana, S.reagents.total_volume*(2/5)) +/datum/material/bananium/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.reagents.add_reagent(/datum/reagent/consumable/banana, rand(8, 12)) + source_item?.reagents?.add_reagent(/datum/reagent/consumable/banana, source_item.reagents.total_volume*(2/5)) return TRUE ///Mediocre force increase @@ -186,8 +186,8 @@ Unless you know what you're doing, only use the first three numbers. They're in beauty_modifier = 0.05 armor_modifiers = list(MELEE = 1.35, BULLET = 1.3, LASER = 1.3, ENERGY = 1.25, BOMB = 1.25, BIO = 1, RAD = 1, FIRE = 0.7, ACID = 1) -/datum/material/titanium/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(15, BRUTE, BODY_ZONE_HEAD, wound_bonus = 7) +/datum/material/titanium/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(15, BRUTE, BODY_ZONE_HEAD, wound_bonus = 7) return TRUE /datum/material/runite @@ -201,8 +201,8 @@ Unless you know what you're doing, only use the first three numbers. They're in beauty_modifier = 0.5 armor_modifiers = list(MELEE = 1.35, BULLET = 2, LASER = 0.5, ENERGY = 1.25, BOMB = 1.25, BIO = 1, RAD = 1, FIRE = 1.4, ACID = 1) //rune is weak against magic lasers but strong against bullets. This is the combat triangle. -/datum/material/runite/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(20, BRUTE, BODY_ZONE_HEAD, wound_bonus = 10) +/datum/material/runite/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(20, BRUTE, BODY_ZONE_HEAD, wound_bonus = 10) return TRUE ///Force decrease @@ -254,13 +254,11 @@ Unless you know what you're doing, only use the first three numbers. They're in var/obj/wooden = source wooden.resistance_flags &= ~FLAMMABLE -/datum/material/wood/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(5, BRUTE, BODY_ZONE_HEAD) +/datum/material/wood/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(5, BRUTE, BODY_ZONE_HEAD) + victim.reagents.add_reagent(/datum/reagent/cellulose, rand(8, 12)) + source_item?.reagents?.add_reagent(/datum/reagent/cellulose, source_item.reagents.total_volume*(2/5)) - var/obj/item/reagent_containers/food/snacks/food_S = S - if(istype(food_S) && food_S?.tastes?.len) - food_S.tastes += "wood chips and sawdust" - food_S.tastes["wood chips and sawdust"] = 3 return TRUE ///Stronk force increase @@ -275,8 +273,8 @@ Unless you know what you're doing, only use the first three numbers. They're in beauty_modifier = 0.4 armor_modifiers = list(MELEE = 1.5, BULLET = 1.5, LASER = 1.3, ENERGY = 1.3, BOMB = 1, BIO = 1, RAD = 1, FIRE = 2.5, ACID = 1) -/datum/material/adamantine/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(20, BRUTE, BODY_ZONE_HEAD, wound_bonus = 10) +/datum/material/adamantine/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(20, BRUTE, BODY_ZONE_HEAD, wound_bonus = 10) return TRUE ///RPG Magic. @@ -301,8 +299,8 @@ Unless you know what you're doing, only use the first three numbers. They're in if(istype(source, /obj/item)) qdel(source.GetComponent(/datum/component/fantasy)) -/datum/material/mythril/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(20, BRUTE, BODY_ZONE_HEAD, wound_bonus = 10) +/datum/material/mythril/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(20, BRUTE, BODY_ZONE_HEAD, wound_bonus = 10) return TRUE //formed when freon react with o2, emits a lot of plasma when heated @@ -324,13 +322,9 @@ Unless you know what you're doing, only use the first three numbers. They're in qdel(source.GetComponent(/datum/component/hot_ice, "plasma", amount*150, amount*20+300)) return ..() -/datum/material/hot_ice/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.reagents.add_reagent(/datum/reagent/toxin/plasma, rand(5, 6)) - S?.reagents?.add_reagent(/datum/reagent/toxin/plasma, S.reagents.total_volume*(3/5)) - var/obj/item/reagent_containers/food/snacks/food_S = S - if(istype(food_S) && food_S?.tastes?.len) - food_S.tastes += "salt" - food_S.tastes["salt"] = 3 +/datum/material/hot_ice/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.reagents.add_reagent(/datum/reagent/toxin/plasma, rand(5, 6)) + source_item?.reagents?.add_reagent(/datum/reagent/toxin/plasma, source_item.reagents.total_volume*(3/5)) return TRUE /datum/material/metalhydrogen @@ -345,8 +339,8 @@ Unless you know what you're doing, only use the first three numbers. They're in strength_modifier = 1.2 armor_modifiers = list(MELEE = 1.35, BULLET = 1.3, LASER = 1.3, ENERGY = 1.25, BOMB = 0.7, BIO = 1, RAD = 1, FIRE = 1.3, ACID = 1) -/datum/material/metalhydrogen/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.apply_damage(15, BRUTE, BODY_ZONE_HEAD, wound_bonus = 7) +/datum/material/metalhydrogen/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.apply_damage(15, BRUTE, BODY_ZONE_HEAD, wound_bonus = 7) return TRUE /datum/material/otherworld_crystal @@ -375,8 +369,8 @@ Unless you know what you're doing, only use the first three numbers. They're in turf_sound_override = FOOTSTEP_SAND texture_layer_icon_state = "sand" -/datum/material/sand/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.adjust_disgust(17) +/datum/material/sand/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.adjust_disgust(17) return TRUE //And now for our lavaland dwelling friends, sand, but in stone form! Truly revolutionary. @@ -404,8 +398,8 @@ Unless you know what you're doing, only use the first three numbers. They're in turf_sound_override = FOOTSTEP_SAND texture_layer_icon_state = "sand" -/datum/material/snow/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.reagents.add_reagent(/datum/reagent/water, rand(5, 10)) +/datum/material/snow/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.reagents.add_reagent(/datum/reagent/water, rand(5, 10)) return TRUE /datum/material/runedmetal @@ -419,9 +413,9 @@ Unless you know what you're doing, only use the first three numbers. They're in beauty_modifier = -0.15 texture_layer_icon_state = "runed" -/datum/material/runedmetal/on_accidental_mat_consumption(mob/living/carbon/M, obj/item/S) - M.reagents.add_reagent(/datum/reagent/fuel/unholywater, rand(8, 12)) - M.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) +/datum/material/runedmetal/on_accidental_mat_consumption(mob/living/carbon/victim, obj/item/source_item) + victim.reagents.add_reagent(/datum/reagent/fuel/unholywater, rand(8, 12)) + victim.apply_damage(10, BRUTE, BODY_ZONE_HEAD, wound_bonus = 5) return TRUE /datum/material/bronze diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 3c5f54ed365..fbe146c954b 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1004,7 +1004,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb return TRUE /// How many different types of mats will be counted in a bite? -#define MAX_BONUS_MATS_PER_BITE 2 +#define MAX_MATS_PER_BITE 2 /* * On accidental consumption: when you somehow end up eating an item accidentally (currently, this is used for when items are hidden in food like bread or cake) @@ -1023,43 +1023,35 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb * * source_item - the item that held the item being consumed - bread, cake, etc * * discover_after - if the item will be discovered after being chomped (FALSE will usually mean it was swallowed, TRUE will usually mean it was bitten into and discovered) */ -/obj/item/proc/on_accidental_consumption(mob/living/carbon/M, mob/living/carbon/user, obj/item/source_item, discover_after = TRUE) - /// If source_item is a snack, we can adjust its taste - var/obj/item/reagent_containers/food/snacks/S = source_item - if(!istype(S)) - S = null - +/obj/item/proc/on_accidental_consumption(mob/living/carbon/victim, mob/living/carbon/user, obj/item/source_item, discover_after = TRUE) if(get_sharpness() && force >= 5) //if we've got something sharp with a decent force (ie, not plastic) - INVOKE_ASYNC(M, /mob.proc/emote, "scream") - M.visible_message("[M] looks like [M.p_theyve()] just bit something they shouldn't have!", \ + INVOKE_ASYNC(victim, /mob.proc/emote, "scream") + victim.visible_message("[victim] looks like [victim.p_theyve()] just bit something they shouldn't have!", \ "OH GOD! Was that a crunch? That didn't feel good at all!!") - M.apply_damage(max(15, force), BRUTE, BODY_ZONE_HEAD, wound_bonus = 10, sharpness = TRUE) - M.losebreath += 2 - if(tryEmbed(M.get_bodypart(BODY_ZONE_CHEST), TRUE, TRUE)) //and if it embeds successfully in their chest, cause a lot of pain - M.apply_damage(max(25, force*1.5), BRUTE, BODY_ZONE_CHEST, wound_bonus = 7, sharpness = TRUE) - M.losebreath += 6 + victim.apply_damage(max(15, force), BRUTE, BODY_ZONE_HEAD, wound_bonus = 10, sharpness = TRUE) + victim.losebreath += 2 + if(tryEmbed(victim.get_bodypart(BODY_ZONE_CHEST), TRUE, TRUE)) //and if it embeds successfully in their chest, cause a lot of pain + victim.apply_damage(max(25, force*1.5), BRUTE, BODY_ZONE_CHEST, wound_bonus = 7, sharpness = TRUE) + victim.losebreath += 6 discover_after = FALSE if(QDELETED(src)) // in case trying to embed it caused its deletion (say, if it's DROPDEL) return - - if(S?.tastes?.len) //is that blood in my mouth? - S.tastes += "iron" - S.tastes["iron"] = 2 + source_item?.reagents?.add_reagent(/datum/reagent/blood, 2) else if(custom_materials?.len) //if we've got materials, lets see whats in it - /// How many 'bonus' mats have we found? You can only be affected by two 'bonus' material datums by default + /// How many mats have we found? You can only be affected by two material datums by default var/found_mats = 0 /// How much of each material is in it? Used to determine if the glass should break var/total_material_amount = 0 for(var/mats in custom_materials) total_material_amount += custom_materials[mats] - if(found_mats >= MAX_BONUS_MATS_PER_BITE) + if(found_mats >= MAX_MATS_PER_BITE) continue //continue instead of break so we can finish adding up all the mats to the total - var/datum/material/FM = mats - if(FM.on_accidental_mat_consumption(M, S)) + var/datum/material/discovered_mat = mats + if(discovered_mat.on_accidental_mat_consumption(victim, source_item)) found_mats++ //if there's glass in it and the glass is more than 60% of the item, then we can shatter it @@ -1069,38 +1061,38 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb var/obj/item/shard/broken_glass = new /obj/item/shard(loc) broken_glass.name = "broken [name]" broken_glass.desc = "This used to be \a [name], but it sure isn't anymore." - playsound(M, "shatter", 25, TRUE) + playsound(victim, "shatter", 25, TRUE) qdel(src) - if(QDELETED(S)) - broken_glass.on_accidental_consumption(M, user) + if(QDELETED(source_item)) + broken_glass.on_accidental_consumption(victim, user) else //33% chance to just "crack" it (play a sound) and leave it in the bread - playsound(M, "shatter", 15, TRUE) + playsound(victim, "shatter", 15, TRUE) discover_after = FALSE - M.adjust_disgust(33) - M.visible_message("[M] looks like [M.p_theyve()] just bitten into something hard.", \ + victim.adjust_disgust(33) + victim.visible_message("[victim] looks like [victim.p_theyve()] just bitten into something hard.", \ "Eugh! Did I just bite into something?") else if(w_class == WEIGHT_CLASS_TINY) //small items like soap or toys that don't have mat datums - /// M's chest (for cavity implanting the item) - var/obj/item/bodypart/chest/CV = M.get_bodypart(BODY_ZONE_CHEST) - if(CV.cavity_item) - M.vomit(5, FALSE, FALSE, distance = 0) + /// 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) forceMove(drop_location()) - to_chat(M, "You vomit up a [name]! [source_item? "Was that in \the [source_item]?" : ""]") + to_chat(victim, "You vomit up a [name]! [source_item? "Was that in \the [source_item]?" : ""]") else - M.transferItemToLoc(src, M, TRUE) - M.losebreath += 2 - CV.cavity_item = src - to_chat(M, "You swallow hard. [source_item? "Something small was in \the [source_item]..." : ""]") + victim.transferItemToLoc(src, victim, TRUE) + victim.losebreath += 2 + victim_cavity.cavity_item = src + to_chat(victim, "You swallow hard. [source_item? "Something small was in \the [source_item]..." : ""]") discover_after = FALSE else - to_chat(M, "[source_item? "Something strange was in the \the [source_item]..." : "I just bit something strange..."] ") + to_chat(victim, "[source_item? "Something strange was in the \the [source_item]..." : "I just bit something strange..."] ") return discover_after -#undef MAX_BONUS_MATS_PER_BITE +#undef MAX_MATS_PER_BITE // Update icons if this is being carried by a mob /obj/item/wash(clean_types) diff --git a/code/modules/projectiles/ammunition/_ammunition.dm b/code/modules/projectiles/ammunition/_ammunition.dm index 8077d7ec42b..12a35d28fa4 100644 --- a/code/modules/projectiles/ammunition/_ammunition.dm +++ b/code/modules/projectiles/ammunition/_ammunition.dm @@ -50,19 +50,12 @@ /* * On accidental consumption, 'spend' the ammo, and add in some gunpowder */ -/obj/item/ammo_casing/on_accidental_consumption(mob/living/carbon/M, mob/living/carbon/user, obj/item/source_item, discover_after = TRUE) +/obj/item/ammo_casing/on_accidental_consumption(mob/living/carbon/victim, mob/living/carbon/user, obj/item/source_item, discover_after = TRUE) if(BB) BB = null update_icon() - var/obj/item/reagent_containers/food/snacks/S = source_item - if(istype(S)) - if(S.reagents) - S.reagents.add_reagent(/datum/reagent/gunpowder, S.reagents.total_volume*(2/3)) - if(S.tastes?.len) - S.tastes += "salt" - S.tastes["salt"] = 3 - - M.reagents?.add_reagent(/datum/reagent/gunpowder, 3) + victim.reagents?.add_reagent(/datum/reagent/gunpowder, 3) + source_item?.reagents?.add_reagent(/datum/reagent/gunpowder, source_item.reagents.total_volume*(2/3)) return ..() diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 403a9939b2a..19a84294deb 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -77,12 +77,9 @@ /* * On accidental consumption, consume the pill */ -/obj/item/reagent_containers/pill/on_accidental_consumption(mob/living/carbon/M, mob/living/carbon/user, obj/item/source_item, discover_after = FALSE) - to_chat(M, "You swallow something small. Was that in \the [source_item]?") - if(reagents?.total_volume) - reagents.trans_to(M, reagents.total_volume, transfered_by = user, methods = INGEST) - - source_item?.contents -= src +/obj/item/reagent_containers/pill/on_accidental_consumption(mob/living/carbon/victim, mob/living/carbon/user, obj/item/source_item, discover_after = FALSE) + to_chat(victim, "You swallow something small. [source_item ? "Was that in [source_item]?" : ""]") + reagents?.trans_to(victim, reagents.total_volume, transfered_by = user, methods = INGEST) qdel(src) return discover_after diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index 08a6fc6c422..3cface04486 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -160,11 +160,14 @@ /* * On accidental consumption, inject the eater with 2/3rd of the syringe and reveal it */ -/obj/item/reagent_containers/syringe/on_accidental_consumption(mob/living/carbon/M, mob/living/carbon/user, obj/item/source_item, discover_after = TRUE) - to_chat(M, "There's a syringe in \the [source_item]!!") - M.apply_damage(5, BRUTE, BODY_ZONE_HEAD) - if(reagents?.total_volume) - reagents.trans_to(M, round(reagents.total_volume*(2/3)), transfered_by = user, methods = INJECT) +/obj/item/reagent_containers/syringe/on_accidental_consumption(mob/living/carbon/victim, mob/living/carbon/user, obj/item/source_item, discover_after = TRUE) + if(source_item) + to_chat(victim, "There's a [src] in [source_item]!!") + else + to_chat(victim, "[src] injects you!") + + victim.apply_damage(5, BRUTE, BODY_ZONE_HEAD) + reagents?.trans_to(victim, round(reagents.total_volume*(2/3)), transfered_by = user, methods = INJECT) return discover_after