From fd7cb2e55cbad6260d3814aa1b8e194d140b7f6b Mon Sep 17 00:00:00 2001 From: awkwardsocialist <88992598+awkwardsocialist@users.noreply.github.com> Date: Thu, 1 Feb 2024 02:49:25 +0300 Subject: [PATCH] fix: chugging (#23952) * fix: chugging * implement suggestions --- .../food_and_drinks/drinks/drinks_base.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/code/modules/food_and_drinks/drinks/drinks_base.dm b/code/modules/food_and_drinks/drinks/drinks_base.dm index 3ad002ed0ee5..fc9e0a75aa26 100644 --- a/code/modules/food_and_drinks/drinks/drinks_base.dm +++ b/code/modules/food_and_drinks/drinks/drinks_base.dm @@ -45,7 +45,7 @@ "You hear what sounds like gulping.") chugging = TRUE while(do_after_once(chugger, 4 SECONDS, TRUE, chugger, null, "You stop chugging [src].")) - chugger.eat(src, chugger, 25) //Half of a glass, quarter of a bottle. + chugger.drink(src, chugger, 25) //Half of a glass, quarter of a bottle. if(!reagents.total_volume) //Finish in style. chugger.emote("gasp") chugger.visible_message("[chugger] [pick("finishes","downs","polishes off","slams")] the entire [src], what a [pick("savage","monster","champ","beast")]!", diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index be73a9374f8d..720ff9514d35 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1182,22 +1182,22 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven SSticker.score.score_food_eaten++ return TRUE -/mob/living/carbon/proc/drink(obj/item/reagent_containers/drinks/to_eat, mob/user) +/mob/living/carbon/proc/drink(obj/item/reagent_containers/drinks/to_drink, mob/user, drinksize_override) if(user == src) - if(!selfDrink(to_eat)) + if(!selfDrink(to_drink)) return FALSE - else if(!forceFed(to_eat, user, nutrition)) + else if(!forceFed(to_drink, user, nutrition)) return FALSE - if(to_eat.consume_sound) - playsound(loc, to_eat.consume_sound, rand(10, 50), TRUE) - if(to_eat.reagents.total_volume) - taste(to_eat.reagents) - var/fraction = min(1 / to_eat.reagents.total_volume, 1) - var/drink_size = to_eat.amount_per_transfer_from_this > 5 ? 5 : to_eat.amount_per_transfer_from_this - if(fraction) - to_eat.reagents.reaction(src, REAGENT_INGEST, fraction) - to_eat.reagents.trans_to(src, drink_size) + if(to_drink.consume_sound) + playsound(loc, to_drink.consume_sound, rand(10, 50), TRUE) + if(to_drink.reagents.total_volume) + taste(to_drink.reagents) + var/drink_size = min(to_drink.amount_per_transfer_from_this, 5) + if(drinksize_override) + drink_size = drinksize_override + to_drink.reagents.reaction(src, REAGENT_INGEST) + to_drink.reagents.trans_to(src, drink_size) SSticker.score.score_food_eaten++ return TRUE