Allows shaking of salt, pepper and space spices w/ sound (#8623)

This commit is contained in:
HouseOfSynth
2020-04-11 13:49:33 +01:00
committed by GitHub
parent e5baab339d
commit 2cddf9a16d
3 changed files with 62 additions and 1 deletions
@@ -14,6 +14,16 @@
possible_transfer_amounts = list(1,5,10)
center_of_mass = list("x"=16, "y"=6)
volume = 50
var/next_shake
/obj/item/reagent_containers/food/condiment/proc/shake(var/mob/user)
if(world.time >= next_shake)
if(reagents.total_volume > 0)
user.visible_message(pick(SPAN_NOTICE("[user] shakes \the [src]."), SPAN_NOTICE("[user] gives \the [src] a good shake.")), SPAN_NOTICE("You give \the [src] a good shake."))
playsound(get_turf(src),'sound/items/condiment_shaking.ogg', rand(10,50), 1)
else
user.visible_message(pick(SPAN_NOTICE("[user] shakes \the [src], but it makes no noise."), SPAN_NOTICE("[user] gives \the [src] a good shake, but it makes no noise.")), SPAN_NOTICE("You give \the [src] a good shake, but it makes no noise."))
next_shake = world.time + 30
/obj/item/reagent_containers/food/condiment/feed_sound(var/mob/user)
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
@@ -123,6 +133,9 @@
amount_per_transfer_from_this = 1
volume = 20
/obj/item/reagent_containers/food/condiment/saltshaker/attack_self(mob/user)
shake(user)
/obj/item/reagent_containers/food/condiment/saltshaker/Initialize()
. = ..()
reagents.add_reagent("sodiumchloride", 20)
@@ -136,6 +149,9 @@
amount_per_transfer_from_this = 1
volume = 20
/obj/item/reagent_containers/food/condiment/peppermill/attack_self(mob/user)
shake(user)
/obj/item/reagent_containers/food/condiment/peppermill/Initialize()
. = ..()
reagents.add_reagent("blackpepper", 20)
@@ -163,6 +179,9 @@
amount_per_transfer_from_this = 1
volume = 40
/obj/item/reagent_containers/food/condiment/spacespice/attack_self(mob/user)
shake(user)
/obj/item/reagent_containers/food/condiment/spacespice/Initialize()
. = ..()
reagents.add_reagent("spacespice", 40)
@@ -184,4 +203,4 @@
/obj/item/reagent_containers/food/condiment/garlicsauce/Initialize()
..()
reagents.add_reagent("garlicsauce", 50)
reagents.add_reagent("garlicsauce", 50)