Skip to content

Commit

Permalink
self gulp size
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixRuin committed Feb 11, 2025
1 parent f131368 commit 78e34c5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/modules/food_and_drinks/drinks/drinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
reagent_flags = OPENCONTAINER
reagent_value = DEFAULT_REAGENTS_VALUE
var/gulp_size = 5
var/gulp_size = 5 //Максимум выпиваемый из-за количества реагентов
possible_transfer_amounts = list(5,10,15,20,25,30,50)
volume = 50
resistance_flags = NONE
Expand All @@ -33,6 +33,9 @@
return

var/gulp_amount = gulp_size
if(user == M && ishuman(M))
var/mob/living/carbon/human/H = M
gulp_amount = H.self_gulp_size
if(M == user)
if(user.zone_selected == BODY_ZONE_PRECISE_MOUTH && !beingChugged)
beingChugged = TRUE
Expand Down
3 changes: 3 additions & 0 deletions code/modules/reagents/reagent_containers/glass.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

var/gulp_amount = gulp_size
var/self_fed = M == user
if(self_fed && ishuman(M))
var/mob/living/carbon/human/H = M
gulp_amount = H.self_gulp_size
if(istype(M))
if(user.a_intent == INTENT_HARM)
M.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [M]!</span>", \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/mob/living/carbon/human
var/self_gulp_size = 5 //количество выпиваемого за раз при самоличном потреблении

/mob/living/carbon/human/verb/self_gulp_size()
set name = "Set Drink Amount"
set category = "IC"
set waitfor = FALSE
var/N = input("Amount self drink per gulp (1-10):","Self Drinking Control") as null|num
if(N)
N = floor(N)
N = clamp(N, 1, 10)
self_gulp_size = N
to_chat(usr, "<span class='notice'>Amount self drink per gulp is now [self_gulp_size] units.</span>")

/obj/item/reagent_containers/food/drinks/verb/self_gulp_size()
set src in view(1)
set category = "Object"
set name = "Set Drink Amount"

if(ishuman(usr))
var/mob/living/carbon/human/H = usr
H.self_gulp_size()

/obj/item/reagent_containers/food/drinks/CtrlShiftClick(mob/user)
..()
if(Adjacent(user))
self_gulp_size()

/obj/item/reagent_containers/food/drinks/examine(mob/user)
. = ..()
. += "<span class='notice'>Ctrl-Shift-click to set own gulp size amount.</span>"
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3753,6 +3753,7 @@
#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tcomms_and_misc.dm"
#include "code\modules\research\designs\autolathe_desings\autolathe_designs_tools.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_all_misc.dm"
#include "modular_bluemoon\code\modules\mob\living\carbon\human\self_gulp_size.dm"
#include "modular_bluemoon\code\modules\research\designs\machine_desings\machine_designs_all_misc.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_cargo.dm"
#include "code\modules\research\designs\comp_board_designs\comp_board_designs_engi.dm"
Expand Down

0 comments on commit 78e34c5

Please sign in to comment.