Adds toasting (#12798)

This commit is contained in:
Casper3667
2021-12-01 18:45:04 +01:00
committed by GitHub
parent 01e4168445
commit 14cd85881e
5 changed files with 32 additions and 0 deletions
@@ -33,6 +33,32 @@
desc = "Your standard drinking glass."
center_of_mass = list("x"=16, "y"=10)
/obj/item/reagent_containers/food/drinks/drinkingglass/afterattack(var/atom/target, var/mob/user, var/proximity, var/params)
if(ishuman(target) && user.a_intent == I_HELP && (user.zone_sel.selecting == BP_L_HAND || user.zone_sel.selecting == BP_R_HAND))
if(!user.Adjacent(target))
return
var/mob/living/carbon/human/H = target
var/obj/item/reagent_containers/food/drinks/drinkingglass/glass = H.get_type_in_hands(/obj/item/reagent_containers/food/drinks/drinkingglass)
if(!use_check(H))
to_chat(user, SPAN_WARNING("[H] is in no condition to perform a toast!"))
return
else if(!glass)
to_chat(user, SPAN_WARNING("[H] needs to be holding a glass to perform a toast."))
return
else
user.visible_message("<b>[user]</b> holds \the [src] out for a toast with [H].")
if(alert(H,"[user] wants to do a toast with you. Will you accept it?",,"Yes","No") == "No")
H.visible_message("<b>[H]</b> pushes [user]'s hand away.")
return
if(!user.Adjacent(H))
to_chat(user, SPAN_WARNING("You need to remain next to [H]!"))
to_chat(H, SPAN_WARNING("You need to remain next to [user]!"))
return
user.visible_message("<b>[user]</b> clinks \the [src] with [H]'s [glass.name].")
playsound(user.loc, pick('sound/items/glass_clink_1.ogg', 'sound/items/glass_clink_2.ogg', 'sound/items/glass_clink_3.ogg'), 50, 0, vary = FALSE)
return
..()
// for /obj/machinery/vending/sovietsoda
/obj/item/reagent_containers/food/drinks/drinkingglass/soda
reagents_to_add = list(/decl/reagent/drink/sodawater = 50)
+6
View File
@@ -0,0 +1,6 @@
author: TheGreyWolf
delete-after: True
changes:
- rscadd: "You can now do toasts! Hold a glass (including normal drinking ones, most special bar glasses and coffee cups), target the hands and click on another person also hoding a glass while on help intent."
Binary file not shown.
Binary file not shown.
Binary file not shown.