Skip to content

Commit

Permalink
fix: chugging (ParadiseSS13#23952)
Browse files Browse the repository at this point in the history
* fix: chugging

* implement suggestions
  • Loading branch information
awkwardsocialist authored Jan 31, 2024
1 parent 257692d commit fd7cb2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion code/modules/food_and_drinks/drinks/drinks_base.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"<span class='notice'>You hear what sounds like gulping.</span>")
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("<span class='notice'>[chugger] [pick("finishes","downs","polishes off","slams")] the entire [src], what a [pick("savage","monster","champ","beast")]!</span>",
Expand Down
24 changes: 12 additions & 12 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd7cb2e

Please sign in to comment.