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
This commit is contained in:
MrMelbert
2020-11-26 14:41:26 +00:00
committed by GitHub
parent aa992c119b
commit c8536907fc
5 changed files with 91 additions and 112 deletions
@@ -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, "<span class='warning'>You swallow something small. Was that in \the [source_item]?</span>")
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, "<span class='warning'>You swallow something small. [source_item ? "Was that in [source_item]?" : ""]</span>")
reagents?.trans_to(victim, reagents.total_volume, transfered_by = user, methods = INGEST)
qdel(src)
return discover_after
@@ -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, "<span class='boldwarning'>There's a syringe in \the [source_item]!!</span>")
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, "<span class='boldwarning'>There's a [src] in [source_item]!!</span>")
else
to_chat(victim, "<span class='boldwarning'>[src] injects you!</span>")
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