From 4d51fdc72a5ae38227081053cdae672d08212bc2 Mon Sep 17 00:00:00 2001 From: "Wowzewow (Wezzy)" <42310821+alsoandanswer@users.noreply.github.com> Date: Wed, 11 Mar 2020 14:00:27 +0800 Subject: [PATCH] you can shake drink shakers to make a shaking sound to simulate shaking the drink (#8399) --- code/defines/obj/weapon.dm | 8 ++-- code/modules/paperwork/paper.dm | 11 +++-- .../reagent_containers/food/drinks.dm | 8 ++++ html/changelogs/wezzy_shakable_shaker.yml | 41 +++++++++++++++++++ 4 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 html/changelogs/wezzy_shakable_shaker.yml diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 43c4082d73a..7be2f5147eb 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -35,15 +35,13 @@ throw_speed = 3 throw_range = 15 attack_verb = list("HONKED") - var/spam_flag = 0 + var/last_honk = 0 /obj/item/bikehorn/attack_self(mob/user as mob) - if (spam_flag == 0) - spam_flag = 1 + if(last_honk <= world.time - 20) //Spam limiter. + last_honk = world.time playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1) src.add_fingerprint(user) - spawn(20) - spam_flag = 0 return /obj/item/cane diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 2dfc6953b1a..e736371787d 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -29,7 +29,7 @@ var/list/offset_x[0] //offsets stored for later var/list/offset_y[0] //usage by the photocopier var/rigged = 0 - var/spam_flag = 0 + var/last_honk = 0 var/old_name // The name of the paper before it was folded into a plane. var/const/deffont = "Verdana" @@ -161,11 +161,10 @@ user.examinate(src) if(rigged && (Holiday == "April Fool's Day")) - if(spam_flag == 0) - spam_flag = 1 - playsound(loc, 'sound/items/bikehorn.ogg', 50, 1) - spawn(20) - spam_flag = 0 + if(last_honk <= world.time - 20) //Spam limiter. + last_honk = world.time + playsound(src.loc, 'sound/items/bikehorn.ogg', 50, 1) + src.add_fingerprint(user) /obj/item/paper/attack_ai(var/mob/living/silicon/ai/user) show_content(user) diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm index aaae8663948..c0258fd9af8 100644 --- a/code/modules/reagents/reagent_containers/food/drinks.dm +++ b/code/modules/reagents/reagent_containers/food/drinks.dm @@ -300,6 +300,14 @@ amount_per_transfer_from_this = 10 volume = 120 center_of_mass = list("x"=16, "y"=8) + var/last_shake = 0 + +/obj/item/reagent_containers/food/drinks/shaker/attack_self(mob/user) + if(last_shake <= world.time - 10) //Spam limiter. + last_shake = world.time + playsound(src.loc, 'sound/items/soda_shaking.ogg', 50, 1) + src.add_fingerprint(user) + return /obj/item/reagent_containers/food/drinks/teapot name = "teapot" diff --git a/html/changelogs/wezzy_shakable_shaker.yml b/html/changelogs/wezzy_shakable_shaker.yml new file mode 100644 index 00000000000..30039d443a8 --- /dev/null +++ b/html/changelogs/wezzy_shakable_shaker.yml @@ -0,0 +1,41 @@ +################################ +# 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: Wowzewow (Wezzy) + +# 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: + - rscadd: "Adds the ability to shake the drinks shaker. (doesn't actually do anything, just sounds cool.)."