Files
Bubberstation/code/game/objects/items/taster.dm
Mothblocks f54dcda1c0 afterattack now returns a flag if it's reasonable to suspect the user intends to act on an item (#72320)
Necessary for #72292 to work effectively, and probably not very useful
out of that context. Split out of its own PR because this is long and
boring.

I want to make sure that we're catching actual mistakes there, and not
just experiencing side effects of how shitty the attack chain is.
2023-01-04 21:10:41 -08:00

25 lines
797 B
Plaintext

/obj/item/taster
name = "taster"
desc = "Tastes things, so you don't have to!"
icon = 'icons/obj/medical/organs/organs.dmi'
icon_state = "tongue"
w_class = WEIGHT_CLASS_TINY
var/taste_sensitivity = 15
/obj/item/taster/afterattack(atom/O, mob/user, proximity)
. = ..()
if(!proximity)
return
. |= AFTERATTACK_PROCESSED_ITEM
if(!O.reagents)
to_chat(user, span_notice("[src] cannot taste [O], since [O.p_they()] [O.p_have()] have no reagents."))
else if(O.reagents.total_volume == 0)
to_chat(user, "<span class='notice'>[src] cannot taste [O], since [O.p_they()] [O.p_are()] empty.</span>")
else
var/message = O.reagents.generate_taste_message(user, taste_sensitivity)
to_chat(user, "<span class='notice'>[src] tastes <span class='italics'>[message]</span> in [O].</span>")