adds condition to prevent chugging of unopened containers

This commit is contained in:
Birdtalon
2018-02-08 14:48:33 +00:00
parent 62609fd37c
commit 8623fbec73
@@ -43,6 +43,9 @@
/obj/item/weapon/reagent_containers/food/drinks/MouseDrop(atom/over_object) //CHUG! CHUG! CHUG!
var/mob/living/carbon/chugger = over_object
if (!(flags & OPENCONTAINER))
to_chat(chugger, "<span class='notice'>You need to open [src] first!</span>")
return
if(istype(chugger) && loc == chugger && src == chugger.get_active_hand() && reagents.total_volume)
chugger.visible_message("<span class='notice'>[chugger] raises the [src] to their mouth and starts [pick("chugging","gulping")] it down like [pick("a savage","a mad beast","it's going out of style","there's no tomorrow")]!</span>", "<span class='notice'>You start chugging \the [src].</span>", "<span class='notice'>You hear what sounds like gulping.</span>")
while(do_mob(chugger, chugger, 40)) //Between the default time for do_mob and the time it takes for a vampire to suck blood.