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)
@@ -0,0 +1,42 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: House_Of_Synth
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- tweak: "Salt shakers, pepper mills and space spices can now be shaken but will emit no noise when empty."
- soundadd: "Added a shaking sound for when salt shakers, pepper mills and space spices are shaken."
Binary file not shown.